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/Annotation.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Annotation.PowerShell.cs new file mode 100644 index 000000000000..4f429f03e8da --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Annotation.PowerShell.cs @@ -0,0 +1,204 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + + /// Annotation associated with an application insights resource. + [System.ComponentModel.TypeConverter(typeof(AnnotationTypeConverter))] + public partial class Annotation + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal Annotation(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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.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.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.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.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.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 . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal Annotation(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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.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.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.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.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.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 . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + 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 . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IAnnotation DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new Annotation(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IAnnotation FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } + } + /// Annotation associated with an application insights resource. + [System.ComponentModel.TypeConverter(typeof(AnnotationTypeConverter))] + public partial interface IAnnotation + + { + + } +} \ No newline at end of file diff --git a/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/AnnotationError.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/AnnotationError.PowerShell.cs new file mode 100644 index 000000000000..4186d0727c49 --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/AnnotationError.PowerShell.cs @@ -0,0 +1,196 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + + /// Error associated with trying to create annotation with Id that already exist + [System.ComponentModel.TypeConverter(typeof(AnnotationErrorTypeConverter))] + public partial class AnnotationError + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal AnnotationError(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Innererror")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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.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.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.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.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 . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal AnnotationError(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Innererror")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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.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.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.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.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 . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + 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 . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IAnnotationError DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new AnnotationError(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IAnnotationError FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } + } + /// Error associated with trying to create annotation with Id that already exist + [System.ComponentModel.TypeConverter(typeof(AnnotationErrorTypeConverter))] + public partial interface IAnnotationError + + { + + } +} \ No newline at end of file diff --git a/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/AnnotationsListResult.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/AnnotationsListResult.cs new file mode 100644 index 000000000000..254885533168 --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/AnnotationsListResult.cs @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + + /// Annotations list result. + public partial class AnnotationsListResult : + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IAnnotationsListResult, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IAnnotationsListResultInternal + { + + /// Internal Acessors for Value + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IAnnotationsListResultInternal.Value { get => this._value; set { {_value = value;} } } + + /// Backing field for property. + private System.Collections.Generic.List _value; + + /// An array of annotations. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public System.Collections.Generic.List Value { get => this._value; } + + /// Creates an new instance. + public AnnotationsListResult() + { + + } + } + /// Annotations list result. + public partial interface IAnnotationsListResult : + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IJsonSerializable + { + /// An array of annotations. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"An array of annotations.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IAnnotation) })] + System.Collections.Generic.List Value { get; } + + } + /// Annotations list result. + internal partial interface IAnnotationsListResultInternal + + { + /// An array of annotations. + 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/Api10/ProxyResource.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api10/ProxyResource.cs deleted file mode 100644 index 27c620b1cb3e..000000000000 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api10/ProxyResource.cs +++ /dev/null @@ -1,80 +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.Api10 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; - - /// - /// The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location - /// - public partial class ProxyResource : - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IProxyResource, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IProxyResourceInternal, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IValidates - { - /// - /// Backing field for Inherited model - /// - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.Resource(); - - /// - /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - /// - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inherited)] - public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResourceInternal)__resource).Id; } - - /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResourceInternal)__resource).Id = value; } - - /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResourceInternal)__resource).Name = value; } - - /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResourceInternal)__resource).Type = value; } - - /// The name of the resource - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inherited)] - public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResourceInternal)__resource).Name; } - - /// - /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - /// - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inherited)] - public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResourceInternal)__resource).Type; } - - /// Creates an new instance. - public ProxyResource() - { - - } - - /// Validates that this object meets the validation criteria. - /// an instance that will receive validation - /// events. - /// - /// A that will be complete when validation is completed. - /// - public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener) - { - await eventListener.AssertNotNull(nameof(__resource), __resource); - await eventListener.AssertObjectIsValid(nameof(__resource), __resource); - } - } - /// The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location - public partial interface IProxyResource : - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResource - { - - } - /// The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location - internal partial interface IProxyResourceInternal : - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResourceInternal - { - - } -} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api10/Resource.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api10/Resource.PowerShell.cs deleted file mode 100644 index b23aeb837ff0..000000000000 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api10/Resource.PowerShell.cs +++ /dev/null @@ -1,182 +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.Api10 -{ - using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; - - /// - /// Common fields that are returned in the response for all Azure Resource Manager resources - /// - [System.ComponentModel.TypeConverter(typeof(ResourceTypeConverter))] - public partial class Resource - { - - /// - /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the - /// object before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Collections.IDictionary content that should be used. - - partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); - - /// - /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object - /// before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Management.Automation.PSObject content that should be used. - - partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); - - /// - /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Collections.IDictionary content that should be used. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); - - /// - /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Management.Automation.PSObject content that should be used. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); - - /// - /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior - /// - /// /// instance serialized to a string, normally it is a Json - /// /// set returnNow to true if you provide a customized OverrideToString function - - partial void OverrideToString(ref string stringResult, ref bool returnNow); - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResource DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new Resource(content); - } - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new Resource(content); - } - - /// - /// Creates a new instance of , deserializing the content from a json string. - /// - /// a string containing a JSON serialized instance of this model. - /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal Resource(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResourceInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResourceInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResourceInternal)this).Type, global::System.Convert.ToString); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal Resource(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResourceInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResourceInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResourceInternal)this).Type, global::System.Convert.ToString); - } - AfterDeserializePSObject(content); - } - - /// Serializes this instance to a json string. - - /// a containing this model serialized to JSON text. - public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeAll)?.ToString(); - - public override string ToString() - { - var returnNow = false; - var result = global::System.String.Empty; - OverrideToString(ref result, ref returnNow); - if (returnNow) - { - return result; - } - return ToJsonString(); - } - } - /// Common fields that are returned in the response for all Azure Resource Manager resources - [System.ComponentModel.TypeConverter(typeof(ResourceTypeConverter))] - public partial interface IResource - - { - - } -} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api10/Resource.TypeConverter.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api10/Resource.TypeConverter.cs deleted file mode 100644 index 117e750421ac..000000000000 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api10/Resource.TypeConverter.cs +++ /dev/null @@ -1,146 +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.Api10 -{ - using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; - - /// - /// A PowerShell PSTypeConverter to support converting to an instance of - /// - public partial class ResourceTypeConverter : global::System.Management.Automation.PSTypeConverter - { - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false. - /// - public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); - - /// - /// Determines if the converter can convert the parameter to the type. - /// - /// the instance to check if it can be converted to the type. - /// - /// true if the instance could be converted to a type, otherwise false - /// - public static bool CanConvertFrom(dynamic sourceValue) - { - if (null == sourceValue) - { - return true; - } - global::System.Type type = sourceValue.GetType(); - if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) - { - // we say yest to PSObjects - return true; - } - if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) - { - // we say yest to Hashtables/dictionaries - return true; - } - try - { - if (null != sourceValue.ToJsonString()) - { - return true; - } - } - catch - { - // Not one of our objects - } - try - { - string text = sourceValue.ToString()?.Trim(); - return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonType.Object; - } - catch - { - // Doesn't look like it can be treated as JSON - } - return false; - } - - /// - /// Determines if the parameter can be converted to the - /// parameter - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false - /// - public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; - - /// - /// Converts the parameter to the parameter using and - /// - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// - /// an instance of , or null if there is no suitable conversion. - /// - public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); - - /// - /// Converts the parameter into an instance of - /// - /// the value to convert into an instance of . - /// - /// an instance of , or null if there is no suitable conversion. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResource ConvertFrom(dynamic sourceValue) - { - if (null == sourceValue) - { - return null; - } - global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResource).IsAssignableFrom(type)) - { - return sourceValue; - } - try - { - return Resource.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; - } - catch - { - // Unable to use JSON pattern - } - if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) - { - return Resource.DeserializeFromPSObject(sourceValue); - } - if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) - { - return Resource.DeserializeFromDictionary(sourceValue); - } - return null; - } - - /// NotImplemented -- this will return null - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// will always return null. - public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; - } -} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api10/Resource.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api10/Resource.cs deleted file mode 100644 index b95c6322d33c..000000000000 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api10/Resource.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.ApplicationInsights.Models.Api10 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; - - /// - /// Common fields that are returned in the response for all Azure Resource Manager resources - /// - public partial class Resource : - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResource, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResourceInternal - { - - /// Backing field for property. - private string _id; - - /// - /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - /// - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] - public string Id { get => this._id; } - - /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResourceInternal.Id { get => this._id; set { {_id = value;} } } - - /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResourceInternal.Name { get => this._name; set { {_name = value;} } } - - /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResourceInternal.Type { get => this._type; set { {_type = value;} } } - - /// Backing field for property. - private string _name; - - /// The name of the resource - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] - public string Name { get => this._name; } - - /// Backing field for property. - private string _type; - - /// - /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - /// - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] - public string Type { get => this._type; } - - /// Creates an new instance. - public Resource() - { - - } - } - /// Common fields that are returned in the response for all Azure Resource Manager resources - public partial interface IResource : - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IJsonSerializable - { - /// - /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - /// - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}", - SerializedName = @"id", - PossibleTypes = new [] { typeof(string) })] - string Id { get; } - /// The name of the resource - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The name of the resource", - SerializedName = @"name", - PossibleTypes = new [] { typeof(string) })] - string Name { get; } - /// - /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - /// - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The type of the resource. E.g. ""Microsoft.Compute/virtualMachines"" or ""Microsoft.Storage/storageAccounts""", - SerializedName = @"type", - PossibleTypes = new [] { typeof(string) })] - string Type { get; } - - } - /// Common fields that are returned in the response for all Azure Resource Manager resources - internal partial interface IResourceInternal - - { - /// - /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - /// - string Id { get; set; } - /// The name of the resource - string Name { get; set; } - /// - /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - /// - string Type { get; set; } - - } -} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api10/Resource.json.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api10/Resource.json.cs deleted file mode 100644 index c61c72b8faee..000000000000 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api10/Resource.json.cs +++ /dev/null @@ -1,123 +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.Api10 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; - - /// - /// Common fields that are returned in the response for all Azure Resource Manager resources - /// - public partial class Resource - { - - /// - /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object - /// before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The JsonNode that should be deserialized into this object. - - partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json); - - /// - /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The JSON container that the serialization result will be placed in. - - partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container); - - /// - /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of - /// the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the - /// output parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The JsonNode that should be deserialized into this object. - /// Determines if the rest of the deserialization should be processed, or if the method should return - /// instantly. - - partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json, ref bool returnNow); - - /// - /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the - /// object before it is serialized. - /// If you wish to disable the default serialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The JSON container that the serialization result will be placed in. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container, ref bool returnNow); - - /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResource. - /// - /// a to deserialize from. - /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResource. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) - { - return node is Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json ? new Resource(json) : null; - } - - /// - /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject into a new instance of . - /// - /// A Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject instance to deserialize from. - internal Resource(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json) - { - bool returnNow = false; - BeforeFromJson(json, ref returnNow); - if (returnNow) - { - return; - } - {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} - {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} - {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)Type;} - AfterFromJson(json); - } - - /// - /// Serializes this instance of into a . - /// - /// The container to serialize this object into. If the caller - /// passes in null, a new instance will be created and returned to the caller. - /// Allows the caller to choose the depth of the serialization. See . - /// - /// a serialized instance of as a . - /// - public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode serializationMode) - { - container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject(); - - bool returnNow = false; - BeforeToJson(ref container, ref returnNow); - if (returnNow) - { - return container; - } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeReadOnly)) - { - AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); - } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeReadOnly)) - { - AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); - } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeReadOnly)) - { - AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(this._type.ToString()) : null, "type" ,container.Add ); - } - AfterToJson(ref container); - return container; - } - } -} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api10/SystemData.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api10/SystemData.PowerShell.cs deleted file mode 100644 index f6277cc2d178..000000000000 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api10/SystemData.PowerShell.cs +++ /dev/null @@ -1,204 +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.Api10 -{ - using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; - - /// Metadata pertaining to creation and last modification of the resource. - [System.ComponentModel.TypeConverter(typeof(SystemDataTypeConverter))] - public partial class SystemData - { - - /// - /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the - /// object before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Collections.IDictionary content that should be used. - - partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); - - /// - /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object - /// before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Management.Automation.PSObject content that should be used. - - partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); - - /// - /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Collections.IDictionary content that should be used. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); - - /// - /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Management.Automation.PSObject content that should be used. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); - - /// - /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior - /// - /// /// instance serialized to a string, normally it is a Json - /// /// set returnNow to true if you provide a customized OverrideToString function - - partial void OverrideToString(ref string stringResult, ref bool returnNow); - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.ISystemData DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new SystemData(content); - } - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.ISystemData DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new SystemData(content); - } - - /// - /// Creates a new instance of , deserializing the content from a json string. - /// - /// a string containing a JSON serialized instance of this model. - /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.ISystemData 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 SystemData(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // 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); - } - 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); - } - 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)); - } - 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); - } - 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); - } - 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)); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal SystemData(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // 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); - } - 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); - } - 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)); - } - 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); - } - 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); - } - 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)); - } - 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(); - } - } - /// Metadata pertaining to creation and last modification of the resource. - [System.ComponentModel.TypeConverter(typeof(SystemDataTypeConverter))] - public partial interface ISystemData - - { - - } -} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api10/SystemData.TypeConverter.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api10/SystemData.TypeConverter.cs deleted file mode 100644 index 1a712bf5d2c1..000000000000 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api10/SystemData.TypeConverter.cs +++ /dev/null @@ -1,146 +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.Api10 -{ - using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; - - /// - /// A PowerShell PSTypeConverter to support converting to an instance of - /// - public partial class SystemDataTypeConverter : global::System.Management.Automation.PSTypeConverter - { - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false. - /// - public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); - - /// - /// Determines if the converter can convert the parameter to the type. - /// - /// the instance to check if it can be converted to the type. - /// - /// true if the instance could be converted to a type, otherwise false - /// - public static bool CanConvertFrom(dynamic sourceValue) - { - if (null == sourceValue) - { - return true; - } - global::System.Type type = sourceValue.GetType(); - if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) - { - // we say yest to PSObjects - return true; - } - if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) - { - // we say yest to Hashtables/dictionaries - return true; - } - try - { - if (null != sourceValue.ToJsonString()) - { - return true; - } - } - catch - { - // Not one of our objects - } - try - { - string text = sourceValue.ToString()?.Trim(); - return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonType.Object; - } - catch - { - // Doesn't look like it can be treated as JSON - } - return false; - } - - /// - /// Determines if the parameter can be converted to the - /// parameter - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false - /// - public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; - - /// - /// Converts the parameter to the parameter using and - /// - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// - /// an instance of , or null if there is no suitable conversion. - /// - public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); - - /// - /// Converts the parameter into an instance of - /// - /// the value to convert into an instance of . - /// - /// an instance of , or null if there is no suitable conversion. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.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)) - { - return sourceValue; - } - try - { - return SystemData.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; - } - catch - { - // Unable to use JSON pattern - } - if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) - { - return SystemData.DeserializeFromPSObject(sourceValue); - } - if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) - { - return SystemData.DeserializeFromDictionary(sourceValue); - } - return null; - } - - /// NotImplemented -- this will return null - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// will always return null. - public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; - } -} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api10/SystemData.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api10/SystemData.cs deleted file mode 100644 index b9da52e29f6d..000000000000 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api10/SystemData.cs +++ /dev/null @@ -1,136 +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.Api10 -{ - 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 - { - - /// Backing field for property. - private global::System.DateTime? _createdAt; - - /// The timestamp of resource creation (UTC). - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] - public global::System.DateTime? CreatedAt { get => this._createdAt; set => this._createdAt = value; } - - /// Backing field for property. - private string _createdBy; - - /// The identity that created the resource. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] - public string CreatedBy { get => this._createdBy; set => this._createdBy = value; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.CreatedByType? _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; } - - /// Backing field for property. - private global::System.DateTime? _lastModifiedAt; - - /// The timestamp of resource last modification (UTC) - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] - public global::System.DateTime? LastModifiedAt { get => this._lastModifiedAt; set => this._lastModifiedAt = value; } - - /// Backing field for property. - private string _lastModifiedBy; - - /// The identity that last modified the resource. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] - public string LastModifiedBy { get => this._lastModifiedBy; set => this._lastModifiedBy = value; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.CreatedByType? _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; } - - /// Creates an new instance. - public SystemData() - { - - } - } - /// Metadata pertaining to creation and last modification of the resource. - public partial interface ISystemData : - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IJsonSerializable - { - /// The timestamp of resource creation (UTC). - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The timestamp of resource creation (UTC).", - SerializedName = @"createdAt", - PossibleTypes = new [] { typeof(global::System.DateTime) })] - global::System.DateTime? CreatedAt { get; set; } - /// The identity that created the resource. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The identity that created the resource.", - SerializedName = @"createdBy", - PossibleTypes = new [] { typeof(string) })] - string CreatedBy { get; set; } - /// The type of identity that created the resource. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = 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? CreatedByType { get; set; } - /// The timestamp of resource last modification (UTC) - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The timestamp of resource last modification (UTC)", - SerializedName = @"lastModifiedAt", - PossibleTypes = new [] { typeof(global::System.DateTime) })] - global::System.DateTime? LastModifiedAt { get; set; } - /// The identity that last modified the resource. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The identity that last modified the resource.", - SerializedName = @"lastModifiedBy", - PossibleTypes = new [] { typeof(string) })] - string LastModifiedBy { get; set; } - /// The type of identity that last modified the resource. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The type of identity that last modified the resource.", - SerializedName = @"lastModifiedByType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.CreatedByType) })] - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.CreatedByType? LastModifiedByType { get; set; } - - } - /// Metadata pertaining to creation and last modification of the resource. - internal partial interface ISystemDataInternal - - { - /// The timestamp of resource creation (UTC). - global::System.DateTime? CreatedAt { get; set; } - /// The identity that created the resource. - string CreatedBy { get; set; } - /// The type of identity that created the resource. - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.CreatedByType? CreatedByType { get; set; } - /// The timestamp of resource last modification (UTC) - global::System.DateTime? LastModifiedAt { get; set; } - /// The identity that last modified the resource. - string LastModifiedBy { get; set; } - /// The type of identity that last modified the resource. - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.CreatedByType? 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/Api10/SystemData.json.cs deleted file mode 100644 index 115929dd272b..000000000000 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api10/SystemData.json.cs +++ /dev/null @@ -1,118 +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.Api10 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; - - /// Metadata pertaining to creation and last modification of the resource. - public partial class SystemData - { - - /// - /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object - /// before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The JsonNode that should be deserialized into this object. - - partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json); - - /// - /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The JSON container that the serialization result will be placed in. - - partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container); - - /// - /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of - /// the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the - /// output parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The JsonNode that should be deserialized into this object. - /// Determines if the rest of the deserialization should be processed, or if the method should return - /// instantly. - - partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json, ref bool returnNow); - - /// - /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the - /// object before it is serialized. - /// If you wish to disable the default serialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The JSON container that the serialization result will be placed in. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container, ref bool returnNow); - - /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.ISystemData. - /// - /// a to deserialize from. - /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.ISystemData. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.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; - } - - /// - /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject into a new instance of . - /// - /// A Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject instance to deserialize from. - internal SystemData(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json) - { - bool returnNow = false; - BeforeFromJson(json, ref returnNow); - if (returnNow) - { - return; - } - {_createdBy = If( json?.PropertyT("createdBy"), out var __jsonCreatedBy) ? (string)__jsonCreatedBy : (string)CreatedBy;} - {_createdByType = If( json?.PropertyT("createdByType"), out var __jsonCreatedByType) ? (string)__jsonCreatedByType : (string)CreatedByType;} - {_createdAt = If( json?.PropertyT("createdAt"), out var __jsonCreatedAt) ? global::System.DateTime.TryParse((string)__jsonCreatedAt, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonCreatedAtValue) ? __jsonCreatedAtValue : CreatedAt : CreatedAt;} - {_lastModifiedBy = If( json?.PropertyT("lastModifiedBy"), out var __jsonLastModifiedBy) ? (string)__jsonLastModifiedBy : (string)LastModifiedBy;} - {_lastModifiedByType = If( json?.PropertyT("lastModifiedByType"), out var __jsonLastModifiedByType) ? (string)__jsonLastModifiedByType : (string)LastModifiedByType;} - {_lastModifiedAt = If( json?.PropertyT("lastModifiedAt"), out var __jsonLastModifiedAt) ? global::System.DateTime.TryParse((string)__jsonLastModifiedAt, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonLastModifiedAtValue) ? __jsonLastModifiedAtValue : LastModifiedAt : LastModifiedAt;} - AfterFromJson(json); - } - - /// - /// Serializes this instance of into a . - /// - /// The container to serialize this object into. If the caller - /// passes in null, a new instance will be created and returned to the caller. - /// Allows the caller to choose the depth of the serialization. See . - /// - /// a serialized instance of as a . - /// - public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode serializationMode) - { - container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject(); - - bool returnNow = false; - BeforeToJson(ref container, ref returnNow); - if (returnNow) - { - return container; - } - AddIf( null != (((object)this._createdBy)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(this._createdBy.ToString()) : null, "createdBy" ,container.Add ); - AddIf( null != (((object)this._createdByType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(this._createdByType.ToString()) : null, "createdByType" ,container.Add ); - AddIf( null != this._createdAt ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(this._createdAt?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "createdAt" ,container.Add ); - AddIf( null != (((object)this._lastModifiedBy)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(this._lastModifiedBy.ToString()) : null, "lastModifiedBy" ,container.Add ); - AddIf( null != (((object)this._lastModifiedByType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(this._lastModifiedByType.ToString()) : null, "lastModifiedByType" ,container.Add ); - AddIf( null != this._lastModifiedAt ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(this._lastModifiedAt?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "lastModifiedAt" ,container.Add ); - AfterToJson(ref container); - return container; - } - } -} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api10/TrackedResource.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api10/TrackedResource.PowerShell.cs deleted file mode 100644 index 294bd9a97935..000000000000 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api10/TrackedResource.PowerShell.cs +++ /dev/null @@ -1,198 +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.Api10 -{ - using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; - - /// - /// The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location' - /// - [System.ComponentModel.TypeConverter(typeof(TrackedResourceTypeConverter))] - public partial class TrackedResource - { - - /// - /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the - /// object before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Collections.IDictionary content that should be used. - - partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); - - /// - /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object - /// before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Management.Automation.PSObject content that should be used. - - partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); - - /// - /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Collections.IDictionary content that should be used. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); - - /// - /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Management.Automation.PSObject content that should be used. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); - - /// - /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior - /// - /// /// instance serialized to a string, normally it is a Json - /// /// set returnNow to true if you provide a customized OverrideToString function - - partial void OverrideToString(ref string stringResult, ref bool returnNow); - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.ITrackedResource DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new TrackedResource(content); - } - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.ITrackedResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new TrackedResource(content); - } - - /// - /// Creates a new instance of , deserializing the content from a json string. - /// - /// a string containing a JSON serialized instance of this model. - /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.ITrackedResource 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 TrackedResource(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // 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); - } - 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("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResourceInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResourceInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResourceInternal)this).Type, global::System.Convert.ToString); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal TrackedResource(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // 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); - } - 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("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResourceInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResourceInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResourceInternal)this).Type, global::System.Convert.ToString); - } - AfterDeserializePSObject(content); - } - } - /// The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location' - [System.ComponentModel.TypeConverter(typeof(TrackedResourceTypeConverter))] - public partial interface ITrackedResource - - { - - } -} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api10/TrackedResource.TypeConverter.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api10/TrackedResource.TypeConverter.cs deleted file mode 100644 index 01c0416b8f53..000000000000 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api10/TrackedResource.TypeConverter.cs +++ /dev/null @@ -1,147 +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.Api10 -{ - using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; - - /// - /// A PowerShell PSTypeConverter to support converting to an instance of - /// - public partial class TrackedResourceTypeConverter : global::System.Management.Automation.PSTypeConverter - { - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false. - /// - public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); - - /// - /// Determines if the converter can convert the parameter to the - /// type. - /// - /// the instance to check if it can be converted to the type. - /// - /// true if the instance could be converted to a type, otherwise false - /// - public static bool CanConvertFrom(dynamic sourceValue) - { - if (null == sourceValue) - { - return true; - } - global::System.Type type = sourceValue.GetType(); - if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) - { - // we say yest to PSObjects - return true; - } - if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) - { - // we say yest to Hashtables/dictionaries - return true; - } - try - { - if (null != sourceValue.ToJsonString()) - { - return true; - } - } - catch - { - // Not one of our objects - } - try - { - string text = sourceValue.ToString()?.Trim(); - return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonType.Object; - } - catch - { - // Doesn't look like it can be treated as JSON - } - return false; - } - - /// - /// Determines if the parameter can be converted to the - /// parameter - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false - /// - public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; - - /// - /// Converts the parameter to the parameter using and - /// - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// - /// an instance of , or null if there is no suitable conversion. - /// - public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); - - /// - /// Converts the parameter into an instance of - /// - /// the value to convert into an instance of . - /// - /// an instance of , or null if there is no suitable conversion. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.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)) - { - return sourceValue; - } - try - { - return TrackedResource.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; - } - catch - { - // Unable to use JSON pattern - } - if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) - { - return TrackedResource.DeserializeFromPSObject(sourceValue); - } - if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) - { - return TrackedResource.DeserializeFromDictionary(sourceValue); - } - return null; - } - - /// NotImplemented -- this will return null - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// will always return null. - public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; - } -} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api10/TrackedResource.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api10/TrackedResource.cs deleted file mode 100644 index fe87069248eb..000000000000 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api10/TrackedResource.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.ApplicationInsights.Models.Api10 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; - - /// - /// 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.Runtime.IValidates - { - /// - /// Backing field for Inherited model - /// - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.Resource(); - - /// - /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - /// - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inherited)] - public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResourceInternal)__resource).Id; } - - /// Backing field for property. - private string _location; - - /// The geo-location where the resource lives - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] - public string Location { get => this._location; set => this._location = value; } - - /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResourceInternal)__resource).Id = value; } - - /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResourceInternal)__resource).Name = value; } - - /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResourceInternal)__resource).Type = value; } - - /// The name of the resource - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inherited)] - public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResourceInternal)__resource).Name; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.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; } - - /// - /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - /// - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inherited)] - public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResourceInternal)__resource).Type; } - - /// Creates an new instance. - public TrackedResource() - { - - } - - /// Validates that this object meets the validation criteria. - /// an instance that will receive validation - /// events. - /// - /// A that will be complete when validation is completed. - /// - public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener) - { - await eventListener.AssertNotNull(nameof(__resource), __resource); - await eventListener.AssertObjectIsValid(nameof(__resource), __resource); - } - } - /// The resource model definition for 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 - { - /// The geo-location where the resource lives - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The geo-location where the resource lives", - SerializedName = @"location", - PossibleTypes = new [] { typeof(string) })] - string Location { get; set; } - /// Resource tags. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Resource tags.", - SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.ITrackedResourceTags) })] - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.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 - { - /// The geo-location where the resource lives - string Location { get; set; } - /// Resource tags. - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.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/Api10/TrackedResource.json.cs deleted file mode 100644 index 44a6591723af..000000000000 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api10/TrackedResource.json.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.ApplicationInsights.Models.Api10 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; - - /// - /// The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location' - /// - public partial class TrackedResource - { - - /// - /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object - /// before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The JsonNode that should be deserialized into this object. - - partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json); - - /// - /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The JSON container that the serialization result will be placed in. - - partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container); - - /// - /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of - /// the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the - /// output parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The JsonNode that should be deserialized into this object. - /// Determines if the rest of the deserialization should be processed, or if the method should return - /// instantly. - - partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json, ref bool returnNow); - - /// - /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the - /// object before it is serialized. - /// If you wish to disable the default serialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The JSON container that the serialization result will be placed in. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container, ref bool returnNow); - - /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.ITrackedResource. - /// - /// a to deserialize from. - /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.ITrackedResource. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.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; - } - - /// - /// Serializes this instance of into a . - /// - /// The container to serialize this object into. If the caller - /// passes in null, a new instance will be created and returned to the caller. - /// Allows the caller to choose the depth of the serialization. See . - /// - /// a serialized instance of as a . - /// - public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode serializationMode) - { - container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject(); - - bool returnNow = false; - BeforeToJson(ref container, ref returnNow); - if (returnNow) - { - return container; - } - __resource?.ToJson(container, serializationMode); - AddIf( null != this._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 ); - AfterToJson(ref container); - return container; - } - - /// - /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject into a new instance of . - /// - /// A Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject instance to deserialize from. - internal TrackedResource(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json) - { - bool returnNow = false; - BeforeFromJson(json, ref returnNow); - if (returnNow) - { - return; - } - __resource = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.Resource(json); - {_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;} - AfterFromJson(json); - } - } -} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api10/TrackedResourceTags.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api10/TrackedResourceTags.PowerShell.cs deleted file mode 100644 index e3b240986921..000000000000 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api10/TrackedResourceTags.PowerShell.cs +++ /dev/null @@ -1,160 +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.Api10 -{ - using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; - - /// Resource tags. - [System.ComponentModel.TypeConverter(typeof(TrackedResourceTagsTypeConverter))] - public partial class TrackedResourceTags - { - - /// - /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the - /// object before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Collections.IDictionary content that should be used. - - partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); - - /// - /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object - /// before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Management.Automation.PSObject content that should be used. - - partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); - - /// - /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Collections.IDictionary content that should be used. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); - - /// - /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Management.Automation.PSObject content that should be used. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); - - /// - /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior - /// - /// /// instance serialized to a string, normally it is a Json - /// /// set returnNow to true if you provide a customized OverrideToString function - - partial void OverrideToString(ref string stringResult, ref bool returnNow); - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.ITrackedResourceTags DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new TrackedResourceTags(content); - } - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.ITrackedResourceTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new TrackedResourceTags(content); - } - - /// - /// Creates a new instance of , deserializing the content from a json string. - /// - /// a string containing a JSON serialized instance of this model. - /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.ITrackedResourceTags 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 TrackedResourceTags(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - // this type is a dictionary; copy elements from source to here. - CopyFrom(content); - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal TrackedResourceTags(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - // this type is a dictionary; copy elements from source to here. - CopyFrom(content); - AfterDeserializePSObject(content); - } - } - /// Resource tags. - [System.ComponentModel.TypeConverter(typeof(TrackedResourceTagsTypeConverter))] - public partial interface ITrackedResourceTags - - { - - } -} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api10/TrackedResourceTags.TypeConverter.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api10/TrackedResourceTags.TypeConverter.cs deleted file mode 100644 index e3280a2ea8a3..000000000000 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api10/TrackedResourceTags.TypeConverter.cs +++ /dev/null @@ -1,147 +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.Api10 -{ - using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; - - /// - /// A PowerShell PSTypeConverter to support converting to an instance of - /// - public partial class TrackedResourceTagsTypeConverter : global::System.Management.Automation.PSTypeConverter - { - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false. - /// - public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); - - /// - /// Determines if the converter can convert the parameter to the - /// type. - /// - /// the instance to check if it can be converted to the type. - /// - /// true if the instance could be converted to a type, otherwise false - /// - public static bool CanConvertFrom(dynamic sourceValue) - { - if (null == sourceValue) - { - return true; - } - global::System.Type type = sourceValue.GetType(); - if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) - { - // we say yest to PSObjects - return true; - } - if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) - { - // we say yest to Hashtables/dictionaries - return true; - } - try - { - if (null != sourceValue.ToJsonString()) - { - return true; - } - } - catch - { - // Not one of our objects - } - try - { - string text = sourceValue.ToString()?.Trim(); - return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonType.Object; - } - catch - { - // Doesn't look like it can be treated as JSON - } - return false; - } - - /// - /// Determines if the parameter can be converted to the - /// parameter - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false - /// - public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; - - /// - /// Converts the parameter to the parameter using and - /// - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// - /// an instance of , or null if there is no suitable conversion. - /// - public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); - - /// - /// Converts the parameter into an instance of - /// - /// the value to convert into an instance of . - /// - /// an instance of , or null if there is no suitable conversion. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.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)) - { - return sourceValue; - } - try - { - return TrackedResourceTags.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; - } - catch - { - // Unable to use JSON pattern - } - if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) - { - return TrackedResourceTags.DeserializeFromPSObject(sourceValue); - } - if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) - { - return TrackedResourceTags.DeserializeFromDictionary(sourceValue); - } - return null; - } - - /// NotImplemented -- this will return null - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// will always return null. - public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; - } -} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api10/TrackedResourceTags.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api10/TrackedResourceTags.cs deleted file mode 100644 index ae8552b468f3..000000000000 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api10/TrackedResourceTags.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.Models.Api10 -{ - 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 - { - - /// Creates an new instance. - public TrackedResourceTags() - { - - } - } - /// Resource tags. - public partial interface ITrackedResourceTags : - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IAssociativeArray - { - - } - /// Resource tags. - internal partial interface ITrackedResourceTagsInternal - - { - - } -} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api10/TrackedResourceTags.dictionary.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api10/TrackedResourceTags.dictionary.cs deleted file mode 100644 index 8d2d2c844940..000000000000 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api10/TrackedResourceTags.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.Api10 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; - - public partial class TrackedResourceTags : - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IAssociativeArray - { - protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); - - global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; } - - int Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; } - - global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; } - - global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IAssociativeArray.Values { get => __additionalProperties.Values; } - - public string this[global::System.String index] { get => __additionalProperties[index]; set => __additionalProperties[index] = value; } - - /// - /// - public void Add(global::System.String key, string value) => __additionalProperties.Add( key, value); - - public void Clear() => __additionalProperties.Clear(); - - /// - public bool ContainsKey(global::System.String key) => __additionalProperties.ContainsKey( key); - - /// - public void CopyFrom(global::System.Collections.IDictionary source) - { - if (null != source) - { - foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) - { - if ((null != property.Key && null != property.Value)) - { - this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); - } - } - } - } - - /// - public void CopyFrom(global::System.Management.Automation.PSObject source) - { - if (null != source) - { - foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) - { - if ((null != property.Key && null != property.Value)) - { - this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); - } - } - } - } - - /// - public bool Remove(global::System.String key) => __additionalProperties.Remove( key); - - /// - /// - public bool TryGetValue(global::System.String key, out string value) => __additionalProperties.TryGetValue( key, out value); - - /// - - public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.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/Api10/TrackedResourceTags.json.cs deleted file mode 100644 index c9d8088cbbb4..000000000000 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api10/TrackedResourceTags.json.cs +++ /dev/null @@ -1,109 +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.Api10 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; - - /// Resource tags. - public partial class TrackedResourceTags - { - - /// - /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object - /// before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The JsonNode that should be deserialized into this object. - - partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json); - - /// - /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The JSON container that the serialization result will be placed in. - - partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container); - - /// - /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of - /// the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the - /// output parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The JsonNode that should be deserialized into this object. - /// Determines if the rest of the deserialization should be processed, or if the method should return - /// instantly. - - partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json, ref bool returnNow); - - /// - /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the - /// object before it is serialized. - /// If you wish to disable the default serialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The JSON container that the serialization result will be placed in. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container, ref bool returnNow); - - /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.ITrackedResourceTags. - /// - /// a to deserialize from. - /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.ITrackedResourceTags. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.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; - } - - /// - /// Serializes this instance of into a . - /// - /// The container to serialize this object into. If the caller - /// passes in null, a new instance will be created and returned to the caller. - /// Allows the caller to choose the depth of the serialization. See . - /// - /// a serialized instance of as a . - /// - public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode serializationMode) - { - container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject(); - - bool returnNow = false; - BeforeToJson(ref container, ref returnNow); - if (returnNow) - { - return container; - } - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IAssociativeArray)this).AdditionalProperties, container); - AfterToJson(ref container); - return container; - } - - /// - /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject into a new instance of . - /// - /// A Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject instance to deserialize from. - /// - internal TrackedResourceTags(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) - { - bool returnNow = false; - BeforeFromJson(json, ref returnNow); - if (returnNow) - { - return; - } - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IAssociativeArray)this).AdditionalProperties, null ,exclusions ); - AfterFromJson(json); - } - } -} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/Annotation.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/Annotation.PowerShell.cs deleted file mode 100644 index ac43d82f0a64..000000000000 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/Annotation.PowerShell.cs +++ /dev/null @@ -1,204 +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; - - /// Annotation associated with an application insights resource. - [System.ComponentModel.TypeConverter(typeof(AnnotationTypeConverter))] - public partial class Annotation - { - - /// - /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the - /// object before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Collections.IDictionary content that should be used. - - partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); - - /// - /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object - /// before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Management.Automation.PSObject content that should be used. - - partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); - - /// - /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Collections.IDictionary content that should be used. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); - - /// - /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Management.Automation.PSObject content that should be used. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); - - /// - /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior - /// - /// /// instance serialized to a string, normally it is a Json - /// /// set returnNow to true if you provide a customized OverrideToString function - - partial void OverrideToString(ref string stringResult, ref bool returnNow); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal Annotation(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotationInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotationInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Category")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotationInternal)this).Category = (string) content.GetValueForProperty("Category",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotationInternal)this).Category, global::System.Convert.ToString); - } - if (content.Contains("EventTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotationInternal)this).EventTime = (global::System.DateTime?) content.GetValueForProperty("EventTime",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotationInternal)this).EventTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotationInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotationInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Property")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotationInternal)this).Property = (string) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotationInternal)this).Property, global::System.Convert.ToString); - } - if (content.Contains("RelatedAnnotation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotationInternal)this).RelatedAnnotation = (string) content.GetValueForProperty("RelatedAnnotation",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotationInternal)this).RelatedAnnotation, global::System.Convert.ToString); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal Annotation(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotationInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotationInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Category")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotationInternal)this).Category = (string) content.GetValueForProperty("Category",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotationInternal)this).Category, global::System.Convert.ToString); - } - if (content.Contains("EventTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotationInternal)this).EventTime = (global::System.DateTime?) content.GetValueForProperty("EventTime",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotationInternal)this).EventTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotationInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotationInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Property")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotationInternal)this).Property = (string) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotationInternal)this).Property, global::System.Convert.ToString); - } - if (content.Contains("RelatedAnnotation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotationInternal)this).RelatedAnnotation = (string) content.GetValueForProperty("RelatedAnnotation",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotationInternal)this).RelatedAnnotation, global::System.Convert.ToString); - } - AfterDeserializePSObject(content); - } - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotation DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new Annotation(content); - } - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotation DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new Annotation(content); - } - - /// - /// Creates a new instance of , deserializing the content from a json string. - /// - /// a string containing a JSON serialized instance of this model. - /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotation FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); - - /// Serializes this instance to a json string. - - /// a containing this model serialized to JSON text. - public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeAll)?.ToString(); - - public override string ToString() - { - var returnNow = false; - var result = global::System.String.Empty; - OverrideToString(ref result, ref returnNow); - if (returnNow) - { - return result; - } - return ToJsonString(); - } - } - /// Annotation associated with an application insights resource. - [System.ComponentModel.TypeConverter(typeof(AnnotationTypeConverter))] - public partial interface IAnnotation - - { - - } -} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/AnnotationError.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/AnnotationError.PowerShell.cs deleted file mode 100644 index 10fe2700efbd..000000000000 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/AnnotationError.PowerShell.cs +++ /dev/null @@ -1,198 +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; - - /// Error associated with trying to create annotation with Id that already exist - [System.ComponentModel.TypeConverter(typeof(AnnotationErrorTypeConverter))] - public partial class AnnotationError - { - - /// - /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the - /// object before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Collections.IDictionary content that should be used. - - partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); - - /// - /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object - /// before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Management.Automation.PSObject content that should be used. - - partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); - - /// - /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Collections.IDictionary content that should be used. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); - - /// - /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Management.Automation.PSObject content that should be used. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); - - /// - /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior - /// - /// /// instance serialized to a string, normally it is a Json - /// /// set returnNow to true if you provide a customized OverrideToString function - - partial void OverrideToString(ref string stringResult, ref bool returnNow); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal AnnotationError(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("Innererror")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotationErrorInternal)this).Innererror = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IInnerError) content.GetValueForProperty("Innererror",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotationErrorInternal)this).Innererror, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.InnerErrorTypeConverter.ConvertFrom); - } - if (content.Contains("Code")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotationErrorInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotationErrorInternal)this).Code, global::System.Convert.ToString); - } - if (content.Contains("Message")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotationErrorInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotationErrorInternal)this).Message, global::System.Convert.ToString); - } - if (content.Contains("InnererrorDiagnosticcontext")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotationErrorInternal)this).InnererrorDiagnosticcontext = (string) content.GetValueForProperty("InnererrorDiagnosticcontext",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotationErrorInternal)this).InnererrorDiagnosticcontext, global::System.Convert.ToString); - } - if (content.Contains("InnererrorTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotationErrorInternal)this).InnererrorTime = (global::System.DateTime?) content.GetValueForProperty("InnererrorTime",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotationErrorInternal)this).InnererrorTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal AnnotationError(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("Innererror")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotationErrorInternal)this).Innererror = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IInnerError) content.GetValueForProperty("Innererror",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotationErrorInternal)this).Innererror, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.InnerErrorTypeConverter.ConvertFrom); - } - if (content.Contains("Code")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotationErrorInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotationErrorInternal)this).Code, global::System.Convert.ToString); - } - if (content.Contains("Message")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotationErrorInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotationErrorInternal)this).Message, global::System.Convert.ToString); - } - if (content.Contains("InnererrorDiagnosticcontext")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotationErrorInternal)this).InnererrorDiagnosticcontext = (string) content.GetValueForProperty("InnererrorDiagnosticcontext",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotationErrorInternal)this).InnererrorDiagnosticcontext, global::System.Convert.ToString); - } - if (content.Contains("InnererrorTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotationErrorInternal)this).InnererrorTime = (global::System.DateTime?) content.GetValueForProperty("InnererrorTime",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotationErrorInternal)this).InnererrorTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - AfterDeserializePSObject(content); - } - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotationError DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new AnnotationError(content); - } - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotationError DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new AnnotationError(content); - } - - /// - /// Creates a new instance of , deserializing the content from a json string. - /// - /// a string containing a JSON serialized instance of this model. - /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotationError FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); - - /// Serializes this instance to a json string. - - /// a containing this model serialized to JSON text. - public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeAll)?.ToString(); - - public override string ToString() - { - var returnNow = false; - var result = global::System.String.Empty; - OverrideToString(ref result, ref returnNow); - if (returnNow) - { - return result; - } - return ToJsonString(); - } - } - /// Error associated with trying to create annotation with Id that already exist - [System.ComponentModel.TypeConverter(typeof(AnnotationErrorTypeConverter))] - public partial interface IAnnotationError - - { - - } -} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/AnnotationsListResult.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/AnnotationsListResult.cs deleted file mode 100644 index 177f65974b4c..000000000000 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/AnnotationsListResult.cs +++ /dev/null @@ -1,54 +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 static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; - - /// Annotations list result. - public partial class AnnotationsListResult : - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotationsListResult, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotationsListResultInternal - { - - /// Internal Acessors for Value - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotation[] Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotationsListResultInternal.Value { get => this._value; set { {_value = value;} } } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotation[] _value; - - /// An array of annotations. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotation[] Value { get => this._value; } - - /// Creates an new instance. - public AnnotationsListResult() - { - - } - } - /// Annotations list result. - public partial interface IAnnotationsListResult : - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IJsonSerializable - { - /// An array of annotations. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"An array of annotations.", - SerializedName = @"value", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotation) })] - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotation[] Value { get; } - - } - /// Annotations list result. - internal partial interface IAnnotationsListResultInternal - - { - /// An array of annotations. - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IAnnotation[] Value { get; set; } - - } -} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentApiKey.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentApiKey.PowerShell.cs deleted file mode 100644 index 96970a133799..000000000000 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentApiKey.PowerShell.cs +++ /dev/null @@ -1,208 +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 an API key of an Application Insights Component. - [System.ComponentModel.TypeConverter(typeof(ApplicationInsightsComponentApiKeyTypeConverter))] - public partial class ApplicationInsightsComponentApiKey - { - - /// - /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the - /// object before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Collections.IDictionary content that should be used. - - partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); - - /// - /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object - /// before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Management.Automation.PSObject content that should be used. - - partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); - - /// - /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Collections.IDictionary content that should be used. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); - - /// - /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Management.Automation.PSObject content that should be used. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); - - /// - /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior - /// - /// /// instance serialized to a string, normally it is a Json - /// /// set returnNow to true if you provide a customized OverrideToString function - - partial void OverrideToString(ref string stringResult, ref bool returnNow); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal ApplicationInsightsComponentApiKey(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKeyInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKeyInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("ApiKey")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKeyInternal)this).ApiKey = (string) content.GetValueForProperty("ApiKey",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKeyInternal)this).ApiKey, global::System.Convert.ToString); - } - if (content.Contains("CreatedDate")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKeyInternal)this).CreatedDate = (string) content.GetValueForProperty("CreatedDate",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKeyInternal)this).CreatedDate, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKeyInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKeyInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("LinkedReadProperty")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKeyInternal)this).LinkedReadProperty = (string[]) content.GetValueForProperty("LinkedReadProperty",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKeyInternal)this).LinkedReadProperty, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("LinkedWriteProperty")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKeyInternal)this).LinkedWriteProperty = (string[]) content.GetValueForProperty("LinkedWriteProperty",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKeyInternal)this).LinkedWriteProperty, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal ApplicationInsightsComponentApiKey(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKeyInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKeyInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("ApiKey")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKeyInternal)this).ApiKey = (string) content.GetValueForProperty("ApiKey",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKeyInternal)this).ApiKey, global::System.Convert.ToString); - } - if (content.Contains("CreatedDate")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKeyInternal)this).CreatedDate = (string) content.GetValueForProperty("CreatedDate",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKeyInternal)this).CreatedDate, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKeyInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKeyInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("LinkedReadProperty")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKeyInternal)this).LinkedReadProperty = (string[]) content.GetValueForProperty("LinkedReadProperty",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKeyInternal)this).LinkedReadProperty, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("LinkedWriteProperty")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKeyInternal)this).LinkedWriteProperty = (string[]) content.GetValueForProperty("LinkedWriteProperty",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKeyInternal)this).LinkedWriteProperty, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - AfterDeserializePSObject(content); - } - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKey DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new ApplicationInsightsComponentApiKey(content); - } - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKey DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new ApplicationInsightsComponentApiKey(content); - } - - /// - /// Creates a new instance of , deserializing the content from a json string. - /// - /// a string containing a JSON serialized instance of this model. - /// - /// an instance of the model class. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKey FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); - - /// Serializes this instance to a json string. - - /// a containing this model serialized to JSON text. - public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeAll)?.ToString(); - - public override string ToString() - { - var returnNow = false; - var result = global::System.String.Empty; - OverrideToString(ref result, ref returnNow); - if (returnNow) - { - return result; - } - return ToJsonString(); - } - } - /// Properties that define an API key of an Application Insights Component. - [System.ComponentModel.TypeConverter(typeof(ApplicationInsightsComponentApiKeyTypeConverter))] - public partial interface IApplicationInsightsComponentApiKey - - { - - } -} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentApiKeyListResult.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentApiKeyListResult.cs deleted file mode 100644 index a5e3061ebbf6..000000000000 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentApiKeyListResult.cs +++ /dev/null @@ -1,53 +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 static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; - - /// Describes the list of API Keys of an Application Insights Component. - public partial class ApplicationInsightsComponentApiKeyListResult : - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKeyListResult, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKeyListResultInternal - { - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKey[] _value; - - /// List of API Key definitions. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKey[] Value { get => this._value; set => this._value = value; } - - /// - /// Creates an new instance. - /// - public ApplicationInsightsComponentApiKeyListResult() - { - - } - } - /// Describes the list of API Keys of an Application Insights Component. - public partial interface IApplicationInsightsComponentApiKeyListResult : - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IJsonSerializable - { - /// List of API Key definitions. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"List of API Key definitions.", - SerializedName = @"value", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKey) })] - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKey[] Value { get; set; } - - } - /// Describes the list of API Keys of an Application Insights Component. - internal partial interface IApplicationInsightsComponentApiKeyListResultInternal - - { - /// List of API Key definitions. - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentApiKey[] Value { get; set; } - - } -} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentAvailableFeatures.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentAvailableFeatures.cs deleted file mode 100644 index a204b1daa06c..000000000000 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentAvailableFeatures.cs +++ /dev/null @@ -1,56 +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 static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; - - /// An Application Insights component available features. - public partial class ApplicationInsightsComponentAvailableFeatures : - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentAvailableFeatures, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentAvailableFeaturesInternal - { - - /// Internal Acessors for Result - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeature[] Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentAvailableFeaturesInternal.Result { get => this._result; set { {_result = value;} } } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeature[] _result; - - /// A list of Application Insights component feature. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeature[] Result { get => this._result; } - - /// - /// Creates an new instance. - /// - public ApplicationInsightsComponentAvailableFeatures() - { - - } - } - /// An Application Insights component available features. - public partial interface IApplicationInsightsComponentAvailableFeatures : - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IJsonSerializable - { - /// A list of Application Insights component feature. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"A list of Application Insights component feature.", - SerializedName = @"Result", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeature) })] - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeature[] Result { get; } - - } - /// An Application Insights component available features. - internal partial interface IApplicationInsightsComponentAvailableFeaturesInternal - - { - /// A list of Application Insights component feature. - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeature[] Result { get; set; } - - } -} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentBillingFeatures.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentBillingFeatures.PowerShell.cs deleted file mode 100644 index 998120b7b8ba..000000000000 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentBillingFeatures.PowerShell.cs +++ /dev/null @@ -1,225 +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 billing features - [System.ComponentModel.TypeConverter(typeof(ApplicationInsightsComponentBillingFeaturesTypeConverter))] - public partial class ApplicationInsightsComponentBillingFeatures - { - - /// - /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the - /// object before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Collections.IDictionary content that should be used. - - partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); - - /// - /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object - /// before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Management.Automation.PSObject content that should be used. - - partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); - - /// - /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Collections.IDictionary content that should be used. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); - - /// - /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Management.Automation.PSObject content that should be used. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); - - /// - /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior - /// - /// /// instance serialized to a string, normally it is a Json - /// /// set returnNow to true if you provide a customized OverrideToString function - - partial void OverrideToString(ref string stringResult, ref bool returnNow); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal ApplicationInsightsComponentBillingFeatures(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("DataVolumeCap")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentBillingFeaturesInternal)this).DataVolumeCap = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentDataVolumeCap) content.GetValueForProperty("DataVolumeCap",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentBillingFeaturesInternal)this).DataVolumeCap, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.ApplicationInsightsComponentDataVolumeCapTypeConverter.ConvertFrom); - } - if (content.Contains("CurrentBillingFeature")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentBillingFeaturesInternal)this).CurrentBillingFeature = (string[]) content.GetValueForProperty("CurrentBillingFeature",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentBillingFeaturesInternal)this).CurrentBillingFeature, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("DataVolumeCapCap")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentBillingFeaturesInternal)this).DataVolumeCapCap = (float?) content.GetValueForProperty("DataVolumeCapCap",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentBillingFeaturesInternal)this).DataVolumeCapCap, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); - } - if (content.Contains("DataVolumeCapResetTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentBillingFeaturesInternal)this).DataVolumeCapResetTime = (int?) content.GetValueForProperty("DataVolumeCapResetTime",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentBillingFeaturesInternal)this).DataVolumeCapResetTime, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); - } - if (content.Contains("DataVolumeCapWarningThreshold")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentBillingFeaturesInternal)this).DataVolumeCapWarningThreshold = (int?) content.GetValueForProperty("DataVolumeCapWarningThreshold",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentBillingFeaturesInternal)this).DataVolumeCapWarningThreshold, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); - } - if (content.Contains("DataVolumeCapStopSendNotificationWhenHitThreshold")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentBillingFeaturesInternal)this).DataVolumeCapStopSendNotificationWhenHitThreshold = (bool?) content.GetValueForProperty("DataVolumeCapStopSendNotificationWhenHitThreshold",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentBillingFeaturesInternal)this).DataVolumeCapStopSendNotificationWhenHitThreshold, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("DataVolumeCapStopSendNotificationWhenHitCap")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentBillingFeaturesInternal)this).DataVolumeCapStopSendNotificationWhenHitCap = (bool?) content.GetValueForProperty("DataVolumeCapStopSendNotificationWhenHitCap",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentBillingFeaturesInternal)this).DataVolumeCapStopSendNotificationWhenHitCap, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("DataVolumeCapMaxHistoryCap")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentBillingFeaturesInternal)this).DataVolumeCapMaxHistoryCap = (float?) content.GetValueForProperty("DataVolumeCapMaxHistoryCap",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentBillingFeaturesInternal)this).DataVolumeCapMaxHistoryCap, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal ApplicationInsightsComponentBillingFeatures(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("DataVolumeCap")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentBillingFeaturesInternal)this).DataVolumeCap = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentDataVolumeCap) content.GetValueForProperty("DataVolumeCap",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentBillingFeaturesInternal)this).DataVolumeCap, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.ApplicationInsightsComponentDataVolumeCapTypeConverter.ConvertFrom); - } - if (content.Contains("CurrentBillingFeature")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentBillingFeaturesInternal)this).CurrentBillingFeature = (string[]) content.GetValueForProperty("CurrentBillingFeature",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentBillingFeaturesInternal)this).CurrentBillingFeature, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("DataVolumeCapCap")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentBillingFeaturesInternal)this).DataVolumeCapCap = (float?) content.GetValueForProperty("DataVolumeCapCap",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentBillingFeaturesInternal)this).DataVolumeCapCap, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); - } - if (content.Contains("DataVolumeCapResetTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentBillingFeaturesInternal)this).DataVolumeCapResetTime = (int?) content.GetValueForProperty("DataVolumeCapResetTime",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentBillingFeaturesInternal)this).DataVolumeCapResetTime, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); - } - if (content.Contains("DataVolumeCapWarningThreshold")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentBillingFeaturesInternal)this).DataVolumeCapWarningThreshold = (int?) content.GetValueForProperty("DataVolumeCapWarningThreshold",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentBillingFeaturesInternal)this).DataVolumeCapWarningThreshold, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); - } - if (content.Contains("DataVolumeCapStopSendNotificationWhenHitThreshold")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentBillingFeaturesInternal)this).DataVolumeCapStopSendNotificationWhenHitThreshold = (bool?) content.GetValueForProperty("DataVolumeCapStopSendNotificationWhenHitThreshold",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentBillingFeaturesInternal)this).DataVolumeCapStopSendNotificationWhenHitThreshold, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("DataVolumeCapStopSendNotificationWhenHitCap")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentBillingFeaturesInternal)this).DataVolumeCapStopSendNotificationWhenHitCap = (bool?) content.GetValueForProperty("DataVolumeCapStopSendNotificationWhenHitCap",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentBillingFeaturesInternal)this).DataVolumeCapStopSendNotificationWhenHitCap, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("DataVolumeCapMaxHistoryCap")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentBillingFeaturesInternal)this).DataVolumeCapMaxHistoryCap = (float?) content.GetValueForProperty("DataVolumeCapMaxHistoryCap",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentBillingFeaturesInternal)this).DataVolumeCapMaxHistoryCap, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); - } - AfterDeserializePSObject(content); - } - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentBillingFeatures DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new ApplicationInsightsComponentBillingFeatures(content); - } - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentBillingFeatures DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new ApplicationInsightsComponentBillingFeatures(content); - } - - /// - /// Creates a new instance of , deserializing the content from a - /// json string. - /// - /// a string containing a JSON serialized instance of this model. - /// - /// an instance of the model class. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentBillingFeatures FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); - - /// Serializes this instance to a json string. - - /// a containing this model serialized to JSON text. - public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeAll)?.ToString(); - - public override string ToString() - { - var returnNow = false; - var result = global::System.String.Empty; - OverrideToString(ref result, ref returnNow); - if (returnNow) - { - return result; - } - return ToJsonString(); - } - } - /// An Application Insights component billing features - [System.ComponentModel.TypeConverter(typeof(ApplicationInsightsComponentBillingFeaturesTypeConverter))] - public partial interface IApplicationInsightsComponentBillingFeatures - - { - - } -} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentBillingFeatures.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentBillingFeatures.cs deleted file mode 100644 index b2b55374ca33..000000000000 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentBillingFeatures.cs +++ /dev/null @@ -1,164 +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 static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; - - /// An Application Insights component billing features - public partial class ApplicationInsightsComponentBillingFeatures : - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentBillingFeatures, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentBillingFeaturesInternal - { - - /// Backing field for property. - private string[] _currentBillingFeature; - - /// - /// Current enabled pricing plan. When the component is in the Enterprise plan, this will list both 'Basic' and 'Application - /// Insights Enterprise'. - /// - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] - public string[] CurrentBillingFeature { get => this._currentBillingFeature; set => this._currentBillingFeature = value; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentDataVolumeCap _dataVolumeCap; - - /// An Application Insights component daily data volume cap - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentDataVolumeCap DataVolumeCap { get => (this._dataVolumeCap = this._dataVolumeCap ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.ApplicationInsightsComponentDataVolumeCap()); set => this._dataVolumeCap = value; } - - /// Daily data volume cap in GB. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] - public float? DataVolumeCapCap { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentDataVolumeCapInternal)DataVolumeCap).Cap; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentDataVolumeCapInternal)DataVolumeCap).Cap = value ?? default(float); } - - /// Maximum daily data volume cap that the user can set for this component. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] - public float? DataVolumeCapMaxHistoryCap { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentDataVolumeCapInternal)DataVolumeCap).MaxHistoryCap; } - - /// Daily data volume cap UTC reset hour. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] - public int? DataVolumeCapResetTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentDataVolumeCapInternal)DataVolumeCap).ResetTime; } - - /// Do not send a notification email when the daily data volume cap is met. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] - public bool? DataVolumeCapStopSendNotificationWhenHitCap { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentDataVolumeCapInternal)DataVolumeCap).StopSendNotificationWhenHitCap; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentDataVolumeCapInternal)DataVolumeCap).StopSendNotificationWhenHitCap = value ?? default(bool); } - - /// Reserved, not used for now. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] - public bool? DataVolumeCapStopSendNotificationWhenHitThreshold { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentDataVolumeCapInternal)DataVolumeCap).StopSendNotificationWhenHitThreshold; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentDataVolumeCapInternal)DataVolumeCap).StopSendNotificationWhenHitThreshold = value ?? default(bool); } - - /// Reserved, not used for now. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] - public int? DataVolumeCapWarningThreshold { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentDataVolumeCapInternal)DataVolumeCap).WarningThreshold; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentDataVolumeCapInternal)DataVolumeCap).WarningThreshold = value ?? default(int); } - - /// Internal Acessors for DataVolumeCap - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentDataVolumeCap Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentBillingFeaturesInternal.DataVolumeCap { get => (this._dataVolumeCap = this._dataVolumeCap ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.ApplicationInsightsComponentDataVolumeCap()); set { {_dataVolumeCap = value;} } } - - /// Internal Acessors for DataVolumeCapMaxHistoryCap - float? Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentBillingFeaturesInternal.DataVolumeCapMaxHistoryCap { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentDataVolumeCapInternal)DataVolumeCap).MaxHistoryCap; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentDataVolumeCapInternal)DataVolumeCap).MaxHistoryCap = value; } - - /// Internal Acessors for DataVolumeCapResetTime - int? Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentBillingFeaturesInternal.DataVolumeCapResetTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentDataVolumeCapInternal)DataVolumeCap).ResetTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentDataVolumeCapInternal)DataVolumeCap).ResetTime = value; } - - /// - /// Creates an new instance. - /// - public ApplicationInsightsComponentBillingFeatures() - { - - } - } - /// An Application Insights component billing features - public partial interface IApplicationInsightsComponentBillingFeatures : - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IJsonSerializable - { - /// - /// Current enabled pricing plan. When the component is in the Enterprise plan, this will list both 'Basic' and 'Application - /// Insights Enterprise'. - /// - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Current enabled pricing plan. When the component is in the Enterprise plan, this will list both 'Basic' and 'Application Insights Enterprise'.", - SerializedName = @"CurrentBillingFeatures", - PossibleTypes = new [] { typeof(string) })] - string[] CurrentBillingFeature { get; set; } - /// Daily data volume cap in GB. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Daily data volume cap in GB.", - SerializedName = @"Cap", - PossibleTypes = new [] { typeof(float) })] - float? DataVolumeCapCap { get; set; } - /// Maximum daily data volume cap that the user can set for this component. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"Maximum daily data volume cap that the user can set for this component.", - SerializedName = @"MaxHistoryCap", - PossibleTypes = new [] { typeof(float) })] - float? DataVolumeCapMaxHistoryCap { get; } - /// Daily data volume cap UTC reset hour. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"Daily data volume cap UTC reset hour.", - SerializedName = @"ResetTime", - PossibleTypes = new [] { typeof(int) })] - int? DataVolumeCapResetTime { get; } - /// Do not send a notification email when the daily data volume cap is met. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Do not send a notification email when the daily data volume cap is met.", - SerializedName = @"StopSendNotificationWhenHitCap", - PossibleTypes = new [] { typeof(bool) })] - bool? DataVolumeCapStopSendNotificationWhenHitCap { get; set; } - /// Reserved, not used for now. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Reserved, not used for now.", - SerializedName = @"StopSendNotificationWhenHitThreshold", - PossibleTypes = new [] { typeof(bool) })] - bool? DataVolumeCapStopSendNotificationWhenHitThreshold { get; set; } - /// Reserved, not used for now. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Reserved, not used for now.", - SerializedName = @"WarningThreshold", - PossibleTypes = new [] { typeof(int) })] - int? DataVolumeCapWarningThreshold { get; set; } - - } - /// An Application Insights component billing features - internal partial interface IApplicationInsightsComponentBillingFeaturesInternal - - { - /// - /// Current enabled pricing plan. When the component is in the Enterprise plan, this will list both 'Basic' and 'Application - /// Insights Enterprise'. - /// - string[] CurrentBillingFeature { get; set; } - /// An Application Insights component daily data volume cap - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentDataVolumeCap DataVolumeCap { get; set; } - /// Daily data volume cap in GB. - float? DataVolumeCapCap { get; set; } - /// Maximum daily data volume cap that the user can set for this component. - float? DataVolumeCapMaxHistoryCap { get; set; } - /// Daily data volume cap UTC reset hour. - int? DataVolumeCapResetTime { get; set; } - /// Do not send a notification email when the daily data volume cap is met. - bool? DataVolumeCapStopSendNotificationWhenHitCap { get; set; } - /// Reserved, not used for now. - bool? DataVolumeCapStopSendNotificationWhenHitThreshold { get; set; } - /// Reserved, not used for now. - int? DataVolumeCapWarningThreshold { get; set; } - - } -} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentDataVolumeCap.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentDataVolumeCap.PowerShell.cs deleted file mode 100644 index c1aaaecacdab..000000000000 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentDataVolumeCap.PowerShell.cs +++ /dev/null @@ -1,209 +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 daily data volume cap - [System.ComponentModel.TypeConverter(typeof(ApplicationInsightsComponentDataVolumeCapTypeConverter))] - public partial class ApplicationInsightsComponentDataVolumeCap - { - - /// - /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the - /// object before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Collections.IDictionary content that should be used. - - partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); - - /// - /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object - /// before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Management.Automation.PSObject content that should be used. - - partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); - - /// - /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Collections.IDictionary content that should be used. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); - - /// - /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Management.Automation.PSObject content that should be used. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); - - /// - /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior - /// - /// /// instance serialized to a string, normally it is a Json - /// /// set returnNow to true if you provide a customized OverrideToString function - - partial void OverrideToString(ref string stringResult, ref bool returnNow); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal ApplicationInsightsComponentDataVolumeCap(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("Cap")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentDataVolumeCapInternal)this).Cap = (float?) content.GetValueForProperty("Cap",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentDataVolumeCapInternal)this).Cap, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); - } - if (content.Contains("ResetTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentDataVolumeCapInternal)this).ResetTime = (int?) content.GetValueForProperty("ResetTime",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentDataVolumeCapInternal)this).ResetTime, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); - } - if (content.Contains("WarningThreshold")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentDataVolumeCapInternal)this).WarningThreshold = (int?) content.GetValueForProperty("WarningThreshold",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentDataVolumeCapInternal)this).WarningThreshold, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); - } - if (content.Contains("StopSendNotificationWhenHitThreshold")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentDataVolumeCapInternal)this).StopSendNotificationWhenHitThreshold = (bool?) content.GetValueForProperty("StopSendNotificationWhenHitThreshold",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentDataVolumeCapInternal)this).StopSendNotificationWhenHitThreshold, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("StopSendNotificationWhenHitCap")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentDataVolumeCapInternal)this).StopSendNotificationWhenHitCap = (bool?) content.GetValueForProperty("StopSendNotificationWhenHitCap",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentDataVolumeCapInternal)this).StopSendNotificationWhenHitCap, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("MaxHistoryCap")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentDataVolumeCapInternal)this).MaxHistoryCap = (float?) content.GetValueForProperty("MaxHistoryCap",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentDataVolumeCapInternal)this).MaxHistoryCap, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal ApplicationInsightsComponentDataVolumeCap(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("Cap")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentDataVolumeCapInternal)this).Cap = (float?) content.GetValueForProperty("Cap",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentDataVolumeCapInternal)this).Cap, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); - } - if (content.Contains("ResetTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentDataVolumeCapInternal)this).ResetTime = (int?) content.GetValueForProperty("ResetTime",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentDataVolumeCapInternal)this).ResetTime, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); - } - if (content.Contains("WarningThreshold")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentDataVolumeCapInternal)this).WarningThreshold = (int?) content.GetValueForProperty("WarningThreshold",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentDataVolumeCapInternal)this).WarningThreshold, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); - } - if (content.Contains("StopSendNotificationWhenHitThreshold")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentDataVolumeCapInternal)this).StopSendNotificationWhenHitThreshold = (bool?) content.GetValueForProperty("StopSendNotificationWhenHitThreshold",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentDataVolumeCapInternal)this).StopSendNotificationWhenHitThreshold, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("StopSendNotificationWhenHitCap")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentDataVolumeCapInternal)this).StopSendNotificationWhenHitCap = (bool?) content.GetValueForProperty("StopSendNotificationWhenHitCap",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentDataVolumeCapInternal)this).StopSendNotificationWhenHitCap, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("MaxHistoryCap")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentDataVolumeCapInternal)this).MaxHistoryCap = (float?) content.GetValueForProperty("MaxHistoryCap",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentDataVolumeCapInternal)this).MaxHistoryCap, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); - } - AfterDeserializePSObject(content); - } - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentDataVolumeCap DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new ApplicationInsightsComponentDataVolumeCap(content); - } - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentDataVolumeCap DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new ApplicationInsightsComponentDataVolumeCap(content); - } - - /// - /// Creates a new instance of , deserializing the content from a json - /// string. - /// - /// a string containing a JSON serialized instance of this model. - /// - /// an instance of the model class. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentDataVolumeCap FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); - - /// Serializes this instance to a json string. - - /// a containing this model serialized to JSON text. - public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeAll)?.ToString(); - - public override string ToString() - { - var returnNow = false; - var result = global::System.String.Empty; - OverrideToString(ref result, ref returnNow); - if (returnNow) - { - return result; - } - return ToJsonString(); - } - } - /// An Application Insights component daily data volume cap - [System.ComponentModel.TypeConverter(typeof(ApplicationInsightsComponentDataVolumeCapTypeConverter))] - public partial interface IApplicationInsightsComponentDataVolumeCap - - { - - } -} \ No newline at end of file diff --git a/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/ApplicationInsightsComponentExportRequest.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentExportRequest.PowerShell.cs deleted file mode 100644 index d7427f931b37..000000000000 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentExportRequest.PowerShell.cs +++ /dev/null @@ -1,235 +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 Continuous Export configuration request definition. - /// - [System.ComponentModel.TypeConverter(typeof(ApplicationInsightsComponentExportRequestTypeConverter))] - public partial class ApplicationInsightsComponentExportRequest - { - - /// - /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the - /// object before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Collections.IDictionary content that should be used. - - partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); - - /// - /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object - /// before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Management.Automation.PSObject content that should be used. - - partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); - - /// - /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Collections.IDictionary content that should be used. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); - - /// - /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Management.Automation.PSObject content that should be used. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); - - /// - /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior - /// - /// /// instance serialized to a string, normally it is a Json - /// /// set returnNow to true if you provide a customized OverrideToString function - - partial void OverrideToString(ref string stringResult, ref bool returnNow); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal ApplicationInsightsComponentExportRequest(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("RecordType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportRequestInternal)this).RecordType = (string) content.GetValueForProperty("RecordType",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportRequestInternal)this).RecordType, global::System.Convert.ToString); - } - if (content.Contains("DestinationType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportRequestInternal)this).DestinationType = (string) content.GetValueForProperty("DestinationType",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportRequestInternal)this).DestinationType, global::System.Convert.ToString); - } - if (content.Contains("DestinationAddress")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportRequestInternal)this).DestinationAddress = (string) content.GetValueForProperty("DestinationAddress",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportRequestInternal)this).DestinationAddress, global::System.Convert.ToString); - } - if (content.Contains("IsEnabled")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportRequestInternal)this).IsEnabled = (string) content.GetValueForProperty("IsEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportRequestInternal)this).IsEnabled, global::System.Convert.ToString); - } - if (content.Contains("NotificationQueueEnabled")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportRequestInternal)this).NotificationQueueEnabled = (string) content.GetValueForProperty("NotificationQueueEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportRequestInternal)this).NotificationQueueEnabled, global::System.Convert.ToString); - } - if (content.Contains("NotificationQueueUri")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportRequestInternal)this).NotificationQueueUri = (string) content.GetValueForProperty("NotificationQueueUri",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportRequestInternal)this).NotificationQueueUri, global::System.Convert.ToString); - } - if (content.Contains("DestinationStorageSubscriptionId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportRequestInternal)this).DestinationStorageSubscriptionId = (string) content.GetValueForProperty("DestinationStorageSubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportRequestInternal)this).DestinationStorageSubscriptionId, global::System.Convert.ToString); - } - if (content.Contains("DestinationStorageLocationId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportRequestInternal)this).DestinationStorageLocationId = (string) content.GetValueForProperty("DestinationStorageLocationId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportRequestInternal)this).DestinationStorageLocationId, global::System.Convert.ToString); - } - if (content.Contains("DestinationAccountId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportRequestInternal)this).DestinationAccountId = (string) content.GetValueForProperty("DestinationAccountId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportRequestInternal)this).DestinationAccountId, global::System.Convert.ToString); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal ApplicationInsightsComponentExportRequest(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("RecordType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportRequestInternal)this).RecordType = (string) content.GetValueForProperty("RecordType",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportRequestInternal)this).RecordType, global::System.Convert.ToString); - } - if (content.Contains("DestinationType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportRequestInternal)this).DestinationType = (string) content.GetValueForProperty("DestinationType",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportRequestInternal)this).DestinationType, global::System.Convert.ToString); - } - if (content.Contains("DestinationAddress")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportRequestInternal)this).DestinationAddress = (string) content.GetValueForProperty("DestinationAddress",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportRequestInternal)this).DestinationAddress, global::System.Convert.ToString); - } - if (content.Contains("IsEnabled")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportRequestInternal)this).IsEnabled = (string) content.GetValueForProperty("IsEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportRequestInternal)this).IsEnabled, global::System.Convert.ToString); - } - if (content.Contains("NotificationQueueEnabled")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportRequestInternal)this).NotificationQueueEnabled = (string) content.GetValueForProperty("NotificationQueueEnabled",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportRequestInternal)this).NotificationQueueEnabled, global::System.Convert.ToString); - } - if (content.Contains("NotificationQueueUri")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportRequestInternal)this).NotificationQueueUri = (string) content.GetValueForProperty("NotificationQueueUri",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportRequestInternal)this).NotificationQueueUri, global::System.Convert.ToString); - } - if (content.Contains("DestinationStorageSubscriptionId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportRequestInternal)this).DestinationStorageSubscriptionId = (string) content.GetValueForProperty("DestinationStorageSubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportRequestInternal)this).DestinationStorageSubscriptionId, global::System.Convert.ToString); - } - if (content.Contains("DestinationStorageLocationId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportRequestInternal)this).DestinationStorageLocationId = (string) content.GetValueForProperty("DestinationStorageLocationId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportRequestInternal)this).DestinationStorageLocationId, global::System.Convert.ToString); - } - if (content.Contains("DestinationAccountId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportRequestInternal)this).DestinationAccountId = (string) content.GetValueForProperty("DestinationAccountId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportRequestInternal)this).DestinationAccountId, global::System.Convert.ToString); - } - AfterDeserializePSObject(content); - } - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportRequest DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new ApplicationInsightsComponentExportRequest(content); - } - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportRequest DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new ApplicationInsightsComponentExportRequest(content); - } - - /// - /// Creates a new instance of , deserializing the content from a json - /// string. - /// - /// a string containing a JSON serialized instance of this model. - /// - /// an instance of the model class. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentExportRequest FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); - - /// Serializes this instance to a json string. - - /// a containing this model serialized to JSON text. - public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeAll)?.ToString(); - - public override string ToString() - { - var returnNow = false; - var result = global::System.String.Empty; - OverrideToString(ref result, ref returnNow); - if (returnNow) - { - return result; - } - return ToJsonString(); - } - } - /// An Application Insights component Continuous Export configuration request definition. - [System.ComponentModel.TypeConverter(typeof(ApplicationInsightsComponentExportRequestTypeConverter))] - public partial interface IApplicationInsightsComponentExportRequest - - { - - } -} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentFeature.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentFeature.PowerShell.cs deleted file mode 100644 index 44eb3eba0043..000000000000 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentFeature.PowerShell.cs +++ /dev/null @@ -1,232 +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 daily data volume cap status - [System.ComponentModel.TypeConverter(typeof(ApplicationInsightsComponentFeatureTypeConverter))] - public partial class ApplicationInsightsComponentFeature - { - - /// - /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the - /// object before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Collections.IDictionary content that should be used. - - partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); - - /// - /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object - /// before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Management.Automation.PSObject content that should be used. - - partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); - - /// - /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Collections.IDictionary content that should be used. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); - - /// - /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Management.Automation.PSObject content that should be used. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); - - /// - /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior - /// - /// /// instance serialized to a string, normally it is a Json - /// /// set returnNow to true if you provide a customized OverrideToString function - - partial void OverrideToString(ref string stringResult, ref bool returnNow); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal ApplicationInsightsComponentFeature(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("FeatureName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureInternal)this).FeatureName = (string) content.GetValueForProperty("FeatureName",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureInternal)this).FeatureName, global::System.Convert.ToString); - } - if (content.Contains("MeterId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureInternal)this).MeterId = (string) content.GetValueForProperty("MeterId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureInternal)this).MeterId, global::System.Convert.ToString); - } - if (content.Contains("MeterRateFrequency")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureInternal)this).MeterRateFrequency = (string) content.GetValueForProperty("MeterRateFrequency",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureInternal)this).MeterRateFrequency, global::System.Convert.ToString); - } - if (content.Contains("ResouceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureInternal)this).ResouceId = (string) content.GetValueForProperty("ResouceId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureInternal)this).ResouceId, global::System.Convert.ToString); - } - if (content.Contains("IsHidden")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureInternal)this).IsHidden = (bool?) content.GetValueForProperty("IsHidden",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureInternal)this).IsHidden, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("Capability")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureInternal)this).Capability = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapability[]) content.GetValueForProperty("Capability",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureInternal)this).Capability, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.ApplicationInsightsComponentFeatureCapabilityTypeConverter.ConvertFrom)); - } - if (content.Contains("Title")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureInternal)this).Title = (string) content.GetValueForProperty("Title",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureInternal)this).Title, global::System.Convert.ToString); - } - if (content.Contains("IsMainFeature")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureInternal)this).IsMainFeature = (bool?) content.GetValueForProperty("IsMainFeature",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureInternal)this).IsMainFeature, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("SupportedAddonFeature")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureInternal)this).SupportedAddonFeature = (string) content.GetValueForProperty("SupportedAddonFeature",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureInternal)this).SupportedAddonFeature, global::System.Convert.ToString); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal ApplicationInsightsComponentFeature(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("FeatureName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureInternal)this).FeatureName = (string) content.GetValueForProperty("FeatureName",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureInternal)this).FeatureName, global::System.Convert.ToString); - } - if (content.Contains("MeterId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureInternal)this).MeterId = (string) content.GetValueForProperty("MeterId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureInternal)this).MeterId, global::System.Convert.ToString); - } - if (content.Contains("MeterRateFrequency")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureInternal)this).MeterRateFrequency = (string) content.GetValueForProperty("MeterRateFrequency",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureInternal)this).MeterRateFrequency, global::System.Convert.ToString); - } - if (content.Contains("ResouceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureInternal)this).ResouceId = (string) content.GetValueForProperty("ResouceId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureInternal)this).ResouceId, global::System.Convert.ToString); - } - if (content.Contains("IsHidden")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureInternal)this).IsHidden = (bool?) content.GetValueForProperty("IsHidden",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureInternal)this).IsHidden, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("Capability")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureInternal)this).Capability = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapability[]) content.GetValueForProperty("Capability",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureInternal)this).Capability, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.ApplicationInsightsComponentFeatureCapabilityTypeConverter.ConvertFrom)); - } - if (content.Contains("Title")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureInternal)this).Title = (string) content.GetValueForProperty("Title",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureInternal)this).Title, global::System.Convert.ToString); - } - if (content.Contains("IsMainFeature")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureInternal)this).IsMainFeature = (bool?) content.GetValueForProperty("IsMainFeature",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureInternal)this).IsMainFeature, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("SupportedAddonFeature")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureInternal)this).SupportedAddonFeature = (string) content.GetValueForProperty("SupportedAddonFeature",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureInternal)this).SupportedAddonFeature, global::System.Convert.ToString); - } - AfterDeserializePSObject(content); - } - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeature DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new ApplicationInsightsComponentFeature(content); - } - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeature DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new ApplicationInsightsComponentFeature(content); - } - - /// - /// Creates a new instance of , deserializing the content from a json string. - /// - /// a string containing a JSON serialized instance of this model. - /// - /// an instance of the model class. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeature FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); - - /// Serializes this instance to a json string. - - /// a containing this model serialized to JSON text. - public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeAll)?.ToString(); - - public override string ToString() - { - var returnNow = false; - var result = global::System.String.Empty; - OverrideToString(ref result, ref returnNow); - if (returnNow) - { - return result; - } - return ToJsonString(); - } - } - /// An Application Insights component daily data volume cap status - [System.ComponentModel.TypeConverter(typeof(ApplicationInsightsComponentFeatureTypeConverter))] - public partial interface IApplicationInsightsComponentFeature - - { - - } -} \ No newline at end of file diff --git a/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/Api20150501/ApplicationInsightsComponentFeatureCapability.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentFeatureCapability.PowerShell.cs deleted file mode 100644 index 4f3efbfcd665..000000000000 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentFeatureCapability.PowerShell.cs +++ /dev/null @@ -1,209 +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 capability - [System.ComponentModel.TypeConverter(typeof(ApplicationInsightsComponentFeatureCapabilityTypeConverter))] - public partial class ApplicationInsightsComponentFeatureCapability - { - - /// - /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the - /// object before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Collections.IDictionary content that should be used. - - partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); - - /// - /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object - /// before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Management.Automation.PSObject content that should be used. - - partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); - - /// - /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Collections.IDictionary content that should be used. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); - - /// - /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Management.Automation.PSObject content that should be used. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); - - /// - /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior - /// - /// /// instance serialized to a string, normally it is a Json - /// /// set returnNow to true if you provide a customized OverrideToString function - - partial void OverrideToString(ref string stringResult, ref bool returnNow); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal ApplicationInsightsComponentFeatureCapability(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapabilityInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapabilityInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Description")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapabilityInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapabilityInternal)this).Description, global::System.Convert.ToString); - } - if (content.Contains("Value")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapabilityInternal)this).Value = (string) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapabilityInternal)this).Value, global::System.Convert.ToString); - } - if (content.Contains("Unit")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapabilityInternal)this).Unit = (string) content.GetValueForProperty("Unit",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapabilityInternal)this).Unit, global::System.Convert.ToString); - } - if (content.Contains("MeterId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapabilityInternal)this).MeterId = (string) content.GetValueForProperty("MeterId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapabilityInternal)this).MeterId, global::System.Convert.ToString); - } - if (content.Contains("MeterRateFrequency")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapabilityInternal)this).MeterRateFrequency = (string) content.GetValueForProperty("MeterRateFrequency",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapabilityInternal)this).MeterRateFrequency, global::System.Convert.ToString); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal ApplicationInsightsComponentFeatureCapability(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapabilityInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapabilityInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Description")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapabilityInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapabilityInternal)this).Description, global::System.Convert.ToString); - } - if (content.Contains("Value")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapabilityInternal)this).Value = (string) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapabilityInternal)this).Value, global::System.Convert.ToString); - } - if (content.Contains("Unit")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapabilityInternal)this).Unit = (string) content.GetValueForProperty("Unit",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapabilityInternal)this).Unit, global::System.Convert.ToString); - } - if (content.Contains("MeterId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapabilityInternal)this).MeterId = (string) content.GetValueForProperty("MeterId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapabilityInternal)this).MeterId, global::System.Convert.ToString); - } - if (content.Contains("MeterRateFrequency")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapabilityInternal)this).MeterRateFrequency = (string) content.GetValueForProperty("MeterRateFrequency",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapabilityInternal)this).MeterRateFrequency, global::System.Convert.ToString); - } - AfterDeserializePSObject(content); - } - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapability DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new ApplicationInsightsComponentFeatureCapability(content); - } - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapability DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new ApplicationInsightsComponentFeatureCapability(content); - } - - /// - /// Creates a new instance of , deserializing the content from - /// a json string. - /// - /// a string containing a JSON serialized instance of this model. - /// - /// an instance of the model class. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentFeatureCapability FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); - - /// Serializes this instance to a json string. - - /// a containing this model serialized to JSON text. - public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeAll)?.ToString(); - - public override string ToString() - { - var returnNow = false; - var result = global::System.String.Empty; - OverrideToString(ref result, ref returnNow); - if (returnNow) - { - return result; - } - return ToJsonString(); - } - } - /// An Application Insights component feature capability - [System.ComponentModel.TypeConverter(typeof(ApplicationInsightsComponentFeatureCapabilityTypeConverter))] - public partial interface IApplicationInsightsComponentFeatureCapability - - { - - } -} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentQuotaStatus.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentQuotaStatus.PowerShell.cs deleted file mode 100644 index 0125c98a1577..000000000000 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20150501/ApplicationInsightsComponentQuotaStatus.PowerShell.cs +++ /dev/null @@ -1,185 +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 daily data volume cap status - [System.ComponentModel.TypeConverter(typeof(ApplicationInsightsComponentQuotaStatusTypeConverter))] - public partial class ApplicationInsightsComponentQuotaStatus - { - - /// - /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the - /// object before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Collections.IDictionary content that should be used. - - partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); - - /// - /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object - /// before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Management.Automation.PSObject content that should be used. - - partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); - - /// - /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Collections.IDictionary content that should be used. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); - - /// - /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Management.Automation.PSObject content that should be used. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); - - /// - /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior - /// - /// /// instance serialized to a string, normally it is a Json - /// /// set returnNow to true if you provide a customized OverrideToString function - - partial void OverrideToString(ref string stringResult, ref bool returnNow); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal ApplicationInsightsComponentQuotaStatus(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("AppId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentQuotaStatusInternal)this).AppId = (string) content.GetValueForProperty("AppId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentQuotaStatusInternal)this).AppId, global::System.Convert.ToString); - } - if (content.Contains("ShouldBeThrottled")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentQuotaStatusInternal)this).ShouldBeThrottled = (bool?) content.GetValueForProperty("ShouldBeThrottled",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentQuotaStatusInternal)this).ShouldBeThrottled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("ExpirationTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentQuotaStatusInternal)this).ExpirationTime = (string) content.GetValueForProperty("ExpirationTime",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentQuotaStatusInternal)this).ExpirationTime, global::System.Convert.ToString); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal ApplicationInsightsComponentQuotaStatus(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("AppId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentQuotaStatusInternal)this).AppId = (string) content.GetValueForProperty("AppId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentQuotaStatusInternal)this).AppId, global::System.Convert.ToString); - } - if (content.Contains("ShouldBeThrottled")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentQuotaStatusInternal)this).ShouldBeThrottled = (bool?) content.GetValueForProperty("ShouldBeThrottled",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentQuotaStatusInternal)this).ShouldBeThrottled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("ExpirationTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentQuotaStatusInternal)this).ExpirationTime = (string) content.GetValueForProperty("ExpirationTime",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentQuotaStatusInternal)this).ExpirationTime, global::System.Convert.ToString); - } - AfterDeserializePSObject(content); - } - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentQuotaStatus DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new ApplicationInsightsComponentQuotaStatus(content); - } - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentQuotaStatus DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new ApplicationInsightsComponentQuotaStatus(content); - } - - /// - /// Creates a new instance of , deserializing the content from a json - /// string. - /// - /// a string containing a JSON serialized instance of this model. - /// - /// an instance of the model class. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20150501.IApplicationInsightsComponentQuotaStatus FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); - - /// Serializes this instance to a json string. - - /// a containing this model serialized to JSON text. - public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeAll)?.ToString(); - - public override string ToString() - { - var returnNow = false; - var result = global::System.String.Empty; - OverrideToString(ref result, ref returnNow); - if (returnNow) - { - return result; - } - return ToJsonString(); - } - } - /// An Application Insights component daily data volume cap status - [System.ComponentModel.TypeConverter(typeof(ApplicationInsightsComponentQuotaStatusTypeConverter))] - public partial interface IApplicationInsightsComponentQuotaStatus - - { - - } -} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ApplicationInsightsComponent.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ApplicationInsightsComponent.PowerShell.cs deleted file mode 100644 index f70785b705c8..000000000000 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ApplicationInsightsComponent.PowerShell.cs +++ /dev/null @@ -1,422 +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; - - /// An Application Insights component definition. - [System.ComponentModel.TypeConverter(typeof(ApplicationInsightsComponentTypeConverter))] - public partial class ApplicationInsightsComponent - { - - /// - /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the - /// object before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Collections.IDictionary content that should be used. - - partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); - - /// - /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object - /// before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Management.Automation.PSObject content that should be used. - - partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); - - /// - /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Collections.IDictionary content that should be used. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); - - /// - /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Management.Automation.PSObject content that should be used. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); - - /// - /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior - /// - /// /// instance serialized to a string, normally it is a Json - /// /// set returnNow to true if you provide a customized OverrideToString function - - partial void OverrideToString(ref string stringResult, ref bool returnNow); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal ApplicationInsightsComponent(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("Property")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.ApplicationInsightsComponentPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Kind")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).Kind = (string) content.GetValueForProperty("Kind",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).Kind, global::System.Convert.ToString); - } - if (content.Contains("Etag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).Etag, global::System.Convert.ToString); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResourceInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResourceInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResourceInternal)this).Type, global::System.Convert.ToString); - } - if (content.Contains("Location")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResourceInternal)this).Location, global::System.Convert.ToString); - } - if (content.Contains("Tag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.ComponentsResourceTagsTypeConverter.ConvertFrom); - } - if (content.Contains("ApplicationType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).ApplicationType = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.ApplicationType) content.GetValueForProperty("ApplicationType",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).ApplicationType, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.ApplicationType.CreateFrom); - } - if (content.Contains("FlowType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).FlowType = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.FlowType?) content.GetValueForProperty("FlowType",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).FlowType, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.FlowType.CreateFrom); - } - if (content.Contains("RequestSource")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).RequestSource = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.RequestSource?) content.GetValueForProperty("RequestSource",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).RequestSource, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.RequestSource.CreateFrom); - } - if (content.Contains("IngestionMode")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).IngestionMode = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.IngestionMode?) content.GetValueForProperty("IngestionMode",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).IngestionMode, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.IngestionMode.CreateFrom); - } - if (content.Contains("ApplicationId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).ApplicationId = (string) content.GetValueForProperty("ApplicationId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).ApplicationId, global::System.Convert.ToString); - } - if (content.Contains("AppId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).AppId = (string) content.GetValueForProperty("AppId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).AppId, global::System.Convert.ToString); - } - if (content.Contains("PropertiesName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).PropertiesName = (string) content.GetValueForProperty("PropertiesName",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).PropertiesName, global::System.Convert.ToString); - } - if (content.Contains("InstrumentationKey")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).InstrumentationKey = (string) content.GetValueForProperty("InstrumentationKey",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).InstrumentationKey, global::System.Convert.ToString); - } - if (content.Contains("CreationDate")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).CreationDate = (global::System.DateTime?) content.GetValueForProperty("CreationDate",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).CreationDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("TenantId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).TenantId = (string) content.GetValueForProperty("TenantId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).TenantId, global::System.Convert.ToString); - } - if (content.Contains("HockeyAppId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).HockeyAppId = (string) content.GetValueForProperty("HockeyAppId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).HockeyAppId, global::System.Convert.ToString); - } - if (content.Contains("HockeyAppToken")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).HockeyAppToken = (string) content.GetValueForProperty("HockeyAppToken",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).HockeyAppToken, global::System.Convert.ToString); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).ProvisioningState, global::System.Convert.ToString); - } - if (content.Contains("SamplingPercentage")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).SamplingPercentage = (double?) content.GetValueForProperty("SamplingPercentage",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).SamplingPercentage, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); - } - if (content.Contains("ConnectionString")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).ConnectionString = (string) content.GetValueForProperty("ConnectionString",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).ConnectionString, global::System.Convert.ToString); - } - if (content.Contains("RetentionInDay")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).RetentionInDay = (int?) content.GetValueForProperty("RetentionInDay",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).RetentionInDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); - } - if (content.Contains("DisableIPMasking")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).DisableIPMasking = (bool?) content.GetValueForProperty("DisableIPMasking",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).DisableIPMasking, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("ImmediatePurgeDataOn30Day")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).ImmediatePurgeDataOn30Day = (bool?) content.GetValueForProperty("ImmediatePurgeDataOn30Day",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).ImmediatePurgeDataOn30Day, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("WorkspaceResourceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).WorkspaceResourceId = (string) content.GetValueForProperty("WorkspaceResourceId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).WorkspaceResourceId, global::System.Convert.ToString); - } - if (content.Contains("LaMigrationDate")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).LaMigrationDate = (global::System.DateTime?) content.GetValueForProperty("LaMigrationDate",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).LaMigrationDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("PrivateLinkScopedResource")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).PrivateLinkScopedResource = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IPrivateLinkScopedResource[]) content.GetValueForProperty("PrivateLinkScopedResource",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).PrivateLinkScopedResource, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.PrivateLinkScopedResourceTypeConverter.ConvertFrom)); - } - if (content.Contains("PublicNetworkAccessForIngestion")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).PublicNetworkAccessForIngestion = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PublicNetworkAccessType?) content.GetValueForProperty("PublicNetworkAccessForIngestion",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).PublicNetworkAccessForIngestion, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PublicNetworkAccessType.CreateFrom); - } - if (content.Contains("PublicNetworkAccessForQuery")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).PublicNetworkAccessForQuery = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PublicNetworkAccessType?) content.GetValueForProperty("PublicNetworkAccessForQuery",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).PublicNetworkAccessForQuery, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PublicNetworkAccessType.CreateFrom); - } - if (content.Contains("DisableLocalAuth")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).DisableLocalAuth = (bool?) content.GetValueForProperty("DisableLocalAuth",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).DisableLocalAuth, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("ForceCustomerStorageForProfiler")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).ForceCustomerStorageForProfiler = (bool?) content.GetValueForProperty("ForceCustomerStorageForProfiler",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).ForceCustomerStorageForProfiler, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal ApplicationInsightsComponent(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("Property")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.ApplicationInsightsComponentPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Kind")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).Kind = (string) content.GetValueForProperty("Kind",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).Kind, global::System.Convert.ToString); - } - if (content.Contains("Etag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).Etag, global::System.Convert.ToString); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResourceInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResourceInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResourceInternal)this).Type, global::System.Convert.ToString); - } - if (content.Contains("Location")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResourceInternal)this).Location, global::System.Convert.ToString); - } - if (content.Contains("Tag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.ComponentsResourceTagsTypeConverter.ConvertFrom); - } - if (content.Contains("ApplicationType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).ApplicationType = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.ApplicationType) content.GetValueForProperty("ApplicationType",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).ApplicationType, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.ApplicationType.CreateFrom); - } - if (content.Contains("FlowType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).FlowType = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.FlowType?) content.GetValueForProperty("FlowType",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).FlowType, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.FlowType.CreateFrom); - } - if (content.Contains("RequestSource")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).RequestSource = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.RequestSource?) content.GetValueForProperty("RequestSource",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).RequestSource, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.RequestSource.CreateFrom); - } - if (content.Contains("IngestionMode")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).IngestionMode = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.IngestionMode?) content.GetValueForProperty("IngestionMode",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).IngestionMode, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.IngestionMode.CreateFrom); - } - if (content.Contains("ApplicationId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).ApplicationId = (string) content.GetValueForProperty("ApplicationId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).ApplicationId, global::System.Convert.ToString); - } - if (content.Contains("AppId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).AppId = (string) content.GetValueForProperty("AppId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).AppId, global::System.Convert.ToString); - } - if (content.Contains("PropertiesName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).PropertiesName = (string) content.GetValueForProperty("PropertiesName",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).PropertiesName, global::System.Convert.ToString); - } - if (content.Contains("InstrumentationKey")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).InstrumentationKey = (string) content.GetValueForProperty("InstrumentationKey",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).InstrumentationKey, global::System.Convert.ToString); - } - if (content.Contains("CreationDate")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).CreationDate = (global::System.DateTime?) content.GetValueForProperty("CreationDate",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).CreationDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("TenantId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).TenantId = (string) content.GetValueForProperty("TenantId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).TenantId, global::System.Convert.ToString); - } - if (content.Contains("HockeyAppId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).HockeyAppId = (string) content.GetValueForProperty("HockeyAppId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).HockeyAppId, global::System.Convert.ToString); - } - if (content.Contains("HockeyAppToken")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).HockeyAppToken = (string) content.GetValueForProperty("HockeyAppToken",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).HockeyAppToken, global::System.Convert.ToString); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).ProvisioningState, global::System.Convert.ToString); - } - if (content.Contains("SamplingPercentage")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).SamplingPercentage = (double?) content.GetValueForProperty("SamplingPercentage",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).SamplingPercentage, (__y)=> (double) global::System.Convert.ChangeType(__y, typeof(double))); - } - if (content.Contains("ConnectionString")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).ConnectionString = (string) content.GetValueForProperty("ConnectionString",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).ConnectionString, global::System.Convert.ToString); - } - if (content.Contains("RetentionInDay")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).RetentionInDay = (int?) content.GetValueForProperty("RetentionInDay",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).RetentionInDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); - } - if (content.Contains("DisableIPMasking")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).DisableIPMasking = (bool?) content.GetValueForProperty("DisableIPMasking",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).DisableIPMasking, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("ImmediatePurgeDataOn30Day")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).ImmediatePurgeDataOn30Day = (bool?) content.GetValueForProperty("ImmediatePurgeDataOn30Day",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).ImmediatePurgeDataOn30Day, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("WorkspaceResourceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).WorkspaceResourceId = (string) content.GetValueForProperty("WorkspaceResourceId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).WorkspaceResourceId, global::System.Convert.ToString); - } - if (content.Contains("LaMigrationDate")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).LaMigrationDate = (global::System.DateTime?) content.GetValueForProperty("LaMigrationDate",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).LaMigrationDate, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("PrivateLinkScopedResource")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).PrivateLinkScopedResource = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IPrivateLinkScopedResource[]) content.GetValueForProperty("PrivateLinkScopedResource",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).PrivateLinkScopedResource, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.PrivateLinkScopedResourceTypeConverter.ConvertFrom)); - } - if (content.Contains("PublicNetworkAccessForIngestion")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).PublicNetworkAccessForIngestion = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PublicNetworkAccessType?) content.GetValueForProperty("PublicNetworkAccessForIngestion",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).PublicNetworkAccessForIngestion, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PublicNetworkAccessType.CreateFrom); - } - if (content.Contains("PublicNetworkAccessForQuery")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).PublicNetworkAccessForQuery = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PublicNetworkAccessType?) content.GetValueForProperty("PublicNetworkAccessForQuery",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).PublicNetworkAccessForQuery, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PublicNetworkAccessType.CreateFrom); - } - if (content.Contains("DisableLocalAuth")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).DisableLocalAuth = (bool?) content.GetValueForProperty("DisableLocalAuth",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).DisableLocalAuth, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("ForceCustomerStorageForProfiler")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).ForceCustomerStorageForProfiler = (bool?) content.GetValueForProperty("ForceCustomerStorageForProfiler",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal)this).ForceCustomerStorageForProfiler, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - AfterDeserializePSObject(content); - } - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponent DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new ApplicationInsightsComponent(content); - } - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponent DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new ApplicationInsightsComponent(content); - } - - /// - /// Creates a new instance of , deserializing the content from a json string. - /// - /// a string containing a JSON serialized instance of this model. - /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponent FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); - - /// Serializes this instance to a json string. - - /// a containing this model serialized to JSON text. - public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeAll)?.ToString(); - - public override string ToString() - { - var returnNow = false; - var result = global::System.String.Empty; - OverrideToString(ref result, ref returnNow); - if (returnNow) - { - return result; - } - return ToJsonString(); - } - } - /// An Application Insights component definition. - [System.ComponentModel.TypeConverter(typeof(ApplicationInsightsComponentTypeConverter))] - public partial interface IApplicationInsightsComponent - - { - - } -} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ApplicationInsightsComponent.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ApplicationInsightsComponent.cs deleted file mode 100644 index bf2721180d89..000000000000 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ApplicationInsightsComponent.cs +++ /dev/null @@ -1,596 +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 static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; - - /// An Application Insights component definition. - public partial class ApplicationInsightsComponent : - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponent, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IValidates - { - /// - /// Backing field for Inherited model - /// - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResource __componentsResource = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.ComponentsResource(); - - /// Application Insights Unique ID for your Application. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] - public string AppId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)Property).AppId; } - - /// - /// The unique ID of your application. This field mirrors the 'Name' field and cannot be changed. - /// - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] - public string ApplicationId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)Property).ApplicationId; } - - /// Type of application being monitored. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.ApplicationType? ApplicationType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)Property).ApplicationType; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)Property).ApplicationType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.ApplicationType)""); } - - /// Application Insights component connection string. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] - public string ConnectionString { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)Property).ConnectionString; } - - /// Creation Date for the Application Insights component, in ISO 8601 format. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] - public global::System.DateTime? CreationDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)Property).CreationDate; } - - /// Disable IP masking. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] - public bool? DisableIPMasking { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)Property).DisableIPMasking; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)Property).DisableIPMasking = value ?? default(bool); } - - /// Disable Non-AAD based Auth. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] - public bool? DisableLocalAuth { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)Property).DisableLocalAuth; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)Property).DisableLocalAuth = value ?? default(bool); } - - /// Backing field for property. - private string _etag; - - /// Resource etag - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] - public string Etag { get => this._etag; set => this._etag = value; } - - /// - /// Used by the Application Insights system to determine what kind of flow this component was created by. This is to be set - /// to 'Bluefield' when creating/updating a component via the REST API. - /// - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.FlowType? FlowType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)Property).FlowType; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)Property).FlowType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.FlowType)""); } - - /// Force users to create their own storage account for profiler and debugger. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] - public bool? ForceCustomerStorageForProfiler { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)Property).ForceCustomerStorageForProfiler; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)Property).ForceCustomerStorageForProfiler = value ?? default(bool); } - - /// - /// The unique application ID created when a new application is added to HockeyApp, used for communications with HockeyApp. - /// - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] - public string HockeyAppId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)Property).HockeyAppId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)Property).HockeyAppId = value ?? null; } - - /// - /// Token used to authenticate communications with between Application Insights and HockeyApp. - /// - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] - public string HockeyAppToken { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)Property).HockeyAppToken; } - - /// Azure resource Id - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inherited)] - public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResourceInternal)__componentsResource).Id; } - - /// Purge data immediately after 30 days. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] - public bool? ImmediatePurgeDataOn30Day { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)Property).ImmediatePurgeDataOn30Day; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)Property).ImmediatePurgeDataOn30Day = value ?? default(bool); } - - /// Indicates the flow of the ingestion. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.IngestionMode? IngestionMode { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)Property).IngestionMode; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)Property).IngestionMode = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.IngestionMode)""); } - - /// - /// Application Insights Instrumentation key. A read-only value that applications can use to identify the destination for - /// all telemetry sent to Azure Application Insights. This value will be supplied upon construction of each new Application - /// Insights component. - /// - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] - public string InstrumentationKey { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)Property).InstrumentationKey; } - - /// Backing field for property. - private string _kind; - - /// - /// The kind of application that this component refers to, used to customize UI. This value is a freeform string, values should - /// typically be one of the following: web, ios, other, store, java, phone. - /// - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] - public string Kind { get => this._kind; set => this._kind = value; } - - /// The date which the component got migrated to LA, in ISO 8601 format. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] - public global::System.DateTime? LaMigrationDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)Property).LaMigrationDate; } - - /// Resource location - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inherited)] - public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResourceInternal)__componentsResource).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResourceInternal)__componentsResource).Location = value ; } - - /// Internal Acessors for AppId - string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal.AppId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)Property).AppId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)Property).AppId = value; } - - /// Internal Acessors for ApplicationId - string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal.ApplicationId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)Property).ApplicationId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)Property).ApplicationId = value; } - - /// Internal Acessors for ConnectionString - string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal.ConnectionString { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)Property).ConnectionString; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)Property).ConnectionString = value; } - - /// Internal Acessors for CreationDate - global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal.CreationDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)Property).CreationDate; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)Property).CreationDate = value; } - - /// Internal Acessors for HockeyAppToken - string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal.HockeyAppToken { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)Property).HockeyAppToken; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)Property).HockeyAppToken = value; } - - /// Internal Acessors for InstrumentationKey - string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal.InstrumentationKey { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)Property).InstrumentationKey; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)Property).InstrumentationKey = value; } - - /// Internal Acessors for LaMigrationDate - global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal.LaMigrationDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)Property).LaMigrationDate; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)Property).LaMigrationDate = value; } - - /// Internal Acessors for PrivateLinkScopedResource - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IPrivateLinkScopedResource[] Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal.PrivateLinkScopedResource { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)Property).PrivateLinkScopedResource; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)Property).PrivateLinkScopedResource = value; } - - /// Internal Acessors for PropertiesName - string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal.PropertiesName { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)Property).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)Property).Name = value; } - - /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentProperties Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.ApplicationInsightsComponentProperties()); set { {_property = value;} } } - - /// Internal Acessors for ProvisioningState - string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)Property).ProvisioningState = value; } - - /// Internal Acessors for TenantId - string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentInternal.TenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)Property).TenantId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)Property).TenantId = value; } - - /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResourceInternal)__componentsResource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResourceInternal)__componentsResource).Id = value; } - - /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResourceInternal)__componentsResource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResourceInternal)__componentsResource).Name = value; } - - /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResourceInternal)__componentsResource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResourceInternal)__componentsResource).Type = value; } - - /// Azure resource name - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inherited)] - public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResourceInternal)__componentsResource).Name; } - - /// List of linked private link scope resources. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IPrivateLinkScopedResource[] PrivateLinkScopedResource { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)Property).PrivateLinkScopedResource; } - - /// Application name. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] - public string PropertiesName { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)Property).Name; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentProperties _property; - - /// Properties that define an Application Insights component resource. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.ApplicationInsightsComponentProperties()); set => this._property = value; } - - /// - /// Current state of this component: whether or not is has been provisioned within the resource group it is defined. Users - /// cannot change this value but are able to read from it. Values will include Succeeded, Deploying, Canceled, and Failed. - /// - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] - public string ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)Property).ProvisioningState; } - - /// The network access type for accessing Application Insights ingestion. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PublicNetworkAccessType? PublicNetworkAccessForIngestion { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)Property).PublicNetworkAccessForIngestion; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)Property).PublicNetworkAccessForIngestion = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PublicNetworkAccessType)""); } - - /// The network access type for accessing Application Insights query. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PublicNetworkAccessType? PublicNetworkAccessForQuery { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)Property).PublicNetworkAccessForQuery; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)Property).PublicNetworkAccessForQuery = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PublicNetworkAccessType)""); } - - /// - /// Describes what tool created this Application Insights component. Customers using this API should set this to the default - /// 'rest'. - /// - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.RequestSource? RequestSource { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)Property).RequestSource; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)Property).RequestSource = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.RequestSource)""); } - - /// Gets the resource group name - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] - public string ResourceGroupName { get => (new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Success ? new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Groups["resourceGroupName"].Value : null); } - - /// Retention period in days. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] - public int? RetentionInDay { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)Property).RetentionInDay; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)Property).RetentionInDay = value ?? default(int); } - - /// - /// Percentage of the data produced by the application being monitored that is being sampled for Application Insights telemetry. - /// - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] - public double? SamplingPercentage { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)Property).SamplingPercentage; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)Property).SamplingPercentage = value ?? default(double); } - - /// Resource tags - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResourceInternal)__componentsResource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResourceInternal)__componentsResource).Tag = value ?? null /* model class */; } - - /// Azure Tenant Id. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] - public string TenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)Property).TenantId; } - - /// Azure resource type - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inherited)] - public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResourceInternal)__componentsResource).Type; } - - /// - /// Resource Id of the log analytics workspace which the data will be ingested to. This property is required to create an - /// application with this API version. Applications from older versions will not have this property. - /// - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] - public string WorkspaceResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)Property).WorkspaceResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentPropertiesInternal)Property).WorkspaceResourceId = value ?? null; } - - /// Creates an new instance. - public ApplicationInsightsComponent() - { - - } - - /// Validates that this object meets the validation criteria. - /// an instance that will receive validation - /// events. - /// - /// A that will be complete when validation is completed. - /// - public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener) - { - await eventListener.AssertNotNull(nameof(__componentsResource), __componentsResource); - await eventListener.AssertObjectIsValid(nameof(__componentsResource), __componentsResource); - } - } - /// An Application Insights component definition. - public partial interface IApplicationInsightsComponent : - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResource - { - /// Application Insights Unique ID for your Application. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"Application Insights Unique ID for your Application.", - SerializedName = @"AppId", - PossibleTypes = new [] { typeof(string) })] - string AppId { get; } - /// - /// The unique ID of your application. This field mirrors the 'Name' field and cannot be changed. - /// - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The unique ID of your application. This field mirrors the 'Name' field and cannot be changed.", - SerializedName = @"ApplicationId", - PossibleTypes = new [] { typeof(string) })] - string ApplicationId { get; } - /// Type of application being monitored. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Type of application being monitored.", - SerializedName = @"Application_Type", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.ApplicationType) })] - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.ApplicationType? ApplicationType { get; set; } - /// Application Insights component connection string. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"Application Insights component connection string.", - SerializedName = @"ConnectionString", - PossibleTypes = new [] { typeof(string) })] - string ConnectionString { get; } - /// Creation Date for the Application Insights component, in ISO 8601 format. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"Creation Date for the Application Insights component, in ISO 8601 format.", - SerializedName = @"CreationDate", - PossibleTypes = new [] { typeof(global::System.DateTime) })] - global::System.DateTime? CreationDate { get; } - /// Disable IP masking. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Disable IP masking.", - SerializedName = @"DisableIpMasking", - PossibleTypes = new [] { typeof(bool) })] - bool? DisableIPMasking { get; set; } - /// Disable Non-AAD based Auth. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Disable Non-AAD based Auth.", - SerializedName = @"DisableLocalAuth", - PossibleTypes = new [] { typeof(bool) })] - bool? DisableLocalAuth { get; set; } - /// Resource etag - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Resource etag", - SerializedName = @"etag", - PossibleTypes = new [] { typeof(string) })] - string Etag { get; set; } - /// - /// Used by the Application Insights system to determine what kind of flow this component was created by. This is to be set - /// to 'Bluefield' when creating/updating a component via the REST API. - /// - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Used by the Application Insights system to determine what kind of flow this component was created by. This is to be set to 'Bluefield' when creating/updating a component via the REST API.", - SerializedName = @"Flow_Type", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.FlowType) })] - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.FlowType? FlowType { get; set; } - /// Force users to create their own storage account for profiler and debugger. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Force users to create their own storage account for profiler and debugger.", - SerializedName = @"ForceCustomerStorageForProfiler", - PossibleTypes = new [] { typeof(bool) })] - bool? ForceCustomerStorageForProfiler { get; set; } - /// - /// The unique application ID created when a new application is added to HockeyApp, used for communications with HockeyApp. - /// - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The unique application ID created when a new application is added to HockeyApp, used for communications with HockeyApp.", - SerializedName = @"HockeyAppId", - PossibleTypes = new [] { typeof(string) })] - string HockeyAppId { get; set; } - /// - /// Token used to authenticate communications with between Application Insights and HockeyApp. - /// - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"Token used to authenticate communications with between Application Insights and HockeyApp.", - SerializedName = @"HockeyAppToken", - PossibleTypes = new [] { typeof(string) })] - string HockeyAppToken { get; } - /// Purge data immediately after 30 days. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Purge data immediately after 30 days.", - SerializedName = @"ImmediatePurgeDataOn30Days", - PossibleTypes = new [] { typeof(bool) })] - bool? ImmediatePurgeDataOn30Day { get; set; } - /// Indicates the flow of the ingestion. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Indicates the flow of the ingestion.", - SerializedName = @"IngestionMode", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.IngestionMode) })] - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.IngestionMode? IngestionMode { get; set; } - /// - /// Application Insights Instrumentation key. A read-only value that applications can use to identify the destination for - /// all telemetry sent to Azure Application Insights. This value will be supplied upon construction of each new Application - /// Insights component. - /// - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"Application Insights Instrumentation key. A read-only value that applications can use to identify the destination for all telemetry sent to Azure Application Insights. This value will be supplied upon construction of each new Application Insights component.", - SerializedName = @"InstrumentationKey", - PossibleTypes = new [] { typeof(string) })] - string InstrumentationKey { get; } - /// - /// The kind of application that this component refers to, used to customize UI. This value is a freeform string, values should - /// typically be one of the following: web, ios, other, store, java, phone. - /// - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The kind of application that this component refers to, used to customize UI. This value is a freeform string, values should typically be one of the following: web, ios, other, store, java, phone.", - SerializedName = @"kind", - PossibleTypes = new [] { typeof(string) })] - string Kind { get; set; } - /// The date which the component got migrated to LA, in ISO 8601 format. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The date which the component got migrated to LA, in ISO 8601 format.", - SerializedName = @"LaMigrationDate", - PossibleTypes = new [] { typeof(global::System.DateTime) })] - global::System.DateTime? LaMigrationDate { get; } - /// List of linked private link scope resources. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"List of linked private link scope resources.", - SerializedName = @"PrivateLinkScopedResources", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IPrivateLinkScopedResource) })] - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IPrivateLinkScopedResource[] PrivateLinkScopedResource { get; } - /// Application name. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"Application name.", - SerializedName = @"Name", - PossibleTypes = new [] { typeof(string) })] - string PropertiesName { get; } - /// - /// Current state of this component: whether or not is has been provisioned within the resource group it is defined. Users - /// cannot change this value but are able to read from it. Values will include Succeeded, Deploying, Canceled, and Failed. - /// - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"Current state of this component: whether or not is has been provisioned within the resource group it is defined. Users cannot change this value but are able to read from it. Values will include Succeeded, Deploying, Canceled, and Failed.", - SerializedName = @"provisioningState", - PossibleTypes = new [] { typeof(string) })] - string ProvisioningState { get; } - /// The network access type for accessing Application Insights ingestion. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The network access type for accessing Application Insights ingestion.", - SerializedName = @"publicNetworkAccessForIngestion", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PublicNetworkAccessType) })] - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PublicNetworkAccessType? PublicNetworkAccessForIngestion { get; set; } - /// The network access type for accessing Application Insights query. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The network access type for accessing Application Insights query.", - SerializedName = @"publicNetworkAccessForQuery", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PublicNetworkAccessType) })] - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PublicNetworkAccessType? PublicNetworkAccessForQuery { get; set; } - /// - /// Describes what tool created this Application Insights component. Customers using this API should set this to the default - /// 'rest'. - /// - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Describes what tool created this Application Insights component. Customers using this API should set this to the default 'rest'.", - SerializedName = @"Request_Source", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.RequestSource) })] - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.RequestSource? RequestSource { get; set; } - /// Retention period in days. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Retention period in days.", - SerializedName = @"RetentionInDays", - PossibleTypes = new [] { typeof(int) })] - int? RetentionInDay { get; set; } - /// - /// Percentage of the data produced by the application being monitored that is being sampled for Application Insights telemetry. - /// - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Percentage of the data produced by the application being monitored that is being sampled for Application Insights telemetry.", - SerializedName = @"SamplingPercentage", - PossibleTypes = new [] { typeof(double) })] - double? SamplingPercentage { get; set; } - /// Azure Tenant Id. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"Azure Tenant Id.", - SerializedName = @"TenantId", - PossibleTypes = new [] { typeof(string) })] - string TenantId { get; } - /// - /// Resource Id of the log analytics workspace which the data will be ingested to. This property is required to create an - /// application with this API version. Applications from older versions will not have this property. - /// - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Resource Id of the log analytics workspace which the data will be ingested to. This property is required to create an application with this API version. Applications from older versions will not have this property.", - SerializedName = @"WorkspaceResourceId", - PossibleTypes = new [] { typeof(string) })] - string WorkspaceResourceId { get; set; } - - } - /// An Application Insights component definition. - internal partial interface IApplicationInsightsComponentInternal : - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResourceInternal - { - /// Application Insights Unique ID for your Application. - string AppId { get; set; } - /// - /// The unique ID of your application. This field mirrors the 'Name' field and cannot be changed. - /// - string ApplicationId { get; set; } - /// Type of application being monitored. - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.ApplicationType? ApplicationType { get; set; } - /// Application Insights component connection string. - string ConnectionString { get; set; } - /// Creation Date for the Application Insights component, in ISO 8601 format. - global::System.DateTime? CreationDate { get; set; } - /// Disable IP masking. - bool? DisableIPMasking { get; set; } - /// Disable Non-AAD based Auth. - bool? DisableLocalAuth { get; set; } - /// Resource etag - string Etag { get; set; } - /// - /// Used by the Application Insights system to determine what kind of flow this component was created by. This is to be set - /// to 'Bluefield' when creating/updating a component via the REST API. - /// - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.FlowType? FlowType { get; set; } - /// Force users to create their own storage account for profiler and debugger. - bool? ForceCustomerStorageForProfiler { get; set; } - /// - /// The unique application ID created when a new application is added to HockeyApp, used for communications with HockeyApp. - /// - string HockeyAppId { get; set; } - /// - /// Token used to authenticate communications with between Application Insights and HockeyApp. - /// - string HockeyAppToken { get; set; } - /// Purge data immediately after 30 days. - bool? ImmediatePurgeDataOn30Day { get; set; } - /// Indicates the flow of the ingestion. - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.IngestionMode? IngestionMode { get; set; } - /// - /// Application Insights Instrumentation key. A read-only value that applications can use to identify the destination for - /// all telemetry sent to Azure Application Insights. This value will be supplied upon construction of each new Application - /// Insights component. - /// - string InstrumentationKey { get; set; } - /// - /// The kind of application that this component refers to, used to customize UI. This value is a freeform string, values should - /// typically be one of the following: web, ios, other, store, java, phone. - /// - string Kind { get; set; } - /// The date which the component got migrated to LA, in ISO 8601 format. - global::System.DateTime? LaMigrationDate { get; set; } - /// List of linked private link scope resources. - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IPrivateLinkScopedResource[] PrivateLinkScopedResource { get; set; } - /// Application name. - string PropertiesName { get; set; } - /// Properties that define an Application Insights component resource. - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentProperties Property { get; set; } - /// - /// Current state of this component: whether or not is has been provisioned within the resource group it is defined. Users - /// cannot change this value but are able to read from it. Values will include Succeeded, Deploying, Canceled, and Failed. - /// - string ProvisioningState { get; set; } - /// The network access type for accessing Application Insights ingestion. - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PublicNetworkAccessType? PublicNetworkAccessForIngestion { get; set; } - /// The network access type for accessing Application Insights query. - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PublicNetworkAccessType? PublicNetworkAccessForQuery { get; set; } - /// - /// Describes what tool created this Application Insights component. Customers using this API should set this to the default - /// 'rest'. - /// - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.RequestSource? RequestSource { get; set; } - /// Retention period in days. - int? RetentionInDay { get; set; } - /// - /// Percentage of the data produced by the application being monitored that is being sampled for Application Insights telemetry. - /// - double? SamplingPercentage { get; set; } - /// Azure Tenant Id. - string TenantId { get; set; } - /// - /// Resource Id of the log analytics workspace which the data will be ingested to. This property is required to create an - /// application with this API version. Applications from older versions will not have this property. - /// - string WorkspaceResourceId { get; set; } - - } -} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ApplicationInsightsComponentListResult.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ApplicationInsightsComponentListResult.PowerShell.cs deleted file mode 100644 index e5eb02c22be1..000000000000 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ApplicationInsightsComponentListResult.PowerShell.cs +++ /dev/null @@ -1,177 +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; - - /// Describes the list of Application Insights Resources. - [System.ComponentModel.TypeConverter(typeof(ApplicationInsightsComponentListResultTypeConverter))] - public partial class ApplicationInsightsComponentListResult - { - - /// - /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the - /// object before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Collections.IDictionary content that should be used. - - partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); - - /// - /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object - /// before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Management.Automation.PSObject content that should be used. - - partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); - - /// - /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Collections.IDictionary content that should be used. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); - - /// - /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Management.Automation.PSObject content that should be used. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); - - /// - /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior - /// - /// /// instance serialized to a string, normally it is a Json - /// /// set returnNow to true if you provide a customized OverrideToString function - - partial void OverrideToString(ref string stringResult, ref bool returnNow); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal ApplicationInsightsComponentListResult(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("Value")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponent[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.ApplicationInsightsComponentTypeConverter.ConvertFrom)); - } - if (content.Contains("NextLink")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentListResultInternal)this).NextLink, global::System.Convert.ToString); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal ApplicationInsightsComponentListResult(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("Value")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponent[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.ApplicationInsightsComponentTypeConverter.ConvertFrom)); - } - if (content.Contains("NextLink")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentListResultInternal)this).NextLink, global::System.Convert.ToString); - } - AfterDeserializePSObject(content); - } - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentListResult DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new ApplicationInsightsComponentListResult(content); - } - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentListResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new ApplicationInsightsComponentListResult(content); - } - - /// - /// Creates a new instance of , deserializing the content from a json - /// string. - /// - /// a string containing a JSON serialized instance of this model. - /// - /// an instance of the model class. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IApplicationInsightsComponentListResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); - - /// Serializes this instance to a json string. - - /// a containing this model serialized to JSON text. - public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeAll)?.ToString(); - - public override string ToString() - { - var returnNow = false; - var result = global::System.String.Empty; - OverrideToString(ref result, ref returnNow); - if (returnNow) - { - return result; - } - return ToJsonString(); - } - } - /// Describes the list of Application Insights Resources. - [System.ComponentModel.TypeConverter(typeof(ApplicationInsightsComponentListResultTypeConverter))] - public partial interface IApplicationInsightsComponentListResult - - { - - } -} \ No newline at end of file diff --git a/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/Api202002/ComponentPurgeBodyFilters.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ComponentPurgeBodyFilters.PowerShell.cs deleted file mode 100644 index 2f61f9305f4e..000000000000 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ComponentPurgeBodyFilters.PowerShell.cs +++ /dev/null @@ -1,190 +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; - - /// User-defined filters to return data which will be purged from the table. - [System.ComponentModel.TypeConverter(typeof(ComponentPurgeBodyFiltersTypeConverter))] - public partial class ComponentPurgeBodyFilters - { - - /// - /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the - /// object before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Collections.IDictionary content that should be used. - - partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); - - /// - /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object - /// before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Management.Automation.PSObject content that should be used. - - partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); - - /// - /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Collections.IDictionary content that should be used. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); - - /// - /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Management.Automation.PSObject content that should be used. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); - - /// - /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior - /// - /// /// instance serialized to a string, normally it is a Json - /// /// set returnNow to true if you provide a customized OverrideToString function - - partial void OverrideToString(ref string stringResult, ref bool returnNow); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal ComponentPurgeBodyFilters(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("Column")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentPurgeBodyFiltersInternal)this).Column = (string) content.GetValueForProperty("Column",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentPurgeBodyFiltersInternal)this).Column, global::System.Convert.ToString); - } - if (content.Contains("Operator")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentPurgeBodyFiltersInternal)this).Operator = (string) content.GetValueForProperty("Operator",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentPurgeBodyFiltersInternal)this).Operator, global::System.Convert.ToString); - } - if (content.Contains("Value")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentPurgeBodyFiltersInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IAny) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentPurgeBodyFiltersInternal)this).Value, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.AnyTypeConverter.ConvertFrom); - } - if (content.Contains("Key")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentPurgeBodyFiltersInternal)this).Key = (string) content.GetValueForProperty("Key",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentPurgeBodyFiltersInternal)this).Key, global::System.Convert.ToString); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal ComponentPurgeBodyFilters(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("Column")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentPurgeBodyFiltersInternal)this).Column = (string) content.GetValueForProperty("Column",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentPurgeBodyFiltersInternal)this).Column, global::System.Convert.ToString); - } - if (content.Contains("Operator")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentPurgeBodyFiltersInternal)this).Operator = (string) content.GetValueForProperty("Operator",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentPurgeBodyFiltersInternal)this).Operator, global::System.Convert.ToString); - } - if (content.Contains("Value")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentPurgeBodyFiltersInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IAny) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentPurgeBodyFiltersInternal)this).Value, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.AnyTypeConverter.ConvertFrom); - } - if (content.Contains("Key")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentPurgeBodyFiltersInternal)this).Key = (string) content.GetValueForProperty("Key",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentPurgeBodyFiltersInternal)this).Key, global::System.Convert.ToString); - } - AfterDeserializePSObject(content); - } - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentPurgeBodyFilters DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new ComponentPurgeBodyFilters(content); - } - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentPurgeBodyFilters DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new ComponentPurgeBodyFilters(content); - } - - /// - /// Creates a new instance of , deserializing the content from a json string. - /// - /// a string containing a JSON serialized instance of this model. - /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentPurgeBodyFilters FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); - - /// Serializes this instance to a json string. - - /// a containing this model serialized to JSON text. - public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeAll)?.ToString(); - - public override string ToString() - { - var returnNow = false; - var result = global::System.String.Empty; - OverrideToString(ref result, ref returnNow); - if (returnNow) - { - return result; - } - return ToJsonString(); - } - } - /// User-defined filters to return data which will be purged from the table. - [System.ComponentModel.TypeConverter(typeof(ComponentPurgeBodyFiltersTypeConverter))] - public partial interface IComponentPurgeBodyFilters - - { - - } -} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ComponentPurgeStatusResponse.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ComponentPurgeStatusResponse.cs deleted file mode 100644 index 7e350dcdf35f..000000000000 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ComponentPurgeStatusResponse.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.ApplicationInsights.Models.Api202002 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; - - /// Response containing status for a specific purge operation. - public partial class ComponentPurgeStatusResponse : - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentPurgeStatusResponse, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentPurgeStatusResponseInternal - { - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PurgeState _status; - - /// Status of the operation represented by the requested Id. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PurgeState Status { get => this._status; set => this._status = value; } - - /// Creates an new instance. - public ComponentPurgeStatusResponse() - { - - } - } - /// Response containing status for a specific purge operation. - public partial interface IComponentPurgeStatusResponse : - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IJsonSerializable - { - /// Status of the operation represented by the requested Id. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"Status of the operation represented by the requested Id.", - SerializedName = @"status", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PurgeState) })] - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PurgeState Status { get; set; } - - } - /// Response containing status for a specific purge operation. - internal partial interface IComponentPurgeStatusResponseInternal - - { - /// Status of the operation represented by the requested Id. - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.PurgeState Status { get; set; } - - } -} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ComponentsResource.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ComponentsResource.PowerShell.cs deleted file mode 100644 index 6dc7341b4784..000000000000 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ComponentsResource.PowerShell.cs +++ /dev/null @@ -1,198 +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; - - /// An azure resource object - [System.ComponentModel.TypeConverter(typeof(ComponentsResourceTypeConverter))] - public partial class ComponentsResource - { - - /// - /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the - /// object before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Collections.IDictionary content that should be used. - - partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); - - /// - /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object - /// before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Management.Automation.PSObject content that should be used. - - partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); - - /// - /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Collections.IDictionary content that should be used. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); - - /// - /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Management.Automation.PSObject content that should be used. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); - - /// - /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior - /// - /// /// instance serialized to a string, normally it is a Json - /// /// set returnNow to true if you provide a customized OverrideToString function - - partial void OverrideToString(ref string stringResult, ref bool returnNow); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal ComponentsResource(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResourceInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResourceInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResourceInternal)this).Type, global::System.Convert.ToString); - } - if (content.Contains("Location")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResourceInternal)this).Location, global::System.Convert.ToString); - } - if (content.Contains("Tag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.ComponentsResourceTagsTypeConverter.ConvertFrom); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal ComponentsResource(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResourceInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResourceInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResourceInternal)this).Type, global::System.Convert.ToString); - } - if (content.Contains("Location")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResourceInternal)this).Location, global::System.Convert.ToString); - } - if (content.Contains("Tag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.ComponentsResourceTagsTypeConverter.ConvertFrom); - } - AfterDeserializePSObject(content); - } - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResource DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new ComponentsResource(content); - } - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new ComponentsResource(content); - } - - /// - /// Creates a new instance of , deserializing the content from a json string. - /// - /// a string containing a JSON serialized instance of this model. - /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IComponentsResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); - - /// Serializes this instance to a json string. - - /// a containing this model serialized to JSON text. - public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeAll)?.ToString(); - - public override string ToString() - { - var returnNow = false; - var result = global::System.String.Empty; - OverrideToString(ref result, ref returnNow); - if (returnNow) - { - return result; - } - return ToJsonString(); - } - } - /// An azure resource object - [System.ComponentModel.TypeConverter(typeof(ComponentsResourceTypeConverter))] - public partial interface IComponentsResource - - { - - } -} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ErrorResponseComponents.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ErrorResponseComponents.PowerShell.cs deleted file mode 100644 index 5184abfec79a..000000000000 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ErrorResponseComponents.PowerShell.cs +++ /dev/null @@ -1,180 +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; - - [System.ComponentModel.TypeConverter(typeof(ErrorResponseComponentsTypeConverter))] - public partial class ErrorResponseComponents - { - - /// - /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the - /// object before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Collections.IDictionary content that should be used. - - partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); - - /// - /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object - /// before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Management.Automation.PSObject content that should be used. - - partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); - - /// - /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Collections.IDictionary content that should be used. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); - - /// - /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Management.Automation.PSObject content that should be used. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); - - /// - /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior - /// - /// /// instance serialized to a string, normally it is a Json - /// /// set returnNow to true if you provide a customized OverrideToString function - - partial void OverrideToString(ref string stringResult, ref bool returnNow); - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IErrorResponseComponents DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new ErrorResponseComponents(content); - } - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IErrorResponseComponents DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new ErrorResponseComponents(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal ErrorResponseComponents(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("Error")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IErrorResponseComponentsInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IErrorResponseComponentsError) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IErrorResponseComponentsInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.ErrorResponseComponentsErrorTypeConverter.ConvertFrom); - } - if (content.Contains("Code")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IErrorResponseComponentsInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IErrorResponseComponentsInternal)this).Code, global::System.Convert.ToString); - } - if (content.Contains("Message")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IErrorResponseComponentsInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IErrorResponseComponentsInternal)this).Message, global::System.Convert.ToString); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal ErrorResponseComponents(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("Error")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IErrorResponseComponentsInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IErrorResponseComponentsError) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IErrorResponseComponentsInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.ErrorResponseComponentsErrorTypeConverter.ConvertFrom); - } - if (content.Contains("Code")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IErrorResponseComponentsInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IErrorResponseComponentsInternal)this).Code, global::System.Convert.ToString); - } - if (content.Contains("Message")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IErrorResponseComponentsInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IErrorResponseComponentsInternal)this).Message, global::System.Convert.ToString); - } - AfterDeserializePSObject(content); - } - - /// - /// Creates a new instance of , deserializing the content from a json string. - /// - /// a string containing a JSON serialized instance of this model. - /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IErrorResponseComponents FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); - - /// Serializes this instance to a json string. - - /// a containing this model serialized to JSON text. - public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeAll)?.ToString(); - - public override string ToString() - { - var returnNow = false; - var result = global::System.String.Empty; - OverrideToString(ref result, ref returnNow); - if (returnNow) - { - return result; - } - return ToJsonString(); - } - } - [System.ComponentModel.TypeConverter(typeof(ErrorResponseComponentsTypeConverter))] - public partial interface IErrorResponseComponents - - { - - } -} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ErrorResponseComponents.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ErrorResponseComponents.cs deleted file mode 100644 index cb63b46d474a..000000000000 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api202002/ErrorResponseComponents.cs +++ /dev/null @@ -1,83 +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 static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; - - public partial class ErrorResponseComponents : - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IErrorResponseComponents, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IErrorResponseComponentsInternal - { - - /// Error code. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] - public string Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IErrorResponseComponentsErrorInternal)Error).Code; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IErrorResponseComponentsError _error; - - /// - /// Error response indicates Insights service is not able to process the incoming request. The reason is provided in the error - /// message. - /// - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IErrorResponseComponentsError Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.ErrorResponseComponentsError()); set => this._error = value; } - - /// Error message indicating why the operation failed. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] - public string Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IErrorResponseComponentsErrorInternal)Error).Message; } - - /// Internal Acessors for Code - string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IErrorResponseComponentsInternal.Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IErrorResponseComponentsErrorInternal)Error).Code; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IErrorResponseComponentsErrorInternal)Error).Code = value; } - - /// Internal Acessors for Error - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IErrorResponseComponentsError Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IErrorResponseComponentsInternal.Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.ErrorResponseComponentsError()); set { {_error = value;} } } - - /// Internal Acessors for Message - string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IErrorResponseComponentsInternal.Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IErrorResponseComponentsErrorInternal)Error).Message; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IErrorResponseComponentsErrorInternal)Error).Message = value; } - - /// Creates an new instance. - public ErrorResponseComponents() - { - - } - } - public partial interface IErrorResponseComponents : - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IJsonSerializable - { - /// Error code. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"Error code.", - SerializedName = @"code", - PossibleTypes = new [] { typeof(string) })] - string Code { get; } - /// Error message indicating why the operation failed. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"Error message indicating why the operation failed.", - SerializedName = @"message", - PossibleTypes = new [] { typeof(string) })] - string Message { get; } - - } - internal partial interface IErrorResponseComponentsInternal - - { - /// Error code. - string Code { get; set; } - /// - /// Error response indicates Insights service is not able to process the incoming request. The reason is provided in the error - /// message. - /// - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api202002.IErrorResponseComponentsError Error { get; set; } - /// Error message indicating why the operation failed. - string Message { get; set; } - - } -} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20200301Preview/ComponentLinkedStorageAccounts.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20200301Preview/ComponentLinkedStorageAccounts.PowerShell.cs deleted file mode 100644 index 7ac9d07adadf..000000000000 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20200301Preview/ComponentLinkedStorageAccounts.PowerShell.cs +++ /dev/null @@ -1,198 +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.Api20200301Preview -{ - using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; - - /// An Application Insights component linked storage accounts - [System.ComponentModel.TypeConverter(typeof(ComponentLinkedStorageAccountsTypeConverter))] - public partial class ComponentLinkedStorageAccounts - { - - /// - /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the - /// object before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Collections.IDictionary content that should be used. - - partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); - - /// - /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object - /// before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Management.Automation.PSObject content that should be used. - - partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); - - /// - /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Collections.IDictionary content that should be used. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); - - /// - /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Management.Automation.PSObject content that should be used. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); - - /// - /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior - /// - /// /// instance serialized to a string, normally it is a Json - /// /// set returnNow to true if you provide a customized OverrideToString function - - partial void OverrideToString(ref string stringResult, ref bool returnNow); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal ComponentLinkedStorageAccounts(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("Property")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IComponentLinkedStorageAccountsInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.ILinkedStorageAccountsProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IComponentLinkedStorageAccountsInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.LinkedStorageAccountsPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResourceInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResourceInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResourceInternal)this).Type, global::System.Convert.ToString); - } - if (content.Contains("LinkedStorageAccount")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IComponentLinkedStorageAccountsInternal)this).LinkedStorageAccount = (string) content.GetValueForProperty("LinkedStorageAccount",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IComponentLinkedStorageAccountsInternal)this).LinkedStorageAccount, global::System.Convert.ToString); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal ComponentLinkedStorageAccounts(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("Property")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IComponentLinkedStorageAccountsInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.ILinkedStorageAccountsProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IComponentLinkedStorageAccountsInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.LinkedStorageAccountsPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResourceInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResourceInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResourceInternal)this).Type, global::System.Convert.ToString); - } - if (content.Contains("LinkedStorageAccount")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IComponentLinkedStorageAccountsInternal)this).LinkedStorageAccount = (string) content.GetValueForProperty("LinkedStorageAccount",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IComponentLinkedStorageAccountsInternal)this).LinkedStorageAccount, global::System.Convert.ToString); - } - AfterDeserializePSObject(content); - } - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IComponentLinkedStorageAccounts DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new ComponentLinkedStorageAccounts(content); - } - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IComponentLinkedStorageAccounts DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new ComponentLinkedStorageAccounts(content); - } - - /// - /// Creates a new instance of , deserializing the content from a json string. - /// - /// a string containing a JSON serialized instance of this model. - /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IComponentLinkedStorageAccounts FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); - - /// Serializes this instance to a json string. - - /// a containing this model serialized to JSON text. - public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeAll)?.ToString(); - - public override string ToString() - { - var returnNow = false; - var result = global::System.String.Empty; - OverrideToString(ref result, ref returnNow); - if (returnNow) - { - return result; - } - return ToJsonString(); - } - } - /// An Application Insights component linked storage accounts - [System.ComponentModel.TypeConverter(typeof(ComponentLinkedStorageAccountsTypeConverter))] - public partial interface IComponentLinkedStorageAccounts - - { - - } -} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20200301Preview/ComponentLinkedStorageAccounts.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20200301Preview/ComponentLinkedStorageAccounts.cs deleted file mode 100644 index b4c08a5ab14d..000000000000 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20200301Preview/ComponentLinkedStorageAccounts.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.ApplicationInsights.Models.Api20200301Preview -{ - using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; - - /// An Application Insights component linked storage accounts - public partial class ComponentLinkedStorageAccounts : - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IComponentLinkedStorageAccounts, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IComponentLinkedStorageAccountsInternal, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IValidates - { - /// - /// Backing field for Inherited model - /// - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.Resource(); - - /// - /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - /// - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inherited)] - public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResourceInternal)__resource).Id; } - - /// Linked storage account resource ID - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] - public string LinkedStorageAccount { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.ILinkedStorageAccountsPropertiesInternal)Property).LinkedStorageAccount; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.ILinkedStorageAccountsPropertiesInternal)Property).LinkedStorageAccount = value ?? null; } - - /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResourceInternal)__resource).Id = value; } - - /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResourceInternal)__resource).Name = value; } - - /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResourceInternal)__resource).Type = value; } - - /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.ILinkedStorageAccountsProperties Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IComponentLinkedStorageAccountsInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.LinkedStorageAccountsProperties()); set { {_property = value;} } } - - /// The name of the resource - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inherited)] - public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResourceInternal)__resource).Name; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.ILinkedStorageAccountsProperties _property; - - /// The properties of the linked storage accounts. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.ILinkedStorageAccountsProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.LinkedStorageAccountsProperties()); set => this._property = value; } - - /// Gets the resource group name - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] - public string ResourceGroupName { get => (new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Success ? new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Groups["resourceGroupName"].Value : null); } - - /// - /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - /// - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inherited)] - public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResourceInternal)__resource).Type; } - - /// Creates an new instance. - public ComponentLinkedStorageAccounts() - { - - } - - /// Validates that this object meets the validation criteria. - /// an instance that will receive validation - /// events. - /// - /// A that will be complete when validation is completed. - /// - public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener) - { - await eventListener.AssertNotNull(nameof(__resource), __resource); - await eventListener.AssertObjectIsValid(nameof(__resource), __resource); - } - } - /// An Application Insights component linked storage accounts - public partial interface IComponentLinkedStorageAccounts : - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResource - { - /// Linked storage account resource ID - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Linked storage account resource ID", - SerializedName = @"linkedStorageAccount", - PossibleTypes = new [] { typeof(string) })] - string LinkedStorageAccount { get; set; } - - } - /// An Application Insights component linked storage accounts - internal partial interface IComponentLinkedStorageAccountsInternal : - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.IResourceInternal - { - /// Linked storage account resource ID - string LinkedStorageAccount { get; set; } - /// The properties of the linked storage accounts. - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.ILinkedStorageAccountsProperties Property { get; set; } - - } -} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20200301Preview/ComponentLinkedStorageAccountsPatch.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20200301Preview/ComponentLinkedStorageAccountsPatch.PowerShell.cs deleted file mode 100644 index f245fb4f0ea0..000000000000 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20200301Preview/ComponentLinkedStorageAccountsPatch.PowerShell.cs +++ /dev/null @@ -1,176 +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.Api20200301Preview -{ - using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; - - /// An Application Insights component linked storage accounts patch - [System.ComponentModel.TypeConverter(typeof(ComponentLinkedStorageAccountsPatchTypeConverter))] - public partial class ComponentLinkedStorageAccountsPatch - { - - /// - /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the - /// object before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Collections.IDictionary content that should be used. - - partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); - - /// - /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object - /// before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Management.Automation.PSObject content that should be used. - - partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); - - /// - /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Collections.IDictionary content that should be used. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); - - /// - /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Management.Automation.PSObject content that should be used. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); - - /// - /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior - /// - /// /// instance serialized to a string, normally it is a Json - /// /// set returnNow to true if you provide a customized OverrideToString function - - partial void OverrideToString(ref string stringResult, ref bool returnNow); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal ComponentLinkedStorageAccountsPatch(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("Property")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IComponentLinkedStorageAccountsPatchInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.ILinkedStorageAccountsProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IComponentLinkedStorageAccountsPatchInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.LinkedStorageAccountsPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("LinkedStorageAccount")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IComponentLinkedStorageAccountsPatchInternal)this).LinkedStorageAccount = (string) content.GetValueForProperty("LinkedStorageAccount",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IComponentLinkedStorageAccountsPatchInternal)this).LinkedStorageAccount, global::System.Convert.ToString); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal ComponentLinkedStorageAccountsPatch(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("Property")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IComponentLinkedStorageAccountsPatchInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.ILinkedStorageAccountsProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IComponentLinkedStorageAccountsPatchInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.LinkedStorageAccountsPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("LinkedStorageAccount")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IComponentLinkedStorageAccountsPatchInternal)this).LinkedStorageAccount = (string) content.GetValueForProperty("LinkedStorageAccount",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IComponentLinkedStorageAccountsPatchInternal)this).LinkedStorageAccount, global::System.Convert.ToString); - } - AfterDeserializePSObject(content); - } - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IComponentLinkedStorageAccountsPatch DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new ComponentLinkedStorageAccountsPatch(content); - } - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IComponentLinkedStorageAccountsPatch DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new ComponentLinkedStorageAccountsPatch(content); - } - - /// - /// Creates a new instance of , deserializing the content from a json string. - /// - /// a string containing a JSON serialized instance of this model. - /// - /// an instance of the model class. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IComponentLinkedStorageAccountsPatch FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); - - /// Serializes this instance to a json string. - - /// a containing this model serialized to JSON text. - public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeAll)?.ToString(); - - public override string ToString() - { - var returnNow = false; - var result = global::System.String.Empty; - OverrideToString(ref result, ref returnNow); - if (returnNow) - { - return result; - } - return ToJsonString(); - } - } - /// An Application Insights component linked storage accounts patch - [System.ComponentModel.TypeConverter(typeof(ComponentLinkedStorageAccountsPatchTypeConverter))] - public partial interface IComponentLinkedStorageAccountsPatch - - { - - } -} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20200301Preview/ComponentLinkedStorageAccountsPatch.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20200301Preview/ComponentLinkedStorageAccountsPatch.cs deleted file mode 100644 index e497575ea07b..000000000000 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20200301Preview/ComponentLinkedStorageAccountsPatch.cs +++ /dev/null @@ -1,60 +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.Api20200301Preview -{ - using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; - - /// An Application Insights component linked storage accounts patch - public partial class ComponentLinkedStorageAccountsPatch : - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IComponentLinkedStorageAccountsPatch, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IComponentLinkedStorageAccountsPatchInternal - { - - /// Linked storage account resource ID - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] - public string LinkedStorageAccount { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.ILinkedStorageAccountsPropertiesInternal)Property).LinkedStorageAccount; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.ILinkedStorageAccountsPropertiesInternal)Property).LinkedStorageAccount = value ?? null; } - - /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.ILinkedStorageAccountsProperties Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IComponentLinkedStorageAccountsPatchInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.LinkedStorageAccountsProperties()); set { {_property = value;} } } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.ILinkedStorageAccountsProperties _property; - - /// The properties of the linked storage accounts. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.ILinkedStorageAccountsProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.LinkedStorageAccountsProperties()); set => this._property = value; } - - /// Creates an new instance. - public ComponentLinkedStorageAccountsPatch() - { - - } - } - /// An Application Insights component linked storage accounts patch - public partial interface IComponentLinkedStorageAccountsPatch : - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IJsonSerializable - { - /// Linked storage account resource ID - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Linked storage account resource ID", - SerializedName = @"linkedStorageAccount", - PossibleTypes = new [] { typeof(string) })] - string LinkedStorageAccount { get; set; } - - } - /// An Application Insights component linked storage accounts patch - internal partial interface IComponentLinkedStorageAccountsPatchInternal - - { - /// Linked storage account resource ID - string LinkedStorageAccount { get; set; } - /// The properties of the linked storage accounts. - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.ILinkedStorageAccountsProperties Property { get; set; } - - } -} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20200301Preview/ErrorResponseLinkedStorage.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20200301Preview/ErrorResponseLinkedStorage.PowerShell.cs deleted file mode 100644 index c09e8d29cfb0..000000000000 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20200301Preview/ErrorResponseLinkedStorage.PowerShell.cs +++ /dev/null @@ -1,180 +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.Api20200301Preview -{ - using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; - - [System.ComponentModel.TypeConverter(typeof(ErrorResponseLinkedStorageTypeConverter))] - public partial class ErrorResponseLinkedStorage - { - - /// - /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the - /// object before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Collections.IDictionary content that should be used. - - partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); - - /// - /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object - /// before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Management.Automation.PSObject content that should be used. - - partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); - - /// - /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Collections.IDictionary content that should be used. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); - - /// - /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Management.Automation.PSObject content that should be used. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); - - /// - /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior - /// - /// /// instance serialized to a string, normally it is a Json - /// /// set returnNow to true if you provide a customized OverrideToString function - - partial void OverrideToString(ref string stringResult, ref bool returnNow); - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IErrorResponseLinkedStorage DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new ErrorResponseLinkedStorage(content); - } - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IErrorResponseLinkedStorage DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new ErrorResponseLinkedStorage(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal ErrorResponseLinkedStorage(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("Error")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IErrorResponseLinkedStorageInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IErrorResponseLinkedStorageError) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IErrorResponseLinkedStorageInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.ErrorResponseLinkedStorageErrorTypeConverter.ConvertFrom); - } - if (content.Contains("Code")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IErrorResponseLinkedStorageInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IErrorResponseLinkedStorageInternal)this).Code, global::System.Convert.ToString); - } - if (content.Contains("Message")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IErrorResponseLinkedStorageInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IErrorResponseLinkedStorageInternal)this).Message, global::System.Convert.ToString); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal ErrorResponseLinkedStorage(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("Error")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IErrorResponseLinkedStorageInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IErrorResponseLinkedStorageError) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IErrorResponseLinkedStorageInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.ErrorResponseLinkedStorageErrorTypeConverter.ConvertFrom); - } - if (content.Contains("Code")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IErrorResponseLinkedStorageInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IErrorResponseLinkedStorageInternal)this).Code, global::System.Convert.ToString); - } - if (content.Contains("Message")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IErrorResponseLinkedStorageInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IErrorResponseLinkedStorageInternal)this).Message, global::System.Convert.ToString); - } - AfterDeserializePSObject(content); - } - - /// - /// Creates a new instance of , deserializing the content from a json string. - /// - /// a string containing a JSON serialized instance of this model. - /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IErrorResponseLinkedStorage FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); - - /// Serializes this instance to a json string. - - /// a containing this model serialized to JSON text. - public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeAll)?.ToString(); - - public override string ToString() - { - var returnNow = false; - var result = global::System.String.Empty; - OverrideToString(ref result, ref returnNow); - if (returnNow) - { - return result; - } - return ToJsonString(); - } - } - [System.ComponentModel.TypeConverter(typeof(ErrorResponseLinkedStorageTypeConverter))] - public partial interface IErrorResponseLinkedStorage - - { - - } -} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20200301Preview/ErrorResponseLinkedStorage.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20200301Preview/ErrorResponseLinkedStorage.cs deleted file mode 100644 index 552ea2d81103..000000000000 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20200301Preview/ErrorResponseLinkedStorage.cs +++ /dev/null @@ -1,83 +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.Api20200301Preview -{ - using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; - - public partial class ErrorResponseLinkedStorage : - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IErrorResponseLinkedStorage, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IErrorResponseLinkedStorageInternal - { - - /// Error code. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] - public string Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IErrorResponseLinkedStorageErrorInternal)Error).Code; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IErrorResponseLinkedStorageError _error; - - /// - /// Error response indicates Insights service is not able to process the incoming request. The reason is provided in the error - /// message. - /// - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IErrorResponseLinkedStorageError Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.ErrorResponseLinkedStorageError()); set => this._error = value; } - - /// Error message indicating why the operation failed. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] - public string Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IErrorResponseLinkedStorageErrorInternal)Error).Message; } - - /// Internal Acessors for Code - string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IErrorResponseLinkedStorageInternal.Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IErrorResponseLinkedStorageErrorInternal)Error).Code; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IErrorResponseLinkedStorageErrorInternal)Error).Code = value; } - - /// Internal Acessors for Error - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IErrorResponseLinkedStorageError Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IErrorResponseLinkedStorageInternal.Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.ErrorResponseLinkedStorageError()); set { {_error = value;} } } - - /// Internal Acessors for Message - string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IErrorResponseLinkedStorageInternal.Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IErrorResponseLinkedStorageErrorInternal)Error).Message; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IErrorResponseLinkedStorageErrorInternal)Error).Message = value; } - - /// Creates an new instance. - public ErrorResponseLinkedStorage() - { - - } - } - public partial interface IErrorResponseLinkedStorage : - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IJsonSerializable - { - /// Error code. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"Error code.", - SerializedName = @"code", - PossibleTypes = new [] { typeof(string) })] - string Code { get; } - /// Error message indicating why the operation failed. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"Error message indicating why the operation failed.", - SerializedName = @"message", - PossibleTypes = new [] { typeof(string) })] - string Message { get; } - - } - internal partial interface IErrorResponseLinkedStorageInternal - - { - /// Error code. - string Code { get; set; } - /// - /// Error response indicates Insights service is not able to process the incoming request. The reason is provided in the error - /// message. - /// - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20200301Preview.IErrorResponseLinkedStorageError Error { get; set; } - /// Error message indicating why the operation failed. - string Message { get; set; } - - } -} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplate.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplate.PowerShell.cs deleted file mode 100644 index 26f6a7725e7e..000000000000 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplate.PowerShell.cs +++ /dev/null @@ -1,246 +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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; - - /// An Application Insights workbook template definition. - [System.ComponentModel.TypeConverter(typeof(WorkbookTemplateTypeConverter))] - public partial class WorkbookTemplate - { - - /// - /// 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.Api20201120.IWorkbookTemplate DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new WorkbookTemplate(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.Api20201120.IWorkbookTemplate DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new WorkbookTemplate(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.Api20201120.IWorkbookTemplate 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 WorkbookTemplate(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.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); - } - 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); - } - 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); - } - 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); - } - 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); - } - 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); - } - 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))); - } - 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); - } - 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); - } - 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)); - } - 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); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal WorkbookTemplate(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.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); - } - 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); - } - 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); - } - 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); - } - 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); - } - 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); - } - 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))); - } - 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); - } - 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); - } - 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)); - } - 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); - } - AfterDeserializePSObject(content); - } - } - /// An Application Insights workbook template definition. - [System.ComponentModel.TypeConverter(typeof(WorkbookTemplateTypeConverter))] - public partial interface IWorkbookTemplate - - { - - } -} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplate.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplate.cs deleted file mode 100644 index a865d3611a98..000000000000 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplate.cs +++ /dev/null @@ -1,192 +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; - - /// 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.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(); - - /// 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; } - - /// 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 */; } - - /// 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; } - - /// - /// 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 */; } - - /// 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 ; } - - /// 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;} } } - - /// 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; } - - /// 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; } - - /// 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; } - - /// 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; } - - /// - /// 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); } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.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; } - - /// Gets the resource group name - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.FormatTable(Index = 0)] - public string ResourceGroupName { get => (new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Success ? new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Groups["resourceGroupName"].Value : null); } - - /// 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 */; } - - /// 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 */; } - - /// 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; } - - /// Validates that this object meets the validation criteria. - /// an instance that will receive validation - /// events. - /// - /// A that will be complete when validation is completed. - /// - public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener) - { - await eventListener.AssertNotNull(nameof(__workbookTemplateResource), __workbookTemplateResource); - await eventListener.AssertObjectIsValid(nameof(__workbookTemplateResource), __workbookTemplateResource); - } - - /// Creates an new instance. - 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 - { - /// Information about the author of the workbook template. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Information about the author of the workbook template.", - SerializedName = @"author", - PossibleTypes = new [] { typeof(string) })] - string Author { get; set; } - /// Workbook galleries supported by the template. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = false, - 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; } - /// - /// 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, - 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; } - /// - /// 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, - 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) })] - int? Priority { get; set; } - /// Valid JSON object containing workbook template payload. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = false, - 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; } - - } - /// An Application Insights workbook template definition. - internal partial interface IWorkbookTemplateInternal : - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.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; } - /// - /// 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; } - /// - /// 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; } - /// Valid JSON object containing workbook template payload. - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplatePropertiesTemplateData TemplateData { get; set; } - - } -} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplateError.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplateError.PowerShell.cs deleted file mode 100644 index fc533a6365f9..000000000000 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplateError.PowerShell.cs +++ /dev/null @@ -1,190 +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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; - - /// Error message that will indicate why the operation failed. - [System.ComponentModel.TypeConverter(typeof(WorkbookTemplateErrorTypeConverter))] - public partial class WorkbookTemplateError - { - - /// - /// 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.Api20201120.IWorkbookTemplateError DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new WorkbookTemplateError(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.Api20201120.IWorkbookTemplateError DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new WorkbookTemplateError(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.Api20201120.IWorkbookTemplateError 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 WorkbookTemplateError(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("Error")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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); - } - 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); - } - 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); - } - 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)); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal WorkbookTemplateError(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("Error")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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); - } - 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); - } - 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); - } - 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)); - } - AfterDeserializePSObject(content); - } - } - /// Error message that will indicate why the operation failed. - [System.ComponentModel.TypeConverter(typeof(WorkbookTemplateErrorTypeConverter))] - public partial interface IWorkbookTemplateError - - { - - } -} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplateError.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplateError.cs deleted file mode 100644 index 1f7de61bb004..000000000000 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplateError.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.Models.Api20201120 -{ - 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 - { - - /// - /// Service-defined error code. This code serves as a sub-status for the HTTP error code specified in the response. - /// - [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; } - - /// 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 */; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.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; } - - /// 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; } - - /// 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;} } } - - /// Creates an new instance. - public WorkbookTemplateError() - { - - } - } - /// Error message that will indicate why the operation failed. - public partial interface IWorkbookTemplateError : - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IJsonSerializable - { - /// - /// Service-defined error code. This code serves as a sub-status for the HTTP error code specified in the response. - /// - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Service-defined error code. This code serves as a sub-status for the HTTP error code specified in the response.", - SerializedName = @"code", - PossibleTypes = new [] { typeof(string) })] - string Code { get; set; } - /// The list of invalid fields send in request, in case of validation error. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The list of invalid fields send in request, in case of validation error.", - SerializedName = @"details", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateErrorFieldContract) })] - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateErrorFieldContract[] Detail { get; set; } - /// Human-readable representation of the error. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Human-readable representation of the error.", - SerializedName = @"message", - PossibleTypes = new [] { typeof(string) })] - string Message { get; set; } - - } - /// Error message that will indicate why the operation failed. - internal partial interface IWorkbookTemplateErrorInternal - - { - /// - /// Service-defined error code. This code serves as a sub-status for the HTTP error code specified in the response. - /// - string Code { get; set; } - /// The list of invalid fields send in request, in case of validation error. - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateErrorFieldContract[] Detail { get; set; } - /// Error message object that will indicate why the operation failed. - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateErrorBody Error { get; set; } - /// Human-readable representation of the error. - string Message { get; set; } - - } -} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplateErrorBody.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplateErrorBody.PowerShell.cs deleted file mode 100644 index c0c5699ec767..000000000000 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplateErrorBody.PowerShell.cs +++ /dev/null @@ -1,182 +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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; - - /// Error message body that will indicate why the operation failed. - [System.ComponentModel.TypeConverter(typeof(WorkbookTemplateErrorBodyTypeConverter))] - public partial class WorkbookTemplateErrorBody - { - - /// - /// 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.Api20201120.IWorkbookTemplateErrorBody DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new WorkbookTemplateErrorBody(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.Api20201120.IWorkbookTemplateErrorBody DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new WorkbookTemplateErrorBody(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.Api20201120.IWorkbookTemplateErrorBody 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 WorkbookTemplateErrorBody(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("Code")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateErrorBodyInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.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); - } - 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)); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal WorkbookTemplateErrorBody(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("Code")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateErrorBodyInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.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); - } - 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)); - } - AfterDeserializePSObject(content); - } - } - /// Error message body that will indicate why the operation failed. - [System.ComponentModel.TypeConverter(typeof(WorkbookTemplateErrorBodyTypeConverter))] - public partial interface IWorkbookTemplateErrorBody - - { - - } -} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplateGallery.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplateGallery.PowerShell.cs deleted file mode 100644 index 476409160c4b..000000000000 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplateGallery.PowerShell.cs +++ /dev/null @@ -1,198 +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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; - - /// Gallery information for a workbook template. - [System.ComponentModel.TypeConverter(typeof(WorkbookTemplateGalleryTypeConverter))] - public partial class WorkbookTemplateGallery - { - - /// - /// 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.Api20201120.IWorkbookTemplateGallery DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new WorkbookTemplateGallery(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.Api20201120.IWorkbookTemplateGallery DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new WorkbookTemplateGallery(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.Api20201120.IWorkbookTemplateGallery 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 WorkbookTemplateGallery(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateGalleryInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.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); - } - 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); - } - 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))); - } - 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); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal WorkbookTemplateGallery(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateGalleryInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.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); - } - 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); - } - 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))); - } - 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); - } - AfterDeserializePSObject(content); - } - } - /// Gallery information for a workbook template. - [System.ComponentModel.TypeConverter(typeof(WorkbookTemplateGalleryTypeConverter))] - public partial interface IWorkbookTemplateGallery - - { - - } -} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplateLocalizedGallery.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplateLocalizedGallery.PowerShell.cs deleted file mode 100644 index 7a3bc08cda76..000000000000 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplateLocalizedGallery.PowerShell.cs +++ /dev/null @@ -1,174 +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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; - - /// Localized template data and gallery information. - [System.ComponentModel.TypeConverter(typeof(WorkbookTemplateLocalizedGalleryTypeConverter))] - public partial class WorkbookTemplateLocalizedGallery - { - - /// - /// 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.Api20201120.IWorkbookTemplateLocalizedGallery DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new WorkbookTemplateLocalizedGallery(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.Api20201120.IWorkbookTemplateLocalizedGallery DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new WorkbookTemplateLocalizedGallery(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.Api20201120.IWorkbookTemplateLocalizedGallery 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 WorkbookTemplateLocalizedGallery(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // 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); - } - 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)); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal WorkbookTemplateLocalizedGallery(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // 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); - } - 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)); - } - AfterDeserializePSObject(content); - } - } - /// Localized template data and gallery information. - [System.ComponentModel.TypeConverter(typeof(WorkbookTemplateLocalizedGalleryTypeConverter))] - public partial interface IWorkbookTemplateLocalizedGallery - - { - - } -} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplateProperties.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplateProperties.PowerShell.cs deleted file mode 100644 index 80c98104e587..000000000000 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplateProperties.PowerShell.cs +++ /dev/null @@ -1,198 +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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; - - /// Properties that contain a workbook template. - [System.ComponentModel.TypeConverter(typeof(WorkbookTemplatePropertiesTypeConverter))] - public partial class WorkbookTemplateProperties - { - - /// - /// 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.Api20201120.IWorkbookTemplateProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new WorkbookTemplateProperties(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.Api20201120.IWorkbookTemplateProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new WorkbookTemplateProperties(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.Api20201120.IWorkbookTemplateProperties 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 WorkbookTemplateProperties(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // 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))); - } - 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); - } - 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); - } - 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)); - } - 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); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal WorkbookTemplateProperties(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // 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))); - } - 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); - } - 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); - } - 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)); - } - 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); - } - AfterDeserializePSObject(content); - } - } - /// Properties that contain a workbook template. - [System.ComponentModel.TypeConverter(typeof(WorkbookTemplatePropertiesTypeConverter))] - public partial interface IWorkbookTemplateProperties - - { - - } -} \ 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/Api20201120/WorkbookTemplateResource.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplateResource.PowerShell.cs deleted file mode 100644 index 61700ea8dc88..000000000000 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplateResource.PowerShell.cs +++ /dev/null @@ -1,198 +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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; - - /// An azure resource object - [System.ComponentModel.TypeConverter(typeof(WorkbookTemplateResourceTypeConverter))] - public partial class WorkbookTemplateResource - { - - /// - /// 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.Api20201120.IWorkbookTemplateResource DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new WorkbookTemplateResource(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.Api20201120.IWorkbookTemplateResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new WorkbookTemplateResource(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.Api20201120.IWorkbookTemplateResource 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 WorkbookTemplateResource(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.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); - } - 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); - } - 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); - } - 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); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal WorkbookTemplateResource(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.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); - } - 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); - } - 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); - } - 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); - } - AfterDeserializePSObject(content); - } - } - /// An azure resource object - [System.ComponentModel.TypeConverter(typeof(WorkbookTemplateResourceTypeConverter))] - public partial interface IWorkbookTemplateResource - - { - - } -} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplateUpdateParameters.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplateUpdateParameters.PowerShell.cs deleted file mode 100644 index 0eb7e796c6ba..000000000000 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplateUpdateParameters.PowerShell.cs +++ /dev/null @@ -1,214 +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 Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; - - /// The parameters that can be provided when updating workbook template. - [System.ComponentModel.TypeConverter(typeof(WorkbookTemplateUpdateParametersTypeConverter))] - public partial class WorkbookTemplateUpdateParameters - { - - /// - /// 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.Api20201120.IWorkbookTemplateUpdateParameters DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new WorkbookTemplateUpdateParameters(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.Api20201120.IWorkbookTemplateUpdateParameters DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new WorkbookTemplateUpdateParameters(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.Api20201120.IWorkbookTemplateUpdateParameters 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 WorkbookTemplateUpdateParameters(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.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); - } - 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); - } - 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))); - } - 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); - } - 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); - } - 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)); - } - 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); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal WorkbookTemplateUpdateParameters(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.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); - } - 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); - } - 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))); - } - 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); - } - 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); - } - 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)); - } - 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); - } - AfterDeserializePSObject(content); - } - } - /// The parameters that can be provided when updating workbook template. - [System.ComponentModel.TypeConverter(typeof(WorkbookTemplateUpdateParametersTypeConverter))] - public partial interface IWorkbookTemplateUpdateParameters - - { - - } -} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplateUpdateParameters.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplateUpdateParameters.cs deleted file mode 100644 index 06e4279a08af..000000000000 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplateUpdateParameters.cs +++ /dev/null @@ -1,152 +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; - - /// 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 - { - - /// 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; } - - /// 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 */; } - - /// - /// 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 */; } - - /// 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;} } } - - /// - /// 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); } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.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; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.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; } - - /// 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 */; } - - /// Creates an new instance. - public WorkbookTemplateUpdateParameters() - { - - } - } - /// The parameters that can be provided when updating workbook template. - public partial interface IWorkbookTemplateUpdateParameters : - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IJsonSerializable - { - /// Information about the author of the workbook template. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Information about the author of the workbook template.", - SerializedName = @"author", - PossibleTypes = new [] { typeof(string) })] - string Author { get; set; } - /// Workbook galleries supported by the template. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = false, - 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; } - /// - /// 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, - 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; } - /// - /// 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, - 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) })] - int? Priority { get; set; } - /// Resource tags - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Resource tags", - SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateUpdateParametersTags) })] - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateUpdateParametersTags Tag { get; set; } - /// Valid JSON object containing workbook template payload. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = false, - 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; } - - } - /// The parameters that can be provided when updating workbook template. - 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; } - /// - /// 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; } - /// - /// 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; } - /// Resource tags - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplateUpdateParametersTags Tag { get; set; } - /// Valid JSON object containing workbook template payload. - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplatePropertiesTemplateData TemplateData { get; set; } - - } -} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplatesListResult.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplatesListResult.cs deleted file mode 100644 index 6eff864343c1..000000000000 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20201120/WorkbookTemplatesListResult.cs +++ /dev/null @@ -1,52 +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; - - /// WorkbookTemplate list result. - public partial class WorkbookTemplatesListResult : - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplatesListResult, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplatesListResultInternal - { - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplate[] _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; } - - /// Creates an new instance. - public WorkbookTemplatesListResult() - { - - } - } - /// WorkbookTemplate list result. - public partial interface IWorkbookTemplatesListResult : - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IJsonSerializable - { - /// An array of workbook templates. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = false, - 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; } - - } - /// WorkbookTemplate list result. - internal partial interface IWorkbookTemplatesListResultInternal - - { - /// An array of workbook templates. - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20201120.IWorkbookTemplate[] Value { get; set; } - - } -} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/ErrorResponse.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/ErrorResponse.PowerShell.cs deleted file mode 100644 index abb33c908281..000000000000 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/ErrorResponse.PowerShell.cs +++ /dev/null @@ -1,184 +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; - - /// - /// Error response indicates Insights service is not able to process the incoming request. The reason is provided in the error - /// message. - /// - [System.ComponentModel.TypeConverter(typeof(ErrorResponseTypeConverter))] - public partial class ErrorResponse - { - - /// - /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the - /// object before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Collections.IDictionary content that should be used. - - partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); - - /// - /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object - /// before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Management.Automation.PSObject content that should be used. - - partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); - - /// - /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Collections.IDictionary content that should be used. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); - - /// - /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Management.Automation.PSObject content that should be used. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); - - /// - /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior - /// - /// /// instance serialized to a string, normally it is a Json - /// /// set returnNow to true if you provide a customized OverrideToString function - - partial void OverrideToString(ref string stringResult, ref bool returnNow); - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IErrorResponse DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new ErrorResponse(content); - } - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IErrorResponse DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new ErrorResponse(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal ErrorResponse(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("Code")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IErrorResponseInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.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); - } - 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)); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal ErrorResponse(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("Code")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IErrorResponseInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.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); - } - 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)); - } - AfterDeserializePSObject(content); - } - - /// - /// Creates a new instance of , deserializing the content from a json string. - /// - /// a string containing a JSON serialized instance of this model. - /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IErrorResponse FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); - - /// Serializes this instance to a json string. - - /// a containing this model serialized to JSON text. - public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeAll)?.ToString(); - - public override string ToString() - { - var returnNow = false; - var result = global::System.String.Empty; - OverrideToString(ref result, ref returnNow); - if (returnNow) - { - return result; - } - return ToJsonString(); - } - } - /// Error response indicates Insights service is not able to process the incoming request. The reason is provided in the error - /// message. - [System.ComponentModel.TypeConverter(typeof(ErrorResponseTypeConverter))] - public partial interface IErrorResponse - - { - - } -} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/ErrorResponse.TypeConverter.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/ErrorResponse.TypeConverter.cs deleted file mode 100644 index 7b61cf965c55..000000000000 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/ErrorResponse.TypeConverter.cs +++ /dev/null @@ -1,147 +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; - - /// - /// A PowerShell PSTypeConverter to support converting to an instance of - /// - public partial class ErrorResponseTypeConverter : global::System.Management.Automation.PSTypeConverter - { - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false. - /// - public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); - - /// - /// Determines if the converter can convert the parameter to the - /// type. - /// - /// the instance to check if it can be converted to the type. - /// - /// true if the instance could be converted to a type, otherwise false - /// - public static bool CanConvertFrom(dynamic sourceValue) - { - if (null == sourceValue) - { - return true; - } - global::System.Type type = sourceValue.GetType(); - if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) - { - // we say yest to PSObjects - return true; - } - if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) - { - // we say yest to Hashtables/dictionaries - return true; - } - try - { - if (null != sourceValue.ToJsonString()) - { - return true; - } - } - catch - { - // Not one of our objects - } - try - { - string text = sourceValue.ToString()?.Trim(); - return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonType.Object; - } - catch - { - // Doesn't look like it can be treated as JSON - } - return false; - } - - /// - /// Determines if the parameter can be converted to the - /// parameter - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false - /// - public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; - - /// - /// Converts the parameter to the parameter using and - /// - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// - /// an instance of , or null if there is no suitable conversion. - /// - public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); - - /// - /// Converts the parameter into an instance of - /// - /// the value to convert into an instance of . - /// - /// an instance of , or null if there is no suitable conversion. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.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)) - { - return sourceValue; - } - try - { - return ErrorResponse.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; - } - catch - { - // Unable to use JSON pattern - } - if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) - { - return ErrorResponse.DeserializeFromPSObject(sourceValue); - } - if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) - { - return ErrorResponse.DeserializeFromDictionary(sourceValue); - } - return null; - } - - /// NotImplemented -- this will return null - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// will always return null. - public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; - } -} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/ErrorResponse.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/ErrorResponse.cs deleted file mode 100644 index eb2ed93cfa7d..000000000000 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/ErrorResponse.cs +++ /dev/null @@ -1,90 +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 static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; - - /// - /// Error response indicates Insights service is not able to process the incoming request. The reason is provided in the error - /// message. - /// - public partial class ErrorResponse : - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IErrorResponse, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IErrorResponseInternal - { - - /// Backing field for property. - private string _code; - - /// Error code. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] - public string Code { get => this._code; set => this._code = value; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IErrorFieldContract[] _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; } - - /// Backing field for property. - private string _message; - - /// Error message indicating why the operation failed. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] - public string Message { get => this._message; set => this._message = value; } - - /// Creates an new instance. - public ErrorResponse() - { - - } - } - /// Error response indicates Insights service is not able to process the incoming request. The reason is provided in the error - /// message. - public partial interface IErrorResponse : - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IJsonSerializable - { - /// Error code. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Error code.", - SerializedName = @"code", - PossibleTypes = new [] { typeof(string) })] - string Code { get; set; } - /// The list of invalid fields send in request, in case of validation error. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The list of invalid fields send in request, in case of validation error.", - SerializedName = @"details", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IErrorFieldContract) })] - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IErrorFieldContract[] Detail { get; set; } - /// Error message indicating why the operation failed. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Error message indicating why the operation failed.", - SerializedName = @"message", - PossibleTypes = new [] { typeof(string) })] - string Message { get; set; } - - } - /// Error response indicates Insights service is not able to process the incoming request. The reason is provided in the error - /// message. - internal partial interface IErrorResponseInternal - - { - /// Error code. - string Code { get; set; } - /// The list of invalid fields send in request, in case of validation error. - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IErrorFieldContract[] Detail { get; set; } - /// Error message indicating why the operation failed. - string Message { get; set; } - - } -} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/ErrorResponse.json.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/ErrorResponse.json.cs deleted file mode 100644 index 99717e802326..000000000000 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/ErrorResponse.json.cs +++ /dev/null @@ -1,123 +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 static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; - - /// - /// Error response indicates Insights service is not able to process the incoming request. The reason is provided in the error - /// message. - /// - public partial class ErrorResponse - { - - /// - /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object - /// before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The JsonNode that should be deserialized into this object. - - partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json); - - /// - /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The JSON container that the serialization result will be placed in. - - partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container); - - /// - /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of - /// the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the - /// output parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The JsonNode that should be deserialized into this object. - /// Determines if the rest of the deserialization should be processed, or if the method should return - /// instantly. - - partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json, ref bool returnNow); - - /// - /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the - /// object before it is serialized. - /// If you wish to disable the default serialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The JSON container that the serialization result will be placed in. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container, ref bool returnNow); - - /// - /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject into a new instance of . - /// - /// A Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject instance to deserialize from. - internal ErrorResponse(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json) - { - bool returnNow = false; - BeforeFromJson(json, ref returnNow); - if (returnNow) - { - return; - } - {_code = If( json?.PropertyT("code"), out var __jsonCode) ? (string)__jsonCode : (string)Code;} - {_message = If( json?.PropertyT("message"), out var __jsonMessage) ? (string)__jsonMessage : (string)Message;} - {_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;} - AfterFromJson(json); - } - - /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IErrorResponse. - /// - /// a to deserialize from. - /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IErrorResponse. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IErrorResponse FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) - { - return node is Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json ? new ErrorResponse(json) : null; - } - - /// - /// Serializes this instance of into a . - /// - /// The container to serialize this object into. If the caller - /// passes in null, a new instance will be created and returned to the caller. - /// Allows the caller to choose the depth of the serialization. See . - /// - /// a serialized instance of as a . - /// - public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode serializationMode) - { - container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject(); - - bool returnNow = false; - BeforeToJson(ref container, ref returnNow); - if (returnNow) - { - return container; - } - AddIf( null != (((object)this._code)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(this._code.ToString()) : null, "code" ,container.Add ); - AddIf( null != (((object)this._message)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(this._message.ToString()) : null, "message" ,container.Add ); - if (null != this._detail) - { - var __w = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.XNodeArray(); - foreach( var __x in this._detail ) - { - AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); - } - container.Add("details",__w); - } - AfterToJson(ref container); - return container; - } - } -} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/InnerErrorTrace.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/InnerErrorTrace.cs deleted file mode 100644 index fe942c320d66..000000000000 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/InnerErrorTrace.cs +++ /dev/null @@ -1,54 +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 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 - { - - /// Internal Acessors for Trace - string[] Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IInnerErrorTraceInternal.Trace { get => this._trace; set { {_trace = value;} } } - - /// Backing field for property. - private string[] _trace; - - /// detailed error trace - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] - public string[] Trace { get => this._trace; } - - /// Creates an new instance. - public InnerErrorTrace() - { - - } - } - /// Error details - public partial interface IInnerErrorTrace : - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IJsonSerializable - { - /// detailed error trace - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"detailed error trace", - SerializedName = @"trace", - PossibleTypes = new [] { typeof(string) })] - string[] Trace { get; } - - } - /// Error details - internal partial interface IInnerErrorTraceInternal - - { - /// detailed error trace - string[] Trace { get; set; } - - } -} \ 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/Api20210308/MyWorkbook.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/MyWorkbook.cs deleted file mode 100644 index a994b70a8a0e..000000000000 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/MyWorkbook.cs +++ /dev/null @@ -1,418 +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 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.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(); - - /// 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; } - - /// 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; } - - /// 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 */; } - - /// 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; } - - /// 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 */; } - - /// 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; } - - /// 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 */; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.Kind? _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; } - - /// 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; } - - /// 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;} } } - - /// 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;} } } - - /// 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; } - - /// 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; } - - /// 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; } - - /// 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; } - - /// 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; } - - /// - /// 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 */; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.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; } - - /// Gets the resource group name - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.FormatTable(Index = 0)] - public string ResourceGroupName { get => (new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Success ? new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Groups["resourceGroupName"].Value : null); } - - /// - /// Configuration of this particular private 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.Api20210308.IMyWorkbookPropertiesInternal)Property).SerializedData; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.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; } - - /// 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; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.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()); } - - /// 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); } - - /// 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; } - - /// 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)""); } - - /// 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); } - - /// 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; } - - /// 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)""); } - - /// 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 */; } - - /// - /// 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; } - - /// 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; } - - /// 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; } - - /// 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; } - - /// 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; } - - /// - /// 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; } - - /// Creates an new instance. - public MyWorkbook() - { - - } - - /// Validates that this object meets the validation criteria. - /// an instance that will receive validation - /// events. - /// - /// A that will be complete when validation is completed. - /// - public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener) - { - await eventListener.AssertNotNull(nameof(__myWorkbookResource), __myWorkbookResource); - await eventListener.AssertObjectIsValid(nameof(__myWorkbookResource), __myWorkbookResource); - } - } - /// 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 - { - /// Workbook category, as defined by the user at creation time. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Workbook category, as defined by the user at creation time.", - SerializedName = @"category", - PossibleTypes = new [] { typeof(string) })] - string Category { get; set; } - /// The user-defined name of the private workbook. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The user-defined name of the private workbook.", - SerializedName = @"displayName", - PossibleTypes = new [] { typeof(string) })] - string DisplayName { get; set; } - /// The kind of workbook. Choices are user and shared. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = false, - 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; } - /// - /// 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, - 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; } - /// - /// 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, - Description = @"Configuration of this particular private workbook. Configuration data is a string containing valid JSON", - SerializedName = @"serializedData", - PossibleTypes = new [] { typeof(string) })] - string SerializedData { get; set; } - /// Optional resourceId for a source resource. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Optional resourceId for a source resource.", - SerializedName = @"sourceId", - PossibleTypes = new [] { typeof(string) })] - string SourceId { get; set; } - /// BYOS Storage Account URI - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"BYOS Storage Account URI", - SerializedName = @"storageUri", - PossibleTypes = new [] { typeof(string) })] - string StorageUri { get; set; } - /// The timestamp of resource creation (UTC). - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The timestamp of resource creation (UTC).", - SerializedName = @"createdAt", - PossibleTypes = new [] { typeof(global::System.DateTime) })] - global::System.DateTime? SystemDataCreatedAt { get; set; } - /// The identity that created the resource. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The identity that created the resource.", - SerializedName = @"createdBy", - PossibleTypes = new [] { typeof(string) })] - string SystemDataCreatedBy { get; set; } - /// The type of identity that created the resource. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = 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; } - /// The timestamp of resource last modification (UTC) - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The timestamp of resource last modification (UTC)", - SerializedName = @"lastModifiedAt", - PossibleTypes = new [] { typeof(global::System.DateTime) })] - global::System.DateTime? SystemDataLastModifiedAt { get; set; } - /// The identity that last modified the resource. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The identity that last modified the resource.", - SerializedName = @"lastModifiedBy", - PossibleTypes = new [] { typeof(string) })] - string SystemDataLastModifiedBy { get; set; } - /// The type of identity that last modified the resource. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The type of identity that last modified the resource.", - SerializedName = @"lastModifiedByType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.CreatedByType) })] - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.CreatedByType? SystemDataLastModifiedByType { 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, - Description = @"Date and time in UTC of the last modification that was made to this private workbook definition.", - SerializedName = @"timeModified", - PossibleTypes = new [] { typeof(string) })] - string TimeModified { get; } - /// Unique user id of the specific user that owns this private workbook. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"Unique user id of the specific user that owns this private workbook.", - SerializedName = @"userId", - PossibleTypes = new [] { typeof(string) })] - string UserId { get; } - /// - /// 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.Runtime.Info( - Required = false, - ReadOnly = false, - 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) })] - string Version { get; set; } - - } - /// An Application Insights private workbook definition. - internal partial interface IMyWorkbookInternal : - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.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; } - /// - /// A list of 0 or more tags that are associated with this private workbook definition - /// - string[] PropertiesTag { get; set; } - /// Metadata describing a workbook for an Azure resource. - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookProperties Property { get; set; } - /// - /// Configuration of this particular private workbook. Configuration data is a string containing valid JSON - /// - string SerializedData { get; set; } - /// Optional resourceId for a source resource. - string SourceId { get; set; } - /// 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; } - /// 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; } - /// 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; } - /// - /// Date and time in UTC of the last modification that was made to this private workbook definition. - /// - string TimeModified { get; set; } - /// Unique user id of the specific user that owns this private workbook. - string UserId { get; set; } - /// - /// This instance's version of the data model. This can change as new features are added that can be marked private workbook. - /// - string Version { get; set; } - - } -} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/MyWorkbookError.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/MyWorkbookError.PowerShell.cs deleted file mode 100644 index a1fca58dfe5f..000000000000 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/MyWorkbookError.PowerShell.cs +++ /dev/null @@ -1,190 +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; - - /// Error response. - [System.ComponentModel.TypeConverter(typeof(MyWorkbookErrorTypeConverter))] - public partial class MyWorkbookError - { - - /// - /// 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.IMyWorkbookError DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new MyWorkbookError(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.IMyWorkbookError DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new MyWorkbookError(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.IMyWorkbookError 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 MyWorkbookError(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("Error")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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); - } - 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); - } - 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); - } - 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); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal MyWorkbookError(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("Error")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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); - } - 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); - } - 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); - } - 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); - } - 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(); - } - } - /// Error response. - [System.ComponentModel.TypeConverter(typeof(MyWorkbookErrorTypeConverter))] - public partial interface IMyWorkbookError - - { - - } -} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/MyWorkbookError.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/MyWorkbookError.cs deleted file mode 100644 index fb22f4cdfb1d..000000000000 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/MyWorkbookError.cs +++ /dev/null @@ -1,107 +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 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 - { - - /// - /// Service specific error code which serves as the substatus for the HTTP error code. - /// - [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; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.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 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; } - - /// 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; } - - /// 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; } - - /// 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;} } } - - /// 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; } - - /// 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; } - - /// Creates an new instance. - public MyWorkbookError() - { - - } - } - /// Error response. - public partial interface IMyWorkbookError : - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IJsonSerializable - { - /// - /// Service specific error code which serves as the substatus for the HTTP error code. - /// - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"Service specific error code which serves as the substatus for the HTTP error code.", - SerializedName = @"code", - PossibleTypes = new [] { typeof(string) })] - string Code { get; } - /// Internal error details. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"Internal error details.", - SerializedName = @"innererror", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IAny) })] - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IAny Innererror { get; } - /// Description of the error. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"Description of the error.", - SerializedName = @"message", - PossibleTypes = new [] { typeof(string) })] - string Message { get; } - - } - /// Error response. - internal partial interface IMyWorkbookErrorInternal - - { - /// - /// Service specific error code which serves as the substatus for the HTTP error code. - /// - string Code { get; set; } - /// The error details. - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IErrorDefinition Error { get; set; } - /// Internal error details. - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IAny Innererror { get; set; } - /// Description of the error. - string Message { get; set; } - - } -} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/MyWorkbookManagedIdentity.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/MyWorkbookManagedIdentity.PowerShell.cs deleted file mode 100644 index 8c5f6dbbddab..000000000000 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/MyWorkbookManagedIdentity.PowerShell.cs +++ /dev/null @@ -1,190 +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; - - /// Customer Managed Identity - [System.ComponentModel.TypeConverter(typeof(MyWorkbookManagedIdentityTypeConverter))] - public partial class MyWorkbookManagedIdentity - { - - /// - /// 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.IMyWorkbookManagedIdentity DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new MyWorkbookManagedIdentity(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.IMyWorkbookManagedIdentity DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new MyWorkbookManagedIdentity(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.IMyWorkbookManagedIdentity 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 MyWorkbookManagedIdentity(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // 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); - } - 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); - } - 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); - } - 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); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal MyWorkbookManagedIdentity(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // 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); - } - 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); - } - 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); - } - 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); - } - 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(); - } - } - /// Customer Managed Identity - [System.ComponentModel.TypeConverter(typeof(MyWorkbookManagedIdentityTypeConverter))] - public partial interface IMyWorkbookManagedIdentity - - { - - } -} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/MyWorkbookManagedIdentity.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/MyWorkbookManagedIdentity.cs deleted file mode 100644 index 8c6f05ded4e5..000000000000 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/MyWorkbookManagedIdentity.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.Models.Api20210308 -{ - 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 - { - - /// 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;} } } - - /// 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; } - - /// 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; } - - /// Backing field for property. - private string _type; - - /// The identity type. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] - public string Type { get => this._type; set => this._type = value; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.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; } - - /// 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; } - - /// 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; } - - /// Creates an new instance. - public MyWorkbookManagedIdentity() - { - - } - } - /// Customer Managed Identity - public partial interface IMyWorkbookManagedIdentity : - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IJsonSerializable - { - /// The identity type. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The identity type.", - SerializedName = @"type", - PossibleTypes = new [] { typeof(string) })] - string Type { get; set; } - /// The principal ID of resource identity. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The principal ID of resource identity.", - SerializedName = @"principalId", - PossibleTypes = new [] { typeof(string) })] - string UserAssignedIdentityPrincipalId { get; } - /// The tenant ID of resource. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The tenant ID of resource.", - SerializedName = @"tenantId", - PossibleTypes = new [] { typeof(string) })] - string UserAssignedIdentityTenantId { get; } - - } - /// Customer Managed Identity - 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; } - /// The principal ID of resource identity. - string UserAssignedIdentityPrincipalId { get; set; } - /// The tenant ID of resource. - string UserAssignedIdentityTenantId { get; set; } - - } -} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/MyWorkbookProperties.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/MyWorkbookProperties.PowerShell.cs deleted file mode 100644 index 7a3477a68abd..000000000000 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/MyWorkbookProperties.PowerShell.cs +++ /dev/null @@ -1,230 +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; - - /// Properties that contain a private workbook. - [System.ComponentModel.TypeConverter(typeof(MyWorkbookPropertiesTypeConverter))] - public partial class MyWorkbookProperties - { - - /// - /// 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.IMyWorkbookProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new MyWorkbookProperties(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.IMyWorkbookProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new MyWorkbookProperties(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.IMyWorkbookProperties 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 MyWorkbookProperties(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // 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); - } - 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); - } - 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); - } - 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); - } - 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); - } - 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)); - } - 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); - } - 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); - } - 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); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal MyWorkbookProperties(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // 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); - } - 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); - } - 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); - } - 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); - } - 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); - } - 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)); - } - 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); - } - 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); - } - 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); - } - 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(); - } - } - /// Properties that contain a private workbook. - [System.ComponentModel.TypeConverter(typeof(MyWorkbookPropertiesTypeConverter))] - public partial interface IMyWorkbookProperties - - { - - } -} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/MyWorkbookResource.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/MyWorkbookResource.PowerShell.cs deleted file mode 100644 index 357722683bd6..000000000000 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/MyWorkbookResource.PowerShell.cs +++ /dev/null @@ -1,246 +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 azure resource object - [System.ComponentModel.TypeConverter(typeof(MyWorkbookResourceTypeConverter))] - public partial class MyWorkbookResource - { - - /// - /// 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.IMyWorkbookResource DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new MyWorkbookResource(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.IMyWorkbookResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new MyWorkbookResource(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.IMyWorkbookResource 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 MyWorkbookResource(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // 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); - } - 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("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); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal MyWorkbookResource(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // 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); - } - 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("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); - } - 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 azure resource object - [System.ComponentModel.TypeConverter(typeof(MyWorkbookResourceTypeConverter))] - public partial interface IMyWorkbookResource - - { - - } -} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/MyWorkbookResource.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/MyWorkbookResource.cs deleted file mode 100644 index e5b515ef9d54..000000000000 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/MyWorkbookResource.cs +++ /dev/null @@ -1,211 +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 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 - { - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.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; } - - /// Backing field for property. - private string _id; - - /// Azure resource Id - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] - public string Id { get => this._id; set => this._id = value; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.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; } - - /// 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; } - - /// Backing field for property. - private string _location; - - /// Resource location - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.FormatTable(Index = 3)] - 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;} } } - - /// 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; } - - /// 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; } - - /// 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; } - - /// Backing field for property. - private string _name; - - /// Azure resource name - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.FormatTable(Index = 1)] - public string Name { get => this._name; set => this._name = value; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.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; } - - /// Backing field for property. - private string _type; - - /// Azure resource type - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] - public string Type { get => this._type; set => this._type = 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.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; } - - /// Creates an new instance. - public MyWorkbookResource() - { - - } - } - /// An azure resource object - public partial interface IMyWorkbookResource : - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IJsonSerializable - { - /// Resource etag - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = false, - 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; } - /// Azure resource Id - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Azure resource Id", - SerializedName = @"id", - PossibleTypes = new [] { typeof(string) })] - string Id { get; set; } - /// The identity type. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The identity type.", - SerializedName = @"type", - PossibleTypes = new [] { typeof(string) })] - string IdentityType { get; set; } - /// Resource location - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Resource location", - SerializedName = @"location", - PossibleTypes = new [] { typeof(string) })] - string Location { get; set; } - /// Azure resource name - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Azure resource name", - SerializedName = @"name", - PossibleTypes = new [] { typeof(string) })] - string Name { get; set; } - /// Resource tags - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Resource tags", - SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResourceTags) })] - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResourceTags Tag { get; set; } - /// Azure resource type - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Azure resource type", - SerializedName = @"type", - PossibleTypes = new [] { typeof(string) })] - string Type { get; set; } - /// The principal ID of resource identity. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The principal ID of resource identity.", - SerializedName = @"principalId", - PossibleTypes = new [] { typeof(string) })] - string UserAssignedIdentityPrincipalId { get; } - /// The tenant ID of resource. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The tenant ID of resource.", - SerializedName = @"tenantId", - PossibleTypes = new [] { typeof(string) })] - string UserAssignedIdentityTenantId { get; } - - } - /// An azure resource object - internal partial interface IMyWorkbookResourceInternal - - { - /// Resource etag - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.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; } - /// The identity type. - string IdentityType { get; set; } - /// Customer Managed Identity - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.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; } - /// Azure resource type - string Type { get; set; } - /// The principal ID of resource identity. - string UserAssignedIdentityPrincipalId { get; set; } - /// The tenant ID of resource. - string UserAssignedIdentityTenantId { get; set; } - - } -} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/MyWorkbookResource.json.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/MyWorkbookResource.json.cs deleted file mode 100644 index 350ce4122fdb..000000000000 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/MyWorkbookResource.json.cs +++ /dev/null @@ -1,120 +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 static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; - - /// An azure resource object - public partial class MyWorkbookResource - { - - /// - /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object - /// before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The JsonNode that should be deserialized into this object. - - partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json); - - /// - /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The JSON container that the serialization result will be placed in. - - partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container); - - /// - /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of - /// the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the - /// output parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The JsonNode that should be deserialized into this object. - /// Determines if the rest of the deserialization should be processed, or if the method should return - /// instantly. - - partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json, ref bool returnNow); - - /// - /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the - /// object before it is serialized. - /// If you wish to disable the default serialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The JSON container that the serialization result will be placed in. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container, ref bool returnNow); - - /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResource. - /// - /// a to deserialize from. - /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbookResource. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.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; - } - - /// - /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject into a new instance of . - /// - /// A Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject instance to deserialize from. - internal MyWorkbookResource(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json) - { - bool returnNow = false; - BeforeFromJson(json, ref returnNow); - if (returnNow) - { - 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;} - AfterFromJson(json); - } - - /// - /// Serializes this instance of into a . - /// - /// The container to serialize this object into. If the caller - /// passes in null, a new instance will be created and returned to the caller. - /// Allows the caller to choose the depth of the serialization. See . - /// - /// a serialized instance of as a . - /// - public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode serializationMode) - { - container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject(); - - bool returnNow = false; - BeforeToJson(ref container, ref returnNow); - if (returnNow) - { - return container; - } - AddIf( null != this._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 ); - 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); - return container; - } - } -} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/MyWorkbooksListResult.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/MyWorkbooksListResult.cs deleted file mode 100644 index 728a5de9649d..000000000000 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/MyWorkbooksListResult.cs +++ /dev/null @@ -1,70 +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 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 - { - - /// 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;} } } - - /// Backing field for property. - private string _nextLink; - - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] - public string NextLink { get => this._nextLink; set => this._nextLink = value; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbook[] _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; } - - /// Creates an new instance. - public MyWorkbooksListResult() - { - - } - } - /// Workbook list result. - public partial interface IMyWorkbooksListResult : - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IJsonSerializable - { - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"", - SerializedName = @"nextLink", - PossibleTypes = new [] { typeof(string) })] - string NextLink { get; set; } - /// An array of private workbooks. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = true, - 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; } - - } - /// Workbook list result. - internal partial interface IMyWorkbooksListResultInternal - - { - string NextLink { get; set; } - /// An array of private workbooks. - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IMyWorkbook[] Value { get; set; } - - } -} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/Operation.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/Operation.PowerShell.cs deleted file mode 100644 index 5242c9fc3e2b..000000000000 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/Operation.PowerShell.cs +++ /dev/null @@ -1,196 +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; - - /// Azure Workbooks REST API operation - [System.ComponentModel.TypeConverter(typeof(OperationTypeConverter))] - public partial class Operation - { - - /// - /// 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.IOperation DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new Operation(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.IOperation DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new Operation(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.IOperation 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 Operation(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("Display")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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); - } - 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); - } - 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); - } - 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); - } - 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); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal Operation(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("Display")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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); - } - 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); - } - 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); - } - 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); - } - 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); - } - 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(); - } - } - /// Azure Workbooks REST API operation - [System.ComponentModel.TypeConverter(typeof(OperationTypeConverter))] - public partial interface IOperation - - { - - } -} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/Operation.TypeConverter.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/Operation.TypeConverter.cs deleted file mode 100644 index c816d0eb07c3..000000000000 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/Operation.TypeConverter.cs +++ /dev/null @@ -1,146 +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; - - /// - /// A PowerShell PSTypeConverter to support converting to an instance of - /// - public partial class OperationTypeConverter : global::System.Management.Automation.PSTypeConverter - { - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false. - /// - public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); - - /// - /// Determines if the converter can convert the parameter to the type. - /// - /// the instance to check if it can be converted to the type. - /// - /// true if the instance could be converted to a type, otherwise false - /// - public static bool CanConvertFrom(dynamic sourceValue) - { - if (null == sourceValue) - { - return true; - } - global::System.Type type = sourceValue.GetType(); - if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) - { - // we say yest to PSObjects - return true; - } - if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) - { - // we say yest to Hashtables/dictionaries - return true; - } - try - { - if (null != sourceValue.ToJsonString()) - { - return true; - } - } - catch - { - // Not one of our objects - } - try - { - string text = sourceValue.ToString()?.Trim(); - return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonType.Object; - } - catch - { - // Doesn't look like it can be treated as JSON - } - return false; - } - - /// - /// Determines if the parameter can be converted to the - /// parameter - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false - /// - public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; - - /// - /// Converts the parameter to the parameter using and - /// - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// - /// an instance of , or null if there is no suitable conversion. - /// - public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); - - /// - /// Converts the parameter into an instance of - /// - /// the value to convert into an instance of . - /// - /// an instance of , or null if there is no suitable conversion. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.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)) - { - return sourceValue; - } - try - { - return Operation.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; - } - catch - { - // Unable to use JSON pattern - } - if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) - { - return Operation.DeserializeFromPSObject(sourceValue); - } - if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) - { - return Operation.DeserializeFromDictionary(sourceValue); - } - return null; - } - - /// NotImplemented -- this will return null - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// will always return null. - public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; - } -} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/Operation.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/Operation.cs deleted file mode 100644 index 4d11395d2599..000000000000 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/Operation.cs +++ /dev/null @@ -1,105 +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 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 - { - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.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; } - - /// 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; } - - /// 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; } - - /// 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; } - - /// 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;} } } - - /// Backing field for property. - private string _name; - - /// Operation name: {provider}/{resource}/{operation} - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] - public string Name { get => this._name; set => this._name = value; } - - /// Creates an new instance. - public Operation() - { - - } - } - /// Azure Workbooks REST API operation - public partial interface IOperation : - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IJsonSerializable - { - /// Operation type: Read, write, delete, etc. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Operation type: Read, write, delete, etc.", - SerializedName = @"operation", - PossibleTypes = new [] { typeof(string) })] - string DisplayOperation { get; set; } - /// Service provider: Microsoft.Insights - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Service provider: Microsoft.Insights", - SerializedName = @"provider", - PossibleTypes = new [] { typeof(string) })] - string DisplayProvider { get; set; } - /// Resource on which the operation is performed: Profile, endpoint, etc. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Resource on which the operation is performed: Profile, endpoint, etc.", - SerializedName = @"resource", - PossibleTypes = new [] { typeof(string) })] - string DisplayResource { get; set; } - /// Operation name: {provider}/{resource}/{operation} - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Operation name: {provider}/{resource}/{operation}", - SerializedName = @"name", - PossibleTypes = new [] { typeof(string) })] - string Name { get; set; } - - } - /// Azure Workbooks REST API operation - internal partial interface IOperationInternal - - { - /// The object that represents the operation. - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IOperationDisplay Display { get; set; } - /// Operation type: Read, write, delete, etc. - string DisplayOperation { get; set; } - /// Service provider: Microsoft.Insights - string DisplayProvider { get; set; } - /// Resource on which the operation is performed: Profile, endpoint, etc. - string DisplayResource { get; set; } - /// Operation name: {provider}/{resource}/{operation} - string Name { get; set; } - - } -} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/Operation.json.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/Operation.json.cs deleted file mode 100644 index 0c8167260fc1..000000000000 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/Operation.json.cs +++ /dev/null @@ -1,110 +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 static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; - - /// Azure Workbooks REST API operation - public partial class Operation - { - - /// - /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object - /// before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The JsonNode that should be deserialized into this object. - - partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json); - - /// - /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The JSON container that the serialization result will be placed in. - - partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container); - - /// - /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of - /// the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the - /// output parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The JsonNode that should be deserialized into this object. - /// Determines if the rest of the deserialization should be processed, or if the method should return - /// instantly. - - partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json, ref bool returnNow); - - /// - /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the - /// object before it is serialized. - /// If you wish to disable the default serialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The JSON container that the serialization result will be placed in. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container, ref bool returnNow); - - /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IOperation. - /// - /// a to deserialize from. - /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IOperation. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.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; - } - - /// - /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject into a new instance of . - /// - /// A Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject instance to deserialize from. - internal Operation(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json) - { - bool returnNow = false; - BeforeFromJson(json, ref returnNow); - if (returnNow) - { - return; - } - {_display = If( json?.PropertyT("display"), out var __jsonDisplay) ? Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.OperationDisplay.FromJson(__jsonDisplay) : Display;} - {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} - AfterFromJson(json); - } - - /// - /// Serializes this instance of into a . - /// - /// The container to serialize this object into. If the caller - /// passes in null, a new instance will be created and returned to the caller. - /// Allows the caller to choose the depth of the serialization. See . - /// - /// a serialized instance of as a . - /// - public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode serializationMode) - { - container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject(); - - bool returnNow = false; - BeforeToJson(ref container, ref returnNow); - if (returnNow) - { - return container; - } - AddIf( null != this._display ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) this._display.ToJson(null,serializationMode) : null, "display" ,container.Add ); - AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); - AfterToJson(ref container); - return container; - } - } -} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/OperationDisplay.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/OperationDisplay.PowerShell.cs deleted file mode 100644 index dd0c1fbb3a30..000000000000 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/OperationDisplay.PowerShell.cs +++ /dev/null @@ -1,182 +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; - - /// The object that represents the operation. - [System.ComponentModel.TypeConverter(typeof(OperationDisplayTypeConverter))] - public partial class OperationDisplay - { - - /// - /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the - /// object before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Collections.IDictionary content that should be used. - - partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); - - /// - /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object - /// before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Management.Automation.PSObject content that should be used. - - partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); - - /// - /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Collections.IDictionary content that should be used. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); - - /// - /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Management.Automation.PSObject content that should be used. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); - - /// - /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior - /// - /// /// instance serialized to a string, normally it is a Json - /// /// set returnNow to true if you provide a customized OverrideToString function - - partial void OverrideToString(ref string stringResult, ref bool returnNow); - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IOperationDisplay DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new OperationDisplay(content); - } - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IOperationDisplay DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new OperationDisplay(content); - } - - /// - /// Creates a new instance of , deserializing the content from a json string. - /// - /// a string containing a JSON serialized instance of this model. - /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IOperationDisplay FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal OperationDisplay(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("Provider")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IOperationDisplayInternal)this).Provider = (string) content.GetValueForProperty("Provider",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.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); - } - 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); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal OperationDisplay(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("Provider")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IOperationDisplayInternal)this).Provider = (string) content.GetValueForProperty("Provider",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.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); - } - 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); - } - AfterDeserializePSObject(content); - } - - /// Serializes this instance to a json string. - - /// a containing this model serialized to JSON text. - public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeAll)?.ToString(); - - public override string ToString() - { - var returnNow = false; - var result = global::System.String.Empty; - OverrideToString(ref result, ref returnNow); - if (returnNow) - { - return result; - } - return ToJsonString(); - } - } - /// The object that represents the operation. - [System.ComponentModel.TypeConverter(typeof(OperationDisplayTypeConverter))] - public partial interface IOperationDisplay - - { - - } -} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/OperationDisplay.TypeConverter.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/OperationDisplay.TypeConverter.cs deleted file mode 100644 index b09ac88517ce..000000000000 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/OperationDisplay.TypeConverter.cs +++ /dev/null @@ -1,147 +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; - - /// - /// A PowerShell PSTypeConverter to support converting to an instance of - /// - public partial class OperationDisplayTypeConverter : global::System.Management.Automation.PSTypeConverter - { - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false. - /// - public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); - - /// - /// Determines if the converter can convert the parameter to the - /// type. - /// - /// the instance to check if it can be converted to the type. - /// - /// true if the instance could be converted to a type, otherwise false - /// - public static bool CanConvertFrom(dynamic sourceValue) - { - if (null == sourceValue) - { - return true; - } - global::System.Type type = sourceValue.GetType(); - if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) - { - // we say yest to PSObjects - return true; - } - if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) - { - // we say yest to Hashtables/dictionaries - return true; - } - try - { - if (null != sourceValue.ToJsonString()) - { - return true; - } - } - catch - { - // Not one of our objects - } - try - { - string text = sourceValue.ToString()?.Trim(); - return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonType.Object; - } - catch - { - // Doesn't look like it can be treated as JSON - } - return false; - } - - /// - /// Determines if the parameter can be converted to the - /// parameter - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false - /// - public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; - - /// - /// Converts the parameter to the parameter using and - /// - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// - /// an instance of , or null if there is no suitable conversion. - /// - public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); - - /// - /// Converts the parameter into an instance of - /// - /// the value to convert into an instance of . - /// - /// an instance of , or null if there is no suitable conversion. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.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)) - { - return sourceValue; - } - try - { - return OperationDisplay.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; - } - catch - { - // Unable to use JSON pattern - } - if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) - { - return OperationDisplay.DeserializeFromPSObject(sourceValue); - } - if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) - { - return OperationDisplay.DeserializeFromDictionary(sourceValue); - } - return null; - } - - /// NotImplemented -- this will return null - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// will always return null. - public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; - } -} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/OperationDisplay.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/OperationDisplay.cs deleted file mode 100644 index 40bc5069a057..000000000000 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/OperationDisplay.cs +++ /dev/null @@ -1,85 +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 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 - { - - /// Backing field for property. - private string _operation; - - /// Operation type: Read, write, delete, etc. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] - public string Operation { get => this._operation; set => this._operation = value; } - - /// Backing field for property. - private string _provider; - - /// Service provider: Microsoft.Insights - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] - public string Provider { get => this._provider; set => this._provider = value; } - - /// Backing field for property. - private string _resource; - - /// Resource on which the operation is performed: Profile, endpoint, etc. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] - public string Resource { get => this._resource; set => this._resource = value; } - - /// Creates an new instance. - public OperationDisplay() - { - - } - } - /// The object that represents the operation. - public partial interface IOperationDisplay : - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IJsonSerializable - { - /// Operation type: Read, write, delete, etc. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Operation type: Read, write, delete, etc.", - SerializedName = @"operation", - PossibleTypes = new [] { typeof(string) })] - string Operation { get; set; } - /// Service provider: Microsoft.Insights - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Service provider: Microsoft.Insights", - SerializedName = @"provider", - PossibleTypes = new [] { typeof(string) })] - string Provider { get; set; } - /// Resource on which the operation is performed: Profile, endpoint, etc. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Resource on which the operation is performed: Profile, endpoint, etc.", - SerializedName = @"resource", - PossibleTypes = new [] { typeof(string) })] - string Resource { get; set; } - - } - /// The object that represents the operation. - internal partial interface IOperationDisplayInternal - - { - /// Operation type: Read, write, delete, etc. - string Operation { get; set; } - /// Service provider: Microsoft.Insights - string Provider { get; set; } - /// Resource on which the operation is performed: Profile, endpoint, etc. - string Resource { get; set; } - - } -} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/OperationDisplay.json.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/OperationDisplay.json.cs deleted file mode 100644 index 32015755c0ad..000000000000 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/OperationDisplay.json.cs +++ /dev/null @@ -1,112 +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 static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; - - /// The object that represents the operation. - public partial class OperationDisplay - { - - /// - /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object - /// before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The JsonNode that should be deserialized into this object. - - partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json); - - /// - /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The JSON container that the serialization result will be placed in. - - partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container); - - /// - /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of - /// the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the - /// output parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The JsonNode that should be deserialized into this object. - /// Determines if the rest of the deserialization should be processed, or if the method should return - /// instantly. - - partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json, ref bool returnNow); - - /// - /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the - /// object before it is serialized. - /// If you wish to disable the default serialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The JSON container that the serialization result will be placed in. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container, ref bool returnNow); - - /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IOperationDisplay. - /// - /// a to deserialize from. - /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IOperationDisplay. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IOperationDisplay FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) - { - return node is Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json ? new OperationDisplay(json) : null; - } - - /// - /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject into a new instance of . - /// - /// A Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject instance to deserialize from. - internal OperationDisplay(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json) - { - bool returnNow = false; - BeforeFromJson(json, ref returnNow); - if (returnNow) - { - return; - } - {_provider = If( json?.PropertyT("provider"), out var __jsonProvider) ? (string)__jsonProvider : (string)Provider;} - {_resource = If( json?.PropertyT("resource"), out var __jsonResource) ? (string)__jsonResource : (string)Resource;} - {_operation = If( json?.PropertyT("operation"), out var __jsonOperation) ? (string)__jsonOperation : (string)Operation;} - AfterFromJson(json); - } - - /// - /// Serializes this instance of into a . - /// - /// The container to serialize this object into. If the caller - /// passes in null, a new instance will be created and returned to the caller. - /// Allows the caller to choose the depth of the serialization. See . - /// - /// a serialized instance of as a . - /// - public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode serializationMode) - { - container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject(); - - bool returnNow = false; - BeforeToJson(ref container, ref returnNow); - if (returnNow) - { - return container; - } - AddIf( null != (((object)this._provider)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(this._provider.ToString()) : null, "provider" ,container.Add ); - AddIf( null != (((object)this._resource)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(this._resource.ToString()) : null, "resource" ,container.Add ); - AddIf( null != (((object)this._operation)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(this._operation.ToString()) : null, "operation" ,container.Add ); - AfterToJson(ref container); - return container; - } - } -} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/OperationListResult.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/OperationListResult.PowerShell.cs deleted file mode 100644 index a9c5a1271c99..000000000000 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/OperationListResult.PowerShell.cs +++ /dev/null @@ -1,178 +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; - - /// - /// Result of the request to list Azure Workbooks operations. It contains a list of operations and a URL link to get the next - /// set of results. - /// - [System.ComponentModel.TypeConverter(typeof(OperationListResultTypeConverter))] - public partial class OperationListResult - { - - /// - /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the - /// object before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Collections.IDictionary content that should be used. - - partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); - - /// - /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object - /// before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Management.Automation.PSObject content that should be used. - - partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); - - /// - /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Collections.IDictionary content that should be used. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); - - /// - /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Management.Automation.PSObject content that should be used. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); - - /// - /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior - /// - /// /// instance serialized to a string, normally it is a Json - /// /// set returnNow to true if you provide a customized OverrideToString function - - partial void OverrideToString(ref string stringResult, ref bool returnNow); - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IOperationListResult DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new OperationListResult(content); - } - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IOperationListResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new OperationListResult(content); - } - - /// - /// Creates a new instance of , deserializing the content from a json string. - /// - /// a string containing a JSON serialized instance of this model. - /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IOperationListResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal OperationListResult(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("Value")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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)); - } - 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); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal OperationListResult(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("Value")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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)); - } - 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); - } - AfterDeserializePSObject(content); - } - - /// Serializes this instance to a json string. - - /// a containing this model serialized to JSON text. - public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeAll)?.ToString(); - - public override string ToString() - { - var returnNow = false; - var result = global::System.String.Empty; - OverrideToString(ref result, ref returnNow); - if (returnNow) - { - return result; - } - return ToJsonString(); - } - } - /// Result of the request to list Azure Workbooks operations. It contains a list of operations and a URL link to get the next - /// set of results. - [System.ComponentModel.TypeConverter(typeof(OperationListResultTypeConverter))] - public partial interface IOperationListResult - - { - - } -} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/OperationListResult.TypeConverter.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/OperationListResult.TypeConverter.cs deleted file mode 100644 index a6ba09f4ba3f..000000000000 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/OperationListResult.TypeConverter.cs +++ /dev/null @@ -1,147 +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; - - /// - /// A PowerShell PSTypeConverter to support converting to an instance of - /// - public partial class OperationListResultTypeConverter : global::System.Management.Automation.PSTypeConverter - { - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false. - /// - public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); - - /// - /// Determines if the converter can convert the parameter to the - /// type. - /// - /// the instance to check if it can be converted to the type. - /// - /// true if the instance could be converted to a type, otherwise false - /// - public static bool CanConvertFrom(dynamic sourceValue) - { - if (null == sourceValue) - { - return true; - } - global::System.Type type = sourceValue.GetType(); - if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) - { - // we say yest to PSObjects - return true; - } - if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) - { - // we say yest to Hashtables/dictionaries - return true; - } - try - { - if (null != sourceValue.ToJsonString()) - { - return true; - } - } - catch - { - // Not one of our objects - } - try - { - string text = sourceValue.ToString()?.Trim(); - return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonType.Object; - } - catch - { - // Doesn't look like it can be treated as JSON - } - return false; - } - - /// - /// Determines if the parameter can be converted to the - /// parameter - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false - /// - public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; - - /// - /// Converts the parameter to the parameter using and - /// - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// - /// an instance of , or null if there is no suitable conversion. - /// - public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); - - /// - /// Converts the parameter into an instance of - /// - /// the value to convert into an instance of . - /// - /// an instance of , or null if there is no suitable conversion. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.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)) - { - return sourceValue; - } - try - { - return OperationListResult.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; - } - catch - { - // Unable to use JSON pattern - } - if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) - { - return OperationListResult.DeserializeFromPSObject(sourceValue); - } - if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) - { - return OperationListResult.DeserializeFromDictionary(sourceValue); - } - return null; - } - - /// NotImplemented -- this will return null - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// will always return null. - public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; - } -} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/OperationListResult.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/OperationListResult.cs deleted file mode 100644 index 908e1a86a77a..000000000000 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/OperationListResult.cs +++ /dev/null @@ -1,79 +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 static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; - - /// - /// Result of the request to list Azure Workbooks operations. It contains a list of operations and a URL link to get the next - /// set of results. - /// - public partial class OperationListResult : - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IOperationListResult, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IOperationListResultInternal - { - - /// Backing field for property. - private string _nextLink; - - /// URL to get the next set of operation list results if there are any. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] - public string NextLink { get => this._nextLink; set => this._nextLink = value; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IOperation[] _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; } - - /// Creates an new instance. - public OperationListResult() - { - - } - } - /// Result of the request to list Azure Workbooks operations. It contains a list of operations and a URL link to get the next - /// set of results. - public partial interface IOperationListResult : - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IJsonSerializable - { - /// URL to get the next set of operation list results if there are any. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"URL to get the next set of operation list results if there are any.", - SerializedName = @"nextLink", - PossibleTypes = new [] { typeof(string) })] - string NextLink { get; set; } - /// - /// List of Workbook operations supported by the Microsoft.Insights resource provider. - /// - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = false, - 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; } - - } - /// Result of the request to list Azure Workbooks operations. It contains a list of operations and a URL link to get the next - /// set of results. - internal partial interface IOperationListResultInternal - - { - /// URL to get the next set of operation list results if there are any. - string NextLink { get; set; } - /// - /// List of Workbook operations supported by the Microsoft.Insights resource provider. - /// - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IOperation[] 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/Api20210308/OperationListResult.json.cs deleted file mode 100644 index 53c5bd091756..000000000000 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20210308/OperationListResult.json.cs +++ /dev/null @@ -1,121 +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 static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; - - /// - /// Result of the request to list Azure Workbooks operations. It contains a list of operations and a URL link to get the next - /// set of results. - /// - public partial class OperationListResult - { - - /// - /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object - /// before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The JsonNode that should be deserialized into this object. - - partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json); - - /// - /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The JSON container that the serialization result will be placed in. - - partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container); - - /// - /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of - /// the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the - /// output parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The JsonNode that should be deserialized into this object. - /// Determines if the rest of the deserialization should be processed, or if the method should return - /// instantly. - - partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json, ref bool returnNow); - - /// - /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the - /// object before it is serialized. - /// If you wish to disable the default serialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The JSON container that the serialization result will be placed in. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container, ref bool returnNow); - - /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IOperationListResult. - /// - /// a to deserialize from. - /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IOperationListResult. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20210308.IOperationListResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode node) - { - return node is Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json ? new OperationListResult(json) : null; - } - - /// - /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject into a new instance of . - /// - /// A Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject instance to deserialize from. - internal OperationListResult(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json) - { - bool returnNow = false; - BeforeFromJson(json, ref returnNow); - if (returnNow) - { - return; - } - {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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;} - AfterFromJson(json); - } - - /// - /// Serializes this instance of into a . - /// - /// The container to serialize this object into. If the caller - /// passes in null, a new instance will be created and returned to the caller. - /// Allows the caller to choose the depth of the serialization. See . - /// - /// a serialized instance of as a . - /// - public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode serializationMode) - { - container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject(); - - bool returnNow = false; - BeforeToJson(ref container, ref returnNow); - if (returnNow) - { - return container; - } - if (null != this._value) - { - var __w = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.XNodeArray(); - foreach( var __x in this._value ) - { - AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); - } - container.Add("value",__w); - } - AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); - AfterToJson(ref container); - return container; - } - } -} \ No newline at end of file diff --git a/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/Api20220401/Workbook.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/Workbook.cs deleted file mode 100644 index c40f0edb19fd..000000000000 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/Workbook.cs +++ /dev/null @@ -1,455 +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 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.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(); - - /// 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; } - - /// 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; } - - /// 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; } - - /// 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; } - - /// - /// 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; } - - /// 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 */; } - - /// - /// 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; } - - /// - /// 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; } - - /// - /// 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)""); } - - /// - /// 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.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 */; } - - /// 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)""); } - - /// 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 ; } - - /// 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; } - - /// 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; } - - /// 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; } - - /// 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;} } } - - /// 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; } - - /// 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;} } } - - /// 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; } - - /// 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; } - - /// 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; } - - /// 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; } - - /// 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; } - - /// 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 */; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.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; } - - /// Gets the resource group name - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.FormatTable(Index = 0)] - public string ResourceGroupName { get => (new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Success ? new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Groups["resourceGroupName"].Value : null); } - - /// The 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; } - - /// - /// 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; } - - /// 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; } - - /// 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; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.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()); } - - /// 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); } - - /// 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; } - - /// 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)""); } - - /// 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); } - - /// 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; } - - /// 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)""); } - - /// 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 */; } - - /// - /// 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; } - - /// - /// 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; } - - /// 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; } - - /// - /// 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; } - - /// Validates that this object meets the validation criteria. - /// an instance that will receive validation - /// events. - /// - /// A that will be complete when validation is completed. - /// - public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener) - { - await eventListener.AssertNotNull(nameof(__workbookResource), __workbookResource); - await eventListener.AssertObjectIsValid(nameof(__workbookResource), __workbookResource); - } - - /// Creates an new instance. - public Workbook() - { - - } - } - /// A workbook definition. - public partial interface IWorkbook : - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookResource - { - /// Workbook category, as defined by the user at creation time. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Workbook category, as defined by the user at creation time.", - SerializedName = @"category", - PossibleTypes = new [] { typeof(string) })] - string Category { get; set; } - /// The description of the workbook. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The description of the workbook.", - SerializedName = @"description", - PossibleTypes = new [] { typeof(string) })] - string Description { get; set; } - /// The user-defined name (display name) of the workbook. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The user-defined name (display name) of the workbook.", - SerializedName = @"displayName", - PossibleTypes = new [] { typeof(string) })] - string DisplayName { get; set; } - /// Being deprecated, please use the other tags field - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Being deprecated, please use the other tags field", - SerializedName = @"tags", - PossibleTypes = new [] { typeof(string) })] - string[] PropertiesTag { get; set; } - /// The unique revision id for this workbook definition - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The unique revision id for this workbook definition", - SerializedName = @"revision", - PossibleTypes = new [] { typeof(string) })] - string Revision { get; } - /// - /// Configuration of this particular workbook. Configuration data is a string containing valid JSON - /// - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Configuration of this particular workbook. Configuration data is a string containing valid JSON", - SerializedName = @"serializedData", - PossibleTypes = new [] { typeof(string) })] - string SerializedData { get; set; } - /// ResourceId for a source resource. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"ResourceId for a source resource.", - SerializedName = @"sourceId", - PossibleTypes = new [] { typeof(string) })] - string SourceId { get; set; } - /// The resourceId to the storage account when bring your own storage is used - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The resourceId to the storage account when bring your own storage is used", - SerializedName = @"storageUri", - PossibleTypes = new [] { typeof(string) })] - string StorageUri { get; set; } - /// The timestamp of resource creation (UTC). - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The timestamp of resource creation (UTC).", - SerializedName = @"createdAt", - PossibleTypes = new [] { typeof(global::System.DateTime) })] - global::System.DateTime? SystemDataCreatedAt { get; set; } - /// The identity that created the resource. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The identity that created the resource.", - SerializedName = @"createdBy", - PossibleTypes = new [] { typeof(string) })] - string SystemDataCreatedBy { get; set; } - /// The type of identity that created the resource. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = 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; } - /// The timestamp of resource last modification (UTC) - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The timestamp of resource last modification (UTC)", - SerializedName = @"lastModifiedAt", - PossibleTypes = new [] { typeof(global::System.DateTime) })] - global::System.DateTime? SystemDataLastModifiedAt { get; set; } - /// The identity that last modified the resource. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The identity that last modified the resource.", - SerializedName = @"lastModifiedBy", - PossibleTypes = new [] { typeof(string) })] - string SystemDataLastModifiedBy { get; set; } - /// The type of identity that last modified the resource. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The type of identity that last modified the resource.", - SerializedName = @"lastModifiedByType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.CreatedByType) })] - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.CreatedByType? SystemDataLastModifiedByType { 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, - 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) })] - global::System.DateTime? TimeModified { get; } - /// Unique user id of the specific user that owns this workbook. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"Unique user id of the specific user that owns this workbook.", - SerializedName = @"userId", - PossibleTypes = new [] { typeof(string) })] - string UserId { get; } - /// - /// Workbook schema version format, like 'Notebook/1.0', which should match the workbook in serializedData - /// - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Workbook schema version format, like 'Notebook/1.0', which should match the workbook in serializedData", - SerializedName = @"version", - PossibleTypes = new [] { typeof(string) })] - string Version { get; set; } - - } - /// A workbook definition. - internal partial interface IWorkbookInternal : - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookResourceInternal - { - /// Workbook category, as defined by the user at creation time. - string Category { get; set; } - /// The description of the workbook. - string Description { get; set; } - /// 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; } - /// Metadata describing a workbook for an Azure resource. - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookProperties Property { get; set; } - /// The unique revision id for this workbook definition - string Revision { get; set; } - /// - /// Configuration of this particular workbook. Configuration data is a string containing valid JSON - /// - string SerializedData { get; set; } - /// ResourceId for a source resource. - string SourceId { get; set; } - /// 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; } - /// 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; } - /// 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; } - /// - /// Date and time in UTC of the last modification that was made to this workbook definition. - /// - global::System.DateTime? TimeModified { get; set; } - /// Unique user id of the specific user that owns this workbook. - string UserId { get; set; } - /// - /// Workbook schema version format, like 'Notebook/1.0', which should match the workbook in serializedData - /// - string Version { get; set; } - - } -} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/WorkbookError.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/WorkbookError.PowerShell.cs deleted file mode 100644 index f93f83519127..000000000000 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/WorkbookError.PowerShell.cs +++ /dev/null @@ -1,196 +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; - - /// Error response. - [System.ComponentModel.TypeConverter(typeof(WorkbookErrorTypeConverter))] - public partial class WorkbookError - { - - /// - /// 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.IWorkbookError DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new WorkbookError(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.IWorkbookError DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new WorkbookError(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.IWorkbookError 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 WorkbookError(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("Error")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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); - } - 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); - } - 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); - } - 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); - } - 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)); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal WorkbookError(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("Error")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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); - } - 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); - } - 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); - } - 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); - } - 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)); - } - AfterDeserializePSObject(content); - } - } - /// Error response. - [System.ComponentModel.TypeConverter(typeof(WorkbookErrorTypeConverter))] - public partial interface IWorkbookError - - { - - } -} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/WorkbookError.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/WorkbookError.cs deleted file mode 100644 index 130acda3e252..000000000000 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/WorkbookError.cs +++ /dev/null @@ -1,112 +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 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 - { - - /// - /// Service specific error code which serves as the substatus for the HTTP error code. - /// - [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; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.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; } - - /// 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; } - - /// 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; } - - /// 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; } - - /// 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;} } } - - /// 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; } - - /// 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; } - - /// 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; } - - /// Creates an new instance. - public WorkbookError() - { - - } - } - /// Error response. - public partial interface IWorkbookError : - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IJsonSerializable - { - /// - /// Service specific error code which serves as the substatus for the HTTP error code. - /// - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"Service specific error code which serves as the substatus for the HTTP error code.", - SerializedName = @"code", - PossibleTypes = new [] { typeof(string) })] - string Code { get; } - /// detailed error trace - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"detailed error trace", - SerializedName = @"trace", - PossibleTypes = new [] { typeof(string) })] - string[] InnerErrorTrace { get; } - /// Description of the error. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"Description of the error.", - SerializedName = @"message", - PossibleTypes = new [] { typeof(string) })] - string Message { get; } - - } - /// Error response. - internal partial interface IWorkbookErrorInternal - - { - /// - /// Service specific error code which serves as the substatus for the HTTP error code. - /// - string Code { get; set; } - /// The error details. - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookErrorDefinition Error { get; set; } - /// Internal error details. - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookInnerErrorTrace InnerError { get; set; } - /// detailed error trace - string[] InnerErrorTrace { get; set; } - /// Description of the error. - string Message { get; set; } - - } -} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/WorkbookErrorDefinition.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/WorkbookErrorDefinition.PowerShell.cs deleted file mode 100644 index 4ff3408cbe4c..000000000000 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/WorkbookErrorDefinition.PowerShell.cs +++ /dev/null @@ -1,190 +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; - - /// Error definition. - [System.ComponentModel.TypeConverter(typeof(WorkbookErrorDefinitionTypeConverter))] - public partial class WorkbookErrorDefinition - { - - /// - /// 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.IWorkbookErrorDefinition DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new WorkbookErrorDefinition(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.IWorkbookErrorDefinition DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new WorkbookErrorDefinition(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.IWorkbookErrorDefinition 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 WorkbookErrorDefinition(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("InnerError")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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); - } - 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); - } - 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); - } - 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)); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal WorkbookErrorDefinition(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("InnerError")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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); - } - 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); - } - 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); - } - 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)); - } - AfterDeserializePSObject(content); - } - } - /// Error definition. - [System.ComponentModel.TypeConverter(typeof(WorkbookErrorDefinitionTypeConverter))] - public partial interface IWorkbookErrorDefinition - - { - - } -} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/WorkbookErrorDefinition.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/WorkbookErrorDefinition.cs deleted file mode 100644 index 16eb4afc3da2..000000000000 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/WorkbookErrorDefinition.cs +++ /dev/null @@ -1,113 +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 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 - { - - /// Backing field for property. - private string _code; - - /// - /// Service specific error code which serves as the substatus for the HTTP error code. - /// - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] - public string Code { get => this._code; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.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()); } - - /// 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; } - - /// Backing field for property. - private string _message; - - /// Description of the error. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] - 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;} } } - - /// 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;} } } - - /// 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; } - - /// Internal Acessors for Message - string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookErrorDefinitionInternal.Message { get => this._message; set { {_message = value;} } } - - /// Creates an new instance. - public WorkbookErrorDefinition() - { - - } - } - /// Error definition. - public partial interface IWorkbookErrorDefinition : - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IJsonSerializable - { - /// - /// Service specific error code which serves as the substatus for the HTTP error code. - /// - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"Service specific error code which serves as the substatus for the HTTP error code.", - SerializedName = @"code", - PossibleTypes = new [] { typeof(string) })] - string Code { get; } - /// detailed error trace - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"detailed error trace", - SerializedName = @"trace", - PossibleTypes = new [] { typeof(string) })] - string[] InnerErrorTrace { get; } - /// Description of the error. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"Description of the error.", - SerializedName = @"message", - PossibleTypes = new [] { typeof(string) })] - string Message { get; } - - } - /// Error definition. - internal partial interface IWorkbookErrorDefinitionInternal - - { - /// - /// Service specific error code which serves as the substatus for the HTTP error code. - /// - string Code { get; set; } - /// Internal error details. - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookInnerErrorTrace InnerError { get; set; } - /// detailed error trace - string[] InnerErrorTrace { get; set; } - /// Description of the error. - string Message { get; set; } - - } -} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/WorkbookProperties.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/WorkbookProperties.PowerShell.cs deleted file mode 100644 index 53b426ab3cdd..000000000000 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/WorkbookProperties.PowerShell.cs +++ /dev/null @@ -1,246 +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; - - /// Properties that contain a workbook. - [System.ComponentModel.TypeConverter(typeof(WorkbookPropertiesTypeConverter))] - public partial class WorkbookProperties - { - - /// - /// 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.IWorkbookProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new WorkbookProperties(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.IWorkbookProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new WorkbookProperties(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.IWorkbookProperties 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 WorkbookProperties(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // 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); - } - 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); - } - 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); - } - 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)); - } - 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); - } - 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)); - } - 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); - } - 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); - } - 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); - } - 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); - } - 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); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal WorkbookProperties(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // 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); - } - 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); - } - 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); - } - 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)); - } - 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); - } - 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)); - } - 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); - } - 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); - } - 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); - } - 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); - } - 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); - } - AfterDeserializePSObject(content); - } - } - /// Properties that contain a workbook. - [System.ComponentModel.TypeConverter(typeof(WorkbookPropertiesTypeConverter))] - public partial interface IWorkbookProperties - - { - - } -} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/WorkbookPropertiesUpdateParameters.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/WorkbookPropertiesUpdateParameters.PowerShell.cs deleted file mode 100644 index c6ff48d06d76..000000000000 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/WorkbookPropertiesUpdateParameters.PowerShell.cs +++ /dev/null @@ -1,208 +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; - - /// Properties that contain a workbook for PATCH operation. - [System.ComponentModel.TypeConverter(typeof(WorkbookPropertiesUpdateParametersTypeConverter))] - public partial class WorkbookPropertiesUpdateParameters - { - - /// - /// 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.IWorkbookPropertiesUpdateParameters DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new WorkbookPropertiesUpdateParameters(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.IWorkbookPropertiesUpdateParameters DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new WorkbookPropertiesUpdateParameters(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.IWorkbookPropertiesUpdateParameters 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 WorkbookPropertiesUpdateParameters(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // 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); - } - 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); - } - 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); - } - 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)); - } - 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); - } - 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); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal WorkbookPropertiesUpdateParameters(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // 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); - } - 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); - } - 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); - } - 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)); - } - 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); - } - 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); - } - AfterDeserializePSObject(content); - } - } - /// Properties that contain a workbook for PATCH operation. - [System.ComponentModel.TypeConverter(typeof(WorkbookPropertiesUpdateParametersTypeConverter))] - public partial interface IWorkbookPropertiesUpdateParameters - - { - - } -} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/WorkbookResource.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/WorkbookResource.PowerShell.cs deleted file mode 100644 index effec862d9a0..000000000000 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/WorkbookResource.PowerShell.cs +++ /dev/null @@ -1,254 +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; - - /// An azure resource object - [System.ComponentModel.TypeConverter(typeof(WorkbookResourceTypeConverter))] - public partial class WorkbookResource - { - - /// - /// 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.IWorkbookResource DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new WorkbookResource(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.IWorkbookResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new WorkbookResource(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.IWorkbookResource 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 WorkbookResource(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // 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); - } - 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("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); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal WorkbookResource(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // 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); - } - 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("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); - } - AfterDeserializePSObject(content); - } - } - /// An azure resource object - [System.ComponentModel.TypeConverter(typeof(WorkbookResourceTypeConverter))] - public partial interface IWorkbookResource - - { - - } -} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/WorkbookResource.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/WorkbookResource.cs deleted file mode 100644 index 2d3161051610..000000000000 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/WorkbookResource.cs +++ /dev/null @@ -1,236 +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 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.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(); - - /// Backing field for property. - private string _etag; - - /// Resource etag - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] - public string Etag { get => this._etag; set => this._etag = value; } - - /// - /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - /// - [Microsoft.Azure.PowerShell.Cmdlets.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; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.IManagedServiceIdentity _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; } - - /// - /// 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; } - - /// - /// 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; } - - /// - /// 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)""); } - - /// - /// 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.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 */; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.WorkbookSharedTypeKind? _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; } - - /// 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 ; } - - /// 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; } - - /// 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; } - - /// 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; } - - /// 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;} } } - - /// 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; } - - /// 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; } - - /// 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; } - - /// 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 */; } - - /// - /// 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; } - - /// Validates that this object meets the validation criteria. - /// an instance that will receive validation - /// events. - /// - /// A that will be complete when validation is completed. - /// - public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener) - { - await eventListener.AssertNotNull(nameof(__trackedResource), __trackedResource); - await eventListener.AssertObjectIsValid(nameof(__trackedResource), __trackedResource); - } - - /// Creates an new instance. - 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 - { - /// Resource etag - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Resource etag", - SerializedName = @"etag", - PossibleTypes = new [] { typeof(string) })] - string Etag { get; set; } - /// - /// 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.Runtime.Info( - Required = false, - ReadOnly = true, - 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) })] - string IdentityPrincipalId { get; } - /// - /// The tenant ID of the system assigned identity. This property will only be provided for a system assigned identity. - /// - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = true, - 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) })] - string IdentityTenantId { get; } - /// - /// Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). - /// - [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) })] - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.ManagedServiceIdentityType? 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.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) })] - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.IUserAssignedIdentities IdentityUserAssignedIdentity { get; set; } - /// The kind of workbook. Only valid value is shared. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = false, - 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; } - - } - /// An azure resource object - internal partial interface IWorkbookResourceInternal : - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api10.ITrackedResourceInternal - { - /// Resource etag - string Etag { get; set; } - /// Identity used for BYOS - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.IManagedServiceIdentity Identity { get; set; } - /// - /// The service principal ID of the system assigned identity. This property will only be provided for a system assigned identity. - /// - string IdentityPrincipalId { get; set; } - /// - /// The tenant ID of the system assigned identity. This property will only be provided for a system assigned identity. - /// - string IdentityTenantId { get; set; } - /// - /// Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). - /// - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.ManagedServiceIdentityType? 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; } - /// The kind of workbook. Only valid value is shared. - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.WorkbookSharedTypeKind? Kind { get; set; } - - } -} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/WorkbookResourceIdentity.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/WorkbookResourceIdentity.PowerShell.cs deleted file mode 100644 index da02608113eb..000000000000 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/WorkbookResourceIdentity.PowerShell.cs +++ /dev/null @@ -1,190 +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; - - /// Identity used for BYOS - [System.ComponentModel.TypeConverter(typeof(WorkbookResourceIdentityTypeConverter))] - public partial class WorkbookResourceIdentity - { - - /// - /// 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.IWorkbookResourceIdentity DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new WorkbookResourceIdentity(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.IWorkbookResourceIdentity DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new WorkbookResourceIdentity(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.IWorkbookResourceIdentity 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 WorkbookResourceIdentity(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // 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); - } - 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); - } - 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); - } - 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); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal WorkbookResourceIdentity(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // 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); - } - 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); - } - 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); - } - 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); - } - AfterDeserializePSObject(content); - } - } - /// Identity used for BYOS - [System.ComponentModel.TypeConverter(typeof(WorkbookResourceIdentityTypeConverter))] - public partial interface IWorkbookResourceIdentity - - { - - } -} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/WorkbookResourceIdentity.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/WorkbookResourceIdentity.cs deleted file mode 100644 index 40a3913e8151..000000000000 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/WorkbookResourceIdentity.cs +++ /dev/null @@ -1,89 +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 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.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(); - - /// 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; } - - /// 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; } - - /// - /// 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; } - - /// - /// 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; } - - /// - /// 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 ; } - - /// - /// 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.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 */; } - - /// Validates that this object meets the validation criteria. - /// an instance that will receive validation - /// events. - /// - /// A that will be complete when validation is completed. - /// - public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener) - { - await eventListener.AssertNotNull(nameof(__managedServiceIdentity), __managedServiceIdentity); - await eventListener.AssertObjectIsValid(nameof(__managedServiceIdentity), __managedServiceIdentity); - } - - /// Creates an new instance. - 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 - { - - } - /// Identity used for BYOS - internal partial interface IWorkbookResourceIdentityInternal : - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.IManagedServiceIdentityInternal - { - - } -} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/WorkbookUpdateParameters.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/WorkbookUpdateParameters.PowerShell.cs deleted file mode 100644 index c5fd094eec25..000000000000 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/WorkbookUpdateParameters.PowerShell.cs +++ /dev/null @@ -1,232 +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; - - /// - /// The parameters that can be provided when updating workbook properties properties. - /// - [System.ComponentModel.TypeConverter(typeof(WorkbookUpdateParametersTypeConverter))] - public partial class WorkbookUpdateParameters - { - - /// - /// 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.IWorkbookUpdateParameters DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new WorkbookUpdateParameters(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.IWorkbookUpdateParameters DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new WorkbookUpdateParameters(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.IWorkbookUpdateParameters 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 WorkbookUpdateParameters(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.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); - } - 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); - } - 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); - } - 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); - } - 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); - } - 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); - } - 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)); - } - 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); - } - 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); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal WorkbookUpdateParameters(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.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); - } - 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); - } - 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); - } - 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); - } - 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); - } - 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); - } - 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)); - } - 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); - } - 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); - } - AfterDeserializePSObject(content); - } - } - /// The parameters that can be provided when updating workbook properties properties. - [System.ComponentModel.TypeConverter(typeof(WorkbookUpdateParametersTypeConverter))] - public partial interface IWorkbookUpdateParameters - - { - - } -} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/WorkbookUpdateParameters.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/WorkbookUpdateParameters.cs deleted file mode 100644 index d10f15965b99..000000000000 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/WorkbookUpdateParameters.cs +++ /dev/null @@ -1,181 +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 static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; - - /// - /// 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 - { - - /// 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; } - - /// 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; } - - /// 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; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.WorkbookUpdateSharedTypeKind? _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; } - - /// 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;} } } - - /// 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 */; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.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; } - - /// 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; } - - /// - /// 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; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.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; } - - /// Creates an new instance. - public WorkbookUpdateParameters() - { - - } - } - /// The parameters that can be provided when updating workbook properties properties. - public partial interface IWorkbookUpdateParameters : - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IJsonSerializable - { - /// Workbook category, as defined by the user at creation time. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Workbook category, as defined by the user at creation time.", - SerializedName = @"category", - PossibleTypes = new [] { typeof(string) })] - string Category { get; set; } - /// The description of the workbook. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The description of the workbook.", - SerializedName = @"description", - PossibleTypes = new [] { typeof(string) })] - string Description { get; set; } - /// The user-defined name (display name) of the workbook. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The user-defined name (display name) of the workbook.", - SerializedName = @"displayName", - PossibleTypes = new [] { typeof(string) })] - string DisplayName { get; set; } - /// The kind of workbook. Only valid value is shared. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = false, - 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; } - /// 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, - 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; } - /// The unique revision id for this workbook definition - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The unique revision id for this workbook definition", - SerializedName = @"revision", - PossibleTypes = new [] { typeof(string) })] - string Revision { get; set; } - /// - /// Configuration of this particular workbook. Configuration data is a string containing valid JSON - /// - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Configuration of this particular workbook. Configuration data is a string containing valid JSON", - SerializedName = @"serializedData", - PossibleTypes = new [] { typeof(string) })] - string SerializedData { get; set; } - /// Resource tags. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Resource tags.", - SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookUpdateParametersTags) })] - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookUpdateParametersTags Tag { get; set; } - - } - /// The parameters that can be provided when updating workbook properties properties. - internal partial interface IWorkbookUpdateParametersInternal - - { - /// Workbook category, as defined by the user at creation time. - string Category { get; set; } - /// The description of the workbook. - string Description { get; set; } - /// 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; } - /// A list of 0 or more tags that are associated with this workbook definition - string[] PropertiesTag { get; set; } - /// Metadata describing a workbook for an Azure resource. - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookPropertiesUpdateParameters Property { get; set; } - /// The unique revision id for this workbook definition - string Revision { get; set; } - /// - /// Configuration of this particular workbook. Configuration data is a string containing valid JSON - /// - string SerializedData { get; set; } - /// Resource tags. - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbookUpdateParametersTags Tag { get; set; } - - } -} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/WorkbooksListResult.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/WorkbooksListResult.cs deleted file mode 100644 index 942b08f1275a..000000000000 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220401/WorkbooksListResult.cs +++ /dev/null @@ -1,70 +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 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 - { - - /// 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;} } } - - /// Backing field for property. - private string _nextLink; - - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] - public string NextLink { get => this._nextLink; set => this._nextLink = value; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbook[] _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; } - - /// Creates an new instance. - public WorkbooksListResult() - { - - } - } - /// Workbook list result. - public partial interface IWorkbooksListResult : - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IJsonSerializable - { - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"", - SerializedName = @"nextLink", - PossibleTypes = new [] { typeof(string) })] - string NextLink { get; set; } - /// An array of workbooks. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = true, - 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; } - - } - /// Workbook list result. - internal partial interface IWorkbooksListResultInternal - - { - string NextLink { get; set; } - /// An array of workbooks. - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220401.IWorkbook[] Value { get; set; } - - } -} \ 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/WebTest.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220615/WebTest.cs deleted file mode 100644 index ca6e25cdc027..000000000000 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220615/WebTest.cs +++ /dev/null @@ -1,545 +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 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.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(); - - /// 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; } - - /// 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; } - - /// 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); } - - /// - /// 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)] - [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); } - - /// 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; } - - /// 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); } - - /// 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); } - - /// 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; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.WebTestKind? _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; } - - /// 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 ; } - - /// 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; } - - /// 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;} } } - - /// 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; } - - /// 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; } - - /// 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; } - - /// 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; } - - /// 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; } - - /// 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; } - - /// 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; } - - /// 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 */; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.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; } - - /// - /// 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)] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] - public string ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.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; } - - /// 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); } - - /// 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 */; } - - /// 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; } - - /// 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); } - - /// 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; } - - /// Gets the resource group name - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] - public string ResourceGroupName { get => (new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Success ? new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Groups["resourceGroupName"].Value : null); } - - /// Allow for retries should this WebTest fail. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] - [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); } - - /// 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; } - - /// 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 */; } - - /// 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); } - - /// 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; } - - /// 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); } - - /// 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); } - - /// - /// 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)] - [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); } - - /// 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); } - - /// 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)""); } - - /// 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; } - - /// Validates that this object meets the validation criteria. - /// an instance that will receive validation - /// events. - /// - /// A that will be complete when validation is completed. - /// - public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener) - { - await eventListener.AssertNotNull(nameof(__webtestsResource), __webtestsResource); - await eventListener.AssertObjectIsValid(nameof(__webtestsResource), __webtestsResource); - } - - /// Creates an new instance. - 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 - { - /// The XML specification of a WebTest to run against an application. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The XML specification of a WebTest to run against an application.", - SerializedName = @"WebTest", - PossibleTypes = new [] { typeof(string) })] - string ConfigurationWebTest { get; set; } - /// Content to look for in the return of the WebTest. Must not be null or empty. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Content to look for in the return of the WebTest. Must not be null or empty.", - SerializedName = @"ContentMatch", - PossibleTypes = new [] { typeof(string) })] - string ContentValidationContentMatch { get; set; } - /// When set, this value makes the ContentMatch validation case insensitive. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"When set, this value makes the ContentMatch validation case insensitive.", - SerializedName = @"IgnoreCase", - PossibleTypes = new [] { typeof(bool) })] - bool? ContentValidationIgnoreCase { get; set; } - /// - /// 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.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"When true, validation will pass if there is a match for the ContentMatch string. If false, validation will fail if there is a match", - SerializedName = @"PassIfTextFound", - PossibleTypes = new [] { typeof(bool) })] - bool? ContentValidationPassIfTextFound { get; set; } - /// User defined description for this WebTest. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"User defined description for this WebTest.", - SerializedName = @"Description", - PossibleTypes = new [] { typeof(string) })] - string Description { get; set; } - /// Is the test actively being monitored. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Is the test actively being monitored.", - SerializedName = @"Enabled", - PossibleTypes = new [] { typeof(bool) })] - bool? Enabled { get; set; } - /// Interval in seconds between test runs for this WebTest. Default value is 300. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Interval in seconds between test runs for this WebTest. Default value is 300.", - SerializedName = @"Frequency", - PossibleTypes = new [] { typeof(int) })] - int? Frequency { get; set; } - /// - /// The kind of WebTest that this web test watches. Choices are ping, multistep and standard. - /// - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - 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) })] - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.WebTestKind? 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, - 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; } - /// - /// Current state of this component, whether or not is has been provisioned within the resource group it is defined. Users - /// cannot change this value but are able to read from it. Values will include Succeeded, Deploying, Canceled, and Failed. - /// - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"Current state of this component, whether or not is has been provisioned within the resource group it is defined. Users cannot change this value but are able to read from it. Values will include Succeeded, Deploying, Canceled, and Failed.", - SerializedName = @"provisioningState", - PossibleTypes = new [] { typeof(string) })] - string ProvisioningState { get; } - /// Base64 encoded string body to send with this web test. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Base64 encoded string body to send with this web test.", - SerializedName = @"RequestBody", - PossibleTypes = new [] { typeof(string) })] - string RequestBody { get; set; } - /// Follow redirects for this web test. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Follow redirects for this web test.", - SerializedName = @"FollowRedirects", - PossibleTypes = new [] { typeof(bool) })] - bool? RequestFollowRedirect { get; set; } - /// List of headers and their values to add to the WebTest call. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"List of headers and their values to add to the WebTest call.", - SerializedName = @"Headers", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IHeaderField) })] - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IHeaderField[] RequestHeader { get; set; } - /// Http verb to use for this web test. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Http verb to use for this web test.", - SerializedName = @"HttpVerb", - PossibleTypes = new [] { typeof(string) })] - string RequestHttpVerb { get; set; } - /// Parse Dependent request for this WebTest. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Parse Dependent request for this WebTest.", - SerializedName = @"ParseDependentRequests", - PossibleTypes = new [] { typeof(bool) })] - bool? RequestParseDependentRequest { get; set; } - /// Url location to test. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Url location to test.", - SerializedName = @"RequestUrl", - PossibleTypes = new [] { typeof(string) })] - string RequestUrl { get; set; } - /// Allow for retries should this WebTest fail. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Allow for retries should this WebTest fail.", - SerializedName = @"RetryEnabled", - PossibleTypes = new [] { typeof(bool) })] - bool? RetryEnabled { get; set; } - /// Unique ID of this WebTest. This is typically the same value as the Name field. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Unique ID of this WebTest. This is typically the same value as the Name field.", - SerializedName = @"SyntheticMonitorId", - PossibleTypes = new [] { typeof(string) })] - string SyntheticMonitorId { get; set; } - /// Seconds until this WebTest will timeout and fail. Default value is 30. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Seconds until this WebTest will timeout and fail. Default value is 30.", - SerializedName = @"Timeout", - PossibleTypes = new [] { typeof(int) })] - int? Timeout { get; set; } - /// Validate that the WebTest returns the http status code provided. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Validate that the WebTest returns the http status code provided.", - SerializedName = @"ExpectedHttpStatusCode", - PossibleTypes = new [] { typeof(int) })] - int? ValidationRuleExpectedHttpStatusCode { get; set; } - /// When set, validation will ignore the status code. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"When set, validation will ignore the status code.", - SerializedName = @"IgnoreHttpsStatusCode", - PossibleTypes = new [] { typeof(bool) })] - bool? ValidationRuleIgnoreHttpsStatusCode { get; set; } - /// - /// 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.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"A number of days to check still remain before the the existing SSL cert expires. Value must be positive and the SSLCheck must be set to true.", - SerializedName = @"SSLCertRemainingLifetimeCheck", - PossibleTypes = new [] { typeof(int) })] - int? ValidationRuleSslCertRemainingLifetimeCheck { get; set; } - /// Checks to see if the SSL cert is still valid. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Checks to see if the SSL cert is still valid.", - SerializedName = @"SSLCheck", - PossibleTypes = new [] { typeof(bool) })] - bool? ValidationRuleSslCheck { get; set; } - /// The kind of web test this is, valid choices are ping, multistep, and standard. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The kind of web test this is, valid choices are ping, multistep, and standard.", - SerializedName = @"Kind", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.WebTestKindEnum) })] - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.WebTestKindEnum? WebTestKind { get; set; } - /// User defined name if this WebTest. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"User defined name if this WebTest.", - SerializedName = @"Name", - PossibleTypes = new [] { typeof(string) })] - string WebTestName { get; set; } - - } - /// An Application Insights WebTest definition. - internal partial interface IWebTestInternal : - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebtestsResourceInternal - { - /// An XML configuration specification for a WebTest. - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.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. - string ContentValidationContentMatch { get; set; } - /// When set, this value makes the ContentMatch validation case insensitive. - bool? ContentValidationIgnoreCase { get; set; } - /// - /// When true, validation will pass if there is a match for the ContentMatch string. If false, validation will fail if there - /// is a match - /// - bool? ContentValidationPassIfTextFound { get; set; } - /// User defined description for this WebTest. - string Description { get; set; } - /// Is the test actively being monitored. - bool? Enabled { get; set; } - /// Interval in seconds between test runs for this WebTest. Default value is 300. - int? Frequency { get; set; } - /// - /// 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; } - /// - /// 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; } - /// Metadata describing a web test for an Azure resource. - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.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; } - /// 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; } - /// Http verb to use for this web test. - string RequestHttpVerb { get; set; } - /// Parse Dependent request for this WebTest. - bool? RequestParseDependentRequest { get; set; } - /// Url location to test. - string RequestUrl { get; set; } - /// Allow for retries should this WebTest fail. - bool? RetryEnabled { get; set; } - /// Unique ID of this WebTest. This is typically the same value as the Name field. - string SyntheticMonitorId { get; set; } - /// 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; } - /// The collection of content validation properties - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.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. - bool? ValidationRuleIgnoreHttpsStatusCode { get; set; } - /// - /// 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. - /// - int? ValidationRuleSslCertRemainingLifetimeCheck { get; set; } - /// 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; } - /// User defined name if this WebTest. - string WebTestName { get; set; } - - } -} \ 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/Api20220615/WebTestProperties.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220615/WebTestProperties.cs deleted file mode 100644 index a90e9834c5db..000000000000 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220615/WebTestProperties.cs +++ /dev/null @@ -1,477 +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 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 - { - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.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; } - - /// 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; } - - /// 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; } - - /// 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); } - - /// - /// 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); } - - /// Backing field for property. - private string _description; - - /// User defined description for this WebTest. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] - public string Description { get => this._description; set => this._description = value; } - - /// Backing field for property. - private bool? _enabled; - - /// Is the test actively being monitored. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] - public bool? Enabled { get => this._enabled; set => this._enabled = value; } - - /// Backing field for property. - private int? _frequency; - - /// 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.Owned)] - public int? Frequency { get => this._frequency; set => this._frequency = value; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestGeolocation[] _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; } - - /// 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;} } } - - /// Internal Acessors for ProvisioningState - string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.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;} } } - - /// 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;} } } - - /// 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; } - - /// Backing field for property. - private string _provisioningState; - - /// - /// Current state of this component, whether or not is has been provisioned within the resource group it is defined. Users - /// cannot change this value but are able to read from it. Values will include Succeeded, Deploying, Canceled, and Failed. - /// - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] - public string ProvisioningState { get => this._provisioningState; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.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; } - - /// 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; } - - /// 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); } - - /// 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 */; } - - /// 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; } - - /// 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); } - - /// 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; } - - /// Backing field for property. - private bool? _retryEnabled; - - /// Allow for retries should this WebTest fail. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] - public bool? RetryEnabled { get => this._retryEnabled; set => this._retryEnabled = value; } - - /// Backing field for property. - private string _syntheticMonitorId; - - /// 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.Owned)] - public string SyntheticMonitorId { get => this._syntheticMonitorId; set => this._syntheticMonitorId = value; } - - /// Backing field for property. - private int? _timeout; - - /// Seconds until this WebTest will timeout and fail. Default value is 30. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] - public int? Timeout { get => this._timeout; set => this._timeout = value; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.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; } - - /// 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); } - - /// 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); } - - /// - /// 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); } - - /// 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); } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.WebTestKindEnum _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; } - - /// Backing field for property. - private string _webTestName; - - /// User defined name if this WebTest. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] - public string WebTestName { get => this._webTestName; set => this._webTestName = value; } - - /// Creates an new instance. - public WebTestProperties() - { - - } - } - /// Metadata describing a web test for an Azure resource. - public partial interface IWebTestProperties : - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IJsonSerializable - { - /// The XML specification of a WebTest to run against an application. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The XML specification of a WebTest to run against an application.", - SerializedName = @"WebTest", - PossibleTypes = new [] { typeof(string) })] - string ConfigurationWebTest { get; set; } - /// Content to look for in the return of the WebTest. Must not be null or empty. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Content to look for in the return of the WebTest. Must not be null or empty.", - SerializedName = @"ContentMatch", - PossibleTypes = new [] { typeof(string) })] - string ContentValidationContentMatch { get; set; } - /// When set, this value makes the ContentMatch validation case insensitive. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"When set, this value makes the ContentMatch validation case insensitive.", - SerializedName = @"IgnoreCase", - PossibleTypes = new [] { typeof(bool) })] - bool? ContentValidationIgnoreCase { get; set; } - /// - /// 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.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"When true, validation will pass if there is a match for the ContentMatch string. If false, validation will fail if there is a match", - SerializedName = @"PassIfTextFound", - PossibleTypes = new [] { typeof(bool) })] - bool? ContentValidationPassIfTextFound { get; set; } - /// User defined description for this WebTest. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"User defined description for this WebTest.", - SerializedName = @"Description", - PossibleTypes = new [] { typeof(string) })] - string Description { get; set; } - /// Is the test actively being monitored. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Is the test actively being monitored.", - SerializedName = @"Enabled", - PossibleTypes = new [] { typeof(bool) })] - bool? Enabled { get; set; } - /// Interval in seconds between test runs for this WebTest. Default value is 300. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Interval in seconds between test runs for this WebTest. Default value is 300.", - SerializedName = @"Frequency", - PossibleTypes = new [] { typeof(int) })] - int? Frequency { 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 = true, - 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) })] - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IWebTestGeolocation[] 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. - /// - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"Current state of this component, whether or not is has been provisioned within the resource group it is defined. Users cannot change this value but are able to read from it. Values will include Succeeded, Deploying, Canceled, and Failed.", - SerializedName = @"provisioningState", - PossibleTypes = new [] { typeof(string) })] - string ProvisioningState { get; } - /// Base64 encoded string body to send with this web test. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Base64 encoded string body to send with this web test.", - SerializedName = @"RequestBody", - PossibleTypes = new [] { typeof(string) })] - string RequestBody { get; set; } - /// Follow redirects for this web test. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Follow redirects for this web test.", - SerializedName = @"FollowRedirects", - PossibleTypes = new [] { typeof(bool) })] - bool? RequestFollowRedirect { get; set; } - /// List of headers and their values to add to the WebTest call. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"List of headers and their values to add to the WebTest call.", - SerializedName = @"Headers", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IHeaderField) })] - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.IHeaderField[] RequestHeader { get; set; } - /// Http verb to use for this web test. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Http verb to use for this web test.", - SerializedName = @"HttpVerb", - PossibleTypes = new [] { typeof(string) })] - string RequestHttpVerb { get; set; } - /// Parse Dependent request for this WebTest. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Parse Dependent request for this WebTest.", - SerializedName = @"ParseDependentRequests", - PossibleTypes = new [] { typeof(bool) })] - bool? RequestParseDependentRequest { get; set; } - /// Url location to test. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Url location to test.", - SerializedName = @"RequestUrl", - PossibleTypes = new [] { typeof(string) })] - string RequestUrl { get; set; } - /// Allow for retries should this WebTest fail. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Allow for retries should this WebTest fail.", - SerializedName = @"RetryEnabled", - PossibleTypes = new [] { typeof(bool) })] - bool? RetryEnabled { get; set; } - /// Unique ID of this WebTest. This is typically the same value as the Name field. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"Unique ID of this WebTest. This is typically the same value as the Name field.", - SerializedName = @"SyntheticMonitorId", - PossibleTypes = new [] { typeof(string) })] - string SyntheticMonitorId { get; set; } - /// Seconds until this WebTest will timeout and fail. Default value is 30. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Seconds until this WebTest will timeout and fail. Default value is 30.", - SerializedName = @"Timeout", - PossibleTypes = new [] { typeof(int) })] - int? Timeout { get; set; } - /// Validate that the WebTest returns the http status code provided. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Validate that the WebTest returns the http status code provided.", - SerializedName = @"ExpectedHttpStatusCode", - PossibleTypes = new [] { typeof(int) })] - int? ValidationRuleExpectedHttpStatusCode { get; set; } - /// When set, validation will ignore the status code. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"When set, validation will ignore the status code.", - SerializedName = @"IgnoreHttpsStatusCode", - PossibleTypes = new [] { typeof(bool) })] - bool? ValidationRuleIgnoreHttpsStatusCode { get; set; } - /// - /// 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.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"A number of days to check still remain before the the existing SSL cert expires. Value must be positive and the SSLCheck must be set to true.", - SerializedName = @"SSLCertRemainingLifetimeCheck", - PossibleTypes = new [] { typeof(int) })] - int? ValidationRuleSslCertRemainingLifetimeCheck { get; set; } - /// Checks to see if the SSL cert is still valid. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Checks to see if the SSL cert is still valid.", - SerializedName = @"SSLCheck", - PossibleTypes = new [] { typeof(bool) })] - bool? ValidationRuleSslCheck { get; set; } - /// The kind of web test this is, valid choices are ping, multistep, and standard. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = true, - 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) })] - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.WebTestKindEnum WebTestKind { get; set; } - /// User defined name if this WebTest. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"User defined name if this WebTest.", - SerializedName = @"Name", - PossibleTypes = new [] { typeof(string) })] - string WebTestName { get; set; } - - } - /// Metadata describing a web test for an Azure resource. - internal partial interface IWebTestPropertiesInternal - - { - /// An XML configuration specification for a WebTest. - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.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. - string ContentValidationContentMatch { get; set; } - /// When set, this value makes the ContentMatch validation case insensitive. - bool? ContentValidationIgnoreCase { get; set; } - /// - /// When true, validation will pass if there is a match for the ContentMatch string. If false, validation will fail if there - /// is a match - /// - bool? ContentValidationPassIfTextFound { get; set; } - /// User defined description for this WebTest. - string Description { get; set; } - /// Is the test actively being monitored. - bool? Enabled { get; set; } - /// Interval in seconds between test runs for this WebTest. Default value is 300. - int? Frequency { 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[] 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; } - /// 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; } - /// Http verb to use for this web test. - string RequestHttpVerb { get; set; } - /// Parse Dependent request for this WebTest. - bool? RequestParseDependentRequest { get; set; } - /// Url location to test. - string RequestUrl { get; set; } - /// Allow for retries should this WebTest fail. - bool? RetryEnabled { get; set; } - /// Unique ID of this WebTest. This is typically the same value as the Name field. - string SyntheticMonitorId { get; set; } - /// 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; } - /// The collection of content validation properties - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api20220615.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. - bool? ValidationRuleIgnoreHttpsStatusCode { get; set; } - /// - /// 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. - /// - int? ValidationRuleSslCertRemainingLifetimeCheck { get; set; } - /// 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; } - /// User defined name if this WebTest. - string WebTestName { get; set; } - - } -} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220615/WebTestPropertiesRequest.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220615/WebTestPropertiesRequest.PowerShell.cs deleted file mode 100644 index 9164f813b102..000000000000 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220615/WebTestPropertiesRequest.PowerShell.cs +++ /dev/null @@ -1,206 +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; - - /// The collection of request properties - [System.ComponentModel.TypeConverter(typeof(WebTestPropertiesRequestTypeConverter))] - public partial class WebTestPropertiesRequest - { - - /// - /// 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.IWebTestPropertiesRequest DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new WebTestPropertiesRequest(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.IWebTestPropertiesRequest DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new WebTestPropertiesRequest(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.IWebTestPropertiesRequest 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 WebTestPropertiesRequest(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // 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); - } - 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)); - } - 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); - } - 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); - } - 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))); - } - 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))); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal WebTestPropertiesRequest(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // 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); - } - 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)); - } - 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); - } - 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); - } - 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))); - } - 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))); - } - AfterDeserializePSObject(content); - } - } - /// The collection of request properties - [System.ComponentModel.TypeConverter(typeof(WebTestPropertiesRequestTypeConverter))] - public partial interface IWebTestPropertiesRequest - - { - - } -} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220615/WebTestPropertiesValidationRules.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220615/WebTestPropertiesValidationRules.PowerShell.cs deleted file mode 100644 index 55edc55e24bc..000000000000 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220615/WebTestPropertiesValidationRules.PowerShell.cs +++ /dev/null @@ -1,222 +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; - - /// The collection of validation rule properties - [System.ComponentModel.TypeConverter(typeof(WebTestPropertiesValidationRulesTypeConverter))] - public partial class WebTestPropertiesValidationRules - { - - /// - /// 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.IWebTestPropertiesValidationRules DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new WebTestPropertiesValidationRules(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.IWebTestPropertiesValidationRules DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new WebTestPropertiesValidationRules(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.IWebTestPropertiesValidationRules 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 WebTestPropertiesValidationRules(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // 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); - } - 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))); - } - 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))); - } - 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))); - } - 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))); - } - 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); - } - 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))); - } - 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))); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal WebTestPropertiesValidationRules(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // 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); - } - 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))); - } - 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))); - } - 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))); - } - 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))); - } - 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); - } - 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))); - } - 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))); - } - AfterDeserializePSObject(content); - } - } - /// The collection of validation rule properties - [System.ComponentModel.TypeConverter(typeof(WebTestPropertiesValidationRulesTypeConverter))] - public partial interface IWebTestPropertiesValidationRules - - { - - } -} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220615/WebTestPropertiesValidationRulesContentValidation.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220615/WebTestPropertiesValidationRulesContentValidation.PowerShell.cs deleted file mode 100644 index 43c24070eb9b..000000000000 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220615/WebTestPropertiesValidationRulesContentValidation.PowerShell.cs +++ /dev/null @@ -1,185 +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; - - /// The collection of content validation properties - [System.ComponentModel.TypeConverter(typeof(WebTestPropertiesValidationRulesContentValidationTypeConverter))] - public partial class WebTestPropertiesValidationRulesContentValidation - { - - /// - /// 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.IWebTestPropertiesValidationRulesContentValidation DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new WebTestPropertiesValidationRulesContentValidation(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.IWebTestPropertiesValidationRulesContentValidation DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new WebTestPropertiesValidationRulesContentValidation(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.IWebTestPropertiesValidationRulesContentValidation 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 WebTestPropertiesValidationRulesContentValidation(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // 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); - } - 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))); - } - 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))); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal WebTestPropertiesValidationRulesContentValidation(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // 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); - } - 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))); - } - 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))); - } - AfterDeserializePSObject(content); - } - } - /// The collection of content validation properties - [System.ComponentModel.TypeConverter(typeof(WebTestPropertiesValidationRulesContentValidationTypeConverter))] - public partial interface IWebTestPropertiesValidationRulesContentValidation - - { - - } -} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220615/WebtestsResource.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220615/WebtestsResource.PowerShell.cs deleted file mode 100644 index 3d49a234240a..000000000000 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api20220615/WebtestsResource.PowerShell.cs +++ /dev/null @@ -1,198 +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 azure resource object - [System.ComponentModel.TypeConverter(typeof(WebtestsResourceTypeConverter))] - public partial class WebtestsResource - { - - /// - /// 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.IWebtestsResource DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new WebtestsResource(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.IWebtestsResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new WebtestsResource(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.IWebtestsResource 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 WebtestsResource(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal WebtestsResource(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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); - } - AfterDeserializePSObject(content); - } - } - /// An azure resource object - [System.ComponentModel.TypeConverter(typeof(WebtestsResourceTypeConverter))] - public partial interface IWebtestsResource - - { - - } -} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api30/ManagedServiceIdentity.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api30/ManagedServiceIdentity.PowerShell.cs deleted file mode 100644 index ab595a92187c..000000000000 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api30/ManagedServiceIdentity.PowerShell.cs +++ /dev/null @@ -1,190 +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.Api30 -{ - using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; - - /// Managed service identity (system assigned and/or user assigned identities) - [System.ComponentModel.TypeConverter(typeof(ManagedServiceIdentityTypeConverter))] - public partial class ManagedServiceIdentity - { - - /// - /// 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.Api30.IManagedServiceIdentity DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new ManagedServiceIdentity(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.Api30.IManagedServiceIdentity DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new ManagedServiceIdentity(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.Api30.IManagedServiceIdentity 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 ManagedServiceIdentity(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // 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); - } - 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); - } - 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); - } - 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); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal ManagedServiceIdentity(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // 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); - } - 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); - } - 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); - } - 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); - } - 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(); - } - } - /// Managed service identity (system assigned and/or user assigned identities) - [System.ComponentModel.TypeConverter(typeof(ManagedServiceIdentityTypeConverter))] - public partial interface IManagedServiceIdentity - - { - - } -} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api30/ManagedServiceIdentity.TypeConverter.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api30/ManagedServiceIdentity.TypeConverter.cs deleted file mode 100644 index 56ca380ac0a7..000000000000 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api30/ManagedServiceIdentity.TypeConverter.cs +++ /dev/null @@ -1,147 +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.Api30 -{ - using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; - - /// - /// A PowerShell PSTypeConverter to support converting to an instance of - /// - public partial class ManagedServiceIdentityTypeConverter : global::System.Management.Automation.PSTypeConverter - { - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false. - /// - public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); - - /// - /// Determines if the converter can convert the parameter to the - /// type. - /// - /// the instance to check if it can be converted to the type. - /// - /// true if the instance could be converted to a type, otherwise false - /// - public static bool CanConvertFrom(dynamic sourceValue) - { - if (null == sourceValue) - { - return true; - } - global::System.Type type = sourceValue.GetType(); - if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) - { - // we say yest to PSObjects - return true; - } - if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) - { - // we say yest to Hashtables/dictionaries - return true; - } - try - { - if (null != sourceValue.ToJsonString()) - { - return true; - } - } - catch - { - // Not one of our objects - } - try - { - string text = sourceValue.ToString()?.Trim(); - return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonType.Object; - } - catch - { - // Doesn't look like it can be treated as JSON - } - return false; - } - - /// - /// Determines if the parameter can be converted to the - /// parameter - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false - /// - public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; - - /// - /// Converts the parameter to the parameter using and - /// - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// - /// an instance of , or null if there is no suitable conversion. - /// - public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); - - /// - /// Converts the parameter into an instance of - /// - /// the value to convert into an instance of . - /// - /// an instance of , or null if there is no suitable conversion. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.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)) - { - return sourceValue; - } - try - { - return ManagedServiceIdentity.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; - } - catch - { - // Unable to use JSON pattern - } - if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) - { - return ManagedServiceIdentity.DeserializeFromPSObject(sourceValue); - } - if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) - { - return ManagedServiceIdentity.DeserializeFromDictionary(sourceValue); - } - return null; - } - - /// NotImplemented -- this will return null - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// will always return null. - public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; - } -} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api30/ManagedServiceIdentity.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api30/ManagedServiceIdentity.cs deleted file mode 100644 index 3158330cbe3c..000000000000 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api30/ManagedServiceIdentity.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.ApplicationInsights.Models.Api30 -{ - 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 - { - - /// Internal Acessors for PrincipalId - string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.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;} } } - - /// Backing field for property. - private string _principalId; - - /// - /// 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.Owned)] - public string PrincipalId { get => this._principalId; } - - /// Backing field for property. - private string _tenantId; - - /// - /// 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.Owned)] - public string TenantId { get => this._tenantId; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.ManagedServiceIdentityType _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; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.IUserAssignedIdentities _userAssignedIdentity; - - /// - /// 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.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; } - - /// Creates an new instance. - public ManagedServiceIdentity() - { - - } - } - /// Managed service identity (system assigned and/or user assigned identities) - public partial interface IManagedServiceIdentity : - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IJsonSerializable - { - /// - /// 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.Runtime.Info( - Required = false, - ReadOnly = true, - 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) })] - string PrincipalId { get; } - /// - /// The tenant ID of the system assigned identity. This property will only be provided for a system assigned identity. - /// - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = true, - 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) })] - string TenantId { get; } - /// - /// Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). - /// - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = true, - 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) })] - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.ManagedServiceIdentityType 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.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) })] - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.IUserAssignedIdentities UserAssignedIdentity { get; set; } - - } - /// Managed service identity (system assigned and/or user assigned identities) - internal partial interface IManagedServiceIdentityInternal - - { - /// - /// The service principal ID of the system assigned identity. This property will only be provided for a system assigned identity. - /// - string PrincipalId { get; set; } - /// - /// The tenant ID of the system assigned identity. This property will only be provided for a system assigned identity. - /// - string TenantId { get; set; } - /// - /// Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). - /// - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Support.ManagedServiceIdentityType 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; } - - } -} \ 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/Api30/ManagedServiceIdentity.json.cs deleted file mode 100644 index 5a036f9cdeae..000000000000 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api30/ManagedServiceIdentity.json.cs +++ /dev/null @@ -1,120 +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.Api30 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; - - /// Managed service identity (system assigned and/or user assigned identities) - public partial class ManagedServiceIdentity - { - - /// - /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object - /// before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The JsonNode that should be deserialized into this object. - - partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json); - - /// - /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The JSON container that the serialization result will be placed in. - - partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container); - - /// - /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of - /// the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the - /// output parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The JsonNode that should be deserialized into this object. - /// Determines if the rest of the deserialization should be processed, or if the method should return - /// instantly. - - partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json, ref bool returnNow); - - /// - /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the - /// object before it is serialized. - /// If you wish to disable the default serialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The JSON container that the serialization result will be placed in. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container, ref bool returnNow); - - /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.IManagedServiceIdentity. - /// - /// a to deserialize from. - /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.IManagedServiceIdentity. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.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; - } - - /// - /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject into a new instance of . - /// - /// A Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject instance to deserialize from. - internal ManagedServiceIdentity(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json) - { - bool returnNow = false; - BeforeFromJson(json, ref returnNow); - if (returnNow) - { - return; - } - {_principalId = If( json?.PropertyT("principalId"), out var __jsonPrincipalId) ? (string)__jsonPrincipalId : (string)PrincipalId;} - {_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;} - AfterFromJson(json); - } - - /// - /// Serializes this instance of into a . - /// - /// The container to serialize this object into. If the caller - /// passes in null, a new instance will be created and returned to the caller. - /// Allows the caller to choose the depth of the serialization. See . - /// - /// a serialized instance of as a . - /// - public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode serializationMode) - { - container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject(); - - bool returnNow = false; - BeforeToJson(ref container, ref returnNow); - if (returnNow) - { - return container; - } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeReadOnly)) - { - AddIf( null != (((object)this._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)) - { - 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._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 != this._userAssignedIdentity ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) this._userAssignedIdentity.ToJson(null,serializationMode) : null, "userAssignedIdentities" ,container.Add ); - AfterToJson(ref container); - return container; - } - } -} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api30/UserAssignedIdentities.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api30/UserAssignedIdentities.PowerShell.cs deleted file mode 100644 index ee2f886e8a18..000000000000 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api30/UserAssignedIdentities.PowerShell.cs +++ /dev/null @@ -1,168 +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.Api30 -{ - using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; - - /// - /// 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. - /// - [System.ComponentModel.TypeConverter(typeof(UserAssignedIdentitiesTypeConverter))] - public partial class UserAssignedIdentities - { - - /// - /// 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.Api30.IUserAssignedIdentities DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new UserAssignedIdentities(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.Api30.IUserAssignedIdentities DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new UserAssignedIdentities(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.Api30.IUserAssignedIdentities 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 UserAssignedIdentities(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - // this type is a dictionary; copy elements from source to here. - CopyFrom(content); - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal UserAssignedIdentities(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - // this type is a dictionary; copy elements from source to here. - CopyFrom(content); - AfterDeserializePSObject(content); - } - } - /// 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. - [System.ComponentModel.TypeConverter(typeof(UserAssignedIdentitiesTypeConverter))] - public partial interface IUserAssignedIdentities - - { - - } -} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api30/UserAssignedIdentities.TypeConverter.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api30/UserAssignedIdentities.TypeConverter.cs deleted file mode 100644 index 3df7dcc053d9..000000000000 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api30/UserAssignedIdentities.TypeConverter.cs +++ /dev/null @@ -1,147 +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.Api30 -{ - using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; - - /// - /// A PowerShell PSTypeConverter to support converting to an instance of - /// - public partial class UserAssignedIdentitiesTypeConverter : global::System.Management.Automation.PSTypeConverter - { - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false. - /// - public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); - - /// - /// Determines if the converter can convert the parameter to the - /// type. - /// - /// the instance to check if it can be converted to the type. - /// - /// true if the instance could be converted to a type, otherwise false - /// - public static bool CanConvertFrom(dynamic sourceValue) - { - if (null == sourceValue) - { - return true; - } - global::System.Type type = sourceValue.GetType(); - if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) - { - // we say yest to PSObjects - return true; - } - if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) - { - // we say yest to Hashtables/dictionaries - return true; - } - try - { - if (null != sourceValue.ToJsonString()) - { - return true; - } - } - catch - { - // Not one of our objects - } - try - { - string text = sourceValue.ToString()?.Trim(); - return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonType.Object; - } - catch - { - // Doesn't look like it can be treated as JSON - } - return false; - } - - /// - /// Determines if the parameter can be converted to the - /// parameter - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false - /// - public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; - - /// - /// Converts the parameter to the parameter using and - /// - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// - /// an instance of , or null if there is no suitable conversion. - /// - public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); - - /// - /// Converts the parameter into an instance of - /// - /// the value to convert into an instance of . - /// - /// an instance of , or null if there is no suitable conversion. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.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)) - { - return sourceValue; - } - try - { - return UserAssignedIdentities.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; - } - catch - { - // Unable to use JSON pattern - } - if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) - { - return UserAssignedIdentities.DeserializeFromPSObject(sourceValue); - } - if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) - { - return UserAssignedIdentities.DeserializeFromDictionary(sourceValue); - } - return null; - } - - /// NotImplemented -- this will return null - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// will always return null. - public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; - } -} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api30/UserAssignedIdentities.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api30/UserAssignedIdentities.cs deleted file mode 100644 index 9798e0ac3e33..000000000000 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api30/UserAssignedIdentities.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.Models.Api30 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; - - /// - /// 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. - /// - public partial class UserAssignedIdentities : - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.IUserAssignedIdentities, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.IUserAssignedIdentitiesInternal - { - - /// Creates an new instance. - public UserAssignedIdentities() - { - - } - } - /// 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. - public partial interface IUserAssignedIdentities : - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IAssociativeArray - { - - } - /// 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. - internal partial interface IUserAssignedIdentitiesInternal - - { - - } -} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api30/UserAssignedIdentities.dictionary.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api30/UserAssignedIdentities.dictionary.cs deleted file mode 100644 index b00a8efcd75d..000000000000 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api30/UserAssignedIdentities.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.Api30 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; - - public partial class UserAssignedIdentities : - 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.Api30.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 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.Api30.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; - } -} \ 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/Api30/UserAssignedIdentities.json.cs deleted file mode 100644 index cd360bbbbf19..000000000000 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api30/UserAssignedIdentities.json.cs +++ /dev/null @@ -1,113 +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.Api30 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; - - /// - /// 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. - /// - public partial class UserAssignedIdentities - { - - /// - /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object - /// before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The JsonNode that should be deserialized into this object. - - partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json); - - /// - /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The JSON container that the serialization result will be placed in. - - partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container); - - /// - /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of - /// the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the - /// output parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The JsonNode that should be deserialized into this object. - /// Determines if the rest of the deserialization should be processed, or if the method should return - /// instantly. - - partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json, ref bool returnNow); - - /// - /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the - /// object before it is serialized. - /// If you wish to disable the default serialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The JSON container that the serialization result will be placed in. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container, ref bool returnNow); - - /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.IUserAssignedIdentities. - /// - /// a to deserialize from. - /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.IUserAssignedIdentities. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.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; - } - - /// - /// Serializes this instance of into a . - /// - /// The container to serialize this object into. If the caller - /// passes in null, a new instance will be created and returned to the caller. - /// Allows the caller to choose the depth of the serialization. See . - /// - /// a serialized instance of as a . - /// - public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode serializationMode) - { - container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject(); - - bool returnNow = false; - BeforeToJson(ref container, ref returnNow); - if (returnNow) - { - return container; - } - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IAssociativeArray)this).AdditionalProperties, container); - AfterToJson(ref container); - return container; - } - - /// - /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject into a new instance of . - /// - /// A Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject instance to deserialize from. - /// - internal UserAssignedIdentities(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) - { - bool returnNow = false; - BeforeFromJson(json, ref returnNow); - if (returnNow) - { - return; - } - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IAssociativeArray)this).AdditionalProperties, (j) => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.UserAssignedIdentity.FromJson(j) ,exclusions ); - AfterFromJson(json); - } - } -} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api30/UserAssignedIdentity.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api30/UserAssignedIdentity.PowerShell.cs deleted file mode 100644 index 3b7184ce831c..000000000000 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api30/UserAssignedIdentity.PowerShell.cs +++ /dev/null @@ -1,172 +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.Api30 -{ - using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; - - /// User assigned identity properties - [System.ComponentModel.TypeConverter(typeof(UserAssignedIdentityTypeConverter))] - public partial class UserAssignedIdentity - { - - /// - /// 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.Api30.IUserAssignedIdentity DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new UserAssignedIdentity(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.Api30.IUserAssignedIdentity DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new UserAssignedIdentity(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.Api30.IUserAssignedIdentity 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 UserAssignedIdentity(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // 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); - } - 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); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal UserAssignedIdentity(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // 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); - } - 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); - } - AfterDeserializePSObject(content); - } - } - /// User assigned identity properties - [System.ComponentModel.TypeConverter(typeof(UserAssignedIdentityTypeConverter))] - public partial interface IUserAssignedIdentity - - { - - } -} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api30/UserAssignedIdentity.TypeConverter.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api30/UserAssignedIdentity.TypeConverter.cs deleted file mode 100644 index b064320aee42..000000000000 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api30/UserAssignedIdentity.TypeConverter.cs +++ /dev/null @@ -1,147 +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.Api30 -{ - using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; - - /// - /// A PowerShell PSTypeConverter to support converting to an instance of - /// - public partial class UserAssignedIdentityTypeConverter : global::System.Management.Automation.PSTypeConverter - { - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false. - /// - public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); - - /// - /// Determines if the converter can convert the parameter to the - /// type. - /// - /// the instance to check if it can be converted to the type. - /// - /// true if the instance could be converted to a type, otherwise false - /// - public static bool CanConvertFrom(dynamic sourceValue) - { - if (null == sourceValue) - { - return true; - } - global::System.Type type = sourceValue.GetType(); - if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) - { - // we say yest to PSObjects - return true; - } - if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) - { - // we say yest to Hashtables/dictionaries - return true; - } - try - { - if (null != sourceValue.ToJsonString()) - { - return true; - } - } - catch - { - // Not one of our objects - } - try - { - string text = sourceValue.ToString()?.Trim(); - return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonType.Object; - } - catch - { - // Doesn't look like it can be treated as JSON - } - return false; - } - - /// - /// Determines if the parameter can be converted to the - /// parameter - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false - /// - public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; - - /// - /// Converts the parameter to the parameter using and - /// - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// - /// an instance of , or null if there is no suitable conversion. - /// - public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); - - /// - /// Converts the parameter into an instance of - /// - /// the value to convert into an instance of . - /// - /// an instance of , or null if there is no suitable conversion. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.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)) - { - return sourceValue; - } - try - { - return UserAssignedIdentity.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; - } - catch - { - // Unable to use JSON pattern - } - if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) - { - return UserAssignedIdentity.DeserializeFromPSObject(sourceValue); - } - if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) - { - return UserAssignedIdentity.DeserializeFromDictionary(sourceValue); - } - return null; - } - - /// NotImplemented -- this will return null - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// will always return null. - public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; - } -} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api30/UserAssignedIdentity.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api30/UserAssignedIdentity.cs deleted file mode 100644 index 4e16a32eed68..000000000000 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api30/UserAssignedIdentity.cs +++ /dev/null @@ -1,74 +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.Api30 -{ - 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 - { - - /// Backing field for property. - private string _clientId; - - /// The client ID of the assigned identity. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] - 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;} } } - - /// Internal Acessors for PrincipalId - string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.IUserAssignedIdentityInternal.PrincipalId { get => this._principalId; set { {_principalId = value;} } } - - /// Backing field for property. - private string _principalId; - - /// The principal ID of the assigned identity. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] - public string PrincipalId { get => this._principalId; } - - /// Creates an new instance. - public UserAssignedIdentity() - { - - } - } - /// User assigned identity properties - public partial interface IUserAssignedIdentity : - Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IJsonSerializable - { - /// The client ID of the assigned identity. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The client ID of the assigned identity.", - SerializedName = @"clientId", - PossibleTypes = new [] { typeof(string) })] - string ClientId { get; } - /// The principal ID of the assigned identity. - [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The principal ID of the assigned identity.", - SerializedName = @"principalId", - PossibleTypes = new [] { typeof(string) })] - string PrincipalId { get; } - - } - /// User assigned identity properties - internal partial interface IUserAssignedIdentityInternal - - { - /// The client ID of the assigned identity. - string ClientId { get; set; } - /// The principal ID of the assigned identity. - string PrincipalId { get; set; } - - } -} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api30/UserAssignedIdentity.json.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api30/UserAssignedIdentity.json.cs deleted file mode 100644 index 4914915d504b..000000000000 --- a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Api30/UserAssignedIdentity.json.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.ApplicationInsights.Models.Api30 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; - - /// User assigned identity properties - public partial class UserAssignedIdentity - { - - /// - /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object - /// before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The JsonNode that should be deserialized into this object. - - partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json); - - /// - /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The JSON container that the serialization result will be placed in. - - partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container); - - /// - /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of - /// the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the - /// output parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The JsonNode that should be deserialized into this object. - /// Determines if the rest of the deserialization should be processed, or if the method should return - /// instantly. - - partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json, ref bool returnNow); - - /// - /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the - /// object before it is serialized. - /// If you wish to disable the default serialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The JSON container that the serialization result will be placed in. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container, ref bool returnNow); - - /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.IUserAssignedIdentity. - /// - /// a to deserialize from. - /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.IUserAssignedIdentity. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.Api30.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; - } - - /// - /// Serializes this instance of into a . - /// - /// The container to serialize this object into. If the caller - /// passes in null, a new instance will be created and returned to the caller. - /// Allows the caller to choose the depth of the serialization. See . - /// - /// a serialized instance of as a . - /// - public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode serializationMode) - { - container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject(); - - bool returnNow = false; - BeforeToJson(ref container, ref returnNow); - if (returnNow) - { - return container; - } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeReadOnly)) - { - AddIf( null != (((object)this._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)) - { - 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 ); - } - AfterToJson(ref container); - return container; - } - - /// - /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject into a new instance of . - /// - /// A Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject instance to deserialize from. - internal UserAssignedIdentity(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json) - { - bool returnNow = false; - BeforeFromJson(json, ref returnNow); - if (returnNow) - { - return; - } - {_principalId = If( json?.PropertyT("principalId"), out var __jsonPrincipalId) ? (string)__jsonPrincipalId : (string)PrincipalId;} - {_clientId = If( json?.PropertyT("clientId"), out var __jsonClientId) ? (string)__jsonClientId : (string)ClientId;} - AfterFromJson(json); - } - } -} \ No newline at end of file diff --git a/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/ApplicationInsightsComponent.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponent.cs new file mode 100644 index 000000000000..2c19f66401a0 --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponent.cs @@ -0,0 +1,698 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) 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; + + /// An Application Insights component definition. + public partial class ApplicationInsightsComponent : + 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.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.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.IApplicationInsightsComponentPropertiesInternal)Property).ApplicationId; } + + /// Type of application being monitored. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] + 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.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.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.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.IApplicationInsightsComponentPropertiesInternal)Property).DisableLocalAuth; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentPropertiesInternal)Property).DisableLocalAuth = value ?? default(bool); } + + /// Backing field for property. + private string _etag; + + /// Resource etag + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public string Etag { get => this._etag; set => this._etag = value; } + + /// + /// Used by the Application Insights system to determine what kind of flow this component was created by. This is to be set + /// to 'Bluefield' when creating/updating a component via the REST API. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] + public 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.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.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. 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.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.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.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 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 + /// all telemetry sent to Azure Application Insights. This value will be supplied upon construction of each new Application + /// Insights component. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] + public string InstrumentationKey { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentPropertiesInternal)Property).InstrumentationKey; } + + /// Backing field for property. + private string _kind; + + /// + /// The kind of application that this component refers to, used to customize UI. This value is a freeform string, values should + /// typically be one of the following: web, ios, other, store, java, phone. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public string Kind { get => this._kind; set => this._kind = value; } + + /// The date which the component got migrated to LA, in ISO 8601 format. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] + public global::System.DateTime? LaMigrationDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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.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.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.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.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.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.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.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.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 + 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.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.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.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.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.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.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.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.IComponentsResourceInternal)__componentsResource).Name; } + + /// List of linked private link scope resources. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] + 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.IApplicationInsightsComponentPropertiesInternal)Property).Name; } + + /// Backing field for 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.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.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 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 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 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)] + public string ResourceGroupName { get => (new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Success ? new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Groups["resourceGroupName"].Value : null); } + + /// Retention period in days. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] + public int? RetentionInDay { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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.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.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.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.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.IApplicationInsightsComponentPropertiesInternal)Property).WorkspaceResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentPropertiesInternal)Property).WorkspaceResourceId = value ?? null; } + + /// Creates an new instance. + public ApplicationInsightsComponent() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__componentsResource), __componentsResource); + await eventListener.AssertObjectIsValid(nameof(__componentsResource), __componentsResource); + } + } + /// An Application Insights component definition. + public partial interface IApplicationInsightsComponent : + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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) })] + string AppId { get; } + /// + /// The unique ID of your application. This field mirrors the 'Name' field and cannot be changed. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = true, + 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 = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"Type of application being monitored.", + SerializedName = @"Application_Type", + 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) })] + string ConnectionString { get; } + /// Creation Date for the Application Insights component, in ISO 8601 format. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = true, + 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) })] + global::System.DateTime? CreationDate { get; } + /// Disable IP masking. + [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) })] + bool? DisableIPMasking { get; set; } + /// Disable Non-AAD based Auth. + [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) })] + bool? DisableLocalAuth { get; set; } + /// 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) })] + string Etag { get; set; } + /// + /// Used by the Application Insights system to determine what kind of flow this component was created by. This is to be set + /// to 'Bluefield' when creating/updating a component via the REST API. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + 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(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, + 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. Please visit external url https://aka.ms/sls76s + /// to get more information. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = true, + 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; } + /// Purge data immediately after 30 days. + [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) })] + bool? ImmediatePurgeDataOn30Day { get; set; } + /// Indicates the flow of the ingestion. + [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(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 + /// Insights component. + /// + [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) })] + string InstrumentationKey { get; } + /// + /// The kind of application that this component refers to, used to customize UI. This value is a freeform string, values should + /// typically be one of the following: web, ios, other, store, java, phone. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + 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) })] + string Kind { get; set; } + /// The date which the component got migrated to LA, in ISO 8601 format. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = true, + 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) })] + global::System.DateTime? LaMigrationDate { get; } + /// List of linked private link scope resources. + [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.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) })] + string PropertiesName { get; } + /// + /// Current state of this component: whether or not is has been provisioned within the resource group it is defined. Users + /// cannot change this value but are able to read from it. Values will include Succeeded, Deploying, Canceled, and Failed. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = true, + 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) })] + string ProvisioningState { get; } + /// The network access type for accessing Application Insights ingestion. + [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(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(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'. + /// + [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(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, + 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; } + /// Azure Tenant Id. + [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) })] + string TenantId { get; } + /// + /// Resource Id of the log analytics workspace which the data will be ingested to. This property is required to create an + /// application with this API version. Applications from older versions will not have this property. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + 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) })] + string WorkspaceResourceId { get; set; } + + } + /// An Application Insights component definition. + internal partial interface IApplicationInsightsComponentInternal : + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentsResourceInternal + { + /// Application Insights Unique ID for your Application. + string AppId { get; set; } + /// + /// The unique ID of your application. This field mirrors the 'Name' field and cannot be changed. + /// + string ApplicationId { get; set; } + /// Type of application being monitored. + [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. + global::System.DateTime? CreationDate { get; set; } + /// Disable IP masking. + bool? DisableIPMasking { get; set; } + /// Disable Non-AAD based Auth. + bool? DisableLocalAuth { get; set; } + /// Resource etag + string Etag { get; set; } + /// + /// Used by the Application Insights system to determine what kind of flow this component was created by. This is to be set + /// to 'Bluefield' when creating/updating a component via the REST API. + /// + [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. 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. + [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 + /// Insights component. + /// + string InstrumentationKey { get; set; } + /// + /// The kind of application that this component refers to, used to customize UI. This value is a freeform string, values should + /// typically be one of the following: web, ios, other, store, java, phone. + /// + string Kind { get; set; } + /// The date which the component got migrated to LA, in ISO 8601 format. + global::System.DateTime? LaMigrationDate { get; set; } + /// List of linked private link scope resources. + 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.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. + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PSArgumentCompleterAttribute("Enabled", "Disabled")] + string PublicNetworkAccessForIngestion { get; set; } + /// The network access type for accessing Application Insights query. + [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'. + /// + [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. + string TenantId { get; set; } + /// + /// Resource Id of the log analytics workspace which the data will be ingested to. This property is required to create an + /// application with this API version. Applications from older versions will not have this property. + /// + string WorkspaceResourceId { get; set; } + + } +} \ No newline at end of file diff --git a/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/ApplicationInsightsComponentApiKey.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentApiKey.PowerShell.cs new file mode 100644 index 000000000000..9c5667869e90 --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentApiKey.PowerShell.cs @@ -0,0 +1,208 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + + /// Properties that define an API key of an Application Insights Component. + [System.ComponentModel.TypeConverter(typeof(ApplicationInsightsComponentApiKeyTypeConverter))] + public partial class ApplicationInsightsComponentApiKey + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ApplicationInsightsComponentApiKey(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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.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.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.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.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.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 . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ApplicationInsightsComponentApiKey(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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.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.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.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.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.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 . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + 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 . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentApiKey DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ApplicationInsightsComponentApiKey(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentApiKey FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } + } + /// Properties that define an API key of an Application Insights Component. + [System.ComponentModel.TypeConverter(typeof(ApplicationInsightsComponentApiKeyTypeConverter))] + public partial interface IApplicationInsightsComponentApiKey + + { + + } +} \ No newline at end of file diff --git a/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/ApplicationInsightsComponentApiKeyListResult.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentApiKeyListResult.cs new file mode 100644 index 000000000000..199ae8ff2411 --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentApiKeyListResult.cs @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models +{ + 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.IApplicationInsightsComponentApiKeyListResult, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentApiKeyListResultInternal + { + + /// Backing field for property. + 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 System.Collections.Generic.List Value { get => this._value; set => this._value = value; } + + /// + /// Creates an new instance. + /// + public ApplicationInsightsComponentApiKeyListResult() + { + + } + } + /// Describes the list of API Keys of an Application Insights Component. + public partial interface IApplicationInsightsComponentApiKeyListResult : + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IJsonSerializable + { + /// List of API Key definitions. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"List of API Key definitions.", + SerializedName = @"value", + 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. + internal partial interface IApplicationInsightsComponentApiKeyListResultInternal + + { + /// List of API Key definitions. + 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/ApplicationInsightsComponentAvailableFeatures.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentAvailableFeatures.cs new file mode 100644 index 000000000000..0efde4111b22 --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentAvailableFeatures.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.IApplicationInsightsComponentAvailableFeatures, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentAvailableFeaturesInternal + { + + /// Internal Acessors for Result + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentAvailableFeaturesInternal.Result { get => this._result; set { {_result = value;} } } + + /// Backing field for property. + 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 System.Collections.Generic.List Result { get => this._result; } + + /// + /// Creates an new instance. + /// + public ApplicationInsightsComponentAvailableFeatures() + { + + } + } + /// An Application Insights component available features. + public partial interface IApplicationInsightsComponentAvailableFeatures : + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IJsonSerializable + { + /// A list of Application Insights component feature. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = true, + 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.IApplicationInsightsComponentFeature) })] + System.Collections.Generic.List Result { get; } + + } + /// An Application Insights component available features. + internal partial interface IApplicationInsightsComponentAvailableFeaturesInternal + + { + /// A list of Application Insights component feature. + 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/ApplicationInsightsComponentBillingFeatures.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentBillingFeatures.PowerShell.cs new file mode 100644 index 000000000000..06e701f9c06e --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentBillingFeatures.PowerShell.cs @@ -0,0 +1,225 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) 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 billing features + [System.ComponentModel.TypeConverter(typeof(ApplicationInsightsComponentBillingFeaturesTypeConverter))] + public partial class ApplicationInsightsComponentBillingFeatures + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ApplicationInsightsComponentBillingFeatures(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("DataVolumeCap")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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.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.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.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.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.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.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.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 . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ApplicationInsightsComponentBillingFeatures(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("DataVolumeCap")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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.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.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.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.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.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.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.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 . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + 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 . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentBillingFeatures DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ApplicationInsightsComponentBillingFeatures(content); + } + + /// + /// Creates a new instance of , deserializing the content from a + /// json string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentBillingFeatures FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } + } + /// An Application Insights component billing features + [System.ComponentModel.TypeConverter(typeof(ApplicationInsightsComponentBillingFeaturesTypeConverter))] + public partial interface IApplicationInsightsComponentBillingFeatures + + { + + } +} \ No newline at end of file diff --git a/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/ApplicationInsightsComponentBillingFeatures.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentBillingFeatures.cs new file mode 100644 index 000000000000..34737e8a96f4 --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentBillingFeatures.cs @@ -0,0 +1,185 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.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.IApplicationInsightsComponentBillingFeatures, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentBillingFeaturesInternal + { + + /// Backing field for property. + 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 System.Collections.Generic.List CurrentBillingFeature { get => this._currentBillingFeature; set => this._currentBillingFeature = value; } + + /// Backing field for property. + 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.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.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.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.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.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.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.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.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.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.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. + /// + public ApplicationInsightsComponentBillingFeatures() + { + + } + } + /// An Application Insights component billing features + public partial interface IApplicationInsightsComponentBillingFeatures : + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IJsonSerializable + { + /// + /// Current enabled pricing plan. When the component is in the Enterprise plan, this will list both 'Basic' and 'Application + /// Insights Enterprise'. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + 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) })] + 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) })] + float? DataVolumeCapCap { get; set; } + /// Maximum daily data volume cap that the user can set for this component. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = true, + 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) })] + float? DataVolumeCapMaxHistoryCap { get; } + /// Daily data volume cap UTC reset hour. + [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) })] + int? DataVolumeCapResetTime { get; } + /// Do not send a notification email when the daily data volume cap is met. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + 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) })] + bool? DataVolumeCapStopSendNotificationWhenHitCap { get; set; } + /// Reserved, not used for now. + [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) })] + bool? DataVolumeCapStopSendNotificationWhenHitThreshold { get; set; } + /// Reserved, not used for now. + [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) })] + int? DataVolumeCapWarningThreshold { get; set; } + + } + /// An Application Insights component billing features + internal partial interface IApplicationInsightsComponentBillingFeaturesInternal + + { + /// + /// Current enabled pricing plan. When the component is in the Enterprise plan, this will list both 'Basic' and 'Application + /// Insights Enterprise'. + /// + System.Collections.Generic.List CurrentBillingFeature { get; set; } + /// An Application Insights component daily data volume cap + 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. + float? DataVolumeCapMaxHistoryCap { get; set; } + /// Daily data volume cap UTC reset hour. + int? DataVolumeCapResetTime { get; set; } + /// Do not send a notification email when the daily data volume cap is met. + bool? DataVolumeCapStopSendNotificationWhenHitCap { get; set; } + /// Reserved, not used for now. + bool? DataVolumeCapStopSendNotificationWhenHitThreshold { get; set; } + /// Reserved, not used for now. + int? DataVolumeCapWarningThreshold { get; set; } + + } +} \ No newline at end of file diff --git a/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/ApplicationInsightsComponentDataVolumeCap.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentDataVolumeCap.PowerShell.cs new file mode 100644 index 000000000000..c0f877b942b2 --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentDataVolumeCap.PowerShell.cs @@ -0,0 +1,209 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + + /// An Application Insights component daily data volume cap + [System.ComponentModel.TypeConverter(typeof(ApplicationInsightsComponentDataVolumeCapTypeConverter))] + public partial class ApplicationInsightsComponentDataVolumeCap + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ApplicationInsightsComponentDataVolumeCap(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Cap")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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.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.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.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.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.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 . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ApplicationInsightsComponentDataVolumeCap(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Cap")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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.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.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.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.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.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 . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + 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 . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentDataVolumeCap DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ApplicationInsightsComponentDataVolumeCap(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json + /// string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentDataVolumeCap FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } + } + /// An Application Insights component daily data volume cap + [System.ComponentModel.TypeConverter(typeof(ApplicationInsightsComponentDataVolumeCapTypeConverter))] + public partial interface IApplicationInsightsComponentDataVolumeCap + + { + + } +} \ No newline at end of file diff --git a/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/ApplicationInsightsComponentExportRequest.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentExportRequest.PowerShell.cs new file mode 100644 index 000000000000..9ede177efca4 --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentExportRequest.PowerShell.cs @@ -0,0 +1,235 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) 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 Continuous Export configuration request definition. + /// + [System.ComponentModel.TypeConverter(typeof(ApplicationInsightsComponentExportRequestTypeConverter))] + public partial class ApplicationInsightsComponentExportRequest + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ApplicationInsightsComponentExportRequest(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("RecordType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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.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.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.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.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.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.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.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.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 . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ApplicationInsightsComponentExportRequest(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("RecordType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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.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.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.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.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.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.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.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.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 . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + 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 . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportRequest DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ApplicationInsightsComponentExportRequest(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json + /// string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentExportRequest FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } + } + /// An Application Insights component Continuous Export configuration request definition. + [System.ComponentModel.TypeConverter(typeof(ApplicationInsightsComponentExportRequestTypeConverter))] + public partial interface IApplicationInsightsComponentExportRequest + + { + + } +} \ No newline at end of file diff --git a/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/ApplicationInsightsComponentFeature.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentFeature.PowerShell.cs new file mode 100644 index 000000000000..9fe2e25ea354 --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentFeature.PowerShell.cs @@ -0,0 +1,232 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) 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 daily data volume cap status + [System.ComponentModel.TypeConverter(typeof(ApplicationInsightsComponentFeatureTypeConverter))] + public partial class ApplicationInsightsComponentFeature + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ApplicationInsightsComponentFeature(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("FeatureName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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.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.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.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.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.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.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.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.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 . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ApplicationInsightsComponentFeature(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("FeatureName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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.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.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.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.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.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.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.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.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 . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + 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 . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentFeature DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ApplicationInsightsComponentFeature(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentFeature FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } + } + /// An Application Insights component daily data volume cap status + [System.ComponentModel.TypeConverter(typeof(ApplicationInsightsComponentFeatureTypeConverter))] + public partial interface IApplicationInsightsComponentFeature + + { + + } +} \ No newline at end of file diff --git a/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/ApplicationInsightsComponentFeatureCapability.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentFeatureCapability.PowerShell.cs new file mode 100644 index 000000000000..db1874530bae --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentFeatureCapability.PowerShell.cs @@ -0,0 +1,209 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + + /// An Application Insights component feature capability + [System.ComponentModel.TypeConverter(typeof(ApplicationInsightsComponentFeatureCapabilityTypeConverter))] + public partial class ApplicationInsightsComponentFeatureCapability + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ApplicationInsightsComponentFeatureCapability(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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.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.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.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.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.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 . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ApplicationInsightsComponentFeatureCapability(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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.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.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.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.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.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 . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + 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 . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentFeatureCapability DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ApplicationInsightsComponentFeatureCapability(content); + } + + /// + /// Creates a new instance of , deserializing the content from + /// a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentFeatureCapability FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } + } + /// An Application Insights component feature capability + [System.ComponentModel.TypeConverter(typeof(ApplicationInsightsComponentFeatureCapabilityTypeConverter))] + public partial interface IApplicationInsightsComponentFeatureCapability + + { + + } +} \ No newline at end of file diff --git a/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/ApplicationInsightsComponentListResult.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentListResult.PowerShell.cs new file mode 100644 index 000000000000..f2ceee7ec6a6 --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentListResult.PowerShell.cs @@ -0,0 +1,177 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + + /// Describes the list of Application Insights Resources. + [System.ComponentModel.TypeConverter(typeof(ApplicationInsightsComponentListResultTypeConverter))] + public partial class ApplicationInsightsComponentListResult + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ApplicationInsightsComponentListResult(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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.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 . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ApplicationInsightsComponentListResult(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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.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 . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + 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 . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentListResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ApplicationInsightsComponentListResult(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json + /// string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentListResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } + } + /// Describes the list of Application Insights Resources. + [System.ComponentModel.TypeConverter(typeof(ApplicationInsightsComponentListResultTypeConverter))] + public partial interface IApplicationInsightsComponentListResult + + { + + } +} \ No newline at end of file diff --git a/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/ApplicationInsightsComponentProperties.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentProperties.PowerShell.cs new file mode 100644 index 000000000000..1f6a93516214 --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentProperties.PowerShell.cs @@ -0,0 +1,361 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) 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 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.IApplicationInsightsComponentPropertiesInternal)this).ApplicationId = (string) content.GetValueForProperty("ApplicationId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentPropertiesInternal)this).ApplicationId, global::System.Convert.ToString); + } + if (content.Contains("AppId")) + { + ((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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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 . + /// + /// 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.IApplicationInsightsComponentPropertiesInternal)this).ApplicationId = (string) content.GetValueForProperty("ApplicationId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentPropertiesInternal)this).ApplicationId, global::System.Convert.ToString); + } + if (content.Contains("AppId")) + { + ((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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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.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 . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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.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.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/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/ApplicationInsightsComponentQuotaStatus.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentQuotaStatus.PowerShell.cs new file mode 100644 index 000000000000..e9d9b5f58b1c --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ApplicationInsightsComponentQuotaStatus.PowerShell.cs @@ -0,0 +1,185 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + + /// An Application Insights component daily data volume cap status + [System.ComponentModel.TypeConverter(typeof(ApplicationInsightsComponentQuotaStatusTypeConverter))] + public partial class ApplicationInsightsComponentQuotaStatus + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ApplicationInsightsComponentQuotaStatus(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("AppId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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.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.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 . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ApplicationInsightsComponentQuotaStatus(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("AppId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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.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.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 . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + 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 . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentQuotaStatus DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ApplicationInsightsComponentQuotaStatus(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json + /// string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IApplicationInsightsComponentQuotaStatus FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } + } + /// An Application Insights component daily data volume cap status + [System.ComponentModel.TypeConverter(typeof(ApplicationInsightsComponentQuotaStatusTypeConverter))] + public partial interface IApplicationInsightsComponentQuotaStatus + + { + + } +} \ No newline at end of file diff --git a/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/ComponentLinkedStorageAccounts.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ComponentLinkedStorageAccounts.PowerShell.cs new file mode 100644 index 000000000000..5a4e27f22a70 --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ComponentLinkedStorageAccounts.PowerShell.cs @@ -0,0 +1,198 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + + /// An Application Insights component linked storage accounts + [System.ComponentModel.TypeConverter(typeof(ComponentLinkedStorageAccountsTypeConverter))] + public partial class ComponentLinkedStorageAccounts + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ComponentLinkedStorageAccounts(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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.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("LinkedStorageAccount")) + { + ((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 . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ComponentLinkedStorageAccounts(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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.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("LinkedStorageAccount")) + { + ((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 . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + 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 . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentLinkedStorageAccounts DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ComponentLinkedStorageAccounts(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentLinkedStorageAccounts FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } + } + /// An Application Insights component linked storage accounts + [System.ComponentModel.TypeConverter(typeof(ComponentLinkedStorageAccountsTypeConverter))] + public partial interface IComponentLinkedStorageAccounts + + { + + } +} \ No newline at end of file diff --git a/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/ComponentLinkedStorageAccounts.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ComponentLinkedStorageAccounts.cs new file mode 100644 index 000000000000..874128963918 --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ComponentLinkedStorageAccounts.cs @@ -0,0 +1,111 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models +{ + 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.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.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.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.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.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.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.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.IResourceInternal)__proxyResource).Name; } + + /// Backing field for 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.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)] + public string ResourceGroupName { get => (new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Success ? new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Groups["resourceGroupName"].Value : null); } + + /// + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + /// + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IResourceInternal)__proxyResource).Type; } + + /// Creates an new instance. + public ComponentLinkedStorageAccounts() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__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.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) })] + string LinkedStorageAccount { get; set; } + + } + /// An Application Insights component linked storage accounts + internal partial interface IComponentLinkedStorageAccountsInternal : + 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.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/ComponentLinkedStorageAccountsPatch.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ComponentLinkedStorageAccountsPatch.PowerShell.cs new file mode 100644 index 000000000000..e74cdf1bd422 --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ComponentLinkedStorageAccountsPatch.PowerShell.cs @@ -0,0 +1,176 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + + /// An Application Insights component linked storage accounts patch + [System.ComponentModel.TypeConverter(typeof(ComponentLinkedStorageAccountsPatchTypeConverter))] + public partial class ComponentLinkedStorageAccountsPatch + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ComponentLinkedStorageAccountsPatch(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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.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 . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ComponentLinkedStorageAccountsPatch(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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.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 . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + 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 . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentLinkedStorageAccountsPatch DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ComponentLinkedStorageAccountsPatch(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentLinkedStorageAccountsPatch FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } + } + /// An Application Insights component linked storage accounts patch + [System.ComponentModel.TypeConverter(typeof(ComponentLinkedStorageAccountsPatchTypeConverter))] + public partial interface IComponentLinkedStorageAccountsPatch + + { + + } +} \ No newline at end of file diff --git a/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/ComponentLinkedStorageAccountsPatch.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ComponentLinkedStorageAccountsPatch.cs new file mode 100644 index 000000000000..fd9c08fcfc23 --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ComponentLinkedStorageAccountsPatch.cs @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.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.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.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.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.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.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() + { + + } + } + /// An Application Insights component linked storage accounts patch + public partial interface IComponentLinkedStorageAccountsPatch : + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IJsonSerializable + { + /// Linked storage account resource ID + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"Linked storage account resource ID", + SerializedName = @"linkedStorageAccount", + PossibleTypes = new [] { typeof(string) })] + string LinkedStorageAccount { get; set; } + + } + /// An Application Insights component linked storage accounts patch + internal partial interface IComponentLinkedStorageAccountsPatchInternal + + { + /// Linked storage account resource ID + string LinkedStorageAccount { get; set; } + /// The properties of the linked storage accounts. + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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/ComponentPurgeBodyFilters.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ComponentPurgeBodyFilters.PowerShell.cs new file mode 100644 index 000000000000..0b1875d0eef5 --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ComponentPurgeBodyFilters.PowerShell.cs @@ -0,0 +1,188 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + + /// User-defined filters to return data which will be purged from the table. + [System.ComponentModel.TypeConverter(typeof(ComponentPurgeBodyFiltersTypeConverter))] + public partial class ComponentPurgeBodyFilters + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ComponentPurgeBodyFilters(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Column")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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.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.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.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 . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ComponentPurgeBodyFilters(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Column")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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.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.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.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 . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + 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 . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentPurgeBodyFilters DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ComponentPurgeBodyFilters(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentPurgeBodyFilters FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } + } + /// User-defined filters to return data which will be purged from the table. + [System.ComponentModel.TypeConverter(typeof(ComponentPurgeBodyFiltersTypeConverter))] + public partial interface IComponentPurgeBodyFilters + + { + + } +} \ No newline at end of file diff --git a/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/ComponentPurgeStatusResponse.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ComponentPurgeStatusResponse.cs new file mode 100644 index 000000000000..d9464add4208 --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ComponentPurgeStatusResponse.cs @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models +{ + 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.IComponentPurgeStatusResponse, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentPurgeStatusResponseInternal + { + + /// Backing field for property. + 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 string Status { get => this._status; set => this._status = value; } + + /// Creates an new instance. + public ComponentPurgeStatusResponse() + { + + } + } + /// Response containing status for a specific purge operation. + public partial interface IComponentPurgeStatusResponse : + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IJsonSerializable + { + /// Status of the operation represented by the requested Id. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = true, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"Status of the operation represented by the requested Id.", + SerializedName = @"status", + 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. + internal partial interface IComponentPurgeStatusResponseInternal + + { + /// Status of the operation represented by the requested Id. + [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/ComponentsResource.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ComponentsResource.PowerShell.cs new file mode 100644 index 000000000000..ed3b6efcf418 --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ComponentsResource.PowerShell.cs @@ -0,0 +1,196 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + + /// An azure resource object + [System.ComponentModel.TypeConverter(typeof(ComponentsResourceTypeConverter))] + public partial class ComponentsResource + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ComponentsResource(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ComponentsResource(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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); + } + 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.IComponentsResource DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ComponentsResource(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentsResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ComponentsResource(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IComponentsResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } + } + /// An azure resource object + [System.ComponentModel.TypeConverter(typeof(ComponentsResourceTypeConverter))] + public partial interface IComponentsResource + + { + + } +} \ No newline at end of file diff --git a/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/ErrorResponse.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ErrorResponse.PowerShell.cs new file mode 100644 index 000000000000..76c3aad1377b --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ErrorResponse.PowerShell.cs @@ -0,0 +1,184 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + + /// + /// Error response indicates Insights service is not able to process the incoming request. The reason is provided in the error + /// message. + /// + [System.ComponentModel.TypeConverter(typeof(ErrorResponseTypeConverter))] + public partial class ErrorResponse + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponse DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ErrorResponse(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponse DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ErrorResponse(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ErrorResponse(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Code")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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.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.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 . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ErrorResponse(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Code")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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.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.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); + } + + /// + /// 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.IErrorResponse FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } + } + /// Error response indicates Insights service is not able to process the incoming request. The reason is provided in the error + /// message. + [System.ComponentModel.TypeConverter(typeof(ErrorResponseTypeConverter))] + public partial interface IErrorResponse + + { + + } +} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ErrorResponse.TypeConverter.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ErrorResponse.TypeConverter.cs new file mode 100644 index 000000000000..14af957c62eb --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ErrorResponse.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ErrorResponseTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.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.IErrorResponse).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ErrorResponse.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ErrorResponse.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ErrorResponse.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ErrorResponse.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ErrorResponse.cs new file mode 100644 index 000000000000..50bbb8f61adb --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ErrorResponse.cs @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + + /// + /// Error response indicates Insights service is not able to process the incoming request. The reason is provided in the error + /// message. + /// + public partial class ErrorResponse : + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponse, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseInternal + { + + /// Backing field for property. + private string _code; + + /// Error code. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public string Code { get => this._code; set => this._code = value; } + + /// Backing field for property. + private 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 System.Collections.Generic.List Detail { get => this._detail; set => this._detail = value; } + + /// Backing field for property. + private string _message; + + /// Error message indicating why the operation failed. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public string Message { get => this._message; set => this._message = value; } + + /// Creates an new instance. + public ErrorResponse() + { + + } + } + /// Error response indicates Insights service is not able to process the incoming request. The reason is provided in the error + /// message. + public partial interface IErrorResponse : + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IJsonSerializable + { + /// Error code. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"Error code.", + SerializedName = @"code", + PossibleTypes = new [] { typeof(string) })] + string Code { get; set; } + /// The list of invalid fields send in request, in case of validation error. + [Microsoft.Azure.PowerShell.Cmdlets.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.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) })] + string Message { get; set; } + + } + /// Error response indicates Insights service is not able to process the incoming request. The reason is provided in the error + /// message. + internal partial interface IErrorResponseInternal + + { + /// Error code. + string Code { get; set; } + /// The list of invalid fields send in request, in case of validation error. + System.Collections.Generic.List Detail { get; set; } + /// Error message indicating why the operation failed. + string Message { get; set; } + + } +} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ErrorResponse.json.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ErrorResponse.json.cs new file mode 100644 index 000000000000..0a5390282d4f --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ErrorResponse.json.cs @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + + /// + /// Error response indicates Insights service is not able to process the incoming request. The reason is provided in the error + /// message. + /// + public partial class ErrorResponse + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject instance to deserialize from. + internal ErrorResponse(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_code = If( json?.PropertyT("code"), out var __jsonCode) ? (string)__jsonCode : (string)_code;} + {_message = If( json?.PropertyT("message"), out var __jsonMessage) ? (string)__jsonMessage : (string)_message;} + {_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.IErrorResponse. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponse. + /// + 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; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._code)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(this._code.ToString()) : null, "code" ,container.Add ); + AddIf( null != (((object)this._message)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(this._message.ToString()) : null, "message" ,container.Add ); + if (null != this._detail) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.XNodeArray(); + foreach( var __x in this._detail ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("details",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ErrorResponseComponents.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ErrorResponseComponents.PowerShell.cs new file mode 100644 index 000000000000..843ee0037548 --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ErrorResponseComponents.PowerShell.cs @@ -0,0 +1,178 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + + [System.ComponentModel.TypeConverter(typeof(ErrorResponseComponentsTypeConverter))] + public partial class ErrorResponseComponents + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseComponents DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ErrorResponseComponents(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseComponents DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ErrorResponseComponents(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ErrorResponseComponents(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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.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.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 . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ErrorResponseComponents(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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.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.IErrorResponseComponentsInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseComponentsInternal)this).Message, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseComponents FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } + } + [System.ComponentModel.TypeConverter(typeof(ErrorResponseComponentsTypeConverter))] + public partial interface IErrorResponseComponents + + { + + } +} \ No newline at end of file diff --git a/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/ErrorResponseComponents.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ErrorResponseComponents.cs new file mode 100644 index 000000000000..a470836b32c1 --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ErrorResponseComponents.cs @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + + public partial class ErrorResponseComponents : + 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.IErrorResponseComponentsErrorInternal)Error).Code; } + + /// Backing field for property. + 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.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.IErrorResponseComponentsErrorInternal)Error).Message; } + + /// Internal Acessors for Code + 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.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.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() + { + + } + } + public partial interface IErrorResponseComponents : + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IJsonSerializable + { + /// Error code. + [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) })] + string Code { get; } + /// Error message indicating why the operation failed. + [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) })] + string Message { get; } + + } + internal partial interface IErrorResponseComponentsInternal + + { + /// Error code. + string Code { get; set; } + /// + /// Error response indicates Insights service is not able to process the incoming request. The reason is provided in the error + /// message. + /// + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseComponentsError Error { get; set; } + /// Error message indicating why the operation failed. + string Message { get; set; } + + } +} \ No newline at end of file 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/ErrorResponseLinkedStorage.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ErrorResponseLinkedStorage.PowerShell.cs new file mode 100644 index 000000000000..8ddf4ed67306 --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ErrorResponseLinkedStorage.PowerShell.cs @@ -0,0 +1,178 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + + [System.ComponentModel.TypeConverter(typeof(ErrorResponseLinkedStorageTypeConverter))] + public partial class ErrorResponseLinkedStorage + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseLinkedStorage DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ErrorResponseLinkedStorage(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseLinkedStorage DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ErrorResponseLinkedStorage(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ErrorResponseLinkedStorage(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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.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.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 . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ErrorResponseLinkedStorage(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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.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.IErrorResponseLinkedStorageInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseLinkedStorageInternal)this).Message, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseLinkedStorage FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } + } + [System.ComponentModel.TypeConverter(typeof(ErrorResponseLinkedStorageTypeConverter))] + public partial interface IErrorResponseLinkedStorage + + { + + } +} \ No newline at end of file diff --git a/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/ErrorResponseLinkedStorage.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ErrorResponseLinkedStorage.cs new file mode 100644 index 000000000000..73698469055d --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ErrorResponseLinkedStorage.cs @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + + public partial class ErrorResponseLinkedStorage : + 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.IErrorResponseLinkedStorageErrorInternal)Error).Code; } + + /// Backing field for property. + 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.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.IErrorResponseLinkedStorageErrorInternal)Error).Message; } + + /// Internal Acessors for Code + 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.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.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() + { + + } + } + public partial interface IErrorResponseLinkedStorage : + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IJsonSerializable + { + /// Error code. + [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) })] + string Code { get; } + /// Error message indicating why the operation failed. + [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) })] + string Message { get; } + + } + internal partial interface IErrorResponseLinkedStorageInternal + + { + /// Error code. + string Code { get; set; } + /// + /// Error response indicates Insights service is not able to process the incoming request. The reason is provided in the error + /// message. + /// + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IErrorResponseLinkedStorageError Error { get; set; } + /// Error message indicating why the operation failed. + string Message { get; set; } + + } +} \ No newline at end of file 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/InnerErrorTrace.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/InnerErrorTrace.cs new file mode 100644 index 000000000000..0df0aa228380 --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/InnerErrorTrace.cs @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + + /// Error details + public partial class InnerErrorTrace : + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IInnerErrorTrace, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IInnerErrorTraceInternal + { + + /// Internal Acessors for Trace + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IInnerErrorTraceInternal.Trace { get => this._trace; set { {_trace = value;} } } + + /// Backing field for property. + private System.Collections.Generic.List _trace; + + /// detailed error trace + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public System.Collections.Generic.List Trace { get => this._trace; } + + /// Creates an new instance. + public InnerErrorTrace() + { + + } + } + /// Error details + public partial interface IInnerErrorTrace : + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IJsonSerializable + { + /// detailed error trace + [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) })] + System.Collections.Generic.List Trace { get; } + + } + /// Error details + internal partial interface IInnerErrorTraceInternal + + { + /// detailed error trace + 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/ManagedServiceIdentity.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ManagedServiceIdentity.PowerShell.cs new file mode 100644 index 000000000000..6a1e416c44a5 --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ManagedServiceIdentity.PowerShell.cs @@ -0,0 +1,188 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + + /// Managed service identity (system assigned and/or user assigned identities) + [System.ComponentModel.TypeConverter(typeof(ManagedServiceIdentityTypeConverter))] + public partial class ManagedServiceIdentity + { + + /// + /// 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.IManagedServiceIdentity DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ManagedServiceIdentity(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.IManagedServiceIdentity DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ManagedServiceIdentity(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.IManagedServiceIdentity 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 ManagedServiceIdentity(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("PrincipalId")) + { + ((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.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.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.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 . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ManagedServiceIdentity(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("PrincipalId")) + { + ((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.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.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.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); + } + + /// 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(); + } + } + /// Managed service identity (system assigned and/or user assigned identities) + [System.ComponentModel.TypeConverter(typeof(ManagedServiceIdentityTypeConverter))] + public partial interface IManagedServiceIdentity + + { + + } +} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ManagedServiceIdentity.TypeConverter.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ManagedServiceIdentity.TypeConverter.cs new file mode 100644 index 000000000000..4722706ee398 --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ManagedServiceIdentity.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ManagedServiceIdentityTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.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.IManagedServiceIdentity).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ManagedServiceIdentity.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ManagedServiceIdentity.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ManagedServiceIdentity.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ManagedServiceIdentity.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ManagedServiceIdentity.cs new file mode 100644 index 000000000000..ab6939eabb75 --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ManagedServiceIdentity.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models +{ + 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.IManagedServiceIdentity, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IManagedServiceIdentityInternal + { + + /// Internal Acessors for PrincipalId + 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.IManagedServiceIdentityInternal.TenantId { get => this._tenantId; set { {_tenantId = value;} } } + + /// Backing field for property. + private string _principalId; + + /// + /// 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.Owned)] + public string PrincipalId { get => this._principalId; } + + /// Backing field for property. + private string _tenantId; + + /// + /// 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.Owned)] + public string TenantId { get => this._tenantId; } + + /// Backing field for property. + 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 string Type { get => this._type; set => this._type = value; } + + /// Backing field for property. + 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 + /// 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.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + 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() + { + + } + } + /// Managed service identity (system assigned and/or user assigned identities) + public partial interface IManagedServiceIdentity : + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IJsonSerializable + { + /// + /// 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.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) })] + string PrincipalId { get; } + /// + /// The tenant ID of the system assigned identity. This property will only be provided for a system assigned identity. + /// + [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) })] + string TenantId { get; } + /// + /// Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). + /// + [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(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}. + /// The dictionary values can be empty objects ({}) in requests. + /// + [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.IUserAssignedIdentities) })] + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IUserAssignedIdentities UserAssignedIdentity { get; set; } + + } + /// Managed service identity (system assigned and/or user assigned identities) + internal partial interface IManagedServiceIdentityInternal + + { + /// + /// The service principal ID of the system assigned identity. This property will only be provided for a system assigned identity. + /// + string PrincipalId { get; set; } + /// + /// The tenant ID of the system assigned identity. This property will only be provided for a system assigned identity. + /// + string TenantId { get; set; } + /// + /// Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). + /// + [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.IUserAssignedIdentities UserAssignedIdentity { get; set; } + + } +} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ManagedServiceIdentity.json.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ManagedServiceIdentity.json.cs new file mode 100644 index 000000000000..0159bc4663fd --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ManagedServiceIdentity.json.cs @@ -0,0 +1,120 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + + /// Managed service identity (system assigned and/or user assigned identities) + public partial class ManagedServiceIdentity + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IManagedServiceIdentity. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IManagedServiceIdentity. + /// + 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; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject instance to deserialize from. + internal ManagedServiceIdentity(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_principalId = If( json?.PropertyT("principalId"), out var __jsonPrincipalId) ? (string)__jsonPrincipalId : (string)_principalId;} + {_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); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.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.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._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 != this._userAssignedIdentity ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) this._userAssignedIdentity.ToJson(null,serializationMode) : null, "userAssignedIdentities" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/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/MyWorkbook.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/MyWorkbook.cs new file mode 100644 index 000000000000..410c777b736f --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/MyWorkbook.cs @@ -0,0 +1,496 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) 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; + + /// An Application Insights private workbook definition. + public partial class MyWorkbook : + 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.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.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.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.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.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] + 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.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] + 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 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 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.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.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.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.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.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.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.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.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 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.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.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)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.FormatTable(Index = 0)] + public string ResourceGroupName { get => (new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Success ? new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Groups["resourceGroupName"].Value : null); } + + /// + /// Configuration of this particular private 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.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.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.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.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.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.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.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 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.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.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 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.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.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.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.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.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.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.IMyWorkbookPropertiesInternal)Property).Version; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookPropertiesInternal)Property).Version = value ?? null; } + + /// Creates an new instance. + public MyWorkbook() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__myWorkbookResource), __myWorkbookResource); + await eventListener.AssertObjectIsValid(nameof(__myWorkbookResource), __myWorkbookResource); + } + } + /// An Application Insights private workbook definition. + public partial interface IMyWorkbook : + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IJsonSerializable, + 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) })] + string Category { get; set; } + /// The user-defined name of the private workbook. + [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) })] + string DisplayName { get; set; } + /// The kind of workbook. Choices are user and shared. + [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(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) })] + 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) })] + string SerializedData { get; set; } + /// Optional resourceId for a source resource. + [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) })] + string SourceId { get; set; } + /// BYOS Storage Account URI + [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) })] + string StorageUri { get; set; } + /// The timestamp of resource creation (UTC). + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = 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; } + /// The identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = 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; } + /// The type of identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The type of identity that created the resource.", + SerializedName = @"createdByType", + 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 = 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; } + /// The identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = 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; } + /// The type of identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The type of identity that last modified the resource.", + SerializedName = @"lastModifiedByType", + 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) })] + string TimeModified { get; } + /// Unique user id of the specific user that owns this private workbook. + [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) })] + string UserId { get; } + /// + /// 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.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) })] + string Version { get; set; } + + } + /// An Application Insights private workbook definition. + internal partial interface IMyWorkbookInternal : + 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. + [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 + /// + System.Collections.Generic.List PropertiesTag { get; set; } + /// Metadata describing a workbook for an Azure resource. + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookProperties Property { get; set; } + /// + /// Configuration of this particular private workbook. Configuration data is a string containing valid JSON + /// + string SerializedData { get; set; } + /// Optional resourceId for a source resource. + string SourceId { get; set; } + /// BYOS Storage Account URI + string StorageUri { get; set; } + /// Metadata pertaining to creation and last modification of the resource. + 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. + [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. + [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. + /// + string TimeModified { get; set; } + /// Unique user id of the specific user that owns this private workbook. + string UserId { get; set; } + /// + /// This instance's version of the data model. This can change as new features are added that can be marked private workbook. + /// + string Version { get; set; } + + } +} \ No newline at end of file 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/MyWorkbookError.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/MyWorkbookError.PowerShell.cs new file mode 100644 index 000000000000..a60482d9253a --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/MyWorkbookError.PowerShell.cs @@ -0,0 +1,188 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + + /// Error response. + [System.ComponentModel.TypeConverter(typeof(MyWorkbookErrorTypeConverter))] + public partial class MyWorkbookError + { + + /// + /// 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.IMyWorkbookError DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MyWorkbookError(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.IMyWorkbookError DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MyWorkbookError(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.IMyWorkbookError 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 MyWorkbookError(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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.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.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.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 . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MyWorkbookError(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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.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.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.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); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } + } + /// Error response. + [System.ComponentModel.TypeConverter(typeof(MyWorkbookErrorTypeConverter))] + public partial interface IMyWorkbookError + + { + + } +} \ No newline at end of file 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/MyWorkbookError.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/MyWorkbookError.cs new file mode 100644 index 000000000000..b2f2d98d3c41 --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/MyWorkbookError.cs @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + + /// Error response. + public partial class MyWorkbookError : + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookError, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookErrorInternal + { + + /// + /// Service specific error code which serves as the substatus for the HTTP error code. + /// + [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.IErrorDefinitionInternal)Error).Code; } + + /// Backing field for property. + 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.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.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.IErrorDefinitionInternal)Error).Message; } + + /// Internal Acessors for Code + 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.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.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.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() + { + + } + } + /// Error response. + public partial interface IMyWorkbookError : + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IJsonSerializable + { + /// + /// Service specific error code which serves as the substatus for the HTTP error code. + /// + [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) })] + string Code { get; } + /// Internal error details. + [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) })] + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IAny Innererror { 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) })] + string Message { get; } + + } + /// Error response. + internal partial interface IMyWorkbookErrorInternal + + { + /// + /// Service specific error code which serves as the substatus for the HTTP error code. + /// + string Code { get; set; } + /// The error details. + 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. + string Message { get; set; } + + } +} \ No newline at end of file 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/MyWorkbookManagedIdentity.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/MyWorkbookManagedIdentity.PowerShell.cs new file mode 100644 index 000000000000..ecbd5af43eb1 --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/MyWorkbookManagedIdentity.PowerShell.cs @@ -0,0 +1,188 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + + /// Customer Managed Identity + [System.ComponentModel.TypeConverter(typeof(MyWorkbookManagedIdentityTypeConverter))] + public partial class MyWorkbookManagedIdentity + { + + /// + /// 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.IMyWorkbookManagedIdentity DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MyWorkbookManagedIdentity(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.IMyWorkbookManagedIdentity DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MyWorkbookManagedIdentity(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.IMyWorkbookManagedIdentity 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 MyWorkbookManagedIdentity(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("UserAssignedIdentity")) + { + ((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.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.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.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 . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MyWorkbookManagedIdentity(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("UserAssignedIdentity")) + { + ((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.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.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.IMyWorkbookManagedIdentityInternal)this).UserAssignedIdentityTenantId = (string) content.GetValueForProperty("UserAssignedIdentityTenantId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookManagedIdentityInternal)this).UserAssignedIdentityTenantId, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } + } + /// Customer Managed Identity + [System.ComponentModel.TypeConverter(typeof(MyWorkbookManagedIdentityTypeConverter))] + public partial interface IMyWorkbookManagedIdentity + + { + + } +} \ No newline at end of file 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/MyWorkbookManagedIdentity.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/MyWorkbookManagedIdentity.cs new file mode 100644 index 000000000000..d8d32dd47937 --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/MyWorkbookManagedIdentity.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + + /// Customer Managed Identity + public partial class MyWorkbookManagedIdentity : + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookManagedIdentity, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookManagedIdentityInternal + { + + /// Internal Acessors for UserAssignedIdentity + 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.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.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; + + /// The identity type. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] + public string Type { get => this._type; set => this._type = value; } + + /// Backing field for property. + 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.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.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.IMyWorkbookUserAssignedIdentitiesInternal)UserAssignedIdentity).TenantId; } + + /// Creates an new instance. + public MyWorkbookManagedIdentity() + { + + } + } + /// Customer Managed Identity + public partial interface IMyWorkbookManagedIdentity : + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IJsonSerializable + { + /// The identity type. + [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) })] + string Type { get; set; } + /// The principal ID of resource identity. + [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) })] + string UserAssignedIdentityPrincipalId { get; } + /// The tenant ID of resource. + [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) })] + string UserAssignedIdentityTenantId { get; } + + } + /// Customer Managed Identity + internal partial interface IMyWorkbookManagedIdentityInternal + + { + /// The identity type. + string Type { get; set; } + /// Customer Managed Identity + 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. + string UserAssignedIdentityTenantId { get; set; } + + } +} \ No newline at end of file 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/MyWorkbookProperties.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/MyWorkbookProperties.PowerShell.cs new file mode 100644 index 000000000000..9de61b06486d --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/MyWorkbookProperties.PowerShell.cs @@ -0,0 +1,228 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + + /// Properties that contain a private workbook. + [System.ComponentModel.TypeConverter(typeof(MyWorkbookPropertiesTypeConverter))] + public partial class MyWorkbookProperties + { + + /// + /// 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.IMyWorkbookProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MyWorkbookProperties(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.IMyWorkbookProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MyWorkbookProperties(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.IMyWorkbookProperties 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 MyWorkbookProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("DisplayName")) + { + ((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.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.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.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.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.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.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.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.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 . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MyWorkbookProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("DisplayName")) + { + ((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.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.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.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.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.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.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.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.IMyWorkbookPropertiesInternal)this).StorageUri = (string) content.GetValueForProperty("StorageUri",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookPropertiesInternal)this).StorageUri, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } + } + /// Properties that contain a private workbook. + [System.ComponentModel.TypeConverter(typeof(MyWorkbookPropertiesTypeConverter))] + public partial interface IMyWorkbookProperties + + { + + } +} \ No newline at end of file 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/MyWorkbookResource.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/MyWorkbookResource.PowerShell.cs new file mode 100644 index 000000000000..a86fd080a542 --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/MyWorkbookResource.PowerShell.cs @@ -0,0 +1,244 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + + /// An azure resource object + [System.ComponentModel.TypeConverter(typeof(MyWorkbookResourceTypeConverter))] + public partial class MyWorkbookResource + { + + /// + /// 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.IMyWorkbookResource DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MyWorkbookResource(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.IMyWorkbookResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MyWorkbookResource(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.IMyWorkbookResource 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 MyWorkbookResource(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + 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("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); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MyWorkbookResource(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + 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("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); + } + 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 azure resource object + [System.ComponentModel.TypeConverter(typeof(MyWorkbookResourceTypeConverter))] + public partial interface IMyWorkbookResource + + { + + } +} \ No newline at end of file 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/MyWorkbookResource.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/MyWorkbookResource.cs new file mode 100644 index 000000000000..ff0914d9f9c0 --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/MyWorkbookResource.cs @@ -0,0 +1,238 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) 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; + + /// An azure resource object + public partial class MyWorkbookResource : + 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.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.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; + + /// Azure resource Id + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] + public string Id { get => this._id; set => this._id = value; } + + /// Backing field for property. + 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.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.IMyWorkbookManagedIdentityInternal)Identity).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookManagedIdentityInternal)Identity).Type = value ?? null; } + + /// Backing field for property. + private string _location; + + /// Resource location + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.FormatTable(Index = 3)] + public string Location { get => this._location; set => this._location = value; } + + /// Internal Acessors for Identity + 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.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.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.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; + + /// Azure resource name + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.FormatTable(Index = 1)] + public string Name { get => this._name; set => this._name = value; } + + /// Backing field for property. + 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.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; + + /// Azure resource type + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] + public string Type { get => this._type; set => this._type = 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.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.IMyWorkbookManagedIdentityInternal)Identity).UserAssignedIdentityTenantId; } + + /// Creates an new instance. + public MyWorkbookResource() + { + + } + } + /// An azure resource object + public partial interface IMyWorkbookResource : + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IJsonSerializable + { + /// 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(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) })] + string Id { get; set; } + /// The identity type. + [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) })] + string IdentityType { get; set; } + /// Resource location + [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) })] + string Location { get; set; } + /// Azure resource name + [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) })] + string Name { get; set; } + /// Resource tags + [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.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) })] + string Type { get; set; } + /// The principal ID of resource identity. + [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) })] + string UserAssignedIdentityPrincipalId { get; } + /// The tenant ID of resource. + [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) })] + string UserAssignedIdentityTenantId { get; } + + } + /// An azure resource object + internal partial interface IMyWorkbookResourceInternal + + { + /// Resource etag + 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.IMyWorkbookManagedIdentity Identity { get; set; } + /// The identity type. + string IdentityType { get; set; } + /// Customer Managed Identity + 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.IMyWorkbookResourceTags Tag { get; set; } + /// Azure resource type + string Type { get; set; } + /// The principal ID of resource identity. + string UserAssignedIdentityPrincipalId { get; set; } + /// The tenant ID of resource. + string UserAssignedIdentityTenantId { get; set; } + + } +} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/MyWorkbookResource.json.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/MyWorkbookResource.json.cs new file mode 100644 index 000000000000..f5df347ce00a --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/MyWorkbookResource.json.cs @@ -0,0 +1,132 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + + /// An azure resource object + public partial class MyWorkbookResource + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResource. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbookResource. + /// + 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; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject instance to deserialize from. + internal MyWorkbookResource(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_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); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._identity ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) this._identity.ToJson(null,serializationMode) : null, "identity" ,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); + return container; + } + } +} \ No newline at end of file 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/MyWorkbooksListResult.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/MyWorkbooksListResult.cs new file mode 100644 index 000000000000..c3417588668c --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/MyWorkbooksListResult.cs @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) 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; + + /// Workbook list result. + public partial class MyWorkbooksListResult : + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbooksListResult, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IMyWorkbooksListResultInternal + { + + /// Internal Acessors for 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; + + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] + public string NextLink { get => this._nextLink; set => this._nextLink = value; } + + /// Backing field for property. + 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 System.Collections.Generic.List Value { get => this._value; } + + /// Creates an new instance. + public MyWorkbooksListResult() + { + + } + } + /// Workbook list result. + public partial interface IMyWorkbooksListResult : + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IJsonSerializable + { + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"", + SerializedName = @"nextLink", + PossibleTypes = new [] { typeof(string) })] + string NextLink { get; set; } + /// An array of private workbooks. + [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.IMyWorkbook) })] + System.Collections.Generic.List Value { get; } + + } + /// Workbook list result. + internal partial interface IMyWorkbooksListResultInternal + + { + string NextLink { get; set; } + /// An array of private workbooks. + 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/Operation.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Operation.PowerShell.cs new file mode 100644 index 000000000000..fa7581ded062 --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Operation.PowerShell.cs @@ -0,0 +1,196 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + + /// Azure Workbooks REST API operation + [System.ComponentModel.TypeConverter(typeof(OperationTypeConverter))] + public partial class Operation + { + + /// + /// 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.IOperation DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new Operation(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.IOperation DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new Operation(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.IOperation 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 Operation(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Display")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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.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.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.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.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 . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal Operation(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Display")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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.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.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.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.IOperationInternal)this).DisplayOperation = (string) content.GetValueForProperty("DisplayOperation",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IOperationInternal)this).DisplayOperation, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } + } + /// Azure Workbooks REST API operation + [System.ComponentModel.TypeConverter(typeof(OperationTypeConverter))] + public partial interface IOperation + + { + + } +} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Operation.TypeConverter.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Operation.TypeConverter.cs new file mode 100644 index 000000000000..4ec6af2b2177 --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Operation.TypeConverter.cs @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class OperationTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.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.IOperation).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return Operation.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return Operation.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return Operation.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Operation.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Operation.cs new file mode 100644 index 000000000000..7283b02cf97e --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Operation.cs @@ -0,0 +1,117 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + + /// Azure Workbooks REST API operation + public partial class Operation : + 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.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.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.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.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.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.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; + + /// Operation name: {provider}/{resource}/{operation} + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public string Name { get => this._name; set => this._name = value; } + + /// Creates an new instance. + public Operation() + { + + } + } + /// Azure Workbooks REST API operation + public partial interface IOperation : + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IJsonSerializable + { + /// Operation type: Read, write, delete, etc. + [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) })] + string DisplayOperation { get; set; } + /// Service provider: Microsoft.Insights + [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) })] + string DisplayProvider { get; set; } + /// Resource on which the operation is performed: Profile, endpoint, etc. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"Resource on which the operation is performed: Profile, endpoint, etc.", + SerializedName = @"resource", + PossibleTypes = new [] { typeof(string) })] + string DisplayResource { get; set; } + /// Operation name: {provider}/{resource}/{operation} + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"Operation name: {provider}/{resource}/{operation}", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string Name { get; set; } + + } + /// Azure Workbooks REST API operation + internal partial interface IOperationInternal + + { + /// The object that represents the operation. + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IOperationDisplay Display { get; set; } + /// Operation type: Read, write, delete, etc. + string DisplayOperation { get; set; } + /// Service provider: Microsoft.Insights + string DisplayProvider { get; set; } + /// Resource on which the operation is performed: Profile, endpoint, etc. + string DisplayResource { get; set; } + /// Operation name: {provider}/{resource}/{operation} + string Name { get; set; } + + } +} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Operation.json.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Operation.json.cs new file mode 100644 index 000000000000..45a34567023f --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Operation.json.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + + /// Azure Workbooks REST API operation + public partial class Operation + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IOperation. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IOperation. + /// + 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; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject instance to deserialize from. + internal Operation(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_display = If( json?.PropertyT("display"), out var __jsonDisplay) ? Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.OperationDisplay.FromJson(__jsonDisplay) : _display;} + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)_name;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._display ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) this._display.ToJson(null,serializationMode) : null, "display" ,container.Add ); + AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/OperationDisplay.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/OperationDisplay.PowerShell.cs new file mode 100644 index 000000000000..a64fe19dead6 --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/OperationDisplay.PowerShell.cs @@ -0,0 +1,180 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + + /// The object that represents the operation. + [System.ComponentModel.TypeConverter(typeof(OperationDisplayTypeConverter))] + public partial class OperationDisplay + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IOperationDisplay DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new OperationDisplay(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IOperationDisplay DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new OperationDisplay(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IOperationDisplay FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal OperationDisplay(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Provider")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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.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.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 . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal OperationDisplay(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Provider")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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.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.IOperationDisplayInternal)this).Operation = (string) content.GetValueForProperty("Operation",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IOperationDisplayInternal)this).Operation, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } + } + /// The object that represents the operation. + [System.ComponentModel.TypeConverter(typeof(OperationDisplayTypeConverter))] + public partial interface IOperationDisplay + + { + + } +} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/OperationDisplay.TypeConverter.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/OperationDisplay.TypeConverter.cs new file mode 100644 index 000000000000..8b5fddb1f321 --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/OperationDisplay.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class OperationDisplayTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.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.IOperationDisplay).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return OperationDisplay.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return OperationDisplay.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return OperationDisplay.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/OperationDisplay.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/OperationDisplay.cs new file mode 100644 index 000000000000..400096df4c46 --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/OperationDisplay.cs @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.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.IOperationDisplay, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IOperationDisplayInternal + { + + /// Backing field for property. + private string _operation; + + /// Operation type: Read, write, delete, etc. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public string Operation { get => this._operation; set => this._operation = value; } + + /// Backing field for property. + private string _provider; + + /// Service provider: Microsoft.Insights + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public string Provider { get => this._provider; set => this._provider = value; } + + /// Backing field for property. + private string _resource; + + /// Resource on which the operation is performed: Profile, endpoint, etc. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public string Resource { get => this._resource; set => this._resource = value; } + + /// Creates an new instance. + public OperationDisplay() + { + + } + } + /// The object that represents the operation. + public partial interface IOperationDisplay : + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IJsonSerializable + { + /// Operation type: Read, write, delete, etc. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"Operation type: Read, write, delete, etc.", + SerializedName = @"operation", + PossibleTypes = new [] { typeof(string) })] + string Operation { get; set; } + /// Service provider: Microsoft.Insights + [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) })] + string Provider { get; set; } + /// Resource on which the operation is performed: Profile, endpoint, etc. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"Resource on which the operation is performed: Profile, endpoint, etc.", + SerializedName = @"resource", + PossibleTypes = new [] { typeof(string) })] + string Resource { get; set; } + + } + /// The object that represents the operation. + internal partial interface IOperationDisplayInternal + + { + /// Operation type: Read, write, delete, etc. + string Operation { get; set; } + /// Service provider: Microsoft.Insights + string Provider { get; set; } + /// Resource on which the operation is performed: Profile, endpoint, etc. + string Resource { get; set; } + + } +} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/OperationDisplay.json.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/OperationDisplay.json.cs new file mode 100644 index 000000000000..f538102c53e0 --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/OperationDisplay.json.cs @@ -0,0 +1,112 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + + /// The object that represents the operation. + public partial class OperationDisplay + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IOperationDisplay. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IOperationDisplay. + /// + 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; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject instance to deserialize from. + internal OperationDisplay(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_provider = If( json?.PropertyT("provider"), out var __jsonProvider) ? (string)__jsonProvider : (string)_provider;} + {_resource = If( json?.PropertyT("resource"), out var __jsonResource) ? (string)__jsonResource : (string)_resource;} + {_operation = If( json?.PropertyT("operation"), out var __jsonOperation) ? (string)__jsonOperation : (string)_operation;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._provider)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(this._provider.ToString()) : null, "provider" ,container.Add ); + AddIf( null != (((object)this._resource)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(this._resource.ToString()) : null, "resource" ,container.Add ); + AddIf( null != (((object)this._operation)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(this._operation.ToString()) : null, "operation" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/OperationListResult.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/OperationListResult.PowerShell.cs new file mode 100644 index 000000000000..0c8299e2963e --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/OperationListResult.PowerShell.cs @@ -0,0 +1,176 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + + /// + /// Result of the request to list Azure Workbooks operations. It contains a list of operations and a URL link to get the next + /// set of results. + /// + [System.ComponentModel.TypeConverter(typeof(OperationListResultTypeConverter))] + public partial class OperationListResult + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IOperationListResult DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new OperationListResult(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IOperationListResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new OperationListResult(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IOperationListResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal OperationListResult(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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.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 . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal OperationListResult(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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.IOperationListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IOperationListResultInternal)this).NextLink, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } + } + /// Result of the request to list Azure Workbooks operations. It contains a list of operations and a URL link to get the next + /// set of results. + [System.ComponentModel.TypeConverter(typeof(OperationListResultTypeConverter))] + public partial interface IOperationListResult + + { + + } +} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/OperationListResult.TypeConverter.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/OperationListResult.TypeConverter.cs new file mode 100644 index 000000000000..f06ced469e00 --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/OperationListResult.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class OperationListResultTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.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.IOperationListResult).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return OperationListResult.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return OperationListResult.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return OperationListResult.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/OperationListResult.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/OperationListResult.cs new file mode 100644 index 000000000000..b7edd99e0f89 --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/OperationListResult.cs @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + + /// + /// Result of the request to list Azure Workbooks operations. It contains a list of operations and a URL link to get the next + /// set of results. + /// + public partial class OperationListResult : + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IOperationListResult, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IOperationListResultInternal + { + + /// Backing field for property. + private string _nextLink; + + /// URL to get the next set of operation list results if there are any. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; set => this._nextLink = value; } + + /// Backing field for property. + private 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 System.Collections.Generic.List Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public OperationListResult() + { + + } + } + /// Result of the request to list Azure Workbooks operations. It contains a list of operations and a URL link to get the next + /// set of results. + public partial interface IOperationListResult : + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IJsonSerializable + { + /// URL to get the next set of operation list results if there are any. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + 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) })] + string NextLink { get; set; } + /// + /// List of Workbook operations supported by the Microsoft.Insights resource provider. + /// + [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.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 + /// set of results. + internal partial interface IOperationListResultInternal + + { + /// URL to get the next set of operation list results if there are any. + string NextLink { get; set; } + /// + /// List of Workbook operations supported by the Microsoft.Insights resource provider. + /// + System.Collections.Generic.List Value { get; set; } + + } +} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/OperationListResult.json.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/OperationListResult.json.cs new file mode 100644 index 000000000000..bfe2fbac1c93 --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/OperationListResult.json.cs @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + + /// + /// Result of the request to list Azure Workbooks operations. It contains a list of operations and a URL link to get the next + /// set of results. + /// + public partial class OperationListResult + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IOperationListResult. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IOperationListResult. + /// + 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; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject instance to deserialize from. + internal OperationListResult(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonArray, out var __v) ? new global::System.Func>(()=> global::System.Linq.Enumerable.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); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/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/ProxyResource.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ProxyResource.cs new file mode 100644 index 000000000000..fd7d7dda1e96 --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/ProxyResource.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + + /// + /// The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location + /// + public partial class ProxyResource : + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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.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.IResourceInternal)__resource).Id; } + + /// Internal Acessors for Id + 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.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.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.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.IResourceInternal)__resource).Type; } + + /// Creates an new instance. + public ProxyResource() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__resource), __resource); + await eventListener.AssertObjectIsValid(nameof(__resource), __resource); + } + } + /// The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location + public partial interface IProxyResource : + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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.IResourceInternal + { + + } +} \ No newline at end of file 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/Resource.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Resource.PowerShell.cs new file mode 100644 index 000000000000..27dde34898ee --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Resource.PowerShell.cs @@ -0,0 +1,182 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) 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; + + /// + /// Common fields that are returned in the response for all Azure Resource Manager resources + /// + [System.ComponentModel.TypeConverter(typeof(ResourceTypeConverter))] + public partial class Resource + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IResource DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new Resource(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new Resource(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal Resource(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal Resource(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } + } + /// Common fields that are returned in the response for all Azure Resource Manager resources + [System.ComponentModel.TypeConverter(typeof(ResourceTypeConverter))] + public partial interface IResource + + { + + } +} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Resource.TypeConverter.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Resource.TypeConverter.cs new file mode 100644 index 000000000000..2b91ff27b820 --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Resource.TypeConverter.cs @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ResourceTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.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.IResource).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return Resource.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return Resource.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return Resource.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Resource.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Resource.cs new file mode 100644 index 000000000000..2cf77f359085 --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Resource.cs @@ -0,0 +1,117 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + + /// + /// Common fields that are returned in the response for all Azure Resource Manager resources + /// + public partial class Resource : + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IResource, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IResourceInternal + { + + /// Backing field for property. + private string _id; + + /// + /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public string Id { get => this._id; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IResourceInternal.Id { get => this._id; set { {_id = value;} } } + + /// Internal Acessors for Name + 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.IResourceInternal.Type { get => this._type; set { {_type = value;} } } + + /// Backing field for property. + private string _name; + + /// The name of the resource + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public string Name { get => this._name; } + + /// Backing field for property. + private string _type; + + /// + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + /// + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public string Type { get => this._type; } + + /// Creates an new instance. + public Resource() + { + + } + } + /// Common fields that are returned in the response for all Azure Resource Manager resources + public partial interface IResource : + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IJsonSerializable + { + /// + /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = true, + 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) })] + string Id { get; } + /// The name of the resource + [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) })] + string Name { get; } + /// + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + /// + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = true, + 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) })] + string Type { get; } + + } + /// Common fields that are returned in the response for all Azure Resource Manager resources + internal partial interface IResourceInternal + + { + /// + /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// + string Id { get; set; } + /// The name of the resource + string Name { get; set; } + /// + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + /// + string Type { get; set; } + + } +} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Resource.json.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Resource.json.cs new file mode 100644 index 000000000000..d7bc56b4675d --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Resource.json.cs @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + + /// + /// Common fields that are returned in the response for all Azure Resource Manager resources + /// + public partial class Resource + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IResource. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IResource. + /// + 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; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject instance to deserialize from. + internal Resource(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)_id;} + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)_name;} + {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)_type;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.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.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.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 ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/SystemData.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/SystemData.PowerShell.cs new file mode 100644 index 000000000000..a34f815b3edd --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/SystemData.PowerShell.cs @@ -0,0 +1,204 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + + /// Metadata pertaining to creation and last modification of the resource. + [System.ComponentModel.TypeConverter(typeof(SystemDataTypeConverter))] + public partial class SystemData + { + + /// + /// 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.ISystemData DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new SystemData(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.ISystemData DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new SystemData(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.ISystemData 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 SystemData(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("CreatedBy")) + { + ((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.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.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.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.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.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 . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal SystemData(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("CreatedBy")) + { + ((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.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.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.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.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.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); + } + + /// 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(); + } + } + /// Metadata pertaining to creation and last modification of the resource. + [System.ComponentModel.TypeConverter(typeof(SystemDataTypeConverter))] + public partial interface ISystemData + + { + + } +} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/SystemData.TypeConverter.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/SystemData.TypeConverter.cs new file mode 100644 index 000000000000..4668400de2af --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/SystemData.TypeConverter.cs @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class SystemDataTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.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.ISystemData).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return SystemData.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return SystemData.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return SystemData.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/SystemData.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/SystemData.cs new file mode 100644 index 000000000000..45b1daa651f1 --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/SystemData.cs @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models +{ + 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.ISystemData, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ISystemDataInternal + { + + /// Backing field for property. + private global::System.DateTime? _createdAt; + + /// The timestamp of resource creation (UTC). + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public global::System.DateTime? CreatedAt { get => this._createdAt; set => this._createdAt = value; } + + /// Backing field for property. + private string _createdBy; + + /// The identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public string CreatedBy { get => this._createdBy; set => this._createdBy = value; } + + /// Backing field for property. + 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 string CreatedByType { get => this._createdByType; set => this._createdByType = value; } + + /// Backing field for property. + private global::System.DateTime? _lastModifiedAt; + + /// The timestamp of resource last modification (UTC) + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public global::System.DateTime? LastModifiedAt { get => this._lastModifiedAt; set => this._lastModifiedAt = value; } + + /// Backing field for property. + private string _lastModifiedBy; + + /// The identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public string LastModifiedBy { get => this._lastModifiedBy; set => this._lastModifiedBy = value; } + + /// Backing field for property. + 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 string LastModifiedByType { get => this._lastModifiedByType; set => this._lastModifiedByType = value; } + + /// Creates an new instance. + public SystemData() + { + + } + } + /// Metadata pertaining to creation and last modification of the resource. + public partial interface ISystemData : + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IJsonSerializable + { + /// The timestamp of resource creation (UTC). + [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) })] + global::System.DateTime? CreatedAt { get; set; } + /// The identity that created the resource. + [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) })] + string CreatedBy { get; set; } + /// The type of identity that created the resource. + [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(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) })] + global::System.DateTime? LastModifiedAt { get; set; } + /// The identity that last modified the resource. + [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) })] + string LastModifiedBy { get; set; } + /// The type of identity that last modified the resource. + [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(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. + internal partial interface ISystemDataInternal + + { + /// The timestamp of resource creation (UTC). + global::System.DateTime? CreatedAt { get; set; } + /// The identity that created the resource. + string CreatedBy { get; set; } + /// The type of identity that created the resource. + [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. + [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/SystemData.json.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/SystemData.json.cs new file mode 100644 index 000000000000..3796fbca2581 --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/SystemData.json.cs @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + + /// Metadata pertaining to creation and last modification of the resource. + public partial class SystemData + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ISystemData. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ISystemData. + /// + 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; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject instance to deserialize from. + internal SystemData(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_createdBy = If( json?.PropertyT("createdBy"), out var __jsonCreatedBy) ? (string)__jsonCreatedBy : (string)_createdBy;} + {_createdByType = If( json?.PropertyT("createdByType"), out var __jsonCreatedByType) ? (string)__jsonCreatedByType : (string)_createdByType;} + {_createdAt = If( json?.PropertyT("createdAt"), out var __jsonCreatedAt) ? global::System.DateTime.TryParse((string)__jsonCreatedAt, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonCreatedAtValue) ? __jsonCreatedAtValue : _createdAt : _createdAt;} + {_lastModifiedBy = If( json?.PropertyT("lastModifiedBy"), out var __jsonLastModifiedBy) ? (string)__jsonLastModifiedBy : (string)_lastModifiedBy;} + {_lastModifiedByType = If( json?.PropertyT("lastModifiedByType"), out var __jsonLastModifiedByType) ? (string)__jsonLastModifiedByType : (string)_lastModifiedByType;} + {_lastModifiedAt = If( json?.PropertyT("lastModifiedAt"), out var __jsonLastModifiedAt) ? global::System.DateTime.TryParse((string)__jsonLastModifiedAt, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonLastModifiedAtValue) ? __jsonLastModifiedAtValue : _lastModifiedAt : _lastModifiedAt;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._createdBy)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(this._createdBy.ToString()) : null, "createdBy" ,container.Add ); + AddIf( null != (((object)this._createdByType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(this._createdByType.ToString()) : null, "createdByType" ,container.Add ); + AddIf( null != this._createdAt ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(this._createdAt?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "createdAt" ,container.Add ); + AddIf( null != (((object)this._lastModifiedBy)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(this._lastModifiedBy.ToString()) : null, "lastModifiedBy" ,container.Add ); + AddIf( null != (((object)this._lastModifiedByType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(this._lastModifiedByType.ToString()) : null, "lastModifiedByType" ,container.Add ); + AddIf( null != this._lastModifiedAt ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonString(this._lastModifiedAt?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "lastModifiedAt" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/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/TrackedResource.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/TrackedResource.PowerShell.cs new file mode 100644 index 000000000000..b47ee4d4d96c --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/TrackedResource.PowerShell.cs @@ -0,0 +1,198 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + + /// + /// The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location' + /// + [System.ComponentModel.TypeConverter(typeof(TrackedResourceTypeConverter))] + public partial class TrackedResource + { + + /// + /// 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.ITrackedResource DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new TrackedResource(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.ITrackedResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new TrackedResource(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.ITrackedResource 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 TrackedResource(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + 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("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); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal TrackedResource(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + 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("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); + } + AfterDeserializePSObject(content); + } + } + /// The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location' + [System.ComponentModel.TypeConverter(typeof(TrackedResourceTypeConverter))] + public partial interface ITrackedResource + + { + + } +} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/TrackedResource.TypeConverter.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/TrackedResource.TypeConverter.cs new file mode 100644 index 000000000000..776beb6f406f --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/TrackedResource.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class TrackedResourceTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.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.ITrackedResource).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return TrackedResource.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return TrackedResource.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return TrackedResource.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/TrackedResource.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/TrackedResource.cs new file mode 100644 index 000000000000..555b0da2354b --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/TrackedResource.cs @@ -0,0 +1,120 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + + /// + /// 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.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.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.IResourceInternal)__resource).Id; } + + /// Backing field for property. + private string _location; + + /// The geo-location where the resource lives + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public string Location { get => this._location; set => this._location = value; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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.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.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.IResourceInternal)__resource).Name; } + + /// Backing field for property. + 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.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.IResourceInternal)__resource).Type; } + + /// Creates an new instance. + public TrackedResource() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__resource), __resource); + await eventListener.AssertObjectIsValid(nameof(__resource), __resource); + } + } + /// The resource model definition for 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.IResource + { + /// The geo-location where the resource lives + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The geo-location where the resource lives", + SerializedName = @"location", + PossibleTypes = new [] { typeof(string) })] + string Location { get; set; } + /// Resource tags. + [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.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.IResourceInternal + { + /// The geo-location where the resource lives + string Location { get; set; } + /// Resource tags. + 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/TrackedResource.json.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/TrackedResource.json.cs new file mode 100644 index 000000000000..002f63a9d4ab --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/TrackedResource.json.cs @@ -0,0 +1,117 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + + /// + /// The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location' + /// + public partial class TrackedResource + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ITrackedResource. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ITrackedResource. + /// + 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; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __resource?.ToJson(container, serializationMode); + AddIf( null != this._tag ? (Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode) this._tag.ToJson(null,serializationMode) : null, "tags" ,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; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject instance to deserialize from. + internal TrackedResource(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __resource = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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); + } + } +} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/TrackedResourceTags.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/TrackedResourceTags.PowerShell.cs new file mode 100644 index 000000000000..80fb0b76cfea --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/TrackedResourceTags.PowerShell.cs @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + + /// Resource tags. + [System.ComponentModel.TypeConverter(typeof(TrackedResourceTagsTypeConverter))] + public partial class TrackedResourceTags + { + + /// + /// 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.ITrackedResourceTags DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new TrackedResourceTags(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.ITrackedResourceTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new TrackedResourceTags(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.ITrackedResourceTags 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 TrackedResourceTags(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal TrackedResourceTags(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializePSObject(content); + } + } + /// Resource tags. + [System.ComponentModel.TypeConverter(typeof(TrackedResourceTagsTypeConverter))] + public partial interface ITrackedResourceTags + + { + + } +} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/TrackedResourceTags.TypeConverter.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/TrackedResourceTags.TypeConverter.cs new file mode 100644 index 000000000000..2d682e11ae4d --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/TrackedResourceTags.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class TrackedResourceTagsTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.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.ITrackedResourceTags).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return TrackedResourceTags.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return TrackedResourceTags.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return TrackedResourceTags.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/TrackedResourceTags.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/TrackedResourceTags.cs new file mode 100644 index 000000000000..eb2ec6becb6b --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/TrackedResourceTags.cs @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + + /// Resource tags. + public partial class TrackedResourceTags : + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ITrackedResourceTags, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ITrackedResourceTagsInternal + { + + /// Creates an new instance. + public TrackedResourceTags() + { + + } + } + /// Resource tags. + public partial interface ITrackedResourceTags : + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IAssociativeArray + { + + } + /// Resource tags. + internal partial interface ITrackedResourceTagsInternal + + { + + } +} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/TrackedResourceTags.dictionary.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/TrackedResourceTags.dictionary.cs new file mode 100644 index 000000000000..2b2c7b62223d --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/TrackedResourceTags.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 TrackedResourceTags : + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IAssociativeArray + { + protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); + + global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; } + + int Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IAssociativeArray.Values { get => __additionalProperties.Values; } + + public string this[global::System.String index] { get => __additionalProperties[index]; set => __additionalProperties[index] = value; } + + /// + /// + public void Add(global::System.String key, string value) => __additionalProperties.Add( key, value); + + public void Clear() => __additionalProperties.Clear(); + + /// + public bool ContainsKey(global::System.String key) => __additionalProperties.ContainsKey( key); + + /// + public void CopyFrom(global::System.Collections.IDictionary source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public void CopyFrom(global::System.Management.Automation.PSObject source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public bool Remove(global::System.String key) => __additionalProperties.Remove( key); + + /// + /// + public bool TryGetValue(global::System.String key, out string value) => __additionalProperties.TryGetValue( key, out value); + + /// + + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.TrackedResourceTags source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/TrackedResourceTags.json.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/TrackedResourceTags.json.cs new file mode 100644 index 000000000000..8583da1704e2 --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/TrackedResourceTags.json.cs @@ -0,0 +1,109 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + + /// Resource tags. + public partial class TrackedResourceTags + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ITrackedResourceTags. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ITrackedResourceTags. + /// + 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; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IAssociativeArray)this).AdditionalProperties, container); + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject instance to deserialize from. + /// + internal TrackedResourceTags(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IAssociativeArray)this).AdditionalProperties, null ,exclusions ); + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/UserAssignedIdentities.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/UserAssignedIdentities.PowerShell.cs new file mode 100644 index 000000000000..47f35e45363f --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/UserAssignedIdentities.PowerShell.cs @@ -0,0 +1,166 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + + /// + /// 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. + /// + [System.ComponentModel.TypeConverter(typeof(UserAssignedIdentitiesTypeConverter))] + public partial class UserAssignedIdentities + { + + /// + /// 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.IUserAssignedIdentities DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new UserAssignedIdentities(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.IUserAssignedIdentities DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new UserAssignedIdentities(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.IUserAssignedIdentities 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 UserAssignedIdentities(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal UserAssignedIdentities(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializePSObject(content); + } + } + /// 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. + [System.ComponentModel.TypeConverter(typeof(UserAssignedIdentitiesTypeConverter))] + public partial interface IUserAssignedIdentities + + { + + } +} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/UserAssignedIdentities.TypeConverter.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/UserAssignedIdentities.TypeConverter.cs new file mode 100644 index 000000000000..2e4b38b3ae6b --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/UserAssignedIdentities.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class UserAssignedIdentitiesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.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.IUserAssignedIdentities).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return UserAssignedIdentities.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return UserAssignedIdentities.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return UserAssignedIdentities.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/UserAssignedIdentities.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/UserAssignedIdentities.cs new file mode 100644 index 000000000000..2d5c45711511 --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/UserAssignedIdentities.cs @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + + /// + /// 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. + /// + public partial class UserAssignedIdentities : + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IUserAssignedIdentities, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IUserAssignedIdentitiesInternal + { + + /// Creates an new instance. + public UserAssignedIdentities() + { + + } + } + /// 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. + public partial interface IUserAssignedIdentities : + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IAssociativeArray + { + + } + /// 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. + internal partial interface IUserAssignedIdentitiesInternal + + { + + } +} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/UserAssignedIdentities.dictionary.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/UserAssignedIdentities.dictionary.cs new file mode 100644 index 000000000000..5532e5787d30 --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/UserAssignedIdentities.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 UserAssignedIdentities : + 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.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.IUserAssignedIdentity 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.IUserAssignedIdentity value) => __additionalProperties.TryGetValue( key, out value); + + /// + + 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/UserAssignedIdentities.json.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/UserAssignedIdentities.json.cs new file mode 100644 index 000000000000..5b7a9211c3b1 --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/UserAssignedIdentities.json.cs @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + + /// + /// 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. + /// + public partial class UserAssignedIdentities + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IUserAssignedIdentities. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IUserAssignedIdentities. + /// + 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; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IAssociativeArray)this).AdditionalProperties, container); + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject instance to deserialize from. + /// + internal UserAssignedIdentities(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IAssociativeArray)this).AdditionalProperties, (j) => Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.UserAssignedIdentity.FromJson(j) ,exclusions ); + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/UserAssignedIdentity.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/UserAssignedIdentity.PowerShell.cs new file mode 100644 index 000000000000..152f2842cd76 --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/UserAssignedIdentity.PowerShell.cs @@ -0,0 +1,172 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + + /// User assigned identity properties + [System.ComponentModel.TypeConverter(typeof(UserAssignedIdentityTypeConverter))] + public partial class UserAssignedIdentity + { + + /// + /// 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.IUserAssignedIdentity DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new UserAssignedIdentity(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.IUserAssignedIdentity DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new UserAssignedIdentity(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.IUserAssignedIdentity 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 UserAssignedIdentity(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("PrincipalId")) + { + ((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.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 . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal UserAssignedIdentity(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("PrincipalId")) + { + ((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.IUserAssignedIdentityInternal)this).ClientId = (string) content.GetValueForProperty("ClientId",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IUserAssignedIdentityInternal)this).ClientId, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + } + /// User assigned identity properties + [System.ComponentModel.TypeConverter(typeof(UserAssignedIdentityTypeConverter))] + public partial interface IUserAssignedIdentity + + { + + } +} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/UserAssignedIdentity.TypeConverter.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/UserAssignedIdentity.TypeConverter.cs new file mode 100644 index 000000000000..d4f55bbb08fe --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/UserAssignedIdentity.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class UserAssignedIdentityTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.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.IUserAssignedIdentity).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return UserAssignedIdentity.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return UserAssignedIdentity.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return UserAssignedIdentity.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/UserAssignedIdentity.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/UserAssignedIdentity.cs new file mode 100644 index 000000000000..75ea4f313976 --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/UserAssignedIdentity.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + + /// User assigned identity properties + public partial class UserAssignedIdentity : + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IUserAssignedIdentity, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IUserAssignedIdentityInternal + { + + /// Backing field for property. + private string _clientId; + + /// The client ID of the assigned identity. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public string ClientId { get => this._clientId; } + + /// Internal Acessors for ClientId + 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.IUserAssignedIdentityInternal.PrincipalId { get => this._principalId; set { {_principalId = value;} } } + + /// Backing field for property. + private string _principalId; + + /// The principal ID of the assigned identity. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public string PrincipalId { get => this._principalId; } + + /// Creates an new instance. + public UserAssignedIdentity() + { + + } + } + /// User assigned identity properties + public partial interface IUserAssignedIdentity : + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IJsonSerializable + { + /// The client ID of the assigned identity. + [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) })] + string ClientId { get; } + /// The principal ID of the assigned identity. + [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) })] + string PrincipalId { get; } + + } + /// User assigned identity properties + internal partial interface IUserAssignedIdentityInternal + + { + /// The client ID of the assigned identity. + string ClientId { get; set; } + /// The principal ID of the assigned identity. + string PrincipalId { get; set; } + + } +} \ No newline at end of file diff --git a/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/UserAssignedIdentity.json.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/UserAssignedIdentity.json.cs new file mode 100644 index 000000000000..4017e3d62afa --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/UserAssignedIdentity.json.cs @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + + /// User assigned identity properties + public partial class UserAssignedIdentity + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IUserAssignedIdentity. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IUserAssignedIdentity. + /// + 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; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.SerializationMode.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.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 ); + } + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject instance to deserialize from. + internal UserAssignedIdentity(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_principalId = If( json?.PropertyT("principalId"), out var __jsonPrincipalId) ? (string)__jsonPrincipalId : (string)_principalId;} + {_clientId = If( json?.PropertyT("clientId"), out var __jsonClientId) ? (string)__jsonClientId : (string)_clientId;} + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/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/WebTest.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WebTest.cs new file mode 100644 index 000000000000..ddbcf71905d0 --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WebTest.cs @@ -0,0 +1,624 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) 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; + + /// An Application Insights WebTest definition. + public partial class WebTest : + 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.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.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.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.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 + /// is a match + /// + [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.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.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.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.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.IWebtestsResourceInternal)__webtestsResource).Id; } + + /// Backing field for property. + 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 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.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.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.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.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.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.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.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.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.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.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.IWebtestsResourceInternal)__webtestsResource).Name; } + + /// Backing field for 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.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 + /// 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)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] + 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.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.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 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.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.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.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)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] + public string ResourceGroupName { get => (new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Success ? new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Groups["resourceGroupName"].Value : null); } + + /// Allow for retries should this WebTest fail. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] + 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.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.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.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.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.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.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 + /// must be set to true. + /// + [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.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.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 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.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 + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__webtestsResource), __webtestsResource); + await eventListener.AssertObjectIsValid(nameof(__webtestsResource), __webtestsResource); + } + + /// Creates an new instance. + public WebTest() + { + + } + } + /// An Application Insights WebTest definition. + public partial interface IWebTest : + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IJsonSerializable, + 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) })] + string ConfigurationWebTest { get; set; } + /// Content to look for in the return of the WebTest. Must not be null or empty. + [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) })] + string ContentValidationContentMatch { get; set; } + /// When set, this value makes the ContentMatch validation case insensitive. + [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) })] + bool? ContentValidationIgnoreCase { get; set; } + /// + /// 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.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) })] + bool? ContentValidationPassIfTextFound { get; set; } + /// User defined description for this WebTest. + [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) })] + string Description { get; set; } + /// Is the test actively being monitored. + [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) })] + bool? Enabled { get; set; } + /// Interval in seconds between test runs for this WebTest. Default value is 300. + [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) })] + int? Frequency { get; set; } + /// + /// The kind of WebTest that this web test watches. Choices are ping, multistep and standard. + /// + [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(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.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. + /// + [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) })] + string ProvisioningState { get; } + /// Base64 encoded string body to send with this web test. + [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) })] + string RequestBody { get; set; } + /// Follow redirects for this web test. + [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) })] + bool? RequestFollowRedirect { get; set; } + /// List of headers and their values to add to the WebTest call. + [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.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) })] + string RequestHttpVerb { get; set; } + /// Parse Dependent request for this WebTest. + [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) })] + bool? RequestParseDependentRequest { get; set; } + /// Url location to test. + [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) })] + string RequestUrl { get; set; } + /// Allow for retries should this WebTest fail. + [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) })] + bool? RetryEnabled { get; set; } + /// Unique ID of this WebTest. This is typically the same value as the Name field. + [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) })] + string SyntheticMonitorId { get; set; } + /// Seconds until this WebTest will timeout and fail. Default value is 30. + [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) })] + int? Timeout { get; set; } + /// Validate that the WebTest returns the http status code provided. + [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) })] + int? ValidationRuleExpectedHttpStatusCode { get; set; } + /// When set, validation will ignore the status code. + [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) })] + bool? ValidationRuleIgnoreHttpsStatusCode { get; set; } + /// + /// 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.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) })] + int? ValidationRuleSslCertRemainingLifetimeCheck { get; set; } + /// Checks to see if the SSL cert is still valid. + [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) })] + bool? ValidationRuleSslCheck { get; set; } + /// The kind of web test this is, valid choices are ping, multistep, and standard. + [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(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) })] + string WebTestName { get; set; } + + } + /// An Application Insights WebTest definition. + internal partial interface IWebTestInternal : + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebtestsResourceInternal + { + /// An XML configuration specification for a WebTest. + 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. + string ContentValidationContentMatch { get; set; } + /// When set, this value makes the ContentMatch validation case insensitive. + bool? ContentValidationIgnoreCase { get; set; } + /// + /// When true, validation will pass if there is a match for the ContentMatch string. If false, validation will fail if there + /// is a match + /// + bool? ContentValidationPassIfTextFound { get; set; } + /// User defined description for this WebTest. + string Description { get; set; } + /// Is the test actively being monitored. + bool? Enabled { get; set; } + /// Interval in seconds between test runs for this WebTest. Default value is 300. + int? Frequency { get; set; } + /// + /// The kind of WebTest that this web test watches. Choices are ping, multistep and standard. + /// + [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. + /// + System.Collections.Generic.List Locations { get; set; } + /// Metadata describing a web test for an Azure resource. + 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.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. + 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. + bool? RequestParseDependentRequest { get; set; } + /// Url location to test. + string RequestUrl { get; set; } + /// Allow for retries should this WebTest fail. + bool? RetryEnabled { get; set; } + /// Unique ID of this WebTest. This is typically the same value as the Name field. + string SyntheticMonitorId { get; set; } + /// 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.IWebTestPropertiesValidationRules ValidationRule { get; set; } + /// The collection of content validation properties + 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. + bool? ValidationRuleIgnoreHttpsStatusCode { get; set; } + /// + /// 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. + /// + int? ValidationRuleSslCertRemainingLifetimeCheck { get; set; } + /// 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. + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PSArgumentCompleterAttribute("ping", "multistep", "standard")] + string WebTestKind { get; set; } + /// User defined name if this WebTest. + string WebTestName { get; set; } + + } +} \ No newline at end of file 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/WebTestProperties.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WebTestProperties.cs new file mode 100644 index 000000000000..0f19e6a1a277 --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WebTestProperties.cs @@ -0,0 +1,551 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) 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; + + /// Metadata describing a web test for an Azure resource. + public partial class WebTestProperties : + 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.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.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.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.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.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.IWebTestPropertiesValidationRulesInternal)ValidationRule).ContentValidationPassIfTextFound; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesValidationRulesInternal)ValidationRule).ContentValidationPassIfTextFound = value ?? default(bool); } + + /// Backing field for property. + private string _description; + + /// User defined description for this WebTest. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public string Description { get => this._description; set => this._description = value; } + + /// Backing field for property. + private bool? _enabled; + + /// Is the test actively being monitored. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public bool? Enabled { get => this._enabled; set => this._enabled = value; } + + /// Backing field for property. + private int? _frequency; + + /// 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.Owned)] + public int? Frequency { get => this._frequency; set => this._frequency = value; } + + /// Backing field for property. + 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 System.Collections.Generic.List Location { get => this._location; set => this._location = value; } + + /// Internal Acessors for Configuration + 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.IWebTestPropertiesInternal.ProvisioningState { get => this._provisioningState; set { {_provisioningState = value;} } } + + /// Internal Acessors for Request + 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.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.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; + + /// + /// Current state of this component, whether or not is has been provisioned within the resource group it is defined. Users + /// cannot change this value but are able to read from it. Values will include Succeeded, Deploying, Canceled, and Failed. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public string ProvisioningState { get => this._provisioningState; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.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.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.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.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 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.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.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.IWebTestPropertiesRequestInternal)Request).RequestUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesRequestInternal)Request).RequestUrl = value ?? null; } + + /// Backing field for property. + private bool? _retryEnabled; + + /// Allow for retries should this WebTest fail. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public bool? RetryEnabled { get => this._retryEnabled; set => this._retryEnabled = value; } + + /// Backing field for property. + private string _syntheticMonitorId; + + /// 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.Owned)] + public string SyntheticMonitorId { get => this._syntheticMonitorId; set => this._syntheticMonitorId = value; } + + /// Backing field for property. + private int? _timeout; + + /// Seconds until this WebTest will timeout and fail. Default value is 30. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public int? Timeout { get => this._timeout; set => this._timeout = value; } + + /// Backing field for property. + 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.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.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.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.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.IWebTestPropertiesValidationRulesInternal)ValidationRule).SslCheck; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWebTestPropertiesValidationRulesInternal)ValidationRule).SslCheck = value ?? default(bool); } + + /// Backing field for property. + 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 string WebTestKind { get => this._webTestKind; set => this._webTestKind = value; } + + /// Backing field for property. + private string _webTestName; + + /// User defined name if this WebTest. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + public string WebTestName { get => this._webTestName; set => this._webTestName = value; } + + /// Creates an new instance. + public WebTestProperties() + { + + } + } + /// Metadata describing a web test for an Azure resource. + public partial interface IWebTestProperties : + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IJsonSerializable + { + /// 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) })] + string ConfigurationWebTest { get; set; } + /// Content to look for in the return of the WebTest. Must not be null or empty. + [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) })] + string ContentValidationContentMatch { get; set; } + /// When set, this value makes the ContentMatch validation case insensitive. + [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) })] + bool? ContentValidationIgnoreCase { get; set; } + /// + /// 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.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) })] + bool? ContentValidationPassIfTextFound { get; set; } + /// User defined description for this WebTest. + [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) })] + string Description { get; set; } + /// Is the test actively being monitored. + [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) })] + bool? Enabled { get; set; } + /// Interval in seconds between test runs for this WebTest. Default value is 300. + [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) })] + int? Frequency { 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 = 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.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. + /// + [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) })] + string ProvisioningState { get; } + /// Base64 encoded string body to send with this web test. + [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) })] + string RequestBody { get; set; } + /// Follow redirects for this web test. + [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) })] + bool? RequestFollowRedirect { get; set; } + /// List of headers and their values to add to the WebTest call. + [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.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) })] + string RequestHttpVerb { get; set; } + /// Parse Dependent request for this WebTest. + [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) })] + bool? RequestParseDependentRequest { get; set; } + /// Url location to test. + [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) })] + string RequestUrl { get; set; } + /// Allow for retries should this WebTest fail. + [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) })] + bool? RetryEnabled { get; set; } + /// Unique ID of this WebTest. This is typically the same value as the Name field. + [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) })] + string SyntheticMonitorId { get; set; } + /// Seconds until this WebTest will timeout and fail. Default value is 30. + [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) })] + int? Timeout { get; set; } + /// Validate that the WebTest returns the http status code provided. + [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) })] + int? ValidationRuleExpectedHttpStatusCode { get; set; } + /// When set, validation will ignore the status code. + [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) })] + bool? ValidationRuleIgnoreHttpsStatusCode { get; set; } + /// + /// 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.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) })] + int? ValidationRuleSslCertRemainingLifetimeCheck { get; set; } + /// Checks to see if the SSL cert is still valid. + [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) })] + bool? ValidationRuleSslCheck { get; set; } + /// The kind of web test this is, valid choices are ping, multistep, and standard. + [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(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) })] + string WebTestName { get; set; } + + } + /// Metadata describing a web test for an Azure resource. + internal partial interface IWebTestPropertiesInternal + + { + /// An XML configuration specification for a WebTest. + 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. + string ContentValidationContentMatch { get; set; } + /// When set, this value makes the ContentMatch validation case insensitive. + bool? ContentValidationIgnoreCase { get; set; } + /// + /// When true, validation will pass if there is a match for the ContentMatch string. If false, validation will fail if there + /// is a match + /// + bool? ContentValidationPassIfTextFound { get; set; } + /// User defined description for this WebTest. + string Description { get; set; } + /// Is the test actively being monitored. + bool? Enabled { get; set; } + /// Interval in seconds between test runs for this WebTest. Default value is 300. + int? Frequency { get; set; } + /// + /// A list of where to physically run the tests from to give global coverage for accessibility of your application. + /// + 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.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. + 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. + bool? RequestParseDependentRequest { get; set; } + /// Url location to test. + string RequestUrl { get; set; } + /// Allow for retries should this WebTest fail. + bool? RetryEnabled { get; set; } + /// Unique ID of this WebTest. This is typically the same value as the Name field. + string SyntheticMonitorId { get; set; } + /// 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.IWebTestPropertiesValidationRules ValidationRule { get; set; } + /// The collection of content validation properties + 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. + bool? ValidationRuleIgnoreHttpsStatusCode { get; set; } + /// + /// 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. + /// + int? ValidationRuleSslCertRemainingLifetimeCheck { get; set; } + /// 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. + [global::Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PSArgumentCompleterAttribute("ping", "multistep", "standard")] + string WebTestKind { get; set; } + /// User defined name if this WebTest. + string WebTestName { get; set; } + + } +} \ No newline at end of file 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/WebTestPropertiesRequest.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WebTestPropertiesRequest.PowerShell.cs new file mode 100644 index 000000000000..1b08b82e6804 --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WebTestPropertiesRequest.PowerShell.cs @@ -0,0 +1,204 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + + /// The collection of request properties + [System.ComponentModel.TypeConverter(typeof(WebTestPropertiesRequestTypeConverter))] + public partial class WebTestPropertiesRequest + { + + /// + /// 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.IWebTestPropertiesRequest DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new WebTestPropertiesRequest(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.IWebTestPropertiesRequest DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new WebTestPropertiesRequest(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.IWebTestPropertiesRequest 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 WebTestPropertiesRequest(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("RequestUrl")) + { + ((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.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.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.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.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.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 . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal WebTestPropertiesRequest(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("RequestUrl")) + { + ((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.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.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.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.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.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); + } + } + /// The collection of request properties + [System.ComponentModel.TypeConverter(typeof(WebTestPropertiesRequestTypeConverter))] + public partial interface IWebTestPropertiesRequest + + { + + } +} \ No newline at end of file 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/WebTestPropertiesValidationRules.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WebTestPropertiesValidationRules.PowerShell.cs new file mode 100644 index 000000000000..4e2736ef7709 --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WebTestPropertiesValidationRules.PowerShell.cs @@ -0,0 +1,222 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + + /// The collection of validation rule properties + [System.ComponentModel.TypeConverter(typeof(WebTestPropertiesValidationRulesTypeConverter))] + public partial class WebTestPropertiesValidationRules + { + + /// + /// 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.IWebTestPropertiesValidationRules DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new WebTestPropertiesValidationRules(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.IWebTestPropertiesValidationRules DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new WebTestPropertiesValidationRules(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.IWebTestPropertiesValidationRules 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 WebTestPropertiesValidationRules(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ContentValidation")) + { + ((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.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.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.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.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.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.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.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 . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal WebTestPropertiesValidationRules(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ContentValidation")) + { + ((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.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.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.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.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.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.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.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); + } + } + /// The collection of validation rule properties + [System.ComponentModel.TypeConverter(typeof(WebTestPropertiesValidationRulesTypeConverter))] + public partial interface IWebTestPropertiesValidationRules + + { + + } +} \ No newline at end of file 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/WebTestPropertiesValidationRulesContentValidation.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WebTestPropertiesValidationRulesContentValidation.PowerShell.cs new file mode 100644 index 000000000000..7dcdafc5252a --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WebTestPropertiesValidationRulesContentValidation.PowerShell.cs @@ -0,0 +1,185 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + + /// The collection of content validation properties + [System.ComponentModel.TypeConverter(typeof(WebTestPropertiesValidationRulesContentValidationTypeConverter))] + public partial class WebTestPropertiesValidationRulesContentValidation + { + + /// + /// 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.IWebTestPropertiesValidationRulesContentValidation DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new WebTestPropertiesValidationRulesContentValidation(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.IWebTestPropertiesValidationRulesContentValidation DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new WebTestPropertiesValidationRulesContentValidation(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.IWebTestPropertiesValidationRulesContentValidation 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 WebTestPropertiesValidationRulesContentValidation(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ContentMatch")) + { + ((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.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.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 . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal WebTestPropertiesValidationRulesContentValidation(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ContentMatch")) + { + ((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.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.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); + } + } + /// The collection of content validation properties + [System.ComponentModel.TypeConverter(typeof(WebTestPropertiesValidationRulesContentValidationTypeConverter))] + public partial interface IWebTestPropertiesValidationRulesContentValidation + + { + + } +} \ No newline at end of file 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/WebtestsResource.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WebtestsResource.PowerShell.cs new file mode 100644 index 000000000000..2e0dbb919338 --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WebtestsResource.PowerShell.cs @@ -0,0 +1,196 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + + /// An azure resource object + [System.ComponentModel.TypeConverter(typeof(WebtestsResourceTypeConverter))] + public partial class WebtestsResource + { + + /// + /// 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.IWebtestsResource DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new WebtestsResource(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.IWebtestsResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new WebtestsResource(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.IWebtestsResource 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 WebtestsResource(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal WebtestsResource(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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); + } + AfterDeserializePSObject(content); + } + } + /// An azure resource object + [System.ComponentModel.TypeConverter(typeof(WebtestsResourceTypeConverter))] + public partial interface IWebtestsResource + + { + + } +} \ No newline at end of file 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/Workbook.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Workbook.cs new file mode 100644 index 000000000000..4e31a3f3ae70 --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/Workbook.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.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + + /// A workbook definition. + public partial class Workbook : + 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.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.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.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.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.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.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] + 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.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.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 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 + /// 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.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inherited)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] + 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 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.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.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.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.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.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.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.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.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.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.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.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.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 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.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.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)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.FormatTable(Index = 0)] + public string ResourceGroupName { get => (new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Success ? new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Groups["resourceGroupName"].Value : null); } + + /// The 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.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.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.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.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.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.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.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.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 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.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.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 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.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.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.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.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.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 + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__workbookResource), __workbookResource); + await eventListener.AssertObjectIsValid(nameof(__workbookResource), __workbookResource); + } + + /// Creates an new instance. + public Workbook() + { + + } + } + /// A workbook definition. + public partial interface IWorkbook : + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IJsonSerializable, + 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) })] + string Category { get; set; } + /// The description of the workbook. + [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) })] + string Description { get; set; } + /// The user-defined name (display name) of the workbook. + [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) })] + string DisplayName { get; set; } + /// Being deprecated, please use the other tags field + [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) })] + 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) })] + string Revision { get; } + /// + /// Configuration of this particular 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 workbook. Configuration data is a string containing valid JSON", + SerializedName = @"serializedData", + PossibleTypes = new [] { typeof(string) })] + string SerializedData { get; set; } + /// ResourceId for a source resource. + [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) })] + string SourceId { get; set; } + /// The resourceId to the storage account when bring your own storage is used + [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) })] + string StorageUri { get; set; } + /// The timestamp of resource creation (UTC). + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = 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; } + /// The identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = 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; } + /// The type of identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The type of identity that created the resource.", + SerializedName = @"createdByType", + 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 = 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; } + /// The identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = 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; } + /// The type of identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The type of identity that last modified the resource.", + SerializedName = @"lastModifiedByType", + 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) })] + global::System.DateTime? TimeModified { get; } + /// Unique user id of the specific user that owns this workbook. + [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) })] + string UserId { get; } + /// + /// Workbook schema version format, like 'Notebook/1.0', which should match the workbook in serializedData + /// + [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) })] + string Version { get; set; } + + } + /// A workbook definition. + internal partial interface IWorkbookInternal : + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookResourceInternal + { + /// Workbook category, as defined by the user at creation time. + string Category { get; set; } + /// The description of the workbook. + string Description { get; set; } + /// The user-defined name (display name) of the workbook. + string DisplayName { get; set; } + /// Being deprecated, please use the other tags field + System.Collections.Generic.List PropertiesTag { get; set; } + /// Metadata describing a workbook for an Azure resource. + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookProperties Property { get; set; } + /// The unique revision id for this workbook definition + string Revision { get; set; } + /// + /// Configuration of this particular workbook. Configuration data is a string containing valid JSON + /// + string SerializedData { get; set; } + /// ResourceId for a source resource. + string SourceId { get; set; } + /// 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.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. + [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. + [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. + /// + global::System.DateTime? TimeModified { get; set; } + /// Unique user id of the specific user that owns this workbook. + string UserId { get; set; } + /// + /// Workbook schema version format, like 'Notebook/1.0', which should match the workbook in serializedData + /// + string Version { get; set; } + + } +} \ No newline at end of file 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/WorkbookError.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookError.PowerShell.cs new file mode 100644 index 000000000000..372626cd88db --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookError.PowerShell.cs @@ -0,0 +1,196 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + + /// Error response. + [System.ComponentModel.TypeConverter(typeof(WorkbookErrorTypeConverter))] + public partial class WorkbookError + { + + /// + /// 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.IWorkbookError DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new WorkbookError(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.IWorkbookError DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new WorkbookError(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.IWorkbookError 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 WorkbookError(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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.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.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.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.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 . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal WorkbookError(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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.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.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.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.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); + } + } + /// Error response. + [System.ComponentModel.TypeConverter(typeof(WorkbookErrorTypeConverter))] + public partial interface IWorkbookError + + { + + } +} \ No newline at end of file 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/WorkbookError.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookError.cs new file mode 100644 index 000000000000..ef9eeef16ec1 --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookError.cs @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + + /// Error response. + public partial class WorkbookError : + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookError, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookErrorInternal + { + + /// + /// Service specific error code which serves as the substatus for the HTTP error code. + /// + [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.IWorkbookErrorDefinitionInternal)Error).Code; } + + /// Backing field for property. + 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.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 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.IWorkbookErrorDefinitionInternal)Error).Message; } + + /// Internal Acessors for Code + 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.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.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 + 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.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() + { + + } + } + /// Error response. + public partial interface IWorkbookError : + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IJsonSerializable + { + /// + /// Service specific error code which serves as the substatus for the HTTP error code. + /// + [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) })] + string Code { get; } + /// detailed error trace + [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) })] + 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) })] + string Message { get; } + + } + /// Error response. + internal partial interface IWorkbookErrorInternal + + { + /// + /// Service specific error code which serves as the substatus for the HTTP error code. + /// + string Code { get; set; } + /// The error details. + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookErrorDefinition Error { get; set; } + /// Internal error details. + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookInnerErrorTrace InnerError { get; set; } + /// detailed error trace + System.Collections.Generic.List InnerErrorTrace { get; set; } + /// Description of the error. + string Message { get; set; } + + } +} \ No newline at end of file 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/WorkbookErrorDefinition.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookErrorDefinition.PowerShell.cs new file mode 100644 index 000000000000..35222f3fdce3 --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookErrorDefinition.PowerShell.cs @@ -0,0 +1,188 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + + /// Error definition. + [System.ComponentModel.TypeConverter(typeof(WorkbookErrorDefinitionTypeConverter))] + public partial class WorkbookErrorDefinition + { + + /// + /// 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.IWorkbookErrorDefinition DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new WorkbookErrorDefinition(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.IWorkbookErrorDefinition DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new WorkbookErrorDefinition(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.IWorkbookErrorDefinition 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 WorkbookErrorDefinition(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("InnerError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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.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.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.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 . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal WorkbookErrorDefinition(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("InnerError")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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.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.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.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); + } + } + /// Error definition. + [System.ComponentModel.TypeConverter(typeof(WorkbookErrorDefinitionTypeConverter))] + public partial interface IWorkbookErrorDefinition + + { + + } +} \ No newline at end of file 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/WorkbookErrorDefinition.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookErrorDefinition.cs new file mode 100644 index 000000000000..51256677aac0 --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookErrorDefinition.cs @@ -0,0 +1,122 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + + /// Error definition. + public partial class WorkbookErrorDefinition : + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookErrorDefinition, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookErrorDefinitionInternal + { + + /// Backing field for property. + private string _code; + + /// + /// Service specific error code which serves as the substatus for the HTTP error code. + /// + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] + public string Code { get => this._code; } + + /// Backing field for property. + 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.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 System.Collections.Generic.List InnerErrorTrace { get => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookInnerErrorTraceInternal)InnerError).Trace; } + + /// Backing field for property. + private string _message; + + /// Description of the error. + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] + public string Message { get => this._message; } + + /// Internal Acessors for Code + 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.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 + 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.IWorkbookErrorDefinitionInternal.Message { get => this._message; set { {_message = value;} } } + + /// Creates an new instance. + public WorkbookErrorDefinition() + { + + } + } + /// Error definition. + public partial interface IWorkbookErrorDefinition : + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IJsonSerializable + { + /// + /// Service specific error code which serves as the substatus for the HTTP error code. + /// + [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) })] + string Code { get; } + /// detailed error trace + [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) })] + 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) })] + string Message { get; } + + } + /// Error definition. + internal partial interface IWorkbookErrorDefinitionInternal + + { + /// + /// Service specific error code which serves as the substatus for the HTTP error code. + /// + string Code { get; set; } + /// Internal error details. + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookInnerErrorTrace InnerError { get; set; } + /// detailed error trace + System.Collections.Generic.List InnerErrorTrace { get; set; } + /// Description of the error. + string Message { get; set; } + + } +} \ No newline at end of file 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/WorkbookProperties.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookProperties.PowerShell.cs new file mode 100644 index 000000000000..4228ffb3b16f --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookProperties.PowerShell.cs @@ -0,0 +1,244 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + + /// Properties that contain a workbook. + [System.ComponentModel.TypeConverter(typeof(WorkbookPropertiesTypeConverter))] + public partial class WorkbookProperties + { + + /// + /// 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.IWorkbookProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new WorkbookProperties(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.IWorkbookProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new WorkbookProperties(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.IWorkbookProperties 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 WorkbookProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("DisplayName")) + { + ((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.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.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.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.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.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.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.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.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.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.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 . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal WorkbookProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("DisplayName")) + { + ((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.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.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.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.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.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.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.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.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.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.IWorkbookPropertiesInternal)this).Revision = (string) content.GetValueForProperty("Revision",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookPropertiesInternal)this).Revision, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + } + /// Properties that contain a workbook. + [System.ComponentModel.TypeConverter(typeof(WorkbookPropertiesTypeConverter))] + public partial interface IWorkbookProperties + + { + + } +} \ No newline at end of file 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/WorkbookPropertiesUpdateParameters.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookPropertiesUpdateParameters.PowerShell.cs new file mode 100644 index 000000000000..d5956b1df615 --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookPropertiesUpdateParameters.PowerShell.cs @@ -0,0 +1,208 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + + /// Properties that contain a workbook for PATCH operation. + [System.ComponentModel.TypeConverter(typeof(WorkbookPropertiesUpdateParametersTypeConverter))] + public partial class WorkbookPropertiesUpdateParameters + { + + /// + /// 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.IWorkbookPropertiesUpdateParameters DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new WorkbookPropertiesUpdateParameters(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.IWorkbookPropertiesUpdateParameters DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new WorkbookPropertiesUpdateParameters(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.IWorkbookPropertiesUpdateParameters 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 WorkbookPropertiesUpdateParameters(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("DisplayName")) + { + ((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.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.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.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.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.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 . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal WorkbookPropertiesUpdateParameters(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("DisplayName")) + { + ((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.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.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.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.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.IWorkbookPropertiesUpdateParametersInternal)this).Revision = (string) content.GetValueForProperty("Revision",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookPropertiesUpdateParametersInternal)this).Revision, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + } + /// Properties that contain a workbook for PATCH operation. + [System.ComponentModel.TypeConverter(typeof(WorkbookPropertiesUpdateParametersTypeConverter))] + public partial interface IWorkbookPropertiesUpdateParameters + + { + + } +} \ No newline at end of file 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/WorkbookResource.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookResource.PowerShell.cs new file mode 100644 index 000000000000..abeb2b243fcf --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookResource.PowerShell.cs @@ -0,0 +1,252 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) 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 azure resource object + [System.ComponentModel.TypeConverter(typeof(WorkbookResourceTypeConverter))] + public partial class WorkbookResource + { + + /// + /// 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.IWorkbookResource DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new WorkbookResource(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.IWorkbookResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new WorkbookResource(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.IWorkbookResource 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 WorkbookResource(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + 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("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); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal WorkbookResource(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + 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("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); + } + AfterDeserializePSObject(content); + } + } + /// An azure resource object + [System.ComponentModel.TypeConverter(typeof(WorkbookResourceTypeConverter))] + public partial interface IWorkbookResource + + { + + } +} \ No newline at end of file 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/WorkbookResource.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookResource.cs new file mode 100644 index 000000000000..233cefa49518 --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookResource.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.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.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.ITrackedResource __trackedResource = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.TrackedResource(); + + /// Backing field for property. + private string _etag; + + /// Resource etag + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] + public string Etag { get => this._etag; set => this._etag = value; } + + /// + /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// + [Microsoft.Azure.PowerShell.Cmdlets.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.IResourceInternal)__trackedResource).Id; } + + /// Backing field for property. + 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.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.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.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 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 + /// 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.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inlined)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] + 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 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 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.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.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.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.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.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.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.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.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.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.IResourceInternal)__trackedResource).Type; } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__trackedResource), __trackedResource); + await eventListener.AssertObjectIsValid(nameof(__trackedResource), __trackedResource); + } + + /// Creates an new instance. + public WorkbookResource() + { + + } + } + /// An azure resource object + public partial interface IWorkbookResource : + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IJsonSerializable, + 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) })] + string Etag { get; set; } + /// + /// 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.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) })] + string IdentityPrincipalId { get; } + /// + /// The tenant ID of the system assigned identity. This property will only be provided for a system assigned identity. + /// + [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) })] + string IdentityTenantId { get; } + /// + /// Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). + /// + [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(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}. + /// The dictionary values can be empty objects ({}) in requests. + /// + [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.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(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.ITrackedResourceInternal + { + /// Resource etag + string Etag { get; set; } + /// Identity used for BYOS + 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. + /// + string IdentityPrincipalId { get; set; } + /// + /// The tenant ID of the system assigned identity. This property will only be provided for a system assigned identity. + /// + string IdentityTenantId { get; set; } + /// + /// Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). + /// + [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.IUserAssignedIdentities IdentityUserAssignedIdentity { get; set; } + /// The kind of workbook. Only valid value is shared. + [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/WorkbookResourceIdentity.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookResourceIdentity.PowerShell.cs new file mode 100644 index 000000000000..84b9b64c8df6 --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookResourceIdentity.PowerShell.cs @@ -0,0 +1,188 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + + /// Identity used for BYOS + [System.ComponentModel.TypeConverter(typeof(WorkbookResourceIdentityTypeConverter))] + public partial class WorkbookResourceIdentity + { + + /// + /// 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.IWorkbookResourceIdentity DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new WorkbookResourceIdentity(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.IWorkbookResourceIdentity DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new WorkbookResourceIdentity(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.IWorkbookResourceIdentity 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 WorkbookResourceIdentity(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("PrincipalId")) + { + ((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.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.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.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 . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal WorkbookResourceIdentity(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("PrincipalId")) + { + ((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.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.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.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); + } + } + /// Identity used for BYOS + [System.ComponentModel.TypeConverter(typeof(WorkbookResourceIdentityTypeConverter))] + public partial interface IWorkbookResourceIdentity + + { + + } +} \ No newline at end of file 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/WorkbookResourceIdentity.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookResourceIdentity.cs new file mode 100644 index 000000000000..c21b2fed54f8 --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookResourceIdentity.cs @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.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.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.IManagedServiceIdentity __managedServiceIdentity = new Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.ManagedServiceIdentity(); + + /// Internal Acessors for PrincipalId + 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.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.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.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 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 + /// 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.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Inherited)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] + 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 + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__managedServiceIdentity), __managedServiceIdentity); + await eventListener.AssertObjectIsValid(nameof(__managedServiceIdentity), __managedServiceIdentity); + } + + /// Creates an new instance. + public WorkbookResourceIdentity() + { + + } + } + /// Identity used for BYOS + public partial interface IWorkbookResourceIdentity : + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IManagedServiceIdentity + { + + } + /// Identity used for BYOS + internal partial interface IWorkbookResourceIdentityInternal : + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IManagedServiceIdentityInternal + { + + } +} \ No newline at end of file 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/WorkbookTemplate.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplate.PowerShell.cs new file mode 100644 index 000000000000..f491c407b417 --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplate.PowerShell.cs @@ -0,0 +1,244 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + + /// An Application Insights workbook template definition. + [System.ComponentModel.TypeConverter(typeof(WorkbookTemplateTypeConverter))] + public partial class WorkbookTemplate + { + + /// + /// 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.IWorkbookTemplate DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new WorkbookTemplate(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.IWorkbookTemplate DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new WorkbookTemplate(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.IWorkbookTemplate 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 WorkbookTemplate(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.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.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.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.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.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.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.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.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.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.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.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 . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal WorkbookTemplate(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.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.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.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.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.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.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.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.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.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.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.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); + } + } + /// An Application Insights workbook template definition. + [System.ComponentModel.TypeConverter(typeof(WorkbookTemplateTypeConverter))] + public partial interface IWorkbookTemplate + + { + + } +} \ No newline at end of file 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/WorkbookTemplate.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplate.cs new file mode 100644 index 000000000000..dc90a7c6dc72 --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplate.cs @@ -0,0 +1,207 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models +{ + 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.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.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.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 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.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.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.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.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.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.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.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.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.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.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.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)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.FormatTable(Index = 0)] + public string ResourceGroupName { get => (new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Success ? new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Groups["resourceGroupName"].Value : null); } + + /// 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.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.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.IWorkbookTemplateResourceInternal)__workbookTemplateResource).Type; } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__workbookTemplateResource), __workbookTemplateResource); + await eventListener.AssertObjectIsValid(nameof(__workbookTemplateResource), __workbookTemplateResource); + } + + /// Creates an new instance. + 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.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) })] + string Author { get; set; } + /// Workbook galleries supported by the template. + [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.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.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) })] + int? Priority { 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.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.IWorkbookTemplateResourceInternal + { + /// Information about the author of the workbook template. + string Author { get; set; } + /// Workbook galleries supported by the template. + 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.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.IWorkbookTemplateProperties Property { get; set; } + /// Valid JSON object containing workbook template payload. + 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/WorkbookTemplateError.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplateError.PowerShell.cs new file mode 100644 index 000000000000..cc21bb7473cd --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplateError.PowerShell.cs @@ -0,0 +1,188 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + + /// Error message that will indicate why the operation failed. + [System.ComponentModel.TypeConverter(typeof(WorkbookTemplateErrorTypeConverter))] + public partial class WorkbookTemplateError + { + + /// + /// 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.IWorkbookTemplateError DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new WorkbookTemplateError(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.IWorkbookTemplateError DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new WorkbookTemplateError(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.IWorkbookTemplateError 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 WorkbookTemplateError(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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.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.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.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 . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal WorkbookTemplateError(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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.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.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.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); + } + } + /// Error message that will indicate why the operation failed. + [System.ComponentModel.TypeConverter(typeof(WorkbookTemplateErrorTypeConverter))] + public partial interface IWorkbookTemplateError + + { + + } +} \ No newline at end of file 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/WorkbookTemplateError.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplateError.cs new file mode 100644 index 000000000000..61783900ad9a --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplateError.cs @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models +{ + 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.IWorkbookTemplateError, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateErrorInternal + { + + /// + /// Service-defined error code. This code serves as a sub-status for the HTTP error code specified in the response. + /// + [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.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 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.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.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.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.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() + { + + } + } + /// Error message that will indicate why the operation failed. + public partial interface IWorkbookTemplateError : + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IJsonSerializable + { + /// + /// Service-defined error code. This code serves as a sub-status for the HTTP error code specified in the response. + /// + [Microsoft.Azure.PowerShell.Cmdlets.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) })] + string Code { get; set; } + /// The list of invalid fields send in request, in case of validation error. + [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.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) })] + string Message { get; set; } + + } + /// Error message that will indicate why the operation failed. + internal partial interface IWorkbookTemplateErrorInternal + + { + /// + /// Service-defined error code. This code serves as a sub-status for the HTTP error code specified in the response. + /// + string Code { get; set; } + /// The list of invalid fields send in request, in case of validation error. + System.Collections.Generic.List Detail { get; set; } + /// Error message object that will indicate why the operation failed. + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateErrorBody Error { get; set; } + /// Human-readable representation of the error. + string Message { get; set; } + + } +} \ No newline at end of file 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/WorkbookTemplateErrorBody.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplateErrorBody.PowerShell.cs new file mode 100644 index 000000000000..d7e434bb9e46 --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplateErrorBody.PowerShell.cs @@ -0,0 +1,180 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + + /// Error message body that will indicate why the operation failed. + [System.ComponentModel.TypeConverter(typeof(WorkbookTemplateErrorBodyTypeConverter))] + public partial class WorkbookTemplateErrorBody + { + + /// + /// 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.IWorkbookTemplateErrorBody DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new WorkbookTemplateErrorBody(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.IWorkbookTemplateErrorBody DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new WorkbookTemplateErrorBody(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.IWorkbookTemplateErrorBody 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 WorkbookTemplateErrorBody(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Code")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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.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.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 . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal WorkbookTemplateErrorBody(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Code")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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.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.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); + } + } + /// Error message body that will indicate why the operation failed. + [System.ComponentModel.TypeConverter(typeof(WorkbookTemplateErrorBodyTypeConverter))] + public partial interface IWorkbookTemplateErrorBody + + { + + } +} \ No newline at end of file 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/WorkbookTemplateGallery.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplateGallery.PowerShell.cs new file mode 100644 index 000000000000..bef150699dbc --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplateGallery.PowerShell.cs @@ -0,0 +1,196 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + + /// Gallery information for a workbook template. + [System.ComponentModel.TypeConverter(typeof(WorkbookTemplateGalleryTypeConverter))] + public partial class WorkbookTemplateGallery + { + + /// + /// 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.IWorkbookTemplateGallery DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new WorkbookTemplateGallery(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.IWorkbookTemplateGallery DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new WorkbookTemplateGallery(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.IWorkbookTemplateGallery 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 WorkbookTemplateGallery(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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.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.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.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.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 . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal WorkbookTemplateGallery(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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.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.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.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.IWorkbookTemplateGalleryInternal)this).ResourceType = (string) content.GetValueForProperty("ResourceType",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateGalleryInternal)this).ResourceType, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + } + /// Gallery information for a workbook template. + [System.ComponentModel.TypeConverter(typeof(WorkbookTemplateGalleryTypeConverter))] + public partial interface IWorkbookTemplateGallery + + { + + } +} \ No newline at end of file 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/WorkbookTemplateLocalizedGallery.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplateLocalizedGallery.PowerShell.cs new file mode 100644 index 000000000000..8fd0d3d50ebe --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplateLocalizedGallery.PowerShell.cs @@ -0,0 +1,174 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + + /// Localized template data and gallery information. + [System.ComponentModel.TypeConverter(typeof(WorkbookTemplateLocalizedGalleryTypeConverter))] + public partial class WorkbookTemplateLocalizedGallery + { + + /// + /// 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.IWorkbookTemplateLocalizedGallery DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new WorkbookTemplateLocalizedGallery(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.IWorkbookTemplateLocalizedGallery DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new WorkbookTemplateLocalizedGallery(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.IWorkbookTemplateLocalizedGallery 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 WorkbookTemplateLocalizedGallery(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("TemplateData")) + { + ((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.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 . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal WorkbookTemplateLocalizedGallery(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("TemplateData")) + { + ((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.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); + } + } + /// Localized template data and gallery information. + [System.ComponentModel.TypeConverter(typeof(WorkbookTemplateLocalizedGalleryTypeConverter))] + public partial interface IWorkbookTemplateLocalizedGallery + + { + + } +} \ No newline at end of file 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/WorkbookTemplateProperties.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplateProperties.PowerShell.cs new file mode 100644 index 000000000000..1e16a7fd5175 --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplateProperties.PowerShell.cs @@ -0,0 +1,196 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + + /// Properties that contain a workbook template. + [System.ComponentModel.TypeConverter(typeof(WorkbookTemplatePropertiesTypeConverter))] + public partial class WorkbookTemplateProperties + { + + /// + /// 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.IWorkbookTemplateProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new WorkbookTemplateProperties(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.IWorkbookTemplateProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new WorkbookTemplateProperties(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.IWorkbookTemplateProperties 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 WorkbookTemplateProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Priority")) + { + ((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.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.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.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.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 . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal WorkbookTemplateProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Priority")) + { + ((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.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.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.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.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); + } + } + /// Properties that contain a workbook template. + [System.ComponentModel.TypeConverter(typeof(WorkbookTemplatePropertiesTypeConverter))] + public partial interface IWorkbookTemplateProperties + + { + + } +} \ No newline at end of file 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/WorkbookTemplateResource.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplateResource.PowerShell.cs new file mode 100644 index 000000000000..c20e762c80ed --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplateResource.PowerShell.cs @@ -0,0 +1,196 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + + /// An azure resource object + [System.ComponentModel.TypeConverter(typeof(WorkbookTemplateResourceTypeConverter))] + public partial class WorkbookTemplateResource + { + + /// + /// 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.IWorkbookTemplateResource DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new WorkbookTemplateResource(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.IWorkbookTemplateResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new WorkbookTemplateResource(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.IWorkbookTemplateResource 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 WorkbookTemplateResource(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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.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.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.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.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 . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal WorkbookTemplateResource(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.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.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.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.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.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); + } + } + /// An azure resource object + [System.ComponentModel.TypeConverter(typeof(WorkbookTemplateResourceTypeConverter))] + public partial interface IWorkbookTemplateResource + + { + + } +} \ No newline at end of file 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/WorkbookTemplateUpdateParameters.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplateUpdateParameters.PowerShell.cs new file mode 100644 index 000000000000..58e804f624f8 --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplateUpdateParameters.PowerShell.cs @@ -0,0 +1,214 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + + /// The parameters that can be provided when updating workbook template. + [System.ComponentModel.TypeConverter(typeof(WorkbookTemplateUpdateParametersTypeConverter))] + public partial class WorkbookTemplateUpdateParameters + { + + /// + /// 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.IWorkbookTemplateUpdateParameters DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new WorkbookTemplateUpdateParameters(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.IWorkbookTemplateUpdateParameters DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new WorkbookTemplateUpdateParameters(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.IWorkbookTemplateUpdateParameters 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 WorkbookTemplateUpdateParameters(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.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.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.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.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.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.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.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 . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal WorkbookTemplateUpdateParameters(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.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.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.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.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.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.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.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); + } + } + /// The parameters that can be provided when updating workbook template. + [System.ComponentModel.TypeConverter(typeof(WorkbookTemplateUpdateParametersTypeConverter))] + public partial interface IWorkbookTemplateUpdateParameters + + { + + } +} \ No newline at end of file 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/WorkbookTemplateUpdateParameters.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplateUpdateParameters.cs new file mode 100644 index 000000000000..c9d16952d454 --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplateUpdateParameters.cs @@ -0,0 +1,170 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models +{ + 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.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.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 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.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.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.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.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.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.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.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.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() + { + + } + } + /// The parameters that can be provided when updating workbook template. + public partial interface IWorkbookTemplateUpdateParameters : + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IJsonSerializable + { + /// 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) })] + string Author { get; set; } + /// Workbook galleries supported by the template. + [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.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.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) })] + int? Priority { get; set; } + /// Resource tags + [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.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.IWorkbookTemplatePropertiesTemplateData) })] + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplatePropertiesTemplateData TemplateData { get; set; } + + } + /// The parameters that can be provided when updating workbook template. + internal partial interface IWorkbookTemplateUpdateParametersInternal + + { + /// Information about the author of the workbook template. + string Author { get; set; } + /// Workbook galleries supported by the template. + 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.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.IWorkbookTemplateProperties Property { get; set; } + /// Resource tags + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplateUpdateParametersTags Tag { get; set; } + /// Valid JSON object containing workbook template payload. + 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/WorkbookTemplatesListResult.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplatesListResult.cs new file mode 100644 index 000000000000..c36c3d3de52b --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookTemplatesListResult.cs @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + + /// WorkbookTemplate list result. + public partial class WorkbookTemplatesListResult : + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplatesListResult, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookTemplatesListResultInternal + { + + /// Backing field for property. + 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 System.Collections.Generic.List Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public WorkbookTemplatesListResult() + { + + } + } + /// WorkbookTemplate list result. + public partial interface IWorkbookTemplatesListResult : + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IJsonSerializable + { + /// An array of workbook templates. + [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.IWorkbookTemplate) })] + System.Collections.Generic.List Value { get; set; } + + } + /// WorkbookTemplate list result. + internal partial interface IWorkbookTemplatesListResultInternal + + { + /// An array of workbook templates. + 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/WorkbookUpdateParameters.PowerShell.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookUpdateParameters.PowerShell.cs new file mode 100644 index 000000000000..c6760d8cba44 --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookUpdateParameters.PowerShell.cs @@ -0,0 +1,230 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.PowerShell; + + /// + /// The parameters that can be provided when updating workbook properties properties. + /// + [System.ComponentModel.TypeConverter(typeof(WorkbookUpdateParametersTypeConverter))] + public partial class WorkbookUpdateParameters + { + + /// + /// 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.IWorkbookUpdateParameters DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new WorkbookUpdateParameters(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.IWorkbookUpdateParameters DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new WorkbookUpdateParameters(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.IWorkbookUpdateParameters 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 WorkbookUpdateParameters(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.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.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.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.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.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.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.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.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.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 . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal WorkbookUpdateParameters(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.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.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.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.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.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.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.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.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.IWorkbookUpdateParametersInternal)this).Revision = (string) content.GetValueForProperty("Revision",((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookUpdateParametersInternal)this).Revision, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + } + /// The parameters that can be provided when updating workbook properties properties. + [System.ComponentModel.TypeConverter(typeof(WorkbookUpdateParametersTypeConverter))] + public partial interface IWorkbookUpdateParameters + + { + + } +} \ No newline at end of file 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/WorkbookUpdateParameters.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookUpdateParameters.cs new file mode 100644 index 000000000000..820e44da3f87 --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbookUpdateParameters.cs @@ -0,0 +1,207 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Extensions; + + /// + /// The parameters that can be provided when updating workbook properties properties. + /// + public partial class WorkbookUpdateParameters : + 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.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.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.IWorkbookPropertiesUpdateParametersInternal)Property).DisplayName; set => ((Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookPropertiesUpdateParametersInternal)Property).DisplayName = value ?? null; } + + /// Backing field for property. + 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 string Kind { get => this._kind; set => this._kind = value; } + + /// Internal Acessors for Property + 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 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.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.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.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.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.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.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() + { + + } + } + /// The parameters that can be provided when updating workbook properties properties. + public partial interface IWorkbookUpdateParameters : + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IJsonSerializable + { + /// 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) })] + string Category { get; set; } + /// The description of the workbook. + [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) })] + string Description { get; set; } + /// The user-defined name (display name) of the workbook. + [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) })] + string DisplayName { 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(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) })] + 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) })] + string Revision { get; set; } + /// + /// Configuration of this particular 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 workbook. Configuration data is a string containing valid JSON", + SerializedName = @"serializedData", + PossibleTypes = new [] { typeof(string) })] + string SerializedData { get; set; } + /// Resource tags. + [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.IWorkbookUpdateParametersTags) })] + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookUpdateParametersTags Tag { get; set; } + + } + /// The parameters that can be provided when updating workbook properties properties. + internal partial interface IWorkbookUpdateParametersInternal + + { + /// Workbook category, as defined by the user at creation time. + string Category { get; set; } + /// The description of the workbook. + string Description { get; set; } + /// The user-defined name (display name) of the workbook. + string DisplayName { get; set; } + /// The kind of workbook. Only valid value is shared. + [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 + System.Collections.Generic.List PropertiesTag { get; set; } + /// Metadata describing a workbook for an Azure resource. + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbookPropertiesUpdateParameters Property { get; set; } + /// The unique revision id for this workbook definition + string Revision { get; set; } + /// + /// Configuration of this particular workbook. Configuration data is a string containing valid JSON + /// + string SerializedData { get; set; } + /// Resource tags. + 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/WorkbooksListResult.cs b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbooksListResult.cs new file mode 100644 index 000000000000..2acd65a9317c --- /dev/null +++ b/generated/ApplicationInsights/ApplicationInsights.Autorest/generated/api/Models/WorkbooksListResult.cs @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) 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; + + /// Workbook list result. + public partial class WorkbooksListResult : + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbooksListResult, + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Models.IWorkbooksListResultInternal + { + + /// Internal Acessors for 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; + + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Origin(Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.PropertyOrigin.Owned)] + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.DoNotFormat] + public string NextLink { get => this._nextLink; set => this._nextLink = value; } + + /// Backing field for property. + 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 System.Collections.Generic.List Value { get => this._value; } + + /// Creates an new instance. + public WorkbooksListResult() + { + + } + } + /// Workbook list result. + public partial interface IWorkbooksListResult : + Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.IJsonSerializable + { + [Microsoft.Azure.PowerShell.Cmdlets.ApplicationInsights.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"", + SerializedName = @"nextLink", + PossibleTypes = new [] { typeof(string) })] + string NextLink { get; set; } + /// An array of workbooks. + [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.IWorkbook) })] + System.Collections.Generic.List Value { get; } + + } + /// Workbook list result. + internal partial interface IWorkbooksListResultInternal + + { + string NextLink { get; set; } + /// An array of workbooks. + 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/ActionList.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/ActionList.cs new file mode 100644 index 000000000000..7dbde1023cfe --- /dev/null +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/ActionList.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.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.IActionList, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActionListInternal + { + + /// Backing field for property. + 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 System.Collections.Generic.List ActionGroup { get => this._actionGroup; set => this._actionGroup = value; } + + /// Creates an new instance. + public ActionList() + { + + } + } + /// A list of Activity Log Alert rule actions. + public partial interface IActionList : + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IJsonSerializable + { + /// 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.IActionGroup) })] + System.Collections.Generic.List ActionGroup { get; set; } + + } + /// A list of Activity Log Alert rule actions. + internal partial interface IActionListInternal + + { + /// The list of the Action Groups. + 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/ActivityLogAlertResource.PowerShell.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/ActivityLogAlertResource.PowerShell.cs new file mode 100644 index 000000000000..6a37903e6427 --- /dev/null +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/ActivityLogAlertResource.PowerShell.cs @@ -0,0 +1,262 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PowerShell; + + /// An Activity Log Alert rule resource. + [System.ComponentModel.TypeConverter(typeof(ActivityLogAlertResourceTypeConverter))] + public partial class ActivityLogAlertResource + { + + /// + /// 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 ActivityLogAlertResource(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.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.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.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.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.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.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.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.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.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.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.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.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.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 . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ActivityLogAlertResource(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.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.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.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.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.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.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.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.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.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.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.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.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.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 . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + 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 . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActivityLogAlertResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ActivityLogAlertResource(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.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. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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 Activity Log Alert rule resource. + [System.ComponentModel.TypeConverter(typeof(ActivityLogAlertResourceTypeConverter))] + public partial interface IActivityLogAlertResource + + { + + } +} \ No newline at end of file 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/ActivityLogAlertResource.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/ActivityLogAlertResource.cs new file mode 100644 index 000000000000..c3c6653a4427 --- /dev/null +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/ActivityLogAlertResource.cs @@ -0,0 +1,214 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.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.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.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 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 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.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.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.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.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.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.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.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.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.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.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.IAzureResourceInternal)__azureResource).Name; } + + /// Backing field for 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.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)] + public string ResourceGroupName { get => (new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Success ? new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Groups["resourceGroupName"].Value : null); } + + /// + /// 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.Inlined)] + 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.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.IAzureResourceInternal)__azureResource).Type; } + + /// Creates an new instance. + public ActivityLogAlertResource() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__azureResource), __azureResource); + await eventListener.AssertObjectIsValid(nameof(__azureResource), __azureResource); + } + } + /// 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.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.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.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) })] + string Description { get; set; } + /// + /// 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.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) })] + bool? Enabled { 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. + /// + [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) })] + System.Collections.Generic.List Scope { get; set; } + + } + /// An Activity Log Alert rule resource. + internal partial interface IActivityLogAlertResourceInternal : + 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.IActionList Action { get; set; } + /// The list of the Action Groups. + System.Collections.Generic.List ActionGroup { get; set; } + /// The condition that will cause this alert to activate. + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleAllOfCondition Condition { get; set; } + /// The list of Activity Log Alert rule conditions. + System.Collections.Generic.List ConditionAllOf { get; set; } + /// A description of this Activity Log Alert rule. + string Description { get; set; } + /// + /// 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. + /// + bool? Enabled { get; set; } + /// The Activity Log Alert rule properties of the resource. + 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. + /// + 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/AlertRuleAllOfCondition.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRuleAllOfCondition.cs new file mode 100644 index 000000000000..14016e442798 --- /dev/null +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRuleAllOfCondition.cs @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Extensions; + + /// + /// 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.IAlertRuleAllOfCondition, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleAllOfConditionInternal + { + + /// Backing field for property. + 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 System.Collections.Generic.List AllOf { get => this._allOf; set => this._allOf = value; } + + /// Creates an new instance. + public AlertRuleAllOfCondition() + { + + } + } + /// An Activity Log Alert rule condition that is met when all its member conditions are met. + public partial interface IAlertRuleAllOfCondition : + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IJsonSerializable + { + /// 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.IAlertRuleAnyOfOrLeafCondition) })] + System.Collections.Generic.List AllOf { get; set; } + + } + /// An Activity Log Alert rule condition that is met when all its member conditions are met. + internal partial interface IAlertRuleAllOfConditionInternal + + { + /// The list of Activity Log Alert rule conditions. + 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/AlertRuleAnyOfOrLeafCondition.PowerShell.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRuleAnyOfOrLeafCondition.PowerShell.cs new file mode 100644 index 000000000000..50a675617c2b --- /dev/null +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRuleAnyOfOrLeafCondition.PowerShell.cs @@ -0,0 +1,204 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PowerShell; + + /// + /// An Activity Log Alert rule condition that is met when all its member conditions are met. + /// Each condition can be of one of the following types: + /// __Important__: Each type has its unique subset of properties. Properties from different types CANNOT exist in one condition. + /// * __Leaf Condition -__ must contain 'field' and either 'equals' or 'containsAny'. + /// _Please note, 'anyOf' should __not__ be set in a Leaf Condition._ + /// * __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._ + /// + [System.ComponentModel.TypeConverter(typeof(AlertRuleAnyOfOrLeafConditionTypeConverter))] + public partial class AlertRuleAnyOfOrLeafCondition + { + + /// + /// 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 AlertRuleAnyOfOrLeafCondition(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("AnyOf")) + { + ((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.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.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.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 . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal AlertRuleAnyOfOrLeafCondition(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("AnyOf")) + { + ((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.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.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.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 . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + 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 . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleAnyOfOrLeafCondition DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new AlertRuleAnyOfOrLeafCondition(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.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. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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 Activity Log Alert rule condition that is met when all its member conditions are met. + /// Each condition can be of one of the following types: + /// __Important__: Each type has its unique subset of properties. Properties from different types CANNOT exist in one condition. + /// * __Leaf Condition -__ must contain 'field' and either 'equals' or 'containsAny'. + /// _Please note, 'anyOf' should __not__ be set in a Leaf Condition._ + /// * __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._ + [System.ComponentModel.TypeConverter(typeof(AlertRuleAnyOfOrLeafConditionTypeConverter))] + public partial interface IAlertRuleAnyOfOrLeafCondition + + { + + } +} \ No newline at end of file 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/AlertRuleList.PowerShell.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRuleList.PowerShell.cs new file mode 100644 index 000000000000..409c592b0ee4 --- /dev/null +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRuleList.PowerShell.cs @@ -0,0 +1,172 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PowerShell; + + /// A list of Activity Log Alert rules. + [System.ComponentModel.TypeConverter(typeof(AlertRuleListTypeConverter))] + public partial class AlertRuleList + { + + /// + /// 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 AlertRuleList(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.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.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 . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal AlertRuleList(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.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.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 . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + 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 . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new AlertRuleList(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.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. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } + } + /// A list of Activity Log Alert rules. + [System.ComponentModel.TypeConverter(typeof(AlertRuleListTypeConverter))] + public partial interface IAlertRuleList + + { + + } +} \ No newline at end of file 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/AlertRulePatchObject.PowerShell.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRulePatchObject.PowerShell.cs new file mode 100644 index 000000000000..865a2a67af14 --- /dev/null +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRulePatchObject.PowerShell.cs @@ -0,0 +1,180 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PowerShell; + + /// An Activity Log Alert rule object for the body of patch operations. + [System.ComponentModel.TypeConverter(typeof(AlertRulePatchObjectTypeConverter))] + public partial class AlertRulePatchObject + { + + /// + /// 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 AlertRulePatchObject(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.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.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.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 . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal AlertRulePatchObject(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.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.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.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 . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + 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 . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePatchObject DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new AlertRulePatchObject(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.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. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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 Activity Log Alert rule object for the body of patch operations. + [System.ComponentModel.TypeConverter(typeof(AlertRulePatchObjectTypeConverter))] + public partial interface IAlertRulePatchObject + + { + + } +} \ No newline at end of file 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/AlertRulePatchObject.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRulePatchObject.cs new file mode 100644 index 000000000000..f4edcdb718ca --- /dev/null +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRulePatchObject.cs @@ -0,0 +1,92 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.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.IAlertRulePatchObject, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePatchObjectInternal + { + + /// + /// 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.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.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.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.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.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.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() + { + + } + } + /// An Activity Log Alert rule object for the body of patch operations. + public partial interface IAlertRulePatchObject : + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IJsonSerializable + { + /// + /// 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.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) })] + bool? Enabled { get; set; } + /// The resource tags + [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.IAlertRulePatchObjectTags) })] + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePatchObjectTags Tag { get; set; } + + } + /// An Activity Log Alert rule object for the body of patch operations. + internal partial interface IAlertRulePatchObjectInternal + + { + /// + /// 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. + /// + bool? Enabled { get; set; } + /// The activity log alert settings for an update operation. + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePatchProperties Property { get; set; } + /// The resource tags + 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/AlertRuleProperties.PowerShell.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRuleProperties.PowerShell.cs new file mode 100644 index 000000000000..0dc25a194f0a --- /dev/null +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRuleProperties.PowerShell.cs @@ -0,0 +1,212 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PowerShell; + + /// An Azure Activity Log Alert rule. + [System.ComponentModel.TypeConverter(typeof(AlertRulePropertiesTypeConverter))] + public partial class AlertRuleProperties + { + + /// + /// 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 AlertRuleProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Condition")) + { + ((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.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.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.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.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.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.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 . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal AlertRuleProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Condition")) + { + ((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.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.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.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.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.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.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 . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + 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 . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new AlertRuleProperties(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.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. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } + } + /// An Azure Activity Log Alert rule. + [System.ComponentModel.TypeConverter(typeof(AlertRulePropertiesTypeConverter))] + public partial interface IAlertRuleProperties + + { + + } +} \ No newline at end of file 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/AlertRuleProperties.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRuleProperties.cs new file mode 100644 index 000000000000..91baab8296fc --- /dev/null +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AlertRuleProperties.cs @@ -0,0 +1,170 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.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.IAlertRuleProperties, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRulePropertiesInternal + { + + /// Backing field for property. + 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.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 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.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.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 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; + + /// A description of this Activity Log Alert rule. + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.PropertyOrigin.Owned)] + public string Description { get => this._description; set => this._description = value; } + + /// Backing field for property. + private bool? _enabled; + + /// + /// 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.Owned)] + public bool? Enabled { get => this._enabled; set => this._enabled = value; } + + /// Internal Acessors for Action + 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.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 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 System.Collections.Generic.List Scope { get => this._scope; set => this._scope = value; } + + /// Creates an new instance. + public AlertRuleProperties() + { + + } + } + /// An Azure Activity Log Alert rule. + public partial interface IAlertRuleProperties : + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IJsonSerializable + { + /// 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.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.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) })] + string Description { get; set; } + /// + /// 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.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) })] + bool? Enabled { 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. + /// + [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) })] + System.Collections.Generic.List Scope { get; set; } + + } + /// An Azure Activity Log Alert rule. + internal partial interface IAlertRulePropertiesInternal + + { + /// The actions that will activate when the condition is met. + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IActionList Action { get; set; } + /// The list of the Action Groups. + System.Collections.Generic.List ActionGroup { get; set; } + /// The condition that will cause this alert to activate. + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAlertRuleAllOfCondition Condition { get; set; } + /// The list of Activity Log Alert rule conditions. + System.Collections.Generic.List ConditionAllOf { get; set; } + /// A description of this Activity Log Alert rule. + string Description { get; set; } + /// + /// 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. + /// + bool? Enabled { 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. + /// + 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/ActionList.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/ActionList.cs deleted file mode 100644 index 650c424c8fe1..000000000000 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/ActionList.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.Monitor.ActivityLogAlert.Models.Api20201001 -{ - 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 - { - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionGroup[] _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; } - - /// Creates an new instance. - public ActionList() - { - - } - } - /// A list of Activity Log Alert rule actions. - public partial interface IActionList : - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IJsonSerializable - { - /// The list of the Action Groups. - [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.Api20201001.IActionGroup) })] - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionGroup[] ActionGroup { get; set; } - - } - /// A list of Activity Log Alert rule actions. - internal partial interface IActionListInternal - - { - /// The list of the Action Groups. - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionGroup[] ActionGroup { get; set; } - - } -} \ No newline at end of file diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/ActivityLogAlertResource.PowerShell.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/ActivityLogAlertResource.PowerShell.cs deleted file mode 100644 index 34397279273b..000000000000 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/ActivityLogAlertResource.PowerShell.cs +++ /dev/null @@ -1,262 +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.Monitor.ActivityLogAlert.Models.Api20201001 -{ - using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PowerShell; - - /// An Activity Log Alert rule resource. - [System.ComponentModel.TypeConverter(typeof(ActivityLogAlertResourceTypeConverter))] - public partial class ActivityLogAlertResource - { - - /// - /// 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 ActivityLogAlertResource(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.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); - } - 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); - } - 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); - } - 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); - } - 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); - } - 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); - } - 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); - } - 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); - } - 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)); - } - 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))); - } - 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); - } - 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)); - } - 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)); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal ActivityLogAlertResource(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.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); - } - 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); - } - 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); - } - 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); - } - 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); - } - 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); - } - 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); - } - 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); - } - 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)); - } - 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))); - } - 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); - } - 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)); - } - 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)); - } - 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.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResource DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new ActivityLogAlertResource(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.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new ActivityLogAlertResource(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.Monitor.ActivityLogAlert.Models.Api20201001.IActivityLogAlertResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.Monitor.ActivityLogAlert.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 Activity Log Alert rule resource. - [System.ComponentModel.TypeConverter(typeof(ActivityLogAlertResourceTypeConverter))] - public partial interface IActivityLogAlertResource - - { - - } -} \ No newline at end of file diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/ActivityLogAlertResource.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/ActivityLogAlertResource.cs deleted file mode 100644 index 0a605e03d696..000000000000 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/ActivityLogAlertResource.cs +++ /dev/null @@ -1,199 +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.Monitor.ActivityLogAlert.Models.Api20201001 -{ - 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.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(); - - /// 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 */; } - - /// 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 */; } - - /// 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; } - - /// - /// 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); } - - /// 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; } - - /// - /// 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; } - - /// 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; } - - /// 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; } - - /// 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;} } } - - /// 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; } - - /// 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; } - - /// 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; } - - /// 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; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.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; } - - /// Gets the resource group name - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.PropertyOrigin.Owned)] - public string ResourceGroupName { get => (new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Success ? new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Groups["resourceGroupName"].Value : null); } - - /// - /// 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.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 */; } - - /// 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 */; } - - /// 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; } - - /// Creates an new instance. - public ActivityLogAlertResource() - { - - } - - /// Validates that this object meets the validation criteria. - /// an instance that will receive validation - /// events. - /// - /// A that will be complete when validation is completed. - /// - public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IEventListener eventListener) - { - await eventListener.AssertNotNull(nameof(__azureResource), __azureResource); - await eventListener.AssertObjectIsValid(nameof(__azureResource), __azureResource); - } - } - /// 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 - { - /// The list of the Action Groups. - [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.Api20201001.IActionGroup) })] - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionGroup[] ActionGroup { get; set; } - /// The list of Activity Log Alert rule conditions. - [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.Api20201001.IAlertRuleAnyOfOrLeafCondition) })] - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleAnyOfOrLeafCondition[] ConditionAllOf { get; set; } - /// A description of this Activity Log Alert rule. - [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) })] - string Description { get; set; } - /// - /// 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.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(bool) })] - bool? Enabled { 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. - /// - [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) })] - string[] Scope { get; set; } - - } - /// An Activity Log Alert rule resource. - internal partial interface IActivityLogAlertResourceInternal : - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResourceInternal - { - /// The actions that will activate when the condition is met. - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionList Action { get; set; } - /// The list of the Action Groups. - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionGroup[] ActionGroup { get; set; } - /// The condition that will cause this alert to activate. - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleAllOfCondition Condition { get; set; } - /// The list of Activity Log Alert rule conditions. - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleAnyOfOrLeafCondition[] ConditionAllOf { get; set; } - /// A description of this Activity Log Alert rule. - string Description { get; set; } - /// - /// 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. - /// - 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; } - /// - /// 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; } - - } -} \ No newline at end of file diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRuleAllOfCondition.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRuleAllOfCondition.cs deleted file mode 100644 index cb6cfd165b7e..000000000000 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRuleAllOfCondition.cs +++ /dev/null @@ -1,53 +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.Monitor.ActivityLogAlert.Models.Api20201001 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Extensions; - - /// - /// 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 - { - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleAnyOfOrLeafCondition[] _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; } - - /// Creates an new instance. - public AlertRuleAllOfCondition() - { - - } - } - /// An Activity Log Alert rule condition that is met when all its member conditions are met. - public partial interface IAlertRuleAllOfCondition : - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IJsonSerializable - { - /// The list of Activity Log Alert rule conditions. - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Info( - Required = true, - 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.Models.Api20201001.IAlertRuleAnyOfOrLeafCondition[] AllOf { get; set; } - - } - /// An Activity Log Alert rule condition that is met when all its member conditions are met. - internal partial interface IAlertRuleAllOfConditionInternal - - { - /// The list of Activity Log Alert rule conditions. - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleAnyOfOrLeafCondition[] AllOf { get; set; } - - } -} \ No newline at end of file diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRuleAnyOfOrLeafCondition.PowerShell.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRuleAnyOfOrLeafCondition.PowerShell.cs deleted file mode 100644 index 3afc7600eea0..000000000000 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRuleAnyOfOrLeafCondition.PowerShell.cs +++ /dev/null @@ -1,204 +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.Monitor.ActivityLogAlert.Models.Api20201001 -{ - using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PowerShell; - - /// - /// An Activity Log Alert rule condition that is met when all its member conditions are met. - /// Each condition can be of one of the following types: - /// __Important__: Each type has its unique subset of properties. Properties from different types CANNOT exist in one condition. - /// * __Leaf Condition -__ must contain 'field' and either 'equals' or 'containsAny'. - /// _Please note, 'anyOf' should __not__ be set in a Leaf Condition._ - /// * __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._ - /// - [System.ComponentModel.TypeConverter(typeof(AlertRuleAnyOfOrLeafConditionTypeConverter))] - public partial class AlertRuleAnyOfOrLeafCondition - { - - /// - /// 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 AlertRuleAnyOfOrLeafCondition(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // 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)); - } - 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); - } - 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); - } - 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)); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal AlertRuleAnyOfOrLeafCondition(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // 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)); - } - 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); - } - 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); - } - 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)); - } - 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.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleAnyOfOrLeafCondition DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new AlertRuleAnyOfOrLeafCondition(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.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleAnyOfOrLeafCondition DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new AlertRuleAnyOfOrLeafCondition(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.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleAnyOfOrLeafCondition FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.Monitor.ActivityLogAlert.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 Activity Log Alert rule condition that is met when all its member conditions are met. - /// Each condition can be of one of the following types: - /// __Important__: Each type has its unique subset of properties. Properties from different types CANNOT exist in one condition. - /// * __Leaf Condition -__ must contain 'field' and either 'equals' or 'containsAny'. - /// _Please note, 'anyOf' should __not__ be set in a Leaf Condition._ - /// * __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._ - [System.ComponentModel.TypeConverter(typeof(AlertRuleAnyOfOrLeafConditionTypeConverter))] - public partial interface IAlertRuleAnyOfOrLeafCondition - - { - - } -} \ No newline at end of file diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRuleList.PowerShell.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRuleList.PowerShell.cs deleted file mode 100644 index e5e635fff8d1..000000000000 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRuleList.PowerShell.cs +++ /dev/null @@ -1,174 +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.Monitor.ActivityLogAlert.Models.Api20201001 -{ - using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PowerShell; - - /// A list of Activity Log Alert rules. - [System.ComponentModel.TypeConverter(typeof(AlertRuleListTypeConverter))] - public partial class AlertRuleList - { - - /// - /// 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 AlertRuleList(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("Value")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.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)); - } - 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); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal AlertRuleList(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("Value")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.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)); - } - 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); - } - 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.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleList DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new AlertRuleList(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.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new AlertRuleList(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.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.Monitor.ActivityLogAlert.Runtime.SerializationMode.IncludeAll)?.ToString(); - - public override string ToString() - { - var returnNow = false; - var result = global::System.String.Empty; - OverrideToString(ref result, ref returnNow); - if (returnNow) - { - return result; - } - return ToJsonString(); - } - } - /// A list of Activity Log Alert rules. - [System.ComponentModel.TypeConverter(typeof(AlertRuleListTypeConverter))] - public partial interface IAlertRuleList - - { - - } -} \ No newline at end of file diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRulePatchObject.PowerShell.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRulePatchObject.PowerShell.cs deleted file mode 100644 index 764b5b67e20d..000000000000 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRulePatchObject.PowerShell.cs +++ /dev/null @@ -1,182 +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.Monitor.ActivityLogAlert.Models.Api20201001 -{ - using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PowerShell; - - /// An Activity Log Alert rule object for the body of patch operations. - [System.ComponentModel.TypeConverter(typeof(AlertRulePatchObjectTypeConverter))] - public partial class AlertRulePatchObject - { - - /// - /// 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 AlertRulePatchObject(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.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); - } - 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); - } - 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))); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal AlertRulePatchObject(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.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); - } - 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); - } - 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))); - } - 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.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePatchObject DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new AlertRulePatchObject(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.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePatchObject DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new AlertRulePatchObject(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.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePatchObject FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.Monitor.ActivityLogAlert.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 Activity Log Alert rule object for the body of patch operations. - [System.ComponentModel.TypeConverter(typeof(AlertRulePatchObjectTypeConverter))] - public partial interface IAlertRulePatchObject - - { - - } -} \ No newline at end of file diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRulePatchObject.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRulePatchObject.cs deleted file mode 100644 index 18b4afd8cdac..000000000000 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRulePatchObject.cs +++ /dev/null @@ -1,86 +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.Monitor.ActivityLogAlert.Models.Api20201001 -{ - 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 - { - - /// - /// 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.IAlertRulePatchPropertiesInternal)Property).Enabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.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;} } } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.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; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.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; } - - /// Creates an new instance. - public AlertRulePatchObject() - { - - } - } - /// An Activity Log Alert rule object for the body of patch operations. - public partial interface IAlertRulePatchObject : - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IJsonSerializable - { - /// - /// 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.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(bool) })] - bool? Enabled { get; set; } - /// The resource tags - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Info( - Required = false, - ReadOnly = false, - 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; } - - } - /// An Activity Log Alert rule object for the body of patch operations. - internal partial interface IAlertRulePatchObjectInternal - - { - /// - /// 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. - /// - 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; } - /// The resource tags - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRulePatchObjectTags Tag { get; set; } - - } -} \ No newline at end of file diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRuleProperties.PowerShell.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRuleProperties.PowerShell.cs deleted file mode 100644 index b873f77ac568..000000000000 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRuleProperties.PowerShell.cs +++ /dev/null @@ -1,214 +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.Monitor.ActivityLogAlert.Models.Api20201001 -{ - using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PowerShell; - - /// An Azure Activity Log Alert rule. - [System.ComponentModel.TypeConverter(typeof(AlertRulePropertiesTypeConverter))] - public partial class AlertRuleProperties - { - - /// - /// 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 AlertRuleProperties(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // 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); - } - 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); - } - 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)); - } - 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))); - } - 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); - } - 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)); - } - 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)); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal AlertRuleProperties(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // 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); - } - 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); - } - 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)); - } - 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))); - } - 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); - } - 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)); - } - 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)); - } - 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.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new AlertRuleProperties(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.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new AlertRuleProperties(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.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.Monitor.ActivityLogAlert.Runtime.SerializationMode.IncludeAll)?.ToString(); - - public override string ToString() - { - var returnNow = false; - var result = global::System.String.Empty; - OverrideToString(ref result, ref returnNow); - if (returnNow) - { - return result; - } - return ToJsonString(); - } - } - /// An Azure Activity Log Alert rule. - [System.ComponentModel.TypeConverter(typeof(AlertRulePropertiesTypeConverter))] - public partial interface IAlertRuleProperties - - { - - } -} \ No newline at end of file diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRuleProperties.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRuleProperties.cs deleted file mode 100644 index f2eb91582334..000000000000 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AlertRuleProperties.cs +++ /dev/null @@ -1,155 +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.Monitor.ActivityLogAlert.Models.Api20201001 -{ - 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 - { - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.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; } - - /// 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 */; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.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; } - - /// 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 ; } - - /// Backing field for property. - private string _description; - - /// A description of this Activity Log Alert rule. - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.PropertyOrigin.Owned)] - public string Description { get => this._description; set => this._description = value; } - - /// Backing field for property. - private bool? _enabled; - - /// - /// 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.Owned)] - 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;} } } - - /// 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;} } } - - /// Backing field for property. - private string[] _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; } - - /// Creates an new instance. - public AlertRuleProperties() - { - - } - } - /// An Azure Activity Log Alert rule. - public partial interface IAlertRuleProperties : - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IJsonSerializable - { - /// The list of the Action Groups. - [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.Api20201001.IActionGroup) })] - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionGroup[] ActionGroup { get; set; } - /// The list of Activity Log Alert rule conditions. - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Info( - Required = true, - 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.Models.Api20201001.IAlertRuleAnyOfOrLeafCondition[] ConditionAllOf { get; set; } - /// A description of this Activity Log Alert rule. - [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) })] - string Description { get; set; } - /// - /// 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.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(bool) })] - bool? Enabled { 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. - /// - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Info( - Required = true, - 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) })] - string[] Scope { get; set; } - - } - /// An Azure Activity Log Alert rule. - 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; } - /// The list of the Action Groups. - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IActionGroup[] ActionGroup { get; set; } - /// The condition that will cause this alert to activate. - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleAllOfCondition Condition { get; set; } - /// The list of Activity Log Alert rule conditions. - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IAlertRuleAnyOfOrLeafCondition[] ConditionAllOf { get; set; } - /// A description of this Activity Log Alert rule. - string Description { get; set; } - /// - /// 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. - /// - bool? Enabled { 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; } - - } -} \ No newline at end of file diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AzureResource.PowerShell.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AzureResource.PowerShell.cs deleted file mode 100644 index 89d9946ddcfa..000000000000 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/AzureResource.PowerShell.cs +++ /dev/null @@ -1,198 +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.Monitor.ActivityLogAlert.Models.Api20201001 -{ - using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PowerShell; - - /// An Azure resource object. - [System.ComponentModel.TypeConverter(typeof(AzureResourceTypeConverter))] - public partial class AzureResource - { - - /// - /// 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 AzureResource(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.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); - } - 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); - } - 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); - } - 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); - } - 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); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal AzureResource(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.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); - } - 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); - } - 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); - } - 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); - } - 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); - } - 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.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResource DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new AzureResource(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.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new AzureResource(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.Monitor.ActivityLogAlert.Models.Api20201001.IAzureResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.Monitor.ActivityLogAlert.Runtime.SerializationMode.IncludeAll)?.ToString(); - - public override string ToString() - { - var returnNow = false; - var result = global::System.String.Empty; - OverrideToString(ref result, ref returnNow); - if (returnNow) - { - return result; - } - return ToJsonString(); - } - } - /// An Azure resource object. - [System.ComponentModel.TypeConverter(typeof(AzureResourceTypeConverter))] - public partial interface IAzureResource - - { - - } -} \ No newline at end of file diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/ErrorResponse.PowerShell.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/ErrorResponse.PowerShell.cs deleted file mode 100644 index 856a168cbf56..000000000000 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/ErrorResponse.PowerShell.cs +++ /dev/null @@ -1,174 +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.Monitor.ActivityLogAlert.Models.Api20201001 -{ - using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PowerShell; - - /// The error response. - [System.ComponentModel.TypeConverter(typeof(ErrorResponseTypeConverter))] - public partial class ErrorResponse - { - - /// - /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the - /// object before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Collections.IDictionary content that should be used. - - partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); - - /// - /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object - /// before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Management.Automation.PSObject content that should be used. - - partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); - - /// - /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Collections.IDictionary content that should be used. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); - - /// - /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Management.Automation.PSObject content that should be used. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); - - /// - /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior - /// - /// /// instance serialized to a string, normally it is a Json - /// /// set returnNow to true if you provide a customized OverrideToString function - - partial void OverrideToString(ref string stringResult, ref bool returnNow); - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IErrorResponse DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new ErrorResponse(content); - } - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IErrorResponse DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new ErrorResponse(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal ErrorResponse(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("Code")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.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); - } - 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); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal ErrorResponse(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("Code")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.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); - } - 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); - } - 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.Monitor.ActivityLogAlert.Models.Api20201001.IErrorResponse FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.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.Monitor.ActivityLogAlert.Runtime.SerializationMode.IncludeAll)?.ToString(); - - public override string ToString() - { - var returnNow = false; - var result = global::System.String.Empty; - OverrideToString(ref result, ref returnNow); - if (returnNow) - { - return result; - } - return ToJsonString(); - } - } - /// The error response. - [System.ComponentModel.TypeConverter(typeof(ErrorResponseTypeConverter))] - public partial interface IErrorResponse - - { - - } -} \ No newline at end of file diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/ErrorResponse.TypeConverter.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/ErrorResponse.TypeConverter.cs deleted file mode 100644 index 3a6bbc66006a..000000000000 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/ErrorResponse.TypeConverter.cs +++ /dev/null @@ -1,147 +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.Monitor.ActivityLogAlert.Models.Api20201001 -{ - using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PowerShell; - - /// - /// A PowerShell PSTypeConverter to support converting to an instance of - /// - public partial class ErrorResponseTypeConverter : global::System.Management.Automation.PSTypeConverter - { - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false. - /// - public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); - - /// - /// Determines if the converter can convert the parameter to the - /// type. - /// - /// the instance to check if it can be converted to the type. - /// - /// true if the instance could be converted to a type, otherwise false - /// - public static bool CanConvertFrom(dynamic sourceValue) - { - if (null == sourceValue) - { - return true; - } - global::System.Type type = sourceValue.GetType(); - if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) - { - // we say yest to PSObjects - return true; - } - if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) - { - // we say yest to Hashtables/dictionaries - return true; - } - try - { - if (null != sourceValue.ToJsonString()) - { - return true; - } - } - catch - { - // Not one of our objects - } - try - { - string text = sourceValue.ToString()?.Trim(); - return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonType.Object; - } - catch - { - // Doesn't look like it can be treated as JSON - } - return false; - } - - /// - /// Determines if the parameter can be converted to the - /// parameter - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false - /// - public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; - - /// - /// Converts the parameter to the parameter using and - /// - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// - /// an instance of , or null if there is no suitable conversion. - /// - public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); - - /// - /// Converts the parameter into an instance of - /// - /// the value to convert into an instance of . - /// - /// an instance of , or null if there is no suitable conversion. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.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)) - { - return sourceValue; - } - try - { - return ErrorResponse.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; - } - catch - { - // Unable to use JSON pattern - } - if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) - { - return ErrorResponse.DeserializeFromPSObject(sourceValue); - } - if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) - { - return ErrorResponse.DeserializeFromDictionary(sourceValue); - } - return null; - } - - /// NotImplemented -- this will return null - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// will always return null. - public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; - } -} \ No newline at end of file diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/ErrorResponse.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/ErrorResponse.cs deleted file mode 100644 index 5230946a87b0..000000000000 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/ErrorResponse.cs +++ /dev/null @@ -1,74 +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.Monitor.ActivityLogAlert.Models.Api20201001 -{ - 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 - { - - /// Backing field for property. - private string _code; - - /// The error code. - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.PropertyOrigin.Owned)] - public string Code { get => this._code; } - - /// Backing field for property. - private string _message; - - /// The error message indicating why the operation failed. - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.PropertyOrigin.Owned)] - 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;} } } - - /// Internal Acessors for Message - string Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IErrorResponseInternal.Message { get => this._message; set { {_message = value;} } } - - /// Creates an new instance. - public ErrorResponse() - { - - } - } - /// The error response. - public partial interface IErrorResponse : - Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IJsonSerializable - { - /// The error code. - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The error code.", - SerializedName = @"code", - PossibleTypes = new [] { typeof(string) })] - string Code { get; } - /// The error message indicating why the operation failed. - [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The error message indicating why the operation failed.", - SerializedName = @"message", - PossibleTypes = new [] { typeof(string) })] - string Message { get; } - - } - /// The error response. - internal partial interface IErrorResponseInternal - - { - /// The error code. - string Code { get; set; } - /// The error message indicating why the operation failed. - string Message { get; set; } - - } -} \ No newline at end of file diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/ErrorResponse.json.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/ErrorResponse.json.cs deleted file mode 100644 index 305deb8c1476..000000000000 --- a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/Api20201001/ErrorResponse.json.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.Monitor.ActivityLogAlert.Models.Api20201001 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Extensions; - - /// The error response. - public partial class ErrorResponse - { - - /// - /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object - /// before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The JsonNode that should be deserialized into this object. - - partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonObject json); - - /// - /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The JSON container that the serialization result will be placed in. - - partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonObject container); - - /// - /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of - /// the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the - /// output parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The JsonNode that should be deserialized into this object. - /// Determines if the rest of the deserialization should be processed, or if the method should return - /// instantly. - - partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonObject json, ref bool returnNow); - - /// - /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the - /// object before it is serialized. - /// If you wish to disable the default serialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The JSON container that the serialization result will be placed in. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonObject container, ref bool returnNow); - - /// - /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonObject into a new instance of . - /// - /// A Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonObject instance to deserialize from. - internal ErrorResponse(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonObject json) - { - bool returnNow = false; - BeforeFromJson(json, ref returnNow); - if (returnNow) - { - return; - } - {_code = If( json?.PropertyT("code"), out var __jsonCode) ? (string)__jsonCode : (string)Code;} - {_message = If( json?.PropertyT("message"), out var __jsonMessage) ? (string)__jsonMessage : (string)Message;} - AfterFromJson(json); - } - - /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IErrorResponse. - /// - /// a to deserialize from. - /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.IErrorResponse. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.Api20201001.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; - } - - /// - /// Serializes this instance of into a . - /// - /// The container to serialize this object into. If the caller - /// passes in null, a new instance will be created and returned to the caller. - /// Allows the caller to choose the depth of the serialization. See . - /// - /// a serialized instance of as a . - /// - public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.SerializationMode serializationMode) - { - container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonObject(); - - bool returnNow = false; - BeforeToJson(ref container, ref returnNow); - if (returnNow) - { - return container; - } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.SerializationMode.IncludeReadOnly)) - { - 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)) - { - 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 ); - } - AfterToJson(ref container); - return container; - } - } -} \ No newline at end of file diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AzureResource.PowerShell.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AzureResource.PowerShell.cs new file mode 100644 index 000000000000..2ce95afb60fb --- /dev/null +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/AzureResource.PowerShell.cs @@ -0,0 +1,196 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PowerShell; + + /// An Azure resource object. + [System.ComponentModel.TypeConverter(typeof(AzureResourceTypeConverter))] + public partial class AzureResource + { + + /// + /// 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 AzureResource(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.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.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.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.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.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 . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal AzureResource(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.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.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.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.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.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 . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + 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 . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IAzureResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new AzureResource(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.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. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } + } + /// An Azure resource object. + [System.ComponentModel.TypeConverter(typeof(AzureResourceTypeConverter))] + public partial interface IAzureResource + + { + + } +} \ No newline at end of file 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/ErrorResponse.PowerShell.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/ErrorResponse.PowerShell.cs new file mode 100644 index 000000000000..0f6c36d9daf2 --- /dev/null +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/ErrorResponse.PowerShell.cs @@ -0,0 +1,172 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PowerShell; + + /// The error response. + [System.ComponentModel.TypeConverter(typeof(ErrorResponseTypeConverter))] + public partial class ErrorResponse + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IErrorResponse DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ErrorResponse(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IErrorResponse DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ErrorResponse(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ErrorResponse(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Code")) + { + ((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.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 . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ErrorResponse(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Code")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.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.IErrorResponseInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IErrorResponseInternal)this).Message, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.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. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } + } + /// The error response. + [System.ComponentModel.TypeConverter(typeof(ErrorResponseTypeConverter))] + public partial interface IErrorResponse + + { + + } +} \ No newline at end of file diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/ErrorResponse.TypeConverter.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/ErrorResponse.TypeConverter.cs new file mode 100644 index 000000000000..57ecfa245484 --- /dev/null +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/ErrorResponse.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ErrorResponseTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.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.IErrorResponse).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ErrorResponse.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ErrorResponse.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ErrorResponse.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/ErrorResponse.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/ErrorResponse.cs new file mode 100644 index 000000000000..1e6effd0dabc --- /dev/null +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/ErrorResponse.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.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.IErrorResponse, + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IErrorResponseInternal + { + + /// Backing field for property. + private string _code; + + /// The error code. + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.PropertyOrigin.Owned)] + public string Code { get => this._code; } + + /// Backing field for property. + private string _message; + + /// The error message indicating why the operation failed. + [Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Origin(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.PropertyOrigin.Owned)] + public string Message { get => this._message; } + + /// Internal Acessors for Code + 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.IErrorResponseInternal.Message { get => this._message; set { {_message = value;} } } + + /// Creates an new instance. + public ErrorResponse() + { + + } + } + /// The error response. + public partial interface IErrorResponse : + Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.IJsonSerializable + { + /// The error code. + [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) })] + string Code { get; } + /// The error message indicating why the operation failed. + [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) })] + string Message { get; } + + } + /// The error response. + internal partial interface IErrorResponseInternal + + { + /// The error code. + string Code { get; set; } + /// The error message indicating why the operation failed. + string Message { get; set; } + + } +} \ No newline at end of file diff --git a/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/ErrorResponse.json.cs b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/ErrorResponse.json.cs new file mode 100644 index 000000000000..43f49f3d4637 --- /dev/null +++ b/generated/Monitor/ActivityLogAlert.Autorest/generated/api/Models/ErrorResponse.json.cs @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Extensions; + + /// The error response. + public partial class ErrorResponse + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonObject instance to deserialize from. + internal ErrorResponse(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_code = If( json?.PropertyT("code"), out var __jsonCode) ? (string)__jsonCode : (string)_code;} + {_message = If( json?.PropertyT("message"), out var __jsonMessage) ? (string)__jsonMessage : (string)_message;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IErrorResponse. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Models.IErrorResponse. + /// + 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; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Monitor.ActivityLogAlert.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + 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.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 ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file 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/NetworkCloud/NetworkCloud.Autorest/Az.NetworkCloud.format.ps1xml b/generated/NetworkCloud/NetworkCloud.Autorest/Az.NetworkCloud.format.ps1xml index b5078fa463e0..3a070ed08c10 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/Az.NetworkCloud.format.ps1xml +++ b/generated/NetworkCloud/NetworkCloud.Autorest/Az.NetworkCloud.format.ps1xml @@ -2,525 +2,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.NetworkCloudIdentity - - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.NetworkCloudIdentity - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - AgentPoolName - - - BareMetalMachineKeySetName - - - BareMetalMachineName - - - BmcKeySetName - - - CloudServicesNetworkName - - - ClusterManagerName - - - ClusterName - - - ConsoleName - - - FeatureName - - - KubernetesClusterName - - - L2NetworkName - - - L3NetworkName - - - MetricsConfigurationName - - - RackName - - - RackSkuName - - - ResourceGroupName - - - StorageApplianceName - - - SubscriptionId - - - TrunkedNetworkName - - - VirtualMachineName - - - VolumeName - - - - - - - - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ErrorDetail - - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ErrorDetail - - - - - - - - - - - - - - - - - - Code - - - Message - - - Target - - - - - - - - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ManagedServiceIdentity - - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ManagedServiceIdentity - - - - - - - - - - - - - - - PrincipalId - - - TenantId - - - - - - - - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.Operation - - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.Operation - - - - - - - - - - - - - - - - - - - - - ActionType - - - IsDataAction - - - Name - - - Origin - - - - - - - - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.OperationDisplay - - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.OperationDisplay - - - - - - - - - - - - - - - - - - - - - Description - - - Operation - - - Provider - - - Resource - - - - - - - - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.OperationListResult - - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.OperationListResult - - - - - - - - - - - - NextLink - - - - - - - - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.Resource - - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.Resource - - - - - - - - - - - - Name - - - - - - - - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.SystemData - - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.SystemData - - - - - - - - - - - - - - - - - - - - - - - - - - - CreatedAt - - - CreatedBy - - - CreatedByType - - - LastModifiedAt - - - LastModifiedBy - - - LastModifiedByType - - - - - - - - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.TrackedResource - - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.TrackedResource - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Name - - - SystemDataCreatedAt - - - SystemDataCreatedBy - - - SystemDataCreatedByType - - - SystemDataLastModifiedAt - - - SystemDataLastModifiedBy - - - SystemDataLastModifiedByType - - - Location - - - - - - - - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.TrackedResourceTags - - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.TrackedResourceTags - - - - - - - - - - - - Item - - - - - - - - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.UserAssignedIdentity - - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.UserAssignedIdentity - - - - - - - - - - - - - - - ClientId - - - PrincipalId - - - - - - - - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AadConfiguration - - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AadConfiguration - - - - - - - - - - - - AdminGroupObjectId - - - - - - - - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AdministrativeCredentials + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AdministrativeCredentials - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AdministrativeCredentials + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AdministrativeCredentials#Multiple @@ -540,9 +24,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AdministratorConfiguration + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AdministratorConfiguration - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AdministratorConfiguration + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AdministratorConfiguration#Multiple @@ -562,9 +46,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AgentOptions + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AgentOptions - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AgentOptions + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AgentOptions#Multiple @@ -590,9 +74,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AgentPool + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AgentPool - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AgentPool + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AgentPool#Multiple @@ -666,15 +150,12 @@ - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AgentPoolConfiguration + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AgentPoolConfiguration - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AgentPoolConfiguration + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AgentPoolConfiguration#Multiple - - - @@ -688,9 +169,6 @@ - - AvailabilityZone - Count @@ -706,9 +184,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AgentPoolList + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AgentPoolList - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AgentPoolList + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AgentPoolList#Multiple @@ -728,9 +206,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AgentPoolPatchParametersTags + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AgentPoolPatchParametersTags - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AgentPoolPatchParametersTags + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AgentPoolPatchParametersTags#Multiple @@ -750,9 +228,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AgentPoolPatchProperties + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AgentPoolPatchProperties - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AgentPoolPatchProperties + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AgentPoolPatchProperties#Multiple @@ -772,15 +250,12 @@ - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AgentPoolProperties + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AgentPoolProperties - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AgentPoolProperties + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AgentPoolProperties#Multiple - - - @@ -806,9 +281,6 @@ - - AvailabilityZone - Count @@ -836,9 +308,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AgentPoolUpgradeSettings + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AgentPoolUpgradeSettings - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AgentPoolUpgradeSettings + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AgentPoolUpgradeSettings#Multiple @@ -870,9 +342,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AnalyticsOutputSettings + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AnalyticsOutputSettings - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AnalyticsOutputSettings + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AnalyticsOutputSettings#Multiple @@ -892,9 +364,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AvailableUpgrade + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AvailableUpgrade - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AvailableUpgrade + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AvailableUpgrade#Multiple @@ -920,9 +392,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BareMetalMachine + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BareMetalMachine - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BareMetalMachine + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BareMetalMachine#Multiple @@ -996,15 +468,12 @@ - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BareMetalMachineCommandSpecification + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BareMetalMachineCommandSpecification - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BareMetalMachineCommandSpecification + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BareMetalMachineCommandSpecification#Multiple - - - @@ -1012,9 +481,6 @@ - - Argument - Command @@ -1024,9 +490,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BareMetalMachineConfigurationData + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BareMetalMachineConfigurationData - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BareMetalMachineConfigurationData + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BareMetalMachineConfigurationData#Multiple @@ -1082,9 +548,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BareMetalMachineCordonParameters + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BareMetalMachineCordonParameters - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BareMetalMachineCordonParameters + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BareMetalMachineCordonParameters#Multiple @@ -1104,9 +570,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BareMetalMachineKeySet + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BareMetalMachineKeySet - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BareMetalMachineKeySet + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BareMetalMachineKeySet#Multiple @@ -1180,9 +646,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BareMetalMachineKeySetList + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BareMetalMachineKeySetList - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BareMetalMachineKeySetList + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BareMetalMachineKeySetList#Multiple @@ -1202,9 +668,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BareMetalMachineKeySetPatchParametersTags + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BareMetalMachineKeySetPatchParametersTags - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BareMetalMachineKeySetPatchParametersTags + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BareMetalMachineKeySetPatchParametersTags#Multiple @@ -1224,18 +690,15 @@ - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BareMetalMachineKeySetPatchProperties + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BareMetalMachineKeySetPatchProperties - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BareMetalMachineKeySetPatchProperties + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BareMetalMachineKeySetPatchProperties#Multiple - - - @@ -1243,18 +706,15 @@ Expiration - - JumpHostsAllowed - - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BareMetalMachineKeySetProperties + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BareMetalMachineKeySetProperties - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BareMetalMachineKeySetProperties + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BareMetalMachineKeySetProperties#Multiple @@ -1270,9 +730,6 @@ - - - @@ -1301,9 +758,6 @@ Expiration - - JumpHostsAllowed - LastValidation @@ -1322,9 +776,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BareMetalMachineList + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BareMetalMachineList - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BareMetalMachineList + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BareMetalMachineList#Multiple @@ -1344,9 +798,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BareMetalMachinePatchParametersTags + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BareMetalMachinePatchParametersTags - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BareMetalMachinePatchParametersTags + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BareMetalMachinePatchParametersTags#Multiple @@ -1366,9 +820,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BareMetalMachinePatchProperties + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BareMetalMachinePatchProperties - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BareMetalMachinePatchProperties + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BareMetalMachinePatchProperties#Multiple @@ -1388,9 +842,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BareMetalMachinePowerOffParameters + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BareMetalMachinePowerOffParameters - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BareMetalMachinePowerOffParameters + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BareMetalMachinePowerOffParameters#Multiple @@ -1410,15 +864,12 @@ - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BareMetalMachineProperties + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BareMetalMachineProperties - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BareMetalMachineProperties + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BareMetalMachineProperties#Multiple - - - @@ -1440,9 +891,6 @@ - - - @@ -1458,9 +906,6 @@ - - - @@ -1494,16 +939,10 @@ - - - - - AssociatedResourceId - BmcConnectionString @@ -1525,9 +964,6 @@ DetailedStatusMessage - - HybridAksClustersAssociatedId - KubernetesNodeName @@ -1543,9 +979,6 @@ MachineName - - MachineRole - MachineSkuId @@ -1579,18 +1012,15 @@ ServiceTag - - VirtualMachinesAssociatedId - - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BareMetalMachineReplaceParameters + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BareMetalMachineReplaceParameters - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BareMetalMachineReplaceParameters + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BareMetalMachineReplaceParameters#Multiple @@ -1628,15 +1058,12 @@ - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BareMetalMachineRunCommandParameters + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BareMetalMachineRunCommandParameters - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BareMetalMachineRunCommandParameters + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BareMetalMachineRunCommandParameters#Multiple - - - @@ -1647,9 +1074,6 @@ - - Argument - LimitTimeSecond @@ -1662,9 +1086,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BareMetalMachineRunDataExtractsParameters + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BareMetalMachineRunDataExtractsParameters - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BareMetalMachineRunDataExtractsParameters + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BareMetalMachineRunDataExtractsParameters#Multiple @@ -1684,9 +1108,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BareMetalMachineRunReadCommandsParameters + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BareMetalMachineRunReadCommandsParameters - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BareMetalMachineRunReadCommandsParameters + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BareMetalMachineRunReadCommandsParameters#Multiple @@ -1706,24 +1130,15 @@ - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BgpAdvertisement + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BgpAdvertisement - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BgpAdvertisement + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BgpAdvertisement#Multiple - - - - - - - - - @@ -1731,24 +1146,15 @@ AdvertiseToFabric - - Community - - - IPAddressPool - - - Peer - - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BgpServiceLoadBalancerConfiguration + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BgpServiceLoadBalancerConfiguration - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BgpServiceLoadBalancerConfiguration + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BgpServiceLoadBalancerConfiguration#Multiple @@ -1768,9 +1174,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BmcKeySet + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BmcKeySet - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BmcKeySet + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BmcKeySet#Multiple @@ -1844,9 +1250,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BmcKeySetList + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BmcKeySetList - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BmcKeySetList + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BmcKeySetList#Multiple @@ -1866,9 +1272,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BmcKeySetPatchParametersTags + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BmcKeySetPatchParametersTags - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BmcKeySetPatchParametersTags + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BmcKeySetPatchParametersTags#Multiple @@ -1888,9 +1294,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BmcKeySetPatchProperties + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BmcKeySetPatchProperties - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BmcKeySetPatchProperties + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BmcKeySetPatchProperties#Multiple @@ -1910,9 +1316,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BmcKeySetProperties + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BmcKeySetProperties - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BmcKeySetProperties + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BmcKeySetProperties#Multiple @@ -1968,9 +1374,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.CloudServicesNetwork + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.CloudServicesNetwork - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.CloudServicesNetwork + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.CloudServicesNetwork#Multiple @@ -2044,9 +1450,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.CloudServicesNetworkList + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.CloudServicesNetworkList - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.CloudServicesNetworkList + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.CloudServicesNetworkList#Multiple @@ -2066,9 +1472,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.CloudServicesNetworkPatchParametersTags + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.CloudServicesNetworkPatchParametersTags - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.CloudServicesNetworkPatchParametersTags + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.CloudServicesNetworkPatchParametersTags#Multiple @@ -2088,9 +1494,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.CloudServicesNetworkPatchProperties + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.CloudServicesNetworkPatchProperties - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.CloudServicesNetworkPatchProperties + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.CloudServicesNetworkPatchProperties#Multiple @@ -2110,15 +1516,12 @@ - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.CloudServicesNetworkProperties + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.CloudServicesNetworkProperties - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.CloudServicesNetworkProperties + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.CloudServicesNetworkProperties#Multiple - - - @@ -2131,25 +1534,16 @@ - - - - - - - - AssociatedResourceId - ClusterId @@ -2162,27 +1556,21 @@ EnableDefaultEgressEndpoint - - HybridAksClustersAssociatedId - InterfaceName ProvisioningState - - VirtualMachinesAssociatedId - - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.Cluster + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Cluster - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.Cluster + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Cluster#Multiple @@ -2256,9 +1644,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ClusterAvailableUpgradeVersion + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterAvailableUpgradeVersion - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ClusterAvailableUpgradeVersion + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterAvailableUpgradeVersion#Multiple @@ -2308,9 +1696,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ClusterAvailableVersion + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterAvailableVersion - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ClusterAvailableVersion + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterAvailableVersion#Multiple @@ -2336,9 +1724,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ClusterCapacity + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterCapacity - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ClusterCapacity + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterCapacity#Multiple @@ -2384,37 +1772,15 @@ TotalApplianceStorageGb - - - TotalCoreCount - - - TotalHostStorageGb - - - TotalMemoryGb - - - - - - - - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ClusterContinueUpdateVersionParameters - - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ClusterContinueUpdateVersionParameters - - - - - - - - - - + - MachineGroupTargetingMode + TotalCoreCount + + + TotalHostStorageGb + + + TotalMemoryGb @@ -2422,21 +1788,21 @@ - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ClusterDeployParameters + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterContinueUpdateVersionParameters - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ClusterDeployParameters + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterContinueUpdateVersionParameters#Multiple - + - SkipValidationsForMachine + MachineGroupTargetingMode @@ -2444,9 +1810,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ClusterList + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterList - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ClusterList + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterList#Multiple @@ -2466,9 +1832,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ClusterManager + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterManager - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ClusterManager + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterManager#Multiple @@ -2542,9 +1908,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ClusterManagerList + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterManagerList - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ClusterManagerList + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterManagerList#Multiple @@ -2564,9 +1930,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ClusterManagerPatchParametersTags + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterManagerPatchParametersTags - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ClusterManagerPatchParametersTags + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterManagerPatchParametersTags#Multiple @@ -2586,18 +1952,15 @@ - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ClusterManagerProperties + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterManagerProperties - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ClusterManagerProperties + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterManagerProperties#Multiple - - - @@ -2620,9 +1983,6 @@ AnalyticsWorkspaceId - - AvailabilityZone - DetailedStatus @@ -2644,9 +2004,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ClusterMetricsConfiguration + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterMetricsConfiguration - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ClusterMetricsConfiguration + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterMetricsConfiguration#Multiple @@ -2720,9 +2080,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ClusterMetricsConfigurationList + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterMetricsConfigurationList - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ClusterMetricsConfigurationList + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterMetricsConfigurationList#Multiple @@ -2742,9 +2102,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ClusterMetricsConfigurationPatchParametersTags + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterMetricsConfigurationPatchParametersTags - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ClusterMetricsConfigurationPatchParametersTags + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterMetricsConfigurationPatchParametersTags#Multiple @@ -2764,18 +2124,15 @@ - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ClusterMetricsConfigurationPatchProperties + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterMetricsConfigurationPatchProperties - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ClusterMetricsConfigurationPatchProperties + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterMetricsConfigurationPatchProperties#Multiple - - - @@ -2783,18 +2140,15 @@ CollectionInterval - - EnabledMetric - - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ClusterMetricsConfigurationProperties + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterMetricsConfigurationProperties - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ClusterMetricsConfigurationProperties + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterMetricsConfigurationProperties#Multiple @@ -2807,12 +2161,6 @@ - - - - - - @@ -2829,12 +2177,6 @@ DetailedStatusMessage - - DisabledMetric - - - EnabledMetric - ProvisioningState @@ -2844,9 +2186,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ClusterPatchParametersTags + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterPatchParametersTags - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ClusterPatchParametersTags + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterPatchParametersTags#Multiple @@ -2866,9 +2208,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ClusterPatchProperties + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterPatchProperties - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ClusterPatchProperties + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterPatchProperties#Multiple @@ -2888,9 +2230,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ClusterProperties + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterProperties - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ClusterProperties + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterProperties#Multiple @@ -2933,9 +2275,6 @@ - - - @@ -2979,18 +2318,15 @@ SupportExpiryDate - - WorkloadResourceId - - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ClusterScanRuntimeParameters + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterScanRuntimeParameters - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ClusterScanRuntimeParameters + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterScanRuntimeParameters#Multiple @@ -3010,9 +2346,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ClusterSecretArchive + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterSecretArchive - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ClusterSecretArchive + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterSecretArchive#Multiple @@ -3038,9 +2374,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ClusterUpdateStrategy + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterUpdateStrategy - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ClusterUpdateStrategy + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterUpdateStrategy#Multiple @@ -3084,9 +2420,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ClusterUpdateVersionParameters + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterUpdateVersionParameters - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ClusterUpdateVersionParameters + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterUpdateVersionParameters#Multiple @@ -3106,9 +2442,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.CommandOutputSettings + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.CommandOutputSettings - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.CommandOutputSettings + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.CommandOutputSettings#Multiple @@ -3128,9 +2464,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.Console + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Console - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.Console + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Console#Multiple @@ -3204,9 +2540,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ConsoleList + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ConsoleList - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ConsoleList + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ConsoleList#Multiple @@ -3226,9 +2562,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ConsolePatchParametersTags + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ConsolePatchParametersTags - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ConsolePatchParametersTags + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ConsolePatchParametersTags#Multiple @@ -3248,9 +2584,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ConsolePatchProperties + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ConsolePatchProperties - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ConsolePatchProperties + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ConsolePatchProperties#Multiple @@ -3276,9 +2612,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ConsoleProperties + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ConsoleProperties - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ConsoleProperties + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ConsoleProperties#Multiple @@ -3334,15 +2670,12 @@ - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ControlPlaneNodeConfiguration + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ControlPlaneNodeConfiguration - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ControlPlaneNodeConfiguration + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ControlPlaneNodeConfiguration#Multiple - - - @@ -3353,9 +2686,6 @@ - - AvailabilityZone - Count @@ -3368,9 +2698,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ControlPlaneNodePatchConfiguration + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ControlPlaneNodePatchConfiguration - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ControlPlaneNodePatchConfiguration + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ControlPlaneNodePatchConfiguration#Multiple @@ -3390,9 +2720,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.EgressEndpoint + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.EgressEndpoint - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.EgressEndpoint + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.EgressEndpoint#Multiple @@ -3412,9 +2742,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.EndpointDependency + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.EndpointDependency - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.EndpointDependency + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.EndpointDependency#Multiple @@ -3440,9 +2770,43 @@ - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ExtendedLocation + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorDetail + + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorDetail#Multiple + + + + + + + + + + + + + + + + + + Code + + + Message + + + Target + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ExtendedLocation - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ExtendedLocation + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ExtendedLocation#Multiple @@ -3462,9 +2826,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.FeatureStatus + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.FeatureStatus - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.FeatureStatus + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.FeatureStatus#Multiple @@ -3502,9 +2866,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.HardwareInventory + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.HardwareInventory - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.HardwareInventory + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.HardwareInventory#Multiple @@ -3524,9 +2888,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.HardwareInventoryNetworkInterface + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.HardwareInventoryNetworkInterface - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.HardwareInventoryNetworkInterface + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.HardwareInventoryNetworkInterface#Multiple @@ -3564,9 +2928,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.HardwareValidationStatus + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.HardwareValidationStatus - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.HardwareValidationStatus + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.HardwareValidationStatus#Multiple @@ -3592,9 +2956,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IdentitySelector + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IdentitySelector - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IdentitySelector + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IdentitySelector#Multiple @@ -3620,9 +2984,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ImageRepositoryCredentials + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ImageRepositoryCredentials - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ImageRepositoryCredentials + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ImageRepositoryCredentials#Multiple @@ -3648,15 +3012,12 @@ - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.InitialAgentPoolConfiguration + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.InitialAgentPoolConfiguration - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.InitialAgentPoolConfiguration + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.InitialAgentPoolConfiguration#Multiple - - - @@ -3673,9 +3034,6 @@ - - AvailabilityZone - Count @@ -3694,15 +3052,12 @@ - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IPAddressPool + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IPAddressPool - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IPAddressPool + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IPAddressPool#Multiple - - - @@ -3716,9 +3071,6 @@ - - Address - AutoAssign @@ -3734,9 +3086,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.KeySetUser + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.KeySetUser - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.KeySetUser + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.KeySetUser#Multiple @@ -3768,9 +3120,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.KeySetUserStatus + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.KeySetUserStatus - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.KeySetUserStatus + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.KeySetUserStatus#Multiple @@ -3802,9 +3154,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.KubernetesCluster + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.KubernetesCluster - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.KubernetesCluster + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.KubernetesCluster#Multiple @@ -3878,9 +3230,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.KubernetesClusterFeature + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.KubernetesClusterFeature - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.KubernetesClusterFeature + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.KubernetesClusterFeature#Multiple @@ -3954,9 +3306,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.KubernetesClusterFeatureList + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.KubernetesClusterFeatureList - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.KubernetesClusterFeatureList + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.KubernetesClusterFeatureList#Multiple @@ -3976,9 +3328,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.KubernetesClusterFeaturePatchParametersTags + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.KubernetesClusterFeaturePatchParametersTags - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.KubernetesClusterFeaturePatchParametersTags + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.KubernetesClusterFeaturePatchParametersTags#Multiple @@ -3998,9 +3350,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.KubernetesClusterFeatureProperties + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.KubernetesClusterFeatureProperties - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.KubernetesClusterFeatureProperties + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.KubernetesClusterFeatureProperties#Multiple @@ -4050,9 +3402,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.KubernetesClusterList + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.KubernetesClusterList - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.KubernetesClusterList + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.KubernetesClusterList#Multiple @@ -4072,9 +3424,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.KubernetesClusterNode + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.KubernetesClusterNode - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.KubernetesClusterNode + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.KubernetesClusterNode#Multiple @@ -4178,9 +3530,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.KubernetesClusterPatchParametersTags + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.KubernetesClusterPatchParametersTags - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.KubernetesClusterPatchParametersTags + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.KubernetesClusterPatchParametersTags#Multiple @@ -4200,9 +3552,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.KubernetesClusterPatchProperties + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.KubernetesClusterPatchProperties - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.KubernetesClusterPatchProperties + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.KubernetesClusterPatchProperties#Multiple @@ -4222,15 +3574,12 @@ - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.KubernetesClusterProperties + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.KubernetesClusterProperties - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.KubernetesClusterProperties + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.KubernetesClusterProperties#Multiple - - - @@ -4256,9 +3605,6 @@ - - AttachedNetworkId - ClusterId @@ -4286,9 +3632,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.KubernetesClusterRestartNodeParameters + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.KubernetesClusterRestartNodeParameters - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.KubernetesClusterRestartNodeParameters + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.KubernetesClusterRestartNodeParameters#Multiple @@ -4308,27 +3654,233 @@ - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.KubernetesLabel + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.KubernetesLabel + + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.KubernetesLabel#Multiple + + + + + + + + + + + + + + + Key + + + Value + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.L2Network + + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.L2Network#Multiple + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Location + + + Name + + + SystemDataCreatedAt + + + SystemDataCreatedBy + + + SystemDataCreatedByType + + + SystemDataLastModifiedAt + + + SystemDataLastModifiedBy + + + SystemDataLastModifiedByType + + + Etag + + + ResourceGroupName + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.L2NetworkAttachmentConfiguration + + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.L2NetworkAttachmentConfiguration#Multiple + + + + + + + + + + + + + + + NetworkId + + + PluginType + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.L2NetworkList + + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.L2NetworkList#Multiple + + + + + + + + + + + + NextLink + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.L2NetworkPatchParametersTags + + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.L2NetworkPatchParametersTags#Multiple + + + + + + + + + + + + Item + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.L2NetworkProperties - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.KubernetesLabel + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.L2NetworkProperties#Multiple - + + + + - + + + + + + + + + + + + + - Key + ClusterId - Value + DetailedStatus + + + DetailedStatusMessage + + + HybridAksPluginType + + + InterfaceName + + + L2IsolationDomainId + + + ProvisioningState @@ -4336,9 +3888,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.L2Network + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.L3Network - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.L2Network + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.L3Network#Multiple @@ -4412,12 +3964,15 @@ - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.L2NetworkAttachmentConfiguration + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.L3NetworkAttachmentConfiguration - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.L2NetworkAttachmentConfiguration + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.L3NetworkAttachmentConfiguration#Multiple + + + @@ -4428,6 +3983,9 @@ + + IpamEnabled + NetworkId @@ -4440,9 +3998,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.L2NetworkList + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.L3NetworkList - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.L2NetworkList + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.L3NetworkList#Multiple @@ -4462,9 +4020,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.L2NetworkPatchParametersTags + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.L3NetworkPatchParametersTags - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.L2NetworkPatchParametersTags + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.L3NetworkPatchParametersTags#Multiple @@ -4484,15 +4042,12 @@ - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.L2NetworkProperties + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.L3NetworkProperties - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.L2NetworkProperties + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.L3NetworkProperties#Multiple - - - @@ -4503,30 +4058,36 @@ - + + + + - + + + + + + + - + - - AssociatedResourceId - ClusterId @@ -4537,22 +4098,31 @@ DetailedStatusMessage - HybridAksClustersAssociatedId + HybridAksIpamEnabled HybridAksPluginType + + IPAllocationType + InterfaceName - L2IsolationDomainId + Ipv4ConnectedPrefix + + + Ipv6ConnectedPrefix + + + L3IsolationDomainId ProvisioningState - VirtualMachinesAssociatedId + Vlan @@ -4560,75 +4130,137 @@ - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.L3Network + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.LldpNeighbor - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.L3Network + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.LldpNeighbor#Multiple - + - + - + - + + + + + + + PortDescription + + + PortName + + + SystemDescription + + + SystemName + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.MachineDisk + + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.MachineDisk#Multiple + + + - + - + + + + + + + + CapacityGb + + + Connection + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.MachineSkuProperties + + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.MachineSkuProperties#Multiple + + + + + - + - + - + - + + + + + + + + + + + + + - Location - - - Name + BootstrapProtocol - SystemDataCreatedAt + CpuCore - SystemDataCreatedBy + CpuSocket - SystemDataCreatedByType + Generation - SystemDataLastModifiedAt + HardwareVersion - SystemDataLastModifiedBy + MemoryCapacityGb - SystemDataLastModifiedByType + Model - Etag + TotalThread - ResourceGroupName + Vendor @@ -4636,33 +4268,49 @@ - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.L3NetworkAttachmentConfiguration + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.MachineSkuSlot - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.L3NetworkAttachmentConfiguration + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.MachineSkuSlot#Multiple - + + + + + + + RackSlot + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ManagedResourceGroupConfiguration + + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ManagedResourceGroupConfiguration#Multiple + + + - + - + - IpamEnabled - - - NetworkId + Location - PluginType + Name @@ -4670,21 +4318,27 @@ - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.L3NetworkList + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ManagedServiceIdentity - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.L3NetworkList + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ManagedServiceIdentity#Multiple - + + + + - NextLink + PrincipalId + + + TenantId @@ -4692,21 +4346,57 @@ - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.L3NetworkPatchParametersTags + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.NetworkAttachment - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.L3NetworkPatchParametersTags + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.NetworkAttachment#Multiple - + + + + + + + + + + + + + + + + + + + - Item + AttachedNetworkId + + + DefaultGateway + + + IPAllocationMethod + + + Ipv4Address + + + Ipv6Address + + + MacAddress + + + Name @@ -4714,145 +4404,141 @@ - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.L3NetworkProperties + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.NetworkCloudIdentity - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.L3NetworkProperties + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.NetworkCloudIdentity#Multiple - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + - AssociatedResourceId + AgentPoolName - ClusterId + BareMetalMachineKeySetName - DetailedStatus + BareMetalMachineName - DetailedStatusMessage + BmcKeySetName - HybridAksClustersAssociatedId + CloudServicesNetworkName - HybridAksIpamEnabled + ClusterManagerName - HybridAksPluginType + ClusterName - IPAllocationType + ConsoleName - InterfaceName + FeatureName - Ipv4ConnectedPrefix + KubernetesClusterName - Ipv6ConnectedPrefix + L2NetworkName - L3IsolationDomainId + L3NetworkName - ProvisioningState + MetricsConfigurationName - VirtualMachinesAssociatedId + RackName - Vlan + RackSkuName - - - - - - - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.LldpNeighbor - - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.LldpNeighbor - - - - - - - - - - - - - - - - - - - - PortDescription + ResourceGroupName - PortName + StorageApplianceName - SystemDescription + SubscriptionId - SystemName + TrunkedNetworkName + + + VirtualMachineName + + + VolumeName @@ -4860,27 +4546,33 @@ - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.MachineDisk + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.NetworkConfiguration - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.MachineDisk + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.NetworkConfiguration#Multiple - + - + + + + - CapacityGb + CloudServicesNetworkId - Connection + CniNetworkId + + + DnsServiceIP @@ -4888,35 +4580,29 @@ - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.MachineSkuProperties + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.NetworkInterface - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.MachineSkuProperties + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.NetworkInterface#Multiple - - - - - - - + - + - + - + - + - + @@ -4926,81 +4612,25 @@ - BootstrapProtocol - - - CpuCore - - - CpuSocket - - - Generation - - - HardwareVersion + Address - MemoryCapacityGb + DeviceConnectionType Model - TotalThread - - - Vendor + PhysicalSlot - - - - - - - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.MachineSkuSlot - - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.MachineSkuSlot - - - - - - - - - - - RackSlot + PortCount - - - - - - - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ManagedResourceGroupConfiguration - - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ManagedResourceGroupConfiguration - - - - - - - - - - - - - - Location + PortSpeed - Name + Vendor @@ -5008,27 +4638,12 @@ - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.NetworkAttachment + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Nic - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.NetworkAttachment + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Nic#Multiple - - - - - - - - - - - - - - - @@ -5039,21 +4654,6 @@ - - AttachedNetworkId - - - DefaultGateway - - - IPAllocationMethod - - - Ipv4Address - - - Ipv6Address - MacAddress @@ -5066,45 +4666,39 @@ - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.NetworkConfiguration + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Operation - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.NetworkConfiguration + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Operation#Multiple - - - - + - + - + - + - CloudServicesNetworkId - - - CniNetworkId + ActionType - DnsServiceIP + IsDataAction - PodCidr + Name - ServiceCidr + Origin @@ -5112,57 +4706,39 @@ - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.NetworkInterface + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.OperationDisplay - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.NetworkInterface + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.OperationDisplay#Multiple - - - - - - - - - - + - + - + - + - Address - - - DeviceConnectionType - - - Model - - - PhysicalSlot + Description - PortCount + Operation - PortSpeed + Provider - Vendor + Resource @@ -5170,27 +4746,21 @@ - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.Nic + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.OperationListResult - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.Nic + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.OperationListResult#Multiple - - - - + - MacAddress - - - Name + NextLink @@ -5198,9 +4768,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.OperationStatusResult + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.OperationStatusResult - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.OperationStatusResult + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.OperationStatusResult#Multiple @@ -5250,9 +4820,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.OperationStatusResultProperties + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.OperationStatusResultProperties - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.OperationStatusResultProperties + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.OperationStatusResultProperties#Multiple @@ -5290,9 +4860,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.OSDisk + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.OSDisk - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.OSDisk + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.OSDisk#Multiple @@ -5324,9 +4894,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.Rack + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Rack - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.Rack + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Rack#Multiple @@ -5400,9 +4970,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.RackDefinition + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.RackDefinition - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.RackDefinition + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.RackDefinition#Multiple @@ -5446,9 +5016,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.RackList + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.RackList - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.RackList + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.RackList#Multiple @@ -5468,9 +5038,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.RackPatchParametersTags + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.RackPatchParametersTags - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.RackPatchParametersTags + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.RackPatchParametersTags#Multiple @@ -5490,9 +5060,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.RackProperties + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.RackProperties - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.RackProperties + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.RackProperties#Multiple @@ -5554,9 +5124,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.RackSku + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.RackSku - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.RackSku + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.RackSku#Multiple @@ -5618,9 +5188,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.RackSkuList + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.RackSkuList - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.RackSkuList + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.RackSkuList#Multiple @@ -5640,9 +5210,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.RackSkuProperties + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.RackSkuProperties - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.RackSkuProperties + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.RackSkuProperties#Multiple @@ -5658,9 +5228,6 @@ - - - @@ -5677,18 +5244,15 @@ RackType - - SupportedRackSkuId - - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.RacksPatchProperties + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.RacksPatchProperties - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.RacksPatchProperties + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.RacksPatchProperties#Multiple @@ -5714,9 +5278,31 @@ - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.RuntimeProtectionConfiguration + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Resource + + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Resource#Multiple + + + + + + + + + + + + Name + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.RuntimeProtectionConfiguration - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.RuntimeProtectionConfiguration + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.RuntimeProtectionConfiguration#Multiple @@ -5736,9 +5322,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.RuntimeProtectionStatus + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.RuntimeProtectionStatus - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.RuntimeProtectionStatus + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.RuntimeProtectionStatus#Multiple @@ -5782,9 +5368,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.SecretArchiveReference + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.SecretArchiveReference - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.SecretArchiveReference + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.SecretArchiveReference#Multiple @@ -5816,9 +5402,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.SecretArchiveSettings + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.SecretArchiveSettings - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.SecretArchiveSettings + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.SecretArchiveSettings#Multiple @@ -5838,9 +5424,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.SecretRotationStatus + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.SecretRotationStatus - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.SecretRotationStatus + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.SecretRotationStatus#Multiple @@ -5878,9 +5464,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ServiceLoadBalancerBgpPeer + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ServiceLoadBalancerBgpPeer - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ServiceLoadBalancerBgpPeer + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ServiceLoadBalancerBgpPeer#Multiple @@ -5954,9 +5540,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ServicePrincipalInformation + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ServicePrincipalInformation - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ServicePrincipalInformation + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ServicePrincipalInformation#Multiple @@ -5988,9 +5574,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.SshPublicKey + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.SshPublicKey - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.SshPublicKey + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.SshPublicKey#Multiple @@ -6010,9 +5596,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.StorageAppliance + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.StorageAppliance - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.StorageAppliance + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.StorageAppliance#Multiple @@ -6086,9 +5672,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.StorageApplianceConfigurationData + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.StorageApplianceConfigurationData - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.StorageApplianceConfigurationData + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.StorageApplianceConfigurationData#Multiple @@ -6120,31 +5706,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.StorageApplianceEnableRemoteVendorManagementParameters - - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.StorageApplianceEnableRemoteVendorManagementParameters - - - - - - - - - - - - SupportEndpoint - - - - - - - - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.StorageApplianceList + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.StorageApplianceList - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.StorageApplianceList + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.StorageApplianceList#Multiple @@ -6164,9 +5728,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.StorageAppliancePatchParametersTags + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.StorageAppliancePatchParametersTags - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.StorageAppliancePatchParametersTags + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.StorageAppliancePatchParametersTags#Multiple @@ -6186,9 +5750,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.StorageAppliancePatchProperties + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.StorageAppliancePatchProperties - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.StorageAppliancePatchProperties + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.StorageAppliancePatchProperties#Multiple @@ -6208,9 +5772,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.StorageApplianceProperties + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.StorageApplianceProperties - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.StorageApplianceProperties + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.StorageApplianceProperties#Multiple @@ -6320,9 +5884,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.StorageApplianceSkuProperties + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.StorageApplianceSkuProperties - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.StorageApplianceSkuProperties + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.StorageApplianceSkuProperties#Multiple @@ -6348,9 +5912,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.StorageApplianceSkuSlot + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.StorageApplianceSkuSlot - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.StorageApplianceSkuSlot + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.StorageApplianceSkuSlot#Multiple @@ -6370,21 +5934,27 @@ - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.StorageProfile + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.StringKeyValuePair - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.StorageProfile + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.StringKeyValuePair#Multiple - + + + + - VolumeAttachment + Key + + + Value @@ -6392,27 +5962,137 @@ - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.StringKeyValuePair + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.SystemData - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.StringKeyValuePair + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.SystemData#Multiple - + - + + + + + + + + + + + + + - Key + CreatedAt - Value + CreatedBy + + + CreatedByType + + + LastModifiedAt + + + LastModifiedBy + + + LastModifiedByType + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.TagsParameterTags + + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.TagsParameterTags#Multiple + + + + + + + + + + + + Item + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.TrackedResource + + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.TrackedResource#Multiple + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Name + + + SystemDataCreatedAt + + + SystemDataCreatedBy + + + SystemDataCreatedByType + + + SystemDataLastModifiedAt + + + SystemDataLastModifiedBy + + + SystemDataLastModifiedByType + + + Location @@ -6420,9 +6100,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.TagsParameterTags + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.TrackedResourceTags - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.TagsParameterTags + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.TrackedResourceTags#Multiple @@ -6442,9 +6122,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.TrunkedNetwork + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.TrunkedNetwork - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.TrunkedNetwork + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.TrunkedNetwork#Multiple @@ -6518,9 +6198,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.TrunkedNetworkAttachmentConfiguration + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.TrunkedNetworkAttachmentConfiguration - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.TrunkedNetworkAttachmentConfiguration + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.TrunkedNetworkAttachmentConfiguration#Multiple @@ -6546,9 +6226,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.TrunkedNetworkList + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.TrunkedNetworkList - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.TrunkedNetworkList + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.TrunkedNetworkList#Multiple @@ -6568,9 +6248,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.TrunkedNetworkPatchParametersTags + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.TrunkedNetworkPatchParametersTags - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.TrunkedNetworkPatchParametersTags + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.TrunkedNetworkPatchParametersTags#Multiple @@ -6590,15 +6270,12 @@ - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.TrunkedNetworkProperties + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.TrunkedNetworkProperties - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.TrunkedNetworkProperties + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.TrunkedNetworkProperties#Multiple - - - @@ -6608,34 +6285,19 @@ - - - - - - - - - - - - - - AssociatedResourceId - ClusterId @@ -6645,26 +6307,42 @@ DetailedStatusMessage - - HybridAksClustersAssociatedId - HybridAksPluginType InterfaceName - - IsolationDomainId - ProvisioningState + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.UserAssignedIdentity + + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.UserAssignedIdentity#Multiple + + + + + + + + + + + + + - VirtualMachinesAssociatedId + ClientId - Vlan + PrincipalId @@ -6672,9 +6350,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ValidationThreshold + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ValidationThreshold - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ValidationThreshold + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ValidationThreshold#Multiple @@ -6700,9 +6378,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.VirtualMachine + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.VirtualMachine - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.VirtualMachine + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.VirtualMachine#Multiple @@ -6776,9 +6454,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.VirtualMachineList + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.VirtualMachineList - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.VirtualMachineList + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.VirtualMachineList#Multiple @@ -6798,9 +6476,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.VirtualMachinePatchParametersTags + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.VirtualMachinePatchParametersTags - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.VirtualMachinePatchParametersTags + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.VirtualMachinePatchParametersTags#Multiple @@ -6820,9 +6498,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.VirtualMachinePlacementHint + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.VirtualMachinePlacementHint - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.VirtualMachinePlacementHint + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.VirtualMachinePlacementHint#Multiple @@ -6860,9 +6538,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.VirtualMachinePowerOffParameters + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.VirtualMachinePowerOffParameters - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.VirtualMachinePowerOffParameters + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.VirtualMachinePowerOffParameters#Multiple @@ -6882,9 +6560,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.VirtualMachineProperties + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.VirtualMachineProperties - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.VirtualMachineProperties + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.VirtualMachineProperties#Multiple @@ -6939,9 +6617,6 @@ - - - @@ -6997,18 +6672,15 @@ VirtioInterface - - Volume - - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.Volume + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Volume - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.Volume + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Volume#Multiple @@ -7082,9 +6754,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.VolumeList + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.VolumeList - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.VolumeList + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.VolumeList#Multiple @@ -7104,9 +6776,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.VolumePatchParametersTags + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.VolumePatchParametersTags - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.VolumePatchParametersTags + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.VolumePatchParametersTags#Multiple @@ -7126,15 +6798,12 @@ - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.VolumeProperties + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.VolumeProperties - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.VolumeProperties + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.VolumeProperties#Multiple - - - @@ -7154,9 +6823,6 @@ - - AttachedTo - DetailedStatus @@ -7178,9 +6844,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.VulnerabilityScanningSettings + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.VulnerabilityScanningSettings - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.VulnerabilityScanningSettings + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.VulnerabilityScanningSettings#Multiple @@ -7200,9 +6866,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.VulnerabilityScanningSettingsPatch + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.VulnerabilityScanningSettingsPatch - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.VulnerabilityScanningSettingsPatch + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.VulnerabilityScanningSettingsPatch#Multiple diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/Az.NetworkCloud.psd1 b/generated/NetworkCloud/NetworkCloud.Autorest/Az.NetworkCloud.psd1 index 13c1584f385a..6e7f25c8b2a4 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/Az.NetworkCloud.psd1 +++ b/generated/NetworkCloud/NetworkCloud.Autorest/Az.NetworkCloud.psd1 @@ -11,8 +11,7 @@ DotNetFrameworkVersion = '4.7.2' RequiredAssemblies = './bin/Az.NetworkCloud.private.dll' FormatsToProcess = './Az.NetworkCloud.format.ps1xml' - FunctionsToExport = 'Deploy-AzNetworkCloudCluster', 'Disable-AzNetworkCloudStorageApplianceRemoteVendorManagement', 'Enable-AzNetworkCloudStorageApplianceRemoteVendorManagement', 'Get-AzNetworkCloudAgentPool', 'Get-AzNetworkCloudBareMetalMachine', 'Get-AzNetworkCloudBareMetalMachineKeySet', 'Get-AzNetworkCloudBmcKeySet', 'Get-AzNetworkCloudCluster', 'Get-AzNetworkCloudClusterManager', 'Get-AzNetworkCloudConsole', 'Get-AzNetworkCloudKubernetesCluster', 'Get-AzNetworkCloudKubernetesClusterFeature', 'Get-AzNetworkCloudL2Network', 'Get-AzNetworkCloudL3Network', 'Get-AzNetworkCloudMetricsConfiguration', 'Get-AzNetworkCloudRack', 'Get-AzNetworkCloudRackSku', 'Get-AzNetworkCloudServicesNetwork', 'Get-AzNetworkCloudStorageAppliance', 'Get-AzNetworkCloudTrunkedNetwork', 'Get-AzNetworkCloudVirtualMachine', 'Get-AzNetworkCloudVolume', 'Invoke-AzNetworkCloudBareMetalMachineCordon', 'Invoke-AzNetworkCloudBareMetalMachineDataExtract', 'Invoke-AzNetworkCloudBareMetalMachineReimage', 'Invoke-AzNetworkCloudBareMetalMachineReplace', 'Invoke-AzNetworkCloudBareMetalMachineRunCommand', 'Invoke-AzNetworkCloudBareMetalMachineRunReadCommand', 'Invoke-AzNetworkCloudBareMetalMachineUncordon', 'Invoke-AzNetworkCloudClusterContinueVersionUpdate', 'Invoke-AzNetworkCloudClusterVersionUpdate', 'Invoke-AzNetworkCloudScanClusterRuntime', 'Invoke-AzNetworkCloudVirtualMachineReimage', 'New-AzNetworkCloudAgentPool', 'New-AzNetworkCloudBareMetalMachineConfigurationDataObject', 'New-AzNetworkCloudBareMetalMachineKeySet', 'New-AzNetworkCloudBgpAdvertisementObject', 'New-AzNetworkCloudBgpServiceLoadBalancerConfigurationObject', 'New-AzNetworkCloudBmcKeySet', 'New-AzNetworkCloudCluster', 'New-AzNetworkCloudClusterManager', 'New-AzNetworkCloudConsole', 'New-AzNetworkCloudControlPlaneNodeConfigurationObject', 'New-AzNetworkCloudEgressEndpointObject', 'New-AzNetworkCloudEndpointDependencyObject', 'New-AzNetworkCloudInitialAgentPoolConfigurationObject', 'New-AzNetworkCloudIpAddressPoolObject', 'New-AzNetworkCloudKeySetUserObject', 'New-AzNetworkCloudKubernetesCluster', 'New-AzNetworkCloudKubernetesClusterFeature', 'New-AzNetworkCloudL2Network', 'New-AzNetworkCloudL3Network', 'New-AzNetworkCloudL3NetworkAttachmentConfigurationObject', 'New-AzNetworkCloudMetricsConfiguration', 'New-AzNetworkCloudNetworkAttachmentObject', 'New-AzNetworkCloudRackDefinitionObject', 'New-AzNetworkCloudServiceLoadBalancerBgpPeerObject', 'New-AzNetworkCloudServicesNetwork', 'New-AzNetworkCloudStorageApplianceConfigurationDataObject', 'New-AzNetworkCloudTrunkedNetwork', 'New-AzNetworkCloudVirtualMachine', 'New-AzNetworkCloudVirtualMachinePlacementHintObject', 'New-AzNetworkCloudVolume', 'Remove-AzNetworkCloudAgentPool', 'Remove-AzNetworkCloudBareMetalMachineKeySet', 'Remove-AzNetworkCloudBmcKeySet', 'Remove-AzNetworkCloudCluster', 'Remove-AzNetworkCloudClusterManager', 'Remove-AzNetworkCloudConsole', 'Remove-AzNetworkCloudKubernetesCluster', 'Remove-AzNetworkCloudKubernetesClusterFeature', 'Remove-AzNetworkCloudL2Network', 'Remove-AzNetworkCloudL3Network', 'Remove-AzNetworkCloudMetricsConfiguration', 'Remove-AzNetworkCloudServicesNetwork', 'Remove-AzNetworkCloudTrunkedNetwork', 'Remove-AzNetworkCloudVirtualMachine', 'Remove-AzNetworkCloudVolume', 'Restart-AzNetworkCloudBareMetalMachine', 'Restart-AzNetworkCloudKubernetesClusterNode', 'Restart-AzNetworkCloudVirtualMachine', 'Start-AzNetworkCloudBareMetalMachine', 'Start-AzNetworkCloudVirtualMachine', 'Stop-AzNetworkCloudBareMetalMachine', 'Stop-AzNetworkCloudVirtualMachine', 'Update-AzNetworkCloudAgentPool', 'Update-AzNetworkCloudBareMetalMachine', 'Update-AzNetworkCloudBareMetalMachineKeySet', 'Update-AzNetworkCloudBmcKeySet', 'Update-AzNetworkCloudCluster', 'Update-AzNetworkCloudClusterManager', 'Update-AzNetworkCloudConsole', 'Update-AzNetworkCloudKubernetesCluster', 'Update-AzNetworkCloudKubernetesClusterFeature', 'Update-AzNetworkCloudL2Network', 'Update-AzNetworkCloudL3Network', 'Update-AzNetworkCloudMetricsConfiguration', 'Update-AzNetworkCloudRack', 'Update-AzNetworkCloudServicesNetwork', 'Update-AzNetworkCloudStorageAppliance', 'Update-AzNetworkCloudTrunkedNetwork', 'Update-AzNetworkCloudVirtualMachine', 'Update-AzNetworkCloudVolume', '*' - AliasesToExport = '*' + FunctionsToExport = 'Deploy-AzNetworkCloudCluster', 'Disable-AzNetworkCloudStorageApplianceRemoteVendorManagement', 'Enable-AzNetworkCloudStorageApplianceRemoteVendorManagement', 'Get-AzNetworkCloudAgentPool', 'Get-AzNetworkCloudBareMetalMachine', 'Get-AzNetworkCloudBareMetalMachineKeySet', 'Get-AzNetworkCloudBmcKeySet', 'Get-AzNetworkCloudCluster', 'Get-AzNetworkCloudClusterManager', 'Get-AzNetworkCloudConsole', 'Get-AzNetworkCloudKubernetesCluster', 'Get-AzNetworkCloudKubernetesClusterFeature', 'Get-AzNetworkCloudL2Network', 'Get-AzNetworkCloudL3Network', 'Get-AzNetworkCloudMetricsConfiguration', 'Get-AzNetworkCloudRack', 'Get-AzNetworkCloudRackSku', 'Get-AzNetworkCloudServicesNetwork', 'Get-AzNetworkCloudStorageAppliance', 'Get-AzNetworkCloudTrunkedNetwork', 'Get-AzNetworkCloudVirtualMachine', 'Get-AzNetworkCloudVolume', 'Invoke-AzNetworkCloudBareMetalMachineCordon', 'Invoke-AzNetworkCloudBareMetalMachineDataExtract', 'Invoke-AzNetworkCloudBareMetalMachineReimage', 'Invoke-AzNetworkCloudBareMetalMachineReplace', 'Invoke-AzNetworkCloudBareMetalMachineRunCommand', 'Invoke-AzNetworkCloudBareMetalMachineRunReadCommand', 'Invoke-AzNetworkCloudBareMetalMachineUncordon', 'Invoke-AzNetworkCloudClusterContinueVersionUpdate', 'Invoke-AzNetworkCloudClusterVersionUpdate', 'Invoke-AzNetworkCloudScanClusterRuntime', 'Invoke-AzNetworkCloudVirtualMachineReimage', 'New-AzNetworkCloudAgentPool', 'New-AzNetworkCloudBareMetalMachineConfigurationDataObject', 'New-AzNetworkCloudBareMetalMachineKeySet', 'New-AzNetworkCloudBgpAdvertisementObject', 'New-AzNetworkCloudBgpServiceLoadBalancerConfigurationObject', 'New-AzNetworkCloudBmcKeySet', 'New-AzNetworkCloudCluster', 'New-AzNetworkCloudClusterManager', 'New-AzNetworkCloudConsole', 'New-AzNetworkCloudControlPlaneNodeConfigurationObject', 'New-AzNetworkCloudEgressEndpointObject', 'New-AzNetworkCloudEndpointDependencyObject', 'New-AzNetworkCloudInitialAgentPoolConfigurationObject', 'New-AzNetworkCloudIpAddressPoolObject', 'New-AzNetworkCloudKeySetUserObject', 'New-AzNetworkCloudKubernetesCluster', 'New-AzNetworkCloudKubernetesClusterFeature', 'New-AzNetworkCloudL2Network', 'New-AzNetworkCloudL3Network', 'New-AzNetworkCloudL3NetworkAttachmentConfigurationObject', 'New-AzNetworkCloudMetricsConfiguration', 'New-AzNetworkCloudNetworkAttachmentObject', 'New-AzNetworkCloudRackDefinitionObject', 'New-AzNetworkCloudServiceLoadBalancerBgpPeerObject', 'New-AzNetworkCloudServicesNetwork', 'New-AzNetworkCloudStorageApplianceConfigurationDataObject', 'New-AzNetworkCloudTrunkedNetwork', 'New-AzNetworkCloudVirtualMachine', 'New-AzNetworkCloudVirtualMachinePlacementHintObject', 'New-AzNetworkCloudVolume', 'Remove-AzNetworkCloudAgentPool', 'Remove-AzNetworkCloudBareMetalMachineKeySet', 'Remove-AzNetworkCloudBmcKeySet', 'Remove-AzNetworkCloudCluster', 'Remove-AzNetworkCloudClusterManager', 'Remove-AzNetworkCloudConsole', 'Remove-AzNetworkCloudKubernetesCluster', 'Remove-AzNetworkCloudKubernetesClusterFeature', 'Remove-AzNetworkCloudL2Network', 'Remove-AzNetworkCloudL3Network', 'Remove-AzNetworkCloudMetricsConfiguration', 'Remove-AzNetworkCloudServicesNetwork', 'Remove-AzNetworkCloudTrunkedNetwork', 'Remove-AzNetworkCloudVirtualMachine', 'Remove-AzNetworkCloudVolume', 'Restart-AzNetworkCloudBareMetalMachine', 'Restart-AzNetworkCloudKubernetesClusterNode', 'Restart-AzNetworkCloudVirtualMachine', 'Start-AzNetworkCloudBareMetalMachine', 'Start-AzNetworkCloudVirtualMachine', 'Stop-AzNetworkCloudBareMetalMachine', 'Stop-AzNetworkCloudVirtualMachine', 'Update-AzNetworkCloudAgentPool', 'Update-AzNetworkCloudBareMetalMachine', 'Update-AzNetworkCloudBareMetalMachineKeySet', 'Update-AzNetworkCloudBmcKeySet', 'Update-AzNetworkCloudCluster', 'Update-AzNetworkCloudClusterManager', 'Update-AzNetworkCloudConsole', 'Update-AzNetworkCloudKubernetesCluster', 'Update-AzNetworkCloudKubernetesClusterFeature', 'Update-AzNetworkCloudL2Network', 'Update-AzNetworkCloudL3Network', 'Update-AzNetworkCloudMetricsConfiguration', 'Update-AzNetworkCloudRack', 'Update-AzNetworkCloudServicesNetwork', 'Update-AzNetworkCloudStorageAppliance', 'Update-AzNetworkCloudTrunkedNetwork', 'Update-AzNetworkCloudVirtualMachine', 'Update-AzNetworkCloudVolume' PrivateData = @{ PSData = @{ Tags = 'Azure', 'ResourceManager', 'ARM', 'PSModule', 'NetworkCloud' diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/Properties/AssemblyInfo.cs b/generated/NetworkCloud/NetworkCloud.Autorest/Properties/AssemblyInfo.cs index 2c092587d8d9..5ffb103f64e8 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/Properties/AssemblyInfo.cs +++ b/generated/NetworkCloud/NetworkCloud.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 - NetworkCloud")] -[assembly: System.Reflection.AssemblyFileVersionAttribute("1.1.0")] -[assembly: System.Reflection.AssemblyVersionAttribute("1.1.0")] +[assembly: System.Reflection.AssemblyFileVersionAttribute("1.2.0")] +[assembly: System.Reflection.AssemblyVersionAttribute("1.2.0")] [assembly: System.Runtime.InteropServices.ComVisibleAttribute(false)] [assembly: System.CLSCompliantAttribute(false)] diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/check-dependencies.ps1 b/generated/NetworkCloud/NetworkCloud.Autorest/check-dependencies.ps1 index c29591c7bfe1..90ca9867ae40 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/check-dependencies.ps1 +++ b/generated/NetworkCloud/NetworkCloud.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/NetworkCloud/NetworkCloud.Autorest/exports/Deploy-AzNetworkCloudCluster.ps1 b/generated/NetworkCloud/NetworkCloud.Autorest/exports/Deploy-AzNetworkCloudCluster.ps1 index d035070fe103..38dff4589e7e 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/exports/Deploy-AzNetworkCloudCluster.ps1 +++ b/generated/NetworkCloud/NetworkCloud.Autorest/exports/Deploy-AzNetworkCloudCluster.ps1 @@ -62,6 +62,8 @@ function Deploy-AzNetworkCloudCluster { [CmdletBinding(DefaultParameterSetName='DeployExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='DeployExpanded', Mandatory)] + [Parameter(ParameterSetName='DeployViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='DeployViaJsonString', Mandatory)] [Alias('ClusterName')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [System.String] @@ -69,6 +71,8 @@ param( ${Name}, [Parameter(ParameterSetName='DeployExpanded', Mandatory)] + [Parameter(ParameterSetName='DeployViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='DeployViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [System.String] # The name of the resource group. @@ -76,6 +80,8 @@ param( ${ResourceGroupName}, [Parameter(ParameterSetName='DeployExpanded')] + [Parameter(ParameterSetName='DeployViaJsonFilePath')] + [Parameter(ParameterSetName='DeployViaJsonString')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] @@ -87,16 +93,28 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, - [Parameter()] + [Parameter(ParameterSetName='DeployExpanded')] + [Parameter(ParameterSetName='DeployViaIdentityExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String[]] # The names of bare metal machines in the cluster that should be skipped during environment validation. ${SkipValidationsForMachine}, + [Parameter(ParameterSetName='DeployViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Path of Json file supplied to the Deploy operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='DeployViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Json string supplied to the Deploy operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -171,6 +189,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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() @@ -192,10 +219,10 @@ begin { $mapping = @{ DeployExpanded = 'Az.NetworkCloud.private\Deploy-AzNetworkCloudCluster_DeployExpanded'; DeployViaIdentityExpanded = 'Az.NetworkCloud.private\Deploy-AzNetworkCloudCluster_DeployViaIdentityExpanded'; + DeployViaJsonFilePath = 'Az.NetworkCloud.private\Deploy-AzNetworkCloudCluster_DeployViaJsonFilePath'; + DeployViaJsonString = 'Az.NetworkCloud.private\Deploy-AzNetworkCloudCluster_DeployViaJsonString'; } - if (('DeployExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('DeployExpanded', 'DeployViaJsonFilePath', 'DeployViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -209,6 +236,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/NetworkCloud/NetworkCloud.Autorest/exports/Disable-AzNetworkCloudStorageApplianceRemoteVendorManagement.ps1 b/generated/NetworkCloud/NetworkCloud.Autorest/exports/Disable-AzNetworkCloudStorageApplianceRemoteVendorManagement.ps1 index 7a208798977c..39eccfa179e6 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/exports/Disable-AzNetworkCloudStorageApplianceRemoteVendorManagement.ps1 +++ b/generated/NetworkCloud/NetworkCloud.Autorest/exports/Disable-AzNetworkCloudStorageApplianceRemoteVendorManagement.ps1 @@ -86,7 +86,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -163,6 +162,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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() @@ -185,9 +193,7 @@ begin { Disable = 'Az.NetworkCloud.private\Disable-AzNetworkCloudStorageApplianceRemoteVendorManagement_Disable'; DisableViaIdentity = 'Az.NetworkCloud.private\Disable-AzNetworkCloudStorageApplianceRemoteVendorManagement_DisableViaIdentity'; } - if (('Disable') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Disable') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -201,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/NetworkCloud/NetworkCloud.Autorest/exports/Enable-AzNetworkCloudStorageApplianceRemoteVendorManagement.ps1 b/generated/NetworkCloud/NetworkCloud.Autorest/exports/Enable-AzNetworkCloudStorageApplianceRemoteVendorManagement.ps1 index 40aef0e01b23..c9aa82bb32f1 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/exports/Enable-AzNetworkCloudStorageApplianceRemoteVendorManagement.ps1 +++ b/generated/NetworkCloud/NetworkCloud.Autorest/exports/Enable-AzNetworkCloudStorageApplianceRemoteVendorManagement.ps1 @@ -62,6 +62,8 @@ function Enable-AzNetworkCloudStorageApplianceRemoteVendorManagement { [CmdletBinding(DefaultParameterSetName='EnableExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='EnableExpanded', Mandatory)] + [Parameter(ParameterSetName='EnableViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='EnableViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [System.String] # The name of the resource group. @@ -69,12 +71,16 @@ param( ${ResourceGroupName}, [Parameter(ParameterSetName='EnableExpanded', Mandatory)] + [Parameter(ParameterSetName='EnableViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='EnableViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [System.String] # The name of the storage appliance. ${StorageApplianceName}, [Parameter(ParameterSetName='EnableExpanded')] + [Parameter(ParameterSetName='EnableViaJsonFilePath')] + [Parameter(ParameterSetName='EnableViaJsonString')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] @@ -86,10 +92,10 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, - [Parameter()] + [Parameter(ParameterSetName='EnableExpanded')] + [Parameter(ParameterSetName='EnableViaIdentityExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String[]] @@ -98,6 +104,18 @@ param( # The list of IPv4 subnets (in CIDR format), IPv6 subnets (in CIDR format), or hostnames that the storage appliance needs accessible in order to turn on the remote vendor management. ${SupportEndpoint}, + [Parameter(ParameterSetName='EnableViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Path of Json file supplied to the Enable operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='EnableViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Json string supplied to the Enable operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -172,6 +190,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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() @@ -193,10 +220,10 @@ begin { $mapping = @{ EnableExpanded = 'Az.NetworkCloud.private\Enable-AzNetworkCloudStorageApplianceRemoteVendorManagement_EnableExpanded'; EnableViaIdentityExpanded = 'Az.NetworkCloud.private\Enable-AzNetworkCloudStorageApplianceRemoteVendorManagement_EnableViaIdentityExpanded'; + EnableViaJsonFilePath = 'Az.NetworkCloud.private\Enable-AzNetworkCloudStorageApplianceRemoteVendorManagement_EnableViaJsonFilePath'; + EnableViaJsonString = 'Az.NetworkCloud.private\Enable-AzNetworkCloudStorageApplianceRemoteVendorManagement_EnableViaJsonString'; } - if (('EnableExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('EnableExpanded', 'EnableViaJsonFilePath', 'EnableViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -210,6 +237,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/NetworkCloud/NetworkCloud.Autorest/exports/Get-AzNetworkCloudAgentPool.ps1 b/generated/NetworkCloud/NetworkCloud.Autorest/exports/Get-AzNetworkCloudAgentPool.ps1 index f313a6d5c1a9..8b6091cc9e49 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/exports/Get-AzNetworkCloudAgentPool.ps1 +++ b/generated/NetworkCloud/NetworkCloud.Autorest/exports/Get-AzNetworkCloudAgentPool.ps1 @@ -27,7 +27,7 @@ Get-AzNetworkCloudAgentPool -Name agentPoolName -KubernetesClusterName clusterNa .Inputs Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPool +Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPool .Notes COMPLEX PARAMETER PROPERTIES @@ -56,11 +56,35 @@ INPUTOBJECT : Identity Parameter [TrunkedNetworkName ]: The name of the trunked network. [VirtualMachineName ]: The name of the virtual machine. [VolumeName ]: The name of the volume. + +KUBERNETESCLUSTERINPUTOBJECT : Identity Parameter + [AgentPoolName ]: The name of the Kubernetes cluster agent pool. + [BareMetalMachineKeySetName ]: The name of the bare metal machine key set. + [BareMetalMachineName ]: The name of the bare metal machine. + [BmcKeySetName ]: The name of the baseboard management controller key set. + [CloudServicesNetworkName ]: The name of the cloud services network. + [ClusterManagerName ]: The name of the cluster manager. + [ClusterName ]: The name of the cluster. + [ConsoleName ]: The name of the virtual machine console. + [FeatureName ]: The name of the feature. + [Id ]: Resource identity path + [KubernetesClusterName ]: The name of the Kubernetes cluster. + [L2NetworkName ]: The name of the L2 network. + [L3NetworkName ]: The name of the L3 network. + [MetricsConfigurationName ]: The name of the metrics configuration for the cluster. + [RackName ]: The name of the rack. + [RackSkuName ]: The name of the rack SKU. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [StorageApplianceName ]: The name of the storage appliance. + [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. + [TrunkedNetworkName ]: The name of the trunked network. + [VirtualMachineName ]: The name of the virtual machine. + [VolumeName ]: The name of the volume. .Link https://learn.microsoft.com/powershell/module/az.networkcloud/get-aznetworkcloudagentpool #> function Get-AzNetworkCloudAgentPool { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPool])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPool])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] @@ -71,6 +95,7 @@ param( ${KubernetesClusterName}, [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='GetViaIdentityKubernetesCluster', Mandatory)] [Alias('AgentPoolName')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [System.String] @@ -98,9 +123,14 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, + [Parameter(ParameterSetName='GetViaIdentityKubernetesCluster', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] + # Identity Parameter + ${KubernetesClusterInputObject}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -157,6 +187,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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() @@ -178,11 +217,10 @@ begin { $mapping = @{ Get = 'Az.NetworkCloud.private\Get-AzNetworkCloudAgentPool_Get'; GetViaIdentity = 'Az.NetworkCloud.private\Get-AzNetworkCloudAgentPool_GetViaIdentity'; + GetViaIdentityKubernetesCluster = 'Az.NetworkCloud.private\Get-AzNetworkCloudAgentPool_GetViaIdentityKubernetesCluster'; List = 'Az.NetworkCloud.private\Get-AzNetworkCloudAgentPool_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.NetworkCloud.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 { @@ -196,6 +234,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/NetworkCloud/NetworkCloud.Autorest/exports/Get-AzNetworkCloudBareMetalMachine.ps1 b/generated/NetworkCloud/NetworkCloud.Autorest/exports/Get-AzNetworkCloudBareMetalMachine.ps1 index fc69a70ca65b..eb177cd4d47f 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/exports/Get-AzNetworkCloudBareMetalMachine.ps1 +++ b/generated/NetworkCloud/NetworkCloud.Autorest/exports/Get-AzNetworkCloudBareMetalMachine.ps1 @@ -29,7 +29,7 @@ Get-AzNetworkCloudBareMetalMachine -ResourceGroupName resourceGroupName -Subscri .Inputs Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachine +Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachine .Notes COMPLEX PARAMETER PROPERTIES @@ -62,7 +62,7 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.networkcloud/get-aznetworkcloudbaremetalmachine #> function Get-AzNetworkCloudBareMetalMachine { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachine])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachine])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] @@ -94,7 +94,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -153,6 +152,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 +185,7 @@ begin { List = 'Az.NetworkCloud.private\Get-AzNetworkCloudBareMetalMachine_List'; List1 = 'Az.NetworkCloud.private\Get-AzNetworkCloudBareMetalMachine_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.NetworkCloud.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 { @@ -193,6 +199,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/NetworkCloud/NetworkCloud.Autorest/exports/Get-AzNetworkCloudBareMetalMachineKeySet.ps1 b/generated/NetworkCloud/NetworkCloud.Autorest/exports/Get-AzNetworkCloudBareMetalMachineKeySet.ps1 index a8f410268956..0161d53f540b 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/exports/Get-AzNetworkCloudBareMetalMachineKeySet.ps1 +++ b/generated/NetworkCloud/NetworkCloud.Autorest/exports/Get-AzNetworkCloudBareMetalMachineKeySet.ps1 @@ -27,12 +27,36 @@ Get-AzNetworkCloudBareMetalMachineKeySet -ClusterName clusterName -ResourceGroup .Inputs Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySet +Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySet .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. +CLUSTERINPUTOBJECT : Identity Parameter + [AgentPoolName ]: The name of the Kubernetes cluster agent pool. + [BareMetalMachineKeySetName ]: The name of the bare metal machine key set. + [BareMetalMachineName ]: The name of the bare metal machine. + [BmcKeySetName ]: The name of the baseboard management controller key set. + [CloudServicesNetworkName ]: The name of the cloud services network. + [ClusterManagerName ]: The name of the cluster manager. + [ClusterName ]: The name of the cluster. + [ConsoleName ]: The name of the virtual machine console. + [FeatureName ]: The name of the feature. + [Id ]: Resource identity path + [KubernetesClusterName ]: The name of the Kubernetes cluster. + [L2NetworkName ]: The name of the L2 network. + [L3NetworkName ]: The name of the L3 network. + [MetricsConfigurationName ]: The name of the metrics configuration for the cluster. + [RackName ]: The name of the rack. + [RackSkuName ]: The name of the rack SKU. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [StorageApplianceName ]: The name of the storage appliance. + [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. + [TrunkedNetworkName ]: The name of the trunked network. + [VirtualMachineName ]: The name of the virtual machine. + [VolumeName ]: The name of the volume. + INPUTOBJECT : Identity Parameter [AgentPoolName ]: The name of the Kubernetes cluster agent pool. [BareMetalMachineKeySetName ]: The name of the bare metal machine key set. @@ -60,7 +84,7 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.networkcloud/get-aznetworkcloudbaremetalmachinekeyset #> function Get-AzNetworkCloudBareMetalMachineKeySet { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySet])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySet])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] @@ -71,6 +95,7 @@ param( ${ClusterName}, [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='GetViaIdentityCluster', Mandatory)] [Alias('BareMetalMachineKeySetName')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [System.String] @@ -98,9 +123,14 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, + [Parameter(ParameterSetName='GetViaIdentityCluster', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] + # Identity Parameter + ${ClusterInputObject}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -157,6 +187,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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() @@ -178,11 +217,10 @@ begin { $mapping = @{ Get = 'Az.NetworkCloud.private\Get-AzNetworkCloudBareMetalMachineKeySet_Get'; GetViaIdentity = 'Az.NetworkCloud.private\Get-AzNetworkCloudBareMetalMachineKeySet_GetViaIdentity'; + GetViaIdentityCluster = 'Az.NetworkCloud.private\Get-AzNetworkCloudBareMetalMachineKeySet_GetViaIdentityCluster'; List = 'Az.NetworkCloud.private\Get-AzNetworkCloudBareMetalMachineKeySet_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.NetworkCloud.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 { @@ -196,6 +234,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/NetworkCloud/NetworkCloud.Autorest/exports/Get-AzNetworkCloudBmcKeySet.ps1 b/generated/NetworkCloud/NetworkCloud.Autorest/exports/Get-AzNetworkCloudBmcKeySet.ps1 index 2fc45ba23c96..2732d41b0cb3 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/exports/Get-AzNetworkCloudBmcKeySet.ps1 +++ b/generated/NetworkCloud/NetworkCloud.Autorest/exports/Get-AzNetworkCloudBmcKeySet.ps1 @@ -27,12 +27,36 @@ Get-AzNetworkCloudBmcKeySet -ClusterName clusterName -ResourceGroupName resource .Inputs Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySet +Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySet .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. +CLUSTERINPUTOBJECT : Identity Parameter + [AgentPoolName ]: The name of the Kubernetes cluster agent pool. + [BareMetalMachineKeySetName ]: The name of the bare metal machine key set. + [BareMetalMachineName ]: The name of the bare metal machine. + [BmcKeySetName ]: The name of the baseboard management controller key set. + [CloudServicesNetworkName ]: The name of the cloud services network. + [ClusterManagerName ]: The name of the cluster manager. + [ClusterName ]: The name of the cluster. + [ConsoleName ]: The name of the virtual machine console. + [FeatureName ]: The name of the feature. + [Id ]: Resource identity path + [KubernetesClusterName ]: The name of the Kubernetes cluster. + [L2NetworkName ]: The name of the L2 network. + [L3NetworkName ]: The name of the L3 network. + [MetricsConfigurationName ]: The name of the metrics configuration for the cluster. + [RackName ]: The name of the rack. + [RackSkuName ]: The name of the rack SKU. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [StorageApplianceName ]: The name of the storage appliance. + [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. + [TrunkedNetworkName ]: The name of the trunked network. + [VirtualMachineName ]: The name of the virtual machine. + [VolumeName ]: The name of the volume. + INPUTOBJECT : Identity Parameter [AgentPoolName ]: The name of the Kubernetes cluster agent pool. [BareMetalMachineKeySetName ]: The name of the bare metal machine key set. @@ -60,7 +84,7 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.networkcloud/get-aznetworkcloudbmckeyset #> function Get-AzNetworkCloudBmcKeySet { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySet])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySet])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] @@ -71,6 +95,7 @@ param( ${ClusterName}, [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='GetViaIdentityCluster', Mandatory)] [Alias('BmcKeySetName')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [System.String] @@ -98,9 +123,14 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, + [Parameter(ParameterSetName='GetViaIdentityCluster', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] + # Identity Parameter + ${ClusterInputObject}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -157,6 +187,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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() @@ -178,11 +217,10 @@ begin { $mapping = @{ Get = 'Az.NetworkCloud.private\Get-AzNetworkCloudBmcKeySet_Get'; GetViaIdentity = 'Az.NetworkCloud.private\Get-AzNetworkCloudBmcKeySet_GetViaIdentity'; + GetViaIdentityCluster = 'Az.NetworkCloud.private\Get-AzNetworkCloudBmcKeySet_GetViaIdentityCluster'; List = 'Az.NetworkCloud.private\Get-AzNetworkCloudBmcKeySet_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.NetworkCloud.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 { @@ -196,6 +234,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/NetworkCloud/NetworkCloud.Autorest/exports/Get-AzNetworkCloudCluster.ps1 b/generated/NetworkCloud/NetworkCloud.Autorest/exports/Get-AzNetworkCloudCluster.ps1 index 8f73a48f0db9..11dddd747605 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/exports/Get-AzNetworkCloudCluster.ps1 +++ b/generated/NetworkCloud/NetworkCloud.Autorest/exports/Get-AzNetworkCloudCluster.ps1 @@ -29,7 +29,7 @@ Get-AzNetworkCloudCluster -ResourceGroupName resourceGroup -SubscriptionId subsc .Inputs Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICluster +Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICluster .Notes COMPLEX PARAMETER PROPERTIES @@ -62,7 +62,7 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.networkcloud/get-aznetworkcloudcluster #> function Get-AzNetworkCloudCluster { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICluster])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICluster])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] @@ -94,7 +94,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -153,6 +152,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 +185,7 @@ begin { List = 'Az.NetworkCloud.private\Get-AzNetworkCloudCluster_List'; List1 = 'Az.NetworkCloud.private\Get-AzNetworkCloudCluster_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.NetworkCloud.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 { @@ -193,6 +199,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/NetworkCloud/NetworkCloud.Autorest/exports/Get-AzNetworkCloudClusterManager.ps1 b/generated/NetworkCloud/NetworkCloud.Autorest/exports/Get-AzNetworkCloudClusterManager.ps1 index 292b83b02f30..586a5a865ace 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/exports/Get-AzNetworkCloudClusterManager.ps1 +++ b/generated/NetworkCloud/NetworkCloud.Autorest/exports/Get-AzNetworkCloudClusterManager.ps1 @@ -29,7 +29,7 @@ Get-AzNetworkCloudClusterManager -ResourceGroupName resourceGroup -SubscriptionI .Inputs Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManager +Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManager .Notes COMPLEX PARAMETER PROPERTIES @@ -62,7 +62,7 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.networkcloud/get-aznetworkcloudclustermanager #> function Get-AzNetworkCloudClusterManager { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManager])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManager])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] @@ -94,7 +94,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -153,6 +152,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 +185,7 @@ begin { List = 'Az.NetworkCloud.private\Get-AzNetworkCloudClusterManager_List'; List1 = 'Az.NetworkCloud.private\Get-AzNetworkCloudClusterManager_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.NetworkCloud.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 { @@ -193,6 +199,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/NetworkCloud/NetworkCloud.Autorest/exports/Get-AzNetworkCloudConsole.ps1 b/generated/NetworkCloud/NetworkCloud.Autorest/exports/Get-AzNetworkCloudConsole.ps1 index a65f76e70b47..0be063aea4fe 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/exports/Get-AzNetworkCloudConsole.ps1 +++ b/generated/NetworkCloud/NetworkCloud.Autorest/exports/Get-AzNetworkCloudConsole.ps1 @@ -27,7 +27,7 @@ Get-AzNetworkCloudConsole -Name consoleName -SubscriptionId subscriptionId -Reso .Inputs Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsole +Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsole .Notes COMPLEX PARAMETER PROPERTIES @@ -56,14 +56,39 @@ INPUTOBJECT : Identity Parameter [TrunkedNetworkName ]: The name of the trunked network. [VirtualMachineName ]: The name of the virtual machine. [VolumeName ]: The name of the volume. + +VIRTUALMACHINEINPUTOBJECT : Identity Parameter + [AgentPoolName ]: The name of the Kubernetes cluster agent pool. + [BareMetalMachineKeySetName ]: The name of the bare metal machine key set. + [BareMetalMachineName ]: The name of the bare metal machine. + [BmcKeySetName ]: The name of the baseboard management controller key set. + [CloudServicesNetworkName ]: The name of the cloud services network. + [ClusterManagerName ]: The name of the cluster manager. + [ClusterName ]: The name of the cluster. + [ConsoleName ]: The name of the virtual machine console. + [FeatureName ]: The name of the feature. + [Id ]: Resource identity path + [KubernetesClusterName ]: The name of the Kubernetes cluster. + [L2NetworkName ]: The name of the L2 network. + [L3NetworkName ]: The name of the L3 network. + [MetricsConfigurationName ]: The name of the metrics configuration for the cluster. + [RackName ]: The name of the rack. + [RackSkuName ]: The name of the rack SKU. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [StorageApplianceName ]: The name of the storage appliance. + [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. + [TrunkedNetworkName ]: The name of the trunked network. + [VirtualMachineName ]: The name of the virtual machine. + [VolumeName ]: The name of the volume. .Link https://learn.microsoft.com/powershell/module/az.networkcloud/get-aznetworkcloudconsole #> function Get-AzNetworkCloudConsole { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsole])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsole])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='GetViaIdentityVirtualMachine', Mandatory)] [Alias('ConsoleName')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [System.String] @@ -98,9 +123,14 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, + [Parameter(ParameterSetName='GetViaIdentityVirtualMachine', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] + # Identity Parameter + ${VirtualMachineInputObject}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -157,6 +187,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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() @@ -178,11 +217,10 @@ begin { $mapping = @{ Get = 'Az.NetworkCloud.private\Get-AzNetworkCloudConsole_Get'; GetViaIdentity = 'Az.NetworkCloud.private\Get-AzNetworkCloudConsole_GetViaIdentity'; + GetViaIdentityVirtualMachine = 'Az.NetworkCloud.private\Get-AzNetworkCloudConsole_GetViaIdentityVirtualMachine'; List = 'Az.NetworkCloud.private\Get-AzNetworkCloudConsole_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.NetworkCloud.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 { @@ -196,6 +234,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/NetworkCloud/NetworkCloud.Autorest/exports/Get-AzNetworkCloudKubernetesCluster.ps1 b/generated/NetworkCloud/NetworkCloud.Autorest/exports/Get-AzNetworkCloudKubernetesCluster.ps1 index 8d9bb691dde5..100c20ba4e89 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/exports/Get-AzNetworkCloudKubernetesCluster.ps1 +++ b/generated/NetworkCloud/NetworkCloud.Autorest/exports/Get-AzNetworkCloudKubernetesCluster.ps1 @@ -29,7 +29,7 @@ Get-AzNetworkCloudKubernetesCluster -ResourceGroupName resourceGroupName -Subscr .Inputs Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesCluster +Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesCluster .Notes COMPLEX PARAMETER PROPERTIES @@ -62,7 +62,7 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.networkcloud/get-aznetworkcloudkubernetescluster #> function Get-AzNetworkCloudKubernetesCluster { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesCluster])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesCluster])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] @@ -94,7 +94,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -153,6 +152,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 +185,7 @@ begin { List = 'Az.NetworkCloud.private\Get-AzNetworkCloudKubernetesCluster_List'; List1 = 'Az.NetworkCloud.private\Get-AzNetworkCloudKubernetesCluster_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.NetworkCloud.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 { @@ -193,6 +199,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/NetworkCloud/NetworkCloud.Autorest/exports/Get-AzNetworkCloudKubernetesClusterFeature.ps1 b/generated/NetworkCloud/NetworkCloud.Autorest/exports/Get-AzNetworkCloudKubernetesClusterFeature.ps1 index c59bb3759692..e4bf41992ecd 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/exports/Get-AzNetworkCloudKubernetesClusterFeature.ps1 +++ b/generated/NetworkCloud/NetworkCloud.Autorest/exports/Get-AzNetworkCloudKubernetesClusterFeature.ps1 @@ -27,7 +27,7 @@ Get-AzNetworkCloudKubernetesClusterFeature -KubernetesClusterName kubernetesClus .Inputs Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeature +Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeature .Notes COMPLEX PARAMETER PROPERTIES @@ -56,14 +56,39 @@ INPUTOBJECT : Identity Parameter [TrunkedNetworkName ]: The name of the trunked network. [VirtualMachineName ]: The name of the virtual machine. [VolumeName ]: The name of the volume. + +KUBERNETESCLUSTERINPUTOBJECT : Identity Parameter + [AgentPoolName ]: The name of the Kubernetes cluster agent pool. + [BareMetalMachineKeySetName ]: The name of the bare metal machine key set. + [BareMetalMachineName ]: The name of the bare metal machine. + [BmcKeySetName ]: The name of the baseboard management controller key set. + [CloudServicesNetworkName ]: The name of the cloud services network. + [ClusterManagerName ]: The name of the cluster manager. + [ClusterName ]: The name of the cluster. + [ConsoleName ]: The name of the virtual machine console. + [FeatureName ]: The name of the feature. + [Id ]: Resource identity path + [KubernetesClusterName ]: The name of the Kubernetes cluster. + [L2NetworkName ]: The name of the L2 network. + [L3NetworkName ]: The name of the L3 network. + [MetricsConfigurationName ]: The name of the metrics configuration for the cluster. + [RackName ]: The name of the rack. + [RackSkuName ]: The name of the rack SKU. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [StorageApplianceName ]: The name of the storage appliance. + [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. + [TrunkedNetworkName ]: The name of the trunked network. + [VirtualMachineName ]: The name of the virtual machine. + [VolumeName ]: The name of the volume. .Link https://learn.microsoft.com/powershell/module/az.networkcloud/get-aznetworkcloudkubernetesclusterfeature #> function Get-AzNetworkCloudKubernetesClusterFeature { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeature])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeature])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='GetViaIdentityKubernetesCluster', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [System.String] # The name of the feature. @@ -97,9 +122,14 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, + [Parameter(ParameterSetName='GetViaIdentityKubernetesCluster', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] + # Identity Parameter + ${KubernetesClusterInputObject}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -156,6 +186,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,11 +216,10 @@ begin { $mapping = @{ Get = 'Az.NetworkCloud.private\Get-AzNetworkCloudKubernetesClusterFeature_Get'; GetViaIdentity = 'Az.NetworkCloud.private\Get-AzNetworkCloudKubernetesClusterFeature_GetViaIdentity'; + GetViaIdentityKubernetesCluster = 'Az.NetworkCloud.private\Get-AzNetworkCloudKubernetesClusterFeature_GetViaIdentityKubernetesCluster'; List = 'Az.NetworkCloud.private\Get-AzNetworkCloudKubernetesClusterFeature_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.NetworkCloud.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 { @@ -195,6 +233,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/NetworkCloud/NetworkCloud.Autorest/exports/Get-AzNetworkCloudL2Network.ps1 b/generated/NetworkCloud/NetworkCloud.Autorest/exports/Get-AzNetworkCloudL2Network.ps1 index 87c6f1125bf6..65b82e9f3ff6 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/exports/Get-AzNetworkCloudL2Network.ps1 +++ b/generated/NetworkCloud/NetworkCloud.Autorest/exports/Get-AzNetworkCloudL2Network.ps1 @@ -29,7 +29,7 @@ Get-AzNetworkCloudL2Network -SubscriptionId subscriptionId .Inputs Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2Network +Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2Network .Notes COMPLEX PARAMETER PROPERTIES @@ -62,7 +62,7 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.networkcloud/get-aznetworkcloudl2network #> function Get-AzNetworkCloudL2Network { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2Network])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2Network])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] @@ -94,7 +94,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -153,6 +152,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 +185,7 @@ begin { List = 'Az.NetworkCloud.private\Get-AzNetworkCloudL2Network_List'; List1 = 'Az.NetworkCloud.private\Get-AzNetworkCloudL2Network_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.NetworkCloud.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 { @@ -193,6 +199,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/NetworkCloud/NetworkCloud.Autorest/exports/Get-AzNetworkCloudL3Network.ps1 b/generated/NetworkCloud/NetworkCloud.Autorest/exports/Get-AzNetworkCloudL3Network.ps1 index 9a9a07f47535..58c6753373d5 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/exports/Get-AzNetworkCloudL3Network.ps1 +++ b/generated/NetworkCloud/NetworkCloud.Autorest/exports/Get-AzNetworkCloudL3Network.ps1 @@ -29,7 +29,7 @@ Get-AzNetworkCloudL3Network -SubscriptionId subscriptionId .Inputs Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3Network +Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3Network .Notes COMPLEX PARAMETER PROPERTIES @@ -62,7 +62,7 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.networkcloud/get-aznetworkcloudl3network #> function Get-AzNetworkCloudL3Network { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3Network])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3Network])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] @@ -94,7 +94,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -153,6 +152,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 +185,7 @@ begin { List = 'Az.NetworkCloud.private\Get-AzNetworkCloudL3Network_List'; List1 = 'Az.NetworkCloud.private\Get-AzNetworkCloudL3Network_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.NetworkCloud.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 { @@ -193,6 +199,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/NetworkCloud/NetworkCloud.Autorest/exports/Get-AzNetworkCloudMetricsConfiguration.ps1 b/generated/NetworkCloud/NetworkCloud.Autorest/exports/Get-AzNetworkCloudMetricsConfiguration.ps1 index ffb834dd9221..92d92ec0da5c 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/exports/Get-AzNetworkCloudMetricsConfiguration.ps1 +++ b/generated/NetworkCloud/NetworkCloud.Autorest/exports/Get-AzNetworkCloudMetricsConfiguration.ps1 @@ -27,12 +27,36 @@ Get-AzNetworkCloudMetricsConfiguration -ClusterName clusterName -ResourceGroupNa .Inputs Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfiguration +Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfiguration .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. +CLUSTERINPUTOBJECT : Identity Parameter + [AgentPoolName ]: The name of the Kubernetes cluster agent pool. + [BareMetalMachineKeySetName ]: The name of the bare metal machine key set. + [BareMetalMachineName ]: The name of the bare metal machine. + [BmcKeySetName ]: The name of the baseboard management controller key set. + [CloudServicesNetworkName ]: The name of the cloud services network. + [ClusterManagerName ]: The name of the cluster manager. + [ClusterName ]: The name of the cluster. + [ConsoleName ]: The name of the virtual machine console. + [FeatureName ]: The name of the feature. + [Id ]: Resource identity path + [KubernetesClusterName ]: The name of the Kubernetes cluster. + [L2NetworkName ]: The name of the L2 network. + [L3NetworkName ]: The name of the L3 network. + [MetricsConfigurationName ]: The name of the metrics configuration for the cluster. + [RackName ]: The name of the rack. + [RackSkuName ]: The name of the rack SKU. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [StorageApplianceName ]: The name of the storage appliance. + [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. + [TrunkedNetworkName ]: The name of the trunked network. + [VirtualMachineName ]: The name of the virtual machine. + [VolumeName ]: The name of the volume. + INPUTOBJECT : Identity Parameter [AgentPoolName ]: The name of the Kubernetes cluster agent pool. [BareMetalMachineKeySetName ]: The name of the bare metal machine key set. @@ -60,7 +84,7 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.networkcloud/get-aznetworkcloudmetricsconfiguration #> function Get-AzNetworkCloudMetricsConfiguration { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfiguration])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfiguration])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] @@ -71,6 +95,7 @@ param( ${ClusterName}, [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='GetViaIdentityCluster', Mandatory)] [Alias('MetricsConfigurationName')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [System.String] @@ -98,9 +123,14 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, + [Parameter(ParameterSetName='GetViaIdentityCluster', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] + # Identity Parameter + ${ClusterInputObject}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -157,6 +187,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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() @@ -178,11 +217,10 @@ begin { $mapping = @{ Get = 'Az.NetworkCloud.private\Get-AzNetworkCloudMetricsConfiguration_Get'; GetViaIdentity = 'Az.NetworkCloud.private\Get-AzNetworkCloudMetricsConfiguration_GetViaIdentity'; + GetViaIdentityCluster = 'Az.NetworkCloud.private\Get-AzNetworkCloudMetricsConfiguration_GetViaIdentityCluster'; List = 'Az.NetworkCloud.private\Get-AzNetworkCloudMetricsConfiguration_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.NetworkCloud.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 { @@ -196,6 +234,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/NetworkCloud/NetworkCloud.Autorest/exports/Get-AzNetworkCloudRack.ps1 b/generated/NetworkCloud/NetworkCloud.Autorest/exports/Get-AzNetworkCloudRack.ps1 index 01efa049a8a1..224c352db18c 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/exports/Get-AzNetworkCloudRack.ps1 +++ b/generated/NetworkCloud/NetworkCloud.Autorest/exports/Get-AzNetworkCloudRack.ps1 @@ -29,7 +29,7 @@ Get-AzNetworkCloudRack -SubscriptionId subscriptionId .Inputs Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRack +Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRack .Notes COMPLEX PARAMETER PROPERTIES @@ -62,7 +62,7 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.networkcloud/get-aznetworkcloudrack #> function Get-AzNetworkCloudRack { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRack])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRack])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] @@ -94,7 +94,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -153,6 +152,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 +185,7 @@ begin { List = 'Az.NetworkCloud.private\Get-AzNetworkCloudRack_List'; List1 = 'Az.NetworkCloud.private\Get-AzNetworkCloudRack_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.NetworkCloud.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 { @@ -193,6 +199,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/NetworkCloud/NetworkCloud.Autorest/exports/Get-AzNetworkCloudRackSku.ps1 b/generated/NetworkCloud/NetworkCloud.Autorest/exports/Get-AzNetworkCloudRackSku.ps1 index 3b9d91dd56f3..4f995f516d97 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/exports/Get-AzNetworkCloudRackSku.ps1 +++ b/generated/NetworkCloud/NetworkCloud.Autorest/exports/Get-AzNetworkCloudRackSku.ps1 @@ -27,7 +27,7 @@ Get-AzNetworkCloudRackSku -Name rackSkuName -SubscriptionId subscriptionId .Inputs Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackSku +Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackSku .Notes COMPLEX PARAMETER PROPERTIES @@ -60,7 +60,7 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.networkcloud/get-aznetworkcloudracksku #> function Get-AzNetworkCloudRackSku { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackSku])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackSku])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] @@ -83,7 +83,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] # 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.NetworkCloud.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 { GetViaIdentity = 'Az.NetworkCloud.private\Get-AzNetworkCloudRackSku_GetViaIdentity'; List = 'Az.NetworkCloud.private\Get-AzNetworkCloudRackSku_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.NetworkCloud.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 { @@ -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/NetworkCloud/NetworkCloud.Autorest/exports/Get-AzNetworkCloudServicesNetwork.ps1 b/generated/NetworkCloud/NetworkCloud.Autorest/exports/Get-AzNetworkCloudServicesNetwork.ps1 index 9acb508d28b3..0a3f11778a08 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/exports/Get-AzNetworkCloudServicesNetwork.ps1 +++ b/generated/NetworkCloud/NetworkCloud.Autorest/exports/Get-AzNetworkCloudServicesNetwork.ps1 @@ -29,7 +29,7 @@ Get-AzNetworkCloudServicesNetwork -SubscriptionId subscriptionId .Inputs Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetwork +Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetwork .Notes COMPLEX PARAMETER PROPERTIES @@ -62,7 +62,7 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.networkcloud/get-aznetworkcloudservicesnetwork #> function Get-AzNetworkCloudServicesNetwork { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetwork])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetwork])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] @@ -94,7 +94,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -153,6 +152,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 +185,7 @@ begin { List = 'Az.NetworkCloud.private\Get-AzNetworkCloudServicesNetwork_List'; List1 = 'Az.NetworkCloud.private\Get-AzNetworkCloudServicesNetwork_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.NetworkCloud.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 { @@ -193,6 +199,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/NetworkCloud/NetworkCloud.Autorest/exports/Get-AzNetworkCloudStorageAppliance.ps1 b/generated/NetworkCloud/NetworkCloud.Autorest/exports/Get-AzNetworkCloudStorageAppliance.ps1 index c51eaf47f24a..8bd780bbd956 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/exports/Get-AzNetworkCloudStorageAppliance.ps1 +++ b/generated/NetworkCloud/NetworkCloud.Autorest/exports/Get-AzNetworkCloudStorageAppliance.ps1 @@ -29,7 +29,7 @@ Get-AzNetworkCloudStorageAppliance -Name storageApplianceName -SubscriptionId su .Inputs Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliance +Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliance .Notes COMPLEX PARAMETER PROPERTIES @@ -62,7 +62,7 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.networkcloud/get-aznetworkcloudstorageappliance #> function Get-AzNetworkCloudStorageAppliance { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliance])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliance])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] @@ -94,7 +94,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -153,6 +152,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 +185,7 @@ begin { List = 'Az.NetworkCloud.private\Get-AzNetworkCloudStorageAppliance_List'; List1 = 'Az.NetworkCloud.private\Get-AzNetworkCloudStorageAppliance_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.NetworkCloud.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 { @@ -193,6 +199,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/NetworkCloud/NetworkCloud.Autorest/exports/Get-AzNetworkCloudTrunkedNetwork.ps1 b/generated/NetworkCloud/NetworkCloud.Autorest/exports/Get-AzNetworkCloudTrunkedNetwork.ps1 index 67732018e35a..ead1f7a4abbf 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/exports/Get-AzNetworkCloudTrunkedNetwork.ps1 +++ b/generated/NetworkCloud/NetworkCloud.Autorest/exports/Get-AzNetworkCloudTrunkedNetwork.ps1 @@ -29,7 +29,7 @@ Get-AzNetworkCloudTrunkedNetwork -ResourceGroupName resourceGroupName -Subscript .Inputs Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetwork +Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetwork .Notes COMPLEX PARAMETER PROPERTIES @@ -62,7 +62,7 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.networkcloud/get-aznetworkcloudtrunkednetwork #> function Get-AzNetworkCloudTrunkedNetwork { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetwork])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetwork])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] @@ -94,7 +94,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -153,6 +152,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 +185,7 @@ begin { List = 'Az.NetworkCloud.private\Get-AzNetworkCloudTrunkedNetwork_List'; List1 = 'Az.NetworkCloud.private\Get-AzNetworkCloudTrunkedNetwork_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.NetworkCloud.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 { @@ -193,6 +199,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/NetworkCloud/NetworkCloud.Autorest/exports/Get-AzNetworkCloudVirtualMachine.ps1 b/generated/NetworkCloud/NetworkCloud.Autorest/exports/Get-AzNetworkCloudVirtualMachine.ps1 index 5b446a105e2c..49d6cb96fc1a 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/exports/Get-AzNetworkCloudVirtualMachine.ps1 +++ b/generated/NetworkCloud/NetworkCloud.Autorest/exports/Get-AzNetworkCloudVirtualMachine.ps1 @@ -29,7 +29,7 @@ Get-AzNetworkCloudVirtualMachine -ResourceGroupName resourceGroup -SubscriptionI .Inputs Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachine +Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachine .Notes COMPLEX PARAMETER PROPERTIES @@ -62,7 +62,7 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.networkcloud/get-aznetworkcloudvirtualmachine #> function Get-AzNetworkCloudVirtualMachine { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachine])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachine])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] @@ -94,7 +94,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -153,6 +152,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 +185,7 @@ begin { List = 'Az.NetworkCloud.private\Get-AzNetworkCloudVirtualMachine_List'; List1 = 'Az.NetworkCloud.private\Get-AzNetworkCloudVirtualMachine_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.NetworkCloud.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 { @@ -193,6 +199,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/NetworkCloud/NetworkCloud.Autorest/exports/Get-AzNetworkCloudVolume.ps1 b/generated/NetworkCloud/NetworkCloud.Autorest/exports/Get-AzNetworkCloudVolume.ps1 index b0d10c793866..490e9c1176de 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/exports/Get-AzNetworkCloudVolume.ps1 +++ b/generated/NetworkCloud/NetworkCloud.Autorest/exports/Get-AzNetworkCloudVolume.ps1 @@ -29,7 +29,7 @@ Get-AzNetworkCloudVolume -ResourceGroupName resourceGroupName -SubscriptionId su .Inputs Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolume +Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolume .Notes COMPLEX PARAMETER PROPERTIES @@ -62,7 +62,7 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.networkcloud/get-aznetworkcloudvolume #> function Get-AzNetworkCloudVolume { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolume])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolume])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] @@ -94,7 +94,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -153,6 +152,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 +185,7 @@ begin { List = 'Az.NetworkCloud.private\Get-AzNetworkCloudVolume_List'; List1 = 'Az.NetworkCloud.private\Get-AzNetworkCloudVolume_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.NetworkCloud.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 { @@ -193,6 +199,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/NetworkCloud/NetworkCloud.Autorest/exports/Invoke-AzNetworkCloudBareMetalMachineCordon.ps1 b/generated/NetworkCloud/NetworkCloud.Autorest/exports/Invoke-AzNetworkCloudBareMetalMachineCordon.ps1 index c6d63eb3b03a..0ef55e16e238 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/exports/Invoke-AzNetworkCloudBareMetalMachineCordon.ps1 +++ b/generated/NetworkCloud/NetworkCloud.Autorest/exports/Invoke-AzNetworkCloudBareMetalMachineCordon.ps1 @@ -62,12 +62,16 @@ function Invoke-AzNetworkCloudBareMetalMachineCordon { [CmdletBinding(DefaultParameterSetName='CordonExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='CordonExpanded', Mandatory)] + [Parameter(ParameterSetName='CordonViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='CordonViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [System.String] # The name of the bare metal machine. ${BareMetalMachineName}, [Parameter(ParameterSetName='CordonExpanded', Mandatory)] + [Parameter(ParameterSetName='CordonViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='CordonViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [System.String] # The name of the resource group. @@ -75,6 +79,8 @@ param( ${ResourceGroupName}, [Parameter(ParameterSetName='CordonExpanded')] + [Parameter(ParameterSetName='CordonViaJsonFilePath')] + [Parameter(ParameterSetName='CordonViaJsonString')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] @@ -86,16 +92,28 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineEvacuate])] + [Parameter(ParameterSetName='CordonExpanded')] + [Parameter(ParameterSetName='CordonViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("True", "False")] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineEvacuate] + [System.String] # The indicator of whether to evacuate the node workload when the bare metal machine is cordoned. ${Evacuate}, + [Parameter(ParameterSetName='CordonViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Path of Json file supplied to the Cordon operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='CordonViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Json string supplied to the Cordon operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -170,6 +188,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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() @@ -191,10 +218,10 @@ begin { $mapping = @{ CordonExpanded = 'Az.NetworkCloud.private\Invoke-AzNetworkCloudBareMetalMachineCordon_CordonExpanded'; CordonViaIdentityExpanded = 'Az.NetworkCloud.private\Invoke-AzNetworkCloudBareMetalMachineCordon_CordonViaIdentityExpanded'; + CordonViaJsonFilePath = 'Az.NetworkCloud.private\Invoke-AzNetworkCloudBareMetalMachineCordon_CordonViaJsonFilePath'; + CordonViaJsonString = 'Az.NetworkCloud.private\Invoke-AzNetworkCloudBareMetalMachineCordon_CordonViaJsonString'; } - if (('CordonExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('CordonExpanded', 'CordonViaJsonFilePath', 'CordonViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -208,6 +235,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/NetworkCloud/NetworkCloud.Autorest/exports/Invoke-AzNetworkCloudBareMetalMachineDataExtract.ps1 b/generated/NetworkCloud/NetworkCloud.Autorest/exports/Invoke-AzNetworkCloudBareMetalMachineDataExtract.ps1 index 60bae70ec534..324419f5b159 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/exports/Invoke-AzNetworkCloudBareMetalMachineDataExtract.ps1 +++ b/generated/NetworkCloud/NetworkCloud.Autorest/exports/Invoke-AzNetworkCloudBareMetalMachineDataExtract.ps1 @@ -40,7 +40,7 @@ To create the parameters described below, construct a hash table containing the COMMAND : The list of curated data extraction commands to be executed directly against the target machine. Command : The command to execute against the bare metal machine. - [Argument ]: The list of string arguments that will be passed to the script in order as separate arguments. + [Argument >]: The list of string arguments that will be passed to the script in order as separate arguments. INPUTOBJECT : Identity Parameter [AgentPoolName ]: The name of the Kubernetes cluster agent pool. @@ -73,12 +73,16 @@ function Invoke-AzNetworkCloudBareMetalMachineDataExtract { [CmdletBinding(DefaultParameterSetName='RunViaIdentityExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='RunExpanded', Mandatory)] + [Parameter(ParameterSetName='RunViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='RunViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [System.String] # The name of the bare metal machine. ${BareMetalMachineName}, [Parameter(ParameterSetName='RunExpanded', Mandatory)] + [Parameter(ParameterSetName='RunViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='RunViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [System.String] # The name of the resource group. @@ -86,6 +90,8 @@ param( ${ResourceGroupName}, [Parameter(ParameterSetName='RunExpanded')] + [Parameter(ParameterSetName='RunViaJsonFilePath')] + [Parameter(ParameterSetName='RunViaJsonString')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] @@ -97,23 +103,35 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='RunExpanded', Mandatory)] + [Parameter(ParameterSetName='RunViaIdentityExpanded', Mandatory)] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineCommandSpecification[]] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineCommandSpecification[]] # The list of curated data extraction commands to be executed directly against the target machine. - # To construct, see NOTES section for COMMAND properties and create a hash table. ${Command}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='RunExpanded', Mandatory)] + [Parameter(ParameterSetName='RunViaIdentityExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.Int64] # The maximum time the commands are allowed to run.If the execution time exceeds the maximum, the script will be stopped, any output produced until then will be captured, and the exit code matching a timeout will be returned (252). ${LimitTimeSecond}, + [Parameter(ParameterSetName='RunViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Path of Json file supplied to the Run operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='RunViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Json string supplied to the Run operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -188,6 +206,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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() @@ -209,10 +236,10 @@ begin { $mapping = @{ RunExpanded = 'Az.NetworkCloud.private\Invoke-AzNetworkCloudBareMetalMachineDataExtract_RunExpanded'; RunViaIdentityExpanded = 'Az.NetworkCloud.private\Invoke-AzNetworkCloudBareMetalMachineDataExtract_RunViaIdentityExpanded'; + RunViaJsonFilePath = 'Az.NetworkCloud.private\Invoke-AzNetworkCloudBareMetalMachineDataExtract_RunViaJsonFilePath'; + RunViaJsonString = 'Az.NetworkCloud.private\Invoke-AzNetworkCloudBareMetalMachineDataExtract_RunViaJsonString'; } - if (('RunExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('RunExpanded', 'RunViaJsonFilePath', 'RunViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -226,6 +253,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/NetworkCloud/NetworkCloud.Autorest/exports/Invoke-AzNetworkCloudBareMetalMachineReimage.ps1 b/generated/NetworkCloud/NetworkCloud.Autorest/exports/Invoke-AzNetworkCloudBareMetalMachineReimage.ps1 index 0158e9dd3e0d..2f6a50a0ace3 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/exports/Invoke-AzNetworkCloudBareMetalMachineReimage.ps1 +++ b/generated/NetworkCloud/NetworkCloud.Autorest/exports/Invoke-AzNetworkCloudBareMetalMachineReimage.ps1 @@ -87,7 +87,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -164,6 +163,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 { Reimage = 'Az.NetworkCloud.private\Invoke-AzNetworkCloudBareMetalMachineReimage_Reimage'; ReimageViaIdentity = 'Az.NetworkCloud.private\Invoke-AzNetworkCloudBareMetalMachineReimage_ReimageViaIdentity'; } - if (('Reimage') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Reimage') -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/NetworkCloud/NetworkCloud.Autorest/exports/Invoke-AzNetworkCloudBareMetalMachineReplace.ps1 b/generated/NetworkCloud/NetworkCloud.Autorest/exports/Invoke-AzNetworkCloudBareMetalMachineReplace.ps1 index fcfdd7b23b40..4196a8f82028 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/exports/Invoke-AzNetworkCloudBareMetalMachineReplace.ps1 +++ b/generated/NetworkCloud/NetworkCloud.Autorest/exports/Invoke-AzNetworkCloudBareMetalMachineReplace.ps1 @@ -64,6 +64,8 @@ function Invoke-AzNetworkCloudBareMetalMachineReplace { [CmdletBinding(DefaultParameterSetName='ReplaceExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='ReplaceExpanded', Mandatory)] + [Parameter(ParameterSetName='ReplaceViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='ReplaceViaJsonString', Mandatory)] [Alias('BareMetalMachineName')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [System.String] @@ -71,6 +73,8 @@ param( ${Name}, [Parameter(ParameterSetName='ReplaceExpanded', Mandatory)] + [Parameter(ParameterSetName='ReplaceViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='ReplaceViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [System.String] # The name of the resource group. @@ -78,6 +82,8 @@ param( ${ResourceGroupName}, [Parameter(ParameterSetName='ReplaceExpanded')] + [Parameter(ParameterSetName='ReplaceViaJsonFilePath')] + [Parameter(ParameterSetName='ReplaceViaJsonString')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] @@ -89,45 +95,62 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, - [Parameter()] + [Parameter(ParameterSetName='ReplaceExpanded')] + [Parameter(ParameterSetName='ReplaceViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.Security.SecureString] # The password of the administrator of the device used during initialization. ${BmcCredentialsPassword}, - [Parameter()] + [Parameter(ParameterSetName='ReplaceExpanded')] + [Parameter(ParameterSetName='ReplaceViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The username of the administrator of the device used during initialization. ${BmcCredentialsUsername}, - [Parameter()] + [Parameter(ParameterSetName='ReplaceExpanded')] + [Parameter(ParameterSetName='ReplaceViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The MAC address of the BMC device. ${BmcMacAddress}, - [Parameter()] + [Parameter(ParameterSetName='ReplaceExpanded')] + [Parameter(ParameterSetName='ReplaceViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The MAC address of a NIC connected to the PXE network. ${BootMacAddress}, - [Parameter()] + [Parameter(ParameterSetName='ReplaceExpanded')] + [Parameter(ParameterSetName='ReplaceViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The OS-level hostname assigned to this machine. ${MachineName}, - [Parameter()] + [Parameter(ParameterSetName='ReplaceExpanded')] + [Parameter(ParameterSetName='ReplaceViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The serial number of the bare metal machine. ${SerialNumber}, + [Parameter(ParameterSetName='ReplaceViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Path of Json file supplied to the Replace operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='ReplaceViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Json string supplied to the Replace operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -202,6 +225,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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() @@ -223,10 +255,10 @@ begin { $mapping = @{ ReplaceExpanded = 'Az.NetworkCloud.private\Invoke-AzNetworkCloudBareMetalMachineReplace_ReplaceExpanded'; ReplaceViaIdentityExpanded = 'Az.NetworkCloud.private\Invoke-AzNetworkCloudBareMetalMachineReplace_ReplaceViaIdentityExpanded'; + ReplaceViaJsonFilePath = 'Az.NetworkCloud.private\Invoke-AzNetworkCloudBareMetalMachineReplace_ReplaceViaJsonFilePath'; + ReplaceViaJsonString = 'Az.NetworkCloud.private\Invoke-AzNetworkCloudBareMetalMachineReplace_ReplaceViaJsonString'; } - if (('ReplaceExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('ReplaceExpanded', 'ReplaceViaJsonFilePath', 'ReplaceViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -240,6 +272,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/NetworkCloud/NetworkCloud.Autorest/exports/Invoke-AzNetworkCloudBareMetalMachineRunCommand.ps1 b/generated/NetworkCloud/NetworkCloud.Autorest/exports/Invoke-AzNetworkCloudBareMetalMachineRunCommand.ps1 index e48c8a80b499..12d9f9a693d3 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/exports/Invoke-AzNetworkCloudBareMetalMachineRunCommand.ps1 +++ b/generated/NetworkCloud/NetworkCloud.Autorest/exports/Invoke-AzNetworkCloudBareMetalMachineRunCommand.ps1 @@ -64,12 +64,16 @@ function Invoke-AzNetworkCloudBareMetalMachineRunCommand { [CmdletBinding(DefaultParameterSetName='RunExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='RunExpanded', Mandatory)] + [Parameter(ParameterSetName='RunViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='RunViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [System.String] # The name of the bare metal machine. ${BareMetalMachineName}, [Parameter(ParameterSetName='RunExpanded', Mandatory)] + [Parameter(ParameterSetName='RunViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='RunViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [System.String] # The name of the resource group. @@ -77,6 +81,8 @@ param( ${ResourceGroupName}, [Parameter(ParameterSetName='RunExpanded')] + [Parameter(ParameterSetName='RunViaJsonFilePath')] + [Parameter(ParameterSetName='RunViaJsonString')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] @@ -88,28 +94,42 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='RunExpanded', Mandatory)] + [Parameter(ParameterSetName='RunViaIdentityExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.Int64] # The maximum time the script is allowed to run.If the execution time exceeds the maximum, the script will be stopped, any output produced until then will be captured, and the exit code matching a timeout will be returned (252). ${LimitTimeSecond}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='RunExpanded', Mandatory)] + [Parameter(ParameterSetName='RunViaIdentityExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The base64 encoded script to execute on the bare metal machine. ${Script}, - [Parameter()] + [Parameter(ParameterSetName='RunExpanded')] + [Parameter(ParameterSetName='RunViaIdentityExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String[]] # The list of string arguments that will be passed to the script in order as separate arguments. ${Argument}, + [Parameter(ParameterSetName='RunViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Path of Json file supplied to the Run operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='RunViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Json string supplied to the Run operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -184,6 +204,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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() @@ -205,10 +234,10 @@ begin { $mapping = @{ RunExpanded = 'Az.NetworkCloud.private\Invoke-AzNetworkCloudBareMetalMachineRunCommand_RunExpanded'; RunViaIdentityExpanded = 'Az.NetworkCloud.private\Invoke-AzNetworkCloudBareMetalMachineRunCommand_RunViaIdentityExpanded'; + RunViaJsonFilePath = 'Az.NetworkCloud.private\Invoke-AzNetworkCloudBareMetalMachineRunCommand_RunViaJsonFilePath'; + RunViaJsonString = 'Az.NetworkCloud.private\Invoke-AzNetworkCloudBareMetalMachineRunCommand_RunViaJsonString'; } - if (('RunExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('RunExpanded', 'RunViaJsonFilePath', 'RunViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -222,6 +251,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/NetworkCloud/NetworkCloud.Autorest/exports/Invoke-AzNetworkCloudBareMetalMachineRunReadCommand.ps1 b/generated/NetworkCloud/NetworkCloud.Autorest/exports/Invoke-AzNetworkCloudBareMetalMachineRunReadCommand.ps1 index 48b2a80e3355..5ef700a10c76 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/exports/Invoke-AzNetworkCloudBareMetalMachineRunReadCommand.ps1 +++ b/generated/NetworkCloud/NetworkCloud.Autorest/exports/Invoke-AzNetworkCloudBareMetalMachineRunReadCommand.ps1 @@ -40,7 +40,7 @@ To create the parameters described below, construct a hash table containing the COMMAND : The list of read-only commands to be executed directly against the target machine. Command : The command to execute against the bare metal machine. - [Argument ]: The list of string arguments that will be passed to the script in order as separate arguments. + [Argument >]: The list of string arguments that will be passed to the script in order as separate arguments. INPUTOBJECT : Identity Parameter [AgentPoolName ]: The name of the Kubernetes cluster agent pool. @@ -73,12 +73,16 @@ function Invoke-AzNetworkCloudBareMetalMachineRunReadCommand { [CmdletBinding(DefaultParameterSetName='RunViaIdentityExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='RunExpanded', Mandatory)] + [Parameter(ParameterSetName='RunViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='RunViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [System.String] # The name of the bare metal machine. ${BareMetalMachineName}, [Parameter(ParameterSetName='RunExpanded', Mandatory)] + [Parameter(ParameterSetName='RunViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='RunViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [System.String] # The name of the resource group. @@ -86,6 +90,8 @@ param( ${ResourceGroupName}, [Parameter(ParameterSetName='RunExpanded')] + [Parameter(ParameterSetName='RunViaJsonFilePath')] + [Parameter(ParameterSetName='RunViaJsonString')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] @@ -97,23 +103,35 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='RunExpanded', Mandatory)] + [Parameter(ParameterSetName='RunViaIdentityExpanded', Mandatory)] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineCommandSpecification[]] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineCommandSpecification[]] # The list of read-only commands to be executed directly against the target machine. - # To construct, see NOTES section for COMMAND properties and create a hash table. ${Command}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='RunExpanded', Mandatory)] + [Parameter(ParameterSetName='RunViaIdentityExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.Int64] # The maximum time the commands are allowed to run.If the execution time exceeds the maximum, the script will be stopped, any output produced until then will be captured, and the exit code matching a timeout will be returned (252). ${LimitTimeSecond}, + [Parameter(ParameterSetName='RunViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Path of Json file supplied to the Run operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='RunViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Json string supplied to the Run operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -188,6 +206,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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() @@ -209,10 +236,10 @@ begin { $mapping = @{ RunExpanded = 'Az.NetworkCloud.private\Invoke-AzNetworkCloudBareMetalMachineRunReadCommand_RunExpanded'; RunViaIdentityExpanded = 'Az.NetworkCloud.private\Invoke-AzNetworkCloudBareMetalMachineRunReadCommand_RunViaIdentityExpanded'; + RunViaJsonFilePath = 'Az.NetworkCloud.private\Invoke-AzNetworkCloudBareMetalMachineRunReadCommand_RunViaJsonFilePath'; + RunViaJsonString = 'Az.NetworkCloud.private\Invoke-AzNetworkCloudBareMetalMachineRunReadCommand_RunViaJsonString'; } - if (('RunExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('RunExpanded', 'RunViaJsonFilePath', 'RunViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -226,6 +253,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/NetworkCloud/NetworkCloud.Autorest/exports/Invoke-AzNetworkCloudBareMetalMachineUncordon.ps1 b/generated/NetworkCloud/NetworkCloud.Autorest/exports/Invoke-AzNetworkCloudBareMetalMachineUncordon.ps1 index 60146b788d9e..24e201d5e2ae 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/exports/Invoke-AzNetworkCloudBareMetalMachineUncordon.ps1 +++ b/generated/NetworkCloud/NetworkCloud.Autorest/exports/Invoke-AzNetworkCloudBareMetalMachineUncordon.ps1 @@ -86,7 +86,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -163,6 +162,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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() @@ -185,9 +193,7 @@ begin { Uncordon = 'Az.NetworkCloud.private\Invoke-AzNetworkCloudBareMetalMachineUncordon_Uncordon'; UncordonViaIdentity = 'Az.NetworkCloud.private\Invoke-AzNetworkCloudBareMetalMachineUncordon_UncordonViaIdentity'; } - if (('Uncordon') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Uncordon') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -201,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/NetworkCloud/NetworkCloud.Autorest/exports/Invoke-AzNetworkCloudClusterContinueVersionUpdate.ps1 b/generated/NetworkCloud/NetworkCloud.Autorest/exports/Invoke-AzNetworkCloudClusterContinueVersionUpdate.ps1 index 689bbd08c38a..5f3797918810 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/exports/Invoke-AzNetworkCloudClusterContinueVersionUpdate.ps1 +++ b/generated/NetworkCloud/NetworkCloud.Autorest/exports/Invoke-AzNetworkCloudClusterContinueVersionUpdate.ps1 @@ -16,14 +16,14 @@ <# .Synopsis -Trigger the continuation of an update for a cluster with a matching update strategy that has paused after completing a segment of the update. +Trigger the continuation of an continue for a cluster with a matching continue strategy that has paused after completing a segment of the continue .Description -Trigger the continuation of an update for a cluster with a matching update strategy that has paused after completing a segment of the update. +Trigger the continuation of an continue for a cluster with a matching continue strategy that has paused after completing a segment of the continue .Example Invoke-AzNetworkCloudClusterContinueVersionUpdate -ResourceGroupName resourceGroupName -ClusterName clusterName -SubscriptionId subscriptionId -MachineGroupTargetingMode "AlphaByRack" .Inputs -Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterContinueUpdateVersionParameters +Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterContinueUpdateVersionParameters .Inputs Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity .Outputs @@ -34,7 +34,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. CLUSTERCONTINUEUPDATEVERSIONPARAMETER : ClusterContinueUpdateVersionParameters represents the body of the request to continue the update of a cluster version. - [MachineGroupTargetingMode ]: The mode by which the cluster will target the next grouping of servers to continue the update. + [MachineGroupTargetingMode ]: The mode by which the cluster will target the next grouping of servers to continue the update. INPUTOBJECT : Identity Parameter [AgentPoolName ]: The name of the Kubernetes cluster agent pool. @@ -68,6 +68,8 @@ function Invoke-AzNetworkCloudClusterContinueVersionUpdate { param( [Parameter(ParameterSetName='Continue', Mandatory)] [Parameter(ParameterSetName='ContinueExpanded', Mandatory)] + [Parameter(ParameterSetName='ContinueViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='ContinueViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [System.String] # The name of the cluster. @@ -75,6 +77,8 @@ param( [Parameter(ParameterSetName='Continue', Mandatory)] [Parameter(ParameterSetName='ContinueExpanded', Mandatory)] + [Parameter(ParameterSetName='ContinueViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='ContinueViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [System.String] # The name of the resource group. @@ -83,6 +87,8 @@ param( [Parameter(ParameterSetName='Continue')] [Parameter(ParameterSetName='ContinueExpanded')] + [Parameter(ParameterSetName='ContinueViaJsonFilePath')] + [Parameter(ParameterSetName='ContinueViaJsonString')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] @@ -95,25 +101,35 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter(ParameterSetName='Continue', Mandatory, ValueFromPipeline)] [Parameter(ParameterSetName='ContinueViaIdentity', Mandatory, ValueFromPipeline)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterContinueUpdateVersionParameters] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterContinueUpdateVersionParameters] # ClusterContinueUpdateVersionParameters represents the body of the request to continue the update of a cluster version. - # To construct, see NOTES section for CLUSTERCONTINUEUPDATEVERSIONPARAMETER properties and create a hash table. ${ClusterContinueUpdateVersionParameter}, [Parameter(ParameterSetName='ContinueExpanded')] [Parameter(ParameterSetName='ContinueViaIdentityExpanded')] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterContinueUpdateVersionMachineGroupTargetingMode])] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("AlphaByRack")] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterContinueUpdateVersionMachineGroupTargetingMode] + [System.String] # The mode by which the cluster will target the next grouping of servers to continue the update. ${MachineGroupTargetingMode}, + [Parameter(ParameterSetName='ContinueViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Path of Json file supplied to the Continue operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='ContinueViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Json string supplied to the Continue operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -188,6 +204,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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() @@ -211,10 +236,10 @@ begin { ContinueExpanded = 'Az.NetworkCloud.private\Invoke-AzNetworkCloudClusterContinueVersionUpdate_ContinueExpanded'; ContinueViaIdentity = 'Az.NetworkCloud.private\Invoke-AzNetworkCloudClusterContinueVersionUpdate_ContinueViaIdentity'; ContinueViaIdentityExpanded = 'Az.NetworkCloud.private\Invoke-AzNetworkCloudClusterContinueVersionUpdate_ContinueViaIdentityExpanded'; + ContinueViaJsonFilePath = 'Az.NetworkCloud.private\Invoke-AzNetworkCloudClusterContinueVersionUpdate_ContinueViaJsonFilePath'; + ContinueViaJsonString = 'Az.NetworkCloud.private\Invoke-AzNetworkCloudClusterContinueVersionUpdate_ContinueViaJsonString'; } - if (('Continue', 'ContinueExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Continue', 'ContinueExpanded', 'ContinueViaJsonFilePath', 'ContinueViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -228,6 +253,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/NetworkCloud/NetworkCloud.Autorest/exports/Invoke-AzNetworkCloudClusterVersionUpdate.ps1 b/generated/NetworkCloud/NetworkCloud.Autorest/exports/Invoke-AzNetworkCloudClusterVersionUpdate.ps1 index 73592bce938f..ff2ceb362973 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/exports/Invoke-AzNetworkCloudClusterVersionUpdate.ps1 +++ b/generated/NetworkCloud/NetworkCloud.Autorest/exports/Invoke-AzNetworkCloudClusterVersionUpdate.ps1 @@ -62,12 +62,16 @@ function Invoke-AzNetworkCloudClusterVersionUpdate { [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.NetworkCloud.Category('Path')] [System.String] # The name of the cluster. ${ClusterName}, [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [System.String] # The name of the resource group. @@ -75,6 +79,8 @@ param( ${ResourceGroupName}, [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaJsonFilePath')] + [Parameter(ParameterSetName='UpdateViaJsonString')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] @@ -86,15 +92,27 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The version to be applied to the cluster during update. ${TargetClusterVersion}, + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Path of Json file supplied to the Update operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Json string supplied to the Update operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -169,6 +187,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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() @@ -190,10 +217,10 @@ begin { $mapping = @{ UpdateExpanded = 'Az.NetworkCloud.private\Invoke-AzNetworkCloudClusterVersionUpdate_UpdateExpanded'; UpdateViaIdentityExpanded = 'Az.NetworkCloud.private\Invoke-AzNetworkCloudClusterVersionUpdate_UpdateViaIdentityExpanded'; + UpdateViaJsonFilePath = 'Az.NetworkCloud.private\Invoke-AzNetworkCloudClusterVersionUpdate_UpdateViaJsonFilePath'; + UpdateViaJsonString = 'Az.NetworkCloud.private\Invoke-AzNetworkCloudClusterVersionUpdate_UpdateViaJsonString'; } - if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 { @@ -207,6 +234,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/NetworkCloud/NetworkCloud.Autorest/exports/Invoke-AzNetworkCloudScanClusterRuntime.ps1 b/generated/NetworkCloud/NetworkCloud.Autorest/exports/Invoke-AzNetworkCloudScanClusterRuntime.ps1 index e654e487acd8..90a2008f85e5 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/exports/Invoke-AzNetworkCloudScanClusterRuntime.ps1 +++ b/generated/NetworkCloud/NetworkCloud.Autorest/exports/Invoke-AzNetworkCloudScanClusterRuntime.ps1 @@ -23,7 +23,7 @@ Triggers the execution of a runtime protection scan to detect and remediate dete Invoke-AzNetworkCloudScanClusterRuntime -ResourceGroupName resourceGroupName -ClusterName clusterName -SubscriptionId subscriptionId -ScanActivity "Scan" .Inputs -Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterScanRuntimeParameters +Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterScanRuntimeParameters .Inputs Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity .Outputs @@ -34,7 +34,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. CLUSTERSCANRUNTIMEPARAMETER : ClusterScanRuntimeParameters defines the parameters for the cluster scan runtime operation. - [ScanActivity ]: The choice of if the scan operation should run the scan. + [ScanActivity ]: The choice of if the scan operation should run the scan. INPUTOBJECT : Identity Parameter [AgentPoolName ]: The name of the Kubernetes cluster agent pool. @@ -68,6 +68,8 @@ function Invoke-AzNetworkCloudScanClusterRuntime { param( [Parameter(ParameterSetName='Scan', Mandatory)] [Parameter(ParameterSetName='ScanExpanded', Mandatory)] + [Parameter(ParameterSetName='ScanViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='ScanViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [System.String] # The name of the cluster. @@ -75,6 +77,8 @@ param( [Parameter(ParameterSetName='Scan', Mandatory)] [Parameter(ParameterSetName='ScanExpanded', Mandatory)] + [Parameter(ParameterSetName='ScanViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='ScanViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [System.String] # The name of the resource group. @@ -83,6 +87,8 @@ param( [Parameter(ParameterSetName='Scan')] [Parameter(ParameterSetName='ScanExpanded')] + [Parameter(ParameterSetName='ScanViaJsonFilePath')] + [Parameter(ParameterSetName='ScanViaJsonString')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] @@ -95,25 +101,35 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter(ParameterSetName='Scan', Mandatory, ValueFromPipeline)] [Parameter(ParameterSetName='ScanViaIdentity', Mandatory, ValueFromPipeline)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterScanRuntimeParameters] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterScanRuntimeParameters] # ClusterScanRuntimeParameters defines the parameters for the cluster scan runtime operation. - # To construct, see NOTES section for CLUSTERSCANRUNTIMEPARAMETER properties and create a hash table. ${ClusterScanRuntimeParameter}, [Parameter(ParameterSetName='ScanExpanded')] [Parameter(ParameterSetName='ScanViaIdentityExpanded')] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterScanRuntimeParametersScanActivity])] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Scan", "Skip")] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterScanRuntimeParametersScanActivity] + [System.String] # The choice of if the scan operation should run the scan. ${ScanActivity}, + [Parameter(ParameterSetName='ScanViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Path of Json file supplied to the Scan operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='ScanViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Json string supplied to the Scan operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -188,6 +204,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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() @@ -211,10 +236,10 @@ begin { ScanExpanded = 'Az.NetworkCloud.private\Invoke-AzNetworkCloudScanClusterRuntime_ScanExpanded'; ScanViaIdentity = 'Az.NetworkCloud.private\Invoke-AzNetworkCloudScanClusterRuntime_ScanViaIdentity'; ScanViaIdentityExpanded = 'Az.NetworkCloud.private\Invoke-AzNetworkCloudScanClusterRuntime_ScanViaIdentityExpanded'; + ScanViaJsonFilePath = 'Az.NetworkCloud.private\Invoke-AzNetworkCloudScanClusterRuntime_ScanViaJsonFilePath'; + ScanViaJsonString = 'Az.NetworkCloud.private\Invoke-AzNetworkCloudScanClusterRuntime_ScanViaJsonString'; } - if (('Scan', 'ScanExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Scan', 'ScanExpanded', 'ScanViaJsonFilePath', 'ScanViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -228,6 +253,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/NetworkCloud/NetworkCloud.Autorest/exports/Invoke-AzNetworkCloudVirtualMachineReimage.ps1 b/generated/NetworkCloud/NetworkCloud.Autorest/exports/Invoke-AzNetworkCloudVirtualMachineReimage.ps1 index f58e10846b8a..0ebe1376d06b 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/exports/Invoke-AzNetworkCloudVirtualMachineReimage.ps1 +++ b/generated/NetworkCloud/NetworkCloud.Autorest/exports/Invoke-AzNetworkCloudVirtualMachineReimage.ps1 @@ -87,7 +87,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -164,6 +163,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 { Reimage = 'Az.NetworkCloud.private\Invoke-AzNetworkCloudVirtualMachineReimage_Reimage'; ReimageViaIdentity = 'Az.NetworkCloud.private\Invoke-AzNetworkCloudVirtualMachineReimage_ReimageViaIdentity'; } - if (('Reimage') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Reimage') -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/NetworkCloud/NetworkCloud.Autorest/exports/New-AzNetworkCloudAgentPool.ps1 b/generated/NetworkCloud/NetworkCloud.Autorest/exports/New-AzNetworkCloudAgentPool.ps1 index 12c81c221f54..d83dec2ea481 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/exports/New-AzNetworkCloudAgentPool.ps1 +++ b/generated/NetworkCloud/NetworkCloud.Autorest/exports/New-AzNetworkCloudAgentPool.ps1 @@ -16,9 +16,9 @@ <# .Synopsis -Create a new Kubernetes cluster agent pool or update the properties of the existing one. +Create a new Kubernetes cluster agent pool or create the properties of the existing one. .Description -Create a new Kubernetes cluster agent pool or update the properties of the existing one. +Create a new Kubernetes cluster agent pool or create the properties of the existing one. .Example $networkAttachment = @{ AttachedNetworkId = "l3NetworkId" @@ -37,8 +37,10 @@ Create a new Kubernetes cluster agent pool or update the properties of the exist New-AzNetworkCloudAgentPool -KubernetesClusterName clusterName -Name agentPoolName -ResourceGroupName resourceGroup -Count count -Location location -Mode agentPoolMode -VMSkuName vmSkuName -SubscriptionId subscriptionId -AdministratorConfigurationAdminUsername adminUsername -AdministratorConfigurationSshPublicKey $sshPublicKey -AgentOptionHugepagesCount hugepagesCount -AgentOptionHugepagesSize hugepagesSize -AttachedNetworkConfigurationL3Network $networkAttachment -AvailabilityZone availabilityZones -ExtendedLocationName clusterExtendedLocation -ExtendedLocationType "CustomLocation " -Tag @{tags = "tag"} -Label $labels -Taint $taints -UpgradeSettingMaxSurge maxSurge +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPool +Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPool .Notes COMPLEX PARAMETER PROPERTIES @@ -48,38 +50,56 @@ ADMINISTRATORCONFIGURATIONSSHPUBLICKEY : The SSH configuration KeyData : The SSH public key data. ATTACHEDNETWORKCONFIGURATIONL2NETWORK : The list of Layer 2 Networks and related configuration for attachment. - NetworkId : The resource ID of the network that is being configured for attachment. - [PluginType ]: The indicator of how this network will be utilized by the Kubernetes cluster. + [NetworkId ]: The resource ID of the network that is being configured for attachment. + [PluginType ]: The indicator of how this network will be utilized by the Kubernetes cluster. ATTACHEDNETWORKCONFIGURATIONL3NETWORK : The list of Layer 3 Networks and related configuration for attachment. NetworkId : The resource ID of the network that is being configured for attachment. - [IpamEnabled ]: The indication of whether this network will or will not perform IP address management and allocate IP addresses when attached. - [PluginType ]: The indicator of how this network will be utilized by the Kubernetes cluster. + [IpamEnabled ]: The indication of whether this network will or will not perform IP address management and allocate IP addresses when attached. + [PluginType ]: The indicator of how this network will be utilized by the Kubernetes cluster. ATTACHEDNETWORKCONFIGURATIONTRUNKEDNETWORK : The list of Trunked Networks and related configuration for attachment. - NetworkId : The resource ID of the network that is being configured for attachment. - [PluginType ]: The indicator of how this network will be utilized by the Kubernetes cluster. + [NetworkId ]: The resource ID of the network that is being configured for attachment. + [PluginType ]: The indicator of how this network will be utilized by the Kubernetes cluster. + +KUBERNETESCLUSTERINPUTOBJECT : Identity Parameter + [AgentPoolName ]: The name of the Kubernetes cluster agent pool. + [BareMetalMachineKeySetName ]: The name of the bare metal machine key set. + [BareMetalMachineName ]: The name of the bare metal machine. + [BmcKeySetName ]: The name of the baseboard management controller key set. + [CloudServicesNetworkName ]: The name of the cloud services network. + [ClusterManagerName ]: The name of the cluster manager. + [ClusterName ]: The name of the cluster. + [ConsoleName ]: The name of the virtual machine console. + [FeatureName ]: The name of the feature. + [Id ]: Resource identity path + [KubernetesClusterName ]: The name of the Kubernetes cluster. + [L2NetworkName ]: The name of the L2 network. + [L3NetworkName ]: The name of the L3 network. + [MetricsConfigurationName ]: The name of the metrics configuration for the cluster. + [RackName ]: The name of the rack. + [RackSkuName ]: The name of the rack SKU. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [StorageApplianceName ]: The name of the storage appliance. + [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. + [TrunkedNetworkName ]: The name of the trunked network. + [VirtualMachineName ]: The name of the virtual machine. + [VolumeName ]: The name of the volume. LABEL : The labels applied to the nodes in this agent pool. - Key : The name of the label or taint. - Value : The value of the label or taint. + [Key ]: The name of the label or taint. + [Value ]: The value of the label or taint. TAINT : The taints applied to the nodes in this agent pool. - Key : The name of the label or taint. - Value : The value of the label or taint. + [Key ]: The name of the label or taint. + [Value ]: The value of the label or taint. .Link https://learn.microsoft.com/powershell/module/az.networkcloud/new-aznetworkcloudagentpool #> function New-AzNetworkCloudAgentPool { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPool])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPool])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( - [Parameter(Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] - [System.String] - # The name of the Kubernetes cluster. - ${KubernetesClusterName}, - [Parameter(Mandatory)] [Alias('AgentPoolName')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] @@ -87,14 +107,26 @@ param( # The name of the Kubernetes cluster agent pool. ${Name}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] + [System.String] + # The name of the Kubernetes cluster. + ${KubernetesClusterName}, + + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] @@ -102,6 +134,12 @@ param( # The value must be an UUID. ${SubscriptionId}, + [Parameter(ParameterSetName='CreateViaIdentityKubernetesClusterExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] + # Identity Parameter + ${KubernetesClusterInputObject}, + [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Header')] [System.String] @@ -117,87 +155,95 @@ param( # Other values will result in error from server as they are not supported. ${IfNoneMatch}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaIdentityKubernetesClusterExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.Int64] # The number of virtual machines that use this configuration. ${Count}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaIdentityKubernetesClusterExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The geo-location where the resource lives ${Location}, - [Parameter(Mandatory)] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.AgentPoolMode])] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaIdentityKubernetesClusterExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("System", "User", "NotApplicable")] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.AgentPoolMode] + [System.String] # The selection of how this agent pool is utilized, either as a system pool or a user pool. # System pools run the features and critical services for the Kubernetes Cluster, while user pools are dedicated to user workloads. # Every Kubernetes cluster must contain at least one system node pool with at least one node. ${Mode}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaIdentityKubernetesClusterExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The name of the VM SKU that determines the size of resources allocated for node VMs. ${VMSkuName}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityKubernetesClusterExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The user name for the administrator that will be applied to the operating systems that run Kubernetes nodes. # If not supplied, a user name will be chosen by the service. ${AdministratorConfigurationAdminUsername}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityKubernetesClusterExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey[]] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISshPublicKey[]] # The SSH configuration for the operating systems that run the nodes in the Kubernetes cluster. # In some cases, specification of public keys may be required to produce a working environment. - # To construct, see NOTES section for ADMINISTRATORCONFIGURATIONSSHPUBLICKEY properties and create a hash table. ${AdministratorConfigurationSshPublicKey}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityKubernetesClusterExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.Int64] # The number of hugepages to allocate. ${AgentOptionHugepagesCount}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HugepagesSize])] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityKubernetesClusterExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("2M", "1G")] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HugepagesSize] + [System.String] # The size of the hugepages to allocate. ${AgentOptionHugepagesSize}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityKubernetesClusterExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkAttachmentConfiguration[]] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkAttachmentConfiguration[]] # The list of Layer 2 Networks and related configuration for attachment. - # To construct, see NOTES section for ATTACHEDNETWORKCONFIGURATIONL2NETWORK properties and create a hash table. ${AttachedNetworkConfigurationL2Network}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityKubernetesClusterExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkAttachmentConfiguration[]] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkAttachmentConfiguration[]] # The list of Layer 3 Networks and related configuration for attachment. - # To construct, see NOTES section for ATTACHEDNETWORKCONFIGURATIONL3NETWORK properties and create a hash table. ${AttachedNetworkConfigurationL3Network}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityKubernetesClusterExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkAttachmentConfiguration[]] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkAttachmentConfiguration[]] # The list of Trunked Networks and related configuration for attachment. - # To construct, see NOTES section for ATTACHEDNETWORKCONFIGURATIONTRUNKEDNETWORK properties and create a hash table. ${AttachedNetworkConfigurationTrunkedNetwork}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityKubernetesClusterExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String[]] @@ -205,49 +251,54 @@ param( # If not specified, all availability zones will be used. ${AvailabilityZone}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityKubernetesClusterExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The resource ID of the extended location on which the resource will be created. ${ExtendedLocationName}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityKubernetesClusterExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The extended location type, for example, CustomLocation. ${ExtendedLocationType}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityKubernetesClusterExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesLabel[]] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesLabel[]] # The labels applied to the nodes in this agent pool. - # To construct, see NOTES section for LABEL properties and create a hash table. ${Label}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityKubernetesClusterExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceTags]))] [System.Collections.Hashtable] # Resource tags. ${Tag}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityKubernetesClusterExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesLabel[]] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesLabel[]] # The taints applied to the nodes in this agent pool. - # To construct, see NOTES section for TAINT properties and create a hash table. ${Taint}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityKubernetesClusterExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.Int64] # The maximum time in seconds that is allowed for a node drain to complete before proceeding with the upgrade of the agent pool. # If not specified during creation, a value of 1800 seconds is used. ${UpgradeSettingDrainTimeout}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityKubernetesClusterExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The maximum number or percentage of nodes that are surged during upgrade. @@ -260,7 +311,8 @@ param( # One of MaxSurge and MaxUnavailable must be greater than 0. ${UpgradeSettingMaxSurge}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityKubernetesClusterExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The maximum number or percentage of nodes that can be unavailable during upgrade. @@ -273,6 +325,18 @@ param( # One of MaxSurge and MaxUnavailable must be greater than 0. ${UpgradeSettingMaxUnavailable}, + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Path of Json file supplied to the Create operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Json string supplied to the Create operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -341,6 +405,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,10 +434,11 @@ begin { $mapping = @{ CreateExpanded = 'Az.NetworkCloud.private\New-AzNetworkCloudAgentPool_CreateExpanded'; + CreateViaIdentityKubernetesClusterExpanded = 'Az.NetworkCloud.private\New-AzNetworkCloudAgentPool_CreateViaIdentityKubernetesClusterExpanded'; + CreateViaJsonFilePath = 'Az.NetworkCloud.private\New-AzNetworkCloudAgentPool_CreateViaJsonFilePath'; + CreateViaJsonString = 'Az.NetworkCloud.private\New-AzNetworkCloudAgentPool_CreateViaJsonString'; } - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 { @@ -378,6 +452,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/NetworkCloud/NetworkCloud.Autorest/exports/New-AzNetworkCloudBareMetalMachineConfigurationDataObject.ps1 b/generated/NetworkCloud/NetworkCloud.Autorest/exports/New-AzNetworkCloudBareMetalMachineConfigurationDataObject.ps1 index f47ab9bd651a..a4173c58e2bf 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/exports/New-AzNetworkCloudBareMetalMachineConfigurationDataObject.ps1 +++ b/generated/NetworkCloud/NetworkCloud.Autorest/exports/New-AzNetworkCloudBareMetalMachineConfigurationDataObject.ps1 @@ -25,12 +25,12 @@ $password = ConvertTo-SecureString "********" -AsPlainText -Force New-AzNetworkCloudBareMetalMachineConfigurationDataObject -BmcCredentialsPassword $password -BmcCredentialsUsername username -BmcMacAddress "00:BB:CC:DD:EE:FF" -BootMacAddress "00:BB:CC:DD:EE:FF" -RackSlot 1 -SerialNumber serialNumber -MachineDetail machineDetail -MachineName machineName .Outputs -Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BareMetalMachineConfigurationData +Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BareMetalMachineConfigurationData .Link -https://learn.microsoft.com/powershell/module/Az.NetworkCloud/new-AzNetworkCloudBareMetalMachineConfigurationDataObject +https://learn.microsoft.com/powershell/module/Az.NetworkCloud/new-aznetworkcloudbaremetalmachineconfigurationdataobject #> function New-AzNetworkCloudBareMetalMachineConfigurationDataObject { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BareMetalMachineConfigurationData])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BareMetalMachineConfigurationData])] [CmdletBinding(PositionalBinding=$false)] param( [Parameter(Mandatory)] @@ -93,6 +93,9 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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() @@ -121,6 +124,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/NetworkCloud/NetworkCloud.Autorest/exports/New-AzNetworkCloudBareMetalMachineKeySet.ps1 b/generated/NetworkCloud/NetworkCloud.Autorest/exports/New-AzNetworkCloudBareMetalMachineKeySet.ps1 index e106713062f8..d3ef8097758d 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/exports/New-AzNetworkCloudBareMetalMachineKeySet.ps1 +++ b/generated/NetworkCloud/NetworkCloud.Autorest/exports/New-AzNetworkCloudBareMetalMachineKeySet.ps1 @@ -16,9 +16,9 @@ <# .Synopsis -Create a new bare metal machine key set or update the existing one for the provided cluster. +Create a new bare metal machine key set or create the existing one for the provided cluster. .Description -Create a new bare metal machine key set or update the existing one for the provided cluster. +Create a new bare metal machine key set or create the existing one for the provided cluster. .Example $tagHash = @{ tag = "tag" @@ -33,13 +33,39 @@ $userList = @{ New-AzNetworkCloudBareMetalMachineKeySet -ResourceGroupName resourceGroupName -Name baremetalmachinekeysetname -ClusterName clusterName -AzureGroupId azuregroupid -Expiration "2023-12-31T23:59:59.008Z" -OSGroupName osgroupName -ExtendedLocationName /subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/customLocationName -PrivilegeLevel Superuser -JumpHostsAllowed "192.0.0.1" -ExtendedLocationType CustomLocation -Location EastUs -Tag $tagHash -UserList $userList -SubscriptionId subscriptionId +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySet +Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySet .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. +CLUSTERINPUTOBJECT : Identity Parameter + [AgentPoolName ]: The name of the Kubernetes cluster agent pool. + [BareMetalMachineKeySetName ]: The name of the bare metal machine key set. + [BareMetalMachineName ]: The name of the bare metal machine. + [BmcKeySetName ]: The name of the baseboard management controller key set. + [CloudServicesNetworkName ]: The name of the cloud services network. + [ClusterManagerName ]: The name of the cluster manager. + [ClusterName ]: The name of the cluster. + [ConsoleName ]: The name of the virtual machine console. + [FeatureName ]: The name of the feature. + [Id ]: Resource identity path + [KubernetesClusterName ]: The name of the Kubernetes cluster. + [L2NetworkName ]: The name of the L2 network. + [L3NetworkName ]: The name of the L3 network. + [MetricsConfigurationName ]: The name of the metrics configuration for the cluster. + [RackName ]: The name of the rack. + [RackSkuName ]: The name of the rack SKU. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [StorageApplianceName ]: The name of the storage appliance. + [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. + [TrunkedNetworkName ]: The name of the trunked network. + [VirtualMachineName ]: The name of the virtual machine. + [VolumeName ]: The name of the volume. + USERLIST : The unique list of permitted users. AzureUserName : The user name that will be used for access. SshPublicKeyData : The SSH public key data. @@ -49,15 +75,9 @@ USERLIST : The unique list of permitted users. https://learn.microsoft.com/powershell/module/az.networkcloud/new-aznetworkcloudbaremetalmachinekeyset #> function New-AzNetworkCloudBareMetalMachineKeySet { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySet])] -[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySet])] +[CmdletBinding(DefaultParameterSetName='CreateViaIdentityClusterExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( - [Parameter(Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] - [System.String] - # The name of the cluster. - ${ClusterName}, - [Parameter(Mandatory)] [Alias('BareMetalMachineKeySetName')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] @@ -65,14 +85,26 @@ param( # The name of the bare metal machine key set. ${Name}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] + [System.String] + # The name of the cluster. + ${ClusterName}, + + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] @@ -80,6 +112,12 @@ param( # The value must be an UUID. ${SubscriptionId}, + [Parameter(ParameterSetName='CreateViaIdentityClusterExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] + # Identity Parameter + ${ClusterInputObject}, + [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Header')] [System.String] @@ -95,72 +133,93 @@ param( # Other values will result in error from server as they are not supported. ${IfNoneMatch}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaIdentityClusterExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The object ID of Azure Active Directory group that all users in the list must be in for access to be granted. # Users that are not in the group will not have access. ${AzureGroupId}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaIdentityClusterExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.DateTime] # The date and time after which the users in this key set will be removed from the bare metal machines. ${Expiration}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaIdentityClusterExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The resource ID of the extended location on which the resource will be created. ${ExtendedLocationName}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaIdentityClusterExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The extended location type, for example, CustomLocation. ${ExtendedLocationType}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaIdentityClusterExpanded', Mandatory)] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String[]] # The list of IP addresses of jump hosts with management network access from which a login will be allowed for the users. ${JumpHostsAllowed}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaIdentityClusterExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The geo-location where the resource lives ${Location}, - [Parameter(Mandatory)] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineKeySetPrivilegeLevel])] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaIdentityClusterExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Standard", "Superuser")] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineKeySetPrivilegeLevel] + [System.String] # The access level allowed for the users in this key set. ${PrivilegeLevel}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaIdentityClusterExpanded', Mandatory)] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKeySetUser[]] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKeySetUser[]] # The unique list of permitted users. - # To construct, see NOTES section for USERLIST properties and create a hash table. ${UserList}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityClusterExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The name of the group that users will be assigned to on the operating system of the machines. ${OSGroupName}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityClusterExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceTags]))] [System.Collections.Hashtable] # Resource tags. ${Tag}, + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Path of Json file supplied to the Create operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Json string supplied to the Create operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -229,6 +288,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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() @@ -249,10 +317,11 @@ begin { $mapping = @{ CreateExpanded = 'Az.NetworkCloud.private\New-AzNetworkCloudBareMetalMachineKeySet_CreateExpanded'; + CreateViaIdentityClusterExpanded = 'Az.NetworkCloud.private\New-AzNetworkCloudBareMetalMachineKeySet_CreateViaIdentityClusterExpanded'; + CreateViaJsonFilePath = 'Az.NetworkCloud.private\New-AzNetworkCloudBareMetalMachineKeySet_CreateViaJsonFilePath'; + CreateViaJsonString = 'Az.NetworkCloud.private\New-AzNetworkCloudBareMetalMachineKeySet_CreateViaJsonString'; } - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 { @@ -266,6 +335,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/NetworkCloud/NetworkCloud.Autorest/exports/New-AzNetworkCloudBgpAdvertisementObject.ps1 b/generated/NetworkCloud/NetworkCloud.Autorest/exports/New-AzNetworkCloudBgpAdvertisementObject.ps1 index b1414007037f..3b4cd81e4866 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/exports/New-AzNetworkCloudBgpAdvertisementObject.ps1 +++ b/generated/NetworkCloud/NetworkCloud.Autorest/exports/New-AzNetworkCloudBgpAdvertisementObject.ps1 @@ -23,12 +23,12 @@ Create an in-memory object for BgpAdvertisement. New-AzNetworkCloudBgpAdvertisementObject -IPAddressPool @("pool1","pool2") -AdvertiseToFabric "True" -Community @("communityString") -Peer @("peer1") .Outputs -Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BgpAdvertisement +Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BgpAdvertisement .Link -https://learn.microsoft.com/powershell/module/Az.NetworkCloud/new-AzNetworkCloudBgpAdvertisementObject +https://learn.microsoft.com/powershell/module/Az.NetworkCloud/new-aznetworkcloudbgpadvertisementobject #> function New-AzNetworkCloudBgpAdvertisementObject { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BgpAdvertisement])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BgpAdvertisement])] [CmdletBinding(PositionalBinding=$false)] param( [Parameter(Mandatory)] @@ -38,9 +38,9 @@ param( ${IPAddressPool}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.AdvertiseToFabric])] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("True", "False")] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.AdvertiseToFabric] + [System.String] # The indicator of if this advertisement is also made to the network fabric associated with the Network Cloud Cluster. # This field is ignored if fabricPeeringEnabled is set to False. ${AdvertiseToFabric}, @@ -66,6 +66,9 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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() @@ -94,6 +97,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/NetworkCloud/NetworkCloud.Autorest/exports/New-AzNetworkCloudBgpServiceLoadBalancerConfigurationObject.ps1 b/generated/NetworkCloud/NetworkCloud.Autorest/exports/New-AzNetworkCloudBgpServiceLoadBalancerConfigurationObject.ps1 index 0a898516f456..fa0bed24854a 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/exports/New-AzNetworkCloudBgpServiceLoadBalancerConfigurationObject.ps1 +++ b/generated/NetworkCloud/NetworkCloud.Autorest/exports/New-AzNetworkCloudBgpServiceLoadBalancerConfigurationObject.ps1 @@ -32,24 +32,24 @@ $object=New-AzNetworkCloudBgpServiceLoadBalancerConfigurationObject -BgpAdvertis Write-Host ($object | Format-List | Out-String) .Outputs -Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BgpServiceLoadBalancerConfiguration +Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BgpServiceLoadBalancerConfiguration .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. BGPADVERTISEMENT : The association of IP address pools to the communities and peers, allowing for announcement of IPs. - IPAddressPool : The names of the IP address pools associated with this announcement. - [AdvertiseToFabric ]: The indicator of if this advertisement is also made to the network fabric associated with the Network Cloud Cluster. This field is ignored if fabricPeeringEnabled is set to False. - [Community ]: The names of the BGP communities to be associated with the announcement, utilizing a BGP community string in 1234:1234 format. - [Peer ]: The names of the BGP peers to limit this advertisement to. If no values are specified, all BGP peers will receive this advertisement. + IPAddressPool >: The names of the IP address pools associated with this announcement. + [AdvertiseToFabric ]: The indicator of if this advertisement is also made to the network fabric associated with the Network Cloud Cluster. This field is ignored if fabricPeeringEnabled is set to False. + [Community >]: The names of the BGP communities to be associated with the announcement, utilizing a BGP community string in 1234:1234 format. + [Peer >]: The names of the BGP peers to limit this advertisement to. If no values are specified, all BGP peers will receive this advertisement. BGPPEER : The list of additional BgpPeer entities that the Kubernetes cluster will peer with. All peering must be explicitly defined. Name : The name used to identify this BGP peer for association with a BGP advertisement. PeerAddress : The IPv4 or IPv6 address used to connect this BGP session. PeerAsn : The autonomous system number expected from the remote end of the BGP session. - [BfdEnabled ]: The indicator of BFD enablement for this BgpPeer. - [BgpMultiHop ]: The indicator to enable multi-hop peering support. + [BfdEnabled ]: The indicator of BFD enablement for this BgpPeer. + [BgpMultiHop ]: The indicator to enable multi-hop peering support. [HoldTime ]: Field Deprecated. The field was previously optional, now it will have no defined behavior and will be ignored. The requested BGP hold time value. This field uses ISO 8601 duration format, for example P1H. [KeepAliveTime ]: Field Deprecated. The field was previously optional, now it will have no defined behavior and will be ignored. The requested BGP keepalive time value. This field uses ISO 8601 duration format, for example P1H. [MyAsn ]: The autonomous system number used for the local end of the BGP session. @@ -57,44 +57,41 @@ BGPPEER : The list of additional BgpPeer entities [PeerPort ]: The port used to connect this BGP session. IPADDRESSPOOL : The list of pools of IP addresses that can be allocated to load balancer services. - Address : The list of IP address ranges. Each range can be a either a subnet in CIDR format or an explicit start-end range of IP addresses. For a BGP service load balancer configuration, only CIDR format is supported and excludes /32 (IPv4) and /128 (IPv6) prefixes. Name : The name used to identify this IP address pool for association with a BGP advertisement. - [AutoAssign ]: The indicator to determine if automatic allocation from the pool should occur. - [OnlyUseHostIP ]: The indicator to prevent the use of IP addresses ending with .0 and .255 for this pool. Enabling this option will only use IP addresses between .1 and .254 inclusive. + [Address >]: The list of IP address ranges. Each range can be a either a subnet in CIDR format or an explicit start-end range of IP addresses. For a BGP service load balancer configuration, only CIDR format is supported and excludes /32 (IPv4) and /128 (IPv6) prefixes. + [AutoAssign ]: The indicator to determine if automatic allocation from the pool should occur. + [OnlyUseHostIP ]: The indicator to prevent the use of IP addresses ending with .0 and .255 for this pool. Enabling this option will only use IP addresses between .1 and .254 inclusive. .Link -https://learn.microsoft.com/powershell/module/Az.NetworkCloud/new-AzNetworkCloudBgpServiceLoadBalancerConfigurationObject +https://learn.microsoft.com/powershell/module/Az.NetworkCloud/new-aznetworkcloudbgpserviceloadbalancerconfigurationobject #> function New-AzNetworkCloudBgpServiceLoadBalancerConfigurationObject { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BgpServiceLoadBalancerConfiguration])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BgpServiceLoadBalancerConfiguration])] [CmdletBinding(PositionalBinding=$false)] param( [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBgpAdvertisement[]] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBgpAdvertisement[]] # The association of IP address pools to the communities and peers, allowing for announcement of IPs. - # To construct, see NOTES section for BGPADVERTISEMENT properties and create a hash table. ${BgpAdvertisement}, [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IServiceLoadBalancerBgpPeer[]] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IServiceLoadBalancerBgpPeer[]] # The list of additional BgpPeer entities that the Kubernetes cluster will peer with. # All peering must be explicitly defined. - # To construct, see NOTES section for BGPPEER properties and create a hash table. ${BgpPeer}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.FabricPeeringEnabled])] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("True", "False")] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.FabricPeeringEnabled] + [System.String] # The indicator to specify if the load balancer peers with the network fabric. ${FabricPeeringEnabled}, [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIPAddressPool[]] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IIPAddressPool[]] # The list of pools of IP addresses that can be allocated to load balancer services. - # To construct, see NOTES section for IPADDRESSPOOL properties and create a hash table. ${IPAddressPool} ) @@ -105,6 +102,9 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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() @@ -133,6 +133,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/NetworkCloud/NetworkCloud.Autorest/exports/New-AzNetworkCloudBmcKeySet.ps1 b/generated/NetworkCloud/NetworkCloud.Autorest/exports/New-AzNetworkCloudBmcKeySet.ps1 index 9d3d69b5f9fa..794e940a22b3 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/exports/New-AzNetworkCloudBmcKeySet.ps1 +++ b/generated/NetworkCloud/NetworkCloud.Autorest/exports/New-AzNetworkCloudBmcKeySet.ps1 @@ -16,9 +16,9 @@ <# .Synopsis -Create a new baseboard management controller key set or update the existing one for the provided cluster. +Create a new baseboard management controller key set or create the existing one for the provided cluster. .Description -Create a new baseboard management controller key set or update the existing one for the provided cluster. +Create a new baseboard management controller key set or create the existing one for the provided cluster. .Example $tagHash = @{ tag = "tag" @@ -32,13 +32,39 @@ $userList = @{ New-AzNetworkCloudBmcKeySet -ResourceGroupName resourceGroupName -Name baseboardmgtcontrollerkeysetname -ClusterName clusterName -AzureGroupId azuregroupid -Expiration "2023-12-31T23:59:59.008Z" -ExtendedLocationName /subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/customLocationName -PrivilegeLevel ReadOnly -ExtendedLocationType CustomLocation -Location EastUs -Tag $tagHash -UserList $userList +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySet +Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySet .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. +CLUSTERINPUTOBJECT : Identity Parameter + [AgentPoolName ]: The name of the Kubernetes cluster agent pool. + [BareMetalMachineKeySetName ]: The name of the bare metal machine key set. + [BareMetalMachineName ]: The name of the bare metal machine. + [BmcKeySetName ]: The name of the baseboard management controller key set. + [CloudServicesNetworkName ]: The name of the cloud services network. + [ClusterManagerName ]: The name of the cluster manager. + [ClusterName ]: The name of the cluster. + [ConsoleName ]: The name of the virtual machine console. + [FeatureName ]: The name of the feature. + [Id ]: Resource identity path + [KubernetesClusterName ]: The name of the Kubernetes cluster. + [L2NetworkName ]: The name of the L2 network. + [L3NetworkName ]: The name of the L3 network. + [MetricsConfigurationName ]: The name of the metrics configuration for the cluster. + [RackName ]: The name of the rack. + [RackSkuName ]: The name of the rack SKU. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [StorageApplianceName ]: The name of the storage appliance. + [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. + [TrunkedNetworkName ]: The name of the trunked network. + [VirtualMachineName ]: The name of the virtual machine. + [VolumeName ]: The name of the volume. + USERLIST : The unique list of permitted users. AzureUserName : The user name that will be used for access. SshPublicKeyData : The SSH public key data. @@ -48,15 +74,9 @@ USERLIST : The unique list of permitted users. https://learn.microsoft.com/powershell/module/az.networkcloud/new-aznetworkcloudbmckeyset #> function New-AzNetworkCloudBmcKeySet { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySet])] -[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySet])] +[CmdletBinding(DefaultParameterSetName='CreateViaIdentityClusterExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( - [Parameter(Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] - [System.String] - # The name of the cluster. - ${ClusterName}, - [Parameter(Mandatory)] [Alias('BmcKeySetName')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] @@ -64,14 +84,26 @@ param( # The name of the baseboard management controller key set. ${Name}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] + [System.String] + # The name of the cluster. + ${ClusterName}, + + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] @@ -79,6 +111,12 @@ param( # The value must be an UUID. ${SubscriptionId}, + [Parameter(ParameterSetName='CreateViaIdentityClusterExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] + # Identity Parameter + ${ClusterInputObject}, + [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Header')] [System.String] @@ -94,59 +132,78 @@ param( # Other values will result in error from server as they are not supported. ${IfNoneMatch}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaIdentityClusterExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The object ID of Azure Active Directory group that all users in the list must be in for access to be granted. # Users that are not in the group will not have access. ${AzureGroupId}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaIdentityClusterExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.DateTime] # The date and time after which the users in this key set will be removed from the baseboard management controllers. ${Expiration}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaIdentityClusterExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The resource ID of the extended location on which the resource will be created. ${ExtendedLocationName}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaIdentityClusterExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The extended location type, for example, CustomLocation. ${ExtendedLocationType}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaIdentityClusterExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The geo-location where the resource lives ${Location}, - [Parameter(Mandatory)] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BmcKeySetPrivilegeLevel])] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaIdentityClusterExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("ReadOnly", "Administrator")] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BmcKeySetPrivilegeLevel] + [System.String] # The access level allowed for the users in this key set. ${PrivilegeLevel}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaIdentityClusterExpanded', Mandatory)] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKeySetUser[]] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKeySetUser[]] # The unique list of permitted users. - # To construct, see NOTES section for USERLIST properties and create a hash table. ${UserList}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityClusterExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceTags]))] [System.Collections.Hashtable] # Resource tags. ${Tag}, + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Path of Json file supplied to the Create operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Json string supplied to the Create operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -215,6 +272,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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() @@ -235,10 +301,11 @@ begin { $mapping = @{ CreateExpanded = 'Az.NetworkCloud.private\New-AzNetworkCloudBmcKeySet_CreateExpanded'; + CreateViaIdentityClusterExpanded = 'Az.NetworkCloud.private\New-AzNetworkCloudBmcKeySet_CreateViaIdentityClusterExpanded'; + CreateViaJsonFilePath = 'Az.NetworkCloud.private\New-AzNetworkCloudBmcKeySet_CreateViaJsonFilePath'; + CreateViaJsonString = 'Az.NetworkCloud.private\New-AzNetworkCloudBmcKeySet_CreateViaJsonString'; } - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 { @@ -252,6 +319,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/NetworkCloud/NetworkCloud.Autorest/exports/New-AzNetworkCloudCluster.ps1 b/generated/NetworkCloud/NetworkCloud.Autorest/exports/New-AzNetworkCloudCluster.ps1 index 74e4f762098e..f4481d0694fa 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/exports/New-AzNetworkCloudCluster.ps1 +++ b/generated/NetworkCloud/NetworkCloud.Autorest/exports/New-AzNetworkCloudCluster.ps1 @@ -16,13 +16,13 @@ <# .Synopsis -Create a new cluster or update the properties of the cluster if it exists. +Create a new cluster or create the properties of the cluster if it exists. .Description -Create a new cluster or update the properties of the cluster if it exists. +Create a new cluster or create the properties of the cluster if it exists. .Example $storageapplianceconfigurationdata = @() $baremetalmachineconfigurationdata = @() -$computerackdefinition = @(@{IRackDefinition = "The list of rack definitions for the compute racks in a multi-rackcluster, or an empty list in a single-rack cluster."}) +$computerackdefinition = @(@{IRackDefinition = "The list of rack definitions for the compute racks in a multi-rack cluster, or an empty list in a single-rack cluster."}) $tagHash = @{ tag = "tag" } @@ -32,20 +32,18 @@ New-AzNetworkCloudCluster -ResourceGroupName resourceGroup -Name clusterName -Ag .Example $storageapplianceconfigurationdata = @() $baremetalmachineconfigurationdata = @() -$computerackdefinition = @(@{IRackDefinition = "The list of rack definitions for the compute racks in a multi-rackcluster, or an empty list in a single-rack cluster."}) +$computerackdefinition = @(@{IRackDefinition = "The list of rack definitions for the compute racks in a multi-rack cluster, or an empty list in a single-rack cluster."}) $tagHash = @{ tag = "tag" } $securePassword = ConvertTo-SecureString "password" -asplaintext -force -$identityUserAssignedIdentity = @{} $userAssignedIdentityResourceId = "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myManagedIdentity" -$identityUserAssignedIdentity.Add($userAssignedIdentityResourceId, @{}) -New-AzNetworkCloudCluster -ResourceGroupName resourceGroup -Name clusterName -AggregatorOrSingleRackDefinitionNetworkRackId rackId -AggregatorOrSingleRackDefinitionRackSerialNumber sr1234 -AggregatorOrSingleRackDefinitionRackSkuId rackSku -ClusterType clustertype -IdentityType identityType -IdentityUserAssignedIdentity $identityUserAssignedIdentity -ClusterVersion clusterversion -ExtendedLocationName CmExtendedLocation -ExtendedLocationType CustomLocation -Location location -NetworkFabricId networkFabricId -SubscriptionId subscriptionId -AggregatorOrSingleRackDefinitionAvailabilityZone availabilityZone -AggregatorOrSingleRackDefinitionBareMetalMachineConfiguration $baremetalmachineconfigurationdata -AggregatorOrSingleRackDefinitionRackLocation rackLocation -AggregatorOrSingleRackDefinitionStorageApplianceConfiguration $storageapplianceconfigurationdata -AnalyticOutputSettingAnalyticsWorkspaceId analyticsWorkspaceId -AnalyticsOutputSettingsAssociatedIdentityType identityType -AnalyticsOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId userAssignedIdentityResourceId -AnalyticsWorkspaceId analyticsWorkspaceId -CommandOutputSettingContainerUrl containerUrl -AssociatedIdentityType commandOutputSettingsIdentityType -AssociatedIdentityUserAssignedIdentityResourceId commandOutputSettingsUserAssignedIdentityResourceId -ClusterServicePrincipalApplicationId clusterServicePrincipalAppId -ClusterServicePrincipalId ClusterServicePrincipalId -ClusterServicePrincipalPassword $securePassword -ClusterServicePrincipalTenantId tenantId -ComputeRackDefinition $computerackdefinition -SecretArchiveKeyVaultId keyVaultId -SecretArchiveSettingVaultUri keyVaultUri -SecretArchiveSettingsAssociatedIdentityType identityType -SecretArchiveSettingsAssociatedIdentityUserAssignedIdentityResourceId userAssignedIdentityResourceId -SecretArchiveUseKeyVault useKeyVault -UpdateStrategyThresholdType updateStrategyThresholdType -UpdateStrategyThresholdValue updateStrategyThresholdValue -UpdateStrategyType updateStrategyType -UpdateStrategyWaitTimeMinute updateStrategyWaitTimeMinutes -VulnerabilityScanningSettingContainerScan vulnerabilityScanningSettingContainerScan -ComputeDeploymentThresholdGrouping computeDeploymentThresholdGrouping -ComputeDeploymentThresholdType computeDeploymentThresholdType -ComputeDeploymentThresholdValue computeDeploymentThresholdValue -Tag $tagHash +New-AzNetworkCloudCluster -ResourceGroupName resourceGroup -Name clusterName -AggregatorOrSingleRackDefinitionNetworkRackId rackId -AggregatorOrSingleRackDefinitionRackSerialNumber sr1234 -AggregatorOrSingleRackDefinitionRackSkuId rackSku -ClusterType clustertype -UserAssignedIdentity $userAssignedIdentityResourceId -ClusterVersion clusterversion -ExtendedLocationName CmExtendedLocation -ExtendedLocationType CustomLocation -Location location -NetworkFabricId networkFabricId -SubscriptionId subscriptionId -AggregatorOrSingleRackDefinitionAvailabilityZone availabilityZone -AggregatorOrSingleRackDefinitionBareMetalMachineConfiguration $baremetalmachineconfigurationdata -AggregatorOrSingleRackDefinitionRackLocation rackLocation -AggregatorOrSingleRackDefinitionStorageApplianceConfiguration $storageapplianceconfigurationdata -AnalyticOutputSettingAnalyticsWorkspaceId analyticsWorkspaceId -AnalyticsOutputSettingsAssociatedIdentityType identityType -AnalyticsOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId userAssignedIdentityResourceId -AnalyticsWorkspaceId analyticsWorkspaceId -CommandOutputSettingContainerUrl containerUrl -AssociatedIdentityType commandOutputSettingsIdentityType -AssociatedIdentityUserAssignedIdentityResourceId commandOutputSettingsUserAssignedIdentityResourceId -ClusterServicePrincipalApplicationId clusterServicePrincipalAppId -ClusterServicePrincipalId ClusterServicePrincipalId -ClusterServicePrincipalPassword $securePassword -ClusterServicePrincipalTenantId tenantId -ComputeRackDefinition $computerackdefinition -SecretArchiveKeyVaultId keyVaultId -SecretArchiveSettingVaultUri keyVaultUri -SecretArchiveSettingsAssociatedIdentityType identityType -SecretArchiveSettingsAssociatedIdentityUserAssignedIdentityResourceId userAssignedIdentityResourceId -SecretArchiveUseKeyVault useKeyVault -UpdateStrategyThresholdType updateStrategyThresholdType -UpdateStrategyThresholdValue updateStrategyThresholdValue -UpdateStrategyType updateStrategyType -UpdateStrategyWaitTimeMinute updateStrategyWaitTimeMinutes -VulnerabilityScanningSettingContainerScan vulnerabilityScanningSettingContainerScan -ComputeDeploymentThresholdGrouping computeDeploymentThresholdGrouping -ComputeDeploymentThresholdType computeDeploymentThresholdType -ComputeDeploymentThresholdValue computeDeploymentThresholdValue -Tag $tagHash .Outputs -Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICluster +Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICluster .Notes COMPLEX PARAMETER PROPERTIES @@ -68,12 +66,12 @@ AGGREGATORORSINGLERACKDEFINITIONSTORAGEAPPLIANCECONFIGURATION : The serial number of the appliance. [StorageApplianceName ]: The user-provided name for the storage appliance that will be created from this specification. -COMPUTERACKDEFINITION : The list of rack definitions for the compute racks in a multi-rackcluster, or an empty list in a single-rack cluster. +COMPUTERACKDEFINITION : The list of rack definitions for the compute racks in a multi-rack cluster, or an empty list in a single-rack cluster. NetworkRackId : The resource ID of the network rack that matches this rack definition. RackSerialNumber : The unique identifier for the rack within Network Cloud cluster. An alternate unique alphanumeric value other than a serial number may be provided if desired. RackSkuId : The resource ID of the sku for the rack being added. [AvailabilityZone ]: The zone name used for this rack when created. Availability zones are used for workload placement. - [BareMetalMachineConfigurationData ]: The unordered list of bare metal machine configuration. + [BareMetalMachineConfigurationData >]: The unordered list of bare metal machine configuration. BmcCredentialsPassword : The password of the administrator of the device used during initialization. BmcCredentialsUsername : The username of the administrator of the device used during initialization. BmcMacAddress : The MAC address of the BMC for this machine. @@ -83,7 +81,7 @@ COMPUTERACKDEFINITION : The list of rack definitions for the [MachineDetail ]: The free-form additional information about the machine, e.g. an asset tag. [MachineName ]: The user-provided name for the bare metal machine created from this specification. If not provided, the machine name will be generated programmatically. [RackLocation ]: The free-form description of the rack's location. - [StorageApplianceConfigurationData ]: The list of storage appliance configuration data for this rack. + [StorageApplianceConfigurationData >]: The list of storage appliance configuration data for this rack. AdminCredentialsPassword : The password of the administrator of the device used during initialization. AdminCredentialsUsername : The username of the administrator of the device used during initialization. RackSlot : The slot that storage appliance is in the rack based on the BOM configuration. @@ -93,7 +91,7 @@ COMPUTERACKDEFINITION : The list of rack definitions for the https://learn.microsoft.com/powershell/module/az.networkcloud/new-aznetworkcloudcluster #> function New-AzNetworkCloudCluster { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICluster])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICluster])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] @@ -133,312 +131,319 @@ param( # Other values will result in error from server as they are not supported. ${IfNoneMatch}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The resource ID of the network rack that matches this rack definition. ${AggregatorOrSingleRackDefinitionNetworkRackId}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The unique identifier for the rack within Network Cloud cluster. # An alternate unique alphanumeric value other than a serial number may be provided if desired. ${AggregatorOrSingleRackDefinitionRackSerialNumber}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The resource ID of the sku for the rack being added. ${AggregatorOrSingleRackDefinitionRackSkuId}, - [Parameter(Mandatory)] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterType])] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("SingleRack", "MultiRack")] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterType] + [System.String] # The type of rack configuration for the cluster. ${ClusterType}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The current runtime version of the cluster. ${ClusterVersion}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The resource ID of the extended location on which the resource will be created. ${ExtendedLocationName}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The extended location type, for example, CustomLocation. ${ExtendedLocationType}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The geo-location where the resource lives ${Location}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The resource ID of the Network Fabric associated with the cluster. ${NetworkFabricId}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The zone name used for this rack when created. # Availability zones are used for workload placement. ${AggregatorOrSingleRackDefinitionAvailabilityZone}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineConfigurationData[]] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineConfigurationData[]] # The unordered list of bare metal machine configuration. - # To construct, see NOTES section for AGGREGATORORSINGLERACKDEFINITIONBAREMETALMACHINECONFIGURATION properties and create a hash table. ${AggregatorOrSingleRackDefinitionBareMetalMachineConfiguration}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The free-form description of the rack's location. ${AggregatorOrSingleRackDefinitionRackLocation}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceConfigurationData[]] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceConfigurationData[]] # The list of storage appliance configuration data for this rack. - # To construct, see NOTES section for AGGREGATORORSINGLERACKDEFINITIONSTORAGEAPPLIANCECONFIGURATION properties and create a hash table. ${AggregatorOrSingleRackDefinitionStorageApplianceConfiguration}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The resource ID of the analytics workspace that is to be used by the specified identity. ${AnalyticOutputSettingAnalyticsWorkspaceId}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType])] + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("SystemAssignedIdentity", "UserAssignedIdentity")] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType] + [System.String] # The type of managed identity that is being selected. ${AnalyticsOutputSettingsAssociatedIdentityType}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The user assigned managed identity resource ID to use. # Mutually exclusive with a system assigned identity type. ${AnalyticsOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # Field Deprecated. # The resource ID of the Log Analytics Workspace that will be used for storing relevant logs. ${AnalyticsWorkspaceId}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType])] + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("SystemAssignedIdentity", "UserAssignedIdentity")] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType] + [System.String] # The type of associated identity for CommandOutputSettings. ${AssociatedIdentityType}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The resource ID of the user assigned identity for CommandOutputSettings. ${AssociatedIdentityUserAssignedIdentityResourceId}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The customer-provided location information to identify where the cluster resides. ${ClusterLocation}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The application ID, also known as client ID, of the service principal. ${ClusterServicePrincipalApplicationId}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The principal ID, also known as the object ID, of the service principal. ${ClusterServicePrincipalId}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.Security.SecureString] # The password of the service principal. ${ClusterServicePrincipalPassword}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The tenant ID, also known as the directory ID, of the tenant in which the service principal is created. ${ClusterServicePrincipalTenantId}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The URL of the storage account container that is to be used by the specified identities. ${CommandOutputSettingContainerUrl}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdGrouping])] + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("PerCluster", "PerRack")] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdGrouping] + [System.String] # Selection of how the type evaluation is applied to the cluster calculation. ${ComputeDeploymentThresholdGrouping}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdType])] + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("CountSuccess", "PercentSuccess")] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdType] + [System.String] # Selection of how the threshold should be evaluated. ${ComputeDeploymentThresholdType}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.Int64] # The numeric threshold value. ${ComputeDeploymentThresholdValue}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackDefinition[]] - # The list of rack definitions for the compute racks in a multi-rackcluster, or an empty list in a single-rack cluster. - # To construct, see NOTES section for COMPUTERACKDEFINITION properties and create a hash table. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackDefinition[]] + # The list of rack definitions for the compute racks in a multi-rack cluster, or an empty list in a single-rack cluster. ${ComputeRackDefinition}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentityType])] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentityType] - # Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). - ${IdentityType}, - - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.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}, + [System.Management.Automation.SwitchParameter] + # Determines whether to enable a system-assigned identity for the resource. + ${EnableSystemAssignedIdentity}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The location of the managed resource group. # If not specified, the location of the parent resource is chosen. ${ManagedResourceGroupConfigurationLocation}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The name for the managed resource group. # If not specified, the unique name is automatically generated. ${ManagedResourceGroupConfigurationName}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RuntimeProtectionEnforcementLevel])] + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Audit", "Disabled", "OnDemand", "Passive", "RealTime")] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RuntimeProtectionEnforcementLevel] + [System.String] # The mode of operation for runtime protection. ${RuntimeProtectionConfigurationEnforcementLevel}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The resource ID of the key vault to archive the secrets of the cluster. ${SecretArchiveKeyVaultId}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The URI for the key vault used as the secret archive. ${SecretArchiveSettingVaultUri}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType])] + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("SystemAssignedIdentity", "UserAssignedIdentity")] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType] + [System.String] # The type of managed identity that is being selected. ${SecretArchiveSettingsAssociatedIdentityType}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The user assigned managed identity resource ID to use. # Mutually exclusive with a system assigned identity type. ${SecretArchiveSettingsAssociatedIdentityUserAssignedIdentityResourceId}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterSecretArchiveEnabled])] + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("True", "False")] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterSecretArchiveEnabled] + [System.String] # The indicator if the specified key vault should be used to archive the secrets of the cluster. ${SecretArchiveUseKeyVault}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceTags]))] [System.Collections.Hashtable] # Resource tags. ${Tag}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.Int64] # The maximum number of worker nodes that can be offline within the increment of update, e.g., rack-by-rack.Limited by the maximum number of machines in the increment. # Defaults to the whole increment size. ${UpdateStrategyMaxUnavailable}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdType])] + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("CountSuccess", "PercentSuccess")] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdType] + [System.String] # Selection of how the threshold should be evaluated. ${UpdateStrategyThresholdType}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.Int64] # The numeric threshold value. ${UpdateStrategyThresholdValue}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterUpdateStrategyType])] + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Rack", "PauseAfterRack")] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterUpdateStrategyType] + [System.String] # The mode of operation for runtime protection. ${UpdateStrategyType}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.Int64] # The time to wait between the increments of update defined by the strategy. ${UpdateStrategyWaitTimeMinute}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VulnerabilityScanningSettingsContainerScan])] + [Parameter(ParameterSetName='CreateExpanded')] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.PSArgumentCompleterAttribute("Disabled", "Enabled")] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VulnerabilityScanningSettingsContainerScan] + [System.String] # The mode selection for container vulnerability scanning. ${VulnerabilityScanningSettingContainerScan}, + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Path of Json file supplied to the Create operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Json string supplied to the Create operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -507,6 +512,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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() @@ -527,10 +541,10 @@ begin { $mapping = @{ CreateExpanded = 'Az.NetworkCloud.private\New-AzNetworkCloudCluster_CreateExpanded'; + CreateViaJsonFilePath = 'Az.NetworkCloud.private\New-AzNetworkCloudCluster_CreateViaJsonFilePath'; + CreateViaJsonString = 'Az.NetworkCloud.private\New-AzNetworkCloudCluster_CreateViaJsonString'; } - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 { @@ -544,6 +558,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/NetworkCloud/NetworkCloud.Autorest/exports/New-AzNetworkCloudClusterManager.ps1 b/generated/NetworkCloud/NetworkCloud.Autorest/exports/New-AzNetworkCloudClusterManager.ps1 index 5da02ff2cf55..849f59ded6fc 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/exports/New-AzNetworkCloudClusterManager.ps1 +++ b/generated/NetworkCloud/NetworkCloud.Autorest/exports/New-AzNetworkCloudClusterManager.ps1 @@ -16,9 +16,9 @@ <# .Synopsis -Create a new cluster manager or update properties of the cluster manager if it exists. +Create a new cluster manager or create properties of the cluster manager if it exists. .Description -Create a new cluster manager or update properties of the cluster manager if it exists. +Create a new cluster manager or create properties of the cluster manager if it exists. .Example $tagHash = @{ tag1 = "true" @@ -28,12 +28,12 @@ $tagHash = @{ New-AzNetworkCloudClusterManager -Name cnName -Location location -ResourceGroupName resourceGroupName -SubscriptionId subscriptionId -AnalyticsWorkspaceId "" -ManagedResourceGroupConfigurationName mrgName -FabricControllerId fabricControllerID -Tag $tagHash .Outputs -Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManager +Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManager .Link https://learn.microsoft.com/powershell/module/az.networkcloud/new-aznetworkcloudclustermanager #> function New-AzNetworkCloudClusterManager { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManager])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManager])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] @@ -73,25 +73,25 @@ param( # Other values will result in error from server as they are not supported. ${IfNoneMatch}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The resource ID of the fabric controller that has one to one mapping with the cluster manager. ${FabricControllerId}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The geo-location where the resource lives ${Location}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The resource ID of the Log Analytics workspace that is used for the logs collection. ${AnalyticsWorkspaceId}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String[]] @@ -99,50 +99,60 @@ param( # The Azure availability zones within the region that will be used to support the cluster manager resource. ${AvailabilityZone}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentityType])] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentityType] - # Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). - ${IdentityType}, - - [Parameter()] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.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}, + [System.Management.Automation.SwitchParameter] + # Determines whether to enable a system-assigned identity for the resource. + ${EnableSystemAssignedIdentity}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The location of the managed resource group. # If not specified, the location of the parent resource is chosen. ${ManagedResourceGroupConfigurationLocation}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The name for the managed resource group. # If not specified, the unique name is automatically generated. ${ManagedResourceGroupConfigurationName}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceTags]))] [System.Collections.Hashtable] # Resource tags. ${Tag}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category('Body')] [System.String] # Field deprecated, this value will no longer influence the cluster manager allocation process and will be removed in a future version. # The size of the Azure virtual machines to use for hosting the cluster manager resource. ${VMSize}, + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Path of Json file supplied to the Create operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Json string supplied to the Create operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -211,6 +221,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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() @@ -231,10 +250,10 @@ begin { $mapping = @{ CreateExpanded = 'Az.NetworkCloud.private\New-AzNetworkCloudClusterManager_CreateExpanded'; + CreateViaJsonFilePath = 'Az.NetworkCloud.private\New-AzNetworkCloudClusterManager_CreateViaJsonFilePath'; + CreateViaJsonString = 'Az.NetworkCloud.private\New-AzNetworkCloudClusterManager_CreateViaJsonString'; } - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 { @@ -248,6 +267,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/NetworkCloud/NetworkCloud.Autorest/exports/New-AzNetworkCloudConsole.ps1 b/generated/NetworkCloud/NetworkCloud.Autorest/exports/New-AzNetworkCloudConsole.ps1 index d90929ade56a..785f1798a516 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/exports/New-AzNetworkCloudConsole.ps1 +++ b/generated/NetworkCloud/NetworkCloud.Autorest/exports/New-AzNetworkCloudConsole.ps1 @@ -16,19 +16,49 @@ <# .Synopsis -Create a new virtual machine console or update the properties of the existing virtual machine console. +Create a new virtual machine console or create the properties of the existing virtual machine console. .Description -Create a new virtual machine console or update the properties of the existing virtual machine console. +Create a new virtual machine console or create the properties of the existing virtual machine console. .Example New-AzNetworkCloudConsole -ResourceGroupName resourceGroupName -Location location -ExtendedLocationName "/subscriptions/subscriptionId/resourcegroups/clusterManagerHostedResourceGroup/providers/microsoft.extendedlocation/customlocations/clusterManagerExtendedLocation" -ExtendedLocationType "CustomLocation" -SubscriptionId subscriptionId -Tag @{tags="tag1"} -Enabled ConsoleEnabled.True -VirtualMachineName virtualMachineName -SshPublicKeyData "ssh-rsa StNw+/C+g0tOZLT9OKK6YTovOn= fakekey@vm" -Expiration "2025-02-01T01:27:03.008Z" +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsole +Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsole +.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. + +VIRTUALMACHINEINPUTOBJECT : Identity Parameter + [AgentPoolName ]: The name of the Kubernetes cluster agent pool. + [BareMetalMachineKeySetName ]: The name of the bare metal machine key set. + [BareMetalMachineName ]: The name of the bare metal machine. + [BmcKeySetName ]: The name of the baseboard management controller key set. + [CloudServicesNetworkName ]: The name of the cloud services network. + [ClusterManagerName ]: The name of the cluster manager. + [ClusterName ]: The name of the cluster. + [ConsoleName ]: The name of the virtual machine console. + [FeatureName ]: The name of the feature. + [Id ]: Resource identity path + [KubernetesClusterName ]: The name of the Kubernetes cluster. + [L2NetworkName ]: The name of the L2 network. + [L3NetworkName ]: The name of the L3 network. + [MetricsConfigurationName ]: The name of the metrics configuration for the cluster. + [RackName ]: The name of the rack. + [RackSkuName ]: The name of the rack SKU. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [StorageApplianceName ]: The name of the storage appliance. + [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. + [TrunkedNetworkName ]: The name of the trunked network. + [VirtualMachineName ]: The name of the virtual machine. + [VolumeName ]: The name of the volume. .Link https://learn.microsoft.com/powershell/module/az.networkcloud/new-aznetworkcloudconsole #> function New-AzNetworkCloudConsole { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsole])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsole])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] @@ -38,20 +68,18 @@ param( # The name of the virtual machine console. ${Name}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [System.String] # The name of the resource group. # The name is case insensitive. ${ResourceGroupName}, - [Parameter(Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] - [System.String] - # The name of the virtual machine. - ${VirtualMachineName}, - - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaJsonFilePath')] + [Parameter(ParameterSetName='CreateViaJsonString')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] @@ -59,6 +87,20 @@ param( # The value must be an UUID. ${SubscriptionId}, + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] + [System.String] + # The name of the virtual machine. + ${VirtualMachineName}, + + [Parameter(ParameterSetName='CreateViaIdentityVirtualMachineExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] + # Identity Parameter + ${VirtualMachineInputObject}, + [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Header')] [System.String] @@ -74,50 +116,69 @@ param( # Other values will result in error from server as they are not supported. ${IfNoneMatch}, - [Parameter(Mandatory)] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ConsoleEnabled])] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaIdentityVirtualMachineExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("True", "False")] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ConsoleEnabled] + [System.String] # The indicator of whether the console access is enabled. ${Enabled}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaIdentityVirtualMachineExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The resource ID of the extended location on which the resource will be created. ${ExtendedLocationName}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaIdentityVirtualMachineExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The extended location type, for example, CustomLocation. ${ExtendedLocationType}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaIdentityVirtualMachineExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The geo-location where the resource lives ${Location}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaIdentityVirtualMachineExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The SSH public key data. ${SshPublicKeyData}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityVirtualMachineExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.DateTime] # The date and time after which the key will be disallowed access. ${Expiration}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityVirtualMachineExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceTags]))] [System.Collections.Hashtable] # Resource tags. ${Tag}, + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Path of Json file supplied to the Create operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Json string supplied to the Create operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -186,6 +247,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 +276,11 @@ begin { $mapping = @{ CreateExpanded = 'Az.NetworkCloud.private\New-AzNetworkCloudConsole_CreateExpanded'; + CreateViaIdentityVirtualMachineExpanded = 'Az.NetworkCloud.private\New-AzNetworkCloudConsole_CreateViaIdentityVirtualMachineExpanded'; + CreateViaJsonFilePath = 'Az.NetworkCloud.private\New-AzNetworkCloudConsole_CreateViaJsonFilePath'; + CreateViaJsonString = 'Az.NetworkCloud.private\New-AzNetworkCloudConsole_CreateViaJsonString'; } - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 +294,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/NetworkCloud/NetworkCloud.Autorest/exports/New-AzNetworkCloudControlPlaneNodeConfigurationObject.ps1 b/generated/NetworkCloud/NetworkCloud.Autorest/exports/New-AzNetworkCloudControlPlaneNodeConfigurationObject.ps1 index 81cdb780b6d4..7b8f78a93230 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/exports/New-AzNetworkCloudControlPlaneNodeConfigurationObject.ps1 +++ b/generated/NetworkCloud/NetworkCloud.Autorest/exports/New-AzNetworkCloudControlPlaneNodeConfigurationObject.ps1 @@ -27,7 +27,7 @@ $sshPublicKey=@{ New-AzNetworkCloudControlPlaneNodeConfigurationObject -Count 1 -VMSkuName vmSkuName -AdministratorConfigurationAdminUsername userName -AdministratorConfigurationSshPublicKey $sshPublicKey -AvailabilityZone @("1","2","3") .Outputs -Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ControlPlaneNodeConfiguration +Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ControlPlaneNodeConfiguration .Notes COMPLEX PARAMETER PROPERTIES @@ -36,10 +36,10 @@ To create the parameters described below, construct a hash table containing the ADMINISTRATORCONFIGURATIONSSHPUBLICKEY : The SSH configuration for the operating systems that run the nodes in the Kubernetes cluster. In some cases, specification of public keys may be required to produce a working environment. KeyData : The SSH public key data. .Link -https://learn.microsoft.com/powershell/module/Az.NetworkCloud/new-AzNetworkCloudControlPlaneNodeConfigurationObject +https://learn.microsoft.com/powershell/module/Az.NetworkCloud/new-aznetworkcloudcontrolplanenodeconfigurationobject #> function New-AzNetworkCloudControlPlaneNodeConfigurationObject { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ControlPlaneNodeConfiguration])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ControlPlaneNodeConfiguration])] [CmdletBinding(PositionalBinding=$false)] param( [Parameter(Mandatory)] @@ -63,10 +63,9 @@ param( [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey[]] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISshPublicKey[]] # The SSH configuration for the operating systems that run the nodes in the Kubernetes cluster. # In some cases, specification of public keys may be required to produce a working environment. - # To construct, see NOTES section for ADMINISTRATORCONFIGURATIONSSHPUBLICKEY properties and create a hash table. ${AdministratorConfigurationSshPublicKey}, [Parameter()] @@ -84,6 +83,9 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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() @@ -112,6 +114,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/NetworkCloud/NetworkCloud.Autorest/exports/New-AzNetworkCloudEgressEndpointObject.ps1 b/generated/NetworkCloud/NetworkCloud.Autorest/exports/New-AzNetworkCloudEgressEndpointObject.ps1 index a3ac27f61324..f1f752dfbed5 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/exports/New-AzNetworkCloudEgressEndpointObject.ps1 +++ b/generated/NetworkCloud/NetworkCloud.Autorest/exports/New-AzNetworkCloudEgressEndpointObject.ps1 @@ -25,7 +25,7 @@ $endpointDependency=New-AzNetworkCloudEndpointDependencyObject -DomainName domai New-AzNetworkCloudEgressEndpointObject -Category "azure-resource-management" -Endpoint ($endpointDependency) .Outputs -Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.EgressEndpoint +Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.EgressEndpoint .Notes COMPLEX PARAMETER PROPERTIES @@ -35,10 +35,10 @@ ENDPOINT : The list of endpoint dependencies. DomainName : The domain name of the dependency. [Port ]: The port of this endpoint. .Link -https://learn.microsoft.com/powershell/module/Az.NetworkCloud/new-AzNetworkCloudEgressEndpointObject +https://learn.microsoft.com/powershell/module/Az.NetworkCloud/new-aznetworkcloudegressendpointobject #> function New-AzNetworkCloudEgressEndpointObject { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.EgressEndpoint])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.EgressEndpoint])] [CmdletBinding(PositionalBinding=$false)] param( [Parameter(Mandatory)] @@ -51,9 +51,8 @@ param( [Parameter(Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IEndpointDependency[]] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IEndpointDependency[]] # The list of endpoint dependencies. - # To construct, see NOTES section for ENDPOINT properties and create a hash table. ${Endpoint} ) @@ -64,6 +63,9 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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() @@ -92,6 +94,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/NetworkCloud/NetworkCloud.Autorest/exports/New-AzNetworkCloudEndpointDependencyObject.ps1 b/generated/NetworkCloud/NetworkCloud.Autorest/exports/New-AzNetworkCloudEndpointDependencyObject.ps1 index 508c9ea24916..97df1077d63c 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/exports/New-AzNetworkCloudEndpointDependencyObject.ps1 +++ b/generated/NetworkCloud/NetworkCloud.Autorest/exports/New-AzNetworkCloudEndpointDependencyObject.ps1 @@ -23,12 +23,12 @@ Create an in-memory object for EndpointDependency. New-AzNetworkCloudEndpointDependencyObject -DomainName domainName -Port 1234 .Outputs -Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.EndpointDependency +Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.EndpointDependency .Link -https://learn.microsoft.com/powershell/module/Az.NetworkCloud/new-AzNetworkCloudEndpointDependencyObject +https://learn.microsoft.com/powershell/module/Az.NetworkCloud/new-aznetworkcloudendpointdependencyobject #> function New-AzNetworkCloudEndpointDependencyObject { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.EndpointDependency])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.EndpointDependency])] [CmdletBinding(PositionalBinding=$false)] param( [Parameter(Mandatory)] @@ -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.NetworkCloud.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/NetworkCloud/NetworkCloud.Autorest/exports/New-AzNetworkCloudInitialAgentPoolConfigurationObject.ps1 b/generated/NetworkCloud/NetworkCloud.Autorest/exports/New-AzNetworkCloudInitialAgentPoolConfigurationObject.ps1 index 9e285d4e5d10..9d67bc0f2aa6 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/exports/New-AzNetworkCloudInitialAgentPoolConfigurationObject.ps1 +++ b/generated/NetworkCloud/NetworkCloud.Autorest/exports/New-AzNetworkCloudInitialAgentPoolConfigurationObject.ps1 @@ -23,7 +23,7 @@ Create an in-memory object for InitialAgentPoolConfiguration. New-AzNetworkCloudInitialAgentPoolConfigurationObject -Count -Mode -Name -VMSkuName -AdministratorConfigurationAdminUsername -AdministratorConfigurationSshPublicKey -AgentOptionHugepagesCount -AgentOptionHugepagesSize -AttachedNetworkConfigurationL2Network -AttachedNetworkConfigurationL3Network -AttachedNetworkConfigurationTrunkedNetwork -AvailabilityZone -Label -Taint -UpgradeSettingMaxSurge .Outputs -Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.InitialAgentPoolConfiguration +Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.InitialAgentPoolConfiguration .Notes COMPLEX PARAMETER PROPERTIES @@ -33,30 +33,30 @@ ADMINISTRATORCONFIGURATIONSSHPUBLICKEY : The SSH configuration KeyData : The SSH public key data. ATTACHEDNETWORKCONFIGURATIONL2NETWORK : The list of Layer 2 Networks and related configuration for attachment. - NetworkId : The resource ID of the network that is being configured for attachment. - [PluginType ]: The indicator of how this network will be utilized by the Kubernetes cluster. + [NetworkId ]: The resource ID of the network that is being configured for attachment. + [PluginType ]: The indicator of how this network will be utilized by the Kubernetes cluster. ATTACHEDNETWORKCONFIGURATIONL3NETWORK : The list of Layer 3 Networks and related configuration for attachment. NetworkId : The resource ID of the network that is being configured for attachment. - [IpamEnabled ]: The indication of whether this network will or will not perform IP address management and allocate IP addresses when attached. - [PluginType ]: The indicator of how this network will be utilized by the Kubernetes cluster. + [IpamEnabled ]: The indication of whether this network will or will not perform IP address management and allocate IP addresses when attached. + [PluginType ]: The indicator of how this network will be utilized by the Kubernetes cluster. ATTACHEDNETWORKCONFIGURATIONTRUNKEDNETWORK : The list of Trunked Networks and related configuration for attachment. - NetworkId : The resource ID of the network that is being configured for attachment. - [PluginType ]: The indicator of how this network will be utilized by the Kubernetes cluster. + [NetworkId ]: The resource ID of the network that is being configured for attachment. + [PluginType ]: The indicator of how this network will be utilized by the Kubernetes cluster. LABEL : The labels applied to the nodes in this agent pool. - Key : The name of the label or taint. - Value : The value of the label or taint. + [Key ]: The name of the label or taint. + [Value ]: The value of the label or taint. TAINT : The taints applied to the nodes in this agent pool. - Key : The name of the label or taint. - Value : The value of the label or taint. + [Key ]: The name of the label or taint. + [Value ]: The value of the label or taint. .Link -https://learn.microsoft.com/powershell/module/Az.NetworkCloud/new-AzNetworkCloudInitialAgentPoolConfigurationObject +https://learn.microsoft.com/powershell/module/Az.NetworkCloud/new-aznetworkcloudinitialagentpoolconfigurationobject #> function New-AzNetworkCloudInitialAgentPoolConfigurationObject { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.InitialAgentPoolConfiguration])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.InitialAgentPoolConfiguration])] [CmdletBinding(PositionalBinding=$false)] param( [Parameter(Mandatory)] @@ -66,9 +66,9 @@ param( ${Count}, [Parameter(Mandatory)] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.AgentPoolMode])] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("System", "User", "NotApplicable")] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.AgentPoolMode] + [System.String] # The selection of how this agent pool is utilized, either as a system pool or a user pool. # System pools run the features and critical services for the Kubernetes Cluster, while user pools are dedicated to user workloads. # Every Kubernetes cluster must contain at least one system node pool with at least one node. @@ -95,10 +95,9 @@ param( [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey[]] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISshPublicKey[]] # The SSH configuration for the operating systems that run the nodes in the Kubernetes cluster. # In some cases, specification of public keys may be required to produce a working environment. - # To construct, see NOTES section for ADMINISTRATORCONFIGURATIONSSHPUBLICKEY properties and create a hash table. ${AdministratorConfigurationSshPublicKey}, [Parameter()] @@ -108,31 +107,28 @@ param( ${AgentOptionHugepagesCount}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HugepagesSize])] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("2M", "1G")] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HugepagesSize] + [System.String] # The size of the hugepages to allocate. ${AgentOptionHugepagesSize}, [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkAttachmentConfiguration[]] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkAttachmentConfiguration[]] # The list of Layer 2 Networks and related configuration for attachment. - # To construct, see NOTES section for ATTACHEDNETWORKCONFIGURATIONL2NETWORK properties and create a hash table. ${AttachedNetworkConfigurationL2Network}, [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkAttachmentConfiguration[]] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkAttachmentConfiguration[]] # The list of Layer 3 Networks and related configuration for attachment. - # To construct, see NOTES section for ATTACHEDNETWORKCONFIGURATIONL3NETWORK properties and create a hash table. ${AttachedNetworkConfigurationL3Network}, [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkAttachmentConfiguration[]] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkAttachmentConfiguration[]] # The list of Trunked Networks and related configuration for attachment. - # To construct, see NOTES section for ATTACHEDNETWORKCONFIGURATIONTRUNKEDNETWORK properties and create a hash table. ${AttachedNetworkConfigurationTrunkedNetwork}, [Parameter()] @@ -144,16 +140,14 @@ param( [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesLabel[]] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesLabel[]] # The labels applied to the nodes in this agent pool. - # To construct, see NOTES section for LABEL properties and create a hash table. ${Label}, [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesLabel[]] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesLabel[]] # The taints applied to the nodes in this agent pool. - # To construct, see NOTES section for TAINT properties and create a hash table. ${Taint}, [Parameter()] @@ -197,6 +191,9 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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() @@ -225,6 +222,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/NetworkCloud/NetworkCloud.Autorest/exports/New-AzNetworkCloudIpAddressPoolObject.ps1 b/generated/NetworkCloud/NetworkCloud.Autorest/exports/New-AzNetworkCloudIpAddressPoolObject.ps1 index 9aba9d7c8ce1..98b2b9c2adc1 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/exports/New-AzNetworkCloudIpAddressPoolObject.ps1 +++ b/generated/NetworkCloud/NetworkCloud.Autorest/exports/New-AzNetworkCloudIpAddressPoolObject.ps1 @@ -23,39 +23,39 @@ Create an in-memory object for IpAddressPool. New-AzNetworkCloudIpAddressPoolObject -Address @("198.51.102.0/24") -Name "pool1" -AutoAssign True -OnlyUseHostIP True .Outputs -Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IPAddressPool +Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IPAddressPool .Link -https://learn.microsoft.com/powershell/module/Az.NetworkCloud/new-AzNetworkCloudIpAddressPoolObject +https://learn.microsoft.com/powershell/module/Az.NetworkCloud/new-aznetworkcloudipaddresspoolobject #> function New-AzNetworkCloudIpAddressPoolObject { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IpAddressPool])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IpAddressPool])] [CmdletBinding(PositionalBinding=$false)] param( [Parameter(Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # The name used to identify this IP address pool for association with a BGP advertisement. + ${Name}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String[]] # The list of IP address ranges. # Each range can be a either a subnet in CIDR format or an explicit start-end range of IP addresses. # For a BGP service load balancer configuration, only CIDR format is supported and excludes /32 (IPv4) and /128 (IPv6) prefixes. ${Address}, - [Parameter(Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [System.String] - # The name used to identify this IP address pool for association with a BGP advertisement. - ${Name}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BfdEnabled])] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("True", "False")] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BfdEnabled] + [System.String] # The indicator to determine if automatic allocation from the pool should occur. ${AutoAssign}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BfdEnabled])] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("True", "False")] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BfdEnabled] + [System.String] # The indicator to prevent the use of IP addresses ending with .0 and .255 for this pool. # Enabling this option will only use IP addresses between .1 and .254 inclusive. ${OnlyUseHostIP} @@ -68,6 +68,9 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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() @@ -96,6 +99,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/NetworkCloud/NetworkCloud.Autorest/exports/New-AzNetworkCloudKeySetUserObject.ps1 b/generated/NetworkCloud/NetworkCloud.Autorest/exports/New-AzNetworkCloudKeySetUserObject.ps1 index d7418156b521..a3bf37bb95c6 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/exports/New-AzNetworkCloudKeySetUserObject.ps1 +++ b/generated/NetworkCloud/NetworkCloud.Autorest/exports/New-AzNetworkCloudKeySetUserObject.ps1 @@ -23,12 +23,12 @@ Create an in-memory object for KeySetUser. New-AzNetworkCloudKeySetUserObject -AzureUserName azureUserName -SshPublicKeyData "ssh-rsa-key" -Description "userDescription" .Outputs -Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.KeySetUser +Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.KeySetUser .Link -https://learn.microsoft.com/powershell/module/Az.NetworkCloud/new-AzNetworkCloudKeySetUserObject +https://learn.microsoft.com/powershell/module/Az.NetworkCloud/new-aznetworkcloudkeysetuserobject #> function New-AzNetworkCloudKeySetUserObject { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.KeySetUser])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.KeySetUser])] [CmdletBinding(PositionalBinding=$false)] param( [Parameter(Mandatory)] @@ -63,6 +63,9 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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() @@ -91,6 +94,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/NetworkCloud/NetworkCloud.Autorest/exports/New-AzNetworkCloudKubernetesCluster.ps1 b/generated/NetworkCloud/NetworkCloud.Autorest/exports/New-AzNetworkCloudKubernetesCluster.ps1 index 78cf5cf3342b..fac98d993b97 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/exports/New-AzNetworkCloudKubernetesCluster.ps1 +++ b/generated/NetworkCloud/NetworkCloud.Autorest/exports/New-AzNetworkCloudKubernetesCluster.ps1 @@ -16,9 +16,9 @@ <# .Synopsis -Create a new Kubernetes cluster or update the properties of the existing one. +Create a new Kubernetes cluster or create the properties of the existing one. .Description -Create a new Kubernetes cluster or update the properties of the existing one. +Create a new Kubernetes cluster or create the properties of the existing one. .Example $tagHash = @{tags = "tag1" } $agentPoolConfiguration = @{ @@ -46,43 +46,43 @@ New-AzNetworkCloudKubernetesCluster -ResourceGroupName resourceGroupName ` -Tag $tagHash .Outputs -Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesCluster +Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesCluster .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. ATTACHEDNETWORKCONFIGURATIONL2NETWORK : The list of Layer 2 Networks and related configuration for attachment. - NetworkId : The resource ID of the network that is being configured for attachment. - [PluginType ]: The indicator of how this network will be utilized by the Kubernetes cluster. + [NetworkId ]: The resource ID of the network that is being configured for attachment. + [PluginType ]: The indicator of how this network will be utilized by the Kubernetes cluster. ATTACHEDNETWORKCONFIGURATIONL3NETWORK : The list of Layer 3 Networks and related configuration for attachment. NetworkId : The resource ID of the network that is being configured for attachment. - [IpamEnabled ]: The indication of whether this network will or will not perform IP address management and allocate IP addresses when attached. - [PluginType ]: The indicator of how this network will be utilized by the Kubernetes cluster. + [IpamEnabled ]: The indication of whether this network will or will not perform IP address management and allocate IP addresses when attached. + [PluginType ]: The indicator of how this network will be utilized by the Kubernetes cluster. ATTACHEDNETWORKCONFIGURATIONTRUNKEDNETWORK : The list of Trunked Networks and related configuration for attachment. - NetworkId : The resource ID of the network that is being configured for attachment. - [PluginType ]: The indicator of how this network will be utilized by the Kubernetes cluster. + [NetworkId ]: The resource ID of the network that is being configured for attachment. + [PluginType ]: The indicator of how this network will be utilized by the Kubernetes cluster. BGPADVERTISEMENT : The association of IP address pools to the communities and peers, allowing for announcement of IPs. - IPAddressPool : The names of the IP address pools associated with this announcement. - [AdvertiseToFabric ]: The indicator of if this advertisement is also made to the network fabric associated with the Network Cloud Cluster. This field is ignored if fabricPeeringEnabled is set to False. - [Community ]: The names of the BGP communities to be associated with the announcement, utilizing a BGP community string in 1234:1234 format. - [Peer ]: The names of the BGP peers to limit this advertisement to. If no values are specified, all BGP peers will receive this advertisement. + IPAddressPool >: The names of the IP address pools associated with this announcement. + [AdvertiseToFabric ]: The indicator of if this advertisement is also made to the network fabric associated with the Network Cloud Cluster. This field is ignored if fabricPeeringEnabled is set to False. + [Community >]: The names of the BGP communities to be associated with the announcement, utilizing a BGP community string in 1234:1234 format. + [Peer >]: The names of the BGP peers to limit this advertisement to. If no values are specified, all BGP peers will receive this advertisement. BGPIPADDRESSPOOL : The list of pools of IP addresses that can be allocated to load balancer services. - Address : The list of IP address ranges. Each range can be a either a subnet in CIDR format or an explicit start-end range of IP addresses. For a BGP service load balancer configuration, only CIDR format is supported and excludes /32 (IPv4) and /128 (IPv6) prefixes. Name : The name used to identify this IP address pool for association with a BGP advertisement. - [AutoAssign ]: The indicator to determine if automatic allocation from the pool should occur. - [OnlyUseHostIP ]: The indicator to prevent the use of IP addresses ending with .0 and .255 for this pool. Enabling this option will only use IP addresses between .1 and .254 inclusive. + [Address >]: The list of IP address ranges. Each range can be a either a subnet in CIDR format or an explicit start-end range of IP addresses. For a BGP service load balancer configuration, only CIDR format is supported and excludes /32 (IPv4) and /128 (IPv6) prefixes. + [AutoAssign ]: The indicator to determine if automatic allocation from the pool should occur. + [OnlyUseHostIP ]: The indicator to prevent the use of IP addresses ending with .0 and .255 for this pool. Enabling this option will only use IP addresses between .1 and .254 inclusive. BGPPEER : The list of additional BgpPeer entities that the Kubernetes cluster will peer with. All peering must be explicitly defined. Name : The name used to identify this BGP peer for association with a BGP advertisement. PeerAddress : The IPv4 or IPv6 address used to connect this BGP session. PeerAsn : The autonomous system number expected from the remote end of the BGP session. - [BfdEnabled ]: The indicator of BFD enablement for this BgpPeer. - [BgpMultiHop ]: The indicator to enable multi-hop peering support. + [BfdEnabled ]: The indicator of BFD enablement for this BgpPeer. + [BgpMultiHop ]: The indicator to enable multi-hop peering support. [HoldTime ]: Field Deprecated. The field was previously optional, now it will have no defined behavior and will be ignored. The requested BGP hold time value. This field uses ISO 8601 duration format, for example P1H. [KeepAliveTime ]: Field Deprecated. The field was previously optional, now it will have no defined behavior and will be ignored. The requested BGP keepalive time value. This field uses ISO 8601 duration format, for example P1H. [MyAsn ]: The autonomous system number used for the local end of the BGP session. @@ -94,38 +94,38 @@ CONTROLPLANENODECONFIGURATIONADMINPUBLICKEY : The SSH configura INITIALAGENTPOOLCONFIGURATION : The agent pools that are created with this Kubernetes cluster for running critical system services and workloads. This data in this field is only used during creation, and the field will be empty following the creation of the Kubernetes Cluster. After creation, the management of agent pools is done using the agentPools sub-resource. Count : The number of virtual machines that use this configuration. - Mode : The selection of how this agent pool is utilized, either as a system pool or a user pool. System pools run the features and critical services for the Kubernetes Cluster, while user pools are dedicated to user workloads. Every Kubernetes cluster must contain at least one system node pool with at least one node. + Mode : The selection of how this agent pool is utilized, either as a system pool or a user pool. System pools run the features and critical services for the Kubernetes Cluster, while user pools are dedicated to user workloads. Every Kubernetes cluster must contain at least one system node pool with at least one node. Name : The name that will be used for the agent pool resource representing this agent pool. VMSkuName : The name of the VM SKU that determines the size of resources allocated for node VMs. [AdministratorConfigurationAdminUsername ]: The user name for the administrator that will be applied to the operating systems that run Kubernetes nodes. If not supplied, a user name will be chosen by the service. - [AdministratorConfigurationSshPublicKey ]: The SSH configuration for the operating systems that run the nodes in the Kubernetes cluster. In some cases, specification of public keys may be required to produce a working environment. + [AdministratorConfigurationSshPublicKey >]: The SSH configuration for the operating systems that run the nodes in the Kubernetes cluster. In some cases, specification of public keys may be required to produce a working environment. KeyData : The SSH public key data. [AgentOptionHugepagesCount ]: The number of hugepages to allocate. - [AgentOptionHugepagesSize ]: The size of the hugepages to allocate. - [AttachedNetworkConfigurationL2Network ]: The list of Layer 2 Networks and related configuration for attachment. - NetworkId : The resource ID of the network that is being configured for attachment. - [PluginType ]: The indicator of how this network will be utilized by the Kubernetes cluster. - [AttachedNetworkConfigurationL3Network ]: The list of Layer 3 Networks and related configuration for attachment. + [AgentOptionHugepagesSize ]: The size of the hugepages to allocate. + [AttachedNetworkConfigurationL2Network >]: The list of Layer 2 Networks and related configuration for attachment. + [NetworkId ]: The resource ID of the network that is being configured for attachment. + [PluginType ]: The indicator of how this network will be utilized by the Kubernetes cluster. + [AttachedNetworkConfigurationL3Network >]: The list of Layer 3 Networks and related configuration for attachment. NetworkId : The resource ID of the network that is being configured for attachment. - [IpamEnabled ]: The indication of whether this network will or will not perform IP address management and allocate IP addresses when attached. - [PluginType ]: The indicator of how this network will be utilized by the Kubernetes cluster. - [AttachedNetworkConfigurationTrunkedNetwork ]: The list of Trunked Networks and related configuration for attachment. - NetworkId : The resource ID of the network that is being configured for attachment. - [PluginType ]: The indicator of how this network will be utilized by the Kubernetes cluster. - [AvailabilityZone ]: The list of availability zones of the Network Cloud cluster used for the provisioning of nodes in this agent pool. If not specified, all availability zones will be used. - [Label ]: The labels applied to the nodes in this agent pool. - Key : The name of the label or taint. - Value : The value of the label or taint. - [Taint ]: The taints applied to the nodes in this agent pool. + [IpamEnabled ]: The indication of whether this network will or will not perform IP address management and allocate IP addresses when attached. + [PluginType ]: The indicator of how this network will be utilized by the Kubernetes cluster. + [AttachedNetworkConfigurationTrunkedNetwork >]: The list of Trunked Networks and related configuration for attachment. + [NetworkId ]: The resource ID of the network that is being configured for attachment. + [PluginType ]: The indicator of how this network will be utilized by the Kubernetes cluster. + [AvailabilityZone >]: The list of availability zones of the Network Cloud cluster used for the provisioning of nodes in this agent pool. If not specified, all availability zones will be used. + [Label >]: The labels applied to the nodes in this agent pool. + [Key ]: The name of the label or taint. + [Value ]: The value of the label or taint. + [Taint >]: The taints applied to the nodes in this agent pool. [UpgradeSettingDrainTimeout ]: The maximum time in seconds that is allowed for a node drain to complete before proceeding with the upgrade of the agent pool. If not specified during creation, a value of 1800 seconds is used. [UpgradeSettingMaxSurge ]: The maximum number or percentage of nodes that are surged during upgrade. This can either be set to an integer (e.g. '5') or a percentage (e.g. '50%'). If a percentage is specified, it is the percentage of the total agent pool size at the time of the upgrade. For percentages, fractional nodes are rounded up. If not specified during creation, a value of 1 is used. One of MaxSurge and MaxUnavailable must be greater than 0. [UpgradeSettingMaxUnavailable ]: The maximum number or percentage of nodes that can be unavailable during upgrade. This can either be set to an integer (e.g. '5') or a percentage (e.g. '50%'). If a percentage is specified, it is the percentage of the total agent pool size at the time of the upgrade. For percentages, fractional nodes are rounded up. If not specified during creation, a value of 0 is used. One of MaxSurge and MaxUnavailable must be greater than 0. L2SERVICELOADBALANCERCONFIGURATIONIPADDRESSPOOL : The list of pools of IP addresses that can be allocated to load balancer services. - Address : The list of IP address ranges. Each range can be a either a subnet in CIDR format or an explicit start-end range of IP addresses. For a BGP service load balancer configuration, only CIDR format is supported and excludes /32 (IPv4) and /128 (IPv6) prefixes. Name : The name used to identify this IP address pool for association with a BGP advertisement. - [AutoAssign ]: The indicator to determine if automatic allocation from the pool should occur. - [OnlyUseHostIP ]: The indicator to prevent the use of IP addresses ending with .0 and .255 for this pool. Enabling this option will only use IP addresses between .1 and .254 inclusive. + [Address >]: The list of IP address ranges. Each range can be a either a subnet in CIDR format or an explicit start-end range of IP addresses. For a BGP service load balancer configuration, only CIDR format is supported and excludes /32 (IPv4) and /128 (IPv6) prefixes. + [AutoAssign ]: The indicator to determine if automatic allocation from the pool should occur. + [OnlyUseHostIP ]: The indicator to prevent the use of IP addresses ending with .0 and .255 for this pool. Enabling this option will only use IP addresses between .1 and .254 inclusive. SSHPUBLICKEY : The SSH configuration for the operating systems that run the nodes in the Kubernetes cluster. In some cases, specification of public keys may be required to produce a working environment. KeyData : The SSH public key data. @@ -133,14 +133,15 @@ SSHPUBLICKEY : The SSH configuration for the operating systems https://learn.microsoft.com/powershell/module/az.networkcloud/new-aznetworkcloudkubernetescluster #> function New-AzNetworkCloudKubernetesCluster { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesCluster])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesCluster])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] + [Alias('KubernetesClusterName')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [System.String] # The name of the Kubernetes cluster. - ${KubernetesClusterName}, + ${Name}, [Parameter(Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] @@ -172,151 +173,143 @@ param( # Other values will result in error from server as they are not supported. ${IfNoneMatch}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.Int64] # The number of virtual machines that use this configuration. ${ControlPlaneNodeConfigurationCount}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The name of the VM SKU supplied during creation. ${ControlPlaneNodeConfigurationVMSkuName}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The resource ID of the extended location on which the resource will be created. ${ExtendedLocationName}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The extended location type, for example, CustomLocation. ${ExtendedLocationType}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IInitialAgentPoolConfiguration[]] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IInitialAgentPoolConfiguration[]] # The agent pools that are created with this Kubernetes cluster for running critical system services and workloads. # This data in this field is only used during creation, and the field will be empty following the creation of the Kubernetes Cluster. # After creation, the management of agent pools is done using the agentPools sub-resource. - # To construct, see NOTES section for INITIALAGENTPOOLCONFIGURATION properties and create a hash table. ${InitialAgentPoolConfiguration}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The Kubernetes version for this cluster. ${KubernetesVersion}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The geo-location where the resource lives ${Location}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The resource ID of the associated Cloud Services network. ${NetworkConfigurationCloudServicesNetworkId}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The resource ID of the Layer 3 network that is used for creation of the Container Networking Interface network. ${NetworkConfigurationCniNetworkId}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String[]] # The list of Azure Active Directory group object IDs that will have an administrative role on the Kubernetes cluster. ${AadConfigurationAdminGroupObjectId}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The user name for the administrator that will be applied to the operating systems that run Kubernetes nodes. # If not supplied, a user name will be chosen by the service. ${AdminUsername}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkAttachmentConfiguration[]] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkAttachmentConfiguration[]] # The list of Layer 2 Networks and related configuration for attachment. - # To construct, see NOTES section for ATTACHEDNETWORKCONFIGURATIONL2NETWORK properties and create a hash table. ${AttachedNetworkConfigurationL2Network}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkAttachmentConfiguration[]] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkAttachmentConfiguration[]] # The list of Layer 3 Networks and related configuration for attachment. - # To construct, see NOTES section for ATTACHEDNETWORKCONFIGURATIONL3NETWORK properties and create a hash table. ${AttachedNetworkConfigurationL3Network}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkAttachmentConfiguration[]] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkAttachmentConfiguration[]] # The list of Trunked Networks and related configuration for attachment. - # To construct, see NOTES section for ATTACHEDNETWORKCONFIGURATIONTRUNKEDNETWORK properties and create a hash table. ${AttachedNetworkConfigurationTrunkedNetwork}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBgpAdvertisement[]] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBgpAdvertisement[]] # The association of IP address pools to the communities and peers, allowing for announcement of IPs. - # To construct, see NOTES section for BGPADVERTISEMENT properties and create a hash table. ${BgpAdvertisement}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIPAddressPool[]] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IIPAddressPool[]] # The list of pools of IP addresses that can be allocated to load balancer services. - # To construct, see NOTES section for BGPIPADDRESSPOOL properties and create a hash table. ${BgpIPAddressPool}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IServiceLoadBalancerBgpPeer[]] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IServiceLoadBalancerBgpPeer[]] # The list of additional BgpPeer entities that the Kubernetes cluster will peer with. # All peering must be explicitly defined. - # To construct, see NOTES section for BGPPEER properties and create a hash table. ${BgpPeer}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.FabricPeeringEnabled])] + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("True", "False")] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.FabricPeeringEnabled] + [System.String] # The indicator to specify if the load balancer peers with the network fabric. ${BgpServiceLoadBalancerConfigurationFabricPeeringEnabled}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey[]] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISshPublicKey[]] # The SSH configuration for the operating systems that run the nodes in the Kubernetes cluster. # In some cases, specification of public keys may be required to produce a working environment. - # To construct, see NOTES section for CONTROLPLANENODECONFIGURATIONADMINPUBLICKEY properties and create a hash table. ${ControlPlaneNodeConfigurationAdminPublicKey}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The user name for the administrator that will be applied to the operating systems that run Kubernetes nodes. # If not supplied, a user name will be chosen by the service. ${ControlPlaneNodeConfigurationAdminUsername}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String[]] @@ -324,36 +317,35 @@ param( # If not specified, all availability zones will be used. ${ControlPlaneNodeConfigurationAvailabilityZone}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIPAddressPool[]] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IIPAddressPool[]] # The list of pools of IP addresses that can be allocated to load balancer services. - # To construct, see NOTES section for L2SERVICELOADBALANCERCONFIGURATIONIPADDRESSPOOL properties and create a hash table. ${L2ServiceLoadBalancerConfigurationIPAddressPool}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The location of the managed resource group. # If not specified, the location of the parent resource is chosen. ${ManagedResourceGroupConfigurationLocation}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The name for the managed resource group. # If not specified, the unique name is automatically generated. ${ManagedResourceGroupConfigurationName}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The IP address assigned to the Kubernetes DNS service. # It must be within the Kubernetes service address range specified in service CIDR. ${NetworkConfigurationDnsServiceIP}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String[]] @@ -362,7 +354,7 @@ param( # Two CIDRs, one for each IP family (IPv4/IPv6), is expected for dual-stack networking. ${NetworkConfigurationPodCidr}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String[]] @@ -371,22 +363,33 @@ param( # Two CIDRs, one for each IP family (IPv4/IPv6), is expected for dual-stack networking. ${NetworkConfigurationServiceCidr}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey[]] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISshPublicKey[]] # The SSH configuration for the operating systems that run the nodes in the Kubernetes cluster. # In some cases, specification of public keys may be required to produce a working environment. - # To construct, see NOTES section for SSHPUBLICKEY properties and create a hash table. ${SshPublicKey}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceTags]))] [System.Collections.Hashtable] # Resource tags. ${Tag}, + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Path of Json file supplied to the Create operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Json string supplied to the Create operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -455,6 +458,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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() @@ -475,10 +487,10 @@ begin { $mapping = @{ CreateExpanded = 'Az.NetworkCloud.private\New-AzNetworkCloudKubernetesCluster_CreateExpanded'; + CreateViaJsonFilePath = 'Az.NetworkCloud.private\New-AzNetworkCloudKubernetesCluster_CreateViaJsonFilePath'; + CreateViaJsonString = 'Az.NetworkCloud.private\New-AzNetworkCloudKubernetesCluster_CreateViaJsonString'; } - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 { @@ -492,6 +504,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/NetworkCloud/NetworkCloud.Autorest/exports/New-AzNetworkCloudKubernetesClusterFeature.ps1 b/generated/NetworkCloud/NetworkCloud.Autorest/exports/New-AzNetworkCloudKubernetesClusterFeature.ps1 index 6b5660f632ec..9cc321d9a01b 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/exports/New-AzNetworkCloudKubernetesClusterFeature.ps1 +++ b/generated/NetworkCloud/NetworkCloud.Autorest/exports/New-AzNetworkCloudKubernetesClusterFeature.ps1 @@ -16,27 +16,53 @@ <# .Synopsis -Create a new Kubernetes cluster feature or update properties of the Kubernetes cluster feature if it exists. +Create a new Kubernetes cluster feature or create properties of the Kubernetes cluster feature if it exists. .Description -Create a new Kubernetes cluster feature or update properties of the Kubernetes cluster feature if it exists. +Create a new Kubernetes cluster feature or create properties of the Kubernetes cluster feature if it exists. .Example New-AzNetworkCloudKubernetesClusterFeature -FeatureName featureName -KubernetesClusterName kubernetesClusterName -ResourceGroupName resourceGroup -SubscriptionId subscriptionId -Location location -Tag @{"key"="value"} +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeature +Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeature .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. +KUBERNETESCLUSTERINPUTOBJECT : Identity Parameter + [AgentPoolName ]: The name of the Kubernetes cluster agent pool. + [BareMetalMachineKeySetName ]: The name of the bare metal machine key set. + [BareMetalMachineName ]: The name of the bare metal machine. + [BmcKeySetName ]: The name of the baseboard management controller key set. + [CloudServicesNetworkName ]: The name of the cloud services network. + [ClusterManagerName ]: The name of the cluster manager. + [ClusterName ]: The name of the cluster. + [ConsoleName ]: The name of the virtual machine console. + [FeatureName ]: The name of the feature. + [Id ]: Resource identity path + [KubernetesClusterName ]: The name of the Kubernetes cluster. + [L2NetworkName ]: The name of the L2 network. + [L3NetworkName ]: The name of the L3 network. + [MetricsConfigurationName ]: The name of the metrics configuration for the cluster. + [RackName ]: The name of the rack. + [RackSkuName ]: The name of the rack SKU. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [StorageApplianceName ]: The name of the storage appliance. + [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. + [TrunkedNetworkName ]: The name of the trunked network. + [VirtualMachineName ]: The name of the virtual machine. + [VolumeName ]: The name of the volume. + OPTION : The configured options for the feature. - Key : The key to the mapped value. - Value : The value of the mapping key. + [Key ]: The key to the mapped value. + [Value ]: The value of the mapping key. .Link https://learn.microsoft.com/powershell/module/az.networkcloud/new-aznetworkcloudkubernetesclusterfeature #> function New-AzNetworkCloudKubernetesClusterFeature { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeature])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeature])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] @@ -45,20 +71,26 @@ param( # The name of the feature. ${FeatureName}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [System.String] # The name of the Kubernetes cluster. ${KubernetesClusterName}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] @@ -66,6 +98,12 @@ param( # The value must be an UUID. ${SubscriptionId}, + [Parameter(ParameterSetName='CreateViaIdentityKubernetesClusterExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] + # Identity Parameter + ${KubernetesClusterInputObject}, + [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Header')] [System.String] @@ -81,27 +119,41 @@ param( # Other values will result in error from server as they are not supported. ${IfNoneMatch}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaIdentityKubernetesClusterExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The geo-location where the resource lives ${Location}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityKubernetesClusterExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStringKeyValuePair[]] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStringKeyValuePair[]] # The configured options for the feature. - # To construct, see NOTES section for OPTION properties and create a hash table. ${Option}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityKubernetesClusterExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceTags]))] [System.Collections.Hashtable] # Resource tags. ${Tag}, + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Path of Json file supplied to the Create operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Json string supplied to the Create operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -170,6 +222,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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() @@ -190,10 +251,11 @@ begin { $mapping = @{ CreateExpanded = 'Az.NetworkCloud.private\New-AzNetworkCloudKubernetesClusterFeature_CreateExpanded'; + CreateViaIdentityKubernetesClusterExpanded = 'Az.NetworkCloud.private\New-AzNetworkCloudKubernetesClusterFeature_CreateViaIdentityKubernetesClusterExpanded'; + CreateViaJsonFilePath = 'Az.NetworkCloud.private\New-AzNetworkCloudKubernetesClusterFeature_CreateViaJsonFilePath'; + CreateViaJsonString = 'Az.NetworkCloud.private\New-AzNetworkCloudKubernetesClusterFeature_CreateViaJsonString'; } - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 { @@ -207,6 +269,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/NetworkCloud/NetworkCloud.Autorest/exports/New-AzNetworkCloudL2Network.ps1 b/generated/NetworkCloud/NetworkCloud.Autorest/exports/New-AzNetworkCloudL2Network.ps1 index b7c459e90e33..ec685b065026 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/exports/New-AzNetworkCloudL2Network.ps1 +++ b/generated/NetworkCloud/NetworkCloud.Autorest/exports/New-AzNetworkCloudL2Network.ps1 @@ -16,19 +16,19 @@ <# .Synopsis -Create a new layer 2 (L2) network or update the properties of the existing network. +Create a new layer 2 (L2) network or create the properties of the existing network. .Description -Create a new layer 2 (L2) network or update the properties of the existing network. +Create a new layer 2 (L2) network or create the properties of the existing network. .Example New-AzNetworkCloudL2Network -Name l2Network -ResourceGroupName resourceGroupName -ExtendedLocationName "/subscriptions/subscriptionId/resourcegroups/resourceGroupName/providers/microsoft.extendedlocation/customlocations/customLocationsName" -ExtendedLocationType "CustomLocation" -L2IsolationDomainId "/subscriptions/fabricsubs/resourceGroups/resourceGroupName/providers/Microsoft.NetworkFabric/L2IsolationDomains/L2IsolationDomainsName" -Location eastus -HybridAksPluginType "DPDK" -InterfaceName "eth0" -Tag @{tags = "tag1" } -SubscriptionId subscriptionId .Outputs -Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2Network +Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2Network .Link https://learn.microsoft.com/powershell/module/az.networkcloud/new-aznetworkcloudl2network #> function New-AzNetworkCloudL2Network { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2Network])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2Network])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] @@ -68,53 +68,65 @@ param( # Other values will result in error from server as they are not supported. ${IfNoneMatch}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The resource ID of the extended location on which the resource will be created. ${ExtendedLocationName}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The extended location type, for example, CustomLocation. ${ExtendedLocationType}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The resource ID of the Network Fabric l2IsolationDomain. ${L2IsolationDomainId}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The geo-location where the resource lives ${Location}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HybridAksPluginType])] + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("DPDK", "SRIOV", "OSDevice")] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HybridAksPluginType] + [System.String] # Field Deprecated. # The field was previously optional, now it will have no defined behavior and will be ignored. # The network plugin type for Hybrid AKS. ${HybridAksPluginType}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The default interface name for this L2 network in the virtual machine. # This name can be overridden by the name supplied in the network attachment configuration of that virtual machine. ${InterfaceName}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceTags]))] [System.Collections.Hashtable] # Resource tags. ${Tag}, + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Path of Json file supplied to the Create operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Json string supplied to the Create operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -183,6 +195,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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() @@ -203,10 +224,10 @@ begin { $mapping = @{ CreateExpanded = 'Az.NetworkCloud.private\New-AzNetworkCloudL2Network_CreateExpanded'; + CreateViaJsonFilePath = 'Az.NetworkCloud.private\New-AzNetworkCloudL2Network_CreateViaJsonFilePath'; + CreateViaJsonString = 'Az.NetworkCloud.private\New-AzNetworkCloudL2Network_CreateViaJsonString'; } - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 { @@ -220,6 +241,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/NetworkCloud/NetworkCloud.Autorest/exports/New-AzNetworkCloudL3Network.ps1 b/generated/NetworkCloud/NetworkCloud.Autorest/exports/New-AzNetworkCloudL3Network.ps1 index f4be67c6f94c..19ed50fda099 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/exports/New-AzNetworkCloudL3Network.ps1 +++ b/generated/NetworkCloud/NetworkCloud.Autorest/exports/New-AzNetworkCloudL3Network.ps1 @@ -16,19 +16,19 @@ <# .Synopsis -Create a new layer 3 (L3) network or update the properties of the existing network. +Create a new layer 3 (L3) network or create the properties of the existing network. .Description -Create a new layer 3 (L3) network or update the properties of the existing network. +Create a new layer 3 (L3) network or create the properties of the existing network. .Example New-AzNetworkCloudL3Network -ResourceGroupName resourceGroupName -Name l3NetworkName -Location eastus -ExtendedLocationName "subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName" -ExtendedLocationType "CustomLocation" -Vlan 1001 -L3IsolationDomainId "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/l3IsolationDomainName" -Ipv4ConnectedPrefix "10.1.100.0/24" -Ipv6ConnectedPrefix "fd01:1::0/64" -SubscriptionId subscriptionId .Outputs -Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3Network +Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3Network .Link https://learn.microsoft.com/powershell/module/az.networkcloud/new-aznetworkcloudl3network #> function New-AzNetworkCloudL3Network { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3Network])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3Network])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] @@ -68,89 +68,101 @@ param( # Other values will result in error from server as they are not supported. ${IfNoneMatch}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The resource ID of the extended location on which the resource will be created. ${ExtendedLocationName}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The extended location type, for example, CustomLocation. ${ExtendedLocationType}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The resource ID of the Network Fabric l3IsolationDomain. ${L3IsolationDomainId}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The geo-location where the resource lives ${Location}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.Int64] # The VLAN from the l3IsolationDomain that is used for this network. ${Vlan}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HybridAksIpamEnabled])] + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("True", "False")] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HybridAksIpamEnabled] + [System.String] # Field Deprecated. # The field was previously optional, now it will have no defined behavior and will be ignored. # The indicator of whether or not to disable IPAM allocation on the network attachment definition injected into the Hybrid AKS Cluster. ${HybridAksIpamEnabled}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HybridAksPluginType])] + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("DPDK", "SRIOV", "OSDevice")] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HybridAksPluginType] + [System.String] # Field Deprecated. # The field was previously optional, now it will have no defined behavior and will be ignored. # The network plugin type for Hybrid AKS. ${HybridAksPluginType}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.IPAllocationType])] + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("IPV4", "IPV6", "DualStack")] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.IPAllocationType] + [System.String] # The type of the IP address allocation, defaulted to "DualStack". ${IPAllocationType}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The default interface name for this L3 network in the virtual machine. # This name can be overridden by the name supplied in the network attachment configuration of that virtual machine. ${InterfaceName}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The IPV4 prefix (CIDR) assigned to this L3 network. # Required when the IP allocation type is IPV4 or DualStack. ${Ipv4ConnectedPrefix}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The IPV6 prefix (CIDR) assigned to this L3 network. # Required when the IP allocation type is IPV6 or DualStack. ${Ipv6ConnectedPrefix}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceTags]))] [System.Collections.Hashtable] # Resource tags. ${Tag}, + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Path of Json file supplied to the Create operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Json string supplied to the Create operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -219,6 +231,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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() @@ -239,10 +260,10 @@ begin { $mapping = @{ CreateExpanded = 'Az.NetworkCloud.private\New-AzNetworkCloudL3Network_CreateExpanded'; + CreateViaJsonFilePath = 'Az.NetworkCloud.private\New-AzNetworkCloudL3Network_CreateViaJsonFilePath'; + CreateViaJsonString = 'Az.NetworkCloud.private\New-AzNetworkCloudL3Network_CreateViaJsonString'; } - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 { @@ -256,6 +277,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/NetworkCloud/NetworkCloud.Autorest/exports/New-AzNetworkCloudL3NetworkAttachmentConfigurationObject.ps1 b/generated/NetworkCloud/NetworkCloud.Autorest/exports/New-AzNetworkCloudL3NetworkAttachmentConfigurationObject.ps1 index 83652010bf50..7d53c9d170bc 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/exports/New-AzNetworkCloudL3NetworkAttachmentConfigurationObject.ps1 +++ b/generated/NetworkCloud/NetworkCloud.Autorest/exports/New-AzNetworkCloudL3NetworkAttachmentConfigurationObject.ps1 @@ -23,12 +23,12 @@ Create an in-memory object for L3NetworkAttachmentConfiguration. New-AzNetworkCloudL3NetworkAttachmentConfigurationObject -NetworkId '/subscriptions/{subscriptionId}/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l3Networks/l3network-502' -IpamEnabled True -PluginType 'SRIOV' .Outputs -Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.L3NetworkAttachmentConfiguration +Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.L3NetworkAttachmentConfiguration .Link -https://learn.microsoft.com/powershell/module/Az.NetworkCloud/new-AzNetworkCloudL3NetworkAttachmentConfigurationObject +https://learn.microsoft.com/powershell/module/Az.NetworkCloud/new-aznetworkcloudl3networkattachmentconfigurationobject #> function New-AzNetworkCloudL3NetworkAttachmentConfigurationObject { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.L3NetworkAttachmentConfiguration])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.L3NetworkAttachmentConfiguration])] [CmdletBinding(PositionalBinding=$false)] param( [Parameter(Mandatory)] @@ -38,16 +38,16 @@ param( ${NetworkId}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.L3NetworkConfigurationIpamEnabled])] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("True", "False")] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.L3NetworkConfigurationIpamEnabled] + [System.String] # The indication of whether this network will or will not perform IP address management and allocate IP addresses when attached. ${IpamEnabled}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesPluginType])] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("DPDK", "SRIOV", "OSDevice", "MACVLAN", "IPVLAN")] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesPluginType] + [System.String] # The indicator of how this network will be utilized by the Kubernetes cluster. ${PluginType} ) @@ -59,6 +59,9 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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() @@ -87,6 +90,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/NetworkCloud/NetworkCloud.Autorest/exports/New-AzNetworkCloudMetricsConfiguration.ps1 b/generated/NetworkCloud/NetworkCloud.Autorest/exports/New-AzNetworkCloudMetricsConfiguration.ps1 index e3c82e80e9c4..b658881f476a 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/exports/New-AzNetworkCloudMetricsConfiguration.ps1 +++ b/generated/NetworkCloud/NetworkCloud.Autorest/exports/New-AzNetworkCloudMetricsConfiguration.ps1 @@ -16,41 +16,78 @@ <# .Synopsis -Create new or update the existing metrics configuration of the provided cluster. +Create new or create the existing metrics configuration of the provided cluster. .Description -Create new or update the existing metrics configuration of the provided cluster. +Create new or create the existing metrics configuration of the provided cluster. .Example New-AzNetworkCloudMetricsConfiguration -ClusterName clusterName -MetricsConfigurationName default -ResourceGroupName resourceGroupName -CollectionInterval 15 -ExtendedLocationName extendedLocationId -ExtendedLocationType CustomLocation -Location eastus -SubscriptionId subscriptionId +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfiguration +Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfiguration +.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. + +CLUSTERINPUTOBJECT : Identity Parameter + [AgentPoolName ]: The name of the Kubernetes cluster agent pool. + [BareMetalMachineKeySetName ]: The name of the bare metal machine key set. + [BareMetalMachineName ]: The name of the bare metal machine. + [BmcKeySetName ]: The name of the baseboard management controller key set. + [CloudServicesNetworkName ]: The name of the cloud services network. + [ClusterManagerName ]: The name of the cluster manager. + [ClusterName ]: The name of the cluster. + [ConsoleName ]: The name of the virtual machine console. + [FeatureName ]: The name of the feature. + [Id ]: Resource identity path + [KubernetesClusterName ]: The name of the Kubernetes cluster. + [L2NetworkName ]: The name of the L2 network. + [L3NetworkName ]: The name of the L3 network. + [MetricsConfigurationName ]: The name of the metrics configuration for the cluster. + [RackName ]: The name of the rack. + [RackSkuName ]: The name of the rack SKU. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [StorageApplianceName ]: The name of the storage appliance. + [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. + [TrunkedNetworkName ]: The name of the trunked network. + [VirtualMachineName ]: The name of the virtual machine. + [VolumeName ]: The name of the volume. .Link https://learn.microsoft.com/powershell/module/az.networkcloud/new-aznetworkcloudmetricsconfiguration #> function New-AzNetworkCloudMetricsConfiguration { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfiguration])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfiguration])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] + [Alias('MetricsConfigurationName')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [System.String] - # The name of the cluster. - ${ClusterName}, + # The name of the metrics configuration for the cluster. + ${Name}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [System.String] - # The name of the metrics configuration for the cluster. - ${MetricsConfigurationName}, + # The name of the cluster. + ${ClusterName}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] @@ -58,6 +95,12 @@ param( # The value must be an UUID. ${SubscriptionId}, + [Parameter(ParameterSetName='CreateViaIdentityClusterExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] + # Identity Parameter + ${ClusterInputObject}, + [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Header')] [System.String] @@ -73,44 +116,62 @@ param( # Other values will result in error from server as they are not supported. ${IfNoneMatch}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaIdentityClusterExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.Int64] # The interval in minutes by which metrics will be collected. ${CollectionInterval}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaIdentityClusterExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The resource ID of the extended location on which the resource will be created. ${ExtendedLocationName}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaIdentityClusterExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The extended location type, for example, CustomLocation. ${ExtendedLocationType}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaIdentityClusterExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The geo-location where the resource lives ${Location}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityClusterExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String[]] # The list of metric names that have been chosen to be enabled in addition to the core set of enabled metrics. ${EnabledMetric}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityClusterExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceTags]))] [System.Collections.Hashtable] # Resource tags. ${Tag}, + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Path of Json file supplied to the Create operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Json string supplied to the Create operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -179,6 +240,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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() @@ -199,10 +269,11 @@ begin { $mapping = @{ CreateExpanded = 'Az.NetworkCloud.private\New-AzNetworkCloudMetricsConfiguration_CreateExpanded'; + CreateViaIdentityClusterExpanded = 'Az.NetworkCloud.private\New-AzNetworkCloudMetricsConfiguration_CreateViaIdentityClusterExpanded'; + CreateViaJsonFilePath = 'Az.NetworkCloud.private\New-AzNetworkCloudMetricsConfiguration_CreateViaJsonFilePath'; + CreateViaJsonString = 'Az.NetworkCloud.private\New-AzNetworkCloudMetricsConfiguration_CreateViaJsonString'; } - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 { @@ -216,6 +287,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/NetworkCloud/NetworkCloud.Autorest/exports/New-AzNetworkCloudNetworkAttachmentObject.ps1 b/generated/NetworkCloud/NetworkCloud.Autorest/exports/New-AzNetworkCloudNetworkAttachmentObject.ps1 index 3d9bd2b9507f..d3f8017b0621 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/exports/New-AzNetworkCloudNetworkAttachmentObject.ps1 +++ b/generated/NetworkCloud/NetworkCloud.Autorest/exports/New-AzNetworkCloudNetworkAttachmentObject.ps1 @@ -23,12 +23,12 @@ Create an in-memory object for NetworkAttachment. New-AzNetworkCloudNetworkAttachmentObject -AttachedNetworkId "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l3Networks/l3NetworkName" -IPAllocationMethod "Dynamic" -DefaultGateway "True" -Ipv4Address "198.51.100.1" -Ipv6Address "2001:0db8:0000:0000:0000:0000:0000:0001" -Name "netAttachName01" .Outputs -Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.NetworkAttachment +Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.NetworkAttachment .Link -https://learn.microsoft.com/powershell/module/Az.NetworkCloud/new-AzNetworkCloudNetworkAttachmentObject +https://learn.microsoft.com/powershell/module/Az.NetworkCloud/new-aznetworkcloudnetworkattachmentobject #> function New-AzNetworkCloudNetworkAttachmentObject { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.NetworkAttachment])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.NetworkAttachment])] [CmdletBinding(PositionalBinding=$false)] param( [Parameter(Mandatory)] @@ -39,18 +39,18 @@ param( ${AttachedNetworkId}, [Parameter(Mandatory)] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineIPAllocationMethod])] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Dynamic", "Static", "Disabled")] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineIPAllocationMethod] + [System.String] # The IP allocation mechanism for the virtual machine. # Dynamic and Static are only valid for l3Network which may also specify Disabled. # Otherwise, Disabled is the only permitted value. ${IPAllocationMethod}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.DefaultGateway])] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("True", "False")] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.DefaultGateway] + [System.String] # The indicator of whether this is the default gateway. # Only one of the attached networks (including the CloudServicesNetwork attachment) for a single machine may be specified as True. ${DefaultGateway}, @@ -98,6 +98,9 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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() @@ -126,6 +129,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/NetworkCloud/NetworkCloud.Autorest/exports/New-AzNetworkCloudRackDefinitionObject.ps1 b/generated/NetworkCloud/NetworkCloud.Autorest/exports/New-AzNetworkCloudRackDefinitionObject.ps1 index 3c868c15a09d..91431a5e1414 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/exports/New-AzNetworkCloudRackDefinitionObject.ps1 +++ b/generated/NetworkCloud/NetworkCloud.Autorest/exports/New-AzNetworkCloudRackDefinitionObject.ps1 @@ -29,7 +29,7 @@ $object = New-AzNetworkCloudRackDefinitionObject -NetworkRackId "/subscriptions/ Write-Host ($object | Format-List | Out-String) .Outputs -Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.RackDefinition +Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.RackDefinition .Notes COMPLEX PARAMETER PROPERTIES @@ -52,10 +52,10 @@ STORAGEAPPLIANCECONFIGURATIONDATA : The li SerialNumber : The serial number of the appliance. [StorageApplianceName ]: The user-provided name for the storage appliance that will be created from this specification. .Link -https://learn.microsoft.com/powershell/module/Az.NetworkCloud/new-AzNetworkCloudRackDefinitionObject +https://learn.microsoft.com/powershell/module/Az.NetworkCloud/new-aznetworkcloudrackdefinitionobject #> function New-AzNetworkCloudRackDefinitionObject { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.RackDefinition])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.RackDefinition])] [CmdletBinding(PositionalBinding=$false)] param( [Parameter(Mandatory)] @@ -86,9 +86,8 @@ param( [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineConfigurationData[]] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineConfigurationData[]] # The unordered list of bare metal machine configuration. - # To construct, see NOTES section for BAREMETALMACHINECONFIGURATIONDATA properties and create a hash table. ${BareMetalMachineConfigurationData}, [Parameter()] @@ -99,9 +98,8 @@ param( [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceConfigurationData[]] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceConfigurationData[]] # The list of storage appliance configuration data for this rack. - # To construct, see NOTES section for STORAGEAPPLIANCECONFIGURATIONDATA properties and create a hash table. ${StorageApplianceConfigurationData} ) @@ -112,6 +110,9 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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() @@ -140,6 +141,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/NetworkCloud/NetworkCloud.Autorest/exports/New-AzNetworkCloudServiceLoadBalancerBgpPeerObject.ps1 b/generated/NetworkCloud/NetworkCloud.Autorest/exports/New-AzNetworkCloudServiceLoadBalancerBgpPeerObject.ps1 index 5c04f73291dc..a5d5d94572bc 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/exports/New-AzNetworkCloudServiceLoadBalancerBgpPeerObject.ps1 +++ b/generated/NetworkCloud/NetworkCloud.Autorest/exports/New-AzNetworkCloudServiceLoadBalancerBgpPeerObject.ps1 @@ -23,12 +23,12 @@ Create an in-memory object for ServiceLoadBalancerBgpPeer. New-AzNetworkCloudServiceLoadBalancerBgpPeerObject -Name name -PeerAddress "203.0.113.254" -PeerAsn "64497" -BfdEnabled False -BgpMultiHop False -HoldTime "P300s" -KeepAliveTime "P300s" -MyAsn 64512 -Password REDACTED -PeerPort 1234 .Outputs -Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ServiceLoadBalancerBgpPeer +Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ServiceLoadBalancerBgpPeer .Link -https://learn.microsoft.com/powershell/module/Az.NetworkCloud/new-AzNetworkCloudServiceLoadBalancerBgpPeerObject +https://learn.microsoft.com/powershell/module/Az.NetworkCloud/new-aznetworkcloudserviceloadbalancerbgppeerobject #> function New-AzNetworkCloudServiceLoadBalancerBgpPeerObject { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ServiceLoadBalancerBgpPeer])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ServiceLoadBalancerBgpPeer])] [CmdletBinding(PositionalBinding=$false)] param( [Parameter(Mandatory)] @@ -50,16 +50,16 @@ param( ${PeerAsn}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BfdEnabled])] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("True", "False")] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BfdEnabled] + [System.String] # The indicator of BFD enablement for this BgpPeer. ${BfdEnabled}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BgpMultiHop])] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("True", "False")] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BgpMultiHop] + [System.String] # The indicator to enable multi-hop peering support. ${BgpMultiHop}, @@ -107,6 +107,9 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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() @@ -135,6 +138,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/NetworkCloud/NetworkCloud.Autorest/exports/New-AzNetworkCloudServicesNetwork.ps1 b/generated/NetworkCloud/NetworkCloud.Autorest/exports/New-AzNetworkCloudServicesNetwork.ps1 index d56cafe57be2..fa057920c3ec 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/exports/New-AzNetworkCloudServicesNetwork.ps1 +++ b/generated/NetworkCloud/NetworkCloud.Autorest/exports/New-AzNetworkCloudServicesNetwork.ps1 @@ -16,9 +16,9 @@ <# .Synopsis -Create a new cloud services network or update the properties of the existing cloud services network. +Create a new cloud services network or create the properties of the existing cloud services network. .Description -Create a new cloud services network or update the properties of the existing cloud services network. +Create a new cloud services network or create the properties of the existing cloud services network. .Example $tags = @{ Tag1 = 'tag1' @@ -28,7 +28,7 @@ $endpointEgressList = @{} New-AzNetworkCloudServicesNetwork -CloudServicesNetworkName cloudNetworkServicesName -ResourceGroupName resourceGroupName -ExtendedLocationName "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/customLocationName" -ExtendedLocationType "CustomLocation" -Location eastus -AdditionalEgressEndpoint $endpointEgressList -EnableDefaultEgressEndpoint false -Tag $tags -SubscriptionId subscriptionId .Outputs -Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetwork +Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetwork .Notes COMPLEX PARAMETER PROPERTIES @@ -36,21 +36,22 @@ To create the parameters described below, construct a hash table containing the ADDITIONALEGRESSENDPOINT : The list of egress endpoints. This allows for connection from a Hybrid AKS cluster to the specified endpoint. Category : The descriptive category name of endpoints accessible by the AKS agent node. For example, azure-resource-management, API server, etc. The platform egress endpoints provided by default will use the category 'default'. - Endpoint : The list of endpoint dependencies. + Endpoint >: The list of endpoint dependencies. DomainName : The domain name of the dependency. [Port ]: The port of this endpoint. .Link https://learn.microsoft.com/powershell/module/az.networkcloud/new-aznetworkcloudservicesnetwork #> function New-AzNetworkCloudServicesNetwork { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetwork])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetwork])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] + [Alias('CloudServicesNetworkName')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [System.String] # The name of the cloud services network. - ${CloudServicesNetworkName}, + ${Name}, [Parameter(Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] @@ -82,47 +83,58 @@ param( # Other values will result in error from server as they are not supported. ${IfNoneMatch}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The resource ID of the extended location on which the resource will be created. ${ExtendedLocationName}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The extended location type, for example, CustomLocation. ${ExtendedLocationType}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The geo-location where the resource lives ${Location}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IEgressEndpoint[]] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IEgressEndpoint[]] # The list of egress endpoints. # This allows for connection from a Hybrid AKS cluster to the specified endpoint. - # To construct, see NOTES section for ADDITIONALEGRESSENDPOINT properties and create a hash table. ${AdditionalEgressEndpoint}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CloudServicesNetworkEnableDefaultEgressEndpoints])] + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("True", "False")] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CloudServicesNetworkEnableDefaultEgressEndpoints] + [System.String] # The indicator of whether the platform default endpoints are allowed for the egress traffic. ${EnableDefaultEgressEndpoint}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceTags]))] [System.Collections.Hashtable] # Resource tags. ${Tag}, + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Path of Json file supplied to the Create operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Json string supplied to the Create operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -191,6 +203,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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() @@ -211,10 +232,10 @@ begin { $mapping = @{ CreateExpanded = 'Az.NetworkCloud.private\New-AzNetworkCloudServicesNetwork_CreateExpanded'; + CreateViaJsonFilePath = 'Az.NetworkCloud.private\New-AzNetworkCloudServicesNetwork_CreateViaJsonFilePath'; + CreateViaJsonString = 'Az.NetworkCloud.private\New-AzNetworkCloudServicesNetwork_CreateViaJsonString'; } - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 { @@ -228,6 +249,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/NetworkCloud/NetworkCloud.Autorest/exports/New-AzNetworkCloudStorageApplianceConfigurationDataObject.ps1 b/generated/NetworkCloud/NetworkCloud.Autorest/exports/New-AzNetworkCloudStorageApplianceConfigurationDataObject.ps1 index 608b459bac24..7c87675199f6 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/exports/New-AzNetworkCloudStorageApplianceConfigurationDataObject.ps1 +++ b/generated/NetworkCloud/NetworkCloud.Autorest/exports/New-AzNetworkCloudStorageApplianceConfigurationDataObject.ps1 @@ -25,12 +25,12 @@ $password = ConvertTo-SecureString "********" -AsPlainText -Force New-AzNetworkCloudStorageApplianceConfigurationDataObject -AdminCredentialsPassword $password -AdminCredentialsUsername username -RackSlot 1 -SerialNumber serialNumber -StorageApplianceName storageApplianceName .Outputs -Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.StorageApplianceConfigurationData +Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.StorageApplianceConfigurationData .Link -https://learn.microsoft.com/powershell/module/Az.NetworkCloud/new-AzNetworkCloudStorageApplianceConfigurationDataObject +https://learn.microsoft.com/powershell/module/Az.NetworkCloud/new-aznetworkcloudstorageapplianceconfigurationdataobject #> function New-AzNetworkCloudStorageApplianceConfigurationDataObject { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.StorageApplianceConfigurationData])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.StorageApplianceConfigurationData])] [CmdletBinding(PositionalBinding=$false)] param( [Parameter(Mandatory)] @@ -71,6 +71,9 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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() @@ -99,6 +102,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/NetworkCloud/NetworkCloud.Autorest/exports/New-AzNetworkCloudTrunkedNetwork.ps1 b/generated/NetworkCloud/NetworkCloud.Autorest/exports/New-AzNetworkCloudTrunkedNetwork.ps1 index 4a3e46212436..9ff9eee05c89 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/exports/New-AzNetworkCloudTrunkedNetwork.ps1 +++ b/generated/NetworkCloud/NetworkCloud.Autorest/exports/New-AzNetworkCloudTrunkedNetwork.ps1 @@ -16,19 +16,19 @@ <# .Synopsis -Create a new trunked network or update the properties of the existing trunked network. +Create a new trunked network or create the properties of the existing trunked network. .Description -Create a new trunked network or update the properties of the existing trunked network. +Create a new trunked network or create the properties of the existing trunked network. .Example New-AzNetworkCloudTrunkedNetwork -Name trunkedNetworkName -ResourceGroupName trunkedNetworkRg -SubscriptionId subscriptionId -ExtendedLocationName extendedLocationName -ExtendedLocationType "CustomLocation" -Location location -Vlan vlans -IsolationDomainId isolationDomainId -InterfaceName interfaceName -Tag @{ tag = "tag" } .Outputs -Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetwork +Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetwork .Link https://learn.microsoft.com/powershell/module/az.networkcloud/new-aznetworkcloudtrunkednetwork #> function New-AzNetworkCloudTrunkedNetwork { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetwork])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetwork])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] @@ -68,19 +68,19 @@ param( # Other values will result in error from server as they are not supported. ${IfNoneMatch}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The resource ID of the extended location on which the resource will be created. ${ExtendedLocationName}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The extended location type, for example, CustomLocation. ${ExtendedLocationType}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String[]] @@ -88,42 +88,54 @@ param( # It can be any combination of l2IsolationDomain and l3IsolationDomain resources. ${IsolationDomainId}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The geo-location where the resource lives ${Location}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.Int64[]] # The list of vlans that are selected from the isolation domains for trunking. ${Vlan}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HybridAksPluginType])] + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("DPDK", "SRIOV", "OSDevice")] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HybridAksPluginType] + [System.String] # Field Deprecated. # The field was previously optional, now it will have no defined behavior and will be ignored. # The network plugin type for Hybrid AKS. ${HybridAksPluginType}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The default interface name for this trunked network in the virtual machine. # This name can be overridden by the name supplied in the network attachment configuration of that virtual machine. ${InterfaceName}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceTags]))] [System.Collections.Hashtable] # Resource tags. ${Tag}, + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Path of Json file supplied to the Create operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Json string supplied to the Create operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -192,6 +204,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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() @@ -212,10 +233,10 @@ begin { $mapping = @{ CreateExpanded = 'Az.NetworkCloud.private\New-AzNetworkCloudTrunkedNetwork_CreateExpanded'; + CreateViaJsonFilePath = 'Az.NetworkCloud.private\New-AzNetworkCloudTrunkedNetwork_CreateViaJsonFilePath'; + CreateViaJsonString = 'Az.NetworkCloud.private\New-AzNetworkCloudTrunkedNetwork_CreateViaJsonString'; } - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 { @@ -229,6 +250,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/NetworkCloud/NetworkCloud.Autorest/exports/New-AzNetworkCloudVirtualMachine.ps1 b/generated/NetworkCloud/NetworkCloud.Autorest/exports/New-AzNetworkCloudVirtualMachine.ps1 index 410eff74a533..760e8dc927f7 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/exports/New-AzNetworkCloudVirtualMachine.ps1 +++ b/generated/NetworkCloud/NetworkCloud.Autorest/exports/New-AzNetworkCloudVirtualMachine.ps1 @@ -16,9 +16,9 @@ <# .Synopsis -Create a new virtual machine or update the properties of the existing virtual machine. +Create a new virtual machine or create the properties of the existing virtual machine. .Description -Create a new virtual machine or update the properties of the existing virtual machine. +Create a new virtual machine or create the properties of the existing virtual machine. .Example $networkAttachment = @{ AttachedNetworkId = "attachedNetworkID" @@ -39,7 +39,7 @@ $securePassword = ConvertTo-SecureString "password" -asplaintext -force New-AzNetworkCloudVirtualMachine -Name vmName -ResourceGroupName resourceGroup -AdminUsername adminUsername -CloudServiceNetworkAttachmentAttachedNetworkId csnAttachedNetworkId -CloudServiceNetworkAttachmentIPAllocationMethod ipAllocationMethod -CpuCore cpuCore -ExtendedLocationName extendedLocationName -ExtendedLocationType "Custom" -Location location -SubscriptionId subscriptionId -MemorySizeGb memorySizeGb -OSDiskSizeGb osDiskSizeGb -VMImage vmImage -BootMethod bootMethod -CloudServiceNetworkAttachmentDefaultGateway defaultGateway -CloudServiceNetworkAttachmentName csnAttachmentName -IsolateEmulatorThread isolateEmulatorThread -NetworkAttachment $networkAttachment -NetworkData networkData -OSDiskCreateOption osDiskCreationOption -OSDiskDeleteOption osDiskDeleteOption -PlacementHint $hint -SshPublicKey $sshPublicKey -Tag @{tags = "tags"} -UserData userData -VirtioInterface virtioInterface -VMDeviceModel vmDeviceModel -VMImageRepositoryCredentialsUsername registryUsername -VMImageRepositoryCredentialsPassword $securePassword -VMImageRepositoryCredentialsRegistryUrl registryUrl .Outputs -Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachine +Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachine .Notes COMPLEX PARAMETER PROPERTIES @@ -47,17 +47,17 @@ To create the parameters described below, construct a hash table containing the NETWORKATTACHMENT : The list of network attachments to the virtual machine. AttachedNetworkId : The resource ID of the associated network attached to the virtual machine. It can be one of cloudServicesNetwork, l3Network, l2Network or trunkedNetwork resources. - IPAllocationMethod : The IP allocation mechanism for the virtual machine. Dynamic and Static are only valid for l3Network which may also specify Disabled. Otherwise, Disabled is the only permitted value. - [DefaultGateway ]: The indicator of whether this is the default gateway. Only one of the attached networks (including the CloudServicesNetwork attachment) for a single machine may be specified as True. + IPAllocationMethod : The IP allocation mechanism for the virtual machine. Dynamic and Static are only valid for l3Network which may also specify Disabled. Otherwise, Disabled is the only permitted value. + [DefaultGateway ]: The indicator of whether this is the default gateway. Only one of the attached networks (including the CloudServicesNetwork attachment) for a single machine may be specified as True. [Ipv4Address ]: The IPv4 address of the virtual machine. This field is used only if the attached network has IPAllocationType of IPV4 or DualStack. If IPAllocationMethod is: Static - this field must contain a user specified IPv4 address from within the subnet specified in the attached network. Dynamic - this field is read-only, but will be populated with an address from within the subnet specified in the attached network. Disabled - this field will be empty. [Ipv6Address ]: The IPv6 address of the virtual machine. This field is used only if the attached network has IPAllocationType of IPV6 or DualStack. If IPAllocationMethod is: Static - this field must contain an IPv6 address range from within the range specified in the attached network. Dynamic - this field is read-only, but will be populated with an range from within the subnet specified in the attached network. Disabled - this field will be empty. [Name ]: The associated network's interface name. If specified, the network attachment name has a maximum length of 15 characters and must be unique to this virtual machine. If the user doesn’t specify this value, the default interface name of the network resource will be used. For a CloudServicesNetwork resource, this name will be ignored. PLACEMENTHINT : The scheduling hints for the virtual machine. - HintType : The specification of whether this hint supports affinity or anti-affinity with the referenced resources. + HintType : The specification of whether this hint supports affinity or anti-affinity with the referenced resources. ResourceId : The resource ID of the target object that the placement hints will be checked against, e.g., the bare metal node to host the virtual machine. - SchedulingExecution : The indicator of whether the hint is a hard or soft requirement during scheduling. - Scope : The scope for the virtual machine affinity or anti-affinity placement hint. It should always be "Machine" in the case of node affinity. + SchedulingExecution : The indicator of whether the hint is a hard or soft requirement during scheduling. + Scope : The scope for the virtual machine affinity or anti-affinity placement hint. It should always be "Machine" in the case of node affinity. SSHPUBLICKEY : The list of ssh public keys. Each key will be added to the virtual machine using the cloud-init ssh_authorized_keys mechanism for the adminUsername. KeyData : The SSH public key data. @@ -65,7 +65,7 @@ SSHPUBLICKEY : The list of ssh public keys. Each key will be ad https://learn.microsoft.com/powershell/module/az.networkcloud/new-aznetworkcloudvirtualmachine #> function New-AzNetworkCloudVirtualMachine { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachine])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachine])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] @@ -105,57 +105,57 @@ param( # Other values will result in error from server as they are not supported. ${IfNoneMatch}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The name of the administrator to which the ssh public keys will be added into the authorized keys. ${AdminUsername}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The resource ID of the associated network attached to the virtual machine.It can be one of cloudServicesNetwork, l3Network, l2Network or trunkedNetwork resources. ${CloudServiceNetworkAttachmentAttachedNetworkId}, - [Parameter(Mandatory)] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineIPAllocationMethod])] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Dynamic", "Static", "Disabled")] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineIPAllocationMethod] + [System.String] # The IP allocation mechanism for the virtual machine.Dynamic and Static are only valid for l3Network which may also specify Disabled.Otherwise, Disabled is the only permitted value. ${CloudServiceNetworkAttachmentIPAllocationMethod}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.Int64] # The number of CPU cores in the virtual machine. ${CpuCore}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The resource ID of the extended location on which the resource will be created. ${ExtendedLocationName}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The extended location type, for example, CustomLocation. ${ExtendedLocationType}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The geo-location where the resource lives ${Location}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.Int64] # The memory size of the virtual machine. # Allocations are measured in gibibytes. ${MemorySizeGb}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.Int64] # The size of the disk. @@ -163,162 +163,171 @@ param( # Allocations are measured in gibibytes. ${OSDiskSizeGb}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The virtual machine image that is currently provisioned to the OS disk, using the full url and tag notation used to pull the image. ${VMImage}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineBootMethod])] + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("UEFI", "BIOS")] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineBootMethod] + [System.String] # Selects the boot method for the virtual machine. ${BootMethod}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.DefaultGateway])] + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("True", "False")] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.DefaultGateway] + [System.String] # The indicator of whether this is the default gateway.Only one of the attached networks (including the CloudServicesNetwork attachment) for a single machine may be specified as True. ${CloudServiceNetworkAttachmentDefaultGateway}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The IPv4 address of the virtual machine.This field is used only if the attached network has IPAllocationType of IPV4 or DualStack.If IPAllocationMethod is:Static - this field must contain a user specified IPv4 address from within the subnet specified in the attached network.Dynamic - this field is read-only, but will be populated with an address from within the subnet specified in the attached network.Disabled - this field will be empty. ${CloudServiceNetworkAttachmentIpv4Address}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The IPv6 address of the virtual machine.This field is used only if the attached network has IPAllocationType of IPV6 or DualStack.If IPAllocationMethod is:Static - this field must contain an IPv6 address range from within the range specified in the attached network.Dynamic - this field is read-only, but will be populated with an range from within the subnet specified in the attached network.Disabled - this field will be empty. ${CloudServiceNetworkAttachmentIpv6Address}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The associated network's interface name.If specified, the network attachment name has a maximum length of 15 characters and must be unique to this virtual machine.If the user doesn’t specify this value, the default interface name of the network resource will be used.For a CloudServicesNetwork resource, this name will be ignored. ${CloudServiceNetworkAttachmentName}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The resource ID of the extended location on which the resource will be created. ${ConsoleExtendedLocationName}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The extended location type, for example, CustomLocation. ${ConsoleExtendedLocationType}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineIsolateEmulatorThread])] + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("True", "False")] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineIsolateEmulatorThread] + [System.String] # Field Deprecated, the value will be ignored if provided. # The indicator of whether one of the specified CPU cores is isolated to run the emulator thread for this virtual machine. ${IsolateEmulatorThread}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkAttachment[]] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkAttachment[]] # The list of network attachments to the virtual machine. - # To construct, see NOTES section for NETWORKATTACHMENT properties and create a hash table. ${NetworkAttachment}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The Base64 encoded cloud-init network data. ${NetworkData}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.OSDiskCreateOption])] + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Ephemeral", "Persistent")] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.OSDiskCreateOption] + [System.String] # The strategy for creating the OS disk. ${OSDiskCreateOption}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.OSDiskDeleteOption])] + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Delete")] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.OSDiskDeleteOption] + [System.String] # The strategy for deleting the OS disk. ${OSDiskDeleteOption}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePlacementHint[]] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePlacementHint[]] # The scheduling hints for the virtual machine. - # To construct, see NOTES section for PLACEMENTHINT properties and create a hash table. ${PlacementHint}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey[]] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISshPublicKey[]] # The list of ssh public keys. # Each key will be added to the virtual machine using the cloud-init ssh_authorized_keys mechanism for the adminUsername. - # To construct, see NOTES section for SSHPUBLICKEY properties and create a hash table. ${SshPublicKey}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String[]] # The resource IDs of volumes that are requested to be attached to the virtual machine. ${StorageProfileVolumeAttachment}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceTags]))] [System.Collections.Hashtable] # Resource tags. ${Tag}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The Base64 encoded cloud-init user data. ${UserData}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineDeviceModelType])] + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("T1", "T2", "T3")] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineDeviceModelType] + [System.String] # The type of the device model to use. ${VMDeviceModel}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.Security.SecureString] # The password or token used to access an image in the target repository. ${VMImageRepositoryCredentialsPassword}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The URL of the authentication server used to validate the repository credentials. ${VMImageRepositoryCredentialsRegistryUrl}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The username used to access an image in the target repository. ${VMImageRepositoryCredentialsUsername}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineVirtioInterfaceType])] + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Modern", "Transitional")] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineVirtioInterfaceType] + [System.String] # Field Deprecated, use virtualizationModel instead. # The type of the virtio interface. ${VirtioInterface}, + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Path of Json file supplied to the Create operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Json string supplied to the Create operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -387,6 +396,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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() @@ -407,10 +425,10 @@ begin { $mapping = @{ CreateExpanded = 'Az.NetworkCloud.private\New-AzNetworkCloudVirtualMachine_CreateExpanded'; + CreateViaJsonFilePath = 'Az.NetworkCloud.private\New-AzNetworkCloudVirtualMachine_CreateViaJsonFilePath'; + CreateViaJsonString = 'Az.NetworkCloud.private\New-AzNetworkCloudVirtualMachine_CreateViaJsonString'; } - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 { @@ -424,6 +442,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/NetworkCloud/NetworkCloud.Autorest/exports/New-AzNetworkCloudVirtualMachinePlacementHintObject.ps1 b/generated/NetworkCloud/NetworkCloud.Autorest/exports/New-AzNetworkCloudVirtualMachinePlacementHintObject.ps1 index b5bfda36c0d1..d1abc29355b3 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/exports/New-AzNetworkCloudVirtualMachinePlacementHintObject.ps1 +++ b/generated/NetworkCloud/NetworkCloud.Autorest/exports/New-AzNetworkCloudVirtualMachinePlacementHintObject.ps1 @@ -23,18 +23,18 @@ Create an in-memory object for VirtualMachinePlacementHint. New-AzNetworkCloudVirtualMachinePlacementHintObject -HintType "Affinity" -ResourceId "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/racks/rackName" -SchedulingExecution "Hard" -Scope "Machine" .Outputs -Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.VirtualMachinePlacementHint +Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.VirtualMachinePlacementHint .Link -https://learn.microsoft.com/powershell/module/Az.NetworkCloud/new-AzNetworkCloudVirtualMachinePlacementHintObject +https://learn.microsoft.com/powershell/module/Az.NetworkCloud/new-aznetworkcloudvirtualmachineplacementhintobject #> function New-AzNetworkCloudVirtualMachinePlacementHintObject { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.VirtualMachinePlacementHint])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.VirtualMachinePlacementHint])] [CmdletBinding(PositionalBinding=$false)] param( [Parameter(Mandatory)] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachinePlacementHintType])] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Affinity", "AntiAffinity")] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachinePlacementHintType] + [System.String] # The specification of whether this hint supports affinity or anti-affinity with the referenced resources. ${HintType}, @@ -45,16 +45,16 @@ param( ${ResourceId}, [Parameter(Mandatory)] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineSchedulingExecution])] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Hard", "Soft")] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineSchedulingExecution] + [System.String] # The indicator of whether the hint is a hard or soft requirement during scheduling. ${SchedulingExecution}, [Parameter(Mandatory)] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachinePlacementHintPodAffinityScope])] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Rack", "Machine")] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachinePlacementHintPodAffinityScope] + [System.String] # The scope for the virtual machine affinity or anti-affinity placement hint. # It should always be "Machine" in the case of node affinity. ${Scope} @@ -67,6 +67,9 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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() @@ -95,6 +98,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/NetworkCloud/NetworkCloud.Autorest/exports/New-AzNetworkCloudVolume.ps1 b/generated/NetworkCloud/NetworkCloud.Autorest/exports/New-AzNetworkCloudVolume.ps1 index f005cb43fefd..a092abcf500f 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/exports/New-AzNetworkCloudVolume.ps1 +++ b/generated/NetworkCloud/NetworkCloud.Autorest/exports/New-AzNetworkCloudVolume.ps1 @@ -16,19 +16,19 @@ <# .Synopsis -Create a new volume or update the properties of the existing one. +Create a new volume or create the properties of the existing one. .Description -Create a new volume or update the properties of the existing one. +Create a new volume or create the properties of the existing one. .Example New-AzNetworkCloudVolume -Name volumeName -ResourceGroupName resourceGroupName -ExtendedLocationName extendedLocation -ExtendedLocationType "CustomLocation " -Location location -SizeMiB size -Tag @{ tag = "newTag" } .Outputs -Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolume +Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolume .Link https://learn.microsoft.com/powershell/module/az.networkcloud/new-aznetworkcloudvolume #> function New-AzNetworkCloudVolume { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolume])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolume])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] @@ -68,37 +68,49 @@ param( # Other values will result in error from server as they are not supported. ${IfNoneMatch}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The resource ID of the extended location on which the resource will be created. ${ExtendedLocationName}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The extended location type, for example, CustomLocation. ${ExtendedLocationType}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The geo-location where the resource lives ${Location}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.Int64] # The size of the allocation for this volume in Mebibytes. ${SizeMiB}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceTags]))] [System.Collections.Hashtable] # Resource tags. ${Tag}, + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Path of Json file supplied to the Create operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Json string supplied to the Create operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -167,6 +179,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,10 +208,10 @@ begin { $mapping = @{ CreateExpanded = 'Az.NetworkCloud.private\New-AzNetworkCloudVolume_CreateExpanded'; + CreateViaJsonFilePath = 'Az.NetworkCloud.private\New-AzNetworkCloudVolume_CreateViaJsonFilePath'; + CreateViaJsonString = 'Az.NetworkCloud.private\New-AzNetworkCloudVolume_CreateViaJsonString'; } - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 { @@ -204,6 +225,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/NetworkCloud/NetworkCloud.Autorest/exports/ProxyCmdletDefinitions.ps1 b/generated/NetworkCloud/NetworkCloud.Autorest/exports/ProxyCmdletDefinitions.ps1 index 0d3c0aa0e31b..3cfd1bde7088 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/exports/ProxyCmdletDefinitions.ps1 +++ b/generated/NetworkCloud/NetworkCloud.Autorest/exports/ProxyCmdletDefinitions.ps1 @@ -62,6 +62,8 @@ function Deploy-AzNetworkCloudCluster { [CmdletBinding(DefaultParameterSetName='DeployExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='DeployExpanded', Mandatory)] + [Parameter(ParameterSetName='DeployViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='DeployViaJsonString', Mandatory)] [Alias('ClusterName')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [System.String] @@ -69,6 +71,8 @@ param( ${Name}, [Parameter(ParameterSetName='DeployExpanded', Mandatory)] + [Parameter(ParameterSetName='DeployViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='DeployViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [System.String] # The name of the resource group. @@ -76,6 +80,8 @@ param( ${ResourceGroupName}, [Parameter(ParameterSetName='DeployExpanded')] + [Parameter(ParameterSetName='DeployViaJsonFilePath')] + [Parameter(ParameterSetName='DeployViaJsonString')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] @@ -87,16 +93,28 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, - [Parameter()] + [Parameter(ParameterSetName='DeployExpanded')] + [Parameter(ParameterSetName='DeployViaIdentityExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String[]] # The names of bare metal machines in the cluster that should be skipped during environment validation. ${SkipValidationsForMachine}, + [Parameter(ParameterSetName='DeployViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Path of Json file supplied to the Deploy operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='DeployViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Json string supplied to the Deploy operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -171,6 +189,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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() @@ -192,10 +219,10 @@ begin { $mapping = @{ DeployExpanded = 'Az.NetworkCloud.private\Deploy-AzNetworkCloudCluster_DeployExpanded'; DeployViaIdentityExpanded = 'Az.NetworkCloud.private\Deploy-AzNetworkCloudCluster_DeployViaIdentityExpanded'; + DeployViaJsonFilePath = 'Az.NetworkCloud.private\Deploy-AzNetworkCloudCluster_DeployViaJsonFilePath'; + DeployViaJsonString = 'Az.NetworkCloud.private\Deploy-AzNetworkCloudCluster_DeployViaJsonString'; } - if (('DeployExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('DeployExpanded', 'DeployViaJsonFilePath', 'DeployViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -209,6 +236,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) @@ -324,7 +354,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -401,6 +430,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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() @@ -423,9 +461,7 @@ begin { Disable = 'Az.NetworkCloud.private\Disable-AzNetworkCloudStorageApplianceRemoteVendorManagement_Disable'; DisableViaIdentity = 'Az.NetworkCloud.private\Disable-AzNetworkCloudStorageApplianceRemoteVendorManagement_DisableViaIdentity'; } - if (('Disable') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Disable') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -439,6 +475,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) @@ -530,6 +569,8 @@ function Enable-AzNetworkCloudStorageApplianceRemoteVendorManagement { [CmdletBinding(DefaultParameterSetName='EnableExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='EnableExpanded', Mandatory)] + [Parameter(ParameterSetName='EnableViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='EnableViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [System.String] # The name of the resource group. @@ -537,12 +578,16 @@ param( ${ResourceGroupName}, [Parameter(ParameterSetName='EnableExpanded', Mandatory)] + [Parameter(ParameterSetName='EnableViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='EnableViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [System.String] # The name of the storage appliance. ${StorageApplianceName}, [Parameter(ParameterSetName='EnableExpanded')] + [Parameter(ParameterSetName='EnableViaJsonFilePath')] + [Parameter(ParameterSetName='EnableViaJsonString')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] @@ -554,10 +599,10 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, - [Parameter()] + [Parameter(ParameterSetName='EnableExpanded')] + [Parameter(ParameterSetName='EnableViaIdentityExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String[]] @@ -566,6 +611,18 @@ param( # The list of IPv4 subnets (in CIDR format), IPv6 subnets (in CIDR format), or hostnames that the storage appliance needs accessible in order to turn on the remote vendor management. ${SupportEndpoint}, + [Parameter(ParameterSetName='EnableViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Path of Json file supplied to the Enable operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='EnableViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Json string supplied to the Enable operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -640,6 +697,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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() @@ -661,10 +727,10 @@ begin { $mapping = @{ EnableExpanded = 'Az.NetworkCloud.private\Enable-AzNetworkCloudStorageApplianceRemoteVendorManagement_EnableExpanded'; EnableViaIdentityExpanded = 'Az.NetworkCloud.private\Enable-AzNetworkCloudStorageApplianceRemoteVendorManagement_EnableViaIdentityExpanded'; + EnableViaJsonFilePath = 'Az.NetworkCloud.private\Enable-AzNetworkCloudStorageApplianceRemoteVendorManagement_EnableViaJsonFilePath'; + EnableViaJsonString = 'Az.NetworkCloud.private\Enable-AzNetworkCloudStorageApplianceRemoteVendorManagement_EnableViaJsonString'; } - if (('EnableExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('EnableExpanded', 'EnableViaJsonFilePath', 'EnableViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -678,6 +744,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) @@ -734,7 +803,7 @@ Get-AzNetworkCloudAgentPool -Name agentPoolName -KubernetesClusterName clusterNa .Inputs Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPool +Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPool .Notes COMPLEX PARAMETER PROPERTIES @@ -763,11 +832,35 @@ INPUTOBJECT : Identity Parameter [TrunkedNetworkName ]: The name of the trunked network. [VirtualMachineName ]: The name of the virtual machine. [VolumeName ]: The name of the volume. + +KUBERNETESCLUSTERINPUTOBJECT : Identity Parameter + [AgentPoolName ]: The name of the Kubernetes cluster agent pool. + [BareMetalMachineKeySetName ]: The name of the bare metal machine key set. + [BareMetalMachineName ]: The name of the bare metal machine. + [BmcKeySetName ]: The name of the baseboard management controller key set. + [CloudServicesNetworkName ]: The name of the cloud services network. + [ClusterManagerName ]: The name of the cluster manager. + [ClusterName ]: The name of the cluster. + [ConsoleName ]: The name of the virtual machine console. + [FeatureName ]: The name of the feature. + [Id ]: Resource identity path + [KubernetesClusterName ]: The name of the Kubernetes cluster. + [L2NetworkName ]: The name of the L2 network. + [L3NetworkName ]: The name of the L3 network. + [MetricsConfigurationName ]: The name of the metrics configuration for the cluster. + [RackName ]: The name of the rack. + [RackSkuName ]: The name of the rack SKU. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [StorageApplianceName ]: The name of the storage appliance. + [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. + [TrunkedNetworkName ]: The name of the trunked network. + [VirtualMachineName ]: The name of the virtual machine. + [VolumeName ]: The name of the volume. .Link https://learn.microsoft.com/powershell/module/az.networkcloud/get-aznetworkcloudagentpool #> function Get-AzNetworkCloudAgentPool { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPool])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPool])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] @@ -778,6 +871,7 @@ param( ${KubernetesClusterName}, [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='GetViaIdentityKubernetesCluster', Mandatory)] [Alias('AgentPoolName')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [System.String] @@ -805,9 +899,14 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, + [Parameter(ParameterSetName='GetViaIdentityKubernetesCluster', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] + # Identity Parameter + ${KubernetesClusterInputObject}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -864,6 +963,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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() @@ -885,11 +993,10 @@ begin { $mapping = @{ Get = 'Az.NetworkCloud.private\Get-AzNetworkCloudAgentPool_Get'; GetViaIdentity = 'Az.NetworkCloud.private\Get-AzNetworkCloudAgentPool_GetViaIdentity'; + GetViaIdentityKubernetesCluster = 'Az.NetworkCloud.private\Get-AzNetworkCloudAgentPool_GetViaIdentityKubernetesCluster'; List = 'Az.NetworkCloud.private\Get-AzNetworkCloudAgentPool_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.NetworkCloud.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 { @@ -903,6 +1010,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) @@ -959,12 +1069,36 @@ Get-AzNetworkCloudBareMetalMachineKeySet -ClusterName clusterName -ResourceGroup .Inputs Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySet +Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySet .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. +CLUSTERINPUTOBJECT : Identity Parameter + [AgentPoolName ]: The name of the Kubernetes cluster agent pool. + [BareMetalMachineKeySetName ]: The name of the bare metal machine key set. + [BareMetalMachineName ]: The name of the bare metal machine. + [BmcKeySetName ]: The name of the baseboard management controller key set. + [CloudServicesNetworkName ]: The name of the cloud services network. + [ClusterManagerName ]: The name of the cluster manager. + [ClusterName ]: The name of the cluster. + [ConsoleName ]: The name of the virtual machine console. + [FeatureName ]: The name of the feature. + [Id ]: Resource identity path + [KubernetesClusterName ]: The name of the Kubernetes cluster. + [L2NetworkName ]: The name of the L2 network. + [L3NetworkName ]: The name of the L3 network. + [MetricsConfigurationName ]: The name of the metrics configuration for the cluster. + [RackName ]: The name of the rack. + [RackSkuName ]: The name of the rack SKU. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [StorageApplianceName ]: The name of the storage appliance. + [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. + [TrunkedNetworkName ]: The name of the trunked network. + [VirtualMachineName ]: The name of the virtual machine. + [VolumeName ]: The name of the volume. + INPUTOBJECT : Identity Parameter [AgentPoolName ]: The name of the Kubernetes cluster agent pool. [BareMetalMachineKeySetName ]: The name of the bare metal machine key set. @@ -992,7 +1126,7 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.networkcloud/get-aznetworkcloudbaremetalmachinekeyset #> function Get-AzNetworkCloudBareMetalMachineKeySet { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySet])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySet])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] @@ -1003,6 +1137,7 @@ param( ${ClusterName}, [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='GetViaIdentityCluster', Mandatory)] [Alias('BareMetalMachineKeySetName')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [System.String] @@ -1030,9 +1165,14 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, + [Parameter(ParameterSetName='GetViaIdentityCluster', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] + # Identity Parameter + ${ClusterInputObject}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -1089,6 +1229,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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() @@ -1110,11 +1259,10 @@ begin { $mapping = @{ Get = 'Az.NetworkCloud.private\Get-AzNetworkCloudBareMetalMachineKeySet_Get'; GetViaIdentity = 'Az.NetworkCloud.private\Get-AzNetworkCloudBareMetalMachineKeySet_GetViaIdentity'; + GetViaIdentityCluster = 'Az.NetworkCloud.private\Get-AzNetworkCloudBareMetalMachineKeySet_GetViaIdentityCluster'; List = 'Az.NetworkCloud.private\Get-AzNetworkCloudBareMetalMachineKeySet_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.NetworkCloud.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 { @@ -1128,6 +1276,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) @@ -1186,7 +1337,7 @@ Get-AzNetworkCloudBareMetalMachine -ResourceGroupName resourceGroupName -Subscri .Inputs Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachine +Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachine .Notes COMPLEX PARAMETER PROPERTIES @@ -1219,7 +1370,7 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.networkcloud/get-aznetworkcloudbaremetalmachine #> function Get-AzNetworkCloudBareMetalMachine { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachine])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachine])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] @@ -1251,7 +1402,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -1310,6 +1460,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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() @@ -1334,9 +1493,7 @@ begin { List = 'Az.NetworkCloud.private\Get-AzNetworkCloudBareMetalMachine_List'; List1 = 'Az.NetworkCloud.private\Get-AzNetworkCloudBareMetalMachine_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.NetworkCloud.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 { @@ -1350,6 +1507,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) @@ -1406,12 +1566,36 @@ Get-AzNetworkCloudBmcKeySet -ClusterName clusterName -ResourceGroupName resource .Inputs Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySet +Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySet .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. +CLUSTERINPUTOBJECT : Identity Parameter + [AgentPoolName ]: The name of the Kubernetes cluster agent pool. + [BareMetalMachineKeySetName ]: The name of the bare metal machine key set. + [BareMetalMachineName ]: The name of the bare metal machine. + [BmcKeySetName ]: The name of the baseboard management controller key set. + [CloudServicesNetworkName ]: The name of the cloud services network. + [ClusterManagerName ]: The name of the cluster manager. + [ClusterName ]: The name of the cluster. + [ConsoleName ]: The name of the virtual machine console. + [FeatureName ]: The name of the feature. + [Id ]: Resource identity path + [KubernetesClusterName ]: The name of the Kubernetes cluster. + [L2NetworkName ]: The name of the L2 network. + [L3NetworkName ]: The name of the L3 network. + [MetricsConfigurationName ]: The name of the metrics configuration for the cluster. + [RackName ]: The name of the rack. + [RackSkuName ]: The name of the rack SKU. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [StorageApplianceName ]: The name of the storage appliance. + [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. + [TrunkedNetworkName ]: The name of the trunked network. + [VirtualMachineName ]: The name of the virtual machine. + [VolumeName ]: The name of the volume. + INPUTOBJECT : Identity Parameter [AgentPoolName ]: The name of the Kubernetes cluster agent pool. [BareMetalMachineKeySetName ]: The name of the bare metal machine key set. @@ -1439,7 +1623,7 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.networkcloud/get-aznetworkcloudbmckeyset #> function Get-AzNetworkCloudBmcKeySet { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySet])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySet])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] @@ -1450,6 +1634,7 @@ param( ${ClusterName}, [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='GetViaIdentityCluster', Mandatory)] [Alias('BmcKeySetName')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [System.String] @@ -1477,9 +1662,14 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, + [Parameter(ParameterSetName='GetViaIdentityCluster', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] + # Identity Parameter + ${ClusterInputObject}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -1536,6 +1726,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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() @@ -1557,11 +1756,10 @@ begin { $mapping = @{ Get = 'Az.NetworkCloud.private\Get-AzNetworkCloudBmcKeySet_Get'; GetViaIdentity = 'Az.NetworkCloud.private\Get-AzNetworkCloudBmcKeySet_GetViaIdentity'; + GetViaIdentityCluster = 'Az.NetworkCloud.private\Get-AzNetworkCloudBmcKeySet_GetViaIdentityCluster'; List = 'Az.NetworkCloud.private\Get-AzNetworkCloudBmcKeySet_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.NetworkCloud.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 { @@ -1575,6 +1773,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) @@ -1633,7 +1834,7 @@ Get-AzNetworkCloudClusterManager -ResourceGroupName resourceGroup -SubscriptionI .Inputs Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManager +Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManager .Notes COMPLEX PARAMETER PROPERTIES @@ -1666,7 +1867,7 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.networkcloud/get-aznetworkcloudclustermanager #> function Get-AzNetworkCloudClusterManager { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManager])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManager])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] @@ -1698,7 +1899,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -1757,6 +1957,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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() @@ -1781,9 +1990,7 @@ begin { List = 'Az.NetworkCloud.private\Get-AzNetworkCloudClusterManager_List'; List1 = 'Az.NetworkCloud.private\Get-AzNetworkCloudClusterManager_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.NetworkCloud.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 { @@ -1797,6 +2004,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) @@ -1855,7 +2065,7 @@ Get-AzNetworkCloudCluster -ResourceGroupName resourceGroup -SubscriptionId subsc .Inputs Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICluster +Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICluster .Notes COMPLEX PARAMETER PROPERTIES @@ -1888,7 +2098,7 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.networkcloud/get-aznetworkcloudcluster #> function Get-AzNetworkCloudCluster { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICluster])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICluster])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] @@ -1920,7 +2130,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -1979,6 +2188,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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() @@ -2003,9 +2221,7 @@ begin { List = 'Az.NetworkCloud.private\Get-AzNetworkCloudCluster_List'; List1 = 'Az.NetworkCloud.private\Get-AzNetworkCloudCluster_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.NetworkCloud.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 { @@ -2019,6 +2235,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) @@ -2075,7 +2294,7 @@ Get-AzNetworkCloudConsole -Name consoleName -SubscriptionId subscriptionId -Reso .Inputs Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsole +Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsole .Notes COMPLEX PARAMETER PROPERTIES @@ -2104,14 +2323,39 @@ INPUTOBJECT : Identity Parameter [TrunkedNetworkName ]: The name of the trunked network. [VirtualMachineName ]: The name of the virtual machine. [VolumeName ]: The name of the volume. + +VIRTUALMACHINEINPUTOBJECT : Identity Parameter + [AgentPoolName ]: The name of the Kubernetes cluster agent pool. + [BareMetalMachineKeySetName ]: The name of the bare metal machine key set. + [BareMetalMachineName ]: The name of the bare metal machine. + [BmcKeySetName ]: The name of the baseboard management controller key set. + [CloudServicesNetworkName ]: The name of the cloud services network. + [ClusterManagerName ]: The name of the cluster manager. + [ClusterName ]: The name of the cluster. + [ConsoleName ]: The name of the virtual machine console. + [FeatureName ]: The name of the feature. + [Id ]: Resource identity path + [KubernetesClusterName ]: The name of the Kubernetes cluster. + [L2NetworkName ]: The name of the L2 network. + [L3NetworkName ]: The name of the L3 network. + [MetricsConfigurationName ]: The name of the metrics configuration for the cluster. + [RackName ]: The name of the rack. + [RackSkuName ]: The name of the rack SKU. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [StorageApplianceName ]: The name of the storage appliance. + [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. + [TrunkedNetworkName ]: The name of the trunked network. + [VirtualMachineName ]: The name of the virtual machine. + [VolumeName ]: The name of the volume. .Link https://learn.microsoft.com/powershell/module/az.networkcloud/get-aznetworkcloudconsole #> function Get-AzNetworkCloudConsole { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsole])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsole])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='GetViaIdentityVirtualMachine', Mandatory)] [Alias('ConsoleName')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [System.String] @@ -2146,9 +2390,14 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, + [Parameter(ParameterSetName='GetViaIdentityVirtualMachine', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] + # Identity Parameter + ${VirtualMachineInputObject}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -2205,6 +2454,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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() @@ -2226,11 +2484,10 @@ begin { $mapping = @{ Get = 'Az.NetworkCloud.private\Get-AzNetworkCloudConsole_Get'; GetViaIdentity = 'Az.NetworkCloud.private\Get-AzNetworkCloudConsole_GetViaIdentity'; + GetViaIdentityVirtualMachine = 'Az.NetworkCloud.private\Get-AzNetworkCloudConsole_GetViaIdentityVirtualMachine'; List = 'Az.NetworkCloud.private\Get-AzNetworkCloudConsole_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.NetworkCloud.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 { @@ -2244,6 +2501,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) @@ -2300,7 +2560,7 @@ Get-AzNetworkCloudKubernetesClusterFeature -KubernetesClusterName kubernetesClus .Inputs Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeature +Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeature .Notes COMPLEX PARAMETER PROPERTIES @@ -2329,14 +2589,39 @@ INPUTOBJECT : Identity Parameter [TrunkedNetworkName ]: The name of the trunked network. [VirtualMachineName ]: The name of the virtual machine. [VolumeName ]: The name of the volume. + +KUBERNETESCLUSTERINPUTOBJECT : Identity Parameter + [AgentPoolName ]: The name of the Kubernetes cluster agent pool. + [BareMetalMachineKeySetName ]: The name of the bare metal machine key set. + [BareMetalMachineName ]: The name of the bare metal machine. + [BmcKeySetName ]: The name of the baseboard management controller key set. + [CloudServicesNetworkName ]: The name of the cloud services network. + [ClusterManagerName ]: The name of the cluster manager. + [ClusterName ]: The name of the cluster. + [ConsoleName ]: The name of the virtual machine console. + [FeatureName ]: The name of the feature. + [Id ]: Resource identity path + [KubernetesClusterName ]: The name of the Kubernetes cluster. + [L2NetworkName ]: The name of the L2 network. + [L3NetworkName ]: The name of the L3 network. + [MetricsConfigurationName ]: The name of the metrics configuration for the cluster. + [RackName ]: The name of the rack. + [RackSkuName ]: The name of the rack SKU. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [StorageApplianceName ]: The name of the storage appliance. + [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. + [TrunkedNetworkName ]: The name of the trunked network. + [VirtualMachineName ]: The name of the virtual machine. + [VolumeName ]: The name of the volume. .Link https://learn.microsoft.com/powershell/module/az.networkcloud/get-aznetworkcloudkubernetesclusterfeature #> function Get-AzNetworkCloudKubernetesClusterFeature { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeature])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeature])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='GetViaIdentityKubernetesCluster', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [System.String] # The name of the feature. @@ -2370,9 +2655,14 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, + [Parameter(ParameterSetName='GetViaIdentityKubernetesCluster', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] + # Identity Parameter + ${KubernetesClusterInputObject}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -2429,6 +2719,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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() @@ -2450,11 +2749,10 @@ begin { $mapping = @{ Get = 'Az.NetworkCloud.private\Get-AzNetworkCloudKubernetesClusterFeature_Get'; GetViaIdentity = 'Az.NetworkCloud.private\Get-AzNetworkCloudKubernetesClusterFeature_GetViaIdentity'; + GetViaIdentityKubernetesCluster = 'Az.NetworkCloud.private\Get-AzNetworkCloudKubernetesClusterFeature_GetViaIdentityKubernetesCluster'; List = 'Az.NetworkCloud.private\Get-AzNetworkCloudKubernetesClusterFeature_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.NetworkCloud.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 { @@ -2468,6 +2766,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) @@ -2526,7 +2827,7 @@ Get-AzNetworkCloudKubernetesCluster -ResourceGroupName resourceGroupName -Subscr .Inputs Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesCluster +Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesCluster .Notes COMPLEX PARAMETER PROPERTIES @@ -2559,7 +2860,7 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.networkcloud/get-aznetworkcloudkubernetescluster #> function Get-AzNetworkCloudKubernetesCluster { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesCluster])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesCluster])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] @@ -2591,7 +2892,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -2650,6 +2950,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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() @@ -2674,9 +2983,7 @@ begin { List = 'Az.NetworkCloud.private\Get-AzNetworkCloudKubernetesCluster_List'; List1 = 'Az.NetworkCloud.private\Get-AzNetworkCloudKubernetesCluster_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.NetworkCloud.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 { @@ -2690,6 +2997,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) @@ -2748,7 +3058,7 @@ Get-AzNetworkCloudL2Network -SubscriptionId subscriptionId .Inputs Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2Network +Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2Network .Notes COMPLEX PARAMETER PROPERTIES @@ -2781,7 +3091,7 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.networkcloud/get-aznetworkcloudl2network #> function Get-AzNetworkCloudL2Network { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2Network])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2Network])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] @@ -2813,7 +3123,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -2872,6 +3181,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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() @@ -2896,9 +3214,7 @@ begin { List = 'Az.NetworkCloud.private\Get-AzNetworkCloudL2Network_List'; List1 = 'Az.NetworkCloud.private\Get-AzNetworkCloudL2Network_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.NetworkCloud.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 { @@ -2912,6 +3228,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) @@ -2970,7 +3289,7 @@ Get-AzNetworkCloudL3Network -SubscriptionId subscriptionId .Inputs Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3Network +Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3Network .Notes COMPLEX PARAMETER PROPERTIES @@ -3003,7 +3322,7 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.networkcloud/get-aznetworkcloudl3network #> function Get-AzNetworkCloudL3Network { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3Network])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3Network])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] @@ -3035,7 +3354,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -3094,6 +3412,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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() @@ -3118,9 +3445,7 @@ begin { List = 'Az.NetworkCloud.private\Get-AzNetworkCloudL3Network_List'; List1 = 'Az.NetworkCloud.private\Get-AzNetworkCloudL3Network_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.NetworkCloud.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 { @@ -3134,6 +3459,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) @@ -3190,12 +3518,36 @@ Get-AzNetworkCloudMetricsConfiguration -ClusterName clusterName -ResourceGroupNa .Inputs Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfiguration +Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfiguration .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. +CLUSTERINPUTOBJECT : Identity Parameter + [AgentPoolName ]: The name of the Kubernetes cluster agent pool. + [BareMetalMachineKeySetName ]: The name of the bare metal machine key set. + [BareMetalMachineName ]: The name of the bare metal machine. + [BmcKeySetName ]: The name of the baseboard management controller key set. + [CloudServicesNetworkName ]: The name of the cloud services network. + [ClusterManagerName ]: The name of the cluster manager. + [ClusterName ]: The name of the cluster. + [ConsoleName ]: The name of the virtual machine console. + [FeatureName ]: The name of the feature. + [Id ]: Resource identity path + [KubernetesClusterName ]: The name of the Kubernetes cluster. + [L2NetworkName ]: The name of the L2 network. + [L3NetworkName ]: The name of the L3 network. + [MetricsConfigurationName ]: The name of the metrics configuration for the cluster. + [RackName ]: The name of the rack. + [RackSkuName ]: The name of the rack SKU. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [StorageApplianceName ]: The name of the storage appliance. + [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. + [TrunkedNetworkName ]: The name of the trunked network. + [VirtualMachineName ]: The name of the virtual machine. + [VolumeName ]: The name of the volume. + INPUTOBJECT : Identity Parameter [AgentPoolName ]: The name of the Kubernetes cluster agent pool. [BareMetalMachineKeySetName ]: The name of the bare metal machine key set. @@ -3223,7 +3575,7 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.networkcloud/get-aznetworkcloudmetricsconfiguration #> function Get-AzNetworkCloudMetricsConfiguration { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfiguration])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfiguration])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] @@ -3234,6 +3586,7 @@ param( ${ClusterName}, [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='GetViaIdentityCluster', Mandatory)] [Alias('MetricsConfigurationName')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [System.String] @@ -3261,9 +3614,14 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, + [Parameter(ParameterSetName='GetViaIdentityCluster', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] + # Identity Parameter + ${ClusterInputObject}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -3320,6 +3678,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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() @@ -3341,11 +3708,10 @@ begin { $mapping = @{ Get = 'Az.NetworkCloud.private\Get-AzNetworkCloudMetricsConfiguration_Get'; GetViaIdentity = 'Az.NetworkCloud.private\Get-AzNetworkCloudMetricsConfiguration_GetViaIdentity'; + GetViaIdentityCluster = 'Az.NetworkCloud.private\Get-AzNetworkCloudMetricsConfiguration_GetViaIdentityCluster'; List = 'Az.NetworkCloud.private\Get-AzNetworkCloudMetricsConfiguration_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.NetworkCloud.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 { @@ -3359,6 +3725,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) @@ -3415,7 +3784,7 @@ Get-AzNetworkCloudRackSku -Name rackSkuName -SubscriptionId subscriptionId .Inputs Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackSku +Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackSku .Notes COMPLEX PARAMETER PROPERTIES @@ -3448,7 +3817,7 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.networkcloud/get-aznetworkcloudracksku #> function Get-AzNetworkCloudRackSku { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackSku])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackSku])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] @@ -3471,7 +3840,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -3530,6 +3898,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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() @@ -3553,9 +3930,7 @@ begin { GetViaIdentity = 'Az.NetworkCloud.private\Get-AzNetworkCloudRackSku_GetViaIdentity'; List = 'Az.NetworkCloud.private\Get-AzNetworkCloudRackSku_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.NetworkCloud.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 { @@ -3569,6 +3944,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) @@ -3627,7 +4005,7 @@ Get-AzNetworkCloudRack -SubscriptionId subscriptionId .Inputs Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRack +Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRack .Notes COMPLEX PARAMETER PROPERTIES @@ -3660,7 +4038,7 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.networkcloud/get-aznetworkcloudrack #> function Get-AzNetworkCloudRack { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRack])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRack])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] @@ -3692,7 +4070,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -3751,6 +4128,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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() @@ -3775,9 +4161,7 @@ begin { List = 'Az.NetworkCloud.private\Get-AzNetworkCloudRack_List'; List1 = 'Az.NetworkCloud.private\Get-AzNetworkCloudRack_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.NetworkCloud.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 { @@ -3791,6 +4175,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) @@ -3849,7 +4236,7 @@ Get-AzNetworkCloudServicesNetwork -SubscriptionId subscriptionId .Inputs Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetwork +Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetwork .Notes COMPLEX PARAMETER PROPERTIES @@ -3882,7 +4269,7 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.networkcloud/get-aznetworkcloudservicesnetwork #> function Get-AzNetworkCloudServicesNetwork { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetwork])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetwork])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] @@ -3914,7 +4301,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -3973,6 +4359,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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() @@ -3997,9 +4392,7 @@ begin { List = 'Az.NetworkCloud.private\Get-AzNetworkCloudServicesNetwork_List'; List1 = 'Az.NetworkCloud.private\Get-AzNetworkCloudServicesNetwork_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.NetworkCloud.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 { @@ -4013,6 +4406,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) @@ -4071,7 +4467,7 @@ Get-AzNetworkCloudStorageAppliance -Name storageApplianceName -SubscriptionId su .Inputs Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliance +Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliance .Notes COMPLEX PARAMETER PROPERTIES @@ -4104,7 +4500,7 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.networkcloud/get-aznetworkcloudstorageappliance #> function Get-AzNetworkCloudStorageAppliance { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliance])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliance])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] @@ -4136,7 +4532,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -4195,6 +4590,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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() @@ -4219,9 +4623,7 @@ begin { List = 'Az.NetworkCloud.private\Get-AzNetworkCloudStorageAppliance_List'; List1 = 'Az.NetworkCloud.private\Get-AzNetworkCloudStorageAppliance_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.NetworkCloud.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 { @@ -4235,6 +4637,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) @@ -4293,7 +4698,7 @@ Get-AzNetworkCloudTrunkedNetwork -ResourceGroupName resourceGroupName -Subscript .Inputs Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetwork +Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetwork .Notes COMPLEX PARAMETER PROPERTIES @@ -4326,7 +4731,7 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.networkcloud/get-aznetworkcloudtrunkednetwork #> function Get-AzNetworkCloudTrunkedNetwork { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetwork])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetwork])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] @@ -4358,7 +4763,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -4417,6 +4821,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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() @@ -4441,9 +4854,7 @@ begin { List = 'Az.NetworkCloud.private\Get-AzNetworkCloudTrunkedNetwork_List'; List1 = 'Az.NetworkCloud.private\Get-AzNetworkCloudTrunkedNetwork_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.NetworkCloud.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 { @@ -4457,6 +4868,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) @@ -4515,7 +4929,7 @@ Get-AzNetworkCloudVirtualMachine -ResourceGroupName resourceGroup -SubscriptionI .Inputs Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachine +Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachine .Notes COMPLEX PARAMETER PROPERTIES @@ -4548,7 +4962,7 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.networkcloud/get-aznetworkcloudvirtualmachine #> function Get-AzNetworkCloudVirtualMachine { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachine])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachine])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] @@ -4580,7 +4994,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -4639,6 +5052,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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() @@ -4663,9 +5085,7 @@ begin { List = 'Az.NetworkCloud.private\Get-AzNetworkCloudVirtualMachine_List'; List1 = 'Az.NetworkCloud.private\Get-AzNetworkCloudVirtualMachine_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.NetworkCloud.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 { @@ -4679,6 +5099,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) @@ -4737,7 +5160,7 @@ Get-AzNetworkCloudVolume -ResourceGroupName resourceGroupName -SubscriptionId su .Inputs Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolume +Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolume .Notes COMPLEX PARAMETER PROPERTIES @@ -4770,7 +5193,7 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.networkcloud/get-aznetworkcloudvolume #> function Get-AzNetworkCloudVolume { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolume])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolume])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] @@ -4802,7 +5225,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -4861,6 +5283,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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() @@ -4885,9 +5316,7 @@ begin { List = 'Az.NetworkCloud.private\Get-AzNetworkCloudVolume_List'; List1 = 'Az.NetworkCloud.private\Get-AzNetworkCloudVolume_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.NetworkCloud.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 { @@ -4901,6 +5330,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) @@ -4992,12 +5424,16 @@ function Invoke-AzNetworkCloudBareMetalMachineCordon { [CmdletBinding(DefaultParameterSetName='CordonExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='CordonExpanded', Mandatory)] + [Parameter(ParameterSetName='CordonViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='CordonViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [System.String] # The name of the bare metal machine. ${BareMetalMachineName}, [Parameter(ParameterSetName='CordonExpanded', Mandatory)] + [Parameter(ParameterSetName='CordonViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='CordonViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [System.String] # The name of the resource group. @@ -5005,6 +5441,8 @@ param( ${ResourceGroupName}, [Parameter(ParameterSetName='CordonExpanded')] + [Parameter(ParameterSetName='CordonViaJsonFilePath')] + [Parameter(ParameterSetName='CordonViaJsonString')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] @@ -5016,16 +5454,28 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineEvacuate])] + [Parameter(ParameterSetName='CordonExpanded')] + [Parameter(ParameterSetName='CordonViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("True", "False")] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineEvacuate] + [System.String] # The indicator of whether to evacuate the node workload when the bare metal machine is cordoned. ${Evacuate}, + [Parameter(ParameterSetName='CordonViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Path of Json file supplied to the Cordon operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='CordonViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Json string supplied to the Cordon operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -5100,6 +5550,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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() @@ -5121,10 +5580,10 @@ begin { $mapping = @{ CordonExpanded = 'Az.NetworkCloud.private\Invoke-AzNetworkCloudBareMetalMachineCordon_CordonExpanded'; CordonViaIdentityExpanded = 'Az.NetworkCloud.private\Invoke-AzNetworkCloudBareMetalMachineCordon_CordonViaIdentityExpanded'; + CordonViaJsonFilePath = 'Az.NetworkCloud.private\Invoke-AzNetworkCloudBareMetalMachineCordon_CordonViaJsonFilePath'; + CordonViaJsonString = 'Az.NetworkCloud.private\Invoke-AzNetworkCloudBareMetalMachineCordon_CordonViaJsonString'; } - if (('CordonExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('CordonExpanded', 'CordonViaJsonFilePath', 'CordonViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -5138,6 +5597,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) @@ -5207,7 +5669,7 @@ To create the parameters described below, construct a hash table containing the COMMAND : The list of curated data extraction commands to be executed directly against the target machine. Command : The command to execute against the bare metal machine. - [Argument ]: The list of string arguments that will be passed to the script in order as separate arguments. + [Argument >]: The list of string arguments that will be passed to the script in order as separate arguments. INPUTOBJECT : Identity Parameter [AgentPoolName ]: The name of the Kubernetes cluster agent pool. @@ -5240,12 +5702,16 @@ function Invoke-AzNetworkCloudBareMetalMachineDataExtract { [CmdletBinding(DefaultParameterSetName='RunViaIdentityExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='RunExpanded', Mandatory)] + [Parameter(ParameterSetName='RunViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='RunViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [System.String] # The name of the bare metal machine. ${BareMetalMachineName}, [Parameter(ParameterSetName='RunExpanded', Mandatory)] + [Parameter(ParameterSetName='RunViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='RunViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [System.String] # The name of the resource group. @@ -5253,6 +5719,8 @@ param( ${ResourceGroupName}, [Parameter(ParameterSetName='RunExpanded')] + [Parameter(ParameterSetName='RunViaJsonFilePath')] + [Parameter(ParameterSetName='RunViaJsonString')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] @@ -5264,23 +5732,35 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='RunExpanded', Mandatory)] + [Parameter(ParameterSetName='RunViaIdentityExpanded', Mandatory)] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineCommandSpecification[]] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineCommandSpecification[]] # The list of curated data extraction commands to be executed directly against the target machine. - # To construct, see NOTES section for COMMAND properties and create a hash table. ${Command}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='RunExpanded', Mandatory)] + [Parameter(ParameterSetName='RunViaIdentityExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.Int64] # The maximum time the commands are allowed to run.If the execution time exceeds the maximum, the script will be stopped, any output produced until then will be captured, and the exit code matching a timeout will be returned (252). ${LimitTimeSecond}, + [Parameter(ParameterSetName='RunViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Path of Json file supplied to the Run operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='RunViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Json string supplied to the Run operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -5355,6 +5835,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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() @@ -5376,10 +5865,10 @@ begin { $mapping = @{ RunExpanded = 'Az.NetworkCloud.private\Invoke-AzNetworkCloudBareMetalMachineDataExtract_RunExpanded'; RunViaIdentityExpanded = 'Az.NetworkCloud.private\Invoke-AzNetworkCloudBareMetalMachineDataExtract_RunViaIdentityExpanded'; + RunViaJsonFilePath = 'Az.NetworkCloud.private\Invoke-AzNetworkCloudBareMetalMachineDataExtract_RunViaJsonFilePath'; + RunViaJsonString = 'Az.NetworkCloud.private\Invoke-AzNetworkCloudBareMetalMachineDataExtract_RunViaJsonString'; } - if (('RunExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('RunExpanded', 'RunViaJsonFilePath', 'RunViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -5393,6 +5882,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) @@ -5509,7 +6001,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -5586,6 +6077,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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() @@ -5608,9 +6108,7 @@ begin { Reimage = 'Az.NetworkCloud.private\Invoke-AzNetworkCloudBareMetalMachineReimage_Reimage'; ReimageViaIdentity = 'Az.NetworkCloud.private\Invoke-AzNetworkCloudBareMetalMachineReimage_ReimageViaIdentity'; } - if (('Reimage') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Reimage') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -5624,6 +6122,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) @@ -5717,6 +6218,8 @@ function Invoke-AzNetworkCloudBareMetalMachineReplace { [CmdletBinding(DefaultParameterSetName='ReplaceExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='ReplaceExpanded', Mandatory)] + [Parameter(ParameterSetName='ReplaceViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='ReplaceViaJsonString', Mandatory)] [Alias('BareMetalMachineName')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [System.String] @@ -5724,6 +6227,8 @@ param( ${Name}, [Parameter(ParameterSetName='ReplaceExpanded', Mandatory)] + [Parameter(ParameterSetName='ReplaceViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='ReplaceViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [System.String] # The name of the resource group. @@ -5731,6 +6236,8 @@ param( ${ResourceGroupName}, [Parameter(ParameterSetName='ReplaceExpanded')] + [Parameter(ParameterSetName='ReplaceViaJsonFilePath')] + [Parameter(ParameterSetName='ReplaceViaJsonString')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] @@ -5742,45 +6249,62 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, - [Parameter()] + [Parameter(ParameterSetName='ReplaceExpanded')] + [Parameter(ParameterSetName='ReplaceViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.Security.SecureString] # The password of the administrator of the device used during initialization. ${BmcCredentialsPassword}, - [Parameter()] + [Parameter(ParameterSetName='ReplaceExpanded')] + [Parameter(ParameterSetName='ReplaceViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The username of the administrator of the device used during initialization. ${BmcCredentialsUsername}, - [Parameter()] + [Parameter(ParameterSetName='ReplaceExpanded')] + [Parameter(ParameterSetName='ReplaceViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The MAC address of the BMC device. ${BmcMacAddress}, - [Parameter()] + [Parameter(ParameterSetName='ReplaceExpanded')] + [Parameter(ParameterSetName='ReplaceViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The MAC address of a NIC connected to the PXE network. ${BootMacAddress}, - [Parameter()] + [Parameter(ParameterSetName='ReplaceExpanded')] + [Parameter(ParameterSetName='ReplaceViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The OS-level hostname assigned to this machine. ${MachineName}, - [Parameter()] + [Parameter(ParameterSetName='ReplaceExpanded')] + [Parameter(ParameterSetName='ReplaceViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The serial number of the bare metal machine. ${SerialNumber}, + [Parameter(ParameterSetName='ReplaceViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Path of Json file supplied to the Replace operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='ReplaceViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Json string supplied to the Replace operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -5855,6 +6379,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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() @@ -5876,10 +6409,10 @@ begin { $mapping = @{ ReplaceExpanded = 'Az.NetworkCloud.private\Invoke-AzNetworkCloudBareMetalMachineReplace_ReplaceExpanded'; ReplaceViaIdentityExpanded = 'Az.NetworkCloud.private\Invoke-AzNetworkCloudBareMetalMachineReplace_ReplaceViaIdentityExpanded'; + ReplaceViaJsonFilePath = 'Az.NetworkCloud.private\Invoke-AzNetworkCloudBareMetalMachineReplace_ReplaceViaJsonFilePath'; + ReplaceViaJsonString = 'Az.NetworkCloud.private\Invoke-AzNetworkCloudBareMetalMachineReplace_ReplaceViaJsonString'; } - if (('ReplaceExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('ReplaceExpanded', 'ReplaceViaJsonFilePath', 'ReplaceViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -5893,6 +6426,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) @@ -5986,12 +6522,16 @@ function Invoke-AzNetworkCloudBareMetalMachineRunCommand { [CmdletBinding(DefaultParameterSetName='RunExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='RunExpanded', Mandatory)] + [Parameter(ParameterSetName='RunViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='RunViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [System.String] # The name of the bare metal machine. ${BareMetalMachineName}, [Parameter(ParameterSetName='RunExpanded', Mandatory)] + [Parameter(ParameterSetName='RunViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='RunViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [System.String] # The name of the resource group. @@ -5999,6 +6539,8 @@ param( ${ResourceGroupName}, [Parameter(ParameterSetName='RunExpanded')] + [Parameter(ParameterSetName='RunViaJsonFilePath')] + [Parameter(ParameterSetName='RunViaJsonString')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] @@ -6010,28 +6552,42 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='RunExpanded', Mandatory)] + [Parameter(ParameterSetName='RunViaIdentityExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.Int64] # The maximum time the script is allowed to run.If the execution time exceeds the maximum, the script will be stopped, any output produced until then will be captured, and the exit code matching a timeout will be returned (252). ${LimitTimeSecond}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='RunExpanded', Mandatory)] + [Parameter(ParameterSetName='RunViaIdentityExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The base64 encoded script to execute on the bare metal machine. ${Script}, - [Parameter()] + [Parameter(ParameterSetName='RunExpanded')] + [Parameter(ParameterSetName='RunViaIdentityExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String[]] # The list of string arguments that will be passed to the script in order as separate arguments. ${Argument}, + [Parameter(ParameterSetName='RunViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Path of Json file supplied to the Run operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='RunViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Json string supplied to the Run operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -6106,6 +6662,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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() @@ -6127,10 +6692,10 @@ begin { $mapping = @{ RunExpanded = 'Az.NetworkCloud.private\Invoke-AzNetworkCloudBareMetalMachineRunCommand_RunExpanded'; RunViaIdentityExpanded = 'Az.NetworkCloud.private\Invoke-AzNetworkCloudBareMetalMachineRunCommand_RunViaIdentityExpanded'; + RunViaJsonFilePath = 'Az.NetworkCloud.private\Invoke-AzNetworkCloudBareMetalMachineRunCommand_RunViaJsonFilePath'; + RunViaJsonString = 'Az.NetworkCloud.private\Invoke-AzNetworkCloudBareMetalMachineRunCommand_RunViaJsonString'; } - if (('RunExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('RunExpanded', 'RunViaJsonFilePath', 'RunViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -6144,6 +6709,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) @@ -6213,7 +6781,7 @@ To create the parameters described below, construct a hash table containing the COMMAND : The list of read-only commands to be executed directly against the target machine. Command : The command to execute against the bare metal machine. - [Argument ]: The list of string arguments that will be passed to the script in order as separate arguments. + [Argument >]: The list of string arguments that will be passed to the script in order as separate arguments. INPUTOBJECT : Identity Parameter [AgentPoolName ]: The name of the Kubernetes cluster agent pool. @@ -6246,12 +6814,16 @@ function Invoke-AzNetworkCloudBareMetalMachineRunReadCommand { [CmdletBinding(DefaultParameterSetName='RunViaIdentityExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='RunExpanded', Mandatory)] + [Parameter(ParameterSetName='RunViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='RunViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [System.String] # The name of the bare metal machine. ${BareMetalMachineName}, [Parameter(ParameterSetName='RunExpanded', Mandatory)] + [Parameter(ParameterSetName='RunViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='RunViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [System.String] # The name of the resource group. @@ -6259,6 +6831,8 @@ param( ${ResourceGroupName}, [Parameter(ParameterSetName='RunExpanded')] + [Parameter(ParameterSetName='RunViaJsonFilePath')] + [Parameter(ParameterSetName='RunViaJsonString')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] @@ -6270,23 +6844,35 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='RunExpanded', Mandatory)] + [Parameter(ParameterSetName='RunViaIdentityExpanded', Mandatory)] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineCommandSpecification[]] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineCommandSpecification[]] # The list of read-only commands to be executed directly against the target machine. - # To construct, see NOTES section for COMMAND properties and create a hash table. ${Command}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='RunExpanded', Mandatory)] + [Parameter(ParameterSetName='RunViaIdentityExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.Int64] # The maximum time the commands are allowed to run.If the execution time exceeds the maximum, the script will be stopped, any output produced until then will be captured, and the exit code matching a timeout will be returned (252). ${LimitTimeSecond}, + [Parameter(ParameterSetName='RunViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Path of Json file supplied to the Run operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='RunViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Json string supplied to the Run operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -6361,6 +6947,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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() @@ -6382,10 +6977,10 @@ begin { $mapping = @{ RunExpanded = 'Az.NetworkCloud.private\Invoke-AzNetworkCloudBareMetalMachineRunReadCommand_RunExpanded'; RunViaIdentityExpanded = 'Az.NetworkCloud.private\Invoke-AzNetworkCloudBareMetalMachineRunReadCommand_RunViaIdentityExpanded'; + RunViaJsonFilePath = 'Az.NetworkCloud.private\Invoke-AzNetworkCloudBareMetalMachineRunReadCommand_RunViaJsonFilePath'; + RunViaJsonString = 'Az.NetworkCloud.private\Invoke-AzNetworkCloudBareMetalMachineRunReadCommand_RunViaJsonString'; } - if (('RunExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('RunExpanded', 'RunViaJsonFilePath', 'RunViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -6399,6 +6994,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) @@ -6514,7 +7112,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -6591,6 +7188,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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() @@ -6613,9 +7219,7 @@ begin { Uncordon = 'Az.NetworkCloud.private\Invoke-AzNetworkCloudBareMetalMachineUncordon_Uncordon'; UncordonViaIdentity = 'Az.NetworkCloud.private\Invoke-AzNetworkCloudBareMetalMachineUncordon_UncordonViaIdentity'; } - if (('Uncordon') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Uncordon') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -6629,6 +7233,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) @@ -6674,14 +7281,14 @@ end { <# .Synopsis -Trigger the continuation of an update for a cluster with a matching update strategy that has paused after completing a segment of the update. +Trigger the continuation of an continue for a cluster with a matching continue strategy that has paused after completing a segment of the continue .Description -Trigger the continuation of an update for a cluster with a matching update strategy that has paused after completing a segment of the update. +Trigger the continuation of an continue for a cluster with a matching continue strategy that has paused after completing a segment of the continue .Example Invoke-AzNetworkCloudClusterContinueVersionUpdate -ResourceGroupName resourceGroupName -ClusterName clusterName -SubscriptionId subscriptionId -MachineGroupTargetingMode "AlphaByRack" .Inputs -Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterContinueUpdateVersionParameters +Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterContinueUpdateVersionParameters .Inputs Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity .Outputs @@ -6692,7 +7299,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. CLUSTERCONTINUEUPDATEVERSIONPARAMETER : ClusterContinueUpdateVersionParameters represents the body of the request to continue the update of a cluster version. - [MachineGroupTargetingMode ]: The mode by which the cluster will target the next grouping of servers to continue the update. + [MachineGroupTargetingMode ]: The mode by which the cluster will target the next grouping of servers to continue the update. INPUTOBJECT : Identity Parameter [AgentPoolName ]: The name of the Kubernetes cluster agent pool. @@ -6726,6 +7333,8 @@ function Invoke-AzNetworkCloudClusterContinueVersionUpdate { param( [Parameter(ParameterSetName='Continue', Mandatory)] [Parameter(ParameterSetName='ContinueExpanded', Mandatory)] + [Parameter(ParameterSetName='ContinueViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='ContinueViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [System.String] # The name of the cluster. @@ -6733,6 +7342,8 @@ param( [Parameter(ParameterSetName='Continue', Mandatory)] [Parameter(ParameterSetName='ContinueExpanded', Mandatory)] + [Parameter(ParameterSetName='ContinueViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='ContinueViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [System.String] # The name of the resource group. @@ -6741,6 +7352,8 @@ param( [Parameter(ParameterSetName='Continue')] [Parameter(ParameterSetName='ContinueExpanded')] + [Parameter(ParameterSetName='ContinueViaJsonFilePath')] + [Parameter(ParameterSetName='ContinueViaJsonString')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] @@ -6753,25 +7366,35 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter(ParameterSetName='Continue', Mandatory, ValueFromPipeline)] [Parameter(ParameterSetName='ContinueViaIdentity', Mandatory, ValueFromPipeline)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterContinueUpdateVersionParameters] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterContinueUpdateVersionParameters] # ClusterContinueUpdateVersionParameters represents the body of the request to continue the update of a cluster version. - # To construct, see NOTES section for CLUSTERCONTINUEUPDATEVERSIONPARAMETER properties and create a hash table. ${ClusterContinueUpdateVersionParameter}, [Parameter(ParameterSetName='ContinueExpanded')] [Parameter(ParameterSetName='ContinueViaIdentityExpanded')] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterContinueUpdateVersionMachineGroupTargetingMode])] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("AlphaByRack")] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterContinueUpdateVersionMachineGroupTargetingMode] + [System.String] # The mode by which the cluster will target the next grouping of servers to continue the update. ${MachineGroupTargetingMode}, + [Parameter(ParameterSetName='ContinueViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Path of Json file supplied to the Continue operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='ContinueViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Json string supplied to the Continue operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -6846,6 +7469,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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() @@ -6869,10 +7501,10 @@ begin { ContinueExpanded = 'Az.NetworkCloud.private\Invoke-AzNetworkCloudClusterContinueVersionUpdate_ContinueExpanded'; ContinueViaIdentity = 'Az.NetworkCloud.private\Invoke-AzNetworkCloudClusterContinueVersionUpdate_ContinueViaIdentity'; ContinueViaIdentityExpanded = 'Az.NetworkCloud.private\Invoke-AzNetworkCloudClusterContinueVersionUpdate_ContinueViaIdentityExpanded'; + ContinueViaJsonFilePath = 'Az.NetworkCloud.private\Invoke-AzNetworkCloudClusterContinueVersionUpdate_ContinueViaJsonFilePath'; + ContinueViaJsonString = 'Az.NetworkCloud.private\Invoke-AzNetworkCloudClusterContinueVersionUpdate_ContinueViaJsonString'; } - if (('Continue', 'ContinueExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Continue', 'ContinueExpanded', 'ContinueViaJsonFilePath', 'ContinueViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -6886,6 +7518,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) @@ -6977,12 +7612,16 @@ function Invoke-AzNetworkCloudClusterVersionUpdate { [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.NetworkCloud.Category('Path')] [System.String] # The name of the cluster. ${ClusterName}, [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [System.String] # The name of the resource group. @@ -6990,6 +7629,8 @@ param( ${ResourceGroupName}, [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaJsonFilePath')] + [Parameter(ParameterSetName='UpdateViaJsonString')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] @@ -7001,15 +7642,27 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The version to be applied to the cluster during update. ${TargetClusterVersion}, + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Path of Json file supplied to the Update operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Json string supplied to the Update operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -7084,6 +7737,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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() @@ -7105,10 +7767,10 @@ begin { $mapping = @{ UpdateExpanded = 'Az.NetworkCloud.private\Invoke-AzNetworkCloudClusterVersionUpdate_UpdateExpanded'; UpdateViaIdentityExpanded = 'Az.NetworkCloud.private\Invoke-AzNetworkCloudClusterVersionUpdate_UpdateViaIdentityExpanded'; + UpdateViaJsonFilePath = 'Az.NetworkCloud.private\Invoke-AzNetworkCloudClusterVersionUpdate_UpdateViaJsonFilePath'; + UpdateViaJsonString = 'Az.NetworkCloud.private\Invoke-AzNetworkCloudClusterVersionUpdate_UpdateViaJsonString'; } - if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 { @@ -7122,6 +7784,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) @@ -7174,7 +7839,7 @@ Triggers the execution of a runtime protection scan to detect and remediate dete Invoke-AzNetworkCloudScanClusterRuntime -ResourceGroupName resourceGroupName -ClusterName clusterName -SubscriptionId subscriptionId -ScanActivity "Scan" .Inputs -Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterScanRuntimeParameters +Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterScanRuntimeParameters .Inputs Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity .Outputs @@ -7185,7 +7850,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. CLUSTERSCANRUNTIMEPARAMETER : ClusterScanRuntimeParameters defines the parameters for the cluster scan runtime operation. - [ScanActivity ]: The choice of if the scan operation should run the scan. + [ScanActivity ]: The choice of if the scan operation should run the scan. INPUTOBJECT : Identity Parameter [AgentPoolName ]: The name of the Kubernetes cluster agent pool. @@ -7219,6 +7884,8 @@ function Invoke-AzNetworkCloudScanClusterRuntime { param( [Parameter(ParameterSetName='Scan', Mandatory)] [Parameter(ParameterSetName='ScanExpanded', Mandatory)] + [Parameter(ParameterSetName='ScanViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='ScanViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [System.String] # The name of the cluster. @@ -7226,6 +7893,8 @@ param( [Parameter(ParameterSetName='Scan', Mandatory)] [Parameter(ParameterSetName='ScanExpanded', Mandatory)] + [Parameter(ParameterSetName='ScanViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='ScanViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [System.String] # The name of the resource group. @@ -7234,6 +7903,8 @@ param( [Parameter(ParameterSetName='Scan')] [Parameter(ParameterSetName='ScanExpanded')] + [Parameter(ParameterSetName='ScanViaJsonFilePath')] + [Parameter(ParameterSetName='ScanViaJsonString')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] @@ -7246,25 +7917,35 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter(ParameterSetName='Scan', Mandatory, ValueFromPipeline)] [Parameter(ParameterSetName='ScanViaIdentity', Mandatory, ValueFromPipeline)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterScanRuntimeParameters] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterScanRuntimeParameters] # ClusterScanRuntimeParameters defines the parameters for the cluster scan runtime operation. - # To construct, see NOTES section for CLUSTERSCANRUNTIMEPARAMETER properties and create a hash table. ${ClusterScanRuntimeParameter}, [Parameter(ParameterSetName='ScanExpanded')] [Parameter(ParameterSetName='ScanViaIdentityExpanded')] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterScanRuntimeParametersScanActivity])] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Scan", "Skip")] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterScanRuntimeParametersScanActivity] + [System.String] # The choice of if the scan operation should run the scan. ${ScanActivity}, + [Parameter(ParameterSetName='ScanViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Path of Json file supplied to the Scan operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='ScanViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Json string supplied to the Scan operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -7339,6 +8020,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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() @@ -7362,10 +8052,10 @@ begin { ScanExpanded = 'Az.NetworkCloud.private\Invoke-AzNetworkCloudScanClusterRuntime_ScanExpanded'; ScanViaIdentity = 'Az.NetworkCloud.private\Invoke-AzNetworkCloudScanClusterRuntime_ScanViaIdentity'; ScanViaIdentityExpanded = 'Az.NetworkCloud.private\Invoke-AzNetworkCloudScanClusterRuntime_ScanViaIdentityExpanded'; + ScanViaJsonFilePath = 'Az.NetworkCloud.private\Invoke-AzNetworkCloudScanClusterRuntime_ScanViaJsonFilePath'; + ScanViaJsonString = 'Az.NetworkCloud.private\Invoke-AzNetworkCloudScanClusterRuntime_ScanViaJsonString'; } - if (('Scan', 'ScanExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Scan', 'ScanExpanded', 'ScanViaJsonFilePath', 'ScanViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -7379,6 +8069,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) @@ -7495,7 +8188,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -7572,6 +8264,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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() @@ -7594,9 +8295,7 @@ begin { Reimage = 'Az.NetworkCloud.private\Invoke-AzNetworkCloudVirtualMachineReimage_Reimage'; ReimageViaIdentity = 'Az.NetworkCloud.private\Invoke-AzNetworkCloudVirtualMachineReimage_ReimageViaIdentity'; } - if (('Reimage') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Reimage') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -7610,6 +8309,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) @@ -7655,9 +8357,9 @@ end { <# .Synopsis -Create a new Kubernetes cluster agent pool or update the properties of the existing one. +Create a new Kubernetes cluster agent pool or create the properties of the existing one. .Description -Create a new Kubernetes cluster agent pool or update the properties of the existing one. +Create a new Kubernetes cluster agent pool or create the properties of the existing one. .Example $networkAttachment = @{ AttachedNetworkId = "l3NetworkId" @@ -7676,8 +8378,10 @@ Create a new Kubernetes cluster agent pool or update the properties of the exist New-AzNetworkCloudAgentPool -KubernetesClusterName clusterName -Name agentPoolName -ResourceGroupName resourceGroup -Count count -Location location -Mode agentPoolMode -VMSkuName vmSkuName -SubscriptionId subscriptionId -AdministratorConfigurationAdminUsername adminUsername -AdministratorConfigurationSshPublicKey $sshPublicKey -AgentOptionHugepagesCount hugepagesCount -AgentOptionHugepagesSize hugepagesSize -AttachedNetworkConfigurationL3Network $networkAttachment -AvailabilityZone availabilityZones -ExtendedLocationName clusterExtendedLocation -ExtendedLocationType "CustomLocation " -Tag @{tags = "tag"} -Label $labels -Taint $taints -UpgradeSettingMaxSurge maxSurge +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPool +Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPool .Notes COMPLEX PARAMETER PROPERTIES @@ -7687,38 +8391,56 @@ ADMINISTRATORCONFIGURATIONSSHPUBLICKEY : The SSH configuration KeyData : The SSH public key data. ATTACHEDNETWORKCONFIGURATIONL2NETWORK : The list of Layer 2 Networks and related configuration for attachment. - NetworkId : The resource ID of the network that is being configured for attachment. - [PluginType ]: The indicator of how this network will be utilized by the Kubernetes cluster. + [NetworkId ]: The resource ID of the network that is being configured for attachment. + [PluginType ]: The indicator of how this network will be utilized by the Kubernetes cluster. ATTACHEDNETWORKCONFIGURATIONL3NETWORK : The list of Layer 3 Networks and related configuration for attachment. NetworkId : The resource ID of the network that is being configured for attachment. - [IpamEnabled ]: The indication of whether this network will or will not perform IP address management and allocate IP addresses when attached. - [PluginType ]: The indicator of how this network will be utilized by the Kubernetes cluster. + [IpamEnabled ]: The indication of whether this network will or will not perform IP address management and allocate IP addresses when attached. + [PluginType ]: The indicator of how this network will be utilized by the Kubernetes cluster. ATTACHEDNETWORKCONFIGURATIONTRUNKEDNETWORK : The list of Trunked Networks and related configuration for attachment. - NetworkId : The resource ID of the network that is being configured for attachment. - [PluginType ]: The indicator of how this network will be utilized by the Kubernetes cluster. + [NetworkId ]: The resource ID of the network that is being configured for attachment. + [PluginType ]: The indicator of how this network will be utilized by the Kubernetes cluster. + +KUBERNETESCLUSTERINPUTOBJECT : Identity Parameter + [AgentPoolName ]: The name of the Kubernetes cluster agent pool. + [BareMetalMachineKeySetName ]: The name of the bare metal machine key set. + [BareMetalMachineName ]: The name of the bare metal machine. + [BmcKeySetName ]: The name of the baseboard management controller key set. + [CloudServicesNetworkName ]: The name of the cloud services network. + [ClusterManagerName ]: The name of the cluster manager. + [ClusterName ]: The name of the cluster. + [ConsoleName ]: The name of the virtual machine console. + [FeatureName ]: The name of the feature. + [Id ]: Resource identity path + [KubernetesClusterName ]: The name of the Kubernetes cluster. + [L2NetworkName ]: The name of the L2 network. + [L3NetworkName ]: The name of the L3 network. + [MetricsConfigurationName ]: The name of the metrics configuration for the cluster. + [RackName ]: The name of the rack. + [RackSkuName ]: The name of the rack SKU. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [StorageApplianceName ]: The name of the storage appliance. + [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. + [TrunkedNetworkName ]: The name of the trunked network. + [VirtualMachineName ]: The name of the virtual machine. + [VolumeName ]: The name of the volume. LABEL : The labels applied to the nodes in this agent pool. - Key : The name of the label or taint. - Value : The value of the label or taint. + [Key ]: The name of the label or taint. + [Value ]: The value of the label or taint. TAINT : The taints applied to the nodes in this agent pool. - Key : The name of the label or taint. - Value : The value of the label or taint. + [Key ]: The name of the label or taint. + [Value ]: The value of the label or taint. .Link https://learn.microsoft.com/powershell/module/az.networkcloud/new-aznetworkcloudagentpool #> function New-AzNetworkCloudAgentPool { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPool])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPool])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( - [Parameter(Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] - [System.String] - # The name of the Kubernetes cluster. - ${KubernetesClusterName}, - [Parameter(Mandatory)] [Alias('AgentPoolName')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] @@ -7726,14 +8448,26 @@ param( # The name of the Kubernetes cluster agent pool. ${Name}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] + [System.String] + # The name of the Kubernetes cluster. + ${KubernetesClusterName}, + + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] @@ -7741,6 +8475,12 @@ param( # The value must be an UUID. ${SubscriptionId}, + [Parameter(ParameterSetName='CreateViaIdentityKubernetesClusterExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] + # Identity Parameter + ${KubernetesClusterInputObject}, + [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Header')] [System.String] @@ -7756,87 +8496,95 @@ param( # Other values will result in error from server as they are not supported. ${IfNoneMatch}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaIdentityKubernetesClusterExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.Int64] # The number of virtual machines that use this configuration. ${Count}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaIdentityKubernetesClusterExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The geo-location where the resource lives ${Location}, - [Parameter(Mandatory)] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.AgentPoolMode])] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaIdentityKubernetesClusterExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("System", "User", "NotApplicable")] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.AgentPoolMode] + [System.String] # The selection of how this agent pool is utilized, either as a system pool or a user pool. # System pools run the features and critical services for the Kubernetes Cluster, while user pools are dedicated to user workloads. # Every Kubernetes cluster must contain at least one system node pool with at least one node. ${Mode}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaIdentityKubernetesClusterExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The name of the VM SKU that determines the size of resources allocated for node VMs. ${VMSkuName}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityKubernetesClusterExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The user name for the administrator that will be applied to the operating systems that run Kubernetes nodes. # If not supplied, a user name will be chosen by the service. ${AdministratorConfigurationAdminUsername}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityKubernetesClusterExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey[]] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISshPublicKey[]] # The SSH configuration for the operating systems that run the nodes in the Kubernetes cluster. # In some cases, specification of public keys may be required to produce a working environment. - # To construct, see NOTES section for ADMINISTRATORCONFIGURATIONSSHPUBLICKEY properties and create a hash table. ${AdministratorConfigurationSshPublicKey}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityKubernetesClusterExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.Int64] # The number of hugepages to allocate. ${AgentOptionHugepagesCount}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HugepagesSize])] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityKubernetesClusterExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("2M", "1G")] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HugepagesSize] + [System.String] # The size of the hugepages to allocate. ${AgentOptionHugepagesSize}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityKubernetesClusterExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkAttachmentConfiguration[]] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkAttachmentConfiguration[]] # The list of Layer 2 Networks and related configuration for attachment. - # To construct, see NOTES section for ATTACHEDNETWORKCONFIGURATIONL2NETWORK properties and create a hash table. ${AttachedNetworkConfigurationL2Network}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityKubernetesClusterExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkAttachmentConfiguration[]] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkAttachmentConfiguration[]] # The list of Layer 3 Networks and related configuration for attachment. - # To construct, see NOTES section for ATTACHEDNETWORKCONFIGURATIONL3NETWORK properties and create a hash table. ${AttachedNetworkConfigurationL3Network}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityKubernetesClusterExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkAttachmentConfiguration[]] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkAttachmentConfiguration[]] # The list of Trunked Networks and related configuration for attachment. - # To construct, see NOTES section for ATTACHEDNETWORKCONFIGURATIONTRUNKEDNETWORK properties and create a hash table. ${AttachedNetworkConfigurationTrunkedNetwork}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityKubernetesClusterExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String[]] @@ -7844,49 +8592,54 @@ param( # If not specified, all availability zones will be used. ${AvailabilityZone}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityKubernetesClusterExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The resource ID of the extended location on which the resource will be created. ${ExtendedLocationName}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityKubernetesClusterExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The extended location type, for example, CustomLocation. ${ExtendedLocationType}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityKubernetesClusterExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesLabel[]] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesLabel[]] # The labels applied to the nodes in this agent pool. - # To construct, see NOTES section for LABEL properties and create a hash table. ${Label}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityKubernetesClusterExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceTags]))] [System.Collections.Hashtable] # Resource tags. ${Tag}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityKubernetesClusterExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesLabel[]] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesLabel[]] # The taints applied to the nodes in this agent pool. - # To construct, see NOTES section for TAINT properties and create a hash table. ${Taint}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityKubernetesClusterExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.Int64] # The maximum time in seconds that is allowed for a node drain to complete before proceeding with the upgrade of the agent pool. # If not specified during creation, a value of 1800 seconds is used. ${UpgradeSettingDrainTimeout}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityKubernetesClusterExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The maximum number or percentage of nodes that are surged during upgrade. @@ -7899,7 +8652,8 @@ param( # One of MaxSurge and MaxUnavailable must be greater than 0. ${UpgradeSettingMaxSurge}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityKubernetesClusterExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The maximum number or percentage of nodes that can be unavailable during upgrade. @@ -7912,6 +8666,18 @@ param( # One of MaxSurge and MaxUnavailable must be greater than 0. ${UpgradeSettingMaxUnavailable}, + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Path of Json file supplied to the Create operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Json string supplied to the Create operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -7980,6 +8746,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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() @@ -8000,10 +8775,11 @@ begin { $mapping = @{ CreateExpanded = 'Az.NetworkCloud.private\New-AzNetworkCloudAgentPool_CreateExpanded'; + CreateViaIdentityKubernetesClusterExpanded = 'Az.NetworkCloud.private\New-AzNetworkCloudAgentPool_CreateViaIdentityKubernetesClusterExpanded'; + CreateViaJsonFilePath = 'Az.NetworkCloud.private\New-AzNetworkCloudAgentPool_CreateViaJsonFilePath'; + CreateViaJsonString = 'Az.NetworkCloud.private\New-AzNetworkCloudAgentPool_CreateViaJsonString'; } - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 { @@ -8017,6 +8793,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) @@ -8062,9 +8841,9 @@ end { <# .Synopsis -Create a new bare metal machine key set or update the existing one for the provided cluster. +Create a new bare metal machine key set or create the existing one for the provided cluster. .Description -Create a new bare metal machine key set or update the existing one for the provided cluster. +Create a new bare metal machine key set or create the existing one for the provided cluster. .Example $tagHash = @{ tag = "tag" @@ -8079,13 +8858,39 @@ $userList = @{ New-AzNetworkCloudBareMetalMachineKeySet -ResourceGroupName resourceGroupName -Name baremetalmachinekeysetname -ClusterName clusterName -AzureGroupId azuregroupid -Expiration "2023-12-31T23:59:59.008Z" -OSGroupName osgroupName -ExtendedLocationName /subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/customLocationName -PrivilegeLevel Superuser -JumpHostsAllowed "192.0.0.1" -ExtendedLocationType CustomLocation -Location EastUs -Tag $tagHash -UserList $userList -SubscriptionId subscriptionId +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySet +Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySet .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. +CLUSTERINPUTOBJECT : Identity Parameter + [AgentPoolName ]: The name of the Kubernetes cluster agent pool. + [BareMetalMachineKeySetName ]: The name of the bare metal machine key set. + [BareMetalMachineName ]: The name of the bare metal machine. + [BmcKeySetName ]: The name of the baseboard management controller key set. + [CloudServicesNetworkName ]: The name of the cloud services network. + [ClusterManagerName ]: The name of the cluster manager. + [ClusterName ]: The name of the cluster. + [ConsoleName ]: The name of the virtual machine console. + [FeatureName ]: The name of the feature. + [Id ]: Resource identity path + [KubernetesClusterName ]: The name of the Kubernetes cluster. + [L2NetworkName ]: The name of the L2 network. + [L3NetworkName ]: The name of the L3 network. + [MetricsConfigurationName ]: The name of the metrics configuration for the cluster. + [RackName ]: The name of the rack. + [RackSkuName ]: The name of the rack SKU. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [StorageApplianceName ]: The name of the storage appliance. + [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. + [TrunkedNetworkName ]: The name of the trunked network. + [VirtualMachineName ]: The name of the virtual machine. + [VolumeName ]: The name of the volume. + USERLIST : The unique list of permitted users. AzureUserName : The user name that will be used for access. SshPublicKeyData : The SSH public key data. @@ -8095,15 +8900,9 @@ USERLIST : The unique list of permitted users. https://learn.microsoft.com/powershell/module/az.networkcloud/new-aznetworkcloudbaremetalmachinekeyset #> function New-AzNetworkCloudBareMetalMachineKeySet { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySet])] -[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySet])] +[CmdletBinding(DefaultParameterSetName='CreateViaIdentityClusterExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( - [Parameter(Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] - [System.String] - # The name of the cluster. - ${ClusterName}, - [Parameter(Mandatory)] [Alias('BareMetalMachineKeySetName')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] @@ -8111,14 +8910,26 @@ param( # The name of the bare metal machine key set. ${Name}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] + [System.String] + # The name of the cluster. + ${ClusterName}, + + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] @@ -8126,6 +8937,12 @@ param( # The value must be an UUID. ${SubscriptionId}, + [Parameter(ParameterSetName='CreateViaIdentityClusterExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] + # Identity Parameter + ${ClusterInputObject}, + [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Header')] [System.String] @@ -8141,72 +8958,93 @@ param( # Other values will result in error from server as they are not supported. ${IfNoneMatch}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaIdentityClusterExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The object ID of Azure Active Directory group that all users in the list must be in for access to be granted. # Users that are not in the group will not have access. ${AzureGroupId}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaIdentityClusterExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.DateTime] # The date and time after which the users in this key set will be removed from the bare metal machines. ${Expiration}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaIdentityClusterExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The resource ID of the extended location on which the resource will be created. ${ExtendedLocationName}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaIdentityClusterExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The extended location type, for example, CustomLocation. ${ExtendedLocationType}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaIdentityClusterExpanded', Mandatory)] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String[]] # The list of IP addresses of jump hosts with management network access from which a login will be allowed for the users. ${JumpHostsAllowed}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaIdentityClusterExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The geo-location where the resource lives ${Location}, - [Parameter(Mandatory)] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineKeySetPrivilegeLevel])] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaIdentityClusterExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Standard", "Superuser")] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineKeySetPrivilegeLevel] + [System.String] # The access level allowed for the users in this key set. ${PrivilegeLevel}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaIdentityClusterExpanded', Mandatory)] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKeySetUser[]] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKeySetUser[]] # The unique list of permitted users. - # To construct, see NOTES section for USERLIST properties and create a hash table. ${UserList}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityClusterExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The name of the group that users will be assigned to on the operating system of the machines. ${OSGroupName}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityClusterExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceTags]))] [System.Collections.Hashtable] # Resource tags. ${Tag}, + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Path of Json file supplied to the Create operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Json string supplied to the Create operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -8275,6 +9113,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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() @@ -8295,10 +9142,11 @@ begin { $mapping = @{ CreateExpanded = 'Az.NetworkCloud.private\New-AzNetworkCloudBareMetalMachineKeySet_CreateExpanded'; + CreateViaIdentityClusterExpanded = 'Az.NetworkCloud.private\New-AzNetworkCloudBareMetalMachineKeySet_CreateViaIdentityClusterExpanded'; + CreateViaJsonFilePath = 'Az.NetworkCloud.private\New-AzNetworkCloudBareMetalMachineKeySet_CreateViaJsonFilePath'; + CreateViaJsonString = 'Az.NetworkCloud.private\New-AzNetworkCloudBareMetalMachineKeySet_CreateViaJsonString'; } - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 { @@ -8312,6 +9160,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) @@ -8357,9 +9208,9 @@ end { <# .Synopsis -Create a new baseboard management controller key set or update the existing one for the provided cluster. +Create a new baseboard management controller key set or create the existing one for the provided cluster. .Description -Create a new baseboard management controller key set or update the existing one for the provided cluster. +Create a new baseboard management controller key set or create the existing one for the provided cluster. .Example $tagHash = @{ tag = "tag" @@ -8373,31 +9224,51 @@ $userList = @{ New-AzNetworkCloudBmcKeySet -ResourceGroupName resourceGroupName -Name baseboardmgtcontrollerkeysetname -ClusterName clusterName -AzureGroupId azuregroupid -Expiration "2023-12-31T23:59:59.008Z" -ExtendedLocationName /subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/customLocationName -PrivilegeLevel ReadOnly -ExtendedLocationType CustomLocation -Location EastUs -Tag $tagHash -UserList $userList +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySet +Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySet .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. -USERLIST : The unique list of permitted users. - AzureUserName : The user name that will be used for access. - SshPublicKeyData : The SSH public key data. - [Description ]: The free-form description for this user. - [UserPrincipalName ]: The user principal name (email format) used to validate this user's group membership. -.Link -https://learn.microsoft.com/powershell/module/az.networkcloud/new-aznetworkcloudbmckeyset -#> -function New-AzNetworkCloudBmcKeySet { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySet])] -[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] -param( - [Parameter(Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] - [System.String] - # The name of the cluster. - ${ClusterName}, +CLUSTERINPUTOBJECT : Identity Parameter + [AgentPoolName ]: The name of the Kubernetes cluster agent pool. + [BareMetalMachineKeySetName ]: The name of the bare metal machine key set. + [BareMetalMachineName ]: The name of the bare metal machine. + [BmcKeySetName ]: The name of the baseboard management controller key set. + [CloudServicesNetworkName ]: The name of the cloud services network. + [ClusterManagerName ]: The name of the cluster manager. + [ClusterName ]: The name of the cluster. + [ConsoleName ]: The name of the virtual machine console. + [FeatureName ]: The name of the feature. + [Id ]: Resource identity path + [KubernetesClusterName ]: The name of the Kubernetes cluster. + [L2NetworkName ]: The name of the L2 network. + [L3NetworkName ]: The name of the L3 network. + [MetricsConfigurationName ]: The name of the metrics configuration for the cluster. + [RackName ]: The name of the rack. + [RackSkuName ]: The name of the rack SKU. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [StorageApplianceName ]: The name of the storage appliance. + [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. + [TrunkedNetworkName ]: The name of the trunked network. + [VirtualMachineName ]: The name of the virtual machine. + [VolumeName ]: The name of the volume. +USERLIST : The unique list of permitted users. + AzureUserName : The user name that will be used for access. + SshPublicKeyData : The SSH public key data. + [Description ]: The free-form description for this user. + [UserPrincipalName ]: The user principal name (email format) used to validate this user's group membership. +.Link +https://learn.microsoft.com/powershell/module/az.networkcloud/new-aznetworkcloudbmckeyset +#> +function New-AzNetworkCloudBmcKeySet { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySet])] +[CmdletBinding(DefaultParameterSetName='CreateViaIdentityClusterExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( [Parameter(Mandatory)] [Alias('BmcKeySetName')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] @@ -8405,14 +9276,26 @@ param( # The name of the baseboard management controller key set. ${Name}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] + [System.String] + # The name of the cluster. + ${ClusterName}, + + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] @@ -8420,6 +9303,12 @@ param( # The value must be an UUID. ${SubscriptionId}, + [Parameter(ParameterSetName='CreateViaIdentityClusterExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] + # Identity Parameter + ${ClusterInputObject}, + [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Header')] [System.String] @@ -8435,59 +9324,78 @@ param( # Other values will result in error from server as they are not supported. ${IfNoneMatch}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaIdentityClusterExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The object ID of Azure Active Directory group that all users in the list must be in for access to be granted. # Users that are not in the group will not have access. ${AzureGroupId}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaIdentityClusterExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.DateTime] # The date and time after which the users in this key set will be removed from the baseboard management controllers. ${Expiration}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaIdentityClusterExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The resource ID of the extended location on which the resource will be created. ${ExtendedLocationName}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaIdentityClusterExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The extended location type, for example, CustomLocation. ${ExtendedLocationType}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaIdentityClusterExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The geo-location where the resource lives ${Location}, - [Parameter(Mandatory)] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BmcKeySetPrivilegeLevel])] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaIdentityClusterExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("ReadOnly", "Administrator")] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BmcKeySetPrivilegeLevel] + [System.String] # The access level allowed for the users in this key set. ${PrivilegeLevel}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaIdentityClusterExpanded', Mandatory)] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKeySetUser[]] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKeySetUser[]] # The unique list of permitted users. - # To construct, see NOTES section for USERLIST properties and create a hash table. ${UserList}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityClusterExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceTags]))] [System.Collections.Hashtable] # Resource tags. ${Tag}, + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Path of Json file supplied to the Create operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Json string supplied to the Create operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -8556,6 +9464,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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() @@ -8576,10 +9493,11 @@ begin { $mapping = @{ CreateExpanded = 'Az.NetworkCloud.private\New-AzNetworkCloudBmcKeySet_CreateExpanded'; + CreateViaIdentityClusterExpanded = 'Az.NetworkCloud.private\New-AzNetworkCloudBmcKeySet_CreateViaIdentityClusterExpanded'; + CreateViaJsonFilePath = 'Az.NetworkCloud.private\New-AzNetworkCloudBmcKeySet_CreateViaJsonFilePath'; + CreateViaJsonString = 'Az.NetworkCloud.private\New-AzNetworkCloudBmcKeySet_CreateViaJsonString'; } - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 { @@ -8593,6 +9511,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) @@ -8638,9 +9559,9 @@ end { <# .Synopsis -Create a new cluster manager or update properties of the cluster manager if it exists. +Create a new cluster manager or create properties of the cluster manager if it exists. .Description -Create a new cluster manager or update properties of the cluster manager if it exists. +Create a new cluster manager or create properties of the cluster manager if it exists. .Example $tagHash = @{ tag1 = "true" @@ -8650,12 +9571,12 @@ $tagHash = @{ New-AzNetworkCloudClusterManager -Name cnName -Location location -ResourceGroupName resourceGroupName -SubscriptionId subscriptionId -AnalyticsWorkspaceId "" -ManagedResourceGroupConfigurationName mrgName -FabricControllerId fabricControllerID -Tag $tagHash .Outputs -Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManager +Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManager .Link https://learn.microsoft.com/powershell/module/az.networkcloud/new-aznetworkcloudclustermanager #> function New-AzNetworkCloudClusterManager { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManager])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManager])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] @@ -8695,25 +9616,25 @@ param( # Other values will result in error from server as they are not supported. ${IfNoneMatch}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The resource ID of the fabric controller that has one to one mapping with the cluster manager. ${FabricControllerId}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The geo-location where the resource lives ${Location}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The resource ID of the Log Analytics workspace that is used for the logs collection. ${AnalyticsWorkspaceId}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String[]] @@ -8721,50 +9642,60 @@ param( # The Azure availability zones within the region that will be used to support the cluster manager resource. ${AvailabilityZone}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentityType])] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentityType] - # Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). - ${IdentityType}, - - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.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}, + [System.Management.Automation.SwitchParameter] + # Determines whether to enable a system-assigned identity for the resource. + ${EnableSystemAssignedIdentity}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The location of the managed resource group. # If not specified, the location of the parent resource is chosen. ${ManagedResourceGroupConfigurationLocation}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The name for the managed resource group. # If not specified, the unique name is automatically generated. ${ManagedResourceGroupConfigurationName}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceTags]))] [System.Collections.Hashtable] # Resource tags. ${Tag}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category('Body')] [System.String] # Field deprecated, this value will no longer influence the cluster manager allocation process and will be removed in a future version. # The size of the Azure virtual machines to use for hosting the cluster manager resource. ${VMSize}, + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Path of Json file supplied to the Create operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Json string supplied to the Create operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -8833,6 +9764,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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() @@ -8853,10 +9793,10 @@ begin { $mapping = @{ CreateExpanded = 'Az.NetworkCloud.private\New-AzNetworkCloudClusterManager_CreateExpanded'; + CreateViaJsonFilePath = 'Az.NetworkCloud.private\New-AzNetworkCloudClusterManager_CreateViaJsonFilePath'; + CreateViaJsonString = 'Az.NetworkCloud.private\New-AzNetworkCloudClusterManager_CreateViaJsonString'; } - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 { @@ -8870,6 +9810,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) @@ -8915,13 +9858,13 @@ end { <# .Synopsis -Create a new cluster or update the properties of the cluster if it exists. +Create a new cluster or create the properties of the cluster if it exists. .Description -Create a new cluster or update the properties of the cluster if it exists. +Create a new cluster or create the properties of the cluster if it exists. .Example $storageapplianceconfigurationdata = @() $baremetalmachineconfigurationdata = @() -$computerackdefinition = @(@{IRackDefinition = "The list of rack definitions for the compute racks in a multi-rackcluster, or an empty list in a single-rack cluster."}) +$computerackdefinition = @(@{IRackDefinition = "The list of rack definitions for the compute racks in a multi-rack cluster, or an empty list in a single-rack cluster."}) $tagHash = @{ tag = "tag" } @@ -8931,20 +9874,18 @@ New-AzNetworkCloudCluster -ResourceGroupName resourceGroup -Name clusterName -Ag .Example $storageapplianceconfigurationdata = @() $baremetalmachineconfigurationdata = @() -$computerackdefinition = @(@{IRackDefinition = "The list of rack definitions for the compute racks in a multi-rackcluster, or an empty list in a single-rack cluster."}) +$computerackdefinition = @(@{IRackDefinition = "The list of rack definitions for the compute racks in a multi-rack cluster, or an empty list in a single-rack cluster."}) $tagHash = @{ tag = "tag" } $securePassword = ConvertTo-SecureString "password" -asplaintext -force -$identityUserAssignedIdentity = @{} $userAssignedIdentityResourceId = "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myManagedIdentity" -$identityUserAssignedIdentity.Add($userAssignedIdentityResourceId, @{}) -New-AzNetworkCloudCluster -ResourceGroupName resourceGroup -Name clusterName -AggregatorOrSingleRackDefinitionNetworkRackId rackId -AggregatorOrSingleRackDefinitionRackSerialNumber sr1234 -AggregatorOrSingleRackDefinitionRackSkuId rackSku -ClusterType clustertype -IdentityType identityType -IdentityUserAssignedIdentity $identityUserAssignedIdentity -ClusterVersion clusterversion -ExtendedLocationName CmExtendedLocation -ExtendedLocationType CustomLocation -Location location -NetworkFabricId networkFabricId -SubscriptionId subscriptionId -AggregatorOrSingleRackDefinitionAvailabilityZone availabilityZone -AggregatorOrSingleRackDefinitionBareMetalMachineConfiguration $baremetalmachineconfigurationdata -AggregatorOrSingleRackDefinitionRackLocation rackLocation -AggregatorOrSingleRackDefinitionStorageApplianceConfiguration $storageapplianceconfigurationdata -AnalyticOutputSettingAnalyticsWorkspaceId analyticsWorkspaceId -AnalyticsOutputSettingsAssociatedIdentityType identityType -AnalyticsOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId userAssignedIdentityResourceId -AnalyticsWorkspaceId analyticsWorkspaceId -CommandOutputSettingContainerUrl containerUrl -AssociatedIdentityType commandOutputSettingsIdentityType -AssociatedIdentityUserAssignedIdentityResourceId commandOutputSettingsUserAssignedIdentityResourceId -ClusterServicePrincipalApplicationId clusterServicePrincipalAppId -ClusterServicePrincipalId ClusterServicePrincipalId -ClusterServicePrincipalPassword $securePassword -ClusterServicePrincipalTenantId tenantId -ComputeRackDefinition $computerackdefinition -SecretArchiveKeyVaultId keyVaultId -SecretArchiveSettingVaultUri keyVaultUri -SecretArchiveSettingsAssociatedIdentityType identityType -SecretArchiveSettingsAssociatedIdentityUserAssignedIdentityResourceId userAssignedIdentityResourceId -SecretArchiveUseKeyVault useKeyVault -UpdateStrategyThresholdType updateStrategyThresholdType -UpdateStrategyThresholdValue updateStrategyThresholdValue -UpdateStrategyType updateStrategyType -UpdateStrategyWaitTimeMinute updateStrategyWaitTimeMinutes -VulnerabilityScanningSettingContainerScan vulnerabilityScanningSettingContainerScan -ComputeDeploymentThresholdGrouping computeDeploymentThresholdGrouping -ComputeDeploymentThresholdType computeDeploymentThresholdType -ComputeDeploymentThresholdValue computeDeploymentThresholdValue -Tag $tagHash +New-AzNetworkCloudCluster -ResourceGroupName resourceGroup -Name clusterName -AggregatorOrSingleRackDefinitionNetworkRackId rackId -AggregatorOrSingleRackDefinitionRackSerialNumber sr1234 -AggregatorOrSingleRackDefinitionRackSkuId rackSku -ClusterType clustertype -UserAssignedIdentity $userAssignedIdentityResourceId -ClusterVersion clusterversion -ExtendedLocationName CmExtendedLocation -ExtendedLocationType CustomLocation -Location location -NetworkFabricId networkFabricId -SubscriptionId subscriptionId -AggregatorOrSingleRackDefinitionAvailabilityZone availabilityZone -AggregatorOrSingleRackDefinitionBareMetalMachineConfiguration $baremetalmachineconfigurationdata -AggregatorOrSingleRackDefinitionRackLocation rackLocation -AggregatorOrSingleRackDefinitionStorageApplianceConfiguration $storageapplianceconfigurationdata -AnalyticOutputSettingAnalyticsWorkspaceId analyticsWorkspaceId -AnalyticsOutputSettingsAssociatedIdentityType identityType -AnalyticsOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId userAssignedIdentityResourceId -AnalyticsWorkspaceId analyticsWorkspaceId -CommandOutputSettingContainerUrl containerUrl -AssociatedIdentityType commandOutputSettingsIdentityType -AssociatedIdentityUserAssignedIdentityResourceId commandOutputSettingsUserAssignedIdentityResourceId -ClusterServicePrincipalApplicationId clusterServicePrincipalAppId -ClusterServicePrincipalId ClusterServicePrincipalId -ClusterServicePrincipalPassword $securePassword -ClusterServicePrincipalTenantId tenantId -ComputeRackDefinition $computerackdefinition -SecretArchiveKeyVaultId keyVaultId -SecretArchiveSettingVaultUri keyVaultUri -SecretArchiveSettingsAssociatedIdentityType identityType -SecretArchiveSettingsAssociatedIdentityUserAssignedIdentityResourceId userAssignedIdentityResourceId -SecretArchiveUseKeyVault useKeyVault -UpdateStrategyThresholdType updateStrategyThresholdType -UpdateStrategyThresholdValue updateStrategyThresholdValue -UpdateStrategyType updateStrategyType -UpdateStrategyWaitTimeMinute updateStrategyWaitTimeMinutes -VulnerabilityScanningSettingContainerScan vulnerabilityScanningSettingContainerScan -ComputeDeploymentThresholdGrouping computeDeploymentThresholdGrouping -ComputeDeploymentThresholdType computeDeploymentThresholdType -ComputeDeploymentThresholdValue computeDeploymentThresholdValue -Tag $tagHash .Outputs -Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICluster +Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICluster .Notes COMPLEX PARAMETER PROPERTIES @@ -8967,12 +9908,12 @@ AGGREGATORORSINGLERACKDEFINITIONSTORAGEAPPLIANCECONFIGURATION : The serial number of the appliance. [StorageApplianceName ]: The user-provided name for the storage appliance that will be created from this specification. -COMPUTERACKDEFINITION : The list of rack definitions for the compute racks in a multi-rackcluster, or an empty list in a single-rack cluster. +COMPUTERACKDEFINITION : The list of rack definitions for the compute racks in a multi-rack cluster, or an empty list in a single-rack cluster. NetworkRackId : The resource ID of the network rack that matches this rack definition. RackSerialNumber : The unique identifier for the rack within Network Cloud cluster. An alternate unique alphanumeric value other than a serial number may be provided if desired. RackSkuId : The resource ID of the sku for the rack being added. [AvailabilityZone ]: The zone name used for this rack when created. Availability zones are used for workload placement. - [BareMetalMachineConfigurationData ]: The unordered list of bare metal machine configuration. + [BareMetalMachineConfigurationData >]: The unordered list of bare metal machine configuration. BmcCredentialsPassword : The password of the administrator of the device used during initialization. BmcCredentialsUsername : The username of the administrator of the device used during initialization. BmcMacAddress : The MAC address of the BMC for this machine. @@ -8982,7 +9923,7 @@ COMPUTERACKDEFINITION : The list of rack definitions for the [MachineDetail ]: The free-form additional information about the machine, e.g. an asset tag. [MachineName ]: The user-provided name for the bare metal machine created from this specification. If not provided, the machine name will be generated programmatically. [RackLocation ]: The free-form description of the rack's location. - [StorageApplianceConfigurationData ]: The list of storage appliance configuration data for this rack. + [StorageApplianceConfigurationData >]: The list of storage appliance configuration data for this rack. AdminCredentialsPassword : The password of the administrator of the device used during initialization. AdminCredentialsUsername : The username of the administrator of the device used during initialization. RackSlot : The slot that storage appliance is in the rack based on the BOM configuration. @@ -8992,7 +9933,7 @@ COMPUTERACKDEFINITION : The list of rack definitions for the https://learn.microsoft.com/powershell/module/az.networkcloud/new-aznetworkcloudcluster #> function New-AzNetworkCloudCluster { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICluster])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICluster])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] @@ -9032,312 +9973,319 @@ param( # Other values will result in error from server as they are not supported. ${IfNoneMatch}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The resource ID of the network rack that matches this rack definition. ${AggregatorOrSingleRackDefinitionNetworkRackId}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The unique identifier for the rack within Network Cloud cluster. # An alternate unique alphanumeric value other than a serial number may be provided if desired. ${AggregatorOrSingleRackDefinitionRackSerialNumber}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The resource ID of the sku for the rack being added. ${AggregatorOrSingleRackDefinitionRackSkuId}, - [Parameter(Mandatory)] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterType])] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("SingleRack", "MultiRack")] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterType] + [System.String] # The type of rack configuration for the cluster. ${ClusterType}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The current runtime version of the cluster. ${ClusterVersion}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The resource ID of the extended location on which the resource will be created. ${ExtendedLocationName}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The extended location type, for example, CustomLocation. ${ExtendedLocationType}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The geo-location where the resource lives ${Location}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The resource ID of the Network Fabric associated with the cluster. ${NetworkFabricId}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The zone name used for this rack when created. # Availability zones are used for workload placement. ${AggregatorOrSingleRackDefinitionAvailabilityZone}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineConfigurationData[]] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineConfigurationData[]] # The unordered list of bare metal machine configuration. - # To construct, see NOTES section for AGGREGATORORSINGLERACKDEFINITIONBAREMETALMACHINECONFIGURATION properties and create a hash table. ${AggregatorOrSingleRackDefinitionBareMetalMachineConfiguration}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The free-form description of the rack's location. ${AggregatorOrSingleRackDefinitionRackLocation}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceConfigurationData[]] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceConfigurationData[]] # The list of storage appliance configuration data for this rack. - # To construct, see NOTES section for AGGREGATORORSINGLERACKDEFINITIONSTORAGEAPPLIANCECONFIGURATION properties and create a hash table. ${AggregatorOrSingleRackDefinitionStorageApplianceConfiguration}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The resource ID of the analytics workspace that is to be used by the specified identity. ${AnalyticOutputSettingAnalyticsWorkspaceId}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType])] + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("SystemAssignedIdentity", "UserAssignedIdentity")] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType] + [System.String] # The type of managed identity that is being selected. ${AnalyticsOutputSettingsAssociatedIdentityType}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The user assigned managed identity resource ID to use. # Mutually exclusive with a system assigned identity type. ${AnalyticsOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # Field Deprecated. # The resource ID of the Log Analytics Workspace that will be used for storing relevant logs. ${AnalyticsWorkspaceId}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType])] + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("SystemAssignedIdentity", "UserAssignedIdentity")] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType] + [System.String] # The type of associated identity for CommandOutputSettings. ${AssociatedIdentityType}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The resource ID of the user assigned identity for CommandOutputSettings. ${AssociatedIdentityUserAssignedIdentityResourceId}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The customer-provided location information to identify where the cluster resides. ${ClusterLocation}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The application ID, also known as client ID, of the service principal. ${ClusterServicePrincipalApplicationId}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The principal ID, also known as the object ID, of the service principal. ${ClusterServicePrincipalId}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.Security.SecureString] # The password of the service principal. ${ClusterServicePrincipalPassword}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The tenant ID, also known as the directory ID, of the tenant in which the service principal is created. ${ClusterServicePrincipalTenantId}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The URL of the storage account container that is to be used by the specified identities. ${CommandOutputSettingContainerUrl}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdGrouping])] + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("PerCluster", "PerRack")] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdGrouping] + [System.String] # Selection of how the type evaluation is applied to the cluster calculation. ${ComputeDeploymentThresholdGrouping}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdType])] + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("CountSuccess", "PercentSuccess")] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdType] + [System.String] # Selection of how the threshold should be evaluated. ${ComputeDeploymentThresholdType}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.Int64] # The numeric threshold value. ${ComputeDeploymentThresholdValue}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackDefinition[]] - # The list of rack definitions for the compute racks in a multi-rackcluster, or an empty list in a single-rack cluster. - # To construct, see NOTES section for COMPUTERACKDEFINITION properties and create a hash table. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackDefinition[]] + # The list of rack definitions for the compute racks in a multi-rack cluster, or an empty list in a single-rack cluster. ${ComputeRackDefinition}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentityType])] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentityType] - # Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). - ${IdentityType}, - - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.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}, + [System.Management.Automation.SwitchParameter] + # Determines whether to enable a system-assigned identity for the resource. + ${EnableSystemAssignedIdentity}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The location of the managed resource group. # If not specified, the location of the parent resource is chosen. ${ManagedResourceGroupConfigurationLocation}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The name for the managed resource group. # If not specified, the unique name is automatically generated. ${ManagedResourceGroupConfigurationName}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RuntimeProtectionEnforcementLevel])] + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Audit", "Disabled", "OnDemand", "Passive", "RealTime")] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RuntimeProtectionEnforcementLevel] + [System.String] # The mode of operation for runtime protection. ${RuntimeProtectionConfigurationEnforcementLevel}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The resource ID of the key vault to archive the secrets of the cluster. ${SecretArchiveKeyVaultId}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The URI for the key vault used as the secret archive. ${SecretArchiveSettingVaultUri}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType])] + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("SystemAssignedIdentity", "UserAssignedIdentity")] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType] + [System.String] # The type of managed identity that is being selected. ${SecretArchiveSettingsAssociatedIdentityType}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The user assigned managed identity resource ID to use. # Mutually exclusive with a system assigned identity type. ${SecretArchiveSettingsAssociatedIdentityUserAssignedIdentityResourceId}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterSecretArchiveEnabled])] + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("True", "False")] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterSecretArchiveEnabled] + [System.String] # The indicator if the specified key vault should be used to archive the secrets of the cluster. ${SecretArchiveUseKeyVault}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceTags]))] [System.Collections.Hashtable] # Resource tags. ${Tag}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.Int64] # The maximum number of worker nodes that can be offline within the increment of update, e.g., rack-by-rack.Limited by the maximum number of machines in the increment. # Defaults to the whole increment size. ${UpdateStrategyMaxUnavailable}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdType])] + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("CountSuccess", "PercentSuccess")] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdType] + [System.String] # Selection of how the threshold should be evaluated. ${UpdateStrategyThresholdType}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.Int64] # The numeric threshold value. ${UpdateStrategyThresholdValue}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterUpdateStrategyType])] + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Rack", "PauseAfterRack")] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterUpdateStrategyType] + [System.String] # The mode of operation for runtime protection. ${UpdateStrategyType}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.Int64] # The time to wait between the increments of update defined by the strategy. ${UpdateStrategyWaitTimeMinute}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VulnerabilityScanningSettingsContainerScan])] + [Parameter(ParameterSetName='CreateExpanded')] + [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VulnerabilityScanningSettingsContainerScan] + [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.NetworkCloud.PSArgumentCompleterAttribute("Disabled", "Enabled")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] # The mode selection for container vulnerability scanning. ${VulnerabilityScanningSettingContainerScan}, + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Path of Json file supplied to the Create operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Json string supplied to the Create operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -9406,6 +10354,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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() @@ -9426,10 +10383,10 @@ begin { $mapping = @{ CreateExpanded = 'Az.NetworkCloud.private\New-AzNetworkCloudCluster_CreateExpanded'; + CreateViaJsonFilePath = 'Az.NetworkCloud.private\New-AzNetworkCloudCluster_CreateViaJsonFilePath'; + CreateViaJsonString = 'Az.NetworkCloud.private\New-AzNetworkCloudCluster_CreateViaJsonString'; } - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 { @@ -9443,6 +10400,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) @@ -9488,19 +10448,49 @@ end { <# .Synopsis -Create a new virtual machine console or update the properties of the existing virtual machine console. +Create a new virtual machine console or create the properties of the existing virtual machine console. .Description -Create a new virtual machine console or update the properties of the existing virtual machine console. +Create a new virtual machine console or create the properties of the existing virtual machine console. .Example New-AzNetworkCloudConsole -ResourceGroupName resourceGroupName -Location location -ExtendedLocationName "/subscriptions/subscriptionId/resourcegroups/clusterManagerHostedResourceGroup/providers/microsoft.extendedlocation/customlocations/clusterManagerExtendedLocation" -ExtendedLocationType "CustomLocation" -SubscriptionId subscriptionId -Tag @{tags="tag1"} -Enabled ConsoleEnabled.True -VirtualMachineName virtualMachineName -SshPublicKeyData "ssh-rsa StNw+/C+g0tOZLT9OKK6YTovOn= fakekey@vm" -Expiration "2025-02-01T01:27:03.008Z" +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsole +Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsole +.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. + +VIRTUALMACHINEINPUTOBJECT : Identity Parameter + [AgentPoolName ]: The name of the Kubernetes cluster agent pool. + [BareMetalMachineKeySetName ]: The name of the bare metal machine key set. + [BareMetalMachineName ]: The name of the bare metal machine. + [BmcKeySetName ]: The name of the baseboard management controller key set. + [CloudServicesNetworkName ]: The name of the cloud services network. + [ClusterManagerName ]: The name of the cluster manager. + [ClusterName ]: The name of the cluster. + [ConsoleName ]: The name of the virtual machine console. + [FeatureName ]: The name of the feature. + [Id ]: Resource identity path + [KubernetesClusterName ]: The name of the Kubernetes cluster. + [L2NetworkName ]: The name of the L2 network. + [L3NetworkName ]: The name of the L3 network. + [MetricsConfigurationName ]: The name of the metrics configuration for the cluster. + [RackName ]: The name of the rack. + [RackSkuName ]: The name of the rack SKU. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [StorageApplianceName ]: The name of the storage appliance. + [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. + [TrunkedNetworkName ]: The name of the trunked network. + [VirtualMachineName ]: The name of the virtual machine. + [VolumeName ]: The name of the volume. .Link https://learn.microsoft.com/powershell/module/az.networkcloud/new-aznetworkcloudconsole #> function New-AzNetworkCloudConsole { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsole])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsole])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] @@ -9510,20 +10500,18 @@ param( # The name of the virtual machine console. ${Name}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [System.String] # The name of the resource group. # The name is case insensitive. ${ResourceGroupName}, - [Parameter(Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] - [System.String] - # The name of the virtual machine. - ${VirtualMachineName}, - - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaJsonFilePath')] + [Parameter(ParameterSetName='CreateViaJsonString')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] @@ -9531,6 +10519,20 @@ param( # The value must be an UUID. ${SubscriptionId}, + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] + [System.String] + # The name of the virtual machine. + ${VirtualMachineName}, + + [Parameter(ParameterSetName='CreateViaIdentityVirtualMachineExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] + # Identity Parameter + ${VirtualMachineInputObject}, + [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Header')] [System.String] @@ -9546,50 +10548,69 @@ param( # Other values will result in error from server as they are not supported. ${IfNoneMatch}, - [Parameter(Mandatory)] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ConsoleEnabled])] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaIdentityVirtualMachineExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("True", "False")] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ConsoleEnabled] + [System.String] # The indicator of whether the console access is enabled. ${Enabled}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaIdentityVirtualMachineExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The resource ID of the extended location on which the resource will be created. ${ExtendedLocationName}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaIdentityVirtualMachineExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The extended location type, for example, CustomLocation. ${ExtendedLocationType}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaIdentityVirtualMachineExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The geo-location where the resource lives ${Location}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaIdentityVirtualMachineExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The SSH public key data. ${SshPublicKeyData}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityVirtualMachineExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.DateTime] # The date and time after which the key will be disallowed access. ${Expiration}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityVirtualMachineExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceTags]))] [System.Collections.Hashtable] # Resource tags. ${Tag}, + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Path of Json file supplied to the Create operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Json string supplied to the Create operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -9658,6 +10679,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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() @@ -9678,10 +10708,11 @@ begin { $mapping = @{ CreateExpanded = 'Az.NetworkCloud.private\New-AzNetworkCloudConsole_CreateExpanded'; + CreateViaIdentityVirtualMachineExpanded = 'Az.NetworkCloud.private\New-AzNetworkCloudConsole_CreateViaIdentityVirtualMachineExpanded'; + CreateViaJsonFilePath = 'Az.NetworkCloud.private\New-AzNetworkCloudConsole_CreateViaJsonFilePath'; + CreateViaJsonString = 'Az.NetworkCloud.private\New-AzNetworkCloudConsole_CreateViaJsonString'; } - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 { @@ -9695,6 +10726,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) @@ -9740,27 +10774,53 @@ end { <# .Synopsis -Create a new Kubernetes cluster feature or update properties of the Kubernetes cluster feature if it exists. +Create a new Kubernetes cluster feature or create properties of the Kubernetes cluster feature if it exists. .Description -Create a new Kubernetes cluster feature or update properties of the Kubernetes cluster feature if it exists. +Create a new Kubernetes cluster feature or create properties of the Kubernetes cluster feature if it exists. .Example New-AzNetworkCloudKubernetesClusterFeature -FeatureName featureName -KubernetesClusterName kubernetesClusterName -ResourceGroupName resourceGroup -SubscriptionId subscriptionId -Location location -Tag @{"key"="value"} +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeature +Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeature .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. +KUBERNETESCLUSTERINPUTOBJECT : Identity Parameter + [AgentPoolName ]: The name of the Kubernetes cluster agent pool. + [BareMetalMachineKeySetName ]: The name of the bare metal machine key set. + [BareMetalMachineName ]: The name of the bare metal machine. + [BmcKeySetName ]: The name of the baseboard management controller key set. + [CloudServicesNetworkName ]: The name of the cloud services network. + [ClusterManagerName ]: The name of the cluster manager. + [ClusterName ]: The name of the cluster. + [ConsoleName ]: The name of the virtual machine console. + [FeatureName ]: The name of the feature. + [Id ]: Resource identity path + [KubernetesClusterName ]: The name of the Kubernetes cluster. + [L2NetworkName ]: The name of the L2 network. + [L3NetworkName ]: The name of the L3 network. + [MetricsConfigurationName ]: The name of the metrics configuration for the cluster. + [RackName ]: The name of the rack. + [RackSkuName ]: The name of the rack SKU. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [StorageApplianceName ]: The name of the storage appliance. + [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. + [TrunkedNetworkName ]: The name of the trunked network. + [VirtualMachineName ]: The name of the virtual machine. + [VolumeName ]: The name of the volume. + OPTION : The configured options for the feature. - Key : The key to the mapped value. - Value : The value of the mapping key. + [Key ]: The key to the mapped value. + [Value ]: The value of the mapping key. .Link https://learn.microsoft.com/powershell/module/az.networkcloud/new-aznetworkcloudkubernetesclusterfeature #> function New-AzNetworkCloudKubernetesClusterFeature { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeature])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeature])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] @@ -9769,20 +10829,26 @@ param( # The name of the feature. ${FeatureName}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [System.String] # The name of the Kubernetes cluster. ${KubernetesClusterName}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] @@ -9790,6 +10856,12 @@ param( # The value must be an UUID. ${SubscriptionId}, + [Parameter(ParameterSetName='CreateViaIdentityKubernetesClusterExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] + # Identity Parameter + ${KubernetesClusterInputObject}, + [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Header')] [System.String] @@ -9805,27 +10877,41 @@ param( # Other values will result in error from server as they are not supported. ${IfNoneMatch}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaIdentityKubernetesClusterExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The geo-location where the resource lives ${Location}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityKubernetesClusterExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStringKeyValuePair[]] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStringKeyValuePair[]] # The configured options for the feature. - # To construct, see NOTES section for OPTION properties and create a hash table. ${Option}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityKubernetesClusterExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceTags]))] [System.Collections.Hashtable] # Resource tags. ${Tag}, + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Path of Json file supplied to the Create operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Json string supplied to the Create operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -9894,6 +10980,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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() @@ -9914,10 +11009,11 @@ begin { $mapping = @{ CreateExpanded = 'Az.NetworkCloud.private\New-AzNetworkCloudKubernetesClusterFeature_CreateExpanded'; + CreateViaIdentityKubernetesClusterExpanded = 'Az.NetworkCloud.private\New-AzNetworkCloudKubernetesClusterFeature_CreateViaIdentityKubernetesClusterExpanded'; + CreateViaJsonFilePath = 'Az.NetworkCloud.private\New-AzNetworkCloudKubernetesClusterFeature_CreateViaJsonFilePath'; + CreateViaJsonString = 'Az.NetworkCloud.private\New-AzNetworkCloudKubernetesClusterFeature_CreateViaJsonString'; } - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 { @@ -9931,6 +11027,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) @@ -9976,9 +11075,9 @@ end { <# .Synopsis -Create a new Kubernetes cluster or update the properties of the existing one. +Create a new Kubernetes cluster or create the properties of the existing one. .Description -Create a new Kubernetes cluster or update the properties of the existing one. +Create a new Kubernetes cluster or create the properties of the existing one. .Example $tagHash = @{tags = "tag1" } $agentPoolConfiguration = @{ @@ -10006,43 +11105,43 @@ New-AzNetworkCloudKubernetesCluster -ResourceGroupName resourceGroupName ` -Tag $tagHash .Outputs -Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesCluster +Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesCluster .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. ATTACHEDNETWORKCONFIGURATIONL2NETWORK : The list of Layer 2 Networks and related configuration for attachment. - NetworkId : The resource ID of the network that is being configured for attachment. - [PluginType ]: The indicator of how this network will be utilized by the Kubernetes cluster. + [NetworkId ]: The resource ID of the network that is being configured for attachment. + [PluginType ]: The indicator of how this network will be utilized by the Kubernetes cluster. ATTACHEDNETWORKCONFIGURATIONL3NETWORK : The list of Layer 3 Networks and related configuration for attachment. NetworkId : The resource ID of the network that is being configured for attachment. - [IpamEnabled ]: The indication of whether this network will or will not perform IP address management and allocate IP addresses when attached. - [PluginType ]: The indicator of how this network will be utilized by the Kubernetes cluster. + [IpamEnabled ]: The indication of whether this network will or will not perform IP address management and allocate IP addresses when attached. + [PluginType ]: The indicator of how this network will be utilized by the Kubernetes cluster. ATTACHEDNETWORKCONFIGURATIONTRUNKEDNETWORK : The list of Trunked Networks and related configuration for attachment. - NetworkId : The resource ID of the network that is being configured for attachment. - [PluginType ]: The indicator of how this network will be utilized by the Kubernetes cluster. + [NetworkId ]: The resource ID of the network that is being configured for attachment. + [PluginType ]: The indicator of how this network will be utilized by the Kubernetes cluster. BGPADVERTISEMENT : The association of IP address pools to the communities and peers, allowing for announcement of IPs. - IPAddressPool : The names of the IP address pools associated with this announcement. - [AdvertiseToFabric ]: The indicator of if this advertisement is also made to the network fabric associated with the Network Cloud Cluster. This field is ignored if fabricPeeringEnabled is set to False. - [Community ]: The names of the BGP communities to be associated with the announcement, utilizing a BGP community string in 1234:1234 format. - [Peer ]: The names of the BGP peers to limit this advertisement to. If no values are specified, all BGP peers will receive this advertisement. + IPAddressPool >: The names of the IP address pools associated with this announcement. + [AdvertiseToFabric ]: The indicator of if this advertisement is also made to the network fabric associated with the Network Cloud Cluster. This field is ignored if fabricPeeringEnabled is set to False. + [Community >]: The names of the BGP communities to be associated with the announcement, utilizing a BGP community string in 1234:1234 format. + [Peer >]: The names of the BGP peers to limit this advertisement to. If no values are specified, all BGP peers will receive this advertisement. BGPIPADDRESSPOOL : The list of pools of IP addresses that can be allocated to load balancer services. - Address : The list of IP address ranges. Each range can be a either a subnet in CIDR format or an explicit start-end range of IP addresses. For a BGP service load balancer configuration, only CIDR format is supported and excludes /32 (IPv4) and /128 (IPv6) prefixes. Name : The name used to identify this IP address pool for association with a BGP advertisement. - [AutoAssign ]: The indicator to determine if automatic allocation from the pool should occur. - [OnlyUseHostIP ]: The indicator to prevent the use of IP addresses ending with .0 and .255 for this pool. Enabling this option will only use IP addresses between .1 and .254 inclusive. + [Address >]: The list of IP address ranges. Each range can be a either a subnet in CIDR format or an explicit start-end range of IP addresses. For a BGP service load balancer configuration, only CIDR format is supported and excludes /32 (IPv4) and /128 (IPv6) prefixes. + [AutoAssign ]: The indicator to determine if automatic allocation from the pool should occur. + [OnlyUseHostIP ]: The indicator to prevent the use of IP addresses ending with .0 and .255 for this pool. Enabling this option will only use IP addresses between .1 and .254 inclusive. BGPPEER : The list of additional BgpPeer entities that the Kubernetes cluster will peer with. All peering must be explicitly defined. Name : The name used to identify this BGP peer for association with a BGP advertisement. PeerAddress : The IPv4 or IPv6 address used to connect this BGP session. PeerAsn : The autonomous system number expected from the remote end of the BGP session. - [BfdEnabled ]: The indicator of BFD enablement for this BgpPeer. - [BgpMultiHop ]: The indicator to enable multi-hop peering support. + [BfdEnabled ]: The indicator of BFD enablement for this BgpPeer. + [BgpMultiHop ]: The indicator to enable multi-hop peering support. [HoldTime ]: Field Deprecated. The field was previously optional, now it will have no defined behavior and will be ignored. The requested BGP hold time value. This field uses ISO 8601 duration format, for example P1H. [KeepAliveTime ]: Field Deprecated. The field was previously optional, now it will have no defined behavior and will be ignored. The requested BGP keepalive time value. This field uses ISO 8601 duration format, for example P1H. [MyAsn ]: The autonomous system number used for the local end of the BGP session. @@ -10054,38 +11153,38 @@ CONTROLPLANENODECONFIGURATIONADMINPUBLICKEY : The SSH configura INITIALAGENTPOOLCONFIGURATION : The agent pools that are created with this Kubernetes cluster for running critical system services and workloads. This data in this field is only used during creation, and the field will be empty following the creation of the Kubernetes Cluster. After creation, the management of agent pools is done using the agentPools sub-resource. Count : The number of virtual machines that use this configuration. - Mode : The selection of how this agent pool is utilized, either as a system pool or a user pool. System pools run the features and critical services for the Kubernetes Cluster, while user pools are dedicated to user workloads. Every Kubernetes cluster must contain at least one system node pool with at least one node. + Mode : The selection of how this agent pool is utilized, either as a system pool or a user pool. System pools run the features and critical services for the Kubernetes Cluster, while user pools are dedicated to user workloads. Every Kubernetes cluster must contain at least one system node pool with at least one node. Name : The name that will be used for the agent pool resource representing this agent pool. VMSkuName : The name of the VM SKU that determines the size of resources allocated for node VMs. [AdministratorConfigurationAdminUsername ]: The user name for the administrator that will be applied to the operating systems that run Kubernetes nodes. If not supplied, a user name will be chosen by the service. - [AdministratorConfigurationSshPublicKey ]: The SSH configuration for the operating systems that run the nodes in the Kubernetes cluster. In some cases, specification of public keys may be required to produce a working environment. + [AdministratorConfigurationSshPublicKey >]: The SSH configuration for the operating systems that run the nodes in the Kubernetes cluster. In some cases, specification of public keys may be required to produce a working environment. KeyData : The SSH public key data. [AgentOptionHugepagesCount ]: The number of hugepages to allocate. - [AgentOptionHugepagesSize ]: The size of the hugepages to allocate. - [AttachedNetworkConfigurationL2Network ]: The list of Layer 2 Networks and related configuration for attachment. + [AgentOptionHugepagesSize ]: The size of the hugepages to allocate. + [AttachedNetworkConfigurationL2Network >]: The list of Layer 2 Networks and related configuration for attachment. + [NetworkId ]: The resource ID of the network that is being configured for attachment. + [PluginType ]: The indicator of how this network will be utilized by the Kubernetes cluster. + [AttachedNetworkConfigurationL3Network >]: The list of Layer 3 Networks and related configuration for attachment. NetworkId : The resource ID of the network that is being configured for attachment. - [PluginType ]: The indicator of how this network will be utilized by the Kubernetes cluster. - [AttachedNetworkConfigurationL3Network ]: The list of Layer 3 Networks and related configuration for attachment. - NetworkId : The resource ID of the network that is being configured for attachment. - [IpamEnabled ]: The indication of whether this network will or will not perform IP address management and allocate IP addresses when attached. - [PluginType ]: The indicator of how this network will be utilized by the Kubernetes cluster. - [AttachedNetworkConfigurationTrunkedNetwork ]: The list of Trunked Networks and related configuration for attachment. - NetworkId : The resource ID of the network that is being configured for attachment. - [PluginType ]: The indicator of how this network will be utilized by the Kubernetes cluster. - [AvailabilityZone ]: The list of availability zones of the Network Cloud cluster used for the provisioning of nodes in this agent pool. If not specified, all availability zones will be used. - [Label ]: The labels applied to the nodes in this agent pool. - Key : The name of the label or taint. - Value : The value of the label or taint. - [Taint ]: The taints applied to the nodes in this agent pool. + [IpamEnabled ]: The indication of whether this network will or will not perform IP address management and allocate IP addresses when attached. + [PluginType ]: The indicator of how this network will be utilized by the Kubernetes cluster. + [AttachedNetworkConfigurationTrunkedNetwork >]: The list of Trunked Networks and related configuration for attachment. + [NetworkId ]: The resource ID of the network that is being configured for attachment. + [PluginType ]: The indicator of how this network will be utilized by the Kubernetes cluster. + [AvailabilityZone >]: The list of availability zones of the Network Cloud cluster used for the provisioning of nodes in this agent pool. If not specified, all availability zones will be used. + [Label >]: The labels applied to the nodes in this agent pool. + [Key ]: The name of the label or taint. + [Value ]: The value of the label or taint. + [Taint >]: The taints applied to the nodes in this agent pool. [UpgradeSettingDrainTimeout ]: The maximum time in seconds that is allowed for a node drain to complete before proceeding with the upgrade of the agent pool. If not specified during creation, a value of 1800 seconds is used. [UpgradeSettingMaxSurge ]: The maximum number or percentage of nodes that are surged during upgrade. This can either be set to an integer (e.g. '5') or a percentage (e.g. '50%'). If a percentage is specified, it is the percentage of the total agent pool size at the time of the upgrade. For percentages, fractional nodes are rounded up. If not specified during creation, a value of 1 is used. One of MaxSurge and MaxUnavailable must be greater than 0. [UpgradeSettingMaxUnavailable ]: The maximum number or percentage of nodes that can be unavailable during upgrade. This can either be set to an integer (e.g. '5') or a percentage (e.g. '50%'). If a percentage is specified, it is the percentage of the total agent pool size at the time of the upgrade. For percentages, fractional nodes are rounded up. If not specified during creation, a value of 0 is used. One of MaxSurge and MaxUnavailable must be greater than 0. L2SERVICELOADBALANCERCONFIGURATIONIPADDRESSPOOL : The list of pools of IP addresses that can be allocated to load balancer services. - Address : The list of IP address ranges. Each range can be a either a subnet in CIDR format or an explicit start-end range of IP addresses. For a BGP service load balancer configuration, only CIDR format is supported and excludes /32 (IPv4) and /128 (IPv6) prefixes. Name : The name used to identify this IP address pool for association with a BGP advertisement. - [AutoAssign ]: The indicator to determine if automatic allocation from the pool should occur. - [OnlyUseHostIP ]: The indicator to prevent the use of IP addresses ending with .0 and .255 for this pool. Enabling this option will only use IP addresses between .1 and .254 inclusive. + [Address >]: The list of IP address ranges. Each range can be a either a subnet in CIDR format or an explicit start-end range of IP addresses. For a BGP service load balancer configuration, only CIDR format is supported and excludes /32 (IPv4) and /128 (IPv6) prefixes. + [AutoAssign ]: The indicator to determine if automatic allocation from the pool should occur. + [OnlyUseHostIP ]: The indicator to prevent the use of IP addresses ending with .0 and .255 for this pool. Enabling this option will only use IP addresses between .1 and .254 inclusive. SSHPUBLICKEY : The SSH configuration for the operating systems that run the nodes in the Kubernetes cluster. In some cases, specification of public keys may be required to produce a working environment. KeyData : The SSH public key data. @@ -10093,14 +11192,15 @@ SSHPUBLICKEY : The SSH configuration for the operating systems https://learn.microsoft.com/powershell/module/az.networkcloud/new-aznetworkcloudkubernetescluster #> function New-AzNetworkCloudKubernetesCluster { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesCluster])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesCluster])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] + [Alias('KubernetesClusterName')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [System.String] # The name of the Kubernetes cluster. - ${KubernetesClusterName}, + ${Name}, [Parameter(Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] @@ -10132,151 +11232,143 @@ param( # Other values will result in error from server as they are not supported. ${IfNoneMatch}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.Int64] # The number of virtual machines that use this configuration. ${ControlPlaneNodeConfigurationCount}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The name of the VM SKU supplied during creation. ${ControlPlaneNodeConfigurationVMSkuName}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The resource ID of the extended location on which the resource will be created. ${ExtendedLocationName}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The extended location type, for example, CustomLocation. ${ExtendedLocationType}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IInitialAgentPoolConfiguration[]] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IInitialAgentPoolConfiguration[]] # The agent pools that are created with this Kubernetes cluster for running critical system services and workloads. # This data in this field is only used during creation, and the field will be empty following the creation of the Kubernetes Cluster. # After creation, the management of agent pools is done using the agentPools sub-resource. - # To construct, see NOTES section for INITIALAGENTPOOLCONFIGURATION properties and create a hash table. ${InitialAgentPoolConfiguration}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The Kubernetes version for this cluster. ${KubernetesVersion}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The geo-location where the resource lives ${Location}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The resource ID of the associated Cloud Services network. ${NetworkConfigurationCloudServicesNetworkId}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The resource ID of the Layer 3 network that is used for creation of the Container Networking Interface network. ${NetworkConfigurationCniNetworkId}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String[]] # The list of Azure Active Directory group object IDs that will have an administrative role on the Kubernetes cluster. ${AadConfigurationAdminGroupObjectId}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The user name for the administrator that will be applied to the operating systems that run Kubernetes nodes. # If not supplied, a user name will be chosen by the service. ${AdminUsername}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkAttachmentConfiguration[]] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkAttachmentConfiguration[]] # The list of Layer 2 Networks and related configuration for attachment. - # To construct, see NOTES section for ATTACHEDNETWORKCONFIGURATIONL2NETWORK properties and create a hash table. ${AttachedNetworkConfigurationL2Network}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkAttachmentConfiguration[]] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkAttachmentConfiguration[]] # The list of Layer 3 Networks and related configuration for attachment. - # To construct, see NOTES section for ATTACHEDNETWORKCONFIGURATIONL3NETWORK properties and create a hash table. ${AttachedNetworkConfigurationL3Network}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkAttachmentConfiguration[]] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkAttachmentConfiguration[]] # The list of Trunked Networks and related configuration for attachment. - # To construct, see NOTES section for ATTACHEDNETWORKCONFIGURATIONTRUNKEDNETWORK properties and create a hash table. ${AttachedNetworkConfigurationTrunkedNetwork}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBgpAdvertisement[]] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBgpAdvertisement[]] # The association of IP address pools to the communities and peers, allowing for announcement of IPs. - # To construct, see NOTES section for BGPADVERTISEMENT properties and create a hash table. ${BgpAdvertisement}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIPAddressPool[]] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IIPAddressPool[]] # The list of pools of IP addresses that can be allocated to load balancer services. - # To construct, see NOTES section for BGPIPADDRESSPOOL properties and create a hash table. ${BgpIPAddressPool}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IServiceLoadBalancerBgpPeer[]] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IServiceLoadBalancerBgpPeer[]] # The list of additional BgpPeer entities that the Kubernetes cluster will peer with. # All peering must be explicitly defined. - # To construct, see NOTES section for BGPPEER properties and create a hash table. ${BgpPeer}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.FabricPeeringEnabled])] + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("True", "False")] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.FabricPeeringEnabled] + [System.String] # The indicator to specify if the load balancer peers with the network fabric. ${BgpServiceLoadBalancerConfigurationFabricPeeringEnabled}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey[]] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISshPublicKey[]] # The SSH configuration for the operating systems that run the nodes in the Kubernetes cluster. # In some cases, specification of public keys may be required to produce a working environment. - # To construct, see NOTES section for CONTROLPLANENODECONFIGURATIONADMINPUBLICKEY properties and create a hash table. ${ControlPlaneNodeConfigurationAdminPublicKey}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The user name for the administrator that will be applied to the operating systems that run Kubernetes nodes. # If not supplied, a user name will be chosen by the service. ${ControlPlaneNodeConfigurationAdminUsername}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String[]] @@ -10284,36 +11376,35 @@ param( # If not specified, all availability zones will be used. ${ControlPlaneNodeConfigurationAvailabilityZone}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIPAddressPool[]] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IIPAddressPool[]] # The list of pools of IP addresses that can be allocated to load balancer services. - # To construct, see NOTES section for L2SERVICELOADBALANCERCONFIGURATIONIPADDRESSPOOL properties and create a hash table. ${L2ServiceLoadBalancerConfigurationIPAddressPool}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The location of the managed resource group. # If not specified, the location of the parent resource is chosen. ${ManagedResourceGroupConfigurationLocation}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The name for the managed resource group. # If not specified, the unique name is automatically generated. ${ManagedResourceGroupConfigurationName}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The IP address assigned to the Kubernetes DNS service. # It must be within the Kubernetes service address range specified in service CIDR. ${NetworkConfigurationDnsServiceIP}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String[]] @@ -10322,7 +11413,7 @@ param( # Two CIDRs, one for each IP family (IPv4/IPv6), is expected for dual-stack networking. ${NetworkConfigurationPodCidr}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String[]] @@ -10331,22 +11422,33 @@ param( # Two CIDRs, one for each IP family (IPv4/IPv6), is expected for dual-stack networking. ${NetworkConfigurationServiceCidr}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey[]] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISshPublicKey[]] # The SSH configuration for the operating systems that run the nodes in the Kubernetes cluster. # In some cases, specification of public keys may be required to produce a working environment. - # To construct, see NOTES section for SSHPUBLICKEY properties and create a hash table. ${SshPublicKey}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceTags]))] [System.Collections.Hashtable] # Resource tags. ${Tag}, + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Path of Json file supplied to the Create operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Json string supplied to the Create operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -10415,6 +11517,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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() @@ -10435,10 +11546,10 @@ begin { $mapping = @{ CreateExpanded = 'Az.NetworkCloud.private\New-AzNetworkCloudKubernetesCluster_CreateExpanded'; + CreateViaJsonFilePath = 'Az.NetworkCloud.private\New-AzNetworkCloudKubernetesCluster_CreateViaJsonFilePath'; + CreateViaJsonString = 'Az.NetworkCloud.private\New-AzNetworkCloudKubernetesCluster_CreateViaJsonString'; } - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 { @@ -10452,6 +11563,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) @@ -10497,19 +11611,19 @@ end { <# .Synopsis -Create a new layer 2 (L2) network or update the properties of the existing network. +Create a new layer 2 (L2) network or create the properties of the existing network. .Description -Create a new layer 2 (L2) network or update the properties of the existing network. +Create a new layer 2 (L2) network or create the properties of the existing network. .Example New-AzNetworkCloudL2Network -Name l2Network -ResourceGroupName resourceGroupName -ExtendedLocationName "/subscriptions/subscriptionId/resourcegroups/resourceGroupName/providers/microsoft.extendedlocation/customlocations/customLocationsName" -ExtendedLocationType "CustomLocation" -L2IsolationDomainId "/subscriptions/fabricsubs/resourceGroups/resourceGroupName/providers/Microsoft.NetworkFabric/L2IsolationDomains/L2IsolationDomainsName" -Location eastus -HybridAksPluginType "DPDK" -InterfaceName "eth0" -Tag @{tags = "tag1" } -SubscriptionId subscriptionId .Outputs -Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2Network +Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2Network .Link https://learn.microsoft.com/powershell/module/az.networkcloud/new-aznetworkcloudl2network #> function New-AzNetworkCloudL2Network { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2Network])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2Network])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] @@ -10549,53 +11663,65 @@ param( # Other values will result in error from server as they are not supported. ${IfNoneMatch}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The resource ID of the extended location on which the resource will be created. ${ExtendedLocationName}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The extended location type, for example, CustomLocation. ${ExtendedLocationType}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The resource ID of the Network Fabric l2IsolationDomain. ${L2IsolationDomainId}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The geo-location where the resource lives ${Location}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HybridAksPluginType])] + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("DPDK", "SRIOV", "OSDevice")] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HybridAksPluginType] + [System.String] # Field Deprecated. # The field was previously optional, now it will have no defined behavior and will be ignored. # The network plugin type for Hybrid AKS. ${HybridAksPluginType}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The default interface name for this L2 network in the virtual machine. # This name can be overridden by the name supplied in the network attachment configuration of that virtual machine. ${InterfaceName}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceTags]))] [System.Collections.Hashtable] # Resource tags. ${Tag}, + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Path of Json file supplied to the Create operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Json string supplied to the Create operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -10664,6 +11790,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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() @@ -10684,10 +11819,10 @@ begin { $mapping = @{ CreateExpanded = 'Az.NetworkCloud.private\New-AzNetworkCloudL2Network_CreateExpanded'; + CreateViaJsonFilePath = 'Az.NetworkCloud.private\New-AzNetworkCloudL2Network_CreateViaJsonFilePath'; + CreateViaJsonString = 'Az.NetworkCloud.private\New-AzNetworkCloudL2Network_CreateViaJsonString'; } - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 { @@ -10701,6 +11836,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) @@ -10746,19 +11884,19 @@ end { <# .Synopsis -Create a new layer 3 (L3) network or update the properties of the existing network. +Create a new layer 3 (L3) network or create the properties of the existing network. .Description -Create a new layer 3 (L3) network or update the properties of the existing network. +Create a new layer 3 (L3) network or create the properties of the existing network. .Example New-AzNetworkCloudL3Network -ResourceGroupName resourceGroupName -Name l3NetworkName -Location eastus -ExtendedLocationName "subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/clusterExtendedLocationName" -ExtendedLocationType "CustomLocation" -Vlan 1001 -L3IsolationDomainId "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedNetworkFabric/l3IsolationDomains/l3IsolationDomainName" -Ipv4ConnectedPrefix "10.1.100.0/24" -Ipv6ConnectedPrefix "fd01:1::0/64" -SubscriptionId subscriptionId .Outputs -Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3Network +Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3Network .Link https://learn.microsoft.com/powershell/module/az.networkcloud/new-aznetworkcloudl3network #> function New-AzNetworkCloudL3Network { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3Network])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3Network])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] @@ -10798,89 +11936,101 @@ param( # Other values will result in error from server as they are not supported. ${IfNoneMatch}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The resource ID of the extended location on which the resource will be created. ${ExtendedLocationName}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The extended location type, for example, CustomLocation. ${ExtendedLocationType}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The resource ID of the Network Fabric l3IsolationDomain. ${L3IsolationDomainId}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The geo-location where the resource lives ${Location}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.Int64] # The VLAN from the l3IsolationDomain that is used for this network. ${Vlan}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HybridAksIpamEnabled])] + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("True", "False")] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HybridAksIpamEnabled] + [System.String] # Field Deprecated. # The field was previously optional, now it will have no defined behavior and will be ignored. # The indicator of whether or not to disable IPAM allocation on the network attachment definition injected into the Hybrid AKS Cluster. ${HybridAksIpamEnabled}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HybridAksPluginType])] + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("DPDK", "SRIOV", "OSDevice")] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HybridAksPluginType] + [System.String] # Field Deprecated. # The field was previously optional, now it will have no defined behavior and will be ignored. # The network plugin type for Hybrid AKS. ${HybridAksPluginType}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.IPAllocationType])] + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("IPV4", "IPV6", "DualStack")] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.IPAllocationType] + [System.String] # The type of the IP address allocation, defaulted to "DualStack". ${IPAllocationType}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The default interface name for this L3 network in the virtual machine. # This name can be overridden by the name supplied in the network attachment configuration of that virtual machine. ${InterfaceName}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The IPV4 prefix (CIDR) assigned to this L3 network. # Required when the IP allocation type is IPV4 or DualStack. ${Ipv4ConnectedPrefix}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The IPV6 prefix (CIDR) assigned to this L3 network. # Required when the IP allocation type is IPV6 or DualStack. ${Ipv6ConnectedPrefix}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceTags]))] [System.Collections.Hashtable] # Resource tags. ${Tag}, + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Path of Json file supplied to the Create operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Json string supplied to the Create operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -10949,6 +12099,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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() @@ -10969,10 +12128,10 @@ begin { $mapping = @{ CreateExpanded = 'Az.NetworkCloud.private\New-AzNetworkCloudL3Network_CreateExpanded'; + CreateViaJsonFilePath = 'Az.NetworkCloud.private\New-AzNetworkCloudL3Network_CreateViaJsonFilePath'; + CreateViaJsonString = 'Az.NetworkCloud.private\New-AzNetworkCloudL3Network_CreateViaJsonString'; } - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 { @@ -10986,6 +12145,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) @@ -11031,41 +12193,78 @@ end { <# .Synopsis -Create new or update the existing metrics configuration of the provided cluster. +Create new or create the existing metrics configuration of the provided cluster. .Description -Create new or update the existing metrics configuration of the provided cluster. +Create new or create the existing metrics configuration of the provided cluster. .Example New-AzNetworkCloudMetricsConfiguration -ClusterName clusterName -MetricsConfigurationName default -ResourceGroupName resourceGroupName -CollectionInterval 15 -ExtendedLocationName extendedLocationId -ExtendedLocationType CustomLocation -Location eastus -SubscriptionId subscriptionId +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfiguration +Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfiguration +.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. + +CLUSTERINPUTOBJECT : Identity Parameter + [AgentPoolName ]: The name of the Kubernetes cluster agent pool. + [BareMetalMachineKeySetName ]: The name of the bare metal machine key set. + [BareMetalMachineName ]: The name of the bare metal machine. + [BmcKeySetName ]: The name of the baseboard management controller key set. + [CloudServicesNetworkName ]: The name of the cloud services network. + [ClusterManagerName ]: The name of the cluster manager. + [ClusterName ]: The name of the cluster. + [ConsoleName ]: The name of the virtual machine console. + [FeatureName ]: The name of the feature. + [Id ]: Resource identity path + [KubernetesClusterName ]: The name of the Kubernetes cluster. + [L2NetworkName ]: The name of the L2 network. + [L3NetworkName ]: The name of the L3 network. + [MetricsConfigurationName ]: The name of the metrics configuration for the cluster. + [RackName ]: The name of the rack. + [RackSkuName ]: The name of the rack SKU. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [StorageApplianceName ]: The name of the storage appliance. + [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. + [TrunkedNetworkName ]: The name of the trunked network. + [VirtualMachineName ]: The name of the virtual machine. + [VolumeName ]: The name of the volume. .Link https://learn.microsoft.com/powershell/module/az.networkcloud/new-aznetworkcloudmetricsconfiguration #> function New-AzNetworkCloudMetricsConfiguration { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfiguration])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfiguration])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] + [Alias('MetricsConfigurationName')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [System.String] - # The name of the cluster. - ${ClusterName}, + # The name of the metrics configuration for the cluster. + ${Name}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [System.String] - # The name of the metrics configuration for the cluster. - ${MetricsConfigurationName}, + # The name of the cluster. + ${ClusterName}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] @@ -11073,6 +12272,12 @@ param( # The value must be an UUID. ${SubscriptionId}, + [Parameter(ParameterSetName='CreateViaIdentityClusterExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] + # Identity Parameter + ${ClusterInputObject}, + [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Header')] [System.String] @@ -11088,44 +12293,62 @@ param( # Other values will result in error from server as they are not supported. ${IfNoneMatch}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaIdentityClusterExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.Int64] # The interval in minutes by which metrics will be collected. ${CollectionInterval}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaIdentityClusterExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The resource ID of the extended location on which the resource will be created. ${ExtendedLocationName}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaIdentityClusterExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The extended location type, for example, CustomLocation. ${ExtendedLocationType}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Parameter(ParameterSetName='CreateViaIdentityClusterExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The geo-location where the resource lives ${Location}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityClusterExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String[]] # The list of metric names that have been chosen to be enabled in addition to the core set of enabled metrics. ${EnabledMetric}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] + [Parameter(ParameterSetName='CreateViaIdentityClusterExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceTags]))] [System.Collections.Hashtable] # Resource tags. ${Tag}, + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Path of Json file supplied to the Create operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Json string supplied to the Create operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -11194,6 +12417,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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() @@ -11214,10 +12446,11 @@ begin { $mapping = @{ CreateExpanded = 'Az.NetworkCloud.private\New-AzNetworkCloudMetricsConfiguration_CreateExpanded'; + CreateViaIdentityClusterExpanded = 'Az.NetworkCloud.private\New-AzNetworkCloudMetricsConfiguration_CreateViaIdentityClusterExpanded'; + CreateViaJsonFilePath = 'Az.NetworkCloud.private\New-AzNetworkCloudMetricsConfiguration_CreateViaJsonFilePath'; + CreateViaJsonString = 'Az.NetworkCloud.private\New-AzNetworkCloudMetricsConfiguration_CreateViaJsonString'; } - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 { @@ -11231,6 +12464,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) @@ -11276,9 +12512,9 @@ end { <# .Synopsis -Create a new cloud services network or update the properties of the existing cloud services network. +Create a new cloud services network or create the properties of the existing cloud services network. .Description -Create a new cloud services network or update the properties of the existing cloud services network. +Create a new cloud services network or create the properties of the existing cloud services network. .Example $tags = @{ Tag1 = 'tag1' @@ -11288,7 +12524,7 @@ $endpointEgressList = @{} New-AzNetworkCloudServicesNetwork -CloudServicesNetworkName cloudNetworkServicesName -ResourceGroupName resourceGroupName -ExtendedLocationName "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ExtendedLocation/customLocations/customLocationName" -ExtendedLocationType "CustomLocation" -Location eastus -AdditionalEgressEndpoint $endpointEgressList -EnableDefaultEgressEndpoint false -Tag $tags -SubscriptionId subscriptionId .Outputs -Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetwork +Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetwork .Notes COMPLEX PARAMETER PROPERTIES @@ -11296,21 +12532,22 @@ To create the parameters described below, construct a hash table containing the ADDITIONALEGRESSENDPOINT : The list of egress endpoints. This allows for connection from a Hybrid AKS cluster to the specified endpoint. Category : The descriptive category name of endpoints accessible by the AKS agent node. For example, azure-resource-management, API server, etc. The platform egress endpoints provided by default will use the category 'default'. - Endpoint : The list of endpoint dependencies. + Endpoint >: The list of endpoint dependencies. DomainName : The domain name of the dependency. [Port ]: The port of this endpoint. .Link https://learn.microsoft.com/powershell/module/az.networkcloud/new-aznetworkcloudservicesnetwork #> function New-AzNetworkCloudServicesNetwork { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetwork])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetwork])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] + [Alias('CloudServicesNetworkName')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [System.String] # The name of the cloud services network. - ${CloudServicesNetworkName}, + ${Name}, [Parameter(Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] @@ -11342,47 +12579,58 @@ param( # Other values will result in error from server as they are not supported. ${IfNoneMatch}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The resource ID of the extended location on which the resource will be created. ${ExtendedLocationName}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The extended location type, for example, CustomLocation. ${ExtendedLocationType}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The geo-location where the resource lives ${Location}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IEgressEndpoint[]] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IEgressEndpoint[]] # The list of egress endpoints. # This allows for connection from a Hybrid AKS cluster to the specified endpoint. - # To construct, see NOTES section for ADDITIONALEGRESSENDPOINT properties and create a hash table. ${AdditionalEgressEndpoint}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CloudServicesNetworkEnableDefaultEgressEndpoints])] + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("True", "False")] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CloudServicesNetworkEnableDefaultEgressEndpoints] + [System.String] # The indicator of whether the platform default endpoints are allowed for the egress traffic. ${EnableDefaultEgressEndpoint}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceTags]))] [System.Collections.Hashtable] # Resource tags. ${Tag}, + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Path of Json file supplied to the Create operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Json string supplied to the Create operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -11451,6 +12699,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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() @@ -11471,10 +12728,10 @@ begin { $mapping = @{ CreateExpanded = 'Az.NetworkCloud.private\New-AzNetworkCloudServicesNetwork_CreateExpanded'; + CreateViaJsonFilePath = 'Az.NetworkCloud.private\New-AzNetworkCloudServicesNetwork_CreateViaJsonFilePath'; + CreateViaJsonString = 'Az.NetworkCloud.private\New-AzNetworkCloudServicesNetwork_CreateViaJsonString'; } - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 { @@ -11488,6 +12745,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) @@ -11533,19 +12793,19 @@ end { <# .Synopsis -Create a new trunked network or update the properties of the existing trunked network. +Create a new trunked network or create the properties of the existing trunked network. .Description -Create a new trunked network or update the properties of the existing trunked network. +Create a new trunked network or create the properties of the existing trunked network. .Example New-AzNetworkCloudTrunkedNetwork -Name trunkedNetworkName -ResourceGroupName trunkedNetworkRg -SubscriptionId subscriptionId -ExtendedLocationName extendedLocationName -ExtendedLocationType "CustomLocation" -Location location -Vlan vlans -IsolationDomainId isolationDomainId -InterfaceName interfaceName -Tag @{ tag = "tag" } .Outputs -Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetwork +Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetwork .Link https://learn.microsoft.com/powershell/module/az.networkcloud/new-aznetworkcloudtrunkednetwork #> function New-AzNetworkCloudTrunkedNetwork { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetwork])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetwork])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] @@ -11585,19 +12845,19 @@ param( # Other values will result in error from server as they are not supported. ${IfNoneMatch}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The resource ID of the extended location on which the resource will be created. ${ExtendedLocationName}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The extended location type, for example, CustomLocation. ${ExtendedLocationType}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String[]] @@ -11605,42 +12865,54 @@ param( # It can be any combination of l2IsolationDomain and l3IsolationDomain resources. ${IsolationDomainId}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The geo-location where the resource lives ${Location}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.Int64[]] # The list of vlans that are selected from the isolation domains for trunking. ${Vlan}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HybridAksPluginType])] + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("DPDK", "SRIOV", "OSDevice")] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HybridAksPluginType] + [System.String] # Field Deprecated. # The field was previously optional, now it will have no defined behavior and will be ignored. # The network plugin type for Hybrid AKS. ${HybridAksPluginType}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The default interface name for this trunked network in the virtual machine. # This name can be overridden by the name supplied in the network attachment configuration of that virtual machine. ${InterfaceName}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceTags]))] [System.Collections.Hashtable] # Resource tags. ${Tag}, + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Path of Json file supplied to the Create operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Json string supplied to the Create operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -11709,6 +12981,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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() @@ -11729,10 +13010,10 @@ begin { $mapping = @{ CreateExpanded = 'Az.NetworkCloud.private\New-AzNetworkCloudTrunkedNetwork_CreateExpanded'; + CreateViaJsonFilePath = 'Az.NetworkCloud.private\New-AzNetworkCloudTrunkedNetwork_CreateViaJsonFilePath'; + CreateViaJsonString = 'Az.NetworkCloud.private\New-AzNetworkCloudTrunkedNetwork_CreateViaJsonString'; } - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 { @@ -11746,6 +13027,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) @@ -11791,9 +13075,9 @@ end { <# .Synopsis -Create a new virtual machine or update the properties of the existing virtual machine. +Create a new virtual machine or create the properties of the existing virtual machine. .Description -Create a new virtual machine or update the properties of the existing virtual machine. +Create a new virtual machine or create the properties of the existing virtual machine. .Example $networkAttachment = @{ AttachedNetworkId = "attachedNetworkID" @@ -11814,7 +13098,7 @@ $securePassword = ConvertTo-SecureString "password" -asplaintext -force New-AzNetworkCloudVirtualMachine -Name vmName -ResourceGroupName resourceGroup -AdminUsername adminUsername -CloudServiceNetworkAttachmentAttachedNetworkId csnAttachedNetworkId -CloudServiceNetworkAttachmentIPAllocationMethod ipAllocationMethod -CpuCore cpuCore -ExtendedLocationName extendedLocationName -ExtendedLocationType "Custom" -Location location -SubscriptionId subscriptionId -MemorySizeGb memorySizeGb -OSDiskSizeGb osDiskSizeGb -VMImage vmImage -BootMethod bootMethod -CloudServiceNetworkAttachmentDefaultGateway defaultGateway -CloudServiceNetworkAttachmentName csnAttachmentName -IsolateEmulatorThread isolateEmulatorThread -NetworkAttachment $networkAttachment -NetworkData networkData -OSDiskCreateOption osDiskCreationOption -OSDiskDeleteOption osDiskDeleteOption -PlacementHint $hint -SshPublicKey $sshPublicKey -Tag @{tags = "tags"} -UserData userData -VirtioInterface virtioInterface -VMDeviceModel vmDeviceModel -VMImageRepositoryCredentialsUsername registryUsername -VMImageRepositoryCredentialsPassword $securePassword -VMImageRepositoryCredentialsRegistryUrl registryUrl .Outputs -Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachine +Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachine .Notes COMPLEX PARAMETER PROPERTIES @@ -11822,17 +13106,17 @@ To create the parameters described below, construct a hash table containing the NETWORKATTACHMENT : The list of network attachments to the virtual machine. AttachedNetworkId : The resource ID of the associated network attached to the virtual machine. It can be one of cloudServicesNetwork, l3Network, l2Network or trunkedNetwork resources. - IPAllocationMethod : The IP allocation mechanism for the virtual machine. Dynamic and Static are only valid for l3Network which may also specify Disabled. Otherwise, Disabled is the only permitted value. - [DefaultGateway ]: The indicator of whether this is the default gateway. Only one of the attached networks (including the CloudServicesNetwork attachment) for a single machine may be specified as True. + IPAllocationMethod : The IP allocation mechanism for the virtual machine. Dynamic and Static are only valid for l3Network which may also specify Disabled. Otherwise, Disabled is the only permitted value. + [DefaultGateway ]: The indicator of whether this is the default gateway. Only one of the attached networks (including the CloudServicesNetwork attachment) for a single machine may be specified as True. [Ipv4Address ]: The IPv4 address of the virtual machine. This field is used only if the attached network has IPAllocationType of IPV4 or DualStack. If IPAllocationMethod is: Static - this field must contain a user specified IPv4 address from within the subnet specified in the attached network. Dynamic - this field is read-only, but will be populated with an address from within the subnet specified in the attached network. Disabled - this field will be empty. [Ipv6Address ]: The IPv6 address of the virtual machine. This field is used only if the attached network has IPAllocationType of IPV6 or DualStack. If IPAllocationMethod is: Static - this field must contain an IPv6 address range from within the range specified in the attached network. Dynamic - this field is read-only, but will be populated with an range from within the subnet specified in the attached network. Disabled - this field will be empty. [Name ]: The associated network's interface name. If specified, the network attachment name has a maximum length of 15 characters and must be unique to this virtual machine. If the user doesn’t specify this value, the default interface name of the network resource will be used. For a CloudServicesNetwork resource, this name will be ignored. PLACEMENTHINT : The scheduling hints for the virtual machine. - HintType : The specification of whether this hint supports affinity or anti-affinity with the referenced resources. + HintType : The specification of whether this hint supports affinity or anti-affinity with the referenced resources. ResourceId : The resource ID of the target object that the placement hints will be checked against, e.g., the bare metal node to host the virtual machine. - SchedulingExecution : The indicator of whether the hint is a hard or soft requirement during scheduling. - Scope : The scope for the virtual machine affinity or anti-affinity placement hint. It should always be "Machine" in the case of node affinity. + SchedulingExecution : The indicator of whether the hint is a hard or soft requirement during scheduling. + Scope : The scope for the virtual machine affinity or anti-affinity placement hint. It should always be "Machine" in the case of node affinity. SSHPUBLICKEY : The list of ssh public keys. Each key will be added to the virtual machine using the cloud-init ssh_authorized_keys mechanism for the adminUsername. KeyData : The SSH public key data. @@ -11840,7 +13124,7 @@ SSHPUBLICKEY : The list of ssh public keys. Each key will be ad https://learn.microsoft.com/powershell/module/az.networkcloud/new-aznetworkcloudvirtualmachine #> function New-AzNetworkCloudVirtualMachine { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachine])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachine])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] @@ -11880,57 +13164,57 @@ param( # Other values will result in error from server as they are not supported. ${IfNoneMatch}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The name of the administrator to which the ssh public keys will be added into the authorized keys. ${AdminUsername}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The resource ID of the associated network attached to the virtual machine.It can be one of cloudServicesNetwork, l3Network, l2Network or trunkedNetwork resources. ${CloudServiceNetworkAttachmentAttachedNetworkId}, - [Parameter(Mandatory)] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineIPAllocationMethod])] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Dynamic", "Static", "Disabled")] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineIPAllocationMethod] + [System.String] # The IP allocation mechanism for the virtual machine.Dynamic and Static are only valid for l3Network which may also specify Disabled.Otherwise, Disabled is the only permitted value. ${CloudServiceNetworkAttachmentIPAllocationMethod}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.Int64] # The number of CPU cores in the virtual machine. ${CpuCore}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The resource ID of the extended location on which the resource will be created. ${ExtendedLocationName}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The extended location type, for example, CustomLocation. ${ExtendedLocationType}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The geo-location where the resource lives ${Location}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.Int64] # The memory size of the virtual machine. # Allocations are measured in gibibytes. ${MemorySizeGb}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.Int64] # The size of the disk. @@ -11938,162 +13222,171 @@ param( # Allocations are measured in gibibytes. ${OSDiskSizeGb}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The virtual machine image that is currently provisioned to the OS disk, using the full url and tag notation used to pull the image. ${VMImage}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineBootMethod])] + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("UEFI", "BIOS")] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineBootMethod] + [System.String] # Selects the boot method for the virtual machine. ${BootMethod}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.DefaultGateway])] + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("True", "False")] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.DefaultGateway] + [System.String] # The indicator of whether this is the default gateway.Only one of the attached networks (including the CloudServicesNetwork attachment) for a single machine may be specified as True. ${CloudServiceNetworkAttachmentDefaultGateway}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The IPv4 address of the virtual machine.This field is used only if the attached network has IPAllocationType of IPV4 or DualStack.If IPAllocationMethod is:Static - this field must contain a user specified IPv4 address from within the subnet specified in the attached network.Dynamic - this field is read-only, but will be populated with an address from within the subnet specified in the attached network.Disabled - this field will be empty. ${CloudServiceNetworkAttachmentIpv4Address}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The IPv6 address of the virtual machine.This field is used only if the attached network has IPAllocationType of IPV6 or DualStack.If IPAllocationMethod is:Static - this field must contain an IPv6 address range from within the range specified in the attached network.Dynamic - this field is read-only, but will be populated with an range from within the subnet specified in the attached network.Disabled - this field will be empty. ${CloudServiceNetworkAttachmentIpv6Address}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The associated network's interface name.If specified, the network attachment name has a maximum length of 15 characters and must be unique to this virtual machine.If the user doesn’t specify this value, the default interface name of the network resource will be used.For a CloudServicesNetwork resource, this name will be ignored. ${CloudServiceNetworkAttachmentName}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The resource ID of the extended location on which the resource will be created. ${ConsoleExtendedLocationName}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The extended location type, for example, CustomLocation. ${ConsoleExtendedLocationType}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineIsolateEmulatorThread])] + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("True", "False")] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineIsolateEmulatorThread] + [System.String] # Field Deprecated, the value will be ignored if provided. # The indicator of whether one of the specified CPU cores is isolated to run the emulator thread for this virtual machine. ${IsolateEmulatorThread}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkAttachment[]] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkAttachment[]] # The list of network attachments to the virtual machine. - # To construct, see NOTES section for NETWORKATTACHMENT properties and create a hash table. ${NetworkAttachment}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The Base64 encoded cloud-init network data. ${NetworkData}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.OSDiskCreateOption])] + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Ephemeral", "Persistent")] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.OSDiskCreateOption] + [System.String] # The strategy for creating the OS disk. ${OSDiskCreateOption}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.OSDiskDeleteOption])] + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Delete")] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.OSDiskDeleteOption] + [System.String] # The strategy for deleting the OS disk. ${OSDiskDeleteOption}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePlacementHint[]] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePlacementHint[]] # The scheduling hints for the virtual machine. - # To construct, see NOTES section for PLACEMENTHINT properties and create a hash table. ${PlacementHint}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey[]] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISshPublicKey[]] # The list of ssh public keys. # Each key will be added to the virtual machine using the cloud-init ssh_authorized_keys mechanism for the adminUsername. - # To construct, see NOTES section for SSHPUBLICKEY properties and create a hash table. ${SshPublicKey}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String[]] # The resource IDs of volumes that are requested to be attached to the virtual machine. ${StorageProfileVolumeAttachment}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceTags]))] [System.Collections.Hashtable] # Resource tags. ${Tag}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The Base64 encoded cloud-init user data. ${UserData}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineDeviceModelType])] + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("T1", "T2", "T3")] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineDeviceModelType] + [System.String] # The type of the device model to use. ${VMDeviceModel}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.Security.SecureString] # The password or token used to access an image in the target repository. ${VMImageRepositoryCredentialsPassword}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The URL of the authentication server used to validate the repository credentials. ${VMImageRepositoryCredentialsRegistryUrl}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The username used to access an image in the target repository. ${VMImageRepositoryCredentialsUsername}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineVirtioInterfaceType])] + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Modern", "Transitional")] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineVirtioInterfaceType] + [System.String] # Field Deprecated, use virtualizationModel instead. # The type of the virtio interface. ${VirtioInterface}, + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Path of Json file supplied to the Create operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Json string supplied to the Create operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -12161,7 +13454,16 @@ begin { if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { $PSBoundParameters['OutBuffer'] = 1 } - $parameterSet = $PSCmdlet.ParameterSetName + $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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() @@ -12182,10 +13484,10 @@ begin { $mapping = @{ CreateExpanded = 'Az.NetworkCloud.private\New-AzNetworkCloudVirtualMachine_CreateExpanded'; + CreateViaJsonFilePath = 'Az.NetworkCloud.private\New-AzNetworkCloudVirtualMachine_CreateViaJsonFilePath'; + CreateViaJsonString = 'Az.NetworkCloud.private\New-AzNetworkCloudVirtualMachine_CreateViaJsonString'; } - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 { @@ -12199,6 +13501,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) @@ -12244,19 +13549,19 @@ end { <# .Synopsis -Create a new volume or update the properties of the existing one. +Create a new volume or create the properties of the existing one. .Description -Create a new volume or update the properties of the existing one. +Create a new volume or create the properties of the existing one. .Example New-AzNetworkCloudVolume -Name volumeName -ResourceGroupName resourceGroupName -ExtendedLocationName extendedLocation -ExtendedLocationType "CustomLocation " -Location location -SizeMiB size -Tag @{ tag = "newTag" } .Outputs -Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolume +Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolume .Link https://learn.microsoft.com/powershell/module/az.networkcloud/new-aznetworkcloudvolume #> function New-AzNetworkCloudVolume { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolume])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolume])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] @@ -12296,37 +13601,49 @@ param( # Other values will result in error from server as they are not supported. ${IfNoneMatch}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The resource ID of the extended location on which the resource will be created. ${ExtendedLocationName}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The extended location type, for example, CustomLocation. ${ExtendedLocationType}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The geo-location where the resource lives ${Location}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='CreateExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.Int64] # The size of the allocation for this volume in Mebibytes. ${SizeMiB}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceTags]))] [System.Collections.Hashtable] # Resource tags. ${Tag}, + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Path of Json file supplied to the Create operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Json string supplied to the Create operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -12395,6 +13712,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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() @@ -12415,10 +13741,10 @@ begin { $mapping = @{ CreateExpanded = 'Az.NetworkCloud.private\New-AzNetworkCloudVolume_CreateExpanded'; + CreateViaJsonFilePath = 'Az.NetworkCloud.private\New-AzNetworkCloudVolume_CreateViaJsonFilePath'; + CreateViaJsonString = 'Az.NetworkCloud.private\New-AzNetworkCloudVolume_CreateViaJsonString'; } - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 { @@ -12432,6 +13758,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) @@ -12515,6 +13844,30 @@ INPUTOBJECT : Identity Parameter [TrunkedNetworkName ]: The name of the trunked network. [VirtualMachineName ]: The name of the virtual machine. [VolumeName ]: The name of the volume. + +KUBERNETESCLUSTERINPUTOBJECT : Identity Parameter + [AgentPoolName ]: The name of the Kubernetes cluster agent pool. + [BareMetalMachineKeySetName ]: The name of the bare metal machine key set. + [BareMetalMachineName ]: The name of the bare metal machine. + [BmcKeySetName ]: The name of the baseboard management controller key set. + [CloudServicesNetworkName ]: The name of the cloud services network. + [ClusterManagerName ]: The name of the cluster manager. + [ClusterName ]: The name of the cluster. + [ConsoleName ]: The name of the virtual machine console. + [FeatureName ]: The name of the feature. + [Id ]: Resource identity path + [KubernetesClusterName ]: The name of the Kubernetes cluster. + [L2NetworkName ]: The name of the L2 network. + [L3NetworkName ]: The name of the L3 network. + [MetricsConfigurationName ]: The name of the metrics configuration for the cluster. + [RackName ]: The name of the rack. + [RackSkuName ]: The name of the rack SKU. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [StorageApplianceName ]: The name of the storage appliance. + [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. + [TrunkedNetworkName ]: The name of the trunked network. + [VirtualMachineName ]: The name of the virtual machine. + [VolumeName ]: The name of the volume. .Link https://learn.microsoft.com/powershell/module/az.networkcloud/remove-aznetworkcloudagentpool #> @@ -12529,6 +13882,7 @@ param( ${KubernetesClusterName}, [Parameter(ParameterSetName='Delete', Mandatory)] + [Parameter(ParameterSetName='DeleteViaIdentityKubernetesCluster', Mandatory)] [Alias('AgentPoolName')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [System.String] @@ -12554,9 +13908,14 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, + [Parameter(ParameterSetName='DeleteViaIdentityKubernetesCluster', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] + # Identity Parameter + ${KubernetesClusterInputObject}, + [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Header')] [System.String] @@ -12646,6 +14005,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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() @@ -12667,10 +14035,9 @@ begin { $mapping = @{ Delete = 'Az.NetworkCloud.private\Remove-AzNetworkCloudAgentPool_Delete'; DeleteViaIdentity = 'Az.NetworkCloud.private\Remove-AzNetworkCloudAgentPool_DeleteViaIdentity'; + DeleteViaIdentityKubernetesCluster = 'Az.NetworkCloud.private\Remove-AzNetworkCloudAgentPool_DeleteViaIdentityKubernetesCluster'; } - if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 { @@ -12684,6 +14051,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) @@ -12744,6 +14114,30 @@ 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. +CLUSTERINPUTOBJECT : Identity Parameter + [AgentPoolName ]: The name of the Kubernetes cluster agent pool. + [BareMetalMachineKeySetName ]: The name of the bare metal machine key set. + [BareMetalMachineName ]: The name of the bare metal machine. + [BmcKeySetName ]: The name of the baseboard management controller key set. + [CloudServicesNetworkName ]: The name of the cloud services network. + [ClusterManagerName ]: The name of the cluster manager. + [ClusterName ]: The name of the cluster. + [ConsoleName ]: The name of the virtual machine console. + [FeatureName ]: The name of the feature. + [Id ]: Resource identity path + [KubernetesClusterName ]: The name of the Kubernetes cluster. + [L2NetworkName ]: The name of the L2 network. + [L3NetworkName ]: The name of the L3 network. + [MetricsConfigurationName ]: The name of the metrics configuration for the cluster. + [RackName ]: The name of the rack. + [RackSkuName ]: The name of the rack SKU. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [StorageApplianceName ]: The name of the storage appliance. + [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. + [TrunkedNetworkName ]: The name of the trunked network. + [VirtualMachineName ]: The name of the virtual machine. + [VolumeName ]: The name of the volume. + INPUTOBJECT : Identity Parameter [AgentPoolName ]: The name of the Kubernetes cluster agent pool. [BareMetalMachineKeySetName ]: The name of the bare metal machine key set. @@ -12781,6 +14175,7 @@ param( ${ClusterName}, [Parameter(ParameterSetName='Delete', Mandatory)] + [Parameter(ParameterSetName='DeleteViaIdentityCluster', Mandatory)] [Alias('BareMetalMachineKeySetName')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [System.String] @@ -12806,9 +14201,14 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, + [Parameter(ParameterSetName='DeleteViaIdentityCluster', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] + # Identity Parameter + ${ClusterInputObject}, + [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Header')] [System.String] @@ -12898,6 +14298,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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() @@ -12919,10 +14328,9 @@ begin { $mapping = @{ Delete = 'Az.NetworkCloud.private\Remove-AzNetworkCloudBareMetalMachineKeySet_Delete'; DeleteViaIdentity = 'Az.NetworkCloud.private\Remove-AzNetworkCloudBareMetalMachineKeySet_DeleteViaIdentity'; + DeleteViaIdentityCluster = 'Az.NetworkCloud.private\Remove-AzNetworkCloudBareMetalMachineKeySet_DeleteViaIdentityCluster'; } - if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 { @@ -12936,6 +14344,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) @@ -12996,6 +14407,30 @@ 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. +CLUSTERINPUTOBJECT : Identity Parameter + [AgentPoolName ]: The name of the Kubernetes cluster agent pool. + [BareMetalMachineKeySetName ]: The name of the bare metal machine key set. + [BareMetalMachineName ]: The name of the bare metal machine. + [BmcKeySetName ]: The name of the baseboard management controller key set. + [CloudServicesNetworkName ]: The name of the cloud services network. + [ClusterManagerName ]: The name of the cluster manager. + [ClusterName ]: The name of the cluster. + [ConsoleName ]: The name of the virtual machine console. + [FeatureName ]: The name of the feature. + [Id ]: Resource identity path + [KubernetesClusterName ]: The name of the Kubernetes cluster. + [L2NetworkName ]: The name of the L2 network. + [L3NetworkName ]: The name of the L3 network. + [MetricsConfigurationName ]: The name of the metrics configuration for the cluster. + [RackName ]: The name of the rack. + [RackSkuName ]: The name of the rack SKU. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [StorageApplianceName ]: The name of the storage appliance. + [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. + [TrunkedNetworkName ]: The name of the trunked network. + [VirtualMachineName ]: The name of the virtual machine. + [VolumeName ]: The name of the volume. + INPUTOBJECT : Identity Parameter [AgentPoolName ]: The name of the Kubernetes cluster agent pool. [BareMetalMachineKeySetName ]: The name of the bare metal machine key set. @@ -13033,6 +14468,7 @@ param( ${ClusterName}, [Parameter(ParameterSetName='Delete', Mandatory)] + [Parameter(ParameterSetName='DeleteViaIdentityCluster', Mandatory)] [Alias('BmcKeySetName')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [System.String] @@ -13058,9 +14494,14 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, + [Parameter(ParameterSetName='DeleteViaIdentityCluster', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] + # Identity Parameter + ${ClusterInputObject}, + [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Header')] [System.String] @@ -13150,6 +14591,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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() @@ -13171,10 +14621,9 @@ begin { $mapping = @{ Delete = 'Az.NetworkCloud.private\Remove-AzNetworkCloudBmcKeySet_Delete'; DeleteViaIdentity = 'Az.NetworkCloud.private\Remove-AzNetworkCloudBmcKeySet_DeleteViaIdentity'; + DeleteViaIdentityCluster = 'Az.NetworkCloud.private\Remove-AzNetworkCloudBmcKeySet_DeleteViaIdentityCluster'; } - if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 { @@ -13188,6 +14637,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) @@ -13304,7 +14756,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -13396,6 +14847,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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() @@ -13418,9 +14878,7 @@ begin { Delete = 'Az.NetworkCloud.private\Remove-AzNetworkCloudClusterManager_Delete'; DeleteViaIdentity = 'Az.NetworkCloud.private\Remove-AzNetworkCloudClusterManager_DeleteViaIdentity'; } - if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 { @@ -13434,6 +14892,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) @@ -13550,7 +15011,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -13642,6 +15102,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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() @@ -13664,9 +15133,7 @@ begin { Delete = 'Az.NetworkCloud.private\Remove-AzNetworkCloudCluster_Delete'; DeleteViaIdentity = 'Az.NetworkCloud.private\Remove-AzNetworkCloudCluster_DeleteViaIdentity'; } - if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 { @@ -13680,6 +15147,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) @@ -13763,6 +15233,30 @@ INPUTOBJECT : Identity Parameter [TrunkedNetworkName ]: The name of the trunked network. [VirtualMachineName ]: The name of the virtual machine. [VolumeName ]: The name of the volume. + +VIRTUALMACHINEINPUTOBJECT : Identity Parameter + [AgentPoolName ]: The name of the Kubernetes cluster agent pool. + [BareMetalMachineKeySetName ]: The name of the bare metal machine key set. + [BareMetalMachineName ]: The name of the bare metal machine. + [BmcKeySetName ]: The name of the baseboard management controller key set. + [CloudServicesNetworkName ]: The name of the cloud services network. + [ClusterManagerName ]: The name of the cluster manager. + [ClusterName ]: The name of the cluster. + [ConsoleName ]: The name of the virtual machine console. + [FeatureName ]: The name of the feature. + [Id ]: Resource identity path + [KubernetesClusterName ]: The name of the Kubernetes cluster. + [L2NetworkName ]: The name of the L2 network. + [L3NetworkName ]: The name of the L3 network. + [MetricsConfigurationName ]: The name of the metrics configuration for the cluster. + [RackName ]: The name of the rack. + [RackSkuName ]: The name of the rack SKU. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [StorageApplianceName ]: The name of the storage appliance. + [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. + [TrunkedNetworkName ]: The name of the trunked network. + [VirtualMachineName ]: The name of the virtual machine. + [VolumeName ]: The name of the volume. .Link https://learn.microsoft.com/powershell/module/az.networkcloud/remove-aznetworkcloudconsole #> @@ -13771,6 +15265,7 @@ function Remove-AzNetworkCloudConsole { [CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='Delete', Mandatory)] + [Parameter(ParameterSetName='DeleteViaIdentityVirtualMachine', Mandatory)] [Alias('ConsoleName')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [System.String] @@ -13802,9 +15297,14 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, + [Parameter(ParameterSetName='DeleteViaIdentityVirtualMachine', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] + # Identity Parameter + ${VirtualMachineInputObject}, + [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Header')] [System.String] @@ -13894,6 +15394,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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() @@ -13915,10 +15424,9 @@ begin { $mapping = @{ Delete = 'Az.NetworkCloud.private\Remove-AzNetworkCloudConsole_Delete'; DeleteViaIdentity = 'Az.NetworkCloud.private\Remove-AzNetworkCloudConsole_DeleteViaIdentity'; + DeleteViaIdentityVirtualMachine = 'Az.NetworkCloud.private\Remove-AzNetworkCloudConsole_DeleteViaIdentityVirtualMachine'; } - if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 { @@ -13932,6 +15440,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) @@ -14015,6 +15526,30 @@ INPUTOBJECT : Identity Parameter [TrunkedNetworkName ]: The name of the trunked network. [VirtualMachineName ]: The name of the virtual machine. [VolumeName ]: The name of the volume. + +KUBERNETESCLUSTERINPUTOBJECT : Identity Parameter + [AgentPoolName ]: The name of the Kubernetes cluster agent pool. + [BareMetalMachineKeySetName ]: The name of the bare metal machine key set. + [BareMetalMachineName ]: The name of the bare metal machine. + [BmcKeySetName ]: The name of the baseboard management controller key set. + [CloudServicesNetworkName ]: The name of the cloud services network. + [ClusterManagerName ]: The name of the cluster manager. + [ClusterName ]: The name of the cluster. + [ConsoleName ]: The name of the virtual machine console. + [FeatureName ]: The name of the feature. + [Id ]: Resource identity path + [KubernetesClusterName ]: The name of the Kubernetes cluster. + [L2NetworkName ]: The name of the L2 network. + [L3NetworkName ]: The name of the L3 network. + [MetricsConfigurationName ]: The name of the metrics configuration for the cluster. + [RackName ]: The name of the rack. + [RackSkuName ]: The name of the rack SKU. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [StorageApplianceName ]: The name of the storage appliance. + [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. + [TrunkedNetworkName ]: The name of the trunked network. + [VirtualMachineName ]: The name of the virtual machine. + [VolumeName ]: The name of the volume. .Link https://learn.microsoft.com/powershell/module/az.networkcloud/remove-aznetworkcloudkubernetesclusterfeature #> @@ -14023,6 +15558,7 @@ function Remove-AzNetworkCloudKubernetesClusterFeature { [CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='Delete', Mandatory)] + [Parameter(ParameterSetName='DeleteViaIdentityKubernetesCluster', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [System.String] # The name of the feature. @@ -14053,9 +15589,14 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, + [Parameter(ParameterSetName='DeleteViaIdentityKubernetesCluster', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] + # Identity Parameter + ${KubernetesClusterInputObject}, + [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Header')] [System.String] @@ -14145,6 +15686,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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() @@ -14166,10 +15716,9 @@ begin { $mapping = @{ Delete = 'Az.NetworkCloud.private\Remove-AzNetworkCloudKubernetesClusterFeature_Delete'; DeleteViaIdentity = 'Az.NetworkCloud.private\Remove-AzNetworkCloudKubernetesClusterFeature_DeleteViaIdentity'; + DeleteViaIdentityKubernetesCluster = 'Az.NetworkCloud.private\Remove-AzNetworkCloudKubernetesClusterFeature_DeleteViaIdentityKubernetesCluster'; } - if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 { @@ -14183,6 +15732,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) @@ -14299,7 +15851,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -14391,6 +15942,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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() @@ -14413,9 +15973,7 @@ begin { Delete = 'Az.NetworkCloud.private\Remove-AzNetworkCloudKubernetesCluster_Delete'; DeleteViaIdentity = 'Az.NetworkCloud.private\Remove-AzNetworkCloudKubernetesCluster_DeleteViaIdentity'; } - if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 { @@ -14429,6 +15987,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) @@ -14545,7 +16106,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -14637,6 +16197,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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() @@ -14659,9 +16228,7 @@ begin { Delete = 'Az.NetworkCloud.private\Remove-AzNetworkCloudL2Network_Delete'; DeleteViaIdentity = 'Az.NetworkCloud.private\Remove-AzNetworkCloudL2Network_DeleteViaIdentity'; } - if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 { @@ -14675,6 +16242,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) @@ -14791,7 +16361,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -14883,6 +16452,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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() @@ -14905,9 +16483,7 @@ begin { Delete = 'Az.NetworkCloud.private\Remove-AzNetworkCloudL3Network_Delete'; DeleteViaIdentity = 'Az.NetworkCloud.private\Remove-AzNetworkCloudL3Network_DeleteViaIdentity'; } - if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 { @@ -14921,6 +16497,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) @@ -14981,6 +16560,30 @@ 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. +CLUSTERINPUTOBJECT : Identity Parameter + [AgentPoolName ]: The name of the Kubernetes cluster agent pool. + [BareMetalMachineKeySetName ]: The name of the bare metal machine key set. + [BareMetalMachineName ]: The name of the bare metal machine. + [BmcKeySetName ]: The name of the baseboard management controller key set. + [CloudServicesNetworkName ]: The name of the cloud services network. + [ClusterManagerName ]: The name of the cluster manager. + [ClusterName ]: The name of the cluster. + [ConsoleName ]: The name of the virtual machine console. + [FeatureName ]: The name of the feature. + [Id ]: Resource identity path + [KubernetesClusterName ]: The name of the Kubernetes cluster. + [L2NetworkName ]: The name of the L2 network. + [L3NetworkName ]: The name of the L3 network. + [MetricsConfigurationName ]: The name of the metrics configuration for the cluster. + [RackName ]: The name of the rack. + [RackSkuName ]: The name of the rack SKU. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [StorageApplianceName ]: The name of the storage appliance. + [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. + [TrunkedNetworkName ]: The name of the trunked network. + [VirtualMachineName ]: The name of the virtual machine. + [VolumeName ]: The name of the volume. + INPUTOBJECT : Identity Parameter [AgentPoolName ]: The name of the Kubernetes cluster agent pool. [BareMetalMachineKeySetName ]: The name of the bare metal machine key set. @@ -15018,6 +16621,7 @@ param( ${ClusterName}, [Parameter(ParameterSetName='Delete', Mandatory)] + [Parameter(ParameterSetName='DeleteViaIdentityCluster', Mandatory)] [Alias('MetricsConfigurationName')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [System.String] @@ -15043,9 +16647,14 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, + [Parameter(ParameterSetName='DeleteViaIdentityCluster', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] + # Identity Parameter + ${ClusterInputObject}, + [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Header')] [System.String] @@ -15135,6 +16744,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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() @@ -15156,10 +16774,9 @@ begin { $mapping = @{ Delete = 'Az.NetworkCloud.private\Remove-AzNetworkCloudMetricsConfiguration_Delete'; DeleteViaIdentity = 'Az.NetworkCloud.private\Remove-AzNetworkCloudMetricsConfiguration_DeleteViaIdentity'; + DeleteViaIdentityCluster = 'Az.NetworkCloud.private\Remove-AzNetworkCloudMetricsConfiguration_DeleteViaIdentityCluster'; } - if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 { @@ -15173,6 +16790,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) @@ -15289,7 +16909,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -15381,6 +17000,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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() @@ -15403,9 +17031,7 @@ begin { Delete = 'Az.NetworkCloud.private\Remove-AzNetworkCloudServicesNetwork_Delete'; DeleteViaIdentity = 'Az.NetworkCloud.private\Remove-AzNetworkCloudServicesNetwork_DeleteViaIdentity'; } - if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 { @@ -15419,6 +17045,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) @@ -15535,7 +17164,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -15627,6 +17255,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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() @@ -15649,9 +17286,7 @@ begin { Delete = 'Az.NetworkCloud.private\Remove-AzNetworkCloudTrunkedNetwork_Delete'; DeleteViaIdentity = 'Az.NetworkCloud.private\Remove-AzNetworkCloudTrunkedNetwork_DeleteViaIdentity'; } - if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 { @@ -15665,6 +17300,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) @@ -15781,7 +17419,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -15873,6 +17510,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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() @@ -15895,9 +17541,7 @@ begin { Delete = 'Az.NetworkCloud.private\Remove-AzNetworkCloudVirtualMachine_Delete'; DeleteViaIdentity = 'Az.NetworkCloud.private\Remove-AzNetworkCloudVirtualMachine_DeleteViaIdentity'; } - if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 { @@ -15911,6 +17555,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) @@ -16027,7 +17674,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -16119,6 +17765,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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() @@ -16141,9 +17796,7 @@ begin { Delete = 'Az.NetworkCloud.private\Remove-AzNetworkCloudVolume_Delete'; DeleteViaIdentity = 'Az.NetworkCloud.private\Remove-AzNetworkCloudVolume_DeleteViaIdentity'; } - if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 { @@ -16157,6 +17810,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) @@ -16273,7 +17929,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -16350,6 +18005,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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() @@ -16372,9 +18036,7 @@ begin { Restart = 'Az.NetworkCloud.private\Restart-AzNetworkCloudBareMetalMachine_Restart'; RestartViaIdentity = 'Az.NetworkCloud.private\Restart-AzNetworkCloudBareMetalMachine_RestartViaIdentity'; } - if (('Restart') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Restart') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -16388,6 +18050,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) @@ -16439,6 +18104,8 @@ Restart a targeted node of a Kubernetes cluster. .Example Restart-AzNetworkCloudKubernetesClusterNode -KubernetesClusterName kubernetesClusterName -ResourceGroupName resourceGroup -NodeName nodeName -SubscriptionId subscriptionId +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterRestartNodeParameters .Inputs Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity .Outputs @@ -16471,6 +18138,9 @@ INPUTOBJECT : Identity Parameter [TrunkedNetworkName ]: The name of the trunked network. [VirtualMachineName ]: The name of the virtual machine. [VolumeName ]: The name of the volume. + +KUBERNETESCLUSTERRESTARTNODEPARAMETER : KubernetesClusterRestartNodeParameters represents the body of the request to restart the node of a Kubernetes cluster. + NodeName : The name of the node to restart. .Link https://learn.microsoft.com/powershell/module/az.networkcloud/restart-aznetworkcloudkubernetesclusternode #> @@ -16478,20 +18148,29 @@ function Restart-AzNetworkCloudKubernetesClusterNode { [OutputType([System.Boolean])] [CmdletBinding(DefaultParameterSetName='RestartExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( + [Parameter(ParameterSetName='Restart', Mandatory)] [Parameter(ParameterSetName='RestartExpanded', Mandatory)] + [Parameter(ParameterSetName='RestartViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='RestartViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [System.String] # The name of the Kubernetes cluster. ${KubernetesClusterName}, + [Parameter(ParameterSetName='Restart', Mandatory)] [Parameter(ParameterSetName='RestartExpanded', Mandatory)] + [Parameter(ParameterSetName='RestartViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='RestartViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [System.String] # The name of the resource group. # The name is case insensitive. ${ResourceGroupName}, + [Parameter(ParameterSetName='Restart')] [Parameter(ParameterSetName='RestartExpanded')] + [Parameter(ParameterSetName='RestartViaJsonFilePath')] + [Parameter(ParameterSetName='RestartViaJsonString')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] @@ -16499,19 +18178,39 @@ param( # The value must be an UUID. ${SubscriptionId}, + [Parameter(ParameterSetName='RestartViaIdentity', Mandatory, ValueFromPipeline)] [Parameter(ParameterSetName='RestartViaIdentityExpanded', Mandatory, ValueFromPipeline)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='Restart', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='RestartViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterRestartNodeParameters] + # KubernetesClusterRestartNodeParameters represents the body of the request to restart the node of a Kubernetes cluster. + ${KubernetesClusterRestartNodeParameter}, + + [Parameter(ParameterSetName='RestartExpanded', Mandatory)] + [Parameter(ParameterSetName='RestartViaIdentityExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The name of the node to restart. ${NodeName}, + [Parameter(ParameterSetName='RestartViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Path of Json file supplied to the Restart operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='RestartViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Json string supplied to the Restart operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -16586,6 +18285,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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() @@ -16605,12 +18313,14 @@ begin { } $mapping = @{ + Restart = 'Az.NetworkCloud.private\Restart-AzNetworkCloudKubernetesClusterNode_Restart'; RestartExpanded = 'Az.NetworkCloud.private\Restart-AzNetworkCloudKubernetesClusterNode_RestartExpanded'; + RestartViaIdentity = 'Az.NetworkCloud.private\Restart-AzNetworkCloudKubernetesClusterNode_RestartViaIdentity'; RestartViaIdentityExpanded = 'Az.NetworkCloud.private\Restart-AzNetworkCloudKubernetesClusterNode_RestartViaIdentityExpanded'; + RestartViaJsonFilePath = 'Az.NetworkCloud.private\Restart-AzNetworkCloudKubernetesClusterNode_RestartViaJsonFilePath'; + RestartViaJsonString = 'Az.NetworkCloud.private\Restart-AzNetworkCloudKubernetesClusterNode_RestartViaJsonString'; } - if (('RestartExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Restart', 'RestartExpanded', 'RestartViaJsonFilePath', 'RestartViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -16624,6 +18334,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) @@ -16740,7 +18453,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -16817,6 +18529,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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() @@ -16839,9 +18560,7 @@ begin { Restart = 'Az.NetworkCloud.private\Restart-AzNetworkCloudVirtualMachine_Restart'; RestartViaIdentity = 'Az.NetworkCloud.private\Restart-AzNetworkCloudVirtualMachine_RestartViaIdentity'; } - if (('Restart') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Restart') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -16855,6 +18574,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) @@ -16971,7 +18693,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -17048,6 +18769,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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() @@ -17070,9 +18800,7 @@ begin { Start = 'Az.NetworkCloud.private\Start-AzNetworkCloudBareMetalMachine_Start'; StartViaIdentity = 'Az.NetworkCloud.private\Start-AzNetworkCloudBareMetalMachine_StartViaIdentity'; } - if (('Start') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Start') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -17086,6 +18814,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) @@ -17202,7 +18933,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -17279,6 +19009,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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() @@ -17301,9 +19040,7 @@ begin { Start = 'Az.NetworkCloud.private\Start-AzNetworkCloudVirtualMachine_Start'; StartViaIdentity = 'Az.NetworkCloud.private\Start-AzNetworkCloudVirtualMachine_StartViaIdentity'; } - if (('Start') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Start') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -17317,6 +19054,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) @@ -17408,6 +19148,8 @@ function Stop-AzNetworkCloudBareMetalMachine { [CmdletBinding(DefaultParameterSetName='PowerOffExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='PowerOffExpanded', Mandatory)] + [Parameter(ParameterSetName='PowerOffViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='PowerOffViaJsonString', Mandatory)] [Alias('BareMetalMachineName')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [System.String] @@ -17415,6 +19157,8 @@ param( ${Name}, [Parameter(ParameterSetName='PowerOffExpanded', Mandatory)] + [Parameter(ParameterSetName='PowerOffViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='PowerOffViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [System.String] # The name of the resource group. @@ -17422,6 +19166,8 @@ param( ${ResourceGroupName}, [Parameter(ParameterSetName='PowerOffExpanded')] + [Parameter(ParameterSetName='PowerOffViaJsonFilePath')] + [Parameter(ParameterSetName='PowerOffViaJsonString')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] @@ -17433,16 +19179,28 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineSkipShutdown])] + [Parameter(ParameterSetName='PowerOffExpanded')] + [Parameter(ParameterSetName='PowerOffViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("True", "False")] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineSkipShutdown] + [System.String] # The indicator of whether to skip the graceful OS shutdown and power off the bare metal machine immediately. ${SkipShutdown}, + [Parameter(ParameterSetName='PowerOffViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Path of Json file supplied to the PowerOff operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='PowerOffViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Json string supplied to the PowerOff operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -17517,6 +19275,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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() @@ -17538,10 +19305,10 @@ begin { $mapping = @{ PowerOffExpanded = 'Az.NetworkCloud.private\Stop-AzNetworkCloudBareMetalMachine_PowerOffExpanded'; PowerOffViaIdentityExpanded = 'Az.NetworkCloud.private\Stop-AzNetworkCloudBareMetalMachine_PowerOffViaIdentityExpanded'; + PowerOffViaJsonFilePath = 'Az.NetworkCloud.private\Stop-AzNetworkCloudBareMetalMachine_PowerOffViaJsonFilePath'; + PowerOffViaJsonString = 'Az.NetworkCloud.private\Stop-AzNetworkCloudBareMetalMachine_PowerOffViaJsonString'; } - if (('PowerOffExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('PowerOffExpanded', 'PowerOffViaJsonFilePath', 'PowerOffViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -17555,6 +19322,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) @@ -17646,6 +19416,8 @@ function Stop-AzNetworkCloudVirtualMachine { [CmdletBinding(DefaultParameterSetName='PowerOffExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='PowerOffExpanded', Mandatory)] + [Parameter(ParameterSetName='PowerOffViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='PowerOffViaJsonString', Mandatory)] [Alias('VirtualMachineName')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [System.String] @@ -17653,6 +19425,8 @@ param( ${Name}, [Parameter(ParameterSetName='PowerOffExpanded', Mandatory)] + [Parameter(ParameterSetName='PowerOffViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='PowerOffViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [System.String] # The name of the resource group. @@ -17660,6 +19434,8 @@ param( ${ResourceGroupName}, [Parameter(ParameterSetName='PowerOffExpanded')] + [Parameter(ParameterSetName='PowerOffViaJsonFilePath')] + [Parameter(ParameterSetName='PowerOffViaJsonString')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] @@ -17671,16 +19447,28 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.SkipShutdown])] + [Parameter(ParameterSetName='PowerOffExpanded')] + [Parameter(ParameterSetName='PowerOffViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("True", "False")] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.SkipShutdown] + [System.String] # The indicator of whether to skip the graceful OS shutdown and power off the virtual machine immediately. ${SkipShutdown}, + [Parameter(ParameterSetName='PowerOffViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Path of Json file supplied to the PowerOff operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='PowerOffViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Json string supplied to the PowerOff operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -17755,6 +19543,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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() @@ -17776,10 +19573,10 @@ begin { $mapping = @{ PowerOffExpanded = 'Az.NetworkCloud.private\Stop-AzNetworkCloudVirtualMachine_PowerOffExpanded'; PowerOffViaIdentityExpanded = 'Az.NetworkCloud.private\Stop-AzNetworkCloudVirtualMachine_PowerOffViaIdentityExpanded'; + PowerOffViaJsonFilePath = 'Az.NetworkCloud.private\Stop-AzNetworkCloudVirtualMachine_PowerOffViaJsonFilePath'; + PowerOffViaJsonString = 'Az.NetworkCloud.private\Stop-AzNetworkCloudVirtualMachine_PowerOffViaJsonString'; } - if (('PowerOffExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('PowerOffExpanded', 'PowerOffViaJsonFilePath', 'PowerOffViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -17793,6 +19590,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) @@ -17839,17 +19639,17 @@ end { <# .Synopsis Patch the properties of the provided Kubernetes cluster agent pool, or update the tags associated with the Kubernetes cluster agent pool. -Properties and tag updates can be done independently. +Properties and tag update can be done independently. .Description Patch the properties of the provided Kubernetes cluster agent pool, or update the tags associated with the Kubernetes cluster agent pool. -Properties and tag updates can be done independently. +Properties and tag update can be done independently. .Example Update-AzNetworkCloudAgentPool -Name agentPoolName -KubernetesClusterName clusterName -ResourceGroupName resourceGroup -Count updatedCount -Tag @{tags = "newTag"} -UpgradeSettingMaxSurge updatedMaxSurge .Inputs Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPool +Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPool .Notes COMPLEX PARAMETER PROPERTIES @@ -17881,20 +19681,49 @@ INPUTOBJECT : Identity Parameter [TrunkedNetworkName ]: The name of the trunked network. [VirtualMachineName ]: The name of the virtual machine. [VolumeName ]: The name of the volume. + +KUBERNETESCLUSTERINPUTOBJECT : Identity Parameter + [AgentPoolName ]: The name of the Kubernetes cluster agent pool. + [BareMetalMachineKeySetName ]: The name of the bare metal machine key set. + [BareMetalMachineName ]: The name of the bare metal machine. + [BmcKeySetName ]: The name of the baseboard management controller key set. + [CloudServicesNetworkName ]: The name of the cloud services network. + [ClusterManagerName ]: The name of the cluster manager. + [ClusterName ]: The name of the cluster. + [ConsoleName ]: The name of the virtual machine console. + [FeatureName ]: The name of the feature. + [Id ]: Resource identity path + [KubernetesClusterName ]: The name of the Kubernetes cluster. + [L2NetworkName ]: The name of the L2 network. + [L3NetworkName ]: The name of the L3 network. + [MetricsConfigurationName ]: The name of the metrics configuration for the cluster. + [RackName ]: The name of the rack. + [RackSkuName ]: The name of the rack SKU. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [StorageApplianceName ]: The name of the storage appliance. + [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. + [TrunkedNetworkName ]: The name of the trunked network. + [VirtualMachineName ]: The name of the virtual machine. + [VolumeName ]: The name of the volume. .Link https://learn.microsoft.com/powershell/module/az.networkcloud/update-aznetworkcloudagentpool #> function Update-AzNetworkCloudAgentPool { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPool])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPool])] [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.NetworkCloud.Category('Path')] [System.String] # The name of the Kubernetes cluster. ${KubernetesClusterName}, [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaIdentityKubernetesClusterExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [Alias('AgentPoolName')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [System.String] @@ -17902,6 +19731,8 @@ param( ${Name}, [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [System.String] # The name of the resource group. @@ -17909,6 +19740,8 @@ param( ${ResourceGroupName}, [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaJsonFilePath')] + [Parameter(ParameterSetName='UpdateViaJsonString')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] @@ -17920,9 +19753,14 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, + [Parameter(ParameterSetName='UpdateViaIdentityKubernetesClusterExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] + # Identity Parameter + ${KubernetesClusterInputObject}, + [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Header')] [System.String] @@ -17938,35 +19776,44 @@ param( # Other values will result in error from server as they are not supported. ${IfNoneMatch}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityKubernetesClusterExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey[]] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISshPublicKey[]] # SshPublicKey represents the public key used to authenticate with a resource through SSH. - # To construct, see NOTES section for ADMINISTRATORCONFIGURATIONSSHPUBLICKEY properties and create a hash table. ${AdministratorConfigurationSshPublicKey}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityKubernetesClusterExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.Int64] # The number of virtual machines that use this configuration. ${Count}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityKubernetesClusterExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPatchParametersTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPatchParametersTags]))] [System.Collections.Hashtable] # The Azure resource tags that will replace the existing ones. ${Tag}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityKubernetesClusterExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.Int64] # The maximum time in seconds that is allowed for a node drain to complete before proceeding with the upgrade of the agent pool. # If not specified during creation, a value of 1800 seconds is used. ${UpgradeSettingDrainTimeout}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityKubernetesClusterExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The maximum number or percentage of nodes that are surged during upgrade. @@ -17979,7 +19826,9 @@ param( # One of MaxSurge and MaxUnavailable must be greater than 0. ${UpgradeSettingMaxSurge}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityKubernetesClusterExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The maximum number or percentage of nodes that can be unavailable during upgrade. @@ -17992,6 +19841,18 @@ param( # One of MaxSurge and MaxUnavailable must be greater than 0. ${UpgradeSettingMaxUnavailable}, + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Path of Json file supplied to the Update operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Json string supplied to the Update operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -18060,6 +19921,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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() @@ -18081,10 +19951,11 @@ begin { $mapping = @{ UpdateExpanded = 'Az.NetworkCloud.private\Update-AzNetworkCloudAgentPool_UpdateExpanded'; UpdateViaIdentityExpanded = 'Az.NetworkCloud.private\Update-AzNetworkCloudAgentPool_UpdateViaIdentityExpanded'; + UpdateViaIdentityKubernetesClusterExpanded = 'Az.NetworkCloud.private\Update-AzNetworkCloudAgentPool_UpdateViaIdentityKubernetesClusterExpanded'; + UpdateViaJsonFilePath = 'Az.NetworkCloud.private\Update-AzNetworkCloudAgentPool_UpdateViaJsonFilePath'; + UpdateViaJsonString = 'Az.NetworkCloud.private\Update-AzNetworkCloudAgentPool_UpdateViaJsonString'; } - if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 { @@ -18098,6 +19969,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) @@ -18144,10 +20018,10 @@ end { <# .Synopsis Patch properties of bare metal machine key set for the provided cluster, or update the tags associated with it. -Properties and tag updates can be done independently. +Properties and tag update can be done independently. .Description Patch properties of bare metal machine key set for the provided cluster, or update the tags associated with it. -Properties and tag updates can be done independently. +Properties and tag update can be done independently. .Example $tagHash = @{ tag = "tagUpdate" @@ -18169,12 +20043,36 @@ Update-AzNetworkCloudBareMetalMachineKeySet -ResourceGroupName resourceGroupName .Inputs Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySet +Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySet .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. +CLUSTERINPUTOBJECT : Identity Parameter + [AgentPoolName ]: The name of the Kubernetes cluster agent pool. + [BareMetalMachineKeySetName ]: The name of the bare metal machine key set. + [BareMetalMachineName ]: The name of the bare metal machine. + [BmcKeySetName ]: The name of the baseboard management controller key set. + [CloudServicesNetworkName ]: The name of the cloud services network. + [ClusterManagerName ]: The name of the cluster manager. + [ClusterName ]: The name of the cluster. + [ConsoleName ]: The name of the virtual machine console. + [FeatureName ]: The name of the feature. + [Id ]: Resource identity path + [KubernetesClusterName ]: The name of the Kubernetes cluster. + [L2NetworkName ]: The name of the L2 network. + [L3NetworkName ]: The name of the L3 network. + [MetricsConfigurationName ]: The name of the metrics configuration for the cluster. + [RackName ]: The name of the rack. + [RackSkuName ]: The name of the rack SKU. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [StorageApplianceName ]: The name of the storage appliance. + [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. + [TrunkedNetworkName ]: The name of the trunked network. + [VirtualMachineName ]: The name of the virtual machine. + [VolumeName ]: The name of the volume. + INPUTOBJECT : Identity Parameter [AgentPoolName ]: The name of the Kubernetes cluster agent pool. [BareMetalMachineKeySetName ]: The name of the bare metal machine key set. @@ -18208,16 +20106,21 @@ USERLIST : The unique list of permitted users. https://learn.microsoft.com/powershell/module/az.networkcloud/update-aznetworkcloudbaremetalmachinekeyset #> function Update-AzNetworkCloudBareMetalMachineKeySet { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySet])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySet])] [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.NetworkCloud.Category('Path')] [System.String] # The name of the cluster. ${ClusterName}, [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaIdentityClusterExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [Alias('BareMetalMachineKeySetName')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [System.String] @@ -18225,6 +20128,8 @@ param( ${Name}, [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [System.String] # The name of the resource group. @@ -18232,6 +20137,8 @@ param( ${ResourceGroupName}, [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaJsonFilePath')] + [Parameter(ParameterSetName='UpdateViaJsonString')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] @@ -18239,11 +20146,16 @@ param( # The value must be an UUID. ${SubscriptionId}, + [Parameter(ParameterSetName='UpdateViaIdentityClusterExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] + # Identity Parameter + ${ClusterInputObject}, + [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -18261,34 +20173,53 @@ param( # Other values will result in error from server as they are not supported. ${IfNoneMatch}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityClusterExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.DateTime] # The date and time after which the users in this key set will be removed from the bare metal machines. ${Expiration}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityClusterExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String[]] # The list of IP addresses of jump hosts with management network access from which a login will be allowed for the users. ${JumpHostsAllowed}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityClusterExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetPatchParametersTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetPatchParametersTags]))] [System.Collections.Hashtable] # The Azure resource tags that will replace the existing ones. ${Tag}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityClusterExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKeySetUser[]] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKeySetUser[]] # The unique list of permitted users. - # To construct, see NOTES section for USERLIST properties and create a hash table. ${UserList}, + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Path of Json file supplied to the Update operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Json string supplied to the Update operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -18357,6 +20288,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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() @@ -18377,11 +20317,12 @@ begin { $mapping = @{ UpdateExpanded = 'Az.NetworkCloud.private\Update-AzNetworkCloudBareMetalMachineKeySet_UpdateExpanded'; + UpdateViaIdentityClusterExpanded = 'Az.NetworkCloud.private\Update-AzNetworkCloudBareMetalMachineKeySet_UpdateViaIdentityClusterExpanded'; UpdateViaIdentityExpanded = 'Az.NetworkCloud.private\Update-AzNetworkCloudBareMetalMachineKeySet_UpdateViaIdentityExpanded'; + UpdateViaJsonFilePath = 'Az.NetworkCloud.private\Update-AzNetworkCloudBareMetalMachineKeySet_UpdateViaJsonFilePath'; + UpdateViaJsonString = 'Az.NetworkCloud.private\Update-AzNetworkCloudBareMetalMachineKeySet_UpdateViaJsonString'; } - if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 { @@ -18395,6 +20336,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) @@ -18441,17 +20385,17 @@ end { <# .Synopsis Patch properties of the provided bare metal machine, or update tags associated with the bare metal machine. -Properties and tag updates can be done independently. +Properties and tag update can be done independently. .Description Patch properties of the provided bare metal machine, or update tags associated with the bare metal machine. -Properties and tag updates can be done independently. +Properties and tag update can be done independently. .Example Update-AzNetworkCloudBareMetalMachine -Name bmmName -ResourceGroupName resourceGroupName -SubscriptionId subscriptionId -Tag @{tags = "tag1"} -MachineDetail machineDetailInfo .Inputs Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachine +Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachine .Notes COMPLEX PARAMETER PROPERTIES @@ -18484,10 +20428,12 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.networkcloud/update-aznetworkcloudbaremetalmachine #> function Update-AzNetworkCloudBareMetalMachine { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachine])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachine])] [CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [Alias('BareMetalMachineName')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [System.String] @@ -18495,6 +20441,8 @@ param( ${Name}, [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [System.String] # The name of the resource group. @@ -18502,6 +20450,8 @@ param( ${ResourceGroupName}, [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaJsonFilePath')] + [Parameter(ParameterSetName='UpdateViaJsonString')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] @@ -18513,7 +20463,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -18531,19 +20480,33 @@ param( # Other values will result in error from server as they are not supported. ${IfNoneMatch}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The details provided by the customer during the creation of rack manifests that allows for custom data to be associated with this machine. ${MachineDetail}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePatchParametersTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePatchParametersTags]))] [System.Collections.Hashtable] # The Azure resource tags that will replace the existing ones. ${Tag}, + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Path of Json file supplied to the Update operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Json string supplied to the Update operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -18612,6 +20575,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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() @@ -18633,10 +20605,10 @@ begin { $mapping = @{ UpdateExpanded = 'Az.NetworkCloud.private\Update-AzNetworkCloudBareMetalMachine_UpdateExpanded'; UpdateViaIdentityExpanded = 'Az.NetworkCloud.private\Update-AzNetworkCloudBareMetalMachine_UpdateViaIdentityExpanded'; + UpdateViaJsonFilePath = 'Az.NetworkCloud.private\Update-AzNetworkCloudBareMetalMachine_UpdateViaJsonFilePath'; + UpdateViaJsonString = 'Az.NetworkCloud.private\Update-AzNetworkCloudBareMetalMachine_UpdateViaJsonString'; } - if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 { @@ -18650,6 +20622,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) @@ -18696,10 +20671,10 @@ end { <# .Synopsis Patch properties of baseboard management controller key set for the provided cluster, or update the tags associated with it. -Properties and tag updates can be done independently. +Properties and tag update can be done independently. .Description Patch properties of baseboard management controller key set for the provided cluster, or update the tags associated with it. -Properties and tag updates can be done independently. +Properties and tag update can be done independently. .Example $tagHash = @{ tag = "tagUpdate" @@ -18721,12 +20696,36 @@ Update-AzNetworkCloudBmcKeySet -ResourceGroupName resourceGroupName -Name basebo .Inputs Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySet +Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySet .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. +CLUSTERINPUTOBJECT : Identity Parameter + [AgentPoolName ]: The name of the Kubernetes cluster agent pool. + [BareMetalMachineKeySetName ]: The name of the bare metal machine key set. + [BareMetalMachineName ]: The name of the bare metal machine. + [BmcKeySetName ]: The name of the baseboard management controller key set. + [CloudServicesNetworkName ]: The name of the cloud services network. + [ClusterManagerName ]: The name of the cluster manager. + [ClusterName ]: The name of the cluster. + [ConsoleName ]: The name of the virtual machine console. + [FeatureName ]: The name of the feature. + [Id ]: Resource identity path + [KubernetesClusterName ]: The name of the Kubernetes cluster. + [L2NetworkName ]: The name of the L2 network. + [L3NetworkName ]: The name of the L3 network. + [MetricsConfigurationName ]: The name of the metrics configuration for the cluster. + [RackName ]: The name of the rack. + [RackSkuName ]: The name of the rack SKU. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [StorageApplianceName ]: The name of the storage appliance. + [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. + [TrunkedNetworkName ]: The name of the trunked network. + [VirtualMachineName ]: The name of the virtual machine. + [VolumeName ]: The name of the volume. + INPUTOBJECT : Identity Parameter [AgentPoolName ]: The name of the Kubernetes cluster agent pool. [BareMetalMachineKeySetName ]: The name of the bare metal machine key set. @@ -18760,16 +20759,21 @@ USERLIST : The unique list of permitted users. https://learn.microsoft.com/powershell/module/az.networkcloud/update-aznetworkcloudbmckeyset #> function Update-AzNetworkCloudBmcKeySet { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySet])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySet])] [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.NetworkCloud.Category('Path')] [System.String] # The name of the cluster. ${ClusterName}, [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaIdentityClusterExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [Alias('BmcKeySetName')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [System.String] @@ -18777,6 +20781,8 @@ param( ${Name}, [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [System.String] # The name of the resource group. @@ -18784,6 +20790,8 @@ param( ${ResourceGroupName}, [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaJsonFilePath')] + [Parameter(ParameterSetName='UpdateViaJsonString')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] @@ -18791,11 +20799,16 @@ param( # The value must be an UUID. ${SubscriptionId}, + [Parameter(ParameterSetName='UpdateViaIdentityClusterExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] + # Identity Parameter + ${ClusterInputObject}, + [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -18813,27 +20826,44 @@ param( # Other values will result in error from server as they are not supported. ${IfNoneMatch}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityClusterExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.DateTime] # The date and time after which the users in this key set will be removed from the baseboard management controllers. ${Expiration}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityClusterExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetPatchParametersTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetPatchParametersTags]))] [System.Collections.Hashtable] # The Azure resource tags that will replace the existing ones. ${Tag}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityClusterExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKeySetUser[]] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKeySetUser[]] # The unique list of permitted users. - # To construct, see NOTES section for USERLIST properties and create a hash table. ${UserList}, + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Path of Json file supplied to the Update operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Json string supplied to the Update operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -18902,6 +20932,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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() @@ -18922,11 +20961,12 @@ begin { $mapping = @{ UpdateExpanded = 'Az.NetworkCloud.private\Update-AzNetworkCloudBmcKeySet_UpdateExpanded'; + UpdateViaIdentityClusterExpanded = 'Az.NetworkCloud.private\Update-AzNetworkCloudBmcKeySet_UpdateViaIdentityClusterExpanded'; UpdateViaIdentityExpanded = 'Az.NetworkCloud.private\Update-AzNetworkCloudBmcKeySet_UpdateViaIdentityExpanded'; + UpdateViaJsonFilePath = 'Az.NetworkCloud.private\Update-AzNetworkCloudBmcKeySet_UpdateViaJsonFilePath'; + UpdateViaJsonString = 'Az.NetworkCloud.private\Update-AzNetworkCloudBmcKeySet_UpdateViaJsonString'; } - if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 { @@ -18940,6 +20980,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) @@ -18985,11 +21028,9 @@ end { <# .Synopsis -Patch properties of the provided cluster manager, or update the tags assigned to the cluster manager. -Properties and tag updates can be done independently. +Update a new cluster manager or update properties of the cluster manager if it exists. .Description -Patch properties of the provided cluster manager, or update the tags assigned to the cluster manager. -Properties and tag updates can be done independently. +Update a new cluster manager or update properties of the cluster manager if it exists. .Example $tagUpdatedHash = @{ tag1 = "tag1" @@ -19001,7 +21042,7 @@ Update-AzNetworkCloudClusterManager -ResourceGroupName resourceGroupName -Subscr .Inputs Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManager +Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManager .Notes COMPLEX PARAMETER PROPERTIES @@ -19034,7 +21075,7 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.networkcloud/update-aznetworkcloudclustermanager #> function Update-AzNetworkCloudClusterManager { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManager])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManager])] [CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] @@ -19063,7 +21104,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -19082,27 +21122,25 @@ param( ${IfNoneMatch}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentityType])] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentityType] - # Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). - ${IdentityType}, + [System.Nullable[System.Boolean]] + # Determines whether to enable a system-assigned identity for the resource. + ${EnableSystemAssignedIdentity}, [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IUserAssignedIdentities]))] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceTags]))] [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}, + # Resource tags. + ${Tag}, [Parameter()] + [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerPatchParametersTags]))] - [System.Collections.Hashtable] - # The Azure resource tags that will replace the existing ones. - ${Tag}, + [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()] [Alias('AzureRMContext', 'AzureCredential')] @@ -19113,6 +21151,12 @@ param( # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Runtime')] [System.Management.Automation.SwitchParameter] @@ -19133,6 +21177,12 @@ param( # SendAsync Pipeline Steps to be prepended to the front of the pipeline ${HttpPipelinePrepend}, + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Runtime')] [System.Uri] @@ -19160,6 +21210,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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() @@ -19182,9 +21241,7 @@ begin { UpdateExpanded = 'Az.NetworkCloud.private\Update-AzNetworkCloudClusterManager_UpdateExpanded'; UpdateViaIdentityExpanded = 'Az.NetworkCloud.private\Update-AzNetworkCloudClusterManager_UpdateViaIdentityExpanded'; } - if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 { @@ -19198,6 +21255,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) @@ -19243,15 +21303,13 @@ end { <# .Synopsis -Patch the properties of the provided cluster, or update the tags associated with the cluster. -Properties and tag updates can be done independently. +Update a new cluster or update the properties of the cluster if it exists. .Description -Patch the properties of the provided cluster, or update the tags associated with the cluster. -Properties and tag updates can be done independently. +Update a new cluster or update the properties of the cluster if it exists. .Example $storageapplianceconfigurationdata = @() $baremetalmachineconfigurationdata = @() -$computerackdefinition = @(@{IRackDefinition = "The list of rack definitions for the compute racks in a multi-rackcluster, or an empty list in a single-rack cluster."}) +$computerackdefinition = @(@{IRackDefinition = "The list of rack definitions for the compute racks in a multi-rack cluster, or an empty list in a single-rack cluster."}) $tagHash = @{ tag = "tag" tagUpdate = "tagUpdate" @@ -19268,17 +21326,15 @@ $tagHash = @{ tagUpdate = "tagUpdate" } $securePassword = ConvertTo-SecureString "password" -asplaintext -force -$identityUserAssignedIdentity = @{} $userAssignedIdentityResourceId = "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myManagedIdentity" -$identityUserAssignedIdentity.Add($userAssignedIdentityResourceId, @{}) -Update-AzNetworkCloudCluster -ResourceGroupName resourceGroup -Name clusterName -AggregatorOrSingleRackDefinitionNetworkRackId rackId -AggregatorOrSingleRackDefinitionRackSerialNumber sr1234 -AggregatorOrSingleRackDefinitionRackSkuId rackSku -IdentityType identityType -IdentityUserAssignedIdentity $identityUserAssignedIdentity -SubscriptionId subscriptionId -AggregatorOrSingleRackDefinitionAvailabilityZone availabilityZone -AggregatorOrSingleRackDefinitionBareMetalMachineConfiguration $baremetalmachineconfigurationdata -AggregatorOrSingleRackDefinitionRackLocation rackLocation -AggregatorOrSingleRackDefinitionStorageApplianceConfiguration $storageapplianceconfigurationdata -AnalyticsOutputSettingsAssociatedIdentityType identityType -AnalyticsOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId userAssignedIdentityResourceId -AnalyticOutputSettingAnalyticsWorkspaceId analyticsWorkspaceId -CommandOutputSettingContainerUrl containerUrl -AssociatedIdentityType commandOutputSettingsIdentityType -AssociatedIdentityUserAssignedIdentityResourceId commandOutputSettingsUserAssignedIdentityResourceId -ClusterServicePrincipalApplicationId clusterServicePrincipalAppId -ClusterServicePrincipalId ClusterServicePrincipalId -ClusterServicePrincipalPassword $securePassword -ClusterServicePrincipalTenantId tenantId -ComputeRackDefinition $computerackdefinition -SecretArchiveKeyVaultId keyVaultId -SecretArchiveSettingVaultUri keyVaultUri -SecretArchiveSettingsAssociatedIdentityType identityType -SecretArchiveSettingsAssociatedIdentityUserAssignedIdentityResourceId userAssignedIdentityResourceId -SecretArchiveUseKeyVault useKeyVault -UpdateStrategyThresholdType updateStrategyThresholdType -UpdateStrategyThresholdValue updateStrategyThresholdValue -UpdateStrategyType updateStrategyType -UpdateStrategyWaitTimeMinute updateStrategyWaitTimeMinutes -VulnerabilityScanningSettingContainerScan vulnerabilityScanningSettingContainerScan -ComputeDeploymentThresholdGrouping computeDeploymentThresholdGrouping -ComputeDeploymentThresholdType computeDeploymentThresholdType -ComputeDeploymentThresholdValue computeDeploymentThresholdValue -Tag $tagHash +Update-AzNetworkCloudCluster -ResourceGroupName resourceGroup -Name clusterName -AggregatorOrSingleRackDefinitionNetworkRackId rackId -AggregatorOrSingleRackDefinitionRackSerialNumber sr1234 -AggregatorOrSingleRackDefinitionRackSkuId rackSku -UserAssignedIdentity $userAssignedIdentityResourceId -SubscriptionId subscriptionId -AggregatorOrSingleRackDefinitionAvailabilityZone availabilityZone -AggregatorOrSingleRackDefinitionBareMetalMachineConfiguration $baremetalmachineconfigurationdata -AggregatorOrSingleRackDefinitionRackLocation rackLocation -AggregatorOrSingleRackDefinitionStorageApplianceConfiguration $storageapplianceconfigurationdata -AnalyticsOutputSettingsAssociatedIdentityType identityType -AnalyticsOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId userAssignedIdentityResourceId -AnalyticOutputSettingAnalyticsWorkspaceId analyticsWorkspaceId -CommandOutputSettingContainerUrl containerUrl -AssociatedIdentityType commandOutputSettingsIdentityType -AssociatedIdentityUserAssignedIdentityResourceId commandOutputSettingsUserAssignedIdentityResourceId -ClusterServicePrincipalApplicationId clusterServicePrincipalAppId -ClusterServicePrincipalId ClusterServicePrincipalId -ClusterServicePrincipalPassword $securePassword -ClusterServicePrincipalTenantId tenantId -ComputeRackDefinition $computerackdefinition -SecretArchiveKeyVaultId keyVaultId -SecretArchiveSettingVaultUri keyVaultUri -SecretArchiveSettingsAssociatedIdentityType identityType -SecretArchiveSettingsAssociatedIdentityUserAssignedIdentityResourceId userAssignedIdentityResourceId -SecretArchiveUseKeyVault useKeyVault -UpdateStrategyThresholdType updateStrategyThresholdType -UpdateStrategyThresholdValue updateStrategyThresholdValue -UpdateStrategyType updateStrategyType -UpdateStrategyWaitTimeMinute updateStrategyWaitTimeMinutes -VulnerabilityScanningSettingContainerScan vulnerabilityScanningSettingContainerScan -ComputeDeploymentThresholdGrouping computeDeploymentThresholdGrouping -ComputeDeploymentThresholdType computeDeploymentThresholdType -ComputeDeploymentThresholdValue computeDeploymentThresholdValue -Tag $tagHash .Inputs Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICluster +Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICluster .Notes COMPLEX PARAMETER PROPERTIES @@ -19306,7 +21362,7 @@ COMPUTERACKDEFINITION : The list of rack definitions for the RackSerialNumber : The unique identifier for the rack within Network Cloud cluster. An alternate unique alphanumeric value other than a serial number may be provided if desired. RackSkuId : The resource ID of the sku for the rack being added. [AvailabilityZone ]: The zone name used for this rack when created. Availability zones are used for workload placement. - [BareMetalMachineConfigurationData ]: The unordered list of bare metal machine configuration. + [BareMetalMachineConfigurationData >]: The unordered list of bare metal machine configuration. BmcCredentialsPassword : The password of the administrator of the device used during initialization. BmcCredentialsUsername : The username of the administrator of the device used during initialization. BmcMacAddress : The MAC address of the BMC for this machine. @@ -19316,7 +21372,7 @@ COMPUTERACKDEFINITION : The list of rack definitions for the [MachineDetail ]: The free-form additional information about the machine, e.g. an asset tag. [MachineName ]: The user-provided name for the bare metal machine created from this specification. If not provided, the machine name will be generated programmatically. [RackLocation ]: The free-form description of the rack's location. - [StorageApplianceConfigurationData ]: The list of storage appliance configuration data for this rack. + [StorageApplianceConfigurationData >]: The list of storage appliance configuration data for this rack. AdminCredentialsPassword : The password of the administrator of the device used during initialization. AdminCredentialsUsername : The username of the administrator of the device used during initialization. RackSlot : The slot that storage appliance is in the rack based on the BOM configuration. @@ -19350,7 +21406,7 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.networkcloud/update-aznetworkcloudcluster #> function Update-AzNetworkCloudCluster { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICluster])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICluster])] [CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] @@ -19379,7 +21435,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -19407,9 +21462,8 @@ param( [Parameter()] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineConfigurationData[]] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineConfigurationData[]] # The unordered list of bare metal machine configuration. - # To construct, see NOTES section for AGGREGATORORSINGLERACKDEFINITIONBAREMETALMACHINECONFIGURATION properties and create a hash table. ${AggregatorOrSingleRackDefinitionBareMetalMachineConfiguration}, [Parameter()] @@ -19440,9 +21494,8 @@ param( [Parameter()] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceConfigurationData[]] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceConfigurationData[]] # The list of storage appliance configuration data for this rack. - # To construct, see NOTES section for AGGREGATORORSINGLERACKDEFINITIONSTORAGEAPPLIANCECONFIGURATION properties and create a hash table. ${AggregatorOrSingleRackDefinitionStorageApplianceConfiguration}, [Parameter()] @@ -19452,9 +21505,9 @@ param( ${AnalyticOutputSettingAnalyticsWorkspaceId}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType])] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("SystemAssignedIdentity", "UserAssignedIdentity")] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType] + [System.String] # The type of managed identity that is being selected. ${AnalyticsOutputSettingsAssociatedIdentityType}, @@ -19466,9 +21519,9 @@ param( ${AnalyticsOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType])] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("SystemAssignedIdentity", "UserAssignedIdentity")] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType] + [System.String] # The type of associated identity for CommandOutputSettings. ${AssociatedIdentityType}, @@ -19515,16 +21568,16 @@ param( ${CommandOutputSettingContainerUrl}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdGrouping])] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("PerCluster", "PerRack")] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdGrouping] + [System.String] # Selection of how the type evaluation is applied to the cluster calculation. ${ComputeDeploymentThresholdGrouping}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdType])] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("CountSuccess", "PercentSuccess")] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdType] + [System.String] # Selection of how the threshold should be evaluated. ${ComputeDeploymentThresholdType}, @@ -19537,31 +21590,20 @@ param( [Parameter()] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackDefinition[]] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackDefinition[]] # The list of rack definitions for the compute racks in a multi-rack cluster, or an empty list in a single-rack cluster. - # To construct, see NOTES section for COMPUTERACKDEFINITION properties and create a hash table. ${ComputeRackDefinition}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentityType])] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentityType] - # Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). - ${IdentityType}, - [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.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}, + [System.Nullable[System.Boolean]] + # Determines whether to enable a system-assigned identity for the resource. + ${EnableSystemAssignedIdentity}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RuntimeProtectionEnforcementLevel])] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Audit", "Disabled", "OnDemand", "Passive", "RealTime")] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RuntimeProtectionEnforcementLevel] + [System.String] # The mode of operation for runtime protection. ${RuntimeProtectionConfigurationEnforcementLevel}, @@ -19578,9 +21620,9 @@ param( ${SecretArchiveSettingVaultUri}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType])] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("SystemAssignedIdentity", "UserAssignedIdentity")] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType] + [System.String] # The type of managed identity that is being selected. ${SecretArchiveSettingsAssociatedIdentityType}, @@ -19592,17 +21634,17 @@ param( ${SecretArchiveSettingsAssociatedIdentityUserAssignedIdentityResourceId}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterSecretArchiveEnabled])] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("True", "False")] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterSecretArchiveEnabled] + [System.String] # The indicator if the specified key vault should be used to archive the secrets of the cluster. ${SecretArchiveUseKeyVault}, [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceTags]))] [System.Collections.Hashtable] - # The Azure resource tags that will replace the existing ones. + # Resource tags. ${Tag}, [Parameter()] @@ -19613,9 +21655,9 @@ param( ${UpdateStrategyMaxUnavailable}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdType])] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("CountSuccess", "PercentSuccess")] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdType] + [System.String] # Selection of how the threshold should be evaluated. ${UpdateStrategyThresholdType}, @@ -19626,9 +21668,9 @@ param( ${UpdateStrategyThresholdValue}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterUpdateStrategyType])] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Rack", "PauseAfterRack")] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterUpdateStrategyType] + [System.String] # The mode of operation for runtime protection. ${UpdateStrategyType}, @@ -19639,9 +21681,17 @@ param( ${UpdateStrategyWaitTimeMinute}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VulnerabilityScanningSettingsContainerScan])] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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()] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Disabled", "Enabled")] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VulnerabilityScanningSettingsContainerScan] + [System.String] # The mode selection for container vulnerability scanning. ${VulnerabilityScanningSettingContainerScan}, @@ -19713,6 +21763,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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() @@ -19735,9 +21794,7 @@ begin { UpdateExpanded = 'Az.NetworkCloud.private\Update-AzNetworkCloudCluster_UpdateExpanded'; UpdateViaIdentityExpanded = 'Az.NetworkCloud.private\Update-AzNetworkCloudCluster_UpdateViaIdentityExpanded'; } - if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 { @@ -19751,6 +21808,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) @@ -19797,10 +21857,10 @@ end { <# .Synopsis Patch the properties of the provided virtual machine console, or update the tags associated with the virtual machine console. -Properties and tag updates can be done independently. +Properties and tag update can be done independently. .Description Patch the properties of the provided virtual machine console, or update the tags associated with the virtual machine console. -Properties and tag updates can be done independently. +Properties and tag update can be done independently. .Example $tagUpdatedHash = @{ tag1 = "tag1" @@ -19812,7 +21872,7 @@ Update-AzNetworkCloudConsole -ResourceGroupName resourceGroupName -VirtualMachin .Inputs Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsole +Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsole .Notes COMPLEX PARAMETER PROPERTIES @@ -19841,14 +21901,41 @@ INPUTOBJECT : Identity Parameter [TrunkedNetworkName ]: The name of the trunked network. [VirtualMachineName ]: The name of the virtual machine. [VolumeName ]: The name of the volume. + +VIRTUALMACHINEINPUTOBJECT : Identity Parameter + [AgentPoolName ]: The name of the Kubernetes cluster agent pool. + [BareMetalMachineKeySetName ]: The name of the bare metal machine key set. + [BareMetalMachineName ]: The name of the bare metal machine. + [BmcKeySetName ]: The name of the baseboard management controller key set. + [CloudServicesNetworkName ]: The name of the cloud services network. + [ClusterManagerName ]: The name of the cluster manager. + [ClusterName ]: The name of the cluster. + [ConsoleName ]: The name of the virtual machine console. + [FeatureName ]: The name of the feature. + [Id ]: Resource identity path + [KubernetesClusterName ]: The name of the Kubernetes cluster. + [L2NetworkName ]: The name of the L2 network. + [L3NetworkName ]: The name of the L3 network. + [MetricsConfigurationName ]: The name of the metrics configuration for the cluster. + [RackName ]: The name of the rack. + [RackSkuName ]: The name of the rack SKU. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [StorageApplianceName ]: The name of the storage appliance. + [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. + [TrunkedNetworkName ]: The name of the trunked network. + [VirtualMachineName ]: The name of the virtual machine. + [VolumeName ]: The name of the volume. .Link https://learn.microsoft.com/powershell/module/az.networkcloud/update-aznetworkcloudconsole #> function Update-AzNetworkCloudConsole { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsole])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsole])] [CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaIdentityVirtualMachineExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [Alias('ConsoleName')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [System.String] @@ -19856,6 +21943,8 @@ param( ${Name}, [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [System.String] # The name of the resource group. @@ -19863,6 +21952,8 @@ param( ${ResourceGroupName}, [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaJsonFilePath')] + [Parameter(ParameterSetName='UpdateViaJsonString')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] @@ -19871,6 +21962,8 @@ param( ${SubscriptionId}, [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [System.String] # The name of the virtual machine. @@ -19880,9 +21973,14 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, + [Parameter(ParameterSetName='UpdateViaIdentityVirtualMachineExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] + # Identity Parameter + ${VirtualMachineInputObject}, + [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Header')] [System.String] @@ -19898,32 +21996,52 @@ param( # Other values will result in error from server as they are not supported. ${IfNoneMatch}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ConsoleEnabled])] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityVirtualMachineExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("True", "False")] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ConsoleEnabled] + [System.String] # The indicator of whether the console access is enabled. ${Enabled}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityVirtualMachineExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.DateTime] # The date and time after which the key will be disallowed access. ${Expiration}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityVirtualMachineExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The SSH public key data. ${SshPublicKeyData}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityVirtualMachineExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsolePatchParametersTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsolePatchParametersTags]))] [System.Collections.Hashtable] # The Azure resource tags that will replace the existing ones. ${Tag}, + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Path of Json file supplied to the Update operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Json string supplied to the Update operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -19992,6 +22110,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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() @@ -20013,10 +22140,11 @@ begin { $mapping = @{ UpdateExpanded = 'Az.NetworkCloud.private\Update-AzNetworkCloudConsole_UpdateExpanded'; UpdateViaIdentityExpanded = 'Az.NetworkCloud.private\Update-AzNetworkCloudConsole_UpdateViaIdentityExpanded'; + UpdateViaIdentityVirtualMachineExpanded = 'Az.NetworkCloud.private\Update-AzNetworkCloudConsole_UpdateViaIdentityVirtualMachineExpanded'; + UpdateViaJsonFilePath = 'Az.NetworkCloud.private\Update-AzNetworkCloudConsole_UpdateViaJsonFilePath'; + UpdateViaJsonString = 'Az.NetworkCloud.private\Update-AzNetworkCloudConsole_UpdateViaJsonString'; } - if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 { @@ -20030,6 +22158,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) @@ -20088,7 +22219,7 @@ Update-AzNetworkCloudKubernetesClusterFeature -FeatureName featureName -Kubernet .Inputs Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeature +Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeature .Notes COMPLEX PARAMETER PROPERTIES @@ -20118,29 +22249,60 @@ INPUTOBJECT : Identity Parameter [VirtualMachineName ]: The name of the virtual machine. [VolumeName ]: The name of the volume. +KUBERNETESCLUSTERINPUTOBJECT : Identity Parameter + [AgentPoolName ]: The name of the Kubernetes cluster agent pool. + [BareMetalMachineKeySetName ]: The name of the bare metal machine key set. + [BareMetalMachineName ]: The name of the bare metal machine. + [BmcKeySetName ]: The name of the baseboard management controller key set. + [CloudServicesNetworkName ]: The name of the cloud services network. + [ClusterManagerName ]: The name of the cluster manager. + [ClusterName ]: The name of the cluster. + [ConsoleName ]: The name of the virtual machine console. + [FeatureName ]: The name of the feature. + [Id ]: Resource identity path + [KubernetesClusterName ]: The name of the Kubernetes cluster. + [L2NetworkName ]: The name of the L2 network. + [L3NetworkName ]: The name of the L3 network. + [MetricsConfigurationName ]: The name of the metrics configuration for the cluster. + [RackName ]: The name of the rack. + [RackSkuName ]: The name of the rack SKU. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [StorageApplianceName ]: The name of the storage appliance. + [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. + [TrunkedNetworkName ]: The name of the trunked network. + [VirtualMachineName ]: The name of the virtual machine. + [VolumeName ]: The name of the volume. + OPTION : The configured options for the feature. - Key : The key to the mapped value. - Value : The value of the mapping key. + [Key ]: The key to the mapped value. + [Value ]: The value of the mapping key. .Link https://learn.microsoft.com/powershell/module/az.networkcloud/update-aznetworkcloudkubernetesclusterfeature #> function Update-AzNetworkCloudKubernetesClusterFeature { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeature])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeature])] [CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaIdentityKubernetesClusterExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [System.String] # The name of the feature. ${FeatureName}, [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [System.String] # The name of the Kubernetes cluster. ${KubernetesClusterName}, [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [System.String] # The name of the resource group. @@ -20148,6 +22310,8 @@ param( ${ResourceGroupName}, [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaJsonFilePath')] + [Parameter(ParameterSetName='UpdateViaJsonString')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] @@ -20159,9 +22323,14 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, + [Parameter(ParameterSetName='UpdateViaIdentityKubernetesClusterExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] + # Identity Parameter + ${KubernetesClusterInputObject}, + [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Header')] [System.String] @@ -20177,21 +22346,36 @@ param( # Other values will result in error from server as they are not supported. ${IfNoneMatch}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityKubernetesClusterExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStringKeyValuePair[]] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStringKeyValuePair[]] # The configured options for the feature. - # To construct, see NOTES section for OPTION properties and create a hash table. ${Option}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityKubernetesClusterExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeaturePatchParametersTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeaturePatchParametersTags]))] [System.Collections.Hashtable] # The Azure resource tags that will replace the existing ones. ${Tag}, + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Path of Json file supplied to the Update operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Json string supplied to the Update operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -20260,6 +22444,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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() @@ -20281,10 +22474,11 @@ begin { $mapping = @{ UpdateExpanded = 'Az.NetworkCloud.private\Update-AzNetworkCloudKubernetesClusterFeature_UpdateExpanded'; UpdateViaIdentityExpanded = 'Az.NetworkCloud.private\Update-AzNetworkCloudKubernetesClusterFeature_UpdateViaIdentityExpanded'; + UpdateViaIdentityKubernetesClusterExpanded = 'Az.NetworkCloud.private\Update-AzNetworkCloudKubernetesClusterFeature_UpdateViaIdentityKubernetesClusterExpanded'; + UpdateViaJsonFilePath = 'Az.NetworkCloud.private\Update-AzNetworkCloudKubernetesClusterFeature_UpdateViaJsonFilePath'; + UpdateViaJsonString = 'Az.NetworkCloud.private\Update-AzNetworkCloudKubernetesClusterFeature_UpdateViaJsonString'; } - if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 { @@ -20298,6 +22492,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) @@ -20344,10 +22541,10 @@ end { <# .Synopsis Patch the properties of the provided Kubernetes cluster, or update the tags associated with the Kubernetes cluster. -Properties and tag updates can be done independently. +Properties and tag update can be done independently. .Description Patch the properties of the provided Kubernetes cluster, or update the tags associated with the Kubernetes cluster. -Properties and tag updates can be done independently. +Properties and tag update can be done independently. .Example $tagUpdatedHash = @{ tag1 = "tags" @@ -20359,7 +22556,7 @@ Update-AzNetworkCloudKubernetesCluster -KubernetesClusterName kubernetesClusterN .Inputs Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesCluster +Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesCluster .Notes COMPLEX PARAMETER PROPERTIES @@ -20398,10 +22595,12 @@ SSHPUBLICKEY : SshPublicKey represents the public key used to a https://learn.microsoft.com/powershell/module/az.networkcloud/update-aznetworkcloudkubernetescluster #> function Update-AzNetworkCloudKubernetesCluster { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesCluster])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesCluster])] [CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [Alias('KubernetesClusterName')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [System.String] @@ -20409,6 +22608,8 @@ param( ${Name}, [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [System.String] # The name of the resource group. @@ -20416,6 +22617,8 @@ param( ${ResourceGroupName}, [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaJsonFilePath')] + [Parameter(ParameterSetName='UpdateViaJsonString')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] @@ -20427,7 +22630,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -20445,41 +22647,56 @@ param( # Other values will result in error from server as they are not supported. ${IfNoneMatch}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey[]] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISshPublicKey[]] # SshPublicKey represents the public key used to authenticate with a resource through SSH. - # To construct, see NOTES section for CONTROLPLANENODECONFIGURATIONADMINPUBLICKEY properties and create a hash table. ${ControlPlaneNodeConfigurationAdminPublicKey}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.Int64] # The number of virtual machines that use this configuration. ${ControlPlaneNodeConfigurationCount}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The Kubernetes version for this cluster. ${KubernetesVersion}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey[]] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISshPublicKey[]] # SshPublicKey represents the public key used to authenticate with a resource through SSH. - # To construct, see NOTES section for SSHPUBLICKEY properties and create a hash table. ${SshPublicKey}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPatchParametersTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPatchParametersTags]))] [System.Collections.Hashtable] # The Azure resource tags that will replace the existing ones. ${Tag}, + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Path of Json file supplied to the Update operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Json string supplied to the Update operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -20548,6 +22765,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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() @@ -20569,10 +22795,10 @@ begin { $mapping = @{ UpdateExpanded = 'Az.NetworkCloud.private\Update-AzNetworkCloudKubernetesCluster_UpdateExpanded'; UpdateViaIdentityExpanded = 'Az.NetworkCloud.private\Update-AzNetworkCloudKubernetesCluster_UpdateViaIdentityExpanded'; + UpdateViaJsonFilePath = 'Az.NetworkCloud.private\Update-AzNetworkCloudKubernetesCluster_UpdateViaJsonFilePath'; + UpdateViaJsonString = 'Az.NetworkCloud.private\Update-AzNetworkCloudKubernetesCluster_UpdateViaJsonString'; } - if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 { @@ -20586,6 +22812,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) @@ -20640,7 +22869,7 @@ Update-AzNetworkCloudL2Network -ResourceGroupName resourceGroupName -Name l2Netw .Inputs Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2Network +Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2Network .Notes COMPLEX PARAMETER PROPERTIES @@ -20673,10 +22902,12 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.networkcloud/update-aznetworkcloudl2network #> function Update-AzNetworkCloudL2Network { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2Network])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2Network])] [CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [Alias('L2NetworkName')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [System.String] @@ -20684,6 +22915,8 @@ param( ${Name}, [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [System.String] # The name of the resource group. @@ -20691,6 +22924,8 @@ param( ${ResourceGroupName}, [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaJsonFilePath')] + [Parameter(ParameterSetName='UpdateViaJsonString')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] @@ -20702,7 +22937,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -20720,13 +22954,26 @@ param( # Other values will result in error from server as they are not supported. ${IfNoneMatch}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkPatchParametersTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkPatchParametersTags]))] [System.Collections.Hashtable] # The Azure resource tags that will replace the existing ones. ${Tag}, + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Path of Json file supplied to the Update operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Json string supplied to the Update operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -20783,6 +23030,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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() @@ -20804,10 +23060,10 @@ begin { $mapping = @{ UpdateExpanded = 'Az.NetworkCloud.private\Update-AzNetworkCloudL2Network_UpdateExpanded'; UpdateViaIdentityExpanded = 'Az.NetworkCloud.private\Update-AzNetworkCloudL2Network_UpdateViaIdentityExpanded'; + UpdateViaJsonFilePath = 'Az.NetworkCloud.private\Update-AzNetworkCloudL2Network_UpdateViaJsonFilePath'; + UpdateViaJsonString = 'Az.NetworkCloud.private\Update-AzNetworkCloudL2Network_UpdateViaJsonString'; } - if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 { @@ -20821,6 +23077,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) @@ -20875,7 +23134,7 @@ Update-AzNetworkCloudL3Network -ResourceGroupName resourceGroupName -Name l3netw .Inputs Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3Network +Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3Network .Notes COMPLEX PARAMETER PROPERTIES @@ -20908,10 +23167,12 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.networkcloud/update-aznetworkcloudl3network #> function Update-AzNetworkCloudL3Network { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3Network])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3Network])] [CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [Alias('L3NetworkName')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [System.String] @@ -20919,6 +23180,8 @@ param( ${Name}, [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [System.String] # The name of the resource group. @@ -20926,6 +23189,8 @@ param( ${ResourceGroupName}, [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaJsonFilePath')] + [Parameter(ParameterSetName='UpdateViaJsonString')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] @@ -20937,7 +23202,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -20955,13 +23219,26 @@ param( # Other values will result in error from server as they are not supported. ${IfNoneMatch}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkPatchParametersTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkPatchParametersTags]))] [System.Collections.Hashtable] # The Azure resource tags that will replace the existing ones. ${Tag}, + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Path of Json file supplied to the Update operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Json string supplied to the Update operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -21018,6 +23295,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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() @@ -21039,10 +23325,10 @@ begin { $mapping = @{ UpdateExpanded = 'Az.NetworkCloud.private\Update-AzNetworkCloudL3Network_UpdateExpanded'; UpdateViaIdentityExpanded = 'Az.NetworkCloud.private\Update-AzNetworkCloudL3Network_UpdateViaIdentityExpanded'; + UpdateViaJsonFilePath = 'Az.NetworkCloud.private\Update-AzNetworkCloudL3Network_UpdateViaJsonFilePath'; + UpdateViaJsonString = 'Az.NetworkCloud.private\Update-AzNetworkCloudL3Network_UpdateViaJsonString'; } - if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 { @@ -21056,6 +23342,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) @@ -21102,22 +23391,46 @@ end { <# .Synopsis Patch properties of metrics configuration for the provided cluster, or update the tags associated with it. -Properties and tag updates can be done independently. +Properties and tag update can be done independently. .Description Patch properties of metrics configuration for the provided cluster, or update the tags associated with it. -Properties and tag updates can be done independently. +Properties and tag update can be done independently. .Example Update-AzNetworkCloudMetricsConfiguration -ClusterName clusterName -ResourceGroupName resourceGroupName -Name metricsConfigName -CollectionInterval 10 -EnabledMetric @("metric1", "metric2") -Tag @{tag1="tag1"} .Inputs Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfiguration +Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfiguration .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. +CLUSTERINPUTOBJECT : Identity Parameter + [AgentPoolName ]: The name of the Kubernetes cluster agent pool. + [BareMetalMachineKeySetName ]: The name of the bare metal machine key set. + [BareMetalMachineName ]: The name of the bare metal machine. + [BmcKeySetName ]: The name of the baseboard management controller key set. + [CloudServicesNetworkName ]: The name of the cloud services network. + [ClusterManagerName ]: The name of the cluster manager. + [ClusterName ]: The name of the cluster. + [ConsoleName ]: The name of the virtual machine console. + [FeatureName ]: The name of the feature. + [Id ]: Resource identity path + [KubernetesClusterName ]: The name of the Kubernetes cluster. + [L2NetworkName ]: The name of the L2 network. + [L3NetworkName ]: The name of the L3 network. + [MetricsConfigurationName ]: The name of the metrics configuration for the cluster. + [RackName ]: The name of the rack. + [RackSkuName ]: The name of the rack SKU. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [StorageApplianceName ]: The name of the storage appliance. + [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. + [TrunkedNetworkName ]: The name of the trunked network. + [VirtualMachineName ]: The name of the virtual machine. + [VolumeName ]: The name of the volume. + INPUTOBJECT : Identity Parameter [AgentPoolName ]: The name of the Kubernetes cluster agent pool. [BareMetalMachineKeySetName ]: The name of the bare metal machine key set. @@ -21145,16 +23458,21 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.networkcloud/update-aznetworkcloudmetricsconfiguration #> function Update-AzNetworkCloudMetricsConfiguration { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfiguration])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfiguration])] [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.NetworkCloud.Category('Path')] [System.String] # The name of the cluster. ${ClusterName}, [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaIdentityClusterExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [Alias('MetricsConfigurationName')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [System.String] @@ -21162,6 +23480,8 @@ param( ${Name}, [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [System.String] # The name of the resource group. @@ -21169,6 +23489,8 @@ param( ${ResourceGroupName}, [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaJsonFilePath')] + [Parameter(ParameterSetName='UpdateViaJsonString')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] @@ -21176,11 +23498,16 @@ param( # The value must be an UUID. ${SubscriptionId}, + [Parameter(ParameterSetName='UpdateViaIdentityClusterExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] + # Identity Parameter + ${ClusterInputObject}, + [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -21198,26 +23525,44 @@ param( # Other values will result in error from server as they are not supported. ${IfNoneMatch}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityClusterExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.Int64] # The interval in minutes by which metrics will be collected. ${CollectionInterval}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityClusterExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String[]] # The list of metric names that have been chosen to be enabled in addition to the core set of enabled metrics. ${EnabledMetric}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityClusterExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationPatchParametersTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationPatchParametersTags]))] [System.Collections.Hashtable] # The Azure resource tags that will replace the existing ones. ${Tag}, + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Path of Json file supplied to the Update operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Json string supplied to the Update operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -21286,6 +23631,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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() @@ -21306,11 +23660,12 @@ begin { $mapping = @{ UpdateExpanded = 'Az.NetworkCloud.private\Update-AzNetworkCloudMetricsConfiguration_UpdateExpanded'; + UpdateViaIdentityClusterExpanded = 'Az.NetworkCloud.private\Update-AzNetworkCloudMetricsConfiguration_UpdateViaIdentityClusterExpanded'; UpdateViaIdentityExpanded = 'Az.NetworkCloud.private\Update-AzNetworkCloudMetricsConfiguration_UpdateViaIdentityExpanded'; + UpdateViaJsonFilePath = 'Az.NetworkCloud.private\Update-AzNetworkCloudMetricsConfiguration_UpdateViaJsonFilePath'; + UpdateViaJsonString = 'Az.NetworkCloud.private\Update-AzNetworkCloudMetricsConfiguration_UpdateViaJsonString'; } - if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 { @@ -21324,6 +23679,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) @@ -21370,17 +23728,17 @@ end { <# .Synopsis Patch properties of the provided rack, or update the tags associated with the rack. -Properties and tag updates can be done independently. +Properties and tag update can be done independently. .Description Patch properties of the provided rack, or update the tags associated with the rack. -Properties and tag updates can be done independently. +Properties and tag update can be done independently. .Example Update-AzNetworkCloudRack -ResourceGroupName resourceGroupName -Name rackName -Tag @{'tag'="tagUpdated"} -SubscriptionId subscriptionId .Inputs Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRack +Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRack .Notes COMPLEX PARAMETER PROPERTIES @@ -21413,10 +23771,12 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.networkcloud/update-aznetworkcloudrack #> function Update-AzNetworkCloudRack { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRack])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRack])] [CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [Alias('RackName')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [System.String] @@ -21424,6 +23784,8 @@ param( ${Name}, [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [System.String] # The name of the resource group. @@ -21431,6 +23793,8 @@ param( ${ResourceGroupName}, [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaJsonFilePath')] + [Parameter(ParameterSetName='UpdateViaJsonString')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] @@ -21442,7 +23806,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -21460,7 +23823,8 @@ param( # Other values will result in error from server as they are not supported. ${IfNoneMatch}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The free-form description of the rack location. @@ -21468,19 +23832,33 @@ param( # “DTN Datacenter, Floor 3, Isle 9, Rack 2B”) ${RackLocation}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The globally unique identifier for the rack. ${RackSerialNumber}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackPatchParametersTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackPatchParametersTags]))] [System.Collections.Hashtable] # The Azure resource tags that will replace the existing ones. ${Tag}, + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Path of Json file supplied to the Update operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Json string supplied to the Update operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -21549,6 +23927,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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() @@ -21570,10 +23957,10 @@ begin { $mapping = @{ UpdateExpanded = 'Az.NetworkCloud.private\Update-AzNetworkCloudRack_UpdateExpanded'; UpdateViaIdentityExpanded = 'Az.NetworkCloud.private\Update-AzNetworkCloudRack_UpdateViaIdentityExpanded'; + UpdateViaJsonFilePath = 'Az.NetworkCloud.private\Update-AzNetworkCloudRack_UpdateViaJsonFilePath'; + UpdateViaJsonString = 'Az.NetworkCloud.private\Update-AzNetworkCloudRack_UpdateViaJsonString'; } - if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 { @@ -21587,6 +23974,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) @@ -21633,10 +24023,10 @@ end { <# .Synopsis Update properties of the provided cloud services network, or update the tags associated with it. -Properties and tag updates can be done independently. +Properties and tag update can be done independently. .Description Update properties of the provided cloud services network, or update the tags associated with it. -Properties and tag updates can be done independently. +Properties and tag update can be done independently. .Example $tags = @{ Tag1 = 'tag1' @@ -21651,7 +24041,7 @@ Update-AzNetworkCloudServicesNetwork -ResourceGroupName resourceGroupName -Cloud .Inputs Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetwork +Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetwork .Notes COMPLEX PARAMETER PROPERTIES @@ -21659,7 +24049,7 @@ To create the parameters described below, construct a hash table containing the ADDITIONALEGRESSENDPOINT : The list of egress endpoints. This allows for connection from a Hybrid AKS cluster to the specified endpoint. Category : The descriptive category name of endpoints accessible by the AKS agent node. For example, azure-resource-management, API server, etc. The platform egress endpoints provided by default will use the category 'default'. - Endpoint : The list of endpoint dependencies. + Endpoint >: The list of endpoint dependencies. DomainName : The domain name of the dependency. [Port ]: The port of this endpoint. @@ -21690,10 +24080,12 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.networkcloud/update-aznetworkcloudservicesnetwork #> function Update-AzNetworkCloudServicesNetwork { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetwork])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetwork])] [CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [Alias('CloudServicesNetworkName')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [System.String] @@ -21701,6 +24093,8 @@ param( ${Name}, [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [System.String] # The name of the resource group. @@ -21708,6 +24102,8 @@ param( ${ResourceGroupName}, [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaJsonFilePath')] + [Parameter(ParameterSetName='UpdateViaJsonString')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] @@ -21719,7 +24115,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -21737,29 +24132,43 @@ param( # Other values will result in error from server as they are not supported. ${IfNoneMatch}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IEgressEndpoint[]] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IEgressEndpoint[]] # The list of egress endpoints. # This allows for connection from a Hybrid AKS cluster to the specified endpoint. - # To construct, see NOTES section for ADDITIONALEGRESSENDPOINT properties and create a hash table. ${AdditionalEgressEndpoint}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CloudServicesNetworkEnableDefaultEgressEndpoints])] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("True", "False")] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CloudServicesNetworkEnableDefaultEgressEndpoints] + [System.String] # The indicator of whether the platform default endpoints are allowed for the egress traffic. ${EnableDefaultEgressEndpoint}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkPatchParametersTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkPatchParametersTags]))] [System.Collections.Hashtable] # The Azure resource tags that will replace the existing ones. ${Tag}, + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Path of Json file supplied to the Update operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Json string supplied to the Update operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -21828,6 +24237,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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() @@ -21849,10 +24267,10 @@ begin { $mapping = @{ UpdateExpanded = 'Az.NetworkCloud.private\Update-AzNetworkCloudServicesNetwork_UpdateExpanded'; UpdateViaIdentityExpanded = 'Az.NetworkCloud.private\Update-AzNetworkCloudServicesNetwork_UpdateViaIdentityExpanded'; + UpdateViaJsonFilePath = 'Az.NetworkCloud.private\Update-AzNetworkCloudServicesNetwork_UpdateViaJsonFilePath'; + UpdateViaJsonString = 'Az.NetworkCloud.private\Update-AzNetworkCloudServicesNetwork_UpdateViaJsonString'; } - if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 { @@ -21866,6 +24284,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) @@ -21911,16 +24332,16 @@ end { <# .Synopsis -Update properties of the provided storage appliance, or update tags associated with the storage appliance Properties and tag updates can be done independently. +Update properties of the provided storage appliance, or update tags associated with the storage appliance Properties and tag update can be done independently. .Description -Update properties of the provided storage appliance, or update tags associated with the storage appliance Properties and tag updates can be done independently. +Update properties of the provided storage appliance, or update tags associated with the storage appliance Properties and tag update can be done independently. .Example Update-AzNetworkCloudStorageAppliance -Name storageApplianceName -ResourceGroupName resourceGroup -SubscriptionId subscriptionId -SerialNumber serialNumber -Tag @{ tag1 = "tag1"; tag2 = "tag2" } .Inputs Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliance +Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliance .Notes COMPLEX PARAMETER PROPERTIES @@ -21953,10 +24374,12 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.networkcloud/update-aznetworkcloudstorageappliance #> function Update-AzNetworkCloudStorageAppliance { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliance])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliance])] [CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [Alias('StorageApplianceName')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [System.String] @@ -21964,6 +24387,8 @@ param( ${Name}, [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [System.String] # The name of the resource group. @@ -21971,6 +24396,8 @@ param( ${ResourceGroupName}, [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaJsonFilePath')] + [Parameter(ParameterSetName='UpdateViaJsonString')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] @@ -21982,7 +24409,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -22000,19 +24426,33 @@ param( # Other values will result in error from server as they are not supported. ${IfNoneMatch}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The serial number for the storage appliance. ${SerialNumber}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePatchParametersTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePatchParametersTags]))] [System.Collections.Hashtable] # The Azure resource tags that will replace the existing ones. ${Tag}, + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Path of Json file supplied to the Update operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Json string supplied to the Update operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -22081,6 +24521,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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() @@ -22102,10 +24551,10 @@ begin { $mapping = @{ UpdateExpanded = 'Az.NetworkCloud.private\Update-AzNetworkCloudStorageAppliance_UpdateExpanded'; UpdateViaIdentityExpanded = 'Az.NetworkCloud.private\Update-AzNetworkCloudStorageAppliance_UpdateViaIdentityExpanded'; + UpdateViaJsonFilePath = 'Az.NetworkCloud.private\Update-AzNetworkCloudStorageAppliance_UpdateViaJsonFilePath'; + UpdateViaJsonString = 'Az.NetworkCloud.private\Update-AzNetworkCloudStorageAppliance_UpdateViaJsonString'; } - if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 { @@ -22119,6 +24568,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) @@ -22173,7 +24625,7 @@ Update-AzNetworkCloudTrunkedNetwork -Name trunkedNetworkName -ResourceGroupName .Inputs Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetwork +Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetwork .Notes COMPLEX PARAMETER PROPERTIES @@ -22206,10 +24658,12 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.networkcloud/update-aznetworkcloudtrunkednetwork #> function Update-AzNetworkCloudTrunkedNetwork { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetwork])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetwork])] [CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [Alias('TrunkedNetworkName')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [System.String] @@ -22217,6 +24671,8 @@ param( ${Name}, [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [System.String] # The name of the resource group. @@ -22224,6 +24680,8 @@ param( ${ResourceGroupName}, [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaJsonFilePath')] + [Parameter(ParameterSetName='UpdateViaJsonString')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] @@ -22235,7 +24693,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -22253,13 +24710,26 @@ param( # Other values will result in error from server as they are not supported. ${IfNoneMatch}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkPatchParametersTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkPatchParametersTags]))] [System.Collections.Hashtable] # The Azure resource tags that will replace the existing ones. ${Tag}, + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Path of Json file supplied to the Update operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Json string supplied to the Update operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -22316,6 +24786,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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() @@ -22337,10 +24816,10 @@ begin { $mapping = @{ UpdateExpanded = 'Az.NetworkCloud.private\Update-AzNetworkCloudTrunkedNetwork_UpdateExpanded'; UpdateViaIdentityExpanded = 'Az.NetworkCloud.private\Update-AzNetworkCloudTrunkedNetwork_UpdateViaIdentityExpanded'; + UpdateViaJsonFilePath = 'Az.NetworkCloud.private\Update-AzNetworkCloudTrunkedNetwork_UpdateViaJsonFilePath'; + UpdateViaJsonString = 'Az.NetworkCloud.private\Update-AzNetworkCloudTrunkedNetwork_UpdateViaJsonString'; } - if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 { @@ -22354,6 +24833,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) @@ -22400,10 +24882,10 @@ end { <# .Synopsis Patch the properties of the provided virtual machine, or update the tags associated with the virtual machine. -Properties and tag updates can be done independently. +Properties and tag update can be done independently. .Description Patch the properties of the provided virtual machine, or update the tags associated with the virtual machine. -Properties and tag updates can be done independently. +Properties and tag update can be done independently. .Example $tagUpdatedHash = @{ tag1 = "tag1" @@ -22416,7 +24898,7 @@ Update-AzNetworkCloudVirtualMachine -Name vmName -ResourceGroupName resourceGrou .Inputs Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachine +Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachine .Notes COMPLEX PARAMETER PROPERTIES @@ -22449,10 +24931,12 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.networkcloud/update-aznetworkcloudvirtualmachine #> function Update-AzNetworkCloudVirtualMachine { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachine])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachine])] [CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [Alias('VirtualMachineName')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [System.String] @@ -22460,6 +24944,8 @@ param( ${Name}, [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [System.String] # The name of the resource group. @@ -22467,6 +24953,8 @@ param( ${ResourceGroupName}, [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaJsonFilePath')] + [Parameter(ParameterSetName='UpdateViaJsonString')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] @@ -22478,7 +24966,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -22496,31 +24983,47 @@ param( # Other values will result in error from server as they are not supported. ${IfNoneMatch}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePatchParametersTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePatchParametersTags]))] [System.Collections.Hashtable] # The Azure resource tags that will replace the existing ones. ${Tag}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.Security.SecureString] # The password or token used to access an image in the target repository. ${VMImageRepositoryCredentialsPassword}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The URL of the authentication server used to validate the repository credentials. ${VMImageRepositoryCredentialsRegistryUrl}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The username used to access an image in the target repository. ${VMImageRepositoryCredentialsUsername}, + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Path of Json file supplied to the Update operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Json string supplied to the Update operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -22589,6 +25092,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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() @@ -22610,10 +25122,10 @@ begin { $mapping = @{ UpdateExpanded = 'Az.NetworkCloud.private\Update-AzNetworkCloudVirtualMachine_UpdateExpanded'; UpdateViaIdentityExpanded = 'Az.NetworkCloud.private\Update-AzNetworkCloudVirtualMachine_UpdateViaIdentityExpanded'; + UpdateViaJsonFilePath = 'Az.NetworkCloud.private\Update-AzNetworkCloudVirtualMachine_UpdateViaJsonFilePath'; + UpdateViaJsonString = 'Az.NetworkCloud.private\Update-AzNetworkCloudVirtualMachine_UpdateViaJsonString'; } - if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 { @@ -22627,6 +25139,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) @@ -22681,7 +25196,7 @@ Update-AzNetworkCloudVolume -Name volumeName -ResourceGroupName resourceGroupNam .Inputs Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolume +Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolume .Notes COMPLEX PARAMETER PROPERTIES @@ -22714,10 +25229,12 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.networkcloud/update-aznetworkcloudvolume #> function Update-AzNetworkCloudVolume { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolume])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolume])] [CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [Alias('VolumeName')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [System.String] @@ -22725,6 +25242,8 @@ param( ${Name}, [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [System.String] # The name of the resource group. @@ -22732,6 +25251,8 @@ param( ${ResourceGroupName}, [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaJsonFilePath')] + [Parameter(ParameterSetName='UpdateViaJsonString')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] @@ -22743,7 +25264,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -22761,13 +25281,26 @@ param( # Other values will result in error from server as they are not supported. ${IfNoneMatch}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolumePatchParametersTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumePatchParametersTags]))] [System.Collections.Hashtable] # The Azure resource tags that will replace the existing ones. ${Tag}, + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Path of Json file supplied to the Update operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Json string supplied to the Update operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -22824,6 +25357,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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() @@ -22845,10 +25387,10 @@ begin { $mapping = @{ UpdateExpanded = 'Az.NetworkCloud.private\Update-AzNetworkCloudVolume_UpdateExpanded'; UpdateViaIdentityExpanded = 'Az.NetworkCloud.private\Update-AzNetworkCloudVolume_UpdateViaIdentityExpanded'; + UpdateViaJsonFilePath = 'Az.NetworkCloud.private\Update-AzNetworkCloudVolume_UpdateViaJsonFilePath'; + UpdateViaJsonString = 'Az.NetworkCloud.private\Update-AzNetworkCloudVolume_UpdateViaJsonString'; } - if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 { @@ -22862,6 +25404,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) @@ -22916,12 +25461,12 @@ $password = ConvertTo-SecureString "********" -AsPlainText -Force New-AzNetworkCloudBareMetalMachineConfigurationDataObject -BmcCredentialsPassword $password -BmcCredentialsUsername username -BmcMacAddress "00:BB:CC:DD:EE:FF" -BootMacAddress "00:BB:CC:DD:EE:FF" -RackSlot 1 -SerialNumber serialNumber -MachineDetail machineDetail -MachineName machineName .Outputs -Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BareMetalMachineConfigurationData +Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BareMetalMachineConfigurationData .Link -https://learn.microsoft.com/powershell/module/Az.NetworkCloud/new-AzNetworkCloudBareMetalMachineConfigurationDataObject +https://learn.microsoft.com/powershell/module/Az.NetworkCloud/new-aznetworkcloudbaremetalmachineconfigurationdataobject #> function New-AzNetworkCloudBareMetalMachineConfigurationDataObject { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BareMetalMachineConfigurationData])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BareMetalMachineConfigurationData])] [CmdletBinding(PositionalBinding=$false)] param( [Parameter(Mandatory)] @@ -22984,6 +25529,9 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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() @@ -23012,6 +25560,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) @@ -23064,12 +25615,12 @@ Create an in-memory object for BgpAdvertisement. New-AzNetworkCloudBgpAdvertisementObject -IPAddressPool @("pool1","pool2") -AdvertiseToFabric "True" -Community @("communityString") -Peer @("peer1") .Outputs -Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BgpAdvertisement +Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BgpAdvertisement .Link -https://learn.microsoft.com/powershell/module/Az.NetworkCloud/new-AzNetworkCloudBgpAdvertisementObject +https://learn.microsoft.com/powershell/module/Az.NetworkCloud/new-aznetworkcloudbgpadvertisementobject #> function New-AzNetworkCloudBgpAdvertisementObject { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BgpAdvertisement])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BgpAdvertisement])] [CmdletBinding(PositionalBinding=$false)] param( [Parameter(Mandatory)] @@ -23079,9 +25630,9 @@ param( ${IPAddressPool}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.AdvertiseToFabric])] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("True", "False")] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.AdvertiseToFabric] + [System.String] # The indicator of if this advertisement is also made to the network fabric associated with the Network Cloud Cluster. # This field is ignored if fabricPeeringEnabled is set to False. ${AdvertiseToFabric}, @@ -23107,6 +25658,9 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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() @@ -23135,6 +25689,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) @@ -23196,24 +25753,24 @@ $object=New-AzNetworkCloudBgpServiceLoadBalancerConfigurationObject -BgpAdvertis Write-Host ($object | Format-List | Out-String) .Outputs -Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BgpServiceLoadBalancerConfiguration +Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BgpServiceLoadBalancerConfiguration .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. BGPADVERTISEMENT : The association of IP address pools to the communities and peers, allowing for announcement of IPs. - IPAddressPool : The names of the IP address pools associated with this announcement. - [AdvertiseToFabric ]: The indicator of if this advertisement is also made to the network fabric associated with the Network Cloud Cluster. This field is ignored if fabricPeeringEnabled is set to False. - [Community ]: The names of the BGP communities to be associated with the announcement, utilizing a BGP community string in 1234:1234 format. - [Peer ]: The names of the BGP peers to limit this advertisement to. If no values are specified, all BGP peers will receive this advertisement. + IPAddressPool >: The names of the IP address pools associated with this announcement. + [AdvertiseToFabric ]: The indicator of if this advertisement is also made to the network fabric associated with the Network Cloud Cluster. This field is ignored if fabricPeeringEnabled is set to False. + [Community >]: The names of the BGP communities to be associated with the announcement, utilizing a BGP community string in 1234:1234 format. + [Peer >]: The names of the BGP peers to limit this advertisement to. If no values are specified, all BGP peers will receive this advertisement. BGPPEER : The list of additional BgpPeer entities that the Kubernetes cluster will peer with. All peering must be explicitly defined. Name : The name used to identify this BGP peer for association with a BGP advertisement. PeerAddress : The IPv4 or IPv6 address used to connect this BGP session. PeerAsn : The autonomous system number expected from the remote end of the BGP session. - [BfdEnabled ]: The indicator of BFD enablement for this BgpPeer. - [BgpMultiHop ]: The indicator to enable multi-hop peering support. + [BfdEnabled ]: The indicator of BFD enablement for this BgpPeer. + [BgpMultiHop ]: The indicator to enable multi-hop peering support. [HoldTime ]: Field Deprecated. The field was previously optional, now it will have no defined behavior and will be ignored. The requested BGP hold time value. This field uses ISO 8601 duration format, for example P1H. [KeepAliveTime ]: Field Deprecated. The field was previously optional, now it will have no defined behavior and will be ignored. The requested BGP keepalive time value. This field uses ISO 8601 duration format, for example P1H. [MyAsn ]: The autonomous system number used for the local end of the BGP session. @@ -23221,44 +25778,41 @@ BGPPEER : The list of additional BgpPeer entities [PeerPort ]: The port used to connect this BGP session. IPADDRESSPOOL : The list of pools of IP addresses that can be allocated to load balancer services. - Address : The list of IP address ranges. Each range can be a either a subnet in CIDR format or an explicit start-end range of IP addresses. For a BGP service load balancer configuration, only CIDR format is supported and excludes /32 (IPv4) and /128 (IPv6) prefixes. Name : The name used to identify this IP address pool for association with a BGP advertisement. - [AutoAssign ]: The indicator to determine if automatic allocation from the pool should occur. - [OnlyUseHostIP ]: The indicator to prevent the use of IP addresses ending with .0 and .255 for this pool. Enabling this option will only use IP addresses between .1 and .254 inclusive. + [Address >]: The list of IP address ranges. Each range can be a either a subnet in CIDR format or an explicit start-end range of IP addresses. For a BGP service load balancer configuration, only CIDR format is supported and excludes /32 (IPv4) and /128 (IPv6) prefixes. + [AutoAssign ]: The indicator to determine if automatic allocation from the pool should occur. + [OnlyUseHostIP ]: The indicator to prevent the use of IP addresses ending with .0 and .255 for this pool. Enabling this option will only use IP addresses between .1 and .254 inclusive. .Link -https://learn.microsoft.com/powershell/module/Az.NetworkCloud/new-AzNetworkCloudBgpServiceLoadBalancerConfigurationObject +https://learn.microsoft.com/powershell/module/Az.NetworkCloud/new-aznetworkcloudbgpserviceloadbalancerconfigurationobject #> function New-AzNetworkCloudBgpServiceLoadBalancerConfigurationObject { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BgpServiceLoadBalancerConfiguration])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BgpServiceLoadBalancerConfiguration])] [CmdletBinding(PositionalBinding=$false)] param( [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBgpAdvertisement[]] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBgpAdvertisement[]] # The association of IP address pools to the communities and peers, allowing for announcement of IPs. - # To construct, see NOTES section for BGPADVERTISEMENT properties and create a hash table. ${BgpAdvertisement}, [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IServiceLoadBalancerBgpPeer[]] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IServiceLoadBalancerBgpPeer[]] # The list of additional BgpPeer entities that the Kubernetes cluster will peer with. # All peering must be explicitly defined. - # To construct, see NOTES section for BGPPEER properties and create a hash table. ${BgpPeer}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.FabricPeeringEnabled])] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("True", "False")] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.FabricPeeringEnabled] + [System.String] # The indicator to specify if the load balancer peers with the network fabric. ${FabricPeeringEnabled}, [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIPAddressPool[]] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IIPAddressPool[]] # The list of pools of IP addresses that can be allocated to load balancer services. - # To construct, see NOTES section for IPADDRESSPOOL properties and create a hash table. ${IPAddressPool} ) @@ -23269,6 +25823,9 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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() @@ -23297,6 +25854,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) @@ -23353,7 +25913,7 @@ $sshPublicKey=@{ New-AzNetworkCloudControlPlaneNodeConfigurationObject -Count 1 -VMSkuName vmSkuName -AdministratorConfigurationAdminUsername userName -AdministratorConfigurationSshPublicKey $sshPublicKey -AvailabilityZone @("1","2","3") .Outputs -Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ControlPlaneNodeConfiguration +Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ControlPlaneNodeConfiguration .Notes COMPLEX PARAMETER PROPERTIES @@ -23362,10 +25922,10 @@ To create the parameters described below, construct a hash table containing the ADMINISTRATORCONFIGURATIONSSHPUBLICKEY : The SSH configuration for the operating systems that run the nodes in the Kubernetes cluster. In some cases, specification of public keys may be required to produce a working environment. KeyData : The SSH public key data. .Link -https://learn.microsoft.com/powershell/module/Az.NetworkCloud/new-AzNetworkCloudControlPlaneNodeConfigurationObject +https://learn.microsoft.com/powershell/module/Az.NetworkCloud/new-aznetworkcloudcontrolplanenodeconfigurationobject #> function New-AzNetworkCloudControlPlaneNodeConfigurationObject { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ControlPlaneNodeConfiguration])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ControlPlaneNodeConfiguration])] [CmdletBinding(PositionalBinding=$false)] param( [Parameter(Mandatory)] @@ -23389,10 +25949,9 @@ param( [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey[]] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISshPublicKey[]] # The SSH configuration for the operating systems that run the nodes in the Kubernetes cluster. # In some cases, specification of public keys may be required to produce a working environment. - # To construct, see NOTES section for ADMINISTRATORCONFIGURATIONSSHPUBLICKEY properties and create a hash table. ${AdministratorConfigurationSshPublicKey}, [Parameter()] @@ -23410,6 +25969,9 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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() @@ -23438,6 +26000,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) @@ -23492,7 +26057,7 @@ $endpointDependency=New-AzNetworkCloudEndpointDependencyObject -DomainName domai New-AzNetworkCloudEgressEndpointObject -Category "azure-resource-management" -Endpoint ($endpointDependency) .Outputs -Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.EgressEndpoint +Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.EgressEndpoint .Notes COMPLEX PARAMETER PROPERTIES @@ -23502,10 +26067,10 @@ ENDPOINT : The list of endpoint dependencies. DomainName : The domain name of the dependency. [Port ]: The port of this endpoint. .Link -https://learn.microsoft.com/powershell/module/Az.NetworkCloud/new-AzNetworkCloudEgressEndpointObject +https://learn.microsoft.com/powershell/module/Az.NetworkCloud/new-aznetworkcloudegressendpointobject #> function New-AzNetworkCloudEgressEndpointObject { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.EgressEndpoint])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.EgressEndpoint])] [CmdletBinding(PositionalBinding=$false)] param( [Parameter(Mandatory)] @@ -23518,9 +26083,8 @@ param( [Parameter(Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IEndpointDependency[]] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IEndpointDependency[]] # The list of endpoint dependencies. - # To construct, see NOTES section for ENDPOINT properties and create a hash table. ${Endpoint} ) @@ -23531,6 +26095,9 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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() @@ -23559,6 +26126,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) @@ -23611,12 +26181,12 @@ Create an in-memory object for EndpointDependency. New-AzNetworkCloudEndpointDependencyObject -DomainName domainName -Port 1234 .Outputs -Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.EndpointDependency +Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.EndpointDependency .Link -https://learn.microsoft.com/powershell/module/Az.NetworkCloud/new-AzNetworkCloudEndpointDependencyObject +https://learn.microsoft.com/powershell/module/Az.NetworkCloud/new-aznetworkcloudendpointdependencyobject #> function New-AzNetworkCloudEndpointDependencyObject { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.EndpointDependency])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.EndpointDependency])] [CmdletBinding(PositionalBinding=$false)] param( [Parameter(Mandatory)] @@ -23639,6 +26209,9 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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() @@ -23667,6 +26240,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) @@ -23719,7 +26295,7 @@ Create an in-memory object for InitialAgentPoolConfiguration. New-AzNetworkCloudInitialAgentPoolConfigurationObject -Count -Mode -Name -VMSkuName -AdministratorConfigurationAdminUsername -AdministratorConfigurationSshPublicKey -AgentOptionHugepagesCount -AgentOptionHugepagesSize -AttachedNetworkConfigurationL2Network -AttachedNetworkConfigurationL3Network -AttachedNetworkConfigurationTrunkedNetwork -AvailabilityZone -Label -Taint -UpgradeSettingMaxSurge .Outputs -Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.InitialAgentPoolConfiguration +Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.InitialAgentPoolConfiguration .Notes COMPLEX PARAMETER PROPERTIES @@ -23729,30 +26305,30 @@ ADMINISTRATORCONFIGURATIONSSHPUBLICKEY : The SSH configuration KeyData : The SSH public key data. ATTACHEDNETWORKCONFIGURATIONL2NETWORK : The list of Layer 2 Networks and related configuration for attachment. - NetworkId : The resource ID of the network that is being configured for attachment. - [PluginType ]: The indicator of how this network will be utilized by the Kubernetes cluster. + [NetworkId ]: The resource ID of the network that is being configured for attachment. + [PluginType ]: The indicator of how this network will be utilized by the Kubernetes cluster. ATTACHEDNETWORKCONFIGURATIONL3NETWORK : The list of Layer 3 Networks and related configuration for attachment. NetworkId : The resource ID of the network that is being configured for attachment. - [IpamEnabled ]: The indication of whether this network will or will not perform IP address management and allocate IP addresses when attached. - [PluginType ]: The indicator of how this network will be utilized by the Kubernetes cluster. + [IpamEnabled ]: The indication of whether this network will or will not perform IP address management and allocate IP addresses when attached. + [PluginType ]: The indicator of how this network will be utilized by the Kubernetes cluster. ATTACHEDNETWORKCONFIGURATIONTRUNKEDNETWORK : The list of Trunked Networks and related configuration for attachment. - NetworkId : The resource ID of the network that is being configured for attachment. - [PluginType ]: The indicator of how this network will be utilized by the Kubernetes cluster. + [NetworkId ]: The resource ID of the network that is being configured for attachment. + [PluginType ]: The indicator of how this network will be utilized by the Kubernetes cluster. LABEL : The labels applied to the nodes in this agent pool. - Key : The name of the label or taint. - Value : The value of the label or taint. + [Key ]: The name of the label or taint. + [Value ]: The value of the label or taint. TAINT : The taints applied to the nodes in this agent pool. - Key : The name of the label or taint. - Value : The value of the label or taint. + [Key ]: The name of the label or taint. + [Value ]: The value of the label or taint. .Link -https://learn.microsoft.com/powershell/module/Az.NetworkCloud/new-AzNetworkCloudInitialAgentPoolConfigurationObject +https://learn.microsoft.com/powershell/module/Az.NetworkCloud/new-aznetworkcloudinitialagentpoolconfigurationobject #> function New-AzNetworkCloudInitialAgentPoolConfigurationObject { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.InitialAgentPoolConfiguration])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.InitialAgentPoolConfiguration])] [CmdletBinding(PositionalBinding=$false)] param( [Parameter(Mandatory)] @@ -23762,9 +26338,9 @@ param( ${Count}, [Parameter(Mandatory)] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.AgentPoolMode])] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("System", "User", "NotApplicable")] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.AgentPoolMode] + [System.String] # The selection of how this agent pool is utilized, either as a system pool or a user pool. # System pools run the features and critical services for the Kubernetes Cluster, while user pools are dedicated to user workloads. # Every Kubernetes cluster must contain at least one system node pool with at least one node. @@ -23791,10 +26367,9 @@ param( [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey[]] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISshPublicKey[]] # The SSH configuration for the operating systems that run the nodes in the Kubernetes cluster. # In some cases, specification of public keys may be required to produce a working environment. - # To construct, see NOTES section for ADMINISTRATORCONFIGURATIONSSHPUBLICKEY properties and create a hash table. ${AdministratorConfigurationSshPublicKey}, [Parameter()] @@ -23804,31 +26379,28 @@ param( ${AgentOptionHugepagesCount}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HugepagesSize])] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("2M", "1G")] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HugepagesSize] + [System.String] # The size of the hugepages to allocate. ${AgentOptionHugepagesSize}, [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkAttachmentConfiguration[]] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkAttachmentConfiguration[]] # The list of Layer 2 Networks and related configuration for attachment. - # To construct, see NOTES section for ATTACHEDNETWORKCONFIGURATIONL2NETWORK properties and create a hash table. ${AttachedNetworkConfigurationL2Network}, [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkAttachmentConfiguration[]] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkAttachmentConfiguration[]] # The list of Layer 3 Networks and related configuration for attachment. - # To construct, see NOTES section for ATTACHEDNETWORKCONFIGURATIONL3NETWORK properties and create a hash table. ${AttachedNetworkConfigurationL3Network}, [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkAttachmentConfiguration[]] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkAttachmentConfiguration[]] # The list of Trunked Networks and related configuration for attachment. - # To construct, see NOTES section for ATTACHEDNETWORKCONFIGURATIONTRUNKEDNETWORK properties and create a hash table. ${AttachedNetworkConfigurationTrunkedNetwork}, [Parameter()] @@ -23840,16 +26412,14 @@ param( [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesLabel[]] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesLabel[]] # The labels applied to the nodes in this agent pool. - # To construct, see NOTES section for LABEL properties and create a hash table. ${Label}, [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesLabel[]] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesLabel[]] # The taints applied to the nodes in this agent pool. - # To construct, see NOTES section for TAINT properties and create a hash table. ${Taint}, [Parameter()] @@ -23893,6 +26463,9 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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() @@ -23921,6 +26494,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) @@ -23973,39 +26549,39 @@ Create an in-memory object for IpAddressPool. New-AzNetworkCloudIpAddressPoolObject -Address @("198.51.102.0/24") -Name "pool1" -AutoAssign True -OnlyUseHostIP True .Outputs -Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IPAddressPool +Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IPAddressPool .Link -https://learn.microsoft.com/powershell/module/Az.NetworkCloud/new-AzNetworkCloudIpAddressPoolObject +https://learn.microsoft.com/powershell/module/Az.NetworkCloud/new-aznetworkcloudipaddresspoolobject #> function New-AzNetworkCloudIpAddressPoolObject { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IpAddressPool])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IpAddressPool])] [CmdletBinding(PositionalBinding=$false)] param( [Parameter(Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # The name used to identify this IP address pool for association with a BGP advertisement. + ${Name}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String[]] # The list of IP address ranges. # Each range can be a either a subnet in CIDR format or an explicit start-end range of IP addresses. # For a BGP service load balancer configuration, only CIDR format is supported and excludes /32 (IPv4) and /128 (IPv6) prefixes. ${Address}, - [Parameter(Mandatory)] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [System.String] - # The name used to identify this IP address pool for association with a BGP advertisement. - ${Name}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BfdEnabled])] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("True", "False")] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BfdEnabled] + [System.String] # The indicator to determine if automatic allocation from the pool should occur. ${AutoAssign}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BfdEnabled])] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("True", "False")] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BfdEnabled] + [System.String] # The indicator to prevent the use of IP addresses ending with .0 and .255 for this pool. # Enabling this option will only use IP addresses between .1 and .254 inclusive. ${OnlyUseHostIP} @@ -24018,6 +26594,9 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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() @@ -24046,6 +26625,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) @@ -24098,12 +26680,12 @@ Create an in-memory object for KeySetUser. New-AzNetworkCloudKeySetUserObject -AzureUserName azureUserName -SshPublicKeyData "ssh-rsa-key" -Description "userDescription" .Outputs -Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.KeySetUser +Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.KeySetUser .Link -https://learn.microsoft.com/powershell/module/Az.NetworkCloud/new-AzNetworkCloudKeySetUserObject +https://learn.microsoft.com/powershell/module/Az.NetworkCloud/new-aznetworkcloudkeysetuserobject #> function New-AzNetworkCloudKeySetUserObject { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.KeySetUser])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.KeySetUser])] [CmdletBinding(PositionalBinding=$false)] param( [Parameter(Mandatory)] @@ -24138,6 +26720,9 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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() @@ -24166,6 +26751,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) @@ -24218,12 +26806,12 @@ Create an in-memory object for L3NetworkAttachmentConfiguration. New-AzNetworkCloudL3NetworkAttachmentConfigurationObject -NetworkId '/subscriptions/{subscriptionId}/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l3Networks/l3network-502' -IpamEnabled True -PluginType 'SRIOV' .Outputs -Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.L3NetworkAttachmentConfiguration +Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.L3NetworkAttachmentConfiguration .Link -https://learn.microsoft.com/powershell/module/Az.NetworkCloud/new-AzNetworkCloudL3NetworkAttachmentConfigurationObject +https://learn.microsoft.com/powershell/module/Az.NetworkCloud/new-aznetworkcloudl3networkattachmentconfigurationobject #> function New-AzNetworkCloudL3NetworkAttachmentConfigurationObject { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.L3NetworkAttachmentConfiguration])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.L3NetworkAttachmentConfiguration])] [CmdletBinding(PositionalBinding=$false)] param( [Parameter(Mandatory)] @@ -24233,16 +26821,16 @@ param( ${NetworkId}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.L3NetworkConfigurationIpamEnabled])] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("True", "False")] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.L3NetworkConfigurationIpamEnabled] + [System.String] # The indication of whether this network will or will not perform IP address management and allocate IP addresses when attached. ${IpamEnabled}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesPluginType])] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("DPDK", "SRIOV", "OSDevice", "MACVLAN", "IPVLAN")] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesPluginType] + [System.String] # The indicator of how this network will be utilized by the Kubernetes cluster. ${PluginType} ) @@ -24254,6 +26842,9 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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() @@ -24282,6 +26873,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) @@ -24334,12 +26928,12 @@ Create an in-memory object for NetworkAttachment. New-AzNetworkCloudNetworkAttachmentObject -AttachedNetworkId "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/l3Networks/l3NetworkName" -IPAllocationMethod "Dynamic" -DefaultGateway "True" -Ipv4Address "198.51.100.1" -Ipv6Address "2001:0db8:0000:0000:0000:0000:0000:0001" -Name "netAttachName01" .Outputs -Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.NetworkAttachment +Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.NetworkAttachment .Link -https://learn.microsoft.com/powershell/module/Az.NetworkCloud/new-AzNetworkCloudNetworkAttachmentObject +https://learn.microsoft.com/powershell/module/Az.NetworkCloud/new-aznetworkcloudnetworkattachmentobject #> function New-AzNetworkCloudNetworkAttachmentObject { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.NetworkAttachment])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.NetworkAttachment])] [CmdletBinding(PositionalBinding=$false)] param( [Parameter(Mandatory)] @@ -24350,18 +26944,18 @@ param( ${AttachedNetworkId}, [Parameter(Mandatory)] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineIPAllocationMethod])] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Dynamic", "Static", "Disabled")] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineIPAllocationMethod] + [System.String] # The IP allocation mechanism for the virtual machine. # Dynamic and Static are only valid for l3Network which may also specify Disabled. # Otherwise, Disabled is the only permitted value. ${IPAllocationMethod}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.DefaultGateway])] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("True", "False")] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.DefaultGateway] + [System.String] # The indicator of whether this is the default gateway. # Only one of the attached networks (including the CloudServicesNetwork attachment) for a single machine may be specified as True. ${DefaultGateway}, @@ -24409,6 +27003,9 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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() @@ -24437,6 +27034,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) @@ -24495,7 +27095,7 @@ $object = New-AzNetworkCloudRackDefinitionObject -NetworkRackId "/subscriptions/ Write-Host ($object | Format-List | Out-String) .Outputs -Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.RackDefinition +Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.RackDefinition .Notes COMPLEX PARAMETER PROPERTIES @@ -24518,10 +27118,10 @@ STORAGEAPPLIANCECONFIGURATIONDATA : The li SerialNumber : The serial number of the appliance. [StorageApplianceName ]: The user-provided name for the storage appliance that will be created from this specification. .Link -https://learn.microsoft.com/powershell/module/Az.NetworkCloud/new-AzNetworkCloudRackDefinitionObject +https://learn.microsoft.com/powershell/module/Az.NetworkCloud/new-aznetworkcloudrackdefinitionobject #> function New-AzNetworkCloudRackDefinitionObject { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.RackDefinition])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.RackDefinition])] [CmdletBinding(PositionalBinding=$false)] param( [Parameter(Mandatory)] @@ -24552,9 +27152,8 @@ param( [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineConfigurationData[]] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineConfigurationData[]] # The unordered list of bare metal machine configuration. - # To construct, see NOTES section for BAREMETALMACHINECONFIGURATIONDATA properties and create a hash table. ${BareMetalMachineConfigurationData}, [Parameter()] @@ -24565,9 +27164,8 @@ param( [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceConfigurationData[]] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceConfigurationData[]] # The list of storage appliance configuration data for this rack. - # To construct, see NOTES section for STORAGEAPPLIANCECONFIGURATIONDATA properties and create a hash table. ${StorageApplianceConfigurationData} ) @@ -24578,6 +27176,9 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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() @@ -24606,6 +27207,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) @@ -24658,12 +27262,12 @@ Create an in-memory object for ServiceLoadBalancerBgpPeer. New-AzNetworkCloudServiceLoadBalancerBgpPeerObject -Name name -PeerAddress "203.0.113.254" -PeerAsn "64497" -BfdEnabled False -BgpMultiHop False -HoldTime "P300s" -KeepAliveTime "P300s" -MyAsn 64512 -Password REDACTED -PeerPort 1234 .Outputs -Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ServiceLoadBalancerBgpPeer +Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ServiceLoadBalancerBgpPeer .Link -https://learn.microsoft.com/powershell/module/Az.NetworkCloud/new-AzNetworkCloudServiceLoadBalancerBgpPeerObject +https://learn.microsoft.com/powershell/module/Az.NetworkCloud/new-aznetworkcloudserviceloadbalancerbgppeerobject #> function New-AzNetworkCloudServiceLoadBalancerBgpPeerObject { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ServiceLoadBalancerBgpPeer])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ServiceLoadBalancerBgpPeer])] [CmdletBinding(PositionalBinding=$false)] param( [Parameter(Mandatory)] @@ -24685,16 +27289,16 @@ param( ${PeerAsn}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BfdEnabled])] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("True", "False")] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BfdEnabled] + [System.String] # The indicator of BFD enablement for this BgpPeer. ${BfdEnabled}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BgpMultiHop])] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("True", "False")] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BgpMultiHop] + [System.String] # The indicator to enable multi-hop peering support. ${BgpMultiHop}, @@ -24742,6 +27346,9 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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() @@ -24770,6 +27377,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) @@ -24824,12 +27434,12 @@ $password = ConvertTo-SecureString "********" -AsPlainText -Force New-AzNetworkCloudStorageApplianceConfigurationDataObject -AdminCredentialsPassword $password -AdminCredentialsUsername username -RackSlot 1 -SerialNumber serialNumber -StorageApplianceName storageApplianceName .Outputs -Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.StorageApplianceConfigurationData +Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.StorageApplianceConfigurationData .Link -https://learn.microsoft.com/powershell/module/Az.NetworkCloud/new-AzNetworkCloudStorageApplianceConfigurationDataObject +https://learn.microsoft.com/powershell/module/Az.NetworkCloud/new-aznetworkcloudstorageapplianceconfigurationdataobject #> function New-AzNetworkCloudStorageApplianceConfigurationDataObject { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.StorageApplianceConfigurationData])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.StorageApplianceConfigurationData])] [CmdletBinding(PositionalBinding=$false)] param( [Parameter(Mandatory)] @@ -24870,6 +27480,9 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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() @@ -24898,6 +27511,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) @@ -24950,18 +27566,18 @@ Create an in-memory object for VirtualMachinePlacementHint. New-AzNetworkCloudVirtualMachinePlacementHintObject -HintType "Affinity" -ResourceId "/subscriptions/subscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.NetworkCloud/racks/rackName" -SchedulingExecution "Hard" -Scope "Machine" .Outputs -Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.VirtualMachinePlacementHint +Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.VirtualMachinePlacementHint .Link -https://learn.microsoft.com/powershell/module/Az.NetworkCloud/new-AzNetworkCloudVirtualMachinePlacementHintObject +https://learn.microsoft.com/powershell/module/Az.NetworkCloud/new-aznetworkcloudvirtualmachineplacementhintobject #> function New-AzNetworkCloudVirtualMachinePlacementHintObject { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.VirtualMachinePlacementHint])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.VirtualMachinePlacementHint])] [CmdletBinding(PositionalBinding=$false)] param( [Parameter(Mandatory)] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachinePlacementHintType])] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Affinity", "AntiAffinity")] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachinePlacementHintType] + [System.String] # The specification of whether this hint supports affinity or anti-affinity with the referenced resources. ${HintType}, @@ -24972,16 +27588,16 @@ param( ${ResourceId}, [Parameter(Mandatory)] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineSchedulingExecution])] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Hard", "Soft")] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineSchedulingExecution] + [System.String] # The indicator of whether the hint is a hard or soft requirement during scheduling. ${SchedulingExecution}, [Parameter(Mandatory)] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachinePlacementHintPodAffinityScope])] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Rack", "Machine")] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachinePlacementHintPodAffinityScope] + [System.String] # The scope for the virtual machine affinity or anti-affinity placement hint. # It should always be "Machine" in the case of node affinity. ${Scope} @@ -24994,6 +27610,9 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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() @@ -25022,6 +27641,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/NetworkCloud/NetworkCloud.Autorest/exports/Remove-AzNetworkCloudAgentPool.ps1 b/generated/NetworkCloud/NetworkCloud.Autorest/exports/Remove-AzNetworkCloudAgentPool.ps1 index c4c2507ba1a0..67367f530dad 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/exports/Remove-AzNetworkCloudAgentPool.ps1 +++ b/generated/NetworkCloud/NetworkCloud.Autorest/exports/Remove-AzNetworkCloudAgentPool.ps1 @@ -54,6 +54,30 @@ INPUTOBJECT : Identity Parameter [TrunkedNetworkName ]: The name of the trunked network. [VirtualMachineName ]: The name of the virtual machine. [VolumeName ]: The name of the volume. + +KUBERNETESCLUSTERINPUTOBJECT : Identity Parameter + [AgentPoolName ]: The name of the Kubernetes cluster agent pool. + [BareMetalMachineKeySetName ]: The name of the bare metal machine key set. + [BareMetalMachineName ]: The name of the bare metal machine. + [BmcKeySetName ]: The name of the baseboard management controller key set. + [CloudServicesNetworkName ]: The name of the cloud services network. + [ClusterManagerName ]: The name of the cluster manager. + [ClusterName ]: The name of the cluster. + [ConsoleName ]: The name of the virtual machine console. + [FeatureName ]: The name of the feature. + [Id ]: Resource identity path + [KubernetesClusterName ]: The name of the Kubernetes cluster. + [L2NetworkName ]: The name of the L2 network. + [L3NetworkName ]: The name of the L3 network. + [MetricsConfigurationName ]: The name of the metrics configuration for the cluster. + [RackName ]: The name of the rack. + [RackSkuName ]: The name of the rack SKU. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [StorageApplianceName ]: The name of the storage appliance. + [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. + [TrunkedNetworkName ]: The name of the trunked network. + [VirtualMachineName ]: The name of the virtual machine. + [VolumeName ]: The name of the volume. .Link https://learn.microsoft.com/powershell/module/az.networkcloud/remove-aznetworkcloudagentpool #> @@ -68,6 +92,7 @@ param( ${KubernetesClusterName}, [Parameter(ParameterSetName='Delete', Mandatory)] + [Parameter(ParameterSetName='DeleteViaIdentityKubernetesCluster', Mandatory)] [Alias('AgentPoolName')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [System.String] @@ -93,9 +118,14 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, + [Parameter(ParameterSetName='DeleteViaIdentityKubernetesCluster', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] + # Identity Parameter + ${KubernetesClusterInputObject}, + [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Header')] [System.String] @@ -185,6 +215,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 +245,9 @@ begin { $mapping = @{ Delete = 'Az.NetworkCloud.private\Remove-AzNetworkCloudAgentPool_Delete'; DeleteViaIdentity = 'Az.NetworkCloud.private\Remove-AzNetworkCloudAgentPool_DeleteViaIdentity'; + DeleteViaIdentityKubernetesCluster = 'Az.NetworkCloud.private\Remove-AzNetworkCloudAgentPool_DeleteViaIdentityKubernetesCluster'; } - if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 { @@ -223,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/NetworkCloud/NetworkCloud.Autorest/exports/Remove-AzNetworkCloudBareMetalMachineKeySet.ps1 b/generated/NetworkCloud/NetworkCloud.Autorest/exports/Remove-AzNetworkCloudBareMetalMachineKeySet.ps1 index e1a7ee50e4c6..41725306112a 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/exports/Remove-AzNetworkCloudBareMetalMachineKeySet.ps1 +++ b/generated/NetworkCloud/NetworkCloud.Autorest/exports/Remove-AzNetworkCloudBareMetalMachineKeySet.ps1 @@ -31,6 +31,30 @@ 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. +CLUSTERINPUTOBJECT : Identity Parameter + [AgentPoolName ]: The name of the Kubernetes cluster agent pool. + [BareMetalMachineKeySetName ]: The name of the bare metal machine key set. + [BareMetalMachineName ]: The name of the bare metal machine. + [BmcKeySetName ]: The name of the baseboard management controller key set. + [CloudServicesNetworkName ]: The name of the cloud services network. + [ClusterManagerName ]: The name of the cluster manager. + [ClusterName ]: The name of the cluster. + [ConsoleName ]: The name of the virtual machine console. + [FeatureName ]: The name of the feature. + [Id ]: Resource identity path + [KubernetesClusterName ]: The name of the Kubernetes cluster. + [L2NetworkName ]: The name of the L2 network. + [L3NetworkName ]: The name of the L3 network. + [MetricsConfigurationName ]: The name of the metrics configuration for the cluster. + [RackName ]: The name of the rack. + [RackSkuName ]: The name of the rack SKU. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [StorageApplianceName ]: The name of the storage appliance. + [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. + [TrunkedNetworkName ]: The name of the trunked network. + [VirtualMachineName ]: The name of the virtual machine. + [VolumeName ]: The name of the volume. + INPUTOBJECT : Identity Parameter [AgentPoolName ]: The name of the Kubernetes cluster agent pool. [BareMetalMachineKeySetName ]: The name of the bare metal machine key set. @@ -68,6 +92,7 @@ param( ${ClusterName}, [Parameter(ParameterSetName='Delete', Mandatory)] + [Parameter(ParameterSetName='DeleteViaIdentityCluster', Mandatory)] [Alias('BareMetalMachineKeySetName')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [System.String] @@ -93,9 +118,14 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, + [Parameter(ParameterSetName='DeleteViaIdentityCluster', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] + # Identity Parameter + ${ClusterInputObject}, + [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Header')] [System.String] @@ -185,6 +215,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 +245,9 @@ begin { $mapping = @{ Delete = 'Az.NetworkCloud.private\Remove-AzNetworkCloudBareMetalMachineKeySet_Delete'; DeleteViaIdentity = 'Az.NetworkCloud.private\Remove-AzNetworkCloudBareMetalMachineKeySet_DeleteViaIdentity'; + DeleteViaIdentityCluster = 'Az.NetworkCloud.private\Remove-AzNetworkCloudBareMetalMachineKeySet_DeleteViaIdentityCluster'; } - if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 { @@ -223,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/NetworkCloud/NetworkCloud.Autorest/exports/Remove-AzNetworkCloudBmcKeySet.ps1 b/generated/NetworkCloud/NetworkCloud.Autorest/exports/Remove-AzNetworkCloudBmcKeySet.ps1 index 55704b72de44..1cf7bbc3e8da 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/exports/Remove-AzNetworkCloudBmcKeySet.ps1 +++ b/generated/NetworkCloud/NetworkCloud.Autorest/exports/Remove-AzNetworkCloudBmcKeySet.ps1 @@ -31,6 +31,30 @@ 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. +CLUSTERINPUTOBJECT : Identity Parameter + [AgentPoolName ]: The name of the Kubernetes cluster agent pool. + [BareMetalMachineKeySetName ]: The name of the bare metal machine key set. + [BareMetalMachineName ]: The name of the bare metal machine. + [BmcKeySetName ]: The name of the baseboard management controller key set. + [CloudServicesNetworkName ]: The name of the cloud services network. + [ClusterManagerName ]: The name of the cluster manager. + [ClusterName ]: The name of the cluster. + [ConsoleName ]: The name of the virtual machine console. + [FeatureName ]: The name of the feature. + [Id ]: Resource identity path + [KubernetesClusterName ]: The name of the Kubernetes cluster. + [L2NetworkName ]: The name of the L2 network. + [L3NetworkName ]: The name of the L3 network. + [MetricsConfigurationName ]: The name of the metrics configuration for the cluster. + [RackName ]: The name of the rack. + [RackSkuName ]: The name of the rack SKU. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [StorageApplianceName ]: The name of the storage appliance. + [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. + [TrunkedNetworkName ]: The name of the trunked network. + [VirtualMachineName ]: The name of the virtual machine. + [VolumeName ]: The name of the volume. + INPUTOBJECT : Identity Parameter [AgentPoolName ]: The name of the Kubernetes cluster agent pool. [BareMetalMachineKeySetName ]: The name of the bare metal machine key set. @@ -68,6 +92,7 @@ param( ${ClusterName}, [Parameter(ParameterSetName='Delete', Mandatory)] + [Parameter(ParameterSetName='DeleteViaIdentityCluster', Mandatory)] [Alias('BmcKeySetName')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [System.String] @@ -93,9 +118,14 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, + [Parameter(ParameterSetName='DeleteViaIdentityCluster', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] + # Identity Parameter + ${ClusterInputObject}, + [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Header')] [System.String] @@ -185,6 +215,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 +245,9 @@ begin { $mapping = @{ Delete = 'Az.NetworkCloud.private\Remove-AzNetworkCloudBmcKeySet_Delete'; DeleteViaIdentity = 'Az.NetworkCloud.private\Remove-AzNetworkCloudBmcKeySet_DeleteViaIdentity'; + DeleteViaIdentityCluster = 'Az.NetworkCloud.private\Remove-AzNetworkCloudBmcKeySet_DeleteViaIdentityCluster'; } - if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 { @@ -223,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/NetworkCloud/NetworkCloud.Autorest/exports/Remove-AzNetworkCloudCluster.ps1 b/generated/NetworkCloud/NetworkCloud.Autorest/exports/Remove-AzNetworkCloudCluster.ps1 index 510745754d90..4886aa24d707 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/exports/Remove-AzNetworkCloudCluster.ps1 +++ b/generated/NetworkCloud/NetworkCloud.Autorest/exports/Remove-AzNetworkCloudCluster.ps1 @@ -87,7 +87,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -179,6 +178,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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() @@ -201,9 +209,7 @@ begin { Delete = 'Az.NetworkCloud.private\Remove-AzNetworkCloudCluster_Delete'; DeleteViaIdentity = 'Az.NetworkCloud.private\Remove-AzNetworkCloudCluster_DeleteViaIdentity'; } - if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 { @@ -217,6 +223,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/NetworkCloud/NetworkCloud.Autorest/exports/Remove-AzNetworkCloudClusterManager.ps1 b/generated/NetworkCloud/NetworkCloud.Autorest/exports/Remove-AzNetworkCloudClusterManager.ps1 index 8e2818b9ab9f..f118e67a2404 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/exports/Remove-AzNetworkCloudClusterManager.ps1 +++ b/generated/NetworkCloud/NetworkCloud.Autorest/exports/Remove-AzNetworkCloudClusterManager.ps1 @@ -87,7 +87,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -179,6 +178,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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() @@ -201,9 +209,7 @@ begin { Delete = 'Az.NetworkCloud.private\Remove-AzNetworkCloudClusterManager_Delete'; DeleteViaIdentity = 'Az.NetworkCloud.private\Remove-AzNetworkCloudClusterManager_DeleteViaIdentity'; } - if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 { @@ -217,6 +223,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/NetworkCloud/NetworkCloud.Autorest/exports/Remove-AzNetworkCloudConsole.ps1 b/generated/NetworkCloud/NetworkCloud.Autorest/exports/Remove-AzNetworkCloudConsole.ps1 index 6f22bac1f959..cb5be35f93cd 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/exports/Remove-AzNetworkCloudConsole.ps1 +++ b/generated/NetworkCloud/NetworkCloud.Autorest/exports/Remove-AzNetworkCloudConsole.ps1 @@ -54,6 +54,30 @@ INPUTOBJECT : Identity Parameter [TrunkedNetworkName ]: The name of the trunked network. [VirtualMachineName ]: The name of the virtual machine. [VolumeName ]: The name of the volume. + +VIRTUALMACHINEINPUTOBJECT : Identity Parameter + [AgentPoolName ]: The name of the Kubernetes cluster agent pool. + [BareMetalMachineKeySetName ]: The name of the bare metal machine key set. + [BareMetalMachineName ]: The name of the bare metal machine. + [BmcKeySetName ]: The name of the baseboard management controller key set. + [CloudServicesNetworkName ]: The name of the cloud services network. + [ClusterManagerName ]: The name of the cluster manager. + [ClusterName ]: The name of the cluster. + [ConsoleName ]: The name of the virtual machine console. + [FeatureName ]: The name of the feature. + [Id ]: Resource identity path + [KubernetesClusterName ]: The name of the Kubernetes cluster. + [L2NetworkName ]: The name of the L2 network. + [L3NetworkName ]: The name of the L3 network. + [MetricsConfigurationName ]: The name of the metrics configuration for the cluster. + [RackName ]: The name of the rack. + [RackSkuName ]: The name of the rack SKU. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [StorageApplianceName ]: The name of the storage appliance. + [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. + [TrunkedNetworkName ]: The name of the trunked network. + [VirtualMachineName ]: The name of the virtual machine. + [VolumeName ]: The name of the volume. .Link https://learn.microsoft.com/powershell/module/az.networkcloud/remove-aznetworkcloudconsole #> @@ -62,6 +86,7 @@ function Remove-AzNetworkCloudConsole { [CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='Delete', Mandatory)] + [Parameter(ParameterSetName='DeleteViaIdentityVirtualMachine', Mandatory)] [Alias('ConsoleName')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [System.String] @@ -93,9 +118,14 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, + [Parameter(ParameterSetName='DeleteViaIdentityVirtualMachine', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] + # Identity Parameter + ${VirtualMachineInputObject}, + [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Header')] [System.String] @@ -185,6 +215,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 +245,9 @@ begin { $mapping = @{ Delete = 'Az.NetworkCloud.private\Remove-AzNetworkCloudConsole_Delete'; DeleteViaIdentity = 'Az.NetworkCloud.private\Remove-AzNetworkCloudConsole_DeleteViaIdentity'; + DeleteViaIdentityVirtualMachine = 'Az.NetworkCloud.private\Remove-AzNetworkCloudConsole_DeleteViaIdentityVirtualMachine'; } - if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 { @@ -223,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/NetworkCloud/NetworkCloud.Autorest/exports/Remove-AzNetworkCloudKubernetesCluster.ps1 b/generated/NetworkCloud/NetworkCloud.Autorest/exports/Remove-AzNetworkCloudKubernetesCluster.ps1 index 64ca8d1811de..74b5f0fde0b5 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/exports/Remove-AzNetworkCloudKubernetesCluster.ps1 +++ b/generated/NetworkCloud/NetworkCloud.Autorest/exports/Remove-AzNetworkCloudKubernetesCluster.ps1 @@ -87,7 +87,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -179,6 +178,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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() @@ -201,9 +209,7 @@ begin { Delete = 'Az.NetworkCloud.private\Remove-AzNetworkCloudKubernetesCluster_Delete'; DeleteViaIdentity = 'Az.NetworkCloud.private\Remove-AzNetworkCloudKubernetesCluster_DeleteViaIdentity'; } - if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 { @@ -217,6 +223,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/NetworkCloud/NetworkCloud.Autorest/exports/Remove-AzNetworkCloudKubernetesClusterFeature.ps1 b/generated/NetworkCloud/NetworkCloud.Autorest/exports/Remove-AzNetworkCloudKubernetesClusterFeature.ps1 index 5dd0b37b1d79..5f486f68972f 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/exports/Remove-AzNetworkCloudKubernetesClusterFeature.ps1 +++ b/generated/NetworkCloud/NetworkCloud.Autorest/exports/Remove-AzNetworkCloudKubernetesClusterFeature.ps1 @@ -54,6 +54,30 @@ INPUTOBJECT : Identity Parameter [TrunkedNetworkName ]: The name of the trunked network. [VirtualMachineName ]: The name of the virtual machine. [VolumeName ]: The name of the volume. + +KUBERNETESCLUSTERINPUTOBJECT : Identity Parameter + [AgentPoolName ]: The name of the Kubernetes cluster agent pool. + [BareMetalMachineKeySetName ]: The name of the bare metal machine key set. + [BareMetalMachineName ]: The name of the bare metal machine. + [BmcKeySetName ]: The name of the baseboard management controller key set. + [CloudServicesNetworkName ]: The name of the cloud services network. + [ClusterManagerName ]: The name of the cluster manager. + [ClusterName ]: The name of the cluster. + [ConsoleName ]: The name of the virtual machine console. + [FeatureName ]: The name of the feature. + [Id ]: Resource identity path + [KubernetesClusterName ]: The name of the Kubernetes cluster. + [L2NetworkName ]: The name of the L2 network. + [L3NetworkName ]: The name of the L3 network. + [MetricsConfigurationName ]: The name of the metrics configuration for the cluster. + [RackName ]: The name of the rack. + [RackSkuName ]: The name of the rack SKU. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [StorageApplianceName ]: The name of the storage appliance. + [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. + [TrunkedNetworkName ]: The name of the trunked network. + [VirtualMachineName ]: The name of the virtual machine. + [VolumeName ]: The name of the volume. .Link https://learn.microsoft.com/powershell/module/az.networkcloud/remove-aznetworkcloudkubernetesclusterfeature #> @@ -62,6 +86,7 @@ function Remove-AzNetworkCloudKubernetesClusterFeature { [CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='Delete', Mandatory)] + [Parameter(ParameterSetName='DeleteViaIdentityKubernetesCluster', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [System.String] # The name of the feature. @@ -92,9 +117,14 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, + [Parameter(ParameterSetName='DeleteViaIdentityKubernetesCluster', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] + # Identity Parameter + ${KubernetesClusterInputObject}, + [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Header')] [System.String] @@ -184,6 +214,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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() @@ -205,10 +244,9 @@ begin { $mapping = @{ Delete = 'Az.NetworkCloud.private\Remove-AzNetworkCloudKubernetesClusterFeature_Delete'; DeleteViaIdentity = 'Az.NetworkCloud.private\Remove-AzNetworkCloudKubernetesClusterFeature_DeleteViaIdentity'; + DeleteViaIdentityKubernetesCluster = 'Az.NetworkCloud.private\Remove-AzNetworkCloudKubernetesClusterFeature_DeleteViaIdentityKubernetesCluster'; } - if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 { @@ -222,6 +260,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/NetworkCloud/NetworkCloud.Autorest/exports/Remove-AzNetworkCloudL2Network.ps1 b/generated/NetworkCloud/NetworkCloud.Autorest/exports/Remove-AzNetworkCloudL2Network.ps1 index b6d4075b59d6..52d44526f551 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/exports/Remove-AzNetworkCloudL2Network.ps1 +++ b/generated/NetworkCloud/NetworkCloud.Autorest/exports/Remove-AzNetworkCloudL2Network.ps1 @@ -87,7 +87,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -179,6 +178,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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() @@ -201,9 +209,7 @@ begin { Delete = 'Az.NetworkCloud.private\Remove-AzNetworkCloudL2Network_Delete'; DeleteViaIdentity = 'Az.NetworkCloud.private\Remove-AzNetworkCloudL2Network_DeleteViaIdentity'; } - if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 { @@ -217,6 +223,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/NetworkCloud/NetworkCloud.Autorest/exports/Remove-AzNetworkCloudL3Network.ps1 b/generated/NetworkCloud/NetworkCloud.Autorest/exports/Remove-AzNetworkCloudL3Network.ps1 index 2e971753e7e2..1656622d028f 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/exports/Remove-AzNetworkCloudL3Network.ps1 +++ b/generated/NetworkCloud/NetworkCloud.Autorest/exports/Remove-AzNetworkCloudL3Network.ps1 @@ -87,7 +87,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -179,6 +178,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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() @@ -201,9 +209,7 @@ begin { Delete = 'Az.NetworkCloud.private\Remove-AzNetworkCloudL3Network_Delete'; DeleteViaIdentity = 'Az.NetworkCloud.private\Remove-AzNetworkCloudL3Network_DeleteViaIdentity'; } - if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 { @@ -217,6 +223,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/NetworkCloud/NetworkCloud.Autorest/exports/Remove-AzNetworkCloudMetricsConfiguration.ps1 b/generated/NetworkCloud/NetworkCloud.Autorest/exports/Remove-AzNetworkCloudMetricsConfiguration.ps1 index ef07849275b0..b5b9ec3a50b7 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/exports/Remove-AzNetworkCloudMetricsConfiguration.ps1 +++ b/generated/NetworkCloud/NetworkCloud.Autorest/exports/Remove-AzNetworkCloudMetricsConfiguration.ps1 @@ -31,6 +31,30 @@ 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. +CLUSTERINPUTOBJECT : Identity Parameter + [AgentPoolName ]: The name of the Kubernetes cluster agent pool. + [BareMetalMachineKeySetName ]: The name of the bare metal machine key set. + [BareMetalMachineName ]: The name of the bare metal machine. + [BmcKeySetName ]: The name of the baseboard management controller key set. + [CloudServicesNetworkName ]: The name of the cloud services network. + [ClusterManagerName ]: The name of the cluster manager. + [ClusterName ]: The name of the cluster. + [ConsoleName ]: The name of the virtual machine console. + [FeatureName ]: The name of the feature. + [Id ]: Resource identity path + [KubernetesClusterName ]: The name of the Kubernetes cluster. + [L2NetworkName ]: The name of the L2 network. + [L3NetworkName ]: The name of the L3 network. + [MetricsConfigurationName ]: The name of the metrics configuration for the cluster. + [RackName ]: The name of the rack. + [RackSkuName ]: The name of the rack SKU. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [StorageApplianceName ]: The name of the storage appliance. + [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. + [TrunkedNetworkName ]: The name of the trunked network. + [VirtualMachineName ]: The name of the virtual machine. + [VolumeName ]: The name of the volume. + INPUTOBJECT : Identity Parameter [AgentPoolName ]: The name of the Kubernetes cluster agent pool. [BareMetalMachineKeySetName ]: The name of the bare metal machine key set. @@ -68,6 +92,7 @@ param( ${ClusterName}, [Parameter(ParameterSetName='Delete', Mandatory)] + [Parameter(ParameterSetName='DeleteViaIdentityCluster', Mandatory)] [Alias('MetricsConfigurationName')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [System.String] @@ -93,9 +118,14 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, + [Parameter(ParameterSetName='DeleteViaIdentityCluster', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] + # Identity Parameter + ${ClusterInputObject}, + [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Header')] [System.String] @@ -185,6 +215,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 +245,9 @@ begin { $mapping = @{ Delete = 'Az.NetworkCloud.private\Remove-AzNetworkCloudMetricsConfiguration_Delete'; DeleteViaIdentity = 'Az.NetworkCloud.private\Remove-AzNetworkCloudMetricsConfiguration_DeleteViaIdentity'; + DeleteViaIdentityCluster = 'Az.NetworkCloud.private\Remove-AzNetworkCloudMetricsConfiguration_DeleteViaIdentityCluster'; } - if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 { @@ -223,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/NetworkCloud/NetworkCloud.Autorest/exports/Remove-AzNetworkCloudServicesNetwork.ps1 b/generated/NetworkCloud/NetworkCloud.Autorest/exports/Remove-AzNetworkCloudServicesNetwork.ps1 index ee71c6e4beb3..943f25d6847c 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/exports/Remove-AzNetworkCloudServicesNetwork.ps1 +++ b/generated/NetworkCloud/NetworkCloud.Autorest/exports/Remove-AzNetworkCloudServicesNetwork.ps1 @@ -87,7 +87,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -179,6 +178,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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() @@ -201,9 +209,7 @@ begin { Delete = 'Az.NetworkCloud.private\Remove-AzNetworkCloudServicesNetwork_Delete'; DeleteViaIdentity = 'Az.NetworkCloud.private\Remove-AzNetworkCloudServicesNetwork_DeleteViaIdentity'; } - if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 { @@ -217,6 +223,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/NetworkCloud/NetworkCloud.Autorest/exports/Remove-AzNetworkCloudTrunkedNetwork.ps1 b/generated/NetworkCloud/NetworkCloud.Autorest/exports/Remove-AzNetworkCloudTrunkedNetwork.ps1 index 76c54cdc9780..629071dfaff0 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/exports/Remove-AzNetworkCloudTrunkedNetwork.ps1 +++ b/generated/NetworkCloud/NetworkCloud.Autorest/exports/Remove-AzNetworkCloudTrunkedNetwork.ps1 @@ -87,7 +87,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -179,6 +178,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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() @@ -201,9 +209,7 @@ begin { Delete = 'Az.NetworkCloud.private\Remove-AzNetworkCloudTrunkedNetwork_Delete'; DeleteViaIdentity = 'Az.NetworkCloud.private\Remove-AzNetworkCloudTrunkedNetwork_DeleteViaIdentity'; } - if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 { @@ -217,6 +223,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/NetworkCloud/NetworkCloud.Autorest/exports/Remove-AzNetworkCloudVirtualMachine.ps1 b/generated/NetworkCloud/NetworkCloud.Autorest/exports/Remove-AzNetworkCloudVirtualMachine.ps1 index e253d279bbae..0ea5b8c54056 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/exports/Remove-AzNetworkCloudVirtualMachine.ps1 +++ b/generated/NetworkCloud/NetworkCloud.Autorest/exports/Remove-AzNetworkCloudVirtualMachine.ps1 @@ -87,7 +87,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -179,6 +178,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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() @@ -201,9 +209,7 @@ begin { Delete = 'Az.NetworkCloud.private\Remove-AzNetworkCloudVirtualMachine_Delete'; DeleteViaIdentity = 'Az.NetworkCloud.private\Remove-AzNetworkCloudVirtualMachine_DeleteViaIdentity'; } - if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 { @@ -217,6 +223,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/NetworkCloud/NetworkCloud.Autorest/exports/Remove-AzNetworkCloudVolume.ps1 b/generated/NetworkCloud/NetworkCloud.Autorest/exports/Remove-AzNetworkCloudVolume.ps1 index 649d21361040..e77f78987535 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/exports/Remove-AzNetworkCloudVolume.ps1 +++ b/generated/NetworkCloud/NetworkCloud.Autorest/exports/Remove-AzNetworkCloudVolume.ps1 @@ -87,7 +87,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -179,6 +178,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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() @@ -201,9 +209,7 @@ begin { Delete = 'Az.NetworkCloud.private\Remove-AzNetworkCloudVolume_Delete'; DeleteViaIdentity = 'Az.NetworkCloud.private\Remove-AzNetworkCloudVolume_DeleteViaIdentity'; } - if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 { @@ -217,6 +223,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/NetworkCloud/NetworkCloud.Autorest/exports/Restart-AzNetworkCloudBareMetalMachine.ps1 b/generated/NetworkCloud/NetworkCloud.Autorest/exports/Restart-AzNetworkCloudBareMetalMachine.ps1 index fce0c3301f4d..6ffafdae2bb0 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/exports/Restart-AzNetworkCloudBareMetalMachine.ps1 +++ b/generated/NetworkCloud/NetworkCloud.Autorest/exports/Restart-AzNetworkCloudBareMetalMachine.ps1 @@ -87,7 +87,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -164,6 +163,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 { Restart = 'Az.NetworkCloud.private\Restart-AzNetworkCloudBareMetalMachine_Restart'; RestartViaIdentity = 'Az.NetworkCloud.private\Restart-AzNetworkCloudBareMetalMachine_RestartViaIdentity'; } - if (('Restart') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Restart') -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/NetworkCloud/NetworkCloud.Autorest/exports/Restart-AzNetworkCloudKubernetesClusterNode.ps1 b/generated/NetworkCloud/NetworkCloud.Autorest/exports/Restart-AzNetworkCloudKubernetesClusterNode.ps1 index 93d8f2967fdb..8d090861068f 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/exports/Restart-AzNetworkCloudKubernetesClusterNode.ps1 +++ b/generated/NetworkCloud/NetworkCloud.Autorest/exports/Restart-AzNetworkCloudKubernetesClusterNode.ps1 @@ -22,6 +22,8 @@ Restart a targeted node of a Kubernetes cluster. .Example Restart-AzNetworkCloudKubernetesClusterNode -KubernetesClusterName kubernetesClusterName -ResourceGroupName resourceGroup -NodeName nodeName -SubscriptionId subscriptionId +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterRestartNodeParameters .Inputs Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity .Outputs @@ -54,6 +56,9 @@ INPUTOBJECT : Identity Parameter [TrunkedNetworkName ]: The name of the trunked network. [VirtualMachineName ]: The name of the virtual machine. [VolumeName ]: The name of the volume. + +KUBERNETESCLUSTERRESTARTNODEPARAMETER : KubernetesClusterRestartNodeParameters represents the body of the request to restart the node of a Kubernetes cluster. + NodeName : The name of the node to restart. .Link https://learn.microsoft.com/powershell/module/az.networkcloud/restart-aznetworkcloudkubernetesclusternode #> @@ -61,20 +66,29 @@ function Restart-AzNetworkCloudKubernetesClusterNode { [OutputType([System.Boolean])] [CmdletBinding(DefaultParameterSetName='RestartExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( + [Parameter(ParameterSetName='Restart', Mandatory)] [Parameter(ParameterSetName='RestartExpanded', Mandatory)] + [Parameter(ParameterSetName='RestartViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='RestartViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [System.String] # The name of the Kubernetes cluster. ${KubernetesClusterName}, + [Parameter(ParameterSetName='Restart', Mandatory)] [Parameter(ParameterSetName='RestartExpanded', Mandatory)] + [Parameter(ParameterSetName='RestartViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='RestartViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [System.String] # The name of the resource group. # The name is case insensitive. ${ResourceGroupName}, + [Parameter(ParameterSetName='Restart')] [Parameter(ParameterSetName='RestartExpanded')] + [Parameter(ParameterSetName='RestartViaJsonFilePath')] + [Parameter(ParameterSetName='RestartViaJsonString')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] @@ -82,19 +96,39 @@ param( # The value must be an UUID. ${SubscriptionId}, + [Parameter(ParameterSetName='RestartViaIdentity', Mandatory, ValueFromPipeline)] [Parameter(ParameterSetName='RestartViaIdentityExpanded', Mandatory, ValueFromPipeline)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, - [Parameter(Mandatory)] + [Parameter(ParameterSetName='Restart', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='RestartViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterRestartNodeParameters] + # KubernetesClusterRestartNodeParameters represents the body of the request to restart the node of a Kubernetes cluster. + ${KubernetesClusterRestartNodeParameter}, + + [Parameter(ParameterSetName='RestartExpanded', Mandatory)] + [Parameter(ParameterSetName='RestartViaIdentityExpanded', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The name of the node to restart. ${NodeName}, + [Parameter(ParameterSetName='RestartViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Path of Json file supplied to the Restart operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='RestartViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Json string supplied to the Restart operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -169,6 +203,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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() @@ -188,12 +231,14 @@ begin { } $mapping = @{ + Restart = 'Az.NetworkCloud.private\Restart-AzNetworkCloudKubernetesClusterNode_Restart'; RestartExpanded = 'Az.NetworkCloud.private\Restart-AzNetworkCloudKubernetesClusterNode_RestartExpanded'; + RestartViaIdentity = 'Az.NetworkCloud.private\Restart-AzNetworkCloudKubernetesClusterNode_RestartViaIdentity'; RestartViaIdentityExpanded = 'Az.NetworkCloud.private\Restart-AzNetworkCloudKubernetesClusterNode_RestartViaIdentityExpanded'; + RestartViaJsonFilePath = 'Az.NetworkCloud.private\Restart-AzNetworkCloudKubernetesClusterNode_RestartViaJsonFilePath'; + RestartViaJsonString = 'Az.NetworkCloud.private\Restart-AzNetworkCloudKubernetesClusterNode_RestartViaJsonString'; } - if (('RestartExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Restart', 'RestartExpanded', 'RestartViaJsonFilePath', 'RestartViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -207,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/NetworkCloud/NetworkCloud.Autorest/exports/Restart-AzNetworkCloudVirtualMachine.ps1 b/generated/NetworkCloud/NetworkCloud.Autorest/exports/Restart-AzNetworkCloudVirtualMachine.ps1 index 00fbaeef7c9f..7363cef445a0 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/exports/Restart-AzNetworkCloudVirtualMachine.ps1 +++ b/generated/NetworkCloud/NetworkCloud.Autorest/exports/Restart-AzNetworkCloudVirtualMachine.ps1 @@ -87,7 +87,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -164,6 +163,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 { Restart = 'Az.NetworkCloud.private\Restart-AzNetworkCloudVirtualMachine_Restart'; RestartViaIdentity = 'Az.NetworkCloud.private\Restart-AzNetworkCloudVirtualMachine_RestartViaIdentity'; } - if (('Restart') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Restart') -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/NetworkCloud/NetworkCloud.Autorest/exports/Start-AzNetworkCloudBareMetalMachine.ps1 b/generated/NetworkCloud/NetworkCloud.Autorest/exports/Start-AzNetworkCloudBareMetalMachine.ps1 index 27e42a1c489b..ca3a5093138b 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/exports/Start-AzNetworkCloudBareMetalMachine.ps1 +++ b/generated/NetworkCloud/NetworkCloud.Autorest/exports/Start-AzNetworkCloudBareMetalMachine.ps1 @@ -87,7 +87,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -164,6 +163,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 { Start = 'Az.NetworkCloud.private\Start-AzNetworkCloudBareMetalMachine_Start'; StartViaIdentity = 'Az.NetworkCloud.private\Start-AzNetworkCloudBareMetalMachine_StartViaIdentity'; } - if (('Start') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Start') -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/NetworkCloud/NetworkCloud.Autorest/exports/Start-AzNetworkCloudVirtualMachine.ps1 b/generated/NetworkCloud/NetworkCloud.Autorest/exports/Start-AzNetworkCloudVirtualMachine.ps1 index 526cc15c1139..048a2d946df2 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/exports/Start-AzNetworkCloudVirtualMachine.ps1 +++ b/generated/NetworkCloud/NetworkCloud.Autorest/exports/Start-AzNetworkCloudVirtualMachine.ps1 @@ -87,7 +87,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -164,6 +163,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 { Start = 'Az.NetworkCloud.private\Start-AzNetworkCloudVirtualMachine_Start'; StartViaIdentity = 'Az.NetworkCloud.private\Start-AzNetworkCloudVirtualMachine_StartViaIdentity'; } - if (('Start') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Start') -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/NetworkCloud/NetworkCloud.Autorest/exports/Stop-AzNetworkCloudBareMetalMachine.ps1 b/generated/NetworkCloud/NetworkCloud.Autorest/exports/Stop-AzNetworkCloudBareMetalMachine.ps1 index 9e45c5f4de08..ca9b76f139f3 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/exports/Stop-AzNetworkCloudBareMetalMachine.ps1 +++ b/generated/NetworkCloud/NetworkCloud.Autorest/exports/Stop-AzNetworkCloudBareMetalMachine.ps1 @@ -62,6 +62,8 @@ function Stop-AzNetworkCloudBareMetalMachine { [CmdletBinding(DefaultParameterSetName='PowerOffExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='PowerOffExpanded', Mandatory)] + [Parameter(ParameterSetName='PowerOffViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='PowerOffViaJsonString', Mandatory)] [Alias('BareMetalMachineName')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [System.String] @@ -69,6 +71,8 @@ param( ${Name}, [Parameter(ParameterSetName='PowerOffExpanded', Mandatory)] + [Parameter(ParameterSetName='PowerOffViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='PowerOffViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [System.String] # The name of the resource group. @@ -76,6 +80,8 @@ param( ${ResourceGroupName}, [Parameter(ParameterSetName='PowerOffExpanded')] + [Parameter(ParameterSetName='PowerOffViaJsonFilePath')] + [Parameter(ParameterSetName='PowerOffViaJsonString')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] @@ -87,16 +93,28 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineSkipShutdown])] + [Parameter(ParameterSetName='PowerOffExpanded')] + [Parameter(ParameterSetName='PowerOffViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("True", "False")] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineSkipShutdown] + [System.String] # The indicator of whether to skip the graceful OS shutdown and power off the bare metal machine immediately. ${SkipShutdown}, + [Parameter(ParameterSetName='PowerOffViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Path of Json file supplied to the PowerOff operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='PowerOffViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Json string supplied to the PowerOff operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -171,6 +189,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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() @@ -192,10 +219,10 @@ begin { $mapping = @{ PowerOffExpanded = 'Az.NetworkCloud.private\Stop-AzNetworkCloudBareMetalMachine_PowerOffExpanded'; PowerOffViaIdentityExpanded = 'Az.NetworkCloud.private\Stop-AzNetworkCloudBareMetalMachine_PowerOffViaIdentityExpanded'; + PowerOffViaJsonFilePath = 'Az.NetworkCloud.private\Stop-AzNetworkCloudBareMetalMachine_PowerOffViaJsonFilePath'; + PowerOffViaJsonString = 'Az.NetworkCloud.private\Stop-AzNetworkCloudBareMetalMachine_PowerOffViaJsonString'; } - if (('PowerOffExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('PowerOffExpanded', 'PowerOffViaJsonFilePath', 'PowerOffViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -209,6 +236,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/NetworkCloud/NetworkCloud.Autorest/exports/Stop-AzNetworkCloudVirtualMachine.ps1 b/generated/NetworkCloud/NetworkCloud.Autorest/exports/Stop-AzNetworkCloudVirtualMachine.ps1 index 5d8559466ef8..f2d68e134aa3 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/exports/Stop-AzNetworkCloudVirtualMachine.ps1 +++ b/generated/NetworkCloud/NetworkCloud.Autorest/exports/Stop-AzNetworkCloudVirtualMachine.ps1 @@ -62,6 +62,8 @@ function Stop-AzNetworkCloudVirtualMachine { [CmdletBinding(DefaultParameterSetName='PowerOffExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='PowerOffExpanded', Mandatory)] + [Parameter(ParameterSetName='PowerOffViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='PowerOffViaJsonString', Mandatory)] [Alias('VirtualMachineName')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [System.String] @@ -69,6 +71,8 @@ param( ${Name}, [Parameter(ParameterSetName='PowerOffExpanded', Mandatory)] + [Parameter(ParameterSetName='PowerOffViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='PowerOffViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [System.String] # The name of the resource group. @@ -76,6 +80,8 @@ param( ${ResourceGroupName}, [Parameter(ParameterSetName='PowerOffExpanded')] + [Parameter(ParameterSetName='PowerOffViaJsonFilePath')] + [Parameter(ParameterSetName='PowerOffViaJsonString')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] @@ -87,16 +93,28 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.SkipShutdown])] + [Parameter(ParameterSetName='PowerOffExpanded')] + [Parameter(ParameterSetName='PowerOffViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("True", "False")] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.SkipShutdown] + [System.String] # The indicator of whether to skip the graceful OS shutdown and power off the virtual machine immediately. ${SkipShutdown}, + [Parameter(ParameterSetName='PowerOffViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Path of Json file supplied to the PowerOff operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='PowerOffViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Json string supplied to the PowerOff operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -171,6 +189,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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() @@ -192,10 +219,10 @@ begin { $mapping = @{ PowerOffExpanded = 'Az.NetworkCloud.private\Stop-AzNetworkCloudVirtualMachine_PowerOffExpanded'; PowerOffViaIdentityExpanded = 'Az.NetworkCloud.private\Stop-AzNetworkCloudVirtualMachine_PowerOffViaIdentityExpanded'; + PowerOffViaJsonFilePath = 'Az.NetworkCloud.private\Stop-AzNetworkCloudVirtualMachine_PowerOffViaJsonFilePath'; + PowerOffViaJsonString = 'Az.NetworkCloud.private\Stop-AzNetworkCloudVirtualMachine_PowerOffViaJsonString'; } - if (('PowerOffExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('PowerOffExpanded', 'PowerOffViaJsonFilePath', 'PowerOffViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -209,6 +236,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/NetworkCloud/NetworkCloud.Autorest/exports/Update-AzNetworkCloudAgentPool.ps1 b/generated/NetworkCloud/NetworkCloud.Autorest/exports/Update-AzNetworkCloudAgentPool.ps1 index 0299ed211c87..c3952618ef29 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/exports/Update-AzNetworkCloudAgentPool.ps1 +++ b/generated/NetworkCloud/NetworkCloud.Autorest/exports/Update-AzNetworkCloudAgentPool.ps1 @@ -17,17 +17,17 @@ <# .Synopsis Patch the properties of the provided Kubernetes cluster agent pool, or update the tags associated with the Kubernetes cluster agent pool. -Properties and tag updates can be done independently. +Properties and tag update can be done independently. .Description Patch the properties of the provided Kubernetes cluster agent pool, or update the tags associated with the Kubernetes cluster agent pool. -Properties and tag updates can be done independently. +Properties and tag update can be done independently. .Example Update-AzNetworkCloudAgentPool -Name agentPoolName -KubernetesClusterName clusterName -ResourceGroupName resourceGroup -Count updatedCount -Tag @{tags = "newTag"} -UpgradeSettingMaxSurge updatedMaxSurge .Inputs Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPool +Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPool .Notes COMPLEX PARAMETER PROPERTIES @@ -59,20 +59,49 @@ INPUTOBJECT : Identity Parameter [TrunkedNetworkName ]: The name of the trunked network. [VirtualMachineName ]: The name of the virtual machine. [VolumeName ]: The name of the volume. + +KUBERNETESCLUSTERINPUTOBJECT : Identity Parameter + [AgentPoolName ]: The name of the Kubernetes cluster agent pool. + [BareMetalMachineKeySetName ]: The name of the bare metal machine key set. + [BareMetalMachineName ]: The name of the bare metal machine. + [BmcKeySetName ]: The name of the baseboard management controller key set. + [CloudServicesNetworkName ]: The name of the cloud services network. + [ClusterManagerName ]: The name of the cluster manager. + [ClusterName ]: The name of the cluster. + [ConsoleName ]: The name of the virtual machine console. + [FeatureName ]: The name of the feature. + [Id ]: Resource identity path + [KubernetesClusterName ]: The name of the Kubernetes cluster. + [L2NetworkName ]: The name of the L2 network. + [L3NetworkName ]: The name of the L3 network. + [MetricsConfigurationName ]: The name of the metrics configuration for the cluster. + [RackName ]: The name of the rack. + [RackSkuName ]: The name of the rack SKU. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [StorageApplianceName ]: The name of the storage appliance. + [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. + [TrunkedNetworkName ]: The name of the trunked network. + [VirtualMachineName ]: The name of the virtual machine. + [VolumeName ]: The name of the volume. .Link https://learn.microsoft.com/powershell/module/az.networkcloud/update-aznetworkcloudagentpool #> function Update-AzNetworkCloudAgentPool { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPool])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPool])] [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.NetworkCloud.Category('Path')] [System.String] # The name of the Kubernetes cluster. ${KubernetesClusterName}, [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaIdentityKubernetesClusterExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [Alias('AgentPoolName')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [System.String] @@ -80,6 +109,8 @@ param( ${Name}, [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [System.String] # The name of the resource group. @@ -87,6 +118,8 @@ param( ${ResourceGroupName}, [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaJsonFilePath')] + [Parameter(ParameterSetName='UpdateViaJsonString')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] @@ -98,9 +131,14 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, + [Parameter(ParameterSetName='UpdateViaIdentityKubernetesClusterExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] + # Identity Parameter + ${KubernetesClusterInputObject}, + [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Header')] [System.String] @@ -116,35 +154,44 @@ param( # Other values will result in error from server as they are not supported. ${IfNoneMatch}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityKubernetesClusterExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey[]] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISshPublicKey[]] # SshPublicKey represents the public key used to authenticate with a resource through SSH. - # To construct, see NOTES section for ADMINISTRATORCONFIGURATIONSSHPUBLICKEY properties and create a hash table. ${AdministratorConfigurationSshPublicKey}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityKubernetesClusterExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.Int64] # The number of virtual machines that use this configuration. ${Count}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityKubernetesClusterExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPatchParametersTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPatchParametersTags]))] [System.Collections.Hashtable] # The Azure resource tags that will replace the existing ones. ${Tag}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityKubernetesClusterExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.Int64] # The maximum time in seconds that is allowed for a node drain to complete before proceeding with the upgrade of the agent pool. # If not specified during creation, a value of 1800 seconds is used. ${UpgradeSettingDrainTimeout}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityKubernetesClusterExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The maximum number or percentage of nodes that are surged during upgrade. @@ -157,7 +204,9 @@ param( # One of MaxSurge and MaxUnavailable must be greater than 0. ${UpgradeSettingMaxSurge}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityKubernetesClusterExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The maximum number or percentage of nodes that can be unavailable during upgrade. @@ -170,6 +219,18 @@ param( # One of MaxSurge and MaxUnavailable must be greater than 0. ${UpgradeSettingMaxUnavailable}, + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Path of Json file supplied to the Update operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Json string supplied to the Update operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -238,6 +299,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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() @@ -259,10 +329,11 @@ begin { $mapping = @{ UpdateExpanded = 'Az.NetworkCloud.private\Update-AzNetworkCloudAgentPool_UpdateExpanded'; UpdateViaIdentityExpanded = 'Az.NetworkCloud.private\Update-AzNetworkCloudAgentPool_UpdateViaIdentityExpanded'; + UpdateViaIdentityKubernetesClusterExpanded = 'Az.NetworkCloud.private\Update-AzNetworkCloudAgentPool_UpdateViaIdentityKubernetesClusterExpanded'; + UpdateViaJsonFilePath = 'Az.NetworkCloud.private\Update-AzNetworkCloudAgentPool_UpdateViaJsonFilePath'; + UpdateViaJsonString = 'Az.NetworkCloud.private\Update-AzNetworkCloudAgentPool_UpdateViaJsonString'; } - if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 { @@ -276,6 +347,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/NetworkCloud/NetworkCloud.Autorest/exports/Update-AzNetworkCloudBareMetalMachine.ps1 b/generated/NetworkCloud/NetworkCloud.Autorest/exports/Update-AzNetworkCloudBareMetalMachine.ps1 index 9f7e8c3495fd..e38f6696db13 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/exports/Update-AzNetworkCloudBareMetalMachine.ps1 +++ b/generated/NetworkCloud/NetworkCloud.Autorest/exports/Update-AzNetworkCloudBareMetalMachine.ps1 @@ -17,17 +17,17 @@ <# .Synopsis Patch properties of the provided bare metal machine, or update tags associated with the bare metal machine. -Properties and tag updates can be done independently. +Properties and tag update can be done independently. .Description Patch properties of the provided bare metal machine, or update tags associated with the bare metal machine. -Properties and tag updates can be done independently. +Properties and tag update can be done independently. .Example Update-AzNetworkCloudBareMetalMachine -Name bmmName -ResourceGroupName resourceGroupName -SubscriptionId subscriptionId -Tag @{tags = "tag1"} -MachineDetail machineDetailInfo .Inputs Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachine +Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachine .Notes COMPLEX PARAMETER PROPERTIES @@ -60,10 +60,12 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.networkcloud/update-aznetworkcloudbaremetalmachine #> function Update-AzNetworkCloudBareMetalMachine { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachine])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachine])] [CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [Alias('BareMetalMachineName')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [System.String] @@ -71,6 +73,8 @@ param( ${Name}, [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [System.String] # The name of the resource group. @@ -78,6 +82,8 @@ param( ${ResourceGroupName}, [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaJsonFilePath')] + [Parameter(ParameterSetName='UpdateViaJsonString')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] @@ -89,7 +95,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -107,19 +112,33 @@ param( # Other values will result in error from server as they are not supported. ${IfNoneMatch}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The details provided by the customer during the creation of rack manifests that allows for custom data to be associated with this machine. ${MachineDetail}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePatchParametersTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePatchParametersTags]))] [System.Collections.Hashtable] # The Azure resource tags that will replace the existing ones. ${Tag}, + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Path of Json file supplied to the Update operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Json string supplied to the Update operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -188,6 +207,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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() @@ -209,10 +237,10 @@ begin { $mapping = @{ UpdateExpanded = 'Az.NetworkCloud.private\Update-AzNetworkCloudBareMetalMachine_UpdateExpanded'; UpdateViaIdentityExpanded = 'Az.NetworkCloud.private\Update-AzNetworkCloudBareMetalMachine_UpdateViaIdentityExpanded'; + UpdateViaJsonFilePath = 'Az.NetworkCloud.private\Update-AzNetworkCloudBareMetalMachine_UpdateViaJsonFilePath'; + UpdateViaJsonString = 'Az.NetworkCloud.private\Update-AzNetworkCloudBareMetalMachine_UpdateViaJsonString'; } - if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 { @@ -226,6 +254,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/NetworkCloud/NetworkCloud.Autorest/exports/Update-AzNetworkCloudBareMetalMachineKeySet.ps1 b/generated/NetworkCloud/NetworkCloud.Autorest/exports/Update-AzNetworkCloudBareMetalMachineKeySet.ps1 index 9dfd474c3e31..a70236b23ab8 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/exports/Update-AzNetworkCloudBareMetalMachineKeySet.ps1 +++ b/generated/NetworkCloud/NetworkCloud.Autorest/exports/Update-AzNetworkCloudBareMetalMachineKeySet.ps1 @@ -17,10 +17,10 @@ <# .Synopsis Patch properties of bare metal machine key set for the provided cluster, or update the tags associated with it. -Properties and tag updates can be done independently. +Properties and tag update can be done independently. .Description Patch properties of bare metal machine key set for the provided cluster, or update the tags associated with it. -Properties and tag updates can be done independently. +Properties and tag update can be done independently. .Example $tagHash = @{ tag = "tagUpdate" @@ -42,12 +42,36 @@ Update-AzNetworkCloudBareMetalMachineKeySet -ResourceGroupName resourceGroupName .Inputs Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySet +Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySet .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. +CLUSTERINPUTOBJECT : Identity Parameter + [AgentPoolName ]: The name of the Kubernetes cluster agent pool. + [BareMetalMachineKeySetName ]: The name of the bare metal machine key set. + [BareMetalMachineName ]: The name of the bare metal machine. + [BmcKeySetName ]: The name of the baseboard management controller key set. + [CloudServicesNetworkName ]: The name of the cloud services network. + [ClusterManagerName ]: The name of the cluster manager. + [ClusterName ]: The name of the cluster. + [ConsoleName ]: The name of the virtual machine console. + [FeatureName ]: The name of the feature. + [Id ]: Resource identity path + [KubernetesClusterName ]: The name of the Kubernetes cluster. + [L2NetworkName ]: The name of the L2 network. + [L3NetworkName ]: The name of the L3 network. + [MetricsConfigurationName ]: The name of the metrics configuration for the cluster. + [RackName ]: The name of the rack. + [RackSkuName ]: The name of the rack SKU. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [StorageApplianceName ]: The name of the storage appliance. + [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. + [TrunkedNetworkName ]: The name of the trunked network. + [VirtualMachineName ]: The name of the virtual machine. + [VolumeName ]: The name of the volume. + INPUTOBJECT : Identity Parameter [AgentPoolName ]: The name of the Kubernetes cluster agent pool. [BareMetalMachineKeySetName ]: The name of the bare metal machine key set. @@ -81,16 +105,21 @@ USERLIST : The unique list of permitted users. https://learn.microsoft.com/powershell/module/az.networkcloud/update-aznetworkcloudbaremetalmachinekeyset #> function Update-AzNetworkCloudBareMetalMachineKeySet { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySet])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySet])] [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.NetworkCloud.Category('Path')] [System.String] # The name of the cluster. ${ClusterName}, [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaIdentityClusterExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [Alias('BareMetalMachineKeySetName')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [System.String] @@ -98,6 +127,8 @@ param( ${Name}, [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [System.String] # The name of the resource group. @@ -105,6 +136,8 @@ param( ${ResourceGroupName}, [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaJsonFilePath')] + [Parameter(ParameterSetName='UpdateViaJsonString')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] @@ -112,11 +145,16 @@ param( # The value must be an UUID. ${SubscriptionId}, + [Parameter(ParameterSetName='UpdateViaIdentityClusterExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] + # Identity Parameter + ${ClusterInputObject}, + [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -134,34 +172,53 @@ param( # Other values will result in error from server as they are not supported. ${IfNoneMatch}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityClusterExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.DateTime] # The date and time after which the users in this key set will be removed from the bare metal machines. ${Expiration}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityClusterExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String[]] # The list of IP addresses of jump hosts with management network access from which a login will be allowed for the users. ${JumpHostsAllowed}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityClusterExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetPatchParametersTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetPatchParametersTags]))] [System.Collections.Hashtable] # The Azure resource tags that will replace the existing ones. ${Tag}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityClusterExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKeySetUser[]] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKeySetUser[]] # The unique list of permitted users. - # To construct, see NOTES section for USERLIST properties and create a hash table. ${UserList}, + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Path of Json file supplied to the Update operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Json string supplied to the Update operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -230,6 +287,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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() @@ -250,11 +316,12 @@ begin { $mapping = @{ UpdateExpanded = 'Az.NetworkCloud.private\Update-AzNetworkCloudBareMetalMachineKeySet_UpdateExpanded'; + UpdateViaIdentityClusterExpanded = 'Az.NetworkCloud.private\Update-AzNetworkCloudBareMetalMachineKeySet_UpdateViaIdentityClusterExpanded'; UpdateViaIdentityExpanded = 'Az.NetworkCloud.private\Update-AzNetworkCloudBareMetalMachineKeySet_UpdateViaIdentityExpanded'; + UpdateViaJsonFilePath = 'Az.NetworkCloud.private\Update-AzNetworkCloudBareMetalMachineKeySet_UpdateViaJsonFilePath'; + UpdateViaJsonString = 'Az.NetworkCloud.private\Update-AzNetworkCloudBareMetalMachineKeySet_UpdateViaJsonString'; } - if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 { @@ -268,6 +335,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/NetworkCloud/NetworkCloud.Autorest/exports/Update-AzNetworkCloudBmcKeySet.ps1 b/generated/NetworkCloud/NetworkCloud.Autorest/exports/Update-AzNetworkCloudBmcKeySet.ps1 index 1de5231904d0..1d790e86888f 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/exports/Update-AzNetworkCloudBmcKeySet.ps1 +++ b/generated/NetworkCloud/NetworkCloud.Autorest/exports/Update-AzNetworkCloudBmcKeySet.ps1 @@ -17,10 +17,10 @@ <# .Synopsis Patch properties of baseboard management controller key set for the provided cluster, or update the tags associated with it. -Properties and tag updates can be done independently. +Properties and tag update can be done independently. .Description Patch properties of baseboard management controller key set for the provided cluster, or update the tags associated with it. -Properties and tag updates can be done independently. +Properties and tag update can be done independently. .Example $tagHash = @{ tag = "tagUpdate" @@ -42,12 +42,36 @@ Update-AzNetworkCloudBmcKeySet -ResourceGroupName resourceGroupName -Name basebo .Inputs Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySet +Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySet .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. +CLUSTERINPUTOBJECT : Identity Parameter + [AgentPoolName ]: The name of the Kubernetes cluster agent pool. + [BareMetalMachineKeySetName ]: The name of the bare metal machine key set. + [BareMetalMachineName ]: The name of the bare metal machine. + [BmcKeySetName ]: The name of the baseboard management controller key set. + [CloudServicesNetworkName ]: The name of the cloud services network. + [ClusterManagerName ]: The name of the cluster manager. + [ClusterName ]: The name of the cluster. + [ConsoleName ]: The name of the virtual machine console. + [FeatureName ]: The name of the feature. + [Id ]: Resource identity path + [KubernetesClusterName ]: The name of the Kubernetes cluster. + [L2NetworkName ]: The name of the L2 network. + [L3NetworkName ]: The name of the L3 network. + [MetricsConfigurationName ]: The name of the metrics configuration for the cluster. + [RackName ]: The name of the rack. + [RackSkuName ]: The name of the rack SKU. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [StorageApplianceName ]: The name of the storage appliance. + [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. + [TrunkedNetworkName ]: The name of the trunked network. + [VirtualMachineName ]: The name of the virtual machine. + [VolumeName ]: The name of the volume. + INPUTOBJECT : Identity Parameter [AgentPoolName ]: The name of the Kubernetes cluster agent pool. [BareMetalMachineKeySetName ]: The name of the bare metal machine key set. @@ -81,16 +105,21 @@ USERLIST : The unique list of permitted users. https://learn.microsoft.com/powershell/module/az.networkcloud/update-aznetworkcloudbmckeyset #> function Update-AzNetworkCloudBmcKeySet { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySet])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySet])] [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.NetworkCloud.Category('Path')] [System.String] # The name of the cluster. ${ClusterName}, [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaIdentityClusterExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [Alias('BmcKeySetName')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [System.String] @@ -98,6 +127,8 @@ param( ${Name}, [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [System.String] # The name of the resource group. @@ -105,6 +136,8 @@ param( ${ResourceGroupName}, [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaJsonFilePath')] + [Parameter(ParameterSetName='UpdateViaJsonString')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] @@ -112,11 +145,16 @@ param( # The value must be an UUID. ${SubscriptionId}, + [Parameter(ParameterSetName='UpdateViaIdentityClusterExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] + # Identity Parameter + ${ClusterInputObject}, + [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -134,27 +172,44 @@ param( # Other values will result in error from server as they are not supported. ${IfNoneMatch}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityClusterExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.DateTime] # The date and time after which the users in this key set will be removed from the baseboard management controllers. ${Expiration}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityClusterExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetPatchParametersTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetPatchParametersTags]))] [System.Collections.Hashtable] # The Azure resource tags that will replace the existing ones. ${Tag}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityClusterExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKeySetUser[]] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKeySetUser[]] # The unique list of permitted users. - # To construct, see NOTES section for USERLIST properties and create a hash table. ${UserList}, + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Path of Json file supplied to the Update operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Json string supplied to the Update operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -223,6 +278,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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() @@ -243,11 +307,12 @@ begin { $mapping = @{ UpdateExpanded = 'Az.NetworkCloud.private\Update-AzNetworkCloudBmcKeySet_UpdateExpanded'; + UpdateViaIdentityClusterExpanded = 'Az.NetworkCloud.private\Update-AzNetworkCloudBmcKeySet_UpdateViaIdentityClusterExpanded'; UpdateViaIdentityExpanded = 'Az.NetworkCloud.private\Update-AzNetworkCloudBmcKeySet_UpdateViaIdentityExpanded'; + UpdateViaJsonFilePath = 'Az.NetworkCloud.private\Update-AzNetworkCloudBmcKeySet_UpdateViaJsonFilePath'; + UpdateViaJsonString = 'Az.NetworkCloud.private\Update-AzNetworkCloudBmcKeySet_UpdateViaJsonString'; } - if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 { @@ -261,6 +326,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/NetworkCloud/NetworkCloud.Autorest/exports/Update-AzNetworkCloudCluster.ps1 b/generated/NetworkCloud/NetworkCloud.Autorest/exports/Update-AzNetworkCloudCluster.ps1 index 6cb83c125319..93369ec58a2d 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/exports/Update-AzNetworkCloudCluster.ps1 +++ b/generated/NetworkCloud/NetworkCloud.Autorest/exports/Update-AzNetworkCloudCluster.ps1 @@ -16,15 +16,13 @@ <# .Synopsis -Patch the properties of the provided cluster, or update the tags associated with the cluster. -Properties and tag updates can be done independently. +Update a new cluster or update the properties of the cluster if it exists. .Description -Patch the properties of the provided cluster, or update the tags associated with the cluster. -Properties and tag updates can be done independently. +Update a new cluster or update the properties of the cluster if it exists. .Example $storageapplianceconfigurationdata = @() $baremetalmachineconfigurationdata = @() -$computerackdefinition = @(@{IRackDefinition = "The list of rack definitions for the compute racks in a multi-rackcluster, or an empty list in a single-rack cluster."}) +$computerackdefinition = @(@{IRackDefinition = "The list of rack definitions for the compute racks in a multi-rack cluster, or an empty list in a single-rack cluster."}) $tagHash = @{ tag = "tag" tagUpdate = "tagUpdate" @@ -41,17 +39,15 @@ $tagHash = @{ tagUpdate = "tagUpdate" } $securePassword = ConvertTo-SecureString "password" -asplaintext -force -$identityUserAssignedIdentity = @{} $userAssignedIdentityResourceId = "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myManagedIdentity" -$identityUserAssignedIdentity.Add($userAssignedIdentityResourceId, @{}) -Update-AzNetworkCloudCluster -ResourceGroupName resourceGroup -Name clusterName -AggregatorOrSingleRackDefinitionNetworkRackId rackId -AggregatorOrSingleRackDefinitionRackSerialNumber sr1234 -AggregatorOrSingleRackDefinitionRackSkuId rackSku -IdentityType identityType -IdentityUserAssignedIdentity $identityUserAssignedIdentity -SubscriptionId subscriptionId -AggregatorOrSingleRackDefinitionAvailabilityZone availabilityZone -AggregatorOrSingleRackDefinitionBareMetalMachineConfiguration $baremetalmachineconfigurationdata -AggregatorOrSingleRackDefinitionRackLocation rackLocation -AggregatorOrSingleRackDefinitionStorageApplianceConfiguration $storageapplianceconfigurationdata -AnalyticsOutputSettingsAssociatedIdentityType identityType -AnalyticsOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId userAssignedIdentityResourceId -AnalyticOutputSettingAnalyticsWorkspaceId analyticsWorkspaceId -CommandOutputSettingContainerUrl containerUrl -AssociatedIdentityType commandOutputSettingsIdentityType -AssociatedIdentityUserAssignedIdentityResourceId commandOutputSettingsUserAssignedIdentityResourceId -ClusterServicePrincipalApplicationId clusterServicePrincipalAppId -ClusterServicePrincipalId ClusterServicePrincipalId -ClusterServicePrincipalPassword $securePassword -ClusterServicePrincipalTenantId tenantId -ComputeRackDefinition $computerackdefinition -SecretArchiveKeyVaultId keyVaultId -SecretArchiveSettingVaultUri keyVaultUri -SecretArchiveSettingsAssociatedIdentityType identityType -SecretArchiveSettingsAssociatedIdentityUserAssignedIdentityResourceId userAssignedIdentityResourceId -SecretArchiveUseKeyVault useKeyVault -UpdateStrategyThresholdType updateStrategyThresholdType -UpdateStrategyThresholdValue updateStrategyThresholdValue -UpdateStrategyType updateStrategyType -UpdateStrategyWaitTimeMinute updateStrategyWaitTimeMinutes -VulnerabilityScanningSettingContainerScan vulnerabilityScanningSettingContainerScan -ComputeDeploymentThresholdGrouping computeDeploymentThresholdGrouping -ComputeDeploymentThresholdType computeDeploymentThresholdType -ComputeDeploymentThresholdValue computeDeploymentThresholdValue -Tag $tagHash +Update-AzNetworkCloudCluster -ResourceGroupName resourceGroup -Name clusterName -AggregatorOrSingleRackDefinitionNetworkRackId rackId -AggregatorOrSingleRackDefinitionRackSerialNumber sr1234 -AggregatorOrSingleRackDefinitionRackSkuId rackSku -UserAssignedIdentity $userAssignedIdentityResourceId -SubscriptionId subscriptionId -AggregatorOrSingleRackDefinitionAvailabilityZone availabilityZone -AggregatorOrSingleRackDefinitionBareMetalMachineConfiguration $baremetalmachineconfigurationdata -AggregatorOrSingleRackDefinitionRackLocation rackLocation -AggregatorOrSingleRackDefinitionStorageApplianceConfiguration $storageapplianceconfigurationdata -AnalyticsOutputSettingsAssociatedIdentityType identityType -AnalyticsOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId userAssignedIdentityResourceId -AnalyticOutputSettingAnalyticsWorkspaceId analyticsWorkspaceId -CommandOutputSettingContainerUrl containerUrl -AssociatedIdentityType commandOutputSettingsIdentityType -AssociatedIdentityUserAssignedIdentityResourceId commandOutputSettingsUserAssignedIdentityResourceId -ClusterServicePrincipalApplicationId clusterServicePrincipalAppId -ClusterServicePrincipalId ClusterServicePrincipalId -ClusterServicePrincipalPassword $securePassword -ClusterServicePrincipalTenantId tenantId -ComputeRackDefinition $computerackdefinition -SecretArchiveKeyVaultId keyVaultId -SecretArchiveSettingVaultUri keyVaultUri -SecretArchiveSettingsAssociatedIdentityType identityType -SecretArchiveSettingsAssociatedIdentityUserAssignedIdentityResourceId userAssignedIdentityResourceId -SecretArchiveUseKeyVault useKeyVault -UpdateStrategyThresholdType updateStrategyThresholdType -UpdateStrategyThresholdValue updateStrategyThresholdValue -UpdateStrategyType updateStrategyType -UpdateStrategyWaitTimeMinute updateStrategyWaitTimeMinutes -VulnerabilityScanningSettingContainerScan vulnerabilityScanningSettingContainerScan -ComputeDeploymentThresholdGrouping computeDeploymentThresholdGrouping -ComputeDeploymentThresholdType computeDeploymentThresholdType -ComputeDeploymentThresholdValue computeDeploymentThresholdValue -Tag $tagHash .Inputs Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICluster +Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICluster .Notes COMPLEX PARAMETER PROPERTIES @@ -79,7 +75,7 @@ COMPUTERACKDEFINITION : The list of rack definitions for the RackSerialNumber : The unique identifier for the rack within Network Cloud cluster. An alternate unique alphanumeric value other than a serial number may be provided if desired. RackSkuId : The resource ID of the sku for the rack being added. [AvailabilityZone ]: The zone name used for this rack when created. Availability zones are used for workload placement. - [BareMetalMachineConfigurationData ]: The unordered list of bare metal machine configuration. + [BareMetalMachineConfigurationData >]: The unordered list of bare metal machine configuration. BmcCredentialsPassword : The password of the administrator of the device used during initialization. BmcCredentialsUsername : The username of the administrator of the device used during initialization. BmcMacAddress : The MAC address of the BMC for this machine. @@ -89,7 +85,7 @@ COMPUTERACKDEFINITION : The list of rack definitions for the [MachineDetail ]: The free-form additional information about the machine, e.g. an asset tag. [MachineName ]: The user-provided name for the bare metal machine created from this specification. If not provided, the machine name will be generated programmatically. [RackLocation ]: The free-form description of the rack's location. - [StorageApplianceConfigurationData ]: The list of storage appliance configuration data for this rack. + [StorageApplianceConfigurationData >]: The list of storage appliance configuration data for this rack. AdminCredentialsPassword : The password of the administrator of the device used during initialization. AdminCredentialsUsername : The username of the administrator of the device used during initialization. RackSlot : The slot that storage appliance is in the rack based on the BOM configuration. @@ -123,7 +119,7 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.networkcloud/update-aznetworkcloudcluster #> function Update-AzNetworkCloudCluster { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICluster])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICluster])] [CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] @@ -152,7 +148,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -180,9 +175,8 @@ param( [Parameter()] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineConfigurationData[]] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineConfigurationData[]] # The unordered list of bare metal machine configuration. - # To construct, see NOTES section for AGGREGATORORSINGLERACKDEFINITIONBAREMETALMACHINECONFIGURATION properties and create a hash table. ${AggregatorOrSingleRackDefinitionBareMetalMachineConfiguration}, [Parameter()] @@ -213,9 +207,8 @@ param( [Parameter()] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceConfigurationData[]] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceConfigurationData[]] # The list of storage appliance configuration data for this rack. - # To construct, see NOTES section for AGGREGATORORSINGLERACKDEFINITIONSTORAGEAPPLIANCECONFIGURATION properties and create a hash table. ${AggregatorOrSingleRackDefinitionStorageApplianceConfiguration}, [Parameter()] @@ -225,9 +218,9 @@ param( ${AnalyticOutputSettingAnalyticsWorkspaceId}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType])] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("SystemAssignedIdentity", "UserAssignedIdentity")] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType] + [System.String] # The type of managed identity that is being selected. ${AnalyticsOutputSettingsAssociatedIdentityType}, @@ -239,9 +232,9 @@ param( ${AnalyticsOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType])] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("SystemAssignedIdentity", "UserAssignedIdentity")] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType] + [System.String] # The type of associated identity for CommandOutputSettings. ${AssociatedIdentityType}, @@ -288,16 +281,16 @@ param( ${CommandOutputSettingContainerUrl}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdGrouping])] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("PerCluster", "PerRack")] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdGrouping] + [System.String] # Selection of how the type evaluation is applied to the cluster calculation. ${ComputeDeploymentThresholdGrouping}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdType])] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("CountSuccess", "PercentSuccess")] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdType] + [System.String] # Selection of how the threshold should be evaluated. ${ComputeDeploymentThresholdType}, @@ -310,31 +303,20 @@ param( [Parameter()] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackDefinition[]] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackDefinition[]] # The list of rack definitions for the compute racks in a multi-rack cluster, or an empty list in a single-rack cluster. - # To construct, see NOTES section for COMPUTERACKDEFINITION properties and create a hash table. ${ComputeRackDefinition}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentityType])] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentityType] - # Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). - ${IdentityType}, + [System.Nullable[System.Boolean]] + # Determines whether to enable a system-assigned identity for the resource. + ${EnableSystemAssignedIdentity}, [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Audit", "Disabled", "OnDemand", "Passive", "RealTime")] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.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()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RuntimeProtectionEnforcementLevel])] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RuntimeProtectionEnforcementLevel] + [System.String] # The mode of operation for runtime protection. ${RuntimeProtectionConfigurationEnforcementLevel}, @@ -351,9 +333,9 @@ param( ${SecretArchiveSettingVaultUri}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType])] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("SystemAssignedIdentity", "UserAssignedIdentity")] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType] + [System.String] # The type of managed identity that is being selected. ${SecretArchiveSettingsAssociatedIdentityType}, @@ -365,17 +347,17 @@ param( ${SecretArchiveSettingsAssociatedIdentityUserAssignedIdentityResourceId}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterSecretArchiveEnabled])] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("True", "False")] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterSecretArchiveEnabled] + [System.String] # The indicator if the specified key vault should be used to archive the secrets of the cluster. ${SecretArchiveUseKeyVault}, [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceTags]))] [System.Collections.Hashtable] - # The Azure resource tags that will replace the existing ones. + # Resource tags. ${Tag}, [Parameter()] @@ -386,9 +368,9 @@ param( ${UpdateStrategyMaxUnavailable}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdType])] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("CountSuccess", "PercentSuccess")] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdType] + [System.String] # Selection of how the threshold should be evaluated. ${UpdateStrategyThresholdType}, @@ -399,9 +381,9 @@ param( ${UpdateStrategyThresholdValue}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterUpdateStrategyType])] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Rack", "PauseAfterRack")] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterUpdateStrategyType] + [System.String] # The mode of operation for runtime protection. ${UpdateStrategyType}, @@ -412,9 +394,17 @@ param( ${UpdateStrategyWaitTimeMinute}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VulnerabilityScanningSettingsContainerScan])] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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()] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Disabled", "Enabled")] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VulnerabilityScanningSettingsContainerScan] + [System.String] # The mode selection for container vulnerability scanning. ${VulnerabilityScanningSettingContainerScan}, @@ -486,6 +476,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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() @@ -508,9 +507,7 @@ begin { UpdateExpanded = 'Az.NetworkCloud.private\Update-AzNetworkCloudCluster_UpdateExpanded'; UpdateViaIdentityExpanded = 'Az.NetworkCloud.private\Update-AzNetworkCloudCluster_UpdateViaIdentityExpanded'; } - if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 { @@ -524,6 +521,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/NetworkCloud/NetworkCloud.Autorest/exports/Update-AzNetworkCloudClusterManager.ps1 b/generated/NetworkCloud/NetworkCloud.Autorest/exports/Update-AzNetworkCloudClusterManager.ps1 index de06bdc906ec..cec735208bc8 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/exports/Update-AzNetworkCloudClusterManager.ps1 +++ b/generated/NetworkCloud/NetworkCloud.Autorest/exports/Update-AzNetworkCloudClusterManager.ps1 @@ -16,11 +16,9 @@ <# .Synopsis -Patch properties of the provided cluster manager, or update the tags assigned to the cluster manager. -Properties and tag updates can be done independently. +Update a new cluster manager or update properties of the cluster manager if it exists. .Description -Patch properties of the provided cluster manager, or update the tags assigned to the cluster manager. -Properties and tag updates can be done independently. +Update a new cluster manager or update properties of the cluster manager if it exists. .Example $tagUpdatedHash = @{ tag1 = "tag1" @@ -32,7 +30,7 @@ Update-AzNetworkCloudClusterManager -ResourceGroupName resourceGroupName -Subscr .Inputs Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManager +Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManager .Notes COMPLEX PARAMETER PROPERTIES @@ -65,7 +63,7 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.networkcloud/update-aznetworkcloudclustermanager #> function Update-AzNetworkCloudClusterManager { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManager])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManager])] [CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] @@ -94,7 +92,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -113,27 +110,25 @@ param( ${IfNoneMatch}, [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentityType])] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentityType] - # Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). - ${IdentityType}, + [System.Nullable[System.Boolean]] + # Determines whether to enable a system-assigned identity for the resource. + ${EnableSystemAssignedIdentity}, [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IUserAssignedIdentities]))] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceTags]))] [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}, + # Resource tags. + ${Tag}, [Parameter()] + [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerPatchParametersTags]))] - [System.Collections.Hashtable] - # The Azure resource tags that will replace the existing ones. - ${Tag}, + [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()] [Alias('AzureRMContext', 'AzureCredential')] @@ -144,6 +139,12 @@ param( # Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription. ${DefaultProfile}, + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Runtime')] [System.Management.Automation.SwitchParameter] @@ -164,6 +165,12 @@ param( # SendAsync Pipeline Steps to be prepended to the front of the pipeline ${HttpPipelinePrepend}, + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + [Parameter(DontShow)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Runtime')] [System.Uri] @@ -191,6 +198,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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() @@ -213,9 +229,7 @@ begin { UpdateExpanded = 'Az.NetworkCloud.private\Update-AzNetworkCloudClusterManager_UpdateExpanded'; UpdateViaIdentityExpanded = 'Az.NetworkCloud.private\Update-AzNetworkCloudClusterManager_UpdateViaIdentityExpanded'; } - if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 { @@ -229,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/NetworkCloud/NetworkCloud.Autorest/exports/Update-AzNetworkCloudConsole.ps1 b/generated/NetworkCloud/NetworkCloud.Autorest/exports/Update-AzNetworkCloudConsole.ps1 index ecf5ac998c54..e05a9510a334 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/exports/Update-AzNetworkCloudConsole.ps1 +++ b/generated/NetworkCloud/NetworkCloud.Autorest/exports/Update-AzNetworkCloudConsole.ps1 @@ -17,10 +17,10 @@ <# .Synopsis Patch the properties of the provided virtual machine console, or update the tags associated with the virtual machine console. -Properties and tag updates can be done independently. +Properties and tag update can be done independently. .Description Patch the properties of the provided virtual machine console, or update the tags associated with the virtual machine console. -Properties and tag updates can be done independently. +Properties and tag update can be done independently. .Example $tagUpdatedHash = @{ tag1 = "tag1" @@ -32,7 +32,7 @@ Update-AzNetworkCloudConsole -ResourceGroupName resourceGroupName -VirtualMachin .Inputs Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsole +Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsole .Notes COMPLEX PARAMETER PROPERTIES @@ -61,14 +61,41 @@ INPUTOBJECT : Identity Parameter [TrunkedNetworkName ]: The name of the trunked network. [VirtualMachineName ]: The name of the virtual machine. [VolumeName ]: The name of the volume. + +VIRTUALMACHINEINPUTOBJECT : Identity Parameter + [AgentPoolName ]: The name of the Kubernetes cluster agent pool. + [BareMetalMachineKeySetName ]: The name of the bare metal machine key set. + [BareMetalMachineName ]: The name of the bare metal machine. + [BmcKeySetName ]: The name of the baseboard management controller key set. + [CloudServicesNetworkName ]: The name of the cloud services network. + [ClusterManagerName ]: The name of the cluster manager. + [ClusterName ]: The name of the cluster. + [ConsoleName ]: The name of the virtual machine console. + [FeatureName ]: The name of the feature. + [Id ]: Resource identity path + [KubernetesClusterName ]: The name of the Kubernetes cluster. + [L2NetworkName ]: The name of the L2 network. + [L3NetworkName ]: The name of the L3 network. + [MetricsConfigurationName ]: The name of the metrics configuration for the cluster. + [RackName ]: The name of the rack. + [RackSkuName ]: The name of the rack SKU. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [StorageApplianceName ]: The name of the storage appliance. + [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. + [TrunkedNetworkName ]: The name of the trunked network. + [VirtualMachineName ]: The name of the virtual machine. + [VolumeName ]: The name of the volume. .Link https://learn.microsoft.com/powershell/module/az.networkcloud/update-aznetworkcloudconsole #> function Update-AzNetworkCloudConsole { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsole])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsole])] [CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaIdentityVirtualMachineExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [Alias('ConsoleName')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [System.String] @@ -76,6 +103,8 @@ param( ${Name}, [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [System.String] # The name of the resource group. @@ -83,6 +112,8 @@ param( ${ResourceGroupName}, [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaJsonFilePath')] + [Parameter(ParameterSetName='UpdateViaJsonString')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] @@ -91,6 +122,8 @@ param( ${SubscriptionId}, [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [System.String] # The name of the virtual machine. @@ -100,9 +133,14 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, + [Parameter(ParameterSetName='UpdateViaIdentityVirtualMachineExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] + # Identity Parameter + ${VirtualMachineInputObject}, + [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Header')] [System.String] @@ -118,32 +156,52 @@ param( # Other values will result in error from server as they are not supported. ${IfNoneMatch}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ConsoleEnabled])] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityVirtualMachineExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("True", "False")] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ConsoleEnabled] + [System.String] # The indicator of whether the console access is enabled. ${Enabled}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityVirtualMachineExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.DateTime] # The date and time after which the key will be disallowed access. ${Expiration}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityVirtualMachineExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The SSH public key data. ${SshPublicKeyData}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityVirtualMachineExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsolePatchParametersTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsolePatchParametersTags]))] [System.Collections.Hashtable] # The Azure resource tags that will replace the existing ones. ${Tag}, + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Path of Json file supplied to the Update operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Json string supplied to the Update operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -212,6 +270,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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() @@ -233,10 +300,11 @@ begin { $mapping = @{ UpdateExpanded = 'Az.NetworkCloud.private\Update-AzNetworkCloudConsole_UpdateExpanded'; UpdateViaIdentityExpanded = 'Az.NetworkCloud.private\Update-AzNetworkCloudConsole_UpdateViaIdentityExpanded'; + UpdateViaIdentityVirtualMachineExpanded = 'Az.NetworkCloud.private\Update-AzNetworkCloudConsole_UpdateViaIdentityVirtualMachineExpanded'; + UpdateViaJsonFilePath = 'Az.NetworkCloud.private\Update-AzNetworkCloudConsole_UpdateViaJsonFilePath'; + UpdateViaJsonString = 'Az.NetworkCloud.private\Update-AzNetworkCloudConsole_UpdateViaJsonString'; } - if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 { @@ -250,6 +318,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/NetworkCloud/NetworkCloud.Autorest/exports/Update-AzNetworkCloudKubernetesCluster.ps1 b/generated/NetworkCloud/NetworkCloud.Autorest/exports/Update-AzNetworkCloudKubernetesCluster.ps1 index 1dd608f21817..357b2c5993d6 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/exports/Update-AzNetworkCloudKubernetesCluster.ps1 +++ b/generated/NetworkCloud/NetworkCloud.Autorest/exports/Update-AzNetworkCloudKubernetesCluster.ps1 @@ -17,10 +17,10 @@ <# .Synopsis Patch the properties of the provided Kubernetes cluster, or update the tags associated with the Kubernetes cluster. -Properties and tag updates can be done independently. +Properties and tag update can be done independently. .Description Patch the properties of the provided Kubernetes cluster, or update the tags associated with the Kubernetes cluster. -Properties and tag updates can be done independently. +Properties and tag update can be done independently. .Example $tagUpdatedHash = @{ tag1 = "tags" @@ -32,7 +32,7 @@ Update-AzNetworkCloudKubernetesCluster -KubernetesClusterName kubernetesClusterN .Inputs Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesCluster +Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesCluster .Notes COMPLEX PARAMETER PROPERTIES @@ -71,10 +71,12 @@ SSHPUBLICKEY : SshPublicKey represents the public key used to a https://learn.microsoft.com/powershell/module/az.networkcloud/update-aznetworkcloudkubernetescluster #> function Update-AzNetworkCloudKubernetesCluster { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesCluster])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesCluster])] [CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [Alias('KubernetesClusterName')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [System.String] @@ -82,6 +84,8 @@ param( ${Name}, [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [System.String] # The name of the resource group. @@ -89,6 +93,8 @@ param( ${ResourceGroupName}, [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaJsonFilePath')] + [Parameter(ParameterSetName='UpdateViaJsonString')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] @@ -100,7 +106,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -118,41 +123,56 @@ param( # Other values will result in error from server as they are not supported. ${IfNoneMatch}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey[]] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISshPublicKey[]] # SshPublicKey represents the public key used to authenticate with a resource through SSH. - # To construct, see NOTES section for CONTROLPLANENODECONFIGURATIONADMINPUBLICKEY properties and create a hash table. ${ControlPlaneNodeConfigurationAdminPublicKey}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.Int64] # The number of virtual machines that use this configuration. ${ControlPlaneNodeConfigurationCount}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The Kubernetes version for this cluster. ${KubernetesVersion}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey[]] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISshPublicKey[]] # SshPublicKey represents the public key used to authenticate with a resource through SSH. - # To construct, see NOTES section for SSHPUBLICKEY properties and create a hash table. ${SshPublicKey}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPatchParametersTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPatchParametersTags]))] [System.Collections.Hashtable] # The Azure resource tags that will replace the existing ones. ${Tag}, + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Path of Json file supplied to the Update operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Json string supplied to the Update operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -221,6 +241,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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() @@ -242,10 +271,10 @@ begin { $mapping = @{ UpdateExpanded = 'Az.NetworkCloud.private\Update-AzNetworkCloudKubernetesCluster_UpdateExpanded'; UpdateViaIdentityExpanded = 'Az.NetworkCloud.private\Update-AzNetworkCloudKubernetesCluster_UpdateViaIdentityExpanded'; + UpdateViaJsonFilePath = 'Az.NetworkCloud.private\Update-AzNetworkCloudKubernetesCluster_UpdateViaJsonFilePath'; + UpdateViaJsonString = 'Az.NetworkCloud.private\Update-AzNetworkCloudKubernetesCluster_UpdateViaJsonString'; } - if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 { @@ -259,6 +288,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/NetworkCloud/NetworkCloud.Autorest/exports/Update-AzNetworkCloudKubernetesClusterFeature.ps1 b/generated/NetworkCloud/NetworkCloud.Autorest/exports/Update-AzNetworkCloudKubernetesClusterFeature.ps1 index 44ec0f6f272f..afe0e22ef5ef 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/exports/Update-AzNetworkCloudKubernetesClusterFeature.ps1 +++ b/generated/NetworkCloud/NetworkCloud.Autorest/exports/Update-AzNetworkCloudKubernetesClusterFeature.ps1 @@ -29,7 +29,7 @@ Update-AzNetworkCloudKubernetesClusterFeature -FeatureName featureName -Kubernet .Inputs Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeature +Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeature .Notes COMPLEX PARAMETER PROPERTIES @@ -59,29 +59,60 @@ INPUTOBJECT : Identity Parameter [VirtualMachineName ]: The name of the virtual machine. [VolumeName ]: The name of the volume. +KUBERNETESCLUSTERINPUTOBJECT : Identity Parameter + [AgentPoolName ]: The name of the Kubernetes cluster agent pool. + [BareMetalMachineKeySetName ]: The name of the bare metal machine key set. + [BareMetalMachineName ]: The name of the bare metal machine. + [BmcKeySetName ]: The name of the baseboard management controller key set. + [CloudServicesNetworkName ]: The name of the cloud services network. + [ClusterManagerName ]: The name of the cluster manager. + [ClusterName ]: The name of the cluster. + [ConsoleName ]: The name of the virtual machine console. + [FeatureName ]: The name of the feature. + [Id ]: Resource identity path + [KubernetesClusterName ]: The name of the Kubernetes cluster. + [L2NetworkName ]: The name of the L2 network. + [L3NetworkName ]: The name of the L3 network. + [MetricsConfigurationName ]: The name of the metrics configuration for the cluster. + [RackName ]: The name of the rack. + [RackSkuName ]: The name of the rack SKU. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [StorageApplianceName ]: The name of the storage appliance. + [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. + [TrunkedNetworkName ]: The name of the trunked network. + [VirtualMachineName ]: The name of the virtual machine. + [VolumeName ]: The name of the volume. + OPTION : The configured options for the feature. - Key : The key to the mapped value. - Value : The value of the mapping key. + [Key ]: The key to the mapped value. + [Value ]: The value of the mapping key. .Link https://learn.microsoft.com/powershell/module/az.networkcloud/update-aznetworkcloudkubernetesclusterfeature #> function Update-AzNetworkCloudKubernetesClusterFeature { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeature])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeature])] [CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaIdentityKubernetesClusterExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [System.String] # The name of the feature. ${FeatureName}, [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [System.String] # The name of the Kubernetes cluster. ${KubernetesClusterName}, [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [System.String] # The name of the resource group. @@ -89,6 +120,8 @@ param( ${ResourceGroupName}, [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaJsonFilePath')] + [Parameter(ParameterSetName='UpdateViaJsonString')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] @@ -100,9 +133,14 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, + [Parameter(ParameterSetName='UpdateViaIdentityKubernetesClusterExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] + # Identity Parameter + ${KubernetesClusterInputObject}, + [Parameter()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Header')] [System.String] @@ -118,21 +156,36 @@ param( # Other values will result in error from server as they are not supported. ${IfNoneMatch}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityKubernetesClusterExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStringKeyValuePair[]] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStringKeyValuePair[]] # The configured options for the feature. - # To construct, see NOTES section for OPTION properties and create a hash table. ${Option}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityKubernetesClusterExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeaturePatchParametersTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeaturePatchParametersTags]))] [System.Collections.Hashtable] # The Azure resource tags that will replace the existing ones. ${Tag}, + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Path of Json file supplied to the Update operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Json string supplied to the Update operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -201,6 +254,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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() @@ -222,10 +284,11 @@ begin { $mapping = @{ UpdateExpanded = 'Az.NetworkCloud.private\Update-AzNetworkCloudKubernetesClusterFeature_UpdateExpanded'; UpdateViaIdentityExpanded = 'Az.NetworkCloud.private\Update-AzNetworkCloudKubernetesClusterFeature_UpdateViaIdentityExpanded'; + UpdateViaIdentityKubernetesClusterExpanded = 'Az.NetworkCloud.private\Update-AzNetworkCloudKubernetesClusterFeature_UpdateViaIdentityKubernetesClusterExpanded'; + UpdateViaJsonFilePath = 'Az.NetworkCloud.private\Update-AzNetworkCloudKubernetesClusterFeature_UpdateViaJsonFilePath'; + UpdateViaJsonString = 'Az.NetworkCloud.private\Update-AzNetworkCloudKubernetesClusterFeature_UpdateViaJsonString'; } - if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 { @@ -239,6 +302,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/NetworkCloud/NetworkCloud.Autorest/exports/Update-AzNetworkCloudL2Network.ps1 b/generated/NetworkCloud/NetworkCloud.Autorest/exports/Update-AzNetworkCloudL2Network.ps1 index 531c662e22a3..fb14e28e7dc2 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/exports/Update-AzNetworkCloudL2Network.ps1 +++ b/generated/NetworkCloud/NetworkCloud.Autorest/exports/Update-AzNetworkCloudL2Network.ps1 @@ -25,7 +25,7 @@ Update-AzNetworkCloudL2Network -ResourceGroupName resourceGroupName -Name l2Netw .Inputs Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2Network +Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2Network .Notes COMPLEX PARAMETER PROPERTIES @@ -58,10 +58,12 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.networkcloud/update-aznetworkcloudl2network #> function Update-AzNetworkCloudL2Network { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2Network])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2Network])] [CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [Alias('L2NetworkName')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [System.String] @@ -69,6 +71,8 @@ param( ${Name}, [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [System.String] # The name of the resource group. @@ -76,6 +80,8 @@ param( ${ResourceGroupName}, [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaJsonFilePath')] + [Parameter(ParameterSetName='UpdateViaJsonString')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] @@ -87,7 +93,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -105,13 +110,26 @@ param( # Other values will result in error from server as they are not supported. ${IfNoneMatch}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkPatchParametersTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkPatchParametersTags]))] [System.Collections.Hashtable] # The Azure resource tags that will replace the existing ones. ${Tag}, + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Path of Json file supplied to the Update operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Json string supplied to the Update operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -168,6 +186,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,10 +216,10 @@ begin { $mapping = @{ UpdateExpanded = 'Az.NetworkCloud.private\Update-AzNetworkCloudL2Network_UpdateExpanded'; UpdateViaIdentityExpanded = 'Az.NetworkCloud.private\Update-AzNetworkCloudL2Network_UpdateViaIdentityExpanded'; + UpdateViaJsonFilePath = 'Az.NetworkCloud.private\Update-AzNetworkCloudL2Network_UpdateViaJsonFilePath'; + UpdateViaJsonString = 'Az.NetworkCloud.private\Update-AzNetworkCloudL2Network_UpdateViaJsonString'; } - if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 { @@ -206,6 +233,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/NetworkCloud/NetworkCloud.Autorest/exports/Update-AzNetworkCloudL3Network.ps1 b/generated/NetworkCloud/NetworkCloud.Autorest/exports/Update-AzNetworkCloudL3Network.ps1 index b8a4d9751a67..c3ddc8399179 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/exports/Update-AzNetworkCloudL3Network.ps1 +++ b/generated/NetworkCloud/NetworkCloud.Autorest/exports/Update-AzNetworkCloudL3Network.ps1 @@ -25,7 +25,7 @@ Update-AzNetworkCloudL3Network -ResourceGroupName resourceGroupName -Name l3netw .Inputs Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3Network +Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3Network .Notes COMPLEX PARAMETER PROPERTIES @@ -58,10 +58,12 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.networkcloud/update-aznetworkcloudl3network #> function Update-AzNetworkCloudL3Network { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3Network])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3Network])] [CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [Alias('L3NetworkName')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [System.String] @@ -69,6 +71,8 @@ param( ${Name}, [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [System.String] # The name of the resource group. @@ -76,6 +80,8 @@ param( ${ResourceGroupName}, [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaJsonFilePath')] + [Parameter(ParameterSetName='UpdateViaJsonString')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] @@ -87,7 +93,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -105,13 +110,26 @@ param( # Other values will result in error from server as they are not supported. ${IfNoneMatch}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkPatchParametersTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkPatchParametersTags]))] [System.Collections.Hashtable] # The Azure resource tags that will replace the existing ones. ${Tag}, + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Path of Json file supplied to the Update operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Json string supplied to the Update operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -168,6 +186,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,10 +216,10 @@ begin { $mapping = @{ UpdateExpanded = 'Az.NetworkCloud.private\Update-AzNetworkCloudL3Network_UpdateExpanded'; UpdateViaIdentityExpanded = 'Az.NetworkCloud.private\Update-AzNetworkCloudL3Network_UpdateViaIdentityExpanded'; + UpdateViaJsonFilePath = 'Az.NetworkCloud.private\Update-AzNetworkCloudL3Network_UpdateViaJsonFilePath'; + UpdateViaJsonString = 'Az.NetworkCloud.private\Update-AzNetworkCloudL3Network_UpdateViaJsonString'; } - if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 { @@ -206,6 +233,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/NetworkCloud/NetworkCloud.Autorest/exports/Update-AzNetworkCloudMetricsConfiguration.ps1 b/generated/NetworkCloud/NetworkCloud.Autorest/exports/Update-AzNetworkCloudMetricsConfiguration.ps1 index 597c15f2fabb..b3dfbe326deb 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/exports/Update-AzNetworkCloudMetricsConfiguration.ps1 +++ b/generated/NetworkCloud/NetworkCloud.Autorest/exports/Update-AzNetworkCloudMetricsConfiguration.ps1 @@ -17,22 +17,46 @@ <# .Synopsis Patch properties of metrics configuration for the provided cluster, or update the tags associated with it. -Properties and tag updates can be done independently. +Properties and tag update can be done independently. .Description Patch properties of metrics configuration for the provided cluster, or update the tags associated with it. -Properties and tag updates can be done independently. +Properties and tag update can be done independently. .Example Update-AzNetworkCloudMetricsConfiguration -ClusterName clusterName -ResourceGroupName resourceGroupName -Name metricsConfigName -CollectionInterval 10 -EnabledMetric @("metric1", "metric2") -Tag @{tag1="tag1"} .Inputs Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfiguration +Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfiguration .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. +CLUSTERINPUTOBJECT : Identity Parameter + [AgentPoolName ]: The name of the Kubernetes cluster agent pool. + [BareMetalMachineKeySetName ]: The name of the bare metal machine key set. + [BareMetalMachineName ]: The name of the bare metal machine. + [BmcKeySetName ]: The name of the baseboard management controller key set. + [CloudServicesNetworkName ]: The name of the cloud services network. + [ClusterManagerName ]: The name of the cluster manager. + [ClusterName ]: The name of the cluster. + [ConsoleName ]: The name of the virtual machine console. + [FeatureName ]: The name of the feature. + [Id ]: Resource identity path + [KubernetesClusterName ]: The name of the Kubernetes cluster. + [L2NetworkName ]: The name of the L2 network. + [L3NetworkName ]: The name of the L3 network. + [MetricsConfigurationName ]: The name of the metrics configuration for the cluster. + [RackName ]: The name of the rack. + [RackSkuName ]: The name of the rack SKU. + [ResourceGroupName ]: The name of the resource group. The name is case insensitive. + [StorageApplianceName ]: The name of the storage appliance. + [SubscriptionId ]: The ID of the target subscription. The value must be an UUID. + [TrunkedNetworkName ]: The name of the trunked network. + [VirtualMachineName ]: The name of the virtual machine. + [VolumeName ]: The name of the volume. + INPUTOBJECT : Identity Parameter [AgentPoolName ]: The name of the Kubernetes cluster agent pool. [BareMetalMachineKeySetName ]: The name of the bare metal machine key set. @@ -60,16 +84,21 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.networkcloud/update-aznetworkcloudmetricsconfiguration #> function Update-AzNetworkCloudMetricsConfiguration { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfiguration])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfiguration])] [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.NetworkCloud.Category('Path')] [System.String] # The name of the cluster. ${ClusterName}, [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaIdentityClusterExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [Alias('MetricsConfigurationName')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [System.String] @@ -77,6 +106,8 @@ param( ${Name}, [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [System.String] # The name of the resource group. @@ -84,6 +115,8 @@ param( ${ResourceGroupName}, [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaJsonFilePath')] + [Parameter(ParameterSetName='UpdateViaJsonString')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] @@ -91,11 +124,16 @@ param( # The value must be an UUID. ${SubscriptionId}, + [Parameter(ParameterSetName='UpdateViaIdentityClusterExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] + # Identity Parameter + ${ClusterInputObject}, + [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -113,26 +151,44 @@ param( # Other values will result in error from server as they are not supported. ${IfNoneMatch}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityClusterExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.Int64] # The interval in minutes by which metrics will be collected. ${CollectionInterval}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityClusterExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String[]] # The list of metric names that have been chosen to be enabled in addition to the core set of enabled metrics. ${EnabledMetric}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityClusterExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationPatchParametersTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationPatchParametersTags]))] [System.Collections.Hashtable] # The Azure resource tags that will replace the existing ones. ${Tag}, + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Path of Json file supplied to the Update operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Json string supplied to the Update operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -201,6 +257,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,11 +286,12 @@ begin { $mapping = @{ UpdateExpanded = 'Az.NetworkCloud.private\Update-AzNetworkCloudMetricsConfiguration_UpdateExpanded'; + UpdateViaIdentityClusterExpanded = 'Az.NetworkCloud.private\Update-AzNetworkCloudMetricsConfiguration_UpdateViaIdentityClusterExpanded'; UpdateViaIdentityExpanded = 'Az.NetworkCloud.private\Update-AzNetworkCloudMetricsConfiguration_UpdateViaIdentityExpanded'; + UpdateViaJsonFilePath = 'Az.NetworkCloud.private\Update-AzNetworkCloudMetricsConfiguration_UpdateViaJsonFilePath'; + UpdateViaJsonString = 'Az.NetworkCloud.private\Update-AzNetworkCloudMetricsConfiguration_UpdateViaJsonString'; } - if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 { @@ -239,6 +305,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/NetworkCloud/NetworkCloud.Autorest/exports/Update-AzNetworkCloudRack.ps1 b/generated/NetworkCloud/NetworkCloud.Autorest/exports/Update-AzNetworkCloudRack.ps1 index fafe8b99a8f3..bfcc87cab0e0 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/exports/Update-AzNetworkCloudRack.ps1 +++ b/generated/NetworkCloud/NetworkCloud.Autorest/exports/Update-AzNetworkCloudRack.ps1 @@ -17,17 +17,17 @@ <# .Synopsis Patch properties of the provided rack, or update the tags associated with the rack. -Properties and tag updates can be done independently. +Properties and tag update can be done independently. .Description Patch properties of the provided rack, or update the tags associated with the rack. -Properties and tag updates can be done independently. +Properties and tag update can be done independently. .Example Update-AzNetworkCloudRack -ResourceGroupName resourceGroupName -Name rackName -Tag @{'tag'="tagUpdated"} -SubscriptionId subscriptionId .Inputs Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRack +Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRack .Notes COMPLEX PARAMETER PROPERTIES @@ -60,10 +60,12 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.networkcloud/update-aznetworkcloudrack #> function Update-AzNetworkCloudRack { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRack])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRack])] [CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [Alias('RackName')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [System.String] @@ -71,6 +73,8 @@ param( ${Name}, [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [System.String] # The name of the resource group. @@ -78,6 +82,8 @@ param( ${ResourceGroupName}, [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaJsonFilePath')] + [Parameter(ParameterSetName='UpdateViaJsonString')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] @@ -89,7 +95,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -107,7 +112,8 @@ param( # Other values will result in error from server as they are not supported. ${IfNoneMatch}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The free-form description of the rack location. @@ -115,19 +121,33 @@ param( # “DTN Datacenter, Floor 3, Isle 9, Rack 2B”) ${RackLocation}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The globally unique identifier for the rack. ${RackSerialNumber}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackPatchParametersTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackPatchParametersTags]))] [System.Collections.Hashtable] # The Azure resource tags that will replace the existing ones. ${Tag}, + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Path of Json file supplied to the Update operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Json string supplied to the Update operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -196,6 +216,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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() @@ -217,10 +246,10 @@ begin { $mapping = @{ UpdateExpanded = 'Az.NetworkCloud.private\Update-AzNetworkCloudRack_UpdateExpanded'; UpdateViaIdentityExpanded = 'Az.NetworkCloud.private\Update-AzNetworkCloudRack_UpdateViaIdentityExpanded'; + UpdateViaJsonFilePath = 'Az.NetworkCloud.private\Update-AzNetworkCloudRack_UpdateViaJsonFilePath'; + UpdateViaJsonString = 'Az.NetworkCloud.private\Update-AzNetworkCloudRack_UpdateViaJsonString'; } - if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 { @@ -234,6 +263,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/NetworkCloud/NetworkCloud.Autorest/exports/Update-AzNetworkCloudServicesNetwork.ps1 b/generated/NetworkCloud/NetworkCloud.Autorest/exports/Update-AzNetworkCloudServicesNetwork.ps1 index 44eb1c3a4417..24d103c64ece 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/exports/Update-AzNetworkCloudServicesNetwork.ps1 +++ b/generated/NetworkCloud/NetworkCloud.Autorest/exports/Update-AzNetworkCloudServicesNetwork.ps1 @@ -17,10 +17,10 @@ <# .Synopsis Update properties of the provided cloud services network, or update the tags associated with it. -Properties and tag updates can be done independently. +Properties and tag update can be done independently. .Description Update properties of the provided cloud services network, or update the tags associated with it. -Properties and tag updates can be done independently. +Properties and tag update can be done independently. .Example $tags = @{ Tag1 = 'tag1' @@ -35,7 +35,7 @@ Update-AzNetworkCloudServicesNetwork -ResourceGroupName resourceGroupName -Cloud .Inputs Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetwork +Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetwork .Notes COMPLEX PARAMETER PROPERTIES @@ -43,7 +43,7 @@ To create the parameters described below, construct a hash table containing the ADDITIONALEGRESSENDPOINT : The list of egress endpoints. This allows for connection from a Hybrid AKS cluster to the specified endpoint. Category : The descriptive category name of endpoints accessible by the AKS agent node. For example, azure-resource-management, API server, etc. The platform egress endpoints provided by default will use the category 'default'. - Endpoint : The list of endpoint dependencies. + Endpoint >: The list of endpoint dependencies. DomainName : The domain name of the dependency. [Port ]: The port of this endpoint. @@ -74,10 +74,12 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.networkcloud/update-aznetworkcloudservicesnetwork #> function Update-AzNetworkCloudServicesNetwork { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetwork])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetwork])] [CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [Alias('CloudServicesNetworkName')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [System.String] @@ -85,6 +87,8 @@ param( ${Name}, [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [System.String] # The name of the resource group. @@ -92,6 +96,8 @@ param( ${ResourceGroupName}, [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaJsonFilePath')] + [Parameter(ParameterSetName='UpdateViaJsonString')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] @@ -103,7 +109,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -121,29 +126,43 @@ param( # Other values will result in error from server as they are not supported. ${IfNoneMatch}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IEgressEndpoint[]] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IEgressEndpoint[]] # The list of egress endpoints. # This allows for connection from a Hybrid AKS cluster to the specified endpoint. - # To construct, see NOTES section for ADDITIONALEGRESSENDPOINT properties and create a hash table. ${AdditionalEgressEndpoint}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CloudServicesNetworkEnableDefaultEgressEndpoints])] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("True", "False")] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CloudServicesNetworkEnableDefaultEgressEndpoints] + [System.String] # The indicator of whether the platform default endpoints are allowed for the egress traffic. ${EnableDefaultEgressEndpoint}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkPatchParametersTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkPatchParametersTags]))] [System.Collections.Hashtable] # The Azure resource tags that will replace the existing ones. ${Tag}, + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Path of Json file supplied to the Update operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Json string supplied to the Update operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -212,6 +231,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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() @@ -233,10 +261,10 @@ begin { $mapping = @{ UpdateExpanded = 'Az.NetworkCloud.private\Update-AzNetworkCloudServicesNetwork_UpdateExpanded'; UpdateViaIdentityExpanded = 'Az.NetworkCloud.private\Update-AzNetworkCloudServicesNetwork_UpdateViaIdentityExpanded'; + UpdateViaJsonFilePath = 'Az.NetworkCloud.private\Update-AzNetworkCloudServicesNetwork_UpdateViaJsonFilePath'; + UpdateViaJsonString = 'Az.NetworkCloud.private\Update-AzNetworkCloudServicesNetwork_UpdateViaJsonString'; } - if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 { @@ -250,6 +278,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/NetworkCloud/NetworkCloud.Autorest/exports/Update-AzNetworkCloudStorageAppliance.ps1 b/generated/NetworkCloud/NetworkCloud.Autorest/exports/Update-AzNetworkCloudStorageAppliance.ps1 index 820dbf847d4f..c1e49ecb3084 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/exports/Update-AzNetworkCloudStorageAppliance.ps1 +++ b/generated/NetworkCloud/NetworkCloud.Autorest/exports/Update-AzNetworkCloudStorageAppliance.ps1 @@ -16,16 +16,16 @@ <# .Synopsis -Update properties of the provided storage appliance, or update tags associated with the storage appliance Properties and tag updates can be done independently. +Update properties of the provided storage appliance, or update tags associated with the storage appliance Properties and tag update can be done independently. .Description -Update properties of the provided storage appliance, or update tags associated with the storage appliance Properties and tag updates can be done independently. +Update properties of the provided storage appliance, or update tags associated with the storage appliance Properties and tag update can be done independently. .Example Update-AzNetworkCloudStorageAppliance -Name storageApplianceName -ResourceGroupName resourceGroup -SubscriptionId subscriptionId -SerialNumber serialNumber -Tag @{ tag1 = "tag1"; tag2 = "tag2" } .Inputs Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliance +Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliance .Notes COMPLEX PARAMETER PROPERTIES @@ -58,10 +58,12 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.networkcloud/update-aznetworkcloudstorageappliance #> function Update-AzNetworkCloudStorageAppliance { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliance])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliance])] [CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [Alias('StorageApplianceName')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [System.String] @@ -69,6 +71,8 @@ param( ${Name}, [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [System.String] # The name of the resource group. @@ -76,6 +80,8 @@ param( ${ResourceGroupName}, [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaJsonFilePath')] + [Parameter(ParameterSetName='UpdateViaJsonString')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] @@ -87,7 +93,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -105,19 +110,33 @@ param( # Other values will result in error from server as they are not supported. ${IfNoneMatch}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The serial number for the storage appliance. ${SerialNumber}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePatchParametersTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePatchParametersTags]))] [System.Collections.Hashtable] # The Azure resource tags that will replace the existing ones. ${Tag}, + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Path of Json file supplied to the Update operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Json string supplied to the Update operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -186,6 +205,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 +235,10 @@ begin { $mapping = @{ UpdateExpanded = 'Az.NetworkCloud.private\Update-AzNetworkCloudStorageAppliance_UpdateExpanded'; UpdateViaIdentityExpanded = 'Az.NetworkCloud.private\Update-AzNetworkCloudStorageAppliance_UpdateViaIdentityExpanded'; + UpdateViaJsonFilePath = 'Az.NetworkCloud.private\Update-AzNetworkCloudStorageAppliance_UpdateViaJsonFilePath'; + UpdateViaJsonString = 'Az.NetworkCloud.private\Update-AzNetworkCloudStorageAppliance_UpdateViaJsonString'; } - if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 +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/NetworkCloud/NetworkCloud.Autorest/exports/Update-AzNetworkCloudTrunkedNetwork.ps1 b/generated/NetworkCloud/NetworkCloud.Autorest/exports/Update-AzNetworkCloudTrunkedNetwork.ps1 index 2c39b5ce52f9..ef940ce6f36a 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/exports/Update-AzNetworkCloudTrunkedNetwork.ps1 +++ b/generated/NetworkCloud/NetworkCloud.Autorest/exports/Update-AzNetworkCloudTrunkedNetwork.ps1 @@ -25,7 +25,7 @@ Update-AzNetworkCloudTrunkedNetwork -Name trunkedNetworkName -ResourceGroupName .Inputs Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetwork +Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetwork .Notes COMPLEX PARAMETER PROPERTIES @@ -58,10 +58,12 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.networkcloud/update-aznetworkcloudtrunkednetwork #> function Update-AzNetworkCloudTrunkedNetwork { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetwork])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetwork])] [CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [Alias('TrunkedNetworkName')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [System.String] @@ -69,6 +71,8 @@ param( ${Name}, [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [System.String] # The name of the resource group. @@ -76,6 +80,8 @@ param( ${ResourceGroupName}, [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaJsonFilePath')] + [Parameter(ParameterSetName='UpdateViaJsonString')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] @@ -87,7 +93,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -105,13 +110,26 @@ param( # Other values will result in error from server as they are not supported. ${IfNoneMatch}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkPatchParametersTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkPatchParametersTags]))] [System.Collections.Hashtable] # The Azure resource tags that will replace the existing ones. ${Tag}, + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Path of Json file supplied to the Update operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Json string supplied to the Update operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -168,6 +186,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,10 +216,10 @@ begin { $mapping = @{ UpdateExpanded = 'Az.NetworkCloud.private\Update-AzNetworkCloudTrunkedNetwork_UpdateExpanded'; UpdateViaIdentityExpanded = 'Az.NetworkCloud.private\Update-AzNetworkCloudTrunkedNetwork_UpdateViaIdentityExpanded'; + UpdateViaJsonFilePath = 'Az.NetworkCloud.private\Update-AzNetworkCloudTrunkedNetwork_UpdateViaJsonFilePath'; + UpdateViaJsonString = 'Az.NetworkCloud.private\Update-AzNetworkCloudTrunkedNetwork_UpdateViaJsonString'; } - if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 { @@ -206,6 +233,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/NetworkCloud/NetworkCloud.Autorest/exports/Update-AzNetworkCloudVirtualMachine.ps1 b/generated/NetworkCloud/NetworkCloud.Autorest/exports/Update-AzNetworkCloudVirtualMachine.ps1 index 871cb19573fa..10a24d88cfd9 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/exports/Update-AzNetworkCloudVirtualMachine.ps1 +++ b/generated/NetworkCloud/NetworkCloud.Autorest/exports/Update-AzNetworkCloudVirtualMachine.ps1 @@ -17,10 +17,10 @@ <# .Synopsis Patch the properties of the provided virtual machine, or update the tags associated with the virtual machine. -Properties and tag updates can be done independently. +Properties and tag update can be done independently. .Description Patch the properties of the provided virtual machine, or update the tags associated with the virtual machine. -Properties and tag updates can be done independently. +Properties and tag update can be done independently. .Example $tagUpdatedHash = @{ tag1 = "tag1" @@ -33,7 +33,7 @@ Update-AzNetworkCloudVirtualMachine -Name vmName -ResourceGroupName resourceGrou .Inputs Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachine +Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachine .Notes COMPLEX PARAMETER PROPERTIES @@ -66,10 +66,12 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.networkcloud/update-aznetworkcloudvirtualmachine #> function Update-AzNetworkCloudVirtualMachine { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachine])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachine])] [CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [Alias('VirtualMachineName')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [System.String] @@ -77,6 +79,8 @@ param( ${Name}, [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [System.String] # The name of the resource group. @@ -84,6 +88,8 @@ param( ${ResourceGroupName}, [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaJsonFilePath')] + [Parameter(ParameterSetName='UpdateViaJsonString')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] @@ -95,7 +101,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -113,31 +118,47 @@ param( # Other values will result in error from server as they are not supported. ${IfNoneMatch}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePatchParametersTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePatchParametersTags]))] [System.Collections.Hashtable] # The Azure resource tags that will replace the existing ones. ${Tag}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.Security.SecureString] # The password or token used to access an image in the target repository. ${VMImageRepositoryCredentialsPassword}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The URL of the authentication server used to validate the repository credentials. ${VMImageRepositoryCredentialsRegistryUrl}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] [System.String] # The username used to access an image in the target repository. ${VMImageRepositoryCredentialsUsername}, + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Path of Json file supplied to the Update operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Json string supplied to the Update operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -206,6 +227,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,10 +257,10 @@ begin { $mapping = @{ UpdateExpanded = 'Az.NetworkCloud.private\Update-AzNetworkCloudVirtualMachine_UpdateExpanded'; UpdateViaIdentityExpanded = 'Az.NetworkCloud.private\Update-AzNetworkCloudVirtualMachine_UpdateViaIdentityExpanded'; + UpdateViaJsonFilePath = 'Az.NetworkCloud.private\Update-AzNetworkCloudVirtualMachine_UpdateViaJsonFilePath'; + UpdateViaJsonString = 'Az.NetworkCloud.private\Update-AzNetworkCloudVirtualMachine_UpdateViaJsonString'; } - if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 { @@ -244,6 +274,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/NetworkCloud/NetworkCloud.Autorest/exports/Update-AzNetworkCloudVolume.ps1 b/generated/NetworkCloud/NetworkCloud.Autorest/exports/Update-AzNetworkCloudVolume.ps1 index fe185849239d..d72e26815ff6 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/exports/Update-AzNetworkCloudVolume.ps1 +++ b/generated/NetworkCloud/NetworkCloud.Autorest/exports/Update-AzNetworkCloudVolume.ps1 @@ -25,7 +25,7 @@ Update-AzNetworkCloudVolume -Name volumeName -ResourceGroupName resourceGroupNam .Inputs Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolume +Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolume .Notes COMPLEX PARAMETER PROPERTIES @@ -58,10 +58,12 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.networkcloud/update-aznetworkcloudvolume #> function Update-AzNetworkCloudVolume { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolume])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolume])] [CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [Alias('VolumeName')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [System.String] @@ -69,6 +71,8 @@ param( ${Name}, [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [System.String] # The name of the resource group. @@ -76,6 +80,8 @@ param( ${ResourceGroupName}, [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaJsonFilePath')] + [Parameter(ParameterSetName='UpdateViaJsonString')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] @@ -87,7 +93,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -105,13 +110,26 @@ param( # Other values will result in error from server as they are not supported. ${IfNoneMatch}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolumePatchParametersTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumePatchParametersTags]))] [System.Collections.Hashtable] # The Azure resource tags that will replace the existing ones. ${Tag}, + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Path of Json file supplied to the Update operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category('Body')] + [System.String] + # Json string supplied to the Update operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -168,6 +186,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,10 +216,10 @@ begin { $mapping = @{ UpdateExpanded = 'Az.NetworkCloud.private\Update-AzNetworkCloudVolume_UpdateExpanded'; UpdateViaIdentityExpanded = 'Az.NetworkCloud.private\Update-AzNetworkCloudVolume_UpdateViaIdentityExpanded'; + UpdateViaJsonFilePath = 'Az.NetworkCloud.private\Update-AzNetworkCloudVolume_UpdateViaJsonFilePath'; + UpdateViaJsonString = 'Az.NetworkCloud.private\Update-AzNetworkCloudVolume_UpdateViaJsonString'; } - if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 { @@ -206,6 +233,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/NetworkCloud/NetworkCloud.Autorest/generate-info.json b/generated/NetworkCloud/NetworkCloud.Autorest/generate-info.json index 051505bcd69b..9dd212d6b627 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generate-info.json +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generate-info.json @@ -1,3 +1,3 @@ { - "generate_Id": "48ebe054-8b3a-45d6-9b34-ee4f1ab573de" + "generate_Id": "8d780923-aa45-4776-9a4e-68d2e0c2cc65" } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/Module.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/Module.cs index d1082343f033..d661eab16c16 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/Module.cs +++ b/generated/NetworkCloud/NetworkCloud.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.NetworkCloud.Module _instance; + /// the ISendAsync pipeline instance private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline _pipeline; /// the ISendAsync pipeline instance (when proxy is enabled) private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Module _instance; - /// the singleton of this module class - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module Instance => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module._instance?? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module._instance = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module()); + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud"; @@ -125,9 +130,17 @@ public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Crea /// 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/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AadConfiguration.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AadConfiguration.PowerShell.cs similarity index 83% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AadConfiguration.PowerShell.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AadConfiguration.PowerShell.cs index b84212b3493b..3640e4c632ea 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AadConfiguration.PowerShell.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AadConfiguration.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; @@ -63,7 +63,7 @@ public partial class AadConfiguration 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 AadConfiguration(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("AdminGroupObjectId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAadConfigurationInternal)this).AdminGroupObjectId = (string[]) content.GetValueForProperty("AdminGroupObjectId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAadConfigurationInternal)this).AdminGroupObjectId, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAadConfigurationInternal)this).AdminGroupObjectId = (System.Collections.Generic.List) content.GetValueForProperty("AdminGroupObjectId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAadConfigurationInternal)this).AdminGroupObjectId, __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. @@ -99,33 +99,33 @@ internal AadConfiguration(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("AdminGroupObjectId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAadConfigurationInternal)this).AdminGroupObjectId = (string[]) content.GetValueForProperty("AdminGroupObjectId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAadConfigurationInternal)this).AdminGroupObjectId, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAadConfigurationInternal)this).AdminGroupObjectId = (System.Collections.Generic.List) content.GetValueForProperty("AdminGroupObjectId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAadConfigurationInternal)this).AdminGroupObjectId, __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.NetworkCloud.Models.Api20250201.IAadConfiguration DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAadConfiguration DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new AadConfiguration(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.NetworkCloud.Models.Api20250201.IAadConfiguration DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAadConfiguration DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new AadConfiguration(content); } @@ -135,7 +135,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAadConfiguration FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAadConfiguration FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AadConfiguration.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AadConfiguration.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AadConfiguration.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AadConfiguration.TypeConverter.cs index ca5fa29b3daa..76ebe0bea05c 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AadConfiguration.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AadConfiguration.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IAadConfiguration ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAadConfiguration ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAadConfiguration).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAadConfiguration).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AadConfiguration.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AadConfiguration.cs similarity index 77% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AadConfiguration.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AadConfiguration.cs index 64e3a1b6a8ca..6858cff03b29 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AadConfiguration.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AadConfiguration.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; /// AadConfiguration represents the Azure Active Directory Integration properties. public partial class AadConfiguration : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAadConfiguration, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAadConfigurationInternal + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAadConfiguration, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAadConfigurationInternal { /// Backing field for property. - private string[] _adminGroupObjectId; + private System.Collections.Generic.List _adminGroupObjectId; /// /// The list of Azure Active Directory group object IDs that will have an administrative role on the Kubernetes cluster. /// [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string[] AdminGroupObjectId { get => this._adminGroupObjectId; set => this._adminGroupObjectId = value; } + public System.Collections.Generic.List AdminGroupObjectId { get => this._adminGroupObjectId; set => this._adminGroupObjectId = value; } /// Creates an new instance. public AadConfiguration() @@ -36,12 +36,15 @@ public partial interface IAadConfiguration : /// The list of Azure Active Directory group object IDs that will have an administrative role on the Kubernetes cluster. /// [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, + Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = false, Description = @"The list of Azure Active Directory group object IDs that will have an administrative role on the Kubernetes cluster.", SerializedName = @"adminGroupObjectIds", PossibleTypes = new [] { typeof(string) })] - string[] AdminGroupObjectId { get; set; } + System.Collections.Generic.List AdminGroupObjectId { get; set; } } /// AadConfiguration represents the Azure Active Directory Integration properties. @@ -51,7 +54,7 @@ internal partial interface IAadConfigurationInternal /// /// The list of Azure Active Directory group object IDs that will have an administrative role on the Kubernetes cluster. /// - string[] AdminGroupObjectId { get; set; } + System.Collections.Generic.List AdminGroupObjectId { get; set; } } } \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AadConfiguration.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AadConfiguration.json.cs similarity index 82% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AadConfiguration.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AadConfiguration.json.cs index b7311236c170..a9fea476cef7 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AadConfiguration.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AadConfiguration.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -65,18 +65,18 @@ internal AadConfiguration(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtim { return; } - {_adminGroupObjectId = If( json?.PropertyT("adminGroupObjectIds"), out var __jsonAdminGroupObjectIds) ? If( __jsonAdminGroupObjectIds as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : AdminGroupObjectId;} + {_adminGroupObjectId = If( json?.PropertyT("adminGroupObjectIds"), out var __jsonAdminGroupObjectIds) ? If( __jsonAdminGroupObjectIds as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : _adminGroupObjectId;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAadConfiguration. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAadConfiguration. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAadConfiguration. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAadConfiguration. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAadConfiguration FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAadConfiguration FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new AadConfiguration(json) : null; } @@ -100,14 +100,17 @@ public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode ToJ { return container; } - if (null != this._adminGroupObjectId) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)||serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate)) { - var __w = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.XNodeArray(); - foreach( var __x in this._adminGroupObjectId ) + if (null != this._adminGroupObjectId) { - AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + var __w = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.XNodeArray(); + foreach( var __x in this._adminGroupObjectId ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("adminGroupObjectIds",__w); } - container.Add("adminGroupObjectIds",__w); } AfterToJson(ref container); return container; diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AdministrativeCredentials.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AdministrativeCredentials.PowerShell.cs similarity index 79% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AdministrativeCredentials.PowerShell.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AdministrativeCredentials.PowerShell.cs index a642671eb1a6..d2f62a393eeb 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AdministrativeCredentials.PowerShell.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AdministrativeCredentials.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; @@ -65,7 +65,7 @@ public partial class AdministrativeCredentials 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,17 +80,17 @@ internal AdministrativeCredentials(global::System.Collections.IDictionary conten // actually deserialize if (content.Contains("Password")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministrativeCredentialsInternal)this).Password = (System.Security.SecureString) content.GetValueForProperty("Password",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministrativeCredentialsInternal)this).Password, (object ss) => (System.Security.SecureString)ss); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministrativeCredentialsInternal)this).Password = (System.Security.SecureString) content.GetValueForProperty("Password",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministrativeCredentialsInternal)this).Password, (object ss) => (System.Security.SecureString)ss); } if (content.Contains("Username")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministrativeCredentialsInternal)this).Username = (string) content.GetValueForProperty("Username",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministrativeCredentialsInternal)this).Username, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministrativeCredentialsInternal)this).Username = (string) content.GetValueForProperty("Username",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministrativeCredentialsInternal)this).Username, 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. @@ -105,39 +105,37 @@ internal AdministrativeCredentials(global::System.Management.Automation.PSObject // actually deserialize if (content.Contains("Password")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministrativeCredentialsInternal)this).Password = (System.Security.SecureString) content.GetValueForProperty("Password",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministrativeCredentialsInternal)this).Password, (object ss) => (System.Security.SecureString)ss); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministrativeCredentialsInternal)this).Password = (System.Security.SecureString) content.GetValueForProperty("Password",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministrativeCredentialsInternal)this).Password, (object ss) => (System.Security.SecureString)ss); } if (content.Contains("Username")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministrativeCredentialsInternal)this).Username = (string) content.GetValueForProperty("Username",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministrativeCredentialsInternal)this).Username, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministrativeCredentialsInternal)this).Username = (string) content.GetValueForProperty("Username",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministrativeCredentialsInternal)this).Username, 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.NetworkCloud.Models.Api20250201.IAdministrativeCredentials DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministrativeCredentials DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new AdministrativeCredentials(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.NetworkCloud.Models.Api20250201.IAdministrativeCredentials DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministrativeCredentials DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new AdministrativeCredentials(content); } @@ -147,7 +145,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministrativeCredentials FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministrativeCredentials FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AdministrativeCredentials.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AdministrativeCredentials.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AdministrativeCredentials.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AdministrativeCredentials.TypeConverter.cs index 3109b192a7de..975be86391db 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AdministrativeCredentials.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AdministrativeCredentials.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IAdministrativeCredentials ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministrativeCredentials ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministrativeCredentials).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministrativeCredentials).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AdministrativeCredentials.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AdministrativeCredentials.cs similarity index 91% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AdministrativeCredentials.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AdministrativeCredentials.cs index 75ec8b6816ed..8b59098e58d5 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AdministrativeCredentials.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AdministrativeCredentials.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -11,8 +11,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201 /// AdministrativeCredentials represents the admin credentials for the device requiring password-based authentication. /// public partial class AdministrativeCredentials : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministrativeCredentials, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministrativeCredentialsInternal + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministrativeCredentials, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministrativeCredentialsInternal { /// Backing field for property. @@ -43,6 +43,9 @@ public partial interface IAdministrativeCredentials : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The password of the administrator of the device used during initialization.", SerializedName = @"password", PossibleTypes = new [] { typeof(System.Security.SecureString) })] @@ -51,6 +54,9 @@ public partial interface IAdministrativeCredentials : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The username of the administrator of the device used during initialization.", SerializedName = @"username", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AdministrativeCredentials.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AdministrativeCredentials.json.cs similarity index 94% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AdministrativeCredentials.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AdministrativeCredentials.json.cs index 1aab1818946d..3dcf979db231 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AdministrativeCredentials.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AdministrativeCredentials.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -67,19 +67,19 @@ internal AdministrativeCredentials(Microsoft.Azure.PowerShell.Cmdlets.NetworkClo { return; } - {_password = If( json?.PropertyT("password"), out var __jsonPassword) ? new System.Net.NetworkCredential("",(string)__jsonPassword).SecurePassword : Password;} - {_username = If( json?.PropertyT("username"), out var __jsonUsername) ? (string)__jsonUsername : (string)Username;} + {_password = If( json?.PropertyT("password"), out var __jsonPassword) ? new System.Net.NetworkCredential("",(string)__jsonPassword).SecurePassword : _password;} + {_username = If( json?.PropertyT("username"), out var __jsonUsername) ? (string)__jsonUsername : (string)_username;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministrativeCredentials. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministrativeCredentials. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministrativeCredentials. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministrativeCredentials. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministrativeCredentials FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministrativeCredentials FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new AdministrativeCredentials(json) : null; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AdministratorConfiguration.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AdministratorConfiguration.PowerShell.cs similarity index 76% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AdministratorConfiguration.PowerShell.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AdministratorConfiguration.PowerShell.cs index 68f298d73a13..4c536d81afd9 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AdministratorConfiguration.PowerShell.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AdministratorConfiguration.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; @@ -66,7 +66,7 @@ public partial class AdministratorConfiguration 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,17 +81,17 @@ internal AdministratorConfiguration(global::System.Collections.IDictionary conte // actually deserialize if (content.Contains("AdminUsername")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministratorConfigurationInternal)this).AdminUsername = (string) content.GetValueForProperty("AdminUsername",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministratorConfigurationInternal)this).AdminUsername, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministratorConfigurationInternal)this).AdminUsername = (string) content.GetValueForProperty("AdminUsername",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministratorConfigurationInternal)this).AdminUsername, global::System.Convert.ToString); } if (content.Contains("SshPublicKey")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministratorConfigurationInternal)this).SshPublicKey = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey[]) content.GetValueForProperty("SshPublicKey",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministratorConfigurationInternal)this).SshPublicKey, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.SshPublicKeyTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministratorConfigurationInternal)this).SshPublicKey = (System.Collections.Generic.List) content.GetValueForProperty("SshPublicKey",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministratorConfigurationInternal)this).SshPublicKey, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.SshPublicKeyTypeConverter.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. @@ -106,39 +106,37 @@ internal AdministratorConfiguration(global::System.Management.Automation.PSObjec // actually deserialize if (content.Contains("AdminUsername")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministratorConfigurationInternal)this).AdminUsername = (string) content.GetValueForProperty("AdminUsername",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministratorConfigurationInternal)this).AdminUsername, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministratorConfigurationInternal)this).AdminUsername = (string) content.GetValueForProperty("AdminUsername",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministratorConfigurationInternal)this).AdminUsername, global::System.Convert.ToString); } if (content.Contains("SshPublicKey")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministratorConfigurationInternal)this).SshPublicKey = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey[]) content.GetValueForProperty("SshPublicKey",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministratorConfigurationInternal)this).SshPublicKey, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.SshPublicKeyTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministratorConfigurationInternal)this).SshPublicKey = (System.Collections.Generic.List) content.GetValueForProperty("SshPublicKey",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministratorConfigurationInternal)this).SshPublicKey, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.SshPublicKeyTypeConverter.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.NetworkCloud.Models.Api20250201.IAdministratorConfiguration DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministratorConfiguration DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new AdministratorConfiguration(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.NetworkCloud.Models.Api20250201.IAdministratorConfiguration DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministratorConfiguration DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new AdministratorConfiguration(content); } @@ -148,7 +146,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministratorConfiguration FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministratorConfiguration FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AdministratorConfiguration.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AdministratorConfiguration.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AdministratorConfiguration.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AdministratorConfiguration.TypeConverter.cs index b170fdd8ea68..9440bacfd253 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AdministratorConfiguration.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AdministratorConfiguration.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IAdministratorConfiguration ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministratorConfiguration ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministratorConfiguration).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministratorConfiguration).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AdministratorConfiguration.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AdministratorConfiguration.cs similarity index 82% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AdministratorConfiguration.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AdministratorConfiguration.cs index 63d1c88756ae..6455ecee8158 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AdministratorConfiguration.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AdministratorConfiguration.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -12,8 +12,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201 /// pool nodes in Kubernetes clusters. /// public partial class AdministratorConfiguration : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministratorConfiguration, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministratorConfigurationInternal + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministratorConfiguration, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministratorConfigurationInternal { /// Backing field for property. @@ -27,14 +27,14 @@ public partial class AdministratorConfiguration : public string AdminUsername { get => this._adminUsername; set => this._adminUsername = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey[] _sshPublicKey; + private System.Collections.Generic.List _sshPublicKey; /// /// The SSH configuration for the operating systems that run the nodes in the Kubernetes cluster. In some cases, specification /// of public keys may be required to produce a working environment. /// [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey[] SshPublicKey { get => this._sshPublicKey; set => this._sshPublicKey = value; } + public System.Collections.Generic.List SshPublicKey { get => this._sshPublicKey; set => this._sshPublicKey = value; } /// Creates an new instance. public AdministratorConfiguration() @@ -54,6 +54,9 @@ public partial interface IAdministratorConfiguration : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = false, Description = @"The user name for the administrator that will be applied to the operating systems that run Kubernetes nodes. If not supplied, a user name will be chosen by the service.", SerializedName = @"adminUsername", PossibleTypes = new [] { typeof(string) })] @@ -65,10 +68,13 @@ public partial interface IAdministratorConfiguration : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The SSH configuration for the operating systems that run the nodes in the Kubernetes cluster. In some cases, specification of public keys may be required to produce a working environment.", SerializedName = @"sshPublicKeys", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey[] SshPublicKey { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISshPublicKey) })] + System.Collections.Generic.List SshPublicKey { get; set; } } /// AdministratorConfiguration represents the administrative credentials that will be applied to the control plane and agent @@ -85,7 +91,7 @@ internal partial interface IAdministratorConfigurationInternal /// The SSH configuration for the operating systems that run the nodes in the Kubernetes cluster. In some cases, specification /// of public keys may be required to produce a working environment. /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey[] SshPublicKey { get; set; } + System.Collections.Generic.List SshPublicKey { get; set; } } } \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AdministratorConfiguration.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AdministratorConfiguration.json.cs similarity index 84% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AdministratorConfiguration.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AdministratorConfiguration.json.cs index f47fd8d96d7c..7ac803417dd6 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AdministratorConfiguration.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AdministratorConfiguration.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -68,19 +68,19 @@ internal AdministratorConfiguration(Microsoft.Azure.PowerShell.Cmdlets.NetworkCl { return; } - {_adminUsername = If( json?.PropertyT("adminUsername"), out var __jsonAdminUsername) ? (string)__jsonAdminUsername : (string)AdminUsername;} - {_sshPublicKey = If( json?.PropertyT("sshPublicKeys"), out var __jsonSshPublicKeys) ? If( __jsonSshPublicKeys as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.ISshPublicKey) (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.SshPublicKey.FromJson(__u) )) ))() : null : SshPublicKey;} + {_adminUsername = If( json?.PropertyT("adminUsername"), out var __jsonAdminUsername) ? (string)__jsonAdminUsername : (string)_adminUsername;} + {_sshPublicKey = If( json?.PropertyT("sshPublicKeys"), out var __jsonSshPublicKeys) ? If( __jsonSshPublicKeys as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.ISshPublicKey) (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.SshPublicKey.FromJson(__u) )) ))() : null : _sshPublicKey;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministratorConfiguration. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministratorConfiguration. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministratorConfiguration. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministratorConfiguration. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministratorConfiguration FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministratorConfiguration FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new AdministratorConfiguration(json) : null; } @@ -104,7 +104,10 @@ public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode ToJ { return container; } - AddIf( null != (((object)this._adminUsername)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._adminUsername.ToString()) : null, "adminUsername" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)||serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate)) + { + AddIf( null != (((object)this._adminUsername)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._adminUsername.ToString()) : null, "adminUsername" ,container.Add ); + } if (null != this._sshPublicKey) { var __w = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.XNodeArray(); diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AdministratorConfigurationPatch.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AdministratorConfigurationPatch.PowerShell.cs similarity index 79% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AdministratorConfigurationPatch.PowerShell.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AdministratorConfigurationPatch.PowerShell.cs index 0a9436e57b73..c175406cbbc4 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AdministratorConfigurationPatch.PowerShell.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AdministratorConfigurationPatch.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; @@ -65,7 +65,7 @@ public partial class AdministratorConfigurationPatch 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 AdministratorConfigurationPatch(global::System.Collections.IDictionary // actually deserialize if (content.Contains("SshPublicKey")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministratorConfigurationPatchInternal)this).SshPublicKey = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey[]) content.GetValueForProperty("SshPublicKey",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministratorConfigurationPatchInternal)this).SshPublicKey, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.SshPublicKeyTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministratorConfigurationPatchInternal)this).SshPublicKey = (System.Collections.Generic.List) content.GetValueForProperty("SshPublicKey",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministratorConfigurationPatchInternal)this).SshPublicKey, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.SshPublicKeyTypeConverter.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,33 @@ internal AdministratorConfigurationPatch(global::System.Management.Automation.PS // actually deserialize if (content.Contains("SshPublicKey")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministratorConfigurationPatchInternal)this).SshPublicKey = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey[]) content.GetValueForProperty("SshPublicKey",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministratorConfigurationPatchInternal)this).SshPublicKey, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.SshPublicKeyTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministratorConfigurationPatchInternal)this).SshPublicKey = (System.Collections.Generic.List) content.GetValueForProperty("SshPublicKey",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministratorConfigurationPatchInternal)this).SshPublicKey, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.SshPublicKeyTypeConverter.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.NetworkCloud.Models.Api20250201.IAdministratorConfigurationPatch DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministratorConfigurationPatch DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new AdministratorConfigurationPatch(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.NetworkCloud.Models.Api20250201.IAdministratorConfigurationPatch DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministratorConfigurationPatch DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new AdministratorConfigurationPatch(content); } @@ -139,7 +137,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministratorConfigurationPatch FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministratorConfigurationPatch FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AdministratorConfigurationPatch.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AdministratorConfigurationPatch.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AdministratorConfigurationPatch.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AdministratorConfigurationPatch.TypeConverter.cs index 91996d2d6515..4d26f202a239 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AdministratorConfigurationPatch.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AdministratorConfigurationPatch.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IAdministratorConfigurationPatch ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministratorConfigurationPatch ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministratorConfigurationPatch).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministratorConfigurationPatch).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AdministratorConfigurationPatch.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AdministratorConfigurationPatch.cs new file mode 100644 index 000000000000..3d4360c41f59 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AdministratorConfigurationPatch.cs @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + + /// + /// AdministratorConfigurationPatch represents the patching capabilities for the administrator configuration. + /// + public partial class AdministratorConfigurationPatch : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministratorConfigurationPatch, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministratorConfigurationPatchInternal + { + + /// Backing field for property. + private System.Collections.Generic.List _sshPublicKey; + + /// + /// SshPublicKey represents the public key used to authenticate with a resource through SSH. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public System.Collections.Generic.List SshPublicKey { get => this._sshPublicKey; set => this._sshPublicKey = value; } + + /// Creates an new instance. + public AdministratorConfigurationPatch() + { + + } + } + /// AdministratorConfigurationPatch represents the patching capabilities for the administrator configuration. + public partial interface IAdministratorConfigurationPatch : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable + { + /// + /// SshPublicKey represents the public key used to authenticate with a resource through SSH. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"SshPublicKey represents the public key used to authenticate with a resource through SSH.", + SerializedName = @"sshPublicKeys", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISshPublicKey) })] + System.Collections.Generic.List SshPublicKey { get; set; } + + } + /// AdministratorConfigurationPatch represents the patching capabilities for the administrator configuration. + internal partial interface IAdministratorConfigurationPatchInternal + + { + /// + /// SshPublicKey represents the public key used to authenticate with a resource through SSH. + /// + System.Collections.Generic.List SshPublicKey { get; set; } + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AdministratorConfigurationPatch.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AdministratorConfigurationPatch.json.cs similarity index 90% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AdministratorConfigurationPatch.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AdministratorConfigurationPatch.json.cs index edfe03fe459e..ac9bf9ea32ba 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AdministratorConfigurationPatch.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AdministratorConfigurationPatch.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -67,18 +67,18 @@ internal AdministratorConfigurationPatch(Microsoft.Azure.PowerShell.Cmdlets.Netw { return; } - {_sshPublicKey = If( json?.PropertyT("sshPublicKeys"), out var __jsonSshPublicKeys) ? If( __jsonSshPublicKeys as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.ISshPublicKey) (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.SshPublicKey.FromJson(__u) )) ))() : null : SshPublicKey;} + {_sshPublicKey = If( json?.PropertyT("sshPublicKeys"), out var __jsonSshPublicKeys) ? If( __jsonSshPublicKeys as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.ISshPublicKey) (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.SshPublicKey.FromJson(__u) )) ))() : null : _sshPublicKey;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministratorConfigurationPatch. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministratorConfigurationPatch. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministratorConfigurationPatch. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministratorConfigurationPatch. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministratorConfigurationPatch FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministratorConfigurationPatch FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new AdministratorConfigurationPatch(json) : null; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AgentOptions.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AgentOptions.PowerShell.cs similarity index 79% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AgentOptions.PowerShell.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AgentOptions.PowerShell.cs index dec09933f3a0..e48d9c3b6a37 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AgentOptions.PowerShell.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AgentOptions.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; @@ -65,7 +65,7 @@ public partial class AgentOptions 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,17 +80,17 @@ internal AgentOptions(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("HugepagesCount")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentOptionsInternal)this).HugepagesCount = (long) content.GetValueForProperty("HugepagesCount",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentOptionsInternal)this).HugepagesCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentOptionsInternal)this).HugepagesCount = (long) content.GetValueForProperty("HugepagesCount",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentOptionsInternal)this).HugepagesCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); } if (content.Contains("HugepagesSize")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentOptionsInternal)this).HugepagesSize = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HugepagesSize?) content.GetValueForProperty("HugepagesSize",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentOptionsInternal)this).HugepagesSize, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HugepagesSize.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentOptionsInternal)this).HugepagesSize = (string) content.GetValueForProperty("HugepagesSize",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentOptionsInternal)this).HugepagesSize, 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. @@ -105,37 +105,37 @@ internal AgentOptions(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("HugepagesCount")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentOptionsInternal)this).HugepagesCount = (long) content.GetValueForProperty("HugepagesCount",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentOptionsInternal)this).HugepagesCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentOptionsInternal)this).HugepagesCount = (long) content.GetValueForProperty("HugepagesCount",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentOptionsInternal)this).HugepagesCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); } if (content.Contains("HugepagesSize")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentOptionsInternal)this).HugepagesSize = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HugepagesSize?) content.GetValueForProperty("HugepagesSize",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentOptionsInternal)this).HugepagesSize, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HugepagesSize.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentOptionsInternal)this).HugepagesSize = (string) content.GetValueForProperty("HugepagesSize",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentOptionsInternal)this).HugepagesSize, 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.NetworkCloud.Models.Api20250201.IAgentOptions DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentOptions DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new AgentOptions(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.NetworkCloud.Models.Api20250201.IAgentOptions DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentOptions DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new AgentOptions(content); } @@ -145,7 +145,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentOptions FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentOptions FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AgentOptions.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AgentOptions.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AgentOptions.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AgentOptions.TypeConverter.cs index 336d2841cf0d..448cd464a0b1 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AgentOptions.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AgentOptions.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IAgentOptions ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentOptions ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentOptions).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentOptions).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AgentOptions.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AgentOptions.cs similarity index 78% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AgentOptions.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AgentOptions.cs index 148c0ea8e4cd..6eab01343943 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AgentOptions.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AgentOptions.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -11,8 +11,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201 /// AgentOptions are configurations that will be applied to each agent in an agent pool. /// public partial class AgentOptions : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentOptions, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentOptionsInternal + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentOptions, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentOptionsInternal { /// Backing field for property. @@ -23,11 +23,11 @@ public partial class AgentOptions : public long HugepagesCount { get => this._hugepagesCount; set => this._hugepagesCount = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HugepagesSize? _hugepagesSize; + private string _hugepagesSize; /// The size of the hugepages to allocate. [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HugepagesSize? HugepagesSize { get => this._hugepagesSize; set => this._hugepagesSize = value; } + public string HugepagesSize { get => this._hugepagesSize; set => this._hugepagesSize = value; } /// Creates an new instance. public AgentOptions() @@ -43,6 +43,9 @@ public partial interface IAgentOptions : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The number of hugepages to allocate.", SerializedName = @"hugepagesCount", PossibleTypes = new [] { typeof(long) })] @@ -51,10 +54,14 @@ public partial interface IAgentOptions : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = false, Description = @"The size of the hugepages to allocate.", SerializedName = @"hugepagesSize", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HugepagesSize) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HugepagesSize? HugepagesSize { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("2M", "1G")] + string HugepagesSize { get; set; } } /// AgentOptions are configurations that will be applied to each agent in an agent pool. @@ -64,7 +71,8 @@ internal partial interface IAgentOptionsInternal /// The number of hugepages to allocate. long HugepagesCount { get; set; } /// The size of the hugepages to allocate. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HugepagesSize? HugepagesSize { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("2M", "1G")] + string HugepagesSize { get; set; } } } \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AgentOptions.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AgentOptions.json.cs similarity index 88% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AgentOptions.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AgentOptions.json.cs index d81178287f6a..9024d8cacea9 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AgentOptions.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AgentOptions.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -67,19 +67,19 @@ internal AgentOptions(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Js { return; } - {_hugepagesCount = If( json?.PropertyT("hugepagesCount"), out var __jsonHugepagesCount) ? (long)__jsonHugepagesCount : HugepagesCount;} - {_hugepagesSize = If( json?.PropertyT("hugepagesSize"), out var __jsonHugepagesSize) ? (string)__jsonHugepagesSize : (string)HugepagesSize;} + {_hugepagesCount = If( json?.PropertyT("hugepagesCount"), out var __jsonHugepagesCount) ? (long)__jsonHugepagesCount : _hugepagesCount;} + {_hugepagesSize = If( json?.PropertyT("hugepagesSize"), out var __jsonHugepagesSize) ? (string)__jsonHugepagesSize : (string)_hugepagesSize;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentOptions. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentOptions. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentOptions. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentOptions. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentOptions FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentOptions FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new AgentOptions(json) : null; } @@ -104,7 +104,10 @@ public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode ToJ return container; } AddIf( (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNumber(this._hugepagesCount), "hugepagesCount" ,container.Add ); - AddIf( null != (((object)this._hugepagesSize)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._hugepagesSize.ToString()) : null, "hugepagesSize" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)||serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate)) + { + AddIf( null != (((object)this._hugepagesSize)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._hugepagesSize.ToString()) : null, "hugepagesSize" ,container.Add ); + } AfterToJson(ref container); return container; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AgentPool.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AgentPool.PowerShell.cs new file mode 100644 index 000000000000..b7d9b7c40963 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AgentPool.PowerShell.cs @@ -0,0 +1,484 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + + /// AgentPool represents the agent pool of Kubernetes cluster. + [System.ComponentModel.TypeConverter(typeof(AgentPoolTypeConverter))] + public partial class AgentPool + { + + /// + /// 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 AgentPool(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ExtendedLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolInternal)this).ExtendedLocation = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocation) content.GetValueForProperty("ExtendedLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolInternal)this).ExtendedLocation, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ExtendedLocationTypeConverter.ConvertFrom); + } + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AgentPoolPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Etag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolInternal)this).Etag, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)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("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedByType = (string) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedByType = (string) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.TrackedResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("ExtendedLocationName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolInternal)this).ExtendedLocationName = (string) content.GetValueForProperty("ExtendedLocationName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolInternal)this).ExtendedLocationName, global::System.Convert.ToString); + } + if (content.Contains("ExtendedLocationType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolInternal)this).ExtendedLocationType = (string) content.GetValueForProperty("ExtendedLocationType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolInternal)this).ExtendedLocationType, global::System.Convert.ToString); + } + if (content.Contains("AdministratorConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolInternal)this).AdministratorConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministratorConfiguration) content.GetValueForProperty("AdministratorConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolInternal)this).AdministratorConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AdministratorConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("AgentOption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolInternal)this).AgentOption = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentOptions) content.GetValueForProperty("AgentOption",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolInternal)this).AgentOption, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AgentOptionsTypeConverter.ConvertFrom); + } + if (content.Contains("AttachedNetworkConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolInternal)this).AttachedNetworkConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAttachedNetworkConfiguration) content.GetValueForProperty("AttachedNetworkConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolInternal)this).AttachedNetworkConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AttachedNetworkConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("UpgradeSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolInternal)this).UpgradeSetting = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolUpgradeSettings) content.GetValueForProperty("UpgradeSetting",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolInternal)this).UpgradeSetting, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AgentPoolUpgradeSettingsTypeConverter.ConvertFrom); + } + if (content.Contains("AvailabilityZone")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolInternal)this).AvailabilityZone = (System.Collections.Generic.List) content.GetValueForProperty("AvailabilityZone",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolInternal)this).AvailabilityZone, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("Count")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolInternal)this).Count = (long) content.GetValueForProperty("Count",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolInternal)this).Count, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("DetailedStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolInternal)this).DetailedStatus = (string) content.GetValueForProperty("DetailedStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolInternal)this).DetailedStatus, global::System.Convert.ToString); + } + if (content.Contains("DetailedStatusMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolInternal)this).DetailedStatusMessage = (string) content.GetValueForProperty("DetailedStatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolInternal)this).DetailedStatusMessage, global::System.Convert.ToString); + } + if (content.Contains("KubernetesVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolInternal)this).KubernetesVersion = (string) content.GetValueForProperty("KubernetesVersion",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolInternal)this).KubernetesVersion, global::System.Convert.ToString); + } + if (content.Contains("Label")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolInternal)this).Label = (System.Collections.Generic.List) content.GetValueForProperty("Label",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolInternal)this).Label, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.KubernetesLabelTypeConverter.ConvertFrom)); + } + if (content.Contains("Mode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolInternal)this).Mode = (string) content.GetValueForProperty("Mode",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolInternal)this).Mode, global::System.Convert.ToString); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("Taint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolInternal)this).Taint = (System.Collections.Generic.List) content.GetValueForProperty("Taint",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolInternal)this).Taint, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.KubernetesLabelTypeConverter.ConvertFrom)); + } + if (content.Contains("VMSkuName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolInternal)this).VMSkuName = (string) content.GetValueForProperty("VMSkuName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolInternal)this).VMSkuName, global::System.Convert.ToString); + } + if (content.Contains("AdministratorConfigurationAdminUsername")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolInternal)this).AdministratorConfigurationAdminUsername = (string) content.GetValueForProperty("AdministratorConfigurationAdminUsername",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolInternal)this).AdministratorConfigurationAdminUsername, global::System.Convert.ToString); + } + if (content.Contains("AgentOptionHugepagesCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolInternal)this).AgentOptionHugepagesCount = (long?) content.GetValueForProperty("AgentOptionHugepagesCount",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolInternal)this).AgentOptionHugepagesCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("AgentOptionHugepagesSize")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolInternal)this).AgentOptionHugepagesSize = (string) content.GetValueForProperty("AgentOptionHugepagesSize",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolInternal)this).AgentOptionHugepagesSize, global::System.Convert.ToString); + } + if (content.Contains("AttachedNetworkConfigurationL2Network")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolInternal)this).AttachedNetworkConfigurationL2Network = (System.Collections.Generic.List) content.GetValueForProperty("AttachedNetworkConfigurationL2Network",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolInternal)this).AttachedNetworkConfigurationL2Network, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.L2NetworkAttachmentConfigurationTypeConverter.ConvertFrom)); + } + if (content.Contains("AttachedNetworkConfigurationL3Network")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolInternal)this).AttachedNetworkConfigurationL3Network = (System.Collections.Generic.List) content.GetValueForProperty("AttachedNetworkConfigurationL3Network",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolInternal)this).AttachedNetworkConfigurationL3Network, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.L3NetworkAttachmentConfigurationTypeConverter.ConvertFrom)); + } + if (content.Contains("AttachedNetworkConfigurationTrunkedNetwork")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolInternal)this).AttachedNetworkConfigurationTrunkedNetwork = (System.Collections.Generic.List) content.GetValueForProperty("AttachedNetworkConfigurationTrunkedNetwork",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolInternal)this).AttachedNetworkConfigurationTrunkedNetwork, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.TrunkedNetworkAttachmentConfigurationTypeConverter.ConvertFrom)); + } + if (content.Contains("AdministratorConfigurationSshPublicKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolInternal)this).AdministratorConfigurationSshPublicKey = (System.Collections.Generic.List) content.GetValueForProperty("AdministratorConfigurationSshPublicKey",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolInternal)this).AdministratorConfigurationSshPublicKey, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.SshPublicKeyTypeConverter.ConvertFrom)); + } + if (content.Contains("UpgradeSettingDrainTimeout")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolInternal)this).UpgradeSettingDrainTimeout = (long?) content.GetValueForProperty("UpgradeSettingDrainTimeout",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolInternal)this).UpgradeSettingDrainTimeout, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("UpgradeSettingMaxSurge")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolInternal)this).UpgradeSettingMaxSurge = (string) content.GetValueForProperty("UpgradeSettingMaxSurge",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolInternal)this).UpgradeSettingMaxSurge, global::System.Convert.ToString); + } + if (content.Contains("UpgradeSettingMaxUnavailable")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolInternal)this).UpgradeSettingMaxUnavailable = (string) content.GetValueForProperty("UpgradeSettingMaxUnavailable",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolInternal)this).UpgradeSettingMaxUnavailable, 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 AgentPool(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ExtendedLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolInternal)this).ExtendedLocation = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocation) content.GetValueForProperty("ExtendedLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolInternal)this).ExtendedLocation, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ExtendedLocationTypeConverter.ConvertFrom); + } + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AgentPoolPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Etag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolInternal)this).Etag, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)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("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedByType = (string) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedByType = (string) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.TrackedResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("ExtendedLocationName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolInternal)this).ExtendedLocationName = (string) content.GetValueForProperty("ExtendedLocationName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolInternal)this).ExtendedLocationName, global::System.Convert.ToString); + } + if (content.Contains("ExtendedLocationType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolInternal)this).ExtendedLocationType = (string) content.GetValueForProperty("ExtendedLocationType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolInternal)this).ExtendedLocationType, global::System.Convert.ToString); + } + if (content.Contains("AdministratorConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolInternal)this).AdministratorConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministratorConfiguration) content.GetValueForProperty("AdministratorConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolInternal)this).AdministratorConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AdministratorConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("AgentOption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolInternal)this).AgentOption = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentOptions) content.GetValueForProperty("AgentOption",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolInternal)this).AgentOption, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AgentOptionsTypeConverter.ConvertFrom); + } + if (content.Contains("AttachedNetworkConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolInternal)this).AttachedNetworkConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAttachedNetworkConfiguration) content.GetValueForProperty("AttachedNetworkConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolInternal)this).AttachedNetworkConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AttachedNetworkConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("UpgradeSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolInternal)this).UpgradeSetting = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolUpgradeSettings) content.GetValueForProperty("UpgradeSetting",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolInternal)this).UpgradeSetting, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AgentPoolUpgradeSettingsTypeConverter.ConvertFrom); + } + if (content.Contains("AvailabilityZone")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolInternal)this).AvailabilityZone = (System.Collections.Generic.List) content.GetValueForProperty("AvailabilityZone",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolInternal)this).AvailabilityZone, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("Count")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolInternal)this).Count = (long) content.GetValueForProperty("Count",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolInternal)this).Count, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("DetailedStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolInternal)this).DetailedStatus = (string) content.GetValueForProperty("DetailedStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolInternal)this).DetailedStatus, global::System.Convert.ToString); + } + if (content.Contains("DetailedStatusMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolInternal)this).DetailedStatusMessage = (string) content.GetValueForProperty("DetailedStatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolInternal)this).DetailedStatusMessage, global::System.Convert.ToString); + } + if (content.Contains("KubernetesVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolInternal)this).KubernetesVersion = (string) content.GetValueForProperty("KubernetesVersion",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolInternal)this).KubernetesVersion, global::System.Convert.ToString); + } + if (content.Contains("Label")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolInternal)this).Label = (System.Collections.Generic.List) content.GetValueForProperty("Label",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolInternal)this).Label, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.KubernetesLabelTypeConverter.ConvertFrom)); + } + if (content.Contains("Mode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolInternal)this).Mode = (string) content.GetValueForProperty("Mode",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolInternal)this).Mode, global::System.Convert.ToString); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("Taint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolInternal)this).Taint = (System.Collections.Generic.List) content.GetValueForProperty("Taint",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolInternal)this).Taint, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.KubernetesLabelTypeConverter.ConvertFrom)); + } + if (content.Contains("VMSkuName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolInternal)this).VMSkuName = (string) content.GetValueForProperty("VMSkuName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolInternal)this).VMSkuName, global::System.Convert.ToString); + } + if (content.Contains("AdministratorConfigurationAdminUsername")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolInternal)this).AdministratorConfigurationAdminUsername = (string) content.GetValueForProperty("AdministratorConfigurationAdminUsername",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolInternal)this).AdministratorConfigurationAdminUsername, global::System.Convert.ToString); + } + if (content.Contains("AgentOptionHugepagesCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolInternal)this).AgentOptionHugepagesCount = (long?) content.GetValueForProperty("AgentOptionHugepagesCount",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolInternal)this).AgentOptionHugepagesCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("AgentOptionHugepagesSize")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolInternal)this).AgentOptionHugepagesSize = (string) content.GetValueForProperty("AgentOptionHugepagesSize",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolInternal)this).AgentOptionHugepagesSize, global::System.Convert.ToString); + } + if (content.Contains("AttachedNetworkConfigurationL2Network")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolInternal)this).AttachedNetworkConfigurationL2Network = (System.Collections.Generic.List) content.GetValueForProperty("AttachedNetworkConfigurationL2Network",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolInternal)this).AttachedNetworkConfigurationL2Network, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.L2NetworkAttachmentConfigurationTypeConverter.ConvertFrom)); + } + if (content.Contains("AttachedNetworkConfigurationL3Network")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolInternal)this).AttachedNetworkConfigurationL3Network = (System.Collections.Generic.List) content.GetValueForProperty("AttachedNetworkConfigurationL3Network",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolInternal)this).AttachedNetworkConfigurationL3Network, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.L3NetworkAttachmentConfigurationTypeConverter.ConvertFrom)); + } + if (content.Contains("AttachedNetworkConfigurationTrunkedNetwork")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolInternal)this).AttachedNetworkConfigurationTrunkedNetwork = (System.Collections.Generic.List) content.GetValueForProperty("AttachedNetworkConfigurationTrunkedNetwork",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolInternal)this).AttachedNetworkConfigurationTrunkedNetwork, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.TrunkedNetworkAttachmentConfigurationTypeConverter.ConvertFrom)); + } + if (content.Contains("AdministratorConfigurationSshPublicKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolInternal)this).AdministratorConfigurationSshPublicKey = (System.Collections.Generic.List) content.GetValueForProperty("AdministratorConfigurationSshPublicKey",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolInternal)this).AdministratorConfigurationSshPublicKey, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.SshPublicKeyTypeConverter.ConvertFrom)); + } + if (content.Contains("UpgradeSettingDrainTimeout")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolInternal)this).UpgradeSettingDrainTimeout = (long?) content.GetValueForProperty("UpgradeSettingDrainTimeout",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolInternal)this).UpgradeSettingDrainTimeout, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("UpgradeSettingMaxSurge")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolInternal)this).UpgradeSettingMaxSurge = (string) content.GetValueForProperty("UpgradeSettingMaxSurge",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolInternal)this).UpgradeSettingMaxSurge, global::System.Convert.ToString); + } + if (content.Contains("UpgradeSettingMaxUnavailable")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolInternal)this).UpgradeSettingMaxUnavailable = (string) content.GetValueForProperty("UpgradeSettingMaxUnavailable",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolInternal)this).UpgradeSettingMaxUnavailable, 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.NetworkCloud.Models.IAgentPool DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new AgentPool(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.NetworkCloud.Models.IAgentPool DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new AgentPool(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.NetworkCloud.Models.IAgentPool FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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(); + } + } + /// AgentPool represents the agent pool of Kubernetes cluster. + [System.ComponentModel.TypeConverter(typeof(AgentPoolTypeConverter))] + public partial interface IAgentPool + + { + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AgentPool.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AgentPool.TypeConverter.cs similarity index 98% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AgentPool.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AgentPool.TypeConverter.cs index fb4845ddf106..c395a4129f8f 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AgentPool.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AgentPool.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IAgentPool ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPool ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPool).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPool).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AgentPool.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AgentPool.cs new file mode 100644 index 000000000000..e63e356b8413 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AgentPool.cs @@ -0,0 +1,688 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + + /// AgentPool represents the agent pool of Kubernetes cluster. + public partial class AgentPool : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPool, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolInternal, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResource __trackedResource = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.TrackedResource(); + + /// + /// The user name for the administrator that will be applied to the operating systems that run Kubernetes nodes. If not supplied, + /// a user name will be chosen by the service. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string AdministratorConfigurationAdminUsername { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPropertiesInternal)Property).AdministratorConfigurationAdminUsername; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPropertiesInternal)Property).AdministratorConfigurationAdminUsername = value ?? null; } + + /// + /// The SSH configuration for the operating systems that run the nodes in the Kubernetes cluster. In some cases, specification + /// of public keys may be required to produce a working environment. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public System.Collections.Generic.List AdministratorConfigurationSshPublicKey { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPropertiesInternal)Property).AdministratorConfigurationSshPublicKey; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPropertiesInternal)Property).AdministratorConfigurationSshPublicKey = value ?? null /* arrayOf */; } + + /// The number of hugepages to allocate. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public long? AgentOptionHugepagesCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPropertiesInternal)Property).AgentOptionHugepagesCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPropertiesInternal)Property).AgentOptionHugepagesCount = value ?? default(long); } + + /// The size of the hugepages to allocate. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string AgentOptionHugepagesSize { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPropertiesInternal)Property).AgentOptionHugepagesSize; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPropertiesInternal)Property).AgentOptionHugepagesSize = value ?? null; } + + /// The list of Layer 2 Networks and related configuration for attachment. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public System.Collections.Generic.List AttachedNetworkConfigurationL2Network { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPropertiesInternal)Property).AttachedNetworkConfigurationL2Network; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPropertiesInternal)Property).AttachedNetworkConfigurationL2Network = value ?? null /* arrayOf */; } + + /// The list of Layer 3 Networks and related configuration for attachment. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public System.Collections.Generic.List AttachedNetworkConfigurationL3Network { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPropertiesInternal)Property).AttachedNetworkConfigurationL3Network; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPropertiesInternal)Property).AttachedNetworkConfigurationL3Network = value ?? null /* arrayOf */; } + + /// The list of Trunked Networks and related configuration for attachment. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public System.Collections.Generic.List AttachedNetworkConfigurationTrunkedNetwork { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPropertiesInternal)Property).AttachedNetworkConfigurationTrunkedNetwork; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPropertiesInternal)Property).AttachedNetworkConfigurationTrunkedNetwork = value ?? null /* arrayOf */; } + + /// + /// The list of availability zones of the Network Cloud cluster used for the provisioning of nodes in this agent pool. If + /// not specified, all availability zones will be used. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public System.Collections.Generic.List AvailabilityZone { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPropertiesInternal)Property).AvailabilityZone; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPropertiesInternal)Property).AvailabilityZone = value ?? null /* arrayOf */; } + + /// The number of virtual machines that use this configuration. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public long Count { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPropertiesInternal)Property).Count; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPropertiesInternal)Property).Count = value ; } + + /// The current status of the agent pool. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string DetailedStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPropertiesInternal)Property).DetailedStatus; } + + /// The descriptive message about the current detailed status. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string DetailedStatusMessage { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPropertiesInternal)Property).DetailedStatusMessage; } + + /// Backing field for property. + private string _etag; + + /// Resource ETag. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string Etag { get => this._etag; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocation _extendedLocation; + + /// The extended location of the cluster associated with the resource. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocation ExtendedLocation { get => (this._extendedLocation = this._extendedLocation ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ExtendedLocation()); set => this._extendedLocation = value; } + + /// The resource ID of the extended location on which the resource will be created. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string ExtendedLocationName { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocationInternal)ExtendedLocation).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocationInternal)ExtendedLocation).Name = value ?? null; } + + /// The extended location type, for example, CustomLocation. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string ExtendedLocationType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocationInternal)ExtendedLocation).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocationInternal)ExtendedLocation).Type = value ?? null; } + + /// + /// Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).Id; } + + /// The Kubernetes version running in this agent pool. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string KubernetesVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPropertiesInternal)Property).KubernetesVersion; } + + /// The labels applied to the nodes in this agent pool. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public System.Collections.Generic.List Label { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPropertiesInternal)Property).Label; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPropertiesInternal)Property).Label = value ?? null /* arrayOf */; } + + /// The geo-location where the resource lives + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)__trackedResource).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)__trackedResource).Location = value ?? null; } + + /// Internal Acessors for AdministratorConfiguration + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministratorConfiguration Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolInternal.AdministratorConfiguration { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPropertiesInternal)Property).AdministratorConfiguration; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPropertiesInternal)Property).AdministratorConfiguration = value ?? null /* model class */; } + + /// Internal Acessors for AgentOption + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentOptions Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolInternal.AgentOption { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPropertiesInternal)Property).AgentOption; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPropertiesInternal)Property).AgentOption = value ?? null /* model class */; } + + /// Internal Acessors for AttachedNetworkConfiguration + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAttachedNetworkConfiguration Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolInternal.AttachedNetworkConfiguration { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPropertiesInternal)Property).AttachedNetworkConfiguration; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPropertiesInternal)Property).AttachedNetworkConfiguration = value ?? null /* model class */; } + + /// Internal Acessors for DetailedStatus + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolInternal.DetailedStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPropertiesInternal)Property).DetailedStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPropertiesInternal)Property).DetailedStatus = value ?? null; } + + /// Internal Acessors for DetailedStatusMessage + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolInternal.DetailedStatusMessage { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPropertiesInternal)Property).DetailedStatusMessage; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPropertiesInternal)Property).DetailedStatusMessage = value ?? null; } + + /// Internal Acessors for Etag + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolInternal.Etag { get => this._etag; set { {_etag = value;} } } + + /// Internal Acessors for ExtendedLocation + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocation Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolInternal.ExtendedLocation { get => (this._extendedLocation = this._extendedLocation ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ExtendedLocation()); set { {_extendedLocation = value;} } } + + /// Internal Acessors for KubernetesVersion + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolInternal.KubernetesVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPropertiesInternal)Property).KubernetesVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPropertiesInternal)Property).KubernetesVersion = value ?? null; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolProperties Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AgentPoolProperties()); set { {_property = value;} } } + + /// Internal Acessors for ProvisioningState + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPropertiesInternal)Property).ProvisioningState = value ?? null; } + + /// Internal Acessors for UpgradeSetting + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolUpgradeSettings Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolInternal.UpgradeSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPropertiesInternal)Property).UpgradeSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPropertiesInternal)Property).UpgradeSetting = value ?? null /* model class */; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).Id = value ?? null; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).Name = value ?? null; } + + /// Internal Acessors for SystemData + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISystemData Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemData; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemData = value ?? null /* model class */; } + + /// Internal Acessors for SystemDataCreatedAt + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataCreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataCreatedAt = value ?? default(global::System.DateTime); } + + /// Internal Acessors for SystemDataCreatedBy + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataCreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataCreatedBy = value ?? null; } + + /// Internal Acessors for SystemDataCreatedByType + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataCreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataCreatedByType = value ?? null; } + + /// Internal Acessors for SystemDataLastModifiedAt + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedAt = value ?? default(global::System.DateTime); } + + /// Internal Acessors for SystemDataLastModifiedBy + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedBy = value ?? null; } + + /// Internal Acessors for SystemDataLastModifiedByType + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedByType = value ?? null; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).Type = value ?? null; } + + /// + /// The selection of how this agent pool is utilized, either as a system pool or a user pool. System pools run the features + /// and critical services for the Kubernetes Cluster, while user pools are dedicated to user workloads. Every Kubernetes cluster + /// must contain at least one system node pool with at least one node. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string Mode { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPropertiesInternal)Property).Mode; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPropertiesInternal)Property).Mode = value ?? null; } + + /// The name of the resource + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).Name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolProperties _property; + + /// The list of the resource properties. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AgentPoolProperties()); set => this._property = value; } + + /// The provisioning state of the agent pool. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPropertiesInternal)Property).ProvisioningState; } + + /// Gets the resource group name + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string ResourceGroupName { get => (new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Success ? new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Groups["resourceGroupName"].Value : null); } + + /// + /// Azure Resource Manager metadata containing createdBy and modifiedBy information. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISystemData SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemData; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemData = value ?? null /* model class */; } + + /// The timestamp of resource creation (UTC). + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataCreatedAt; } + + /// The identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataCreatedBy; } + + /// The type of identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public string SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataCreatedByType; } + + /// The timestamp of resource last modification (UTC) + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedAt; } + + /// The identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedBy; } + + /// The type of identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public string SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedByType; } + + /// Resource tags. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)__trackedResource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)__trackedResource).Tag = value ?? null /* model class */; } + + /// The taints applied to the nodes in this agent pool. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public System.Collections.Generic.List Taint { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPropertiesInternal)Property).Taint; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPropertiesInternal)Property).Taint = value ?? null /* arrayOf */; } + + /// + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).Type; } + + /// + /// The maximum time in seconds that is allowed for a node drain to complete before proceeding with the upgrade of the agent + /// pool. If not specified during creation, a value of 1800 seconds is used. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public long? UpgradeSettingDrainTimeout { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPropertiesInternal)Property).UpgradeSettingDrainTimeout; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPropertiesInternal)Property).UpgradeSettingDrainTimeout = value ?? default(long); } + + /// + /// The maximum number or percentage of nodes that are surged during upgrade. This can either be set to an integer (e.g. '5') + /// or a percentage (e.g. '50%'). If a percentage is specified, it is the percentage of the total agent pool size at the time + /// of the upgrade. For percentages, fractional nodes are rounded up. If not specified during creation, a value of 1 is used. + /// One of MaxSurge and MaxUnavailable must be greater than 0. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string UpgradeSettingMaxSurge { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPropertiesInternal)Property).UpgradeSettingMaxSurge; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPropertiesInternal)Property).UpgradeSettingMaxSurge = value ?? null; } + + /// + /// The maximum number or percentage of nodes that can be unavailable during upgrade. This can either be set to an integer + /// (e.g. '5') or a percentage (e.g. '50%'). If a percentage is specified, it is the percentage of the total agent pool size + /// at the time of the upgrade. For percentages, fractional nodes are rounded up. If not specified during creation, a value + /// of 0 is used. One of MaxSurge and MaxUnavailable must be greater than 0. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string UpgradeSettingMaxUnavailable { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPropertiesInternal)Property).UpgradeSettingMaxUnavailable; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPropertiesInternal)Property).UpgradeSettingMaxUnavailable = value ?? null; } + + /// + /// The name of the VM SKU that determines the size of resources allocated for node VMs. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string VMSkuName { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPropertiesInternal)Property).VMSkuName; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPropertiesInternal)Property).VMSkuName = value ?? null; } + + /// Creates an new instance. + public AgentPool() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__trackedResource), __trackedResource); + await eventListener.AssertObjectIsValid(nameof(__trackedResource), __trackedResource); + } + } + /// AgentPool represents the agent pool of Kubernetes cluster. + public partial interface IAgentPool : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResource + { + /// + /// The user name for the administrator that will be applied to the operating systems that run Kubernetes nodes. If not supplied, + /// a user name will be chosen by the service. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The user name for the administrator that will be applied to the operating systems that run Kubernetes nodes. If not supplied, a user name will be chosen by the service.", + SerializedName = @"adminUsername", + PossibleTypes = new [] { typeof(string) })] + string AdministratorConfigurationAdminUsername { get; set; } + /// + /// The SSH configuration for the operating systems that run the nodes in the Kubernetes cluster. In some cases, specification + /// of public keys may be required to produce a working environment. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The SSH configuration for the operating systems that run the nodes in the Kubernetes cluster. In some cases, specification of public keys may be required to produce a working environment.", + SerializedName = @"sshPublicKeys", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISshPublicKey) })] + System.Collections.Generic.List AdministratorConfigurationSshPublicKey { get; set; } + /// The number of hugepages to allocate. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The number of hugepages to allocate.", + SerializedName = @"hugepagesCount", + PossibleTypes = new [] { typeof(long) })] + long? AgentOptionHugepagesCount { get; set; } + /// The size of the hugepages to allocate. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The size of the hugepages to allocate.", + SerializedName = @"hugepagesSize", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("2M", "1G")] + string AgentOptionHugepagesSize { get; set; } + /// The list of Layer 2 Networks and related configuration for attachment. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The list of Layer 2 Networks and related configuration for attachment.", + SerializedName = @"l2Networks", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkAttachmentConfiguration) })] + System.Collections.Generic.List AttachedNetworkConfigurationL2Network { get; set; } + /// The list of Layer 3 Networks and related configuration for attachment. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The list of Layer 3 Networks and related configuration for attachment.", + SerializedName = @"l3Networks", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkAttachmentConfiguration) })] + System.Collections.Generic.List AttachedNetworkConfigurationL3Network { get; set; } + /// The list of Trunked Networks and related configuration for attachment. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The list of Trunked Networks and related configuration for attachment.", + SerializedName = @"trunkedNetworks", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkAttachmentConfiguration) })] + System.Collections.Generic.List AttachedNetworkConfigurationTrunkedNetwork { get; set; } + /// + /// The list of availability zones of the Network Cloud cluster used for the provisioning of nodes in this agent pool. If + /// not specified, all availability zones will be used. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The list of availability zones of the Network Cloud cluster used for the provisioning of nodes in this agent pool. If not specified, all availability zones will be used.", + SerializedName = @"availabilityZones", + PossibleTypes = new [] { typeof(string) })] + System.Collections.Generic.List AvailabilityZone { get; set; } + /// The number of virtual machines that use this configuration. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The number of virtual machines that use this configuration.", + SerializedName = @"count", + PossibleTypes = new [] { typeof(long) })] + long Count { get; set; } + /// The current status of the agent pool. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The current status of the agent pool.", + SerializedName = @"detailedStatus", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Available", "Error", "Provisioning")] + string DetailedStatus { get; } + /// The descriptive message about the current detailed status. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The descriptive message about the current detailed status.", + SerializedName = @"detailedStatusMessage", + PossibleTypes = new [] { typeof(string) })] + string DetailedStatusMessage { get; } + /// Resource ETag. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"Resource ETag.", + SerializedName = @"etag", + PossibleTypes = new [] { typeof(string) })] + string Etag { get; } + /// The resource ID of the extended location on which the resource will be created. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The resource ID of the extended location on which the resource will be created.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string ExtendedLocationName { get; set; } + /// The extended location type, for example, CustomLocation. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The extended location type, for example, CustomLocation.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + string ExtendedLocationType { get; set; } + /// The Kubernetes version running in this agent pool. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The Kubernetes version running in this agent pool.", + SerializedName = @"kubernetesVersion", + PossibleTypes = new [] { typeof(string) })] + string KubernetesVersion { get; } + /// The labels applied to the nodes in this agent pool. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The labels applied to the nodes in this agent pool.", + SerializedName = @"labels", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesLabel) })] + System.Collections.Generic.List Label { get; set; } + /// + /// The selection of how this agent pool is utilized, either as a system pool or a user pool. System pools run the features + /// and critical services for the Kubernetes Cluster, while user pools are dedicated to user workloads. Every Kubernetes cluster + /// must contain at least one system node pool with at least one node. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The selection of how this agent pool is utilized, either as a system pool or a user pool. System pools run the features and critical services for the Kubernetes Cluster, while user pools are dedicated to user workloads. Every Kubernetes cluster must contain at least one system node pool with at least one node.", + SerializedName = @"mode", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("System", "User", "NotApplicable")] + string Mode { get; set; } + /// The provisioning state of the agent pool. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The provisioning state of the agent pool.", + SerializedName = @"provisioningState", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Accepted", "Canceled", "Deleting", "Failed", "InProgress", "Succeeded", "Updating")] + string ProvisioningState { get; } + /// The taints applied to the nodes in this agent pool. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The taints applied to the nodes in this agent pool.", + SerializedName = @"taints", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesLabel) })] + System.Collections.Generic.List Taint { get; set; } + /// + /// The maximum time in seconds that is allowed for a node drain to complete before proceeding with the upgrade of the agent + /// pool. If not specified during creation, a value of 1800 seconds is used. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The maximum time in seconds that is allowed for a node drain to complete before proceeding with the upgrade of the agent pool. If not specified during creation, a value of 1800 seconds is used.", + SerializedName = @"drainTimeout", + PossibleTypes = new [] { typeof(long) })] + long? UpgradeSettingDrainTimeout { get; set; } + /// + /// The maximum number or percentage of nodes that are surged during upgrade. This can either be set to an integer (e.g. '5') + /// or a percentage (e.g. '50%'). If a percentage is specified, it is the percentage of the total agent pool size at the time + /// of the upgrade. For percentages, fractional nodes are rounded up. If not specified during creation, a value of 1 is used. + /// One of MaxSurge and MaxUnavailable must be greater than 0. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The maximum number or percentage of nodes that are surged during upgrade. This can either be set to an integer (e.g. '5') or a percentage (e.g. '50%'). If a percentage is specified, it is the percentage of the total agent pool size at the time of the upgrade. For percentages, fractional nodes are rounded up. If not specified during creation, a value of 1 is used. One of MaxSurge and MaxUnavailable must be greater than 0.", + SerializedName = @"maxSurge", + PossibleTypes = new [] { typeof(string) })] + string UpgradeSettingMaxSurge { get; set; } + /// + /// The maximum number or percentage of nodes that can be unavailable during upgrade. This can either be set to an integer + /// (e.g. '5') or a percentage (e.g. '50%'). If a percentage is specified, it is the percentage of the total agent pool size + /// at the time of the upgrade. For percentages, fractional nodes are rounded up. If not specified during creation, a value + /// of 0 is used. One of MaxSurge and MaxUnavailable must be greater than 0. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The maximum number or percentage of nodes that can be unavailable during upgrade. This can either be set to an integer (e.g. '5') or a percentage (e.g. '50%'). If a percentage is specified, it is the percentage of the total agent pool size at the time of the upgrade. For percentages, fractional nodes are rounded up. If not specified during creation, a value of 0 is used. One of MaxSurge and MaxUnavailable must be greater than 0.", + SerializedName = @"maxUnavailable", + PossibleTypes = new [] { typeof(string) })] + string UpgradeSettingMaxUnavailable { get; set; } + /// + /// The name of the VM SKU that determines the size of resources allocated for node VMs. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The name of the VM SKU that determines the size of resources allocated for node VMs.", + SerializedName = @"vmSkuName", + PossibleTypes = new [] { typeof(string) })] + string VMSkuName { get; set; } + + } + /// AgentPool represents the agent pool of Kubernetes cluster. + internal partial interface IAgentPoolInternal : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal + { + /// The administrator credentials to be used for the nodes in this agent pool. + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministratorConfiguration AdministratorConfiguration { get; set; } + /// + /// The user name for the administrator that will be applied to the operating systems that run Kubernetes nodes. If not supplied, + /// a user name will be chosen by the service. + /// + string AdministratorConfigurationAdminUsername { get; set; } + /// + /// The SSH configuration for the operating systems that run the nodes in the Kubernetes cluster. In some cases, specification + /// of public keys may be required to produce a working environment. + /// + System.Collections.Generic.List AdministratorConfigurationSshPublicKey { get; set; } + /// The configurations that will be applied to each agent in this agent pool. + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentOptions AgentOption { get; set; } + /// The number of hugepages to allocate. + long? AgentOptionHugepagesCount { get; set; } + /// The size of the hugepages to allocate. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("2M", "1G")] + string AgentOptionHugepagesSize { get; set; } + /// + /// The configuration of networks being attached to the agent pool for use by the workloads that run on this Kubernetes cluster. + /// + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAttachedNetworkConfiguration AttachedNetworkConfiguration { get; set; } + /// The list of Layer 2 Networks and related configuration for attachment. + System.Collections.Generic.List AttachedNetworkConfigurationL2Network { get; set; } + /// The list of Layer 3 Networks and related configuration for attachment. + System.Collections.Generic.List AttachedNetworkConfigurationL3Network { get; set; } + /// The list of Trunked Networks and related configuration for attachment. + System.Collections.Generic.List AttachedNetworkConfigurationTrunkedNetwork { get; set; } + /// + /// The list of availability zones of the Network Cloud cluster used for the provisioning of nodes in this agent pool. If + /// not specified, all availability zones will be used. + /// + System.Collections.Generic.List AvailabilityZone { get; set; } + /// The number of virtual machines that use this configuration. + long Count { get; set; } + /// The current status of the agent pool. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Available", "Error", "Provisioning")] + string DetailedStatus { get; set; } + /// The descriptive message about the current detailed status. + string DetailedStatusMessage { get; set; } + /// Resource ETag. + string Etag { get; set; } + /// The extended location of the cluster associated with the resource. + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocation ExtendedLocation { get; set; } + /// The resource ID of the extended location on which the resource will be created. + string ExtendedLocationName { get; set; } + /// The extended location type, for example, CustomLocation. + string ExtendedLocationType { get; set; } + /// The Kubernetes version running in this agent pool. + string KubernetesVersion { get; set; } + /// The labels applied to the nodes in this agent pool. + System.Collections.Generic.List Label { get; set; } + /// + /// The selection of how this agent pool is utilized, either as a system pool or a user pool. System pools run the features + /// and critical services for the Kubernetes Cluster, while user pools are dedicated to user workloads. Every Kubernetes cluster + /// must contain at least one system node pool with at least one node. + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("System", "User", "NotApplicable")] + string Mode { get; set; } + /// The list of the resource properties. + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolProperties Property { get; set; } + /// The provisioning state of the agent pool. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Accepted", "Canceled", "Deleting", "Failed", "InProgress", "Succeeded", "Updating")] + string ProvisioningState { get; set; } + /// The taints applied to the nodes in this agent pool. + System.Collections.Generic.List Taint { get; set; } + /// The configuration of the agent pool. + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolUpgradeSettings UpgradeSetting { get; set; } + /// + /// The maximum time in seconds that is allowed for a node drain to complete before proceeding with the upgrade of the agent + /// pool. If not specified during creation, a value of 1800 seconds is used. + /// + long? UpgradeSettingDrainTimeout { get; set; } + /// + /// The maximum number or percentage of nodes that are surged during upgrade. This can either be set to an integer (e.g. '5') + /// or a percentage (e.g. '50%'). If a percentage is specified, it is the percentage of the total agent pool size at the time + /// of the upgrade. For percentages, fractional nodes are rounded up. If not specified during creation, a value of 1 is used. + /// One of MaxSurge and MaxUnavailable must be greater than 0. + /// + string UpgradeSettingMaxSurge { get; set; } + /// + /// The maximum number or percentage of nodes that can be unavailable during upgrade. This can either be set to an integer + /// (e.g. '5') or a percentage (e.g. '50%'). If a percentage is specified, it is the percentage of the total agent pool size + /// at the time of the upgrade. For percentages, fractional nodes are rounded up. If not specified during creation, a value + /// of 0 is used. One of MaxSurge and MaxUnavailable must be greater than 0. + /// + string UpgradeSettingMaxUnavailable { get; set; } + /// + /// The name of the VM SKU that determines the size of resources allocated for node VMs. + /// + string VMSkuName { get; set; } + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AgentPool.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AgentPool.json.cs similarity index 92% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AgentPool.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AgentPool.json.cs index 963ea7738c69..2dc40a16e44a 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AgentPool.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AgentPool.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -65,21 +65,21 @@ internal AgentPool(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json. { return; } - __trackedResource = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.TrackedResource(json); - {_extendedLocation = If( json?.PropertyT("extendedLocation"), out var __jsonExtendedLocation) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ExtendedLocation.FromJson(__jsonExtendedLocation) : ExtendedLocation;} - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AgentPoolProperties.FromJson(__jsonProperties) : Property;} - {_etag = If( json?.PropertyT("etag"), out var __jsonEtag) ? (string)__jsonEtag : (string)Etag;} + __trackedResource = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.TrackedResource(json); + {_extendedLocation = If( json?.PropertyT("extendedLocation"), out var __jsonExtendedLocation) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ExtendedLocation.FromJson(__jsonExtendedLocation) : _extendedLocation;} + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AgentPoolProperties.FromJson(__jsonProperties) : _property;} + {_etag = If( json?.PropertyT("etag"), out var __jsonEtag) ? (string)__jsonEtag : (string)_etag;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPool. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPool. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPool. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPool. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPool FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPool FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new AgentPool(json) : null; } @@ -106,7 +106,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode ToJ __trackedResource?.ToJson(container, serializationMode); AddIf( null != this._extendedLocation ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) this._extendedLocation.ToJson(null,serializationMode) : null, "extendedLocation" ,container.Add ); AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._etag)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._etag.ToString()) : null, "etag" ,container.Add ); } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AgentPoolConfiguration.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AgentPoolConfiguration.PowerShell.cs new file mode 100644 index 000000000000..550004af4a4b --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AgentPoolConfiguration.PowerShell.cs @@ -0,0 +1,316 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + + /// AgentPoolConfiguration specifies the configuration of a pool of nodes. + [System.ComponentModel.TypeConverter(typeof(AgentPoolConfigurationTypeConverter))] + public partial class AgentPoolConfiguration + { + + /// + /// 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 AgentPoolConfiguration(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("AdministratorConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolConfigurationInternal)this).AdministratorConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministratorConfiguration) content.GetValueForProperty("AdministratorConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolConfigurationInternal)this).AdministratorConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AdministratorConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("AgentOption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolConfigurationInternal)this).AgentOption = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentOptions) content.GetValueForProperty("AgentOption",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolConfigurationInternal)this).AgentOption, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AgentOptionsTypeConverter.ConvertFrom); + } + if (content.Contains("AttachedNetworkConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolConfigurationInternal)this).AttachedNetworkConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAttachedNetworkConfiguration) content.GetValueForProperty("AttachedNetworkConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolConfigurationInternal)this).AttachedNetworkConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AttachedNetworkConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("UpgradeSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolConfigurationInternal)this).UpgradeSetting = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolUpgradeSettings) content.GetValueForProperty("UpgradeSetting",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolConfigurationInternal)this).UpgradeSetting, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AgentPoolUpgradeSettingsTypeConverter.ConvertFrom); + } + if (content.Contains("AvailabilityZone")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolConfigurationInternal)this).AvailabilityZone = (System.Collections.Generic.List) content.GetValueForProperty("AvailabilityZone",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolConfigurationInternal)this).AvailabilityZone, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("Count")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolConfigurationInternal)this).Count = (long) content.GetValueForProperty("Count",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolConfigurationInternal)this).Count, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("Label")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolConfigurationInternal)this).Label = (System.Collections.Generic.List) content.GetValueForProperty("Label",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolConfigurationInternal)this).Label, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.KubernetesLabelTypeConverter.ConvertFrom)); + } + if (content.Contains("Mode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolConfigurationInternal)this).Mode = (string) content.GetValueForProperty("Mode",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolConfigurationInternal)this).Mode, global::System.Convert.ToString); + } + if (content.Contains("Taint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolConfigurationInternal)this).Taint = (System.Collections.Generic.List) content.GetValueForProperty("Taint",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolConfigurationInternal)this).Taint, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.KubernetesLabelTypeConverter.ConvertFrom)); + } + if (content.Contains("VMSkuName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolConfigurationInternal)this).VMSkuName = (string) content.GetValueForProperty("VMSkuName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolConfigurationInternal)this).VMSkuName, global::System.Convert.ToString); + } + if (content.Contains("AdministratorConfigurationAdminUsername")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolConfigurationInternal)this).AdministratorConfigurationAdminUsername = (string) content.GetValueForProperty("AdministratorConfigurationAdminUsername",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolConfigurationInternal)this).AdministratorConfigurationAdminUsername, global::System.Convert.ToString); + } + if (content.Contains("AgentOptionHugepagesCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolConfigurationInternal)this).AgentOptionHugepagesCount = (long?) content.GetValueForProperty("AgentOptionHugepagesCount",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolConfigurationInternal)this).AgentOptionHugepagesCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("AgentOptionHugepagesSize")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolConfigurationInternal)this).AgentOptionHugepagesSize = (string) content.GetValueForProperty("AgentOptionHugepagesSize",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolConfigurationInternal)this).AgentOptionHugepagesSize, global::System.Convert.ToString); + } + if (content.Contains("AttachedNetworkConfigurationL2Network")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolConfigurationInternal)this).AttachedNetworkConfigurationL2Network = (System.Collections.Generic.List) content.GetValueForProperty("AttachedNetworkConfigurationL2Network",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolConfigurationInternal)this).AttachedNetworkConfigurationL2Network, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.L2NetworkAttachmentConfigurationTypeConverter.ConvertFrom)); + } + if (content.Contains("AttachedNetworkConfigurationL3Network")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolConfigurationInternal)this).AttachedNetworkConfigurationL3Network = (System.Collections.Generic.List) content.GetValueForProperty("AttachedNetworkConfigurationL3Network",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolConfigurationInternal)this).AttachedNetworkConfigurationL3Network, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.L3NetworkAttachmentConfigurationTypeConverter.ConvertFrom)); + } + if (content.Contains("AttachedNetworkConfigurationTrunkedNetwork")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolConfigurationInternal)this).AttachedNetworkConfigurationTrunkedNetwork = (System.Collections.Generic.List) content.GetValueForProperty("AttachedNetworkConfigurationTrunkedNetwork",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolConfigurationInternal)this).AttachedNetworkConfigurationTrunkedNetwork, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.TrunkedNetworkAttachmentConfigurationTypeConverter.ConvertFrom)); + } + if (content.Contains("AdministratorConfigurationSshPublicKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolConfigurationInternal)this).AdministratorConfigurationSshPublicKey = (System.Collections.Generic.List) content.GetValueForProperty("AdministratorConfigurationSshPublicKey",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolConfigurationInternal)this).AdministratorConfigurationSshPublicKey, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.SshPublicKeyTypeConverter.ConvertFrom)); + } + if (content.Contains("UpgradeSettingDrainTimeout")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolConfigurationInternal)this).UpgradeSettingDrainTimeout = (long?) content.GetValueForProperty("UpgradeSettingDrainTimeout",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolConfigurationInternal)this).UpgradeSettingDrainTimeout, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("UpgradeSettingMaxSurge")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolConfigurationInternal)this).UpgradeSettingMaxSurge = (string) content.GetValueForProperty("UpgradeSettingMaxSurge",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolConfigurationInternal)this).UpgradeSettingMaxSurge, global::System.Convert.ToString); + } + if (content.Contains("UpgradeSettingMaxUnavailable")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolConfigurationInternal)this).UpgradeSettingMaxUnavailable = (string) content.GetValueForProperty("UpgradeSettingMaxUnavailable",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolConfigurationInternal)this).UpgradeSettingMaxUnavailable, 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 AgentPoolConfiguration(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("AdministratorConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolConfigurationInternal)this).AdministratorConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministratorConfiguration) content.GetValueForProperty("AdministratorConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolConfigurationInternal)this).AdministratorConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AdministratorConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("AgentOption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolConfigurationInternal)this).AgentOption = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentOptions) content.GetValueForProperty("AgentOption",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolConfigurationInternal)this).AgentOption, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AgentOptionsTypeConverter.ConvertFrom); + } + if (content.Contains("AttachedNetworkConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolConfigurationInternal)this).AttachedNetworkConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAttachedNetworkConfiguration) content.GetValueForProperty("AttachedNetworkConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolConfigurationInternal)this).AttachedNetworkConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AttachedNetworkConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("UpgradeSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolConfigurationInternal)this).UpgradeSetting = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolUpgradeSettings) content.GetValueForProperty("UpgradeSetting",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolConfigurationInternal)this).UpgradeSetting, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AgentPoolUpgradeSettingsTypeConverter.ConvertFrom); + } + if (content.Contains("AvailabilityZone")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolConfigurationInternal)this).AvailabilityZone = (System.Collections.Generic.List) content.GetValueForProperty("AvailabilityZone",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolConfigurationInternal)this).AvailabilityZone, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("Count")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolConfigurationInternal)this).Count = (long) content.GetValueForProperty("Count",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolConfigurationInternal)this).Count, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("Label")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolConfigurationInternal)this).Label = (System.Collections.Generic.List) content.GetValueForProperty("Label",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolConfigurationInternal)this).Label, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.KubernetesLabelTypeConverter.ConvertFrom)); + } + if (content.Contains("Mode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolConfigurationInternal)this).Mode = (string) content.GetValueForProperty("Mode",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolConfigurationInternal)this).Mode, global::System.Convert.ToString); + } + if (content.Contains("Taint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolConfigurationInternal)this).Taint = (System.Collections.Generic.List) content.GetValueForProperty("Taint",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolConfigurationInternal)this).Taint, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.KubernetesLabelTypeConverter.ConvertFrom)); + } + if (content.Contains("VMSkuName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolConfigurationInternal)this).VMSkuName = (string) content.GetValueForProperty("VMSkuName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolConfigurationInternal)this).VMSkuName, global::System.Convert.ToString); + } + if (content.Contains("AdministratorConfigurationAdminUsername")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolConfigurationInternal)this).AdministratorConfigurationAdminUsername = (string) content.GetValueForProperty("AdministratorConfigurationAdminUsername",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolConfigurationInternal)this).AdministratorConfigurationAdminUsername, global::System.Convert.ToString); + } + if (content.Contains("AgentOptionHugepagesCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolConfigurationInternal)this).AgentOptionHugepagesCount = (long?) content.GetValueForProperty("AgentOptionHugepagesCount",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolConfigurationInternal)this).AgentOptionHugepagesCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("AgentOptionHugepagesSize")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolConfigurationInternal)this).AgentOptionHugepagesSize = (string) content.GetValueForProperty("AgentOptionHugepagesSize",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolConfigurationInternal)this).AgentOptionHugepagesSize, global::System.Convert.ToString); + } + if (content.Contains("AttachedNetworkConfigurationL2Network")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolConfigurationInternal)this).AttachedNetworkConfigurationL2Network = (System.Collections.Generic.List) content.GetValueForProperty("AttachedNetworkConfigurationL2Network",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolConfigurationInternal)this).AttachedNetworkConfigurationL2Network, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.L2NetworkAttachmentConfigurationTypeConverter.ConvertFrom)); + } + if (content.Contains("AttachedNetworkConfigurationL3Network")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolConfigurationInternal)this).AttachedNetworkConfigurationL3Network = (System.Collections.Generic.List) content.GetValueForProperty("AttachedNetworkConfigurationL3Network",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolConfigurationInternal)this).AttachedNetworkConfigurationL3Network, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.L3NetworkAttachmentConfigurationTypeConverter.ConvertFrom)); + } + if (content.Contains("AttachedNetworkConfigurationTrunkedNetwork")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolConfigurationInternal)this).AttachedNetworkConfigurationTrunkedNetwork = (System.Collections.Generic.List) content.GetValueForProperty("AttachedNetworkConfigurationTrunkedNetwork",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolConfigurationInternal)this).AttachedNetworkConfigurationTrunkedNetwork, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.TrunkedNetworkAttachmentConfigurationTypeConverter.ConvertFrom)); + } + if (content.Contains("AdministratorConfigurationSshPublicKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolConfigurationInternal)this).AdministratorConfigurationSshPublicKey = (System.Collections.Generic.List) content.GetValueForProperty("AdministratorConfigurationSshPublicKey",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolConfigurationInternal)this).AdministratorConfigurationSshPublicKey, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.SshPublicKeyTypeConverter.ConvertFrom)); + } + if (content.Contains("UpgradeSettingDrainTimeout")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolConfigurationInternal)this).UpgradeSettingDrainTimeout = (long?) content.GetValueForProperty("UpgradeSettingDrainTimeout",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolConfigurationInternal)this).UpgradeSettingDrainTimeout, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("UpgradeSettingMaxSurge")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolConfigurationInternal)this).UpgradeSettingMaxSurge = (string) content.GetValueForProperty("UpgradeSettingMaxSurge",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolConfigurationInternal)this).UpgradeSettingMaxSurge, global::System.Convert.ToString); + } + if (content.Contains("UpgradeSettingMaxUnavailable")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolConfigurationInternal)this).UpgradeSettingMaxUnavailable = (string) content.GetValueForProperty("UpgradeSettingMaxUnavailable",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolConfigurationInternal)this).UpgradeSettingMaxUnavailable, 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.NetworkCloud.Models.IAgentPoolConfiguration DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new AgentPoolConfiguration(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.NetworkCloud.Models.IAgentPoolConfiguration DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new AgentPoolConfiguration(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.NetworkCloud.Models.IAgentPoolConfiguration FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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(); + } + } + /// AgentPoolConfiguration specifies the configuration of a pool of nodes. + [System.ComponentModel.TypeConverter(typeof(AgentPoolConfigurationTypeConverter))] + public partial interface IAgentPoolConfiguration + + { + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AgentPoolConfiguration.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AgentPoolConfiguration.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AgentPoolConfiguration.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AgentPoolConfiguration.TypeConverter.cs index d297e2da8f47..25eba6252f94 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AgentPoolConfiguration.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AgentPoolConfiguration.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IAgentPoolConfiguration ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolConfiguration ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolConfiguration).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolConfiguration).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AgentPoolConfiguration.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AgentPoolConfiguration.cs new file mode 100644 index 000000000000..b22839ef4386 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AgentPoolConfiguration.cs @@ -0,0 +1,464 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + + /// AgentPoolConfiguration specifies the configuration of a pool of nodes. + public partial class AgentPoolConfiguration : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolConfiguration, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolConfigurationInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministratorConfiguration _administratorConfiguration; + + /// The administrator credentials to be used for the nodes in this agent pool. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministratorConfiguration AdministratorConfiguration { get => (this._administratorConfiguration = this._administratorConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AdministratorConfiguration()); set => this._administratorConfiguration = value; } + + /// + /// The user name for the administrator that will be applied to the operating systems that run Kubernetes nodes. If not supplied, + /// a user name will be chosen by the service. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string AdministratorConfigurationAdminUsername { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministratorConfigurationInternal)AdministratorConfiguration).AdminUsername; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministratorConfigurationInternal)AdministratorConfiguration).AdminUsername = value ?? null; } + + /// + /// The SSH configuration for the operating systems that run the nodes in the Kubernetes cluster. In some cases, specification + /// of public keys may be required to produce a working environment. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public System.Collections.Generic.List AdministratorConfigurationSshPublicKey { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministratorConfigurationInternal)AdministratorConfiguration).SshPublicKey; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministratorConfigurationInternal)AdministratorConfiguration).SshPublicKey = value ?? null /* arrayOf */; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentOptions _agentOption; + + /// The configurations that will be applied to each agent in this agent pool. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentOptions AgentOption { get => (this._agentOption = this._agentOption ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AgentOptions()); set => this._agentOption = value; } + + /// The number of hugepages to allocate. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public long? AgentOptionHugepagesCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentOptionsInternal)AgentOption).HugepagesCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentOptionsInternal)AgentOption).HugepagesCount = value ?? default(long); } + + /// The size of the hugepages to allocate. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string AgentOptionHugepagesSize { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentOptionsInternal)AgentOption).HugepagesSize; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentOptionsInternal)AgentOption).HugepagesSize = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAttachedNetworkConfiguration _attachedNetworkConfiguration; + + /// + /// The configuration of networks being attached to the agent pool for use by the workloads that run on this Kubernetes cluster. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAttachedNetworkConfiguration AttachedNetworkConfiguration { get => (this._attachedNetworkConfiguration = this._attachedNetworkConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AttachedNetworkConfiguration()); set => this._attachedNetworkConfiguration = value; } + + /// The list of Layer 2 Networks and related configuration for attachment. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public System.Collections.Generic.List AttachedNetworkConfigurationL2Network { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAttachedNetworkConfigurationInternal)AttachedNetworkConfiguration).L2Network; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAttachedNetworkConfigurationInternal)AttachedNetworkConfiguration).L2Network = value ?? null /* arrayOf */; } + + /// The list of Layer 3 Networks and related configuration for attachment. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public System.Collections.Generic.List AttachedNetworkConfigurationL3Network { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAttachedNetworkConfigurationInternal)AttachedNetworkConfiguration).L3Network; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAttachedNetworkConfigurationInternal)AttachedNetworkConfiguration).L3Network = value ?? null /* arrayOf */; } + + /// The list of Trunked Networks and related configuration for attachment. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public System.Collections.Generic.List AttachedNetworkConfigurationTrunkedNetwork { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAttachedNetworkConfigurationInternal)AttachedNetworkConfiguration).TrunkedNetwork; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAttachedNetworkConfigurationInternal)AttachedNetworkConfiguration).TrunkedNetwork = value ?? null /* arrayOf */; } + + /// Backing field for property. + private System.Collections.Generic.List _availabilityZone; + + /// + /// The list of availability zones of the Network Cloud cluster used for the provisioning of nodes in this agent pool. If + /// not specified, all availability zones will be used. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public System.Collections.Generic.List AvailabilityZone { get => this._availabilityZone; set => this._availabilityZone = value; } + + /// Backing field for property. + private long _count; + + /// The number of virtual machines that use this configuration. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public long Count { get => this._count; set => this._count = value; } + + /// Backing field for property. + private System.Collections.Generic.List _label; + + /// The labels applied to the nodes in this agent pool. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public System.Collections.Generic.List Label { get => this._label; set => this._label = value; } + + /// Internal Acessors for AdministratorConfiguration + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministratorConfiguration Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolConfigurationInternal.AdministratorConfiguration { get => (this._administratorConfiguration = this._administratorConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AdministratorConfiguration()); set { {_administratorConfiguration = value;} } } + + /// Internal Acessors for AgentOption + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentOptions Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolConfigurationInternal.AgentOption { get => (this._agentOption = this._agentOption ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AgentOptions()); set { {_agentOption = value;} } } + + /// Internal Acessors for AttachedNetworkConfiguration + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAttachedNetworkConfiguration Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolConfigurationInternal.AttachedNetworkConfiguration { get => (this._attachedNetworkConfiguration = this._attachedNetworkConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AttachedNetworkConfiguration()); set { {_attachedNetworkConfiguration = value;} } } + + /// Internal Acessors for UpgradeSetting + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolUpgradeSettings Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolConfigurationInternal.UpgradeSetting { get => (this._upgradeSetting = this._upgradeSetting ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AgentPoolUpgradeSettings()); set { {_upgradeSetting = value;} } } + + /// Backing field for property. + private string _mode; + + /// + /// The selection of how this agent pool is utilized, either as a system pool or a user pool. System pools run the features + /// and critical services for the Kubernetes Cluster, while user pools are dedicated to user workloads. Every Kubernetes cluster + /// must contain at least one system node pool with at least one node. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string Mode { get => this._mode; set => this._mode = value; } + + /// Backing field for property. + private System.Collections.Generic.List _taint; + + /// The taints applied to the nodes in this agent pool. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public System.Collections.Generic.List Taint { get => this._taint; set => this._taint = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolUpgradeSettings _upgradeSetting; + + /// The configuration of the agent pool. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolUpgradeSettings UpgradeSetting { get => (this._upgradeSetting = this._upgradeSetting ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AgentPoolUpgradeSettings()); set => this._upgradeSetting = value; } + + /// + /// The maximum time in seconds that is allowed for a node drain to complete before proceeding with the upgrade of the agent + /// pool. If not specified during creation, a value of 1800 seconds is used. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public long? UpgradeSettingDrainTimeout { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolUpgradeSettingsInternal)UpgradeSetting).DrainTimeout; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolUpgradeSettingsInternal)UpgradeSetting).DrainTimeout = value ?? default(long); } + + /// + /// The maximum number or percentage of nodes that are surged during upgrade. This can either be set to an integer (e.g. '5') + /// or a percentage (e.g. '50%'). If a percentage is specified, it is the percentage of the total agent pool size at the time + /// of the upgrade. For percentages, fractional nodes are rounded up. If not specified during creation, a value of 1 is used. + /// One of MaxSurge and MaxUnavailable must be greater than 0. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string UpgradeSettingMaxSurge { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolUpgradeSettingsInternal)UpgradeSetting).MaxSurge; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolUpgradeSettingsInternal)UpgradeSetting).MaxSurge = value ?? null; } + + /// + /// The maximum number or percentage of nodes that can be unavailable during upgrade. This can either be set to an integer + /// (e.g. '5') or a percentage (e.g. '50%'). If a percentage is specified, it is the percentage of the total agent pool size + /// at the time of the upgrade. For percentages, fractional nodes are rounded up. If not specified during creation, a value + /// of 0 is used. One of MaxSurge and MaxUnavailable must be greater than 0. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string UpgradeSettingMaxUnavailable { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolUpgradeSettingsInternal)UpgradeSetting).MaxUnavailable; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolUpgradeSettingsInternal)UpgradeSetting).MaxUnavailable = value ?? null; } + + /// Backing field for property. + private string _vMSkuName; + + /// + /// The name of the VM SKU that determines the size of resources allocated for node VMs. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string VMSkuName { get => this._vMSkuName; set => this._vMSkuName = value; } + + /// Creates an new instance. + public AgentPoolConfiguration() + { + + } + } + /// AgentPoolConfiguration specifies the configuration of a pool of nodes. + public partial interface IAgentPoolConfiguration : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable + { + /// + /// The user name for the administrator that will be applied to the operating systems that run Kubernetes nodes. If not supplied, + /// a user name will be chosen by the service. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The user name for the administrator that will be applied to the operating systems that run Kubernetes nodes. If not supplied, a user name will be chosen by the service.", + SerializedName = @"adminUsername", + PossibleTypes = new [] { typeof(string) })] + string AdministratorConfigurationAdminUsername { get; set; } + /// + /// The SSH configuration for the operating systems that run the nodes in the Kubernetes cluster. In some cases, specification + /// of public keys may be required to produce a working environment. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The SSH configuration for the operating systems that run the nodes in the Kubernetes cluster. In some cases, specification of public keys may be required to produce a working environment.", + SerializedName = @"sshPublicKeys", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISshPublicKey) })] + System.Collections.Generic.List AdministratorConfigurationSshPublicKey { get; set; } + /// The number of hugepages to allocate. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The number of hugepages to allocate.", + SerializedName = @"hugepagesCount", + PossibleTypes = new [] { typeof(long) })] + long? AgentOptionHugepagesCount { get; set; } + /// The size of the hugepages to allocate. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The size of the hugepages to allocate.", + SerializedName = @"hugepagesSize", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("2M", "1G")] + string AgentOptionHugepagesSize { get; set; } + /// The list of Layer 2 Networks and related configuration for attachment. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The list of Layer 2 Networks and related configuration for attachment.", + SerializedName = @"l2Networks", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkAttachmentConfiguration) })] + System.Collections.Generic.List AttachedNetworkConfigurationL2Network { get; set; } + /// The list of Layer 3 Networks and related configuration for attachment. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The list of Layer 3 Networks and related configuration for attachment.", + SerializedName = @"l3Networks", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkAttachmentConfiguration) })] + System.Collections.Generic.List AttachedNetworkConfigurationL3Network { get; set; } + /// The list of Trunked Networks and related configuration for attachment. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The list of Trunked Networks and related configuration for attachment.", + SerializedName = @"trunkedNetworks", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkAttachmentConfiguration) })] + System.Collections.Generic.List AttachedNetworkConfigurationTrunkedNetwork { get; set; } + /// + /// The list of availability zones of the Network Cloud cluster used for the provisioning of nodes in this agent pool. If + /// not specified, all availability zones will be used. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The list of availability zones of the Network Cloud cluster used for the provisioning of nodes in this agent pool. If not specified, all availability zones will be used.", + SerializedName = @"availabilityZones", + PossibleTypes = new [] { typeof(string) })] + System.Collections.Generic.List AvailabilityZone { get; set; } + /// The number of virtual machines that use this configuration. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The number of virtual machines that use this configuration.", + SerializedName = @"count", + PossibleTypes = new [] { typeof(long) })] + long Count { get; set; } + /// The labels applied to the nodes in this agent pool. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The labels applied to the nodes in this agent pool.", + SerializedName = @"labels", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesLabel) })] + System.Collections.Generic.List Label { get; set; } + /// + /// The selection of how this agent pool is utilized, either as a system pool or a user pool. System pools run the features + /// and critical services for the Kubernetes Cluster, while user pools are dedicated to user workloads. Every Kubernetes cluster + /// must contain at least one system node pool with at least one node. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The selection of how this agent pool is utilized, either as a system pool or a user pool. System pools run the features and critical services for the Kubernetes Cluster, while user pools are dedicated to user workloads. Every Kubernetes cluster must contain at least one system node pool with at least one node.", + SerializedName = @"mode", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("System", "User", "NotApplicable")] + string Mode { get; set; } + /// The taints applied to the nodes in this agent pool. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The taints applied to the nodes in this agent pool.", + SerializedName = @"taints", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesLabel) })] + System.Collections.Generic.List Taint { get; set; } + /// + /// The maximum time in seconds that is allowed for a node drain to complete before proceeding with the upgrade of the agent + /// pool. If not specified during creation, a value of 1800 seconds is used. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The maximum time in seconds that is allowed for a node drain to complete before proceeding with the upgrade of the agent pool. If not specified during creation, a value of 1800 seconds is used.", + SerializedName = @"drainTimeout", + PossibleTypes = new [] { typeof(long) })] + long? UpgradeSettingDrainTimeout { get; set; } + /// + /// The maximum number or percentage of nodes that are surged during upgrade. This can either be set to an integer (e.g. '5') + /// or a percentage (e.g. '50%'). If a percentage is specified, it is the percentage of the total agent pool size at the time + /// of the upgrade. For percentages, fractional nodes are rounded up. If not specified during creation, a value of 1 is used. + /// One of MaxSurge and MaxUnavailable must be greater than 0. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The maximum number or percentage of nodes that are surged during upgrade. This can either be set to an integer (e.g. '5') or a percentage (e.g. '50%'). If a percentage is specified, it is the percentage of the total agent pool size at the time of the upgrade. For percentages, fractional nodes are rounded up. If not specified during creation, a value of 1 is used. One of MaxSurge and MaxUnavailable must be greater than 0.", + SerializedName = @"maxSurge", + PossibleTypes = new [] { typeof(string) })] + string UpgradeSettingMaxSurge { get; set; } + /// + /// The maximum number or percentage of nodes that can be unavailable during upgrade. This can either be set to an integer + /// (e.g. '5') or a percentage (e.g. '50%'). If a percentage is specified, it is the percentage of the total agent pool size + /// at the time of the upgrade. For percentages, fractional nodes are rounded up. If not specified during creation, a value + /// of 0 is used. One of MaxSurge and MaxUnavailable must be greater than 0. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The maximum number or percentage of nodes that can be unavailable during upgrade. This can either be set to an integer (e.g. '5') or a percentage (e.g. '50%'). If a percentage is specified, it is the percentage of the total agent pool size at the time of the upgrade. For percentages, fractional nodes are rounded up. If not specified during creation, a value of 0 is used. One of MaxSurge and MaxUnavailable must be greater than 0.", + SerializedName = @"maxUnavailable", + PossibleTypes = new [] { typeof(string) })] + string UpgradeSettingMaxUnavailable { get; set; } + /// + /// The name of the VM SKU that determines the size of resources allocated for node VMs. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The name of the VM SKU that determines the size of resources allocated for node VMs.", + SerializedName = @"vmSkuName", + PossibleTypes = new [] { typeof(string) })] + string VMSkuName { get; set; } + + } + /// AgentPoolConfiguration specifies the configuration of a pool of nodes. + internal partial interface IAgentPoolConfigurationInternal + + { + /// The administrator credentials to be used for the nodes in this agent pool. + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministratorConfiguration AdministratorConfiguration { get; set; } + /// + /// The user name for the administrator that will be applied to the operating systems that run Kubernetes nodes. If not supplied, + /// a user name will be chosen by the service. + /// + string AdministratorConfigurationAdminUsername { get; set; } + /// + /// The SSH configuration for the operating systems that run the nodes in the Kubernetes cluster. In some cases, specification + /// of public keys may be required to produce a working environment. + /// + System.Collections.Generic.List AdministratorConfigurationSshPublicKey { get; set; } + /// The configurations that will be applied to each agent in this agent pool. + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentOptions AgentOption { get; set; } + /// The number of hugepages to allocate. + long? AgentOptionHugepagesCount { get; set; } + /// The size of the hugepages to allocate. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("2M", "1G")] + string AgentOptionHugepagesSize { get; set; } + /// + /// The configuration of networks being attached to the agent pool for use by the workloads that run on this Kubernetes cluster. + /// + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAttachedNetworkConfiguration AttachedNetworkConfiguration { get; set; } + /// The list of Layer 2 Networks and related configuration for attachment. + System.Collections.Generic.List AttachedNetworkConfigurationL2Network { get; set; } + /// The list of Layer 3 Networks and related configuration for attachment. + System.Collections.Generic.List AttachedNetworkConfigurationL3Network { get; set; } + /// The list of Trunked Networks and related configuration for attachment. + System.Collections.Generic.List AttachedNetworkConfigurationTrunkedNetwork { get; set; } + /// + /// The list of availability zones of the Network Cloud cluster used for the provisioning of nodes in this agent pool. If + /// not specified, all availability zones will be used. + /// + System.Collections.Generic.List AvailabilityZone { get; set; } + /// The number of virtual machines that use this configuration. + long Count { get; set; } + /// The labels applied to the nodes in this agent pool. + System.Collections.Generic.List Label { get; set; } + /// + /// The selection of how this agent pool is utilized, either as a system pool or a user pool. System pools run the features + /// and critical services for the Kubernetes Cluster, while user pools are dedicated to user workloads. Every Kubernetes cluster + /// must contain at least one system node pool with at least one node. + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("System", "User", "NotApplicable")] + string Mode { get; set; } + /// The taints applied to the nodes in this agent pool. + System.Collections.Generic.List Taint { get; set; } + /// The configuration of the agent pool. + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolUpgradeSettings UpgradeSetting { get; set; } + /// + /// The maximum time in seconds that is allowed for a node drain to complete before proceeding with the upgrade of the agent + /// pool. If not specified during creation, a value of 1800 seconds is used. + /// + long? UpgradeSettingDrainTimeout { get; set; } + /// + /// The maximum number or percentage of nodes that are surged during upgrade. This can either be set to an integer (e.g. '5') + /// or a percentage (e.g. '50%'). If a percentage is specified, it is the percentage of the total agent pool size at the time + /// of the upgrade. For percentages, fractional nodes are rounded up. If not specified during creation, a value of 1 is used. + /// One of MaxSurge and MaxUnavailable must be greater than 0. + /// + string UpgradeSettingMaxSurge { get; set; } + /// + /// The maximum number or percentage of nodes that can be unavailable during upgrade. This can either be set to an integer + /// (e.g. '5') or a percentage (e.g. '50%'). If a percentage is specified, it is the percentage of the total agent pool size + /// at the time of the upgrade. For percentages, fractional nodes are rounded up. If not specified during creation, a value + /// of 0 is used. One of MaxSurge and MaxUnavailable must be greater than 0. + /// + string UpgradeSettingMaxUnavailable { get; set; } + /// + /// The name of the VM SKU that determines the size of resources allocated for node VMs. + /// + string VMSkuName { get; set; } + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AgentPoolConfiguration.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AgentPoolConfiguration.json.cs new file mode 100644 index 000000000000..305f7b8ddbb7 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AgentPoolConfiguration.json.cs @@ -0,0 +1,171 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + + /// AgentPoolConfiguration specifies the configuration of a pool of nodes. + public partial class AgentPoolConfiguration + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject instance to deserialize from. + internal AgentPoolConfiguration(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_administratorConfiguration = If( json?.PropertyT("administratorConfiguration"), out var __jsonAdministratorConfiguration) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AdministratorConfiguration.FromJson(__jsonAdministratorConfiguration) : _administratorConfiguration;} + {_agentOption = If( json?.PropertyT("agentOptions"), out var __jsonAgentOptions) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AgentOptions.FromJson(__jsonAgentOptions) : _agentOption;} + {_attachedNetworkConfiguration = If( json?.PropertyT("attachedNetworkConfiguration"), out var __jsonAttachedNetworkConfiguration) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AttachedNetworkConfiguration.FromJson(__jsonAttachedNetworkConfiguration) : _attachedNetworkConfiguration;} + {_upgradeSetting = If( json?.PropertyT("upgradeSettings"), out var __jsonUpgradeSettings) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AgentPoolUpgradeSettings.FromJson(__jsonUpgradeSettings) : _upgradeSetting;} + {_availabilityZone = If( json?.PropertyT("availabilityZones"), out var __jsonAvailabilityZones) ? If( __jsonAvailabilityZones as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : _availabilityZone;} + {_count = If( json?.PropertyT("count"), out var __jsonCount) ? (long)__jsonCount : _count;} + {_label = If( json?.PropertyT("labels"), out var __jsonLabels) ? If( __jsonLabels as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.IKubernetesLabel) (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.KubernetesLabel.FromJson(__p) )) ))() : null : _label;} + {_mode = If( json?.PropertyT("mode"), out var __jsonMode) ? (string)__jsonMode : (string)_mode;} + {_taint = If( json?.PropertyT("taints"), out var __jsonTaints) ? If( __jsonTaints as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonArray, out var __l) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__l, (__k)=>(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesLabel) (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.KubernetesLabel.FromJson(__k) )) ))() : null : _taint;} + {_vMSkuName = If( json?.PropertyT("vmSkuName"), out var __jsonVMSkuName) ? (string)__jsonVMSkuName : (string)_vMSkuName;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolConfiguration. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolConfiguration. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolConfiguration FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new AgentPoolConfiguration(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._administratorConfiguration ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) this._administratorConfiguration.ToJson(null,serializationMode) : null, "administratorConfiguration" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)||serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate)) + { + AddIf( null != this._agentOption ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) this._agentOption.ToJson(null,serializationMode) : null, "agentOptions" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)||serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate)) + { + AddIf( null != this._attachedNetworkConfiguration ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) this._attachedNetworkConfiguration.ToJson(null,serializationMode) : null, "attachedNetworkConfiguration" ,container.Add ); + } + AddIf( null != this._upgradeSetting ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) this._upgradeSetting.ToJson(null,serializationMode) : null, "upgradeSettings" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)||serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate)) + { + if (null != this._availabilityZone) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.XNodeArray(); + foreach( var __x in this._availabilityZone ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("availabilityZones",__w); + } + } + AddIf( (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNumber(this._count), "count" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)||serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate)) + { + if (null != this._label) + { + var __r = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.XNodeArray(); + foreach( var __s in this._label ) + { + AddIf(__s?.ToJson(null, serializationMode) ,__r.Add); + } + container.Add("labels",__r); + } + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)||serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate)) + { + AddIf( null != (((object)this._mode)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._mode.ToString()) : null, "mode" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)||serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate)) + { + if (null != this._taint) + { + var __m = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.XNodeArray(); + foreach( var __n in this._taint ) + { + AddIf(__n?.ToJson(null, serializationMode) ,__m.Add); + } + container.Add("taints",__m); + } + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)||serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate)) + { + AddIf( null != (((object)this._vMSkuName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._vMSkuName.ToString()) : null, "vmSkuName" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AgentPoolList.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AgentPoolList.PowerShell.cs similarity index 77% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AgentPoolList.PowerShell.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AgentPoolList.PowerShell.cs index d3645f0b6d55..7df44ab0d9ee 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AgentPoolList.PowerShell.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AgentPoolList.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; @@ -63,7 +63,7 @@ public partial class AgentPoolList 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 AgentPoolList(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolListInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolListInternal)this).NextLink, global::System.Convert.ToString); } if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPool[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AgentPoolTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolListInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolListInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AgentPoolTypeConverter.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,37 +103,37 @@ internal AgentPoolList(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolListInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolListInternal)this).NextLink, global::System.Convert.ToString); } if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPool[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AgentPoolTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolListInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolListInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AgentPoolTypeConverter.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.NetworkCloud.Models.Api20250201.IAgentPoolList DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolList DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new AgentPoolList(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.NetworkCloud.Models.Api20250201.IAgentPoolList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new AgentPoolList(content); } @@ -143,7 +143,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AgentPoolList.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AgentPoolList.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AgentPoolList.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AgentPoolList.TypeConverter.cs index 754031d5a2e6..a01f2889f4d4 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AgentPoolList.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AgentPoolList.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IAgentPoolList ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolList ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolList).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolList).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AgentPoolList.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AgentPoolList.cs similarity index 75% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AgentPoolList.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AgentPoolList.cs index 0eeadf6cd277..1bfaedfa2fe5 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AgentPoolList.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AgentPoolList.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; /// AgentPoolList represents a list of Kubernetes cluster agent pools. public partial class AgentPoolList : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolList, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolListInternal + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolList, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolListInternal { /// Backing field for property. @@ -21,11 +21,11 @@ public partial class AgentPoolList : public string NextLink { get => this._nextLink; set => this._nextLink = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPool[] _value; + private System.Collections.Generic.List _value; /// The list of agent pools. [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPool[] 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 AgentPoolList() @@ -41,6 +41,9 @@ public partial interface IAgentPoolList : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The link used to get the next page of operations.", SerializedName = @"nextLink", PossibleTypes = new [] { typeof(string) })] @@ -49,10 +52,13 @@ public partial interface IAgentPoolList : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The list of agent pools.", SerializedName = @"value", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPool) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPool[] Value { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPool) })] + System.Collections.Generic.List Value { get; set; } } /// AgentPoolList represents a list of Kubernetes cluster agent pools. @@ -62,7 +68,7 @@ internal partial interface IAgentPoolListInternal /// The link used to get the next page of operations. string NextLink { get; set; } /// The list of agent pools. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPool[] Value { get; set; } + System.Collections.Generic.List Value { get; set; } } } \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AgentPoolList.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AgentPoolList.json.cs similarity index 90% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AgentPoolList.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AgentPoolList.json.cs index ce9b57130005..9955409fdb7c 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AgentPoolList.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AgentPoolList.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -65,19 +65,19 @@ internal AgentPoolList(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.J { return; } - {_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.NetworkCloud.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.NetworkCloud.Models.Api20250201.IAgentPool) (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AgentPool.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.NetworkCloud.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.NetworkCloud.Models.IAgentPool) (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AgentPool.FromJson(__u) )) ))() : null : _value;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolList. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolList. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolList. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolList. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolList FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolList FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new AgentPoolList(json) : null; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AgentPoolPatchParameters.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AgentPoolPatchParameters.PowerShell.cs new file mode 100644 index 000000000000..639aa1cfd75f --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AgentPoolPatchParameters.PowerShell.cs @@ -0,0 +1,230 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + + /// + /// AgentPoolPatchParameters represents the body of the request to patch the Kubernetes cluster agent pool. + /// + [System.ComponentModel.TypeConverter(typeof(AgentPoolPatchParametersTypeConverter))] + public partial class AgentPoolPatchParameters + { + + /// + /// 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 AgentPoolPatchParameters(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.NetworkCloud.Models.IAgentPoolPatchParametersInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPatchProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPatchParametersInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AgentPoolPatchPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPatchParametersInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPatchParametersTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPatchParametersInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AgentPoolPatchParametersTagsTypeConverter.ConvertFrom); + } + if (content.Contains("AdministratorConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPatchParametersInternal)this).AdministratorConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INodePoolAdministratorConfigurationPatch) content.GetValueForProperty("AdministratorConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPatchParametersInternal)this).AdministratorConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.NodePoolAdministratorConfigurationPatchTypeConverter.ConvertFrom); + } + if (content.Contains("UpgradeSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPatchParametersInternal)this).UpgradeSetting = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolUpgradeSettings) content.GetValueForProperty("UpgradeSetting",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPatchParametersInternal)this).UpgradeSetting, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AgentPoolUpgradeSettingsTypeConverter.ConvertFrom); + } + if (content.Contains("Count")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPatchParametersInternal)this).Count = (long?) content.GetValueForProperty("Count",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPatchParametersInternal)this).Count, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("AdministratorConfigurationSshPublicKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPatchParametersInternal)this).AdministratorConfigurationSshPublicKey = (System.Collections.Generic.List) content.GetValueForProperty("AdministratorConfigurationSshPublicKey",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPatchParametersInternal)this).AdministratorConfigurationSshPublicKey, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.SshPublicKeyTypeConverter.ConvertFrom)); + } + if (content.Contains("UpgradeSettingDrainTimeout")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPatchParametersInternal)this).UpgradeSettingDrainTimeout = (long?) content.GetValueForProperty("UpgradeSettingDrainTimeout",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPatchParametersInternal)this).UpgradeSettingDrainTimeout, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("UpgradeSettingMaxSurge")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPatchParametersInternal)this).UpgradeSettingMaxSurge = (string) content.GetValueForProperty("UpgradeSettingMaxSurge",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPatchParametersInternal)this).UpgradeSettingMaxSurge, global::System.Convert.ToString); + } + if (content.Contains("UpgradeSettingMaxUnavailable")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPatchParametersInternal)this).UpgradeSettingMaxUnavailable = (string) content.GetValueForProperty("UpgradeSettingMaxUnavailable",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPatchParametersInternal)this).UpgradeSettingMaxUnavailable, 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 AgentPoolPatchParameters(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.NetworkCloud.Models.IAgentPoolPatchParametersInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPatchProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPatchParametersInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AgentPoolPatchPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPatchParametersInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPatchParametersTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPatchParametersInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AgentPoolPatchParametersTagsTypeConverter.ConvertFrom); + } + if (content.Contains("AdministratorConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPatchParametersInternal)this).AdministratorConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INodePoolAdministratorConfigurationPatch) content.GetValueForProperty("AdministratorConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPatchParametersInternal)this).AdministratorConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.NodePoolAdministratorConfigurationPatchTypeConverter.ConvertFrom); + } + if (content.Contains("UpgradeSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPatchParametersInternal)this).UpgradeSetting = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolUpgradeSettings) content.GetValueForProperty("UpgradeSetting",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPatchParametersInternal)this).UpgradeSetting, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AgentPoolUpgradeSettingsTypeConverter.ConvertFrom); + } + if (content.Contains("Count")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPatchParametersInternal)this).Count = (long?) content.GetValueForProperty("Count",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPatchParametersInternal)this).Count, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("AdministratorConfigurationSshPublicKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPatchParametersInternal)this).AdministratorConfigurationSshPublicKey = (System.Collections.Generic.List) content.GetValueForProperty("AdministratorConfigurationSshPublicKey",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPatchParametersInternal)this).AdministratorConfigurationSshPublicKey, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.SshPublicKeyTypeConverter.ConvertFrom)); + } + if (content.Contains("UpgradeSettingDrainTimeout")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPatchParametersInternal)this).UpgradeSettingDrainTimeout = (long?) content.GetValueForProperty("UpgradeSettingDrainTimeout",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPatchParametersInternal)this).UpgradeSettingDrainTimeout, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("UpgradeSettingMaxSurge")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPatchParametersInternal)this).UpgradeSettingMaxSurge = (string) content.GetValueForProperty("UpgradeSettingMaxSurge",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPatchParametersInternal)this).UpgradeSettingMaxSurge, global::System.Convert.ToString); + } + if (content.Contains("UpgradeSettingMaxUnavailable")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPatchParametersInternal)this).UpgradeSettingMaxUnavailable = (string) content.GetValueForProperty("UpgradeSettingMaxUnavailable",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPatchParametersInternal)this).UpgradeSettingMaxUnavailable, 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.NetworkCloud.Models.IAgentPoolPatchParameters DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new AgentPoolPatchParameters(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.NetworkCloud.Models.IAgentPoolPatchParameters DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new AgentPoolPatchParameters(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.NetworkCloud.Models.IAgentPoolPatchParameters FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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(); + } + } + /// AgentPoolPatchParameters represents the body of the request to patch the Kubernetes cluster agent pool. + [System.ComponentModel.TypeConverter(typeof(AgentPoolPatchParametersTypeConverter))] + public partial interface IAgentPoolPatchParameters + + { + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AgentPoolPatchParameters.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AgentPoolPatchParameters.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AgentPoolPatchParameters.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AgentPoolPatchParameters.TypeConverter.cs index 8652e6bd6b01..000cecf41bd0 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AgentPoolPatchParameters.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AgentPoolPatchParameters.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IAgentPoolPatchParameters ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPatchParameters ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPatchParameters).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPatchParameters).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AgentPoolPatchParameters.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AgentPoolPatchParameters.cs new file mode 100644 index 000000000000..633e9fdaddb8 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AgentPoolPatchParameters.cs @@ -0,0 +1,208 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + + /// + /// AgentPoolPatchParameters represents the body of the request to patch the Kubernetes cluster agent pool. + /// + public partial class AgentPoolPatchParameters : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPatchParameters, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPatchParametersInternal + { + + /// + /// SshPublicKey represents the public key used to authenticate with a resource through SSH. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public System.Collections.Generic.List AdministratorConfigurationSshPublicKey { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPatchPropertiesInternal)Property).AdministratorConfigurationSshPublicKey; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPatchPropertiesInternal)Property).AdministratorConfigurationSshPublicKey = value ?? null /* arrayOf */; } + + /// The number of virtual machines that use this configuration. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public long? Count { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPatchPropertiesInternal)Property).Count; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPatchPropertiesInternal)Property).Count = value ?? default(long); } + + /// Internal Acessors for AdministratorConfiguration + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INodePoolAdministratorConfigurationPatch Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPatchParametersInternal.AdministratorConfiguration { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPatchPropertiesInternal)Property).AdministratorConfiguration; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPatchPropertiesInternal)Property).AdministratorConfiguration = value ?? null /* model class */; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPatchProperties Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPatchParametersInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AgentPoolPatchProperties()); set { {_property = value;} } } + + /// Internal Acessors for UpgradeSetting + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolUpgradeSettings Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPatchParametersInternal.UpgradeSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPatchPropertiesInternal)Property).UpgradeSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPatchPropertiesInternal)Property).UpgradeSetting = value ?? null /* model class */; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPatchProperties _property; + + /// The list of the resource properties. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPatchProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AgentPoolPatchProperties()); set => this._property = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPatchParametersTags _tag; + + /// The Azure resource tags that will replace the existing ones. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPatchParametersTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AgentPoolPatchParametersTags()); set => this._tag = value; } + + /// + /// The maximum time in seconds that is allowed for a node drain to complete before proceeding with the upgrade of the agent + /// pool. If not specified during creation, a value of 1800 seconds is used. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public long? UpgradeSettingDrainTimeout { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPatchPropertiesInternal)Property).UpgradeSettingDrainTimeout; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPatchPropertiesInternal)Property).UpgradeSettingDrainTimeout = value ?? default(long); } + + /// + /// The maximum number or percentage of nodes that are surged during upgrade. This can either be set to an integer (e.g. '5') + /// or a percentage (e.g. '50%'). If a percentage is specified, it is the percentage of the total agent pool size at the time + /// of the upgrade. For percentages, fractional nodes are rounded up. If not specified during creation, a value of 1 is used. + /// One of MaxSurge and MaxUnavailable must be greater than 0. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string UpgradeSettingMaxSurge { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPatchPropertiesInternal)Property).UpgradeSettingMaxSurge; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPatchPropertiesInternal)Property).UpgradeSettingMaxSurge = value ?? null; } + + /// + /// The maximum number or percentage of nodes that can be unavailable during upgrade. This can either be set to an integer + /// (e.g. '5') or a percentage (e.g. '50%'). If a percentage is specified, it is the percentage of the total agent pool size + /// at the time of the upgrade. For percentages, fractional nodes are rounded up. If not specified during creation, a value + /// of 0 is used. One of MaxSurge and MaxUnavailable must be greater than 0. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string UpgradeSettingMaxUnavailable { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPatchPropertiesInternal)Property).UpgradeSettingMaxUnavailable; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPatchPropertiesInternal)Property).UpgradeSettingMaxUnavailable = value ?? null; } + + /// Creates an new instance. + public AgentPoolPatchParameters() + { + + } + } + /// AgentPoolPatchParameters represents the body of the request to patch the Kubernetes cluster agent pool. + public partial interface IAgentPoolPatchParameters : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable + { + /// + /// SshPublicKey represents the public key used to authenticate with a resource through SSH. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"SshPublicKey represents the public key used to authenticate with a resource through SSH.", + SerializedName = @"sshPublicKeys", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISshPublicKey) })] + System.Collections.Generic.List AdministratorConfigurationSshPublicKey { get; set; } + /// The number of virtual machines that use this configuration. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The number of virtual machines that use this configuration.", + SerializedName = @"count", + PossibleTypes = new [] { typeof(long) })] + long? Count { get; set; } + /// The Azure resource tags that will replace the existing ones. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The Azure resource tags that will replace the existing ones.", + SerializedName = @"tags", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPatchParametersTags) })] + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPatchParametersTags Tag { get; set; } + /// + /// The maximum time in seconds that is allowed for a node drain to complete before proceeding with the upgrade of the agent + /// pool. If not specified during creation, a value of 1800 seconds is used. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The maximum time in seconds that is allowed for a node drain to complete before proceeding with the upgrade of the agent pool. If not specified during creation, a value of 1800 seconds is used.", + SerializedName = @"drainTimeout", + PossibleTypes = new [] { typeof(long) })] + long? UpgradeSettingDrainTimeout { get; set; } + /// + /// The maximum number or percentage of nodes that are surged during upgrade. This can either be set to an integer (e.g. '5') + /// or a percentage (e.g. '50%'). If a percentage is specified, it is the percentage of the total agent pool size at the time + /// of the upgrade. For percentages, fractional nodes are rounded up. If not specified during creation, a value of 1 is used. + /// One of MaxSurge and MaxUnavailable must be greater than 0. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The maximum number or percentage of nodes that are surged during upgrade. This can either be set to an integer (e.g. '5') or a percentage (e.g. '50%'). If a percentage is specified, it is the percentage of the total agent pool size at the time of the upgrade. For percentages, fractional nodes are rounded up. If not specified during creation, a value of 1 is used. One of MaxSurge and MaxUnavailable must be greater than 0.", + SerializedName = @"maxSurge", + PossibleTypes = new [] { typeof(string) })] + string UpgradeSettingMaxSurge { get; set; } + /// + /// The maximum number or percentage of nodes that can be unavailable during upgrade. This can either be set to an integer + /// (e.g. '5') or a percentage (e.g. '50%'). If a percentage is specified, it is the percentage of the total agent pool size + /// at the time of the upgrade. For percentages, fractional nodes are rounded up. If not specified during creation, a value + /// of 0 is used. One of MaxSurge and MaxUnavailable must be greater than 0. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The maximum number or percentage of nodes that can be unavailable during upgrade. This can either be set to an integer (e.g. '5') or a percentage (e.g. '50%'). If a percentage is specified, it is the percentage of the total agent pool size at the time of the upgrade. For percentages, fractional nodes are rounded up. If not specified during creation, a value of 0 is used. One of MaxSurge and MaxUnavailable must be greater than 0.", + SerializedName = @"maxUnavailable", + PossibleTypes = new [] { typeof(string) })] + string UpgradeSettingMaxUnavailable { get; set; } + + } + /// AgentPoolPatchParameters represents the body of the request to patch the Kubernetes cluster agent pool. + internal partial interface IAgentPoolPatchParametersInternal + + { + /// The configuration of administrator credentials for the control plane nodes. + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INodePoolAdministratorConfigurationPatch AdministratorConfiguration { get; set; } + /// + /// SshPublicKey represents the public key used to authenticate with a resource through SSH. + /// + System.Collections.Generic.List AdministratorConfigurationSshPublicKey { get; set; } + /// The number of virtual machines that use this configuration. + long? Count { get; set; } + /// The list of the resource properties. + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPatchProperties Property { get; set; } + /// The Azure resource tags that will replace the existing ones. + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPatchParametersTags Tag { get; set; } + /// The configuration of the agent pool. + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolUpgradeSettings UpgradeSetting { get; set; } + /// + /// The maximum time in seconds that is allowed for a node drain to complete before proceeding with the upgrade of the agent + /// pool. If not specified during creation, a value of 1800 seconds is used. + /// + long? UpgradeSettingDrainTimeout { get; set; } + /// + /// The maximum number or percentage of nodes that are surged during upgrade. This can either be set to an integer (e.g. '5') + /// or a percentage (e.g. '50%'). If a percentage is specified, it is the percentage of the total agent pool size at the time + /// of the upgrade. For percentages, fractional nodes are rounded up. If not specified during creation, a value of 1 is used. + /// One of MaxSurge and MaxUnavailable must be greater than 0. + /// + string UpgradeSettingMaxSurge { get; set; } + /// + /// The maximum number or percentage of nodes that can be unavailable during upgrade. This can either be set to an integer + /// (e.g. '5') or a percentage (e.g. '50%'). If a percentage is specified, it is the percentage of the total agent pool size + /// at the time of the upgrade. For percentages, fractional nodes are rounded up. If not specified during creation, a value + /// of 0 is used. One of MaxSurge and MaxUnavailable must be greater than 0. + /// + string UpgradeSettingMaxUnavailable { get; set; } + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AgentPoolPatchParameters.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AgentPoolPatchParameters.json.cs similarity index 93% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AgentPoolPatchParameters.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AgentPoolPatchParameters.json.cs index fb314a0ca731..a33e89d98719 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AgentPoolPatchParameters.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AgentPoolPatchParameters.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -67,19 +67,19 @@ internal AgentPoolPatchParameters(Microsoft.Azure.PowerShell.Cmdlets.NetworkClou { return; } - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AgentPoolPatchProperties.FromJson(__jsonProperties) : Property;} - {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AgentPoolPatchParametersTags.FromJson(__jsonTags) : Tag;} + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AgentPoolPatchProperties.FromJson(__jsonProperties) : _property;} + {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AgentPoolPatchParametersTags.FromJson(__jsonTags) : _tag;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPatchParameters. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPatchParameters. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPatchParameters. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPatchParameters. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPatchParameters FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPatchParameters FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new AgentPoolPatchParameters(json) : null; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AgentPoolPatchParametersTags.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AgentPoolPatchParametersTags.PowerShell.cs similarity index 89% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AgentPoolPatchParametersTags.PowerShell.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AgentPoolPatchParametersTags.PowerShell.cs index c93514e7a05e..651c7f6e35b4 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AgentPoolPatchParametersTags.PowerShell.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AgentPoolPatchParametersTags.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; @@ -63,7 +63,7 @@ public partial class AgentPoolPatchParametersTags 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 AgentPoolPatchParametersTags(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. @@ -101,29 +101,27 @@ internal AgentPoolPatchParametersTags(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 . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPatchParametersTags DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPatchParametersTags DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new AgentPoolPatchParametersTags(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.NetworkCloud.Models.Api20250201.IAgentPoolPatchParametersTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPatchParametersTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new AgentPoolPatchParametersTags(content); } @@ -133,7 +131,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPatchParametersTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPatchParametersTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AgentPoolPatchParametersTags.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AgentPoolPatchParametersTags.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AgentPoolPatchParametersTags.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AgentPoolPatchParametersTags.TypeConverter.cs index 436fd340bf8c..7471cdcb7824 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AgentPoolPatchParametersTags.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AgentPoolPatchParametersTags.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IAgentPoolPatchParametersTags ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPatchParametersTags ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPatchParametersTags).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPatchParametersTags).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AgentPoolPatchParametersTags.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AgentPoolPatchParametersTags.cs similarity index 84% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AgentPoolPatchParametersTags.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AgentPoolPatchParametersTags.cs index 11076e064e27..d2fa52091742 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AgentPoolPatchParametersTags.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AgentPoolPatchParametersTags.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; /// The Azure resource tags that will replace the existing ones. public partial class AgentPoolPatchParametersTags : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPatchParametersTags, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPatchParametersTagsInternal + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPatchParametersTags, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPatchParametersTagsInternal { /// Creates an new instance. diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AgentPoolPatchParametersTags.dictionary.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AgentPoolPatchParametersTags.dictionary.cs similarity index 96% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AgentPoolPatchParametersTags.dictionary.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AgentPoolPatchParametersTags.dictionary.cs index acb7d85ea85a..6890b7da9208 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AgentPoolPatchParametersTags.dictionary.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AgentPoolPatchParametersTags.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.AgentPoolPatchParametersTags source) => source.__additionalProperties; + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AgentPoolPatchParametersTags source) => source.__additionalProperties; } } \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AgentPoolPatchParametersTags.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AgentPoolPatchParametersTags.json.cs similarity index 95% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AgentPoolPatchParametersTags.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AgentPoolPatchParametersTags.json.cs index 34bef18c3a31..ba1224db9f4e 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AgentPoolPatchParametersTags.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AgentPoolPatchParametersTags.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -71,13 +71,13 @@ internal AgentPoolPatchParametersTags(Microsoft.Azure.PowerShell.Cmdlets.Network } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPatchParametersTags. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPatchParametersTags. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPatchParametersTags. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPatchParametersTags. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPatchParametersTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPatchParametersTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new AgentPoolPatchParametersTags(json) : null; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AgentPoolPatchProperties.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AgentPoolPatchProperties.PowerShell.cs new file mode 100644 index 000000000000..75636dc6cf16 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AgentPoolPatchProperties.PowerShell.cs @@ -0,0 +1,214 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + + /// + /// AgentPoolPatchProperties represents the properties of an agent pool that can be modified. + /// + [System.ComponentModel.TypeConverter(typeof(AgentPoolPatchPropertiesTypeConverter))] + public partial class AgentPoolPatchProperties + { + + /// + /// 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 AgentPoolPatchProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("AdministratorConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPatchPropertiesInternal)this).AdministratorConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INodePoolAdministratorConfigurationPatch) content.GetValueForProperty("AdministratorConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPatchPropertiesInternal)this).AdministratorConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.NodePoolAdministratorConfigurationPatchTypeConverter.ConvertFrom); + } + if (content.Contains("UpgradeSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPatchPropertiesInternal)this).UpgradeSetting = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolUpgradeSettings) content.GetValueForProperty("UpgradeSetting",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPatchPropertiesInternal)this).UpgradeSetting, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AgentPoolUpgradeSettingsTypeConverter.ConvertFrom); + } + if (content.Contains("Count")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPatchPropertiesInternal)this).Count = (long?) content.GetValueForProperty("Count",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPatchPropertiesInternal)this).Count, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("AdministratorConfigurationSshPublicKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPatchPropertiesInternal)this).AdministratorConfigurationSshPublicKey = (System.Collections.Generic.List) content.GetValueForProperty("AdministratorConfigurationSshPublicKey",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPatchPropertiesInternal)this).AdministratorConfigurationSshPublicKey, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.SshPublicKeyTypeConverter.ConvertFrom)); + } + if (content.Contains("UpgradeSettingDrainTimeout")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPatchPropertiesInternal)this).UpgradeSettingDrainTimeout = (long?) content.GetValueForProperty("UpgradeSettingDrainTimeout",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPatchPropertiesInternal)this).UpgradeSettingDrainTimeout, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("UpgradeSettingMaxSurge")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPatchPropertiesInternal)this).UpgradeSettingMaxSurge = (string) content.GetValueForProperty("UpgradeSettingMaxSurge",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPatchPropertiesInternal)this).UpgradeSettingMaxSurge, global::System.Convert.ToString); + } + if (content.Contains("UpgradeSettingMaxUnavailable")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPatchPropertiesInternal)this).UpgradeSettingMaxUnavailable = (string) content.GetValueForProperty("UpgradeSettingMaxUnavailable",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPatchPropertiesInternal)this).UpgradeSettingMaxUnavailable, 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 AgentPoolPatchProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("AdministratorConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPatchPropertiesInternal)this).AdministratorConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INodePoolAdministratorConfigurationPatch) content.GetValueForProperty("AdministratorConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPatchPropertiesInternal)this).AdministratorConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.NodePoolAdministratorConfigurationPatchTypeConverter.ConvertFrom); + } + if (content.Contains("UpgradeSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPatchPropertiesInternal)this).UpgradeSetting = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolUpgradeSettings) content.GetValueForProperty("UpgradeSetting",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPatchPropertiesInternal)this).UpgradeSetting, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AgentPoolUpgradeSettingsTypeConverter.ConvertFrom); + } + if (content.Contains("Count")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPatchPropertiesInternal)this).Count = (long?) content.GetValueForProperty("Count",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPatchPropertiesInternal)this).Count, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("AdministratorConfigurationSshPublicKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPatchPropertiesInternal)this).AdministratorConfigurationSshPublicKey = (System.Collections.Generic.List) content.GetValueForProperty("AdministratorConfigurationSshPublicKey",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPatchPropertiesInternal)this).AdministratorConfigurationSshPublicKey, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.SshPublicKeyTypeConverter.ConvertFrom)); + } + if (content.Contains("UpgradeSettingDrainTimeout")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPatchPropertiesInternal)this).UpgradeSettingDrainTimeout = (long?) content.GetValueForProperty("UpgradeSettingDrainTimeout",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPatchPropertiesInternal)this).UpgradeSettingDrainTimeout, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("UpgradeSettingMaxSurge")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPatchPropertiesInternal)this).UpgradeSettingMaxSurge = (string) content.GetValueForProperty("UpgradeSettingMaxSurge",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPatchPropertiesInternal)this).UpgradeSettingMaxSurge, global::System.Convert.ToString); + } + if (content.Contains("UpgradeSettingMaxUnavailable")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPatchPropertiesInternal)this).UpgradeSettingMaxUnavailable = (string) content.GetValueForProperty("UpgradeSettingMaxUnavailable",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPatchPropertiesInternal)this).UpgradeSettingMaxUnavailable, 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.NetworkCloud.Models.IAgentPoolPatchProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new AgentPoolPatchProperties(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.NetworkCloud.Models.IAgentPoolPatchProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new AgentPoolPatchProperties(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.NetworkCloud.Models.IAgentPoolPatchProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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(); + } + } + /// AgentPoolPatchProperties represents the properties of an agent pool that can be modified. + [System.ComponentModel.TypeConverter(typeof(AgentPoolPatchPropertiesTypeConverter))] + public partial interface IAgentPoolPatchProperties + + { + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AgentPoolPatchProperties.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AgentPoolPatchProperties.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AgentPoolPatchProperties.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AgentPoolPatchProperties.TypeConverter.cs index 3160063c5216..ddb6eb2abbb7 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AgentPoolPatchProperties.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AgentPoolPatchProperties.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IAgentPoolPatchProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPatchProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPatchProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPatchProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AgentPoolPatchProperties.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AgentPoolPatchProperties.cs new file mode 100644 index 000000000000..dd599a2aa00f --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AgentPoolPatchProperties.cs @@ -0,0 +1,193 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + + /// + /// AgentPoolPatchProperties represents the properties of an agent pool that can be modified. + /// + public partial class AgentPoolPatchProperties : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPatchProperties, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPatchPropertiesInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INodePoolAdministratorConfigurationPatch _administratorConfiguration; + + /// The configuration of administrator credentials for the control plane nodes. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INodePoolAdministratorConfigurationPatch AdministratorConfiguration { get => (this._administratorConfiguration = this._administratorConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.NodePoolAdministratorConfigurationPatch()); set => this._administratorConfiguration = value; } + + /// + /// SshPublicKey represents the public key used to authenticate with a resource through SSH. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public System.Collections.Generic.List AdministratorConfigurationSshPublicKey { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INodePoolAdministratorConfigurationPatchInternal)AdministratorConfiguration).SshPublicKey; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INodePoolAdministratorConfigurationPatchInternal)AdministratorConfiguration).SshPublicKey = value ?? null /* arrayOf */; } + + /// Backing field for property. + private long? _count; + + /// The number of virtual machines that use this configuration. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public long? Count { get => this._count; set => this._count = value; } + + /// Internal Acessors for AdministratorConfiguration + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INodePoolAdministratorConfigurationPatch Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPatchPropertiesInternal.AdministratorConfiguration { get => (this._administratorConfiguration = this._administratorConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.NodePoolAdministratorConfigurationPatch()); set { {_administratorConfiguration = value;} } } + + /// Internal Acessors for UpgradeSetting + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolUpgradeSettings Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPatchPropertiesInternal.UpgradeSetting { get => (this._upgradeSetting = this._upgradeSetting ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AgentPoolUpgradeSettings()); set { {_upgradeSetting = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolUpgradeSettings _upgradeSetting; + + /// The configuration of the agent pool. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolUpgradeSettings UpgradeSetting { get => (this._upgradeSetting = this._upgradeSetting ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AgentPoolUpgradeSettings()); set => this._upgradeSetting = value; } + + /// + /// The maximum time in seconds that is allowed for a node drain to complete before proceeding with the upgrade of the agent + /// pool. If not specified during creation, a value of 1800 seconds is used. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public long? UpgradeSettingDrainTimeout { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolUpgradeSettingsInternal)UpgradeSetting).DrainTimeout; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolUpgradeSettingsInternal)UpgradeSetting).DrainTimeout = value ?? default(long); } + + /// + /// The maximum number or percentage of nodes that are surged during upgrade. This can either be set to an integer (e.g. '5') + /// or a percentage (e.g. '50%'). If a percentage is specified, it is the percentage of the total agent pool size at the time + /// of the upgrade. For percentages, fractional nodes are rounded up. If not specified during creation, a value of 1 is used. + /// One of MaxSurge and MaxUnavailable must be greater than 0. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string UpgradeSettingMaxSurge { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolUpgradeSettingsInternal)UpgradeSetting).MaxSurge; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolUpgradeSettingsInternal)UpgradeSetting).MaxSurge = value ?? null; } + + /// + /// The maximum number or percentage of nodes that can be unavailable during upgrade. This can either be set to an integer + /// (e.g. '5') or a percentage (e.g. '50%'). If a percentage is specified, it is the percentage of the total agent pool size + /// at the time of the upgrade. For percentages, fractional nodes are rounded up. If not specified during creation, a value + /// of 0 is used. One of MaxSurge and MaxUnavailable must be greater than 0. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string UpgradeSettingMaxUnavailable { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolUpgradeSettingsInternal)UpgradeSetting).MaxUnavailable; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolUpgradeSettingsInternal)UpgradeSetting).MaxUnavailable = value ?? null; } + + /// Creates an new instance. + public AgentPoolPatchProperties() + { + + } + } + /// AgentPoolPatchProperties represents the properties of an agent pool that can be modified. + public partial interface IAgentPoolPatchProperties : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable + { + /// + /// SshPublicKey represents the public key used to authenticate with a resource through SSH. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"SshPublicKey represents the public key used to authenticate with a resource through SSH.", + SerializedName = @"sshPublicKeys", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISshPublicKey) })] + System.Collections.Generic.List AdministratorConfigurationSshPublicKey { get; set; } + /// The number of virtual machines that use this configuration. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The number of virtual machines that use this configuration.", + SerializedName = @"count", + PossibleTypes = new [] { typeof(long) })] + long? Count { get; set; } + /// + /// The maximum time in seconds that is allowed for a node drain to complete before proceeding with the upgrade of the agent + /// pool. If not specified during creation, a value of 1800 seconds is used. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The maximum time in seconds that is allowed for a node drain to complete before proceeding with the upgrade of the agent pool. If not specified during creation, a value of 1800 seconds is used.", + SerializedName = @"drainTimeout", + PossibleTypes = new [] { typeof(long) })] + long? UpgradeSettingDrainTimeout { get; set; } + /// + /// The maximum number or percentage of nodes that are surged during upgrade. This can either be set to an integer (e.g. '5') + /// or a percentage (e.g. '50%'). If a percentage is specified, it is the percentage of the total agent pool size at the time + /// of the upgrade. For percentages, fractional nodes are rounded up. If not specified during creation, a value of 1 is used. + /// One of MaxSurge and MaxUnavailable must be greater than 0. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The maximum number or percentage of nodes that are surged during upgrade. This can either be set to an integer (e.g. '5') or a percentage (e.g. '50%'). If a percentage is specified, it is the percentage of the total agent pool size at the time of the upgrade. For percentages, fractional nodes are rounded up. If not specified during creation, a value of 1 is used. One of MaxSurge and MaxUnavailable must be greater than 0.", + SerializedName = @"maxSurge", + PossibleTypes = new [] { typeof(string) })] + string UpgradeSettingMaxSurge { get; set; } + /// + /// The maximum number or percentage of nodes that can be unavailable during upgrade. This can either be set to an integer + /// (e.g. '5') or a percentage (e.g. '50%'). If a percentage is specified, it is the percentage of the total agent pool size + /// at the time of the upgrade. For percentages, fractional nodes are rounded up. If not specified during creation, a value + /// of 0 is used. One of MaxSurge and MaxUnavailable must be greater than 0. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The maximum number or percentage of nodes that can be unavailable during upgrade. This can either be set to an integer (e.g. '5') or a percentage (e.g. '50%'). If a percentage is specified, it is the percentage of the total agent pool size at the time of the upgrade. For percentages, fractional nodes are rounded up. If not specified during creation, a value of 0 is used. One of MaxSurge and MaxUnavailable must be greater than 0.", + SerializedName = @"maxUnavailable", + PossibleTypes = new [] { typeof(string) })] + string UpgradeSettingMaxUnavailable { get; set; } + + } + /// AgentPoolPatchProperties represents the properties of an agent pool that can be modified. + internal partial interface IAgentPoolPatchPropertiesInternal + + { + /// The configuration of administrator credentials for the control plane nodes. + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INodePoolAdministratorConfigurationPatch AdministratorConfiguration { get; set; } + /// + /// SshPublicKey represents the public key used to authenticate with a resource through SSH. + /// + System.Collections.Generic.List AdministratorConfigurationSshPublicKey { get; set; } + /// The number of virtual machines that use this configuration. + long? Count { get; set; } + /// The configuration of the agent pool. + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolUpgradeSettings UpgradeSetting { get; set; } + /// + /// The maximum time in seconds that is allowed for a node drain to complete before proceeding with the upgrade of the agent + /// pool. If not specified during creation, a value of 1800 seconds is used. + /// + long? UpgradeSettingDrainTimeout { get; set; } + /// + /// The maximum number or percentage of nodes that are surged during upgrade. This can either be set to an integer (e.g. '5') + /// or a percentage (e.g. '50%'). If a percentage is specified, it is the percentage of the total agent pool size at the time + /// of the upgrade. For percentages, fractional nodes are rounded up. If not specified during creation, a value of 1 is used. + /// One of MaxSurge and MaxUnavailable must be greater than 0. + /// + string UpgradeSettingMaxSurge { get; set; } + /// + /// The maximum number or percentage of nodes that can be unavailable during upgrade. This can either be set to an integer + /// (e.g. '5') or a percentage (e.g. '50%'). If a percentage is specified, it is the percentage of the total agent pool size + /// at the time of the upgrade. For percentages, fractional nodes are rounded up. If not specified during creation, a value + /// of 0 is used. One of MaxSurge and MaxUnavailable must be greater than 0. + /// + string UpgradeSettingMaxUnavailable { get; set; } + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AgentPoolPatchProperties.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AgentPoolPatchProperties.json.cs similarity index 92% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AgentPoolPatchProperties.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AgentPoolPatchProperties.json.cs index db364ab3591d..5c8457f8e724 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AgentPoolPatchProperties.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AgentPoolPatchProperties.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -67,20 +67,20 @@ internal AgentPoolPatchProperties(Microsoft.Azure.PowerShell.Cmdlets.NetworkClou { return; } - {_administratorConfiguration = If( json?.PropertyT("administratorConfiguration"), out var __jsonAdministratorConfiguration) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.NodePoolAdministratorConfigurationPatch.FromJson(__jsonAdministratorConfiguration) : AdministratorConfiguration;} - {_upgradeSetting = If( json?.PropertyT("upgradeSettings"), out var __jsonUpgradeSettings) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AgentPoolUpgradeSettings.FromJson(__jsonUpgradeSettings) : UpgradeSetting;} - {_count = If( json?.PropertyT("count"), out var __jsonCount) ? (long?)__jsonCount : Count;} + {_administratorConfiguration = If( json?.PropertyT("administratorConfiguration"), out var __jsonAdministratorConfiguration) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.NodePoolAdministratorConfigurationPatch.FromJson(__jsonAdministratorConfiguration) : _administratorConfiguration;} + {_upgradeSetting = If( json?.PropertyT("upgradeSettings"), out var __jsonUpgradeSettings) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AgentPoolUpgradeSettings.FromJson(__jsonUpgradeSettings) : _upgradeSetting;} + {_count = If( json?.PropertyT("count"), out var __jsonCount) ? (long?)__jsonCount : _count;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPatchProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPatchProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPatchProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPatchProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPatchProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPatchProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new AgentPoolPatchProperties(json) : null; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AgentPoolProperties.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AgentPoolProperties.PowerShell.cs new file mode 100644 index 000000000000..aa51c45fae50 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AgentPoolProperties.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.NetworkCloud.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + + /// + /// AgentPoolProperties represents the properties of the Kubernetes cluster agent pool. + /// + [System.ComponentModel.TypeConverter(typeof(AgentPoolPropertiesTypeConverter))] + public partial class AgentPoolProperties + { + + /// + /// 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 AgentPoolProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("AdministratorConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPropertiesInternal)this).AdministratorConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministratorConfiguration) content.GetValueForProperty("AdministratorConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPropertiesInternal)this).AdministratorConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AdministratorConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("AgentOption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPropertiesInternal)this).AgentOption = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentOptions) content.GetValueForProperty("AgentOption",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPropertiesInternal)this).AgentOption, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AgentOptionsTypeConverter.ConvertFrom); + } + if (content.Contains("AttachedNetworkConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPropertiesInternal)this).AttachedNetworkConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAttachedNetworkConfiguration) content.GetValueForProperty("AttachedNetworkConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPropertiesInternal)this).AttachedNetworkConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AttachedNetworkConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("UpgradeSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPropertiesInternal)this).UpgradeSetting = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolUpgradeSettings) content.GetValueForProperty("UpgradeSetting",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPropertiesInternal)this).UpgradeSetting, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AgentPoolUpgradeSettingsTypeConverter.ConvertFrom); + } + if (content.Contains("AvailabilityZone")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPropertiesInternal)this).AvailabilityZone = (System.Collections.Generic.List) content.GetValueForProperty("AvailabilityZone",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPropertiesInternal)this).AvailabilityZone, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("Count")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPropertiesInternal)this).Count = (long) content.GetValueForProperty("Count",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPropertiesInternal)this).Count, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("DetailedStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPropertiesInternal)this).DetailedStatus = (string) content.GetValueForProperty("DetailedStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPropertiesInternal)this).DetailedStatus, global::System.Convert.ToString); + } + if (content.Contains("DetailedStatusMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPropertiesInternal)this).DetailedStatusMessage = (string) content.GetValueForProperty("DetailedStatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPropertiesInternal)this).DetailedStatusMessage, global::System.Convert.ToString); + } + if (content.Contains("KubernetesVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPropertiesInternal)this).KubernetesVersion = (string) content.GetValueForProperty("KubernetesVersion",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPropertiesInternal)this).KubernetesVersion, global::System.Convert.ToString); + } + if (content.Contains("Label")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPropertiesInternal)this).Label = (System.Collections.Generic.List) content.GetValueForProperty("Label",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPropertiesInternal)this).Label, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.KubernetesLabelTypeConverter.ConvertFrom)); + } + if (content.Contains("Mode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPropertiesInternal)this).Mode = (string) content.GetValueForProperty("Mode",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPropertiesInternal)this).Mode, global::System.Convert.ToString); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPropertiesInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("Taint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPropertiesInternal)this).Taint = (System.Collections.Generic.List) content.GetValueForProperty("Taint",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPropertiesInternal)this).Taint, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.KubernetesLabelTypeConverter.ConvertFrom)); + } + if (content.Contains("VMSkuName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPropertiesInternal)this).VMSkuName = (string) content.GetValueForProperty("VMSkuName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPropertiesInternal)this).VMSkuName, global::System.Convert.ToString); + } + if (content.Contains("AdministratorConfigurationAdminUsername")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPropertiesInternal)this).AdministratorConfigurationAdminUsername = (string) content.GetValueForProperty("AdministratorConfigurationAdminUsername",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPropertiesInternal)this).AdministratorConfigurationAdminUsername, global::System.Convert.ToString); + } + if (content.Contains("AgentOptionHugepagesCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPropertiesInternal)this).AgentOptionHugepagesCount = (long?) content.GetValueForProperty("AgentOptionHugepagesCount",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPropertiesInternal)this).AgentOptionHugepagesCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("AgentOptionHugepagesSize")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPropertiesInternal)this).AgentOptionHugepagesSize = (string) content.GetValueForProperty("AgentOptionHugepagesSize",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPropertiesInternal)this).AgentOptionHugepagesSize, global::System.Convert.ToString); + } + if (content.Contains("AttachedNetworkConfigurationL2Network")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPropertiesInternal)this).AttachedNetworkConfigurationL2Network = (System.Collections.Generic.List) content.GetValueForProperty("AttachedNetworkConfigurationL2Network",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPropertiesInternal)this).AttachedNetworkConfigurationL2Network, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.L2NetworkAttachmentConfigurationTypeConverter.ConvertFrom)); + } + if (content.Contains("AttachedNetworkConfigurationL3Network")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPropertiesInternal)this).AttachedNetworkConfigurationL3Network = (System.Collections.Generic.List) content.GetValueForProperty("AttachedNetworkConfigurationL3Network",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPropertiesInternal)this).AttachedNetworkConfigurationL3Network, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.L3NetworkAttachmentConfigurationTypeConverter.ConvertFrom)); + } + if (content.Contains("AttachedNetworkConfigurationTrunkedNetwork")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPropertiesInternal)this).AttachedNetworkConfigurationTrunkedNetwork = (System.Collections.Generic.List) content.GetValueForProperty("AttachedNetworkConfigurationTrunkedNetwork",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPropertiesInternal)this).AttachedNetworkConfigurationTrunkedNetwork, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.TrunkedNetworkAttachmentConfigurationTypeConverter.ConvertFrom)); + } + if (content.Contains("AdministratorConfigurationSshPublicKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPropertiesInternal)this).AdministratorConfigurationSshPublicKey = (System.Collections.Generic.List) content.GetValueForProperty("AdministratorConfigurationSshPublicKey",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPropertiesInternal)this).AdministratorConfigurationSshPublicKey, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.SshPublicKeyTypeConverter.ConvertFrom)); + } + if (content.Contains("UpgradeSettingDrainTimeout")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPropertiesInternal)this).UpgradeSettingDrainTimeout = (long?) content.GetValueForProperty("UpgradeSettingDrainTimeout",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPropertiesInternal)this).UpgradeSettingDrainTimeout, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("UpgradeSettingMaxSurge")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPropertiesInternal)this).UpgradeSettingMaxSurge = (string) content.GetValueForProperty("UpgradeSettingMaxSurge",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPropertiesInternal)this).UpgradeSettingMaxSurge, global::System.Convert.ToString); + } + if (content.Contains("UpgradeSettingMaxUnavailable")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPropertiesInternal)this).UpgradeSettingMaxUnavailable = (string) content.GetValueForProperty("UpgradeSettingMaxUnavailable",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPropertiesInternal)this).UpgradeSettingMaxUnavailable, 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 AgentPoolProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("AdministratorConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPropertiesInternal)this).AdministratorConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministratorConfiguration) content.GetValueForProperty("AdministratorConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPropertiesInternal)this).AdministratorConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AdministratorConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("AgentOption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPropertiesInternal)this).AgentOption = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentOptions) content.GetValueForProperty("AgentOption",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPropertiesInternal)this).AgentOption, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AgentOptionsTypeConverter.ConvertFrom); + } + if (content.Contains("AttachedNetworkConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPropertiesInternal)this).AttachedNetworkConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAttachedNetworkConfiguration) content.GetValueForProperty("AttachedNetworkConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPropertiesInternal)this).AttachedNetworkConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AttachedNetworkConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("UpgradeSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPropertiesInternal)this).UpgradeSetting = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolUpgradeSettings) content.GetValueForProperty("UpgradeSetting",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPropertiesInternal)this).UpgradeSetting, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AgentPoolUpgradeSettingsTypeConverter.ConvertFrom); + } + if (content.Contains("AvailabilityZone")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPropertiesInternal)this).AvailabilityZone = (System.Collections.Generic.List) content.GetValueForProperty("AvailabilityZone",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPropertiesInternal)this).AvailabilityZone, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("Count")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPropertiesInternal)this).Count = (long) content.GetValueForProperty("Count",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPropertiesInternal)this).Count, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("DetailedStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPropertiesInternal)this).DetailedStatus = (string) content.GetValueForProperty("DetailedStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPropertiesInternal)this).DetailedStatus, global::System.Convert.ToString); + } + if (content.Contains("DetailedStatusMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPropertiesInternal)this).DetailedStatusMessage = (string) content.GetValueForProperty("DetailedStatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPropertiesInternal)this).DetailedStatusMessage, global::System.Convert.ToString); + } + if (content.Contains("KubernetesVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPropertiesInternal)this).KubernetesVersion = (string) content.GetValueForProperty("KubernetesVersion",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPropertiesInternal)this).KubernetesVersion, global::System.Convert.ToString); + } + if (content.Contains("Label")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPropertiesInternal)this).Label = (System.Collections.Generic.List) content.GetValueForProperty("Label",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPropertiesInternal)this).Label, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.KubernetesLabelTypeConverter.ConvertFrom)); + } + if (content.Contains("Mode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPropertiesInternal)this).Mode = (string) content.GetValueForProperty("Mode",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPropertiesInternal)this).Mode, global::System.Convert.ToString); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPropertiesInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("Taint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPropertiesInternal)this).Taint = (System.Collections.Generic.List) content.GetValueForProperty("Taint",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPropertiesInternal)this).Taint, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.KubernetesLabelTypeConverter.ConvertFrom)); + } + if (content.Contains("VMSkuName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPropertiesInternal)this).VMSkuName = (string) content.GetValueForProperty("VMSkuName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPropertiesInternal)this).VMSkuName, global::System.Convert.ToString); + } + if (content.Contains("AdministratorConfigurationAdminUsername")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPropertiesInternal)this).AdministratorConfigurationAdminUsername = (string) content.GetValueForProperty("AdministratorConfigurationAdminUsername",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPropertiesInternal)this).AdministratorConfigurationAdminUsername, global::System.Convert.ToString); + } + if (content.Contains("AgentOptionHugepagesCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPropertiesInternal)this).AgentOptionHugepagesCount = (long?) content.GetValueForProperty("AgentOptionHugepagesCount",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPropertiesInternal)this).AgentOptionHugepagesCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("AgentOptionHugepagesSize")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPropertiesInternal)this).AgentOptionHugepagesSize = (string) content.GetValueForProperty("AgentOptionHugepagesSize",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPropertiesInternal)this).AgentOptionHugepagesSize, global::System.Convert.ToString); + } + if (content.Contains("AttachedNetworkConfigurationL2Network")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPropertiesInternal)this).AttachedNetworkConfigurationL2Network = (System.Collections.Generic.List) content.GetValueForProperty("AttachedNetworkConfigurationL2Network",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPropertiesInternal)this).AttachedNetworkConfigurationL2Network, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.L2NetworkAttachmentConfigurationTypeConverter.ConvertFrom)); + } + if (content.Contains("AttachedNetworkConfigurationL3Network")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPropertiesInternal)this).AttachedNetworkConfigurationL3Network = (System.Collections.Generic.List) content.GetValueForProperty("AttachedNetworkConfigurationL3Network",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPropertiesInternal)this).AttachedNetworkConfigurationL3Network, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.L3NetworkAttachmentConfigurationTypeConverter.ConvertFrom)); + } + if (content.Contains("AttachedNetworkConfigurationTrunkedNetwork")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPropertiesInternal)this).AttachedNetworkConfigurationTrunkedNetwork = (System.Collections.Generic.List) content.GetValueForProperty("AttachedNetworkConfigurationTrunkedNetwork",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPropertiesInternal)this).AttachedNetworkConfigurationTrunkedNetwork, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.TrunkedNetworkAttachmentConfigurationTypeConverter.ConvertFrom)); + } + if (content.Contains("AdministratorConfigurationSshPublicKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPropertiesInternal)this).AdministratorConfigurationSshPublicKey = (System.Collections.Generic.List) content.GetValueForProperty("AdministratorConfigurationSshPublicKey",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPropertiesInternal)this).AdministratorConfigurationSshPublicKey, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.SshPublicKeyTypeConverter.ConvertFrom)); + } + if (content.Contains("UpgradeSettingDrainTimeout")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPropertiesInternal)this).UpgradeSettingDrainTimeout = (long?) content.GetValueForProperty("UpgradeSettingDrainTimeout",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPropertiesInternal)this).UpgradeSettingDrainTimeout, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("UpgradeSettingMaxSurge")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPropertiesInternal)this).UpgradeSettingMaxSurge = (string) content.GetValueForProperty("UpgradeSettingMaxSurge",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPropertiesInternal)this).UpgradeSettingMaxSurge, global::System.Convert.ToString); + } + if (content.Contains("UpgradeSettingMaxUnavailable")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPropertiesInternal)this).UpgradeSettingMaxUnavailable = (string) content.GetValueForProperty("UpgradeSettingMaxUnavailable",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPropertiesInternal)this).UpgradeSettingMaxUnavailable, 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.NetworkCloud.Models.IAgentPoolProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new AgentPoolProperties(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.NetworkCloud.Models.IAgentPoolProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new AgentPoolProperties(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.NetworkCloud.Models.IAgentPoolProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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(); + } + } + /// AgentPoolProperties represents the properties of the Kubernetes cluster agent pool. + [System.ComponentModel.TypeConverter(typeof(AgentPoolPropertiesTypeConverter))] + public partial interface IAgentPoolProperties + + { + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AgentPoolProperties.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AgentPoolProperties.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AgentPoolProperties.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AgentPoolProperties.TypeConverter.cs index a93072dee578..0f1413f951b7 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AgentPoolProperties.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AgentPoolProperties.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IAgentPoolProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AgentPoolProperties.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AgentPoolProperties.cs new file mode 100644 index 000000000000..4253f1a59182 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AgentPoolProperties.cs @@ -0,0 +1,562 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + + /// + /// AgentPoolProperties represents the properties of the Kubernetes cluster agent pool. + /// + public partial class AgentPoolProperties : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolProperties, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPropertiesInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministratorConfiguration _administratorConfiguration; + + /// The administrator credentials to be used for the nodes in this agent pool. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministratorConfiguration AdministratorConfiguration { get => (this._administratorConfiguration = this._administratorConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AdministratorConfiguration()); set => this._administratorConfiguration = value; } + + /// + /// The user name for the administrator that will be applied to the operating systems that run Kubernetes nodes. If not supplied, + /// a user name will be chosen by the service. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string AdministratorConfigurationAdminUsername { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministratorConfigurationInternal)AdministratorConfiguration).AdminUsername; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministratorConfigurationInternal)AdministratorConfiguration).AdminUsername = value ?? null; } + + /// + /// The SSH configuration for the operating systems that run the nodes in the Kubernetes cluster. In some cases, specification + /// of public keys may be required to produce a working environment. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public System.Collections.Generic.List AdministratorConfigurationSshPublicKey { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministratorConfigurationInternal)AdministratorConfiguration).SshPublicKey; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministratorConfigurationInternal)AdministratorConfiguration).SshPublicKey = value ?? null /* arrayOf */; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentOptions _agentOption; + + /// The configurations that will be applied to each agent in this agent pool. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentOptions AgentOption { get => (this._agentOption = this._agentOption ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AgentOptions()); set => this._agentOption = value; } + + /// The number of hugepages to allocate. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public long? AgentOptionHugepagesCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentOptionsInternal)AgentOption).HugepagesCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentOptionsInternal)AgentOption).HugepagesCount = value ?? default(long); } + + /// The size of the hugepages to allocate. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string AgentOptionHugepagesSize { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentOptionsInternal)AgentOption).HugepagesSize; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentOptionsInternal)AgentOption).HugepagesSize = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAttachedNetworkConfiguration _attachedNetworkConfiguration; + + /// + /// The configuration of networks being attached to the agent pool for use by the workloads that run on this Kubernetes cluster. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAttachedNetworkConfiguration AttachedNetworkConfiguration { get => (this._attachedNetworkConfiguration = this._attachedNetworkConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AttachedNetworkConfiguration()); set => this._attachedNetworkConfiguration = value; } + + /// The list of Layer 2 Networks and related configuration for attachment. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public System.Collections.Generic.List AttachedNetworkConfigurationL2Network { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAttachedNetworkConfigurationInternal)AttachedNetworkConfiguration).L2Network; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAttachedNetworkConfigurationInternal)AttachedNetworkConfiguration).L2Network = value ?? null /* arrayOf */; } + + /// The list of Layer 3 Networks and related configuration for attachment. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public System.Collections.Generic.List AttachedNetworkConfigurationL3Network { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAttachedNetworkConfigurationInternal)AttachedNetworkConfiguration).L3Network; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAttachedNetworkConfigurationInternal)AttachedNetworkConfiguration).L3Network = value ?? null /* arrayOf */; } + + /// The list of Trunked Networks and related configuration for attachment. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public System.Collections.Generic.List AttachedNetworkConfigurationTrunkedNetwork { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAttachedNetworkConfigurationInternal)AttachedNetworkConfiguration).TrunkedNetwork; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAttachedNetworkConfigurationInternal)AttachedNetworkConfiguration).TrunkedNetwork = value ?? null /* arrayOf */; } + + /// Backing field for property. + private System.Collections.Generic.List _availabilityZone; + + /// + /// The list of availability zones of the Network Cloud cluster used for the provisioning of nodes in this agent pool. If + /// not specified, all availability zones will be used. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public System.Collections.Generic.List AvailabilityZone { get => this._availabilityZone; set => this._availabilityZone = value; } + + /// Backing field for property. + private long _count; + + /// The number of virtual machines that use this configuration. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public long Count { get => this._count; set => this._count = value; } + + /// Backing field for property. + private string _detailedStatus; + + /// The current status of the agent pool. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string DetailedStatus { get => this._detailedStatus; } + + /// Backing field for property. + private string _detailedStatusMessage; + + /// The descriptive message about the current detailed status. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string DetailedStatusMessage { get => this._detailedStatusMessage; } + + /// Backing field for property. + private string _kubernetesVersion; + + /// The Kubernetes version running in this agent pool. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string KubernetesVersion { get => this._kubernetesVersion; } + + /// Backing field for property. + private System.Collections.Generic.List _label; + + /// The labels applied to the nodes in this agent pool. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public System.Collections.Generic.List Label { get => this._label; set => this._label = value; } + + /// Internal Acessors for AdministratorConfiguration + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministratorConfiguration Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPropertiesInternal.AdministratorConfiguration { get => (this._administratorConfiguration = this._administratorConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AdministratorConfiguration()); set { {_administratorConfiguration = value;} } } + + /// Internal Acessors for AgentOption + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentOptions Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPropertiesInternal.AgentOption { get => (this._agentOption = this._agentOption ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AgentOptions()); set { {_agentOption = value;} } } + + /// Internal Acessors for AttachedNetworkConfiguration + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAttachedNetworkConfiguration Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPropertiesInternal.AttachedNetworkConfiguration { get => (this._attachedNetworkConfiguration = this._attachedNetworkConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AttachedNetworkConfiguration()); set { {_attachedNetworkConfiguration = value;} } } + + /// Internal Acessors for DetailedStatus + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPropertiesInternal.DetailedStatus { get => this._detailedStatus; set { {_detailedStatus = value;} } } + + /// Internal Acessors for DetailedStatusMessage + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPropertiesInternal.DetailedStatusMessage { get => this._detailedStatusMessage; set { {_detailedStatusMessage = value;} } } + + /// Internal Acessors for KubernetesVersion + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPropertiesInternal.KubernetesVersion { get => this._kubernetesVersion; set { {_kubernetesVersion = value;} } } + + /// Internal Acessors for ProvisioningState + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPropertiesInternal.ProvisioningState { get => this._provisioningState; set { {_provisioningState = value;} } } + + /// Internal Acessors for UpgradeSetting + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolUpgradeSettings Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPropertiesInternal.UpgradeSetting { get => (this._upgradeSetting = this._upgradeSetting ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AgentPoolUpgradeSettings()); set { {_upgradeSetting = value;} } } + + /// Backing field for property. + private string _mode; + + /// + /// The selection of how this agent pool is utilized, either as a system pool or a user pool. System pools run the features + /// and critical services for the Kubernetes Cluster, while user pools are dedicated to user workloads. Every Kubernetes cluster + /// must contain at least one system node pool with at least one node. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string Mode { get => this._mode; set => this._mode = value; } + + /// Backing field for property. + private string _provisioningState; + + /// The provisioning state of the agent pool. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string ProvisioningState { get => this._provisioningState; } + + /// Backing field for property. + private System.Collections.Generic.List _taint; + + /// The taints applied to the nodes in this agent pool. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public System.Collections.Generic.List Taint { get => this._taint; set => this._taint = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolUpgradeSettings _upgradeSetting; + + /// The configuration of the agent pool. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolUpgradeSettings UpgradeSetting { get => (this._upgradeSetting = this._upgradeSetting ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AgentPoolUpgradeSettings()); set => this._upgradeSetting = value; } + + /// + /// The maximum time in seconds that is allowed for a node drain to complete before proceeding with the upgrade of the agent + /// pool. If not specified during creation, a value of 1800 seconds is used. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public long? UpgradeSettingDrainTimeout { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolUpgradeSettingsInternal)UpgradeSetting).DrainTimeout; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolUpgradeSettingsInternal)UpgradeSetting).DrainTimeout = value ?? default(long); } + + /// + /// The maximum number or percentage of nodes that are surged during upgrade. This can either be set to an integer (e.g. '5') + /// or a percentage (e.g. '50%'). If a percentage is specified, it is the percentage of the total agent pool size at the time + /// of the upgrade. For percentages, fractional nodes are rounded up. If not specified during creation, a value of 1 is used. + /// One of MaxSurge and MaxUnavailable must be greater than 0. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string UpgradeSettingMaxSurge { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolUpgradeSettingsInternal)UpgradeSetting).MaxSurge; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolUpgradeSettingsInternal)UpgradeSetting).MaxSurge = value ?? null; } + + /// + /// The maximum number or percentage of nodes that can be unavailable during upgrade. This can either be set to an integer + /// (e.g. '5') or a percentage (e.g. '50%'). If a percentage is specified, it is the percentage of the total agent pool size + /// at the time of the upgrade. For percentages, fractional nodes are rounded up. If not specified during creation, a value + /// of 0 is used. One of MaxSurge and MaxUnavailable must be greater than 0. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string UpgradeSettingMaxUnavailable { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolUpgradeSettingsInternal)UpgradeSetting).MaxUnavailable; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolUpgradeSettingsInternal)UpgradeSetting).MaxUnavailable = value ?? null; } + + /// Backing field for property. + private string _vMSkuName; + + /// + /// The name of the VM SKU that determines the size of resources allocated for node VMs. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string VMSkuName { get => this._vMSkuName; set => this._vMSkuName = value; } + + /// Creates an new instance. + public AgentPoolProperties() + { + + } + } + /// AgentPoolProperties represents the properties of the Kubernetes cluster agent pool. + public partial interface IAgentPoolProperties : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable + { + /// + /// The user name for the administrator that will be applied to the operating systems that run Kubernetes nodes. If not supplied, + /// a user name will be chosen by the service. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The user name for the administrator that will be applied to the operating systems that run Kubernetes nodes. If not supplied, a user name will be chosen by the service.", + SerializedName = @"adminUsername", + PossibleTypes = new [] { typeof(string) })] + string AdministratorConfigurationAdminUsername { get; set; } + /// + /// The SSH configuration for the operating systems that run the nodes in the Kubernetes cluster. In some cases, specification + /// of public keys may be required to produce a working environment. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The SSH configuration for the operating systems that run the nodes in the Kubernetes cluster. In some cases, specification of public keys may be required to produce a working environment.", + SerializedName = @"sshPublicKeys", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISshPublicKey) })] + System.Collections.Generic.List AdministratorConfigurationSshPublicKey { get; set; } + /// The number of hugepages to allocate. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The number of hugepages to allocate.", + SerializedName = @"hugepagesCount", + PossibleTypes = new [] { typeof(long) })] + long? AgentOptionHugepagesCount { get; set; } + /// The size of the hugepages to allocate. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The size of the hugepages to allocate.", + SerializedName = @"hugepagesSize", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("2M", "1G")] + string AgentOptionHugepagesSize { get; set; } + /// The list of Layer 2 Networks and related configuration for attachment. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The list of Layer 2 Networks and related configuration for attachment.", + SerializedName = @"l2Networks", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkAttachmentConfiguration) })] + System.Collections.Generic.List AttachedNetworkConfigurationL2Network { get; set; } + /// The list of Layer 3 Networks and related configuration for attachment. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The list of Layer 3 Networks and related configuration for attachment.", + SerializedName = @"l3Networks", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkAttachmentConfiguration) })] + System.Collections.Generic.List AttachedNetworkConfigurationL3Network { get; set; } + /// The list of Trunked Networks and related configuration for attachment. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The list of Trunked Networks and related configuration for attachment.", + SerializedName = @"trunkedNetworks", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkAttachmentConfiguration) })] + System.Collections.Generic.List AttachedNetworkConfigurationTrunkedNetwork { get; set; } + /// + /// The list of availability zones of the Network Cloud cluster used for the provisioning of nodes in this agent pool. If + /// not specified, all availability zones will be used. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The list of availability zones of the Network Cloud cluster used for the provisioning of nodes in this agent pool. If not specified, all availability zones will be used.", + SerializedName = @"availabilityZones", + PossibleTypes = new [] { typeof(string) })] + System.Collections.Generic.List AvailabilityZone { get; set; } + /// The number of virtual machines that use this configuration. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The number of virtual machines that use this configuration.", + SerializedName = @"count", + PossibleTypes = new [] { typeof(long) })] + long Count { get; set; } + /// The current status of the agent pool. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The current status of the agent pool.", + SerializedName = @"detailedStatus", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Available", "Error", "Provisioning")] + string DetailedStatus { get; } + /// The descriptive message about the current detailed status. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The descriptive message about the current detailed status.", + SerializedName = @"detailedStatusMessage", + PossibleTypes = new [] { typeof(string) })] + string DetailedStatusMessage { get; } + /// The Kubernetes version running in this agent pool. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The Kubernetes version running in this agent pool.", + SerializedName = @"kubernetesVersion", + PossibleTypes = new [] { typeof(string) })] + string KubernetesVersion { get; } + /// The labels applied to the nodes in this agent pool. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The labels applied to the nodes in this agent pool.", + SerializedName = @"labels", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesLabel) })] + System.Collections.Generic.List Label { get; set; } + /// + /// The selection of how this agent pool is utilized, either as a system pool or a user pool. System pools run the features + /// and critical services for the Kubernetes Cluster, while user pools are dedicated to user workloads. Every Kubernetes cluster + /// must contain at least one system node pool with at least one node. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The selection of how this agent pool is utilized, either as a system pool or a user pool. System pools run the features and critical services for the Kubernetes Cluster, while user pools are dedicated to user workloads. Every Kubernetes cluster must contain at least one system node pool with at least one node.", + SerializedName = @"mode", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("System", "User", "NotApplicable")] + string Mode { get; set; } + /// The provisioning state of the agent pool. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The provisioning state of the agent pool.", + SerializedName = @"provisioningState", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Accepted", "Canceled", "Deleting", "Failed", "InProgress", "Succeeded", "Updating")] + string ProvisioningState { get; } + /// The taints applied to the nodes in this agent pool. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The taints applied to the nodes in this agent pool.", + SerializedName = @"taints", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesLabel) })] + System.Collections.Generic.List Taint { get; set; } + /// + /// The maximum time in seconds that is allowed for a node drain to complete before proceeding with the upgrade of the agent + /// pool. If not specified during creation, a value of 1800 seconds is used. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The maximum time in seconds that is allowed for a node drain to complete before proceeding with the upgrade of the agent pool. If not specified during creation, a value of 1800 seconds is used.", + SerializedName = @"drainTimeout", + PossibleTypes = new [] { typeof(long) })] + long? UpgradeSettingDrainTimeout { get; set; } + /// + /// The maximum number or percentage of nodes that are surged during upgrade. This can either be set to an integer (e.g. '5') + /// or a percentage (e.g. '50%'). If a percentage is specified, it is the percentage of the total agent pool size at the time + /// of the upgrade. For percentages, fractional nodes are rounded up. If not specified during creation, a value of 1 is used. + /// One of MaxSurge and MaxUnavailable must be greater than 0. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The maximum number or percentage of nodes that are surged during upgrade. This can either be set to an integer (e.g. '5') or a percentage (e.g. '50%'). If a percentage is specified, it is the percentage of the total agent pool size at the time of the upgrade. For percentages, fractional nodes are rounded up. If not specified during creation, a value of 1 is used. One of MaxSurge and MaxUnavailable must be greater than 0.", + SerializedName = @"maxSurge", + PossibleTypes = new [] { typeof(string) })] + string UpgradeSettingMaxSurge { get; set; } + /// + /// The maximum number or percentage of nodes that can be unavailable during upgrade. This can either be set to an integer + /// (e.g. '5') or a percentage (e.g. '50%'). If a percentage is specified, it is the percentage of the total agent pool size + /// at the time of the upgrade. For percentages, fractional nodes are rounded up. If not specified during creation, a value + /// of 0 is used. One of MaxSurge and MaxUnavailable must be greater than 0. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The maximum number or percentage of nodes that can be unavailable during upgrade. This can either be set to an integer (e.g. '5') or a percentage (e.g. '50%'). If a percentage is specified, it is the percentage of the total agent pool size at the time of the upgrade. For percentages, fractional nodes are rounded up. If not specified during creation, a value of 0 is used. One of MaxSurge and MaxUnavailable must be greater than 0.", + SerializedName = @"maxUnavailable", + PossibleTypes = new [] { typeof(string) })] + string UpgradeSettingMaxUnavailable { get; set; } + /// + /// The name of the VM SKU that determines the size of resources allocated for node VMs. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The name of the VM SKU that determines the size of resources allocated for node VMs.", + SerializedName = @"vmSkuName", + PossibleTypes = new [] { typeof(string) })] + string VMSkuName { get; set; } + + } + /// AgentPoolProperties represents the properties of the Kubernetes cluster agent pool. + internal partial interface IAgentPoolPropertiesInternal + + { + /// The administrator credentials to be used for the nodes in this agent pool. + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministratorConfiguration AdministratorConfiguration { get; set; } + /// + /// The user name for the administrator that will be applied to the operating systems that run Kubernetes nodes. If not supplied, + /// a user name will be chosen by the service. + /// + string AdministratorConfigurationAdminUsername { get; set; } + /// + /// The SSH configuration for the operating systems that run the nodes in the Kubernetes cluster. In some cases, specification + /// of public keys may be required to produce a working environment. + /// + System.Collections.Generic.List AdministratorConfigurationSshPublicKey { get; set; } + /// The configurations that will be applied to each agent in this agent pool. + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentOptions AgentOption { get; set; } + /// The number of hugepages to allocate. + long? AgentOptionHugepagesCount { get; set; } + /// The size of the hugepages to allocate. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("2M", "1G")] + string AgentOptionHugepagesSize { get; set; } + /// + /// The configuration of networks being attached to the agent pool for use by the workloads that run on this Kubernetes cluster. + /// + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAttachedNetworkConfiguration AttachedNetworkConfiguration { get; set; } + /// The list of Layer 2 Networks and related configuration for attachment. + System.Collections.Generic.List AttachedNetworkConfigurationL2Network { get; set; } + /// The list of Layer 3 Networks and related configuration for attachment. + System.Collections.Generic.List AttachedNetworkConfigurationL3Network { get; set; } + /// The list of Trunked Networks and related configuration for attachment. + System.Collections.Generic.List AttachedNetworkConfigurationTrunkedNetwork { get; set; } + /// + /// The list of availability zones of the Network Cloud cluster used for the provisioning of nodes in this agent pool. If + /// not specified, all availability zones will be used. + /// + System.Collections.Generic.List AvailabilityZone { get; set; } + /// The number of virtual machines that use this configuration. + long Count { get; set; } + /// The current status of the agent pool. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Available", "Error", "Provisioning")] + string DetailedStatus { get; set; } + /// The descriptive message about the current detailed status. + string DetailedStatusMessage { get; set; } + /// The Kubernetes version running in this agent pool. + string KubernetesVersion { get; set; } + /// The labels applied to the nodes in this agent pool. + System.Collections.Generic.List Label { get; set; } + /// + /// The selection of how this agent pool is utilized, either as a system pool or a user pool. System pools run the features + /// and critical services for the Kubernetes Cluster, while user pools are dedicated to user workloads. Every Kubernetes cluster + /// must contain at least one system node pool with at least one node. + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("System", "User", "NotApplicable")] + string Mode { get; set; } + /// The provisioning state of the agent pool. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Accepted", "Canceled", "Deleting", "Failed", "InProgress", "Succeeded", "Updating")] + string ProvisioningState { get; set; } + /// The taints applied to the nodes in this agent pool. + System.Collections.Generic.List Taint { get; set; } + /// The configuration of the agent pool. + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolUpgradeSettings UpgradeSetting { get; set; } + /// + /// The maximum time in seconds that is allowed for a node drain to complete before proceeding with the upgrade of the agent + /// pool. If not specified during creation, a value of 1800 seconds is used. + /// + long? UpgradeSettingDrainTimeout { get; set; } + /// + /// The maximum number or percentage of nodes that are surged during upgrade. This can either be set to an integer (e.g. '5') + /// or a percentage (e.g. '50%'). If a percentage is specified, it is the percentage of the total agent pool size at the time + /// of the upgrade. For percentages, fractional nodes are rounded up. If not specified during creation, a value of 1 is used. + /// One of MaxSurge and MaxUnavailable must be greater than 0. + /// + string UpgradeSettingMaxSurge { get; set; } + /// + /// The maximum number or percentage of nodes that can be unavailable during upgrade. This can either be set to an integer + /// (e.g. '5') or a percentage (e.g. '50%'). If a percentage is specified, it is the percentage of the total agent pool size + /// at the time of the upgrade. For percentages, fractional nodes are rounded up. If not specified during creation, a value + /// of 0 is used. One of MaxSurge and MaxUnavailable must be greater than 0. + /// + string UpgradeSettingMaxUnavailable { get; set; } + /// + /// The name of the VM SKU that determines the size of resources allocated for node VMs. + /// + string VMSkuName { get; set; } + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AgentPoolProperties.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AgentPoolProperties.json.cs new file mode 100644 index 000000000000..d2520cfec2b0 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AgentPoolProperties.json.cs @@ -0,0 +1,196 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + + /// + /// AgentPoolProperties represents the properties of the Kubernetes cluster agent pool. + /// + public partial class AgentPoolProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject instance to deserialize from. + internal AgentPoolProperties(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_administratorConfiguration = If( json?.PropertyT("administratorConfiguration"), out var __jsonAdministratorConfiguration) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AdministratorConfiguration.FromJson(__jsonAdministratorConfiguration) : _administratorConfiguration;} + {_agentOption = If( json?.PropertyT("agentOptions"), out var __jsonAgentOptions) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AgentOptions.FromJson(__jsonAgentOptions) : _agentOption;} + {_attachedNetworkConfiguration = If( json?.PropertyT("attachedNetworkConfiguration"), out var __jsonAttachedNetworkConfiguration) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AttachedNetworkConfiguration.FromJson(__jsonAttachedNetworkConfiguration) : _attachedNetworkConfiguration;} + {_upgradeSetting = If( json?.PropertyT("upgradeSettings"), out var __jsonUpgradeSettings) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AgentPoolUpgradeSettings.FromJson(__jsonUpgradeSettings) : _upgradeSetting;} + {_availabilityZone = If( json?.PropertyT("availabilityZones"), out var __jsonAvailabilityZones) ? If( __jsonAvailabilityZones as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : _availabilityZone;} + {_count = If( json?.PropertyT("count"), out var __jsonCount) ? (long)__jsonCount : _count;} + {_detailedStatus = If( json?.PropertyT("detailedStatus"), out var __jsonDetailedStatus) ? (string)__jsonDetailedStatus : (string)_detailedStatus;} + {_detailedStatusMessage = If( json?.PropertyT("detailedStatusMessage"), out var __jsonDetailedStatusMessage) ? (string)__jsonDetailedStatusMessage : (string)_detailedStatusMessage;} + {_kubernetesVersion = If( json?.PropertyT("kubernetesVersion"), out var __jsonKubernetesVersion) ? (string)__jsonKubernetesVersion : (string)_kubernetesVersion;} + {_label = If( json?.PropertyT("labels"), out var __jsonLabels) ? If( __jsonLabels as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.IKubernetesLabel) (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.KubernetesLabel.FromJson(__p) )) ))() : null : _label;} + {_mode = If( json?.PropertyT("mode"), out var __jsonMode) ? (string)__jsonMode : (string)_mode;} + {_provisioningState = If( json?.PropertyT("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)_provisioningState;} + {_taint = If( json?.PropertyT("taints"), out var __jsonTaints) ? If( __jsonTaints as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonArray, out var __l) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__l, (__k)=>(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesLabel) (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.KubernetesLabel.FromJson(__k) )) ))() : null : _taint;} + {_vMSkuName = If( json?.PropertyT("vmSkuName"), out var __jsonVMSkuName) ? (string)__jsonVMSkuName : (string)_vMSkuName;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new AgentPoolProperties(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)||serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate)) + { + AddIf( null != this._administratorConfiguration ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) this._administratorConfiguration.ToJson(null,serializationMode) : null, "administratorConfiguration" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)||serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate)) + { + AddIf( null != this._agentOption ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) this._agentOption.ToJson(null,serializationMode) : null, "agentOptions" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)||serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate)) + { + AddIf( null != this._attachedNetworkConfiguration ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) this._attachedNetworkConfiguration.ToJson(null,serializationMode) : null, "attachedNetworkConfiguration" ,container.Add ); + } + AddIf( null != this._upgradeSetting ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) this._upgradeSetting.ToJson(null,serializationMode) : null, "upgradeSettings" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)||serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate)) + { + if (null != this._availabilityZone) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.XNodeArray(); + foreach( var __x in this._availabilityZone ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("availabilityZones",__w); + } + } + AddIf( (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNumber(this._count), "count" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) + { + AddIf( null != (((object)this._detailedStatus)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._detailedStatus.ToString()) : null, "detailedStatus" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) + { + AddIf( null != (((object)this._detailedStatusMessage)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._detailedStatusMessage.ToString()) : null, "detailedStatusMessage" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) + { + AddIf( null != (((object)this._kubernetesVersion)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._kubernetesVersion.ToString()) : null, "kubernetesVersion" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)||serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate)) + { + if (null != this._label) + { + var __r = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.XNodeArray(); + foreach( var __s in this._label ) + { + AddIf(__s?.ToJson(null, serializationMode) ,__r.Add); + } + container.Add("labels",__r); + } + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)||serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate)) + { + AddIf( null != (((object)this._mode)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._mode.ToString()) : null, "mode" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) + { + AddIf( null != (((object)this._provisioningState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._provisioningState.ToString()) : null, "provisioningState" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)||serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate)) + { + if (null != this._taint) + { + var __m = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.XNodeArray(); + foreach( var __n in this._taint ) + { + AddIf(__n?.ToJson(null, serializationMode) ,__m.Add); + } + container.Add("taints",__m); + } + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)||serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate)) + { + AddIf( null != (((object)this._vMSkuName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._vMSkuName.ToString()) : null, "vmSkuName" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AgentPoolUpgradeSettings.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AgentPoolUpgradeSettings.PowerShell.cs similarity index 76% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AgentPoolUpgradeSettings.PowerShell.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AgentPoolUpgradeSettings.PowerShell.cs index e6f2d20bfe4a..0e5979029c12 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AgentPoolUpgradeSettings.PowerShell.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AgentPoolUpgradeSettings.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; @@ -63,7 +63,7 @@ public partial class AgentPoolUpgradeSettings 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 AgentPoolUpgradeSettings(global::System.Collections.IDictionary content // actually deserialize if (content.Contains("DrainTimeout")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolUpgradeSettingsInternal)this).DrainTimeout = (long?) content.GetValueForProperty("DrainTimeout",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolUpgradeSettingsInternal)this).DrainTimeout, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolUpgradeSettingsInternal)this).DrainTimeout = (long?) content.GetValueForProperty("DrainTimeout",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolUpgradeSettingsInternal)this).DrainTimeout, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); } if (content.Contains("MaxSurge")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolUpgradeSettingsInternal)this).MaxSurge = (string) content.GetValueForProperty("MaxSurge",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolUpgradeSettingsInternal)this).MaxSurge, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolUpgradeSettingsInternal)this).MaxSurge = (string) content.GetValueForProperty("MaxSurge",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolUpgradeSettingsInternal)this).MaxSurge, global::System.Convert.ToString); } if (content.Contains("MaxUnavailable")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolUpgradeSettingsInternal)this).MaxUnavailable = (string) content.GetValueForProperty("MaxUnavailable",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolUpgradeSettingsInternal)this).MaxUnavailable, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolUpgradeSettingsInternal)this).MaxUnavailable = (string) content.GetValueForProperty("MaxUnavailable",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolUpgradeSettingsInternal)this).MaxUnavailable, 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,41 @@ internal AgentPoolUpgradeSettings(global::System.Management.Automation.PSObject // actually deserialize if (content.Contains("DrainTimeout")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolUpgradeSettingsInternal)this).DrainTimeout = (long?) content.GetValueForProperty("DrainTimeout",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolUpgradeSettingsInternal)this).DrainTimeout, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolUpgradeSettingsInternal)this).DrainTimeout = (long?) content.GetValueForProperty("DrainTimeout",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolUpgradeSettingsInternal)this).DrainTimeout, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); } if (content.Contains("MaxSurge")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolUpgradeSettingsInternal)this).MaxSurge = (string) content.GetValueForProperty("MaxSurge",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolUpgradeSettingsInternal)this).MaxSurge, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolUpgradeSettingsInternal)this).MaxSurge = (string) content.GetValueForProperty("MaxSurge",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolUpgradeSettingsInternal)this).MaxSurge, global::System.Convert.ToString); } if (content.Contains("MaxUnavailable")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolUpgradeSettingsInternal)this).MaxUnavailable = (string) content.GetValueForProperty("MaxUnavailable",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolUpgradeSettingsInternal)this).MaxUnavailable, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolUpgradeSettingsInternal)this).MaxUnavailable = (string) content.GetValueForProperty("MaxUnavailable",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolUpgradeSettingsInternal)this).MaxUnavailable, 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.NetworkCloud.Models.Api20250201.IAgentPoolUpgradeSettings DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolUpgradeSettings DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new AgentPoolUpgradeSettings(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.NetworkCloud.Models.Api20250201.IAgentPoolUpgradeSettings DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolUpgradeSettings DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new AgentPoolUpgradeSettings(content); } @@ -153,7 +151,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolUpgradeSettings FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolUpgradeSettings FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AgentPoolUpgradeSettings.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AgentPoolUpgradeSettings.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AgentPoolUpgradeSettings.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AgentPoolUpgradeSettings.TypeConverter.cs index 4b8a1f81a082..42dafd80df57 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AgentPoolUpgradeSettings.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AgentPoolUpgradeSettings.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IAgentPoolUpgradeSettings ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolUpgradeSettings ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolUpgradeSettings).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolUpgradeSettings).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AgentPoolUpgradeSettings.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AgentPoolUpgradeSettings.cs similarity index 95% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AgentPoolUpgradeSettings.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AgentPoolUpgradeSettings.cs index 1e3fef5200a5..a31b6602a85d 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AgentPoolUpgradeSettings.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AgentPoolUpgradeSettings.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; /// AgentPoolUpgradeSettings specifies the upgrade settings for an agent pool. public partial class AgentPoolUpgradeSettings : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolUpgradeSettings, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolUpgradeSettingsInternal + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolUpgradeSettings, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolUpgradeSettingsInternal { /// Backing field for property. @@ -64,6 +64,9 @@ public partial interface IAgentPoolUpgradeSettings : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The maximum time in seconds that is allowed for a node drain to complete before proceeding with the upgrade of the agent pool. If not specified during creation, a value of 1800 seconds is used.", SerializedName = @"drainTimeout", PossibleTypes = new [] { typeof(long) })] @@ -77,6 +80,9 @@ public partial interface IAgentPoolUpgradeSettings : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The maximum number or percentage of nodes that are surged during upgrade. This can either be set to an integer (e.g. '5') or a percentage (e.g. '50%'). If a percentage is specified, it is the percentage of the total agent pool size at the time of the upgrade. For percentages, fractional nodes are rounded up. If not specified during creation, a value of 1 is used. One of MaxSurge and MaxUnavailable must be greater than 0.", SerializedName = @"maxSurge", PossibleTypes = new [] { typeof(string) })] @@ -90,6 +96,9 @@ public partial interface IAgentPoolUpgradeSettings : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The maximum number or percentage of nodes that can be unavailable during upgrade. This can either be set to an integer (e.g. '5') or a percentage (e.g. '50%'). If a percentage is specified, it is the percentage of the total agent pool size at the time of the upgrade. For percentages, fractional nodes are rounded up. If not specified during creation, a value of 0 is used. One of MaxSurge and MaxUnavailable must be greater than 0.", SerializedName = @"maxUnavailable", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AgentPoolUpgradeSettings.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AgentPoolUpgradeSettings.json.cs similarity index 94% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AgentPoolUpgradeSettings.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AgentPoolUpgradeSettings.json.cs index da389d4a1c82..b81c826ebf89 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AgentPoolUpgradeSettings.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AgentPoolUpgradeSettings.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -65,20 +65,20 @@ internal AgentPoolUpgradeSettings(Microsoft.Azure.PowerShell.Cmdlets.NetworkClou { return; } - {_drainTimeout = If( json?.PropertyT("drainTimeout"), out var __jsonDrainTimeout) ? (long?)__jsonDrainTimeout : DrainTimeout;} - {_maxSurge = If( json?.PropertyT("maxSurge"), out var __jsonMaxSurge) ? (string)__jsonMaxSurge : (string)MaxSurge;} - {_maxUnavailable = If( json?.PropertyT("maxUnavailable"), out var __jsonMaxUnavailable) ? (string)__jsonMaxUnavailable : (string)MaxUnavailable;} + {_drainTimeout = If( json?.PropertyT("drainTimeout"), out var __jsonDrainTimeout) ? (long?)__jsonDrainTimeout : _drainTimeout;} + {_maxSurge = If( json?.PropertyT("maxSurge"), out var __jsonMaxSurge) ? (string)__jsonMaxSurge : (string)_maxSurge;} + {_maxUnavailable = If( json?.PropertyT("maxUnavailable"), out var __jsonMaxUnavailable) ? (string)__jsonMaxUnavailable : (string)_maxUnavailable;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolUpgradeSettings. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolUpgradeSettings. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolUpgradeSettings. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolUpgradeSettings. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolUpgradeSettings FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolUpgradeSettings FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new AgentPoolUpgradeSettings(json) : null; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AnalyticsOutputSettings.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AnalyticsOutputSettings.PowerShell.cs new file mode 100644 index 000000000000..26ce27099e25 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AnalyticsOutputSettings.PowerShell.cs @@ -0,0 +1,190 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + + /// + /// AnalyticsOutputSettings represents the settings for the log analytics workspace used for output of logs from this cluster. + /// + [System.ComponentModel.TypeConverter(typeof(AnalyticsOutputSettingsTypeConverter))] + public partial class AnalyticsOutputSettings + { + + /// + /// 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 AnalyticsOutputSettings(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("AssociatedIdentity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAnalyticsOutputSettingsInternal)this).AssociatedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IIdentitySelector) content.GetValueForProperty("AssociatedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAnalyticsOutputSettingsInternal)this).AssociatedIdentity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IdentitySelectorTypeConverter.ConvertFrom); + } + if (content.Contains("AnalyticsWorkspaceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAnalyticsOutputSettingsInternal)this).AnalyticsWorkspaceId = (string) content.GetValueForProperty("AnalyticsWorkspaceId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAnalyticsOutputSettingsInternal)this).AnalyticsWorkspaceId, global::System.Convert.ToString); + } + if (content.Contains("AssociatedIdentityType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAnalyticsOutputSettingsInternal)this).AssociatedIdentityType = (string) content.GetValueForProperty("AssociatedIdentityType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAnalyticsOutputSettingsInternal)this).AssociatedIdentityType, global::System.Convert.ToString); + } + if (content.Contains("AssociatedIdentityUserAssignedIdentityResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAnalyticsOutputSettingsInternal)this).AssociatedIdentityUserAssignedIdentityResourceId = (string) content.GetValueForProperty("AssociatedIdentityUserAssignedIdentityResourceId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAnalyticsOutputSettingsInternal)this).AssociatedIdentityUserAssignedIdentityResourceId, 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 AnalyticsOutputSettings(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("AssociatedIdentity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAnalyticsOutputSettingsInternal)this).AssociatedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IIdentitySelector) content.GetValueForProperty("AssociatedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAnalyticsOutputSettingsInternal)this).AssociatedIdentity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IdentitySelectorTypeConverter.ConvertFrom); + } + if (content.Contains("AnalyticsWorkspaceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAnalyticsOutputSettingsInternal)this).AnalyticsWorkspaceId = (string) content.GetValueForProperty("AnalyticsWorkspaceId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAnalyticsOutputSettingsInternal)this).AnalyticsWorkspaceId, global::System.Convert.ToString); + } + if (content.Contains("AssociatedIdentityType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAnalyticsOutputSettingsInternal)this).AssociatedIdentityType = (string) content.GetValueForProperty("AssociatedIdentityType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAnalyticsOutputSettingsInternal)this).AssociatedIdentityType, global::System.Convert.ToString); + } + if (content.Contains("AssociatedIdentityUserAssignedIdentityResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAnalyticsOutputSettingsInternal)this).AssociatedIdentityUserAssignedIdentityResourceId = (string) content.GetValueForProperty("AssociatedIdentityUserAssignedIdentityResourceId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAnalyticsOutputSettingsInternal)this).AssociatedIdentityUserAssignedIdentityResourceId, 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.NetworkCloud.Models.IAnalyticsOutputSettings DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new AnalyticsOutputSettings(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.NetworkCloud.Models.IAnalyticsOutputSettings DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new AnalyticsOutputSettings(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.NetworkCloud.Models.IAnalyticsOutputSettings FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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(); + } + } + /// AnalyticsOutputSettings represents the settings for the log analytics workspace used for output of logs from this cluster. + [System.ComponentModel.TypeConverter(typeof(AnalyticsOutputSettingsTypeConverter))] + public partial interface IAnalyticsOutputSettings + + { + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AnalyticsOutputSettings.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AnalyticsOutputSettings.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AnalyticsOutputSettings.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AnalyticsOutputSettings.TypeConverter.cs index 2e11dbab6bea..22026fa4ae04 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AnalyticsOutputSettings.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AnalyticsOutputSettings.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IAnalyticsOutputSettings ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAnalyticsOutputSettings ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAnalyticsOutputSettings).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAnalyticsOutputSettings).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AnalyticsOutputSettings.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AnalyticsOutputSettings.cs new file mode 100644 index 000000000000..32ee481d9959 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AnalyticsOutputSettings.cs @@ -0,0 +1,122 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + + /// + /// AnalyticsOutputSettings represents the settings for the log analytics workspace used for output of logs from this cluster. + /// + public partial class AnalyticsOutputSettings : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAnalyticsOutputSettings, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAnalyticsOutputSettingsInternal + { + + /// Backing field for property. + private string _analyticsWorkspaceId; + + /// + /// The resource ID of the analytics workspace that is to be used by the specified identity. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string AnalyticsWorkspaceId { get => this._analyticsWorkspaceId; set => this._analyticsWorkspaceId = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IIdentitySelector _associatedIdentity; + + /// + /// The selection of the managed identity to use with this analytics workspace. The identity type must be either system assigned + /// or user assigned. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IIdentitySelector AssociatedIdentity { get => (this._associatedIdentity = this._associatedIdentity ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IdentitySelector()); set => this._associatedIdentity = value; } + + /// The type of managed identity that is being selected. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string AssociatedIdentityType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IIdentitySelectorInternal)AssociatedIdentity).IdentityType; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IIdentitySelectorInternal)AssociatedIdentity).IdentityType = value ?? null; } + + /// + /// The user assigned managed identity resource ID to use. Mutually exclusive with a system assigned identity type. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string AssociatedIdentityUserAssignedIdentityResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IIdentitySelectorInternal)AssociatedIdentity).UserAssignedIdentityResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IIdentitySelectorInternal)AssociatedIdentity).UserAssignedIdentityResourceId = value ?? null; } + + /// Internal Acessors for AssociatedIdentity + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IIdentitySelector Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAnalyticsOutputSettingsInternal.AssociatedIdentity { get => (this._associatedIdentity = this._associatedIdentity ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IdentitySelector()); set { {_associatedIdentity = value;} } } + + /// Creates an new instance. + public AnalyticsOutputSettings() + { + + } + } + /// AnalyticsOutputSettings represents the settings for the log analytics workspace used for output of logs from this cluster. + public partial interface IAnalyticsOutputSettings : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable + { + /// + /// The resource ID of the analytics workspace that is to be used by the specified identity. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The resource ID of the analytics workspace that is to be used by the specified identity.", + SerializedName = @"analyticsWorkspaceId", + PossibleTypes = new [] { typeof(string) })] + string AnalyticsWorkspaceId { get; set; } + /// The type of managed identity that is being selected. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The type of managed identity that is being selected.", + SerializedName = @"identityType", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("SystemAssignedIdentity", "UserAssignedIdentity")] + string AssociatedIdentityType { get; set; } + /// + /// The user assigned managed identity resource ID to use. Mutually exclusive with a system assigned identity type. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The user assigned managed identity resource ID to use. Mutually exclusive with a system assigned identity type.", + SerializedName = @"userAssignedIdentityResourceId", + PossibleTypes = new [] { typeof(string) })] + string AssociatedIdentityUserAssignedIdentityResourceId { get; set; } + + } + /// AnalyticsOutputSettings represents the settings for the log analytics workspace used for output of logs from this cluster. + internal partial interface IAnalyticsOutputSettingsInternal + + { + /// + /// The resource ID of the analytics workspace that is to be used by the specified identity. + /// + string AnalyticsWorkspaceId { get; set; } + /// + /// The selection of the managed identity to use with this analytics workspace. The identity type must be either system assigned + /// or user assigned. + /// + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IIdentitySelector AssociatedIdentity { get; set; } + /// The type of managed identity that is being selected. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("SystemAssignedIdentity", "UserAssignedIdentity")] + string AssociatedIdentityType { get; set; } + /// + /// The user assigned managed identity resource ID to use. Mutually exclusive with a system assigned identity type. + /// + string AssociatedIdentityUserAssignedIdentityResourceId { get; set; } + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AnalyticsOutputSettings.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AnalyticsOutputSettings.json.cs similarity index 93% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AnalyticsOutputSettings.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AnalyticsOutputSettings.json.cs index 4460c73ea557..d919cdb39eae 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AnalyticsOutputSettings.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AnalyticsOutputSettings.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -67,19 +67,19 @@ internal AnalyticsOutputSettings(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud { return; } - {_associatedIdentity = If( json?.PropertyT("associatedIdentity"), out var __jsonAssociatedIdentity) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IdentitySelector.FromJson(__jsonAssociatedIdentity) : AssociatedIdentity;} - {_analyticsWorkspaceId = If( json?.PropertyT("analyticsWorkspaceId"), out var __jsonAnalyticsWorkspaceId) ? (string)__jsonAnalyticsWorkspaceId : (string)AnalyticsWorkspaceId;} + {_associatedIdentity = If( json?.PropertyT("associatedIdentity"), out var __jsonAssociatedIdentity) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IdentitySelector.FromJson(__jsonAssociatedIdentity) : _associatedIdentity;} + {_analyticsWorkspaceId = If( json?.PropertyT("analyticsWorkspaceId"), out var __jsonAnalyticsWorkspaceId) ? (string)__jsonAnalyticsWorkspaceId : (string)_analyticsWorkspaceId;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAnalyticsOutputSettings. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAnalyticsOutputSettings. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAnalyticsOutputSettings. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAnalyticsOutputSettings. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAnalyticsOutputSettings FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAnalyticsOutputSettings FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new AnalyticsOutputSettings(json) : null; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Any.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Any.PowerShell.cs index 9e64a5a57211..6e42302f4981 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Any.PowerShell.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Any.PowerShell.cs @@ -7,7 +7,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Any.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Any.cs index 24e73270b2b3..ad87784cd0c8 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Any.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Any.cs @@ -7,7 +7,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; - /// Any object + /// Anything public partial class Any : Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAny, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAnyInternal @@ -19,13 +19,13 @@ public Any() } } - /// Any object + /// Anything public partial interface IAny : Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable { } - /// Any object + /// Anything internal partial interface IAnyInternal { diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Any.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Any.json.cs index 2a9c7f881b74..dc53cf2029f5 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Any.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Any.json.cs @@ -7,7 +7,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; - /// Any object + /// Anything public partial class Any { diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AdministratorConfigurationPatch.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AdministratorConfigurationPatch.cs deleted file mode 100644 index 2570416230e4..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AdministratorConfigurationPatch.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.NetworkCloud.Models.Api20250201 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; - - /// - /// AdministratorConfigurationPatch represents the patching capabilities for the administrator configuration. - /// - public partial class AdministratorConfigurationPatch : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministratorConfigurationPatch, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministratorConfigurationPatchInternal - { - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey[] _sshPublicKey; - - /// - /// SshPublicKey represents the public key used to authenticate with a resource through SSH. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey[] SshPublicKey { get => this._sshPublicKey; set => this._sshPublicKey = value; } - - /// Creates an new instance. - public AdministratorConfigurationPatch() - { - - } - } - /// AdministratorConfigurationPatch represents the patching capabilities for the administrator configuration. - public partial interface IAdministratorConfigurationPatch : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable - { - /// - /// SshPublicKey represents the public key used to authenticate with a resource through SSH. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"SshPublicKey represents the public key used to authenticate with a resource through SSH.", - SerializedName = @"sshPublicKeys", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey[] SshPublicKey { get; set; } - - } - /// AdministratorConfigurationPatch represents the patching capabilities for the administrator configuration. - internal partial interface IAdministratorConfigurationPatchInternal - - { - /// - /// SshPublicKey represents the public key used to authenticate with a resource through SSH. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey[] SshPublicKey { get; set; } - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AgentPool.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AgentPool.PowerShell.cs deleted file mode 100644 index 120b281d800d..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AgentPool.PowerShell.cs +++ /dev/null @@ -1,484 +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.NetworkCloud.Models.Api20250201 -{ - using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; - - /// AgentPool represents the agent pool of Kubernetes cluster. - [System.ComponentModel.TypeConverter(typeof(AgentPoolTypeConverter))] - public partial class AgentPool - { - - /// - /// 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 AgentPool(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("ExtendedLocation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolInternal)this).ExtendedLocation = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocation) content.GetValueForProperty("ExtendedLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolInternal)this).ExtendedLocation, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ExtendedLocationTypeConverter.ConvertFrom); - } - if (content.Contains("Property")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AgentPoolPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Etag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolInternal)this).Etag, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)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("SystemDataCreatedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataLastModifiedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("SystemData")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.SystemDataTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Type, global::System.Convert.ToString); - } - if (content.Contains("Tag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.TrackedResourceTagsTypeConverter.ConvertFrom); - } - if (content.Contains("Location")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); - } - if (content.Contains("ExtendedLocationName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolInternal)this).ExtendedLocationName = (string) content.GetValueForProperty("ExtendedLocationName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolInternal)this).ExtendedLocationName, global::System.Convert.ToString); - } - if (content.Contains("ExtendedLocationType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolInternal)this).ExtendedLocationType = (string) content.GetValueForProperty("ExtendedLocationType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolInternal)this).ExtendedLocationType, global::System.Convert.ToString); - } - if (content.Contains("AdministratorConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolInternal)this).AdministratorConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministratorConfiguration) content.GetValueForProperty("AdministratorConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolInternal)this).AdministratorConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AdministratorConfigurationTypeConverter.ConvertFrom); - } - if (content.Contains("AgentOption")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolInternal)this).AgentOption = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentOptions) content.GetValueForProperty("AgentOption",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolInternal)this).AgentOption, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AgentOptionsTypeConverter.ConvertFrom); - } - if (content.Contains("AttachedNetworkConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolInternal)this).AttachedNetworkConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAttachedNetworkConfiguration) content.GetValueForProperty("AttachedNetworkConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolInternal)this).AttachedNetworkConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AttachedNetworkConfigurationTypeConverter.ConvertFrom); - } - if (content.Contains("UpgradeSetting")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolInternal)this).UpgradeSetting = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolUpgradeSettings) content.GetValueForProperty("UpgradeSetting",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolInternal)this).UpgradeSetting, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AgentPoolUpgradeSettingsTypeConverter.ConvertFrom); - } - if (content.Contains("AvailabilityZone")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolInternal)this).AvailabilityZone = (string[]) content.GetValueForProperty("AvailabilityZone",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolInternal)this).AvailabilityZone, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("Count")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolInternal)this).Count = (long) content.GetValueForProperty("Count",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolInternal)this).Count, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("DetailedStatus")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolInternal)this).DetailedStatus = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.AgentPoolDetailedStatus?) content.GetValueForProperty("DetailedStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolInternal)this).DetailedStatus, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.AgentPoolDetailedStatus.CreateFrom); - } - if (content.Contains("DetailedStatusMessage")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolInternal)this).DetailedStatusMessage = (string) content.GetValueForProperty("DetailedStatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolInternal)this).DetailedStatusMessage, global::System.Convert.ToString); - } - if (content.Contains("KubernetesVersion")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolInternal)this).KubernetesVersion = (string) content.GetValueForProperty("KubernetesVersion",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolInternal)this).KubernetesVersion, global::System.Convert.ToString); - } - if (content.Contains("Label")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolInternal)this).Label = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesLabel[]) content.GetValueForProperty("Label",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolInternal)this).Label, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.KubernetesLabelTypeConverter.ConvertFrom)); - } - if (content.Contains("Mode")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolInternal)this).Mode = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.AgentPoolMode) content.GetValueForProperty("Mode",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolInternal)this).Mode, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.AgentPoolMode.CreateFrom); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.AgentPoolProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.AgentPoolProvisioningState.CreateFrom); - } - if (content.Contains("Taint")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolInternal)this).Taint = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesLabel[]) content.GetValueForProperty("Taint",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolInternal)this).Taint, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.KubernetesLabelTypeConverter.ConvertFrom)); - } - if (content.Contains("VMSkuName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolInternal)this).VMSkuName = (string) content.GetValueForProperty("VMSkuName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolInternal)this).VMSkuName, global::System.Convert.ToString); - } - if (content.Contains("AdministratorConfigurationAdminUsername")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolInternal)this).AdministratorConfigurationAdminUsername = (string) content.GetValueForProperty("AdministratorConfigurationAdminUsername",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolInternal)this).AdministratorConfigurationAdminUsername, global::System.Convert.ToString); - } - if (content.Contains("AgentOptionHugepagesCount")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolInternal)this).AgentOptionHugepagesCount = (long) content.GetValueForProperty("AgentOptionHugepagesCount",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolInternal)this).AgentOptionHugepagesCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("AgentOptionHugepagesSize")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolInternal)this).AgentOptionHugepagesSize = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HugepagesSize?) content.GetValueForProperty("AgentOptionHugepagesSize",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolInternal)this).AgentOptionHugepagesSize, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HugepagesSize.CreateFrom); - } - if (content.Contains("AttachedNetworkConfigurationL2Network")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolInternal)this).AttachedNetworkConfigurationL2Network = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkAttachmentConfiguration[]) content.GetValueForProperty("AttachedNetworkConfigurationL2Network",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolInternal)this).AttachedNetworkConfigurationL2Network, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.L2NetworkAttachmentConfigurationTypeConverter.ConvertFrom)); - } - if (content.Contains("AttachedNetworkConfigurationL3Network")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolInternal)this).AttachedNetworkConfigurationL3Network = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkAttachmentConfiguration[]) content.GetValueForProperty("AttachedNetworkConfigurationL3Network",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolInternal)this).AttachedNetworkConfigurationL3Network, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.L3NetworkAttachmentConfigurationTypeConverter.ConvertFrom)); - } - if (content.Contains("AttachedNetworkConfigurationTrunkedNetwork")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolInternal)this).AttachedNetworkConfigurationTrunkedNetwork = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkAttachmentConfiguration[]) content.GetValueForProperty("AttachedNetworkConfigurationTrunkedNetwork",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolInternal)this).AttachedNetworkConfigurationTrunkedNetwork, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.TrunkedNetworkAttachmentConfigurationTypeConverter.ConvertFrom)); - } - if (content.Contains("AdministratorConfigurationSshPublicKey")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolInternal)this).AdministratorConfigurationSshPublicKey = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey[]) content.GetValueForProperty("AdministratorConfigurationSshPublicKey",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolInternal)this).AdministratorConfigurationSshPublicKey, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.SshPublicKeyTypeConverter.ConvertFrom)); - } - if (content.Contains("UpgradeSettingDrainTimeout")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolInternal)this).UpgradeSettingDrainTimeout = (long?) content.GetValueForProperty("UpgradeSettingDrainTimeout",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolInternal)this).UpgradeSettingDrainTimeout, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("UpgradeSettingMaxSurge")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolInternal)this).UpgradeSettingMaxSurge = (string) content.GetValueForProperty("UpgradeSettingMaxSurge",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolInternal)this).UpgradeSettingMaxSurge, global::System.Convert.ToString); - } - if (content.Contains("UpgradeSettingMaxUnavailable")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolInternal)this).UpgradeSettingMaxUnavailable = (string) content.GetValueForProperty("UpgradeSettingMaxUnavailable",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolInternal)this).UpgradeSettingMaxUnavailable, 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 AgentPool(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("ExtendedLocation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolInternal)this).ExtendedLocation = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocation) content.GetValueForProperty("ExtendedLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolInternal)this).ExtendedLocation, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ExtendedLocationTypeConverter.ConvertFrom); - } - if (content.Contains("Property")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AgentPoolPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Etag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolInternal)this).Etag, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)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("SystemDataCreatedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataLastModifiedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("SystemData")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.SystemDataTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Type, global::System.Convert.ToString); - } - if (content.Contains("Tag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.TrackedResourceTagsTypeConverter.ConvertFrom); - } - if (content.Contains("Location")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); - } - if (content.Contains("ExtendedLocationName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolInternal)this).ExtendedLocationName = (string) content.GetValueForProperty("ExtendedLocationName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolInternal)this).ExtendedLocationName, global::System.Convert.ToString); - } - if (content.Contains("ExtendedLocationType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolInternal)this).ExtendedLocationType = (string) content.GetValueForProperty("ExtendedLocationType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolInternal)this).ExtendedLocationType, global::System.Convert.ToString); - } - if (content.Contains("AdministratorConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolInternal)this).AdministratorConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministratorConfiguration) content.GetValueForProperty("AdministratorConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolInternal)this).AdministratorConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AdministratorConfigurationTypeConverter.ConvertFrom); - } - if (content.Contains("AgentOption")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolInternal)this).AgentOption = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentOptions) content.GetValueForProperty("AgentOption",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolInternal)this).AgentOption, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AgentOptionsTypeConverter.ConvertFrom); - } - if (content.Contains("AttachedNetworkConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolInternal)this).AttachedNetworkConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAttachedNetworkConfiguration) content.GetValueForProperty("AttachedNetworkConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolInternal)this).AttachedNetworkConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AttachedNetworkConfigurationTypeConverter.ConvertFrom); - } - if (content.Contains("UpgradeSetting")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolInternal)this).UpgradeSetting = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolUpgradeSettings) content.GetValueForProperty("UpgradeSetting",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolInternal)this).UpgradeSetting, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AgentPoolUpgradeSettingsTypeConverter.ConvertFrom); - } - if (content.Contains("AvailabilityZone")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolInternal)this).AvailabilityZone = (string[]) content.GetValueForProperty("AvailabilityZone",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolInternal)this).AvailabilityZone, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("Count")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolInternal)this).Count = (long) content.GetValueForProperty("Count",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolInternal)this).Count, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("DetailedStatus")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolInternal)this).DetailedStatus = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.AgentPoolDetailedStatus?) content.GetValueForProperty("DetailedStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolInternal)this).DetailedStatus, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.AgentPoolDetailedStatus.CreateFrom); - } - if (content.Contains("DetailedStatusMessage")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolInternal)this).DetailedStatusMessage = (string) content.GetValueForProperty("DetailedStatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolInternal)this).DetailedStatusMessage, global::System.Convert.ToString); - } - if (content.Contains("KubernetesVersion")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolInternal)this).KubernetesVersion = (string) content.GetValueForProperty("KubernetesVersion",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolInternal)this).KubernetesVersion, global::System.Convert.ToString); - } - if (content.Contains("Label")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolInternal)this).Label = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesLabel[]) content.GetValueForProperty("Label",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolInternal)this).Label, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.KubernetesLabelTypeConverter.ConvertFrom)); - } - if (content.Contains("Mode")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolInternal)this).Mode = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.AgentPoolMode) content.GetValueForProperty("Mode",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolInternal)this).Mode, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.AgentPoolMode.CreateFrom); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.AgentPoolProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.AgentPoolProvisioningState.CreateFrom); - } - if (content.Contains("Taint")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolInternal)this).Taint = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesLabel[]) content.GetValueForProperty("Taint",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolInternal)this).Taint, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.KubernetesLabelTypeConverter.ConvertFrom)); - } - if (content.Contains("VMSkuName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolInternal)this).VMSkuName = (string) content.GetValueForProperty("VMSkuName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolInternal)this).VMSkuName, global::System.Convert.ToString); - } - if (content.Contains("AdministratorConfigurationAdminUsername")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolInternal)this).AdministratorConfigurationAdminUsername = (string) content.GetValueForProperty("AdministratorConfigurationAdminUsername",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolInternal)this).AdministratorConfigurationAdminUsername, global::System.Convert.ToString); - } - if (content.Contains("AgentOptionHugepagesCount")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolInternal)this).AgentOptionHugepagesCount = (long) content.GetValueForProperty("AgentOptionHugepagesCount",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolInternal)this).AgentOptionHugepagesCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("AgentOptionHugepagesSize")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolInternal)this).AgentOptionHugepagesSize = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HugepagesSize?) content.GetValueForProperty("AgentOptionHugepagesSize",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolInternal)this).AgentOptionHugepagesSize, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HugepagesSize.CreateFrom); - } - if (content.Contains("AttachedNetworkConfigurationL2Network")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolInternal)this).AttachedNetworkConfigurationL2Network = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkAttachmentConfiguration[]) content.GetValueForProperty("AttachedNetworkConfigurationL2Network",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolInternal)this).AttachedNetworkConfigurationL2Network, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.L2NetworkAttachmentConfigurationTypeConverter.ConvertFrom)); - } - if (content.Contains("AttachedNetworkConfigurationL3Network")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolInternal)this).AttachedNetworkConfigurationL3Network = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkAttachmentConfiguration[]) content.GetValueForProperty("AttachedNetworkConfigurationL3Network",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolInternal)this).AttachedNetworkConfigurationL3Network, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.L3NetworkAttachmentConfigurationTypeConverter.ConvertFrom)); - } - if (content.Contains("AttachedNetworkConfigurationTrunkedNetwork")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolInternal)this).AttachedNetworkConfigurationTrunkedNetwork = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkAttachmentConfiguration[]) content.GetValueForProperty("AttachedNetworkConfigurationTrunkedNetwork",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolInternal)this).AttachedNetworkConfigurationTrunkedNetwork, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.TrunkedNetworkAttachmentConfigurationTypeConverter.ConvertFrom)); - } - if (content.Contains("AdministratorConfigurationSshPublicKey")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolInternal)this).AdministratorConfigurationSshPublicKey = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey[]) content.GetValueForProperty("AdministratorConfigurationSshPublicKey",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolInternal)this).AdministratorConfigurationSshPublicKey, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.SshPublicKeyTypeConverter.ConvertFrom)); - } - if (content.Contains("UpgradeSettingDrainTimeout")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolInternal)this).UpgradeSettingDrainTimeout = (long?) content.GetValueForProperty("UpgradeSettingDrainTimeout",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolInternal)this).UpgradeSettingDrainTimeout, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("UpgradeSettingMaxSurge")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolInternal)this).UpgradeSettingMaxSurge = (string) content.GetValueForProperty("UpgradeSettingMaxSurge",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolInternal)this).UpgradeSettingMaxSurge, global::System.Convert.ToString); - } - if (content.Contains("UpgradeSettingMaxUnavailable")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolInternal)this).UpgradeSettingMaxUnavailable = (string) content.GetValueForProperty("UpgradeSettingMaxUnavailable",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolInternal)this).UpgradeSettingMaxUnavailable, 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.NetworkCloud.Models.Api20250201.IAgentPool DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new AgentPool(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.NetworkCloud.Models.Api20250201.IAgentPool DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new AgentPool(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.NetworkCloud.Models.Api20250201.IAgentPool FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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(); - } - } - /// AgentPool represents the agent pool of Kubernetes cluster. - [System.ComponentModel.TypeConverter(typeof(AgentPoolTypeConverter))] - public partial interface IAgentPool - - { - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AgentPool.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AgentPool.cs deleted file mode 100644 index f094557adfd6..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AgentPool.cs +++ /dev/null @@ -1,593 +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.NetworkCloud.Models.Api20250201 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; - - /// AgentPool represents the agent pool of Kubernetes cluster. - public partial class AgentPool : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPool, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolInternal, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IValidates - { - /// - /// Backing field for Inherited model - /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResource __trackedResource = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.TrackedResource(); - - /// - /// The user name for the administrator that will be applied to the operating systems that run Kubernetes nodes. If not supplied, - /// a user name will be chosen by the service. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string AdministratorConfigurationAdminUsername { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPropertiesInternal)Property).AdministratorConfigurationAdminUsername; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPropertiesInternal)Property).AdministratorConfigurationAdminUsername = value ?? null; } - - /// - /// The SSH configuration for the operating systems that run the nodes in the Kubernetes cluster. In some cases, specification - /// of public keys may be required to produce a working environment. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey[] AdministratorConfigurationSshPublicKey { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPropertiesInternal)Property).AdministratorConfigurationSshPublicKey; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPropertiesInternal)Property).AdministratorConfigurationSshPublicKey = value ?? null /* arrayOf */; } - - /// The number of hugepages to allocate. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public long? AgentOptionHugepagesCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPropertiesInternal)Property).AgentOptionHugepagesCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPropertiesInternal)Property).AgentOptionHugepagesCount = value ?? default(long); } - - /// The size of the hugepages to allocate. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HugepagesSize? AgentOptionHugepagesSize { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPropertiesInternal)Property).AgentOptionHugepagesSize; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPropertiesInternal)Property).AgentOptionHugepagesSize = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HugepagesSize)""); } - - /// The list of Layer 2 Networks and related configuration for attachment. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkAttachmentConfiguration[] AttachedNetworkConfigurationL2Network { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPropertiesInternal)Property).AttachedNetworkConfigurationL2Network; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPropertiesInternal)Property).AttachedNetworkConfigurationL2Network = value ?? null /* arrayOf */; } - - /// The list of Layer 3 Networks and related configuration for attachment. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkAttachmentConfiguration[] AttachedNetworkConfigurationL3Network { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPropertiesInternal)Property).AttachedNetworkConfigurationL3Network; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPropertiesInternal)Property).AttachedNetworkConfigurationL3Network = value ?? null /* arrayOf */; } - - /// The list of Trunked Networks and related configuration for attachment. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkAttachmentConfiguration[] AttachedNetworkConfigurationTrunkedNetwork { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPropertiesInternal)Property).AttachedNetworkConfigurationTrunkedNetwork; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPropertiesInternal)Property).AttachedNetworkConfigurationTrunkedNetwork = value ?? null /* arrayOf */; } - - /// - /// The list of availability zones of the Network Cloud cluster used for the provisioning of nodes in this agent pool. If - /// not specified, all availability zones will be used. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string[] AvailabilityZone { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPropertiesInternal)Property).AvailabilityZone; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPropertiesInternal)Property).AvailabilityZone = value ?? null /* arrayOf */; } - - /// The number of virtual machines that use this configuration. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public long Count { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPropertiesInternal)Property).Count; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPropertiesInternal)Property).Count = value ; } - - /// The current status of the agent pool. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.AgentPoolDetailedStatus? DetailedStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPropertiesInternal)Property).DetailedStatus; } - - /// The descriptive message about the current detailed status. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string DetailedStatusMessage { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPropertiesInternal)Property).DetailedStatusMessage; } - - /// Backing field for property. - private string _etag; - - /// Resource ETag. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string Etag { get => this._etag; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocation _extendedLocation; - - /// The extended location of the cluster associated with the resource. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocation ExtendedLocation { get => (this._extendedLocation = this._extendedLocation ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ExtendedLocation()); set => this._extendedLocation = value; } - - /// The resource ID of the extended location on which the resource will be created. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string ExtendedLocationName { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocationInternal)ExtendedLocation).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocationInternal)ExtendedLocation).Name = value ?? null; } - - /// The extended location type, for example, CustomLocation. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string ExtendedLocationType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocationInternal)ExtendedLocation).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocationInternal)ExtendedLocation).Type = value ?? null; } - - /// - /// Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).Id; } - - /// The Kubernetes version running in this agent pool. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string KubernetesVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPropertiesInternal)Property).KubernetesVersion; } - - /// The labels applied to the nodes in this agent pool. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesLabel[] Label { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPropertiesInternal)Property).Label; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPropertiesInternal)Property).Label = value ?? null /* arrayOf */; } - - /// The geo-location where the resource lives - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)__trackedResource).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)__trackedResource).Location = value ; } - - /// Internal Acessors for AdministratorConfiguration - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministratorConfiguration Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolInternal.AdministratorConfiguration { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPropertiesInternal)Property).AdministratorConfiguration; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPropertiesInternal)Property).AdministratorConfiguration = value; } - - /// Internal Acessors for AgentOption - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentOptions Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolInternal.AgentOption { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPropertiesInternal)Property).AgentOption; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPropertiesInternal)Property).AgentOption = value; } - - /// Internal Acessors for AttachedNetworkConfiguration - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAttachedNetworkConfiguration Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolInternal.AttachedNetworkConfiguration { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPropertiesInternal)Property).AttachedNetworkConfiguration; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPropertiesInternal)Property).AttachedNetworkConfiguration = value; } - - /// Internal Acessors for DetailedStatus - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.AgentPoolDetailedStatus? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolInternal.DetailedStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPropertiesInternal)Property).DetailedStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPropertiesInternal)Property).DetailedStatus = value; } - - /// Internal Acessors for DetailedStatusMessage - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolInternal.DetailedStatusMessage { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPropertiesInternal)Property).DetailedStatusMessage; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPropertiesInternal)Property).DetailedStatusMessage = value; } - - /// Internal Acessors for Etag - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolInternal.Etag { get => this._etag; set { {_etag = value;} } } - - /// Internal Acessors for ExtendedLocation - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocation Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolInternal.ExtendedLocation { get => (this._extendedLocation = this._extendedLocation ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ExtendedLocation()); set { {_extendedLocation = value;} } } - - /// Internal Acessors for KubernetesVersion - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolInternal.KubernetesVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPropertiesInternal)Property).KubernetesVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPropertiesInternal)Property).KubernetesVersion = value; } - - /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolProperties Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AgentPoolProperties()); set { {_property = value;} } } - - /// Internal Acessors for ProvisioningState - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.AgentPoolProvisioningState? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPropertiesInternal)Property).ProvisioningState = value; } - - /// Internal Acessors for UpgradeSetting - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolUpgradeSettings Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolInternal.UpgradeSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPropertiesInternal)Property).UpgradeSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPropertiesInternal)Property).UpgradeSetting = value; } - - /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).Id = value; } - - /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).Name = value; } - - /// Internal Acessors for SystemData - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ISystemData Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal.SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemData; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemData = value; } - - /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).Type = value; } - - /// - /// The selection of how this agent pool is utilized, either as a system pool or a user pool. System pools run the features - /// and critical services for the Kubernetes Cluster, while user pools are dedicated to user workloads. Every Kubernetes cluster - /// must contain at least one system node pool with at least one node. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.AgentPoolMode Mode { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPropertiesInternal)Property).Mode; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPropertiesInternal)Property).Mode = value ; } - - /// The name of the resource - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).Name; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolProperties _property; - - /// The list of the resource properties. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AgentPoolProperties()); set => this._property = value; } - - /// The provisioning state of the agent pool. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.AgentPoolProvisioningState? ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPropertiesInternal)Property).ProvisioningState; } - - /// Gets the resource group name - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string ResourceGroupName { get => (new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Success ? new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Groups["resourceGroupName"].Value : null); } - - /// - /// Azure Resource Manager metadata containing createdBy and modifiedBy information. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ISystemData SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemData; } - - /// The timestamp of resource creation (UTC). - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataCreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataCreatedAt = value ?? default(global::System.DateTime); } - - /// The identity that created the resource. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataCreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataCreatedBy = value ?? null; } - - /// The type of identity that created the resource. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType? SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataCreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataCreatedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType)""); } - - /// The timestamp of resource last modification (UTC) - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataLastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataLastModifiedAt = value ?? default(global::System.DateTime); } - - /// The identity that last modified the resource. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataLastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataLastModifiedBy = value ?? null; } - - /// The type of identity that last modified the resource. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType? SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataLastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataLastModifiedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType)""); } - - /// Resource tags. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)__trackedResource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)__trackedResource).Tag = value ?? null /* model class */; } - - /// The taints applied to the nodes in this agent pool. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesLabel[] Taint { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPropertiesInternal)Property).Taint; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPropertiesInternal)Property).Taint = value ?? null /* arrayOf */; } - - /// - /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).Type; } - - /// - /// The maximum time in seconds that is allowed for a node drain to complete before proceeding with the upgrade of the agent - /// pool. If not specified during creation, a value of 1800 seconds is used. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public long? UpgradeSettingDrainTimeout { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPropertiesInternal)Property).UpgradeSettingDrainTimeout; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPropertiesInternal)Property).UpgradeSettingDrainTimeout = value ?? default(long); } - - /// - /// The maximum number or percentage of nodes that are surged during upgrade. This can either be set to an integer (e.g. '5') - /// or a percentage (e.g. '50%'). If a percentage is specified, it is the percentage of the total agent pool size at the time - /// of the upgrade. For percentages, fractional nodes are rounded up. If not specified during creation, a value of 1 is used. - /// One of MaxSurge and MaxUnavailable must be greater than 0. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string UpgradeSettingMaxSurge { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPropertiesInternal)Property).UpgradeSettingMaxSurge; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPropertiesInternal)Property).UpgradeSettingMaxSurge = value ?? null; } - - /// - /// The maximum number or percentage of nodes that can be unavailable during upgrade. This can either be set to an integer - /// (e.g. '5') or a percentage (e.g. '50%'). If a percentage is specified, it is the percentage of the total agent pool size - /// at the time of the upgrade. For percentages, fractional nodes are rounded up. If not specified during creation, a value - /// of 0 is used. One of MaxSurge and MaxUnavailable must be greater than 0. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string UpgradeSettingMaxUnavailable { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPropertiesInternal)Property).UpgradeSettingMaxUnavailable; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPropertiesInternal)Property).UpgradeSettingMaxUnavailable = value ?? null; } - - /// - /// The name of the VM SKU that determines the size of resources allocated for node VMs. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string VMSkuName { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPropertiesInternal)Property).VMSkuName; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPropertiesInternal)Property).VMSkuName = value ; } - - /// Creates an new instance. - public AgentPool() - { - - } - - /// Validates that this object meets the validation criteria. - /// an instance that will receive validation - /// events. - /// - /// A that will be complete when validation is completed. - /// - public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) - { - await eventListener.AssertNotNull(nameof(__trackedResource), __trackedResource); - await eventListener.AssertObjectIsValid(nameof(__trackedResource), __trackedResource); - } - } - /// AgentPool represents the agent pool of Kubernetes cluster. - public partial interface IAgentPool : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResource - { - /// - /// The user name for the administrator that will be applied to the operating systems that run Kubernetes nodes. If not supplied, - /// a user name will be chosen by the service. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The user name for the administrator that will be applied to the operating systems that run Kubernetes nodes. If not supplied, a user name will be chosen by the service.", - SerializedName = @"adminUsername", - PossibleTypes = new [] { typeof(string) })] - string AdministratorConfigurationAdminUsername { get; set; } - /// - /// The SSH configuration for the operating systems that run the nodes in the Kubernetes cluster. In some cases, specification - /// of public keys may be required to produce a working environment. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The SSH configuration for the operating systems that run the nodes in the Kubernetes cluster. In some cases, specification of public keys may be required to produce a working environment.", - SerializedName = @"sshPublicKeys", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey[] AdministratorConfigurationSshPublicKey { get; set; } - /// The number of hugepages to allocate. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The number of hugepages to allocate.", - SerializedName = @"hugepagesCount", - PossibleTypes = new [] { typeof(long) })] - long? AgentOptionHugepagesCount { get; set; } - /// The size of the hugepages to allocate. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The size of the hugepages to allocate.", - SerializedName = @"hugepagesSize", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HugepagesSize) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HugepagesSize? AgentOptionHugepagesSize { get; set; } - /// The list of Layer 2 Networks and related configuration for attachment. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The list of Layer 2 Networks and related configuration for attachment.", - SerializedName = @"l2Networks", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkAttachmentConfiguration) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkAttachmentConfiguration[] AttachedNetworkConfigurationL2Network { get; set; } - /// The list of Layer 3 Networks and related configuration for attachment. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The list of Layer 3 Networks and related configuration for attachment.", - SerializedName = @"l3Networks", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkAttachmentConfiguration) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkAttachmentConfiguration[] AttachedNetworkConfigurationL3Network { get; set; } - /// The list of Trunked Networks and related configuration for attachment. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The list of Trunked Networks and related configuration for attachment.", - SerializedName = @"trunkedNetworks", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkAttachmentConfiguration) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkAttachmentConfiguration[] AttachedNetworkConfigurationTrunkedNetwork { get; set; } - /// - /// The list of availability zones of the Network Cloud cluster used for the provisioning of nodes in this agent pool. If - /// not specified, all availability zones will be used. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The list of availability zones of the Network Cloud cluster used for the provisioning of nodes in this agent pool. If not specified, all availability zones will be used.", - SerializedName = @"availabilityZones", - PossibleTypes = new [] { typeof(string) })] - string[] AvailabilityZone { get; set; } - /// The number of virtual machines that use this configuration. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The number of virtual machines that use this configuration.", - SerializedName = @"count", - PossibleTypes = new [] { typeof(long) })] - long Count { get; set; } - /// The current status of the agent pool. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The current status of the agent pool.", - SerializedName = @"detailedStatus", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.AgentPoolDetailedStatus) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.AgentPoolDetailedStatus? DetailedStatus { get; } - /// The descriptive message about the current detailed status. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The descriptive message about the current detailed status.", - SerializedName = @"detailedStatusMessage", - PossibleTypes = new [] { typeof(string) })] - string DetailedStatusMessage { get; } - /// Resource ETag. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"Resource ETag.", - SerializedName = @"etag", - PossibleTypes = new [] { typeof(string) })] - string Etag { get; } - /// The resource ID of the extended location on which the resource will be created. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The resource ID of the extended location on which the resource will be created.", - SerializedName = @"name", - PossibleTypes = new [] { typeof(string) })] - string ExtendedLocationName { get; set; } - /// The extended location type, for example, CustomLocation. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The extended location type, for example, CustomLocation.", - SerializedName = @"type", - PossibleTypes = new [] { typeof(string) })] - string ExtendedLocationType { get; set; } - /// The Kubernetes version running in this agent pool. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The Kubernetes version running in this agent pool.", - SerializedName = @"kubernetesVersion", - PossibleTypes = new [] { typeof(string) })] - string KubernetesVersion { get; } - /// The labels applied to the nodes in this agent pool. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The labels applied to the nodes in this agent pool.", - SerializedName = @"labels", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesLabel) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesLabel[] Label { get; set; } - /// - /// The selection of how this agent pool is utilized, either as a system pool or a user pool. System pools run the features - /// and critical services for the Kubernetes Cluster, while user pools are dedicated to user workloads. Every Kubernetes cluster - /// must contain at least one system node pool with at least one node. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The selection of how this agent pool is utilized, either as a system pool or a user pool. System pools run the features and critical services for the Kubernetes Cluster, while user pools are dedicated to user workloads. Every Kubernetes cluster must contain at least one system node pool with at least one node.", - SerializedName = @"mode", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.AgentPoolMode) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.AgentPoolMode Mode { get; set; } - /// The provisioning state of the agent pool. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The provisioning state of the agent pool.", - SerializedName = @"provisioningState", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.AgentPoolProvisioningState) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.AgentPoolProvisioningState? ProvisioningState { get; } - /// The taints applied to the nodes in this agent pool. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The taints applied to the nodes in this agent pool.", - SerializedName = @"taints", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesLabel) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesLabel[] Taint { get; set; } - /// - /// The maximum time in seconds that is allowed for a node drain to complete before proceeding with the upgrade of the agent - /// pool. If not specified during creation, a value of 1800 seconds is used. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The maximum time in seconds that is allowed for a node drain to complete before proceeding with the upgrade of the agent pool. If not specified during creation, a value of 1800 seconds is used.", - SerializedName = @"drainTimeout", - PossibleTypes = new [] { typeof(long) })] - long? UpgradeSettingDrainTimeout { get; set; } - /// - /// The maximum number or percentage of nodes that are surged during upgrade. This can either be set to an integer (e.g. '5') - /// or a percentage (e.g. '50%'). If a percentage is specified, it is the percentage of the total agent pool size at the time - /// of the upgrade. For percentages, fractional nodes are rounded up. If not specified during creation, a value of 1 is used. - /// One of MaxSurge and MaxUnavailable must be greater than 0. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The maximum number or percentage of nodes that are surged during upgrade. This can either be set to an integer (e.g. '5') or a percentage (e.g. '50%'). If a percentage is specified, it is the percentage of the total agent pool size at the time of the upgrade. For percentages, fractional nodes are rounded up. If not specified during creation, a value of 1 is used. One of MaxSurge and MaxUnavailable must be greater than 0.", - SerializedName = @"maxSurge", - PossibleTypes = new [] { typeof(string) })] - string UpgradeSettingMaxSurge { get; set; } - /// - /// The maximum number or percentage of nodes that can be unavailable during upgrade. This can either be set to an integer - /// (e.g. '5') or a percentage (e.g. '50%'). If a percentage is specified, it is the percentage of the total agent pool size - /// at the time of the upgrade. For percentages, fractional nodes are rounded up. If not specified during creation, a value - /// of 0 is used. One of MaxSurge and MaxUnavailable must be greater than 0. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The maximum number or percentage of nodes that can be unavailable during upgrade. This can either be set to an integer (e.g. '5') or a percentage (e.g. '50%'). If a percentage is specified, it is the percentage of the total agent pool size at the time of the upgrade. For percentages, fractional nodes are rounded up. If not specified during creation, a value of 0 is used. One of MaxSurge and MaxUnavailable must be greater than 0.", - SerializedName = @"maxUnavailable", - PossibleTypes = new [] { typeof(string) })] - string UpgradeSettingMaxUnavailable { get; set; } - /// - /// The name of the VM SKU that determines the size of resources allocated for node VMs. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The name of the VM SKU that determines the size of resources allocated for node VMs.", - SerializedName = @"vmSkuName", - PossibleTypes = new [] { typeof(string) })] - string VMSkuName { get; set; } - - } - /// AgentPool represents the agent pool of Kubernetes cluster. - internal partial interface IAgentPoolInternal : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal - { - /// The administrator credentials to be used for the nodes in this agent pool. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministratorConfiguration AdministratorConfiguration { get; set; } - /// - /// The user name for the administrator that will be applied to the operating systems that run Kubernetes nodes. If not supplied, - /// a user name will be chosen by the service. - /// - string AdministratorConfigurationAdminUsername { get; set; } - /// - /// The SSH configuration for the operating systems that run the nodes in the Kubernetes cluster. In some cases, specification - /// of public keys may be required to produce a working environment. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey[] AdministratorConfigurationSshPublicKey { get; set; } - /// The configurations that will be applied to each agent in this agent pool. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentOptions AgentOption { get; set; } - /// The number of hugepages to allocate. - long? AgentOptionHugepagesCount { get; set; } - /// The size of the hugepages to allocate. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HugepagesSize? AgentOptionHugepagesSize { get; set; } - /// - /// The configuration of networks being attached to the agent pool for use by the workloads that run on this Kubernetes cluster. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAttachedNetworkConfiguration AttachedNetworkConfiguration { get; set; } - /// The list of Layer 2 Networks and related configuration for attachment. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkAttachmentConfiguration[] AttachedNetworkConfigurationL2Network { get; set; } - /// The list of Layer 3 Networks and related configuration for attachment. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkAttachmentConfiguration[] AttachedNetworkConfigurationL3Network { get; set; } - /// The list of Trunked Networks and related configuration for attachment. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkAttachmentConfiguration[] AttachedNetworkConfigurationTrunkedNetwork { get; set; } - /// - /// The list of availability zones of the Network Cloud cluster used for the provisioning of nodes in this agent pool. If - /// not specified, all availability zones will be used. - /// - string[] AvailabilityZone { get; set; } - /// The number of virtual machines that use this configuration. - long Count { get; set; } - /// The current status of the agent pool. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.AgentPoolDetailedStatus? DetailedStatus { get; set; } - /// The descriptive message about the current detailed status. - string DetailedStatusMessage { get; set; } - /// Resource ETag. - string Etag { get; set; } - /// The extended location of the cluster associated with the resource. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocation ExtendedLocation { get; set; } - /// The resource ID of the extended location on which the resource will be created. - string ExtendedLocationName { get; set; } - /// The extended location type, for example, CustomLocation. - string ExtendedLocationType { get; set; } - /// The Kubernetes version running in this agent pool. - string KubernetesVersion { get; set; } - /// The labels applied to the nodes in this agent pool. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesLabel[] Label { get; set; } - /// - /// The selection of how this agent pool is utilized, either as a system pool or a user pool. System pools run the features - /// and critical services for the Kubernetes Cluster, while user pools are dedicated to user workloads. Every Kubernetes cluster - /// must contain at least one system node pool with at least one node. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.AgentPoolMode Mode { get; set; } - /// The list of the resource properties. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolProperties Property { get; set; } - /// The provisioning state of the agent pool. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.AgentPoolProvisioningState? ProvisioningState { get; set; } - /// The taints applied to the nodes in this agent pool. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesLabel[] Taint { get; set; } - /// The configuration of the agent pool. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolUpgradeSettings UpgradeSetting { get; set; } - /// - /// The maximum time in seconds that is allowed for a node drain to complete before proceeding with the upgrade of the agent - /// pool. If not specified during creation, a value of 1800 seconds is used. - /// - long? UpgradeSettingDrainTimeout { get; set; } - /// - /// The maximum number or percentage of nodes that are surged during upgrade. This can either be set to an integer (e.g. '5') - /// or a percentage (e.g. '50%'). If a percentage is specified, it is the percentage of the total agent pool size at the time - /// of the upgrade. For percentages, fractional nodes are rounded up. If not specified during creation, a value of 1 is used. - /// One of MaxSurge and MaxUnavailable must be greater than 0. - /// - string UpgradeSettingMaxSurge { get; set; } - /// - /// The maximum number or percentage of nodes that can be unavailable during upgrade. This can either be set to an integer - /// (e.g. '5') or a percentage (e.g. '50%'). If a percentage is specified, it is the percentage of the total agent pool size - /// at the time of the upgrade. For percentages, fractional nodes are rounded up. If not specified during creation, a value - /// of 0 is used. One of MaxSurge and MaxUnavailable must be greater than 0. - /// - string UpgradeSettingMaxUnavailable { get; set; } - /// - /// The name of the VM SKU that determines the size of resources allocated for node VMs. - /// - string VMSkuName { get; set; } - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AgentPoolConfiguration.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AgentPoolConfiguration.PowerShell.cs deleted file mode 100644 index 79263cda6eb1..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AgentPoolConfiguration.PowerShell.cs +++ /dev/null @@ -1,318 +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.NetworkCloud.Models.Api20250201 -{ - using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; - - /// AgentPoolConfiguration specifies the configuration of a pool of nodes. - [System.ComponentModel.TypeConverter(typeof(AgentPoolConfigurationTypeConverter))] - public partial class AgentPoolConfiguration - { - - /// - /// 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 AgentPoolConfiguration(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("AdministratorConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolConfigurationInternal)this).AdministratorConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministratorConfiguration) content.GetValueForProperty("AdministratorConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolConfigurationInternal)this).AdministratorConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AdministratorConfigurationTypeConverter.ConvertFrom); - } - if (content.Contains("AgentOption")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolConfigurationInternal)this).AgentOption = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentOptions) content.GetValueForProperty("AgentOption",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolConfigurationInternal)this).AgentOption, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AgentOptionsTypeConverter.ConvertFrom); - } - if (content.Contains("AttachedNetworkConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolConfigurationInternal)this).AttachedNetworkConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAttachedNetworkConfiguration) content.GetValueForProperty("AttachedNetworkConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolConfigurationInternal)this).AttachedNetworkConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AttachedNetworkConfigurationTypeConverter.ConvertFrom); - } - if (content.Contains("UpgradeSetting")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolConfigurationInternal)this).UpgradeSetting = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolUpgradeSettings) content.GetValueForProperty("UpgradeSetting",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolConfigurationInternal)this).UpgradeSetting, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AgentPoolUpgradeSettingsTypeConverter.ConvertFrom); - } - if (content.Contains("AvailabilityZone")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolConfigurationInternal)this).AvailabilityZone = (string[]) content.GetValueForProperty("AvailabilityZone",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolConfigurationInternal)this).AvailabilityZone, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("Count")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolConfigurationInternal)this).Count = (long) content.GetValueForProperty("Count",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolConfigurationInternal)this).Count, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("Label")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolConfigurationInternal)this).Label = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesLabel[]) content.GetValueForProperty("Label",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolConfigurationInternal)this).Label, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.KubernetesLabelTypeConverter.ConvertFrom)); - } - if (content.Contains("Mode")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolConfigurationInternal)this).Mode = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.AgentPoolMode) content.GetValueForProperty("Mode",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolConfigurationInternal)this).Mode, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.AgentPoolMode.CreateFrom); - } - if (content.Contains("Taint")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolConfigurationInternal)this).Taint = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesLabel[]) content.GetValueForProperty("Taint",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolConfigurationInternal)this).Taint, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.KubernetesLabelTypeConverter.ConvertFrom)); - } - if (content.Contains("VMSkuName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolConfigurationInternal)this).VMSkuName = (string) content.GetValueForProperty("VMSkuName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolConfigurationInternal)this).VMSkuName, global::System.Convert.ToString); - } - if (content.Contains("AdministratorConfigurationAdminUsername")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolConfigurationInternal)this).AdministratorConfigurationAdminUsername = (string) content.GetValueForProperty("AdministratorConfigurationAdminUsername",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolConfigurationInternal)this).AdministratorConfigurationAdminUsername, global::System.Convert.ToString); - } - if (content.Contains("AgentOptionHugepagesCount")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolConfigurationInternal)this).AgentOptionHugepagesCount = (long) content.GetValueForProperty("AgentOptionHugepagesCount",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolConfigurationInternal)this).AgentOptionHugepagesCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("AgentOptionHugepagesSize")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolConfigurationInternal)this).AgentOptionHugepagesSize = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HugepagesSize?) content.GetValueForProperty("AgentOptionHugepagesSize",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolConfigurationInternal)this).AgentOptionHugepagesSize, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HugepagesSize.CreateFrom); - } - if (content.Contains("AttachedNetworkConfigurationL2Network")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolConfigurationInternal)this).AttachedNetworkConfigurationL2Network = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkAttachmentConfiguration[]) content.GetValueForProperty("AttachedNetworkConfigurationL2Network",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolConfigurationInternal)this).AttachedNetworkConfigurationL2Network, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.L2NetworkAttachmentConfigurationTypeConverter.ConvertFrom)); - } - if (content.Contains("AttachedNetworkConfigurationL3Network")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolConfigurationInternal)this).AttachedNetworkConfigurationL3Network = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkAttachmentConfiguration[]) content.GetValueForProperty("AttachedNetworkConfigurationL3Network",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolConfigurationInternal)this).AttachedNetworkConfigurationL3Network, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.L3NetworkAttachmentConfigurationTypeConverter.ConvertFrom)); - } - if (content.Contains("AttachedNetworkConfigurationTrunkedNetwork")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolConfigurationInternal)this).AttachedNetworkConfigurationTrunkedNetwork = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkAttachmentConfiguration[]) content.GetValueForProperty("AttachedNetworkConfigurationTrunkedNetwork",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolConfigurationInternal)this).AttachedNetworkConfigurationTrunkedNetwork, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.TrunkedNetworkAttachmentConfigurationTypeConverter.ConvertFrom)); - } - if (content.Contains("AdministratorConfigurationSshPublicKey")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolConfigurationInternal)this).AdministratorConfigurationSshPublicKey = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey[]) content.GetValueForProperty("AdministratorConfigurationSshPublicKey",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolConfigurationInternal)this).AdministratorConfigurationSshPublicKey, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.SshPublicKeyTypeConverter.ConvertFrom)); - } - if (content.Contains("UpgradeSettingDrainTimeout")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolConfigurationInternal)this).UpgradeSettingDrainTimeout = (long?) content.GetValueForProperty("UpgradeSettingDrainTimeout",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolConfigurationInternal)this).UpgradeSettingDrainTimeout, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("UpgradeSettingMaxSurge")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolConfigurationInternal)this).UpgradeSettingMaxSurge = (string) content.GetValueForProperty("UpgradeSettingMaxSurge",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolConfigurationInternal)this).UpgradeSettingMaxSurge, global::System.Convert.ToString); - } - if (content.Contains("UpgradeSettingMaxUnavailable")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolConfigurationInternal)this).UpgradeSettingMaxUnavailable = (string) content.GetValueForProperty("UpgradeSettingMaxUnavailable",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolConfigurationInternal)this).UpgradeSettingMaxUnavailable, 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 AgentPoolConfiguration(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("AdministratorConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolConfigurationInternal)this).AdministratorConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministratorConfiguration) content.GetValueForProperty("AdministratorConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolConfigurationInternal)this).AdministratorConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AdministratorConfigurationTypeConverter.ConvertFrom); - } - if (content.Contains("AgentOption")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolConfigurationInternal)this).AgentOption = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentOptions) content.GetValueForProperty("AgentOption",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolConfigurationInternal)this).AgentOption, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AgentOptionsTypeConverter.ConvertFrom); - } - if (content.Contains("AttachedNetworkConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolConfigurationInternal)this).AttachedNetworkConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAttachedNetworkConfiguration) content.GetValueForProperty("AttachedNetworkConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolConfigurationInternal)this).AttachedNetworkConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AttachedNetworkConfigurationTypeConverter.ConvertFrom); - } - if (content.Contains("UpgradeSetting")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolConfigurationInternal)this).UpgradeSetting = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolUpgradeSettings) content.GetValueForProperty("UpgradeSetting",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolConfigurationInternal)this).UpgradeSetting, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AgentPoolUpgradeSettingsTypeConverter.ConvertFrom); - } - if (content.Contains("AvailabilityZone")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolConfigurationInternal)this).AvailabilityZone = (string[]) content.GetValueForProperty("AvailabilityZone",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolConfigurationInternal)this).AvailabilityZone, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("Count")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolConfigurationInternal)this).Count = (long) content.GetValueForProperty("Count",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolConfigurationInternal)this).Count, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("Label")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolConfigurationInternal)this).Label = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesLabel[]) content.GetValueForProperty("Label",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolConfigurationInternal)this).Label, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.KubernetesLabelTypeConverter.ConvertFrom)); - } - if (content.Contains("Mode")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolConfigurationInternal)this).Mode = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.AgentPoolMode) content.GetValueForProperty("Mode",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolConfigurationInternal)this).Mode, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.AgentPoolMode.CreateFrom); - } - if (content.Contains("Taint")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolConfigurationInternal)this).Taint = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesLabel[]) content.GetValueForProperty("Taint",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolConfigurationInternal)this).Taint, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.KubernetesLabelTypeConverter.ConvertFrom)); - } - if (content.Contains("VMSkuName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolConfigurationInternal)this).VMSkuName = (string) content.GetValueForProperty("VMSkuName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolConfigurationInternal)this).VMSkuName, global::System.Convert.ToString); - } - if (content.Contains("AdministratorConfigurationAdminUsername")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolConfigurationInternal)this).AdministratorConfigurationAdminUsername = (string) content.GetValueForProperty("AdministratorConfigurationAdminUsername",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolConfigurationInternal)this).AdministratorConfigurationAdminUsername, global::System.Convert.ToString); - } - if (content.Contains("AgentOptionHugepagesCount")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolConfigurationInternal)this).AgentOptionHugepagesCount = (long) content.GetValueForProperty("AgentOptionHugepagesCount",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolConfigurationInternal)this).AgentOptionHugepagesCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("AgentOptionHugepagesSize")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolConfigurationInternal)this).AgentOptionHugepagesSize = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HugepagesSize?) content.GetValueForProperty("AgentOptionHugepagesSize",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolConfigurationInternal)this).AgentOptionHugepagesSize, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HugepagesSize.CreateFrom); - } - if (content.Contains("AttachedNetworkConfigurationL2Network")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolConfigurationInternal)this).AttachedNetworkConfigurationL2Network = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkAttachmentConfiguration[]) content.GetValueForProperty("AttachedNetworkConfigurationL2Network",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolConfigurationInternal)this).AttachedNetworkConfigurationL2Network, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.L2NetworkAttachmentConfigurationTypeConverter.ConvertFrom)); - } - if (content.Contains("AttachedNetworkConfigurationL3Network")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolConfigurationInternal)this).AttachedNetworkConfigurationL3Network = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkAttachmentConfiguration[]) content.GetValueForProperty("AttachedNetworkConfigurationL3Network",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolConfigurationInternal)this).AttachedNetworkConfigurationL3Network, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.L3NetworkAttachmentConfigurationTypeConverter.ConvertFrom)); - } - if (content.Contains("AttachedNetworkConfigurationTrunkedNetwork")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolConfigurationInternal)this).AttachedNetworkConfigurationTrunkedNetwork = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkAttachmentConfiguration[]) content.GetValueForProperty("AttachedNetworkConfigurationTrunkedNetwork",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolConfigurationInternal)this).AttachedNetworkConfigurationTrunkedNetwork, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.TrunkedNetworkAttachmentConfigurationTypeConverter.ConvertFrom)); - } - if (content.Contains("AdministratorConfigurationSshPublicKey")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolConfigurationInternal)this).AdministratorConfigurationSshPublicKey = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey[]) content.GetValueForProperty("AdministratorConfigurationSshPublicKey",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolConfigurationInternal)this).AdministratorConfigurationSshPublicKey, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.SshPublicKeyTypeConverter.ConvertFrom)); - } - if (content.Contains("UpgradeSettingDrainTimeout")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolConfigurationInternal)this).UpgradeSettingDrainTimeout = (long?) content.GetValueForProperty("UpgradeSettingDrainTimeout",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolConfigurationInternal)this).UpgradeSettingDrainTimeout, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("UpgradeSettingMaxSurge")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolConfigurationInternal)this).UpgradeSettingMaxSurge = (string) content.GetValueForProperty("UpgradeSettingMaxSurge",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolConfigurationInternal)this).UpgradeSettingMaxSurge, global::System.Convert.ToString); - } - if (content.Contains("UpgradeSettingMaxUnavailable")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolConfigurationInternal)this).UpgradeSettingMaxUnavailable = (string) content.GetValueForProperty("UpgradeSettingMaxUnavailable",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolConfigurationInternal)this).UpgradeSettingMaxUnavailable, 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.NetworkCloud.Models.Api20250201.IAgentPoolConfiguration DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new AgentPoolConfiguration(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.NetworkCloud.Models.Api20250201.IAgentPoolConfiguration DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new AgentPoolConfiguration(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.NetworkCloud.Models.Api20250201.IAgentPoolConfiguration FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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(); - } - } - /// AgentPoolConfiguration specifies the configuration of a pool of nodes. - [System.ComponentModel.TypeConverter(typeof(AgentPoolConfigurationTypeConverter))] - public partial interface IAgentPoolConfiguration - - { - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AgentPoolConfiguration.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AgentPoolConfiguration.cs deleted file mode 100644 index fba09ecd8828..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AgentPoolConfiguration.cs +++ /dev/null @@ -1,412 +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.NetworkCloud.Models.Api20250201 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; - - /// AgentPoolConfiguration specifies the configuration of a pool of nodes. - public partial class AgentPoolConfiguration : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolConfiguration, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolConfigurationInternal - { - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministratorConfiguration _administratorConfiguration; - - /// The administrator credentials to be used for the nodes in this agent pool. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministratorConfiguration AdministratorConfiguration { get => (this._administratorConfiguration = this._administratorConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AdministratorConfiguration()); set => this._administratorConfiguration = value; } - - /// - /// The user name for the administrator that will be applied to the operating systems that run Kubernetes nodes. If not supplied, - /// a user name will be chosen by the service. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string AdministratorConfigurationAdminUsername { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministratorConfigurationInternal)AdministratorConfiguration).AdminUsername; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministratorConfigurationInternal)AdministratorConfiguration).AdminUsername = value ?? null; } - - /// - /// The SSH configuration for the operating systems that run the nodes in the Kubernetes cluster. In some cases, specification - /// of public keys may be required to produce a working environment. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey[] AdministratorConfigurationSshPublicKey { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministratorConfigurationInternal)AdministratorConfiguration).SshPublicKey; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministratorConfigurationInternal)AdministratorConfiguration).SshPublicKey = value ?? null /* arrayOf */; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentOptions _agentOption; - - /// The configurations that will be applied to each agent in this agent pool. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentOptions AgentOption { get => (this._agentOption = this._agentOption ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AgentOptions()); set => this._agentOption = value; } - - /// The number of hugepages to allocate. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public long? AgentOptionHugepagesCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentOptionsInternal)AgentOption).HugepagesCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentOptionsInternal)AgentOption).HugepagesCount = value ?? default(long); } - - /// The size of the hugepages to allocate. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HugepagesSize? AgentOptionHugepagesSize { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentOptionsInternal)AgentOption).HugepagesSize; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentOptionsInternal)AgentOption).HugepagesSize = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HugepagesSize)""); } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAttachedNetworkConfiguration _attachedNetworkConfiguration; - - /// - /// The configuration of networks being attached to the agent pool for use by the workloads that run on this Kubernetes cluster. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAttachedNetworkConfiguration AttachedNetworkConfiguration { get => (this._attachedNetworkConfiguration = this._attachedNetworkConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AttachedNetworkConfiguration()); set => this._attachedNetworkConfiguration = value; } - - /// The list of Layer 2 Networks and related configuration for attachment. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkAttachmentConfiguration[] AttachedNetworkConfigurationL2Network { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAttachedNetworkConfigurationInternal)AttachedNetworkConfiguration).L2Network; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAttachedNetworkConfigurationInternal)AttachedNetworkConfiguration).L2Network = value ?? null /* arrayOf */; } - - /// The list of Layer 3 Networks and related configuration for attachment. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkAttachmentConfiguration[] AttachedNetworkConfigurationL3Network { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAttachedNetworkConfigurationInternal)AttachedNetworkConfiguration).L3Network; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAttachedNetworkConfigurationInternal)AttachedNetworkConfiguration).L3Network = value ?? null /* arrayOf */; } - - /// The list of Trunked Networks and related configuration for attachment. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkAttachmentConfiguration[] AttachedNetworkConfigurationTrunkedNetwork { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAttachedNetworkConfigurationInternal)AttachedNetworkConfiguration).TrunkedNetwork; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAttachedNetworkConfigurationInternal)AttachedNetworkConfiguration).TrunkedNetwork = value ?? null /* arrayOf */; } - - /// Backing field for property. - private string[] _availabilityZone; - - /// - /// The list of availability zones of the Network Cloud cluster used for the provisioning of nodes in this agent pool. If - /// not specified, all availability zones will be used. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string[] AvailabilityZone { get => this._availabilityZone; set => this._availabilityZone = value; } - - /// Backing field for property. - private long _count; - - /// The number of virtual machines that use this configuration. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public long Count { get => this._count; set => this._count = value; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesLabel[] _label; - - /// The labels applied to the nodes in this agent pool. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesLabel[] Label { get => this._label; set => this._label = value; } - - /// Internal Acessors for AdministratorConfiguration - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministratorConfiguration Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolConfigurationInternal.AdministratorConfiguration { get => (this._administratorConfiguration = this._administratorConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AdministratorConfiguration()); set { {_administratorConfiguration = value;} } } - - /// Internal Acessors for AgentOption - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentOptions Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolConfigurationInternal.AgentOption { get => (this._agentOption = this._agentOption ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AgentOptions()); set { {_agentOption = value;} } } - - /// Internal Acessors for AttachedNetworkConfiguration - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAttachedNetworkConfiguration Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolConfigurationInternal.AttachedNetworkConfiguration { get => (this._attachedNetworkConfiguration = this._attachedNetworkConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AttachedNetworkConfiguration()); set { {_attachedNetworkConfiguration = value;} } } - - /// Internal Acessors for UpgradeSetting - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolUpgradeSettings Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolConfigurationInternal.UpgradeSetting { get => (this._upgradeSetting = this._upgradeSetting ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AgentPoolUpgradeSettings()); set { {_upgradeSetting = value;} } } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.AgentPoolMode _mode; - - /// - /// The selection of how this agent pool is utilized, either as a system pool or a user pool. System pools run the features - /// and critical services for the Kubernetes Cluster, while user pools are dedicated to user workloads. Every Kubernetes cluster - /// must contain at least one system node pool with at least one node. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.AgentPoolMode Mode { get => this._mode; set => this._mode = value; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesLabel[] _taint; - - /// The taints applied to the nodes in this agent pool. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesLabel[] Taint { get => this._taint; set => this._taint = value; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolUpgradeSettings _upgradeSetting; - - /// The configuration of the agent pool. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolUpgradeSettings UpgradeSetting { get => (this._upgradeSetting = this._upgradeSetting ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AgentPoolUpgradeSettings()); set => this._upgradeSetting = value; } - - /// - /// The maximum time in seconds that is allowed for a node drain to complete before proceeding with the upgrade of the agent - /// pool. If not specified during creation, a value of 1800 seconds is used. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public long? UpgradeSettingDrainTimeout { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolUpgradeSettingsInternal)UpgradeSetting).DrainTimeout; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolUpgradeSettingsInternal)UpgradeSetting).DrainTimeout = value ?? default(long); } - - /// - /// The maximum number or percentage of nodes that are surged during upgrade. This can either be set to an integer (e.g. '5') - /// or a percentage (e.g. '50%'). If a percentage is specified, it is the percentage of the total agent pool size at the time - /// of the upgrade. For percentages, fractional nodes are rounded up. If not specified during creation, a value of 1 is used. - /// One of MaxSurge and MaxUnavailable must be greater than 0. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string UpgradeSettingMaxSurge { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolUpgradeSettingsInternal)UpgradeSetting).MaxSurge; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolUpgradeSettingsInternal)UpgradeSetting).MaxSurge = value ?? null; } - - /// - /// The maximum number or percentage of nodes that can be unavailable during upgrade. This can either be set to an integer - /// (e.g. '5') or a percentage (e.g. '50%'). If a percentage is specified, it is the percentage of the total agent pool size - /// at the time of the upgrade. For percentages, fractional nodes are rounded up. If not specified during creation, a value - /// of 0 is used. One of MaxSurge and MaxUnavailable must be greater than 0. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string UpgradeSettingMaxUnavailable { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolUpgradeSettingsInternal)UpgradeSetting).MaxUnavailable; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolUpgradeSettingsInternal)UpgradeSetting).MaxUnavailable = value ?? null; } - - /// Backing field for property. - private string _vMSkuName; - - /// - /// The name of the VM SKU that determines the size of resources allocated for node VMs. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string VMSkuName { get => this._vMSkuName; set => this._vMSkuName = value; } - - /// Creates an new instance. - public AgentPoolConfiguration() - { - - } - } - /// AgentPoolConfiguration specifies the configuration of a pool of nodes. - public partial interface IAgentPoolConfiguration : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable - { - /// - /// The user name for the administrator that will be applied to the operating systems that run Kubernetes nodes. If not supplied, - /// a user name will be chosen by the service. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The user name for the administrator that will be applied to the operating systems that run Kubernetes nodes. If not supplied, a user name will be chosen by the service.", - SerializedName = @"adminUsername", - PossibleTypes = new [] { typeof(string) })] - string AdministratorConfigurationAdminUsername { get; set; } - /// - /// The SSH configuration for the operating systems that run the nodes in the Kubernetes cluster. In some cases, specification - /// of public keys may be required to produce a working environment. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The SSH configuration for the operating systems that run the nodes in the Kubernetes cluster. In some cases, specification of public keys may be required to produce a working environment.", - SerializedName = @"sshPublicKeys", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey[] AdministratorConfigurationSshPublicKey { get; set; } - /// The number of hugepages to allocate. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The number of hugepages to allocate.", - SerializedName = @"hugepagesCount", - PossibleTypes = new [] { typeof(long) })] - long? AgentOptionHugepagesCount { get; set; } - /// The size of the hugepages to allocate. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The size of the hugepages to allocate.", - SerializedName = @"hugepagesSize", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HugepagesSize) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HugepagesSize? AgentOptionHugepagesSize { get; set; } - /// The list of Layer 2 Networks and related configuration for attachment. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The list of Layer 2 Networks and related configuration for attachment.", - SerializedName = @"l2Networks", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkAttachmentConfiguration) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkAttachmentConfiguration[] AttachedNetworkConfigurationL2Network { get; set; } - /// The list of Layer 3 Networks and related configuration for attachment. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The list of Layer 3 Networks and related configuration for attachment.", - SerializedName = @"l3Networks", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkAttachmentConfiguration) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkAttachmentConfiguration[] AttachedNetworkConfigurationL3Network { get; set; } - /// The list of Trunked Networks and related configuration for attachment. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The list of Trunked Networks and related configuration for attachment.", - SerializedName = @"trunkedNetworks", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkAttachmentConfiguration) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkAttachmentConfiguration[] AttachedNetworkConfigurationTrunkedNetwork { get; set; } - /// - /// The list of availability zones of the Network Cloud cluster used for the provisioning of nodes in this agent pool. If - /// not specified, all availability zones will be used. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The list of availability zones of the Network Cloud cluster used for the provisioning of nodes in this agent pool. If not specified, all availability zones will be used.", - SerializedName = @"availabilityZones", - PossibleTypes = new [] { typeof(string) })] - string[] AvailabilityZone { get; set; } - /// The number of virtual machines that use this configuration. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The number of virtual machines that use this configuration.", - SerializedName = @"count", - PossibleTypes = new [] { typeof(long) })] - long Count { get; set; } - /// The labels applied to the nodes in this agent pool. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The labels applied to the nodes in this agent pool.", - SerializedName = @"labels", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesLabel) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesLabel[] Label { get; set; } - /// - /// The selection of how this agent pool is utilized, either as a system pool or a user pool. System pools run the features - /// and critical services for the Kubernetes Cluster, while user pools are dedicated to user workloads. Every Kubernetes cluster - /// must contain at least one system node pool with at least one node. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The selection of how this agent pool is utilized, either as a system pool or a user pool. System pools run the features and critical services for the Kubernetes Cluster, while user pools are dedicated to user workloads. Every Kubernetes cluster must contain at least one system node pool with at least one node.", - SerializedName = @"mode", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.AgentPoolMode) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.AgentPoolMode Mode { get; set; } - /// The taints applied to the nodes in this agent pool. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The taints applied to the nodes in this agent pool.", - SerializedName = @"taints", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesLabel) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesLabel[] Taint { get; set; } - /// - /// The maximum time in seconds that is allowed for a node drain to complete before proceeding with the upgrade of the agent - /// pool. If not specified during creation, a value of 1800 seconds is used. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The maximum time in seconds that is allowed for a node drain to complete before proceeding with the upgrade of the agent pool. If not specified during creation, a value of 1800 seconds is used.", - SerializedName = @"drainTimeout", - PossibleTypes = new [] { typeof(long) })] - long? UpgradeSettingDrainTimeout { get; set; } - /// - /// The maximum number or percentage of nodes that are surged during upgrade. This can either be set to an integer (e.g. '5') - /// or a percentage (e.g. '50%'). If a percentage is specified, it is the percentage of the total agent pool size at the time - /// of the upgrade. For percentages, fractional nodes are rounded up. If not specified during creation, a value of 1 is used. - /// One of MaxSurge and MaxUnavailable must be greater than 0. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The maximum number or percentage of nodes that are surged during upgrade. This can either be set to an integer (e.g. '5') or a percentage (e.g. '50%'). If a percentage is specified, it is the percentage of the total agent pool size at the time of the upgrade. For percentages, fractional nodes are rounded up. If not specified during creation, a value of 1 is used. One of MaxSurge and MaxUnavailable must be greater than 0.", - SerializedName = @"maxSurge", - PossibleTypes = new [] { typeof(string) })] - string UpgradeSettingMaxSurge { get; set; } - /// - /// The maximum number or percentage of nodes that can be unavailable during upgrade. This can either be set to an integer - /// (e.g. '5') or a percentage (e.g. '50%'). If a percentage is specified, it is the percentage of the total agent pool size - /// at the time of the upgrade. For percentages, fractional nodes are rounded up. If not specified during creation, a value - /// of 0 is used. One of MaxSurge and MaxUnavailable must be greater than 0. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The maximum number or percentage of nodes that can be unavailable during upgrade. This can either be set to an integer (e.g. '5') or a percentage (e.g. '50%'). If a percentage is specified, it is the percentage of the total agent pool size at the time of the upgrade. For percentages, fractional nodes are rounded up. If not specified during creation, a value of 0 is used. One of MaxSurge and MaxUnavailable must be greater than 0.", - SerializedName = @"maxUnavailable", - PossibleTypes = new [] { typeof(string) })] - string UpgradeSettingMaxUnavailable { get; set; } - /// - /// The name of the VM SKU that determines the size of resources allocated for node VMs. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The name of the VM SKU that determines the size of resources allocated for node VMs.", - SerializedName = @"vmSkuName", - PossibleTypes = new [] { typeof(string) })] - string VMSkuName { get; set; } - - } - /// AgentPoolConfiguration specifies the configuration of a pool of nodes. - internal partial interface IAgentPoolConfigurationInternal - - { - /// The administrator credentials to be used for the nodes in this agent pool. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministratorConfiguration AdministratorConfiguration { get; set; } - /// - /// The user name for the administrator that will be applied to the operating systems that run Kubernetes nodes. If not supplied, - /// a user name will be chosen by the service. - /// - string AdministratorConfigurationAdminUsername { get; set; } - /// - /// The SSH configuration for the operating systems that run the nodes in the Kubernetes cluster. In some cases, specification - /// of public keys may be required to produce a working environment. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey[] AdministratorConfigurationSshPublicKey { get; set; } - /// The configurations that will be applied to each agent in this agent pool. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentOptions AgentOption { get; set; } - /// The number of hugepages to allocate. - long? AgentOptionHugepagesCount { get; set; } - /// The size of the hugepages to allocate. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HugepagesSize? AgentOptionHugepagesSize { get; set; } - /// - /// The configuration of networks being attached to the agent pool for use by the workloads that run on this Kubernetes cluster. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAttachedNetworkConfiguration AttachedNetworkConfiguration { get; set; } - /// The list of Layer 2 Networks and related configuration for attachment. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkAttachmentConfiguration[] AttachedNetworkConfigurationL2Network { get; set; } - /// The list of Layer 3 Networks and related configuration for attachment. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkAttachmentConfiguration[] AttachedNetworkConfigurationL3Network { get; set; } - /// The list of Trunked Networks and related configuration for attachment. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkAttachmentConfiguration[] AttachedNetworkConfigurationTrunkedNetwork { get; set; } - /// - /// The list of availability zones of the Network Cloud cluster used for the provisioning of nodes in this agent pool. If - /// not specified, all availability zones will be used. - /// - string[] AvailabilityZone { get; set; } - /// The number of virtual machines that use this configuration. - long Count { get; set; } - /// The labels applied to the nodes in this agent pool. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesLabel[] Label { get; set; } - /// - /// The selection of how this agent pool is utilized, either as a system pool or a user pool. System pools run the features - /// and critical services for the Kubernetes Cluster, while user pools are dedicated to user workloads. Every Kubernetes cluster - /// must contain at least one system node pool with at least one node. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.AgentPoolMode Mode { get; set; } - /// The taints applied to the nodes in this agent pool. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesLabel[] Taint { get; set; } - /// The configuration of the agent pool. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolUpgradeSettings UpgradeSetting { get; set; } - /// - /// The maximum time in seconds that is allowed for a node drain to complete before proceeding with the upgrade of the agent - /// pool. If not specified during creation, a value of 1800 seconds is used. - /// - long? UpgradeSettingDrainTimeout { get; set; } - /// - /// The maximum number or percentage of nodes that are surged during upgrade. This can either be set to an integer (e.g. '5') - /// or a percentage (e.g. '50%'). If a percentage is specified, it is the percentage of the total agent pool size at the time - /// of the upgrade. For percentages, fractional nodes are rounded up. If not specified during creation, a value of 1 is used. - /// One of MaxSurge and MaxUnavailable must be greater than 0. - /// - string UpgradeSettingMaxSurge { get; set; } - /// - /// The maximum number or percentage of nodes that can be unavailable during upgrade. This can either be set to an integer - /// (e.g. '5') or a percentage (e.g. '50%'). If a percentage is specified, it is the percentage of the total agent pool size - /// at the time of the upgrade. For percentages, fractional nodes are rounded up. If not specified during creation, a value - /// of 0 is used. One of MaxSurge and MaxUnavailable must be greater than 0. - /// - string UpgradeSettingMaxUnavailable { get; set; } - /// - /// The name of the VM SKU that determines the size of resources allocated for node VMs. - /// - string VMSkuName { get; set; } - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AgentPoolConfiguration.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AgentPoolConfiguration.json.cs deleted file mode 100644 index ea47cd253b13..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AgentPoolConfiguration.json.cs +++ /dev/null @@ -1,150 +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.NetworkCloud.Models.Api20250201 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; - - /// AgentPoolConfiguration specifies the configuration of a pool of nodes. - public partial class AgentPoolConfiguration - { - - /// - /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object - /// before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The JsonNode that should be deserialized into this object. - - partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json); - - /// - /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The JSON container that the serialization result will be placed in. - - partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container); - - /// - /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of - /// the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the - /// output parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The JsonNode that should be deserialized into this object. - /// Determines if the rest of the deserialization should be processed, or if the method should return - /// instantly. - - partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json, ref bool returnNow); - - /// - /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the - /// object before it is serialized. - /// If you wish to disable the default serialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The JSON container that the serialization result will be placed in. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, ref bool returnNow); - - /// - /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject into a new instance of . - /// - /// A Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject instance to deserialize from. - internal AgentPoolConfiguration(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) - { - bool returnNow = false; - BeforeFromJson(json, ref returnNow); - if (returnNow) - { - return; - } - {_administratorConfiguration = If( json?.PropertyT("administratorConfiguration"), out var __jsonAdministratorConfiguration) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AdministratorConfiguration.FromJson(__jsonAdministratorConfiguration) : AdministratorConfiguration;} - {_agentOption = If( json?.PropertyT("agentOptions"), out var __jsonAgentOptions) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AgentOptions.FromJson(__jsonAgentOptions) : AgentOption;} - {_attachedNetworkConfiguration = If( json?.PropertyT("attachedNetworkConfiguration"), out var __jsonAttachedNetworkConfiguration) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AttachedNetworkConfiguration.FromJson(__jsonAttachedNetworkConfiguration) : AttachedNetworkConfiguration;} - {_upgradeSetting = If( json?.PropertyT("upgradeSettings"), out var __jsonUpgradeSettings) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AgentPoolUpgradeSettings.FromJson(__jsonUpgradeSettings) : UpgradeSetting;} - {_availabilityZone = If( json?.PropertyT("availabilityZones"), out var __jsonAvailabilityZones) ? If( __jsonAvailabilityZones as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : AvailabilityZone;} - {_count = If( json?.PropertyT("count"), out var __jsonCount) ? (long)__jsonCount : Count;} - {_label = If( json?.PropertyT("labels"), out var __jsonLabels) ? If( __jsonLabels as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IKubernetesLabel) (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.KubernetesLabel.FromJson(__p) )) ))() : null : Label;} - {_mode = If( json?.PropertyT("mode"), out var __jsonMode) ? (string)__jsonMode : (string)Mode;} - {_taint = If( json?.PropertyT("taints"), out var __jsonTaints) ? If( __jsonTaints as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonArray, out var __l) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__l, (__k)=>(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesLabel) (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.KubernetesLabel.FromJson(__k) )) ))() : null : Taint;} - {_vMSkuName = If( json?.PropertyT("vmSkuName"), out var __jsonVMSkuName) ? (string)__jsonVMSkuName : (string)VMSkuName;} - AfterFromJson(json); - } - - /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolConfiguration. - /// - /// a to deserialize from. - /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolConfiguration. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolConfiguration FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) - { - return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new AgentPoolConfiguration(json) : null; - } - - /// - /// Serializes this instance of into a . - /// - /// The container to serialize this object into. If the caller - /// passes in null, a new instance will be created and returned to the caller. - /// Allows the caller to choose the depth of the serialization. See . - /// - /// a serialized instance of as a . - /// - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode) - { - container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject(); - - bool returnNow = false; - BeforeToJson(ref container, ref returnNow); - if (returnNow) - { - return container; - } - AddIf( null != this._administratorConfiguration ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) this._administratorConfiguration.ToJson(null,serializationMode) : null, "administratorConfiguration" ,container.Add ); - AddIf( null != this._agentOption ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) this._agentOption.ToJson(null,serializationMode) : null, "agentOptions" ,container.Add ); - AddIf( null != this._attachedNetworkConfiguration ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) this._attachedNetworkConfiguration.ToJson(null,serializationMode) : null, "attachedNetworkConfiguration" ,container.Add ); - AddIf( null != this._upgradeSetting ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) this._upgradeSetting.ToJson(null,serializationMode) : null, "upgradeSettings" ,container.Add ); - if (null != this._availabilityZone) - { - var __w = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.XNodeArray(); - foreach( var __x in this._availabilityZone ) - { - AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); - } - container.Add("availabilityZones",__w); - } - AddIf( (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNumber(this._count), "count" ,container.Add ); - if (null != this._label) - { - var __r = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.XNodeArray(); - foreach( var __s in this._label ) - { - AddIf(__s?.ToJson(null, serializationMode) ,__r.Add); - } - container.Add("labels",__r); - } - AddIf( null != (((object)this._mode)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._mode.ToString()) : null, "mode" ,container.Add ); - if (null != this._taint) - { - var __m = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.XNodeArray(); - foreach( var __n in this._taint ) - { - AddIf(__n?.ToJson(null, serializationMode) ,__m.Add); - } - container.Add("taints",__m); - } - AddIf( null != (((object)this._vMSkuName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._vMSkuName.ToString()) : null, "vmSkuName" ,container.Add ); - AfterToJson(ref container); - return container; - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AgentPoolPatchParameters.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AgentPoolPatchParameters.PowerShell.cs deleted file mode 100644 index cd464585828c..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AgentPoolPatchParameters.PowerShell.cs +++ /dev/null @@ -1,232 +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.NetworkCloud.Models.Api20250201 -{ - using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; - - /// - /// AgentPoolPatchParameters represents the body of the request to patch the Kubernetes cluster agent pool. - /// - [System.ComponentModel.TypeConverter(typeof(AgentPoolPatchParametersTypeConverter))] - public partial class AgentPoolPatchParameters - { - - /// - /// 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 AgentPoolPatchParameters(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.NetworkCloud.Models.Api20250201.IAgentPoolPatchParametersInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPatchProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPatchParametersInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AgentPoolPatchPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Tag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPatchParametersInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPatchParametersTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPatchParametersInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AgentPoolPatchParametersTagsTypeConverter.ConvertFrom); - } - if (content.Contains("AdministratorConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPatchParametersInternal)this).AdministratorConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INodePoolAdministratorConfigurationPatch) content.GetValueForProperty("AdministratorConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPatchParametersInternal)this).AdministratorConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.NodePoolAdministratorConfigurationPatchTypeConverter.ConvertFrom); - } - if (content.Contains("UpgradeSetting")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPatchParametersInternal)this).UpgradeSetting = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolUpgradeSettings) content.GetValueForProperty("UpgradeSetting",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPatchParametersInternal)this).UpgradeSetting, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AgentPoolUpgradeSettingsTypeConverter.ConvertFrom); - } - if (content.Contains("Count")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPatchParametersInternal)this).Count = (long?) content.GetValueForProperty("Count",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPatchParametersInternal)this).Count, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("AdministratorConfigurationSshPublicKey")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPatchParametersInternal)this).AdministratorConfigurationSshPublicKey = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey[]) content.GetValueForProperty("AdministratorConfigurationSshPublicKey",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPatchParametersInternal)this).AdministratorConfigurationSshPublicKey, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.SshPublicKeyTypeConverter.ConvertFrom)); - } - if (content.Contains("UpgradeSettingDrainTimeout")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPatchParametersInternal)this).UpgradeSettingDrainTimeout = (long?) content.GetValueForProperty("UpgradeSettingDrainTimeout",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPatchParametersInternal)this).UpgradeSettingDrainTimeout, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("UpgradeSettingMaxSurge")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPatchParametersInternal)this).UpgradeSettingMaxSurge = (string) content.GetValueForProperty("UpgradeSettingMaxSurge",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPatchParametersInternal)this).UpgradeSettingMaxSurge, global::System.Convert.ToString); - } - if (content.Contains("UpgradeSettingMaxUnavailable")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPatchParametersInternal)this).UpgradeSettingMaxUnavailable = (string) content.GetValueForProperty("UpgradeSettingMaxUnavailable",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPatchParametersInternal)this).UpgradeSettingMaxUnavailable, 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 AgentPoolPatchParameters(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.NetworkCloud.Models.Api20250201.IAgentPoolPatchParametersInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPatchProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPatchParametersInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AgentPoolPatchPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Tag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPatchParametersInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPatchParametersTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPatchParametersInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AgentPoolPatchParametersTagsTypeConverter.ConvertFrom); - } - if (content.Contains("AdministratorConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPatchParametersInternal)this).AdministratorConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INodePoolAdministratorConfigurationPatch) content.GetValueForProperty("AdministratorConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPatchParametersInternal)this).AdministratorConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.NodePoolAdministratorConfigurationPatchTypeConverter.ConvertFrom); - } - if (content.Contains("UpgradeSetting")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPatchParametersInternal)this).UpgradeSetting = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolUpgradeSettings) content.GetValueForProperty("UpgradeSetting",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPatchParametersInternal)this).UpgradeSetting, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AgentPoolUpgradeSettingsTypeConverter.ConvertFrom); - } - if (content.Contains("Count")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPatchParametersInternal)this).Count = (long?) content.GetValueForProperty("Count",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPatchParametersInternal)this).Count, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("AdministratorConfigurationSshPublicKey")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPatchParametersInternal)this).AdministratorConfigurationSshPublicKey = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey[]) content.GetValueForProperty("AdministratorConfigurationSshPublicKey",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPatchParametersInternal)this).AdministratorConfigurationSshPublicKey, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.SshPublicKeyTypeConverter.ConvertFrom)); - } - if (content.Contains("UpgradeSettingDrainTimeout")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPatchParametersInternal)this).UpgradeSettingDrainTimeout = (long?) content.GetValueForProperty("UpgradeSettingDrainTimeout",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPatchParametersInternal)this).UpgradeSettingDrainTimeout, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("UpgradeSettingMaxSurge")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPatchParametersInternal)this).UpgradeSettingMaxSurge = (string) content.GetValueForProperty("UpgradeSettingMaxSurge",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPatchParametersInternal)this).UpgradeSettingMaxSurge, global::System.Convert.ToString); - } - if (content.Contains("UpgradeSettingMaxUnavailable")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPatchParametersInternal)this).UpgradeSettingMaxUnavailable = (string) content.GetValueForProperty("UpgradeSettingMaxUnavailable",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPatchParametersInternal)this).UpgradeSettingMaxUnavailable, 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.NetworkCloud.Models.Api20250201.IAgentPoolPatchParameters DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new AgentPoolPatchParameters(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.NetworkCloud.Models.Api20250201.IAgentPoolPatchParameters DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new AgentPoolPatchParameters(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.NetworkCloud.Models.Api20250201.IAgentPoolPatchParameters FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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(); - } - } - /// AgentPoolPatchParameters represents the body of the request to patch the Kubernetes cluster agent pool. - [System.ComponentModel.TypeConverter(typeof(AgentPoolPatchParametersTypeConverter))] - public partial interface IAgentPoolPatchParameters - - { - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AgentPoolPatchParameters.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AgentPoolPatchParameters.cs deleted file mode 100644 index ee562755f456..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AgentPoolPatchParameters.cs +++ /dev/null @@ -1,190 +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.NetworkCloud.Models.Api20250201 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; - - /// - /// AgentPoolPatchParameters represents the body of the request to patch the Kubernetes cluster agent pool. - /// - public partial class AgentPoolPatchParameters : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPatchParameters, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPatchParametersInternal - { - - /// - /// SshPublicKey represents the public key used to authenticate with a resource through SSH. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey[] AdministratorConfigurationSshPublicKey { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPatchPropertiesInternal)Property).AdministratorConfigurationSshPublicKey; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPatchPropertiesInternal)Property).AdministratorConfigurationSshPublicKey = value ?? null /* arrayOf */; } - - /// The number of virtual machines that use this configuration. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public long? Count { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPatchPropertiesInternal)Property).Count; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPatchPropertiesInternal)Property).Count = value ?? default(long); } - - /// Internal Acessors for AdministratorConfiguration - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INodePoolAdministratorConfigurationPatch Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPatchParametersInternal.AdministratorConfiguration { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPatchPropertiesInternal)Property).AdministratorConfiguration; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPatchPropertiesInternal)Property).AdministratorConfiguration = value; } - - /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPatchProperties Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPatchParametersInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AgentPoolPatchProperties()); set { {_property = value;} } } - - /// Internal Acessors for UpgradeSetting - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolUpgradeSettings Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPatchParametersInternal.UpgradeSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPatchPropertiesInternal)Property).UpgradeSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPatchPropertiesInternal)Property).UpgradeSetting = value; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPatchProperties _property; - - /// The list of the resource properties. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPatchProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AgentPoolPatchProperties()); set => this._property = value; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPatchParametersTags _tag; - - /// The Azure resource tags that will replace the existing ones. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPatchParametersTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AgentPoolPatchParametersTags()); set => this._tag = value; } - - /// - /// The maximum time in seconds that is allowed for a node drain to complete before proceeding with the upgrade of the agent - /// pool. If not specified during creation, a value of 1800 seconds is used. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public long? UpgradeSettingDrainTimeout { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPatchPropertiesInternal)Property).UpgradeSettingDrainTimeout; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPatchPropertiesInternal)Property).UpgradeSettingDrainTimeout = value ?? default(long); } - - /// - /// The maximum number or percentage of nodes that are surged during upgrade. This can either be set to an integer (e.g. '5') - /// or a percentage (e.g. '50%'). If a percentage is specified, it is the percentage of the total agent pool size at the time - /// of the upgrade. For percentages, fractional nodes are rounded up. If not specified during creation, a value of 1 is used. - /// One of MaxSurge and MaxUnavailable must be greater than 0. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string UpgradeSettingMaxSurge { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPatchPropertiesInternal)Property).UpgradeSettingMaxSurge; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPatchPropertiesInternal)Property).UpgradeSettingMaxSurge = value ?? null; } - - /// - /// The maximum number or percentage of nodes that can be unavailable during upgrade. This can either be set to an integer - /// (e.g. '5') or a percentage (e.g. '50%'). If a percentage is specified, it is the percentage of the total agent pool size - /// at the time of the upgrade. For percentages, fractional nodes are rounded up. If not specified during creation, a value - /// of 0 is used. One of MaxSurge and MaxUnavailable must be greater than 0. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string UpgradeSettingMaxUnavailable { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPatchPropertiesInternal)Property).UpgradeSettingMaxUnavailable; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPatchPropertiesInternal)Property).UpgradeSettingMaxUnavailable = value ?? null; } - - /// Creates an new instance. - public AgentPoolPatchParameters() - { - - } - } - /// AgentPoolPatchParameters represents the body of the request to patch the Kubernetes cluster agent pool. - public partial interface IAgentPoolPatchParameters : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable - { - /// - /// SshPublicKey represents the public key used to authenticate with a resource through SSH. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"SshPublicKey represents the public key used to authenticate with a resource through SSH.", - SerializedName = @"sshPublicKeys", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey[] AdministratorConfigurationSshPublicKey { get; set; } - /// The number of virtual machines that use this configuration. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The number of virtual machines that use this configuration.", - SerializedName = @"count", - PossibleTypes = new [] { typeof(long) })] - long? Count { get; set; } - /// The Azure resource tags that will replace the existing ones. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The Azure resource tags that will replace the existing ones.", - SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPatchParametersTags) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPatchParametersTags Tag { get; set; } - /// - /// The maximum time in seconds that is allowed for a node drain to complete before proceeding with the upgrade of the agent - /// pool. If not specified during creation, a value of 1800 seconds is used. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The maximum time in seconds that is allowed for a node drain to complete before proceeding with the upgrade of the agent pool. If not specified during creation, a value of 1800 seconds is used.", - SerializedName = @"drainTimeout", - PossibleTypes = new [] { typeof(long) })] - long? UpgradeSettingDrainTimeout { get; set; } - /// - /// The maximum number or percentage of nodes that are surged during upgrade. This can either be set to an integer (e.g. '5') - /// or a percentage (e.g. '50%'). If a percentage is specified, it is the percentage of the total agent pool size at the time - /// of the upgrade. For percentages, fractional nodes are rounded up. If not specified during creation, a value of 1 is used. - /// One of MaxSurge and MaxUnavailable must be greater than 0. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The maximum number or percentage of nodes that are surged during upgrade. This can either be set to an integer (e.g. '5') or a percentage (e.g. '50%'). If a percentage is specified, it is the percentage of the total agent pool size at the time of the upgrade. For percentages, fractional nodes are rounded up. If not specified during creation, a value of 1 is used. One of MaxSurge and MaxUnavailable must be greater than 0.", - SerializedName = @"maxSurge", - PossibleTypes = new [] { typeof(string) })] - string UpgradeSettingMaxSurge { get; set; } - /// - /// The maximum number or percentage of nodes that can be unavailable during upgrade. This can either be set to an integer - /// (e.g. '5') or a percentage (e.g. '50%'). If a percentage is specified, it is the percentage of the total agent pool size - /// at the time of the upgrade. For percentages, fractional nodes are rounded up. If not specified during creation, a value - /// of 0 is used. One of MaxSurge and MaxUnavailable must be greater than 0. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The maximum number or percentage of nodes that can be unavailable during upgrade. This can either be set to an integer (e.g. '5') or a percentage (e.g. '50%'). If a percentage is specified, it is the percentage of the total agent pool size at the time of the upgrade. For percentages, fractional nodes are rounded up. If not specified during creation, a value of 0 is used. One of MaxSurge and MaxUnavailable must be greater than 0.", - SerializedName = @"maxUnavailable", - PossibleTypes = new [] { typeof(string) })] - string UpgradeSettingMaxUnavailable { get; set; } - - } - /// AgentPoolPatchParameters represents the body of the request to patch the Kubernetes cluster agent pool. - internal partial interface IAgentPoolPatchParametersInternal - - { - /// The configuration of administrator credentials for the control plane nodes. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INodePoolAdministratorConfigurationPatch AdministratorConfiguration { get; set; } - /// - /// SshPublicKey represents the public key used to authenticate with a resource through SSH. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey[] AdministratorConfigurationSshPublicKey { get; set; } - /// The number of virtual machines that use this configuration. - long? Count { get; set; } - /// The list of the resource properties. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPatchProperties Property { get; set; } - /// The Azure resource tags that will replace the existing ones. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPatchParametersTags Tag { get; set; } - /// The configuration of the agent pool. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolUpgradeSettings UpgradeSetting { get; set; } - /// - /// The maximum time in seconds that is allowed for a node drain to complete before proceeding with the upgrade of the agent - /// pool. If not specified during creation, a value of 1800 seconds is used. - /// - long? UpgradeSettingDrainTimeout { get; set; } - /// - /// The maximum number or percentage of nodes that are surged during upgrade. This can either be set to an integer (e.g. '5') - /// or a percentage (e.g. '50%'). If a percentage is specified, it is the percentage of the total agent pool size at the time - /// of the upgrade. For percentages, fractional nodes are rounded up. If not specified during creation, a value of 1 is used. - /// One of MaxSurge and MaxUnavailable must be greater than 0. - /// - string UpgradeSettingMaxSurge { get; set; } - /// - /// The maximum number or percentage of nodes that can be unavailable during upgrade. This can either be set to an integer - /// (e.g. '5') or a percentage (e.g. '50%'). If a percentage is specified, it is the percentage of the total agent pool size - /// at the time of the upgrade. For percentages, fractional nodes are rounded up. If not specified during creation, a value - /// of 0 is used. One of MaxSurge and MaxUnavailable must be greater than 0. - /// - string UpgradeSettingMaxUnavailable { get; set; } - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AgentPoolPatchProperties.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AgentPoolPatchProperties.PowerShell.cs deleted file mode 100644 index 8a756a3afd39..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AgentPoolPatchProperties.PowerShell.cs +++ /dev/null @@ -1,216 +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.NetworkCloud.Models.Api20250201 -{ - using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; - - /// - /// AgentPoolPatchProperties represents the properties of an agent pool that can be modified. - /// - [System.ComponentModel.TypeConverter(typeof(AgentPoolPatchPropertiesTypeConverter))] - public partial class AgentPoolPatchProperties - { - - /// - /// 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 AgentPoolPatchProperties(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("AdministratorConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPatchPropertiesInternal)this).AdministratorConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INodePoolAdministratorConfigurationPatch) content.GetValueForProperty("AdministratorConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPatchPropertiesInternal)this).AdministratorConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.NodePoolAdministratorConfigurationPatchTypeConverter.ConvertFrom); - } - if (content.Contains("UpgradeSetting")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPatchPropertiesInternal)this).UpgradeSetting = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolUpgradeSettings) content.GetValueForProperty("UpgradeSetting",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPatchPropertiesInternal)this).UpgradeSetting, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AgentPoolUpgradeSettingsTypeConverter.ConvertFrom); - } - if (content.Contains("Count")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPatchPropertiesInternal)this).Count = (long?) content.GetValueForProperty("Count",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPatchPropertiesInternal)this).Count, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("AdministratorConfigurationSshPublicKey")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPatchPropertiesInternal)this).AdministratorConfigurationSshPublicKey = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey[]) content.GetValueForProperty("AdministratorConfigurationSshPublicKey",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPatchPropertiesInternal)this).AdministratorConfigurationSshPublicKey, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.SshPublicKeyTypeConverter.ConvertFrom)); - } - if (content.Contains("UpgradeSettingDrainTimeout")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPatchPropertiesInternal)this).UpgradeSettingDrainTimeout = (long?) content.GetValueForProperty("UpgradeSettingDrainTimeout",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPatchPropertiesInternal)this).UpgradeSettingDrainTimeout, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("UpgradeSettingMaxSurge")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPatchPropertiesInternal)this).UpgradeSettingMaxSurge = (string) content.GetValueForProperty("UpgradeSettingMaxSurge",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPatchPropertiesInternal)this).UpgradeSettingMaxSurge, global::System.Convert.ToString); - } - if (content.Contains("UpgradeSettingMaxUnavailable")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPatchPropertiesInternal)this).UpgradeSettingMaxUnavailable = (string) content.GetValueForProperty("UpgradeSettingMaxUnavailable",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPatchPropertiesInternal)this).UpgradeSettingMaxUnavailable, 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 AgentPoolPatchProperties(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("AdministratorConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPatchPropertiesInternal)this).AdministratorConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INodePoolAdministratorConfigurationPatch) content.GetValueForProperty("AdministratorConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPatchPropertiesInternal)this).AdministratorConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.NodePoolAdministratorConfigurationPatchTypeConverter.ConvertFrom); - } - if (content.Contains("UpgradeSetting")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPatchPropertiesInternal)this).UpgradeSetting = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolUpgradeSettings) content.GetValueForProperty("UpgradeSetting",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPatchPropertiesInternal)this).UpgradeSetting, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AgentPoolUpgradeSettingsTypeConverter.ConvertFrom); - } - if (content.Contains("Count")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPatchPropertiesInternal)this).Count = (long?) content.GetValueForProperty("Count",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPatchPropertiesInternal)this).Count, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("AdministratorConfigurationSshPublicKey")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPatchPropertiesInternal)this).AdministratorConfigurationSshPublicKey = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey[]) content.GetValueForProperty("AdministratorConfigurationSshPublicKey",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPatchPropertiesInternal)this).AdministratorConfigurationSshPublicKey, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.SshPublicKeyTypeConverter.ConvertFrom)); - } - if (content.Contains("UpgradeSettingDrainTimeout")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPatchPropertiesInternal)this).UpgradeSettingDrainTimeout = (long?) content.GetValueForProperty("UpgradeSettingDrainTimeout",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPatchPropertiesInternal)this).UpgradeSettingDrainTimeout, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("UpgradeSettingMaxSurge")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPatchPropertiesInternal)this).UpgradeSettingMaxSurge = (string) content.GetValueForProperty("UpgradeSettingMaxSurge",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPatchPropertiesInternal)this).UpgradeSettingMaxSurge, global::System.Convert.ToString); - } - if (content.Contains("UpgradeSettingMaxUnavailable")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPatchPropertiesInternal)this).UpgradeSettingMaxUnavailable = (string) content.GetValueForProperty("UpgradeSettingMaxUnavailable",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPatchPropertiesInternal)this).UpgradeSettingMaxUnavailable, 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.NetworkCloud.Models.Api20250201.IAgentPoolPatchProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new AgentPoolPatchProperties(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.NetworkCloud.Models.Api20250201.IAgentPoolPatchProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new AgentPoolPatchProperties(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.NetworkCloud.Models.Api20250201.IAgentPoolPatchProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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(); - } - } - /// AgentPoolPatchProperties represents the properties of an agent pool that can be modified. - [System.ComponentModel.TypeConverter(typeof(AgentPoolPatchPropertiesTypeConverter))] - public partial interface IAgentPoolPatchProperties - - { - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AgentPoolPatchProperties.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AgentPoolPatchProperties.cs deleted file mode 100644 index 54017ed465b6..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AgentPoolPatchProperties.cs +++ /dev/null @@ -1,178 +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.NetworkCloud.Models.Api20250201 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; - - /// - /// AgentPoolPatchProperties represents the properties of an agent pool that can be modified. - /// - public partial class AgentPoolPatchProperties : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPatchProperties, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPatchPropertiesInternal - { - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INodePoolAdministratorConfigurationPatch _administratorConfiguration; - - /// The configuration of administrator credentials for the control plane nodes. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INodePoolAdministratorConfigurationPatch AdministratorConfiguration { get => (this._administratorConfiguration = this._administratorConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.NodePoolAdministratorConfigurationPatch()); set => this._administratorConfiguration = value; } - - /// - /// SshPublicKey represents the public key used to authenticate with a resource through SSH. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey[] AdministratorConfigurationSshPublicKey { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INodePoolAdministratorConfigurationPatchInternal)AdministratorConfiguration).SshPublicKey; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INodePoolAdministratorConfigurationPatchInternal)AdministratorConfiguration).SshPublicKey = value ?? null /* arrayOf */; } - - /// Backing field for property. - private long? _count; - - /// The number of virtual machines that use this configuration. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public long? Count { get => this._count; set => this._count = value; } - - /// Internal Acessors for AdministratorConfiguration - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INodePoolAdministratorConfigurationPatch Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPatchPropertiesInternal.AdministratorConfiguration { get => (this._administratorConfiguration = this._administratorConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.NodePoolAdministratorConfigurationPatch()); set { {_administratorConfiguration = value;} } } - - /// Internal Acessors for UpgradeSetting - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolUpgradeSettings Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPatchPropertiesInternal.UpgradeSetting { get => (this._upgradeSetting = this._upgradeSetting ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AgentPoolUpgradeSettings()); set { {_upgradeSetting = value;} } } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolUpgradeSettings _upgradeSetting; - - /// The configuration of the agent pool. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolUpgradeSettings UpgradeSetting { get => (this._upgradeSetting = this._upgradeSetting ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AgentPoolUpgradeSettings()); set => this._upgradeSetting = value; } - - /// - /// The maximum time in seconds that is allowed for a node drain to complete before proceeding with the upgrade of the agent - /// pool. If not specified during creation, a value of 1800 seconds is used. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public long? UpgradeSettingDrainTimeout { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolUpgradeSettingsInternal)UpgradeSetting).DrainTimeout; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolUpgradeSettingsInternal)UpgradeSetting).DrainTimeout = value ?? default(long); } - - /// - /// The maximum number or percentage of nodes that are surged during upgrade. This can either be set to an integer (e.g. '5') - /// or a percentage (e.g. '50%'). If a percentage is specified, it is the percentage of the total agent pool size at the time - /// of the upgrade. For percentages, fractional nodes are rounded up. If not specified during creation, a value of 1 is used. - /// One of MaxSurge and MaxUnavailable must be greater than 0. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string UpgradeSettingMaxSurge { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolUpgradeSettingsInternal)UpgradeSetting).MaxSurge; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolUpgradeSettingsInternal)UpgradeSetting).MaxSurge = value ?? null; } - - /// - /// The maximum number or percentage of nodes that can be unavailable during upgrade. This can either be set to an integer - /// (e.g. '5') or a percentage (e.g. '50%'). If a percentage is specified, it is the percentage of the total agent pool size - /// at the time of the upgrade. For percentages, fractional nodes are rounded up. If not specified during creation, a value - /// of 0 is used. One of MaxSurge and MaxUnavailable must be greater than 0. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string UpgradeSettingMaxUnavailable { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolUpgradeSettingsInternal)UpgradeSetting).MaxUnavailable; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolUpgradeSettingsInternal)UpgradeSetting).MaxUnavailable = value ?? null; } - - /// Creates an new instance. - public AgentPoolPatchProperties() - { - - } - } - /// AgentPoolPatchProperties represents the properties of an agent pool that can be modified. - public partial interface IAgentPoolPatchProperties : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable - { - /// - /// SshPublicKey represents the public key used to authenticate with a resource through SSH. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"SshPublicKey represents the public key used to authenticate with a resource through SSH.", - SerializedName = @"sshPublicKeys", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey[] AdministratorConfigurationSshPublicKey { get; set; } - /// The number of virtual machines that use this configuration. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The number of virtual machines that use this configuration.", - SerializedName = @"count", - PossibleTypes = new [] { typeof(long) })] - long? Count { get; set; } - /// - /// The maximum time in seconds that is allowed for a node drain to complete before proceeding with the upgrade of the agent - /// pool. If not specified during creation, a value of 1800 seconds is used. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The maximum time in seconds that is allowed for a node drain to complete before proceeding with the upgrade of the agent pool. If not specified during creation, a value of 1800 seconds is used.", - SerializedName = @"drainTimeout", - PossibleTypes = new [] { typeof(long) })] - long? UpgradeSettingDrainTimeout { get; set; } - /// - /// The maximum number or percentage of nodes that are surged during upgrade. This can either be set to an integer (e.g. '5') - /// or a percentage (e.g. '50%'). If a percentage is specified, it is the percentage of the total agent pool size at the time - /// of the upgrade. For percentages, fractional nodes are rounded up. If not specified during creation, a value of 1 is used. - /// One of MaxSurge and MaxUnavailable must be greater than 0. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The maximum number or percentage of nodes that are surged during upgrade. This can either be set to an integer (e.g. '5') or a percentage (e.g. '50%'). If a percentage is specified, it is the percentage of the total agent pool size at the time of the upgrade. For percentages, fractional nodes are rounded up. If not specified during creation, a value of 1 is used. One of MaxSurge and MaxUnavailable must be greater than 0.", - SerializedName = @"maxSurge", - PossibleTypes = new [] { typeof(string) })] - string UpgradeSettingMaxSurge { get; set; } - /// - /// The maximum number or percentage of nodes that can be unavailable during upgrade. This can either be set to an integer - /// (e.g. '5') or a percentage (e.g. '50%'). If a percentage is specified, it is the percentage of the total agent pool size - /// at the time of the upgrade. For percentages, fractional nodes are rounded up. If not specified during creation, a value - /// of 0 is used. One of MaxSurge and MaxUnavailable must be greater than 0. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The maximum number or percentage of nodes that can be unavailable during upgrade. This can either be set to an integer (e.g. '5') or a percentage (e.g. '50%'). If a percentage is specified, it is the percentage of the total agent pool size at the time of the upgrade. For percentages, fractional nodes are rounded up. If not specified during creation, a value of 0 is used. One of MaxSurge and MaxUnavailable must be greater than 0.", - SerializedName = @"maxUnavailable", - PossibleTypes = new [] { typeof(string) })] - string UpgradeSettingMaxUnavailable { get; set; } - - } - /// AgentPoolPatchProperties represents the properties of an agent pool that can be modified. - internal partial interface IAgentPoolPatchPropertiesInternal - - { - /// The configuration of administrator credentials for the control plane nodes. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INodePoolAdministratorConfigurationPatch AdministratorConfiguration { get; set; } - /// - /// SshPublicKey represents the public key used to authenticate with a resource through SSH. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey[] AdministratorConfigurationSshPublicKey { get; set; } - /// The number of virtual machines that use this configuration. - long? Count { get; set; } - /// The configuration of the agent pool. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolUpgradeSettings UpgradeSetting { get; set; } - /// - /// The maximum time in seconds that is allowed for a node drain to complete before proceeding with the upgrade of the agent - /// pool. If not specified during creation, a value of 1800 seconds is used. - /// - long? UpgradeSettingDrainTimeout { get; set; } - /// - /// The maximum number or percentage of nodes that are surged during upgrade. This can either be set to an integer (e.g. '5') - /// or a percentage (e.g. '50%'). If a percentage is specified, it is the percentage of the total agent pool size at the time - /// of the upgrade. For percentages, fractional nodes are rounded up. If not specified during creation, a value of 1 is used. - /// One of MaxSurge and MaxUnavailable must be greater than 0. - /// - string UpgradeSettingMaxSurge { get; set; } - /// - /// The maximum number or percentage of nodes that can be unavailable during upgrade. This can either be set to an integer - /// (e.g. '5') or a percentage (e.g. '50%'). If a percentage is specified, it is the percentage of the total agent pool size - /// at the time of the upgrade. For percentages, fractional nodes are rounded up. If not specified during creation, a value - /// of 0 is used. One of MaxSurge and MaxUnavailable must be greater than 0. - /// - string UpgradeSettingMaxUnavailable { get; set; } - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AgentPoolProperties.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AgentPoolProperties.PowerShell.cs deleted file mode 100644 index a026df3c23f6..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AgentPoolProperties.PowerShell.cs +++ /dev/null @@ -1,350 +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.NetworkCloud.Models.Api20250201 -{ - using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; - - /// - /// AgentPoolProperties represents the properties of the Kubernetes cluster agent pool. - /// - [System.ComponentModel.TypeConverter(typeof(AgentPoolPropertiesTypeConverter))] - public partial class AgentPoolProperties - { - - /// - /// 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 AgentPoolProperties(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("AdministratorConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPropertiesInternal)this).AdministratorConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministratorConfiguration) content.GetValueForProperty("AdministratorConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPropertiesInternal)this).AdministratorConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AdministratorConfigurationTypeConverter.ConvertFrom); - } - if (content.Contains("AgentOption")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPropertiesInternal)this).AgentOption = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentOptions) content.GetValueForProperty("AgentOption",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPropertiesInternal)this).AgentOption, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AgentOptionsTypeConverter.ConvertFrom); - } - if (content.Contains("AttachedNetworkConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPropertiesInternal)this).AttachedNetworkConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAttachedNetworkConfiguration) content.GetValueForProperty("AttachedNetworkConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPropertiesInternal)this).AttachedNetworkConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AttachedNetworkConfigurationTypeConverter.ConvertFrom); - } - if (content.Contains("UpgradeSetting")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPropertiesInternal)this).UpgradeSetting = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolUpgradeSettings) content.GetValueForProperty("UpgradeSetting",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPropertiesInternal)this).UpgradeSetting, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AgentPoolUpgradeSettingsTypeConverter.ConvertFrom); - } - if (content.Contains("AvailabilityZone")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPropertiesInternal)this).AvailabilityZone = (string[]) content.GetValueForProperty("AvailabilityZone",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPropertiesInternal)this).AvailabilityZone, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("Count")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPropertiesInternal)this).Count = (long) content.GetValueForProperty("Count",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPropertiesInternal)this).Count, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("DetailedStatus")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPropertiesInternal)this).DetailedStatus = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.AgentPoolDetailedStatus?) content.GetValueForProperty("DetailedStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPropertiesInternal)this).DetailedStatus, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.AgentPoolDetailedStatus.CreateFrom); - } - if (content.Contains("DetailedStatusMessage")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPropertiesInternal)this).DetailedStatusMessage = (string) content.GetValueForProperty("DetailedStatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPropertiesInternal)this).DetailedStatusMessage, global::System.Convert.ToString); - } - if (content.Contains("KubernetesVersion")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPropertiesInternal)this).KubernetesVersion = (string) content.GetValueForProperty("KubernetesVersion",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPropertiesInternal)this).KubernetesVersion, global::System.Convert.ToString); - } - if (content.Contains("Label")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPropertiesInternal)this).Label = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesLabel[]) content.GetValueForProperty("Label",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPropertiesInternal)this).Label, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.KubernetesLabelTypeConverter.ConvertFrom)); - } - if (content.Contains("Mode")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPropertiesInternal)this).Mode = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.AgentPoolMode) content.GetValueForProperty("Mode",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPropertiesInternal)this).Mode, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.AgentPoolMode.CreateFrom); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.AgentPoolProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.AgentPoolProvisioningState.CreateFrom); - } - if (content.Contains("Taint")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPropertiesInternal)this).Taint = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesLabel[]) content.GetValueForProperty("Taint",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPropertiesInternal)this).Taint, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.KubernetesLabelTypeConverter.ConvertFrom)); - } - if (content.Contains("VMSkuName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPropertiesInternal)this).VMSkuName = (string) content.GetValueForProperty("VMSkuName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPropertiesInternal)this).VMSkuName, global::System.Convert.ToString); - } - if (content.Contains("AdministratorConfigurationAdminUsername")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPropertiesInternal)this).AdministratorConfigurationAdminUsername = (string) content.GetValueForProperty("AdministratorConfigurationAdminUsername",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPropertiesInternal)this).AdministratorConfigurationAdminUsername, global::System.Convert.ToString); - } - if (content.Contains("AgentOptionHugepagesCount")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPropertiesInternal)this).AgentOptionHugepagesCount = (long) content.GetValueForProperty("AgentOptionHugepagesCount",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPropertiesInternal)this).AgentOptionHugepagesCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("AgentOptionHugepagesSize")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPropertiesInternal)this).AgentOptionHugepagesSize = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HugepagesSize?) content.GetValueForProperty("AgentOptionHugepagesSize",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPropertiesInternal)this).AgentOptionHugepagesSize, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HugepagesSize.CreateFrom); - } - if (content.Contains("AttachedNetworkConfigurationL2Network")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPropertiesInternal)this).AttachedNetworkConfigurationL2Network = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkAttachmentConfiguration[]) content.GetValueForProperty("AttachedNetworkConfigurationL2Network",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPropertiesInternal)this).AttachedNetworkConfigurationL2Network, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.L2NetworkAttachmentConfigurationTypeConverter.ConvertFrom)); - } - if (content.Contains("AttachedNetworkConfigurationL3Network")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPropertiesInternal)this).AttachedNetworkConfigurationL3Network = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkAttachmentConfiguration[]) content.GetValueForProperty("AttachedNetworkConfigurationL3Network",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPropertiesInternal)this).AttachedNetworkConfigurationL3Network, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.L3NetworkAttachmentConfigurationTypeConverter.ConvertFrom)); - } - if (content.Contains("AttachedNetworkConfigurationTrunkedNetwork")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPropertiesInternal)this).AttachedNetworkConfigurationTrunkedNetwork = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkAttachmentConfiguration[]) content.GetValueForProperty("AttachedNetworkConfigurationTrunkedNetwork",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPropertiesInternal)this).AttachedNetworkConfigurationTrunkedNetwork, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.TrunkedNetworkAttachmentConfigurationTypeConverter.ConvertFrom)); - } - if (content.Contains("AdministratorConfigurationSshPublicKey")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPropertiesInternal)this).AdministratorConfigurationSshPublicKey = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey[]) content.GetValueForProperty("AdministratorConfigurationSshPublicKey",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPropertiesInternal)this).AdministratorConfigurationSshPublicKey, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.SshPublicKeyTypeConverter.ConvertFrom)); - } - if (content.Contains("UpgradeSettingDrainTimeout")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPropertiesInternal)this).UpgradeSettingDrainTimeout = (long?) content.GetValueForProperty("UpgradeSettingDrainTimeout",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPropertiesInternal)this).UpgradeSettingDrainTimeout, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("UpgradeSettingMaxSurge")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPropertiesInternal)this).UpgradeSettingMaxSurge = (string) content.GetValueForProperty("UpgradeSettingMaxSurge",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPropertiesInternal)this).UpgradeSettingMaxSurge, global::System.Convert.ToString); - } - if (content.Contains("UpgradeSettingMaxUnavailable")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPropertiesInternal)this).UpgradeSettingMaxUnavailable = (string) content.GetValueForProperty("UpgradeSettingMaxUnavailable",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPropertiesInternal)this).UpgradeSettingMaxUnavailable, 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 AgentPoolProperties(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("AdministratorConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPropertiesInternal)this).AdministratorConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministratorConfiguration) content.GetValueForProperty("AdministratorConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPropertiesInternal)this).AdministratorConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AdministratorConfigurationTypeConverter.ConvertFrom); - } - if (content.Contains("AgentOption")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPropertiesInternal)this).AgentOption = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentOptions) content.GetValueForProperty("AgentOption",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPropertiesInternal)this).AgentOption, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AgentOptionsTypeConverter.ConvertFrom); - } - if (content.Contains("AttachedNetworkConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPropertiesInternal)this).AttachedNetworkConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAttachedNetworkConfiguration) content.GetValueForProperty("AttachedNetworkConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPropertiesInternal)this).AttachedNetworkConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AttachedNetworkConfigurationTypeConverter.ConvertFrom); - } - if (content.Contains("UpgradeSetting")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPropertiesInternal)this).UpgradeSetting = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolUpgradeSettings) content.GetValueForProperty("UpgradeSetting",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPropertiesInternal)this).UpgradeSetting, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AgentPoolUpgradeSettingsTypeConverter.ConvertFrom); - } - if (content.Contains("AvailabilityZone")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPropertiesInternal)this).AvailabilityZone = (string[]) content.GetValueForProperty("AvailabilityZone",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPropertiesInternal)this).AvailabilityZone, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("Count")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPropertiesInternal)this).Count = (long) content.GetValueForProperty("Count",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPropertiesInternal)this).Count, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("DetailedStatus")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPropertiesInternal)this).DetailedStatus = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.AgentPoolDetailedStatus?) content.GetValueForProperty("DetailedStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPropertiesInternal)this).DetailedStatus, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.AgentPoolDetailedStatus.CreateFrom); - } - if (content.Contains("DetailedStatusMessage")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPropertiesInternal)this).DetailedStatusMessage = (string) content.GetValueForProperty("DetailedStatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPropertiesInternal)this).DetailedStatusMessage, global::System.Convert.ToString); - } - if (content.Contains("KubernetesVersion")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPropertiesInternal)this).KubernetesVersion = (string) content.GetValueForProperty("KubernetesVersion",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPropertiesInternal)this).KubernetesVersion, global::System.Convert.ToString); - } - if (content.Contains("Label")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPropertiesInternal)this).Label = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesLabel[]) content.GetValueForProperty("Label",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPropertiesInternal)this).Label, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.KubernetesLabelTypeConverter.ConvertFrom)); - } - if (content.Contains("Mode")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPropertiesInternal)this).Mode = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.AgentPoolMode) content.GetValueForProperty("Mode",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPropertiesInternal)this).Mode, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.AgentPoolMode.CreateFrom); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.AgentPoolProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.AgentPoolProvisioningState.CreateFrom); - } - if (content.Contains("Taint")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPropertiesInternal)this).Taint = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesLabel[]) content.GetValueForProperty("Taint",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPropertiesInternal)this).Taint, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.KubernetesLabelTypeConverter.ConvertFrom)); - } - if (content.Contains("VMSkuName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPropertiesInternal)this).VMSkuName = (string) content.GetValueForProperty("VMSkuName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPropertiesInternal)this).VMSkuName, global::System.Convert.ToString); - } - if (content.Contains("AdministratorConfigurationAdminUsername")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPropertiesInternal)this).AdministratorConfigurationAdminUsername = (string) content.GetValueForProperty("AdministratorConfigurationAdminUsername",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPropertiesInternal)this).AdministratorConfigurationAdminUsername, global::System.Convert.ToString); - } - if (content.Contains("AgentOptionHugepagesCount")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPropertiesInternal)this).AgentOptionHugepagesCount = (long) content.GetValueForProperty("AgentOptionHugepagesCount",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPropertiesInternal)this).AgentOptionHugepagesCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("AgentOptionHugepagesSize")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPropertiesInternal)this).AgentOptionHugepagesSize = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HugepagesSize?) content.GetValueForProperty("AgentOptionHugepagesSize",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPropertiesInternal)this).AgentOptionHugepagesSize, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HugepagesSize.CreateFrom); - } - if (content.Contains("AttachedNetworkConfigurationL2Network")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPropertiesInternal)this).AttachedNetworkConfigurationL2Network = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkAttachmentConfiguration[]) content.GetValueForProperty("AttachedNetworkConfigurationL2Network",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPropertiesInternal)this).AttachedNetworkConfigurationL2Network, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.L2NetworkAttachmentConfigurationTypeConverter.ConvertFrom)); - } - if (content.Contains("AttachedNetworkConfigurationL3Network")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPropertiesInternal)this).AttachedNetworkConfigurationL3Network = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkAttachmentConfiguration[]) content.GetValueForProperty("AttachedNetworkConfigurationL3Network",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPropertiesInternal)this).AttachedNetworkConfigurationL3Network, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.L3NetworkAttachmentConfigurationTypeConverter.ConvertFrom)); - } - if (content.Contains("AttachedNetworkConfigurationTrunkedNetwork")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPropertiesInternal)this).AttachedNetworkConfigurationTrunkedNetwork = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkAttachmentConfiguration[]) content.GetValueForProperty("AttachedNetworkConfigurationTrunkedNetwork",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPropertiesInternal)this).AttachedNetworkConfigurationTrunkedNetwork, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.TrunkedNetworkAttachmentConfigurationTypeConverter.ConvertFrom)); - } - if (content.Contains("AdministratorConfigurationSshPublicKey")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPropertiesInternal)this).AdministratorConfigurationSshPublicKey = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey[]) content.GetValueForProperty("AdministratorConfigurationSshPublicKey",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPropertiesInternal)this).AdministratorConfigurationSshPublicKey, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.SshPublicKeyTypeConverter.ConvertFrom)); - } - if (content.Contains("UpgradeSettingDrainTimeout")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPropertiesInternal)this).UpgradeSettingDrainTimeout = (long?) content.GetValueForProperty("UpgradeSettingDrainTimeout",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPropertiesInternal)this).UpgradeSettingDrainTimeout, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("UpgradeSettingMaxSurge")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPropertiesInternal)this).UpgradeSettingMaxSurge = (string) content.GetValueForProperty("UpgradeSettingMaxSurge",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPropertiesInternal)this).UpgradeSettingMaxSurge, global::System.Convert.ToString); - } - if (content.Contains("UpgradeSettingMaxUnavailable")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPropertiesInternal)this).UpgradeSettingMaxUnavailable = (string) content.GetValueForProperty("UpgradeSettingMaxUnavailable",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPropertiesInternal)this).UpgradeSettingMaxUnavailable, 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.NetworkCloud.Models.Api20250201.IAgentPoolProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new AgentPoolProperties(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.NetworkCloud.Models.Api20250201.IAgentPoolProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new AgentPoolProperties(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.NetworkCloud.Models.Api20250201.IAgentPoolProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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(); - } - } - /// AgentPoolProperties represents the properties of the Kubernetes cluster agent pool. - [System.ComponentModel.TypeConverter(typeof(AgentPoolPropertiesTypeConverter))] - public partial interface IAgentPoolProperties - - { - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AgentPoolProperties.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AgentPoolProperties.cs deleted file mode 100644 index e4d16f769169..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AgentPoolProperties.cs +++ /dev/null @@ -1,494 +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.NetworkCloud.Models.Api20250201 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; - - /// - /// AgentPoolProperties represents the properties of the Kubernetes cluster agent pool. - /// - public partial class AgentPoolProperties : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolProperties, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPropertiesInternal - { - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministratorConfiguration _administratorConfiguration; - - /// The administrator credentials to be used for the nodes in this agent pool. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministratorConfiguration AdministratorConfiguration { get => (this._administratorConfiguration = this._administratorConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AdministratorConfiguration()); set => this._administratorConfiguration = value; } - - /// - /// The user name for the administrator that will be applied to the operating systems that run Kubernetes nodes. If not supplied, - /// a user name will be chosen by the service. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string AdministratorConfigurationAdminUsername { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministratorConfigurationInternal)AdministratorConfiguration).AdminUsername; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministratorConfigurationInternal)AdministratorConfiguration).AdminUsername = value ?? null; } - - /// - /// The SSH configuration for the operating systems that run the nodes in the Kubernetes cluster. In some cases, specification - /// of public keys may be required to produce a working environment. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey[] AdministratorConfigurationSshPublicKey { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministratorConfigurationInternal)AdministratorConfiguration).SshPublicKey; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministratorConfigurationInternal)AdministratorConfiguration).SshPublicKey = value ?? null /* arrayOf */; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentOptions _agentOption; - - /// The configurations that will be applied to each agent in this agent pool. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentOptions AgentOption { get => (this._agentOption = this._agentOption ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AgentOptions()); set => this._agentOption = value; } - - /// The number of hugepages to allocate. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public long? AgentOptionHugepagesCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentOptionsInternal)AgentOption).HugepagesCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentOptionsInternal)AgentOption).HugepagesCount = value ?? default(long); } - - /// The size of the hugepages to allocate. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HugepagesSize? AgentOptionHugepagesSize { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentOptionsInternal)AgentOption).HugepagesSize; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentOptionsInternal)AgentOption).HugepagesSize = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HugepagesSize)""); } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAttachedNetworkConfiguration _attachedNetworkConfiguration; - - /// - /// The configuration of networks being attached to the agent pool for use by the workloads that run on this Kubernetes cluster. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAttachedNetworkConfiguration AttachedNetworkConfiguration { get => (this._attachedNetworkConfiguration = this._attachedNetworkConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AttachedNetworkConfiguration()); set => this._attachedNetworkConfiguration = value; } - - /// The list of Layer 2 Networks and related configuration for attachment. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkAttachmentConfiguration[] AttachedNetworkConfigurationL2Network { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAttachedNetworkConfigurationInternal)AttachedNetworkConfiguration).L2Network; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAttachedNetworkConfigurationInternal)AttachedNetworkConfiguration).L2Network = value ?? null /* arrayOf */; } - - /// The list of Layer 3 Networks and related configuration for attachment. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkAttachmentConfiguration[] AttachedNetworkConfigurationL3Network { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAttachedNetworkConfigurationInternal)AttachedNetworkConfiguration).L3Network; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAttachedNetworkConfigurationInternal)AttachedNetworkConfiguration).L3Network = value ?? null /* arrayOf */; } - - /// The list of Trunked Networks and related configuration for attachment. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkAttachmentConfiguration[] AttachedNetworkConfigurationTrunkedNetwork { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAttachedNetworkConfigurationInternal)AttachedNetworkConfiguration).TrunkedNetwork; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAttachedNetworkConfigurationInternal)AttachedNetworkConfiguration).TrunkedNetwork = value ?? null /* arrayOf */; } - - /// Backing field for property. - private string[] _availabilityZone; - - /// - /// The list of availability zones of the Network Cloud cluster used for the provisioning of nodes in this agent pool. If - /// not specified, all availability zones will be used. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string[] AvailabilityZone { get => this._availabilityZone; set => this._availabilityZone = value; } - - /// Backing field for property. - private long _count; - - /// The number of virtual machines that use this configuration. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public long Count { get => this._count; set => this._count = value; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.AgentPoolDetailedStatus? _detailedStatus; - - /// The current status of the agent pool. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.AgentPoolDetailedStatus? DetailedStatus { get => this._detailedStatus; } - - /// Backing field for property. - private string _detailedStatusMessage; - - /// The descriptive message about the current detailed status. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string DetailedStatusMessage { get => this._detailedStatusMessage; } - - /// Backing field for property. - private string _kubernetesVersion; - - /// The Kubernetes version running in this agent pool. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string KubernetesVersion { get => this._kubernetesVersion; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesLabel[] _label; - - /// The labels applied to the nodes in this agent pool. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesLabel[] Label { get => this._label; set => this._label = value; } - - /// Internal Acessors for AdministratorConfiguration - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministratorConfiguration Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPropertiesInternal.AdministratorConfiguration { get => (this._administratorConfiguration = this._administratorConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AdministratorConfiguration()); set { {_administratorConfiguration = value;} } } - - /// Internal Acessors for AgentOption - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentOptions Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPropertiesInternal.AgentOption { get => (this._agentOption = this._agentOption ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AgentOptions()); set { {_agentOption = value;} } } - - /// Internal Acessors for AttachedNetworkConfiguration - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAttachedNetworkConfiguration Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPropertiesInternal.AttachedNetworkConfiguration { get => (this._attachedNetworkConfiguration = this._attachedNetworkConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AttachedNetworkConfiguration()); set { {_attachedNetworkConfiguration = value;} } } - - /// Internal Acessors for DetailedStatus - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.AgentPoolDetailedStatus? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPropertiesInternal.DetailedStatus { get => this._detailedStatus; set { {_detailedStatus = value;} } } - - /// Internal Acessors for DetailedStatusMessage - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPropertiesInternal.DetailedStatusMessage { get => this._detailedStatusMessage; set { {_detailedStatusMessage = value;} } } - - /// Internal Acessors for KubernetesVersion - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPropertiesInternal.KubernetesVersion { get => this._kubernetesVersion; set { {_kubernetesVersion = value;} } } - - /// Internal Acessors for ProvisioningState - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.AgentPoolProvisioningState? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPropertiesInternal.ProvisioningState { get => this._provisioningState; set { {_provisioningState = value;} } } - - /// Internal Acessors for UpgradeSetting - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolUpgradeSettings Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPropertiesInternal.UpgradeSetting { get => (this._upgradeSetting = this._upgradeSetting ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AgentPoolUpgradeSettings()); set { {_upgradeSetting = value;} } } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.AgentPoolMode _mode; - - /// - /// The selection of how this agent pool is utilized, either as a system pool or a user pool. System pools run the features - /// and critical services for the Kubernetes Cluster, while user pools are dedicated to user workloads. Every Kubernetes cluster - /// must contain at least one system node pool with at least one node. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.AgentPoolMode Mode { get => this._mode; set => this._mode = value; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.AgentPoolProvisioningState? _provisioningState; - - /// The provisioning state of the agent pool. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.AgentPoolProvisioningState? ProvisioningState { get => this._provisioningState; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesLabel[] _taint; - - /// The taints applied to the nodes in this agent pool. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesLabel[] Taint { get => this._taint; set => this._taint = value; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolUpgradeSettings _upgradeSetting; - - /// The configuration of the agent pool. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolUpgradeSettings UpgradeSetting { get => (this._upgradeSetting = this._upgradeSetting ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AgentPoolUpgradeSettings()); set => this._upgradeSetting = value; } - - /// - /// The maximum time in seconds that is allowed for a node drain to complete before proceeding with the upgrade of the agent - /// pool. If not specified during creation, a value of 1800 seconds is used. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public long? UpgradeSettingDrainTimeout { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolUpgradeSettingsInternal)UpgradeSetting).DrainTimeout; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolUpgradeSettingsInternal)UpgradeSetting).DrainTimeout = value ?? default(long); } - - /// - /// The maximum number or percentage of nodes that are surged during upgrade. This can either be set to an integer (e.g. '5') - /// or a percentage (e.g. '50%'). If a percentage is specified, it is the percentage of the total agent pool size at the time - /// of the upgrade. For percentages, fractional nodes are rounded up. If not specified during creation, a value of 1 is used. - /// One of MaxSurge and MaxUnavailable must be greater than 0. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string UpgradeSettingMaxSurge { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolUpgradeSettingsInternal)UpgradeSetting).MaxSurge; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolUpgradeSettingsInternal)UpgradeSetting).MaxSurge = value ?? null; } - - /// - /// The maximum number or percentage of nodes that can be unavailable during upgrade. This can either be set to an integer - /// (e.g. '5') or a percentage (e.g. '50%'). If a percentage is specified, it is the percentage of the total agent pool size - /// at the time of the upgrade. For percentages, fractional nodes are rounded up. If not specified during creation, a value - /// of 0 is used. One of MaxSurge and MaxUnavailable must be greater than 0. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string UpgradeSettingMaxUnavailable { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolUpgradeSettingsInternal)UpgradeSetting).MaxUnavailable; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolUpgradeSettingsInternal)UpgradeSetting).MaxUnavailable = value ?? null; } - - /// Backing field for property. - private string _vMSkuName; - - /// - /// The name of the VM SKU that determines the size of resources allocated for node VMs. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string VMSkuName { get => this._vMSkuName; set => this._vMSkuName = value; } - - /// Creates an new instance. - public AgentPoolProperties() - { - - } - } - /// AgentPoolProperties represents the properties of the Kubernetes cluster agent pool. - public partial interface IAgentPoolProperties : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable - { - /// - /// The user name for the administrator that will be applied to the operating systems that run Kubernetes nodes. If not supplied, - /// a user name will be chosen by the service. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The user name for the administrator that will be applied to the operating systems that run Kubernetes nodes. If not supplied, a user name will be chosen by the service.", - SerializedName = @"adminUsername", - PossibleTypes = new [] { typeof(string) })] - string AdministratorConfigurationAdminUsername { get; set; } - /// - /// The SSH configuration for the operating systems that run the nodes in the Kubernetes cluster. In some cases, specification - /// of public keys may be required to produce a working environment. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The SSH configuration for the operating systems that run the nodes in the Kubernetes cluster. In some cases, specification of public keys may be required to produce a working environment.", - SerializedName = @"sshPublicKeys", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey[] AdministratorConfigurationSshPublicKey { get; set; } - /// The number of hugepages to allocate. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The number of hugepages to allocate.", - SerializedName = @"hugepagesCount", - PossibleTypes = new [] { typeof(long) })] - long? AgentOptionHugepagesCount { get; set; } - /// The size of the hugepages to allocate. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The size of the hugepages to allocate.", - SerializedName = @"hugepagesSize", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HugepagesSize) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HugepagesSize? AgentOptionHugepagesSize { get; set; } - /// The list of Layer 2 Networks and related configuration for attachment. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The list of Layer 2 Networks and related configuration for attachment.", - SerializedName = @"l2Networks", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkAttachmentConfiguration) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkAttachmentConfiguration[] AttachedNetworkConfigurationL2Network { get; set; } - /// The list of Layer 3 Networks and related configuration for attachment. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The list of Layer 3 Networks and related configuration for attachment.", - SerializedName = @"l3Networks", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkAttachmentConfiguration) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkAttachmentConfiguration[] AttachedNetworkConfigurationL3Network { get; set; } - /// The list of Trunked Networks and related configuration for attachment. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The list of Trunked Networks and related configuration for attachment.", - SerializedName = @"trunkedNetworks", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkAttachmentConfiguration) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkAttachmentConfiguration[] AttachedNetworkConfigurationTrunkedNetwork { get; set; } - /// - /// The list of availability zones of the Network Cloud cluster used for the provisioning of nodes in this agent pool. If - /// not specified, all availability zones will be used. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The list of availability zones of the Network Cloud cluster used for the provisioning of nodes in this agent pool. If not specified, all availability zones will be used.", - SerializedName = @"availabilityZones", - PossibleTypes = new [] { typeof(string) })] - string[] AvailabilityZone { get; set; } - /// The number of virtual machines that use this configuration. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The number of virtual machines that use this configuration.", - SerializedName = @"count", - PossibleTypes = new [] { typeof(long) })] - long Count { get; set; } - /// The current status of the agent pool. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The current status of the agent pool.", - SerializedName = @"detailedStatus", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.AgentPoolDetailedStatus) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.AgentPoolDetailedStatus? DetailedStatus { get; } - /// The descriptive message about the current detailed status. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The descriptive message about the current detailed status.", - SerializedName = @"detailedStatusMessage", - PossibleTypes = new [] { typeof(string) })] - string DetailedStatusMessage { get; } - /// The Kubernetes version running in this agent pool. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The Kubernetes version running in this agent pool.", - SerializedName = @"kubernetesVersion", - PossibleTypes = new [] { typeof(string) })] - string KubernetesVersion { get; } - /// The labels applied to the nodes in this agent pool. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The labels applied to the nodes in this agent pool.", - SerializedName = @"labels", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesLabel) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesLabel[] Label { get; set; } - /// - /// The selection of how this agent pool is utilized, either as a system pool or a user pool. System pools run the features - /// and critical services for the Kubernetes Cluster, while user pools are dedicated to user workloads. Every Kubernetes cluster - /// must contain at least one system node pool with at least one node. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The selection of how this agent pool is utilized, either as a system pool or a user pool. System pools run the features and critical services for the Kubernetes Cluster, while user pools are dedicated to user workloads. Every Kubernetes cluster must contain at least one system node pool with at least one node.", - SerializedName = @"mode", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.AgentPoolMode) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.AgentPoolMode Mode { get; set; } - /// The provisioning state of the agent pool. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The provisioning state of the agent pool.", - SerializedName = @"provisioningState", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.AgentPoolProvisioningState) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.AgentPoolProvisioningState? ProvisioningState { get; } - /// The taints applied to the nodes in this agent pool. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The taints applied to the nodes in this agent pool.", - SerializedName = @"taints", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesLabel) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesLabel[] Taint { get; set; } - /// - /// The maximum time in seconds that is allowed for a node drain to complete before proceeding with the upgrade of the agent - /// pool. If not specified during creation, a value of 1800 seconds is used. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The maximum time in seconds that is allowed for a node drain to complete before proceeding with the upgrade of the agent pool. If not specified during creation, a value of 1800 seconds is used.", - SerializedName = @"drainTimeout", - PossibleTypes = new [] { typeof(long) })] - long? UpgradeSettingDrainTimeout { get; set; } - /// - /// The maximum number or percentage of nodes that are surged during upgrade. This can either be set to an integer (e.g. '5') - /// or a percentage (e.g. '50%'). If a percentage is specified, it is the percentage of the total agent pool size at the time - /// of the upgrade. For percentages, fractional nodes are rounded up. If not specified during creation, a value of 1 is used. - /// One of MaxSurge and MaxUnavailable must be greater than 0. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The maximum number or percentage of nodes that are surged during upgrade. This can either be set to an integer (e.g. '5') or a percentage (e.g. '50%'). If a percentage is specified, it is the percentage of the total agent pool size at the time of the upgrade. For percentages, fractional nodes are rounded up. If not specified during creation, a value of 1 is used. One of MaxSurge and MaxUnavailable must be greater than 0.", - SerializedName = @"maxSurge", - PossibleTypes = new [] { typeof(string) })] - string UpgradeSettingMaxSurge { get; set; } - /// - /// The maximum number or percentage of nodes that can be unavailable during upgrade. This can either be set to an integer - /// (e.g. '5') or a percentage (e.g. '50%'). If a percentage is specified, it is the percentage of the total agent pool size - /// at the time of the upgrade. For percentages, fractional nodes are rounded up. If not specified during creation, a value - /// of 0 is used. One of MaxSurge and MaxUnavailable must be greater than 0. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The maximum number or percentage of nodes that can be unavailable during upgrade. This can either be set to an integer (e.g. '5') or a percentage (e.g. '50%'). If a percentage is specified, it is the percentage of the total agent pool size at the time of the upgrade. For percentages, fractional nodes are rounded up. If not specified during creation, a value of 0 is used. One of MaxSurge and MaxUnavailable must be greater than 0.", - SerializedName = @"maxUnavailable", - PossibleTypes = new [] { typeof(string) })] - string UpgradeSettingMaxUnavailable { get; set; } - /// - /// The name of the VM SKU that determines the size of resources allocated for node VMs. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The name of the VM SKU that determines the size of resources allocated for node VMs.", - SerializedName = @"vmSkuName", - PossibleTypes = new [] { typeof(string) })] - string VMSkuName { get; set; } - - } - /// AgentPoolProperties represents the properties of the Kubernetes cluster agent pool. - internal partial interface IAgentPoolPropertiesInternal - - { - /// The administrator credentials to be used for the nodes in this agent pool. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministratorConfiguration AdministratorConfiguration { get; set; } - /// - /// The user name for the administrator that will be applied to the operating systems that run Kubernetes nodes. If not supplied, - /// a user name will be chosen by the service. - /// - string AdministratorConfigurationAdminUsername { get; set; } - /// - /// The SSH configuration for the operating systems that run the nodes in the Kubernetes cluster. In some cases, specification - /// of public keys may be required to produce a working environment. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey[] AdministratorConfigurationSshPublicKey { get; set; } - /// The configurations that will be applied to each agent in this agent pool. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentOptions AgentOption { get; set; } - /// The number of hugepages to allocate. - long? AgentOptionHugepagesCount { get; set; } - /// The size of the hugepages to allocate. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HugepagesSize? AgentOptionHugepagesSize { get; set; } - /// - /// The configuration of networks being attached to the agent pool for use by the workloads that run on this Kubernetes cluster. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAttachedNetworkConfiguration AttachedNetworkConfiguration { get; set; } - /// The list of Layer 2 Networks and related configuration for attachment. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkAttachmentConfiguration[] AttachedNetworkConfigurationL2Network { get; set; } - /// The list of Layer 3 Networks and related configuration for attachment. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkAttachmentConfiguration[] AttachedNetworkConfigurationL3Network { get; set; } - /// The list of Trunked Networks and related configuration for attachment. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkAttachmentConfiguration[] AttachedNetworkConfigurationTrunkedNetwork { get; set; } - /// - /// The list of availability zones of the Network Cloud cluster used for the provisioning of nodes in this agent pool. If - /// not specified, all availability zones will be used. - /// - string[] AvailabilityZone { get; set; } - /// The number of virtual machines that use this configuration. - long Count { get; set; } - /// The current status of the agent pool. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.AgentPoolDetailedStatus? DetailedStatus { get; set; } - /// The descriptive message about the current detailed status. - string DetailedStatusMessage { get; set; } - /// The Kubernetes version running in this agent pool. - string KubernetesVersion { get; set; } - /// The labels applied to the nodes in this agent pool. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesLabel[] Label { get; set; } - /// - /// The selection of how this agent pool is utilized, either as a system pool or a user pool. System pools run the features - /// and critical services for the Kubernetes Cluster, while user pools are dedicated to user workloads. Every Kubernetes cluster - /// must contain at least one system node pool with at least one node. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.AgentPoolMode Mode { get; set; } - /// The provisioning state of the agent pool. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.AgentPoolProvisioningState? ProvisioningState { get; set; } - /// The taints applied to the nodes in this agent pool. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesLabel[] Taint { get; set; } - /// The configuration of the agent pool. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolUpgradeSettings UpgradeSetting { get; set; } - /// - /// The maximum time in seconds that is allowed for a node drain to complete before proceeding with the upgrade of the agent - /// pool. If not specified during creation, a value of 1800 seconds is used. - /// - long? UpgradeSettingDrainTimeout { get; set; } - /// - /// The maximum number or percentage of nodes that are surged during upgrade. This can either be set to an integer (e.g. '5') - /// or a percentage (e.g. '50%'). If a percentage is specified, it is the percentage of the total agent pool size at the time - /// of the upgrade. For percentages, fractional nodes are rounded up. If not specified during creation, a value of 1 is used. - /// One of MaxSurge and MaxUnavailable must be greater than 0. - /// - string UpgradeSettingMaxSurge { get; set; } - /// - /// The maximum number or percentage of nodes that can be unavailable during upgrade. This can either be set to an integer - /// (e.g. '5') or a percentage (e.g. '50%'). If a percentage is specified, it is the percentage of the total agent pool size - /// at the time of the upgrade. For percentages, fractional nodes are rounded up. If not specified during creation, a value - /// of 0 is used. One of MaxSurge and MaxUnavailable must be greater than 0. - /// - string UpgradeSettingMaxUnavailable { get; set; } - /// - /// The name of the VM SKU that determines the size of resources allocated for node VMs. - /// - string VMSkuName { get; set; } - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AgentPoolProperties.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AgentPoolProperties.json.cs deleted file mode 100644 index be6dfaa2ca33..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AgentPoolProperties.json.cs +++ /dev/null @@ -1,172 +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.NetworkCloud.Models.Api20250201 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; - - /// - /// AgentPoolProperties represents the properties of the Kubernetes cluster agent pool. - /// - public partial class AgentPoolProperties - { - - /// - /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object - /// before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The JsonNode that should be deserialized into this object. - - partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json); - - /// - /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The JSON container that the serialization result will be placed in. - - partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container); - - /// - /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of - /// the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the - /// output parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The JsonNode that should be deserialized into this object. - /// Determines if the rest of the deserialization should be processed, or if the method should return - /// instantly. - - partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json, ref bool returnNow); - - /// - /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the - /// object before it is serialized. - /// If you wish to disable the default serialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The JSON container that the serialization result will be placed in. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, ref bool returnNow); - - /// - /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject into a new instance of . - /// - /// A Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject instance to deserialize from. - internal AgentPoolProperties(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) - { - bool returnNow = false; - BeforeFromJson(json, ref returnNow); - if (returnNow) - { - return; - } - {_administratorConfiguration = If( json?.PropertyT("administratorConfiguration"), out var __jsonAdministratorConfiguration) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AdministratorConfiguration.FromJson(__jsonAdministratorConfiguration) : AdministratorConfiguration;} - {_agentOption = If( json?.PropertyT("agentOptions"), out var __jsonAgentOptions) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AgentOptions.FromJson(__jsonAgentOptions) : AgentOption;} - {_attachedNetworkConfiguration = If( json?.PropertyT("attachedNetworkConfiguration"), out var __jsonAttachedNetworkConfiguration) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AttachedNetworkConfiguration.FromJson(__jsonAttachedNetworkConfiguration) : AttachedNetworkConfiguration;} - {_upgradeSetting = If( json?.PropertyT("upgradeSettings"), out var __jsonUpgradeSettings) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AgentPoolUpgradeSettings.FromJson(__jsonUpgradeSettings) : UpgradeSetting;} - {_availabilityZone = If( json?.PropertyT("availabilityZones"), out var __jsonAvailabilityZones) ? If( __jsonAvailabilityZones as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : AvailabilityZone;} - {_count = If( json?.PropertyT("count"), out var __jsonCount) ? (long)__jsonCount : Count;} - {_detailedStatus = If( json?.PropertyT("detailedStatus"), out var __jsonDetailedStatus) ? (string)__jsonDetailedStatus : (string)DetailedStatus;} - {_detailedStatusMessage = If( json?.PropertyT("detailedStatusMessage"), out var __jsonDetailedStatusMessage) ? (string)__jsonDetailedStatusMessage : (string)DetailedStatusMessage;} - {_kubernetesVersion = If( json?.PropertyT("kubernetesVersion"), out var __jsonKubernetesVersion) ? (string)__jsonKubernetesVersion : (string)KubernetesVersion;} - {_label = If( json?.PropertyT("labels"), out var __jsonLabels) ? If( __jsonLabels as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IKubernetesLabel) (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.KubernetesLabel.FromJson(__p) )) ))() : null : Label;} - {_mode = If( json?.PropertyT("mode"), out var __jsonMode) ? (string)__jsonMode : (string)Mode;} - {_provisioningState = If( json?.PropertyT("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)ProvisioningState;} - {_taint = If( json?.PropertyT("taints"), out var __jsonTaints) ? If( __jsonTaints as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonArray, out var __l) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__l, (__k)=>(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesLabel) (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.KubernetesLabel.FromJson(__k) )) ))() : null : Taint;} - {_vMSkuName = If( json?.PropertyT("vmSkuName"), out var __jsonVMSkuName) ? (string)__jsonVMSkuName : (string)VMSkuName;} - AfterFromJson(json); - } - - /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolProperties. - /// - /// a to deserialize from. - /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolProperties. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) - { - return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new AgentPoolProperties(json) : null; - } - - /// - /// Serializes this instance of into a . - /// - /// The container to serialize this object into. If the caller - /// passes in null, a new instance will be created and returned to the caller. - /// Allows the caller to choose the depth of the serialization. See . - /// - /// a serialized instance of as a . - /// - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode) - { - container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject(); - - bool returnNow = false; - BeforeToJson(ref container, ref returnNow); - if (returnNow) - { - return container; - } - AddIf( null != this._administratorConfiguration ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) this._administratorConfiguration.ToJson(null,serializationMode) : null, "administratorConfiguration" ,container.Add ); - AddIf( null != this._agentOption ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) this._agentOption.ToJson(null,serializationMode) : null, "agentOptions" ,container.Add ); - AddIf( null != this._attachedNetworkConfiguration ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) this._attachedNetworkConfiguration.ToJson(null,serializationMode) : null, "attachedNetworkConfiguration" ,container.Add ); - AddIf( null != this._upgradeSetting ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) this._upgradeSetting.ToJson(null,serializationMode) : null, "upgradeSettings" ,container.Add ); - if (null != this._availabilityZone) - { - var __w = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.XNodeArray(); - foreach( var __x in this._availabilityZone ) - { - AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); - } - container.Add("availabilityZones",__w); - } - AddIf( (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNumber(this._count), "count" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) - { - AddIf( null != (((object)this._detailedStatus)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._detailedStatus.ToString()) : null, "detailedStatus" ,container.Add ); - } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) - { - AddIf( null != (((object)this._detailedStatusMessage)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._detailedStatusMessage.ToString()) : null, "detailedStatusMessage" ,container.Add ); - } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) - { - AddIf( null != (((object)this._kubernetesVersion)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._kubernetesVersion.ToString()) : null, "kubernetesVersion" ,container.Add ); - } - if (null != this._label) - { - var __r = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.XNodeArray(); - foreach( var __s in this._label ) - { - AddIf(__s?.ToJson(null, serializationMode) ,__r.Add); - } - container.Add("labels",__r); - } - AddIf( null != (((object)this._mode)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._mode.ToString()) : null, "mode" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) - { - AddIf( null != (((object)this._provisioningState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._provisioningState.ToString()) : null, "provisioningState" ,container.Add ); - } - if (null != this._taint) - { - var __m = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.XNodeArray(); - foreach( var __n in this._taint ) - { - AddIf(__n?.ToJson(null, serializationMode) ,__m.Add); - } - container.Add("taints",__m); - } - AddIf( null != (((object)this._vMSkuName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._vMSkuName.ToString()) : null, "vmSkuName" ,container.Add ); - AfterToJson(ref container); - return container; - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AnalyticsOutputSettings.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AnalyticsOutputSettings.PowerShell.cs deleted file mode 100644 index 777465590154..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AnalyticsOutputSettings.PowerShell.cs +++ /dev/null @@ -1,192 +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.NetworkCloud.Models.Api20250201 -{ - using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; - - /// - /// AnalyticsOutputSettings represents the settings for the log analytics workspace used for output of logs from this cluster. - /// - [System.ComponentModel.TypeConverter(typeof(AnalyticsOutputSettingsTypeConverter))] - public partial class AnalyticsOutputSettings - { - - /// - /// 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 AnalyticsOutputSettings(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("AssociatedIdentity")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAnalyticsOutputSettingsInternal)this).AssociatedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIdentitySelector) content.GetValueForProperty("AssociatedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAnalyticsOutputSettingsInternal)this).AssociatedIdentity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IdentitySelectorTypeConverter.ConvertFrom); - } - if (content.Contains("AnalyticsWorkspaceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAnalyticsOutputSettingsInternal)this).AnalyticsWorkspaceId = (string) content.GetValueForProperty("AnalyticsWorkspaceId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAnalyticsOutputSettingsInternal)this).AnalyticsWorkspaceId, global::System.Convert.ToString); - } - if (content.Contains("AssociatedIdentityType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAnalyticsOutputSettingsInternal)this).AssociatedIdentityType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType?) content.GetValueForProperty("AssociatedIdentityType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAnalyticsOutputSettingsInternal)this).AssociatedIdentityType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType.CreateFrom); - } - if (content.Contains("AssociatedIdentityUserAssignedIdentityResourceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAnalyticsOutputSettingsInternal)this).AssociatedIdentityUserAssignedIdentityResourceId = (string) content.GetValueForProperty("AssociatedIdentityUserAssignedIdentityResourceId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAnalyticsOutputSettingsInternal)this).AssociatedIdentityUserAssignedIdentityResourceId, 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 AnalyticsOutputSettings(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("AssociatedIdentity")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAnalyticsOutputSettingsInternal)this).AssociatedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIdentitySelector) content.GetValueForProperty("AssociatedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAnalyticsOutputSettingsInternal)this).AssociatedIdentity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IdentitySelectorTypeConverter.ConvertFrom); - } - if (content.Contains("AnalyticsWorkspaceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAnalyticsOutputSettingsInternal)this).AnalyticsWorkspaceId = (string) content.GetValueForProperty("AnalyticsWorkspaceId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAnalyticsOutputSettingsInternal)this).AnalyticsWorkspaceId, global::System.Convert.ToString); - } - if (content.Contains("AssociatedIdentityType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAnalyticsOutputSettingsInternal)this).AssociatedIdentityType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType?) content.GetValueForProperty("AssociatedIdentityType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAnalyticsOutputSettingsInternal)this).AssociatedIdentityType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType.CreateFrom); - } - if (content.Contains("AssociatedIdentityUserAssignedIdentityResourceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAnalyticsOutputSettingsInternal)this).AssociatedIdentityUserAssignedIdentityResourceId = (string) content.GetValueForProperty("AssociatedIdentityUserAssignedIdentityResourceId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAnalyticsOutputSettingsInternal)this).AssociatedIdentityUserAssignedIdentityResourceId, 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.NetworkCloud.Models.Api20250201.IAnalyticsOutputSettings DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new AnalyticsOutputSettings(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.NetworkCloud.Models.Api20250201.IAnalyticsOutputSettings DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new AnalyticsOutputSettings(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.NetworkCloud.Models.Api20250201.IAnalyticsOutputSettings FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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(); - } - } - /// AnalyticsOutputSettings represents the settings for the log analytics workspace used for output of logs from this cluster. - [System.ComponentModel.TypeConverter(typeof(AnalyticsOutputSettingsTypeConverter))] - public partial interface IAnalyticsOutputSettings - - { - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AnalyticsOutputSettings.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AnalyticsOutputSettings.cs deleted file mode 100644 index 9b1768c8a813..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AnalyticsOutputSettings.cs +++ /dev/null @@ -1,111 +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.NetworkCloud.Models.Api20250201 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; - - /// - /// AnalyticsOutputSettings represents the settings for the log analytics workspace used for output of logs from this cluster. - /// - public partial class AnalyticsOutputSettings : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAnalyticsOutputSettings, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAnalyticsOutputSettingsInternal - { - - /// Backing field for property. - private string _analyticsWorkspaceId; - - /// - /// The resource ID of the analytics workspace that is to be used by the specified identity. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string AnalyticsWorkspaceId { get => this._analyticsWorkspaceId; set => this._analyticsWorkspaceId = value; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIdentitySelector _associatedIdentity; - - /// - /// The selection of the managed identity to use with this analytics workspace. The identity type must be either system assigned - /// or user assigned. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIdentitySelector AssociatedIdentity { get => (this._associatedIdentity = this._associatedIdentity ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IdentitySelector()); set => this._associatedIdentity = value; } - - /// The type of managed identity that is being selected. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType? AssociatedIdentityType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIdentitySelectorInternal)AssociatedIdentity).IdentityType; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIdentitySelectorInternal)AssociatedIdentity).IdentityType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType)""); } - - /// - /// The user assigned managed identity resource ID to use. Mutually exclusive with a system assigned identity type. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string AssociatedIdentityUserAssignedIdentityResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIdentitySelectorInternal)AssociatedIdentity).UserAssignedIdentityResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIdentitySelectorInternal)AssociatedIdentity).UserAssignedIdentityResourceId = value ?? null; } - - /// Internal Acessors for AssociatedIdentity - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIdentitySelector Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAnalyticsOutputSettingsInternal.AssociatedIdentity { get => (this._associatedIdentity = this._associatedIdentity ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IdentitySelector()); set { {_associatedIdentity = value;} } } - - /// Creates an new instance. - public AnalyticsOutputSettings() - { - - } - } - /// AnalyticsOutputSettings represents the settings for the log analytics workspace used for output of logs from this cluster. - public partial interface IAnalyticsOutputSettings : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable - { - /// - /// The resource ID of the analytics workspace that is to be used by the specified identity. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The resource ID of the analytics workspace that is to be used by the specified identity.", - SerializedName = @"analyticsWorkspaceId", - PossibleTypes = new [] { typeof(string) })] - string AnalyticsWorkspaceId { get; set; } - /// The type of managed identity that is being selected. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The type of managed identity that is being selected.", - SerializedName = @"identityType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType? AssociatedIdentityType { get; set; } - /// - /// The user assigned managed identity resource ID to use. Mutually exclusive with a system assigned identity type. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The user assigned managed identity resource ID to use. Mutually exclusive with a system assigned identity type.", - SerializedName = @"userAssignedIdentityResourceId", - PossibleTypes = new [] { typeof(string) })] - string AssociatedIdentityUserAssignedIdentityResourceId { get; set; } - - } - /// AnalyticsOutputSettings represents the settings for the log analytics workspace used for output of logs from this cluster. - internal partial interface IAnalyticsOutputSettingsInternal - - { - /// - /// The resource ID of the analytics workspace that is to be used by the specified identity. - /// - string AnalyticsWorkspaceId { get; set; } - /// - /// The selection of the managed identity to use with this analytics workspace. The identity type must be either system assigned - /// or user assigned. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIdentitySelector AssociatedIdentity { get; set; } - /// The type of managed identity that is being selected. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType? AssociatedIdentityType { get; set; } - /// - /// The user assigned managed identity resource ID to use. Mutually exclusive with a system assigned identity type. - /// - string AssociatedIdentityUserAssignedIdentityResourceId { get; set; } - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AttachedNetworkConfiguration.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AttachedNetworkConfiguration.PowerShell.cs deleted file mode 100644 index 47929ec98273..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AttachedNetworkConfiguration.PowerShell.cs +++ /dev/null @@ -1,184 +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.NetworkCloud.Models.Api20250201 -{ - using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; - - /// - /// AttachedNetworkConfiguration represents the set of workload networks to attach to a resource. - /// - [System.ComponentModel.TypeConverter(typeof(AttachedNetworkConfigurationTypeConverter))] - public partial class AttachedNetworkConfiguration - { - - /// - /// 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 AttachedNetworkConfiguration(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("L2Network")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAttachedNetworkConfigurationInternal)this).L2Network = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkAttachmentConfiguration[]) content.GetValueForProperty("L2Network",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAttachedNetworkConfigurationInternal)this).L2Network, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.L2NetworkAttachmentConfigurationTypeConverter.ConvertFrom)); - } - if (content.Contains("L3Network")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAttachedNetworkConfigurationInternal)this).L3Network = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkAttachmentConfiguration[]) content.GetValueForProperty("L3Network",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAttachedNetworkConfigurationInternal)this).L3Network, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.L3NetworkAttachmentConfigurationTypeConverter.ConvertFrom)); - } - if (content.Contains("TrunkedNetwork")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAttachedNetworkConfigurationInternal)this).TrunkedNetwork = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkAttachmentConfiguration[]) content.GetValueForProperty("TrunkedNetwork",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAttachedNetworkConfigurationInternal)this).TrunkedNetwork, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.TrunkedNetworkAttachmentConfigurationTypeConverter.ConvertFrom)); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal AttachedNetworkConfiguration(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("L2Network")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAttachedNetworkConfigurationInternal)this).L2Network = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkAttachmentConfiguration[]) content.GetValueForProperty("L2Network",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAttachedNetworkConfigurationInternal)this).L2Network, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.L2NetworkAttachmentConfigurationTypeConverter.ConvertFrom)); - } - if (content.Contains("L3Network")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAttachedNetworkConfigurationInternal)this).L3Network = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkAttachmentConfiguration[]) content.GetValueForProperty("L3Network",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAttachedNetworkConfigurationInternal)this).L3Network, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.L3NetworkAttachmentConfigurationTypeConverter.ConvertFrom)); - } - if (content.Contains("TrunkedNetwork")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAttachedNetworkConfigurationInternal)this).TrunkedNetwork = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkAttachmentConfiguration[]) content.GetValueForProperty("TrunkedNetwork",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAttachedNetworkConfigurationInternal)this).TrunkedNetwork, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.TrunkedNetworkAttachmentConfigurationTypeConverter.ConvertFrom)); - } - AfterDeserializePSObject(content); - } - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAttachedNetworkConfiguration DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new AttachedNetworkConfiguration(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.NetworkCloud.Models.Api20250201.IAttachedNetworkConfiguration DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new AttachedNetworkConfiguration(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.NetworkCloud.Models.Api20250201.IAttachedNetworkConfiguration FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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(); - } - } - /// AttachedNetworkConfiguration represents the set of workload networks to attach to a resource. - [System.ComponentModel.TypeConverter(typeof(AttachedNetworkConfigurationTypeConverter))] - public partial interface IAttachedNetworkConfiguration - - { - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AttachedNetworkConfiguration.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AttachedNetworkConfiguration.cs deleted file mode 100644 index f0d8bc4b916b..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AttachedNetworkConfiguration.cs +++ /dev/null @@ -1,87 +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.NetworkCloud.Models.Api20250201 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; - - /// - /// AttachedNetworkConfiguration represents the set of workload networks to attach to a resource. - /// - public partial class AttachedNetworkConfiguration : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAttachedNetworkConfiguration, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAttachedNetworkConfigurationInternal - { - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkAttachmentConfiguration[] _l2Network; - - /// The list of Layer 2 Networks and related configuration for attachment. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkAttachmentConfiguration[] L2Network { get => this._l2Network; set => this._l2Network = value; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkAttachmentConfiguration[] _l3Network; - - /// The list of Layer 3 Networks and related configuration for attachment. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkAttachmentConfiguration[] L3Network { get => this._l3Network; set => this._l3Network = value; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkAttachmentConfiguration[] _trunkedNetwork; - - /// The list of Trunked Networks and related configuration for attachment. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkAttachmentConfiguration[] TrunkedNetwork { get => this._trunkedNetwork; set => this._trunkedNetwork = value; } - - /// Creates an new instance. - public AttachedNetworkConfiguration() - { - - } - } - /// AttachedNetworkConfiguration represents the set of workload networks to attach to a resource. - public partial interface IAttachedNetworkConfiguration : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable - { - /// The list of Layer 2 Networks and related configuration for attachment. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The list of Layer 2 Networks and related configuration for attachment.", - SerializedName = @"l2Networks", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkAttachmentConfiguration) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkAttachmentConfiguration[] L2Network { get; set; } - /// The list of Layer 3 Networks and related configuration for attachment. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The list of Layer 3 Networks and related configuration for attachment.", - SerializedName = @"l3Networks", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkAttachmentConfiguration) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkAttachmentConfiguration[] L3Network { get; set; } - /// The list of Trunked Networks and related configuration for attachment. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The list of Trunked Networks and related configuration for attachment.", - SerializedName = @"trunkedNetworks", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkAttachmentConfiguration) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkAttachmentConfiguration[] TrunkedNetwork { get; set; } - - } - /// AttachedNetworkConfiguration represents the set of workload networks to attach to a resource. - internal partial interface IAttachedNetworkConfigurationInternal - - { - /// The list of Layer 2 Networks and related configuration for attachment. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkAttachmentConfiguration[] L2Network { get; set; } - /// The list of Layer 3 Networks and related configuration for attachment. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkAttachmentConfiguration[] L3Network { get; set; } - /// The list of Trunked Networks and related configuration for attachment. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkAttachmentConfiguration[] TrunkedNetwork { get; set; } - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AttachedNetworkConfiguration.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AttachedNetworkConfiguration.json.cs deleted file mode 100644 index 45710f6ddef4..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AttachedNetworkConfiguration.json.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.NetworkCloud.Models.Api20250201 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; - - /// - /// AttachedNetworkConfiguration represents the set of workload networks to attach to a resource. - /// - public partial class AttachedNetworkConfiguration - { - - /// - /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object - /// before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The JsonNode that should be deserialized into this object. - - partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json); - - /// - /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The JSON container that the serialization result will be placed in. - - partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container); - - /// - /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of - /// the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the - /// output parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The JsonNode that should be deserialized into this object. - /// Determines if the rest of the deserialization should be processed, or if the method should return - /// instantly. - - partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json, ref bool returnNow); - - /// - /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the - /// object before it is serialized. - /// If you wish to disable the default serialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The JSON container that the serialization result will be placed in. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, ref bool returnNow); - - /// - /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject into a new instance of . - /// - /// A Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject instance to deserialize from. - internal AttachedNetworkConfiguration(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) - { - bool returnNow = false; - BeforeFromJson(json, ref returnNow); - if (returnNow) - { - return; - } - {_l2Network = If( json?.PropertyT("l2Networks"), out var __jsonL2Networks) ? If( __jsonL2Networks as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IL2NetworkAttachmentConfiguration) (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.L2NetworkAttachmentConfiguration.FromJson(__u) )) ))() : null : L2Network;} - {_l3Network = If( json?.PropertyT("l3Networks"), out var __jsonL3Networks) ? If( __jsonL3Networks as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IL3NetworkAttachmentConfiguration) (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.L3NetworkAttachmentConfiguration.FromJson(__p) )) ))() : null : L3Network;} - {_trunkedNetwork = If( json?.PropertyT("trunkedNetworks"), out var __jsonTrunkedNetworks) ? If( __jsonTrunkedNetworks as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonArray, out var __l) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__l, (__k)=>(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkAttachmentConfiguration) (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.TrunkedNetworkAttachmentConfiguration.FromJson(__k) )) ))() : null : TrunkedNetwork;} - AfterFromJson(json); - } - - /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAttachedNetworkConfiguration. - /// - /// a to deserialize from. - /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAttachedNetworkConfiguration. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAttachedNetworkConfiguration FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) - { - return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new AttachedNetworkConfiguration(json) : null; - } - - /// - /// Serializes this instance of into a . - /// - /// The container to serialize this object into. If the caller - /// passes in null, a new instance will be created and returned to the caller. - /// Allows the caller to choose the depth of the serialization. See . - /// - /// a serialized instance of as a . - /// - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode) - { - container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject(); - - bool returnNow = false; - BeforeToJson(ref container, ref returnNow); - if (returnNow) - { - return container; - } - if (null != this._l2Network) - { - var __w = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.XNodeArray(); - foreach( var __x in this._l2Network ) - { - AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); - } - container.Add("l2Networks",__w); - } - if (null != this._l3Network) - { - var __r = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.XNodeArray(); - foreach( var __s in this._l3Network ) - { - AddIf(__s?.ToJson(null, serializationMode) ,__r.Add); - } - container.Add("l3Networks",__r); - } - if (null != this._trunkedNetwork) - { - var __m = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.XNodeArray(); - foreach( var __n in this._trunkedNetwork ) - { - AddIf(__n?.ToJson(null, serializationMode) ,__m.Add); - } - container.Add("trunkedNetworks",__m); - } - AfterToJson(ref container); - return container; - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AvailableUpgrade.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AvailableUpgrade.cs deleted file mode 100644 index eb84a6334dac..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AvailableUpgrade.cs +++ /dev/null @@ -1,74 +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.NetworkCloud.Models.Api20250201 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; - - /// AvailableUpgrade represents an upgrade available for a Kubernetes cluster. - public partial class AvailableUpgrade : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAvailableUpgrade, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAvailableUpgradeInternal - { - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.AvailabilityLifecycle? _availabilityLifecycle; - - /// The version lifecycle indicator. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.AvailabilityLifecycle? AvailabilityLifecycle { get => this._availabilityLifecycle; } - - /// Internal Acessors for AvailabilityLifecycle - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.AvailabilityLifecycle? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAvailableUpgradeInternal.AvailabilityLifecycle { get => this._availabilityLifecycle; set { {_availabilityLifecycle = value;} } } - - /// Internal Acessors for Version - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAvailableUpgradeInternal.Version { get => this._version; set { {_version = value;} } } - - /// Backing field for property. - private string _version; - - /// The version available for upgrading. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string Version { get => this._version; } - - /// Creates an new instance. - public AvailableUpgrade() - { - - } - } - /// AvailableUpgrade represents an upgrade available for a Kubernetes cluster. - public partial interface IAvailableUpgrade : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable - { - /// The version lifecycle indicator. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The version lifecycle indicator.", - SerializedName = @"availabilityLifecycle", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.AvailabilityLifecycle) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.AvailabilityLifecycle? AvailabilityLifecycle { get; } - /// The version available for upgrading. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The version available for upgrading.", - SerializedName = @"version", - PossibleTypes = new [] { typeof(string) })] - string Version { get; } - - } - /// AvailableUpgrade represents an upgrade available for a Kubernetes cluster. - internal partial interface IAvailableUpgradeInternal - - { - /// The version lifecycle indicator. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.AvailabilityLifecycle? AvailabilityLifecycle { get; set; } - /// The version available for upgrading. - string Version { get; set; } - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachine.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachine.PowerShell.cs deleted file mode 100644 index 133a5f4fffe5..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachine.PowerShell.cs +++ /dev/null @@ -1,644 +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.NetworkCloud.Models.Api20250201 -{ - using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; - - /// BareMetalMachine represents the physical machine in the rack. - [System.ComponentModel.TypeConverter(typeof(BareMetalMachineTypeConverter))] - public partial class BareMetalMachine - { - - /// - /// 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 BareMetalMachine(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("ExtendedLocation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).ExtendedLocation = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocation) content.GetValueForProperty("ExtendedLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).ExtendedLocation, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ExtendedLocationTypeConverter.ConvertFrom); - } - if (content.Contains("Property")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BareMetalMachinePropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Etag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).Etag, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)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("SystemDataCreatedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataLastModifiedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("SystemData")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.SystemDataTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Type, global::System.Convert.ToString); - } - if (content.Contains("Tag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.TrackedResourceTagsTypeConverter.ConvertFrom); - } - if (content.Contains("Location")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); - } - if (content.Contains("ExtendedLocationName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).ExtendedLocationName = (string) content.GetValueForProperty("ExtendedLocationName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).ExtendedLocationName, global::System.Convert.ToString); - } - if (content.Contains("ExtendedLocationType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).ExtendedLocationType = (string) content.GetValueForProperty("ExtendedLocationType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).ExtendedLocationType, global::System.Convert.ToString); - } - if (content.Contains("HardwareInventory")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).HardwareInventory = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IHardwareInventory) content.GetValueForProperty("HardwareInventory",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).HardwareInventory, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.HardwareInventoryTypeConverter.ConvertFrom); - } - if (content.Contains("BmcCredentials")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).BmcCredentials = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministrativeCredentials) content.GetValueForProperty("BmcCredentials",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).BmcCredentials, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AdministrativeCredentialsTypeConverter.ConvertFrom); - } - if (content.Contains("HardwareValidationStatus")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).HardwareValidationStatus = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IHardwareValidationStatus) content.GetValueForProperty("HardwareValidationStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).HardwareValidationStatus, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.HardwareValidationStatusTypeConverter.ConvertFrom); - } - if (content.Contains("RuntimeProtectionStatus")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).RuntimeProtectionStatus = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRuntimeProtectionStatus) content.GetValueForProperty("RuntimeProtectionStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).RuntimeProtectionStatus, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.RuntimeProtectionStatusTypeConverter.ConvertFrom); - } - if (content.Contains("AssociatedResourceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).AssociatedResourceId = (string[]) content.GetValueForProperty("AssociatedResourceId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).AssociatedResourceId, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("BmcConnectionString")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).BmcConnectionString = (string) content.GetValueForProperty("BmcConnectionString",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).BmcConnectionString, global::System.Convert.ToString); - } - if (content.Contains("BmcMacAddress")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).BmcMacAddress = (string) content.GetValueForProperty("BmcMacAddress",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).BmcMacAddress, global::System.Convert.ToString); - } - if (content.Contains("BootMacAddress")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).BootMacAddress = (string) content.GetValueForProperty("BootMacAddress",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).BootMacAddress, global::System.Convert.ToString); - } - if (content.Contains("ClusterId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).ClusterId = (string) content.GetValueForProperty("ClusterId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).ClusterId, global::System.Convert.ToString); - } - if (content.Contains("CordonStatus")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).CordonStatus = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineCordonStatus?) content.GetValueForProperty("CordonStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).CordonStatus, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineCordonStatus.CreateFrom); - } - if (content.Contains("DetailedStatus")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).DetailedStatus = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineDetailedStatus?) content.GetValueForProperty("DetailedStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).DetailedStatus, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineDetailedStatus.CreateFrom); - } - if (content.Contains("DetailedStatusMessage")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).DetailedStatusMessage = (string) content.GetValueForProperty("DetailedStatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).DetailedStatusMessage, global::System.Convert.ToString); - } - if (content.Contains("HybridAksClustersAssociatedId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).HybridAksClustersAssociatedId = (string[]) content.GetValueForProperty("HybridAksClustersAssociatedId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).HybridAksClustersAssociatedId, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("KubernetesNodeName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).KubernetesNodeName = (string) content.GetValueForProperty("KubernetesNodeName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).KubernetesNodeName, global::System.Convert.ToString); - } - if (content.Contains("KubernetesVersion")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).KubernetesVersion = (string) content.GetValueForProperty("KubernetesVersion",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).KubernetesVersion, global::System.Convert.ToString); - } - if (content.Contains("MachineClusterVersion")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).MachineClusterVersion = (string) content.GetValueForProperty("MachineClusterVersion",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).MachineClusterVersion, global::System.Convert.ToString); - } - if (content.Contains("MachineDetail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).MachineDetail = (string) content.GetValueForProperty("MachineDetail",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).MachineDetail, global::System.Convert.ToString); - } - if (content.Contains("MachineName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).MachineName = (string) content.GetValueForProperty("MachineName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).MachineName, global::System.Convert.ToString); - } - if (content.Contains("MachineRole")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).MachineRole = (string[]) content.GetValueForProperty("MachineRole",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).MachineRole, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("MachineSkuId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).MachineSkuId = (string) content.GetValueForProperty("MachineSkuId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).MachineSkuId, global::System.Convert.ToString); - } - if (content.Contains("OamIpv4Address")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).OamIpv4Address = (string) content.GetValueForProperty("OamIpv4Address",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).OamIpv4Address, global::System.Convert.ToString); - } - if (content.Contains("OamIpv6Address")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).OamIpv6Address = (string) content.GetValueForProperty("OamIpv6Address",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).OamIpv6Address, global::System.Convert.ToString); - } - if (content.Contains("OSImage")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).OSImage = (string) content.GetValueForProperty("OSImage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).OSImage, global::System.Convert.ToString); - } - if (content.Contains("PowerState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).PowerState = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachinePowerState?) content.GetValueForProperty("PowerState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).PowerState, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachinePowerState.CreateFrom); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineProvisioningState.CreateFrom); - } - if (content.Contains("RackId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).RackId = (string) content.GetValueForProperty("RackId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).RackId, global::System.Convert.ToString); - } - if (content.Contains("RackSlot")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).RackSlot = (long) content.GetValueForProperty("RackSlot",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).RackSlot, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("ReadyState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).ReadyState = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineReadyState?) content.GetValueForProperty("ReadyState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).ReadyState, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineReadyState.CreateFrom); - } - if (content.Contains("SecretRotationStatus")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).SecretRotationStatus = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretRotationStatus[]) content.GetValueForProperty("SecretRotationStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).SecretRotationStatus, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.SecretRotationStatusTypeConverter.ConvertFrom)); - } - if (content.Contains("SerialNumber")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).SerialNumber = (string) content.GetValueForProperty("SerialNumber",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).SerialNumber, global::System.Convert.ToString); - } - if (content.Contains("ServiceTag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).ServiceTag = (string) content.GetValueForProperty("ServiceTag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).ServiceTag, global::System.Convert.ToString); - } - if (content.Contains("VirtualMachinesAssociatedId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).VirtualMachinesAssociatedId = (string[]) content.GetValueForProperty("VirtualMachinesAssociatedId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).VirtualMachinesAssociatedId, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("HardwareInventoryInterface")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).HardwareInventoryInterface = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IHardwareInventoryNetworkInterface[]) content.GetValueForProperty("HardwareInventoryInterface",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).HardwareInventoryInterface, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.HardwareInventoryNetworkInterfaceTypeConverter.ConvertFrom)); - } - if (content.Contains("HardwareInventoryNic")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).HardwareInventoryNic = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INic[]) content.GetValueForProperty("HardwareInventoryNic",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).HardwareInventoryNic, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.NicTypeConverter.ConvertFrom)); - } - if (content.Contains("RuntimeProtectionStatusDefinitionsVersion")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).RuntimeProtectionStatusDefinitionsVersion = (string) content.GetValueForProperty("RuntimeProtectionStatusDefinitionsVersion",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).RuntimeProtectionStatusDefinitionsVersion, global::System.Convert.ToString); - } - if (content.Contains("BmcCredentialsPassword")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).BmcCredentialsPassword = (System.Security.SecureString) content.GetValueForProperty("BmcCredentialsPassword",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).BmcCredentialsPassword, (object ss) => (System.Security.SecureString)ss); - } - if (content.Contains("BmcCredentialsUsername")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).BmcCredentialsUsername = (string) content.GetValueForProperty("BmcCredentialsUsername",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).BmcCredentialsUsername, global::System.Convert.ToString); - } - if (content.Contains("HardwareInventoryAdditionalHostInformation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).HardwareInventoryAdditionalHostInformation = (string) content.GetValueForProperty("HardwareInventoryAdditionalHostInformation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).HardwareInventoryAdditionalHostInformation, global::System.Convert.ToString); - } - if (content.Contains("HardwareValidationStatusLastValidationTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).HardwareValidationStatusLastValidationTime = (global::System.DateTime?) content.GetValueForProperty("HardwareValidationStatusLastValidationTime",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).HardwareValidationStatusLastValidationTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("HardwareValidationStatusResult")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).HardwareValidationStatusResult = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineHardwareValidationResult?) content.GetValueForProperty("HardwareValidationStatusResult",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).HardwareValidationStatusResult, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineHardwareValidationResult.CreateFrom); - } - if (content.Contains("RuntimeProtectionStatusDefinitionsLastUpdated")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).RuntimeProtectionStatusDefinitionsLastUpdated = (global::System.DateTime?) content.GetValueForProperty("RuntimeProtectionStatusDefinitionsLastUpdated",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).RuntimeProtectionStatusDefinitionsLastUpdated, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("RuntimeProtectionStatusScanCompletedTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).RuntimeProtectionStatusScanCompletedTime = (global::System.DateTime?) content.GetValueForProperty("RuntimeProtectionStatusScanCompletedTime",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).RuntimeProtectionStatusScanCompletedTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("RuntimeProtectionStatusScanScheduledTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).RuntimeProtectionStatusScanScheduledTime = (global::System.DateTime?) content.GetValueForProperty("RuntimeProtectionStatusScanScheduledTime",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).RuntimeProtectionStatusScanScheduledTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("RuntimeProtectionStatusScanStartedTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).RuntimeProtectionStatusScanStartedTime = (global::System.DateTime?) content.GetValueForProperty("RuntimeProtectionStatusScanStartedTime",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).RuntimeProtectionStatusScanStartedTime, (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 BareMetalMachine(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("ExtendedLocation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).ExtendedLocation = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocation) content.GetValueForProperty("ExtendedLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).ExtendedLocation, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ExtendedLocationTypeConverter.ConvertFrom); - } - if (content.Contains("Property")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BareMetalMachinePropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Etag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).Etag, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)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("SystemDataCreatedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataLastModifiedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("SystemData")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.SystemDataTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Type, global::System.Convert.ToString); - } - if (content.Contains("Tag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.TrackedResourceTagsTypeConverter.ConvertFrom); - } - if (content.Contains("Location")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); - } - if (content.Contains("ExtendedLocationName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).ExtendedLocationName = (string) content.GetValueForProperty("ExtendedLocationName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).ExtendedLocationName, global::System.Convert.ToString); - } - if (content.Contains("ExtendedLocationType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).ExtendedLocationType = (string) content.GetValueForProperty("ExtendedLocationType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).ExtendedLocationType, global::System.Convert.ToString); - } - if (content.Contains("HardwareInventory")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).HardwareInventory = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IHardwareInventory) content.GetValueForProperty("HardwareInventory",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).HardwareInventory, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.HardwareInventoryTypeConverter.ConvertFrom); - } - if (content.Contains("BmcCredentials")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).BmcCredentials = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministrativeCredentials) content.GetValueForProperty("BmcCredentials",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).BmcCredentials, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AdministrativeCredentialsTypeConverter.ConvertFrom); - } - if (content.Contains("HardwareValidationStatus")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).HardwareValidationStatus = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IHardwareValidationStatus) content.GetValueForProperty("HardwareValidationStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).HardwareValidationStatus, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.HardwareValidationStatusTypeConverter.ConvertFrom); - } - if (content.Contains("RuntimeProtectionStatus")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).RuntimeProtectionStatus = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRuntimeProtectionStatus) content.GetValueForProperty("RuntimeProtectionStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).RuntimeProtectionStatus, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.RuntimeProtectionStatusTypeConverter.ConvertFrom); - } - if (content.Contains("AssociatedResourceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).AssociatedResourceId = (string[]) content.GetValueForProperty("AssociatedResourceId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).AssociatedResourceId, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("BmcConnectionString")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).BmcConnectionString = (string) content.GetValueForProperty("BmcConnectionString",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).BmcConnectionString, global::System.Convert.ToString); - } - if (content.Contains("BmcMacAddress")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).BmcMacAddress = (string) content.GetValueForProperty("BmcMacAddress",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).BmcMacAddress, global::System.Convert.ToString); - } - if (content.Contains("BootMacAddress")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).BootMacAddress = (string) content.GetValueForProperty("BootMacAddress",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).BootMacAddress, global::System.Convert.ToString); - } - if (content.Contains("ClusterId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).ClusterId = (string) content.GetValueForProperty("ClusterId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).ClusterId, global::System.Convert.ToString); - } - if (content.Contains("CordonStatus")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).CordonStatus = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineCordonStatus?) content.GetValueForProperty("CordonStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).CordonStatus, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineCordonStatus.CreateFrom); - } - if (content.Contains("DetailedStatus")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).DetailedStatus = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineDetailedStatus?) content.GetValueForProperty("DetailedStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).DetailedStatus, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineDetailedStatus.CreateFrom); - } - if (content.Contains("DetailedStatusMessage")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).DetailedStatusMessage = (string) content.GetValueForProperty("DetailedStatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).DetailedStatusMessage, global::System.Convert.ToString); - } - if (content.Contains("HybridAksClustersAssociatedId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).HybridAksClustersAssociatedId = (string[]) content.GetValueForProperty("HybridAksClustersAssociatedId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).HybridAksClustersAssociatedId, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("KubernetesNodeName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).KubernetesNodeName = (string) content.GetValueForProperty("KubernetesNodeName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).KubernetesNodeName, global::System.Convert.ToString); - } - if (content.Contains("KubernetesVersion")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).KubernetesVersion = (string) content.GetValueForProperty("KubernetesVersion",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).KubernetesVersion, global::System.Convert.ToString); - } - if (content.Contains("MachineClusterVersion")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).MachineClusterVersion = (string) content.GetValueForProperty("MachineClusterVersion",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).MachineClusterVersion, global::System.Convert.ToString); - } - if (content.Contains("MachineDetail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).MachineDetail = (string) content.GetValueForProperty("MachineDetail",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).MachineDetail, global::System.Convert.ToString); - } - if (content.Contains("MachineName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).MachineName = (string) content.GetValueForProperty("MachineName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).MachineName, global::System.Convert.ToString); - } - if (content.Contains("MachineRole")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).MachineRole = (string[]) content.GetValueForProperty("MachineRole",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).MachineRole, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("MachineSkuId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).MachineSkuId = (string) content.GetValueForProperty("MachineSkuId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).MachineSkuId, global::System.Convert.ToString); - } - if (content.Contains("OamIpv4Address")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).OamIpv4Address = (string) content.GetValueForProperty("OamIpv4Address",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).OamIpv4Address, global::System.Convert.ToString); - } - if (content.Contains("OamIpv6Address")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).OamIpv6Address = (string) content.GetValueForProperty("OamIpv6Address",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).OamIpv6Address, global::System.Convert.ToString); - } - if (content.Contains("OSImage")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).OSImage = (string) content.GetValueForProperty("OSImage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).OSImage, global::System.Convert.ToString); - } - if (content.Contains("PowerState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).PowerState = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachinePowerState?) content.GetValueForProperty("PowerState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).PowerState, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachinePowerState.CreateFrom); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineProvisioningState.CreateFrom); - } - if (content.Contains("RackId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).RackId = (string) content.GetValueForProperty("RackId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).RackId, global::System.Convert.ToString); - } - if (content.Contains("RackSlot")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).RackSlot = (long) content.GetValueForProperty("RackSlot",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).RackSlot, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("ReadyState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).ReadyState = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineReadyState?) content.GetValueForProperty("ReadyState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).ReadyState, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineReadyState.CreateFrom); - } - if (content.Contains("SecretRotationStatus")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).SecretRotationStatus = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretRotationStatus[]) content.GetValueForProperty("SecretRotationStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).SecretRotationStatus, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.SecretRotationStatusTypeConverter.ConvertFrom)); - } - if (content.Contains("SerialNumber")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).SerialNumber = (string) content.GetValueForProperty("SerialNumber",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).SerialNumber, global::System.Convert.ToString); - } - if (content.Contains("ServiceTag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).ServiceTag = (string) content.GetValueForProperty("ServiceTag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).ServiceTag, global::System.Convert.ToString); - } - if (content.Contains("VirtualMachinesAssociatedId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).VirtualMachinesAssociatedId = (string[]) content.GetValueForProperty("VirtualMachinesAssociatedId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).VirtualMachinesAssociatedId, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("HardwareInventoryInterface")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).HardwareInventoryInterface = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IHardwareInventoryNetworkInterface[]) content.GetValueForProperty("HardwareInventoryInterface",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).HardwareInventoryInterface, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.HardwareInventoryNetworkInterfaceTypeConverter.ConvertFrom)); - } - if (content.Contains("HardwareInventoryNic")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).HardwareInventoryNic = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INic[]) content.GetValueForProperty("HardwareInventoryNic",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).HardwareInventoryNic, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.NicTypeConverter.ConvertFrom)); - } - if (content.Contains("RuntimeProtectionStatusDefinitionsVersion")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).RuntimeProtectionStatusDefinitionsVersion = (string) content.GetValueForProperty("RuntimeProtectionStatusDefinitionsVersion",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).RuntimeProtectionStatusDefinitionsVersion, global::System.Convert.ToString); - } - if (content.Contains("BmcCredentialsPassword")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).BmcCredentialsPassword = (System.Security.SecureString) content.GetValueForProperty("BmcCredentialsPassword",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).BmcCredentialsPassword, (object ss) => (System.Security.SecureString)ss); - } - if (content.Contains("BmcCredentialsUsername")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).BmcCredentialsUsername = (string) content.GetValueForProperty("BmcCredentialsUsername",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).BmcCredentialsUsername, global::System.Convert.ToString); - } - if (content.Contains("HardwareInventoryAdditionalHostInformation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).HardwareInventoryAdditionalHostInformation = (string) content.GetValueForProperty("HardwareInventoryAdditionalHostInformation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).HardwareInventoryAdditionalHostInformation, global::System.Convert.ToString); - } - if (content.Contains("HardwareValidationStatusLastValidationTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).HardwareValidationStatusLastValidationTime = (global::System.DateTime?) content.GetValueForProperty("HardwareValidationStatusLastValidationTime",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).HardwareValidationStatusLastValidationTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("HardwareValidationStatusResult")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).HardwareValidationStatusResult = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineHardwareValidationResult?) content.GetValueForProperty("HardwareValidationStatusResult",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).HardwareValidationStatusResult, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineHardwareValidationResult.CreateFrom); - } - if (content.Contains("RuntimeProtectionStatusDefinitionsLastUpdated")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).RuntimeProtectionStatusDefinitionsLastUpdated = (global::System.DateTime?) content.GetValueForProperty("RuntimeProtectionStatusDefinitionsLastUpdated",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).RuntimeProtectionStatusDefinitionsLastUpdated, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("RuntimeProtectionStatusScanCompletedTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).RuntimeProtectionStatusScanCompletedTime = (global::System.DateTime?) content.GetValueForProperty("RuntimeProtectionStatusScanCompletedTime",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).RuntimeProtectionStatusScanCompletedTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("RuntimeProtectionStatusScanScheduledTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).RuntimeProtectionStatusScanScheduledTime = (global::System.DateTime?) content.GetValueForProperty("RuntimeProtectionStatusScanScheduledTime",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).RuntimeProtectionStatusScanScheduledTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("RuntimeProtectionStatusScanStartedTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).RuntimeProtectionStatusScanStartedTime = (global::System.DateTime?) content.GetValueForProperty("RuntimeProtectionStatusScanStartedTime",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal)this).RuntimeProtectionStatusScanStartedTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - AfterDeserializePSObject(content); - } - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachine DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new BareMetalMachine(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.NetworkCloud.Models.Api20250201.IBareMetalMachine DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new BareMetalMachine(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.NetworkCloud.Models.Api20250201.IBareMetalMachine FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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(); - } - } - /// BareMetalMachine represents the physical machine in the rack. - [System.ComponentModel.TypeConverter(typeof(BareMetalMachineTypeConverter))] - public partial interface IBareMetalMachine - - { - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachine.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachine.cs deleted file mode 100644 index 4ec5cfa4206b..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachine.cs +++ /dev/null @@ -1,973 +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.NetworkCloud.Models.Api20250201 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; - - /// BareMetalMachine represents the physical machine in the rack. - public partial class BareMetalMachine : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachine, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IValidates - { - /// - /// Backing field for Inherited model - /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResource __trackedResource = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.TrackedResource(); - - /// - /// The list of resource IDs for the other Microsoft.NetworkCloud resources that have attached this network. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string[] AssociatedResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)Property).AssociatedResourceId; } - - /// - /// The connection string for the baseboard management controller including IP address and protocol. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string BmcConnectionString { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)Property).BmcConnectionString; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)Property).BmcConnectionString = value ; } - - /// The password of the administrator of the device used during initialization. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public System.Security.SecureString BmcCredentialsPassword { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)Property).BmcCredentialsPassword; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)Property).BmcCredentialsPassword = value ; } - - /// The username of the administrator of the device used during initialization. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string BmcCredentialsUsername { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)Property).BmcCredentialsUsername; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)Property).BmcCredentialsUsername = value ; } - - /// The MAC address of the BMC device. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string BmcMacAddress { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)Property).BmcMacAddress; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)Property).BmcMacAddress = value ; } - - /// The MAC address of a NIC connected to the PXE network. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string BootMacAddress { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)Property).BootMacAddress; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)Property).BootMacAddress = value ; } - - /// The resource ID of the cluster this bare metal machine is associated with. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string ClusterId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)Property).ClusterId; } - - /// The cordon status of the bare metal machine. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineCordonStatus? CordonStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)Property).CordonStatus; } - - /// The more detailed status of the bare metal machine. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineDetailedStatus? DetailedStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)Property).DetailedStatus; } - - /// The descriptive message about the current detailed status. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string DetailedStatusMessage { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)Property).DetailedStatusMessage; } - - /// Backing field for property. - private string _etag; - - /// Resource ETag. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string Etag { get => this._etag; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocation _extendedLocation; - - /// The extended location of the cluster associated with the resource. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocation ExtendedLocation { get => (this._extendedLocation = this._extendedLocation ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ExtendedLocation()); set => this._extendedLocation = value; } - - /// The resource ID of the extended location on which the resource will be created. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string ExtendedLocationName { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocationInternal)ExtendedLocation).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocationInternal)ExtendedLocation).Name = value ; } - - /// The extended location type, for example, CustomLocation. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string ExtendedLocationType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocationInternal)ExtendedLocation).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocationInternal)ExtendedLocation).Type = value ; } - - /// - /// Freeform data extracted from the environment about this machine. This information varies depending on the specific hardware - /// and configuration. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string HardwareInventoryAdditionalHostInformation { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)Property).HardwareInventoryAdditionalHostInformation; } - - /// - /// The list of network interfaces and associated details for the bare metal machine. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IHardwareInventoryNetworkInterface[] HardwareInventoryInterface { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)Property).HardwareInventoryInterface; } - - /// - /// Field Deprecated. Will be removed in an upcoming version. The list of network interface cards and associated details for - /// the bare metal machine. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INic[] HardwareInventoryNic { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)Property).HardwareInventoryNic; } - - /// The timestamp of the hardware validation execution. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public global::System.DateTime? HardwareValidationStatusLastValidationTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)Property).HardwareValidationStatusLastValidationTime; } - - /// The outcome of the hardware validation. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineHardwareValidationResult? HardwareValidationStatusResult { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)Property).HardwareValidationStatusResult; } - - /// - /// Field Deprecated. These fields will be empty/omitted. The list of the resource IDs for the HybridAksClusters that have - /// nodes hosted on this bare metal machine. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string[] HybridAksClustersAssociatedId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)Property).HybridAksClustersAssociatedId; } - - /// - /// Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).Id; } - - /// - /// The name of this machine represented by the host object in the Cluster's Kubernetes control plane. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string KubernetesNodeName { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)Property).KubernetesNodeName; } - - /// The version of Kubernetes running on this machine. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string KubernetesVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)Property).KubernetesVersion; } - - /// The geo-location where the resource lives - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)__trackedResource).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)__trackedResource).Location = value ; } - - /// - /// The cluster version that has been applied to this machine during deployment or a version update. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string MachineClusterVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)Property).MachineClusterVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)Property).MachineClusterVersion = value ?? null; } - - /// The custom details provided by the customer. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string MachineDetail { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)Property).MachineDetail; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)Property).MachineDetail = value ; } - - /// The OS-level hostname assigned to this machine. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string MachineName { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)Property).MachineName; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)Property).MachineName = value ; } - - /// - /// The list of roles that are assigned to the cluster node running on this machine. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string[] MachineRole { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)Property).MachineRole; } - - /// The unique internal identifier of the bare metal machine SKU. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string MachineSkuId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)Property).MachineSkuId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)Property).MachineSkuId = value ; } - - /// Internal Acessors for AssociatedResourceId - string[] Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal.AssociatedResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)Property).AssociatedResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)Property).AssociatedResourceId = value; } - - /// Internal Acessors for BmcCredentials - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministrativeCredentials Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal.BmcCredentials { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)Property).BmcCredentials; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)Property).BmcCredentials = value; } - - /// Internal Acessors for ClusterId - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal.ClusterId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)Property).ClusterId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)Property).ClusterId = value; } - - /// Internal Acessors for CordonStatus - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineCordonStatus? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal.CordonStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)Property).CordonStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)Property).CordonStatus = value; } - - /// Internal Acessors for DetailedStatus - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineDetailedStatus? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal.DetailedStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)Property).DetailedStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)Property).DetailedStatus = value; } - - /// Internal Acessors for DetailedStatusMessage - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal.DetailedStatusMessage { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)Property).DetailedStatusMessage; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)Property).DetailedStatusMessage = value; } - - /// Internal Acessors for Etag - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal.Etag { get => this._etag; set { {_etag = value;} } } - - /// Internal Acessors for ExtendedLocation - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocation Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal.ExtendedLocation { get => (this._extendedLocation = this._extendedLocation ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ExtendedLocation()); set { {_extendedLocation = value;} } } - - /// Internal Acessors for HardwareInventory - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IHardwareInventory Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal.HardwareInventory { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)Property).HardwareInventory; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)Property).HardwareInventory = value; } - - /// Internal Acessors for HardwareInventoryAdditionalHostInformation - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal.HardwareInventoryAdditionalHostInformation { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)Property).HardwareInventoryAdditionalHostInformation; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)Property).HardwareInventoryAdditionalHostInformation = value; } - - /// Internal Acessors for HardwareInventoryInterface - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IHardwareInventoryNetworkInterface[] Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal.HardwareInventoryInterface { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)Property).HardwareInventoryInterface; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)Property).HardwareInventoryInterface = value; } - - /// Internal Acessors for HardwareInventoryNic - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INic[] Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal.HardwareInventoryNic { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)Property).HardwareInventoryNic; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)Property).HardwareInventoryNic = value; } - - /// Internal Acessors for HardwareValidationStatus - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IHardwareValidationStatus Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal.HardwareValidationStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)Property).HardwareValidationStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)Property).HardwareValidationStatus = value; } - - /// Internal Acessors for HardwareValidationStatusLastValidationTime - global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal.HardwareValidationStatusLastValidationTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)Property).HardwareValidationStatusLastValidationTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)Property).HardwareValidationStatusLastValidationTime = value; } - - /// Internal Acessors for HardwareValidationStatusResult - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineHardwareValidationResult? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal.HardwareValidationStatusResult { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)Property).HardwareValidationStatusResult; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)Property).HardwareValidationStatusResult = value; } - - /// Internal Acessors for HybridAksClustersAssociatedId - string[] Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal.HybridAksClustersAssociatedId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)Property).HybridAksClustersAssociatedId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)Property).HybridAksClustersAssociatedId = value; } - - /// Internal Acessors for KubernetesNodeName - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal.KubernetesNodeName { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)Property).KubernetesNodeName; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)Property).KubernetesNodeName = value; } - - /// Internal Acessors for KubernetesVersion - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal.KubernetesVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)Property).KubernetesVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)Property).KubernetesVersion = value; } - - /// Internal Acessors for MachineRole - string[] Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal.MachineRole { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)Property).MachineRole; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)Property).MachineRole = value; } - - /// Internal Acessors for OSImage - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal.OSImage { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)Property).OSImage; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)Property).OSImage = value; } - - /// Internal Acessors for OamIpv4Address - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal.OamIpv4Address { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)Property).OamIpv4Address; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)Property).OamIpv4Address = value; } - - /// Internal Acessors for OamIpv6Address - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal.OamIpv6Address { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)Property).OamIpv6Address; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)Property).OamIpv6Address = value; } - - /// Internal Acessors for PowerState - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachinePowerState? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal.PowerState { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)Property).PowerState; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)Property).PowerState = value; } - - /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineProperties Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BareMetalMachineProperties()); set { {_property = value;} } } - - /// Internal Acessors for ProvisioningState - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineProvisioningState? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)Property).ProvisioningState = value; } - - /// Internal Acessors for ReadyState - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineReadyState? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal.ReadyState { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)Property).ReadyState; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)Property).ReadyState = value; } - - /// Internal Acessors for RuntimeProtectionStatus - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRuntimeProtectionStatus Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal.RuntimeProtectionStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)Property).RuntimeProtectionStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)Property).RuntimeProtectionStatus = value; } - - /// Internal Acessors for RuntimeProtectionStatusDefinitionsLastUpdated - global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal.RuntimeProtectionStatusDefinitionsLastUpdated { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)Property).RuntimeProtectionStatusDefinitionsLastUpdated; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)Property).RuntimeProtectionStatusDefinitionsLastUpdated = value; } - - /// Internal Acessors for RuntimeProtectionStatusDefinitionsVersion - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal.RuntimeProtectionStatusDefinitionsVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)Property).RuntimeProtectionStatusDefinitionsVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)Property).RuntimeProtectionStatusDefinitionsVersion = value; } - - /// Internal Acessors for RuntimeProtectionStatusScanCompletedTime - global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal.RuntimeProtectionStatusScanCompletedTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)Property).RuntimeProtectionStatusScanCompletedTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)Property).RuntimeProtectionStatusScanCompletedTime = value; } - - /// Internal Acessors for RuntimeProtectionStatusScanScheduledTime - global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal.RuntimeProtectionStatusScanScheduledTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)Property).RuntimeProtectionStatusScanScheduledTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)Property).RuntimeProtectionStatusScanScheduledTime = value; } - - /// Internal Acessors for RuntimeProtectionStatusScanStartedTime - global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal.RuntimeProtectionStatusScanStartedTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)Property).RuntimeProtectionStatusScanStartedTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)Property).RuntimeProtectionStatusScanStartedTime = value; } - - /// Internal Acessors for SecretRotationStatus - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretRotationStatus[] Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal.SecretRotationStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)Property).SecretRotationStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)Property).SecretRotationStatus = value; } - - /// Internal Acessors for ServiceTag - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal.ServiceTag { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)Property).ServiceTag; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)Property).ServiceTag = value; } - - /// Internal Acessors for VirtualMachinesAssociatedId - string[] Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineInternal.VirtualMachinesAssociatedId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)Property).VirtualMachinesAssociatedId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)Property).VirtualMachinesAssociatedId = value; } - - /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).Id = value; } - - /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).Name = value; } - - /// Internal Acessors for SystemData - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ISystemData Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal.SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemData; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemData = value; } - - /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).Type = value; } - - /// The name of the resource - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).Name; } - - /// The image that is currently provisioned to the OS disk. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string OSImage { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)Property).OSImage; } - - /// - /// The IPv4 address that is assigned to the bare metal machine during the cluster deployment. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string OamIpv4Address { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)Property).OamIpv4Address; } - - /// - /// The IPv6 address that is assigned to the bare metal machine during the cluster deployment. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string OamIpv6Address { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)Property).OamIpv6Address; } - - /// The power state derived from the baseboard management controller. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachinePowerState? PowerState { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)Property).PowerState; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineProperties _property; - - /// The list of the resource properties. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BareMetalMachineProperties()); set => this._property = value; } - - /// The provisioning state of the bare metal machine. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineProvisioningState? ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)Property).ProvisioningState; } - - /// The resource ID of the rack where this bare metal machine resides. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string RackId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)Property).RackId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)Property).RackId = value ; } - - /// - /// The rack slot in which this bare metal machine is located, ordered from the bottom up i.e. the lowest slot is 1. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public long RackSlot { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)Property).RackSlot; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)Property).RackSlot = value ; } - - /// The indicator of whether the bare metal machine is ready to receive workloads. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineReadyState? ReadyState { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)Property).ReadyState; } - - /// Gets the resource group name - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string ResourceGroupName { get => (new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Success ? new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Groups["resourceGroupName"].Value : null); } - - /// The timestamp when the malware definitions were last updated. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public global::System.DateTime? RuntimeProtectionStatusDefinitionsLastUpdated { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)Property).RuntimeProtectionStatusDefinitionsLastUpdated; } - - /// The version of the malware definitions. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string RuntimeProtectionStatusDefinitionsVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)Property).RuntimeProtectionStatusDefinitionsVersion; } - - /// - /// The timestamp of the most recently completed scan, or empty if there has never been a scan. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public global::System.DateTime? RuntimeProtectionStatusScanCompletedTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)Property).RuntimeProtectionStatusScanCompletedTime; } - - /// - /// The timestamp of the most recently scheduled scan, or empty if no scan has been scheduled. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public global::System.DateTime? RuntimeProtectionStatusScanScheduledTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)Property).RuntimeProtectionStatusScanScheduledTime; } - - /// - /// The timestamp of the most recently started scan, or empty if there has never been a scan. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public global::System.DateTime? RuntimeProtectionStatusScanStartedTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)Property).RuntimeProtectionStatusScanStartedTime; } - - /// The list of statuses that represent secret rotation activity. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretRotationStatus[] SecretRotationStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)Property).SecretRotationStatus; } - - /// The serial number of the bare metal machine. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string SerialNumber { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)Property).SerialNumber; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)Property).SerialNumber = value ; } - - /// The discovered value of the machine's service tag. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string ServiceTag { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)Property).ServiceTag; } - - /// - /// Azure Resource Manager metadata containing createdBy and modifiedBy information. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ISystemData SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemData; } - - /// The timestamp of resource creation (UTC). - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataCreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataCreatedAt = value ?? default(global::System.DateTime); } - - /// The identity that created the resource. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataCreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataCreatedBy = value ?? null; } - - /// The type of identity that created the resource. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType? SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataCreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataCreatedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType)""); } - - /// The timestamp of resource last modification (UTC) - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataLastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataLastModifiedAt = value ?? default(global::System.DateTime); } - - /// The identity that last modified the resource. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataLastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataLastModifiedBy = value ?? null; } - - /// The type of identity that last modified the resource. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType? SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataLastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataLastModifiedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType)""); } - - /// Resource tags. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)__trackedResource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.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.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).Type; } - - /// - /// Field Deprecated. These fields will be empty/omitted. The list of the resource IDs for the VirtualMachines that are hosted - /// on this bare metal machine. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string[] VirtualMachinesAssociatedId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)Property).VirtualMachinesAssociatedId; } - - /// Creates an new instance. - public BareMetalMachine() - { - - } - - /// Validates that this object meets the validation criteria. - /// an instance that will receive validation - /// events. - /// - /// A that will be complete when validation is completed. - /// - public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) - { - await eventListener.AssertNotNull(nameof(__trackedResource), __trackedResource); - await eventListener.AssertObjectIsValid(nameof(__trackedResource), __trackedResource); - } - } - /// BareMetalMachine represents the physical machine in the rack. - public partial interface IBareMetalMachine : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResource - { - /// - /// The list of resource IDs for the other Microsoft.NetworkCloud resources that have attached this network. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The list of resource IDs for the other Microsoft.NetworkCloud resources that have attached this network.", - SerializedName = @"associatedResourceIds", - PossibleTypes = new [] { typeof(string) })] - string[] AssociatedResourceId { get; } - /// - /// The connection string for the baseboard management controller including IP address and protocol. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The connection string for the baseboard management controller including IP address and protocol.", - SerializedName = @"bmcConnectionString", - PossibleTypes = new [] { typeof(string) })] - string BmcConnectionString { get; set; } - /// The password of the administrator of the device used during initialization. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The password of the administrator of the device used during initialization.", - SerializedName = @"password", - PossibleTypes = new [] { typeof(System.Security.SecureString) })] - System.Security.SecureString BmcCredentialsPassword { get; set; } - /// The username of the administrator of the device used during initialization. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The username of the administrator of the device used during initialization.", - SerializedName = @"username", - PossibleTypes = new [] { typeof(string) })] - string BmcCredentialsUsername { get; set; } - /// The MAC address of the BMC device. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The MAC address of the BMC device.", - SerializedName = @"bmcMacAddress", - PossibleTypes = new [] { typeof(string) })] - string BmcMacAddress { get; set; } - /// The MAC address of a NIC connected to the PXE network. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The MAC address of a NIC connected to the PXE network.", - SerializedName = @"bootMacAddress", - PossibleTypes = new [] { typeof(string) })] - string BootMacAddress { get; set; } - /// The resource ID of the cluster this bare metal machine is associated with. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The resource ID of the cluster this bare metal machine is associated with.", - SerializedName = @"clusterId", - PossibleTypes = new [] { typeof(string) })] - string ClusterId { get; } - /// The cordon status of the bare metal machine. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The cordon status of the bare metal machine.", - SerializedName = @"cordonStatus", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineCordonStatus) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineCordonStatus? CordonStatus { get; } - /// The more detailed status of the bare metal machine. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The more detailed status of the bare metal machine.", - SerializedName = @"detailedStatus", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineDetailedStatus) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineDetailedStatus? DetailedStatus { get; } - /// The descriptive message about the current detailed status. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The descriptive message about the current detailed status.", - SerializedName = @"detailedStatusMessage", - PossibleTypes = new [] { typeof(string) })] - string DetailedStatusMessage { get; } - /// Resource ETag. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"Resource ETag.", - SerializedName = @"etag", - PossibleTypes = new [] { typeof(string) })] - string Etag { get; } - /// The resource ID of the extended location on which the resource will be created. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The resource ID of the extended location on which the resource will be created.", - SerializedName = @"name", - PossibleTypes = new [] { typeof(string) })] - string ExtendedLocationName { get; set; } - /// The extended location type, for example, CustomLocation. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The extended location type, for example, CustomLocation.", - SerializedName = @"type", - PossibleTypes = new [] { typeof(string) })] - string ExtendedLocationType { get; set; } - /// - /// Freeform data extracted from the environment about this machine. This information varies depending on the specific hardware - /// and configuration. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"Freeform data extracted from the environment about this machine. This information varies depending on the specific hardware and configuration.", - SerializedName = @"additionalHostInformation", - PossibleTypes = new [] { typeof(string) })] - string HardwareInventoryAdditionalHostInformation { get; } - /// - /// The list of network interfaces and associated details for the bare metal machine. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The list of network interfaces and associated details for the bare metal machine.", - SerializedName = @"interfaces", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IHardwareInventoryNetworkInterface) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IHardwareInventoryNetworkInterface[] HardwareInventoryInterface { get; } - /// - /// Field Deprecated. Will be removed in an upcoming version. The list of network interface cards and associated details for - /// the bare metal machine. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"Field Deprecated. Will be removed in an upcoming version. The list of network interface cards and associated details for the bare metal machine.", - SerializedName = @"nics", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INic) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INic[] HardwareInventoryNic { get; } - /// The timestamp of the hardware validation execution. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The timestamp of the hardware validation execution.", - SerializedName = @"lastValidationTime", - PossibleTypes = new [] { typeof(global::System.DateTime) })] - global::System.DateTime? HardwareValidationStatusLastValidationTime { get; } - /// The outcome of the hardware validation. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The outcome of the hardware validation.", - SerializedName = @"result", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineHardwareValidationResult) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineHardwareValidationResult? HardwareValidationStatusResult { get; } - /// - /// Field Deprecated. These fields will be empty/omitted. The list of the resource IDs for the HybridAksClusters that have - /// nodes hosted on this bare metal machine. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"Field Deprecated. These fields will be empty/omitted. The list of the resource IDs for the HybridAksClusters that have nodes hosted on this bare metal machine.", - SerializedName = @"hybridAksClustersAssociatedIds", - PossibleTypes = new [] { typeof(string) })] - string[] HybridAksClustersAssociatedId { get; } - /// - /// The name of this machine represented by the host object in the Cluster's Kubernetes control plane. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The name of this machine represented by the host object in the Cluster's Kubernetes control plane.", - SerializedName = @"kubernetesNodeName", - PossibleTypes = new [] { typeof(string) })] - string KubernetesNodeName { get; } - /// The version of Kubernetes running on this machine. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The version of Kubernetes running on this machine.", - SerializedName = @"kubernetesVersion", - PossibleTypes = new [] { typeof(string) })] - string KubernetesVersion { get; } - /// - /// The cluster version that has been applied to this machine during deployment or a version update. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The cluster version that has been applied to this machine during deployment or a version update.", - SerializedName = @"machineClusterVersion", - PossibleTypes = new [] { typeof(string) })] - string MachineClusterVersion { get; set; } - /// The custom details provided by the customer. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The custom details provided by the customer.", - SerializedName = @"machineDetails", - PossibleTypes = new [] { typeof(string) })] - string MachineDetail { get; set; } - /// The OS-level hostname assigned to this machine. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The OS-level hostname assigned to this machine.", - SerializedName = @"machineName", - PossibleTypes = new [] { typeof(string) })] - string MachineName { get; set; } - /// - /// The list of roles that are assigned to the cluster node running on this machine. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The list of roles that are assigned to the cluster node running on this machine.", - SerializedName = @"machineRoles", - PossibleTypes = new [] { typeof(string) })] - string[] MachineRole { get; } - /// The unique internal identifier of the bare metal machine SKU. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The unique internal identifier of the bare metal machine SKU.", - SerializedName = @"machineSkuId", - PossibleTypes = new [] { typeof(string) })] - string MachineSkuId { get; set; } - /// The image that is currently provisioned to the OS disk. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The image that is currently provisioned to the OS disk.", - SerializedName = @"osImage", - PossibleTypes = new [] { typeof(string) })] - string OSImage { get; } - /// - /// The IPv4 address that is assigned to the bare metal machine during the cluster deployment. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The IPv4 address that is assigned to the bare metal machine during the cluster deployment.", - SerializedName = @"oamIpv4Address", - PossibleTypes = new [] { typeof(string) })] - string OamIpv4Address { get; } - /// - /// The IPv6 address that is assigned to the bare metal machine during the cluster deployment. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The IPv6 address that is assigned to the bare metal machine during the cluster deployment.", - SerializedName = @"oamIpv6Address", - PossibleTypes = new [] { typeof(string) })] - string OamIpv6Address { get; } - /// The power state derived from the baseboard management controller. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The power state derived from the baseboard management controller.", - SerializedName = @"powerState", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachinePowerState) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachinePowerState? PowerState { get; } - /// The provisioning state of the bare metal machine. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The provisioning state of the bare metal machine.", - SerializedName = @"provisioningState", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineProvisioningState) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineProvisioningState? ProvisioningState { get; } - /// The resource ID of the rack where this bare metal machine resides. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The resource ID of the rack where this bare metal machine resides.", - SerializedName = @"rackId", - PossibleTypes = new [] { typeof(string) })] - string RackId { get; set; } - /// - /// The rack slot in which this bare metal machine is located, ordered from the bottom up i.e. the lowest slot is 1. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The rack slot in which this bare metal machine is located, ordered from the bottom up i.e. the lowest slot is 1.", - SerializedName = @"rackSlot", - PossibleTypes = new [] { typeof(long) })] - long RackSlot { get; set; } - /// The indicator of whether the bare metal machine is ready to receive workloads. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The indicator of whether the bare metal machine is ready to receive workloads.", - SerializedName = @"readyState", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineReadyState) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineReadyState? ReadyState { get; } - /// The timestamp when the malware definitions were last updated. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The timestamp when the malware definitions were last updated.", - SerializedName = @"definitionsLastUpdated", - PossibleTypes = new [] { typeof(global::System.DateTime) })] - global::System.DateTime? RuntimeProtectionStatusDefinitionsLastUpdated { get; } - /// The version of the malware definitions. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The version of the malware definitions.", - SerializedName = @"definitionsVersion", - PossibleTypes = new [] { typeof(string) })] - string RuntimeProtectionStatusDefinitionsVersion { get; } - /// - /// The timestamp of the most recently completed scan, or empty if there has never been a scan. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The timestamp of the most recently completed scan, or empty if there has never been a scan.", - SerializedName = @"scanCompletedTime", - PossibleTypes = new [] { typeof(global::System.DateTime) })] - global::System.DateTime? RuntimeProtectionStatusScanCompletedTime { get; } - /// - /// The timestamp of the most recently scheduled scan, or empty if no scan has been scheduled. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The timestamp of the most recently scheduled scan, or empty if no scan has been scheduled.", - SerializedName = @"scanScheduledTime", - PossibleTypes = new [] { typeof(global::System.DateTime) })] - global::System.DateTime? RuntimeProtectionStatusScanScheduledTime { get; } - /// - /// The timestamp of the most recently started scan, or empty if there has never been a scan. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The timestamp of the most recently started scan, or empty if there has never been a scan.", - SerializedName = @"scanStartedTime", - PossibleTypes = new [] { typeof(global::System.DateTime) })] - global::System.DateTime? RuntimeProtectionStatusScanStartedTime { get; } - /// The list of statuses that represent secret rotation activity. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The list of statuses that represent secret rotation activity.", - SerializedName = @"secretRotationStatus", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretRotationStatus) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretRotationStatus[] SecretRotationStatus { get; } - /// The serial number of the bare metal machine. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The serial number of the bare metal machine.", - SerializedName = @"serialNumber", - PossibleTypes = new [] { typeof(string) })] - string SerialNumber { get; set; } - /// The discovered value of the machine's service tag. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The discovered value of the machine's service tag.", - SerializedName = @"serviceTag", - PossibleTypes = new [] { typeof(string) })] - string ServiceTag { get; } - /// - /// Field Deprecated. These fields will be empty/omitted. The list of the resource IDs for the VirtualMachines that are hosted - /// on this bare metal machine. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"Field Deprecated. These fields will be empty/omitted. The list of the resource IDs for the VirtualMachines that are hosted on this bare metal machine.", - SerializedName = @"virtualMachinesAssociatedIds", - PossibleTypes = new [] { typeof(string) })] - string[] VirtualMachinesAssociatedId { get; } - - } - /// BareMetalMachine represents the physical machine in the rack. - internal partial interface IBareMetalMachineInternal : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal - { - /// - /// The list of resource IDs for the other Microsoft.NetworkCloud resources that have attached this network. - /// - string[] AssociatedResourceId { get; set; } - /// - /// The connection string for the baseboard management controller including IP address and protocol. - /// - string BmcConnectionString { get; set; } - /// - /// The credentials of the baseboard management controller on this bare metal machine. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministrativeCredentials BmcCredentials { get; set; } - /// The password of the administrator of the device used during initialization. - System.Security.SecureString BmcCredentialsPassword { get; set; } - /// The username of the administrator of the device used during initialization. - string BmcCredentialsUsername { get; set; } - /// The MAC address of the BMC device. - string BmcMacAddress { get; set; } - /// The MAC address of a NIC connected to the PXE network. - string BootMacAddress { get; set; } - /// The resource ID of the cluster this bare metal machine is associated with. - string ClusterId { get; set; } - /// The cordon status of the bare metal machine. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineCordonStatus? CordonStatus { get; set; } - /// The more detailed status of the bare metal machine. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineDetailedStatus? DetailedStatus { get; set; } - /// The descriptive message about the current detailed status. - string DetailedStatusMessage { get; set; } - /// Resource ETag. - string Etag { get; set; } - /// The extended location of the cluster associated with the resource. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocation ExtendedLocation { get; set; } - /// The resource ID of the extended location on which the resource will be created. - string ExtendedLocationName { get; set; } - /// The extended location type, for example, CustomLocation. - string ExtendedLocationType { get; set; } - /// - /// The hardware inventory, including information acquired from the model/sku information and from the ironic inspector. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IHardwareInventory HardwareInventory { get; set; } - /// - /// Freeform data extracted from the environment about this machine. This information varies depending on the specific hardware - /// and configuration. - /// - string HardwareInventoryAdditionalHostInformation { get; set; } - /// - /// The list of network interfaces and associated details for the bare metal machine. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IHardwareInventoryNetworkInterface[] HardwareInventoryInterface { get; set; } - /// - /// Field Deprecated. Will be removed in an upcoming version. The list of network interface cards and associated details for - /// the bare metal machine. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INic[] HardwareInventoryNic { get; set; } - /// - /// The details of the latest hardware validation performed for this bare metal machine. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IHardwareValidationStatus HardwareValidationStatus { get; set; } - /// The timestamp of the hardware validation execution. - global::System.DateTime? HardwareValidationStatusLastValidationTime { get; set; } - /// The outcome of the hardware validation. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineHardwareValidationResult? HardwareValidationStatusResult { get; set; } - /// - /// Field Deprecated. These fields will be empty/omitted. The list of the resource IDs for the HybridAksClusters that have - /// nodes hosted on this bare metal machine. - /// - string[] HybridAksClustersAssociatedId { get; set; } - /// - /// The name of this machine represented by the host object in the Cluster's Kubernetes control plane. - /// - string KubernetesNodeName { get; set; } - /// The version of Kubernetes running on this machine. - string KubernetesVersion { get; set; } - /// - /// The cluster version that has been applied to this machine during deployment or a version update. - /// - string MachineClusterVersion { get; set; } - /// The custom details provided by the customer. - string MachineDetail { get; set; } - /// The OS-level hostname assigned to this machine. - string MachineName { get; set; } - /// - /// The list of roles that are assigned to the cluster node running on this machine. - /// - string[] MachineRole { get; set; } - /// The unique internal identifier of the bare metal machine SKU. - string MachineSkuId { get; set; } - /// The image that is currently provisioned to the OS disk. - string OSImage { get; set; } - /// - /// The IPv4 address that is assigned to the bare metal machine during the cluster deployment. - /// - string OamIpv4Address { get; set; } - /// - /// The IPv6 address that is assigned to the bare metal machine during the cluster deployment. - /// - string OamIpv6Address { get; set; } - /// The power state derived from the baseboard management controller. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachinePowerState? PowerState { get; set; } - /// The list of the resource properties. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineProperties Property { get; set; } - /// The provisioning state of the bare metal machine. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineProvisioningState? ProvisioningState { get; set; } - /// The resource ID of the rack where this bare metal machine resides. - string RackId { get; set; } - /// - /// The rack slot in which this bare metal machine is located, ordered from the bottom up i.e. the lowest slot is 1. - /// - long RackSlot { get; set; } - /// The indicator of whether the bare metal machine is ready to receive workloads. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineReadyState? ReadyState { get; set; } - /// The runtime protection status of the bare metal machine. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRuntimeProtectionStatus RuntimeProtectionStatus { get; set; } - /// The timestamp when the malware definitions were last updated. - global::System.DateTime? RuntimeProtectionStatusDefinitionsLastUpdated { get; set; } - /// The version of the malware definitions. - string RuntimeProtectionStatusDefinitionsVersion { get; set; } - /// - /// The timestamp of the most recently completed scan, or empty if there has never been a scan. - /// - global::System.DateTime? RuntimeProtectionStatusScanCompletedTime { get; set; } - /// - /// The timestamp of the most recently scheduled scan, or empty if no scan has been scheduled. - /// - global::System.DateTime? RuntimeProtectionStatusScanScheduledTime { get; set; } - /// - /// The timestamp of the most recently started scan, or empty if there has never been a scan. - /// - global::System.DateTime? RuntimeProtectionStatusScanStartedTime { get; set; } - /// The list of statuses that represent secret rotation activity. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretRotationStatus[] SecretRotationStatus { get; set; } - /// The serial number of the bare metal machine. - string SerialNumber { get; set; } - /// The discovered value of the machine's service tag. - string ServiceTag { get; set; } - /// - /// Field Deprecated. These fields will be empty/omitted. The list of the resource IDs for the VirtualMachines that are hosted - /// on this bare metal machine. - /// - string[] VirtualMachinesAssociatedId { get; set; } - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineConfigurationData.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineConfigurationData.PowerShell.cs deleted file mode 100644 index 5c2fe2702782..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineConfigurationData.PowerShell.cs +++ /dev/null @@ -1,242 +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.NetworkCloud.Models.Api20250201 -{ - using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; - - /// - /// BareMetalMachineConfigurationData represents configuration for the bare metal machine. - /// - [System.ComponentModel.TypeConverter(typeof(BareMetalMachineConfigurationDataTypeConverter))] - public partial class BareMetalMachineConfigurationData - { - - /// - /// 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 BareMetalMachineConfigurationData(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("BmcCredentials")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineConfigurationDataInternal)this).BmcCredentials = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministrativeCredentials) content.GetValueForProperty("BmcCredentials",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineConfigurationDataInternal)this).BmcCredentials, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AdministrativeCredentialsTypeConverter.ConvertFrom); - } - if (content.Contains("BmcConnectionString")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineConfigurationDataInternal)this).BmcConnectionString = (string) content.GetValueForProperty("BmcConnectionString",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineConfigurationDataInternal)this).BmcConnectionString, global::System.Convert.ToString); - } - if (content.Contains("BmcMacAddress")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineConfigurationDataInternal)this).BmcMacAddress = (string) content.GetValueForProperty("BmcMacAddress",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineConfigurationDataInternal)this).BmcMacAddress, global::System.Convert.ToString); - } - if (content.Contains("BootMacAddress")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineConfigurationDataInternal)this).BootMacAddress = (string) content.GetValueForProperty("BootMacAddress",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineConfigurationDataInternal)this).BootMacAddress, global::System.Convert.ToString); - } - if (content.Contains("MachineDetail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineConfigurationDataInternal)this).MachineDetail = (string) content.GetValueForProperty("MachineDetail",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineConfigurationDataInternal)this).MachineDetail, global::System.Convert.ToString); - } - if (content.Contains("MachineName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineConfigurationDataInternal)this).MachineName = (string) content.GetValueForProperty("MachineName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineConfigurationDataInternal)this).MachineName, global::System.Convert.ToString); - } - if (content.Contains("RackSlot")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineConfigurationDataInternal)this).RackSlot = (long) content.GetValueForProperty("RackSlot",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineConfigurationDataInternal)this).RackSlot, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("SerialNumber")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineConfigurationDataInternal)this).SerialNumber = (string) content.GetValueForProperty("SerialNumber",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineConfigurationDataInternal)this).SerialNumber, global::System.Convert.ToString); - } - if (content.Contains("BmcCredentialsPassword")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineConfigurationDataInternal)this).BmcCredentialsPassword = (System.Security.SecureString) content.GetValueForProperty("BmcCredentialsPassword",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineConfigurationDataInternal)this).BmcCredentialsPassword, (object ss) => (System.Security.SecureString)ss); - } - if (content.Contains("BmcCredentialsUsername")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineConfigurationDataInternal)this).BmcCredentialsUsername = (string) content.GetValueForProperty("BmcCredentialsUsername",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineConfigurationDataInternal)this).BmcCredentialsUsername, 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 BareMetalMachineConfigurationData(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("BmcCredentials")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineConfigurationDataInternal)this).BmcCredentials = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministrativeCredentials) content.GetValueForProperty("BmcCredentials",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineConfigurationDataInternal)this).BmcCredentials, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AdministrativeCredentialsTypeConverter.ConvertFrom); - } - if (content.Contains("BmcConnectionString")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineConfigurationDataInternal)this).BmcConnectionString = (string) content.GetValueForProperty("BmcConnectionString",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineConfigurationDataInternal)this).BmcConnectionString, global::System.Convert.ToString); - } - if (content.Contains("BmcMacAddress")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineConfigurationDataInternal)this).BmcMacAddress = (string) content.GetValueForProperty("BmcMacAddress",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineConfigurationDataInternal)this).BmcMacAddress, global::System.Convert.ToString); - } - if (content.Contains("BootMacAddress")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineConfigurationDataInternal)this).BootMacAddress = (string) content.GetValueForProperty("BootMacAddress",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineConfigurationDataInternal)this).BootMacAddress, global::System.Convert.ToString); - } - if (content.Contains("MachineDetail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineConfigurationDataInternal)this).MachineDetail = (string) content.GetValueForProperty("MachineDetail",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineConfigurationDataInternal)this).MachineDetail, global::System.Convert.ToString); - } - if (content.Contains("MachineName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineConfigurationDataInternal)this).MachineName = (string) content.GetValueForProperty("MachineName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineConfigurationDataInternal)this).MachineName, global::System.Convert.ToString); - } - if (content.Contains("RackSlot")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineConfigurationDataInternal)this).RackSlot = (long) content.GetValueForProperty("RackSlot",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineConfigurationDataInternal)this).RackSlot, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("SerialNumber")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineConfigurationDataInternal)this).SerialNumber = (string) content.GetValueForProperty("SerialNumber",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineConfigurationDataInternal)this).SerialNumber, global::System.Convert.ToString); - } - if (content.Contains("BmcCredentialsPassword")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineConfigurationDataInternal)this).BmcCredentialsPassword = (System.Security.SecureString) content.GetValueForProperty("BmcCredentialsPassword",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineConfigurationDataInternal)this).BmcCredentialsPassword, (object ss) => (System.Security.SecureString)ss); - } - if (content.Contains("BmcCredentialsUsername")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineConfigurationDataInternal)this).BmcCredentialsUsername = (string) content.GetValueForProperty("BmcCredentialsUsername",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineConfigurationDataInternal)this).BmcCredentialsUsername, 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.NetworkCloud.Models.Api20250201.IBareMetalMachineConfigurationData DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new BareMetalMachineConfigurationData(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.NetworkCloud.Models.Api20250201.IBareMetalMachineConfigurationData DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new BareMetalMachineConfigurationData(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.NetworkCloud.Models.Api20250201.IBareMetalMachineConfigurationData FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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(); - } - } - /// BareMetalMachineConfigurationData represents configuration for the bare metal machine. - [System.ComponentModel.TypeConverter(typeof(BareMetalMachineConfigurationDataTypeConverter))] - public partial interface IBareMetalMachineConfigurationData - - { - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineCordonParameters.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineCordonParameters.cs deleted file mode 100644 index d958871b99b3..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineCordonParameters.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.NetworkCloud.Models.Api20250201 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; - - /// - /// BareMetalMachineCordonParameters represents the body of the request to evacuate workloads from node on a bare metal machine. - /// - public partial class BareMetalMachineCordonParameters : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineCordonParameters, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineCordonParametersInternal - { - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineEvacuate? _evacuate; - - /// - /// The indicator of whether to evacuate the node workload when the bare metal machine is cordoned. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineEvacuate? Evacuate { get => this._evacuate; set => this._evacuate = value; } - - /// Creates an new instance. - public BareMetalMachineCordonParameters() - { - - } - } - /// BareMetalMachineCordonParameters represents the body of the request to evacuate workloads from node on a bare metal machine. - public partial interface IBareMetalMachineCordonParameters : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable - { - /// - /// The indicator of whether to evacuate the node workload when the bare metal machine is cordoned. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The indicator of whether to evacuate the node workload when the bare metal machine is cordoned.", - SerializedName = @"evacuate", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineEvacuate) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineEvacuate? Evacuate { get; set; } - - } - /// BareMetalMachineCordonParameters represents the body of the request to evacuate workloads from node on a bare metal machine. - internal partial interface IBareMetalMachineCordonParametersInternal - - { - /// - /// The indicator of whether to evacuate the node workload when the bare metal machine is cordoned. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineEvacuate? Evacuate { get; set; } - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineKeySet.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineKeySet.PowerShell.cs deleted file mode 100644 index 84aac268f58a..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineKeySet.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.NetworkCloud.Models.Api20250201 -{ - using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; - - /// BareMetalMachineKeySet represents the bare metal machine key set. - [System.ComponentModel.TypeConverter(typeof(BareMetalMachineKeySetTypeConverter))] - public partial class BareMetalMachineKeySet - { - - /// - /// 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 BareMetalMachineKeySet(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("ExtendedLocation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetInternal)this).ExtendedLocation = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocation) content.GetValueForProperty("ExtendedLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetInternal)this).ExtendedLocation, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ExtendedLocationTypeConverter.ConvertFrom); - } - if (content.Contains("Property")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BareMetalMachineKeySetPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Etag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetInternal)this).Etag, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)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("SystemDataCreatedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataLastModifiedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("SystemData")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.SystemDataTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Type, global::System.Convert.ToString); - } - if (content.Contains("Tag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.TrackedResourceTagsTypeConverter.ConvertFrom); - } - if (content.Contains("Location")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); - } - if (content.Contains("ExtendedLocationName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetInternal)this).ExtendedLocationName = (string) content.GetValueForProperty("ExtendedLocationName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetInternal)this).ExtendedLocationName, global::System.Convert.ToString); - } - if (content.Contains("ExtendedLocationType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetInternal)this).ExtendedLocationType = (string) content.GetValueForProperty("ExtendedLocationType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetInternal)this).ExtendedLocationType, global::System.Convert.ToString); - } - if (content.Contains("AzureGroupId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetInternal)this).AzureGroupId = (string) content.GetValueForProperty("AzureGroupId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetInternal)this).AzureGroupId, global::System.Convert.ToString); - } - if (content.Contains("DetailedStatus")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetInternal)this).DetailedStatus = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineKeySetDetailedStatus?) content.GetValueForProperty("DetailedStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetInternal)this).DetailedStatus, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineKeySetDetailedStatus.CreateFrom); - } - if (content.Contains("DetailedStatusMessage")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetInternal)this).DetailedStatusMessage = (string) content.GetValueForProperty("DetailedStatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetInternal)this).DetailedStatusMessage, global::System.Convert.ToString); - } - if (content.Contains("Expiration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetInternal)this).Expiration = (global::System.DateTime) content.GetValueForProperty("Expiration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetInternal)this).Expiration, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("JumpHostsAllowed")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetInternal)this).JumpHostsAllowed = (string[]) content.GetValueForProperty("JumpHostsAllowed",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetInternal)this).JumpHostsAllowed, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("LastValidation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetInternal)this).LastValidation = (global::System.DateTime?) content.GetValueForProperty("LastValidation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetInternal)this).LastValidation, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("OSGroupName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetInternal)this).OSGroupName = (string) content.GetValueForProperty("OSGroupName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetInternal)this).OSGroupName, global::System.Convert.ToString); - } - if (content.Contains("PrivilegeLevel")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetInternal)this).PrivilegeLevel = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineKeySetPrivilegeLevel) content.GetValueForProperty("PrivilegeLevel",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetInternal)this).PrivilegeLevel, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineKeySetPrivilegeLevel.CreateFrom); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineKeySetProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineKeySetProvisioningState.CreateFrom); - } - if (content.Contains("UserList")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetInternal)this).UserList = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKeySetUser[]) content.GetValueForProperty("UserList",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetInternal)this).UserList, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.KeySetUserTypeConverter.ConvertFrom)); - } - if (content.Contains("UserListStatus")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetInternal)this).UserListStatus = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKeySetUserStatus[]) content.GetValueForProperty("UserListStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetInternal)this).UserListStatus, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.KeySetUserStatusTypeConverter.ConvertFrom)); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal BareMetalMachineKeySet(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("ExtendedLocation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetInternal)this).ExtendedLocation = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocation) content.GetValueForProperty("ExtendedLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetInternal)this).ExtendedLocation, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ExtendedLocationTypeConverter.ConvertFrom); - } - if (content.Contains("Property")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BareMetalMachineKeySetPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Etag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetInternal)this).Etag, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)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("SystemDataCreatedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataLastModifiedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("SystemData")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.SystemDataTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Type, global::System.Convert.ToString); - } - if (content.Contains("Tag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.TrackedResourceTagsTypeConverter.ConvertFrom); - } - if (content.Contains("Location")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); - } - if (content.Contains("ExtendedLocationName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetInternal)this).ExtendedLocationName = (string) content.GetValueForProperty("ExtendedLocationName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetInternal)this).ExtendedLocationName, global::System.Convert.ToString); - } - if (content.Contains("ExtendedLocationType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetInternal)this).ExtendedLocationType = (string) content.GetValueForProperty("ExtendedLocationType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetInternal)this).ExtendedLocationType, global::System.Convert.ToString); - } - if (content.Contains("AzureGroupId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetInternal)this).AzureGroupId = (string) content.GetValueForProperty("AzureGroupId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetInternal)this).AzureGroupId, global::System.Convert.ToString); - } - if (content.Contains("DetailedStatus")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetInternal)this).DetailedStatus = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineKeySetDetailedStatus?) content.GetValueForProperty("DetailedStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetInternal)this).DetailedStatus, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineKeySetDetailedStatus.CreateFrom); - } - if (content.Contains("DetailedStatusMessage")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetInternal)this).DetailedStatusMessage = (string) content.GetValueForProperty("DetailedStatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetInternal)this).DetailedStatusMessage, global::System.Convert.ToString); - } - if (content.Contains("Expiration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetInternal)this).Expiration = (global::System.DateTime) content.GetValueForProperty("Expiration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetInternal)this).Expiration, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("JumpHostsAllowed")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetInternal)this).JumpHostsAllowed = (string[]) content.GetValueForProperty("JumpHostsAllowed",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetInternal)this).JumpHostsAllowed, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("LastValidation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetInternal)this).LastValidation = (global::System.DateTime?) content.GetValueForProperty("LastValidation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetInternal)this).LastValidation, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("OSGroupName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetInternal)this).OSGroupName = (string) content.GetValueForProperty("OSGroupName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetInternal)this).OSGroupName, global::System.Convert.ToString); - } - if (content.Contains("PrivilegeLevel")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetInternal)this).PrivilegeLevel = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineKeySetPrivilegeLevel) content.GetValueForProperty("PrivilegeLevel",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetInternal)this).PrivilegeLevel, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineKeySetPrivilegeLevel.CreateFrom); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineKeySetProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineKeySetProvisioningState.CreateFrom); - } - if (content.Contains("UserList")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetInternal)this).UserList = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKeySetUser[]) content.GetValueForProperty("UserList",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetInternal)this).UserList, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.KeySetUserTypeConverter.ConvertFrom)); - } - if (content.Contains("UserListStatus")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetInternal)this).UserListStatus = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKeySetUserStatus[]) content.GetValueForProperty("UserListStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetInternal)this).UserListStatus, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.KeySetUserStatusTypeConverter.ConvertFrom)); - } - AfterDeserializePSObject(content); - } - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySet DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new BareMetalMachineKeySet(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.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySet DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new BareMetalMachineKeySet(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.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySet FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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(); - } - } - /// BareMetalMachineKeySet represents the bare metal machine key set. - [System.ComponentModel.TypeConverter(typeof(BareMetalMachineKeySetTypeConverter))] - public partial interface IBareMetalMachineKeySet - - { - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineKeySet.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineKeySet.cs deleted file mode 100644 index 26c21325bc62..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineKeySet.cs +++ /dev/null @@ -1,391 +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.NetworkCloud.Models.Api20250201 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; - - /// BareMetalMachineKeySet represents the bare metal machine key set. - public partial class BareMetalMachineKeySet : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetInternal, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IValidates - { - /// - /// Backing field for Inherited model - /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResource __trackedResource = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.TrackedResource(); - - /// - /// The object ID of Azure Active Directory group that all users in the list must be in for access to be granted. Users that - /// are not in the group will not have access. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string AzureGroupId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetPropertiesInternal)Property).AzureGroupId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetPropertiesInternal)Property).AzureGroupId = value ; } - - /// The more detailed status of the key set. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineKeySetDetailedStatus? DetailedStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetPropertiesInternal)Property).DetailedStatus; } - - /// The descriptive message about the current detailed status. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string DetailedStatusMessage { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetPropertiesInternal)Property).DetailedStatusMessage; } - - /// Backing field for property. - private string _etag; - - /// Resource ETag. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string Etag { get => this._etag; } - - /// - /// The date and time after which the users in this key set will be removed from the bare metal machines. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public global::System.DateTime Expiration { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetPropertiesInternal)Property).Expiration; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetPropertiesInternal)Property).Expiration = value ; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocation _extendedLocation; - - /// The extended location of the cluster associated with the resource. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocation ExtendedLocation { get => (this._extendedLocation = this._extendedLocation ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ExtendedLocation()); set => this._extendedLocation = value; } - - /// The resource ID of the extended location on which the resource will be created. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string ExtendedLocationName { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocationInternal)ExtendedLocation).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocationInternal)ExtendedLocation).Name = value ; } - - /// The extended location type, for example, CustomLocation. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string ExtendedLocationType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocationInternal)ExtendedLocation).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocationInternal)ExtendedLocation).Type = value ; } - - /// - /// Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).Id; } - - /// - /// The list of IP addresses of jump hosts with management network access from which a login will be allowed for the users. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string[] JumpHostsAllowed { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetPropertiesInternal)Property).JumpHostsAllowed; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetPropertiesInternal)Property).JumpHostsAllowed = value ; } - - /// The last time this key set was validated. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public global::System.DateTime? LastValidation { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetPropertiesInternal)Property).LastValidation; } - - /// The geo-location where the resource lives - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)__trackedResource).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)__trackedResource).Location = value ; } - - /// Internal Acessors for DetailedStatus - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineKeySetDetailedStatus? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetInternal.DetailedStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetPropertiesInternal)Property).DetailedStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetPropertiesInternal)Property).DetailedStatus = value; } - - /// Internal Acessors for DetailedStatusMessage - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetInternal.DetailedStatusMessage { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetPropertiesInternal)Property).DetailedStatusMessage; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetPropertiesInternal)Property).DetailedStatusMessage = value; } - - /// Internal Acessors for Etag - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetInternal.Etag { get => this._etag; set { {_etag = value;} } } - - /// Internal Acessors for ExtendedLocation - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocation Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetInternal.ExtendedLocation { get => (this._extendedLocation = this._extendedLocation ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ExtendedLocation()); set { {_extendedLocation = value;} } } - - /// Internal Acessors for LastValidation - global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetInternal.LastValidation { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetPropertiesInternal)Property).LastValidation; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetPropertiesInternal)Property).LastValidation = value; } - - /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetProperties Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BareMetalMachineKeySetProperties()); set { {_property = value;} } } - - /// Internal Acessors for ProvisioningState - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineKeySetProvisioningState? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetPropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetPropertiesInternal)Property).ProvisioningState = value; } - - /// Internal Acessors for UserListStatus - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKeySetUserStatus[] Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetInternal.UserListStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetPropertiesInternal)Property).UserListStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetPropertiesInternal)Property).UserListStatus = value; } - - /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).Id = value; } - - /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).Name = value; } - - /// Internal Acessors for SystemData - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ISystemData Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal.SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemData; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemData = value; } - - /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).Type = value; } - - /// The name of the resource - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).Name; } - - /// - /// The name of the group that users will be assigned to on the operating system of the machines. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string OSGroupName { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetPropertiesInternal)Property).OSGroupName; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetPropertiesInternal)Property).OSGroupName = value ?? null; } - - /// The access level allowed for the users in this key set. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineKeySetPrivilegeLevel PrivilegeLevel { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetPropertiesInternal)Property).PrivilegeLevel; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetPropertiesInternal)Property).PrivilegeLevel = value ; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetProperties _property; - - /// The list of the resource properties. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BareMetalMachineKeySetProperties()); set => this._property = value; } - - /// The provisioning state of the bare metal machine key set. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineKeySetProvisioningState? ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetPropertiesInternal)Property).ProvisioningState; } - - /// Gets the resource group name - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string ResourceGroupName { get => (new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Success ? new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Groups["resourceGroupName"].Value : null); } - - /// - /// Azure Resource Manager metadata containing createdBy and modifiedBy information. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ISystemData SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemData; } - - /// The timestamp of resource creation (UTC). - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataCreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataCreatedAt = value ?? default(global::System.DateTime); } - - /// The identity that created the resource. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataCreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataCreatedBy = value ?? null; } - - /// The type of identity that created the resource. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType? SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataCreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataCreatedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType)""); } - - /// The timestamp of resource last modification (UTC) - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataLastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataLastModifiedAt = value ?? default(global::System.DateTime); } - - /// The identity that last modified the resource. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataLastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataLastModifiedBy = value ?? null; } - - /// The type of identity that last modified the resource. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType? SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataLastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataLastModifiedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType)""); } - - /// Resource tags. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)__trackedResource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.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.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).Type; } - - /// The unique list of permitted users. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKeySetUser[] UserList { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetPropertiesInternal)Property).UserList; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetPropertiesInternal)Property).UserList = value ; } - - /// The status evaluation of each user. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKeySetUserStatus[] UserListStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetPropertiesInternal)Property).UserListStatus; } - - /// Creates an new instance. - public BareMetalMachineKeySet() - { - - } - - /// Validates that this object meets the validation criteria. - /// an instance that will receive validation - /// events. - /// - /// A that will be complete when validation is completed. - /// - public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) - { - await eventListener.AssertNotNull(nameof(__trackedResource), __trackedResource); - await eventListener.AssertObjectIsValid(nameof(__trackedResource), __trackedResource); - } - } - /// BareMetalMachineKeySet represents the bare metal machine key set. - public partial interface IBareMetalMachineKeySet : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResource - { - /// - /// The object ID of Azure Active Directory group that all users in the list must be in for access to be granted. Users that - /// are not in the group will not have access. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The object ID of Azure Active Directory group that all users in the list must be in for access to be granted. Users that are not in the group will not have access.", - SerializedName = @"azureGroupId", - PossibleTypes = new [] { typeof(string) })] - string AzureGroupId { get; set; } - /// The more detailed status of the key set. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The more detailed status of the key set.", - SerializedName = @"detailedStatus", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineKeySetDetailedStatus) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineKeySetDetailedStatus? DetailedStatus { get; } - /// The descriptive message about the current detailed status. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The descriptive message about the current detailed status.", - SerializedName = @"detailedStatusMessage", - PossibleTypes = new [] { typeof(string) })] - string DetailedStatusMessage { get; } - /// Resource ETag. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"Resource ETag.", - SerializedName = @"etag", - PossibleTypes = new [] { typeof(string) })] - string Etag { get; } - /// - /// The date and time after which the users in this key set will be removed from the bare metal machines. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The date and time after which the users in this key set will be removed from the bare metal machines.", - SerializedName = @"expiration", - PossibleTypes = new [] { typeof(global::System.DateTime) })] - global::System.DateTime Expiration { get; set; } - /// The resource ID of the extended location on which the resource will be created. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The resource ID of the extended location on which the resource will be created.", - SerializedName = @"name", - PossibleTypes = new [] { typeof(string) })] - string ExtendedLocationName { get; set; } - /// The extended location type, for example, CustomLocation. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The extended location type, for example, CustomLocation.", - SerializedName = @"type", - PossibleTypes = new [] { typeof(string) })] - string ExtendedLocationType { get; set; } - /// - /// The list of IP addresses of jump hosts with management network access from which a login will be allowed for the users. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The list of IP addresses of jump hosts with management network access from which a login will be allowed for the users.", - SerializedName = @"jumpHostsAllowed", - PossibleTypes = new [] { typeof(string) })] - string[] JumpHostsAllowed { get; set; } - /// The last time this key set was validated. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The last time this key set was validated.", - SerializedName = @"lastValidation", - PossibleTypes = new [] { typeof(global::System.DateTime) })] - global::System.DateTime? LastValidation { get; } - /// - /// The name of the group that users will be assigned to on the operating system of the machines. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The name of the group that users will be assigned to on the operating system of the machines.", - SerializedName = @"osGroupName", - PossibleTypes = new [] { typeof(string) })] - string OSGroupName { get; set; } - /// The access level allowed for the users in this key set. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The access level allowed for the users in this key set.", - SerializedName = @"privilegeLevel", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineKeySetPrivilegeLevel) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineKeySetPrivilegeLevel PrivilegeLevel { get; set; } - /// The provisioning state of the bare metal machine key set. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The provisioning state of the bare metal machine key set.", - SerializedName = @"provisioningState", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineKeySetProvisioningState) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineKeySetProvisioningState? ProvisioningState { get; } - /// The unique list of permitted users. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The unique list of permitted users.", - SerializedName = @"userList", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKeySetUser) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKeySetUser[] UserList { get; set; } - /// The status evaluation of each user. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The status evaluation of each user.", - SerializedName = @"userListStatus", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKeySetUserStatus) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKeySetUserStatus[] UserListStatus { get; } - - } - /// BareMetalMachineKeySet represents the bare metal machine key set. - internal partial interface IBareMetalMachineKeySetInternal : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal - { - /// - /// The object ID of Azure Active Directory group that all users in the list must be in for access to be granted. Users that - /// are not in the group will not have access. - /// - string AzureGroupId { get; set; } - /// The more detailed status of the key set. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineKeySetDetailedStatus? DetailedStatus { get; set; } - /// The descriptive message about the current detailed status. - string DetailedStatusMessage { get; set; } - /// Resource ETag. - string Etag { get; set; } - /// - /// The date and time after which the users in this key set will be removed from the bare metal machines. - /// - global::System.DateTime Expiration { get; set; } - /// The extended location of the cluster associated with the resource. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocation ExtendedLocation { get; set; } - /// The resource ID of the extended location on which the resource will be created. - string ExtendedLocationName { get; set; } - /// The extended location type, for example, CustomLocation. - string ExtendedLocationType { get; set; } - /// - /// The list of IP addresses of jump hosts with management network access from which a login will be allowed for the users. - /// - string[] JumpHostsAllowed { get; set; } - /// The last time this key set was validated. - global::System.DateTime? LastValidation { get; set; } - /// - /// The name of the group that users will be assigned to on the operating system of the machines. - /// - string OSGroupName { get; set; } - /// The access level allowed for the users in this key set. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineKeySetPrivilegeLevel PrivilegeLevel { get; set; } - /// The list of the resource properties. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetProperties Property { get; set; } - /// The provisioning state of the bare metal machine key set. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineKeySetProvisioningState? ProvisioningState { get; set; } - /// The unique list of permitted users. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKeySetUser[] UserList { get; set; } - /// The status evaluation of each user. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKeySetUserStatus[] UserListStatus { get; set; } - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineKeySetList.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineKeySetList.cs deleted file mode 100644 index 4363097db266..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineKeySetList.cs +++ /dev/null @@ -1,68 +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.NetworkCloud.Models.Api20250201 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; - - /// BareMetalMachineKeySetList represents a list of bare metal machine key sets. - public partial class BareMetalMachineKeySetList : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetList, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetListInternal - { - - /// Backing field for property. - private string _nextLink; - - /// The link used to get the next page of operations. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string NextLink { get => this._nextLink; set => this._nextLink = value; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySet[] _value; - - /// The list of bare metal machine key sets. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySet[] Value { get => this._value; set => this._value = value; } - - /// Creates an new instance. - public BareMetalMachineKeySetList() - { - - } - } - /// BareMetalMachineKeySetList represents a list of bare metal machine key sets. - public partial interface IBareMetalMachineKeySetList : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable - { - /// The link used to get the next page of operations. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The link used to get the next page of operations.", - SerializedName = @"nextLink", - PossibleTypes = new [] { typeof(string) })] - string NextLink { get; set; } - /// The list of bare metal machine key sets. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The list of bare metal machine key sets.", - SerializedName = @"value", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySet) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySet[] Value { get; set; } - - } - /// BareMetalMachineKeySetList represents a list of bare metal machine key sets. - internal partial interface IBareMetalMachineKeySetListInternal - - { - /// The link used to get the next page of operations. - string NextLink { get; set; } - /// The list of bare metal machine key sets. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySet[] Value { get; set; } - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineKeySetPatchParameters.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineKeySetPatchParameters.PowerShell.cs deleted file mode 100644 index 35fc0a6a576e..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineKeySetPatchParameters.PowerShell.cs +++ /dev/null @@ -1,203 +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.NetworkCloud.Models.Api20250201 -{ - using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; - - /// - /// BareMetalMachineKeySetPatchParameters represents the body of the request to patch the bare metal machine key set. - /// - [System.ComponentModel.TypeConverter(typeof(BareMetalMachineKeySetPatchParametersTypeConverter))] - public partial class BareMetalMachineKeySetPatchParameters - { - - /// - /// 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 BareMetalMachineKeySetPatchParameters(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.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetPatchParametersInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetPatchProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetPatchParametersInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BareMetalMachineKeySetPatchPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Tag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetPatchParametersInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetPatchParametersTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetPatchParametersInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BareMetalMachineKeySetPatchParametersTagsTypeConverter.ConvertFrom); - } - if (content.Contains("Expiration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetPatchParametersInternal)this).Expiration = (global::System.DateTime?) content.GetValueForProperty("Expiration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetPatchParametersInternal)this).Expiration, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("JumpHostsAllowed")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetPatchParametersInternal)this).JumpHostsAllowed = (string[]) content.GetValueForProperty("JumpHostsAllowed",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetPatchParametersInternal)this).JumpHostsAllowed, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("UserList")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetPatchParametersInternal)this).UserList = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKeySetUser[]) content.GetValueForProperty("UserList",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetPatchParametersInternal)this).UserList, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.KeySetUserTypeConverter.ConvertFrom)); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal BareMetalMachineKeySetPatchParameters(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.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetPatchParametersInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetPatchProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetPatchParametersInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BareMetalMachineKeySetPatchPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Tag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetPatchParametersInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetPatchParametersTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetPatchParametersInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BareMetalMachineKeySetPatchParametersTagsTypeConverter.ConvertFrom); - } - if (content.Contains("Expiration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetPatchParametersInternal)this).Expiration = (global::System.DateTime?) content.GetValueForProperty("Expiration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetPatchParametersInternal)this).Expiration, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("JumpHostsAllowed")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetPatchParametersInternal)this).JumpHostsAllowed = (string[]) content.GetValueForProperty("JumpHostsAllowed",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetPatchParametersInternal)this).JumpHostsAllowed, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("UserList")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetPatchParametersInternal)this).UserList = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKeySetUser[]) content.GetValueForProperty("UserList",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetPatchParametersInternal)this).UserList, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.KeySetUserTypeConverter.ConvertFrom)); - } - AfterDeserializePSObject(content); - } - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetPatchParameters DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new BareMetalMachineKeySetPatchParameters(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.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetPatchParameters DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new BareMetalMachineKeySetPatchParameters(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.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetPatchParameters FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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(); - } - } - /// BareMetalMachineKeySetPatchParameters represents the body of the request to patch the bare metal machine key set. - [System.ComponentModel.TypeConverter(typeof(BareMetalMachineKeySetPatchParametersTypeConverter))] - public partial interface IBareMetalMachineKeySetPatchParameters - - { - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineKeySetPatchParameters.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineKeySetPatchParameters.cs deleted file mode 100644 index 22d2c5fab8d4..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineKeySetPatchParameters.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.NetworkCloud.Models.Api20250201 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; - - /// - /// BareMetalMachineKeySetPatchParameters represents the body of the request to patch the bare metal machine key set. - /// - public partial class BareMetalMachineKeySetPatchParameters : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetPatchParameters, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetPatchParametersInternal - { - - /// - /// The date and time after which the users in this key set will be removed from the bare metal machines. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public global::System.DateTime? Expiration { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetPatchPropertiesInternal)Property).Expiration; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetPatchPropertiesInternal)Property).Expiration = value ?? default(global::System.DateTime); } - - /// - /// The list of IP addresses of jump hosts with management network access from which a login will be allowed for the users. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string[] JumpHostsAllowed { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetPatchPropertiesInternal)Property).JumpHostsAllowed; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetPatchPropertiesInternal)Property).JumpHostsAllowed = value ?? null /* arrayOf */; } - - /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetPatchProperties Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetPatchParametersInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BareMetalMachineKeySetPatchProperties()); set { {_property = value;} } } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetPatchProperties _property; - - /// The list of the resource properties. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetPatchProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BareMetalMachineKeySetPatchProperties()); set => this._property = value; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetPatchParametersTags _tag; - - /// The Azure resource tags that will replace the existing ones. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetPatchParametersTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BareMetalMachineKeySetPatchParametersTags()); set => this._tag = value; } - - /// The unique list of permitted users. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKeySetUser[] UserList { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetPatchPropertiesInternal)Property).UserList; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetPatchPropertiesInternal)Property).UserList = value ?? null /* arrayOf */; } - - /// Creates an new instance. - public BareMetalMachineKeySetPatchParameters() - { - - } - } - /// BareMetalMachineKeySetPatchParameters represents the body of the request to patch the bare metal machine key set. - public partial interface IBareMetalMachineKeySetPatchParameters : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable - { - /// - /// The date and time after which the users in this key set will be removed from the bare metal machines. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The date and time after which the users in this key set will be removed from the bare metal machines.", - SerializedName = @"expiration", - PossibleTypes = new [] { typeof(global::System.DateTime) })] - global::System.DateTime? Expiration { get; set; } - /// - /// The list of IP addresses of jump hosts with management network access from which a login will be allowed for the users. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The list of IP addresses of jump hosts with management network access from which a login will be allowed for the users.", - SerializedName = @"jumpHostsAllowed", - PossibleTypes = new [] { typeof(string) })] - string[] JumpHostsAllowed { get; set; } - /// The Azure resource tags that will replace the existing ones. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The Azure resource tags that will replace the existing ones.", - SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetPatchParametersTags) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetPatchParametersTags Tag { get; set; } - /// The unique list of permitted users. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The unique list of permitted users.", - SerializedName = @"userList", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKeySetUser) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKeySetUser[] UserList { get; set; } - - } - /// BareMetalMachineKeySetPatchParameters represents the body of the request to patch the bare metal machine key set. - internal partial interface IBareMetalMachineKeySetPatchParametersInternal - - { - /// - /// The date and time after which the users in this key set will be removed from the bare metal machines. - /// - global::System.DateTime? Expiration { get; set; } - /// - /// The list of IP addresses of jump hosts with management network access from which a login will be allowed for the users. - /// - string[] JumpHostsAllowed { get; set; } - /// The list of the resource properties. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetPatchProperties Property { get; set; } - /// The Azure resource tags that will replace the existing ones. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetPatchParametersTags Tag { get; set; } - /// The unique list of permitted users. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKeySetUser[] UserList { get; set; } - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineKeySetPatchProperties.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineKeySetPatchProperties.PowerShell.cs deleted file mode 100644 index d26458682604..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineKeySetPatchProperties.PowerShell.cs +++ /dev/null @@ -1,187 +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.NetworkCloud.Models.Api20250201 -{ - using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; - - /// - /// BareMetalMachineKeySetPatchProperties represents the properties of bare metal machine key set that can be patched. - /// - [System.ComponentModel.TypeConverter(typeof(BareMetalMachineKeySetPatchPropertiesTypeConverter))] - public partial class BareMetalMachineKeySetPatchProperties - { - - /// - /// 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 BareMetalMachineKeySetPatchProperties(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("Expiration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetPatchPropertiesInternal)this).Expiration = (global::System.DateTime?) content.GetValueForProperty("Expiration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetPatchPropertiesInternal)this).Expiration, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("JumpHostsAllowed")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetPatchPropertiesInternal)this).JumpHostsAllowed = (string[]) content.GetValueForProperty("JumpHostsAllowed",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetPatchPropertiesInternal)this).JumpHostsAllowed, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("UserList")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetPatchPropertiesInternal)this).UserList = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKeySetUser[]) content.GetValueForProperty("UserList",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetPatchPropertiesInternal)this).UserList, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.KeySetUserTypeConverter.ConvertFrom)); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal BareMetalMachineKeySetPatchProperties(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("Expiration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetPatchPropertiesInternal)this).Expiration = (global::System.DateTime?) content.GetValueForProperty("Expiration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetPatchPropertiesInternal)this).Expiration, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("JumpHostsAllowed")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetPatchPropertiesInternal)this).JumpHostsAllowed = (string[]) content.GetValueForProperty("JumpHostsAllowed",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetPatchPropertiesInternal)this).JumpHostsAllowed, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("UserList")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetPatchPropertiesInternal)this).UserList = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKeySetUser[]) content.GetValueForProperty("UserList",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetPatchPropertiesInternal)this).UserList, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.KeySetUserTypeConverter.ConvertFrom)); - } - AfterDeserializePSObject(content); - } - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetPatchProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new BareMetalMachineKeySetPatchProperties(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.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetPatchProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new BareMetalMachineKeySetPatchProperties(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.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetPatchProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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(); - } - } - /// BareMetalMachineKeySetPatchProperties represents the properties of bare metal machine key set that can be patched. - [System.ComponentModel.TypeConverter(typeof(BareMetalMachineKeySetPatchPropertiesTypeConverter))] - public partial interface IBareMetalMachineKeySetPatchProperties - - { - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineKeySetProperties.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineKeySetProperties.PowerShell.cs deleted file mode 100644 index 311181eae73e..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineKeySetProperties.PowerShell.cs +++ /dev/null @@ -1,248 +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.NetworkCloud.Models.Api20250201 -{ - using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; - - /// - /// BareMetalMachineKeySetProperties represents the properties of bare metal machine key set. - /// - [System.ComponentModel.TypeConverter(typeof(BareMetalMachineKeySetPropertiesTypeConverter))] - public partial class BareMetalMachineKeySetProperties - { - - /// - /// 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 BareMetalMachineKeySetProperties(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("AzureGroupId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetPropertiesInternal)this).AzureGroupId = (string) content.GetValueForProperty("AzureGroupId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetPropertiesInternal)this).AzureGroupId, global::System.Convert.ToString); - } - if (content.Contains("DetailedStatus")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetPropertiesInternal)this).DetailedStatus = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineKeySetDetailedStatus?) content.GetValueForProperty("DetailedStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetPropertiesInternal)this).DetailedStatus, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineKeySetDetailedStatus.CreateFrom); - } - if (content.Contains("DetailedStatusMessage")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetPropertiesInternal)this).DetailedStatusMessage = (string) content.GetValueForProperty("DetailedStatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetPropertiesInternal)this).DetailedStatusMessage, global::System.Convert.ToString); - } - if (content.Contains("Expiration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetPropertiesInternal)this).Expiration = (global::System.DateTime) content.GetValueForProperty("Expiration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetPropertiesInternal)this).Expiration, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("JumpHostsAllowed")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetPropertiesInternal)this).JumpHostsAllowed = (string[]) content.GetValueForProperty("JumpHostsAllowed",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetPropertiesInternal)this).JumpHostsAllowed, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("LastValidation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetPropertiesInternal)this).LastValidation = (global::System.DateTime?) content.GetValueForProperty("LastValidation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetPropertiesInternal)this).LastValidation, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("OSGroupName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetPropertiesInternal)this).OSGroupName = (string) content.GetValueForProperty("OSGroupName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetPropertiesInternal)this).OSGroupName, global::System.Convert.ToString); - } - if (content.Contains("PrivilegeLevel")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetPropertiesInternal)this).PrivilegeLevel = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineKeySetPrivilegeLevel) content.GetValueForProperty("PrivilegeLevel",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetPropertiesInternal)this).PrivilegeLevel, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineKeySetPrivilegeLevel.CreateFrom); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetPropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineKeySetProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetPropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineKeySetProvisioningState.CreateFrom); - } - if (content.Contains("UserList")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetPropertiesInternal)this).UserList = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKeySetUser[]) content.GetValueForProperty("UserList",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetPropertiesInternal)this).UserList, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.KeySetUserTypeConverter.ConvertFrom)); - } - if (content.Contains("UserListStatus")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetPropertiesInternal)this).UserListStatus = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKeySetUserStatus[]) content.GetValueForProperty("UserListStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetPropertiesInternal)this).UserListStatus, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.KeySetUserStatusTypeConverter.ConvertFrom)); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal BareMetalMachineKeySetProperties(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("AzureGroupId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetPropertiesInternal)this).AzureGroupId = (string) content.GetValueForProperty("AzureGroupId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetPropertiesInternal)this).AzureGroupId, global::System.Convert.ToString); - } - if (content.Contains("DetailedStatus")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetPropertiesInternal)this).DetailedStatus = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineKeySetDetailedStatus?) content.GetValueForProperty("DetailedStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetPropertiesInternal)this).DetailedStatus, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineKeySetDetailedStatus.CreateFrom); - } - if (content.Contains("DetailedStatusMessage")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetPropertiesInternal)this).DetailedStatusMessage = (string) content.GetValueForProperty("DetailedStatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetPropertiesInternal)this).DetailedStatusMessage, global::System.Convert.ToString); - } - if (content.Contains("Expiration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetPropertiesInternal)this).Expiration = (global::System.DateTime) content.GetValueForProperty("Expiration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetPropertiesInternal)this).Expiration, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("JumpHostsAllowed")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetPropertiesInternal)this).JumpHostsAllowed = (string[]) content.GetValueForProperty("JumpHostsAllowed",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetPropertiesInternal)this).JumpHostsAllowed, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("LastValidation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetPropertiesInternal)this).LastValidation = (global::System.DateTime?) content.GetValueForProperty("LastValidation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetPropertiesInternal)this).LastValidation, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("OSGroupName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetPropertiesInternal)this).OSGroupName = (string) content.GetValueForProperty("OSGroupName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetPropertiesInternal)this).OSGroupName, global::System.Convert.ToString); - } - if (content.Contains("PrivilegeLevel")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetPropertiesInternal)this).PrivilegeLevel = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineKeySetPrivilegeLevel) content.GetValueForProperty("PrivilegeLevel",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetPropertiesInternal)this).PrivilegeLevel, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineKeySetPrivilegeLevel.CreateFrom); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetPropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineKeySetProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetPropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineKeySetProvisioningState.CreateFrom); - } - if (content.Contains("UserList")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetPropertiesInternal)this).UserList = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKeySetUser[]) content.GetValueForProperty("UserList",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetPropertiesInternal)this).UserList, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.KeySetUserTypeConverter.ConvertFrom)); - } - if (content.Contains("UserListStatus")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetPropertiesInternal)this).UserListStatus = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKeySetUserStatus[]) content.GetValueForProperty("UserListStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetPropertiesInternal)this).UserListStatus, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.KeySetUserStatusTypeConverter.ConvertFrom)); - } - AfterDeserializePSObject(content); - } - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new BareMetalMachineKeySetProperties(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.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new BareMetalMachineKeySetProperties(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.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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(); - } - } - /// BareMetalMachineKeySetProperties represents the properties of bare metal machine key set. - [System.ComponentModel.TypeConverter(typeof(BareMetalMachineKeySetPropertiesTypeConverter))] - public partial interface IBareMetalMachineKeySetProperties - - { - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineKeySetProperties.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineKeySetProperties.cs deleted file mode 100644 index cde922568efc..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineKeySetProperties.cs +++ /dev/null @@ -1,265 +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.NetworkCloud.Models.Api20250201 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; - - /// - /// BareMetalMachineKeySetProperties represents the properties of bare metal machine key set. - /// - public partial class BareMetalMachineKeySetProperties : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetProperties, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetPropertiesInternal - { - - /// Backing field for property. - private string _azureGroupId; - - /// - /// The object ID of Azure Active Directory group that all users in the list must be in for access to be granted. Users that - /// are not in the group will not have access. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string AzureGroupId { get => this._azureGroupId; set => this._azureGroupId = value; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineKeySetDetailedStatus? _detailedStatus; - - /// The more detailed status of the key set. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineKeySetDetailedStatus? DetailedStatus { get => this._detailedStatus; } - - /// Backing field for property. - private string _detailedStatusMessage; - - /// The descriptive message about the current detailed status. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string DetailedStatusMessage { get => this._detailedStatusMessage; } - - /// Backing field for property. - private global::System.DateTime _expiration; - - /// - /// The date and time after which the users in this key set will be removed from the bare metal machines. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public global::System.DateTime Expiration { get => this._expiration; set => this._expiration = value; } - - /// Backing field for property. - private string[] _jumpHostsAllowed; - - /// - /// The list of IP addresses of jump hosts with management network access from which a login will be allowed for the users. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string[] JumpHostsAllowed { get => this._jumpHostsAllowed; set => this._jumpHostsAllowed = value; } - - /// Backing field for property. - private global::System.DateTime? _lastValidation; - - /// The last time this key set was validated. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public global::System.DateTime? LastValidation { get => this._lastValidation; } - - /// Internal Acessors for DetailedStatus - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineKeySetDetailedStatus? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetPropertiesInternal.DetailedStatus { get => this._detailedStatus; set { {_detailedStatus = value;} } } - - /// Internal Acessors for DetailedStatusMessage - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetPropertiesInternal.DetailedStatusMessage { get => this._detailedStatusMessage; set { {_detailedStatusMessage = value;} } } - - /// Internal Acessors for LastValidation - global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetPropertiesInternal.LastValidation { get => this._lastValidation; set { {_lastValidation = value;} } } - - /// Internal Acessors for ProvisioningState - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineKeySetProvisioningState? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetPropertiesInternal.ProvisioningState { get => this._provisioningState; set { {_provisioningState = value;} } } - - /// Internal Acessors for UserListStatus - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKeySetUserStatus[] Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetPropertiesInternal.UserListStatus { get => this._userListStatus; set { {_userListStatus = value;} } } - - /// Backing field for property. - private string _oSGroupName; - - /// - /// The name of the group that users will be assigned to on the operating system of the machines. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string OSGroupName { get => this._oSGroupName; set => this._oSGroupName = value; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineKeySetPrivilegeLevel _privilegeLevel; - - /// The access level allowed for the users in this key set. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineKeySetPrivilegeLevel PrivilegeLevel { get => this._privilegeLevel; set => this._privilegeLevel = value; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineKeySetProvisioningState? _provisioningState; - - /// The provisioning state of the bare metal machine key set. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineKeySetProvisioningState? ProvisioningState { get => this._provisioningState; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKeySetUser[] _userList; - - /// The unique list of permitted users. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKeySetUser[] UserList { get => this._userList; set => this._userList = value; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKeySetUserStatus[] _userListStatus; - - /// The status evaluation of each user. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKeySetUserStatus[] UserListStatus { get => this._userListStatus; } - - /// Creates an new instance. - public BareMetalMachineKeySetProperties() - { - - } - } - /// BareMetalMachineKeySetProperties represents the properties of bare metal machine key set. - public partial interface IBareMetalMachineKeySetProperties : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable - { - /// - /// The object ID of Azure Active Directory group that all users in the list must be in for access to be granted. Users that - /// are not in the group will not have access. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The object ID of Azure Active Directory group that all users in the list must be in for access to be granted. Users that are not in the group will not have access.", - SerializedName = @"azureGroupId", - PossibleTypes = new [] { typeof(string) })] - string AzureGroupId { get; set; } - /// The more detailed status of the key set. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The more detailed status of the key set.", - SerializedName = @"detailedStatus", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineKeySetDetailedStatus) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineKeySetDetailedStatus? DetailedStatus { get; } - /// The descriptive message about the current detailed status. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The descriptive message about the current detailed status.", - SerializedName = @"detailedStatusMessage", - PossibleTypes = new [] { typeof(string) })] - string DetailedStatusMessage { get; } - /// - /// The date and time after which the users in this key set will be removed from the bare metal machines. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The date and time after which the users in this key set will be removed from the bare metal machines.", - SerializedName = @"expiration", - PossibleTypes = new [] { typeof(global::System.DateTime) })] - global::System.DateTime Expiration { get; set; } - /// - /// The list of IP addresses of jump hosts with management network access from which a login will be allowed for the users. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The list of IP addresses of jump hosts with management network access from which a login will be allowed for the users.", - SerializedName = @"jumpHostsAllowed", - PossibleTypes = new [] { typeof(string) })] - string[] JumpHostsAllowed { get; set; } - /// The last time this key set was validated. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The last time this key set was validated.", - SerializedName = @"lastValidation", - PossibleTypes = new [] { typeof(global::System.DateTime) })] - global::System.DateTime? LastValidation { get; } - /// - /// The name of the group that users will be assigned to on the operating system of the machines. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The name of the group that users will be assigned to on the operating system of the machines.", - SerializedName = @"osGroupName", - PossibleTypes = new [] { typeof(string) })] - string OSGroupName { get; set; } - /// The access level allowed for the users in this key set. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The access level allowed for the users in this key set.", - SerializedName = @"privilegeLevel", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineKeySetPrivilegeLevel) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineKeySetPrivilegeLevel PrivilegeLevel { get; set; } - /// The provisioning state of the bare metal machine key set. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The provisioning state of the bare metal machine key set.", - SerializedName = @"provisioningState", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineKeySetProvisioningState) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineKeySetProvisioningState? ProvisioningState { get; } - /// The unique list of permitted users. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The unique list of permitted users.", - SerializedName = @"userList", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKeySetUser) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKeySetUser[] UserList { get; set; } - /// The status evaluation of each user. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The status evaluation of each user.", - SerializedName = @"userListStatus", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKeySetUserStatus) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKeySetUserStatus[] UserListStatus { get; } - - } - /// BareMetalMachineKeySetProperties represents the properties of bare metal machine key set. - internal partial interface IBareMetalMachineKeySetPropertiesInternal - - { - /// - /// The object ID of Azure Active Directory group that all users in the list must be in for access to be granted. Users that - /// are not in the group will not have access. - /// - string AzureGroupId { get; set; } - /// The more detailed status of the key set. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineKeySetDetailedStatus? DetailedStatus { get; set; } - /// The descriptive message about the current detailed status. - string DetailedStatusMessage { get; set; } - /// - /// The date and time after which the users in this key set will be removed from the bare metal machines. - /// - global::System.DateTime Expiration { get; set; } - /// - /// The list of IP addresses of jump hosts with management network access from which a login will be allowed for the users. - /// - string[] JumpHostsAllowed { get; set; } - /// The last time this key set was validated. - global::System.DateTime? LastValidation { get; set; } - /// - /// The name of the group that users will be assigned to on the operating system of the machines. - /// - string OSGroupName { get; set; } - /// The access level allowed for the users in this key set. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineKeySetPrivilegeLevel PrivilegeLevel { get; set; } - /// The provisioning state of the bare metal machine key set. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineKeySetProvisioningState? ProvisioningState { get; set; } - /// The unique list of permitted users. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKeySetUser[] UserList { get; set; } - /// The status evaluation of each user. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKeySetUserStatus[] UserListStatus { get; set; } - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineList.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineList.cs deleted file mode 100644 index c585fb49fa4f..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineList.cs +++ /dev/null @@ -1,68 +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.NetworkCloud.Models.Api20250201 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; - - /// BareMetalMachineList represents a list of bare metal machines. - public partial class BareMetalMachineList : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineList, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineListInternal - { - - /// Backing field for property. - private string _nextLink; - - /// The link used to get the next page of operations. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string NextLink { get => this._nextLink; set => this._nextLink = value; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachine[] _value; - - /// The list of bare metal machines. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachine[] Value { get => this._value; set => this._value = value; } - - /// Creates an new instance. - public BareMetalMachineList() - { - - } - } - /// BareMetalMachineList represents a list of bare metal machines. - public partial interface IBareMetalMachineList : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable - { - /// The link used to get the next page of operations. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The link used to get the next page of operations.", - SerializedName = @"nextLink", - PossibleTypes = new [] { typeof(string) })] - string NextLink { get; set; } - /// The list of bare metal machines. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The list of bare metal machines.", - SerializedName = @"value", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachine) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachine[] Value { get; set; } - - } - /// BareMetalMachineList represents a list of bare metal machines. - internal partial interface IBareMetalMachineListInternal - - { - /// The link used to get the next page of operations. - string NextLink { get; set; } - /// The list of bare metal machines. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachine[] Value { get; set; } - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachinePatchParameters.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachinePatchParameters.PowerShell.cs deleted file mode 100644 index 52ab6e38b65e..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachinePatchParameters.PowerShell.cs +++ /dev/null @@ -1,184 +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.NetworkCloud.Models.Api20250201 -{ - using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; - - /// - /// BareMetalMachinePatchParameters represents the body of the request to patch bare metal machine properties. - /// - [System.ComponentModel.TypeConverter(typeof(BareMetalMachinePatchParametersTypeConverter))] - public partial class BareMetalMachinePatchParameters - { - - /// - /// 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 BareMetalMachinePatchParameters(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.NetworkCloud.Models.Api20250201.IBareMetalMachinePatchParametersInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePatchProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePatchParametersInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BareMetalMachinePatchPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Tag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePatchParametersInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePatchParametersTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePatchParametersInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BareMetalMachinePatchParametersTagsTypeConverter.ConvertFrom); - } - if (content.Contains("MachineDetail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePatchParametersInternal)this).MachineDetail = (string) content.GetValueForProperty("MachineDetail",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePatchParametersInternal)this).MachineDetail, 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 BareMetalMachinePatchParameters(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.NetworkCloud.Models.Api20250201.IBareMetalMachinePatchParametersInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePatchProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePatchParametersInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BareMetalMachinePatchPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Tag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePatchParametersInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePatchParametersTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePatchParametersInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BareMetalMachinePatchParametersTagsTypeConverter.ConvertFrom); - } - if (content.Contains("MachineDetail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePatchParametersInternal)this).MachineDetail = (string) content.GetValueForProperty("MachineDetail",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePatchParametersInternal)this).MachineDetail, 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.NetworkCloud.Models.Api20250201.IBareMetalMachinePatchParameters DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new BareMetalMachinePatchParameters(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.NetworkCloud.Models.Api20250201.IBareMetalMachinePatchParameters DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new BareMetalMachinePatchParameters(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.NetworkCloud.Models.Api20250201.IBareMetalMachinePatchParameters FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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(); - } - } - /// BareMetalMachinePatchParameters represents the body of the request to patch bare metal machine properties. - [System.ComponentModel.TypeConverter(typeof(BareMetalMachinePatchParametersTypeConverter))] - public partial interface IBareMetalMachinePatchParameters - - { - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachinePatchParameters.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachinePatchParameters.cs deleted file mode 100644 index d494dc4bb592..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachinePatchParameters.cs +++ /dev/null @@ -1,88 +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.NetworkCloud.Models.Api20250201 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; - - /// - /// BareMetalMachinePatchParameters represents the body of the request to patch bare metal machine properties. - /// - public partial class BareMetalMachinePatchParameters : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePatchParameters, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePatchParametersInternal - { - - /// - /// The details provided by the customer during the creation of rack manifests that allows for custom data to be associated - /// with this machine. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string MachineDetail { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePatchPropertiesInternal)Property).MachineDetail; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePatchPropertiesInternal)Property).MachineDetail = value ?? null; } - - /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePatchProperties Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePatchParametersInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BareMetalMachinePatchProperties()); set { {_property = value;} } } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePatchProperties _property; - - /// The list of the resource properties. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePatchProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BareMetalMachinePatchProperties()); set => this._property = value; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePatchParametersTags _tag; - - /// The Azure resource tags that will replace the existing ones. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePatchParametersTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BareMetalMachinePatchParametersTags()); set => this._tag = value; } - - /// Creates an new instance. - public BareMetalMachinePatchParameters() - { - - } - } - /// BareMetalMachinePatchParameters represents the body of the request to patch bare metal machine properties. - public partial interface IBareMetalMachinePatchParameters : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable - { - /// - /// The details provided by the customer during the creation of rack manifests that allows for custom data to be associated - /// with this machine. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The details provided by the customer during the creation of rack manifests that allows for custom data to be associated with this machine.", - SerializedName = @"machineDetails", - PossibleTypes = new [] { typeof(string) })] - string MachineDetail { get; set; } - /// The Azure resource tags that will replace the existing ones. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The Azure resource tags that will replace the existing ones.", - SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePatchParametersTags) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePatchParametersTags Tag { get; set; } - - } - /// BareMetalMachinePatchParameters represents the body of the request to patch bare metal machine properties. - internal partial interface IBareMetalMachinePatchParametersInternal - - { - /// - /// The details provided by the customer during the creation of rack manifests that allows for custom data to be associated - /// with this machine. - /// - string MachineDetail { get; set; } - /// The list of the resource properties. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePatchProperties Property { get; set; } - /// The Azure resource tags that will replace the existing ones. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePatchParametersTags Tag { get; set; } - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachinePowerOffParameters.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachinePowerOffParameters.cs deleted file mode 100644 index 46c81858cf44..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachinePowerOffParameters.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.NetworkCloud.Models.Api20250201 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; - - /// - /// BareMetalMachinePowerOffParameters represents the body of the request to power off bare metal machine. - /// - public partial class BareMetalMachinePowerOffParameters : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePowerOffParameters, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePowerOffParametersInternal - { - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineSkipShutdown? _skipShutdown; - - /// - /// The indicator of whether to skip the graceful OS shutdown and power off the bare metal machine immediately. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineSkipShutdown? SkipShutdown { get => this._skipShutdown; set => this._skipShutdown = value; } - - /// Creates an new instance. - public BareMetalMachinePowerOffParameters() - { - - } - } - /// BareMetalMachinePowerOffParameters represents the body of the request to power off bare metal machine. - public partial interface IBareMetalMachinePowerOffParameters : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable - { - /// - /// The indicator of whether to skip the graceful OS shutdown and power off the bare metal machine immediately. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The indicator of whether to skip the graceful OS shutdown and power off the bare metal machine immediately.", - SerializedName = @"skipShutdown", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineSkipShutdown) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineSkipShutdown? SkipShutdown { get; set; } - - } - /// BareMetalMachinePowerOffParameters represents the body of the request to power off bare metal machine. - internal partial interface IBareMetalMachinePowerOffParametersInternal - - { - /// - /// The indicator of whether to skip the graceful OS shutdown and power off the bare metal machine immediately. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineSkipShutdown? SkipShutdown { get; set; } - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineProperties.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineProperties.PowerShell.cs deleted file mode 100644 index 756e6bd979a3..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineProperties.PowerShell.cs +++ /dev/null @@ -1,510 +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.NetworkCloud.Models.Api20250201 -{ - using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; - - /// BareMetalMachineProperties represents the properties of a bare metal machine. - [System.ComponentModel.TypeConverter(typeof(BareMetalMachinePropertiesTypeConverter))] - public partial class BareMetalMachineProperties - { - - /// - /// 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 BareMetalMachineProperties(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("BmcCredentials")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).BmcCredentials = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministrativeCredentials) content.GetValueForProperty("BmcCredentials",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).BmcCredentials, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AdministrativeCredentialsTypeConverter.ConvertFrom); - } - if (content.Contains("HardwareInventory")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).HardwareInventory = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IHardwareInventory) content.GetValueForProperty("HardwareInventory",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).HardwareInventory, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.HardwareInventoryTypeConverter.ConvertFrom); - } - if (content.Contains("HardwareValidationStatus")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).HardwareValidationStatus = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IHardwareValidationStatus) content.GetValueForProperty("HardwareValidationStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).HardwareValidationStatus, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.HardwareValidationStatusTypeConverter.ConvertFrom); - } - if (content.Contains("RuntimeProtectionStatus")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).RuntimeProtectionStatus = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRuntimeProtectionStatus) content.GetValueForProperty("RuntimeProtectionStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).RuntimeProtectionStatus, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.RuntimeProtectionStatusTypeConverter.ConvertFrom); - } - if (content.Contains("AssociatedResourceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).AssociatedResourceId = (string[]) content.GetValueForProperty("AssociatedResourceId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).AssociatedResourceId, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("BmcConnectionString")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).BmcConnectionString = (string) content.GetValueForProperty("BmcConnectionString",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).BmcConnectionString, global::System.Convert.ToString); - } - if (content.Contains("BmcMacAddress")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).BmcMacAddress = (string) content.GetValueForProperty("BmcMacAddress",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).BmcMacAddress, global::System.Convert.ToString); - } - if (content.Contains("BootMacAddress")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).BootMacAddress = (string) content.GetValueForProperty("BootMacAddress",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).BootMacAddress, global::System.Convert.ToString); - } - if (content.Contains("ClusterId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).ClusterId = (string) content.GetValueForProperty("ClusterId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).ClusterId, global::System.Convert.ToString); - } - if (content.Contains("CordonStatus")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).CordonStatus = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineCordonStatus?) content.GetValueForProperty("CordonStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).CordonStatus, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineCordonStatus.CreateFrom); - } - if (content.Contains("DetailedStatus")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).DetailedStatus = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineDetailedStatus?) content.GetValueForProperty("DetailedStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).DetailedStatus, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineDetailedStatus.CreateFrom); - } - if (content.Contains("DetailedStatusMessage")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).DetailedStatusMessage = (string) content.GetValueForProperty("DetailedStatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).DetailedStatusMessage, global::System.Convert.ToString); - } - if (content.Contains("HybridAksClustersAssociatedId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).HybridAksClustersAssociatedId = (string[]) content.GetValueForProperty("HybridAksClustersAssociatedId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).HybridAksClustersAssociatedId, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("KubernetesNodeName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).KubernetesNodeName = (string) content.GetValueForProperty("KubernetesNodeName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).KubernetesNodeName, global::System.Convert.ToString); - } - if (content.Contains("KubernetesVersion")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).KubernetesVersion = (string) content.GetValueForProperty("KubernetesVersion",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).KubernetesVersion, global::System.Convert.ToString); - } - if (content.Contains("MachineClusterVersion")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).MachineClusterVersion = (string) content.GetValueForProperty("MachineClusterVersion",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).MachineClusterVersion, global::System.Convert.ToString); - } - if (content.Contains("MachineDetail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).MachineDetail = (string) content.GetValueForProperty("MachineDetail",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).MachineDetail, global::System.Convert.ToString); - } - if (content.Contains("MachineName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).MachineName = (string) content.GetValueForProperty("MachineName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).MachineName, global::System.Convert.ToString); - } - if (content.Contains("MachineRole")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).MachineRole = (string[]) content.GetValueForProperty("MachineRole",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).MachineRole, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("MachineSkuId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).MachineSkuId = (string) content.GetValueForProperty("MachineSkuId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).MachineSkuId, global::System.Convert.ToString); - } - if (content.Contains("OamIpv4Address")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).OamIpv4Address = (string) content.GetValueForProperty("OamIpv4Address",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).OamIpv4Address, global::System.Convert.ToString); - } - if (content.Contains("OamIpv6Address")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).OamIpv6Address = (string) content.GetValueForProperty("OamIpv6Address",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).OamIpv6Address, global::System.Convert.ToString); - } - if (content.Contains("OSImage")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).OSImage = (string) content.GetValueForProperty("OSImage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).OSImage, global::System.Convert.ToString); - } - if (content.Contains("PowerState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).PowerState = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachinePowerState?) content.GetValueForProperty("PowerState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).PowerState, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachinePowerState.CreateFrom); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineProvisioningState.CreateFrom); - } - if (content.Contains("RackId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).RackId = (string) content.GetValueForProperty("RackId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).RackId, global::System.Convert.ToString); - } - if (content.Contains("RackSlot")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).RackSlot = (long) content.GetValueForProperty("RackSlot",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).RackSlot, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("ReadyState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).ReadyState = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineReadyState?) content.GetValueForProperty("ReadyState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).ReadyState, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineReadyState.CreateFrom); - } - if (content.Contains("SecretRotationStatus")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).SecretRotationStatus = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretRotationStatus[]) content.GetValueForProperty("SecretRotationStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).SecretRotationStatus, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.SecretRotationStatusTypeConverter.ConvertFrom)); - } - if (content.Contains("SerialNumber")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).SerialNumber = (string) content.GetValueForProperty("SerialNumber",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).SerialNumber, global::System.Convert.ToString); - } - if (content.Contains("ServiceTag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).ServiceTag = (string) content.GetValueForProperty("ServiceTag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).ServiceTag, global::System.Convert.ToString); - } - if (content.Contains("VirtualMachinesAssociatedId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).VirtualMachinesAssociatedId = (string[]) content.GetValueForProperty("VirtualMachinesAssociatedId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).VirtualMachinesAssociatedId, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("HardwareInventoryInterface")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).HardwareInventoryInterface = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IHardwareInventoryNetworkInterface[]) content.GetValueForProperty("HardwareInventoryInterface",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).HardwareInventoryInterface, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.HardwareInventoryNetworkInterfaceTypeConverter.ConvertFrom)); - } - if (content.Contains("HardwareInventoryNic")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).HardwareInventoryNic = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INic[]) content.GetValueForProperty("HardwareInventoryNic",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).HardwareInventoryNic, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.NicTypeConverter.ConvertFrom)); - } - if (content.Contains("RuntimeProtectionStatusDefinitionsVersion")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).RuntimeProtectionStatusDefinitionsVersion = (string) content.GetValueForProperty("RuntimeProtectionStatusDefinitionsVersion",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).RuntimeProtectionStatusDefinitionsVersion, global::System.Convert.ToString); - } - if (content.Contains("BmcCredentialsPassword")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).BmcCredentialsPassword = (System.Security.SecureString) content.GetValueForProperty("BmcCredentialsPassword",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).BmcCredentialsPassword, (object ss) => (System.Security.SecureString)ss); - } - if (content.Contains("BmcCredentialsUsername")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).BmcCredentialsUsername = (string) content.GetValueForProperty("BmcCredentialsUsername",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).BmcCredentialsUsername, global::System.Convert.ToString); - } - if (content.Contains("HardwareInventoryAdditionalHostInformation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).HardwareInventoryAdditionalHostInformation = (string) content.GetValueForProperty("HardwareInventoryAdditionalHostInformation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).HardwareInventoryAdditionalHostInformation, global::System.Convert.ToString); - } - if (content.Contains("HardwareValidationStatusLastValidationTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).HardwareValidationStatusLastValidationTime = (global::System.DateTime?) content.GetValueForProperty("HardwareValidationStatusLastValidationTime",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).HardwareValidationStatusLastValidationTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("HardwareValidationStatusResult")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).HardwareValidationStatusResult = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineHardwareValidationResult?) content.GetValueForProperty("HardwareValidationStatusResult",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).HardwareValidationStatusResult, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineHardwareValidationResult.CreateFrom); - } - if (content.Contains("RuntimeProtectionStatusDefinitionsLastUpdated")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).RuntimeProtectionStatusDefinitionsLastUpdated = (global::System.DateTime?) content.GetValueForProperty("RuntimeProtectionStatusDefinitionsLastUpdated",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).RuntimeProtectionStatusDefinitionsLastUpdated, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("RuntimeProtectionStatusScanCompletedTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).RuntimeProtectionStatusScanCompletedTime = (global::System.DateTime?) content.GetValueForProperty("RuntimeProtectionStatusScanCompletedTime",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).RuntimeProtectionStatusScanCompletedTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("RuntimeProtectionStatusScanScheduledTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).RuntimeProtectionStatusScanScheduledTime = (global::System.DateTime?) content.GetValueForProperty("RuntimeProtectionStatusScanScheduledTime",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).RuntimeProtectionStatusScanScheduledTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("RuntimeProtectionStatusScanStartedTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).RuntimeProtectionStatusScanStartedTime = (global::System.DateTime?) content.GetValueForProperty("RuntimeProtectionStatusScanStartedTime",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).RuntimeProtectionStatusScanStartedTime, (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 BareMetalMachineProperties(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("BmcCredentials")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).BmcCredentials = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministrativeCredentials) content.GetValueForProperty("BmcCredentials",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).BmcCredentials, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AdministrativeCredentialsTypeConverter.ConvertFrom); - } - if (content.Contains("HardwareInventory")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).HardwareInventory = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IHardwareInventory) content.GetValueForProperty("HardwareInventory",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).HardwareInventory, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.HardwareInventoryTypeConverter.ConvertFrom); - } - if (content.Contains("HardwareValidationStatus")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).HardwareValidationStatus = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IHardwareValidationStatus) content.GetValueForProperty("HardwareValidationStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).HardwareValidationStatus, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.HardwareValidationStatusTypeConverter.ConvertFrom); - } - if (content.Contains("RuntimeProtectionStatus")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).RuntimeProtectionStatus = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRuntimeProtectionStatus) content.GetValueForProperty("RuntimeProtectionStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).RuntimeProtectionStatus, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.RuntimeProtectionStatusTypeConverter.ConvertFrom); - } - if (content.Contains("AssociatedResourceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).AssociatedResourceId = (string[]) content.GetValueForProperty("AssociatedResourceId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).AssociatedResourceId, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("BmcConnectionString")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).BmcConnectionString = (string) content.GetValueForProperty("BmcConnectionString",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).BmcConnectionString, global::System.Convert.ToString); - } - if (content.Contains("BmcMacAddress")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).BmcMacAddress = (string) content.GetValueForProperty("BmcMacAddress",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).BmcMacAddress, global::System.Convert.ToString); - } - if (content.Contains("BootMacAddress")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).BootMacAddress = (string) content.GetValueForProperty("BootMacAddress",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).BootMacAddress, global::System.Convert.ToString); - } - if (content.Contains("ClusterId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).ClusterId = (string) content.GetValueForProperty("ClusterId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).ClusterId, global::System.Convert.ToString); - } - if (content.Contains("CordonStatus")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).CordonStatus = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineCordonStatus?) content.GetValueForProperty("CordonStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).CordonStatus, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineCordonStatus.CreateFrom); - } - if (content.Contains("DetailedStatus")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).DetailedStatus = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineDetailedStatus?) content.GetValueForProperty("DetailedStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).DetailedStatus, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineDetailedStatus.CreateFrom); - } - if (content.Contains("DetailedStatusMessage")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).DetailedStatusMessage = (string) content.GetValueForProperty("DetailedStatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).DetailedStatusMessage, global::System.Convert.ToString); - } - if (content.Contains("HybridAksClustersAssociatedId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).HybridAksClustersAssociatedId = (string[]) content.GetValueForProperty("HybridAksClustersAssociatedId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).HybridAksClustersAssociatedId, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("KubernetesNodeName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).KubernetesNodeName = (string) content.GetValueForProperty("KubernetesNodeName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).KubernetesNodeName, global::System.Convert.ToString); - } - if (content.Contains("KubernetesVersion")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).KubernetesVersion = (string) content.GetValueForProperty("KubernetesVersion",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).KubernetesVersion, global::System.Convert.ToString); - } - if (content.Contains("MachineClusterVersion")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).MachineClusterVersion = (string) content.GetValueForProperty("MachineClusterVersion",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).MachineClusterVersion, global::System.Convert.ToString); - } - if (content.Contains("MachineDetail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).MachineDetail = (string) content.GetValueForProperty("MachineDetail",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).MachineDetail, global::System.Convert.ToString); - } - if (content.Contains("MachineName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).MachineName = (string) content.GetValueForProperty("MachineName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).MachineName, global::System.Convert.ToString); - } - if (content.Contains("MachineRole")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).MachineRole = (string[]) content.GetValueForProperty("MachineRole",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).MachineRole, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("MachineSkuId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).MachineSkuId = (string) content.GetValueForProperty("MachineSkuId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).MachineSkuId, global::System.Convert.ToString); - } - if (content.Contains("OamIpv4Address")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).OamIpv4Address = (string) content.GetValueForProperty("OamIpv4Address",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).OamIpv4Address, global::System.Convert.ToString); - } - if (content.Contains("OamIpv6Address")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).OamIpv6Address = (string) content.GetValueForProperty("OamIpv6Address",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).OamIpv6Address, global::System.Convert.ToString); - } - if (content.Contains("OSImage")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).OSImage = (string) content.GetValueForProperty("OSImage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).OSImage, global::System.Convert.ToString); - } - if (content.Contains("PowerState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).PowerState = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachinePowerState?) content.GetValueForProperty("PowerState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).PowerState, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachinePowerState.CreateFrom); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineProvisioningState.CreateFrom); - } - if (content.Contains("RackId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).RackId = (string) content.GetValueForProperty("RackId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).RackId, global::System.Convert.ToString); - } - if (content.Contains("RackSlot")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).RackSlot = (long) content.GetValueForProperty("RackSlot",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).RackSlot, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("ReadyState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).ReadyState = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineReadyState?) content.GetValueForProperty("ReadyState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).ReadyState, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineReadyState.CreateFrom); - } - if (content.Contains("SecretRotationStatus")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).SecretRotationStatus = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretRotationStatus[]) content.GetValueForProperty("SecretRotationStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).SecretRotationStatus, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.SecretRotationStatusTypeConverter.ConvertFrom)); - } - if (content.Contains("SerialNumber")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).SerialNumber = (string) content.GetValueForProperty("SerialNumber",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).SerialNumber, global::System.Convert.ToString); - } - if (content.Contains("ServiceTag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).ServiceTag = (string) content.GetValueForProperty("ServiceTag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).ServiceTag, global::System.Convert.ToString); - } - if (content.Contains("VirtualMachinesAssociatedId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).VirtualMachinesAssociatedId = (string[]) content.GetValueForProperty("VirtualMachinesAssociatedId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).VirtualMachinesAssociatedId, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("HardwareInventoryInterface")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).HardwareInventoryInterface = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IHardwareInventoryNetworkInterface[]) content.GetValueForProperty("HardwareInventoryInterface",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).HardwareInventoryInterface, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.HardwareInventoryNetworkInterfaceTypeConverter.ConvertFrom)); - } - if (content.Contains("HardwareInventoryNic")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).HardwareInventoryNic = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INic[]) content.GetValueForProperty("HardwareInventoryNic",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).HardwareInventoryNic, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.NicTypeConverter.ConvertFrom)); - } - if (content.Contains("RuntimeProtectionStatusDefinitionsVersion")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).RuntimeProtectionStatusDefinitionsVersion = (string) content.GetValueForProperty("RuntimeProtectionStatusDefinitionsVersion",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).RuntimeProtectionStatusDefinitionsVersion, global::System.Convert.ToString); - } - if (content.Contains("BmcCredentialsPassword")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).BmcCredentialsPassword = (System.Security.SecureString) content.GetValueForProperty("BmcCredentialsPassword",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).BmcCredentialsPassword, (object ss) => (System.Security.SecureString)ss); - } - if (content.Contains("BmcCredentialsUsername")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).BmcCredentialsUsername = (string) content.GetValueForProperty("BmcCredentialsUsername",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).BmcCredentialsUsername, global::System.Convert.ToString); - } - if (content.Contains("HardwareInventoryAdditionalHostInformation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).HardwareInventoryAdditionalHostInformation = (string) content.GetValueForProperty("HardwareInventoryAdditionalHostInformation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).HardwareInventoryAdditionalHostInformation, global::System.Convert.ToString); - } - if (content.Contains("HardwareValidationStatusLastValidationTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).HardwareValidationStatusLastValidationTime = (global::System.DateTime?) content.GetValueForProperty("HardwareValidationStatusLastValidationTime",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).HardwareValidationStatusLastValidationTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("HardwareValidationStatusResult")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).HardwareValidationStatusResult = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineHardwareValidationResult?) content.GetValueForProperty("HardwareValidationStatusResult",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).HardwareValidationStatusResult, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineHardwareValidationResult.CreateFrom); - } - if (content.Contains("RuntimeProtectionStatusDefinitionsLastUpdated")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).RuntimeProtectionStatusDefinitionsLastUpdated = (global::System.DateTime?) content.GetValueForProperty("RuntimeProtectionStatusDefinitionsLastUpdated",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).RuntimeProtectionStatusDefinitionsLastUpdated, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("RuntimeProtectionStatusScanCompletedTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).RuntimeProtectionStatusScanCompletedTime = (global::System.DateTime?) content.GetValueForProperty("RuntimeProtectionStatusScanCompletedTime",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).RuntimeProtectionStatusScanCompletedTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("RuntimeProtectionStatusScanScheduledTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).RuntimeProtectionStatusScanScheduledTime = (global::System.DateTime?) content.GetValueForProperty("RuntimeProtectionStatusScanScheduledTime",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).RuntimeProtectionStatusScanScheduledTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("RuntimeProtectionStatusScanStartedTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).RuntimeProtectionStatusScanStartedTime = (global::System.DateTime?) content.GetValueForProperty("RuntimeProtectionStatusScanStartedTime",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal)this).RuntimeProtectionStatusScanStartedTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - AfterDeserializePSObject(content); - } - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new BareMetalMachineProperties(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.NetworkCloud.Models.Api20250201.IBareMetalMachineProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new BareMetalMachineProperties(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.NetworkCloud.Models.Api20250201.IBareMetalMachineProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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(); - } - } - /// BareMetalMachineProperties represents the properties of a bare metal machine. - [System.ComponentModel.TypeConverter(typeof(BareMetalMachinePropertiesTypeConverter))] - public partial interface IBareMetalMachineProperties - - { - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineProperties.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineProperties.cs deleted file mode 100644 index fe9e77546506..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineProperties.cs +++ /dev/null @@ -1,930 +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.NetworkCloud.Models.Api20250201 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; - - /// BareMetalMachineProperties represents the properties of a bare metal machine. - public partial class BareMetalMachineProperties : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineProperties, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal - { - - /// Backing field for property. - private string[] _associatedResourceId; - - /// - /// The list of resource IDs for the other Microsoft.NetworkCloud resources that have attached this network. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string[] AssociatedResourceId { get => this._associatedResourceId; } - - /// Backing field for property. - private string _bmcConnectionString; - - /// - /// The connection string for the baseboard management controller including IP address and protocol. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string BmcConnectionString { get => this._bmcConnectionString; set => this._bmcConnectionString = value; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministrativeCredentials _bmcCredentials; - - /// - /// The credentials of the baseboard management controller on this bare metal machine. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministrativeCredentials BmcCredentials { get => (this._bmcCredentials = this._bmcCredentials ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AdministrativeCredentials()); set => this._bmcCredentials = value; } - - /// The password of the administrator of the device used during initialization. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public System.Security.SecureString BmcCredentialsPassword { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministrativeCredentialsInternal)BmcCredentials).Password; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministrativeCredentialsInternal)BmcCredentials).Password = value ; } - - /// The username of the administrator of the device used during initialization. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string BmcCredentialsUsername { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministrativeCredentialsInternal)BmcCredentials).Username; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministrativeCredentialsInternal)BmcCredentials).Username = value ; } - - /// Backing field for property. - private string _bmcMacAddress; - - /// The MAC address of the BMC device. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string BmcMacAddress { get => this._bmcMacAddress; set => this._bmcMacAddress = value; } - - /// Backing field for property. - private string _bootMacAddress; - - /// The MAC address of a NIC connected to the PXE network. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string BootMacAddress { get => this._bootMacAddress; set => this._bootMacAddress = value; } - - /// Backing field for property. - private string _clusterId; - - /// The resource ID of the cluster this bare metal machine is associated with. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string ClusterId { get => this._clusterId; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineCordonStatus? _cordonStatus; - - /// The cordon status of the bare metal machine. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineCordonStatus? CordonStatus { get => this._cordonStatus; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineDetailedStatus? _detailedStatus; - - /// The more detailed status of the bare metal machine. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineDetailedStatus? DetailedStatus { get => this._detailedStatus; } - - /// Backing field for property. - private string _detailedStatusMessage; - - /// The descriptive message about the current detailed status. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string DetailedStatusMessage { get => this._detailedStatusMessage; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IHardwareInventory _hardwareInventory; - - /// - /// The hardware inventory, including information acquired from the model/sku information and from the ironic inspector. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IHardwareInventory HardwareInventory { get => (this._hardwareInventory = this._hardwareInventory ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.HardwareInventory()); } - - /// - /// Freeform data extracted from the environment about this machine. This information varies depending on the specific hardware - /// and configuration. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string HardwareInventoryAdditionalHostInformation { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IHardwareInventoryInternal)HardwareInventory).AdditionalHostInformation; } - - /// - /// The list of network interfaces and associated details for the bare metal machine. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IHardwareInventoryNetworkInterface[] HardwareInventoryInterface { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IHardwareInventoryInternal)HardwareInventory).Interface; } - - /// - /// Field Deprecated. Will be removed in an upcoming version. The list of network interface cards and associated details for - /// the bare metal machine. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INic[] HardwareInventoryNic { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IHardwareInventoryInternal)HardwareInventory).Nic; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IHardwareValidationStatus _hardwareValidationStatus; - - /// - /// The details of the latest hardware validation performed for this bare metal machine. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IHardwareValidationStatus HardwareValidationStatus { get => (this._hardwareValidationStatus = this._hardwareValidationStatus ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.HardwareValidationStatus()); } - - /// The timestamp of the hardware validation execution. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public global::System.DateTime? HardwareValidationStatusLastValidationTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IHardwareValidationStatusInternal)HardwareValidationStatus).LastValidationTime; } - - /// The outcome of the hardware validation. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineHardwareValidationResult? HardwareValidationStatusResult { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IHardwareValidationStatusInternal)HardwareValidationStatus).Result; } - - /// Backing field for property. - private string[] _hybridAksClustersAssociatedId; - - /// - /// Field Deprecated. These fields will be empty/omitted. The list of the resource IDs for the HybridAksClusters that have - /// nodes hosted on this bare metal machine. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string[] HybridAksClustersAssociatedId { get => this._hybridAksClustersAssociatedId; } - - /// Backing field for property. - private string _kubernetesNodeName; - - /// - /// The name of this machine represented by the host object in the Cluster's Kubernetes control plane. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string KubernetesNodeName { get => this._kubernetesNodeName; } - - /// Backing field for property. - private string _kubernetesVersion; - - /// The version of Kubernetes running on this machine. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string KubernetesVersion { get => this._kubernetesVersion; } - - /// Backing field for property. - private string _machineClusterVersion; - - /// - /// The cluster version that has been applied to this machine during deployment or a version update. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string MachineClusterVersion { get => this._machineClusterVersion; set => this._machineClusterVersion = value; } - - /// Backing field for property. - private string _machineDetail; - - /// The custom details provided by the customer. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string MachineDetail { get => this._machineDetail; set => this._machineDetail = value; } - - /// Backing field for property. - private string _machineName; - - /// The OS-level hostname assigned to this machine. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string MachineName { get => this._machineName; set => this._machineName = value; } - - /// Backing field for property. - private string[] _machineRole; - - /// - /// The list of roles that are assigned to the cluster node running on this machine. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string[] MachineRole { get => this._machineRole; } - - /// Backing field for property. - private string _machineSkuId; - - /// The unique internal identifier of the bare metal machine SKU. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string MachineSkuId { get => this._machineSkuId; set => this._machineSkuId = value; } - - /// Internal Acessors for AssociatedResourceId - string[] Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal.AssociatedResourceId { get => this._associatedResourceId; set { {_associatedResourceId = value;} } } - - /// Internal Acessors for BmcCredentials - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministrativeCredentials Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal.BmcCredentials { get => (this._bmcCredentials = this._bmcCredentials ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AdministrativeCredentials()); set { {_bmcCredentials = value;} } } - - /// Internal Acessors for ClusterId - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal.ClusterId { get => this._clusterId; set { {_clusterId = value;} } } - - /// Internal Acessors for CordonStatus - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineCordonStatus? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal.CordonStatus { get => this._cordonStatus; set { {_cordonStatus = value;} } } - - /// Internal Acessors for DetailedStatus - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineDetailedStatus? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal.DetailedStatus { get => this._detailedStatus; set { {_detailedStatus = value;} } } - - /// Internal Acessors for DetailedStatusMessage - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal.DetailedStatusMessage { get => this._detailedStatusMessage; set { {_detailedStatusMessage = value;} } } - - /// Internal Acessors for HardwareInventory - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IHardwareInventory Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal.HardwareInventory { get => (this._hardwareInventory = this._hardwareInventory ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.HardwareInventory()); set { {_hardwareInventory = value;} } } - - /// Internal Acessors for HardwareInventoryAdditionalHostInformation - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal.HardwareInventoryAdditionalHostInformation { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IHardwareInventoryInternal)HardwareInventory).AdditionalHostInformation; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IHardwareInventoryInternal)HardwareInventory).AdditionalHostInformation = value; } - - /// Internal Acessors for HardwareInventoryInterface - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IHardwareInventoryNetworkInterface[] Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal.HardwareInventoryInterface { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IHardwareInventoryInternal)HardwareInventory).Interface; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IHardwareInventoryInternal)HardwareInventory).Interface = value; } - - /// Internal Acessors for HardwareInventoryNic - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INic[] Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal.HardwareInventoryNic { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IHardwareInventoryInternal)HardwareInventory).Nic; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IHardwareInventoryInternal)HardwareInventory).Nic = value; } - - /// Internal Acessors for HardwareValidationStatus - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IHardwareValidationStatus Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal.HardwareValidationStatus { get => (this._hardwareValidationStatus = this._hardwareValidationStatus ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.HardwareValidationStatus()); set { {_hardwareValidationStatus = value;} } } - - /// Internal Acessors for HardwareValidationStatusLastValidationTime - global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal.HardwareValidationStatusLastValidationTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IHardwareValidationStatusInternal)HardwareValidationStatus).LastValidationTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IHardwareValidationStatusInternal)HardwareValidationStatus).LastValidationTime = value; } - - /// Internal Acessors for HardwareValidationStatusResult - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineHardwareValidationResult? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal.HardwareValidationStatusResult { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IHardwareValidationStatusInternal)HardwareValidationStatus).Result; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IHardwareValidationStatusInternal)HardwareValidationStatus).Result = value; } - - /// Internal Acessors for HybridAksClustersAssociatedId - string[] Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal.HybridAksClustersAssociatedId { get => this._hybridAksClustersAssociatedId; set { {_hybridAksClustersAssociatedId = value;} } } - - /// Internal Acessors for KubernetesNodeName - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal.KubernetesNodeName { get => this._kubernetesNodeName; set { {_kubernetesNodeName = value;} } } - - /// Internal Acessors for KubernetesVersion - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal.KubernetesVersion { get => this._kubernetesVersion; set { {_kubernetesVersion = value;} } } - - /// Internal Acessors for MachineRole - string[] Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal.MachineRole { get => this._machineRole; set { {_machineRole = value;} } } - - /// Internal Acessors for OSImage - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal.OSImage { get => this._oSImage; set { {_oSImage = value;} } } - - /// Internal Acessors for OamIpv4Address - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal.OamIpv4Address { get => this._oamIpv4Address; set { {_oamIpv4Address = value;} } } - - /// Internal Acessors for OamIpv6Address - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal.OamIpv6Address { get => this._oamIpv6Address; set { {_oamIpv6Address = value;} } } - - /// Internal Acessors for PowerState - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachinePowerState? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal.PowerState { get => this._powerState; set { {_powerState = value;} } } - - /// Internal Acessors for ProvisioningState - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineProvisioningState? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal.ProvisioningState { get => this._provisioningState; set { {_provisioningState = value;} } } - - /// Internal Acessors for ReadyState - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineReadyState? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal.ReadyState { get => this._readyState; set { {_readyState = value;} } } - - /// Internal Acessors for RuntimeProtectionStatus - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRuntimeProtectionStatus Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal.RuntimeProtectionStatus { get => (this._runtimeProtectionStatus = this._runtimeProtectionStatus ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.RuntimeProtectionStatus()); set { {_runtimeProtectionStatus = value;} } } - - /// Internal Acessors for RuntimeProtectionStatusDefinitionsLastUpdated - global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal.RuntimeProtectionStatusDefinitionsLastUpdated { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRuntimeProtectionStatusInternal)RuntimeProtectionStatus).DefinitionsLastUpdated; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRuntimeProtectionStatusInternal)RuntimeProtectionStatus).DefinitionsLastUpdated = value; } - - /// Internal Acessors for RuntimeProtectionStatusDefinitionsVersion - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal.RuntimeProtectionStatusDefinitionsVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRuntimeProtectionStatusInternal)RuntimeProtectionStatus).DefinitionsVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRuntimeProtectionStatusInternal)RuntimeProtectionStatus).DefinitionsVersion = value; } - - /// Internal Acessors for RuntimeProtectionStatusScanCompletedTime - global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal.RuntimeProtectionStatusScanCompletedTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRuntimeProtectionStatusInternal)RuntimeProtectionStatus).ScanCompletedTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRuntimeProtectionStatusInternal)RuntimeProtectionStatus).ScanCompletedTime = value; } - - /// Internal Acessors for RuntimeProtectionStatusScanScheduledTime - global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal.RuntimeProtectionStatusScanScheduledTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRuntimeProtectionStatusInternal)RuntimeProtectionStatus).ScanScheduledTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRuntimeProtectionStatusInternal)RuntimeProtectionStatus).ScanScheduledTime = value; } - - /// Internal Acessors for RuntimeProtectionStatusScanStartedTime - global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal.RuntimeProtectionStatusScanStartedTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRuntimeProtectionStatusInternal)RuntimeProtectionStatus).ScanStartedTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRuntimeProtectionStatusInternal)RuntimeProtectionStatus).ScanStartedTime = value; } - - /// Internal Acessors for SecretRotationStatus - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretRotationStatus[] Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal.SecretRotationStatus { get => this._secretRotationStatus; set { {_secretRotationStatus = value;} } } - - /// Internal Acessors for ServiceTag - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal.ServiceTag { get => this._serviceTag; set { {_serviceTag = value;} } } - - /// Internal Acessors for VirtualMachinesAssociatedId - string[] Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePropertiesInternal.VirtualMachinesAssociatedId { get => this._virtualMachinesAssociatedId; set { {_virtualMachinesAssociatedId = value;} } } - - /// Backing field for property. - private string _oSImage; - - /// The image that is currently provisioned to the OS disk. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string OSImage { get => this._oSImage; } - - /// Backing field for property. - private string _oamIpv4Address; - - /// - /// The IPv4 address that is assigned to the bare metal machine during the cluster deployment. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string OamIpv4Address { get => this._oamIpv4Address; } - - /// Backing field for property. - private string _oamIpv6Address; - - /// - /// The IPv6 address that is assigned to the bare metal machine during the cluster deployment. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string OamIpv6Address { get => this._oamIpv6Address; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachinePowerState? _powerState; - - /// The power state derived from the baseboard management controller. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachinePowerState? PowerState { get => this._powerState; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineProvisioningState? _provisioningState; - - /// The provisioning state of the bare metal machine. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineProvisioningState? ProvisioningState { get => this._provisioningState; } - - /// Backing field for property. - private string _rackId; - - /// The resource ID of the rack where this bare metal machine resides. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string RackId { get => this._rackId; set => this._rackId = value; } - - /// Backing field for property. - private long _rackSlot; - - /// - /// The rack slot in which this bare metal machine is located, ordered from the bottom up i.e. the lowest slot is 1. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public long RackSlot { get => this._rackSlot; set => this._rackSlot = value; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineReadyState? _readyState; - - /// The indicator of whether the bare metal machine is ready to receive workloads. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineReadyState? ReadyState { get => this._readyState; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRuntimeProtectionStatus _runtimeProtectionStatus; - - /// The runtime protection status of the bare metal machine. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRuntimeProtectionStatus RuntimeProtectionStatus { get => (this._runtimeProtectionStatus = this._runtimeProtectionStatus ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.RuntimeProtectionStatus()); } - - /// The timestamp when the malware definitions were last updated. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public global::System.DateTime? RuntimeProtectionStatusDefinitionsLastUpdated { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRuntimeProtectionStatusInternal)RuntimeProtectionStatus).DefinitionsLastUpdated; } - - /// The version of the malware definitions. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string RuntimeProtectionStatusDefinitionsVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRuntimeProtectionStatusInternal)RuntimeProtectionStatus).DefinitionsVersion; } - - /// - /// The timestamp of the most recently completed scan, or empty if there has never been a scan. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public global::System.DateTime? RuntimeProtectionStatusScanCompletedTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRuntimeProtectionStatusInternal)RuntimeProtectionStatus).ScanCompletedTime; } - - /// - /// The timestamp of the most recently scheduled scan, or empty if no scan has been scheduled. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public global::System.DateTime? RuntimeProtectionStatusScanScheduledTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRuntimeProtectionStatusInternal)RuntimeProtectionStatus).ScanScheduledTime; } - - /// - /// The timestamp of the most recently started scan, or empty if there has never been a scan. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public global::System.DateTime? RuntimeProtectionStatusScanStartedTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRuntimeProtectionStatusInternal)RuntimeProtectionStatus).ScanStartedTime; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretRotationStatus[] _secretRotationStatus; - - /// The list of statuses that represent secret rotation activity. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretRotationStatus[] SecretRotationStatus { get => this._secretRotationStatus; } - - /// Backing field for property. - private string _serialNumber; - - /// The serial number of the bare metal machine. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string SerialNumber { get => this._serialNumber; set => this._serialNumber = value; } - - /// Backing field for property. - private string _serviceTag; - - /// The discovered value of the machine's service tag. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string ServiceTag { get => this._serviceTag; } - - /// Backing field for property. - private string[] _virtualMachinesAssociatedId; - - /// - /// Field Deprecated. These fields will be empty/omitted. The list of the resource IDs for the VirtualMachines that are hosted - /// on this bare metal machine. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string[] VirtualMachinesAssociatedId { get => this._virtualMachinesAssociatedId; } - - /// Creates an new instance. - public BareMetalMachineProperties() - { - - } - } - /// BareMetalMachineProperties represents the properties of a bare metal machine. - public partial interface IBareMetalMachineProperties : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable - { - /// - /// The list of resource IDs for the other Microsoft.NetworkCloud resources that have attached this network. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The list of resource IDs for the other Microsoft.NetworkCloud resources that have attached this network.", - SerializedName = @"associatedResourceIds", - PossibleTypes = new [] { typeof(string) })] - string[] AssociatedResourceId { get; } - /// - /// The connection string for the baseboard management controller including IP address and protocol. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The connection string for the baseboard management controller including IP address and protocol.", - SerializedName = @"bmcConnectionString", - PossibleTypes = new [] { typeof(string) })] - string BmcConnectionString { get; set; } - /// The password of the administrator of the device used during initialization. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The password of the administrator of the device used during initialization.", - SerializedName = @"password", - PossibleTypes = new [] { typeof(System.Security.SecureString) })] - System.Security.SecureString BmcCredentialsPassword { get; set; } - /// The username of the administrator of the device used during initialization. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The username of the administrator of the device used during initialization.", - SerializedName = @"username", - PossibleTypes = new [] { typeof(string) })] - string BmcCredentialsUsername { get; set; } - /// The MAC address of the BMC device. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The MAC address of the BMC device.", - SerializedName = @"bmcMacAddress", - PossibleTypes = new [] { typeof(string) })] - string BmcMacAddress { get; set; } - /// The MAC address of a NIC connected to the PXE network. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The MAC address of a NIC connected to the PXE network.", - SerializedName = @"bootMacAddress", - PossibleTypes = new [] { typeof(string) })] - string BootMacAddress { get; set; } - /// The resource ID of the cluster this bare metal machine is associated with. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The resource ID of the cluster this bare metal machine is associated with.", - SerializedName = @"clusterId", - PossibleTypes = new [] { typeof(string) })] - string ClusterId { get; } - /// The cordon status of the bare metal machine. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The cordon status of the bare metal machine.", - SerializedName = @"cordonStatus", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineCordonStatus) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineCordonStatus? CordonStatus { get; } - /// The more detailed status of the bare metal machine. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The more detailed status of the bare metal machine.", - SerializedName = @"detailedStatus", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineDetailedStatus) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineDetailedStatus? DetailedStatus { get; } - /// The descriptive message about the current detailed status. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The descriptive message about the current detailed status.", - SerializedName = @"detailedStatusMessage", - PossibleTypes = new [] { typeof(string) })] - string DetailedStatusMessage { get; } - /// - /// Freeform data extracted from the environment about this machine. This information varies depending on the specific hardware - /// and configuration. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"Freeform data extracted from the environment about this machine. This information varies depending on the specific hardware and configuration.", - SerializedName = @"additionalHostInformation", - PossibleTypes = new [] { typeof(string) })] - string HardwareInventoryAdditionalHostInformation { get; } - /// - /// The list of network interfaces and associated details for the bare metal machine. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The list of network interfaces and associated details for the bare metal machine.", - SerializedName = @"interfaces", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IHardwareInventoryNetworkInterface) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IHardwareInventoryNetworkInterface[] HardwareInventoryInterface { get; } - /// - /// Field Deprecated. Will be removed in an upcoming version. The list of network interface cards and associated details for - /// the bare metal machine. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"Field Deprecated. Will be removed in an upcoming version. The list of network interface cards and associated details for the bare metal machine.", - SerializedName = @"nics", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INic) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INic[] HardwareInventoryNic { get; } - /// The timestamp of the hardware validation execution. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The timestamp of the hardware validation execution.", - SerializedName = @"lastValidationTime", - PossibleTypes = new [] { typeof(global::System.DateTime) })] - global::System.DateTime? HardwareValidationStatusLastValidationTime { get; } - /// The outcome of the hardware validation. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The outcome of the hardware validation.", - SerializedName = @"result", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineHardwareValidationResult) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineHardwareValidationResult? HardwareValidationStatusResult { get; } - /// - /// Field Deprecated. These fields will be empty/omitted. The list of the resource IDs for the HybridAksClusters that have - /// nodes hosted on this bare metal machine. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"Field Deprecated. These fields will be empty/omitted. The list of the resource IDs for the HybridAksClusters that have nodes hosted on this bare metal machine.", - SerializedName = @"hybridAksClustersAssociatedIds", - PossibleTypes = new [] { typeof(string) })] - string[] HybridAksClustersAssociatedId { get; } - /// - /// The name of this machine represented by the host object in the Cluster's Kubernetes control plane. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The name of this machine represented by the host object in the Cluster's Kubernetes control plane.", - SerializedName = @"kubernetesNodeName", - PossibleTypes = new [] { typeof(string) })] - string KubernetesNodeName { get; } - /// The version of Kubernetes running on this machine. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The version of Kubernetes running on this machine.", - SerializedName = @"kubernetesVersion", - PossibleTypes = new [] { typeof(string) })] - string KubernetesVersion { get; } - /// - /// The cluster version that has been applied to this machine during deployment or a version update. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The cluster version that has been applied to this machine during deployment or a version update.", - SerializedName = @"machineClusterVersion", - PossibleTypes = new [] { typeof(string) })] - string MachineClusterVersion { get; set; } - /// The custom details provided by the customer. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The custom details provided by the customer.", - SerializedName = @"machineDetails", - PossibleTypes = new [] { typeof(string) })] - string MachineDetail { get; set; } - /// The OS-level hostname assigned to this machine. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The OS-level hostname assigned to this machine.", - SerializedName = @"machineName", - PossibleTypes = new [] { typeof(string) })] - string MachineName { get; set; } - /// - /// The list of roles that are assigned to the cluster node running on this machine. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The list of roles that are assigned to the cluster node running on this machine.", - SerializedName = @"machineRoles", - PossibleTypes = new [] { typeof(string) })] - string[] MachineRole { get; } - /// The unique internal identifier of the bare metal machine SKU. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The unique internal identifier of the bare metal machine SKU.", - SerializedName = @"machineSkuId", - PossibleTypes = new [] { typeof(string) })] - string MachineSkuId { get; set; } - /// The image that is currently provisioned to the OS disk. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The image that is currently provisioned to the OS disk.", - SerializedName = @"osImage", - PossibleTypes = new [] { typeof(string) })] - string OSImage { get; } - /// - /// The IPv4 address that is assigned to the bare metal machine during the cluster deployment. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The IPv4 address that is assigned to the bare metal machine during the cluster deployment.", - SerializedName = @"oamIpv4Address", - PossibleTypes = new [] { typeof(string) })] - string OamIpv4Address { get; } - /// - /// The IPv6 address that is assigned to the bare metal machine during the cluster deployment. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The IPv6 address that is assigned to the bare metal machine during the cluster deployment.", - SerializedName = @"oamIpv6Address", - PossibleTypes = new [] { typeof(string) })] - string OamIpv6Address { get; } - /// The power state derived from the baseboard management controller. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The power state derived from the baseboard management controller.", - SerializedName = @"powerState", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachinePowerState) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachinePowerState? PowerState { get; } - /// The provisioning state of the bare metal machine. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The provisioning state of the bare metal machine.", - SerializedName = @"provisioningState", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineProvisioningState) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineProvisioningState? ProvisioningState { get; } - /// The resource ID of the rack where this bare metal machine resides. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The resource ID of the rack where this bare metal machine resides.", - SerializedName = @"rackId", - PossibleTypes = new [] { typeof(string) })] - string RackId { get; set; } - /// - /// The rack slot in which this bare metal machine is located, ordered from the bottom up i.e. the lowest slot is 1. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The rack slot in which this bare metal machine is located, ordered from the bottom up i.e. the lowest slot is 1.", - SerializedName = @"rackSlot", - PossibleTypes = new [] { typeof(long) })] - long RackSlot { get; set; } - /// The indicator of whether the bare metal machine is ready to receive workloads. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The indicator of whether the bare metal machine is ready to receive workloads.", - SerializedName = @"readyState", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineReadyState) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineReadyState? ReadyState { get; } - /// The timestamp when the malware definitions were last updated. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The timestamp when the malware definitions were last updated.", - SerializedName = @"definitionsLastUpdated", - PossibleTypes = new [] { typeof(global::System.DateTime) })] - global::System.DateTime? RuntimeProtectionStatusDefinitionsLastUpdated { get; } - /// The version of the malware definitions. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The version of the malware definitions.", - SerializedName = @"definitionsVersion", - PossibleTypes = new [] { typeof(string) })] - string RuntimeProtectionStatusDefinitionsVersion { get; } - /// - /// The timestamp of the most recently completed scan, or empty if there has never been a scan. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The timestamp of the most recently completed scan, or empty if there has never been a scan.", - SerializedName = @"scanCompletedTime", - PossibleTypes = new [] { typeof(global::System.DateTime) })] - global::System.DateTime? RuntimeProtectionStatusScanCompletedTime { get; } - /// - /// The timestamp of the most recently scheduled scan, or empty if no scan has been scheduled. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The timestamp of the most recently scheduled scan, or empty if no scan has been scheduled.", - SerializedName = @"scanScheduledTime", - PossibleTypes = new [] { typeof(global::System.DateTime) })] - global::System.DateTime? RuntimeProtectionStatusScanScheduledTime { get; } - /// - /// The timestamp of the most recently started scan, or empty if there has never been a scan. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The timestamp of the most recently started scan, or empty if there has never been a scan.", - SerializedName = @"scanStartedTime", - PossibleTypes = new [] { typeof(global::System.DateTime) })] - global::System.DateTime? RuntimeProtectionStatusScanStartedTime { get; } - /// The list of statuses that represent secret rotation activity. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The list of statuses that represent secret rotation activity.", - SerializedName = @"secretRotationStatus", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretRotationStatus) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretRotationStatus[] SecretRotationStatus { get; } - /// The serial number of the bare metal machine. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The serial number of the bare metal machine.", - SerializedName = @"serialNumber", - PossibleTypes = new [] { typeof(string) })] - string SerialNumber { get; set; } - /// The discovered value of the machine's service tag. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The discovered value of the machine's service tag.", - SerializedName = @"serviceTag", - PossibleTypes = new [] { typeof(string) })] - string ServiceTag { get; } - /// - /// Field Deprecated. These fields will be empty/omitted. The list of the resource IDs for the VirtualMachines that are hosted - /// on this bare metal machine. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"Field Deprecated. These fields will be empty/omitted. The list of the resource IDs for the VirtualMachines that are hosted on this bare metal machine.", - SerializedName = @"virtualMachinesAssociatedIds", - PossibleTypes = new [] { typeof(string) })] - string[] VirtualMachinesAssociatedId { get; } - - } - /// BareMetalMachineProperties represents the properties of a bare metal machine. - internal partial interface IBareMetalMachinePropertiesInternal - - { - /// - /// The list of resource IDs for the other Microsoft.NetworkCloud resources that have attached this network. - /// - string[] AssociatedResourceId { get; set; } - /// - /// The connection string for the baseboard management controller including IP address and protocol. - /// - string BmcConnectionString { get; set; } - /// - /// The credentials of the baseboard management controller on this bare metal machine. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministrativeCredentials BmcCredentials { get; set; } - /// The password of the administrator of the device used during initialization. - System.Security.SecureString BmcCredentialsPassword { get; set; } - /// The username of the administrator of the device used during initialization. - string BmcCredentialsUsername { get; set; } - /// The MAC address of the BMC device. - string BmcMacAddress { get; set; } - /// The MAC address of a NIC connected to the PXE network. - string BootMacAddress { get; set; } - /// The resource ID of the cluster this bare metal machine is associated with. - string ClusterId { get; set; } - /// The cordon status of the bare metal machine. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineCordonStatus? CordonStatus { get; set; } - /// The more detailed status of the bare metal machine. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineDetailedStatus? DetailedStatus { get; set; } - /// The descriptive message about the current detailed status. - string DetailedStatusMessage { get; set; } - /// - /// The hardware inventory, including information acquired from the model/sku information and from the ironic inspector. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IHardwareInventory HardwareInventory { get; set; } - /// - /// Freeform data extracted from the environment about this machine. This information varies depending on the specific hardware - /// and configuration. - /// - string HardwareInventoryAdditionalHostInformation { get; set; } - /// - /// The list of network interfaces and associated details for the bare metal machine. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IHardwareInventoryNetworkInterface[] HardwareInventoryInterface { get; set; } - /// - /// Field Deprecated. Will be removed in an upcoming version. The list of network interface cards and associated details for - /// the bare metal machine. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INic[] HardwareInventoryNic { get; set; } - /// - /// The details of the latest hardware validation performed for this bare metal machine. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IHardwareValidationStatus HardwareValidationStatus { get; set; } - /// The timestamp of the hardware validation execution. - global::System.DateTime? HardwareValidationStatusLastValidationTime { get; set; } - /// The outcome of the hardware validation. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineHardwareValidationResult? HardwareValidationStatusResult { get; set; } - /// - /// Field Deprecated. These fields will be empty/omitted. The list of the resource IDs for the HybridAksClusters that have - /// nodes hosted on this bare metal machine. - /// - string[] HybridAksClustersAssociatedId { get; set; } - /// - /// The name of this machine represented by the host object in the Cluster's Kubernetes control plane. - /// - string KubernetesNodeName { get; set; } - /// The version of Kubernetes running on this machine. - string KubernetesVersion { get; set; } - /// - /// The cluster version that has been applied to this machine during deployment or a version update. - /// - string MachineClusterVersion { get; set; } - /// The custom details provided by the customer. - string MachineDetail { get; set; } - /// The OS-level hostname assigned to this machine. - string MachineName { get; set; } - /// - /// The list of roles that are assigned to the cluster node running on this machine. - /// - string[] MachineRole { get; set; } - /// The unique internal identifier of the bare metal machine SKU. - string MachineSkuId { get; set; } - /// The image that is currently provisioned to the OS disk. - string OSImage { get; set; } - /// - /// The IPv4 address that is assigned to the bare metal machine during the cluster deployment. - /// - string OamIpv4Address { get; set; } - /// - /// The IPv6 address that is assigned to the bare metal machine during the cluster deployment. - /// - string OamIpv6Address { get; set; } - /// The power state derived from the baseboard management controller. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachinePowerState? PowerState { get; set; } - /// The provisioning state of the bare metal machine. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineProvisioningState? ProvisioningState { get; set; } - /// The resource ID of the rack where this bare metal machine resides. - string RackId { get; set; } - /// - /// The rack slot in which this bare metal machine is located, ordered from the bottom up i.e. the lowest slot is 1. - /// - long RackSlot { get; set; } - /// The indicator of whether the bare metal machine is ready to receive workloads. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineReadyState? ReadyState { get; set; } - /// The runtime protection status of the bare metal machine. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRuntimeProtectionStatus RuntimeProtectionStatus { get; set; } - /// The timestamp when the malware definitions were last updated. - global::System.DateTime? RuntimeProtectionStatusDefinitionsLastUpdated { get; set; } - /// The version of the malware definitions. - string RuntimeProtectionStatusDefinitionsVersion { get; set; } - /// - /// The timestamp of the most recently completed scan, or empty if there has never been a scan. - /// - global::System.DateTime? RuntimeProtectionStatusScanCompletedTime { get; set; } - /// - /// The timestamp of the most recently scheduled scan, or empty if no scan has been scheduled. - /// - global::System.DateTime? RuntimeProtectionStatusScanScheduledTime { get; set; } - /// - /// The timestamp of the most recently started scan, or empty if there has never been a scan. - /// - global::System.DateTime? RuntimeProtectionStatusScanStartedTime { get; set; } - /// The list of statuses that represent secret rotation activity. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretRotationStatus[] SecretRotationStatus { get; set; } - /// The serial number of the bare metal machine. - string SerialNumber { get; set; } - /// The discovered value of the machine's service tag. - string ServiceTag { get; set; } - /// - /// Field Deprecated. These fields will be empty/omitted. The list of the resource IDs for the VirtualMachines that are hosted - /// on this bare metal machine. - /// - string[] VirtualMachinesAssociatedId { get; set; } - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineReplaceParameters.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineReplaceParameters.PowerShell.cs deleted file mode 100644 index e7ddbbd18f33..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineReplaceParameters.PowerShell.cs +++ /dev/null @@ -1,218 +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.NetworkCloud.Models.Api20250201 -{ - using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; - - /// - /// BareMetalMachineReplaceParameters represents the body of the request to physically swap a bare metal machine for another. - /// - [System.ComponentModel.TypeConverter(typeof(BareMetalMachineReplaceParametersTypeConverter))] - public partial class BareMetalMachineReplaceParameters - { - - /// - /// 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 BareMetalMachineReplaceParameters(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("BmcCredentials")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineReplaceParametersInternal)this).BmcCredentials = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministrativeCredentials) content.GetValueForProperty("BmcCredentials",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineReplaceParametersInternal)this).BmcCredentials, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AdministrativeCredentialsTypeConverter.ConvertFrom); - } - if (content.Contains("BmcMacAddress")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineReplaceParametersInternal)this).BmcMacAddress = (string) content.GetValueForProperty("BmcMacAddress",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineReplaceParametersInternal)this).BmcMacAddress, global::System.Convert.ToString); - } - if (content.Contains("BootMacAddress")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineReplaceParametersInternal)this).BootMacAddress = (string) content.GetValueForProperty("BootMacAddress",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineReplaceParametersInternal)this).BootMacAddress, global::System.Convert.ToString); - } - if (content.Contains("MachineName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineReplaceParametersInternal)this).MachineName = (string) content.GetValueForProperty("MachineName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineReplaceParametersInternal)this).MachineName, global::System.Convert.ToString); - } - if (content.Contains("SerialNumber")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineReplaceParametersInternal)this).SerialNumber = (string) content.GetValueForProperty("SerialNumber",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineReplaceParametersInternal)this).SerialNumber, global::System.Convert.ToString); - } - if (content.Contains("BmcCredentialsPassword")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineReplaceParametersInternal)this).BmcCredentialsPassword = (System.Security.SecureString) content.GetValueForProperty("BmcCredentialsPassword",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineReplaceParametersInternal)this).BmcCredentialsPassword, (object ss) => (System.Security.SecureString)ss); - } - if (content.Contains("BmcCredentialsUsername")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineReplaceParametersInternal)this).BmcCredentialsUsername = (string) content.GetValueForProperty("BmcCredentialsUsername",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineReplaceParametersInternal)this).BmcCredentialsUsername, 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 BareMetalMachineReplaceParameters(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("BmcCredentials")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineReplaceParametersInternal)this).BmcCredentials = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministrativeCredentials) content.GetValueForProperty("BmcCredentials",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineReplaceParametersInternal)this).BmcCredentials, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AdministrativeCredentialsTypeConverter.ConvertFrom); - } - if (content.Contains("BmcMacAddress")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineReplaceParametersInternal)this).BmcMacAddress = (string) content.GetValueForProperty("BmcMacAddress",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineReplaceParametersInternal)this).BmcMacAddress, global::System.Convert.ToString); - } - if (content.Contains("BootMacAddress")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineReplaceParametersInternal)this).BootMacAddress = (string) content.GetValueForProperty("BootMacAddress",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineReplaceParametersInternal)this).BootMacAddress, global::System.Convert.ToString); - } - if (content.Contains("MachineName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineReplaceParametersInternal)this).MachineName = (string) content.GetValueForProperty("MachineName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineReplaceParametersInternal)this).MachineName, global::System.Convert.ToString); - } - if (content.Contains("SerialNumber")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineReplaceParametersInternal)this).SerialNumber = (string) content.GetValueForProperty("SerialNumber",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineReplaceParametersInternal)this).SerialNumber, global::System.Convert.ToString); - } - if (content.Contains("BmcCredentialsPassword")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineReplaceParametersInternal)this).BmcCredentialsPassword = (System.Security.SecureString) content.GetValueForProperty("BmcCredentialsPassword",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineReplaceParametersInternal)this).BmcCredentialsPassword, (object ss) => (System.Security.SecureString)ss); - } - if (content.Contains("BmcCredentialsUsername")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineReplaceParametersInternal)this).BmcCredentialsUsername = (string) content.GetValueForProperty("BmcCredentialsUsername",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineReplaceParametersInternal)this).BmcCredentialsUsername, 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.NetworkCloud.Models.Api20250201.IBareMetalMachineReplaceParameters DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new BareMetalMachineReplaceParameters(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.NetworkCloud.Models.Api20250201.IBareMetalMachineReplaceParameters DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new BareMetalMachineReplaceParameters(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.NetworkCloud.Models.Api20250201.IBareMetalMachineReplaceParameters FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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(); - } - } - /// BareMetalMachineReplaceParameters represents the body of the request to physically swap a bare metal machine for another. - [System.ComponentModel.TypeConverter(typeof(BareMetalMachineReplaceParametersTypeConverter))] - public partial interface IBareMetalMachineReplaceParameters - - { - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineRunCommandParameters.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineRunCommandParameters.PowerShell.cs deleted file mode 100644 index d34bcd5be8ba..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineRunCommandParameters.PowerShell.cs +++ /dev/null @@ -1,186 +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.NetworkCloud.Models.Api20250201 -{ - using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; - - /// - /// BareMetalMachineRunCommandParameters represents the body of the request to execute a script on the bare metal machine. - /// - [System.ComponentModel.TypeConverter(typeof(BareMetalMachineRunCommandParametersTypeConverter))] - public partial class BareMetalMachineRunCommandParameters - { - - /// - /// 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 BareMetalMachineRunCommandParameters(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("Argument")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineRunCommandParametersInternal)this).Argument = (string[]) content.GetValueForProperty("Argument",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineRunCommandParametersInternal)this).Argument, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("LimitTimeSecond")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineRunCommandParametersInternal)this).LimitTimeSecond = (long) content.GetValueForProperty("LimitTimeSecond",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineRunCommandParametersInternal)this).LimitTimeSecond, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("Script")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineRunCommandParametersInternal)this).Script = (string) content.GetValueForProperty("Script",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineRunCommandParametersInternal)this).Script, 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 BareMetalMachineRunCommandParameters(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("Argument")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineRunCommandParametersInternal)this).Argument = (string[]) content.GetValueForProperty("Argument",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineRunCommandParametersInternal)this).Argument, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("LimitTimeSecond")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineRunCommandParametersInternal)this).LimitTimeSecond = (long) content.GetValueForProperty("LimitTimeSecond",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineRunCommandParametersInternal)this).LimitTimeSecond, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("Script")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineRunCommandParametersInternal)this).Script = (string) content.GetValueForProperty("Script",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineRunCommandParametersInternal)this).Script, 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.NetworkCloud.Models.Api20250201.IBareMetalMachineRunCommandParameters DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new BareMetalMachineRunCommandParameters(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.NetworkCloud.Models.Api20250201.IBareMetalMachineRunCommandParameters DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new BareMetalMachineRunCommandParameters(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.NetworkCloud.Models.Api20250201.IBareMetalMachineRunCommandParameters FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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(); - } - } - /// BareMetalMachineRunCommandParameters represents the body of the request to execute a script on the bare metal machine. - [System.ComponentModel.TypeConverter(typeof(BareMetalMachineRunCommandParametersTypeConverter))] - public partial interface IBareMetalMachineRunCommandParameters - - { - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineRunDataExtractsParameters.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineRunDataExtractsParameters.PowerShell.cs deleted file mode 100644 index edb304bdf160..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineRunDataExtractsParameters.PowerShell.cs +++ /dev/null @@ -1,181 +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.NetworkCloud.Models.Api20250201 -{ - using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; - - /// - /// BareMetalMachineRunDataExtractsParameters represents the body of request containing list of curated data extraction commands - /// to run on the bare metal machine. - /// - [System.ComponentModel.TypeConverter(typeof(BareMetalMachineRunDataExtractsParametersTypeConverter))] - public partial class BareMetalMachineRunDataExtractsParameters - { - - /// - /// 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 BareMetalMachineRunDataExtractsParameters(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("Command")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineRunDataExtractsParametersInternal)this).Command = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineCommandSpecification[]) content.GetValueForProperty("Command",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineRunDataExtractsParametersInternal)this).Command, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BareMetalMachineCommandSpecificationTypeConverter.ConvertFrom)); - } - if (content.Contains("LimitTimeSecond")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineRunDataExtractsParametersInternal)this).LimitTimeSecond = (long) content.GetValueForProperty("LimitTimeSecond",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineRunDataExtractsParametersInternal)this).LimitTimeSecond, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal BareMetalMachineRunDataExtractsParameters(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("Command")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineRunDataExtractsParametersInternal)this).Command = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineCommandSpecification[]) content.GetValueForProperty("Command",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineRunDataExtractsParametersInternal)this).Command, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BareMetalMachineCommandSpecificationTypeConverter.ConvertFrom)); - } - if (content.Contains("LimitTimeSecond")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineRunDataExtractsParametersInternal)this).LimitTimeSecond = (long) content.GetValueForProperty("LimitTimeSecond",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineRunDataExtractsParametersInternal)this).LimitTimeSecond, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - 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.NetworkCloud.Models.Api20250201.IBareMetalMachineRunDataExtractsParameters DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new BareMetalMachineRunDataExtractsParameters(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.NetworkCloud.Models.Api20250201.IBareMetalMachineRunDataExtractsParameters DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new BareMetalMachineRunDataExtractsParameters(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.NetworkCloud.Models.Api20250201.IBareMetalMachineRunDataExtractsParameters FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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(); - } - } - /// BareMetalMachineRunDataExtractsParameters represents the body of request containing list of curated data extraction commands - /// to run on the bare metal machine. - [System.ComponentModel.TypeConverter(typeof(BareMetalMachineRunDataExtractsParametersTypeConverter))] - public partial interface IBareMetalMachineRunDataExtractsParameters - - { - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineRunReadCommandsParameters.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineRunReadCommandsParameters.PowerShell.cs deleted file mode 100644 index 3998ba8a97fc..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineRunReadCommandsParameters.PowerShell.cs +++ /dev/null @@ -1,181 +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.NetworkCloud.Models.Api20250201 -{ - using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; - - /// - /// BareMetalMachineRunReadCommandsParameters represents the body of request containing list of read-only commands to run - /// on the bare metal machine. - /// - [System.ComponentModel.TypeConverter(typeof(BareMetalMachineRunReadCommandsParametersTypeConverter))] - public partial class BareMetalMachineRunReadCommandsParameters - { - - /// - /// 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 BareMetalMachineRunReadCommandsParameters(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("Command")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineRunReadCommandsParametersInternal)this).Command = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineCommandSpecification[]) content.GetValueForProperty("Command",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineRunReadCommandsParametersInternal)this).Command, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BareMetalMachineCommandSpecificationTypeConverter.ConvertFrom)); - } - if (content.Contains("LimitTimeSecond")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineRunReadCommandsParametersInternal)this).LimitTimeSecond = (long) content.GetValueForProperty("LimitTimeSecond",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineRunReadCommandsParametersInternal)this).LimitTimeSecond, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal BareMetalMachineRunReadCommandsParameters(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("Command")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineRunReadCommandsParametersInternal)this).Command = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineCommandSpecification[]) content.GetValueForProperty("Command",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineRunReadCommandsParametersInternal)this).Command, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BareMetalMachineCommandSpecificationTypeConverter.ConvertFrom)); - } - if (content.Contains("LimitTimeSecond")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineRunReadCommandsParametersInternal)this).LimitTimeSecond = (long) content.GetValueForProperty("LimitTimeSecond",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineRunReadCommandsParametersInternal)this).LimitTimeSecond, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - 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.NetworkCloud.Models.Api20250201.IBareMetalMachineRunReadCommandsParameters DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new BareMetalMachineRunReadCommandsParameters(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.NetworkCloud.Models.Api20250201.IBareMetalMachineRunReadCommandsParameters DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new BareMetalMachineRunReadCommandsParameters(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.NetworkCloud.Models.Api20250201.IBareMetalMachineRunReadCommandsParameters FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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(); - } - } - /// BareMetalMachineRunReadCommandsParameters represents the body of request containing list of read-only commands to run - /// on the bare metal machine. - [System.ComponentModel.TypeConverter(typeof(BareMetalMachineRunReadCommandsParametersTypeConverter))] - public partial interface IBareMetalMachineRunReadCommandsParameters - - { - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BgpAdvertisement.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BgpAdvertisement.PowerShell.cs deleted file mode 100644 index 13cd32b9977d..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BgpAdvertisement.PowerShell.cs +++ /dev/null @@ -1,190 +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.NetworkCloud.Models.Api20250201 -{ - using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; - - /// - /// BgpAdvertisement represents the association of IP address pools to the communities and peers. - /// - [System.ComponentModel.TypeConverter(typeof(BgpAdvertisementTypeConverter))] - public partial class BgpAdvertisement - { - - /// - /// 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 BgpAdvertisement(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("AdvertiseToFabric")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBgpAdvertisementInternal)this).AdvertiseToFabric = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.AdvertiseToFabric?) content.GetValueForProperty("AdvertiseToFabric",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBgpAdvertisementInternal)this).AdvertiseToFabric, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.AdvertiseToFabric.CreateFrom); - } - if (content.Contains("Community")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBgpAdvertisementInternal)this).Community = (string[]) content.GetValueForProperty("Community",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBgpAdvertisementInternal)this).Community, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("IPAddressPool")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBgpAdvertisementInternal)this).IPAddressPool = (string[]) content.GetValueForProperty("IPAddressPool",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBgpAdvertisementInternal)this).IPAddressPool, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("Peer")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBgpAdvertisementInternal)this).Peer = (string[]) content.GetValueForProperty("Peer",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBgpAdvertisementInternal)this).Peer, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal BgpAdvertisement(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("AdvertiseToFabric")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBgpAdvertisementInternal)this).AdvertiseToFabric = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.AdvertiseToFabric?) content.GetValueForProperty("AdvertiseToFabric",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBgpAdvertisementInternal)this).AdvertiseToFabric, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.AdvertiseToFabric.CreateFrom); - } - if (content.Contains("Community")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBgpAdvertisementInternal)this).Community = (string[]) content.GetValueForProperty("Community",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBgpAdvertisementInternal)this).Community, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("IPAddressPool")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBgpAdvertisementInternal)this).IPAddressPool = (string[]) content.GetValueForProperty("IPAddressPool",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBgpAdvertisementInternal)this).IPAddressPool, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("Peer")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBgpAdvertisementInternal)this).Peer = (string[]) content.GetValueForProperty("Peer",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBgpAdvertisementInternal)this).Peer, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - AfterDeserializePSObject(content); - } - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBgpAdvertisement DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new BgpAdvertisement(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.NetworkCloud.Models.Api20250201.IBgpAdvertisement DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new BgpAdvertisement(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.NetworkCloud.Models.Api20250201.IBgpAdvertisement FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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(); - } - } - /// BgpAdvertisement represents the association of IP address pools to the communities and peers. - [System.ComponentModel.TypeConverter(typeof(BgpAdvertisementTypeConverter))] - public partial interface IBgpAdvertisement - - { - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BgpAdvertisement.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BgpAdvertisement.cs deleted file mode 100644 index fe4a1f059b90..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BgpAdvertisement.cs +++ /dev/null @@ -1,131 +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.NetworkCloud.Models.Api20250201 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; - - /// - /// BgpAdvertisement represents the association of IP address pools to the communities and peers. - /// - public partial class BgpAdvertisement : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBgpAdvertisement, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBgpAdvertisementInternal - { - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.AdvertiseToFabric? _advertiseToFabric; - - /// - /// The indicator of if this advertisement is also made to the network fabric associated with the Network Cloud Cluster. This - /// field is ignored if fabricPeeringEnabled is set to False. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.AdvertiseToFabric? AdvertiseToFabric { get => this._advertiseToFabric; set => this._advertiseToFabric = value; } - - /// Backing field for property. - private string[] _community; - - /// - /// The names of the BGP communities to be associated with the announcement, utilizing a BGP community string in 1234:1234 - /// format. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string[] Community { get => this._community; set => this._community = value; } - - /// Backing field for property. - private string[] _iPAddressPool; - - /// The names of the IP address pools associated with this announcement. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string[] IPAddressPool { get => this._iPAddressPool; set => this._iPAddressPool = value; } - - /// Backing field for property. - private string[] _peer; - - /// - /// The names of the BGP peers to limit this advertisement to. If no values are specified, all BGP peers will receive this - /// advertisement. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string[] Peer { get => this._peer; set => this._peer = value; } - - /// Creates an new instance. - public BgpAdvertisement() - { - - } - } - /// BgpAdvertisement represents the association of IP address pools to the communities and peers. - public partial interface IBgpAdvertisement : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable - { - /// - /// The indicator of if this advertisement is also made to the network fabric associated with the Network Cloud Cluster. This - /// field is ignored if fabricPeeringEnabled is set to False. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The indicator of if this advertisement is also made to the network fabric associated with the Network Cloud Cluster. This field is ignored if fabricPeeringEnabled is set to False.", - SerializedName = @"advertiseToFabric", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.AdvertiseToFabric) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.AdvertiseToFabric? AdvertiseToFabric { get; set; } - /// - /// The names of the BGP communities to be associated with the announcement, utilizing a BGP community string in 1234:1234 - /// format. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The names of the BGP communities to be associated with the announcement, utilizing a BGP community string in 1234:1234 format.", - SerializedName = @"communities", - PossibleTypes = new [] { typeof(string) })] - string[] Community { get; set; } - /// The names of the IP address pools associated with this announcement. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The names of the IP address pools associated with this announcement.", - SerializedName = @"ipAddressPools", - PossibleTypes = new [] { typeof(string) })] - string[] IPAddressPool { get; set; } - /// - /// The names of the BGP peers to limit this advertisement to. If no values are specified, all BGP peers will receive this - /// advertisement. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The names of the BGP peers to limit this advertisement to. If no values are specified, all BGP peers will receive this advertisement.", - SerializedName = @"peers", - PossibleTypes = new [] { typeof(string) })] - string[] Peer { get; set; } - - } - /// BgpAdvertisement represents the association of IP address pools to the communities and peers. - internal partial interface IBgpAdvertisementInternal - - { - /// - /// The indicator of if this advertisement is also made to the network fabric associated with the Network Cloud Cluster. This - /// field is ignored if fabricPeeringEnabled is set to False. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.AdvertiseToFabric? AdvertiseToFabric { get; set; } - /// - /// The names of the BGP communities to be associated with the announcement, utilizing a BGP community string in 1234:1234 - /// format. - /// - string[] Community { get; set; } - /// The names of the IP address pools associated with this announcement. - string[] IPAddressPool { get; set; } - /// - /// The names of the BGP peers to limit this advertisement to. If no values are specified, all BGP peers will receive this - /// advertisement. - /// - string[] Peer { get; set; } - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BgpAdvertisement.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BgpAdvertisement.json.cs deleted file mode 100644 index 55d2ad68d88a..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BgpAdvertisement.json.cs +++ /dev/null @@ -1,140 +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.NetworkCloud.Models.Api20250201 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; - - /// - /// BgpAdvertisement represents the association of IP address pools to the communities and peers. - /// - public partial class BgpAdvertisement - { - - /// - /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object - /// before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The JsonNode that should be deserialized into this object. - - partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json); - - /// - /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The JSON container that the serialization result will be placed in. - - partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container); - - /// - /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of - /// the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the - /// output parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The JsonNode that should be deserialized into this object. - /// Determines if the rest of the deserialization should be processed, or if the method should return - /// instantly. - - partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json, ref bool returnNow); - - /// - /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the - /// object before it is serialized. - /// If you wish to disable the default serialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The JSON container that the serialization result will be placed in. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, ref bool returnNow); - - /// - /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject into a new instance of . - /// - /// A Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject instance to deserialize from. - internal BgpAdvertisement(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) - { - bool returnNow = false; - BeforeFromJson(json, ref returnNow); - if (returnNow) - { - return; - } - {_advertiseToFabric = If( json?.PropertyT("advertiseToFabric"), out var __jsonAdvertiseToFabric) ? (string)__jsonAdvertiseToFabric : (string)AdvertiseToFabric;} - {_community = If( json?.PropertyT("communities"), out var __jsonCommunities) ? If( __jsonCommunities as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : Community;} - {_iPAddressPool = If( json?.PropertyT("ipAddressPools"), out var __jsonIPAddressPools) ? If( __jsonIPAddressPools as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Json.JsonString __o ? (string)(__o.ToString()) : null)) ))() : null : IPAddressPool;} - {_peer = If( json?.PropertyT("peers"), out var __jsonPeers) ? If( __jsonPeers as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Json.JsonString __j ? (string)(__j.ToString()) : null)) ))() : null : Peer;} - AfterFromJson(json); - } - - /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBgpAdvertisement. - /// - /// a to deserialize from. - /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBgpAdvertisement. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBgpAdvertisement FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) - { - return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new BgpAdvertisement(json) : null; - } - - /// - /// Serializes this instance of into a . - /// - /// The container to serialize this object into. If the caller - /// passes in null, a new instance will be created and returned to the caller. - /// Allows the caller to choose the depth of the serialization. See . - /// - /// a serialized instance of as a . - /// - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode) - { - container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject(); - - bool returnNow = false; - BeforeToJson(ref container, ref returnNow); - if (returnNow) - { - return container; - } - AddIf( null != (((object)this._advertiseToFabric)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._advertiseToFabric.ToString()) : null, "advertiseToFabric" ,container.Add ); - if (null != this._community) - { - var __w = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.XNodeArray(); - foreach( var __x in this._community ) - { - AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); - } - container.Add("communities",__w); - } - if (null != this._iPAddressPool) - { - var __r = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.XNodeArray(); - foreach( var __s in this._iPAddressPool ) - { - AddIf(null != (((object)__s)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(__s.ToString()) : null ,__r.Add); - } - container.Add("ipAddressPools",__r); - } - if (null != this._peer) - { - var __m = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.XNodeArray(); - foreach( var __n in this._peer ) - { - AddIf(null != (((object)__n)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(__n.ToString()) : null ,__m.Add); - } - container.Add("peers",__m); - } - AfterToJson(ref container); - return container; - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BgpServiceLoadBalancerConfiguration.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BgpServiceLoadBalancerConfiguration.PowerShell.cs deleted file mode 100644 index 9ae563720f01..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BgpServiceLoadBalancerConfiguration.PowerShell.cs +++ /dev/null @@ -1,194 +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.NetworkCloud.Models.Api20250201 -{ - using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; - - /// - /// BgpServiceLoadBalancerConfiguration represents the configuration of a BGP service load balancer. - /// - [System.ComponentModel.TypeConverter(typeof(BgpServiceLoadBalancerConfigurationTypeConverter))] - public partial class BgpServiceLoadBalancerConfiguration - { - - /// - /// 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 BgpServiceLoadBalancerConfiguration(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("BgpAdvertisement")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBgpServiceLoadBalancerConfigurationInternal)this).BgpAdvertisement = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBgpAdvertisement[]) content.GetValueForProperty("BgpAdvertisement",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBgpServiceLoadBalancerConfigurationInternal)this).BgpAdvertisement, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BgpAdvertisementTypeConverter.ConvertFrom)); - } - if (content.Contains("BgpPeer")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBgpServiceLoadBalancerConfigurationInternal)this).BgpPeer = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IServiceLoadBalancerBgpPeer[]) content.GetValueForProperty("BgpPeer",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBgpServiceLoadBalancerConfigurationInternal)this).BgpPeer, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ServiceLoadBalancerBgpPeerTypeConverter.ConvertFrom)); - } - if (content.Contains("FabricPeeringEnabled")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBgpServiceLoadBalancerConfigurationInternal)this).FabricPeeringEnabled = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.FabricPeeringEnabled?) content.GetValueForProperty("FabricPeeringEnabled",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBgpServiceLoadBalancerConfigurationInternal)this).FabricPeeringEnabled, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.FabricPeeringEnabled.CreateFrom); - } - if (content.Contains("IPAddressPool")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBgpServiceLoadBalancerConfigurationInternal)this).IPAddressPool = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIPAddressPool[]) content.GetValueForProperty("IPAddressPool",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBgpServiceLoadBalancerConfigurationInternal)this).IPAddressPool, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IPAddressPoolTypeConverter.ConvertFrom)); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal BgpServiceLoadBalancerConfiguration(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("BgpAdvertisement")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBgpServiceLoadBalancerConfigurationInternal)this).BgpAdvertisement = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBgpAdvertisement[]) content.GetValueForProperty("BgpAdvertisement",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBgpServiceLoadBalancerConfigurationInternal)this).BgpAdvertisement, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BgpAdvertisementTypeConverter.ConvertFrom)); - } - if (content.Contains("BgpPeer")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBgpServiceLoadBalancerConfigurationInternal)this).BgpPeer = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IServiceLoadBalancerBgpPeer[]) content.GetValueForProperty("BgpPeer",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBgpServiceLoadBalancerConfigurationInternal)this).BgpPeer, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ServiceLoadBalancerBgpPeerTypeConverter.ConvertFrom)); - } - if (content.Contains("FabricPeeringEnabled")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBgpServiceLoadBalancerConfigurationInternal)this).FabricPeeringEnabled = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.FabricPeeringEnabled?) content.GetValueForProperty("FabricPeeringEnabled",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBgpServiceLoadBalancerConfigurationInternal)this).FabricPeeringEnabled, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.FabricPeeringEnabled.CreateFrom); - } - if (content.Contains("IPAddressPool")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBgpServiceLoadBalancerConfigurationInternal)this).IPAddressPool = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIPAddressPool[]) content.GetValueForProperty("IPAddressPool",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBgpServiceLoadBalancerConfigurationInternal)this).IPAddressPool, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IPAddressPoolTypeConverter.ConvertFrom)); - } - AfterDeserializePSObject(content); - } - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBgpServiceLoadBalancerConfiguration DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new BgpServiceLoadBalancerConfiguration(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.NetworkCloud.Models.Api20250201.IBgpServiceLoadBalancerConfiguration DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new BgpServiceLoadBalancerConfiguration(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.NetworkCloud.Models.Api20250201.IBgpServiceLoadBalancerConfiguration FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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(); - } - } - /// BgpServiceLoadBalancerConfiguration represents the configuration of a BGP service load balancer. - [System.ComponentModel.TypeConverter(typeof(BgpServiceLoadBalancerConfigurationTypeConverter))] - public partial interface IBgpServiceLoadBalancerConfiguration - - { - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BgpServiceLoadBalancerConfiguration.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BgpServiceLoadBalancerConfiguration.cs deleted file mode 100644 index f977cf0a4b0c..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BgpServiceLoadBalancerConfiguration.cs +++ /dev/null @@ -1,122 +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.NetworkCloud.Models.Api20250201 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; - - /// - /// BgpServiceLoadBalancerConfiguration represents the configuration of a BGP service load balancer. - /// - public partial class BgpServiceLoadBalancerConfiguration : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBgpServiceLoadBalancerConfiguration, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBgpServiceLoadBalancerConfigurationInternal - { - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBgpAdvertisement[] _bgpAdvertisement; - - /// - /// The association of IP address pools to the communities and peers, allowing for announcement of IPs. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBgpAdvertisement[] BgpAdvertisement { get => this._bgpAdvertisement; set => this._bgpAdvertisement = value; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IServiceLoadBalancerBgpPeer[] _bgpPeer; - - /// - /// The list of additional BgpPeer entities that the Kubernetes cluster will peer with. All peering must be explicitly defined. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IServiceLoadBalancerBgpPeer[] BgpPeer { get => this._bgpPeer; set => this._bgpPeer = value; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.FabricPeeringEnabled? _fabricPeeringEnabled; - - /// The indicator to specify if the load balancer peers with the network fabric. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.FabricPeeringEnabled? FabricPeeringEnabled { get => this._fabricPeeringEnabled; set => this._fabricPeeringEnabled = value; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIPAddressPool[] _iPAddressPool; - - /// - /// The list of pools of IP addresses that can be allocated to load balancer services. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIPAddressPool[] IPAddressPool { get => this._iPAddressPool; set => this._iPAddressPool = value; } - - /// Creates an new instance. - public BgpServiceLoadBalancerConfiguration() - { - - } - } - /// BgpServiceLoadBalancerConfiguration represents the configuration of a BGP service load balancer. - public partial interface IBgpServiceLoadBalancerConfiguration : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable - { - /// - /// The association of IP address pools to the communities and peers, allowing for announcement of IPs. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The association of IP address pools to the communities and peers, allowing for announcement of IPs.", - SerializedName = @"bgpAdvertisements", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBgpAdvertisement) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBgpAdvertisement[] BgpAdvertisement { get; set; } - /// - /// The list of additional BgpPeer entities that the Kubernetes cluster will peer with. All peering must be explicitly defined. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The list of additional BgpPeer entities that the Kubernetes cluster will peer with. All peering must be explicitly defined.", - SerializedName = @"bgpPeers", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IServiceLoadBalancerBgpPeer) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IServiceLoadBalancerBgpPeer[] BgpPeer { get; set; } - /// The indicator to specify if the load balancer peers with the network fabric. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The indicator to specify if the load balancer peers with the network fabric.", - SerializedName = @"fabricPeeringEnabled", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.FabricPeeringEnabled) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.FabricPeeringEnabled? FabricPeeringEnabled { get; set; } - /// - /// The list of pools of IP addresses that can be allocated to load balancer services. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The list of pools of IP addresses that can be allocated to load balancer services.", - SerializedName = @"ipAddressPools", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIPAddressPool) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIPAddressPool[] IPAddressPool { get; set; } - - } - /// BgpServiceLoadBalancerConfiguration represents the configuration of a BGP service load balancer. - internal partial interface IBgpServiceLoadBalancerConfigurationInternal - - { - /// - /// The association of IP address pools to the communities and peers, allowing for announcement of IPs. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBgpAdvertisement[] BgpAdvertisement { get; set; } - /// - /// The list of additional BgpPeer entities that the Kubernetes cluster will peer with. All peering must be explicitly defined. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IServiceLoadBalancerBgpPeer[] BgpPeer { get; set; } - /// The indicator to specify if the load balancer peers with the network fabric. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.FabricPeeringEnabled? FabricPeeringEnabled { get; set; } - /// - /// The list of pools of IP addresses that can be allocated to load balancer services. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIPAddressPool[] IPAddressPool { get; set; } - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BgpServiceLoadBalancerConfiguration.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BgpServiceLoadBalancerConfiguration.json.cs deleted file mode 100644 index 4be4a9ba7144..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BgpServiceLoadBalancerConfiguration.json.cs +++ /dev/null @@ -1,141 +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.NetworkCloud.Models.Api20250201 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; - - /// - /// BgpServiceLoadBalancerConfiguration represents the configuration of a BGP service load balancer. - /// - public partial class BgpServiceLoadBalancerConfiguration - { - - /// - /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object - /// before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The JsonNode that should be deserialized into this object. - - partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json); - - /// - /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The JSON container that the serialization result will be placed in. - - partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container); - - /// - /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of - /// the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the - /// output parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The JsonNode that should be deserialized into this object. - /// Determines if the rest of the deserialization should be processed, or if the method should return - /// instantly. - - partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json, ref bool returnNow); - - /// - /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the - /// object before it is serialized. - /// If you wish to disable the default serialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The JSON container that the serialization result will be placed in. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, ref bool returnNow); - - /// - /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject into a new instance of . - /// - /// A Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject instance to deserialize from. - internal BgpServiceLoadBalancerConfiguration(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) - { - bool returnNow = false; - BeforeFromJson(json, ref returnNow); - if (returnNow) - { - return; - } - {_bgpAdvertisement = If( json?.PropertyT("bgpAdvertisements"), out var __jsonBgpAdvertisements) ? If( __jsonBgpAdvertisements as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IBgpAdvertisement) (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BgpAdvertisement.FromJson(__u) )) ))() : null : BgpAdvertisement;} - {_bgpPeer = If( json?.PropertyT("bgpPeers"), out var __jsonBgpPeers) ? If( __jsonBgpPeers as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IServiceLoadBalancerBgpPeer) (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ServiceLoadBalancerBgpPeer.FromJson(__p) )) ))() : null : BgpPeer;} - {_fabricPeeringEnabled = If( json?.PropertyT("fabricPeeringEnabled"), out var __jsonFabricPeeringEnabled) ? (string)__jsonFabricPeeringEnabled : (string)FabricPeeringEnabled;} - {_iPAddressPool = If( json?.PropertyT("ipAddressPools"), out var __jsonIPAddressPools) ? If( __jsonIPAddressPools as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonArray, out var __l) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__l, (__k)=>(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIPAddressPool) (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IPAddressPool.FromJson(__k) )) ))() : null : IPAddressPool;} - AfterFromJson(json); - } - - /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBgpServiceLoadBalancerConfiguration. - /// - /// a to deserialize from. - /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBgpServiceLoadBalancerConfiguration. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBgpServiceLoadBalancerConfiguration FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) - { - return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new BgpServiceLoadBalancerConfiguration(json) : null; - } - - /// - /// Serializes this instance of into a . - /// - /// The container to serialize this object into. If the caller - /// passes in null, a new instance will be created and returned to the caller. - /// Allows the caller to choose the depth of the serialization. See . - /// - /// a serialized instance of as a . - /// - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode) - { - container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject(); - - bool returnNow = false; - BeforeToJson(ref container, ref returnNow); - if (returnNow) - { - return container; - } - if (null != this._bgpAdvertisement) - { - var __w = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.XNodeArray(); - foreach( var __x in this._bgpAdvertisement ) - { - AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); - } - container.Add("bgpAdvertisements",__w); - } - if (null != this._bgpPeer) - { - var __r = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.XNodeArray(); - foreach( var __s in this._bgpPeer ) - { - AddIf(__s?.ToJson(null, serializationMode) ,__r.Add); - } - container.Add("bgpPeers",__r); - } - AddIf( null != (((object)this._fabricPeeringEnabled)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._fabricPeeringEnabled.ToString()) : null, "fabricPeeringEnabled" ,container.Add ); - if (null != this._iPAddressPool) - { - var __m = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.XNodeArray(); - foreach( var __n in this._iPAddressPool ) - { - AddIf(__n?.ToJson(null, serializationMode) ,__m.Add); - } - container.Add("ipAddressPools",__m); - } - AfterToJson(ref container); - return container; - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BmcKeySet.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BmcKeySet.PowerShell.cs deleted file mode 100644 index 8de1ba78cee9..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BmcKeySet.PowerShell.cs +++ /dev/null @@ -1,364 +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.NetworkCloud.Models.Api20250201 -{ - using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; - - /// BmcKeySet represents the baseboard management controller key set. - [System.ComponentModel.TypeConverter(typeof(BmcKeySetTypeConverter))] - public partial class BmcKeySet - { - - /// - /// 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 BmcKeySet(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("ExtendedLocation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetInternal)this).ExtendedLocation = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocation) content.GetValueForProperty("ExtendedLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetInternal)this).ExtendedLocation, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ExtendedLocationTypeConverter.ConvertFrom); - } - if (content.Contains("Property")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BmcKeySetPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Etag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetInternal)this).Etag, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)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("SystemDataCreatedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataLastModifiedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("SystemData")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.SystemDataTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Type, global::System.Convert.ToString); - } - if (content.Contains("Tag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.TrackedResourceTagsTypeConverter.ConvertFrom); - } - if (content.Contains("Location")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); - } - if (content.Contains("ExtendedLocationName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetInternal)this).ExtendedLocationName = (string) content.GetValueForProperty("ExtendedLocationName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetInternal)this).ExtendedLocationName, global::System.Convert.ToString); - } - if (content.Contains("ExtendedLocationType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetInternal)this).ExtendedLocationType = (string) content.GetValueForProperty("ExtendedLocationType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetInternal)this).ExtendedLocationType, global::System.Convert.ToString); - } - if (content.Contains("AzureGroupId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetInternal)this).AzureGroupId = (string) content.GetValueForProperty("AzureGroupId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetInternal)this).AzureGroupId, global::System.Convert.ToString); - } - if (content.Contains("DetailedStatus")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetInternal)this).DetailedStatus = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BmcKeySetDetailedStatus?) content.GetValueForProperty("DetailedStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetInternal)this).DetailedStatus, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BmcKeySetDetailedStatus.CreateFrom); - } - if (content.Contains("DetailedStatusMessage")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetInternal)this).DetailedStatusMessage = (string) content.GetValueForProperty("DetailedStatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetInternal)this).DetailedStatusMessage, global::System.Convert.ToString); - } - if (content.Contains("Expiration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetInternal)this).Expiration = (global::System.DateTime) content.GetValueForProperty("Expiration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetInternal)this).Expiration, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("LastValidation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetInternal)this).LastValidation = (global::System.DateTime?) content.GetValueForProperty("LastValidation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetInternal)this).LastValidation, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("PrivilegeLevel")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetInternal)this).PrivilegeLevel = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BmcKeySetPrivilegeLevel) content.GetValueForProperty("PrivilegeLevel",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetInternal)this).PrivilegeLevel, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BmcKeySetPrivilegeLevel.CreateFrom); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BmcKeySetProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BmcKeySetProvisioningState.CreateFrom); - } - if (content.Contains("UserList")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetInternal)this).UserList = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKeySetUser[]) content.GetValueForProperty("UserList",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetInternal)this).UserList, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.KeySetUserTypeConverter.ConvertFrom)); - } - if (content.Contains("UserListStatus")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetInternal)this).UserListStatus = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKeySetUserStatus[]) content.GetValueForProperty("UserListStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetInternal)this).UserListStatus, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.KeySetUserStatusTypeConverter.ConvertFrom)); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal BmcKeySet(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("ExtendedLocation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetInternal)this).ExtendedLocation = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocation) content.GetValueForProperty("ExtendedLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetInternal)this).ExtendedLocation, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ExtendedLocationTypeConverter.ConvertFrom); - } - if (content.Contains("Property")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BmcKeySetPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Etag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetInternal)this).Etag, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)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("SystemDataCreatedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataLastModifiedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("SystemData")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.SystemDataTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Type, global::System.Convert.ToString); - } - if (content.Contains("Tag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.TrackedResourceTagsTypeConverter.ConvertFrom); - } - if (content.Contains("Location")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); - } - if (content.Contains("ExtendedLocationName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetInternal)this).ExtendedLocationName = (string) content.GetValueForProperty("ExtendedLocationName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetInternal)this).ExtendedLocationName, global::System.Convert.ToString); - } - if (content.Contains("ExtendedLocationType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetInternal)this).ExtendedLocationType = (string) content.GetValueForProperty("ExtendedLocationType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetInternal)this).ExtendedLocationType, global::System.Convert.ToString); - } - if (content.Contains("AzureGroupId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetInternal)this).AzureGroupId = (string) content.GetValueForProperty("AzureGroupId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetInternal)this).AzureGroupId, global::System.Convert.ToString); - } - if (content.Contains("DetailedStatus")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetInternal)this).DetailedStatus = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BmcKeySetDetailedStatus?) content.GetValueForProperty("DetailedStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetInternal)this).DetailedStatus, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BmcKeySetDetailedStatus.CreateFrom); - } - if (content.Contains("DetailedStatusMessage")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetInternal)this).DetailedStatusMessage = (string) content.GetValueForProperty("DetailedStatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetInternal)this).DetailedStatusMessage, global::System.Convert.ToString); - } - if (content.Contains("Expiration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetInternal)this).Expiration = (global::System.DateTime) content.GetValueForProperty("Expiration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetInternal)this).Expiration, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("LastValidation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetInternal)this).LastValidation = (global::System.DateTime?) content.GetValueForProperty("LastValidation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetInternal)this).LastValidation, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("PrivilegeLevel")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetInternal)this).PrivilegeLevel = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BmcKeySetPrivilegeLevel) content.GetValueForProperty("PrivilegeLevel",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetInternal)this).PrivilegeLevel, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BmcKeySetPrivilegeLevel.CreateFrom); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BmcKeySetProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BmcKeySetProvisioningState.CreateFrom); - } - if (content.Contains("UserList")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetInternal)this).UserList = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKeySetUser[]) content.GetValueForProperty("UserList",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetInternal)this).UserList, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.KeySetUserTypeConverter.ConvertFrom)); - } - if (content.Contains("UserListStatus")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetInternal)this).UserListStatus = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKeySetUserStatus[]) content.GetValueForProperty("UserListStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetInternal)this).UserListStatus, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.KeySetUserStatusTypeConverter.ConvertFrom)); - } - AfterDeserializePSObject(content); - } - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySet DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new BmcKeySet(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.NetworkCloud.Models.Api20250201.IBmcKeySet DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new BmcKeySet(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.NetworkCloud.Models.Api20250201.IBmcKeySet FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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(); - } - } - /// BmcKeySet represents the baseboard management controller key set. - [System.ComponentModel.TypeConverter(typeof(BmcKeySetTypeConverter))] - public partial interface IBmcKeySet - - { - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BmcKeySet.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BmcKeySet.cs deleted file mode 100644 index 45a5a6460b2f..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BmcKeySet.cs +++ /dev/null @@ -1,351 +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.NetworkCloud.Models.Api20250201 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; - - /// BmcKeySet represents the baseboard management controller key set. - public partial class BmcKeySet : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetInternal, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IValidates - { - /// - /// Backing field for Inherited model - /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResource __trackedResource = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.TrackedResource(); - - /// - /// The object ID of Azure Active Directory group that all users in the list must be in for access to be granted. Users that - /// are not in the group will not have access. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string AzureGroupId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetPropertiesInternal)Property).AzureGroupId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetPropertiesInternal)Property).AzureGroupId = value ; } - - /// The more detailed status of the key set. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BmcKeySetDetailedStatus? DetailedStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetPropertiesInternal)Property).DetailedStatus; } - - /// The descriptive message about the current detailed status. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string DetailedStatusMessage { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetPropertiesInternal)Property).DetailedStatusMessage; } - - /// Backing field for property. - private string _etag; - - /// Resource ETag. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string Etag { get => this._etag; } - - /// - /// The date and time after which the users in this key set will be removed from the baseboard management controllers. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public global::System.DateTime Expiration { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetPropertiesInternal)Property).Expiration; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetPropertiesInternal)Property).Expiration = value ; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocation _extendedLocation; - - /// The extended location of the cluster associated with the resource. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocation ExtendedLocation { get => (this._extendedLocation = this._extendedLocation ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ExtendedLocation()); set => this._extendedLocation = value; } - - /// The resource ID of the extended location on which the resource will be created. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string ExtendedLocationName { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocationInternal)ExtendedLocation).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocationInternal)ExtendedLocation).Name = value ; } - - /// The extended location type, for example, CustomLocation. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string ExtendedLocationType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocationInternal)ExtendedLocation).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocationInternal)ExtendedLocation).Type = value ; } - - /// - /// Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).Id; } - - /// The last time this key set was validated. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public global::System.DateTime? LastValidation { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetPropertiesInternal)Property).LastValidation; } - - /// The geo-location where the resource lives - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)__trackedResource).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)__trackedResource).Location = value ; } - - /// Internal Acessors for DetailedStatus - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BmcKeySetDetailedStatus? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetInternal.DetailedStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetPropertiesInternal)Property).DetailedStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetPropertiesInternal)Property).DetailedStatus = value; } - - /// Internal Acessors for DetailedStatusMessage - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetInternal.DetailedStatusMessage { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetPropertiesInternal)Property).DetailedStatusMessage; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetPropertiesInternal)Property).DetailedStatusMessage = value; } - - /// Internal Acessors for Etag - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetInternal.Etag { get => this._etag; set { {_etag = value;} } } - - /// Internal Acessors for ExtendedLocation - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocation Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetInternal.ExtendedLocation { get => (this._extendedLocation = this._extendedLocation ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ExtendedLocation()); set { {_extendedLocation = value;} } } - - /// Internal Acessors for LastValidation - global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetInternal.LastValidation { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetPropertiesInternal)Property).LastValidation; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetPropertiesInternal)Property).LastValidation = value; } - - /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetProperties Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BmcKeySetProperties()); set { {_property = value;} } } - - /// Internal Acessors for ProvisioningState - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BmcKeySetProvisioningState? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetPropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetPropertiesInternal)Property).ProvisioningState = value; } - - /// Internal Acessors for UserListStatus - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKeySetUserStatus[] Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetInternal.UserListStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetPropertiesInternal)Property).UserListStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetPropertiesInternal)Property).UserListStatus = value; } - - /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).Id = value; } - - /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).Name = value; } - - /// Internal Acessors for SystemData - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ISystemData Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal.SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemData; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemData = value; } - - /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).Type = value; } - - /// The name of the resource - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).Name; } - - /// The access level allowed for the users in this key set. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BmcKeySetPrivilegeLevel PrivilegeLevel { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetPropertiesInternal)Property).PrivilegeLevel; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetPropertiesInternal)Property).PrivilegeLevel = value ; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetProperties _property; - - /// The list of the resource properties. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BmcKeySetProperties()); set => this._property = value; } - - /// The provisioning state of the baseboard management controller key set. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BmcKeySetProvisioningState? ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetPropertiesInternal)Property).ProvisioningState; } - - /// Gets the resource group name - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string ResourceGroupName { get => (new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Success ? new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Groups["resourceGroupName"].Value : null); } - - /// - /// Azure Resource Manager metadata containing createdBy and modifiedBy information. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ISystemData SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemData; } - - /// The timestamp of resource creation (UTC). - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataCreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataCreatedAt = value ?? default(global::System.DateTime); } - - /// The identity that created the resource. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataCreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataCreatedBy = value ?? null; } - - /// The type of identity that created the resource. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType? SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataCreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataCreatedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType)""); } - - /// The timestamp of resource last modification (UTC) - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataLastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataLastModifiedAt = value ?? default(global::System.DateTime); } - - /// The identity that last modified the resource. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataLastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataLastModifiedBy = value ?? null; } - - /// The type of identity that last modified the resource. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType? SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataLastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataLastModifiedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType)""); } - - /// Resource tags. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)__trackedResource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.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.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).Type; } - - /// The unique list of permitted users. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKeySetUser[] UserList { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetPropertiesInternal)Property).UserList; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetPropertiesInternal)Property).UserList = value ; } - - /// The status evaluation of each user. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKeySetUserStatus[] UserListStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetPropertiesInternal)Property).UserListStatus; } - - /// Creates an new instance. - public BmcKeySet() - { - - } - - /// Validates that this object meets the validation criteria. - /// an instance that will receive validation - /// events. - /// - /// A that will be complete when validation is completed. - /// - public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) - { - await eventListener.AssertNotNull(nameof(__trackedResource), __trackedResource); - await eventListener.AssertObjectIsValid(nameof(__trackedResource), __trackedResource); - } - } - /// BmcKeySet represents the baseboard management controller key set. - public partial interface IBmcKeySet : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResource - { - /// - /// The object ID of Azure Active Directory group that all users in the list must be in for access to be granted. Users that - /// are not in the group will not have access. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The object ID of Azure Active Directory group that all users in the list must be in for access to be granted. Users that are not in the group will not have access.", - SerializedName = @"azureGroupId", - PossibleTypes = new [] { typeof(string) })] - string AzureGroupId { get; set; } - /// The more detailed status of the key set. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The more detailed status of the key set.", - SerializedName = @"detailedStatus", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BmcKeySetDetailedStatus) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BmcKeySetDetailedStatus? DetailedStatus { get; } - /// The descriptive message about the current detailed status. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The descriptive message about the current detailed status.", - SerializedName = @"detailedStatusMessage", - PossibleTypes = new [] { typeof(string) })] - string DetailedStatusMessage { get; } - /// Resource ETag. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"Resource ETag.", - SerializedName = @"etag", - PossibleTypes = new [] { typeof(string) })] - string Etag { get; } - /// - /// The date and time after which the users in this key set will be removed from the baseboard management controllers. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The date and time after which the users in this key set will be removed from the baseboard management controllers.", - SerializedName = @"expiration", - PossibleTypes = new [] { typeof(global::System.DateTime) })] - global::System.DateTime Expiration { get; set; } - /// The resource ID of the extended location on which the resource will be created. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The resource ID of the extended location on which the resource will be created.", - SerializedName = @"name", - PossibleTypes = new [] { typeof(string) })] - string ExtendedLocationName { get; set; } - /// The extended location type, for example, CustomLocation. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The extended location type, for example, CustomLocation.", - SerializedName = @"type", - PossibleTypes = new [] { typeof(string) })] - string ExtendedLocationType { get; set; } - /// The last time this key set was validated. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The last time this key set was validated.", - SerializedName = @"lastValidation", - PossibleTypes = new [] { typeof(global::System.DateTime) })] - global::System.DateTime? LastValidation { get; } - /// The access level allowed for the users in this key set. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The access level allowed for the users in this key set.", - SerializedName = @"privilegeLevel", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BmcKeySetPrivilegeLevel) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BmcKeySetPrivilegeLevel PrivilegeLevel { get; set; } - /// The provisioning state of the baseboard management controller key set. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The provisioning state of the baseboard management controller key set.", - SerializedName = @"provisioningState", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BmcKeySetProvisioningState) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BmcKeySetProvisioningState? ProvisioningState { get; } - /// The unique list of permitted users. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The unique list of permitted users.", - SerializedName = @"userList", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKeySetUser) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKeySetUser[] UserList { get; set; } - /// The status evaluation of each user. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The status evaluation of each user.", - SerializedName = @"userListStatus", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKeySetUserStatus) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKeySetUserStatus[] UserListStatus { get; } - - } - /// BmcKeySet represents the baseboard management controller key set. - internal partial interface IBmcKeySetInternal : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal - { - /// - /// The object ID of Azure Active Directory group that all users in the list must be in for access to be granted. Users that - /// are not in the group will not have access. - /// - string AzureGroupId { get; set; } - /// The more detailed status of the key set. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BmcKeySetDetailedStatus? DetailedStatus { get; set; } - /// The descriptive message about the current detailed status. - string DetailedStatusMessage { get; set; } - /// Resource ETag. - string Etag { get; set; } - /// - /// The date and time after which the users in this key set will be removed from the baseboard management controllers. - /// - global::System.DateTime Expiration { get; set; } - /// The extended location of the cluster associated with the resource. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocation ExtendedLocation { get; set; } - /// The resource ID of the extended location on which the resource will be created. - string ExtendedLocationName { get; set; } - /// The extended location type, for example, CustomLocation. - string ExtendedLocationType { get; set; } - /// The last time this key set was validated. - global::System.DateTime? LastValidation { get; set; } - /// The access level allowed for the users in this key set. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BmcKeySetPrivilegeLevel PrivilegeLevel { get; set; } - /// The list of the resource properties. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetProperties Property { get; set; } - /// The provisioning state of the baseboard management controller key set. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BmcKeySetProvisioningState? ProvisioningState { get; set; } - /// The unique list of permitted users. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKeySetUser[] UserList { get; set; } - /// The status evaluation of each user. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKeySetUserStatus[] UserListStatus { get; set; } - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BmcKeySetPatchParameters.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BmcKeySetPatchParameters.PowerShell.cs deleted file mode 100644 index caecc88e1493..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BmcKeySetPatchParameters.PowerShell.cs +++ /dev/null @@ -1,192 +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.NetworkCloud.Models.Api20250201 -{ - using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; - - /// - /// BmcKeySetPatchParameters represents the body of the request to patch the baseboard management controller key set. - /// - [System.ComponentModel.TypeConverter(typeof(BmcKeySetPatchParametersTypeConverter))] - public partial class BmcKeySetPatchParameters - { - - /// - /// 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 BmcKeySetPatchParameters(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.NetworkCloud.Models.Api20250201.IBmcKeySetPatchParametersInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetPatchProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetPatchParametersInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BmcKeySetPatchPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Tag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetPatchParametersInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetPatchParametersTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetPatchParametersInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BmcKeySetPatchParametersTagsTypeConverter.ConvertFrom); - } - if (content.Contains("Expiration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetPatchParametersInternal)this).Expiration = (global::System.DateTime?) content.GetValueForProperty("Expiration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetPatchParametersInternal)this).Expiration, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("UserList")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetPatchParametersInternal)this).UserList = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKeySetUser[]) content.GetValueForProperty("UserList",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetPatchParametersInternal)this).UserList, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.KeySetUserTypeConverter.ConvertFrom)); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal BmcKeySetPatchParameters(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.NetworkCloud.Models.Api20250201.IBmcKeySetPatchParametersInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetPatchProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetPatchParametersInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BmcKeySetPatchPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Tag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetPatchParametersInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetPatchParametersTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetPatchParametersInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BmcKeySetPatchParametersTagsTypeConverter.ConvertFrom); - } - if (content.Contains("Expiration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetPatchParametersInternal)this).Expiration = (global::System.DateTime?) content.GetValueForProperty("Expiration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetPatchParametersInternal)this).Expiration, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("UserList")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetPatchParametersInternal)this).UserList = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKeySetUser[]) content.GetValueForProperty("UserList",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetPatchParametersInternal)this).UserList, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.KeySetUserTypeConverter.ConvertFrom)); - } - AfterDeserializePSObject(content); - } - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetPatchParameters DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new BmcKeySetPatchParameters(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.NetworkCloud.Models.Api20250201.IBmcKeySetPatchParameters DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new BmcKeySetPatchParameters(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.NetworkCloud.Models.Api20250201.IBmcKeySetPatchParameters FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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(); - } - } - /// BmcKeySetPatchParameters represents the body of the request to patch the baseboard management controller key set. - [System.ComponentModel.TypeConverter(typeof(BmcKeySetPatchParametersTypeConverter))] - public partial interface IBmcKeySetPatchParameters - - { - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BmcKeySetPatchParameters.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BmcKeySetPatchParameters.cs deleted file mode 100644 index ecda18c17ecf..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BmcKeySetPatchParameters.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.NetworkCloud.Models.Api20250201 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; - - /// - /// BmcKeySetPatchParameters represents the body of the request to patch the baseboard management controller key set. - /// - public partial class BmcKeySetPatchParameters : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetPatchParameters, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetPatchParametersInternal - { - - /// - /// The date and time after which the users in this key set will be removed from the baseboard management controllers. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public global::System.DateTime? Expiration { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetPatchPropertiesInternal)Property).Expiration; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetPatchPropertiesInternal)Property).Expiration = value ?? default(global::System.DateTime); } - - /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetPatchProperties Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetPatchParametersInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BmcKeySetPatchProperties()); set { {_property = value;} } } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetPatchProperties _property; - - /// The list of the resource properties. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetPatchProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BmcKeySetPatchProperties()); set => this._property = value; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetPatchParametersTags _tag; - - /// The Azure resource tags that will replace the existing ones. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetPatchParametersTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BmcKeySetPatchParametersTags()); set => this._tag = value; } - - /// The unique list of permitted users. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKeySetUser[] UserList { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetPatchPropertiesInternal)Property).UserList; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetPatchPropertiesInternal)Property).UserList = value ?? null /* arrayOf */; } - - /// Creates an new instance. - public BmcKeySetPatchParameters() - { - - } - } - /// BmcKeySetPatchParameters represents the body of the request to patch the baseboard management controller key set. - public partial interface IBmcKeySetPatchParameters : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable - { - /// - /// The date and time after which the users in this key set will be removed from the baseboard management controllers. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The date and time after which the users in this key set will be removed from the baseboard management controllers.", - SerializedName = @"expiration", - PossibleTypes = new [] { typeof(global::System.DateTime) })] - global::System.DateTime? Expiration { get; set; } - /// The Azure resource tags that will replace the existing ones. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The Azure resource tags that will replace the existing ones.", - SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetPatchParametersTags) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetPatchParametersTags Tag { get; set; } - /// The unique list of permitted users. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The unique list of permitted users.", - SerializedName = @"userList", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKeySetUser) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKeySetUser[] UserList { get; set; } - - } - /// BmcKeySetPatchParameters represents the body of the request to patch the baseboard management controller key set. - internal partial interface IBmcKeySetPatchParametersInternal - - { - /// - /// The date and time after which the users in this key set will be removed from the baseboard management controllers. - /// - global::System.DateTime? Expiration { get; set; } - /// The list of the resource properties. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetPatchProperties Property { get; set; } - /// The Azure resource tags that will replace the existing ones. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetPatchParametersTags Tag { get; set; } - /// The unique list of permitted users. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKeySetUser[] UserList { get; set; } - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BmcKeySetPatchProperties.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BmcKeySetPatchProperties.PowerShell.cs deleted file mode 100644 index 501e6c63d60d..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BmcKeySetPatchProperties.PowerShell.cs +++ /dev/null @@ -1,176 +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.NetworkCloud.Models.Api20250201 -{ - using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; - - /// - /// BmcKeySetPatchProperties represents the properties of baseboard management controller key set that are patchable. - /// - [System.ComponentModel.TypeConverter(typeof(BmcKeySetPatchPropertiesTypeConverter))] - public partial class BmcKeySetPatchProperties - { - - /// - /// 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 BmcKeySetPatchProperties(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("Expiration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetPatchPropertiesInternal)this).Expiration = (global::System.DateTime?) content.GetValueForProperty("Expiration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetPatchPropertiesInternal)this).Expiration, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("UserList")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetPatchPropertiesInternal)this).UserList = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKeySetUser[]) content.GetValueForProperty("UserList",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetPatchPropertiesInternal)this).UserList, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.KeySetUserTypeConverter.ConvertFrom)); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal BmcKeySetPatchProperties(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("Expiration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetPatchPropertiesInternal)this).Expiration = (global::System.DateTime?) content.GetValueForProperty("Expiration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetPatchPropertiesInternal)this).Expiration, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("UserList")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetPatchPropertiesInternal)this).UserList = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKeySetUser[]) content.GetValueForProperty("UserList",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetPatchPropertiesInternal)this).UserList, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.KeySetUserTypeConverter.ConvertFrom)); - } - AfterDeserializePSObject(content); - } - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetPatchProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new BmcKeySetPatchProperties(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.NetworkCloud.Models.Api20250201.IBmcKeySetPatchProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new BmcKeySetPatchProperties(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.NetworkCloud.Models.Api20250201.IBmcKeySetPatchProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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(); - } - } - /// BmcKeySetPatchProperties represents the properties of baseboard management controller key set that are patchable. - [System.ComponentModel.TypeConverter(typeof(BmcKeySetPatchPropertiesTypeConverter))] - public partial interface IBmcKeySetPatchProperties - - { - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BmcKeySetProperties.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BmcKeySetProperties.PowerShell.cs deleted file mode 100644 index c2347399920f..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BmcKeySetProperties.PowerShell.cs +++ /dev/null @@ -1,230 +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.NetworkCloud.Models.Api20250201 -{ - using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; - - /// - /// BmcKeySetProperties represents the properties of baseboard management controller key set. - /// - [System.ComponentModel.TypeConverter(typeof(BmcKeySetPropertiesTypeConverter))] - public partial class BmcKeySetProperties - { - - /// - /// 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 BmcKeySetProperties(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("AzureGroupId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetPropertiesInternal)this).AzureGroupId = (string) content.GetValueForProperty("AzureGroupId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetPropertiesInternal)this).AzureGroupId, global::System.Convert.ToString); - } - if (content.Contains("DetailedStatus")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetPropertiesInternal)this).DetailedStatus = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BmcKeySetDetailedStatus?) content.GetValueForProperty("DetailedStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetPropertiesInternal)this).DetailedStatus, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BmcKeySetDetailedStatus.CreateFrom); - } - if (content.Contains("DetailedStatusMessage")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetPropertiesInternal)this).DetailedStatusMessage = (string) content.GetValueForProperty("DetailedStatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetPropertiesInternal)this).DetailedStatusMessage, global::System.Convert.ToString); - } - if (content.Contains("Expiration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetPropertiesInternal)this).Expiration = (global::System.DateTime) content.GetValueForProperty("Expiration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetPropertiesInternal)this).Expiration, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("LastValidation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetPropertiesInternal)this).LastValidation = (global::System.DateTime?) content.GetValueForProperty("LastValidation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetPropertiesInternal)this).LastValidation, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("PrivilegeLevel")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetPropertiesInternal)this).PrivilegeLevel = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BmcKeySetPrivilegeLevel) content.GetValueForProperty("PrivilegeLevel",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetPropertiesInternal)this).PrivilegeLevel, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BmcKeySetPrivilegeLevel.CreateFrom); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetPropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BmcKeySetProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetPropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BmcKeySetProvisioningState.CreateFrom); - } - if (content.Contains("UserList")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetPropertiesInternal)this).UserList = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKeySetUser[]) content.GetValueForProperty("UserList",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetPropertiesInternal)this).UserList, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.KeySetUserTypeConverter.ConvertFrom)); - } - if (content.Contains("UserListStatus")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetPropertiesInternal)this).UserListStatus = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKeySetUserStatus[]) content.GetValueForProperty("UserListStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetPropertiesInternal)this).UserListStatus, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.KeySetUserStatusTypeConverter.ConvertFrom)); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal BmcKeySetProperties(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("AzureGroupId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetPropertiesInternal)this).AzureGroupId = (string) content.GetValueForProperty("AzureGroupId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetPropertiesInternal)this).AzureGroupId, global::System.Convert.ToString); - } - if (content.Contains("DetailedStatus")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetPropertiesInternal)this).DetailedStatus = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BmcKeySetDetailedStatus?) content.GetValueForProperty("DetailedStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetPropertiesInternal)this).DetailedStatus, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BmcKeySetDetailedStatus.CreateFrom); - } - if (content.Contains("DetailedStatusMessage")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetPropertiesInternal)this).DetailedStatusMessage = (string) content.GetValueForProperty("DetailedStatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetPropertiesInternal)this).DetailedStatusMessage, global::System.Convert.ToString); - } - if (content.Contains("Expiration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetPropertiesInternal)this).Expiration = (global::System.DateTime) content.GetValueForProperty("Expiration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetPropertiesInternal)this).Expiration, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("LastValidation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetPropertiesInternal)this).LastValidation = (global::System.DateTime?) content.GetValueForProperty("LastValidation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetPropertiesInternal)this).LastValidation, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("PrivilegeLevel")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetPropertiesInternal)this).PrivilegeLevel = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BmcKeySetPrivilegeLevel) content.GetValueForProperty("PrivilegeLevel",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetPropertiesInternal)this).PrivilegeLevel, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BmcKeySetPrivilegeLevel.CreateFrom); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetPropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BmcKeySetProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetPropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BmcKeySetProvisioningState.CreateFrom); - } - if (content.Contains("UserList")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetPropertiesInternal)this).UserList = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKeySetUser[]) content.GetValueForProperty("UserList",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetPropertiesInternal)this).UserList, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.KeySetUserTypeConverter.ConvertFrom)); - } - if (content.Contains("UserListStatus")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetPropertiesInternal)this).UserListStatus = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKeySetUserStatus[]) content.GetValueForProperty("UserListStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetPropertiesInternal)this).UserListStatus, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.KeySetUserStatusTypeConverter.ConvertFrom)); - } - AfterDeserializePSObject(content); - } - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new BmcKeySetProperties(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.NetworkCloud.Models.Api20250201.IBmcKeySetProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new BmcKeySetProperties(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.NetworkCloud.Models.Api20250201.IBmcKeySetProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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(); - } - } - /// BmcKeySetProperties represents the properties of baseboard management controller key set. - [System.ComponentModel.TypeConverter(typeof(BmcKeySetPropertiesTypeConverter))] - public partial interface IBmcKeySetProperties - - { - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BmcKeySetProperties.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BmcKeySetProperties.cs deleted file mode 100644 index 0b3df50becd1..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BmcKeySetProperties.cs +++ /dev/null @@ -1,219 +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.NetworkCloud.Models.Api20250201 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; - - /// - /// BmcKeySetProperties represents the properties of baseboard management controller key set. - /// - public partial class BmcKeySetProperties : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetProperties, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetPropertiesInternal - { - - /// Backing field for property. - private string _azureGroupId; - - /// - /// The object ID of Azure Active Directory group that all users in the list must be in for access to be granted. Users that - /// are not in the group will not have access. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string AzureGroupId { get => this._azureGroupId; set => this._azureGroupId = value; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BmcKeySetDetailedStatus? _detailedStatus; - - /// The more detailed status of the key set. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BmcKeySetDetailedStatus? DetailedStatus { get => this._detailedStatus; } - - /// Backing field for property. - private string _detailedStatusMessage; - - /// The descriptive message about the current detailed status. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string DetailedStatusMessage { get => this._detailedStatusMessage; } - - /// Backing field for property. - private global::System.DateTime _expiration; - - /// - /// The date and time after which the users in this key set will be removed from the baseboard management controllers. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public global::System.DateTime Expiration { get => this._expiration; set => this._expiration = value; } - - /// Backing field for property. - private global::System.DateTime? _lastValidation; - - /// The last time this key set was validated. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public global::System.DateTime? LastValidation { get => this._lastValidation; } - - /// Internal Acessors for DetailedStatus - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BmcKeySetDetailedStatus? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetPropertiesInternal.DetailedStatus { get => this._detailedStatus; set { {_detailedStatus = value;} } } - - /// Internal Acessors for DetailedStatusMessage - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetPropertiesInternal.DetailedStatusMessage { get => this._detailedStatusMessage; set { {_detailedStatusMessage = value;} } } - - /// Internal Acessors for LastValidation - global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetPropertiesInternal.LastValidation { get => this._lastValidation; set { {_lastValidation = value;} } } - - /// Internal Acessors for ProvisioningState - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BmcKeySetProvisioningState? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetPropertiesInternal.ProvisioningState { get => this._provisioningState; set { {_provisioningState = value;} } } - - /// Internal Acessors for UserListStatus - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKeySetUserStatus[] Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetPropertiesInternal.UserListStatus { get => this._userListStatus; set { {_userListStatus = value;} } } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BmcKeySetPrivilegeLevel _privilegeLevel; - - /// The access level allowed for the users in this key set. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BmcKeySetPrivilegeLevel PrivilegeLevel { get => this._privilegeLevel; set => this._privilegeLevel = value; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BmcKeySetProvisioningState? _provisioningState; - - /// The provisioning state of the baseboard management controller key set. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BmcKeySetProvisioningState? ProvisioningState { get => this._provisioningState; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKeySetUser[] _userList; - - /// The unique list of permitted users. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKeySetUser[] UserList { get => this._userList; set => this._userList = value; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKeySetUserStatus[] _userListStatus; - - /// The status evaluation of each user. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKeySetUserStatus[] UserListStatus { get => this._userListStatus; } - - /// Creates an new instance. - public BmcKeySetProperties() - { - - } - } - /// BmcKeySetProperties represents the properties of baseboard management controller key set. - public partial interface IBmcKeySetProperties : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable - { - /// - /// The object ID of Azure Active Directory group that all users in the list must be in for access to be granted. Users that - /// are not in the group will not have access. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The object ID of Azure Active Directory group that all users in the list must be in for access to be granted. Users that are not in the group will not have access.", - SerializedName = @"azureGroupId", - PossibleTypes = new [] { typeof(string) })] - string AzureGroupId { get; set; } - /// The more detailed status of the key set. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The more detailed status of the key set.", - SerializedName = @"detailedStatus", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BmcKeySetDetailedStatus) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BmcKeySetDetailedStatus? DetailedStatus { get; } - /// The descriptive message about the current detailed status. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The descriptive message about the current detailed status.", - SerializedName = @"detailedStatusMessage", - PossibleTypes = new [] { typeof(string) })] - string DetailedStatusMessage { get; } - /// - /// The date and time after which the users in this key set will be removed from the baseboard management controllers. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The date and time after which the users in this key set will be removed from the baseboard management controllers.", - SerializedName = @"expiration", - PossibleTypes = new [] { typeof(global::System.DateTime) })] - global::System.DateTime Expiration { get; set; } - /// The last time this key set was validated. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The last time this key set was validated.", - SerializedName = @"lastValidation", - PossibleTypes = new [] { typeof(global::System.DateTime) })] - global::System.DateTime? LastValidation { get; } - /// The access level allowed for the users in this key set. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The access level allowed for the users in this key set.", - SerializedName = @"privilegeLevel", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BmcKeySetPrivilegeLevel) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BmcKeySetPrivilegeLevel PrivilegeLevel { get; set; } - /// The provisioning state of the baseboard management controller key set. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The provisioning state of the baseboard management controller key set.", - SerializedName = @"provisioningState", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BmcKeySetProvisioningState) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BmcKeySetProvisioningState? ProvisioningState { get; } - /// The unique list of permitted users. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The unique list of permitted users.", - SerializedName = @"userList", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKeySetUser) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKeySetUser[] UserList { get; set; } - /// The status evaluation of each user. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The status evaluation of each user.", - SerializedName = @"userListStatus", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKeySetUserStatus) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKeySetUserStatus[] UserListStatus { get; } - - } - /// BmcKeySetProperties represents the properties of baseboard management controller key set. - internal partial interface IBmcKeySetPropertiesInternal - - { - /// - /// The object ID of Azure Active Directory group that all users in the list must be in for access to be granted. Users that - /// are not in the group will not have access. - /// - string AzureGroupId { get; set; } - /// The more detailed status of the key set. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BmcKeySetDetailedStatus? DetailedStatus { get; set; } - /// The descriptive message about the current detailed status. - string DetailedStatusMessage { get; set; } - /// - /// The date and time after which the users in this key set will be removed from the baseboard management controllers. - /// - global::System.DateTime Expiration { get; set; } - /// The last time this key set was validated. - global::System.DateTime? LastValidation { get; set; } - /// The access level allowed for the users in this key set. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BmcKeySetPrivilegeLevel PrivilegeLevel { get; set; } - /// The provisioning state of the baseboard management controller key set. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BmcKeySetProvisioningState? ProvisioningState { get; set; } - /// The unique list of permitted users. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKeySetUser[] UserList { get; set; } - /// The status evaluation of each user. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKeySetUserStatus[] UserListStatus { get; set; } - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/CloudServicesNetwork.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/CloudServicesNetwork.PowerShell.cs deleted file mode 100644 index d5fad4355436..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/CloudServicesNetwork.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.NetworkCloud.Models.Api20250201 -{ - using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; - - /// - /// Upon creation, the additional services that are provided by the platform will be allocated and - /// represented in the status of this resource. All resources associated with this cloud services network will be part - /// of the same layer 2 (L2) isolation domain. At least one service network must be created but may be reused across many - /// virtual machines and/or Hybrid AKS clusters. - /// - [System.ComponentModel.TypeConverter(typeof(CloudServicesNetworkTypeConverter))] - public partial class CloudServicesNetwork - { - - /// - /// 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 CloudServicesNetwork(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("ExtendedLocation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkInternal)this).ExtendedLocation = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocation) content.GetValueForProperty("ExtendedLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkInternal)this).ExtendedLocation, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ExtendedLocationTypeConverter.ConvertFrom); - } - if (content.Contains("Property")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.CloudServicesNetworkPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Etag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkInternal)this).Etag, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)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("SystemDataCreatedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataLastModifiedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("SystemData")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.SystemDataTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Type, global::System.Convert.ToString); - } - if (content.Contains("Tag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.TrackedResourceTagsTypeConverter.ConvertFrom); - } - if (content.Contains("Location")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); - } - if (content.Contains("ExtendedLocationName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkInternal)this).ExtendedLocationName = (string) content.GetValueForProperty("ExtendedLocationName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkInternal)this).ExtendedLocationName, global::System.Convert.ToString); - } - if (content.Contains("ExtendedLocationType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkInternal)this).ExtendedLocationType = (string) content.GetValueForProperty("ExtendedLocationType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkInternal)this).ExtendedLocationType, global::System.Convert.ToString); - } - if (content.Contains("AdditionalEgressEndpoint")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkInternal)this).AdditionalEgressEndpoint = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IEgressEndpoint[]) content.GetValueForProperty("AdditionalEgressEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkInternal)this).AdditionalEgressEndpoint, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.EgressEndpointTypeConverter.ConvertFrom)); - } - if (content.Contains("AssociatedResourceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkInternal)this).AssociatedResourceId = (string[]) content.GetValueForProperty("AssociatedResourceId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkInternal)this).AssociatedResourceId, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("ClusterId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkInternal)this).ClusterId = (string) content.GetValueForProperty("ClusterId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkInternal)this).ClusterId, global::System.Convert.ToString); - } - if (content.Contains("DetailedStatus")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkInternal)this).DetailedStatus = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CloudServicesNetworkDetailedStatus?) content.GetValueForProperty("DetailedStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkInternal)this).DetailedStatus, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CloudServicesNetworkDetailedStatus.CreateFrom); - } - if (content.Contains("DetailedStatusMessage")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkInternal)this).DetailedStatusMessage = (string) content.GetValueForProperty("DetailedStatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkInternal)this).DetailedStatusMessage, global::System.Convert.ToString); - } - if (content.Contains("EnableDefaultEgressEndpoint")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkInternal)this).EnableDefaultEgressEndpoint = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CloudServicesNetworkEnableDefaultEgressEndpoints?) content.GetValueForProperty("EnableDefaultEgressEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkInternal)this).EnableDefaultEgressEndpoint, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CloudServicesNetworkEnableDefaultEgressEndpoints.CreateFrom); - } - if (content.Contains("EnabledEgressEndpoint")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkInternal)this).EnabledEgressEndpoint = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IEgressEndpoint[]) content.GetValueForProperty("EnabledEgressEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkInternal)this).EnabledEgressEndpoint, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.EgressEndpointTypeConverter.ConvertFrom)); - } - if (content.Contains("HybridAksClustersAssociatedId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkInternal)this).HybridAksClustersAssociatedId = (string[]) content.GetValueForProperty("HybridAksClustersAssociatedId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkInternal)this).HybridAksClustersAssociatedId, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("InterfaceName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkInternal)this).InterfaceName = (string) content.GetValueForProperty("InterfaceName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkInternal)this).InterfaceName, global::System.Convert.ToString); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CloudServicesNetworkProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CloudServicesNetworkProvisioningState.CreateFrom); - } - if (content.Contains("VirtualMachinesAssociatedId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkInternal)this).VirtualMachinesAssociatedId = (string[]) content.GetValueForProperty("VirtualMachinesAssociatedId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkInternal)this).VirtualMachinesAssociatedId, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal CloudServicesNetwork(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("ExtendedLocation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkInternal)this).ExtendedLocation = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocation) content.GetValueForProperty("ExtendedLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkInternal)this).ExtendedLocation, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ExtendedLocationTypeConverter.ConvertFrom); - } - if (content.Contains("Property")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.CloudServicesNetworkPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Etag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkInternal)this).Etag, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)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("SystemDataCreatedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataLastModifiedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("SystemData")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.SystemDataTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Type, global::System.Convert.ToString); - } - if (content.Contains("Tag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.TrackedResourceTagsTypeConverter.ConvertFrom); - } - if (content.Contains("Location")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); - } - if (content.Contains("ExtendedLocationName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkInternal)this).ExtendedLocationName = (string) content.GetValueForProperty("ExtendedLocationName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkInternal)this).ExtendedLocationName, global::System.Convert.ToString); - } - if (content.Contains("ExtendedLocationType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkInternal)this).ExtendedLocationType = (string) content.GetValueForProperty("ExtendedLocationType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkInternal)this).ExtendedLocationType, global::System.Convert.ToString); - } - if (content.Contains("AdditionalEgressEndpoint")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkInternal)this).AdditionalEgressEndpoint = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IEgressEndpoint[]) content.GetValueForProperty("AdditionalEgressEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkInternal)this).AdditionalEgressEndpoint, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.EgressEndpointTypeConverter.ConvertFrom)); - } - if (content.Contains("AssociatedResourceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkInternal)this).AssociatedResourceId = (string[]) content.GetValueForProperty("AssociatedResourceId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkInternal)this).AssociatedResourceId, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("ClusterId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkInternal)this).ClusterId = (string) content.GetValueForProperty("ClusterId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkInternal)this).ClusterId, global::System.Convert.ToString); - } - if (content.Contains("DetailedStatus")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkInternal)this).DetailedStatus = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CloudServicesNetworkDetailedStatus?) content.GetValueForProperty("DetailedStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkInternal)this).DetailedStatus, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CloudServicesNetworkDetailedStatus.CreateFrom); - } - if (content.Contains("DetailedStatusMessage")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkInternal)this).DetailedStatusMessage = (string) content.GetValueForProperty("DetailedStatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkInternal)this).DetailedStatusMessage, global::System.Convert.ToString); - } - if (content.Contains("EnableDefaultEgressEndpoint")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkInternal)this).EnableDefaultEgressEndpoint = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CloudServicesNetworkEnableDefaultEgressEndpoints?) content.GetValueForProperty("EnableDefaultEgressEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkInternal)this).EnableDefaultEgressEndpoint, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CloudServicesNetworkEnableDefaultEgressEndpoints.CreateFrom); - } - if (content.Contains("EnabledEgressEndpoint")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkInternal)this).EnabledEgressEndpoint = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IEgressEndpoint[]) content.GetValueForProperty("EnabledEgressEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkInternal)this).EnabledEgressEndpoint, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.EgressEndpointTypeConverter.ConvertFrom)); - } - if (content.Contains("HybridAksClustersAssociatedId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkInternal)this).HybridAksClustersAssociatedId = (string[]) content.GetValueForProperty("HybridAksClustersAssociatedId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkInternal)this).HybridAksClustersAssociatedId, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("InterfaceName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkInternal)this).InterfaceName = (string) content.GetValueForProperty("InterfaceName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkInternal)this).InterfaceName, global::System.Convert.ToString); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CloudServicesNetworkProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CloudServicesNetworkProvisioningState.CreateFrom); - } - if (content.Contains("VirtualMachinesAssociatedId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkInternal)this).VirtualMachinesAssociatedId = (string[]) content.GetValueForProperty("VirtualMachinesAssociatedId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkInternal)this).VirtualMachinesAssociatedId, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - AfterDeserializePSObject(content); - } - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetwork DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new CloudServicesNetwork(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.NetworkCloud.Models.Api20250201.ICloudServicesNetwork DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new CloudServicesNetwork(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.NetworkCloud.Models.Api20250201.ICloudServicesNetwork FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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(); - } - } - /// Upon creation, the additional services that are provided by the platform will be allocated and - /// represented in the status of this resource. All resources associated with this cloud services network will be part - /// of the same layer 2 (L2) isolation domain. At least one service network must be created but may be reused across many - /// virtual machines and/or Hybrid AKS clusters. - [System.ComponentModel.TypeConverter(typeof(CloudServicesNetworkTypeConverter))] - public partial interface ICloudServicesNetwork - - { - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/CloudServicesNetwork.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/CloudServicesNetwork.cs deleted file mode 100644 index 46efe81e3f97..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/CloudServicesNetwork.cs +++ /dev/null @@ -1,441 +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.NetworkCloud.Models.Api20250201 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; - - /// - /// Upon creation, the additional services that are provided by the platform will be allocated and - /// represented in the status of this resource. All resources associated with this cloud services network will be part - /// of the same layer 2 (L2) isolation domain. At least one service network must be created but may be reused across many - /// virtual machines and/or Hybrid AKS clusters. - /// - public partial class CloudServicesNetwork : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetwork, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkInternal, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IValidates - { - /// - /// Backing field for Inherited model - /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResource __trackedResource = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.TrackedResource(); - - /// - /// The list of egress endpoints. This allows for connection from a Hybrid AKS cluster to the specified endpoint. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IEgressEndpoint[] AdditionalEgressEndpoint { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkPropertiesInternal)Property).AdditionalEgressEndpoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkPropertiesInternal)Property).AdditionalEgressEndpoint = value ?? null /* arrayOf */; } - - /// - /// The list of resource IDs for the other Microsoft.NetworkCloud resources that have attached this network. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string[] AssociatedResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkPropertiesInternal)Property).AssociatedResourceId; } - - /// - /// The resource ID of the Network Cloud cluster this cloud services network is associated with. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string ClusterId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkPropertiesInternal)Property).ClusterId; } - - /// The more detailed status of the cloud services network. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CloudServicesNetworkDetailedStatus? DetailedStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkPropertiesInternal)Property).DetailedStatus; } - - /// The descriptive message about the current detailed status. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string DetailedStatusMessage { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkPropertiesInternal)Property).DetailedStatusMessage; } - - /// - /// The indicator of whether the platform default endpoints are allowed for the egress traffic. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CloudServicesNetworkEnableDefaultEgressEndpoints? EnableDefaultEgressEndpoint { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkPropertiesInternal)Property).EnableDefaultEgressEndpoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkPropertiesInternal)Property).EnableDefaultEgressEndpoint = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CloudServicesNetworkEnableDefaultEgressEndpoints)""); } - - /// - /// The full list of additional and default egress endpoints that are currently enabled. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IEgressEndpoint[] EnabledEgressEndpoint { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkPropertiesInternal)Property).EnabledEgressEndpoint; } - - /// Backing field for property. - private string _etag; - - /// Resource ETag. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string Etag { get => this._etag; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocation _extendedLocation; - - /// The extended location of the cluster associated with the resource. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocation ExtendedLocation { get => (this._extendedLocation = this._extendedLocation ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ExtendedLocation()); set => this._extendedLocation = value; } - - /// The resource ID of the extended location on which the resource will be created. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string ExtendedLocationName { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocationInternal)ExtendedLocation).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocationInternal)ExtendedLocation).Name = value ; } - - /// The extended location type, for example, CustomLocation. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string ExtendedLocationType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocationInternal)ExtendedLocation).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocationInternal)ExtendedLocation).Type = value ; } - - /// - /// Field Deprecated. These fields will be empty/omitted. The list of Hybrid AKS cluster resource IDs that are associated - /// with this cloud services network. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string[] HybridAksClustersAssociatedId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkPropertiesInternal)Property).HybridAksClustersAssociatedId; } - - /// - /// Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).Id; } - - /// - /// The name of the interface that will be present in the virtual machine to represent this network. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string InterfaceName { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkPropertiesInternal)Property).InterfaceName; } - - /// The geo-location where the resource lives - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)__trackedResource).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)__trackedResource).Location = value ; } - - /// Internal Acessors for AssociatedResourceId - string[] Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkInternal.AssociatedResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkPropertiesInternal)Property).AssociatedResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkPropertiesInternal)Property).AssociatedResourceId = value; } - - /// Internal Acessors for ClusterId - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkInternal.ClusterId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkPropertiesInternal)Property).ClusterId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkPropertiesInternal)Property).ClusterId = value; } - - /// Internal Acessors for DetailedStatus - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CloudServicesNetworkDetailedStatus? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkInternal.DetailedStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkPropertiesInternal)Property).DetailedStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkPropertiesInternal)Property).DetailedStatus = value; } - - /// Internal Acessors for DetailedStatusMessage - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkInternal.DetailedStatusMessage { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkPropertiesInternal)Property).DetailedStatusMessage; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkPropertiesInternal)Property).DetailedStatusMessage = value; } - - /// Internal Acessors for EnabledEgressEndpoint - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IEgressEndpoint[] Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkInternal.EnabledEgressEndpoint { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkPropertiesInternal)Property).EnabledEgressEndpoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkPropertiesInternal)Property).EnabledEgressEndpoint = value; } - - /// Internal Acessors for Etag - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkInternal.Etag { get => this._etag; set { {_etag = value;} } } - - /// Internal Acessors for ExtendedLocation - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocation Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkInternal.ExtendedLocation { get => (this._extendedLocation = this._extendedLocation ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ExtendedLocation()); set { {_extendedLocation = value;} } } - - /// Internal Acessors for HybridAksClustersAssociatedId - string[] Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkInternal.HybridAksClustersAssociatedId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkPropertiesInternal)Property).HybridAksClustersAssociatedId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkPropertiesInternal)Property).HybridAksClustersAssociatedId = value; } - - /// Internal Acessors for InterfaceName - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkInternal.InterfaceName { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkPropertiesInternal)Property).InterfaceName; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkPropertiesInternal)Property).InterfaceName = value; } - - /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkProperties Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.CloudServicesNetworkProperties()); set { {_property = value;} } } - - /// Internal Acessors for ProvisioningState - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CloudServicesNetworkProvisioningState? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkPropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkPropertiesInternal)Property).ProvisioningState = value; } - - /// Internal Acessors for VirtualMachinesAssociatedId - string[] Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkInternal.VirtualMachinesAssociatedId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkPropertiesInternal)Property).VirtualMachinesAssociatedId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkPropertiesInternal)Property).VirtualMachinesAssociatedId = value; } - - /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).Id = value; } - - /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).Name = value; } - - /// Internal Acessors for SystemData - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ISystemData Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal.SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemData; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemData = value; } - - /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).Type = value; } - - /// The name of the resource - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).Name; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkProperties _property; - - /// The list of the resource properties. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.CloudServicesNetworkProperties()); set => this._property = value; } - - /// The provisioning state of the cloud services network. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CloudServicesNetworkProvisioningState? ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkPropertiesInternal)Property).ProvisioningState; } - - /// Gets the resource group name - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string ResourceGroupName { get => (new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Success ? new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Groups["resourceGroupName"].Value : null); } - - /// - /// Azure Resource Manager metadata containing createdBy and modifiedBy information. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ISystemData SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemData; } - - /// The timestamp of resource creation (UTC). - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataCreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataCreatedAt = value ?? default(global::System.DateTime); } - - /// The identity that created the resource. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataCreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataCreatedBy = value ?? null; } - - /// The type of identity that created the resource. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType? SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataCreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataCreatedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType)""); } - - /// The timestamp of resource last modification (UTC) - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataLastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataLastModifiedAt = value ?? default(global::System.DateTime); } - - /// The identity that last modified the resource. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataLastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataLastModifiedBy = value ?? null; } - - /// The type of identity that last modified the resource. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType? SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataLastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataLastModifiedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType)""); } - - /// Resource tags. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)__trackedResource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.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.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).Type; } - - /// - /// Field Deprecated. These fields will be empty/omitted. The list of virtual machine resource IDs, excluding any Hybrid AKS - /// virtual machines, that are currently using this cloud services network. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string[] VirtualMachinesAssociatedId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkPropertiesInternal)Property).VirtualMachinesAssociatedId; } - - /// Creates an new instance. - public CloudServicesNetwork() - { - - } - - /// Validates that this object meets the validation criteria. - /// an instance that will receive validation - /// events. - /// - /// A that will be complete when validation is completed. - /// - public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) - { - await eventListener.AssertNotNull(nameof(__trackedResource), __trackedResource); - await eventListener.AssertObjectIsValid(nameof(__trackedResource), __trackedResource); - } - } - /// Upon creation, the additional services that are provided by the platform will be allocated and - /// represented in the status of this resource. All resources associated with this cloud services network will be part - /// of the same layer 2 (L2) isolation domain. At least one service network must be created but may be reused across many - /// virtual machines and/or Hybrid AKS clusters. - public partial interface ICloudServicesNetwork : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResource - { - /// - /// The list of egress endpoints. This allows for connection from a Hybrid AKS cluster to the specified endpoint. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The list of egress endpoints. This allows for connection from a Hybrid AKS cluster to the specified endpoint.", - SerializedName = @"additionalEgressEndpoints", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IEgressEndpoint) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IEgressEndpoint[] AdditionalEgressEndpoint { get; set; } - /// - /// The list of resource IDs for the other Microsoft.NetworkCloud resources that have attached this network. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The list of resource IDs for the other Microsoft.NetworkCloud resources that have attached this network.", - SerializedName = @"associatedResourceIds", - PossibleTypes = new [] { typeof(string) })] - string[] AssociatedResourceId { get; } - /// - /// The resource ID of the Network Cloud cluster this cloud services network is associated with. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The resource ID of the Network Cloud cluster this cloud services network is associated with.", - SerializedName = @"clusterId", - PossibleTypes = new [] { typeof(string) })] - string ClusterId { get; } - /// The more detailed status of the cloud services network. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The more detailed status of the cloud services network.", - SerializedName = @"detailedStatus", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CloudServicesNetworkDetailedStatus) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CloudServicesNetworkDetailedStatus? DetailedStatus { get; } - /// The descriptive message about the current detailed status. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The descriptive message about the current detailed status.", - SerializedName = @"detailedStatusMessage", - PossibleTypes = new [] { typeof(string) })] - string DetailedStatusMessage { get; } - /// - /// The indicator of whether the platform default endpoints are allowed for the egress traffic. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The indicator of whether the platform default endpoints are allowed for the egress traffic.", - SerializedName = @"enableDefaultEgressEndpoints", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CloudServicesNetworkEnableDefaultEgressEndpoints) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CloudServicesNetworkEnableDefaultEgressEndpoints? EnableDefaultEgressEndpoint { get; set; } - /// - /// The full list of additional and default egress endpoints that are currently enabled. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The full list of additional and default egress endpoints that are currently enabled.", - SerializedName = @"enabledEgressEndpoints", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IEgressEndpoint) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IEgressEndpoint[] EnabledEgressEndpoint { get; } - /// Resource ETag. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"Resource ETag.", - SerializedName = @"etag", - PossibleTypes = new [] { typeof(string) })] - string Etag { get; } - /// The resource ID of the extended location on which the resource will be created. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The resource ID of the extended location on which the resource will be created.", - SerializedName = @"name", - PossibleTypes = new [] { typeof(string) })] - string ExtendedLocationName { get; set; } - /// The extended location type, for example, CustomLocation. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The extended location type, for example, CustomLocation.", - SerializedName = @"type", - PossibleTypes = new [] { typeof(string) })] - string ExtendedLocationType { get; set; } - /// - /// Field Deprecated. These fields will be empty/omitted. The list of Hybrid AKS cluster resource IDs that are associated - /// with this cloud services network. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"Field Deprecated. These fields will be empty/omitted. The list of Hybrid AKS cluster resource IDs that are associated with this cloud services network.", - SerializedName = @"hybridAksClustersAssociatedIds", - PossibleTypes = new [] { typeof(string) })] - string[] HybridAksClustersAssociatedId { get; } - /// - /// The name of the interface that will be present in the virtual machine to represent this network. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The name of the interface that will be present in the virtual machine to represent this network.", - SerializedName = @"interfaceName", - PossibleTypes = new [] { typeof(string) })] - string InterfaceName { get; } - /// The provisioning state of the cloud services network. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The provisioning state of the cloud services network.", - SerializedName = @"provisioningState", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CloudServicesNetworkProvisioningState) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CloudServicesNetworkProvisioningState? ProvisioningState { get; } - /// - /// Field Deprecated. These fields will be empty/omitted. The list of virtual machine resource IDs, excluding any Hybrid AKS - /// virtual machines, that are currently using this cloud services network. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"Field Deprecated. These fields will be empty/omitted. The list of virtual machine resource IDs, excluding any Hybrid AKS virtual machines, that are currently using this cloud services network.", - SerializedName = @"virtualMachinesAssociatedIds", - PossibleTypes = new [] { typeof(string) })] - string[] VirtualMachinesAssociatedId { get; } - - } - /// Upon creation, the additional services that are provided by the platform will be allocated and - /// represented in the status of this resource. All resources associated with this cloud services network will be part - /// of the same layer 2 (L2) isolation domain. At least one service network must be created but may be reused across many - /// virtual machines and/or Hybrid AKS clusters. - internal partial interface ICloudServicesNetworkInternal : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal - { - /// - /// The list of egress endpoints. This allows for connection from a Hybrid AKS cluster to the specified endpoint. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IEgressEndpoint[] AdditionalEgressEndpoint { get; set; } - /// - /// The list of resource IDs for the other Microsoft.NetworkCloud resources that have attached this network. - /// - string[] AssociatedResourceId { get; set; } - /// - /// The resource ID of the Network Cloud cluster this cloud services network is associated with. - /// - string ClusterId { get; set; } - /// The more detailed status of the cloud services network. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CloudServicesNetworkDetailedStatus? DetailedStatus { get; set; } - /// The descriptive message about the current detailed status. - string DetailedStatusMessage { get; set; } - /// - /// The indicator of whether the platform default endpoints are allowed for the egress traffic. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CloudServicesNetworkEnableDefaultEgressEndpoints? EnableDefaultEgressEndpoint { get; set; } - /// - /// The full list of additional and default egress endpoints that are currently enabled. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IEgressEndpoint[] EnabledEgressEndpoint { get; set; } - /// Resource ETag. - string Etag { get; set; } - /// The extended location of the cluster associated with the resource. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocation ExtendedLocation { get; set; } - /// The resource ID of the extended location on which the resource will be created. - string ExtendedLocationName { get; set; } - /// The extended location type, for example, CustomLocation. - string ExtendedLocationType { get; set; } - /// - /// Field Deprecated. These fields will be empty/omitted. The list of Hybrid AKS cluster resource IDs that are associated - /// with this cloud services network. - /// - string[] HybridAksClustersAssociatedId { get; set; } - /// - /// The name of the interface that will be present in the virtual machine to represent this network. - /// - string InterfaceName { get; set; } - /// The list of the resource properties. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkProperties Property { get; set; } - /// The provisioning state of the cloud services network. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CloudServicesNetworkProvisioningState? ProvisioningState { get; set; } - /// - /// Field Deprecated. These fields will be empty/omitted. The list of virtual machine resource IDs, excluding any Hybrid AKS - /// virtual machines, that are currently using this cloud services network. - /// - string[] VirtualMachinesAssociatedId { get; set; } - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/CloudServicesNetworkList.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/CloudServicesNetworkList.cs deleted file mode 100644 index 494acf7c0d25..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/CloudServicesNetworkList.cs +++ /dev/null @@ -1,68 +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.NetworkCloud.Models.Api20250201 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; - - /// CloudServicesNetworkList represents a list of cloud services networks. - public partial class CloudServicesNetworkList : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkList, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkListInternal - { - - /// Backing field for property. - private string _nextLink; - - /// The link used to get the next page of operations. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string NextLink { get => this._nextLink; set => this._nextLink = value; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetwork[] _value; - - /// The list of cloud services networks. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetwork[] Value { get => this._value; set => this._value = value; } - - /// Creates an new instance. - public CloudServicesNetworkList() - { - - } - } - /// CloudServicesNetworkList represents a list of cloud services networks. - public partial interface ICloudServicesNetworkList : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable - { - /// The link used to get the next page of operations. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The link used to get the next page of operations.", - SerializedName = @"nextLink", - PossibleTypes = new [] { typeof(string) })] - string NextLink { get; set; } - /// The list of cloud services networks. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The list of cloud services networks.", - SerializedName = @"value", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetwork) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetwork[] Value { get; set; } - - } - /// CloudServicesNetworkList represents a list of cloud services networks. - internal partial interface ICloudServicesNetworkListInternal - - { - /// The link used to get the next page of operations. - string NextLink { get; set; } - /// The list of cloud services networks. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetwork[] Value { get; set; } - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/CloudServicesNetworkPatchParameters.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/CloudServicesNetworkPatchParameters.PowerShell.cs deleted file mode 100644 index c91533f30dab..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/CloudServicesNetworkPatchParameters.PowerShell.cs +++ /dev/null @@ -1,194 +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.NetworkCloud.Models.Api20250201 -{ - using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; - - /// - /// CloudServicesNetworkPatchParameters represents the body of the request to patch the cloud services network. - /// - [System.ComponentModel.TypeConverter(typeof(CloudServicesNetworkPatchParametersTypeConverter))] - public partial class CloudServicesNetworkPatchParameters - { - - /// - /// 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 CloudServicesNetworkPatchParameters(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.NetworkCloud.Models.Api20250201.ICloudServicesNetworkPatchParametersInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkPatchProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkPatchParametersInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.CloudServicesNetworkPatchPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Tag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkPatchParametersInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkPatchParametersTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkPatchParametersInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.CloudServicesNetworkPatchParametersTagsTypeConverter.ConvertFrom); - } - if (content.Contains("AdditionalEgressEndpoint")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkPatchParametersInternal)this).AdditionalEgressEndpoint = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IEgressEndpoint[]) content.GetValueForProperty("AdditionalEgressEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkPatchParametersInternal)this).AdditionalEgressEndpoint, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.EgressEndpointTypeConverter.ConvertFrom)); - } - if (content.Contains("EnableDefaultEgressEndpoint")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkPatchParametersInternal)this).EnableDefaultEgressEndpoint = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CloudServicesNetworkEnableDefaultEgressEndpoints?) content.GetValueForProperty("EnableDefaultEgressEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkPatchParametersInternal)this).EnableDefaultEgressEndpoint, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CloudServicesNetworkEnableDefaultEgressEndpoints.CreateFrom); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal CloudServicesNetworkPatchParameters(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.NetworkCloud.Models.Api20250201.ICloudServicesNetworkPatchParametersInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkPatchProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkPatchParametersInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.CloudServicesNetworkPatchPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Tag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkPatchParametersInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkPatchParametersTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkPatchParametersInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.CloudServicesNetworkPatchParametersTagsTypeConverter.ConvertFrom); - } - if (content.Contains("AdditionalEgressEndpoint")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkPatchParametersInternal)this).AdditionalEgressEndpoint = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IEgressEndpoint[]) content.GetValueForProperty("AdditionalEgressEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkPatchParametersInternal)this).AdditionalEgressEndpoint, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.EgressEndpointTypeConverter.ConvertFrom)); - } - if (content.Contains("EnableDefaultEgressEndpoint")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkPatchParametersInternal)this).EnableDefaultEgressEndpoint = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CloudServicesNetworkEnableDefaultEgressEndpoints?) content.GetValueForProperty("EnableDefaultEgressEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkPatchParametersInternal)this).EnableDefaultEgressEndpoint, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CloudServicesNetworkEnableDefaultEgressEndpoints.CreateFrom); - } - AfterDeserializePSObject(content); - } - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkPatchParameters DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new CloudServicesNetworkPatchParameters(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.NetworkCloud.Models.Api20250201.ICloudServicesNetworkPatchParameters DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new CloudServicesNetworkPatchParameters(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.NetworkCloud.Models.Api20250201.ICloudServicesNetworkPatchParameters FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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(); - } - } - /// CloudServicesNetworkPatchParameters represents the body of the request to patch the cloud services network. - [System.ComponentModel.TypeConverter(typeof(CloudServicesNetworkPatchParametersTypeConverter))] - public partial interface ICloudServicesNetworkPatchParameters - - { - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/CloudServicesNetworkPatchParameters.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/CloudServicesNetworkPatchParameters.cs deleted file mode 100644 index 44b326346318..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/CloudServicesNetworkPatchParameters.cs +++ /dev/null @@ -1,105 +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.NetworkCloud.Models.Api20250201 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; - - /// - /// CloudServicesNetworkPatchParameters represents the body of the request to patch the cloud services network. - /// - public partial class CloudServicesNetworkPatchParameters : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkPatchParameters, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkPatchParametersInternal - { - - /// - /// The list of egress endpoints. This allows for connection from a Hybrid AKS cluster to the specified endpoint. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IEgressEndpoint[] AdditionalEgressEndpoint { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkPatchPropertiesInternal)Property).AdditionalEgressEndpoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkPatchPropertiesInternal)Property).AdditionalEgressEndpoint = value ?? null /* arrayOf */; } - - /// - /// The indicator of whether the platform default endpoints are allowed for the egress traffic. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CloudServicesNetworkEnableDefaultEgressEndpoints? EnableDefaultEgressEndpoint { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkPatchPropertiesInternal)Property).EnableDefaultEgressEndpoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkPatchPropertiesInternal)Property).EnableDefaultEgressEndpoint = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CloudServicesNetworkEnableDefaultEgressEndpoints)""); } - - /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkPatchProperties Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkPatchParametersInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.CloudServicesNetworkPatchProperties()); set { {_property = value;} } } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkPatchProperties _property; - - /// The list of the resource properties. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkPatchProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.CloudServicesNetworkPatchProperties()); set => this._property = value; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkPatchParametersTags _tag; - - /// The Azure resource tags that will replace the existing ones. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkPatchParametersTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.CloudServicesNetworkPatchParametersTags()); set => this._tag = value; } - - /// Creates an new instance. - public CloudServicesNetworkPatchParameters() - { - - } - } - /// CloudServicesNetworkPatchParameters represents the body of the request to patch the cloud services network. - public partial interface ICloudServicesNetworkPatchParameters : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable - { - /// - /// The list of egress endpoints. This allows for connection from a Hybrid AKS cluster to the specified endpoint. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The list of egress endpoints. This allows for connection from a Hybrid AKS cluster to the specified endpoint.", - SerializedName = @"additionalEgressEndpoints", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IEgressEndpoint) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IEgressEndpoint[] AdditionalEgressEndpoint { get; set; } - /// - /// The indicator of whether the platform default endpoints are allowed for the egress traffic. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The indicator of whether the platform default endpoints are allowed for the egress traffic.", - SerializedName = @"enableDefaultEgressEndpoints", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CloudServicesNetworkEnableDefaultEgressEndpoints) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CloudServicesNetworkEnableDefaultEgressEndpoints? EnableDefaultEgressEndpoint { get; set; } - /// The Azure resource tags that will replace the existing ones. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The Azure resource tags that will replace the existing ones.", - SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkPatchParametersTags) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkPatchParametersTags Tag { get; set; } - - } - /// CloudServicesNetworkPatchParameters represents the body of the request to patch the cloud services network. - internal partial interface ICloudServicesNetworkPatchParametersInternal - - { - /// - /// The list of egress endpoints. This allows for connection from a Hybrid AKS cluster to the specified endpoint. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IEgressEndpoint[] AdditionalEgressEndpoint { get; set; } - /// - /// The indicator of whether the platform default endpoints are allowed for the egress traffic. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CloudServicesNetworkEnableDefaultEgressEndpoints? EnableDefaultEgressEndpoint { get; set; } - /// The list of the resource properties. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkPatchProperties Property { get; set; } - /// The Azure resource tags that will replace the existing ones. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkPatchParametersTags Tag { get; set; } - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/CloudServicesNetworkPatchProperties.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/CloudServicesNetworkPatchProperties.PowerShell.cs deleted file mode 100644 index c80ab9bf2244..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/CloudServicesNetworkPatchProperties.PowerShell.cs +++ /dev/null @@ -1,180 +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.NetworkCloud.Models.Api20250201 -{ - using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; - - /// - /// CloudServicesNetworkPatchProperties represents the properties of the cloud services network that can be updated using - /// a patch request. - /// - [System.ComponentModel.TypeConverter(typeof(CloudServicesNetworkPatchPropertiesTypeConverter))] - public partial class CloudServicesNetworkPatchProperties - { - - /// - /// 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 CloudServicesNetworkPatchProperties(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("AdditionalEgressEndpoint")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkPatchPropertiesInternal)this).AdditionalEgressEndpoint = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IEgressEndpoint[]) content.GetValueForProperty("AdditionalEgressEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkPatchPropertiesInternal)this).AdditionalEgressEndpoint, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.EgressEndpointTypeConverter.ConvertFrom)); - } - if (content.Contains("EnableDefaultEgressEndpoint")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkPatchPropertiesInternal)this).EnableDefaultEgressEndpoint = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CloudServicesNetworkEnableDefaultEgressEndpoints?) content.GetValueForProperty("EnableDefaultEgressEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkPatchPropertiesInternal)this).EnableDefaultEgressEndpoint, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CloudServicesNetworkEnableDefaultEgressEndpoints.CreateFrom); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal CloudServicesNetworkPatchProperties(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("AdditionalEgressEndpoint")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkPatchPropertiesInternal)this).AdditionalEgressEndpoint = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IEgressEndpoint[]) content.GetValueForProperty("AdditionalEgressEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkPatchPropertiesInternal)this).AdditionalEgressEndpoint, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.EgressEndpointTypeConverter.ConvertFrom)); - } - if (content.Contains("EnableDefaultEgressEndpoint")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkPatchPropertiesInternal)this).EnableDefaultEgressEndpoint = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CloudServicesNetworkEnableDefaultEgressEndpoints?) content.GetValueForProperty("EnableDefaultEgressEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkPatchPropertiesInternal)this).EnableDefaultEgressEndpoint, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CloudServicesNetworkEnableDefaultEgressEndpoints.CreateFrom); - } - AfterDeserializePSObject(content); - } - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkPatchProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new CloudServicesNetworkPatchProperties(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.NetworkCloud.Models.Api20250201.ICloudServicesNetworkPatchProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new CloudServicesNetworkPatchProperties(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.NetworkCloud.Models.Api20250201.ICloudServicesNetworkPatchProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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(); - } - } - /// CloudServicesNetworkPatchProperties represents the properties of the cloud services network that can be updated using - /// a patch request. - [System.ComponentModel.TypeConverter(typeof(CloudServicesNetworkPatchPropertiesTypeConverter))] - public partial interface ICloudServicesNetworkPatchProperties - - { - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/CloudServicesNetworkPatchProperties.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/CloudServicesNetworkPatchProperties.cs deleted file mode 100644 index 96afa2b52063..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/CloudServicesNetworkPatchProperties.cs +++ /dev/null @@ -1,85 +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.NetworkCloud.Models.Api20250201 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; - - /// - /// CloudServicesNetworkPatchProperties represents the properties of the cloud services network that can be updated using - /// a patch request. - /// - public partial class CloudServicesNetworkPatchProperties : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkPatchProperties, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkPatchPropertiesInternal - { - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IEgressEndpoint[] _additionalEgressEndpoint; - - /// - /// The list of egress endpoints. This allows for connection from a Hybrid AKS cluster to the specified endpoint. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IEgressEndpoint[] AdditionalEgressEndpoint { get => this._additionalEgressEndpoint; set => this._additionalEgressEndpoint = value; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CloudServicesNetworkEnableDefaultEgressEndpoints? _enableDefaultEgressEndpoint; - - /// - /// The indicator of whether the platform default endpoints are allowed for the egress traffic. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CloudServicesNetworkEnableDefaultEgressEndpoints? EnableDefaultEgressEndpoint { get => this._enableDefaultEgressEndpoint; set => this._enableDefaultEgressEndpoint = value; } - - /// Creates an new instance. - public CloudServicesNetworkPatchProperties() - { - - } - } - /// CloudServicesNetworkPatchProperties represents the properties of the cloud services network that can be updated using - /// a patch request. - public partial interface ICloudServicesNetworkPatchProperties : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable - { - /// - /// The list of egress endpoints. This allows for connection from a Hybrid AKS cluster to the specified endpoint. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The list of egress endpoints. This allows for connection from a Hybrid AKS cluster to the specified endpoint.", - SerializedName = @"additionalEgressEndpoints", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IEgressEndpoint) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IEgressEndpoint[] AdditionalEgressEndpoint { get; set; } - /// - /// The indicator of whether the platform default endpoints are allowed for the egress traffic. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The indicator of whether the platform default endpoints are allowed for the egress traffic.", - SerializedName = @"enableDefaultEgressEndpoints", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CloudServicesNetworkEnableDefaultEgressEndpoints) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CloudServicesNetworkEnableDefaultEgressEndpoints? EnableDefaultEgressEndpoint { get; set; } - - } - /// CloudServicesNetworkPatchProperties represents the properties of the cloud services network that can be updated using - /// a patch request. - internal partial interface ICloudServicesNetworkPatchPropertiesInternal - - { - /// - /// The list of egress endpoints. This allows for connection from a Hybrid AKS cluster to the specified endpoint. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IEgressEndpoint[] AdditionalEgressEndpoint { get; set; } - /// - /// The indicator of whether the platform default endpoints are allowed for the egress traffic. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CloudServicesNetworkEnableDefaultEgressEndpoints? EnableDefaultEgressEndpoint { get; set; } - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/CloudServicesNetworkProperties.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/CloudServicesNetworkProperties.PowerShell.cs deleted file mode 100644 index 163c510fce34..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/CloudServicesNetworkProperties.PowerShell.cs +++ /dev/null @@ -1,248 +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.NetworkCloud.Models.Api20250201 -{ - using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; - - /// - /// CloudServicesNetworkProperties represents properties of the cloud services network. - /// - [System.ComponentModel.TypeConverter(typeof(CloudServicesNetworkPropertiesTypeConverter))] - public partial class CloudServicesNetworkProperties - { - - /// - /// 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 CloudServicesNetworkProperties(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("AdditionalEgressEndpoint")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkPropertiesInternal)this).AdditionalEgressEndpoint = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IEgressEndpoint[]) content.GetValueForProperty("AdditionalEgressEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkPropertiesInternal)this).AdditionalEgressEndpoint, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.EgressEndpointTypeConverter.ConvertFrom)); - } - if (content.Contains("AssociatedResourceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkPropertiesInternal)this).AssociatedResourceId = (string[]) content.GetValueForProperty("AssociatedResourceId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkPropertiesInternal)this).AssociatedResourceId, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("ClusterId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkPropertiesInternal)this).ClusterId = (string) content.GetValueForProperty("ClusterId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkPropertiesInternal)this).ClusterId, global::System.Convert.ToString); - } - if (content.Contains("DetailedStatus")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkPropertiesInternal)this).DetailedStatus = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CloudServicesNetworkDetailedStatus?) content.GetValueForProperty("DetailedStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkPropertiesInternal)this).DetailedStatus, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CloudServicesNetworkDetailedStatus.CreateFrom); - } - if (content.Contains("DetailedStatusMessage")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkPropertiesInternal)this).DetailedStatusMessage = (string) content.GetValueForProperty("DetailedStatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkPropertiesInternal)this).DetailedStatusMessage, global::System.Convert.ToString); - } - if (content.Contains("EnableDefaultEgressEndpoint")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkPropertiesInternal)this).EnableDefaultEgressEndpoint = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CloudServicesNetworkEnableDefaultEgressEndpoints?) content.GetValueForProperty("EnableDefaultEgressEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkPropertiesInternal)this).EnableDefaultEgressEndpoint, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CloudServicesNetworkEnableDefaultEgressEndpoints.CreateFrom); - } - if (content.Contains("EnabledEgressEndpoint")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkPropertiesInternal)this).EnabledEgressEndpoint = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IEgressEndpoint[]) content.GetValueForProperty("EnabledEgressEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkPropertiesInternal)this).EnabledEgressEndpoint, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.EgressEndpointTypeConverter.ConvertFrom)); - } - if (content.Contains("HybridAksClustersAssociatedId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkPropertiesInternal)this).HybridAksClustersAssociatedId = (string[]) content.GetValueForProperty("HybridAksClustersAssociatedId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkPropertiesInternal)this).HybridAksClustersAssociatedId, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("InterfaceName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkPropertiesInternal)this).InterfaceName = (string) content.GetValueForProperty("InterfaceName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkPropertiesInternal)this).InterfaceName, global::System.Convert.ToString); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkPropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CloudServicesNetworkProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkPropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CloudServicesNetworkProvisioningState.CreateFrom); - } - if (content.Contains("VirtualMachinesAssociatedId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkPropertiesInternal)this).VirtualMachinesAssociatedId = (string[]) content.GetValueForProperty("VirtualMachinesAssociatedId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkPropertiesInternal)this).VirtualMachinesAssociatedId, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal CloudServicesNetworkProperties(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("AdditionalEgressEndpoint")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkPropertiesInternal)this).AdditionalEgressEndpoint = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IEgressEndpoint[]) content.GetValueForProperty("AdditionalEgressEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkPropertiesInternal)this).AdditionalEgressEndpoint, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.EgressEndpointTypeConverter.ConvertFrom)); - } - if (content.Contains("AssociatedResourceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkPropertiesInternal)this).AssociatedResourceId = (string[]) content.GetValueForProperty("AssociatedResourceId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkPropertiesInternal)this).AssociatedResourceId, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("ClusterId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkPropertiesInternal)this).ClusterId = (string) content.GetValueForProperty("ClusterId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkPropertiesInternal)this).ClusterId, global::System.Convert.ToString); - } - if (content.Contains("DetailedStatus")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkPropertiesInternal)this).DetailedStatus = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CloudServicesNetworkDetailedStatus?) content.GetValueForProperty("DetailedStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkPropertiesInternal)this).DetailedStatus, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CloudServicesNetworkDetailedStatus.CreateFrom); - } - if (content.Contains("DetailedStatusMessage")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkPropertiesInternal)this).DetailedStatusMessage = (string) content.GetValueForProperty("DetailedStatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkPropertiesInternal)this).DetailedStatusMessage, global::System.Convert.ToString); - } - if (content.Contains("EnableDefaultEgressEndpoint")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkPropertiesInternal)this).EnableDefaultEgressEndpoint = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CloudServicesNetworkEnableDefaultEgressEndpoints?) content.GetValueForProperty("EnableDefaultEgressEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkPropertiesInternal)this).EnableDefaultEgressEndpoint, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CloudServicesNetworkEnableDefaultEgressEndpoints.CreateFrom); - } - if (content.Contains("EnabledEgressEndpoint")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkPropertiesInternal)this).EnabledEgressEndpoint = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IEgressEndpoint[]) content.GetValueForProperty("EnabledEgressEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkPropertiesInternal)this).EnabledEgressEndpoint, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.EgressEndpointTypeConverter.ConvertFrom)); - } - if (content.Contains("HybridAksClustersAssociatedId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkPropertiesInternal)this).HybridAksClustersAssociatedId = (string[]) content.GetValueForProperty("HybridAksClustersAssociatedId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkPropertiesInternal)this).HybridAksClustersAssociatedId, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("InterfaceName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkPropertiesInternal)this).InterfaceName = (string) content.GetValueForProperty("InterfaceName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkPropertiesInternal)this).InterfaceName, global::System.Convert.ToString); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkPropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CloudServicesNetworkProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkPropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CloudServicesNetworkProvisioningState.CreateFrom); - } - if (content.Contains("VirtualMachinesAssociatedId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkPropertiesInternal)this).VirtualMachinesAssociatedId = (string[]) content.GetValueForProperty("VirtualMachinesAssociatedId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkPropertiesInternal)this).VirtualMachinesAssociatedId, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - AfterDeserializePSObject(content); - } - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new CloudServicesNetworkProperties(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.NetworkCloud.Models.Api20250201.ICloudServicesNetworkProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new CloudServicesNetworkProperties(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.NetworkCloud.Models.Api20250201.ICloudServicesNetworkProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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(); - } - } - /// CloudServicesNetworkProperties represents properties of the cloud services network. - [System.ComponentModel.TypeConverter(typeof(CloudServicesNetworkPropertiesTypeConverter))] - public partial interface ICloudServicesNetworkProperties - - { - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/CloudServicesNetworkProperties.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/CloudServicesNetworkProperties.cs deleted file mode 100644 index 1bad14d02d6a..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/CloudServicesNetworkProperties.cs +++ /dev/null @@ -1,304 +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.NetworkCloud.Models.Api20250201 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; - - /// - /// CloudServicesNetworkProperties represents properties of the cloud services network. - /// - public partial class CloudServicesNetworkProperties : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkProperties, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkPropertiesInternal - { - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IEgressEndpoint[] _additionalEgressEndpoint; - - /// - /// The list of egress endpoints. This allows for connection from a Hybrid AKS cluster to the specified endpoint. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IEgressEndpoint[] AdditionalEgressEndpoint { get => this._additionalEgressEndpoint; set => this._additionalEgressEndpoint = value; } - - /// Backing field for property. - private string[] _associatedResourceId; - - /// - /// The list of resource IDs for the other Microsoft.NetworkCloud resources that have attached this network. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string[] AssociatedResourceId { get => this._associatedResourceId; } - - /// Backing field for property. - private string _clusterId; - - /// - /// The resource ID of the Network Cloud cluster this cloud services network is associated with. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string ClusterId { get => this._clusterId; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CloudServicesNetworkDetailedStatus? _detailedStatus; - - /// The more detailed status of the cloud services network. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CloudServicesNetworkDetailedStatus? DetailedStatus { get => this._detailedStatus; } - - /// Backing field for property. - private string _detailedStatusMessage; - - /// The descriptive message about the current detailed status. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string DetailedStatusMessage { get => this._detailedStatusMessage; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CloudServicesNetworkEnableDefaultEgressEndpoints? _enableDefaultEgressEndpoint; - - /// - /// The indicator of whether the platform default endpoints are allowed for the egress traffic. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CloudServicesNetworkEnableDefaultEgressEndpoints? EnableDefaultEgressEndpoint { get => this._enableDefaultEgressEndpoint; set => this._enableDefaultEgressEndpoint = value; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IEgressEndpoint[] _enabledEgressEndpoint; - - /// - /// The full list of additional and default egress endpoints that are currently enabled. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IEgressEndpoint[] EnabledEgressEndpoint { get => this._enabledEgressEndpoint; } - - /// Backing field for property. - private string[] _hybridAksClustersAssociatedId; - - /// - /// Field Deprecated. These fields will be empty/omitted. The list of Hybrid AKS cluster resource IDs that are associated - /// with this cloud services network. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string[] HybridAksClustersAssociatedId { get => this._hybridAksClustersAssociatedId; } - - /// Backing field for property. - private string _interfaceName; - - /// - /// The name of the interface that will be present in the virtual machine to represent this network. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string InterfaceName { get => this._interfaceName; } - - /// Internal Acessors for AssociatedResourceId - string[] Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkPropertiesInternal.AssociatedResourceId { get => this._associatedResourceId; set { {_associatedResourceId = value;} } } - - /// Internal Acessors for ClusterId - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkPropertiesInternal.ClusterId { get => this._clusterId; set { {_clusterId = value;} } } - - /// Internal Acessors for DetailedStatus - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CloudServicesNetworkDetailedStatus? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkPropertiesInternal.DetailedStatus { get => this._detailedStatus; set { {_detailedStatus = value;} } } - - /// Internal Acessors for DetailedStatusMessage - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkPropertiesInternal.DetailedStatusMessage { get => this._detailedStatusMessage; set { {_detailedStatusMessage = value;} } } - - /// Internal Acessors for EnabledEgressEndpoint - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IEgressEndpoint[] Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkPropertiesInternal.EnabledEgressEndpoint { get => this._enabledEgressEndpoint; set { {_enabledEgressEndpoint = value;} } } - - /// Internal Acessors for HybridAksClustersAssociatedId - string[] Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkPropertiesInternal.HybridAksClustersAssociatedId { get => this._hybridAksClustersAssociatedId; set { {_hybridAksClustersAssociatedId = value;} } } - - /// Internal Acessors for InterfaceName - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkPropertiesInternal.InterfaceName { get => this._interfaceName; set { {_interfaceName = value;} } } - - /// Internal Acessors for ProvisioningState - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CloudServicesNetworkProvisioningState? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkPropertiesInternal.ProvisioningState { get => this._provisioningState; set { {_provisioningState = value;} } } - - /// Internal Acessors for VirtualMachinesAssociatedId - string[] Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkPropertiesInternal.VirtualMachinesAssociatedId { get => this._virtualMachinesAssociatedId; set { {_virtualMachinesAssociatedId = value;} } } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CloudServicesNetworkProvisioningState? _provisioningState; - - /// The provisioning state of the cloud services network. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CloudServicesNetworkProvisioningState? ProvisioningState { get => this._provisioningState; } - - /// Backing field for property. - private string[] _virtualMachinesAssociatedId; - - /// - /// Field Deprecated. These fields will be empty/omitted. The list of virtual machine resource IDs, excluding any Hybrid AKS - /// virtual machines, that are currently using this cloud services network. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string[] VirtualMachinesAssociatedId { get => this._virtualMachinesAssociatedId; } - - /// Creates an new instance. - public CloudServicesNetworkProperties() - { - - } - } - /// CloudServicesNetworkProperties represents properties of the cloud services network. - public partial interface ICloudServicesNetworkProperties : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable - { - /// - /// The list of egress endpoints. This allows for connection from a Hybrid AKS cluster to the specified endpoint. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The list of egress endpoints. This allows for connection from a Hybrid AKS cluster to the specified endpoint.", - SerializedName = @"additionalEgressEndpoints", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IEgressEndpoint) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IEgressEndpoint[] AdditionalEgressEndpoint { get; set; } - /// - /// The list of resource IDs for the other Microsoft.NetworkCloud resources that have attached this network. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The list of resource IDs for the other Microsoft.NetworkCloud resources that have attached this network.", - SerializedName = @"associatedResourceIds", - PossibleTypes = new [] { typeof(string) })] - string[] AssociatedResourceId { get; } - /// - /// The resource ID of the Network Cloud cluster this cloud services network is associated with. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The resource ID of the Network Cloud cluster this cloud services network is associated with.", - SerializedName = @"clusterId", - PossibleTypes = new [] { typeof(string) })] - string ClusterId { get; } - /// The more detailed status of the cloud services network. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The more detailed status of the cloud services network.", - SerializedName = @"detailedStatus", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CloudServicesNetworkDetailedStatus) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CloudServicesNetworkDetailedStatus? DetailedStatus { get; } - /// The descriptive message about the current detailed status. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The descriptive message about the current detailed status.", - SerializedName = @"detailedStatusMessage", - PossibleTypes = new [] { typeof(string) })] - string DetailedStatusMessage { get; } - /// - /// The indicator of whether the platform default endpoints are allowed for the egress traffic. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The indicator of whether the platform default endpoints are allowed for the egress traffic.", - SerializedName = @"enableDefaultEgressEndpoints", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CloudServicesNetworkEnableDefaultEgressEndpoints) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CloudServicesNetworkEnableDefaultEgressEndpoints? EnableDefaultEgressEndpoint { get; set; } - /// - /// The full list of additional and default egress endpoints that are currently enabled. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The full list of additional and default egress endpoints that are currently enabled.", - SerializedName = @"enabledEgressEndpoints", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IEgressEndpoint) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IEgressEndpoint[] EnabledEgressEndpoint { get; } - /// - /// Field Deprecated. These fields will be empty/omitted. The list of Hybrid AKS cluster resource IDs that are associated - /// with this cloud services network. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"Field Deprecated. These fields will be empty/omitted. The list of Hybrid AKS cluster resource IDs that are associated with this cloud services network.", - SerializedName = @"hybridAksClustersAssociatedIds", - PossibleTypes = new [] { typeof(string) })] - string[] HybridAksClustersAssociatedId { get; } - /// - /// The name of the interface that will be present in the virtual machine to represent this network. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The name of the interface that will be present in the virtual machine to represent this network.", - SerializedName = @"interfaceName", - PossibleTypes = new [] { typeof(string) })] - string InterfaceName { get; } - /// The provisioning state of the cloud services network. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The provisioning state of the cloud services network.", - SerializedName = @"provisioningState", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CloudServicesNetworkProvisioningState) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CloudServicesNetworkProvisioningState? ProvisioningState { get; } - /// - /// Field Deprecated. These fields will be empty/omitted. The list of virtual machine resource IDs, excluding any Hybrid AKS - /// virtual machines, that are currently using this cloud services network. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"Field Deprecated. These fields will be empty/omitted. The list of virtual machine resource IDs, excluding any Hybrid AKS virtual machines, that are currently using this cloud services network.", - SerializedName = @"virtualMachinesAssociatedIds", - PossibleTypes = new [] { typeof(string) })] - string[] VirtualMachinesAssociatedId { get; } - - } - /// CloudServicesNetworkProperties represents properties of the cloud services network. - internal partial interface ICloudServicesNetworkPropertiesInternal - - { - /// - /// The list of egress endpoints. This allows for connection from a Hybrid AKS cluster to the specified endpoint. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IEgressEndpoint[] AdditionalEgressEndpoint { get; set; } - /// - /// The list of resource IDs for the other Microsoft.NetworkCloud resources that have attached this network. - /// - string[] AssociatedResourceId { get; set; } - /// - /// The resource ID of the Network Cloud cluster this cloud services network is associated with. - /// - string ClusterId { get; set; } - /// The more detailed status of the cloud services network. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CloudServicesNetworkDetailedStatus? DetailedStatus { get; set; } - /// The descriptive message about the current detailed status. - string DetailedStatusMessage { get; set; } - /// - /// The indicator of whether the platform default endpoints are allowed for the egress traffic. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CloudServicesNetworkEnableDefaultEgressEndpoints? EnableDefaultEgressEndpoint { get; set; } - /// - /// The full list of additional and default egress endpoints that are currently enabled. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IEgressEndpoint[] EnabledEgressEndpoint { get; set; } - /// - /// Field Deprecated. These fields will be empty/omitted. The list of Hybrid AKS cluster resource IDs that are associated - /// with this cloud services network. - /// - string[] HybridAksClustersAssociatedId { get; set; } - /// - /// The name of the interface that will be present in the virtual machine to represent this network. - /// - string InterfaceName { get; set; } - /// The provisioning state of the cloud services network. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CloudServicesNetworkProvisioningState? ProvisioningState { get; set; } - /// - /// Field Deprecated. These fields will be empty/omitted. The list of virtual machine resource IDs, excluding any Hybrid AKS - /// virtual machines, that are currently using this cloud services network. - /// - string[] VirtualMachinesAssociatedId { get; set; } - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/Cluster.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/Cluster.PowerShell.cs deleted file mode 100644 index 0fd0e1e06ba3..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/Cluster.PowerShell.cs +++ /dev/null @@ -1,964 +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.NetworkCloud.Models.Api20250201 -{ - using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; - - /// Cluster represents the on-premises Network Cloud cluster. - [System.ComponentModel.TypeConverter(typeof(ClusterTypeConverter))] - public partial class Cluster - { - - /// - /// 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 Cluster(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("ExtendedLocation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).ExtendedLocation = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocation) content.GetValueForProperty("ExtendedLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).ExtendedLocation, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ExtendedLocationTypeConverter.ConvertFrom); - } - if (content.Contains("Identity")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).Identity = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IManagedServiceIdentity) content.GetValueForProperty("Identity",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).Identity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ManagedServiceIdentityTypeConverter.ConvertFrom); - } - if (content.Contains("Property")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ClusterPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Etag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).Etag, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)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("SystemDataCreatedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataLastModifiedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("SystemData")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.SystemDataTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Type, global::System.Convert.ToString); - } - if (content.Contains("Tag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.TrackedResourceTagsTypeConverter.ConvertFrom); - } - if (content.Contains("Location")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); - } - if (content.Contains("ExtendedLocationName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).ExtendedLocationName = (string) content.GetValueForProperty("ExtendedLocationName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).ExtendedLocationName, global::System.Convert.ToString); - } - if (content.Contains("ExtendedLocationType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).ExtendedLocationType = (string) content.GetValueForProperty("ExtendedLocationType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).ExtendedLocationType, global::System.Convert.ToString); - } - if (content.Contains("Capacity")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).Capacity = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterCapacity) content.GetValueForProperty("Capacity",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).Capacity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ClusterCapacityTypeConverter.ConvertFrom); - } - if (content.Contains("ClusterType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).ClusterType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterType) content.GetValueForProperty("ClusterType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).ClusterType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterType.CreateFrom); - } - if (content.Contains("IdentityPrincipalId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).IdentityPrincipalId = (string) content.GetValueForProperty("IdentityPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).IdentityPrincipalId, global::System.Convert.ToString); - } - if (content.Contains("IdentityTenantId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).IdentityTenantId = (string) content.GetValueForProperty("IdentityTenantId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).IdentityTenantId, global::System.Convert.ToString); - } - if (content.Contains("IdentityType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).IdentityType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentityType) content.GetValueForProperty("IdentityType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).IdentityType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentityType.CreateFrom); - } - if (content.Contains("IdentityUserAssignedIdentity")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IUserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.UserAssignedIdentitiesTypeConverter.ConvertFrom); - } - if (content.Contains("AggregatorOrSingleRackDefinition")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).AggregatorOrSingleRackDefinition = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackDefinition) content.GetValueForProperty("AggregatorOrSingleRackDefinition",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).AggregatorOrSingleRackDefinition, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.RackDefinitionTypeConverter.ConvertFrom); - } - if (content.Contains("AnalyticsOutputSetting")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).AnalyticsOutputSetting = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAnalyticsOutputSettings) content.GetValueForProperty("AnalyticsOutputSetting",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).AnalyticsOutputSetting, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AnalyticsOutputSettingsTypeConverter.ConvertFrom); - } - if (content.Contains("ClusterExtendedLocation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).ClusterExtendedLocation = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocation) content.GetValueForProperty("ClusterExtendedLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).ClusterExtendedLocation, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ExtendedLocationTypeConverter.ConvertFrom); - } - if (content.Contains("ServicePrincipal")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).ServicePrincipal = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IServicePrincipalInformation) content.GetValueForProperty("ServicePrincipal",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).ServicePrincipal, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ServicePrincipalInformationTypeConverter.ConvertFrom); - } - if (content.Contains("CommandOutputSetting")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).CommandOutputSetting = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICommandOutputSettings) content.GetValueForProperty("CommandOutputSetting",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).CommandOutputSetting, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.CommandOutputSettingsTypeConverter.ConvertFrom); - } - if (content.Contains("ComputeDeploymentThreshold")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).ComputeDeploymentThreshold = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IValidationThreshold) content.GetValueForProperty("ComputeDeploymentThreshold",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).ComputeDeploymentThreshold, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ValidationThresholdTypeConverter.ConvertFrom); - } - if (content.Contains("HybridAksExtendedLocation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).HybridAksExtendedLocation = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocation) content.GetValueForProperty("HybridAksExtendedLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).HybridAksExtendedLocation, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ExtendedLocationTypeConverter.ConvertFrom); - } - if (content.Contains("ManagedResourceGroupConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).ManagedResourceGroupConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IManagedResourceGroupConfiguration) content.GetValueForProperty("ManagedResourceGroupConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).ManagedResourceGroupConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ManagedResourceGroupConfigurationTypeConverter.ConvertFrom); - } - if (content.Contains("RuntimeProtectionConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).RuntimeProtectionConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRuntimeProtectionConfiguration) content.GetValueForProperty("RuntimeProtectionConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).RuntimeProtectionConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.RuntimeProtectionConfigurationTypeConverter.ConvertFrom); - } - if (content.Contains("SecretArchive")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).SecretArchive = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterSecretArchive) content.GetValueForProperty("SecretArchive",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).SecretArchive, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ClusterSecretArchiveTypeConverter.ConvertFrom); - } - if (content.Contains("SecretArchiveSetting")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).SecretArchiveSetting = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretArchiveSettings) content.GetValueForProperty("SecretArchiveSetting",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).SecretArchiveSetting, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.SecretArchiveSettingsTypeConverter.ConvertFrom); - } - if (content.Contains("UpdateStrategy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).UpdateStrategy = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterUpdateStrategy) content.GetValueForProperty("UpdateStrategy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).UpdateStrategy, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ClusterUpdateStrategyTypeConverter.ConvertFrom); - } - if (content.Contains("VulnerabilityScanningSetting")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).VulnerabilityScanningSetting = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVulnerabilityScanningSettings) content.GetValueForProperty("VulnerabilityScanningSetting",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).VulnerabilityScanningSetting, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.VulnerabilityScanningSettingsTypeConverter.ConvertFrom); - } - if (content.Contains("AnalyticsWorkspaceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).AnalyticsWorkspaceId = (string) content.GetValueForProperty("AnalyticsWorkspaceId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).AnalyticsWorkspaceId, global::System.Convert.ToString); - } - if (content.Contains("AvailableUpgradeVersion")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).AvailableUpgradeVersion = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterAvailableUpgradeVersion[]) content.GetValueForProperty("AvailableUpgradeVersion",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).AvailableUpgradeVersion, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ClusterAvailableUpgradeVersionTypeConverter.ConvertFrom)); - } - if (content.Contains("ConnectionStatus")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).ConnectionStatus = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterConnectionStatus?) content.GetValueForProperty("ConnectionStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).ConnectionStatus, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterConnectionStatus.CreateFrom); - } - if (content.Contains("ClusterLocation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).ClusterLocation = (string) content.GetValueForProperty("ClusterLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).ClusterLocation, global::System.Convert.ToString); - } - if (content.Contains("ManagerConnectionStatus")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).ManagerConnectionStatus = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterManagerConnectionStatus?) content.GetValueForProperty("ManagerConnectionStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).ManagerConnectionStatus, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterManagerConnectionStatus.CreateFrom); - } - if (content.Contains("ManagerId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).ManagerId = (string) content.GetValueForProperty("ManagerId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).ManagerId, global::System.Convert.ToString); - } - if (content.Contains("Version")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).Version = (string) content.GetValueForProperty("Version",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).Version, global::System.Convert.ToString); - } - if (content.Contains("ComputeRackDefinition")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).ComputeRackDefinition = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackDefinition[]) content.GetValueForProperty("ComputeRackDefinition",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).ComputeRackDefinition, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.RackDefinitionTypeConverter.ConvertFrom)); - } - if (content.Contains("DetailedStatus")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).DetailedStatus = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterDetailedStatus?) content.GetValueForProperty("DetailedStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).DetailedStatus, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterDetailedStatus.CreateFrom); - } - if (content.Contains("DetailedStatusMessage")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).DetailedStatusMessage = (string) content.GetValueForProperty("DetailedStatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).DetailedStatusMessage, global::System.Convert.ToString); - } - if (content.Contains("ManualActionCount")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).ManualActionCount = (long?) content.GetValueForProperty("ManualActionCount",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).ManualActionCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("NetworkFabricId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).NetworkFabricId = (string) content.GetValueForProperty("NetworkFabricId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).NetworkFabricId, global::System.Convert.ToString); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterProvisioningState.CreateFrom); - } - if (content.Contains("SupportExpiryDate")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).SupportExpiryDate = (string) content.GetValueForProperty("SupportExpiryDate",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).SupportExpiryDate, global::System.Convert.ToString); - } - if (content.Contains("WorkloadResourceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).WorkloadResourceId = (string[]) content.GetValueForProperty("WorkloadResourceId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).WorkloadResourceId, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("CommandOutputSettingContainerUrl")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).CommandOutputSettingContainerUrl = (string) content.GetValueForProperty("CommandOutputSettingContainerUrl",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).CommandOutputSettingContainerUrl, global::System.Convert.ToString); - } - if (content.Contains("ManagedResourceGroupConfigurationLocation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).ManagedResourceGroupConfigurationLocation = (string) content.GetValueForProperty("ManagedResourceGroupConfigurationLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).ManagedResourceGroupConfigurationLocation, global::System.Convert.ToString); - } - if (content.Contains("ManagedResourceGroupConfigurationName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).ManagedResourceGroupConfigurationName = (string) content.GetValueForProperty("ManagedResourceGroupConfigurationName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).ManagedResourceGroupConfigurationName, global::System.Convert.ToString); - } - if (content.Contains("SecretArchiveSettingVaultUri")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).SecretArchiveSettingVaultUri = (string) content.GetValueForProperty("SecretArchiveSettingVaultUri",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).SecretArchiveSettingVaultUri, global::System.Convert.ToString); - } - if (content.Contains("VulnerabilityScanningSettingContainerScan")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).VulnerabilityScanningSettingContainerScan = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VulnerabilityScanningSettingsContainerScan?) content.GetValueForProperty("VulnerabilityScanningSettingContainerScan",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).VulnerabilityScanningSettingContainerScan, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VulnerabilityScanningSettingsContainerScan.CreateFrom); - } - if (content.Contains("AggregatorOrSingleRackDefinitionAvailabilityZone")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).AggregatorOrSingleRackDefinitionAvailabilityZone = (string) content.GetValueForProperty("AggregatorOrSingleRackDefinitionAvailabilityZone",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).AggregatorOrSingleRackDefinitionAvailabilityZone, global::System.Convert.ToString); - } - if (content.Contains("AggregatorOrSingleRackDefinitionBareMetalMachineConfigurationData")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).AggregatorOrSingleRackDefinitionBareMetalMachineConfigurationData = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineConfigurationData[]) content.GetValueForProperty("AggregatorOrSingleRackDefinitionBareMetalMachineConfigurationData",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).AggregatorOrSingleRackDefinitionBareMetalMachineConfigurationData, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BareMetalMachineConfigurationDataTypeConverter.ConvertFrom)); - } - if (content.Contains("AggregatorOrSingleRackDefinitionNetworkRackId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).AggregatorOrSingleRackDefinitionNetworkRackId = (string) content.GetValueForProperty("AggregatorOrSingleRackDefinitionNetworkRackId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).AggregatorOrSingleRackDefinitionNetworkRackId, global::System.Convert.ToString); - } - if (content.Contains("AggregatorOrSingleRackDefinitionRackLocation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).AggregatorOrSingleRackDefinitionRackLocation = (string) content.GetValueForProperty("AggregatorOrSingleRackDefinitionRackLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).AggregatorOrSingleRackDefinitionRackLocation, global::System.Convert.ToString); - } - if (content.Contains("AggregatorOrSingleRackDefinitionRackSerialNumber")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).AggregatorOrSingleRackDefinitionRackSerialNumber = (string) content.GetValueForProperty("AggregatorOrSingleRackDefinitionRackSerialNumber",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).AggregatorOrSingleRackDefinitionRackSerialNumber, global::System.Convert.ToString); - } - if (content.Contains("AggregatorOrSingleRackDefinitionRackSkuId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).AggregatorOrSingleRackDefinitionRackSkuId = (string) content.GetValueForProperty("AggregatorOrSingleRackDefinitionRackSkuId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).AggregatorOrSingleRackDefinitionRackSkuId, global::System.Convert.ToString); - } - if (content.Contains("AggregatorOrSingleRackDefinitionStorageApplianceConfigurationData")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).AggregatorOrSingleRackDefinitionStorageApplianceConfigurationData = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceConfigurationData[]) content.GetValueForProperty("AggregatorOrSingleRackDefinitionStorageApplianceConfigurationData",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).AggregatorOrSingleRackDefinitionStorageApplianceConfigurationData, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.StorageApplianceConfigurationDataTypeConverter.ConvertFrom)); - } - if (content.Contains("AnalyticOutputSettingAssociatedIdentity")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).AnalyticOutputSettingAssociatedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIdentitySelector) content.GetValueForProperty("AnalyticOutputSettingAssociatedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).AnalyticOutputSettingAssociatedIdentity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IdentitySelectorTypeConverter.ConvertFrom); - } - if (content.Contains("AnalyticOutputSettingAnalyticsWorkspaceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).AnalyticOutputSettingAnalyticsWorkspaceId = (string) content.GetValueForProperty("AnalyticOutputSettingAnalyticsWorkspaceId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).AnalyticOutputSettingAnalyticsWorkspaceId, global::System.Convert.ToString); - } - if (content.Contains("CapacityAvailableApplianceStorageGb")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).CapacityAvailableApplianceStorageGb = (long?) content.GetValueForProperty("CapacityAvailableApplianceStorageGb",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).CapacityAvailableApplianceStorageGb, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("CapacityAvailableCoreCount")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).CapacityAvailableCoreCount = (long?) content.GetValueForProperty("CapacityAvailableCoreCount",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).CapacityAvailableCoreCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("CapacityAvailableHostStorageGb")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).CapacityAvailableHostStorageGb = (long?) content.GetValueForProperty("CapacityAvailableHostStorageGb",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).CapacityAvailableHostStorageGb, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("CapacityAvailableMemoryGb")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).CapacityAvailableMemoryGb = (long?) content.GetValueForProperty("CapacityAvailableMemoryGb",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).CapacityAvailableMemoryGb, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("CapacityTotalApplianceStorageGb")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).CapacityTotalApplianceStorageGb = (long?) content.GetValueForProperty("CapacityTotalApplianceStorageGb",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).CapacityTotalApplianceStorageGb, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("CapacityTotalCoreCount")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).CapacityTotalCoreCount = (long?) content.GetValueForProperty("CapacityTotalCoreCount",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).CapacityTotalCoreCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("CapacityTotalHostStorageGb")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).CapacityTotalHostStorageGb = (long?) content.GetValueForProperty("CapacityTotalHostStorageGb",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).CapacityTotalHostStorageGb, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("CapacityTotalMemoryGb")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).CapacityTotalMemoryGb = (long?) content.GetValueForProperty("CapacityTotalMemoryGb",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).CapacityTotalMemoryGb, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("ClusterExtendedLocationName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).ClusterExtendedLocationName = (string) content.GetValueForProperty("ClusterExtendedLocationName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).ClusterExtendedLocationName, global::System.Convert.ToString); - } - if (content.Contains("ClusterExtendedLocationType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).ClusterExtendedLocationType = (string) content.GetValueForProperty("ClusterExtendedLocationType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).ClusterExtendedLocationType, global::System.Convert.ToString); - } - if (content.Contains("ServicePrincipalApplicationId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).ServicePrincipalApplicationId = (string) content.GetValueForProperty("ServicePrincipalApplicationId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).ServicePrincipalApplicationId, global::System.Convert.ToString); - } - if (content.Contains("ServicePrincipalPassword")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).ServicePrincipalPassword = (System.Security.SecureString) content.GetValueForProperty("ServicePrincipalPassword",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).ServicePrincipalPassword, (object ss) => (System.Security.SecureString)ss); - } - if (content.Contains("ServicePrincipalId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).ServicePrincipalId = (string) content.GetValueForProperty("ServicePrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).ServicePrincipalId, global::System.Convert.ToString); - } - if (content.Contains("ServicePrincipalTenantId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).ServicePrincipalTenantId = (string) content.GetValueForProperty("ServicePrincipalTenantId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).ServicePrincipalTenantId, global::System.Convert.ToString); - } - if (content.Contains("CommandOutputSettingAssociatedIdentity")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).CommandOutputSettingAssociatedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIdentitySelector) content.GetValueForProperty("CommandOutputSettingAssociatedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).CommandOutputSettingAssociatedIdentity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IdentitySelectorTypeConverter.ConvertFrom); - } - if (content.Contains("ComputeDeploymentThresholdGrouping")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).ComputeDeploymentThresholdGrouping = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdGrouping) content.GetValueForProperty("ComputeDeploymentThresholdGrouping",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).ComputeDeploymentThresholdGrouping, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdGrouping.CreateFrom); - } - if (content.Contains("ComputeDeploymentThresholdType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).ComputeDeploymentThresholdType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdType) content.GetValueForProperty("ComputeDeploymentThresholdType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).ComputeDeploymentThresholdType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdType.CreateFrom); - } - if (content.Contains("ComputeDeploymentThresholdValue")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).ComputeDeploymentThresholdValue = (long) content.GetValueForProperty("ComputeDeploymentThresholdValue",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).ComputeDeploymentThresholdValue, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("HybridAkExtendedLocationName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).HybridAkExtendedLocationName = (string) content.GetValueForProperty("HybridAkExtendedLocationName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).HybridAkExtendedLocationName, global::System.Convert.ToString); - } - if (content.Contains("HybridAkExtendedLocationType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).HybridAkExtendedLocationType = (string) content.GetValueForProperty("HybridAkExtendedLocationType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).HybridAkExtendedLocationType, global::System.Convert.ToString); - } - if (content.Contains("RuntimeProtectionConfigurationEnforcementLevel")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).RuntimeProtectionConfigurationEnforcementLevel = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RuntimeProtectionEnforcementLevel?) content.GetValueForProperty("RuntimeProtectionConfigurationEnforcementLevel",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).RuntimeProtectionConfigurationEnforcementLevel, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RuntimeProtectionEnforcementLevel.CreateFrom); - } - if (content.Contains("SecretArchiveKeyVaultId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).SecretArchiveKeyVaultId = (string) content.GetValueForProperty("SecretArchiveKeyVaultId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).SecretArchiveKeyVaultId, global::System.Convert.ToString); - } - if (content.Contains("SecretArchiveUseKeyVault")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).SecretArchiveUseKeyVault = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterSecretArchiveEnabled?) content.GetValueForProperty("SecretArchiveUseKeyVault",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).SecretArchiveUseKeyVault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterSecretArchiveEnabled.CreateFrom); - } - if (content.Contains("SecretArchiveSettingAssociatedIdentity")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).SecretArchiveSettingAssociatedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIdentitySelector) content.GetValueForProperty("SecretArchiveSettingAssociatedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).SecretArchiveSettingAssociatedIdentity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IdentitySelectorTypeConverter.ConvertFrom); - } - if (content.Contains("UpdateStrategyMaxUnavailable")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).UpdateStrategyMaxUnavailable = (long?) content.GetValueForProperty("UpdateStrategyMaxUnavailable",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).UpdateStrategyMaxUnavailable, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("UpdateStrategyType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).UpdateStrategyType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterUpdateStrategyType) content.GetValueForProperty("UpdateStrategyType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).UpdateStrategyType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterUpdateStrategyType.CreateFrom); - } - if (content.Contains("UpdateStrategyThresholdType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).UpdateStrategyThresholdType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdType) content.GetValueForProperty("UpdateStrategyThresholdType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).UpdateStrategyThresholdType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdType.CreateFrom); - } - if (content.Contains("UpdateStrategyThresholdValue")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).UpdateStrategyThresholdValue = (long) content.GetValueForProperty("UpdateStrategyThresholdValue",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).UpdateStrategyThresholdValue, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("UpdateStrategyWaitTimeMinute")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).UpdateStrategyWaitTimeMinute = (long?) content.GetValueForProperty("UpdateStrategyWaitTimeMinute",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).UpdateStrategyWaitTimeMinute, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("AnalyticsOutputSettingsAssociatedIdentityType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).AnalyticsOutputSettingsAssociatedIdentityType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType?) content.GetValueForProperty("AnalyticsOutputSettingsAssociatedIdentityType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).AnalyticsOutputSettingsAssociatedIdentityType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType.CreateFrom); - } - if (content.Contains("AnalyticsOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).AnalyticsOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId = (string) content.GetValueForProperty("AnalyticsOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).AnalyticsOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId, global::System.Convert.ToString); - } - if (content.Contains("AssociatedIdentityType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).AssociatedIdentityType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType?) content.GetValueForProperty("AssociatedIdentityType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).AssociatedIdentityType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType.CreateFrom); - } - if (content.Contains("AssociatedIdentityUserAssignedIdentityResourceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).AssociatedIdentityUserAssignedIdentityResourceId = (string) content.GetValueForProperty("AssociatedIdentityUserAssignedIdentityResourceId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).AssociatedIdentityUserAssignedIdentityResourceId, global::System.Convert.ToString); - } - if (content.Contains("SecretArchiveSettingsAssociatedIdentityType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).SecretArchiveSettingsAssociatedIdentityType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType?) content.GetValueForProperty("SecretArchiveSettingsAssociatedIdentityType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).SecretArchiveSettingsAssociatedIdentityType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType.CreateFrom); - } - if (content.Contains("SecretArchiveSettingsAssociatedIdentityUserAssignedIdentityResourceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).SecretArchiveSettingsAssociatedIdentityUserAssignedIdentityResourceId = (string) content.GetValueForProperty("SecretArchiveSettingsAssociatedIdentityUserAssignedIdentityResourceId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).SecretArchiveSettingsAssociatedIdentityUserAssignedIdentityResourceId, 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 Cluster(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("ExtendedLocation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).ExtendedLocation = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocation) content.GetValueForProperty("ExtendedLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).ExtendedLocation, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ExtendedLocationTypeConverter.ConvertFrom); - } - if (content.Contains("Identity")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).Identity = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IManagedServiceIdentity) content.GetValueForProperty("Identity",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).Identity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ManagedServiceIdentityTypeConverter.ConvertFrom); - } - if (content.Contains("Property")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ClusterPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Etag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).Etag, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)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("SystemDataCreatedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataLastModifiedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("SystemData")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.SystemDataTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Type, global::System.Convert.ToString); - } - if (content.Contains("Tag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.TrackedResourceTagsTypeConverter.ConvertFrom); - } - if (content.Contains("Location")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); - } - if (content.Contains("ExtendedLocationName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).ExtendedLocationName = (string) content.GetValueForProperty("ExtendedLocationName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).ExtendedLocationName, global::System.Convert.ToString); - } - if (content.Contains("ExtendedLocationType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).ExtendedLocationType = (string) content.GetValueForProperty("ExtendedLocationType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).ExtendedLocationType, global::System.Convert.ToString); - } - if (content.Contains("Capacity")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).Capacity = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterCapacity) content.GetValueForProperty("Capacity",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).Capacity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ClusterCapacityTypeConverter.ConvertFrom); - } - if (content.Contains("ClusterType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).ClusterType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterType) content.GetValueForProperty("ClusterType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).ClusterType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterType.CreateFrom); - } - if (content.Contains("IdentityPrincipalId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).IdentityPrincipalId = (string) content.GetValueForProperty("IdentityPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).IdentityPrincipalId, global::System.Convert.ToString); - } - if (content.Contains("IdentityTenantId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).IdentityTenantId = (string) content.GetValueForProperty("IdentityTenantId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).IdentityTenantId, global::System.Convert.ToString); - } - if (content.Contains("IdentityType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).IdentityType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentityType) content.GetValueForProperty("IdentityType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).IdentityType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentityType.CreateFrom); - } - if (content.Contains("IdentityUserAssignedIdentity")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IUserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.UserAssignedIdentitiesTypeConverter.ConvertFrom); - } - if (content.Contains("AggregatorOrSingleRackDefinition")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).AggregatorOrSingleRackDefinition = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackDefinition) content.GetValueForProperty("AggregatorOrSingleRackDefinition",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).AggregatorOrSingleRackDefinition, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.RackDefinitionTypeConverter.ConvertFrom); - } - if (content.Contains("AnalyticsOutputSetting")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).AnalyticsOutputSetting = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAnalyticsOutputSettings) content.GetValueForProperty("AnalyticsOutputSetting",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).AnalyticsOutputSetting, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AnalyticsOutputSettingsTypeConverter.ConvertFrom); - } - if (content.Contains("ClusterExtendedLocation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).ClusterExtendedLocation = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocation) content.GetValueForProperty("ClusterExtendedLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).ClusterExtendedLocation, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ExtendedLocationTypeConverter.ConvertFrom); - } - if (content.Contains("ServicePrincipal")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).ServicePrincipal = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IServicePrincipalInformation) content.GetValueForProperty("ServicePrincipal",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).ServicePrincipal, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ServicePrincipalInformationTypeConverter.ConvertFrom); - } - if (content.Contains("CommandOutputSetting")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).CommandOutputSetting = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICommandOutputSettings) content.GetValueForProperty("CommandOutputSetting",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).CommandOutputSetting, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.CommandOutputSettingsTypeConverter.ConvertFrom); - } - if (content.Contains("ComputeDeploymentThreshold")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).ComputeDeploymentThreshold = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IValidationThreshold) content.GetValueForProperty("ComputeDeploymentThreshold",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).ComputeDeploymentThreshold, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ValidationThresholdTypeConverter.ConvertFrom); - } - if (content.Contains("HybridAksExtendedLocation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).HybridAksExtendedLocation = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocation) content.GetValueForProperty("HybridAksExtendedLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).HybridAksExtendedLocation, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ExtendedLocationTypeConverter.ConvertFrom); - } - if (content.Contains("ManagedResourceGroupConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).ManagedResourceGroupConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IManagedResourceGroupConfiguration) content.GetValueForProperty("ManagedResourceGroupConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).ManagedResourceGroupConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ManagedResourceGroupConfigurationTypeConverter.ConvertFrom); - } - if (content.Contains("RuntimeProtectionConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).RuntimeProtectionConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRuntimeProtectionConfiguration) content.GetValueForProperty("RuntimeProtectionConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).RuntimeProtectionConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.RuntimeProtectionConfigurationTypeConverter.ConvertFrom); - } - if (content.Contains("SecretArchive")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).SecretArchive = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterSecretArchive) content.GetValueForProperty("SecretArchive",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).SecretArchive, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ClusterSecretArchiveTypeConverter.ConvertFrom); - } - if (content.Contains("SecretArchiveSetting")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).SecretArchiveSetting = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretArchiveSettings) content.GetValueForProperty("SecretArchiveSetting",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).SecretArchiveSetting, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.SecretArchiveSettingsTypeConverter.ConvertFrom); - } - if (content.Contains("UpdateStrategy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).UpdateStrategy = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterUpdateStrategy) content.GetValueForProperty("UpdateStrategy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).UpdateStrategy, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ClusterUpdateStrategyTypeConverter.ConvertFrom); - } - if (content.Contains("VulnerabilityScanningSetting")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).VulnerabilityScanningSetting = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVulnerabilityScanningSettings) content.GetValueForProperty("VulnerabilityScanningSetting",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).VulnerabilityScanningSetting, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.VulnerabilityScanningSettingsTypeConverter.ConvertFrom); - } - if (content.Contains("AnalyticsWorkspaceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).AnalyticsWorkspaceId = (string) content.GetValueForProperty("AnalyticsWorkspaceId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).AnalyticsWorkspaceId, global::System.Convert.ToString); - } - if (content.Contains("AvailableUpgradeVersion")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).AvailableUpgradeVersion = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterAvailableUpgradeVersion[]) content.GetValueForProperty("AvailableUpgradeVersion",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).AvailableUpgradeVersion, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ClusterAvailableUpgradeVersionTypeConverter.ConvertFrom)); - } - if (content.Contains("ConnectionStatus")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).ConnectionStatus = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterConnectionStatus?) content.GetValueForProperty("ConnectionStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).ConnectionStatus, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterConnectionStatus.CreateFrom); - } - if (content.Contains("ClusterLocation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).ClusterLocation = (string) content.GetValueForProperty("ClusterLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).ClusterLocation, global::System.Convert.ToString); - } - if (content.Contains("ManagerConnectionStatus")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).ManagerConnectionStatus = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterManagerConnectionStatus?) content.GetValueForProperty("ManagerConnectionStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).ManagerConnectionStatus, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterManagerConnectionStatus.CreateFrom); - } - if (content.Contains("ManagerId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).ManagerId = (string) content.GetValueForProperty("ManagerId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).ManagerId, global::System.Convert.ToString); - } - if (content.Contains("Version")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).Version = (string) content.GetValueForProperty("Version",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).Version, global::System.Convert.ToString); - } - if (content.Contains("ComputeRackDefinition")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).ComputeRackDefinition = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackDefinition[]) content.GetValueForProperty("ComputeRackDefinition",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).ComputeRackDefinition, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.RackDefinitionTypeConverter.ConvertFrom)); - } - if (content.Contains("DetailedStatus")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).DetailedStatus = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterDetailedStatus?) content.GetValueForProperty("DetailedStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).DetailedStatus, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterDetailedStatus.CreateFrom); - } - if (content.Contains("DetailedStatusMessage")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).DetailedStatusMessage = (string) content.GetValueForProperty("DetailedStatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).DetailedStatusMessage, global::System.Convert.ToString); - } - if (content.Contains("ManualActionCount")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).ManualActionCount = (long?) content.GetValueForProperty("ManualActionCount",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).ManualActionCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("NetworkFabricId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).NetworkFabricId = (string) content.GetValueForProperty("NetworkFabricId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).NetworkFabricId, global::System.Convert.ToString); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterProvisioningState.CreateFrom); - } - if (content.Contains("SupportExpiryDate")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).SupportExpiryDate = (string) content.GetValueForProperty("SupportExpiryDate",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).SupportExpiryDate, global::System.Convert.ToString); - } - if (content.Contains("WorkloadResourceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).WorkloadResourceId = (string[]) content.GetValueForProperty("WorkloadResourceId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).WorkloadResourceId, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("CommandOutputSettingContainerUrl")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).CommandOutputSettingContainerUrl = (string) content.GetValueForProperty("CommandOutputSettingContainerUrl",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).CommandOutputSettingContainerUrl, global::System.Convert.ToString); - } - if (content.Contains("ManagedResourceGroupConfigurationLocation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).ManagedResourceGroupConfigurationLocation = (string) content.GetValueForProperty("ManagedResourceGroupConfigurationLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).ManagedResourceGroupConfigurationLocation, global::System.Convert.ToString); - } - if (content.Contains("ManagedResourceGroupConfigurationName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).ManagedResourceGroupConfigurationName = (string) content.GetValueForProperty("ManagedResourceGroupConfigurationName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).ManagedResourceGroupConfigurationName, global::System.Convert.ToString); - } - if (content.Contains("SecretArchiveSettingVaultUri")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).SecretArchiveSettingVaultUri = (string) content.GetValueForProperty("SecretArchiveSettingVaultUri",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).SecretArchiveSettingVaultUri, global::System.Convert.ToString); - } - if (content.Contains("VulnerabilityScanningSettingContainerScan")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).VulnerabilityScanningSettingContainerScan = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VulnerabilityScanningSettingsContainerScan?) content.GetValueForProperty("VulnerabilityScanningSettingContainerScan",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).VulnerabilityScanningSettingContainerScan, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VulnerabilityScanningSettingsContainerScan.CreateFrom); - } - if (content.Contains("AggregatorOrSingleRackDefinitionAvailabilityZone")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).AggregatorOrSingleRackDefinitionAvailabilityZone = (string) content.GetValueForProperty("AggregatorOrSingleRackDefinitionAvailabilityZone",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).AggregatorOrSingleRackDefinitionAvailabilityZone, global::System.Convert.ToString); - } - if (content.Contains("AggregatorOrSingleRackDefinitionBareMetalMachineConfigurationData")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).AggregatorOrSingleRackDefinitionBareMetalMachineConfigurationData = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineConfigurationData[]) content.GetValueForProperty("AggregatorOrSingleRackDefinitionBareMetalMachineConfigurationData",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).AggregatorOrSingleRackDefinitionBareMetalMachineConfigurationData, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BareMetalMachineConfigurationDataTypeConverter.ConvertFrom)); - } - if (content.Contains("AggregatorOrSingleRackDefinitionNetworkRackId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).AggregatorOrSingleRackDefinitionNetworkRackId = (string) content.GetValueForProperty("AggregatorOrSingleRackDefinitionNetworkRackId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).AggregatorOrSingleRackDefinitionNetworkRackId, global::System.Convert.ToString); - } - if (content.Contains("AggregatorOrSingleRackDefinitionRackLocation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).AggregatorOrSingleRackDefinitionRackLocation = (string) content.GetValueForProperty("AggregatorOrSingleRackDefinitionRackLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).AggregatorOrSingleRackDefinitionRackLocation, global::System.Convert.ToString); - } - if (content.Contains("AggregatorOrSingleRackDefinitionRackSerialNumber")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).AggregatorOrSingleRackDefinitionRackSerialNumber = (string) content.GetValueForProperty("AggregatorOrSingleRackDefinitionRackSerialNumber",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).AggregatorOrSingleRackDefinitionRackSerialNumber, global::System.Convert.ToString); - } - if (content.Contains("AggregatorOrSingleRackDefinitionRackSkuId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).AggregatorOrSingleRackDefinitionRackSkuId = (string) content.GetValueForProperty("AggregatorOrSingleRackDefinitionRackSkuId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).AggregatorOrSingleRackDefinitionRackSkuId, global::System.Convert.ToString); - } - if (content.Contains("AggregatorOrSingleRackDefinitionStorageApplianceConfigurationData")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).AggregatorOrSingleRackDefinitionStorageApplianceConfigurationData = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceConfigurationData[]) content.GetValueForProperty("AggregatorOrSingleRackDefinitionStorageApplianceConfigurationData",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).AggregatorOrSingleRackDefinitionStorageApplianceConfigurationData, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.StorageApplianceConfigurationDataTypeConverter.ConvertFrom)); - } - if (content.Contains("AnalyticOutputSettingAssociatedIdentity")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).AnalyticOutputSettingAssociatedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIdentitySelector) content.GetValueForProperty("AnalyticOutputSettingAssociatedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).AnalyticOutputSettingAssociatedIdentity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IdentitySelectorTypeConverter.ConvertFrom); - } - if (content.Contains("AnalyticOutputSettingAnalyticsWorkspaceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).AnalyticOutputSettingAnalyticsWorkspaceId = (string) content.GetValueForProperty("AnalyticOutputSettingAnalyticsWorkspaceId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).AnalyticOutputSettingAnalyticsWorkspaceId, global::System.Convert.ToString); - } - if (content.Contains("CapacityAvailableApplianceStorageGb")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).CapacityAvailableApplianceStorageGb = (long?) content.GetValueForProperty("CapacityAvailableApplianceStorageGb",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).CapacityAvailableApplianceStorageGb, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("CapacityAvailableCoreCount")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).CapacityAvailableCoreCount = (long?) content.GetValueForProperty("CapacityAvailableCoreCount",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).CapacityAvailableCoreCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("CapacityAvailableHostStorageGb")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).CapacityAvailableHostStorageGb = (long?) content.GetValueForProperty("CapacityAvailableHostStorageGb",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).CapacityAvailableHostStorageGb, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("CapacityAvailableMemoryGb")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).CapacityAvailableMemoryGb = (long?) content.GetValueForProperty("CapacityAvailableMemoryGb",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).CapacityAvailableMemoryGb, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("CapacityTotalApplianceStorageGb")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).CapacityTotalApplianceStorageGb = (long?) content.GetValueForProperty("CapacityTotalApplianceStorageGb",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).CapacityTotalApplianceStorageGb, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("CapacityTotalCoreCount")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).CapacityTotalCoreCount = (long?) content.GetValueForProperty("CapacityTotalCoreCount",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).CapacityTotalCoreCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("CapacityTotalHostStorageGb")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).CapacityTotalHostStorageGb = (long?) content.GetValueForProperty("CapacityTotalHostStorageGb",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).CapacityTotalHostStorageGb, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("CapacityTotalMemoryGb")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).CapacityTotalMemoryGb = (long?) content.GetValueForProperty("CapacityTotalMemoryGb",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).CapacityTotalMemoryGb, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("ClusterExtendedLocationName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).ClusterExtendedLocationName = (string) content.GetValueForProperty("ClusterExtendedLocationName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).ClusterExtendedLocationName, global::System.Convert.ToString); - } - if (content.Contains("ClusterExtendedLocationType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).ClusterExtendedLocationType = (string) content.GetValueForProperty("ClusterExtendedLocationType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).ClusterExtendedLocationType, global::System.Convert.ToString); - } - if (content.Contains("ServicePrincipalApplicationId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).ServicePrincipalApplicationId = (string) content.GetValueForProperty("ServicePrincipalApplicationId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).ServicePrincipalApplicationId, global::System.Convert.ToString); - } - if (content.Contains("ServicePrincipalPassword")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).ServicePrincipalPassword = (System.Security.SecureString) content.GetValueForProperty("ServicePrincipalPassword",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).ServicePrincipalPassword, (object ss) => (System.Security.SecureString)ss); - } - if (content.Contains("ServicePrincipalId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).ServicePrincipalId = (string) content.GetValueForProperty("ServicePrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).ServicePrincipalId, global::System.Convert.ToString); - } - if (content.Contains("ServicePrincipalTenantId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).ServicePrincipalTenantId = (string) content.GetValueForProperty("ServicePrincipalTenantId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).ServicePrincipalTenantId, global::System.Convert.ToString); - } - if (content.Contains("CommandOutputSettingAssociatedIdentity")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).CommandOutputSettingAssociatedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIdentitySelector) content.GetValueForProperty("CommandOutputSettingAssociatedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).CommandOutputSettingAssociatedIdentity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IdentitySelectorTypeConverter.ConvertFrom); - } - if (content.Contains("ComputeDeploymentThresholdGrouping")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).ComputeDeploymentThresholdGrouping = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdGrouping) content.GetValueForProperty("ComputeDeploymentThresholdGrouping",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).ComputeDeploymentThresholdGrouping, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdGrouping.CreateFrom); - } - if (content.Contains("ComputeDeploymentThresholdType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).ComputeDeploymentThresholdType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdType) content.GetValueForProperty("ComputeDeploymentThresholdType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).ComputeDeploymentThresholdType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdType.CreateFrom); - } - if (content.Contains("ComputeDeploymentThresholdValue")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).ComputeDeploymentThresholdValue = (long) content.GetValueForProperty("ComputeDeploymentThresholdValue",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).ComputeDeploymentThresholdValue, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("HybridAkExtendedLocationName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).HybridAkExtendedLocationName = (string) content.GetValueForProperty("HybridAkExtendedLocationName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).HybridAkExtendedLocationName, global::System.Convert.ToString); - } - if (content.Contains("HybridAkExtendedLocationType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).HybridAkExtendedLocationType = (string) content.GetValueForProperty("HybridAkExtendedLocationType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).HybridAkExtendedLocationType, global::System.Convert.ToString); - } - if (content.Contains("RuntimeProtectionConfigurationEnforcementLevel")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).RuntimeProtectionConfigurationEnforcementLevel = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RuntimeProtectionEnforcementLevel?) content.GetValueForProperty("RuntimeProtectionConfigurationEnforcementLevel",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).RuntimeProtectionConfigurationEnforcementLevel, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RuntimeProtectionEnforcementLevel.CreateFrom); - } - if (content.Contains("SecretArchiveKeyVaultId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).SecretArchiveKeyVaultId = (string) content.GetValueForProperty("SecretArchiveKeyVaultId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).SecretArchiveKeyVaultId, global::System.Convert.ToString); - } - if (content.Contains("SecretArchiveUseKeyVault")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).SecretArchiveUseKeyVault = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterSecretArchiveEnabled?) content.GetValueForProperty("SecretArchiveUseKeyVault",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).SecretArchiveUseKeyVault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterSecretArchiveEnabled.CreateFrom); - } - if (content.Contains("SecretArchiveSettingAssociatedIdentity")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).SecretArchiveSettingAssociatedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIdentitySelector) content.GetValueForProperty("SecretArchiveSettingAssociatedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).SecretArchiveSettingAssociatedIdentity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IdentitySelectorTypeConverter.ConvertFrom); - } - if (content.Contains("UpdateStrategyMaxUnavailable")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).UpdateStrategyMaxUnavailable = (long?) content.GetValueForProperty("UpdateStrategyMaxUnavailable",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).UpdateStrategyMaxUnavailable, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("UpdateStrategyType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).UpdateStrategyType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterUpdateStrategyType) content.GetValueForProperty("UpdateStrategyType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).UpdateStrategyType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterUpdateStrategyType.CreateFrom); - } - if (content.Contains("UpdateStrategyThresholdType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).UpdateStrategyThresholdType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdType) content.GetValueForProperty("UpdateStrategyThresholdType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).UpdateStrategyThresholdType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdType.CreateFrom); - } - if (content.Contains("UpdateStrategyThresholdValue")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).UpdateStrategyThresholdValue = (long) content.GetValueForProperty("UpdateStrategyThresholdValue",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).UpdateStrategyThresholdValue, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("UpdateStrategyWaitTimeMinute")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).UpdateStrategyWaitTimeMinute = (long?) content.GetValueForProperty("UpdateStrategyWaitTimeMinute",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).UpdateStrategyWaitTimeMinute, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("AnalyticsOutputSettingsAssociatedIdentityType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).AnalyticsOutputSettingsAssociatedIdentityType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType?) content.GetValueForProperty("AnalyticsOutputSettingsAssociatedIdentityType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).AnalyticsOutputSettingsAssociatedIdentityType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType.CreateFrom); - } - if (content.Contains("AnalyticsOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).AnalyticsOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId = (string) content.GetValueForProperty("AnalyticsOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).AnalyticsOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId, global::System.Convert.ToString); - } - if (content.Contains("AssociatedIdentityType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).AssociatedIdentityType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType?) content.GetValueForProperty("AssociatedIdentityType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).AssociatedIdentityType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType.CreateFrom); - } - if (content.Contains("AssociatedIdentityUserAssignedIdentityResourceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).AssociatedIdentityUserAssignedIdentityResourceId = (string) content.GetValueForProperty("AssociatedIdentityUserAssignedIdentityResourceId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).AssociatedIdentityUserAssignedIdentityResourceId, global::System.Convert.ToString); - } - if (content.Contains("SecretArchiveSettingsAssociatedIdentityType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).SecretArchiveSettingsAssociatedIdentityType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType?) content.GetValueForProperty("SecretArchiveSettingsAssociatedIdentityType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).SecretArchiveSettingsAssociatedIdentityType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType.CreateFrom); - } - if (content.Contains("SecretArchiveSettingsAssociatedIdentityUserAssignedIdentityResourceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).SecretArchiveSettingsAssociatedIdentityUserAssignedIdentityResourceId = (string) content.GetValueForProperty("SecretArchiveSettingsAssociatedIdentityUserAssignedIdentityResourceId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal)this).SecretArchiveSettingsAssociatedIdentityUserAssignedIdentityResourceId, 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.NetworkCloud.Models.Api20250201.ICluster DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new Cluster(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.NetworkCloud.Models.Api20250201.ICluster DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new Cluster(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.NetworkCloud.Models.Api20250201.ICluster FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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(); - } - } - /// Cluster represents the on-premises Network Cloud cluster. - [System.ComponentModel.TypeConverter(typeof(ClusterTypeConverter))] - public partial interface ICluster - - { - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/Cluster.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/Cluster.cs deleted file mode 100644 index bcbf6a3aae61..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/Cluster.cs +++ /dev/null @@ -1,1463 +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.NetworkCloud.Models.Api20250201 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; - - /// Cluster represents the on-premises Network Cloud cluster. - public partial class Cluster : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICluster, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IValidates - { - /// - /// Backing field for Inherited model - /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResource __trackedResource = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.TrackedResource(); - - /// - /// The zone name used for this rack when created. Availability zones are used for workload placement. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string AggregatorOrSingleRackDefinitionAvailabilityZone { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)Property).AggregatorOrSingleRackDefinitionAvailabilityZone; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)Property).AggregatorOrSingleRackDefinitionAvailabilityZone = value ?? null; } - - /// The unordered list of bare metal machine configuration. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineConfigurationData[] AggregatorOrSingleRackDefinitionBareMetalMachineConfigurationData { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)Property).AggregatorOrSingleRackDefinitionBareMetalMachineConfigurationData; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)Property).AggregatorOrSingleRackDefinitionBareMetalMachineConfigurationData = value ?? null /* arrayOf */; } - - /// The resource ID of the network rack that matches this rack definition. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string AggregatorOrSingleRackDefinitionNetworkRackId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)Property).AggregatorOrSingleRackDefinitionNetworkRackId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)Property).AggregatorOrSingleRackDefinitionNetworkRackId = value ; } - - /// The free-form description of the rack's location. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string AggregatorOrSingleRackDefinitionRackLocation { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)Property).AggregatorOrSingleRackDefinitionRackLocation; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)Property).AggregatorOrSingleRackDefinitionRackLocation = value ?? null; } - - /// - /// The unique identifier for the rack within Network Cloud cluster. An alternate unique alphanumeric value other than a serial - /// number may be provided if desired. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string AggregatorOrSingleRackDefinitionRackSerialNumber { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)Property).AggregatorOrSingleRackDefinitionRackSerialNumber; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)Property).AggregatorOrSingleRackDefinitionRackSerialNumber = value ; } - - /// The resource ID of the sku for the rack being added. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string AggregatorOrSingleRackDefinitionRackSkuId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)Property).AggregatorOrSingleRackDefinitionRackSkuId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)Property).AggregatorOrSingleRackDefinitionRackSkuId = value ; } - - /// The list of storage appliance configuration data for this rack. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceConfigurationData[] AggregatorOrSingleRackDefinitionStorageApplianceConfigurationData { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)Property).AggregatorOrSingleRackDefinitionStorageApplianceConfigurationData; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)Property).AggregatorOrSingleRackDefinitionStorageApplianceConfigurationData = value ?? null /* arrayOf */; } - - /// - /// The resource ID of the analytics workspace that is to be used by the specified identity. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string AnalyticOutputSettingAnalyticsWorkspaceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)Property).AnalyticOutputSettingAnalyticsWorkspaceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)Property).AnalyticOutputSettingAnalyticsWorkspaceId = value ?? null; } - - /// The type of managed identity that is being selected. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType? AnalyticsOutputSettingsAssociatedIdentityType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)Property).AnalyticsOutputSettingsAssociatedIdentityType; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)Property).AnalyticsOutputSettingsAssociatedIdentityType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType)""); } - - /// - /// The user assigned managed identity resource ID to use. Mutually exclusive with a system assigned identity type. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string AnalyticsOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)Property).AnalyticsOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)Property).AnalyticsOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId = value ?? null; } - - /// - /// Field Deprecated. The resource ID of the Log Analytics Workspace that will be used for storing relevant logs. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string AnalyticsWorkspaceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)Property).AnalyticsWorkspaceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)Property).AnalyticsWorkspaceId = value ?? null; } - - /// The type of managed identity that is being selected. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType? AssociatedIdentityType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)Property).CommandOutputSettingsAssociatedIdentityType; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)Property).CommandOutputSettingsAssociatedIdentityType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType)""); } - - /// - /// The user assigned managed identity resource ID to use. Mutually exclusive with a system assigned identity type. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string AssociatedIdentityUserAssignedIdentityResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)Property).CommandOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)Property).CommandOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId = value ?? null; } - - /// The list of cluster runtime version upgrades available for this cluster. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterAvailableUpgradeVersion[] AvailableUpgradeVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)Property).AvailableUpgradeVersion; } - - /// - /// The remaining appliance-based storage in GB available for workload use. Measured in gibibytes. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public long? CapacityAvailableApplianceStorageGb { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)Property).ClusterCapacityAvailableApplianceStorageGb; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)Property).ClusterCapacityAvailableApplianceStorageGb = value ?? default(long); } - - /// - /// The remaining number of cores that are available in this cluster for workload use. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public long? CapacityAvailableCoreCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)Property).ClusterCapacityAvailableCoreCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)Property).ClusterCapacityAvailableCoreCount = value ?? default(long); } - - /// - /// The remaining machine or host-based storage in GB available for workload use. Measured in gibibytes. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public long? CapacityAvailableHostStorageGb { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)Property).ClusterCapacityAvailableHostStorageGb; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)Property).ClusterCapacityAvailableHostStorageGb = value ?? default(long); } - - /// - /// The remaining memory in GB that are available in this cluster for workload use. Measured in gibibytes. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public long? CapacityAvailableMemoryGb { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)Property).ClusterCapacityAvailableMemoryGb; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)Property).ClusterCapacityAvailableMemoryGb = value ?? default(long); } - - /// - /// The total appliance-based storage in GB supported by this cluster for workload use. Measured in gibibytes. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public long? CapacityTotalApplianceStorageGb { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)Property).ClusterCapacityTotalApplianceStorageGb; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)Property).ClusterCapacityTotalApplianceStorageGb = value ?? default(long); } - - /// The total number of cores that are supported by this cluster for workload use. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public long? CapacityTotalCoreCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)Property).ClusterCapacityTotalCoreCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)Property).ClusterCapacityTotalCoreCount = value ?? default(long); } - - /// - /// The total machine or host-based storage in GB supported by this cluster for workload use. Measured in gibibytes. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public long? CapacityTotalHostStorageGb { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)Property).ClusterCapacityTotalHostStorageGb; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)Property).ClusterCapacityTotalHostStorageGb = value ?? default(long); } - - /// - /// The total memory supported by this cluster for workload use. Measured in gibibytes. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public long? CapacityTotalMemoryGb { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)Property).ClusterCapacityTotalMemoryGb; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)Property).ClusterCapacityTotalMemoryGb = value ?? default(long); } - - /// The resource ID of the extended location on which the resource will be created. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string ClusterExtendedLocationName { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)Property).ClusterExtendedLocationName; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)Property).ClusterExtendedLocationName = value ?? null; } - - /// The extended location type, for example, CustomLocation. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string ClusterExtendedLocationType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)Property).ClusterExtendedLocationType; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)Property).ClusterExtendedLocationType = value ?? null; } - - /// - /// The customer-provided location information to identify where the cluster resides. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string ClusterLocation { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)Property).ClusterLocation; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)Property).ClusterLocation = value ?? null; } - - /// The type of rack configuration for the cluster. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterType ClusterType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)Property).ClusterType; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)Property).ClusterType = value ; } - - /// - /// The URL of the storage account container that is to be used by the specified identities. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string CommandOutputSettingContainerUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)Property).CommandOutputSettingContainerUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)Property).CommandOutputSettingContainerUrl = value ?? null; } - - /// Selection of how the type evaluation is applied to the cluster calculation. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdGrouping? ComputeDeploymentThresholdGrouping { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)Property).ComputeDeploymentThresholdGrouping; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)Property).ComputeDeploymentThresholdGrouping = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdGrouping)""); } - - /// Selection of how the threshold should be evaluated. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdType? ComputeDeploymentThresholdType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)Property).ComputeDeploymentThresholdType; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)Property).ComputeDeploymentThresholdType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdType)""); } - - /// The numeric threshold value. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public long? ComputeDeploymentThresholdValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)Property).ComputeDeploymentThresholdValue; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)Property).ComputeDeploymentThresholdValue = value ?? default(long); } - - /// - /// The list of rack definitions for the compute racks in a multi-rack - /// cluster, or an empty list in a single-rack cluster. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackDefinition[] ComputeRackDefinition { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)Property).ComputeRackDefinition; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)Property).ComputeRackDefinition = value ?? null /* arrayOf */; } - - /// The latest heartbeat status between the cluster manager and the cluster. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterConnectionStatus? ConnectionStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)Property).ClusterConnectionStatus; } - - /// The current detailed status of the cluster. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterDetailedStatus? DetailedStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)Property).DetailedStatus; } - - /// The descriptive message about the detailed status. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string DetailedStatusMessage { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)Property).DetailedStatusMessage; } - - /// Backing field for property. - private string _etag; - - /// Resource ETag. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string Etag { get => this._etag; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocation _extendedLocation; - - /// The extended location of the cluster manager associated with the cluster. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocation ExtendedLocation { get => (this._extendedLocation = this._extendedLocation ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ExtendedLocation()); set => this._extendedLocation = value; } - - /// The resource ID of the extended location on which the resource will be created. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string ExtendedLocationName { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocationInternal)ExtendedLocation).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocationInternal)ExtendedLocation).Name = value ; } - - /// The extended location type, for example, CustomLocation. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string ExtendedLocationType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocationInternal)ExtendedLocation).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocationInternal)ExtendedLocation).Type = value ; } - - /// The resource ID of the extended location on which the resource will be created. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string HybridAkExtendedLocationName { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)Property).HybridAkExtendedLocationName; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)Property).HybridAkExtendedLocationName = value ?? null; } - - /// The extended location type, for example, CustomLocation. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string HybridAkExtendedLocationType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)Property).HybridAkExtendedLocationType; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)Property).HybridAkExtendedLocationType = value ?? null; } - - /// - /// Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).Id; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IManagedServiceIdentity _identity; - - /// The identity for the resource. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IManagedServiceIdentity Identity { get => (this._identity = this._identity ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ManagedServiceIdentity()); 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.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string IdentityPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.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.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string IdentityTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IManagedServiceIdentityInternal)Identity).TenantId; } - - /// - /// Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentityType? IdentityType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IManagedServiceIdentityInternal)Identity).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IManagedServiceIdentityInternal)Identity).Type = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentityType)""); } - - /// - /// 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.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IUserAssignedIdentities IdentityUserAssignedIdentity { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IManagedServiceIdentityInternal)Identity).UserAssignedIdentity; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IManagedServiceIdentityInternal)Identity).UserAssignedIdentity = value ?? null /* model class */; } - - /// The geo-location where the resource lives - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)__trackedResource).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)__trackedResource).Location = value ; } - - /// - /// The location of the managed resource group. If not specified, the location of the parent resource is chosen. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string ManagedResourceGroupConfigurationLocation { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)Property).ManagedResourceGroupConfigurationLocation; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)Property).ManagedResourceGroupConfigurationLocation = value ?? null; } - - /// - /// The name for the managed resource group. If not specified, the unique name is automatically generated. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string ManagedResourceGroupConfigurationName { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)Property).ManagedResourceGroupConfigurationName; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)Property).ManagedResourceGroupConfigurationName = value ?? null; } - - /// The latest connectivity status between cluster manager and the cluster. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterManagerConnectionStatus? ManagerConnectionStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)Property).ClusterManagerConnectionStatus; } - - /// - /// The resource ID of the cluster manager that manages this cluster. This is set by the Cluster Manager when the cluster - /// is created. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string ManagerId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)Property).ClusterManagerId; } - - /// The count of Manual Action Taken (MAT) events that have not been validated. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public long? ManualActionCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)Property).ManualActionCount; } - - /// Internal Acessors for AggregatorOrSingleRackDefinition - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackDefinition Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal.AggregatorOrSingleRackDefinition { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)Property).AggregatorOrSingleRackDefinition; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)Property).AggregatorOrSingleRackDefinition = value; } - - /// Internal Acessors for AnalyticOutputSettingAssociatedIdentity - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIdentitySelector Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal.AnalyticOutputSettingAssociatedIdentity { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)Property).AnalyticOutputSettingAssociatedIdentity; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)Property).AnalyticOutputSettingAssociatedIdentity = value; } - - /// Internal Acessors for AnalyticsOutputSetting - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAnalyticsOutputSettings Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal.AnalyticsOutputSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)Property).AnalyticsOutputSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)Property).AnalyticsOutputSetting = value; } - - /// Internal Acessors for AvailableUpgradeVersion - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterAvailableUpgradeVersion[] Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal.AvailableUpgradeVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)Property).AvailableUpgradeVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)Property).AvailableUpgradeVersion = value; } - - /// Internal Acessors for Capacity - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterCapacity Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal.Capacity { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)Property).ClusterCapacity; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)Property).ClusterCapacity = value; } - - /// Internal Acessors for ClusterExtendedLocation - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocation Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal.ClusterExtendedLocation { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)Property).ClusterExtendedLocation; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)Property).ClusterExtendedLocation = value; } - - /// Internal Acessors for CommandOutputSetting - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICommandOutputSettings Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal.CommandOutputSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)Property).CommandOutputSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)Property).CommandOutputSetting = value; } - - /// Internal Acessors for CommandOutputSettingAssociatedIdentity - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIdentitySelector Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal.CommandOutputSettingAssociatedIdentity { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)Property).CommandOutputSettingAssociatedIdentity; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)Property).CommandOutputSettingAssociatedIdentity = value; } - - /// Internal Acessors for ComputeDeploymentThreshold - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IValidationThreshold Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal.ComputeDeploymentThreshold { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)Property).ComputeDeploymentThreshold; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)Property).ComputeDeploymentThreshold = value; } - - /// Internal Acessors for ConnectionStatus - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterConnectionStatus? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal.ConnectionStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)Property).ClusterConnectionStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)Property).ClusterConnectionStatus = value; } - - /// Internal Acessors for DetailedStatus - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterDetailedStatus? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal.DetailedStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)Property).DetailedStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)Property).DetailedStatus = value; } - - /// Internal Acessors for DetailedStatusMessage - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal.DetailedStatusMessage { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)Property).DetailedStatusMessage; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)Property).DetailedStatusMessage = value; } - - /// Internal Acessors for Etag - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal.Etag { get => this._etag; set { {_etag = value;} } } - - /// Internal Acessors for ExtendedLocation - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocation Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal.ExtendedLocation { get => (this._extendedLocation = this._extendedLocation ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ExtendedLocation()); set { {_extendedLocation = value;} } } - - /// Internal Acessors for HybridAksExtendedLocation - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocation Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal.HybridAksExtendedLocation { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)Property).HybridAksExtendedLocation; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)Property).HybridAksExtendedLocation = value; } - - /// Internal Acessors for Identity - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IManagedServiceIdentity Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal.Identity { get => (this._identity = this._identity ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ManagedServiceIdentity()); set { {_identity = value;} } } - - /// Internal Acessors for IdentityPrincipalId - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal.IdentityPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IManagedServiceIdentityInternal)Identity).PrincipalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IManagedServiceIdentityInternal)Identity).PrincipalId = value; } - - /// Internal Acessors for IdentityTenantId - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal.IdentityTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IManagedServiceIdentityInternal)Identity).TenantId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IManagedServiceIdentityInternal)Identity).TenantId = value; } - - /// Internal Acessors for ManagedResourceGroupConfiguration - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IManagedResourceGroupConfiguration Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal.ManagedResourceGroupConfiguration { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)Property).ManagedResourceGroupConfiguration; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)Property).ManagedResourceGroupConfiguration = value; } - - /// Internal Acessors for ManagerConnectionStatus - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterManagerConnectionStatus? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal.ManagerConnectionStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)Property).ClusterManagerConnectionStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)Property).ClusterManagerConnectionStatus = value; } - - /// Internal Acessors for ManagerId - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal.ManagerId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)Property).ClusterManagerId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)Property).ClusterManagerId = value; } - - /// Internal Acessors for ManualActionCount - long? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal.ManualActionCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)Property).ManualActionCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)Property).ManualActionCount = value; } - - /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterProperties Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ClusterProperties()); set { {_property = value;} } } - - /// Internal Acessors for ProvisioningState - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterProvisioningState? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)Property).ProvisioningState = value; } - - /// Internal Acessors for RuntimeProtectionConfiguration - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRuntimeProtectionConfiguration Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal.RuntimeProtectionConfiguration { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)Property).RuntimeProtectionConfiguration; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)Property).RuntimeProtectionConfiguration = value; } - - /// Internal Acessors for SecretArchive - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterSecretArchive Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal.SecretArchive { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)Property).SecretArchive; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)Property).SecretArchive = value; } - - /// Internal Acessors for SecretArchiveSetting - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretArchiveSettings Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal.SecretArchiveSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)Property).SecretArchiveSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)Property).SecretArchiveSetting = value; } - - /// Internal Acessors for SecretArchiveSettingAssociatedIdentity - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIdentitySelector Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal.SecretArchiveSettingAssociatedIdentity { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)Property).SecretArchiveSettingAssociatedIdentity; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)Property).SecretArchiveSettingAssociatedIdentity = value; } - - /// Internal Acessors for ServicePrincipal - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IServicePrincipalInformation Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal.ServicePrincipal { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)Property).ClusterServicePrincipal; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)Property).ClusterServicePrincipal = value; } - - /// Internal Acessors for SupportExpiryDate - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal.SupportExpiryDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)Property).SupportExpiryDate; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)Property).SupportExpiryDate = value; } - - /// Internal Acessors for UpdateStrategy - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterUpdateStrategy Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal.UpdateStrategy { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)Property).UpdateStrategy; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)Property).UpdateStrategy = value; } - - /// Internal Acessors for VulnerabilityScanningSetting - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVulnerabilityScanningSettings Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal.VulnerabilityScanningSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)Property).VulnerabilityScanningSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)Property).VulnerabilityScanningSetting = value; } - - /// Internal Acessors for WorkloadResourceId - string[] Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterInternal.WorkloadResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)Property).WorkloadResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)Property).WorkloadResourceId = value; } - - /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).Id = value; } - - /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).Name = value; } - - /// Internal Acessors for SystemData - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ISystemData Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal.SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemData; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemData = value; } - - /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).Type = value; } - - /// The name of the resource - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).Name; } - - /// The resource ID of the Network Fabric associated with the cluster. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string NetworkFabricId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)Property).NetworkFabricId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)Property).NetworkFabricId = value ; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterProperties _property; - - /// The list of the resource properties. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ClusterProperties()); set => this._property = value; } - - /// The provisioning state of the cluster. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterProvisioningState? ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)Property).ProvisioningState; } - - /// Gets the resource group name - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string ResourceGroupName { get => (new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Success ? new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Groups["resourceGroupName"].Value : null); } - - /// The mode of operation for runtime protection. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RuntimeProtectionEnforcementLevel? RuntimeProtectionConfigurationEnforcementLevel { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)Property).RuntimeProtectionConfigurationEnforcementLevel; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)Property).RuntimeProtectionConfigurationEnforcementLevel = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RuntimeProtectionEnforcementLevel)""); } - - /// The resource ID of the key vault to archive the secrets of the cluster. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string SecretArchiveKeyVaultId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)Property).SecretArchiveKeyVaultId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)Property).SecretArchiveKeyVaultId = value ?? null; } - - /// The URI for the key vault used as the secret archive. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string SecretArchiveSettingVaultUri { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)Property).SecretArchiveSettingVaultUri; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)Property).SecretArchiveSettingVaultUri = value ?? null; } - - /// The type of managed identity that is being selected. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType? SecretArchiveSettingsAssociatedIdentityType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)Property).SecretArchiveSettingsAssociatedIdentityType; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)Property).SecretArchiveSettingsAssociatedIdentityType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType)""); } - - /// - /// The user assigned managed identity resource ID to use. Mutually exclusive with a system assigned identity type. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string SecretArchiveSettingsAssociatedIdentityUserAssignedIdentityResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)Property).SecretArchiveSettingsAssociatedIdentityUserAssignedIdentityResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)Property).SecretArchiveSettingsAssociatedIdentityUserAssignedIdentityResourceId = value ?? null; } - - /// - /// The indicator if the specified key vault should be used to archive the secrets of the cluster. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterSecretArchiveEnabled? SecretArchiveUseKeyVault { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)Property).SecretArchiveUseKeyVault; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)Property).SecretArchiveUseKeyVault = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterSecretArchiveEnabled)""); } - - /// The application ID, also known as client ID, of the service principal. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string ServicePrincipalApplicationId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)Property).ClusterServicePrincipalApplicationId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)Property).ClusterServicePrincipalApplicationId = value ?? null; } - - /// The principal ID, also known as the object ID, of the service principal. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string ServicePrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)Property).ClusterServicePrincipalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)Property).ClusterServicePrincipalId = value ?? null; } - - /// The password of the service principal. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public System.Security.SecureString ServicePrincipalPassword { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)Property).ClusterServicePrincipalPassword; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)Property).ClusterServicePrincipalPassword = value ?? null; } - - /// - /// The tenant ID, also known as the directory ID, of the tenant in which the service principal is created. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string ServicePrincipalTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)Property).ClusterServicePrincipalTenantId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)Property).ClusterServicePrincipalTenantId = value ?? null; } - - /// The support end date of the runtime version of the cluster. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string SupportExpiryDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)Property).SupportExpiryDate; } - - /// - /// Azure Resource Manager metadata containing createdBy and modifiedBy information. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ISystemData SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemData; } - - /// The timestamp of resource creation (UTC). - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataCreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataCreatedAt = value ?? default(global::System.DateTime); } - - /// The identity that created the resource. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataCreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataCreatedBy = value ?? null; } - - /// The type of identity that created the resource. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType? SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataCreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataCreatedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType)""); } - - /// The timestamp of resource last modification (UTC) - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataLastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataLastModifiedAt = value ?? default(global::System.DateTime); } - - /// The identity that last modified the resource. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataLastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataLastModifiedBy = value ?? null; } - - /// The type of identity that last modified the resource. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType? SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataLastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataLastModifiedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType)""); } - - /// Resource tags. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)__trackedResource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.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.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).Type; } - - /// - /// The maximum number of worker nodes that can be offline within the increment of update, e.g., rack-by-rack. - /// Limited by the maximum number of machines in the increment. Defaults to the whole increment size. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public long? UpdateStrategyMaxUnavailable { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)Property).UpdateStrategyMaxUnavailable; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)Property).UpdateStrategyMaxUnavailable = value ?? default(long); } - - /// Selection of how the threshold should be evaluated. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdType? UpdateStrategyThresholdType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)Property).UpdateStrategyThresholdType; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)Property).UpdateStrategyThresholdType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdType)""); } - - /// The numeric threshold value. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public long? UpdateStrategyThresholdValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)Property).UpdateStrategyThresholdValue; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)Property).UpdateStrategyThresholdValue = value ?? default(long); } - - /// The mode of operation for runtime protection. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterUpdateStrategyType? UpdateStrategyType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)Property).UpdateStrategyType; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)Property).UpdateStrategyType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterUpdateStrategyType)""); } - - /// The time to wait between the increments of update defined by the strategy. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public long? UpdateStrategyWaitTimeMinute { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)Property).UpdateStrategyWaitTimeMinute; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)Property).UpdateStrategyWaitTimeMinute = value ?? default(long); } - - /// The current runtime version of the cluster. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string Version { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)Property).ClusterVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)Property).ClusterVersion = value ; } - - /// The mode selection for container vulnerability scanning. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VulnerabilityScanningSettingsContainerScan? VulnerabilityScanningSettingContainerScan { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)Property).VulnerabilityScanningSettingContainerScan; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)Property).VulnerabilityScanningSettingContainerScan = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VulnerabilityScanningSettingsContainerScan)""); } - - /// The list of workload resource IDs that are hosted within this cluster. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string[] WorkloadResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)Property).WorkloadResourceId; } - - /// Creates an new instance. - public Cluster() - { - - } - - /// Validates that this object meets the validation criteria. - /// an instance that will receive validation - /// events. - /// - /// A that will be complete when validation is completed. - /// - public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) - { - await eventListener.AssertNotNull(nameof(__trackedResource), __trackedResource); - await eventListener.AssertObjectIsValid(nameof(__trackedResource), __trackedResource); - } - } - /// Cluster represents the on-premises Network Cloud cluster. - public partial interface ICluster : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResource - { - /// - /// The zone name used for this rack when created. Availability zones are used for workload placement. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The zone name used for this rack when created. Availability zones are used for workload placement.", - SerializedName = @"availabilityZone", - PossibleTypes = new [] { typeof(string) })] - string AggregatorOrSingleRackDefinitionAvailabilityZone { get; set; } - /// The unordered list of bare metal machine configuration. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The unordered list of bare metal machine configuration.", - SerializedName = @"bareMetalMachineConfigurationData", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineConfigurationData) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineConfigurationData[] AggregatorOrSingleRackDefinitionBareMetalMachineConfigurationData { get; set; } - /// The resource ID of the network rack that matches this rack definition. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The resource ID of the network rack that matches this rack definition.", - SerializedName = @"networkRackId", - PossibleTypes = new [] { typeof(string) })] - string AggregatorOrSingleRackDefinitionNetworkRackId { get; set; } - /// The free-form description of the rack's location. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The free-form description of the rack's location.", - SerializedName = @"rackLocation", - PossibleTypes = new [] { typeof(string) })] - string AggregatorOrSingleRackDefinitionRackLocation { get; set; } - /// - /// The unique identifier for the rack within Network Cloud cluster. An alternate unique alphanumeric value other than a serial - /// number may be provided if desired. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The unique identifier for the rack within Network Cloud cluster. An alternate unique alphanumeric value other than a serial number may be provided if desired.", - SerializedName = @"rackSerialNumber", - PossibleTypes = new [] { typeof(string) })] - string AggregatorOrSingleRackDefinitionRackSerialNumber { get; set; } - /// The resource ID of the sku for the rack being added. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The resource ID of the sku for the rack being added.", - SerializedName = @"rackSkuId", - PossibleTypes = new [] { typeof(string) })] - string AggregatorOrSingleRackDefinitionRackSkuId { get; set; } - /// The list of storage appliance configuration data for this rack. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The list of storage appliance configuration data for this rack.", - SerializedName = @"storageApplianceConfigurationData", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceConfigurationData) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceConfigurationData[] AggregatorOrSingleRackDefinitionStorageApplianceConfigurationData { get; set; } - /// - /// The resource ID of the analytics workspace that is to be used by the specified identity. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The resource ID of the analytics workspace that is to be used by the specified identity.", - SerializedName = @"analyticsWorkspaceId", - PossibleTypes = new [] { typeof(string) })] - string AnalyticOutputSettingAnalyticsWorkspaceId { get; set; } - /// The type of managed identity that is being selected. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The type of managed identity that is being selected.", - SerializedName = @"identityType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType? AnalyticsOutputSettingsAssociatedIdentityType { get; set; } - /// - /// The user assigned managed identity resource ID to use. Mutually exclusive with a system assigned identity type. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The user assigned managed identity resource ID to use. Mutually exclusive with a system assigned identity type.", - SerializedName = @"userAssignedIdentityResourceId", - PossibleTypes = new [] { typeof(string) })] - string AnalyticsOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId { get; set; } - /// - /// Field Deprecated. The resource ID of the Log Analytics Workspace that will be used for storing relevant logs. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Field Deprecated. The resource ID of the Log Analytics Workspace that will be used for storing relevant logs.", - SerializedName = @"analyticsWorkspaceId", - PossibleTypes = new [] { typeof(string) })] - string AnalyticsWorkspaceId { get; set; } - /// The type of managed identity that is being selected. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The type of managed identity that is being selected.", - SerializedName = @"identityType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType? AssociatedIdentityType { get; set; } - /// - /// The user assigned managed identity resource ID to use. Mutually exclusive with a system assigned identity type. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The user assigned managed identity resource ID to use. Mutually exclusive with a system assigned identity type.", - SerializedName = @"userAssignedIdentityResourceId", - PossibleTypes = new [] { typeof(string) })] - string AssociatedIdentityUserAssignedIdentityResourceId { get; set; } - /// The list of cluster runtime version upgrades available for this cluster. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The list of cluster runtime version upgrades available for this cluster.", - SerializedName = @"availableUpgradeVersions", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterAvailableUpgradeVersion) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterAvailableUpgradeVersion[] AvailableUpgradeVersion { get; } - /// - /// The remaining appliance-based storage in GB available for workload use. Measured in gibibytes. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The remaining appliance-based storage in GB available for workload use. Measured in gibibytes.", - SerializedName = @"availableApplianceStorageGB", - PossibleTypes = new [] { typeof(long) })] - long? CapacityAvailableApplianceStorageGb { get; set; } - /// - /// The remaining number of cores that are available in this cluster for workload use. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The remaining number of cores that are available in this cluster for workload use.", - SerializedName = @"availableCoreCount", - PossibleTypes = new [] { typeof(long) })] - long? CapacityAvailableCoreCount { get; set; } - /// - /// The remaining machine or host-based storage in GB available for workload use. Measured in gibibytes. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The remaining machine or host-based storage in GB available for workload use. Measured in gibibytes.", - SerializedName = @"availableHostStorageGB", - PossibleTypes = new [] { typeof(long) })] - long? CapacityAvailableHostStorageGb { get; set; } - /// - /// The remaining memory in GB that are available in this cluster for workload use. Measured in gibibytes. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The remaining memory in GB that are available in this cluster for workload use. Measured in gibibytes.", - SerializedName = @"availableMemoryGB", - PossibleTypes = new [] { typeof(long) })] - long? CapacityAvailableMemoryGb { get; set; } - /// - /// The total appliance-based storage in GB supported by this cluster for workload use. Measured in gibibytes. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The total appliance-based storage in GB supported by this cluster for workload use. Measured in gibibytes.", - SerializedName = @"totalApplianceStorageGB", - PossibleTypes = new [] { typeof(long) })] - long? CapacityTotalApplianceStorageGb { get; set; } - /// The total number of cores that are supported by this cluster for workload use. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The total number of cores that are supported by this cluster for workload use.", - SerializedName = @"totalCoreCount", - PossibleTypes = new [] { typeof(long) })] - long? CapacityTotalCoreCount { get; set; } - /// - /// The total machine or host-based storage in GB supported by this cluster for workload use. Measured in gibibytes. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The total machine or host-based storage in GB supported by this cluster for workload use. Measured in gibibytes.", - SerializedName = @"totalHostStorageGB", - PossibleTypes = new [] { typeof(long) })] - long? CapacityTotalHostStorageGb { get; set; } - /// - /// The total memory supported by this cluster for workload use. Measured in gibibytes. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The total memory supported by this cluster for workload use. Measured in gibibytes.", - SerializedName = @"totalMemoryGB", - PossibleTypes = new [] { typeof(long) })] - long? CapacityTotalMemoryGb { get; set; } - /// The resource ID of the extended location on which the resource will be created. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The resource ID of the extended location on which the resource will be created.", - SerializedName = @"name", - PossibleTypes = new [] { typeof(string) })] - string ClusterExtendedLocationName { get; set; } - /// The extended location type, for example, CustomLocation. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The extended location type, for example, CustomLocation.", - SerializedName = @"type", - PossibleTypes = new [] { typeof(string) })] - string ClusterExtendedLocationType { get; set; } - /// - /// The customer-provided location information to identify where the cluster resides. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The customer-provided location information to identify where the cluster resides.", - SerializedName = @"clusterLocation", - PossibleTypes = new [] { typeof(string) })] - string ClusterLocation { get; set; } - /// The type of rack configuration for the cluster. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The type of rack configuration for the cluster.", - SerializedName = @"clusterType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterType) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterType ClusterType { get; set; } - /// - /// The URL of the storage account container that is to be used by the specified identities. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The URL of the storage account container that is to be used by the specified identities.", - SerializedName = @"containerUrl", - PossibleTypes = new [] { typeof(string) })] - string CommandOutputSettingContainerUrl { get; set; } - /// Selection of how the type evaluation is applied to the cluster calculation. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Selection of how the type evaluation is applied to the cluster calculation.", - SerializedName = @"grouping", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdGrouping) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdGrouping? ComputeDeploymentThresholdGrouping { get; set; } - /// Selection of how the threshold should be evaluated. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Selection of how the threshold should be evaluated.", - SerializedName = @"type", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdType) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdType? ComputeDeploymentThresholdType { get; set; } - /// The numeric threshold value. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The numeric threshold value.", - SerializedName = @"value", - PossibleTypes = new [] { typeof(long) })] - long? ComputeDeploymentThresholdValue { get; set; } - /// - /// The list of rack definitions for the compute racks in a multi-rack - /// cluster, or an empty list in a single-rack cluster. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The list of rack definitions for the compute racks in a multi-rack - cluster, or an empty list in a single-rack cluster.", - SerializedName = @"computeRackDefinitions", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackDefinition) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackDefinition[] ComputeRackDefinition { get; set; } - /// The latest heartbeat status between the cluster manager and the cluster. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The latest heartbeat status between the cluster manager and the cluster.", - SerializedName = @"clusterConnectionStatus", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterConnectionStatus) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterConnectionStatus? ConnectionStatus { get; } - /// The current detailed status of the cluster. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The current detailed status of the cluster.", - SerializedName = @"detailedStatus", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterDetailedStatus) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterDetailedStatus? DetailedStatus { get; } - /// The descriptive message about the detailed status. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The descriptive message about the detailed status.", - SerializedName = @"detailedStatusMessage", - PossibleTypes = new [] { typeof(string) })] - string DetailedStatusMessage { get; } - /// Resource ETag. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"Resource ETag.", - SerializedName = @"etag", - PossibleTypes = new [] { typeof(string) })] - string Etag { get; } - /// The resource ID of the extended location on which the resource will be created. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The resource ID of the extended location on which the resource will be created.", - SerializedName = @"name", - PossibleTypes = new [] { typeof(string) })] - string ExtendedLocationName { get; set; } - /// The extended location type, for example, CustomLocation. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The extended location type, for example, CustomLocation.", - SerializedName = @"type", - PossibleTypes = new [] { typeof(string) })] - string ExtendedLocationType { get; set; } - /// The resource ID of the extended location on which the resource will be created. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The resource ID of the extended location on which the resource will be created.", - SerializedName = @"name", - PossibleTypes = new [] { typeof(string) })] - string HybridAkExtendedLocationName { get; set; } - /// The extended location type, for example, CustomLocation. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The extended location type, for example, CustomLocation.", - SerializedName = @"type", - PossibleTypes = new [] { typeof(string) })] - string HybridAkExtendedLocationType { get; set; } - /// - /// The service principal ID of the system assigned identity. This property will only be provided for a system assigned identity. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - 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) })] - string IdentityPrincipalId { get; } - /// - /// The tenant ID of the system assigned identity. This property will only be provided for a system assigned identity. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - 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) })] - string IdentityTenantId { get; } - /// - /// Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Support.ManagedServiceIdentityType) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentityType? 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.NetworkCloud.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.NetworkCloud.Models.Api50.IUserAssignedIdentities) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IUserAssignedIdentities IdentityUserAssignedIdentity { get; set; } - /// - /// The location of the managed resource group. If not specified, the location of the parent resource is chosen. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The location of the managed resource group. If not specified, the location of the parent resource is chosen.", - SerializedName = @"location", - PossibleTypes = new [] { typeof(string) })] - string ManagedResourceGroupConfigurationLocation { get; set; } - /// - /// The name for the managed resource group. If not specified, the unique name is automatically generated. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The name for the managed resource group. If not specified, the unique name is automatically generated.", - SerializedName = @"name", - PossibleTypes = new [] { typeof(string) })] - string ManagedResourceGroupConfigurationName { get; set; } - /// The latest connectivity status between cluster manager and the cluster. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The latest connectivity status between cluster manager and the cluster.", - SerializedName = @"clusterManagerConnectionStatus", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterManagerConnectionStatus) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterManagerConnectionStatus? ManagerConnectionStatus { get; } - /// - /// The resource ID of the cluster manager that manages this cluster. This is set by the Cluster Manager when the cluster - /// is created. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The resource ID of the cluster manager that manages this cluster. This is set by the Cluster Manager when the cluster is created.", - SerializedName = @"clusterManagerId", - PossibleTypes = new [] { typeof(string) })] - string ManagerId { get; } - /// The count of Manual Action Taken (MAT) events that have not been validated. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The count of Manual Action Taken (MAT) events that have not been validated.", - SerializedName = @"manualActionCount", - PossibleTypes = new [] { typeof(long) })] - long? ManualActionCount { get; } - /// The resource ID of the Network Fabric associated with the cluster. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The resource ID of the Network Fabric associated with the cluster.", - SerializedName = @"networkFabricId", - PossibleTypes = new [] { typeof(string) })] - string NetworkFabricId { get; set; } - /// The provisioning state of the cluster. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The provisioning state of the cluster.", - SerializedName = @"provisioningState", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterProvisioningState) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterProvisioningState? ProvisioningState { get; } - /// The mode of operation for runtime protection. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The mode of operation for runtime protection.", - SerializedName = @"enforcementLevel", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RuntimeProtectionEnforcementLevel) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RuntimeProtectionEnforcementLevel? RuntimeProtectionConfigurationEnforcementLevel { get; set; } - /// The resource ID of the key vault to archive the secrets of the cluster. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The resource ID of the key vault to archive the secrets of the cluster.", - SerializedName = @"keyVaultId", - PossibleTypes = new [] { typeof(string) })] - string SecretArchiveKeyVaultId { get; set; } - /// The URI for the key vault used as the secret archive. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The URI for the key vault used as the secret archive.", - SerializedName = @"vaultUri", - PossibleTypes = new [] { typeof(string) })] - string SecretArchiveSettingVaultUri { get; set; } - /// The type of managed identity that is being selected. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The type of managed identity that is being selected.", - SerializedName = @"identityType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType? SecretArchiveSettingsAssociatedIdentityType { get; set; } - /// - /// The user assigned managed identity resource ID to use. Mutually exclusive with a system assigned identity type. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The user assigned managed identity resource ID to use. Mutually exclusive with a system assigned identity type.", - SerializedName = @"userAssignedIdentityResourceId", - PossibleTypes = new [] { typeof(string) })] - string SecretArchiveSettingsAssociatedIdentityUserAssignedIdentityResourceId { get; set; } - /// - /// The indicator if the specified key vault should be used to archive the secrets of the cluster. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The indicator if the specified key vault should be used to archive the secrets of the cluster.", - SerializedName = @"useKeyVault", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterSecretArchiveEnabled) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterSecretArchiveEnabled? SecretArchiveUseKeyVault { get; set; } - /// The application ID, also known as client ID, of the service principal. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The application ID, also known as client ID, of the service principal.", - SerializedName = @"applicationId", - PossibleTypes = new [] { typeof(string) })] - string ServicePrincipalApplicationId { get; set; } - /// The principal ID, also known as the object ID, of the service principal. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The principal ID, also known as the object ID, of the service principal.", - SerializedName = @"principalId", - PossibleTypes = new [] { typeof(string) })] - string ServicePrincipalId { get; set; } - /// The password of the service principal. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The password of the service principal.", - SerializedName = @"password", - PossibleTypes = new [] { typeof(System.Security.SecureString) })] - System.Security.SecureString ServicePrincipalPassword { get; set; } - /// - /// The tenant ID, also known as the directory ID, of the tenant in which the service principal is created. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The tenant ID, also known as the directory ID, of the tenant in which the service principal is created.", - SerializedName = @"tenantId", - PossibleTypes = new [] { typeof(string) })] - string ServicePrincipalTenantId { get; set; } - /// The support end date of the runtime version of the cluster. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The support end date of the runtime version of the cluster.", - SerializedName = @"supportExpiryDate", - PossibleTypes = new [] { typeof(string) })] - string SupportExpiryDate { get; } - /// - /// The maximum number of worker nodes that can be offline within the increment of update, e.g., rack-by-rack. - /// Limited by the maximum number of machines in the increment. Defaults to the whole increment size. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The maximum number of worker nodes that can be offline within the increment of update, e.g., rack-by-rack. - Limited by the maximum number of machines in the increment. Defaults to the whole increment size.", - SerializedName = @"maxUnavailable", - PossibleTypes = new [] { typeof(long) })] - long? UpdateStrategyMaxUnavailable { get; set; } - /// Selection of how the threshold should be evaluated. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Selection of how the threshold should be evaluated.", - SerializedName = @"thresholdType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdType) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdType? UpdateStrategyThresholdType { get; set; } - /// The numeric threshold value. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The numeric threshold value.", - SerializedName = @"thresholdValue", - PossibleTypes = new [] { typeof(long) })] - long? UpdateStrategyThresholdValue { get; set; } - /// The mode of operation for runtime protection. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The mode of operation for runtime protection.", - SerializedName = @"strategyType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterUpdateStrategyType) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterUpdateStrategyType? UpdateStrategyType { get; set; } - /// The time to wait between the increments of update defined by the strategy. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The time to wait between the increments of update defined by the strategy.", - SerializedName = @"waitTimeMinutes", - PossibleTypes = new [] { typeof(long) })] - long? UpdateStrategyWaitTimeMinute { get; set; } - /// The current runtime version of the cluster. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The current runtime version of the cluster.", - SerializedName = @"clusterVersion", - PossibleTypes = new [] { typeof(string) })] - string Version { get; set; } - /// The mode selection for container vulnerability scanning. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The mode selection for container vulnerability scanning.", - SerializedName = @"containerScan", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VulnerabilityScanningSettingsContainerScan) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VulnerabilityScanningSettingsContainerScan? VulnerabilityScanningSettingContainerScan { get; set; } - /// The list of workload resource IDs that are hosted within this cluster. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The list of workload resource IDs that are hosted within this cluster.", - SerializedName = @"workloadResourceIds", - PossibleTypes = new [] { typeof(string) })] - string[] WorkloadResourceId { get; } - - } - /// Cluster represents the on-premises Network Cloud cluster. - internal partial interface IClusterInternal : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal - { - /// - /// The rack definition that is intended to reflect only a single rack in a single rack cluster, or an aggregator rack in - /// a multi-rack cluster. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackDefinition AggregatorOrSingleRackDefinition { get; set; } - /// - /// The zone name used for this rack when created. Availability zones are used for workload placement. - /// - string AggregatorOrSingleRackDefinitionAvailabilityZone { get; set; } - /// The unordered list of bare metal machine configuration. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineConfigurationData[] AggregatorOrSingleRackDefinitionBareMetalMachineConfigurationData { get; set; } - /// The resource ID of the network rack that matches this rack definition. - string AggregatorOrSingleRackDefinitionNetworkRackId { get; set; } - /// The free-form description of the rack's location. - string AggregatorOrSingleRackDefinitionRackLocation { get; set; } - /// - /// The unique identifier for the rack within Network Cloud cluster. An alternate unique alphanumeric value other than a serial - /// number may be provided if desired. - /// - string AggregatorOrSingleRackDefinitionRackSerialNumber { get; set; } - /// The resource ID of the sku for the rack being added. - string AggregatorOrSingleRackDefinitionRackSkuId { get; set; } - /// The list of storage appliance configuration data for this rack. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceConfigurationData[] AggregatorOrSingleRackDefinitionStorageApplianceConfigurationData { get; set; } - /// - /// The resource ID of the analytics workspace that is to be used by the specified identity. - /// - string AnalyticOutputSettingAnalyticsWorkspaceId { get; set; } - /// - /// The selection of the managed identity to use with this analytics workspace. The identity type must be either system assigned - /// or user assigned. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIdentitySelector AnalyticOutputSettingAssociatedIdentity { get; set; } - /// - /// The settings for the log analytics workspace used for output of logs from this cluster. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAnalyticsOutputSettings AnalyticsOutputSetting { get; set; } - /// The type of managed identity that is being selected. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType? AnalyticsOutputSettingsAssociatedIdentityType { get; set; } - /// - /// The user assigned managed identity resource ID to use. Mutually exclusive with a system assigned identity type. - /// - string AnalyticsOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId { get; set; } - /// - /// Field Deprecated. The resource ID of the Log Analytics Workspace that will be used for storing relevant logs. - /// - string AnalyticsWorkspaceId { get; set; } - /// The type of managed identity that is being selected. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType? AssociatedIdentityType { get; set; } - /// - /// The user assigned managed identity resource ID to use. Mutually exclusive with a system assigned identity type. - /// - string AssociatedIdentityUserAssignedIdentityResourceId { get; set; } - /// The list of cluster runtime version upgrades available for this cluster. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterAvailableUpgradeVersion[] AvailableUpgradeVersion { get; set; } - /// The capacity supported by this cluster. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterCapacity Capacity { get; set; } - /// - /// The remaining appliance-based storage in GB available for workload use. Measured in gibibytes. - /// - long? CapacityAvailableApplianceStorageGb { get; set; } - /// - /// The remaining number of cores that are available in this cluster for workload use. - /// - long? CapacityAvailableCoreCount { get; set; } - /// - /// The remaining machine or host-based storage in GB available for workload use. Measured in gibibytes. - /// - long? CapacityAvailableHostStorageGb { get; set; } - /// - /// The remaining memory in GB that are available in this cluster for workload use. Measured in gibibytes. - /// - long? CapacityAvailableMemoryGb { get; set; } - /// - /// The total appliance-based storage in GB supported by this cluster for workload use. Measured in gibibytes. - /// - long? CapacityTotalApplianceStorageGb { get; set; } - /// The total number of cores that are supported by this cluster for workload use. - long? CapacityTotalCoreCount { get; set; } - /// - /// The total machine or host-based storage in GB supported by this cluster for workload use. Measured in gibibytes. - /// - long? CapacityTotalHostStorageGb { get; set; } - /// - /// The total memory supported by this cluster for workload use. Measured in gibibytes. - /// - long? CapacityTotalMemoryGb { get; set; } - /// - /// The extended location (custom location) that represents the cluster's control plane location. This extended location is - /// used to route the requests of child objects of the cluster that are handled by the platform operator. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocation ClusterExtendedLocation { get; set; } - /// The resource ID of the extended location on which the resource will be created. - string ClusterExtendedLocationName { get; set; } - /// The extended location type, for example, CustomLocation. - string ClusterExtendedLocationType { get; set; } - /// - /// The customer-provided location information to identify where the cluster resides. - /// - string ClusterLocation { get; set; } - /// The type of rack configuration for the cluster. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterType ClusterType { get; set; } - /// - /// The settings for commands run in this cluster, such as bare metal machine run read only commands and data extracts. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICommandOutputSettings CommandOutputSetting { get; set; } - /// - /// The selection of the managed identity to use with this storage account container. The identity type must be either system - /// assigned or user assigned. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIdentitySelector CommandOutputSettingAssociatedIdentity { get; set; } - /// - /// The URL of the storage account container that is to be used by the specified identities. - /// - string CommandOutputSettingContainerUrl { get; set; } - /// - /// The validation threshold indicating the allowable failures of compute machines during environment validation and deployment. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IValidationThreshold ComputeDeploymentThreshold { get; set; } - /// Selection of how the type evaluation is applied to the cluster calculation. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdGrouping? ComputeDeploymentThresholdGrouping { get; set; } - /// Selection of how the threshold should be evaluated. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdType? ComputeDeploymentThresholdType { get; set; } - /// The numeric threshold value. - long? ComputeDeploymentThresholdValue { get; set; } - /// - /// The list of rack definitions for the compute racks in a multi-rack - /// cluster, or an empty list in a single-rack cluster. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackDefinition[] ComputeRackDefinition { get; set; } - /// The latest heartbeat status between the cluster manager and the cluster. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterConnectionStatus? ConnectionStatus { get; set; } - /// The current detailed status of the cluster. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterDetailedStatus? DetailedStatus { get; set; } - /// The descriptive message about the detailed status. - string DetailedStatusMessage { get; set; } - /// Resource ETag. - string Etag { get; set; } - /// The extended location of the cluster manager associated with the cluster. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocation ExtendedLocation { get; set; } - /// The resource ID of the extended location on which the resource will be created. - string ExtendedLocationName { get; set; } - /// The extended location type, for example, CustomLocation. - string ExtendedLocationType { get; set; } - /// The resource ID of the extended location on which the resource will be created. - string HybridAkExtendedLocationName { get; set; } - /// The extended location type, for example, CustomLocation. - string HybridAkExtendedLocationType { get; set; } - /// - /// Field Deprecated. This field will not be populated in an upcoming version. The extended location (custom location) that - /// represents the Hybrid AKS control plane location. This extended location is used when creating provisioned clusters (Hybrid - /// AKS clusters). - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocation HybridAksExtendedLocation { get; set; } - /// The identity for the resource. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IManagedServiceIdentity Identity { get; set; } - /// - /// The service principal ID of the system assigned identity. This property will only be provided for a system assigned identity. - /// - string IdentityPrincipalId { get; set; } - /// - /// The tenant ID of the system assigned identity. This property will only be provided for a system assigned identity. - /// - string IdentityTenantId { get; set; } - /// - /// Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentityType? 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.NetworkCloud.Models.Api50.IUserAssignedIdentities IdentityUserAssignedIdentity { get; set; } - /// The configuration of the managed resource group associated with the resource. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IManagedResourceGroupConfiguration ManagedResourceGroupConfiguration { get; set; } - /// - /// The location of the managed resource group. If not specified, the location of the parent resource is chosen. - /// - string ManagedResourceGroupConfigurationLocation { get; set; } - /// - /// The name for the managed resource group. If not specified, the unique name is automatically generated. - /// - string ManagedResourceGroupConfigurationName { get; set; } - /// The latest connectivity status between cluster manager and the cluster. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterManagerConnectionStatus? ManagerConnectionStatus { get; set; } - /// - /// The resource ID of the cluster manager that manages this cluster. This is set by the Cluster Manager when the cluster - /// is created. - /// - string ManagerId { get; set; } - /// The count of Manual Action Taken (MAT) events that have not been validated. - long? ManualActionCount { get; set; } - /// The resource ID of the Network Fabric associated with the cluster. - string NetworkFabricId { get; set; } - /// The list of the resource properties. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterProperties Property { get; set; } - /// The provisioning state of the cluster. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterProvisioningState? ProvisioningState { get; set; } - /// The settings for cluster runtime protection. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRuntimeProtectionConfiguration RuntimeProtectionConfiguration { get; set; } - /// The mode of operation for runtime protection. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RuntimeProtectionEnforcementLevel? RuntimeProtectionConfigurationEnforcementLevel { get; set; } - /// - /// The configuration for use of a key vault to store secrets for later retrieval by the operator. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterSecretArchive SecretArchive { get; set; } - /// The resource ID of the key vault to archive the secrets of the cluster. - string SecretArchiveKeyVaultId { get; set; } - /// The settings for the secret archive used to hold credentials for the cluster. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretArchiveSettings SecretArchiveSetting { get; set; } - /// - /// The selection of the managed identity to use with this vault URI. The identity type must be either system assigned or - /// user assigned. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIdentitySelector SecretArchiveSettingAssociatedIdentity { get; set; } - /// The URI for the key vault used as the secret archive. - string SecretArchiveSettingVaultUri { get; set; } - /// The type of managed identity that is being selected. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType? SecretArchiveSettingsAssociatedIdentityType { get; set; } - /// - /// The user assigned managed identity resource ID to use. Mutually exclusive with a system assigned identity type. - /// - string SecretArchiveSettingsAssociatedIdentityUserAssignedIdentityResourceId { get; set; } - /// - /// The indicator if the specified key vault should be used to archive the secrets of the cluster. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterSecretArchiveEnabled? SecretArchiveUseKeyVault { get; set; } - /// - /// The service principal to be used by the cluster during Arc Appliance installation. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IServicePrincipalInformation ServicePrincipal { get; set; } - /// The application ID, also known as client ID, of the service principal. - string ServicePrincipalApplicationId { get; set; } - /// The principal ID, also known as the object ID, of the service principal. - string ServicePrincipalId { get; set; } - /// The password of the service principal. - System.Security.SecureString ServicePrincipalPassword { get; set; } - /// - /// The tenant ID, also known as the directory ID, of the tenant in which the service principal is created. - /// - string ServicePrincipalTenantId { get; set; } - /// The support end date of the runtime version of the cluster. - string SupportExpiryDate { get; set; } - /// The strategy for updating the cluster. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterUpdateStrategy UpdateStrategy { get; set; } - /// - /// The maximum number of worker nodes that can be offline within the increment of update, e.g., rack-by-rack. - /// Limited by the maximum number of machines in the increment. Defaults to the whole increment size. - /// - long? UpdateStrategyMaxUnavailable { get; set; } - /// Selection of how the threshold should be evaluated. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdType? UpdateStrategyThresholdType { get; set; } - /// The numeric threshold value. - long? UpdateStrategyThresholdValue { get; set; } - /// The mode of operation for runtime protection. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterUpdateStrategyType? UpdateStrategyType { get; set; } - /// The time to wait between the increments of update defined by the strategy. - long? UpdateStrategyWaitTimeMinute { get; set; } - /// The current runtime version of the cluster. - string Version { get; set; } - /// The settings for how security vulnerability scanning is applied to the cluster. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVulnerabilityScanningSettings VulnerabilityScanningSetting { get; set; } - /// The mode selection for container vulnerability scanning. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VulnerabilityScanningSettingsContainerScan? VulnerabilityScanningSettingContainerScan { get; set; } - /// The list of workload resource IDs that are hosted within this cluster. - string[] WorkloadResourceId { get; set; } - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterAvailableUpgradeVersion.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterAvailableUpgradeVersion.PowerShell.cs deleted file mode 100644 index 2c5cb404b4a9..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterAvailableUpgradeVersion.PowerShell.cs +++ /dev/null @@ -1,208 +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.NetworkCloud.Models.Api20250201 -{ - using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; - - /// - /// ClusterAvailableUpgradeVersion represents the various cluster upgrade parameters. - /// - [System.ComponentModel.TypeConverter(typeof(ClusterAvailableUpgradeVersionTypeConverter))] - public partial class ClusterAvailableUpgradeVersion - { - - /// - /// 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 ClusterAvailableUpgradeVersion(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("ControlImpact")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterAvailableUpgradeVersionInternal)this).ControlImpact = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ControlImpact?) content.GetValueForProperty("ControlImpact",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterAvailableUpgradeVersionInternal)this).ControlImpact, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ControlImpact.CreateFrom); - } - if (content.Contains("ExpectedDuration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterAvailableUpgradeVersionInternal)this).ExpectedDuration = (string) content.GetValueForProperty("ExpectedDuration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterAvailableUpgradeVersionInternal)this).ExpectedDuration, global::System.Convert.ToString); - } - if (content.Contains("ImpactDescription")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterAvailableUpgradeVersionInternal)this).ImpactDescription = (string) content.GetValueForProperty("ImpactDescription",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterAvailableUpgradeVersionInternal)this).ImpactDescription, global::System.Convert.ToString); - } - if (content.Contains("SupportExpiryDate")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterAvailableUpgradeVersionInternal)this).SupportExpiryDate = (string) content.GetValueForProperty("SupportExpiryDate",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterAvailableUpgradeVersionInternal)this).SupportExpiryDate, global::System.Convert.ToString); - } - if (content.Contains("TargetClusterVersion")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterAvailableUpgradeVersionInternal)this).TargetClusterVersion = (string) content.GetValueForProperty("TargetClusterVersion",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterAvailableUpgradeVersionInternal)this).TargetClusterVersion, global::System.Convert.ToString); - } - if (content.Contains("WorkloadImpact")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterAvailableUpgradeVersionInternal)this).WorkloadImpact = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.WorkloadImpact?) content.GetValueForProperty("WorkloadImpact",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterAvailableUpgradeVersionInternal)this).WorkloadImpact, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.WorkloadImpact.CreateFrom); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal ClusterAvailableUpgradeVersion(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("ControlImpact")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterAvailableUpgradeVersionInternal)this).ControlImpact = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ControlImpact?) content.GetValueForProperty("ControlImpact",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterAvailableUpgradeVersionInternal)this).ControlImpact, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ControlImpact.CreateFrom); - } - if (content.Contains("ExpectedDuration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterAvailableUpgradeVersionInternal)this).ExpectedDuration = (string) content.GetValueForProperty("ExpectedDuration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterAvailableUpgradeVersionInternal)this).ExpectedDuration, global::System.Convert.ToString); - } - if (content.Contains("ImpactDescription")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterAvailableUpgradeVersionInternal)this).ImpactDescription = (string) content.GetValueForProperty("ImpactDescription",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterAvailableUpgradeVersionInternal)this).ImpactDescription, global::System.Convert.ToString); - } - if (content.Contains("SupportExpiryDate")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterAvailableUpgradeVersionInternal)this).SupportExpiryDate = (string) content.GetValueForProperty("SupportExpiryDate",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterAvailableUpgradeVersionInternal)this).SupportExpiryDate, global::System.Convert.ToString); - } - if (content.Contains("TargetClusterVersion")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterAvailableUpgradeVersionInternal)this).TargetClusterVersion = (string) content.GetValueForProperty("TargetClusterVersion",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterAvailableUpgradeVersionInternal)this).TargetClusterVersion, global::System.Convert.ToString); - } - if (content.Contains("WorkloadImpact")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterAvailableUpgradeVersionInternal)this).WorkloadImpact = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.WorkloadImpact?) content.GetValueForProperty("WorkloadImpact",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterAvailableUpgradeVersionInternal)this).WorkloadImpact, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.WorkloadImpact.CreateFrom); - } - AfterDeserializePSObject(content); - } - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterAvailableUpgradeVersion DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new ClusterAvailableUpgradeVersion(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.NetworkCloud.Models.Api20250201.IClusterAvailableUpgradeVersion DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new ClusterAvailableUpgradeVersion(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.NetworkCloud.Models.Api20250201.IClusterAvailableUpgradeVersion FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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(); - } - } - /// ClusterAvailableUpgradeVersion represents the various cluster upgrade parameters. - [System.ComponentModel.TypeConverter(typeof(ClusterAvailableUpgradeVersionTypeConverter))] - public partial interface IClusterAvailableUpgradeVersion - - { - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterCapacity.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterCapacity.PowerShell.cs deleted file mode 100644 index 0d7dbbebb085..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterCapacity.PowerShell.cs +++ /dev/null @@ -1,220 +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.NetworkCloud.Models.Api20250201 -{ - using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; - - /// ClusterCapacity represents various details regarding compute capacity. - [System.ComponentModel.TypeConverter(typeof(ClusterCapacityTypeConverter))] - public partial class ClusterCapacity - { - - /// - /// 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 ClusterCapacity(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("AvailableApplianceStorageGb")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterCapacityInternal)this).AvailableApplianceStorageGb = (long?) content.GetValueForProperty("AvailableApplianceStorageGb",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterCapacityInternal)this).AvailableApplianceStorageGb, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("AvailableCoreCount")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterCapacityInternal)this).AvailableCoreCount = (long?) content.GetValueForProperty("AvailableCoreCount",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterCapacityInternal)this).AvailableCoreCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("AvailableHostStorageGb")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterCapacityInternal)this).AvailableHostStorageGb = (long?) content.GetValueForProperty("AvailableHostStorageGb",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterCapacityInternal)this).AvailableHostStorageGb, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("AvailableMemoryGb")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterCapacityInternal)this).AvailableMemoryGb = (long?) content.GetValueForProperty("AvailableMemoryGb",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterCapacityInternal)this).AvailableMemoryGb, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("TotalApplianceStorageGb")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterCapacityInternal)this).TotalApplianceStorageGb = (long?) content.GetValueForProperty("TotalApplianceStorageGb",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterCapacityInternal)this).TotalApplianceStorageGb, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("TotalCoreCount")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterCapacityInternal)this).TotalCoreCount = (long?) content.GetValueForProperty("TotalCoreCount",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterCapacityInternal)this).TotalCoreCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("TotalHostStorageGb")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterCapacityInternal)this).TotalHostStorageGb = (long?) content.GetValueForProperty("TotalHostStorageGb",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterCapacityInternal)this).TotalHostStorageGb, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("TotalMemoryGb")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterCapacityInternal)this).TotalMemoryGb = (long?) content.GetValueForProperty("TotalMemoryGb",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterCapacityInternal)this).TotalMemoryGb, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal ClusterCapacity(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("AvailableApplianceStorageGb")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterCapacityInternal)this).AvailableApplianceStorageGb = (long?) content.GetValueForProperty("AvailableApplianceStorageGb",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterCapacityInternal)this).AvailableApplianceStorageGb, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("AvailableCoreCount")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterCapacityInternal)this).AvailableCoreCount = (long?) content.GetValueForProperty("AvailableCoreCount",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterCapacityInternal)this).AvailableCoreCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("AvailableHostStorageGb")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterCapacityInternal)this).AvailableHostStorageGb = (long?) content.GetValueForProperty("AvailableHostStorageGb",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterCapacityInternal)this).AvailableHostStorageGb, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("AvailableMemoryGb")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterCapacityInternal)this).AvailableMemoryGb = (long?) content.GetValueForProperty("AvailableMemoryGb",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterCapacityInternal)this).AvailableMemoryGb, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("TotalApplianceStorageGb")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterCapacityInternal)this).TotalApplianceStorageGb = (long?) content.GetValueForProperty("TotalApplianceStorageGb",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterCapacityInternal)this).TotalApplianceStorageGb, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("TotalCoreCount")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterCapacityInternal)this).TotalCoreCount = (long?) content.GetValueForProperty("TotalCoreCount",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterCapacityInternal)this).TotalCoreCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("TotalHostStorageGb")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterCapacityInternal)this).TotalHostStorageGb = (long?) content.GetValueForProperty("TotalHostStorageGb",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterCapacityInternal)this).TotalHostStorageGb, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("TotalMemoryGb")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterCapacityInternal)this).TotalMemoryGb = (long?) content.GetValueForProperty("TotalMemoryGb",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterCapacityInternal)this).TotalMemoryGb, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - 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.NetworkCloud.Models.Api20250201.IClusterCapacity DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new ClusterCapacity(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.NetworkCloud.Models.Api20250201.IClusterCapacity DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new ClusterCapacity(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.NetworkCloud.Models.Api20250201.IClusterCapacity FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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(); - } - } - /// ClusterCapacity represents various details regarding compute capacity. - [System.ComponentModel.TypeConverter(typeof(ClusterCapacityTypeConverter))] - public partial interface IClusterCapacity - - { - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterContinueUpdateVersionParameters.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterContinueUpdateVersionParameters.cs deleted file mode 100644 index f3a110332b29..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterContinueUpdateVersionParameters.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.NetworkCloud.Models.Api20250201 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; - - /// - /// ClusterContinueUpdateVersionParameters represents the body of the request to continue the update of a cluster version. - /// - public partial class ClusterContinueUpdateVersionParameters : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterContinueUpdateVersionParameters, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterContinueUpdateVersionParametersInternal - { - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterContinueUpdateVersionMachineGroupTargetingMode? _machineGroupTargetingMode; - - /// - /// The mode by which the cluster will target the next grouping of servers to continue the update. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterContinueUpdateVersionMachineGroupTargetingMode? MachineGroupTargetingMode { get => this._machineGroupTargetingMode; set => this._machineGroupTargetingMode = value; } - - /// Creates an new instance. - public ClusterContinueUpdateVersionParameters() - { - - } - } - /// ClusterContinueUpdateVersionParameters represents the body of the request to continue the update of a cluster version. - public partial interface IClusterContinueUpdateVersionParameters : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable - { - /// - /// The mode by which the cluster will target the next grouping of servers to continue the update. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The mode by which the cluster will target the next grouping of servers to continue the update.", - SerializedName = @"machineGroupTargetingMode", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterContinueUpdateVersionMachineGroupTargetingMode) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterContinueUpdateVersionMachineGroupTargetingMode? MachineGroupTargetingMode { get; set; } - - } - /// ClusterContinueUpdateVersionParameters represents the body of the request to continue the update of a cluster version. - internal partial interface IClusterContinueUpdateVersionParametersInternal - - { - /// - /// The mode by which the cluster will target the next grouping of servers to continue the update. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterContinueUpdateVersionMachineGroupTargetingMode? MachineGroupTargetingMode { get; set; } - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterList.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterList.cs deleted file mode 100644 index 2c207d4352f8..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterList.cs +++ /dev/null @@ -1,68 +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.NetworkCloud.Models.Api20250201 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; - - /// ClusterList represents a list of clusters. - public partial class ClusterList : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterList, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterListInternal - { - - /// Backing field for property. - private string _nextLink; - - /// The link used to get the next page of operations. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string NextLink { get => this._nextLink; set => this._nextLink = value; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICluster[] _value; - - /// The list of clusters. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICluster[] Value { get => this._value; set => this._value = value; } - - /// Creates an new instance. - public ClusterList() - { - - } - } - /// ClusterList represents a list of clusters. - public partial interface IClusterList : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable - { - /// The link used to get the next page of operations. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The link used to get the next page of operations.", - SerializedName = @"nextLink", - PossibleTypes = new [] { typeof(string) })] - string NextLink { get; set; } - /// The list of clusters. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The list of clusters.", - SerializedName = @"value", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICluster) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICluster[] Value { get; set; } - - } - /// ClusterList represents a list of clusters. - internal partial interface IClusterListInternal - - { - /// The link used to get the next page of operations. - string NextLink { get; set; } - /// The list of clusters. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICluster[] Value { get; set; } - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterManager.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterManager.PowerShell.cs deleted file mode 100644 index 3ced6c5edcd8..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterManager.PowerShell.cs +++ /dev/null @@ -1,422 +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.NetworkCloud.Models.Api20250201 -{ - using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; - - /// - /// ClusterManager represents a control-plane to manage one or more on-premises clusters. - /// - [System.ComponentModel.TypeConverter(typeof(ClusterManagerTypeConverter))] - public partial class ClusterManager - { - - /// - /// 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 ClusterManager(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("Identity")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerInternal)this).Identity = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IManagedServiceIdentity) content.GetValueForProperty("Identity",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerInternal)this).Identity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ManagedServiceIdentityTypeConverter.ConvertFrom); - } - if (content.Contains("Property")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ClusterManagerPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Etag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerInternal)this).Etag, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)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("SystemDataCreatedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataLastModifiedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("SystemData")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.SystemDataTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Type, global::System.Convert.ToString); - } - if (content.Contains("Tag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.TrackedResourceTagsTypeConverter.ConvertFrom); - } - if (content.Contains("Location")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); - } - if (content.Contains("IdentityPrincipalId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerInternal)this).IdentityPrincipalId = (string) content.GetValueForProperty("IdentityPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerInternal)this).IdentityPrincipalId, global::System.Convert.ToString); - } - if (content.Contains("IdentityTenantId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerInternal)this).IdentityTenantId = (string) content.GetValueForProperty("IdentityTenantId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerInternal)this).IdentityTenantId, global::System.Convert.ToString); - } - if (content.Contains("IdentityType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerInternal)this).IdentityType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentityType) content.GetValueForProperty("IdentityType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerInternal)this).IdentityType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentityType.CreateFrom); - } - if (content.Contains("IdentityUserAssignedIdentity")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IUserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.UserAssignedIdentitiesTypeConverter.ConvertFrom); - } - if (content.Contains("ManagedResourceGroupConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerInternal)this).ManagedResourceGroupConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IManagedResourceGroupConfiguration) content.GetValueForProperty("ManagedResourceGroupConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerInternal)this).ManagedResourceGroupConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ManagedResourceGroupConfigurationTypeConverter.ConvertFrom); - } - if (content.Contains("ManagerExtendedLocation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerInternal)this).ManagerExtendedLocation = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocation) content.GetValueForProperty("ManagerExtendedLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerInternal)this).ManagerExtendedLocation, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ExtendedLocationTypeConverter.ConvertFrom); - } - if (content.Contains("AnalyticsWorkspaceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerInternal)this).AnalyticsWorkspaceId = (string) content.GetValueForProperty("AnalyticsWorkspaceId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerInternal)this).AnalyticsWorkspaceId, global::System.Convert.ToString); - } - if (content.Contains("AvailabilityZone")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerInternal)this).AvailabilityZone = (string[]) content.GetValueForProperty("AvailabilityZone",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerInternal)this).AvailabilityZone, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("ClusterVersion")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerInternal)this).ClusterVersion = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterAvailableVersion[]) content.GetValueForProperty("ClusterVersion",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerInternal)this).ClusterVersion, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ClusterAvailableVersionTypeConverter.ConvertFrom)); - } - if (content.Contains("DetailedStatus")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerInternal)this).DetailedStatus = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterManagerDetailedStatus?) content.GetValueForProperty("DetailedStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerInternal)this).DetailedStatus, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterManagerDetailedStatus.CreateFrom); - } - if (content.Contains("DetailedStatusMessage")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerInternal)this).DetailedStatusMessage = (string) content.GetValueForProperty("DetailedStatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerInternal)this).DetailedStatusMessage, global::System.Convert.ToString); - } - if (content.Contains("FabricControllerId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerInternal)this).FabricControllerId = (string) content.GetValueForProperty("FabricControllerId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerInternal)this).FabricControllerId, global::System.Convert.ToString); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterManagerProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterManagerProvisioningState.CreateFrom); - } - if (content.Contains("VMSize")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerInternal)this).VMSize = (string) content.GetValueForProperty("VMSize",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerInternal)this).VMSize, global::System.Convert.ToString); - } - if (content.Contains("ManagedResourceGroupConfigurationLocation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerInternal)this).ManagedResourceGroupConfigurationLocation = (string) content.GetValueForProperty("ManagedResourceGroupConfigurationLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerInternal)this).ManagedResourceGroupConfigurationLocation, global::System.Convert.ToString); - } - if (content.Contains("ManagedResourceGroupConfigurationName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerInternal)this).ManagedResourceGroupConfigurationName = (string) content.GetValueForProperty("ManagedResourceGroupConfigurationName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerInternal)this).ManagedResourceGroupConfigurationName, global::System.Convert.ToString); - } - if (content.Contains("ManagerExtendedLocationName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerInternal)this).ManagerExtendedLocationName = (string) content.GetValueForProperty("ManagerExtendedLocationName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerInternal)this).ManagerExtendedLocationName, global::System.Convert.ToString); - } - if (content.Contains("ManagerExtendedLocationType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerInternal)this).ManagerExtendedLocationType = (string) content.GetValueForProperty("ManagerExtendedLocationType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerInternal)this).ManagerExtendedLocationType, 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 ClusterManager(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("Identity")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerInternal)this).Identity = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IManagedServiceIdentity) content.GetValueForProperty("Identity",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerInternal)this).Identity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ManagedServiceIdentityTypeConverter.ConvertFrom); - } - if (content.Contains("Property")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ClusterManagerPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Etag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerInternal)this).Etag, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)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("SystemDataCreatedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataLastModifiedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("SystemData")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.SystemDataTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Type, global::System.Convert.ToString); - } - if (content.Contains("Tag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.TrackedResourceTagsTypeConverter.ConvertFrom); - } - if (content.Contains("Location")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); - } - if (content.Contains("IdentityPrincipalId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerInternal)this).IdentityPrincipalId = (string) content.GetValueForProperty("IdentityPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerInternal)this).IdentityPrincipalId, global::System.Convert.ToString); - } - if (content.Contains("IdentityTenantId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerInternal)this).IdentityTenantId = (string) content.GetValueForProperty("IdentityTenantId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerInternal)this).IdentityTenantId, global::System.Convert.ToString); - } - if (content.Contains("IdentityType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerInternal)this).IdentityType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentityType) content.GetValueForProperty("IdentityType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerInternal)this).IdentityType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentityType.CreateFrom); - } - if (content.Contains("IdentityUserAssignedIdentity")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IUserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.UserAssignedIdentitiesTypeConverter.ConvertFrom); - } - if (content.Contains("ManagedResourceGroupConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerInternal)this).ManagedResourceGroupConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IManagedResourceGroupConfiguration) content.GetValueForProperty("ManagedResourceGroupConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerInternal)this).ManagedResourceGroupConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ManagedResourceGroupConfigurationTypeConverter.ConvertFrom); - } - if (content.Contains("ManagerExtendedLocation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerInternal)this).ManagerExtendedLocation = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocation) content.GetValueForProperty("ManagerExtendedLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerInternal)this).ManagerExtendedLocation, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ExtendedLocationTypeConverter.ConvertFrom); - } - if (content.Contains("AnalyticsWorkspaceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerInternal)this).AnalyticsWorkspaceId = (string) content.GetValueForProperty("AnalyticsWorkspaceId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerInternal)this).AnalyticsWorkspaceId, global::System.Convert.ToString); - } - if (content.Contains("AvailabilityZone")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerInternal)this).AvailabilityZone = (string[]) content.GetValueForProperty("AvailabilityZone",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerInternal)this).AvailabilityZone, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("ClusterVersion")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerInternal)this).ClusterVersion = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterAvailableVersion[]) content.GetValueForProperty("ClusterVersion",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerInternal)this).ClusterVersion, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ClusterAvailableVersionTypeConverter.ConvertFrom)); - } - if (content.Contains("DetailedStatus")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerInternal)this).DetailedStatus = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterManagerDetailedStatus?) content.GetValueForProperty("DetailedStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerInternal)this).DetailedStatus, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterManagerDetailedStatus.CreateFrom); - } - if (content.Contains("DetailedStatusMessage")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerInternal)this).DetailedStatusMessage = (string) content.GetValueForProperty("DetailedStatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerInternal)this).DetailedStatusMessage, global::System.Convert.ToString); - } - if (content.Contains("FabricControllerId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerInternal)this).FabricControllerId = (string) content.GetValueForProperty("FabricControllerId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerInternal)this).FabricControllerId, global::System.Convert.ToString); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterManagerProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterManagerProvisioningState.CreateFrom); - } - if (content.Contains("VMSize")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerInternal)this).VMSize = (string) content.GetValueForProperty("VMSize",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerInternal)this).VMSize, global::System.Convert.ToString); - } - if (content.Contains("ManagedResourceGroupConfigurationLocation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerInternal)this).ManagedResourceGroupConfigurationLocation = (string) content.GetValueForProperty("ManagedResourceGroupConfigurationLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerInternal)this).ManagedResourceGroupConfigurationLocation, global::System.Convert.ToString); - } - if (content.Contains("ManagedResourceGroupConfigurationName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerInternal)this).ManagedResourceGroupConfigurationName = (string) content.GetValueForProperty("ManagedResourceGroupConfigurationName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerInternal)this).ManagedResourceGroupConfigurationName, global::System.Convert.ToString); - } - if (content.Contains("ManagerExtendedLocationName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerInternal)this).ManagerExtendedLocationName = (string) content.GetValueForProperty("ManagerExtendedLocationName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerInternal)this).ManagerExtendedLocationName, global::System.Convert.ToString); - } - if (content.Contains("ManagerExtendedLocationType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerInternal)this).ManagerExtendedLocationType = (string) content.GetValueForProperty("ManagerExtendedLocationType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerInternal)this).ManagerExtendedLocationType, 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.NetworkCloud.Models.Api20250201.IClusterManager DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new ClusterManager(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.NetworkCloud.Models.Api20250201.IClusterManager DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new ClusterManager(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.NetworkCloud.Models.Api20250201.IClusterManager FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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(); - } - } - /// ClusterManager represents a control-plane to manage one or more on-premises clusters. - [System.ComponentModel.TypeConverter(typeof(ClusterManagerTypeConverter))] - public partial interface IClusterManager - - { - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterManager.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterManager.cs deleted file mode 100644 index 82f03be90ed0..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterManager.cs +++ /dev/null @@ -1,508 +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.NetworkCloud.Models.Api20250201 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; - - /// - /// ClusterManager represents a control-plane to manage one or more on-premises clusters. - /// - public partial class ClusterManager : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManager, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerInternal, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IValidates - { - /// - /// Backing field for Inherited model - /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResource __trackedResource = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.TrackedResource(); - - /// - /// The resource ID of the Log Analytics workspace that is used for the logs collection. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string AnalyticsWorkspaceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerPropertiesInternal)Property).AnalyticsWorkspaceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerPropertiesInternal)Property).AnalyticsWorkspaceId = value ?? null; } - - /// - /// Field deprecated, this value will no longer influence the cluster manager allocation process and will be removed in a - /// future version. The Azure availability zones within the region that will be used to support the cluster manager resource. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string[] AvailabilityZone { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerPropertiesInternal)Property).AvailabilityZone; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerPropertiesInternal)Property).AvailabilityZone = value ?? null /* arrayOf */; } - - /// - /// The list of the cluster versions the manager supports. It is used as input in clusterVersion property of a cluster resource. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterAvailableVersion[] ClusterVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerPropertiesInternal)Property).ClusterVersion; } - - /// - /// The detailed status that provides additional information about the cluster manager. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterManagerDetailedStatus? DetailedStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerPropertiesInternal)Property).DetailedStatus; } - - /// The descriptive message about the current detailed status. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string DetailedStatusMessage { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerPropertiesInternal)Property).DetailedStatusMessage; } - - /// Backing field for property. - private string _etag; - - /// Resource ETag. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string Etag { get => this._etag; } - - /// - /// The resource ID of the fabric controller that has one to one mapping with the cluster manager. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string FabricControllerId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerPropertiesInternal)Property).FabricControllerId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerPropertiesInternal)Property).FabricControllerId = value ; } - - /// - /// Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).Id; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IManagedServiceIdentity _identity; - - /// The identity of the cluster manager. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IManagedServiceIdentity Identity { get => (this._identity = this._identity ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ManagedServiceIdentity()); 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.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string IdentityPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.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.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string IdentityTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IManagedServiceIdentityInternal)Identity).TenantId; } - - /// - /// Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentityType? IdentityType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IManagedServiceIdentityInternal)Identity).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IManagedServiceIdentityInternal)Identity).Type = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentityType)""); } - - /// - /// 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.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IUserAssignedIdentities IdentityUserAssignedIdentity { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IManagedServiceIdentityInternal)Identity).UserAssignedIdentity; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IManagedServiceIdentityInternal)Identity).UserAssignedIdentity = value ?? null /* model class */; } - - /// The geo-location where the resource lives - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)__trackedResource).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)__trackedResource).Location = value ; } - - /// - /// The location of the managed resource group. If not specified, the location of the parent resource is chosen. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string ManagedResourceGroupConfigurationLocation { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerPropertiesInternal)Property).ManagedResourceGroupConfigurationLocation; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerPropertiesInternal)Property).ManagedResourceGroupConfigurationLocation = value ?? null; } - - /// - /// The name for the managed resource group. If not specified, the unique name is automatically generated. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string ManagedResourceGroupConfigurationName { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerPropertiesInternal)Property).ManagedResourceGroupConfigurationName; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerPropertiesInternal)Property).ManagedResourceGroupConfigurationName = value ?? null; } - - /// The resource ID of the extended location on which the resource will be created. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string ManagerExtendedLocationName { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerPropertiesInternal)Property).ManagerExtendedLocationName; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerPropertiesInternal)Property).ManagerExtendedLocationName = value ?? null; } - - /// The extended location type, for example, CustomLocation. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string ManagerExtendedLocationType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerPropertiesInternal)Property).ManagerExtendedLocationType; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerPropertiesInternal)Property).ManagerExtendedLocationType = value ?? null; } - - /// Internal Acessors for ClusterVersion - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterAvailableVersion[] Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerInternal.ClusterVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerPropertiesInternal)Property).ClusterVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerPropertiesInternal)Property).ClusterVersion = value; } - - /// Internal Acessors for DetailedStatus - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterManagerDetailedStatus? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerInternal.DetailedStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerPropertiesInternal)Property).DetailedStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerPropertiesInternal)Property).DetailedStatus = value; } - - /// Internal Acessors for DetailedStatusMessage - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerInternal.DetailedStatusMessage { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerPropertiesInternal)Property).DetailedStatusMessage; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerPropertiesInternal)Property).DetailedStatusMessage = value; } - - /// Internal Acessors for Etag - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerInternal.Etag { get => this._etag; set { {_etag = value;} } } - - /// Internal Acessors for Identity - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IManagedServiceIdentity Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerInternal.Identity { get => (this._identity = this._identity ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ManagedServiceIdentity()); set { {_identity = value;} } } - - /// Internal Acessors for IdentityPrincipalId - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerInternal.IdentityPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IManagedServiceIdentityInternal)Identity).PrincipalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IManagedServiceIdentityInternal)Identity).PrincipalId = value; } - - /// Internal Acessors for IdentityTenantId - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerInternal.IdentityTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IManagedServiceIdentityInternal)Identity).TenantId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IManagedServiceIdentityInternal)Identity).TenantId = value; } - - /// Internal Acessors for ManagedResourceGroupConfiguration - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IManagedResourceGroupConfiguration Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerInternal.ManagedResourceGroupConfiguration { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerPropertiesInternal)Property).ManagedResourceGroupConfiguration; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerPropertiesInternal)Property).ManagedResourceGroupConfiguration = value; } - - /// Internal Acessors for ManagerExtendedLocation - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocation Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerInternal.ManagerExtendedLocation { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerPropertiesInternal)Property).ManagerExtendedLocation; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerPropertiesInternal)Property).ManagerExtendedLocation = value; } - - /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerProperties Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ClusterManagerProperties()); set { {_property = value;} } } - - /// Internal Acessors for ProvisioningState - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterManagerProvisioningState? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerPropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerPropertiesInternal)Property).ProvisioningState = value; } - - /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).Id = value; } - - /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).Name = value; } - - /// Internal Acessors for SystemData - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ISystemData Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal.SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemData; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemData = value; } - - /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).Type = value; } - - /// The name of the resource - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).Name; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerProperties _property; - - /// The list of the resource properties. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ClusterManagerProperties()); set => this._property = value; } - - /// The provisioning state of the cluster manager. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterManagerProvisioningState? ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerPropertiesInternal)Property).ProvisioningState; } - - /// Gets the resource group name - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string ResourceGroupName { get => (new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Success ? new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Groups["resourceGroupName"].Value : null); } - - /// - /// Azure Resource Manager metadata containing createdBy and modifiedBy information. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ISystemData SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemData; } - - /// The timestamp of resource creation (UTC). - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataCreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataCreatedAt = value ?? default(global::System.DateTime); } - - /// The identity that created the resource. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataCreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataCreatedBy = value ?? null; } - - /// The type of identity that created the resource. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType? SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataCreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataCreatedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType)""); } - - /// The timestamp of resource last modification (UTC) - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataLastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataLastModifiedAt = value ?? default(global::System.DateTime); } - - /// The identity that last modified the resource. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataLastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataLastModifiedBy = value ?? null; } - - /// The type of identity that last modified the resource. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType? SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataLastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataLastModifiedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType)""); } - - /// Resource tags. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)__trackedResource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.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.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).Type; } - - /// - /// Field deprecated, this value will no longer influence the cluster manager allocation process and will be removed in a - /// future version. The size of the Azure virtual machines to use for hosting the cluster manager resource. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string VMSize { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerPropertiesInternal)Property).VMSize; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerPropertiesInternal)Property).VMSize = value ?? null; } - - /// Creates an new instance. - public ClusterManager() - { - - } - - /// Validates that this object meets the validation criteria. - /// an instance that will receive validation - /// events. - /// - /// A that will be complete when validation is completed. - /// - public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) - { - await eventListener.AssertNotNull(nameof(__trackedResource), __trackedResource); - await eventListener.AssertObjectIsValid(nameof(__trackedResource), __trackedResource); - } - } - /// ClusterManager represents a control-plane to manage one or more on-premises clusters. - public partial interface IClusterManager : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResource - { - /// - /// The resource ID of the Log Analytics workspace that is used for the logs collection. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The resource ID of the Log Analytics workspace that is used for the logs collection.", - SerializedName = @"analyticsWorkspaceId", - PossibleTypes = new [] { typeof(string) })] - string AnalyticsWorkspaceId { get; set; } - /// - /// Field deprecated, this value will no longer influence the cluster manager allocation process and will be removed in a - /// future version. The Azure availability zones within the region that will be used to support the cluster manager resource. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Field deprecated, this value will no longer influence the cluster manager allocation process and will be removed in a future version. The Azure availability zones within the region that will be used to support the cluster manager resource.", - SerializedName = @"availabilityZones", - PossibleTypes = new [] { typeof(string) })] - string[] AvailabilityZone { get; set; } - /// - /// The list of the cluster versions the manager supports. It is used as input in clusterVersion property of a cluster resource. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The list of the cluster versions the manager supports. It is used as input in clusterVersion property of a cluster resource.", - SerializedName = @"clusterVersions", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterAvailableVersion) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterAvailableVersion[] ClusterVersion { get; } - /// - /// The detailed status that provides additional information about the cluster manager. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The detailed status that provides additional information about the cluster manager.", - SerializedName = @"detailedStatus", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterManagerDetailedStatus) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterManagerDetailedStatus? DetailedStatus { get; } - /// The descriptive message about the current detailed status. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The descriptive message about the current detailed status.", - SerializedName = @"detailedStatusMessage", - PossibleTypes = new [] { typeof(string) })] - string DetailedStatusMessage { get; } - /// Resource ETag. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"Resource ETag.", - SerializedName = @"etag", - PossibleTypes = new [] { typeof(string) })] - string Etag { get; } - /// - /// The resource ID of the fabric controller that has one to one mapping with the cluster manager. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The resource ID of the fabric controller that has one to one mapping with the cluster manager.", - SerializedName = @"fabricControllerId", - PossibleTypes = new [] { typeof(string) })] - string FabricControllerId { get; set; } - /// - /// The service principal ID of the system assigned identity. This property will only be provided for a system assigned identity. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - 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) })] - string IdentityPrincipalId { get; } - /// - /// The tenant ID of the system assigned identity. This property will only be provided for a system assigned identity. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - 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) })] - string IdentityTenantId { get; } - /// - /// Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Support.ManagedServiceIdentityType) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentityType? 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.NetworkCloud.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.NetworkCloud.Models.Api50.IUserAssignedIdentities) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IUserAssignedIdentities IdentityUserAssignedIdentity { get; set; } - /// - /// The location of the managed resource group. If not specified, the location of the parent resource is chosen. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The location of the managed resource group. If not specified, the location of the parent resource is chosen.", - SerializedName = @"location", - PossibleTypes = new [] { typeof(string) })] - string ManagedResourceGroupConfigurationLocation { get; set; } - /// - /// The name for the managed resource group. If not specified, the unique name is automatically generated. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The name for the managed resource group. If not specified, the unique name is automatically generated.", - SerializedName = @"name", - PossibleTypes = new [] { typeof(string) })] - string ManagedResourceGroupConfigurationName { get; set; } - /// The resource ID of the extended location on which the resource will be created. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The resource ID of the extended location on which the resource will be created.", - SerializedName = @"name", - PossibleTypes = new [] { typeof(string) })] - string ManagerExtendedLocationName { get; set; } - /// The extended location type, for example, CustomLocation. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The extended location type, for example, CustomLocation.", - SerializedName = @"type", - PossibleTypes = new [] { typeof(string) })] - string ManagerExtendedLocationType { get; set; } - /// The provisioning state of the cluster manager. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The provisioning state of the cluster manager.", - SerializedName = @"provisioningState", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterManagerProvisioningState) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterManagerProvisioningState? ProvisioningState { get; } - /// - /// Field deprecated, this value will no longer influence the cluster manager allocation process and will be removed in a - /// future version. The size of the Azure virtual machines to use for hosting the cluster manager resource. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Field deprecated, this value will no longer influence the cluster manager allocation process and will be removed in a future version. The size of the Azure virtual machines to use for hosting the cluster manager resource.", - SerializedName = @"vmSize", - PossibleTypes = new [] { typeof(string) })] - string VMSize { get; set; } - - } - /// ClusterManager represents a control-plane to manage one or more on-premises clusters. - internal partial interface IClusterManagerInternal : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal - { - /// - /// The resource ID of the Log Analytics workspace that is used for the logs collection. - /// - string AnalyticsWorkspaceId { get; set; } - /// - /// Field deprecated, this value will no longer influence the cluster manager allocation process and will be removed in a - /// future version. The Azure availability zones within the region that will be used to support the cluster manager resource. - /// - string[] AvailabilityZone { get; set; } - /// - /// The list of the cluster versions the manager supports. It is used as input in clusterVersion property of a cluster resource. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterAvailableVersion[] ClusterVersion { get; set; } - /// - /// The detailed status that provides additional information about the cluster manager. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterManagerDetailedStatus? DetailedStatus { get; set; } - /// The descriptive message about the current detailed status. - string DetailedStatusMessage { get; set; } - /// Resource ETag. - string Etag { get; set; } - /// - /// The resource ID of the fabric controller that has one to one mapping with the cluster manager. - /// - string FabricControllerId { get; set; } - /// The identity of the cluster manager. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IManagedServiceIdentity Identity { get; set; } - /// - /// The service principal ID of the system assigned identity. This property will only be provided for a system assigned identity. - /// - string IdentityPrincipalId { get; set; } - /// - /// The tenant ID of the system assigned identity. This property will only be provided for a system assigned identity. - /// - string IdentityTenantId { get; set; } - /// - /// Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentityType? 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.NetworkCloud.Models.Api50.IUserAssignedIdentities IdentityUserAssignedIdentity { get; set; } - /// The configuration of the managed resource group associated with the resource. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IManagedResourceGroupConfiguration ManagedResourceGroupConfiguration { get; set; } - /// - /// The location of the managed resource group. If not specified, the location of the parent resource is chosen. - /// - string ManagedResourceGroupConfigurationLocation { get; set; } - /// - /// The name for the managed resource group. If not specified, the unique name is automatically generated. - /// - string ManagedResourceGroupConfigurationName { get; set; } - /// - /// The extended location (custom location) that represents the cluster manager's control plane location. This extended location - /// is used when creating cluster and rack manifest resources. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocation ManagerExtendedLocation { get; set; } - /// The resource ID of the extended location on which the resource will be created. - string ManagerExtendedLocationName { get; set; } - /// The extended location type, for example, CustomLocation. - string ManagerExtendedLocationType { get; set; } - /// The list of the resource properties. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerProperties Property { get; set; } - /// The provisioning state of the cluster manager. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterManagerProvisioningState? ProvisioningState { get; set; } - /// - /// Field deprecated, this value will no longer influence the cluster manager allocation process and will be removed in a - /// future version. The size of the Azure virtual machines to use for hosting the cluster manager resource. - /// - string VMSize { get; set; } - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterManagerList.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterManagerList.cs deleted file mode 100644 index d88ff4f5af46..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterManagerList.cs +++ /dev/null @@ -1,68 +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.NetworkCloud.Models.Api20250201 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; - - /// ClusterManagerList represents a list of cluster manager objects. - public partial class ClusterManagerList : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerList, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerListInternal - { - - /// Backing field for property. - private string _nextLink; - - /// The link used to get the next page of operations. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string NextLink { get => this._nextLink; set => this._nextLink = value; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManager[] _value; - - /// The list of cluster managers. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManager[] Value { get => this._value; set => this._value = value; } - - /// Creates an new instance. - public ClusterManagerList() - { - - } - } - /// ClusterManagerList represents a list of cluster manager objects. - public partial interface IClusterManagerList : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable - { - /// The link used to get the next page of operations. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The link used to get the next page of operations.", - SerializedName = @"nextLink", - PossibleTypes = new [] { typeof(string) })] - string NextLink { get; set; } - /// The list of cluster managers. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The list of cluster managers.", - SerializedName = @"value", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManager) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManager[] Value { get; set; } - - } - /// ClusterManagerList represents a list of cluster manager objects. - internal partial interface IClusterManagerListInternal - - { - /// The link used to get the next page of operations. - string NextLink { get; set; } - /// The list of cluster managers. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManager[] Value { get; set; } - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterManagerPatchParameters.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterManagerPatchParameters.PowerShell.cs deleted file mode 100644 index a58ce00eab19..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterManagerPatchParameters.PowerShell.cs +++ /dev/null @@ -1,208 +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.NetworkCloud.Models.Api20250201 -{ - using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; - - /// - /// ClusterManagerPatchParameters represents the body of the request to patch the cluster properties. - /// - [System.ComponentModel.TypeConverter(typeof(ClusterManagerPatchParametersTypeConverter))] - public partial class ClusterManagerPatchParameters - { - - /// - /// 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 ClusterManagerPatchParameters(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("Identity")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerPatchParametersInternal)this).Identity = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IManagedServiceIdentity) content.GetValueForProperty("Identity",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerPatchParametersInternal)this).Identity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ManagedServiceIdentityTypeConverter.ConvertFrom); - } - if (content.Contains("Tag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerPatchParametersInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerPatchParametersTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerPatchParametersInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ClusterManagerPatchParametersTagsTypeConverter.ConvertFrom); - } - if (content.Contains("IdentityPrincipalId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerPatchParametersInternal)this).IdentityPrincipalId = (string) content.GetValueForProperty("IdentityPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerPatchParametersInternal)this).IdentityPrincipalId, global::System.Convert.ToString); - } - if (content.Contains("IdentityTenantId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerPatchParametersInternal)this).IdentityTenantId = (string) content.GetValueForProperty("IdentityTenantId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerPatchParametersInternal)this).IdentityTenantId, global::System.Convert.ToString); - } - if (content.Contains("IdentityType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerPatchParametersInternal)this).IdentityType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentityType) content.GetValueForProperty("IdentityType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerPatchParametersInternal)this).IdentityType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentityType.CreateFrom); - } - if (content.Contains("IdentityUserAssignedIdentity")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerPatchParametersInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IUserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerPatchParametersInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.UserAssignedIdentitiesTypeConverter.ConvertFrom); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal ClusterManagerPatchParameters(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("Identity")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerPatchParametersInternal)this).Identity = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IManagedServiceIdentity) content.GetValueForProperty("Identity",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerPatchParametersInternal)this).Identity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ManagedServiceIdentityTypeConverter.ConvertFrom); - } - if (content.Contains("Tag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerPatchParametersInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerPatchParametersTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerPatchParametersInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ClusterManagerPatchParametersTagsTypeConverter.ConvertFrom); - } - if (content.Contains("IdentityPrincipalId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerPatchParametersInternal)this).IdentityPrincipalId = (string) content.GetValueForProperty("IdentityPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerPatchParametersInternal)this).IdentityPrincipalId, global::System.Convert.ToString); - } - if (content.Contains("IdentityTenantId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerPatchParametersInternal)this).IdentityTenantId = (string) content.GetValueForProperty("IdentityTenantId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerPatchParametersInternal)this).IdentityTenantId, global::System.Convert.ToString); - } - if (content.Contains("IdentityType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerPatchParametersInternal)this).IdentityType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentityType) content.GetValueForProperty("IdentityType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerPatchParametersInternal)this).IdentityType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentityType.CreateFrom); - } - if (content.Contains("IdentityUserAssignedIdentity")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerPatchParametersInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IUserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerPatchParametersInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.UserAssignedIdentitiesTypeConverter.ConvertFrom); - } - AfterDeserializePSObject(content); - } - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerPatchParameters DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new ClusterManagerPatchParameters(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.NetworkCloud.Models.Api20250201.IClusterManagerPatchParameters DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new ClusterManagerPatchParameters(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.NetworkCloud.Models.Api20250201.IClusterManagerPatchParameters FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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(); - } - } - /// ClusterManagerPatchParameters represents the body of the request to patch the cluster properties. - [System.ComponentModel.TypeConverter(typeof(ClusterManagerPatchParametersTypeConverter))] - public partial interface IClusterManagerPatchParameters - - { - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterManagerPatchParameters.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterManagerPatchParameters.cs deleted file mode 100644 index b654f28f7ad9..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterManagerPatchParameters.cs +++ /dev/null @@ -1,157 +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.NetworkCloud.Models.Api20250201 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; - - /// - /// ClusterManagerPatchParameters represents the body of the request to patch the cluster properties. - /// - public partial class ClusterManagerPatchParameters : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerPatchParameters, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerPatchParametersInternal - { - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IManagedServiceIdentity _identity; - - /// The identity for the resource. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IManagedServiceIdentity Identity { get => (this._identity = this._identity ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ManagedServiceIdentity()); 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.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string IdentityPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.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.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string IdentityTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IManagedServiceIdentityInternal)Identity).TenantId; } - - /// - /// Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentityType? IdentityType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IManagedServiceIdentityInternal)Identity).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IManagedServiceIdentityInternal)Identity).Type = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentityType)""); } - - /// - /// 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.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IUserAssignedIdentities IdentityUserAssignedIdentity { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IManagedServiceIdentityInternal)Identity).UserAssignedIdentity; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IManagedServiceIdentityInternal)Identity).UserAssignedIdentity = value ?? null /* model class */; } - - /// Internal Acessors for Identity - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IManagedServiceIdentity Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerPatchParametersInternal.Identity { get => (this._identity = this._identity ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ManagedServiceIdentity()); set { {_identity = value;} } } - - /// Internal Acessors for IdentityPrincipalId - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerPatchParametersInternal.IdentityPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IManagedServiceIdentityInternal)Identity).PrincipalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IManagedServiceIdentityInternal)Identity).PrincipalId = value; } - - /// Internal Acessors for IdentityTenantId - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerPatchParametersInternal.IdentityTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IManagedServiceIdentityInternal)Identity).TenantId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IManagedServiceIdentityInternal)Identity).TenantId = value; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerPatchParametersTags _tag; - - /// The Azure resource tags that will replace the existing ones. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerPatchParametersTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ClusterManagerPatchParametersTags()); set => this._tag = value; } - - /// Creates an new instance. - public ClusterManagerPatchParameters() - { - - } - } - /// ClusterManagerPatchParameters represents the body of the request to patch the cluster properties. - public partial interface IClusterManagerPatchParameters : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable - { - /// - /// The service principal ID of the system assigned identity. This property will only be provided for a system assigned identity. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - 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) })] - string IdentityPrincipalId { get; } - /// - /// The tenant ID of the system assigned identity. This property will only be provided for a system assigned identity. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - 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) })] - string IdentityTenantId { get; } - /// - /// Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Support.ManagedServiceIdentityType) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentityType? 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.NetworkCloud.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.NetworkCloud.Models.Api50.IUserAssignedIdentities) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IUserAssignedIdentities IdentityUserAssignedIdentity { get; set; } - /// The Azure resource tags that will replace the existing ones. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The Azure resource tags that will replace the existing ones.", - SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerPatchParametersTags) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerPatchParametersTags Tag { get; set; } - - } - /// ClusterManagerPatchParameters represents the body of the request to patch the cluster properties. - internal partial interface IClusterManagerPatchParametersInternal - - { - /// The identity for the resource. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IManagedServiceIdentity Identity { get; set; } - /// - /// The service principal ID of the system assigned identity. This property will only be provided for a system assigned identity. - /// - string IdentityPrincipalId { get; set; } - /// - /// The tenant ID of the system assigned identity. This property will only be provided for a system assigned identity. - /// - string IdentityTenantId { get; set; } - /// - /// Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentityType? 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.NetworkCloud.Models.Api50.IUserAssignedIdentities IdentityUserAssignedIdentity { get; set; } - /// The Azure resource tags that will replace the existing ones. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerPatchParametersTags Tag { get; set; } - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterManagerProperties.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterManagerProperties.PowerShell.cs deleted file mode 100644 index bbc52b4f0f17..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterManagerProperties.PowerShell.cs +++ /dev/null @@ -1,270 +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.NetworkCloud.Models.Api20250201 -{ - using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; - - /// ClusterManagerProperties represents the properties of a cluster manager. - [System.ComponentModel.TypeConverter(typeof(ClusterManagerPropertiesTypeConverter))] - public partial class ClusterManagerProperties - { - - /// - /// 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 ClusterManagerProperties(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("ManagedResourceGroupConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerPropertiesInternal)this).ManagedResourceGroupConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IManagedResourceGroupConfiguration) content.GetValueForProperty("ManagedResourceGroupConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerPropertiesInternal)this).ManagedResourceGroupConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ManagedResourceGroupConfigurationTypeConverter.ConvertFrom); - } - if (content.Contains("ManagerExtendedLocation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerPropertiesInternal)this).ManagerExtendedLocation = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocation) content.GetValueForProperty("ManagerExtendedLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerPropertiesInternal)this).ManagerExtendedLocation, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ExtendedLocationTypeConverter.ConvertFrom); - } - if (content.Contains("AnalyticsWorkspaceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerPropertiesInternal)this).AnalyticsWorkspaceId = (string) content.GetValueForProperty("AnalyticsWorkspaceId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerPropertiesInternal)this).AnalyticsWorkspaceId, global::System.Convert.ToString); - } - if (content.Contains("AvailabilityZone")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerPropertiesInternal)this).AvailabilityZone = (string[]) content.GetValueForProperty("AvailabilityZone",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerPropertiesInternal)this).AvailabilityZone, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("ClusterVersion")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerPropertiesInternal)this).ClusterVersion = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterAvailableVersion[]) content.GetValueForProperty("ClusterVersion",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerPropertiesInternal)this).ClusterVersion, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ClusterAvailableVersionTypeConverter.ConvertFrom)); - } - if (content.Contains("DetailedStatus")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerPropertiesInternal)this).DetailedStatus = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterManagerDetailedStatus?) content.GetValueForProperty("DetailedStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerPropertiesInternal)this).DetailedStatus, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterManagerDetailedStatus.CreateFrom); - } - if (content.Contains("DetailedStatusMessage")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerPropertiesInternal)this).DetailedStatusMessage = (string) content.GetValueForProperty("DetailedStatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerPropertiesInternal)this).DetailedStatusMessage, global::System.Convert.ToString); - } - if (content.Contains("FabricControllerId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerPropertiesInternal)this).FabricControllerId = (string) content.GetValueForProperty("FabricControllerId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerPropertiesInternal)this).FabricControllerId, global::System.Convert.ToString); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerPropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterManagerProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerPropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterManagerProvisioningState.CreateFrom); - } - if (content.Contains("VMSize")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerPropertiesInternal)this).VMSize = (string) content.GetValueForProperty("VMSize",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerPropertiesInternal)this).VMSize, global::System.Convert.ToString); - } - if (content.Contains("ManagedResourceGroupConfigurationLocation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerPropertiesInternal)this).ManagedResourceGroupConfigurationLocation = (string) content.GetValueForProperty("ManagedResourceGroupConfigurationLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerPropertiesInternal)this).ManagedResourceGroupConfigurationLocation, global::System.Convert.ToString); - } - if (content.Contains("ManagedResourceGroupConfigurationName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerPropertiesInternal)this).ManagedResourceGroupConfigurationName = (string) content.GetValueForProperty("ManagedResourceGroupConfigurationName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerPropertiesInternal)this).ManagedResourceGroupConfigurationName, global::System.Convert.ToString); - } - if (content.Contains("ManagerExtendedLocationName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerPropertiesInternal)this).ManagerExtendedLocationName = (string) content.GetValueForProperty("ManagerExtendedLocationName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerPropertiesInternal)this).ManagerExtendedLocationName, global::System.Convert.ToString); - } - if (content.Contains("ManagerExtendedLocationType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerPropertiesInternal)this).ManagerExtendedLocationType = (string) content.GetValueForProperty("ManagerExtendedLocationType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerPropertiesInternal)this).ManagerExtendedLocationType, 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 ClusterManagerProperties(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("ManagedResourceGroupConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerPropertiesInternal)this).ManagedResourceGroupConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IManagedResourceGroupConfiguration) content.GetValueForProperty("ManagedResourceGroupConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerPropertiesInternal)this).ManagedResourceGroupConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ManagedResourceGroupConfigurationTypeConverter.ConvertFrom); - } - if (content.Contains("ManagerExtendedLocation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerPropertiesInternal)this).ManagerExtendedLocation = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocation) content.GetValueForProperty("ManagerExtendedLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerPropertiesInternal)this).ManagerExtendedLocation, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ExtendedLocationTypeConverter.ConvertFrom); - } - if (content.Contains("AnalyticsWorkspaceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerPropertiesInternal)this).AnalyticsWorkspaceId = (string) content.GetValueForProperty("AnalyticsWorkspaceId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerPropertiesInternal)this).AnalyticsWorkspaceId, global::System.Convert.ToString); - } - if (content.Contains("AvailabilityZone")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerPropertiesInternal)this).AvailabilityZone = (string[]) content.GetValueForProperty("AvailabilityZone",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerPropertiesInternal)this).AvailabilityZone, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("ClusterVersion")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerPropertiesInternal)this).ClusterVersion = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterAvailableVersion[]) content.GetValueForProperty("ClusterVersion",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerPropertiesInternal)this).ClusterVersion, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ClusterAvailableVersionTypeConverter.ConvertFrom)); - } - if (content.Contains("DetailedStatus")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerPropertiesInternal)this).DetailedStatus = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterManagerDetailedStatus?) content.GetValueForProperty("DetailedStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerPropertiesInternal)this).DetailedStatus, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterManagerDetailedStatus.CreateFrom); - } - if (content.Contains("DetailedStatusMessage")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerPropertiesInternal)this).DetailedStatusMessage = (string) content.GetValueForProperty("DetailedStatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerPropertiesInternal)this).DetailedStatusMessage, global::System.Convert.ToString); - } - if (content.Contains("FabricControllerId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerPropertiesInternal)this).FabricControllerId = (string) content.GetValueForProperty("FabricControllerId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerPropertiesInternal)this).FabricControllerId, global::System.Convert.ToString); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerPropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterManagerProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerPropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterManagerProvisioningState.CreateFrom); - } - if (content.Contains("VMSize")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerPropertiesInternal)this).VMSize = (string) content.GetValueForProperty("VMSize",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerPropertiesInternal)this).VMSize, global::System.Convert.ToString); - } - if (content.Contains("ManagedResourceGroupConfigurationLocation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerPropertiesInternal)this).ManagedResourceGroupConfigurationLocation = (string) content.GetValueForProperty("ManagedResourceGroupConfigurationLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerPropertiesInternal)this).ManagedResourceGroupConfigurationLocation, global::System.Convert.ToString); - } - if (content.Contains("ManagedResourceGroupConfigurationName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerPropertiesInternal)this).ManagedResourceGroupConfigurationName = (string) content.GetValueForProperty("ManagedResourceGroupConfigurationName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerPropertiesInternal)this).ManagedResourceGroupConfigurationName, global::System.Convert.ToString); - } - if (content.Contains("ManagerExtendedLocationName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerPropertiesInternal)this).ManagerExtendedLocationName = (string) content.GetValueForProperty("ManagerExtendedLocationName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerPropertiesInternal)this).ManagerExtendedLocationName, global::System.Convert.ToString); - } - if (content.Contains("ManagerExtendedLocationType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerPropertiesInternal)this).ManagerExtendedLocationType = (string) content.GetValueForProperty("ManagerExtendedLocationType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerPropertiesInternal)this).ManagerExtendedLocationType, 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.NetworkCloud.Models.Api20250201.IClusterManagerProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new ClusterManagerProperties(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.NetworkCloud.Models.Api20250201.IClusterManagerProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new ClusterManagerProperties(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.NetworkCloud.Models.Api20250201.IClusterManagerProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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(); - } - } - /// ClusterManagerProperties represents the properties of a cluster manager. - [System.ComponentModel.TypeConverter(typeof(ClusterManagerPropertiesTypeConverter))] - public partial interface IClusterManagerProperties - - { - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterManagerProperties.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterManagerProperties.cs deleted file mode 100644 index 3734508b8c9c..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterManagerProperties.cs +++ /dev/null @@ -1,322 +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.NetworkCloud.Models.Api20250201 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; - - /// ClusterManagerProperties represents the properties of a cluster manager. - public partial class ClusterManagerProperties : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerProperties, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerPropertiesInternal - { - - /// Backing field for property. - private string _analyticsWorkspaceId; - - /// - /// The resource ID of the Log Analytics workspace that is used for the logs collection. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string AnalyticsWorkspaceId { get => this._analyticsWorkspaceId; set => this._analyticsWorkspaceId = value; } - - /// Backing field for property. - private string[] _availabilityZone; - - /// - /// Field deprecated, this value will no longer influence the cluster manager allocation process and will be removed in a - /// future version. The Azure availability zones within the region that will be used to support the cluster manager resource. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string[] AvailabilityZone { get => this._availabilityZone; set => this._availabilityZone = value; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterAvailableVersion[] _clusterVersion; - - /// - /// The list of the cluster versions the manager supports. It is used as input in clusterVersion property of a cluster resource. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterAvailableVersion[] ClusterVersion { get => this._clusterVersion; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterManagerDetailedStatus? _detailedStatus; - - /// - /// The detailed status that provides additional information about the cluster manager. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterManagerDetailedStatus? DetailedStatus { get => this._detailedStatus; } - - /// Backing field for property. - private string _detailedStatusMessage; - - /// The descriptive message about the current detailed status. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string DetailedStatusMessage { get => this._detailedStatusMessage; } - - /// Backing field for property. - private string _fabricControllerId; - - /// - /// The resource ID of the fabric controller that has one to one mapping with the cluster manager. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string FabricControllerId { get => this._fabricControllerId; set => this._fabricControllerId = value; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IManagedResourceGroupConfiguration _managedResourceGroupConfiguration; - - /// The configuration of the managed resource group associated with the resource. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IManagedResourceGroupConfiguration ManagedResourceGroupConfiguration { get => (this._managedResourceGroupConfiguration = this._managedResourceGroupConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ManagedResourceGroupConfiguration()); set => this._managedResourceGroupConfiguration = value; } - - /// - /// The location of the managed resource group. If not specified, the location of the parent resource is chosen. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string ManagedResourceGroupConfigurationLocation { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IManagedResourceGroupConfigurationInternal)ManagedResourceGroupConfiguration).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IManagedResourceGroupConfigurationInternal)ManagedResourceGroupConfiguration).Location = value ?? null; } - - /// - /// The name for the managed resource group. If not specified, the unique name is automatically generated. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string ManagedResourceGroupConfigurationName { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IManagedResourceGroupConfigurationInternal)ManagedResourceGroupConfiguration).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IManagedResourceGroupConfigurationInternal)ManagedResourceGroupConfiguration).Name = value ?? null; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocation _managerExtendedLocation; - - /// - /// The extended location (custom location) that represents the cluster manager's control plane location. This extended location - /// is used when creating cluster and rack manifest resources. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocation ManagerExtendedLocation { get => (this._managerExtendedLocation = this._managerExtendedLocation ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ExtendedLocation()); } - - /// The resource ID of the extended location on which the resource will be created. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string ManagerExtendedLocationName { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocationInternal)ManagerExtendedLocation).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocationInternal)ManagerExtendedLocation).Name = value ?? null; } - - /// The extended location type, for example, CustomLocation. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string ManagerExtendedLocationType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocationInternal)ManagerExtendedLocation).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocationInternal)ManagerExtendedLocation).Type = value ?? null; } - - /// Internal Acessors for ClusterVersion - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterAvailableVersion[] Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerPropertiesInternal.ClusterVersion { get => this._clusterVersion; set { {_clusterVersion = value;} } } - - /// Internal Acessors for DetailedStatus - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterManagerDetailedStatus? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerPropertiesInternal.DetailedStatus { get => this._detailedStatus; set { {_detailedStatus = value;} } } - - /// Internal Acessors for DetailedStatusMessage - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerPropertiesInternal.DetailedStatusMessage { get => this._detailedStatusMessage; set { {_detailedStatusMessage = value;} } } - - /// Internal Acessors for ManagedResourceGroupConfiguration - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IManagedResourceGroupConfiguration Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerPropertiesInternal.ManagedResourceGroupConfiguration { get => (this._managedResourceGroupConfiguration = this._managedResourceGroupConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ManagedResourceGroupConfiguration()); set { {_managedResourceGroupConfiguration = value;} } } - - /// Internal Acessors for ManagerExtendedLocation - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocation Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerPropertiesInternal.ManagerExtendedLocation { get => (this._managerExtendedLocation = this._managerExtendedLocation ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ExtendedLocation()); set { {_managerExtendedLocation = value;} } } - - /// Internal Acessors for ProvisioningState - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterManagerProvisioningState? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerPropertiesInternal.ProvisioningState { get => this._provisioningState; set { {_provisioningState = value;} } } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterManagerProvisioningState? _provisioningState; - - /// The provisioning state of the cluster manager. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterManagerProvisioningState? ProvisioningState { get => this._provisioningState; } - - /// Backing field for property. - private string _vMSize; - - /// - /// Field deprecated, this value will no longer influence the cluster manager allocation process and will be removed in a - /// future version. The size of the Azure virtual machines to use for hosting the cluster manager resource. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string VMSize { get => this._vMSize; set => this._vMSize = value; } - - /// Creates an new instance. - public ClusterManagerProperties() - { - - } - } - /// ClusterManagerProperties represents the properties of a cluster manager. - public partial interface IClusterManagerProperties : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable - { - /// - /// The resource ID of the Log Analytics workspace that is used for the logs collection. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The resource ID of the Log Analytics workspace that is used for the logs collection.", - SerializedName = @"analyticsWorkspaceId", - PossibleTypes = new [] { typeof(string) })] - string AnalyticsWorkspaceId { get; set; } - /// - /// Field deprecated, this value will no longer influence the cluster manager allocation process and will be removed in a - /// future version. The Azure availability zones within the region that will be used to support the cluster manager resource. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Field deprecated, this value will no longer influence the cluster manager allocation process and will be removed in a future version. The Azure availability zones within the region that will be used to support the cluster manager resource.", - SerializedName = @"availabilityZones", - PossibleTypes = new [] { typeof(string) })] - string[] AvailabilityZone { get; set; } - /// - /// The list of the cluster versions the manager supports. It is used as input in clusterVersion property of a cluster resource. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The list of the cluster versions the manager supports. It is used as input in clusterVersion property of a cluster resource.", - SerializedName = @"clusterVersions", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterAvailableVersion) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterAvailableVersion[] ClusterVersion { get; } - /// - /// The detailed status that provides additional information about the cluster manager. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The detailed status that provides additional information about the cluster manager.", - SerializedName = @"detailedStatus", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterManagerDetailedStatus) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterManagerDetailedStatus? DetailedStatus { get; } - /// The descriptive message about the current detailed status. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The descriptive message about the current detailed status.", - SerializedName = @"detailedStatusMessage", - PossibleTypes = new [] { typeof(string) })] - string DetailedStatusMessage { get; } - /// - /// The resource ID of the fabric controller that has one to one mapping with the cluster manager. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The resource ID of the fabric controller that has one to one mapping with the cluster manager.", - SerializedName = @"fabricControllerId", - PossibleTypes = new [] { typeof(string) })] - string FabricControllerId { get; set; } - /// - /// The location of the managed resource group. If not specified, the location of the parent resource is chosen. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The location of the managed resource group. If not specified, the location of the parent resource is chosen.", - SerializedName = @"location", - PossibleTypes = new [] { typeof(string) })] - string ManagedResourceGroupConfigurationLocation { get; set; } - /// - /// The name for the managed resource group. If not specified, the unique name is automatically generated. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The name for the managed resource group. If not specified, the unique name is automatically generated.", - SerializedName = @"name", - PossibleTypes = new [] { typeof(string) })] - string ManagedResourceGroupConfigurationName { get; set; } - /// The resource ID of the extended location on which the resource will be created. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The resource ID of the extended location on which the resource will be created.", - SerializedName = @"name", - PossibleTypes = new [] { typeof(string) })] - string ManagerExtendedLocationName { get; set; } - /// The extended location type, for example, CustomLocation. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The extended location type, for example, CustomLocation.", - SerializedName = @"type", - PossibleTypes = new [] { typeof(string) })] - string ManagerExtendedLocationType { get; set; } - /// The provisioning state of the cluster manager. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The provisioning state of the cluster manager.", - SerializedName = @"provisioningState", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterManagerProvisioningState) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterManagerProvisioningState? ProvisioningState { get; } - /// - /// Field deprecated, this value will no longer influence the cluster manager allocation process and will be removed in a - /// future version. The size of the Azure virtual machines to use for hosting the cluster manager resource. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Field deprecated, this value will no longer influence the cluster manager allocation process and will be removed in a future version. The size of the Azure virtual machines to use for hosting the cluster manager resource.", - SerializedName = @"vmSize", - PossibleTypes = new [] { typeof(string) })] - string VMSize { get; set; } - - } - /// ClusterManagerProperties represents the properties of a cluster manager. - internal partial interface IClusterManagerPropertiesInternal - - { - /// - /// The resource ID of the Log Analytics workspace that is used for the logs collection. - /// - string AnalyticsWorkspaceId { get; set; } - /// - /// Field deprecated, this value will no longer influence the cluster manager allocation process and will be removed in a - /// future version. The Azure availability zones within the region that will be used to support the cluster manager resource. - /// - string[] AvailabilityZone { get; set; } - /// - /// The list of the cluster versions the manager supports. It is used as input in clusterVersion property of a cluster resource. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterAvailableVersion[] ClusterVersion { get; set; } - /// - /// The detailed status that provides additional information about the cluster manager. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterManagerDetailedStatus? DetailedStatus { get; set; } - /// The descriptive message about the current detailed status. - string DetailedStatusMessage { get; set; } - /// - /// The resource ID of the fabric controller that has one to one mapping with the cluster manager. - /// - string FabricControllerId { get; set; } - /// The configuration of the managed resource group associated with the resource. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IManagedResourceGroupConfiguration ManagedResourceGroupConfiguration { get; set; } - /// - /// The location of the managed resource group. If not specified, the location of the parent resource is chosen. - /// - string ManagedResourceGroupConfigurationLocation { get; set; } - /// - /// The name for the managed resource group. If not specified, the unique name is automatically generated. - /// - string ManagedResourceGroupConfigurationName { get; set; } - /// - /// The extended location (custom location) that represents the cluster manager's control plane location. This extended location - /// is used when creating cluster and rack manifest resources. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocation ManagerExtendedLocation { get; set; } - /// The resource ID of the extended location on which the resource will be created. - string ManagerExtendedLocationName { get; set; } - /// The extended location type, for example, CustomLocation. - string ManagerExtendedLocationType { get; set; } - /// The provisioning state of the cluster manager. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterManagerProvisioningState? ProvisioningState { get; set; } - /// - /// Field deprecated, this value will no longer influence the cluster manager allocation process and will be removed in a - /// future version. The size of the Azure virtual machines to use for hosting the cluster manager resource. - /// - string VMSize { get; set; } - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterManagerProperties.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterManagerProperties.json.cs deleted file mode 100644 index ddaec9eaa8d9..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterManagerProperties.json.cs +++ /dev/null @@ -1,157 +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.NetworkCloud.Models.Api20250201 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; - - /// ClusterManagerProperties represents the properties of a cluster manager. - public partial class ClusterManagerProperties - { - - /// - /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object - /// before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The JsonNode that should be deserialized into this object. - - partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json); - - /// - /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The JSON container that the serialization result will be placed in. - - partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container); - - /// - /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of - /// the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the - /// output parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The JsonNode that should be deserialized into this object. - /// Determines if the rest of the deserialization should be processed, or if the method should return - /// instantly. - - partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json, ref bool returnNow); - - /// - /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the - /// object before it is serialized. - /// If you wish to disable the default serialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The JSON container that the serialization result will be placed in. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, ref bool returnNow); - - /// - /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject into a new instance of . - /// - /// A Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject instance to deserialize from. - internal ClusterManagerProperties(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) - { - bool returnNow = false; - BeforeFromJson(json, ref returnNow); - if (returnNow) - { - return; - } - {_managedResourceGroupConfiguration = If( json?.PropertyT("managedResourceGroupConfiguration"), out var __jsonManagedResourceGroupConfiguration) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ManagedResourceGroupConfiguration.FromJson(__jsonManagedResourceGroupConfiguration) : ManagedResourceGroupConfiguration;} - {_managerExtendedLocation = If( json?.PropertyT("managerExtendedLocation"), out var __jsonManagerExtendedLocation) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ExtendedLocation.FromJson(__jsonManagerExtendedLocation) : ManagerExtendedLocation;} - {_analyticsWorkspaceId = If( json?.PropertyT("analyticsWorkspaceId"), out var __jsonAnalyticsWorkspaceId) ? (string)__jsonAnalyticsWorkspaceId : (string)AnalyticsWorkspaceId;} - {_availabilityZone = If( json?.PropertyT("availabilityZones"), out var __jsonAvailabilityZones) ? If( __jsonAvailabilityZones as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : AvailabilityZone;} - {_clusterVersion = If( json?.PropertyT("clusterVersions"), out var __jsonClusterVersions) ? If( __jsonClusterVersions as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IClusterAvailableVersion) (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ClusterAvailableVersion.FromJson(__p) )) ))() : null : ClusterVersion;} - {_detailedStatus = If( json?.PropertyT("detailedStatus"), out var __jsonDetailedStatus) ? (string)__jsonDetailedStatus : (string)DetailedStatus;} - {_detailedStatusMessage = If( json?.PropertyT("detailedStatusMessage"), out var __jsonDetailedStatusMessage) ? (string)__jsonDetailedStatusMessage : (string)DetailedStatusMessage;} - {_fabricControllerId = If( json?.PropertyT("fabricControllerId"), out var __jsonFabricControllerId) ? (string)__jsonFabricControllerId : (string)FabricControllerId;} - {_provisioningState = If( json?.PropertyT("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)ProvisioningState;} - {_vMSize = If( json?.PropertyT("vmSize"), out var __jsonVMSize) ? (string)__jsonVMSize : (string)VMSize;} - AfterFromJson(json); - } - - /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerProperties. - /// - /// a to deserialize from. - /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerProperties. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) - { - return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new ClusterManagerProperties(json) : null; - } - - /// - /// Serializes this instance of into a . - /// - /// The container to serialize this object into. If the caller - /// passes in null, a new instance will be created and returned to the caller. - /// Allows the caller to choose the depth of the serialization. See . - /// - /// a serialized instance of as a . - /// - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode) - { - container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject(); - - bool returnNow = false; - BeforeToJson(ref container, ref returnNow); - if (returnNow) - { - return container; - } - AddIf( null != this._managedResourceGroupConfiguration ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) this._managedResourceGroupConfiguration.ToJson(null,serializationMode) : null, "managedResourceGroupConfiguration" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) - { - AddIf( null != this._managerExtendedLocation ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) this._managerExtendedLocation.ToJson(null,serializationMode) : null, "managerExtendedLocation" ,container.Add ); - } - AddIf( null != (((object)this._analyticsWorkspaceId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._analyticsWorkspaceId.ToString()) : null, "analyticsWorkspaceId" ,container.Add ); - if (null != this._availabilityZone) - { - var __w = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.XNodeArray(); - foreach( var __x in this._availabilityZone ) - { - AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); - } - container.Add("availabilityZones",__w); - } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) - { - if (null != this._clusterVersion) - { - var __r = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.XNodeArray(); - foreach( var __s in this._clusterVersion ) - { - AddIf(__s?.ToJson(null, serializationMode) ,__r.Add); - } - container.Add("clusterVersions",__r); - } - } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) - { - AddIf( null != (((object)this._detailedStatus)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._detailedStatus.ToString()) : null, "detailedStatus" ,container.Add ); - } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) - { - AddIf( null != (((object)this._detailedStatusMessage)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._detailedStatusMessage.ToString()) : null, "detailedStatusMessage" ,container.Add ); - } - AddIf( null != (((object)this._fabricControllerId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._fabricControllerId.ToString()) : null, "fabricControllerId" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) - { - AddIf( null != (((object)this._provisioningState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._provisioningState.ToString()) : null, "provisioningState" ,container.Add ); - } - AddIf( null != (((object)this._vMSize)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._vMSize.ToString()) : null, "vmSize" ,container.Add ); - AfterToJson(ref container); - return container; - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterMetricsConfiguration.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterMetricsConfiguration.PowerShell.cs deleted file mode 100644 index e840fc55b28b..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterMetricsConfiguration.PowerShell.cs +++ /dev/null @@ -1,344 +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.NetworkCloud.Models.Api20250201 -{ - using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; - - /// - /// ClusterMetricsConfiguration represents the metrics configuration of an on-premises Network Cloud cluster. - /// - [System.ComponentModel.TypeConverter(typeof(ClusterMetricsConfigurationTypeConverter))] - public partial class ClusterMetricsConfiguration - { - - /// - /// 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 ClusterMetricsConfiguration(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("ExtendedLocation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationInternal)this).ExtendedLocation = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocation) content.GetValueForProperty("ExtendedLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationInternal)this).ExtendedLocation, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ExtendedLocationTypeConverter.ConvertFrom); - } - if (content.Contains("Property")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ClusterMetricsConfigurationPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Etag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationInternal)this).Etag, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)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("SystemDataCreatedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataLastModifiedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("SystemData")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.SystemDataTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Type, global::System.Convert.ToString); - } - if (content.Contains("Tag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.TrackedResourceTagsTypeConverter.ConvertFrom); - } - if (content.Contains("Location")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); - } - if (content.Contains("ExtendedLocationName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationInternal)this).ExtendedLocationName = (string) content.GetValueForProperty("ExtendedLocationName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationInternal)this).ExtendedLocationName, global::System.Convert.ToString); - } - if (content.Contains("ExtendedLocationType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationInternal)this).ExtendedLocationType = (string) content.GetValueForProperty("ExtendedLocationType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationInternal)this).ExtendedLocationType, global::System.Convert.ToString); - } - if (content.Contains("CollectionInterval")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationInternal)this).CollectionInterval = (long) content.GetValueForProperty("CollectionInterval",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationInternal)this).CollectionInterval, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("DetailedStatus")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationInternal)this).DetailedStatus = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterMetricsConfigurationDetailedStatus?) content.GetValueForProperty("DetailedStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationInternal)this).DetailedStatus, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterMetricsConfigurationDetailedStatus.CreateFrom); - } - if (content.Contains("DetailedStatusMessage")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationInternal)this).DetailedStatusMessage = (string) content.GetValueForProperty("DetailedStatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationInternal)this).DetailedStatusMessage, global::System.Convert.ToString); - } - if (content.Contains("DisabledMetric")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationInternal)this).DisabledMetric = (string[]) content.GetValueForProperty("DisabledMetric",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationInternal)this).DisabledMetric, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("EnabledMetric")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationInternal)this).EnabledMetric = (string[]) content.GetValueForProperty("EnabledMetric",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationInternal)this).EnabledMetric, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterMetricsConfigurationProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterMetricsConfigurationProvisioningState.CreateFrom); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal ClusterMetricsConfiguration(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("ExtendedLocation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationInternal)this).ExtendedLocation = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocation) content.GetValueForProperty("ExtendedLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationInternal)this).ExtendedLocation, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ExtendedLocationTypeConverter.ConvertFrom); - } - if (content.Contains("Property")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ClusterMetricsConfigurationPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Etag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationInternal)this).Etag, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)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("SystemDataCreatedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataLastModifiedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("SystemData")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.SystemDataTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Type, global::System.Convert.ToString); - } - if (content.Contains("Tag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.TrackedResourceTagsTypeConverter.ConvertFrom); - } - if (content.Contains("Location")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); - } - if (content.Contains("ExtendedLocationName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationInternal)this).ExtendedLocationName = (string) content.GetValueForProperty("ExtendedLocationName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationInternal)this).ExtendedLocationName, global::System.Convert.ToString); - } - if (content.Contains("ExtendedLocationType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationInternal)this).ExtendedLocationType = (string) content.GetValueForProperty("ExtendedLocationType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationInternal)this).ExtendedLocationType, global::System.Convert.ToString); - } - if (content.Contains("CollectionInterval")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationInternal)this).CollectionInterval = (long) content.GetValueForProperty("CollectionInterval",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationInternal)this).CollectionInterval, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("DetailedStatus")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationInternal)this).DetailedStatus = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterMetricsConfigurationDetailedStatus?) content.GetValueForProperty("DetailedStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationInternal)this).DetailedStatus, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterMetricsConfigurationDetailedStatus.CreateFrom); - } - if (content.Contains("DetailedStatusMessage")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationInternal)this).DetailedStatusMessage = (string) content.GetValueForProperty("DetailedStatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationInternal)this).DetailedStatusMessage, global::System.Convert.ToString); - } - if (content.Contains("DisabledMetric")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationInternal)this).DisabledMetric = (string[]) content.GetValueForProperty("DisabledMetric",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationInternal)this).DisabledMetric, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("EnabledMetric")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationInternal)this).EnabledMetric = (string[]) content.GetValueForProperty("EnabledMetric",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationInternal)this).EnabledMetric, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterMetricsConfigurationProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterMetricsConfigurationProvisioningState.CreateFrom); - } - AfterDeserializePSObject(content); - } - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfiguration DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new ClusterMetricsConfiguration(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.NetworkCloud.Models.Api20250201.IClusterMetricsConfiguration DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new ClusterMetricsConfiguration(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.NetworkCloud.Models.Api20250201.IClusterMetricsConfiguration FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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(); - } - } - /// ClusterMetricsConfiguration represents the metrics configuration of an on-premises Network Cloud cluster. - [System.ComponentModel.TypeConverter(typeof(ClusterMetricsConfigurationTypeConverter))] - public partial interface IClusterMetricsConfiguration - - { - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterMetricsConfiguration.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterMetricsConfiguration.cs deleted file mode 100644 index 6fd50d9e1aa3..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterMetricsConfiguration.cs +++ /dev/null @@ -1,305 +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.NetworkCloud.Models.Api20250201 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; - - /// - /// ClusterMetricsConfiguration represents the metrics configuration of an on-premises Network Cloud cluster. - /// - public partial class ClusterMetricsConfiguration : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfiguration, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationInternal, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IValidates - { - /// - /// Backing field for Inherited model - /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResource __trackedResource = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.TrackedResource(); - - /// The interval in minutes by which metrics will be collected. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public long CollectionInterval { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationPropertiesInternal)Property).CollectionInterval; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationPropertiesInternal)Property).CollectionInterval = value ; } - - /// The more detailed status of the metrics configuration. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterMetricsConfigurationDetailedStatus? DetailedStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationPropertiesInternal)Property).DetailedStatus; } - - /// The descriptive message about the current detailed status. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string DetailedStatusMessage { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationPropertiesInternal)Property).DetailedStatusMessage; } - - /// - /// The list of metrics that are available for the cluster but disabled at the moment. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string[] DisabledMetric { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationPropertiesInternal)Property).DisabledMetric; } - - /// - /// The list of metric names that have been chosen to be enabled in addition to the core set of enabled metrics. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string[] EnabledMetric { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationPropertiesInternal)Property).EnabledMetric; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationPropertiesInternal)Property).EnabledMetric = value ?? null /* arrayOf */; } - - /// Backing field for property. - private string _etag; - - /// Resource ETag. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string Etag { get => this._etag; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocation _extendedLocation; - - /// The extended location of the cluster associated with the resource. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocation ExtendedLocation { get => (this._extendedLocation = this._extendedLocation ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ExtendedLocation()); set => this._extendedLocation = value; } - - /// The resource ID of the extended location on which the resource will be created. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string ExtendedLocationName { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocationInternal)ExtendedLocation).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocationInternal)ExtendedLocation).Name = value ; } - - /// The extended location type, for example, CustomLocation. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string ExtendedLocationType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocationInternal)ExtendedLocation).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocationInternal)ExtendedLocation).Type = value ; } - - /// - /// Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).Id; } - - /// The geo-location where the resource lives - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)__trackedResource).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)__trackedResource).Location = value ; } - - /// Internal Acessors for DetailedStatus - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterMetricsConfigurationDetailedStatus? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationInternal.DetailedStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationPropertiesInternal)Property).DetailedStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationPropertiesInternal)Property).DetailedStatus = value; } - - /// Internal Acessors for DetailedStatusMessage - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationInternal.DetailedStatusMessage { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationPropertiesInternal)Property).DetailedStatusMessage; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationPropertiesInternal)Property).DetailedStatusMessage = value; } - - /// Internal Acessors for DisabledMetric - string[] Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationInternal.DisabledMetric { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationPropertiesInternal)Property).DisabledMetric; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationPropertiesInternal)Property).DisabledMetric = value; } - - /// Internal Acessors for Etag - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationInternal.Etag { get => this._etag; set { {_etag = value;} } } - - /// Internal Acessors for ExtendedLocation - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocation Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationInternal.ExtendedLocation { get => (this._extendedLocation = this._extendedLocation ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ExtendedLocation()); set { {_extendedLocation = value;} } } - - /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationProperties Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ClusterMetricsConfigurationProperties()); set { {_property = value;} } } - - /// Internal Acessors for ProvisioningState - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterMetricsConfigurationProvisioningState? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationPropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationPropertiesInternal)Property).ProvisioningState = value; } - - /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).Id = value; } - - /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).Name = value; } - - /// Internal Acessors for SystemData - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ISystemData Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal.SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemData; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemData = value; } - - /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).Type = value; } - - /// The name of the resource - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).Name; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationProperties _property; - - /// The list of the resource properties. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ClusterMetricsConfigurationProperties()); set => this._property = value; } - - /// The provisioning state of the metrics configuration. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterMetricsConfigurationProvisioningState? ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationPropertiesInternal)Property).ProvisioningState; } - - /// Gets the resource group name - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string ResourceGroupName { get => (new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Success ? new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Groups["resourceGroupName"].Value : null); } - - /// - /// Azure Resource Manager metadata containing createdBy and modifiedBy information. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ISystemData SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemData; } - - /// The timestamp of resource creation (UTC). - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataCreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataCreatedAt = value ?? default(global::System.DateTime); } - - /// The identity that created the resource. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataCreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataCreatedBy = value ?? null; } - - /// The type of identity that created the resource. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType? SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataCreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataCreatedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType)""); } - - /// The timestamp of resource last modification (UTC) - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataLastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataLastModifiedAt = value ?? default(global::System.DateTime); } - - /// The identity that last modified the resource. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataLastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataLastModifiedBy = value ?? null; } - - /// The type of identity that last modified the resource. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType? SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataLastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataLastModifiedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType)""); } - - /// Resource tags. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)__trackedResource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.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.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).Type; } - - /// Creates an new instance. - public ClusterMetricsConfiguration() - { - - } - - /// Validates that this object meets the validation criteria. - /// an instance that will receive validation - /// events. - /// - /// A that will be complete when validation is completed. - /// - public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) - { - await eventListener.AssertNotNull(nameof(__trackedResource), __trackedResource); - await eventListener.AssertObjectIsValid(nameof(__trackedResource), __trackedResource); - } - } - /// ClusterMetricsConfiguration represents the metrics configuration of an on-premises Network Cloud cluster. - public partial interface IClusterMetricsConfiguration : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResource - { - /// The interval in minutes by which metrics will be collected. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The interval in minutes by which metrics will be collected.", - SerializedName = @"collectionInterval", - PossibleTypes = new [] { typeof(long) })] - long CollectionInterval { get; set; } - /// The more detailed status of the metrics configuration. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The more detailed status of the metrics configuration.", - SerializedName = @"detailedStatus", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterMetricsConfigurationDetailedStatus) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterMetricsConfigurationDetailedStatus? DetailedStatus { get; } - /// The descriptive message about the current detailed status. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The descriptive message about the current detailed status.", - SerializedName = @"detailedStatusMessage", - PossibleTypes = new [] { typeof(string) })] - string DetailedStatusMessage { get; } - /// - /// The list of metrics that are available for the cluster but disabled at the moment. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The list of metrics that are available for the cluster but disabled at the moment.", - SerializedName = @"disabledMetrics", - PossibleTypes = new [] { typeof(string) })] - string[] DisabledMetric { get; } - /// - /// The list of metric names that have been chosen to be enabled in addition to the core set of enabled metrics. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The list of metric names that have been chosen to be enabled in addition to the core set of enabled metrics.", - SerializedName = @"enabledMetrics", - PossibleTypes = new [] { typeof(string) })] - string[] EnabledMetric { get; set; } - /// Resource ETag. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"Resource ETag.", - SerializedName = @"etag", - PossibleTypes = new [] { typeof(string) })] - string Etag { get; } - /// The resource ID of the extended location on which the resource will be created. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The resource ID of the extended location on which the resource will be created.", - SerializedName = @"name", - PossibleTypes = new [] { typeof(string) })] - string ExtendedLocationName { get; set; } - /// The extended location type, for example, CustomLocation. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The extended location type, for example, CustomLocation.", - SerializedName = @"type", - PossibleTypes = new [] { typeof(string) })] - string ExtendedLocationType { get; set; } - /// The provisioning state of the metrics configuration. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The provisioning state of the metrics configuration.", - SerializedName = @"provisioningState", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterMetricsConfigurationProvisioningState) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterMetricsConfigurationProvisioningState? ProvisioningState { get; } - - } - /// ClusterMetricsConfiguration represents the metrics configuration of an on-premises Network Cloud cluster. - internal partial interface IClusterMetricsConfigurationInternal : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal - { - /// The interval in minutes by which metrics will be collected. - long CollectionInterval { get; set; } - /// The more detailed status of the metrics configuration. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterMetricsConfigurationDetailedStatus? DetailedStatus { get; set; } - /// The descriptive message about the current detailed status. - string DetailedStatusMessage { get; set; } - /// - /// The list of metrics that are available for the cluster but disabled at the moment. - /// - string[] DisabledMetric { get; set; } - /// - /// The list of metric names that have been chosen to be enabled in addition to the core set of enabled metrics. - /// - string[] EnabledMetric { get; set; } - /// Resource ETag. - string Etag { get; set; } - /// The extended location of the cluster associated with the resource. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocation ExtendedLocation { get; set; } - /// The resource ID of the extended location on which the resource will be created. - string ExtendedLocationName { get; set; } - /// The extended location type, for example, CustomLocation. - string ExtendedLocationType { get; set; } - /// The list of the resource properties. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationProperties Property { get; set; } - /// The provisioning state of the metrics configuration. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterMetricsConfigurationProvisioningState? ProvisioningState { get; set; } - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterMetricsConfigurationList.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterMetricsConfigurationList.cs deleted file mode 100644 index 2c3538ba977c..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterMetricsConfigurationList.cs +++ /dev/null @@ -1,70 +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.NetworkCloud.Models.Api20250201 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; - - /// - /// ClusterMetricsConfigurationList represents a list of metrics configuration of the cluster. - /// - public partial class ClusterMetricsConfigurationList : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationList, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationListInternal - { - - /// Backing field for property. - private string _nextLink; - - /// The link used to get the next page of operations. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string NextLink { get => this._nextLink; set => this._nextLink = value; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfiguration[] _value; - - /// The list of metrics configurations. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfiguration[] Value { get => this._value; set => this._value = value; } - - /// Creates an new instance. - public ClusterMetricsConfigurationList() - { - - } - } - /// ClusterMetricsConfigurationList represents a list of metrics configuration of the cluster. - public partial interface IClusterMetricsConfigurationList : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable - { - /// The link used to get the next page of operations. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The link used to get the next page of operations.", - SerializedName = @"nextLink", - PossibleTypes = new [] { typeof(string) })] - string NextLink { get; set; } - /// The list of metrics configurations. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The list of metrics configurations.", - SerializedName = @"value", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfiguration) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfiguration[] Value { get; set; } - - } - /// ClusterMetricsConfigurationList represents a list of metrics configuration of the cluster. - internal partial interface IClusterMetricsConfigurationListInternal - - { - /// The link used to get the next page of operations. - string NextLink { get; set; } - /// The list of metrics configurations. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfiguration[] Value { get; set; } - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterMetricsConfigurationPatchParameters.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterMetricsConfigurationPatchParameters.PowerShell.cs deleted file mode 100644 index b3fc0cddc9c0..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterMetricsConfigurationPatchParameters.PowerShell.cs +++ /dev/null @@ -1,195 +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.NetworkCloud.Models.Api20250201 -{ - using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; - - /// - /// ClusterMetricsConfigurationPatchParameters represents the body of the request to patch the metrics configuration of cluster. - /// - [System.ComponentModel.TypeConverter(typeof(ClusterMetricsConfigurationPatchParametersTypeConverter))] - public partial class ClusterMetricsConfigurationPatchParameters - { - - /// - /// 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 ClusterMetricsConfigurationPatchParameters(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.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationPatchParametersInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationPatchProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationPatchParametersInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ClusterMetricsConfigurationPatchPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Tag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationPatchParametersInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationPatchParametersTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationPatchParametersInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ClusterMetricsConfigurationPatchParametersTagsTypeConverter.ConvertFrom); - } - if (content.Contains("CollectionInterval")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationPatchParametersInternal)this).CollectionInterval = (long?) content.GetValueForProperty("CollectionInterval",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationPatchParametersInternal)this).CollectionInterval, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("EnabledMetric")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationPatchParametersInternal)this).EnabledMetric = (string[]) content.GetValueForProperty("EnabledMetric",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationPatchParametersInternal)this).EnabledMetric, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal ClusterMetricsConfigurationPatchParameters(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.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationPatchParametersInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationPatchProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationPatchParametersInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ClusterMetricsConfigurationPatchPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Tag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationPatchParametersInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationPatchParametersTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationPatchParametersInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ClusterMetricsConfigurationPatchParametersTagsTypeConverter.ConvertFrom); - } - if (content.Contains("CollectionInterval")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationPatchParametersInternal)this).CollectionInterval = (long?) content.GetValueForProperty("CollectionInterval",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationPatchParametersInternal)this).CollectionInterval, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("EnabledMetric")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationPatchParametersInternal)this).EnabledMetric = (string[]) content.GetValueForProperty("EnabledMetric",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationPatchParametersInternal)this).EnabledMetric, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - AfterDeserializePSObject(content); - } - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationPatchParameters DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new ClusterMetricsConfigurationPatchParameters(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.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationPatchParameters DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new ClusterMetricsConfigurationPatchParameters(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.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationPatchParameters FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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(); - } - } - /// ClusterMetricsConfigurationPatchParameters represents the body of the request to patch the metrics configuration of cluster. - [System.ComponentModel.TypeConverter(typeof(ClusterMetricsConfigurationPatchParametersTypeConverter))] - public partial interface IClusterMetricsConfigurationPatchParameters - - { - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterMetricsConfigurationPatchParameters.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterMetricsConfigurationPatchParameters.cs deleted file mode 100644 index 86ac7a501315..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterMetricsConfigurationPatchParameters.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.NetworkCloud.Models.Api20250201 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; - - /// - /// ClusterMetricsConfigurationPatchParameters represents the body of the request to patch the metrics configuration of cluster. - /// - public partial class ClusterMetricsConfigurationPatchParameters : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationPatchParameters, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationPatchParametersInternal - { - - /// The interval in minutes by which metrics will be collected. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public long? CollectionInterval { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationPatchPropertiesInternal)Property).CollectionInterval; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationPatchPropertiesInternal)Property).CollectionInterval = value ?? default(long); } - - /// - /// The list of metric names that have been chosen to be enabled in addition to the core set of enabled metrics. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string[] EnabledMetric { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationPatchPropertiesInternal)Property).EnabledMetric; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationPatchPropertiesInternal)Property).EnabledMetric = value ?? null /* arrayOf */; } - - /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationPatchProperties Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationPatchParametersInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ClusterMetricsConfigurationPatchProperties()); set { {_property = value;} } } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationPatchProperties _property; - - /// The list of the resource properties. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationPatchProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ClusterMetricsConfigurationPatchProperties()); set => this._property = value; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationPatchParametersTags _tag; - - /// The Azure resource tags that will replace the existing ones. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationPatchParametersTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ClusterMetricsConfigurationPatchParametersTags()); set => this._tag = value; } - - /// - /// Creates an new instance. - /// - public ClusterMetricsConfigurationPatchParameters() - { - - } - } - /// ClusterMetricsConfigurationPatchParameters represents the body of the request to patch the metrics configuration of cluster. - public partial interface IClusterMetricsConfigurationPatchParameters : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable - { - /// The interval in minutes by which metrics will be collected. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The interval in minutes by which metrics will be collected.", - SerializedName = @"collectionInterval", - PossibleTypes = new [] { typeof(long) })] - long? CollectionInterval { get; set; } - /// - /// The list of metric names that have been chosen to be enabled in addition to the core set of enabled metrics. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The list of metric names that have been chosen to be enabled in addition to the core set of enabled metrics.", - SerializedName = @"enabledMetrics", - PossibleTypes = new [] { typeof(string) })] - string[] EnabledMetric { get; set; } - /// The Azure resource tags that will replace the existing ones. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The Azure resource tags that will replace the existing ones.", - SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationPatchParametersTags) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationPatchParametersTags Tag { get; set; } - - } - /// ClusterMetricsConfigurationPatchParameters represents the body of the request to patch the metrics configuration of cluster. - internal partial interface IClusterMetricsConfigurationPatchParametersInternal - - { - /// The interval in minutes by which metrics will be collected. - long? CollectionInterval { get; set; } - /// - /// The list of metric names that have been chosen to be enabled in addition to the core set of enabled metrics. - /// - string[] EnabledMetric { get; set; } - /// The list of the resource properties. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationPatchProperties Property { get; set; } - /// The Azure resource tags that will replace the existing ones. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationPatchParametersTags Tag { get; set; } - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterMetricsConfigurationProperties.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterMetricsConfigurationProperties.PowerShell.cs deleted file mode 100644 index 1ce5d7e0fd8e..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterMetricsConfigurationProperties.PowerShell.cs +++ /dev/null @@ -1,211 +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.NetworkCloud.Models.Api20250201 -{ - using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; - - /// - /// ClusterMetricsConfigurationProperties represents the properties of metrics configuration for the cluster. - /// - [System.ComponentModel.TypeConverter(typeof(ClusterMetricsConfigurationPropertiesTypeConverter))] - public partial class ClusterMetricsConfigurationProperties - { - - /// - /// 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 ClusterMetricsConfigurationProperties(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("CollectionInterval")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationPropertiesInternal)this).CollectionInterval = (long) content.GetValueForProperty("CollectionInterval",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationPropertiesInternal)this).CollectionInterval, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("DetailedStatus")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationPropertiesInternal)this).DetailedStatus = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterMetricsConfigurationDetailedStatus?) content.GetValueForProperty("DetailedStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationPropertiesInternal)this).DetailedStatus, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterMetricsConfigurationDetailedStatus.CreateFrom); - } - if (content.Contains("DetailedStatusMessage")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationPropertiesInternal)this).DetailedStatusMessage = (string) content.GetValueForProperty("DetailedStatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationPropertiesInternal)this).DetailedStatusMessage, global::System.Convert.ToString); - } - if (content.Contains("DisabledMetric")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationPropertiesInternal)this).DisabledMetric = (string[]) content.GetValueForProperty("DisabledMetric",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationPropertiesInternal)this).DisabledMetric, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("EnabledMetric")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationPropertiesInternal)this).EnabledMetric = (string[]) content.GetValueForProperty("EnabledMetric",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationPropertiesInternal)this).EnabledMetric, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationPropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterMetricsConfigurationProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationPropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterMetricsConfigurationProvisioningState.CreateFrom); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal ClusterMetricsConfigurationProperties(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("CollectionInterval")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationPropertiesInternal)this).CollectionInterval = (long) content.GetValueForProperty("CollectionInterval",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationPropertiesInternal)this).CollectionInterval, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("DetailedStatus")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationPropertiesInternal)this).DetailedStatus = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterMetricsConfigurationDetailedStatus?) content.GetValueForProperty("DetailedStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationPropertiesInternal)this).DetailedStatus, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterMetricsConfigurationDetailedStatus.CreateFrom); - } - if (content.Contains("DetailedStatusMessage")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationPropertiesInternal)this).DetailedStatusMessage = (string) content.GetValueForProperty("DetailedStatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationPropertiesInternal)this).DetailedStatusMessage, global::System.Convert.ToString); - } - if (content.Contains("DisabledMetric")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationPropertiesInternal)this).DisabledMetric = (string[]) content.GetValueForProperty("DisabledMetric",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationPropertiesInternal)this).DisabledMetric, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("EnabledMetric")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationPropertiesInternal)this).EnabledMetric = (string[]) content.GetValueForProperty("EnabledMetric",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationPropertiesInternal)this).EnabledMetric, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationPropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterMetricsConfigurationProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationPropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterMetricsConfigurationProvisioningState.CreateFrom); - } - AfterDeserializePSObject(content); - } - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new ClusterMetricsConfigurationProperties(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.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new ClusterMetricsConfigurationProperties(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.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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(); - } - } - /// ClusterMetricsConfigurationProperties represents the properties of metrics configuration for the cluster. - [System.ComponentModel.TypeConverter(typeof(ClusterMetricsConfigurationPropertiesTypeConverter))] - public partial interface IClusterMetricsConfigurationProperties - - { - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterMetricsConfigurationProperties.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterMetricsConfigurationProperties.cs deleted file mode 100644 index 6c0189a9cb15..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterMetricsConfigurationProperties.cs +++ /dev/null @@ -1,162 +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.NetworkCloud.Models.Api20250201 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; - - /// - /// ClusterMetricsConfigurationProperties represents the properties of metrics configuration for the cluster. - /// - public partial class ClusterMetricsConfigurationProperties : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationProperties, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationPropertiesInternal - { - - /// Backing field for property. - private long _collectionInterval; - - /// The interval in minutes by which metrics will be collected. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public long CollectionInterval { get => this._collectionInterval; set => this._collectionInterval = value; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterMetricsConfigurationDetailedStatus? _detailedStatus; - - /// The more detailed status of the metrics configuration. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterMetricsConfigurationDetailedStatus? DetailedStatus { get => this._detailedStatus; } - - /// Backing field for property. - private string _detailedStatusMessage; - - /// The descriptive message about the current detailed status. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string DetailedStatusMessage { get => this._detailedStatusMessage; } - - /// Backing field for property. - private string[] _disabledMetric; - - /// - /// The list of metrics that are available for the cluster but disabled at the moment. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string[] DisabledMetric { get => this._disabledMetric; } - - /// Backing field for property. - private string[] _enabledMetric; - - /// - /// The list of metric names that have been chosen to be enabled in addition to the core set of enabled metrics. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string[] EnabledMetric { get => this._enabledMetric; set => this._enabledMetric = value; } - - /// Internal Acessors for DetailedStatus - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterMetricsConfigurationDetailedStatus? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationPropertiesInternal.DetailedStatus { get => this._detailedStatus; set { {_detailedStatus = value;} } } - - /// Internal Acessors for DetailedStatusMessage - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationPropertiesInternal.DetailedStatusMessage { get => this._detailedStatusMessage; set { {_detailedStatusMessage = value;} } } - - /// Internal Acessors for DisabledMetric - string[] Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationPropertiesInternal.DisabledMetric { get => this._disabledMetric; set { {_disabledMetric = value;} } } - - /// Internal Acessors for ProvisioningState - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterMetricsConfigurationProvisioningState? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationPropertiesInternal.ProvisioningState { get => this._provisioningState; set { {_provisioningState = value;} } } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterMetricsConfigurationProvisioningState? _provisioningState; - - /// The provisioning state of the metrics configuration. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterMetricsConfigurationProvisioningState? ProvisioningState { get => this._provisioningState; } - - /// Creates an new instance. - public ClusterMetricsConfigurationProperties() - { - - } - } - /// ClusterMetricsConfigurationProperties represents the properties of metrics configuration for the cluster. - public partial interface IClusterMetricsConfigurationProperties : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable - { - /// The interval in minutes by which metrics will be collected. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The interval in minutes by which metrics will be collected.", - SerializedName = @"collectionInterval", - PossibleTypes = new [] { typeof(long) })] - long CollectionInterval { get; set; } - /// The more detailed status of the metrics configuration. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The more detailed status of the metrics configuration.", - SerializedName = @"detailedStatus", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterMetricsConfigurationDetailedStatus) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterMetricsConfigurationDetailedStatus? DetailedStatus { get; } - /// The descriptive message about the current detailed status. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The descriptive message about the current detailed status.", - SerializedName = @"detailedStatusMessage", - PossibleTypes = new [] { typeof(string) })] - string DetailedStatusMessage { get; } - /// - /// The list of metrics that are available for the cluster but disabled at the moment. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The list of metrics that are available for the cluster but disabled at the moment.", - SerializedName = @"disabledMetrics", - PossibleTypes = new [] { typeof(string) })] - string[] DisabledMetric { get; } - /// - /// The list of metric names that have been chosen to be enabled in addition to the core set of enabled metrics. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The list of metric names that have been chosen to be enabled in addition to the core set of enabled metrics.", - SerializedName = @"enabledMetrics", - PossibleTypes = new [] { typeof(string) })] - string[] EnabledMetric { get; set; } - /// The provisioning state of the metrics configuration. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The provisioning state of the metrics configuration.", - SerializedName = @"provisioningState", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterMetricsConfigurationProvisioningState) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterMetricsConfigurationProvisioningState? ProvisioningState { get; } - - } - /// ClusterMetricsConfigurationProperties represents the properties of metrics configuration for the cluster. - internal partial interface IClusterMetricsConfigurationPropertiesInternal - - { - /// The interval in minutes by which metrics will be collected. - long CollectionInterval { get; set; } - /// The more detailed status of the metrics configuration. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterMetricsConfigurationDetailedStatus? DetailedStatus { get; set; } - /// The descriptive message about the current detailed status. - string DetailedStatusMessage { get; set; } - /// - /// The list of metrics that are available for the cluster but disabled at the moment. - /// - string[] DisabledMetric { get; set; } - /// - /// The list of metric names that have been chosen to be enabled in addition to the core set of enabled metrics. - /// - string[] EnabledMetric { get; set; } - /// The provisioning state of the metrics configuration. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterMetricsConfigurationProvisioningState? ProvisioningState { get; set; } - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterPatchParameters.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterPatchParameters.PowerShell.cs deleted file mode 100644 index 053700cabca5..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterPatchParameters.PowerShell.cs +++ /dev/null @@ -1,592 +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.NetworkCloud.Models.Api20250201 -{ - using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; - - /// - /// ClusterPatchParameters represents the body of the request to patch the cluster properties. - /// - [System.ComponentModel.TypeConverter(typeof(ClusterPatchParametersTypeConverter))] - public partial class ClusterPatchParameters - { - - /// - /// 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 ClusterPatchParameters(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("Identity")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).Identity = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IManagedServiceIdentity) content.GetValueForProperty("Identity",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).Identity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ManagedServiceIdentityTypeConverter.ConvertFrom); - } - if (content.Contains("Property")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ClusterPatchPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Tag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ClusterPatchParametersTagsTypeConverter.ConvertFrom); - } - if (content.Contains("IdentityPrincipalId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).IdentityPrincipalId = (string) content.GetValueForProperty("IdentityPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).IdentityPrincipalId, global::System.Convert.ToString); - } - if (content.Contains("IdentityTenantId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).IdentityTenantId = (string) content.GetValueForProperty("IdentityTenantId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).IdentityTenantId, global::System.Convert.ToString); - } - if (content.Contains("IdentityType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).IdentityType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentityType) content.GetValueForProperty("IdentityType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).IdentityType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentityType.CreateFrom); - } - if (content.Contains("IdentityUserAssignedIdentity")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IUserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.UserAssignedIdentitiesTypeConverter.ConvertFrom); - } - if (content.Contains("AggregatorOrSingleRackDefinition")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).AggregatorOrSingleRackDefinition = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackDefinition) content.GetValueForProperty("AggregatorOrSingleRackDefinition",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).AggregatorOrSingleRackDefinition, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.RackDefinitionTypeConverter.ConvertFrom); - } - if (content.Contains("AnalyticsOutputSetting")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).AnalyticsOutputSetting = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAnalyticsOutputSettings) content.GetValueForProperty("AnalyticsOutputSetting",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).AnalyticsOutputSetting, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AnalyticsOutputSettingsTypeConverter.ConvertFrom); - } - if (content.Contains("ClusterServicePrincipal")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).ClusterServicePrincipal = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IServicePrincipalInformation) content.GetValueForProperty("ClusterServicePrincipal",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).ClusterServicePrincipal, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ServicePrincipalInformationTypeConverter.ConvertFrom); - } - if (content.Contains("CommandOutputSetting")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).CommandOutputSetting = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICommandOutputSettings) content.GetValueForProperty("CommandOutputSetting",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).CommandOutputSetting, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.CommandOutputSettingsTypeConverter.ConvertFrom); - } - if (content.Contains("ComputeDeploymentThreshold")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).ComputeDeploymentThreshold = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IValidationThreshold) content.GetValueForProperty("ComputeDeploymentThreshold",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).ComputeDeploymentThreshold, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ValidationThresholdTypeConverter.ConvertFrom); - } - if (content.Contains("RuntimeProtectionConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).RuntimeProtectionConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRuntimeProtectionConfiguration) content.GetValueForProperty("RuntimeProtectionConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).RuntimeProtectionConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.RuntimeProtectionConfigurationTypeConverter.ConvertFrom); - } - if (content.Contains("SecretArchive")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).SecretArchive = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterSecretArchive) content.GetValueForProperty("SecretArchive",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).SecretArchive, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ClusterSecretArchiveTypeConverter.ConvertFrom); - } - if (content.Contains("SecretArchiveSetting")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).SecretArchiveSetting = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretArchiveSettings) content.GetValueForProperty("SecretArchiveSetting",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).SecretArchiveSetting, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.SecretArchiveSettingsTypeConverter.ConvertFrom); - } - if (content.Contains("UpdateStrategy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).UpdateStrategy = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterUpdateStrategy) content.GetValueForProperty("UpdateStrategy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).UpdateStrategy, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ClusterUpdateStrategyTypeConverter.ConvertFrom); - } - if (content.Contains("VulnerabilityScanningSetting")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).VulnerabilityScanningSetting = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVulnerabilityScanningSettingsPatch) content.GetValueForProperty("VulnerabilityScanningSetting",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).VulnerabilityScanningSetting, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.VulnerabilityScanningSettingsPatchTypeConverter.ConvertFrom); - } - if (content.Contains("ClusterLocation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).ClusterLocation = (string) content.GetValueForProperty("ClusterLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).ClusterLocation, global::System.Convert.ToString); - } - if (content.Contains("ComputeRackDefinition")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).ComputeRackDefinition = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackDefinition[]) content.GetValueForProperty("ComputeRackDefinition",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).ComputeRackDefinition, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.RackDefinitionTypeConverter.ConvertFrom)); - } - if (content.Contains("CommandOutputSettingContainerUrl")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).CommandOutputSettingContainerUrl = (string) content.GetValueForProperty("CommandOutputSettingContainerUrl",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).CommandOutputSettingContainerUrl, global::System.Convert.ToString); - } - if (content.Contains("SecretArchiveSettingVaultUri")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).SecretArchiveSettingVaultUri = (string) content.GetValueForProperty("SecretArchiveSettingVaultUri",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).SecretArchiveSettingVaultUri, global::System.Convert.ToString); - } - if (content.Contains("VulnerabilityScanningSettingContainerScan")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).VulnerabilityScanningSettingContainerScan = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VulnerabilityScanningSettingsContainerScan?) content.GetValueForProperty("VulnerabilityScanningSettingContainerScan",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).VulnerabilityScanningSettingContainerScan, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VulnerabilityScanningSettingsContainerScan.CreateFrom); - } - if (content.Contains("AggregatorOrSingleRackDefinitionAvailabilityZone")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).AggregatorOrSingleRackDefinitionAvailabilityZone = (string) content.GetValueForProperty("AggregatorOrSingleRackDefinitionAvailabilityZone",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).AggregatorOrSingleRackDefinitionAvailabilityZone, global::System.Convert.ToString); - } - if (content.Contains("AggregatorOrSingleRackDefinitionBareMetalMachineConfigurationData")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).AggregatorOrSingleRackDefinitionBareMetalMachineConfigurationData = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineConfigurationData[]) content.GetValueForProperty("AggregatorOrSingleRackDefinitionBareMetalMachineConfigurationData",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).AggregatorOrSingleRackDefinitionBareMetalMachineConfigurationData, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BareMetalMachineConfigurationDataTypeConverter.ConvertFrom)); - } - if (content.Contains("AggregatorOrSingleRackDefinitionNetworkRackId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).AggregatorOrSingleRackDefinitionNetworkRackId = (string) content.GetValueForProperty("AggregatorOrSingleRackDefinitionNetworkRackId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).AggregatorOrSingleRackDefinitionNetworkRackId, global::System.Convert.ToString); - } - if (content.Contains("AggregatorOrSingleRackDefinitionRackLocation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).AggregatorOrSingleRackDefinitionRackLocation = (string) content.GetValueForProperty("AggregatorOrSingleRackDefinitionRackLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).AggregatorOrSingleRackDefinitionRackLocation, global::System.Convert.ToString); - } - if (content.Contains("AggregatorOrSingleRackDefinitionRackSerialNumber")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).AggregatorOrSingleRackDefinitionRackSerialNumber = (string) content.GetValueForProperty("AggregatorOrSingleRackDefinitionRackSerialNumber",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).AggregatorOrSingleRackDefinitionRackSerialNumber, global::System.Convert.ToString); - } - if (content.Contains("AggregatorOrSingleRackDefinitionRackSkuId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).AggregatorOrSingleRackDefinitionRackSkuId = (string) content.GetValueForProperty("AggregatorOrSingleRackDefinitionRackSkuId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).AggregatorOrSingleRackDefinitionRackSkuId, global::System.Convert.ToString); - } - if (content.Contains("AggregatorOrSingleRackDefinitionStorageApplianceConfigurationData")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).AggregatorOrSingleRackDefinitionStorageApplianceConfigurationData = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceConfigurationData[]) content.GetValueForProperty("AggregatorOrSingleRackDefinitionStorageApplianceConfigurationData",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).AggregatorOrSingleRackDefinitionStorageApplianceConfigurationData, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.StorageApplianceConfigurationDataTypeConverter.ConvertFrom)); - } - if (content.Contains("AnalyticOutputSettingAssociatedIdentity")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).AnalyticOutputSettingAssociatedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIdentitySelector) content.GetValueForProperty("AnalyticOutputSettingAssociatedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).AnalyticOutputSettingAssociatedIdentity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IdentitySelectorTypeConverter.ConvertFrom); - } - if (content.Contains("AnalyticOutputSettingAnalyticsWorkspaceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).AnalyticOutputSettingAnalyticsWorkspaceId = (string) content.GetValueForProperty("AnalyticOutputSettingAnalyticsWorkspaceId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).AnalyticOutputSettingAnalyticsWorkspaceId, global::System.Convert.ToString); - } - if (content.Contains("ClusterServicePrincipalApplicationId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).ClusterServicePrincipalApplicationId = (string) content.GetValueForProperty("ClusterServicePrincipalApplicationId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).ClusterServicePrincipalApplicationId, global::System.Convert.ToString); - } - if (content.Contains("ClusterServicePrincipalPassword")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).ClusterServicePrincipalPassword = (System.Security.SecureString) content.GetValueForProperty("ClusterServicePrincipalPassword",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).ClusterServicePrincipalPassword, (object ss) => (System.Security.SecureString)ss); - } - if (content.Contains("ClusterServicePrincipalId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).ClusterServicePrincipalId = (string) content.GetValueForProperty("ClusterServicePrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).ClusterServicePrincipalId, global::System.Convert.ToString); - } - if (content.Contains("ClusterServicePrincipalTenantId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).ClusterServicePrincipalTenantId = (string) content.GetValueForProperty("ClusterServicePrincipalTenantId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).ClusterServicePrincipalTenantId, global::System.Convert.ToString); - } - if (content.Contains("CommandOutputSettingAssociatedIdentity")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).CommandOutputSettingAssociatedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIdentitySelector) content.GetValueForProperty("CommandOutputSettingAssociatedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).CommandOutputSettingAssociatedIdentity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IdentitySelectorTypeConverter.ConvertFrom); - } - if (content.Contains("ComputeDeploymentThresholdGrouping")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).ComputeDeploymentThresholdGrouping = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdGrouping) content.GetValueForProperty("ComputeDeploymentThresholdGrouping",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).ComputeDeploymentThresholdGrouping, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdGrouping.CreateFrom); - } - if (content.Contains("ComputeDeploymentThresholdType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).ComputeDeploymentThresholdType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdType) content.GetValueForProperty("ComputeDeploymentThresholdType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).ComputeDeploymentThresholdType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdType.CreateFrom); - } - if (content.Contains("ComputeDeploymentThresholdValue")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).ComputeDeploymentThresholdValue = (long) content.GetValueForProperty("ComputeDeploymentThresholdValue",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).ComputeDeploymentThresholdValue, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("RuntimeProtectionConfigurationEnforcementLevel")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).RuntimeProtectionConfigurationEnforcementLevel = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RuntimeProtectionEnforcementLevel?) content.GetValueForProperty("RuntimeProtectionConfigurationEnforcementLevel",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).RuntimeProtectionConfigurationEnforcementLevel, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RuntimeProtectionEnforcementLevel.CreateFrom); - } - if (content.Contains("SecretArchiveKeyVaultId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).SecretArchiveKeyVaultId = (string) content.GetValueForProperty("SecretArchiveKeyVaultId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).SecretArchiveKeyVaultId, global::System.Convert.ToString); - } - if (content.Contains("SecretArchiveUseKeyVault")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).SecretArchiveUseKeyVault = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterSecretArchiveEnabled?) content.GetValueForProperty("SecretArchiveUseKeyVault",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).SecretArchiveUseKeyVault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterSecretArchiveEnabled.CreateFrom); - } - if (content.Contains("SecretArchiveSettingAssociatedIdentity")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).SecretArchiveSettingAssociatedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIdentitySelector) content.GetValueForProperty("SecretArchiveSettingAssociatedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).SecretArchiveSettingAssociatedIdentity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IdentitySelectorTypeConverter.ConvertFrom); - } - if (content.Contains("UpdateStrategyMaxUnavailable")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).UpdateStrategyMaxUnavailable = (long?) content.GetValueForProperty("UpdateStrategyMaxUnavailable",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).UpdateStrategyMaxUnavailable, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("UpdateStrategyType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).UpdateStrategyType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterUpdateStrategyType) content.GetValueForProperty("UpdateStrategyType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).UpdateStrategyType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterUpdateStrategyType.CreateFrom); - } - if (content.Contains("UpdateStrategyThresholdType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).UpdateStrategyThresholdType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdType) content.GetValueForProperty("UpdateStrategyThresholdType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).UpdateStrategyThresholdType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdType.CreateFrom); - } - if (content.Contains("UpdateStrategyThresholdValue")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).UpdateStrategyThresholdValue = (long) content.GetValueForProperty("UpdateStrategyThresholdValue",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).UpdateStrategyThresholdValue, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("UpdateStrategyWaitTimeMinute")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).UpdateStrategyWaitTimeMinute = (long?) content.GetValueForProperty("UpdateStrategyWaitTimeMinute",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).UpdateStrategyWaitTimeMinute, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("AnalyticsOutputSettingsAssociatedIdentityType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).AnalyticsOutputSettingsAssociatedIdentityType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType?) content.GetValueForProperty("AnalyticsOutputSettingsAssociatedIdentityType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).AnalyticsOutputSettingsAssociatedIdentityType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType.CreateFrom); - } - if (content.Contains("AnalyticsOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).AnalyticsOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId = (string) content.GetValueForProperty("AnalyticsOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).AnalyticsOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId, global::System.Convert.ToString); - } - if (content.Contains("CommandOutputSettingsAssociatedIdentityType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).CommandOutputSettingsAssociatedIdentityType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType?) content.GetValueForProperty("CommandOutputSettingsAssociatedIdentityType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).CommandOutputSettingsAssociatedIdentityType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType.CreateFrom); - } - if (content.Contains("CommandOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).CommandOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId = (string) content.GetValueForProperty("CommandOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).CommandOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId, global::System.Convert.ToString); - } - if (content.Contains("SecretArchiveSettingsAssociatedIdentityType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).SecretArchiveSettingsAssociatedIdentityType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType?) content.GetValueForProperty("SecretArchiveSettingsAssociatedIdentityType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).SecretArchiveSettingsAssociatedIdentityType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType.CreateFrom); - } - if (content.Contains("SecretArchiveSettingsAssociatedIdentityUserAssignedIdentityResourceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).SecretArchiveSettingsAssociatedIdentityUserAssignedIdentityResourceId = (string) content.GetValueForProperty("SecretArchiveSettingsAssociatedIdentityUserAssignedIdentityResourceId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).SecretArchiveSettingsAssociatedIdentityUserAssignedIdentityResourceId, 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 ClusterPatchParameters(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("Identity")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).Identity = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IManagedServiceIdentity) content.GetValueForProperty("Identity",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).Identity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ManagedServiceIdentityTypeConverter.ConvertFrom); - } - if (content.Contains("Property")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ClusterPatchPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Tag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ClusterPatchParametersTagsTypeConverter.ConvertFrom); - } - if (content.Contains("IdentityPrincipalId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).IdentityPrincipalId = (string) content.GetValueForProperty("IdentityPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).IdentityPrincipalId, global::System.Convert.ToString); - } - if (content.Contains("IdentityTenantId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).IdentityTenantId = (string) content.GetValueForProperty("IdentityTenantId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).IdentityTenantId, global::System.Convert.ToString); - } - if (content.Contains("IdentityType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).IdentityType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentityType) content.GetValueForProperty("IdentityType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).IdentityType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentityType.CreateFrom); - } - if (content.Contains("IdentityUserAssignedIdentity")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IUserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.UserAssignedIdentitiesTypeConverter.ConvertFrom); - } - if (content.Contains("AggregatorOrSingleRackDefinition")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).AggregatorOrSingleRackDefinition = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackDefinition) content.GetValueForProperty("AggregatorOrSingleRackDefinition",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).AggregatorOrSingleRackDefinition, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.RackDefinitionTypeConverter.ConvertFrom); - } - if (content.Contains("AnalyticsOutputSetting")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).AnalyticsOutputSetting = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAnalyticsOutputSettings) content.GetValueForProperty("AnalyticsOutputSetting",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).AnalyticsOutputSetting, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AnalyticsOutputSettingsTypeConverter.ConvertFrom); - } - if (content.Contains("ClusterServicePrincipal")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).ClusterServicePrincipal = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IServicePrincipalInformation) content.GetValueForProperty("ClusterServicePrincipal",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).ClusterServicePrincipal, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ServicePrincipalInformationTypeConverter.ConvertFrom); - } - if (content.Contains("CommandOutputSetting")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).CommandOutputSetting = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICommandOutputSettings) content.GetValueForProperty("CommandOutputSetting",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).CommandOutputSetting, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.CommandOutputSettingsTypeConverter.ConvertFrom); - } - if (content.Contains("ComputeDeploymentThreshold")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).ComputeDeploymentThreshold = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IValidationThreshold) content.GetValueForProperty("ComputeDeploymentThreshold",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).ComputeDeploymentThreshold, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ValidationThresholdTypeConverter.ConvertFrom); - } - if (content.Contains("RuntimeProtectionConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).RuntimeProtectionConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRuntimeProtectionConfiguration) content.GetValueForProperty("RuntimeProtectionConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).RuntimeProtectionConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.RuntimeProtectionConfigurationTypeConverter.ConvertFrom); - } - if (content.Contains("SecretArchive")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).SecretArchive = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterSecretArchive) content.GetValueForProperty("SecretArchive",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).SecretArchive, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ClusterSecretArchiveTypeConverter.ConvertFrom); - } - if (content.Contains("SecretArchiveSetting")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).SecretArchiveSetting = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretArchiveSettings) content.GetValueForProperty("SecretArchiveSetting",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).SecretArchiveSetting, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.SecretArchiveSettingsTypeConverter.ConvertFrom); - } - if (content.Contains("UpdateStrategy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).UpdateStrategy = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterUpdateStrategy) content.GetValueForProperty("UpdateStrategy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).UpdateStrategy, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ClusterUpdateStrategyTypeConverter.ConvertFrom); - } - if (content.Contains("VulnerabilityScanningSetting")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).VulnerabilityScanningSetting = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVulnerabilityScanningSettingsPatch) content.GetValueForProperty("VulnerabilityScanningSetting",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).VulnerabilityScanningSetting, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.VulnerabilityScanningSettingsPatchTypeConverter.ConvertFrom); - } - if (content.Contains("ClusterLocation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).ClusterLocation = (string) content.GetValueForProperty("ClusterLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).ClusterLocation, global::System.Convert.ToString); - } - if (content.Contains("ComputeRackDefinition")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).ComputeRackDefinition = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackDefinition[]) content.GetValueForProperty("ComputeRackDefinition",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).ComputeRackDefinition, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.RackDefinitionTypeConverter.ConvertFrom)); - } - if (content.Contains("CommandOutputSettingContainerUrl")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).CommandOutputSettingContainerUrl = (string) content.GetValueForProperty("CommandOutputSettingContainerUrl",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).CommandOutputSettingContainerUrl, global::System.Convert.ToString); - } - if (content.Contains("SecretArchiveSettingVaultUri")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).SecretArchiveSettingVaultUri = (string) content.GetValueForProperty("SecretArchiveSettingVaultUri",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).SecretArchiveSettingVaultUri, global::System.Convert.ToString); - } - if (content.Contains("VulnerabilityScanningSettingContainerScan")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).VulnerabilityScanningSettingContainerScan = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VulnerabilityScanningSettingsContainerScan?) content.GetValueForProperty("VulnerabilityScanningSettingContainerScan",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).VulnerabilityScanningSettingContainerScan, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VulnerabilityScanningSettingsContainerScan.CreateFrom); - } - if (content.Contains("AggregatorOrSingleRackDefinitionAvailabilityZone")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).AggregatorOrSingleRackDefinitionAvailabilityZone = (string) content.GetValueForProperty("AggregatorOrSingleRackDefinitionAvailabilityZone",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).AggregatorOrSingleRackDefinitionAvailabilityZone, global::System.Convert.ToString); - } - if (content.Contains("AggregatorOrSingleRackDefinitionBareMetalMachineConfigurationData")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).AggregatorOrSingleRackDefinitionBareMetalMachineConfigurationData = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineConfigurationData[]) content.GetValueForProperty("AggregatorOrSingleRackDefinitionBareMetalMachineConfigurationData",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).AggregatorOrSingleRackDefinitionBareMetalMachineConfigurationData, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BareMetalMachineConfigurationDataTypeConverter.ConvertFrom)); - } - if (content.Contains("AggregatorOrSingleRackDefinitionNetworkRackId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).AggregatorOrSingleRackDefinitionNetworkRackId = (string) content.GetValueForProperty("AggregatorOrSingleRackDefinitionNetworkRackId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).AggregatorOrSingleRackDefinitionNetworkRackId, global::System.Convert.ToString); - } - if (content.Contains("AggregatorOrSingleRackDefinitionRackLocation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).AggregatorOrSingleRackDefinitionRackLocation = (string) content.GetValueForProperty("AggregatorOrSingleRackDefinitionRackLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).AggregatorOrSingleRackDefinitionRackLocation, global::System.Convert.ToString); - } - if (content.Contains("AggregatorOrSingleRackDefinitionRackSerialNumber")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).AggregatorOrSingleRackDefinitionRackSerialNumber = (string) content.GetValueForProperty("AggregatorOrSingleRackDefinitionRackSerialNumber",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).AggregatorOrSingleRackDefinitionRackSerialNumber, global::System.Convert.ToString); - } - if (content.Contains("AggregatorOrSingleRackDefinitionRackSkuId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).AggregatorOrSingleRackDefinitionRackSkuId = (string) content.GetValueForProperty("AggregatorOrSingleRackDefinitionRackSkuId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).AggregatorOrSingleRackDefinitionRackSkuId, global::System.Convert.ToString); - } - if (content.Contains("AggregatorOrSingleRackDefinitionStorageApplianceConfigurationData")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).AggregatorOrSingleRackDefinitionStorageApplianceConfigurationData = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceConfigurationData[]) content.GetValueForProperty("AggregatorOrSingleRackDefinitionStorageApplianceConfigurationData",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).AggregatorOrSingleRackDefinitionStorageApplianceConfigurationData, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.StorageApplianceConfigurationDataTypeConverter.ConvertFrom)); - } - if (content.Contains("AnalyticOutputSettingAssociatedIdentity")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).AnalyticOutputSettingAssociatedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIdentitySelector) content.GetValueForProperty("AnalyticOutputSettingAssociatedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).AnalyticOutputSettingAssociatedIdentity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IdentitySelectorTypeConverter.ConvertFrom); - } - if (content.Contains("AnalyticOutputSettingAnalyticsWorkspaceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).AnalyticOutputSettingAnalyticsWorkspaceId = (string) content.GetValueForProperty("AnalyticOutputSettingAnalyticsWorkspaceId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).AnalyticOutputSettingAnalyticsWorkspaceId, global::System.Convert.ToString); - } - if (content.Contains("ClusterServicePrincipalApplicationId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).ClusterServicePrincipalApplicationId = (string) content.GetValueForProperty("ClusterServicePrincipalApplicationId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).ClusterServicePrincipalApplicationId, global::System.Convert.ToString); - } - if (content.Contains("ClusterServicePrincipalPassword")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).ClusterServicePrincipalPassword = (System.Security.SecureString) content.GetValueForProperty("ClusterServicePrincipalPassword",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).ClusterServicePrincipalPassword, (object ss) => (System.Security.SecureString)ss); - } - if (content.Contains("ClusterServicePrincipalId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).ClusterServicePrincipalId = (string) content.GetValueForProperty("ClusterServicePrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).ClusterServicePrincipalId, global::System.Convert.ToString); - } - if (content.Contains("ClusterServicePrincipalTenantId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).ClusterServicePrincipalTenantId = (string) content.GetValueForProperty("ClusterServicePrincipalTenantId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).ClusterServicePrincipalTenantId, global::System.Convert.ToString); - } - if (content.Contains("CommandOutputSettingAssociatedIdentity")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).CommandOutputSettingAssociatedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIdentitySelector) content.GetValueForProperty("CommandOutputSettingAssociatedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).CommandOutputSettingAssociatedIdentity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IdentitySelectorTypeConverter.ConvertFrom); - } - if (content.Contains("ComputeDeploymentThresholdGrouping")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).ComputeDeploymentThresholdGrouping = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdGrouping) content.GetValueForProperty("ComputeDeploymentThresholdGrouping",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).ComputeDeploymentThresholdGrouping, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdGrouping.CreateFrom); - } - if (content.Contains("ComputeDeploymentThresholdType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).ComputeDeploymentThresholdType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdType) content.GetValueForProperty("ComputeDeploymentThresholdType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).ComputeDeploymentThresholdType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdType.CreateFrom); - } - if (content.Contains("ComputeDeploymentThresholdValue")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).ComputeDeploymentThresholdValue = (long) content.GetValueForProperty("ComputeDeploymentThresholdValue",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).ComputeDeploymentThresholdValue, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("RuntimeProtectionConfigurationEnforcementLevel")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).RuntimeProtectionConfigurationEnforcementLevel = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RuntimeProtectionEnforcementLevel?) content.GetValueForProperty("RuntimeProtectionConfigurationEnforcementLevel",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).RuntimeProtectionConfigurationEnforcementLevel, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RuntimeProtectionEnforcementLevel.CreateFrom); - } - if (content.Contains("SecretArchiveKeyVaultId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).SecretArchiveKeyVaultId = (string) content.GetValueForProperty("SecretArchiveKeyVaultId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).SecretArchiveKeyVaultId, global::System.Convert.ToString); - } - if (content.Contains("SecretArchiveUseKeyVault")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).SecretArchiveUseKeyVault = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterSecretArchiveEnabled?) content.GetValueForProperty("SecretArchiveUseKeyVault",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).SecretArchiveUseKeyVault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterSecretArchiveEnabled.CreateFrom); - } - if (content.Contains("SecretArchiveSettingAssociatedIdentity")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).SecretArchiveSettingAssociatedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIdentitySelector) content.GetValueForProperty("SecretArchiveSettingAssociatedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).SecretArchiveSettingAssociatedIdentity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IdentitySelectorTypeConverter.ConvertFrom); - } - if (content.Contains("UpdateStrategyMaxUnavailable")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).UpdateStrategyMaxUnavailable = (long?) content.GetValueForProperty("UpdateStrategyMaxUnavailable",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).UpdateStrategyMaxUnavailable, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("UpdateStrategyType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).UpdateStrategyType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterUpdateStrategyType) content.GetValueForProperty("UpdateStrategyType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).UpdateStrategyType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterUpdateStrategyType.CreateFrom); - } - if (content.Contains("UpdateStrategyThresholdType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).UpdateStrategyThresholdType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdType) content.GetValueForProperty("UpdateStrategyThresholdType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).UpdateStrategyThresholdType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdType.CreateFrom); - } - if (content.Contains("UpdateStrategyThresholdValue")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).UpdateStrategyThresholdValue = (long) content.GetValueForProperty("UpdateStrategyThresholdValue",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).UpdateStrategyThresholdValue, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("UpdateStrategyWaitTimeMinute")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).UpdateStrategyWaitTimeMinute = (long?) content.GetValueForProperty("UpdateStrategyWaitTimeMinute",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).UpdateStrategyWaitTimeMinute, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("AnalyticsOutputSettingsAssociatedIdentityType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).AnalyticsOutputSettingsAssociatedIdentityType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType?) content.GetValueForProperty("AnalyticsOutputSettingsAssociatedIdentityType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).AnalyticsOutputSettingsAssociatedIdentityType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType.CreateFrom); - } - if (content.Contains("AnalyticsOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).AnalyticsOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId = (string) content.GetValueForProperty("AnalyticsOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).AnalyticsOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId, global::System.Convert.ToString); - } - if (content.Contains("CommandOutputSettingsAssociatedIdentityType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).CommandOutputSettingsAssociatedIdentityType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType?) content.GetValueForProperty("CommandOutputSettingsAssociatedIdentityType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).CommandOutputSettingsAssociatedIdentityType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType.CreateFrom); - } - if (content.Contains("CommandOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).CommandOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId = (string) content.GetValueForProperty("CommandOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).CommandOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId, global::System.Convert.ToString); - } - if (content.Contains("SecretArchiveSettingsAssociatedIdentityType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).SecretArchiveSettingsAssociatedIdentityType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType?) content.GetValueForProperty("SecretArchiveSettingsAssociatedIdentityType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).SecretArchiveSettingsAssociatedIdentityType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType.CreateFrom); - } - if (content.Contains("SecretArchiveSettingsAssociatedIdentityUserAssignedIdentityResourceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).SecretArchiveSettingsAssociatedIdentityUserAssignedIdentityResourceId = (string) content.GetValueForProperty("SecretArchiveSettingsAssociatedIdentityUserAssignedIdentityResourceId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal)this).SecretArchiveSettingsAssociatedIdentityUserAssignedIdentityResourceId, 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.NetworkCloud.Models.Api20250201.IClusterPatchParameters DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new ClusterPatchParameters(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.NetworkCloud.Models.Api20250201.IClusterPatchParameters DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new ClusterPatchParameters(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.NetworkCloud.Models.Api20250201.IClusterPatchParameters FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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(); - } - } - /// ClusterPatchParameters represents the body of the request to patch the cluster properties. - [System.ComponentModel.TypeConverter(typeof(ClusterPatchParametersTypeConverter))] - public partial interface IClusterPatchParameters - - { - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterPatchParameters.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterPatchParameters.cs deleted file mode 100644 index d6b9b59448b8..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterPatchParameters.cs +++ /dev/null @@ -1,811 +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.NetworkCloud.Models.Api20250201 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; - - /// - /// ClusterPatchParameters represents the body of the request to patch the cluster properties. - /// - public partial class ClusterPatchParameters : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParameters, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal - { - - /// - /// The zone name used for this rack when created. Availability zones are used for workload placement. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string AggregatorOrSingleRackDefinitionAvailabilityZone { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)Property).AggregatorOrSingleRackDefinitionAvailabilityZone; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)Property).AggregatorOrSingleRackDefinitionAvailabilityZone = value ?? null; } - - /// The unordered list of bare metal machine configuration. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineConfigurationData[] AggregatorOrSingleRackDefinitionBareMetalMachineConfigurationData { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)Property).AggregatorOrSingleRackDefinitionBareMetalMachineConfigurationData; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)Property).AggregatorOrSingleRackDefinitionBareMetalMachineConfigurationData = value ?? null /* arrayOf */; } - - /// The resource ID of the network rack that matches this rack definition. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string AggregatorOrSingleRackDefinitionNetworkRackId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)Property).AggregatorOrSingleRackDefinitionNetworkRackId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)Property).AggregatorOrSingleRackDefinitionNetworkRackId = value ?? null; } - - /// The free-form description of the rack's location. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string AggregatorOrSingleRackDefinitionRackLocation { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)Property).AggregatorOrSingleRackDefinitionRackLocation; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)Property).AggregatorOrSingleRackDefinitionRackLocation = value ?? null; } - - /// - /// The unique identifier for the rack within Network Cloud cluster. An alternate unique alphanumeric value other than a serial - /// number may be provided if desired. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string AggregatorOrSingleRackDefinitionRackSerialNumber { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)Property).AggregatorOrSingleRackDefinitionRackSerialNumber; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)Property).AggregatorOrSingleRackDefinitionRackSerialNumber = value ?? null; } - - /// The resource ID of the sku for the rack being added. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string AggregatorOrSingleRackDefinitionRackSkuId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)Property).AggregatorOrSingleRackDefinitionRackSkuId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)Property).AggregatorOrSingleRackDefinitionRackSkuId = value ?? null; } - - /// The list of storage appliance configuration data for this rack. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceConfigurationData[] AggregatorOrSingleRackDefinitionStorageApplianceConfigurationData { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)Property).AggregatorOrSingleRackDefinitionStorageApplianceConfigurationData; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)Property).AggregatorOrSingleRackDefinitionStorageApplianceConfigurationData = value ?? null /* arrayOf */; } - - /// - /// The resource ID of the analytics workspace that is to be used by the specified identity. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string AnalyticOutputSettingAnalyticsWorkspaceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)Property).AnalyticOutputSettingAnalyticsWorkspaceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)Property).AnalyticOutputSettingAnalyticsWorkspaceId = value ?? null; } - - /// The type of managed identity that is being selected. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType? AnalyticsOutputSettingsAssociatedIdentityType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)Property).AnalyticsOutputSettingsAssociatedIdentityType; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)Property).AnalyticsOutputSettingsAssociatedIdentityType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType)""); } - - /// - /// The user assigned managed identity resource ID to use. Mutually exclusive with a system assigned identity type. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string AnalyticsOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)Property).AnalyticsOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)Property).AnalyticsOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId = value ?? null; } - - /// - /// The customer-provided location information to identify where the cluster resides. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string ClusterLocation { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)Property).ClusterLocation; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)Property).ClusterLocation = value ?? null; } - - /// The application ID, also known as client ID, of the service principal. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string ClusterServicePrincipalApplicationId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)Property).ClusterServicePrincipalApplicationId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)Property).ClusterServicePrincipalApplicationId = value ?? null; } - - /// The principal ID, also known as the object ID, of the service principal. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string ClusterServicePrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)Property).ClusterServicePrincipalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)Property).ClusterServicePrincipalId = value ?? null; } - - /// The password of the service principal. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public System.Security.SecureString ClusterServicePrincipalPassword { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)Property).ClusterServicePrincipalPassword; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)Property).ClusterServicePrincipalPassword = value ?? null; } - - /// - /// The tenant ID, also known as the directory ID, of the tenant in which the service principal is created. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string ClusterServicePrincipalTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)Property).ClusterServicePrincipalTenantId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)Property).ClusterServicePrincipalTenantId = value ?? null; } - - /// - /// The URL of the storage account container that is to be used by the specified identities. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string CommandOutputSettingContainerUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)Property).CommandOutputSettingContainerUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)Property).CommandOutputSettingContainerUrl = value ?? null; } - - /// The type of managed identity that is being selected. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType? CommandOutputSettingsAssociatedIdentityType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)Property).CommandOutputSettingsAssociatedIdentityType; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)Property).CommandOutputSettingsAssociatedIdentityType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType)""); } - - /// - /// The user assigned managed identity resource ID to use. Mutually exclusive with a system assigned identity type. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string CommandOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)Property).CommandOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)Property).CommandOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId = value ?? null; } - - /// Selection of how the type evaluation is applied to the cluster calculation. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdGrouping? ComputeDeploymentThresholdGrouping { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)Property).ComputeDeploymentThresholdGrouping; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)Property).ComputeDeploymentThresholdGrouping = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdGrouping)""); } - - /// Selection of how the threshold should be evaluated. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdType? ComputeDeploymentThresholdType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)Property).ComputeDeploymentThresholdType; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)Property).ComputeDeploymentThresholdType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdType)""); } - - /// The numeric threshold value. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public long? ComputeDeploymentThresholdValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)Property).ComputeDeploymentThresholdValue; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)Property).ComputeDeploymentThresholdValue = value ?? default(long); } - - /// - /// The list of rack definitions for the compute racks in a multi-rack cluster, or an empty list in a single-rack cluster. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackDefinition[] ComputeRackDefinition { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)Property).ComputeRackDefinition; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)Property).ComputeRackDefinition = value ?? null /* arrayOf */; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IManagedServiceIdentity _identity; - - /// The identity for the resource. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IManagedServiceIdentity Identity { get => (this._identity = this._identity ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ManagedServiceIdentity()); 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.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string IdentityPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.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.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string IdentityTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IManagedServiceIdentityInternal)Identity).TenantId; } - - /// - /// Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentityType? IdentityType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IManagedServiceIdentityInternal)Identity).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IManagedServiceIdentityInternal)Identity).Type = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentityType)""); } - - /// - /// 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.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IUserAssignedIdentities IdentityUserAssignedIdentity { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IManagedServiceIdentityInternal)Identity).UserAssignedIdentity; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IManagedServiceIdentityInternal)Identity).UserAssignedIdentity = value ?? null /* model class */; } - - /// Internal Acessors for AggregatorOrSingleRackDefinition - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackDefinition Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal.AggregatorOrSingleRackDefinition { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)Property).AggregatorOrSingleRackDefinition; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)Property).AggregatorOrSingleRackDefinition = value; } - - /// Internal Acessors for AnalyticOutputSettingAssociatedIdentity - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIdentitySelector Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal.AnalyticOutputSettingAssociatedIdentity { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)Property).AnalyticOutputSettingAssociatedIdentity; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)Property).AnalyticOutputSettingAssociatedIdentity = value; } - - /// Internal Acessors for AnalyticsOutputSetting - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAnalyticsOutputSettings Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal.AnalyticsOutputSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)Property).AnalyticsOutputSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)Property).AnalyticsOutputSetting = value; } - - /// Internal Acessors for ClusterServicePrincipal - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IServicePrincipalInformation Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal.ClusterServicePrincipal { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)Property).ClusterServicePrincipal; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)Property).ClusterServicePrincipal = value; } - - /// Internal Acessors for CommandOutputSetting - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICommandOutputSettings Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal.CommandOutputSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)Property).CommandOutputSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)Property).CommandOutputSetting = value; } - - /// Internal Acessors for CommandOutputSettingAssociatedIdentity - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIdentitySelector Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal.CommandOutputSettingAssociatedIdentity { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)Property).CommandOutputSettingAssociatedIdentity; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)Property).CommandOutputSettingAssociatedIdentity = value; } - - /// Internal Acessors for ComputeDeploymentThreshold - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IValidationThreshold Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal.ComputeDeploymentThreshold { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)Property).ComputeDeploymentThreshold; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)Property).ComputeDeploymentThreshold = value; } - - /// Internal Acessors for Identity - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IManagedServiceIdentity Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal.Identity { get => (this._identity = this._identity ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ManagedServiceIdentity()); set { {_identity = value;} } } - - /// Internal Acessors for IdentityPrincipalId - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal.IdentityPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IManagedServiceIdentityInternal)Identity).PrincipalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IManagedServiceIdentityInternal)Identity).PrincipalId = value; } - - /// Internal Acessors for IdentityTenantId - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal.IdentityTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IManagedServiceIdentityInternal)Identity).TenantId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IManagedServiceIdentityInternal)Identity).TenantId = value; } - - /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchProperties Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ClusterPatchProperties()); set { {_property = value;} } } - - /// Internal Acessors for RuntimeProtectionConfiguration - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRuntimeProtectionConfiguration Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal.RuntimeProtectionConfiguration { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)Property).RuntimeProtectionConfiguration; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)Property).RuntimeProtectionConfiguration = value; } - - /// Internal Acessors for SecretArchive - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterSecretArchive Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal.SecretArchive { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)Property).SecretArchive; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)Property).SecretArchive = value; } - - /// Internal Acessors for SecretArchiveSetting - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretArchiveSettings Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal.SecretArchiveSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)Property).SecretArchiveSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)Property).SecretArchiveSetting = value; } - - /// Internal Acessors for SecretArchiveSettingAssociatedIdentity - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIdentitySelector Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal.SecretArchiveSettingAssociatedIdentity { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)Property).SecretArchiveSettingAssociatedIdentity; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)Property).SecretArchiveSettingAssociatedIdentity = value; } - - /// Internal Acessors for UpdateStrategy - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterUpdateStrategy Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal.UpdateStrategy { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)Property).UpdateStrategy; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)Property).UpdateStrategy = value; } - - /// Internal Acessors for VulnerabilityScanningSetting - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVulnerabilityScanningSettingsPatch Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersInternal.VulnerabilityScanningSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)Property).VulnerabilityScanningSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)Property).VulnerabilityScanningSetting = value; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchProperties _property; - - /// The list of the resource properties. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ClusterPatchProperties()); set => this._property = value; } - - /// The mode of operation for runtime protection. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RuntimeProtectionEnforcementLevel? RuntimeProtectionConfigurationEnforcementLevel { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)Property).RuntimeProtectionConfigurationEnforcementLevel; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)Property).RuntimeProtectionConfigurationEnforcementLevel = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RuntimeProtectionEnforcementLevel)""); } - - /// The resource ID of the key vault to archive the secrets of the cluster. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string SecretArchiveKeyVaultId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)Property).SecretArchiveKeyVaultId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)Property).SecretArchiveKeyVaultId = value ?? null; } - - /// The URI for the key vault used as the secret archive. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string SecretArchiveSettingVaultUri { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)Property).SecretArchiveSettingVaultUri; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)Property).SecretArchiveSettingVaultUri = value ?? null; } - - /// The type of managed identity that is being selected. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType? SecretArchiveSettingsAssociatedIdentityType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)Property).SecretArchiveSettingsAssociatedIdentityType; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)Property).SecretArchiveSettingsAssociatedIdentityType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType)""); } - - /// - /// The user assigned managed identity resource ID to use. Mutually exclusive with a system assigned identity type. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string SecretArchiveSettingsAssociatedIdentityUserAssignedIdentityResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)Property).SecretArchiveSettingsAssociatedIdentityUserAssignedIdentityResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)Property).SecretArchiveSettingsAssociatedIdentityUserAssignedIdentityResourceId = value ?? null; } - - /// - /// The indicator if the specified key vault should be used to archive the secrets of the cluster. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterSecretArchiveEnabled? SecretArchiveUseKeyVault { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)Property).SecretArchiveUseKeyVault; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)Property).SecretArchiveUseKeyVault = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterSecretArchiveEnabled)""); } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersTags _tag; - - /// The Azure resource tags that will replace the existing ones. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ClusterPatchParametersTags()); set => this._tag = value; } - - /// - /// The maximum number of worker nodes that can be offline within the increment of update, e.g., rack-by-rack. - /// Limited by the maximum number of machines in the increment. Defaults to the whole increment size. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public long? UpdateStrategyMaxUnavailable { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)Property).UpdateStrategyMaxUnavailable; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)Property).UpdateStrategyMaxUnavailable = value ?? default(long); } - - /// Selection of how the threshold should be evaluated. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdType? UpdateStrategyThresholdType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)Property).UpdateStrategyThresholdType; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)Property).UpdateStrategyThresholdType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdType)""); } - - /// The numeric threshold value. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public long? UpdateStrategyThresholdValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)Property).UpdateStrategyThresholdValue; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)Property).UpdateStrategyThresholdValue = value ?? default(long); } - - /// The mode of operation for runtime protection. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterUpdateStrategyType? UpdateStrategyType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)Property).UpdateStrategyType; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)Property).UpdateStrategyType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterUpdateStrategyType)""); } - - /// The time to wait between the increments of update defined by the strategy. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public long? UpdateStrategyWaitTimeMinute { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)Property).UpdateStrategyWaitTimeMinute; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)Property).UpdateStrategyWaitTimeMinute = value ?? default(long); } - - /// The mode selection for container vulnerability scanning. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VulnerabilityScanningSettingsContainerScan? VulnerabilityScanningSettingContainerScan { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)Property).VulnerabilityScanningSettingContainerScan; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)Property).VulnerabilityScanningSettingContainerScan = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VulnerabilityScanningSettingsContainerScan)""); } - - /// Creates an new instance. - public ClusterPatchParameters() - { - - } - } - /// ClusterPatchParameters represents the body of the request to patch the cluster properties. - public partial interface IClusterPatchParameters : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable - { - /// - /// The zone name used for this rack when created. Availability zones are used for workload placement. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The zone name used for this rack when created. Availability zones are used for workload placement.", - SerializedName = @"availabilityZone", - PossibleTypes = new [] { typeof(string) })] - string AggregatorOrSingleRackDefinitionAvailabilityZone { get; set; } - /// The unordered list of bare metal machine configuration. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The unordered list of bare metal machine configuration.", - SerializedName = @"bareMetalMachineConfigurationData", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineConfigurationData) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineConfigurationData[] AggregatorOrSingleRackDefinitionBareMetalMachineConfigurationData { get; set; } - /// The resource ID of the network rack that matches this rack definition. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The resource ID of the network rack that matches this rack definition.", - SerializedName = @"networkRackId", - PossibleTypes = new [] { typeof(string) })] - string AggregatorOrSingleRackDefinitionNetworkRackId { get; set; } - /// The free-form description of the rack's location. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The free-form description of the rack's location.", - SerializedName = @"rackLocation", - PossibleTypes = new [] { typeof(string) })] - string AggregatorOrSingleRackDefinitionRackLocation { get; set; } - /// - /// The unique identifier for the rack within Network Cloud cluster. An alternate unique alphanumeric value other than a serial - /// number may be provided if desired. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The unique identifier for the rack within Network Cloud cluster. An alternate unique alphanumeric value other than a serial number may be provided if desired.", - SerializedName = @"rackSerialNumber", - PossibleTypes = new [] { typeof(string) })] - string AggregatorOrSingleRackDefinitionRackSerialNumber { get; set; } - /// The resource ID of the sku for the rack being added. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The resource ID of the sku for the rack being added.", - SerializedName = @"rackSkuId", - PossibleTypes = new [] { typeof(string) })] - string AggregatorOrSingleRackDefinitionRackSkuId { get; set; } - /// The list of storage appliance configuration data for this rack. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The list of storage appliance configuration data for this rack.", - SerializedName = @"storageApplianceConfigurationData", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceConfigurationData) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceConfigurationData[] AggregatorOrSingleRackDefinitionStorageApplianceConfigurationData { get; set; } - /// - /// The resource ID of the analytics workspace that is to be used by the specified identity. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The resource ID of the analytics workspace that is to be used by the specified identity.", - SerializedName = @"analyticsWorkspaceId", - PossibleTypes = new [] { typeof(string) })] - string AnalyticOutputSettingAnalyticsWorkspaceId { get; set; } - /// The type of managed identity that is being selected. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The type of managed identity that is being selected.", - SerializedName = @"identityType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType? AnalyticsOutputSettingsAssociatedIdentityType { get; set; } - /// - /// The user assigned managed identity resource ID to use. Mutually exclusive with a system assigned identity type. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The user assigned managed identity resource ID to use. Mutually exclusive with a system assigned identity type.", - SerializedName = @"userAssignedIdentityResourceId", - PossibleTypes = new [] { typeof(string) })] - string AnalyticsOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId { get; set; } - /// - /// The customer-provided location information to identify where the cluster resides. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The customer-provided location information to identify where the cluster resides.", - SerializedName = @"clusterLocation", - PossibleTypes = new [] { typeof(string) })] - string ClusterLocation { get; set; } - /// The application ID, also known as client ID, of the service principal. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The application ID, also known as client ID, of the service principal.", - SerializedName = @"applicationId", - PossibleTypes = new [] { typeof(string) })] - string ClusterServicePrincipalApplicationId { get; set; } - /// The principal ID, also known as the object ID, of the service principal. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The principal ID, also known as the object ID, of the service principal.", - SerializedName = @"principalId", - PossibleTypes = new [] { typeof(string) })] - string ClusterServicePrincipalId { get; set; } - /// The password of the service principal. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The password of the service principal.", - SerializedName = @"password", - PossibleTypes = new [] { typeof(System.Security.SecureString) })] - System.Security.SecureString ClusterServicePrincipalPassword { get; set; } - /// - /// The tenant ID, also known as the directory ID, of the tenant in which the service principal is created. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The tenant ID, also known as the directory ID, of the tenant in which the service principal is created.", - SerializedName = @"tenantId", - PossibleTypes = new [] { typeof(string) })] - string ClusterServicePrincipalTenantId { get; set; } - /// - /// The URL of the storage account container that is to be used by the specified identities. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The URL of the storage account container that is to be used by the specified identities.", - SerializedName = @"containerUrl", - PossibleTypes = new [] { typeof(string) })] - string CommandOutputSettingContainerUrl { get; set; } - /// The type of managed identity that is being selected. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The type of managed identity that is being selected.", - SerializedName = @"identityType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType? CommandOutputSettingsAssociatedIdentityType { get; set; } - /// - /// The user assigned managed identity resource ID to use. Mutually exclusive with a system assigned identity type. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The user assigned managed identity resource ID to use. Mutually exclusive with a system assigned identity type.", - SerializedName = @"userAssignedIdentityResourceId", - PossibleTypes = new [] { typeof(string) })] - string CommandOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId { get; set; } - /// Selection of how the type evaluation is applied to the cluster calculation. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Selection of how the type evaluation is applied to the cluster calculation.", - SerializedName = @"grouping", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdGrouping) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdGrouping? ComputeDeploymentThresholdGrouping { get; set; } - /// Selection of how the threshold should be evaluated. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Selection of how the threshold should be evaluated.", - SerializedName = @"type", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdType) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdType? ComputeDeploymentThresholdType { get; set; } - /// The numeric threshold value. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The numeric threshold value.", - SerializedName = @"value", - PossibleTypes = new [] { typeof(long) })] - long? ComputeDeploymentThresholdValue { get; set; } - /// - /// The list of rack definitions for the compute racks in a multi-rack cluster, or an empty list in a single-rack cluster. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The list of rack definitions for the compute racks in a multi-rack cluster, or an empty list in a single-rack cluster.", - SerializedName = @"computeRackDefinitions", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackDefinition) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackDefinition[] ComputeRackDefinition { get; set; } - /// - /// The service principal ID of the system assigned identity. This property will only be provided for a system assigned identity. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - 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) })] - string IdentityPrincipalId { get; } - /// - /// The tenant ID of the system assigned identity. This property will only be provided for a system assigned identity. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - 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) })] - string IdentityTenantId { get; } - /// - /// Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Support.ManagedServiceIdentityType) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentityType? 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.NetworkCloud.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.NetworkCloud.Models.Api50.IUserAssignedIdentities) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IUserAssignedIdentities IdentityUserAssignedIdentity { get; set; } - /// The mode of operation for runtime protection. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The mode of operation for runtime protection.", - SerializedName = @"enforcementLevel", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RuntimeProtectionEnforcementLevel) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RuntimeProtectionEnforcementLevel? RuntimeProtectionConfigurationEnforcementLevel { get; set; } - /// The resource ID of the key vault to archive the secrets of the cluster. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The resource ID of the key vault to archive the secrets of the cluster.", - SerializedName = @"keyVaultId", - PossibleTypes = new [] { typeof(string) })] - string SecretArchiveKeyVaultId { get; set; } - /// The URI for the key vault used as the secret archive. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The URI for the key vault used as the secret archive.", - SerializedName = @"vaultUri", - PossibleTypes = new [] { typeof(string) })] - string SecretArchiveSettingVaultUri { get; set; } - /// The type of managed identity that is being selected. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The type of managed identity that is being selected.", - SerializedName = @"identityType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType? SecretArchiveSettingsAssociatedIdentityType { get; set; } - /// - /// The user assigned managed identity resource ID to use. Mutually exclusive with a system assigned identity type. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The user assigned managed identity resource ID to use. Mutually exclusive with a system assigned identity type.", - SerializedName = @"userAssignedIdentityResourceId", - PossibleTypes = new [] { typeof(string) })] - string SecretArchiveSettingsAssociatedIdentityUserAssignedIdentityResourceId { get; set; } - /// - /// The indicator if the specified key vault should be used to archive the secrets of the cluster. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The indicator if the specified key vault should be used to archive the secrets of the cluster.", - SerializedName = @"useKeyVault", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterSecretArchiveEnabled) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterSecretArchiveEnabled? SecretArchiveUseKeyVault { get; set; } - /// The Azure resource tags that will replace the existing ones. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The Azure resource tags that will replace the existing ones.", - SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersTags) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersTags Tag { get; set; } - /// - /// The maximum number of worker nodes that can be offline within the increment of update, e.g., rack-by-rack. - /// Limited by the maximum number of machines in the increment. Defaults to the whole increment size. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The maximum number of worker nodes that can be offline within the increment of update, e.g., rack-by-rack. - Limited by the maximum number of machines in the increment. Defaults to the whole increment size.", - SerializedName = @"maxUnavailable", - PossibleTypes = new [] { typeof(long) })] - long? UpdateStrategyMaxUnavailable { get; set; } - /// Selection of how the threshold should be evaluated. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Selection of how the threshold should be evaluated.", - SerializedName = @"thresholdType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdType) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdType? UpdateStrategyThresholdType { get; set; } - /// The numeric threshold value. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The numeric threshold value.", - SerializedName = @"thresholdValue", - PossibleTypes = new [] { typeof(long) })] - long? UpdateStrategyThresholdValue { get; set; } - /// The mode of operation for runtime protection. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The mode of operation for runtime protection.", - SerializedName = @"strategyType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterUpdateStrategyType) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterUpdateStrategyType? UpdateStrategyType { get; set; } - /// The time to wait between the increments of update defined by the strategy. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The time to wait between the increments of update defined by the strategy.", - SerializedName = @"waitTimeMinutes", - PossibleTypes = new [] { typeof(long) })] - long? UpdateStrategyWaitTimeMinute { get; set; } - /// The mode selection for container vulnerability scanning. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The mode selection for container vulnerability scanning.", - SerializedName = @"containerScan", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VulnerabilityScanningSettingsContainerScan) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VulnerabilityScanningSettingsContainerScan? VulnerabilityScanningSettingContainerScan { get; set; } - - } - /// ClusterPatchParameters represents the body of the request to patch the cluster properties. - internal partial interface IClusterPatchParametersInternal - - { - /// - /// The rack definition that is intended to reflect only a single rack in a single rack cluster, or an aggregator rack in - /// a multi-rack cluster. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackDefinition AggregatorOrSingleRackDefinition { get; set; } - /// - /// The zone name used for this rack when created. Availability zones are used for workload placement. - /// - string AggregatorOrSingleRackDefinitionAvailabilityZone { get; set; } - /// The unordered list of bare metal machine configuration. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineConfigurationData[] AggregatorOrSingleRackDefinitionBareMetalMachineConfigurationData { get; set; } - /// The resource ID of the network rack that matches this rack definition. - string AggregatorOrSingleRackDefinitionNetworkRackId { get; set; } - /// The free-form description of the rack's location. - string AggregatorOrSingleRackDefinitionRackLocation { get; set; } - /// - /// The unique identifier for the rack within Network Cloud cluster. An alternate unique alphanumeric value other than a serial - /// number may be provided if desired. - /// - string AggregatorOrSingleRackDefinitionRackSerialNumber { get; set; } - /// The resource ID of the sku for the rack being added. - string AggregatorOrSingleRackDefinitionRackSkuId { get; set; } - /// The list of storage appliance configuration data for this rack. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceConfigurationData[] AggregatorOrSingleRackDefinitionStorageApplianceConfigurationData { get; set; } - /// - /// The resource ID of the analytics workspace that is to be used by the specified identity. - /// - string AnalyticOutputSettingAnalyticsWorkspaceId { get; set; } - /// - /// The selection of the managed identity to use with this analytics workspace. The identity type must be either system assigned - /// or user assigned. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIdentitySelector AnalyticOutputSettingAssociatedIdentity { get; set; } - /// - /// The settings for the log analytics workspace used for output of logs from this cluster. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAnalyticsOutputSettings AnalyticsOutputSetting { get; set; } - /// The type of managed identity that is being selected. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType? AnalyticsOutputSettingsAssociatedIdentityType { get; set; } - /// - /// The user assigned managed identity resource ID to use. Mutually exclusive with a system assigned identity type. - /// - string AnalyticsOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId { get; set; } - /// - /// The customer-provided location information to identify where the cluster resides. - /// - string ClusterLocation { get; set; } - /// - /// The service principal to be used by the cluster during Arc Appliance installation. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IServicePrincipalInformation ClusterServicePrincipal { get; set; } - /// The application ID, also known as client ID, of the service principal. - string ClusterServicePrincipalApplicationId { get; set; } - /// The principal ID, also known as the object ID, of the service principal. - string ClusterServicePrincipalId { get; set; } - /// The password of the service principal. - System.Security.SecureString ClusterServicePrincipalPassword { get; set; } - /// - /// The tenant ID, also known as the directory ID, of the tenant in which the service principal is created. - /// - string ClusterServicePrincipalTenantId { get; set; } - /// - /// The settings for commands run in this cluster, such as bare metal machine run read only commands and data extracts. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICommandOutputSettings CommandOutputSetting { get; set; } - /// - /// The selection of the managed identity to use with this storage account container. The identity type must be either system - /// assigned or user assigned. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIdentitySelector CommandOutputSettingAssociatedIdentity { get; set; } - /// - /// The URL of the storage account container that is to be used by the specified identities. - /// - string CommandOutputSettingContainerUrl { get; set; } - /// The type of managed identity that is being selected. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType? CommandOutputSettingsAssociatedIdentityType { get; set; } - /// - /// The user assigned managed identity resource ID to use. Mutually exclusive with a system assigned identity type. - /// - string CommandOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId { get; set; } - /// - /// The validation threshold indicating the allowable failures of compute machines during environment validation and deployment. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IValidationThreshold ComputeDeploymentThreshold { get; set; } - /// Selection of how the type evaluation is applied to the cluster calculation. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdGrouping? ComputeDeploymentThresholdGrouping { get; set; } - /// Selection of how the threshold should be evaluated. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdType? ComputeDeploymentThresholdType { get; set; } - /// The numeric threshold value. - long? ComputeDeploymentThresholdValue { get; set; } - /// - /// The list of rack definitions for the compute racks in a multi-rack cluster, or an empty list in a single-rack cluster. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackDefinition[] ComputeRackDefinition { get; set; } - /// The identity for the resource. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IManagedServiceIdentity Identity { get; set; } - /// - /// The service principal ID of the system assigned identity. This property will only be provided for a system assigned identity. - /// - string IdentityPrincipalId { get; set; } - /// - /// The tenant ID of the system assigned identity. This property will only be provided for a system assigned identity. - /// - string IdentityTenantId { get; set; } - /// - /// Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentityType? 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.NetworkCloud.Models.Api50.IUserAssignedIdentities IdentityUserAssignedIdentity { get; set; } - /// The list of the resource properties. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchProperties Property { get; set; } - /// The settings for cluster runtime protection. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRuntimeProtectionConfiguration RuntimeProtectionConfiguration { get; set; } - /// The mode of operation for runtime protection. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RuntimeProtectionEnforcementLevel? RuntimeProtectionConfigurationEnforcementLevel { get; set; } - /// - /// The configuration for use of a key vault to store secrets for later retrieval by the operator. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterSecretArchive SecretArchive { get; set; } - /// The resource ID of the key vault to archive the secrets of the cluster. - string SecretArchiveKeyVaultId { get; set; } - /// The settings for the secret archive used to hold credentials for the cluster. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretArchiveSettings SecretArchiveSetting { get; set; } - /// - /// The selection of the managed identity to use with this vault URI. The identity type must be either system assigned or - /// user assigned. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIdentitySelector SecretArchiveSettingAssociatedIdentity { get; set; } - /// The URI for the key vault used as the secret archive. - string SecretArchiveSettingVaultUri { get; set; } - /// The type of managed identity that is being selected. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType? SecretArchiveSettingsAssociatedIdentityType { get; set; } - /// - /// The user assigned managed identity resource ID to use. Mutually exclusive with a system assigned identity type. - /// - string SecretArchiveSettingsAssociatedIdentityUserAssignedIdentityResourceId { get; set; } - /// - /// The indicator if the specified key vault should be used to archive the secrets of the cluster. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterSecretArchiveEnabled? SecretArchiveUseKeyVault { get; set; } - /// The Azure resource tags that will replace the existing ones. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersTags Tag { get; set; } - /// The strategy for updating the cluster. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterUpdateStrategy UpdateStrategy { get; set; } - /// - /// The maximum number of worker nodes that can be offline within the increment of update, e.g., rack-by-rack. - /// Limited by the maximum number of machines in the increment. Defaults to the whole increment size. - /// - long? UpdateStrategyMaxUnavailable { get; set; } - /// Selection of how the threshold should be evaluated. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdType? UpdateStrategyThresholdType { get; set; } - /// The numeric threshold value. - long? UpdateStrategyThresholdValue { get; set; } - /// The mode of operation for runtime protection. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterUpdateStrategyType? UpdateStrategyType { get; set; } - /// The time to wait between the increments of update defined by the strategy. - long? UpdateStrategyWaitTimeMinute { get; set; } - /// The settings for how security vulnerability scanning is applied to the cluster. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVulnerabilityScanningSettingsPatch VulnerabilityScanningSetting { get; set; } - /// The mode selection for container vulnerability scanning. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VulnerabilityScanningSettingsContainerScan? VulnerabilityScanningSettingContainerScan { get; set; } - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterPatchProperties.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterPatchProperties.PowerShell.cs deleted file mode 100644 index ead15875697f..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterPatchProperties.PowerShell.cs +++ /dev/null @@ -1,534 +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.NetworkCloud.Models.Api20250201 -{ - using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; - - /// ClusterPatchProperties represents the properties of the cluster for patching. - [System.ComponentModel.TypeConverter(typeof(ClusterPatchPropertiesTypeConverter))] - public partial class ClusterPatchProperties - { - - /// - /// 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 ClusterPatchProperties(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("AggregatorOrSingleRackDefinition")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).AggregatorOrSingleRackDefinition = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackDefinition) content.GetValueForProperty("AggregatorOrSingleRackDefinition",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).AggregatorOrSingleRackDefinition, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.RackDefinitionTypeConverter.ConvertFrom); - } - if (content.Contains("AnalyticsOutputSetting")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).AnalyticsOutputSetting = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAnalyticsOutputSettings) content.GetValueForProperty("AnalyticsOutputSetting",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).AnalyticsOutputSetting, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AnalyticsOutputSettingsTypeConverter.ConvertFrom); - } - if (content.Contains("ClusterServicePrincipal")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).ClusterServicePrincipal = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IServicePrincipalInformation) content.GetValueForProperty("ClusterServicePrincipal",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).ClusterServicePrincipal, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ServicePrincipalInformationTypeConverter.ConvertFrom); - } - if (content.Contains("CommandOutputSetting")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).CommandOutputSetting = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICommandOutputSettings) content.GetValueForProperty("CommandOutputSetting",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).CommandOutputSetting, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.CommandOutputSettingsTypeConverter.ConvertFrom); - } - if (content.Contains("ComputeDeploymentThreshold")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).ComputeDeploymentThreshold = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IValidationThreshold) content.GetValueForProperty("ComputeDeploymentThreshold",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).ComputeDeploymentThreshold, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ValidationThresholdTypeConverter.ConvertFrom); - } - if (content.Contains("RuntimeProtectionConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).RuntimeProtectionConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRuntimeProtectionConfiguration) content.GetValueForProperty("RuntimeProtectionConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).RuntimeProtectionConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.RuntimeProtectionConfigurationTypeConverter.ConvertFrom); - } - if (content.Contains("SecretArchive")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).SecretArchive = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterSecretArchive) content.GetValueForProperty("SecretArchive",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).SecretArchive, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ClusterSecretArchiveTypeConverter.ConvertFrom); - } - if (content.Contains("SecretArchiveSetting")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).SecretArchiveSetting = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretArchiveSettings) content.GetValueForProperty("SecretArchiveSetting",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).SecretArchiveSetting, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.SecretArchiveSettingsTypeConverter.ConvertFrom); - } - if (content.Contains("UpdateStrategy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).UpdateStrategy = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterUpdateStrategy) content.GetValueForProperty("UpdateStrategy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).UpdateStrategy, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ClusterUpdateStrategyTypeConverter.ConvertFrom); - } - if (content.Contains("VulnerabilityScanningSetting")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).VulnerabilityScanningSetting = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVulnerabilityScanningSettingsPatch) content.GetValueForProperty("VulnerabilityScanningSetting",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).VulnerabilityScanningSetting, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.VulnerabilityScanningSettingsPatchTypeConverter.ConvertFrom); - } - if (content.Contains("ClusterLocation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).ClusterLocation = (string) content.GetValueForProperty("ClusterLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).ClusterLocation, global::System.Convert.ToString); - } - if (content.Contains("ComputeRackDefinition")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).ComputeRackDefinition = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackDefinition[]) content.GetValueForProperty("ComputeRackDefinition",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).ComputeRackDefinition, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.RackDefinitionTypeConverter.ConvertFrom)); - } - if (content.Contains("CommandOutputSettingContainerUrl")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).CommandOutputSettingContainerUrl = (string) content.GetValueForProperty("CommandOutputSettingContainerUrl",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).CommandOutputSettingContainerUrl, global::System.Convert.ToString); - } - if (content.Contains("SecretArchiveSettingVaultUri")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).SecretArchiveSettingVaultUri = (string) content.GetValueForProperty("SecretArchiveSettingVaultUri",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).SecretArchiveSettingVaultUri, global::System.Convert.ToString); - } - if (content.Contains("VulnerabilityScanningSettingContainerScan")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).VulnerabilityScanningSettingContainerScan = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VulnerabilityScanningSettingsContainerScan?) content.GetValueForProperty("VulnerabilityScanningSettingContainerScan",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).VulnerabilityScanningSettingContainerScan, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VulnerabilityScanningSettingsContainerScan.CreateFrom); - } - if (content.Contains("AggregatorOrSingleRackDefinitionAvailabilityZone")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).AggregatorOrSingleRackDefinitionAvailabilityZone = (string) content.GetValueForProperty("AggregatorOrSingleRackDefinitionAvailabilityZone",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).AggregatorOrSingleRackDefinitionAvailabilityZone, global::System.Convert.ToString); - } - if (content.Contains("AggregatorOrSingleRackDefinitionBareMetalMachineConfigurationData")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).AggregatorOrSingleRackDefinitionBareMetalMachineConfigurationData = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineConfigurationData[]) content.GetValueForProperty("AggregatorOrSingleRackDefinitionBareMetalMachineConfigurationData",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).AggregatorOrSingleRackDefinitionBareMetalMachineConfigurationData, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BareMetalMachineConfigurationDataTypeConverter.ConvertFrom)); - } - if (content.Contains("AggregatorOrSingleRackDefinitionNetworkRackId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).AggregatorOrSingleRackDefinitionNetworkRackId = (string) content.GetValueForProperty("AggregatorOrSingleRackDefinitionNetworkRackId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).AggregatorOrSingleRackDefinitionNetworkRackId, global::System.Convert.ToString); - } - if (content.Contains("AggregatorOrSingleRackDefinitionRackLocation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).AggregatorOrSingleRackDefinitionRackLocation = (string) content.GetValueForProperty("AggregatorOrSingleRackDefinitionRackLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).AggregatorOrSingleRackDefinitionRackLocation, global::System.Convert.ToString); - } - if (content.Contains("AggregatorOrSingleRackDefinitionRackSerialNumber")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).AggregatorOrSingleRackDefinitionRackSerialNumber = (string) content.GetValueForProperty("AggregatorOrSingleRackDefinitionRackSerialNumber",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).AggregatorOrSingleRackDefinitionRackSerialNumber, global::System.Convert.ToString); - } - if (content.Contains("AggregatorOrSingleRackDefinitionRackSkuId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).AggregatorOrSingleRackDefinitionRackSkuId = (string) content.GetValueForProperty("AggregatorOrSingleRackDefinitionRackSkuId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).AggregatorOrSingleRackDefinitionRackSkuId, global::System.Convert.ToString); - } - if (content.Contains("AggregatorOrSingleRackDefinitionStorageApplianceConfigurationData")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).AggregatorOrSingleRackDefinitionStorageApplianceConfigurationData = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceConfigurationData[]) content.GetValueForProperty("AggregatorOrSingleRackDefinitionStorageApplianceConfigurationData",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).AggregatorOrSingleRackDefinitionStorageApplianceConfigurationData, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.StorageApplianceConfigurationDataTypeConverter.ConvertFrom)); - } - if (content.Contains("AnalyticOutputSettingAssociatedIdentity")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).AnalyticOutputSettingAssociatedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIdentitySelector) content.GetValueForProperty("AnalyticOutputSettingAssociatedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).AnalyticOutputSettingAssociatedIdentity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IdentitySelectorTypeConverter.ConvertFrom); - } - if (content.Contains("AnalyticOutputSettingAnalyticsWorkspaceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).AnalyticOutputSettingAnalyticsWorkspaceId = (string) content.GetValueForProperty("AnalyticOutputSettingAnalyticsWorkspaceId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).AnalyticOutputSettingAnalyticsWorkspaceId, global::System.Convert.ToString); - } - if (content.Contains("ClusterServicePrincipalApplicationId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).ClusterServicePrincipalApplicationId = (string) content.GetValueForProperty("ClusterServicePrincipalApplicationId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).ClusterServicePrincipalApplicationId, global::System.Convert.ToString); - } - if (content.Contains("ClusterServicePrincipalPassword")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).ClusterServicePrincipalPassword = (System.Security.SecureString) content.GetValueForProperty("ClusterServicePrincipalPassword",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).ClusterServicePrincipalPassword, (object ss) => (System.Security.SecureString)ss); - } - if (content.Contains("ClusterServicePrincipalId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).ClusterServicePrincipalId = (string) content.GetValueForProperty("ClusterServicePrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).ClusterServicePrincipalId, global::System.Convert.ToString); - } - if (content.Contains("ClusterServicePrincipalTenantId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).ClusterServicePrincipalTenantId = (string) content.GetValueForProperty("ClusterServicePrincipalTenantId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).ClusterServicePrincipalTenantId, global::System.Convert.ToString); - } - if (content.Contains("CommandOutputSettingAssociatedIdentity")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).CommandOutputSettingAssociatedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIdentitySelector) content.GetValueForProperty("CommandOutputSettingAssociatedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).CommandOutputSettingAssociatedIdentity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IdentitySelectorTypeConverter.ConvertFrom); - } - if (content.Contains("ComputeDeploymentThresholdGrouping")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).ComputeDeploymentThresholdGrouping = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdGrouping) content.GetValueForProperty("ComputeDeploymentThresholdGrouping",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).ComputeDeploymentThresholdGrouping, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdGrouping.CreateFrom); - } - if (content.Contains("ComputeDeploymentThresholdType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).ComputeDeploymentThresholdType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdType) content.GetValueForProperty("ComputeDeploymentThresholdType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).ComputeDeploymentThresholdType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdType.CreateFrom); - } - if (content.Contains("ComputeDeploymentThresholdValue")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).ComputeDeploymentThresholdValue = (long) content.GetValueForProperty("ComputeDeploymentThresholdValue",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).ComputeDeploymentThresholdValue, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("RuntimeProtectionConfigurationEnforcementLevel")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).RuntimeProtectionConfigurationEnforcementLevel = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RuntimeProtectionEnforcementLevel?) content.GetValueForProperty("RuntimeProtectionConfigurationEnforcementLevel",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).RuntimeProtectionConfigurationEnforcementLevel, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RuntimeProtectionEnforcementLevel.CreateFrom); - } - if (content.Contains("SecretArchiveKeyVaultId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).SecretArchiveKeyVaultId = (string) content.GetValueForProperty("SecretArchiveKeyVaultId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).SecretArchiveKeyVaultId, global::System.Convert.ToString); - } - if (content.Contains("SecretArchiveUseKeyVault")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).SecretArchiveUseKeyVault = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterSecretArchiveEnabled?) content.GetValueForProperty("SecretArchiveUseKeyVault",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).SecretArchiveUseKeyVault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterSecretArchiveEnabled.CreateFrom); - } - if (content.Contains("SecretArchiveSettingAssociatedIdentity")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).SecretArchiveSettingAssociatedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIdentitySelector) content.GetValueForProperty("SecretArchiveSettingAssociatedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).SecretArchiveSettingAssociatedIdentity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IdentitySelectorTypeConverter.ConvertFrom); - } - if (content.Contains("UpdateStrategyMaxUnavailable")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).UpdateStrategyMaxUnavailable = (long?) content.GetValueForProperty("UpdateStrategyMaxUnavailable",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).UpdateStrategyMaxUnavailable, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("UpdateStrategyType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).UpdateStrategyType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterUpdateStrategyType) content.GetValueForProperty("UpdateStrategyType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).UpdateStrategyType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterUpdateStrategyType.CreateFrom); - } - if (content.Contains("UpdateStrategyThresholdType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).UpdateStrategyThresholdType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdType) content.GetValueForProperty("UpdateStrategyThresholdType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).UpdateStrategyThresholdType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdType.CreateFrom); - } - if (content.Contains("UpdateStrategyThresholdValue")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).UpdateStrategyThresholdValue = (long) content.GetValueForProperty("UpdateStrategyThresholdValue",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).UpdateStrategyThresholdValue, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("UpdateStrategyWaitTimeMinute")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).UpdateStrategyWaitTimeMinute = (long?) content.GetValueForProperty("UpdateStrategyWaitTimeMinute",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).UpdateStrategyWaitTimeMinute, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("AnalyticsOutputSettingsAssociatedIdentityType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).AnalyticsOutputSettingsAssociatedIdentityType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType?) content.GetValueForProperty("AnalyticsOutputSettingsAssociatedIdentityType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).AnalyticsOutputSettingsAssociatedIdentityType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType.CreateFrom); - } - if (content.Contains("AnalyticsOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).AnalyticsOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId = (string) content.GetValueForProperty("AnalyticsOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).AnalyticsOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId, global::System.Convert.ToString); - } - if (content.Contains("CommandOutputSettingsAssociatedIdentityType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).CommandOutputSettingsAssociatedIdentityType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType?) content.GetValueForProperty("CommandOutputSettingsAssociatedIdentityType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).CommandOutputSettingsAssociatedIdentityType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType.CreateFrom); - } - if (content.Contains("CommandOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).CommandOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId = (string) content.GetValueForProperty("CommandOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).CommandOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId, global::System.Convert.ToString); - } - if (content.Contains("SecretArchiveSettingsAssociatedIdentityType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).SecretArchiveSettingsAssociatedIdentityType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType?) content.GetValueForProperty("SecretArchiveSettingsAssociatedIdentityType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).SecretArchiveSettingsAssociatedIdentityType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType.CreateFrom); - } - if (content.Contains("SecretArchiveSettingsAssociatedIdentityUserAssignedIdentityResourceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).SecretArchiveSettingsAssociatedIdentityUserAssignedIdentityResourceId = (string) content.GetValueForProperty("SecretArchiveSettingsAssociatedIdentityUserAssignedIdentityResourceId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).SecretArchiveSettingsAssociatedIdentityUserAssignedIdentityResourceId, 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 ClusterPatchProperties(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("AggregatorOrSingleRackDefinition")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).AggregatorOrSingleRackDefinition = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackDefinition) content.GetValueForProperty("AggregatorOrSingleRackDefinition",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).AggregatorOrSingleRackDefinition, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.RackDefinitionTypeConverter.ConvertFrom); - } - if (content.Contains("AnalyticsOutputSetting")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).AnalyticsOutputSetting = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAnalyticsOutputSettings) content.GetValueForProperty("AnalyticsOutputSetting",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).AnalyticsOutputSetting, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AnalyticsOutputSettingsTypeConverter.ConvertFrom); - } - if (content.Contains("ClusterServicePrincipal")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).ClusterServicePrincipal = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IServicePrincipalInformation) content.GetValueForProperty("ClusterServicePrincipal",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).ClusterServicePrincipal, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ServicePrincipalInformationTypeConverter.ConvertFrom); - } - if (content.Contains("CommandOutputSetting")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).CommandOutputSetting = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICommandOutputSettings) content.GetValueForProperty("CommandOutputSetting",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).CommandOutputSetting, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.CommandOutputSettingsTypeConverter.ConvertFrom); - } - if (content.Contains("ComputeDeploymentThreshold")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).ComputeDeploymentThreshold = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IValidationThreshold) content.GetValueForProperty("ComputeDeploymentThreshold",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).ComputeDeploymentThreshold, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ValidationThresholdTypeConverter.ConvertFrom); - } - if (content.Contains("RuntimeProtectionConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).RuntimeProtectionConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRuntimeProtectionConfiguration) content.GetValueForProperty("RuntimeProtectionConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).RuntimeProtectionConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.RuntimeProtectionConfigurationTypeConverter.ConvertFrom); - } - if (content.Contains("SecretArchive")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).SecretArchive = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterSecretArchive) content.GetValueForProperty("SecretArchive",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).SecretArchive, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ClusterSecretArchiveTypeConverter.ConvertFrom); - } - if (content.Contains("SecretArchiveSetting")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).SecretArchiveSetting = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretArchiveSettings) content.GetValueForProperty("SecretArchiveSetting",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).SecretArchiveSetting, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.SecretArchiveSettingsTypeConverter.ConvertFrom); - } - if (content.Contains("UpdateStrategy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).UpdateStrategy = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterUpdateStrategy) content.GetValueForProperty("UpdateStrategy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).UpdateStrategy, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ClusterUpdateStrategyTypeConverter.ConvertFrom); - } - if (content.Contains("VulnerabilityScanningSetting")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).VulnerabilityScanningSetting = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVulnerabilityScanningSettingsPatch) content.GetValueForProperty("VulnerabilityScanningSetting",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).VulnerabilityScanningSetting, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.VulnerabilityScanningSettingsPatchTypeConverter.ConvertFrom); - } - if (content.Contains("ClusterLocation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).ClusterLocation = (string) content.GetValueForProperty("ClusterLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).ClusterLocation, global::System.Convert.ToString); - } - if (content.Contains("ComputeRackDefinition")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).ComputeRackDefinition = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackDefinition[]) content.GetValueForProperty("ComputeRackDefinition",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).ComputeRackDefinition, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.RackDefinitionTypeConverter.ConvertFrom)); - } - if (content.Contains("CommandOutputSettingContainerUrl")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).CommandOutputSettingContainerUrl = (string) content.GetValueForProperty("CommandOutputSettingContainerUrl",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).CommandOutputSettingContainerUrl, global::System.Convert.ToString); - } - if (content.Contains("SecretArchiveSettingVaultUri")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).SecretArchiveSettingVaultUri = (string) content.GetValueForProperty("SecretArchiveSettingVaultUri",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).SecretArchiveSettingVaultUri, global::System.Convert.ToString); - } - if (content.Contains("VulnerabilityScanningSettingContainerScan")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).VulnerabilityScanningSettingContainerScan = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VulnerabilityScanningSettingsContainerScan?) content.GetValueForProperty("VulnerabilityScanningSettingContainerScan",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).VulnerabilityScanningSettingContainerScan, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VulnerabilityScanningSettingsContainerScan.CreateFrom); - } - if (content.Contains("AggregatorOrSingleRackDefinitionAvailabilityZone")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).AggregatorOrSingleRackDefinitionAvailabilityZone = (string) content.GetValueForProperty("AggregatorOrSingleRackDefinitionAvailabilityZone",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).AggregatorOrSingleRackDefinitionAvailabilityZone, global::System.Convert.ToString); - } - if (content.Contains("AggregatorOrSingleRackDefinitionBareMetalMachineConfigurationData")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).AggregatorOrSingleRackDefinitionBareMetalMachineConfigurationData = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineConfigurationData[]) content.GetValueForProperty("AggregatorOrSingleRackDefinitionBareMetalMachineConfigurationData",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).AggregatorOrSingleRackDefinitionBareMetalMachineConfigurationData, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BareMetalMachineConfigurationDataTypeConverter.ConvertFrom)); - } - if (content.Contains("AggregatorOrSingleRackDefinitionNetworkRackId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).AggregatorOrSingleRackDefinitionNetworkRackId = (string) content.GetValueForProperty("AggregatorOrSingleRackDefinitionNetworkRackId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).AggregatorOrSingleRackDefinitionNetworkRackId, global::System.Convert.ToString); - } - if (content.Contains("AggregatorOrSingleRackDefinitionRackLocation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).AggregatorOrSingleRackDefinitionRackLocation = (string) content.GetValueForProperty("AggregatorOrSingleRackDefinitionRackLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).AggregatorOrSingleRackDefinitionRackLocation, global::System.Convert.ToString); - } - if (content.Contains("AggregatorOrSingleRackDefinitionRackSerialNumber")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).AggregatorOrSingleRackDefinitionRackSerialNumber = (string) content.GetValueForProperty("AggregatorOrSingleRackDefinitionRackSerialNumber",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).AggregatorOrSingleRackDefinitionRackSerialNumber, global::System.Convert.ToString); - } - if (content.Contains("AggregatorOrSingleRackDefinitionRackSkuId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).AggregatorOrSingleRackDefinitionRackSkuId = (string) content.GetValueForProperty("AggregatorOrSingleRackDefinitionRackSkuId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).AggregatorOrSingleRackDefinitionRackSkuId, global::System.Convert.ToString); - } - if (content.Contains("AggregatorOrSingleRackDefinitionStorageApplianceConfigurationData")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).AggregatorOrSingleRackDefinitionStorageApplianceConfigurationData = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceConfigurationData[]) content.GetValueForProperty("AggregatorOrSingleRackDefinitionStorageApplianceConfigurationData",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).AggregatorOrSingleRackDefinitionStorageApplianceConfigurationData, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.StorageApplianceConfigurationDataTypeConverter.ConvertFrom)); - } - if (content.Contains("AnalyticOutputSettingAssociatedIdentity")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).AnalyticOutputSettingAssociatedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIdentitySelector) content.GetValueForProperty("AnalyticOutputSettingAssociatedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).AnalyticOutputSettingAssociatedIdentity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IdentitySelectorTypeConverter.ConvertFrom); - } - if (content.Contains("AnalyticOutputSettingAnalyticsWorkspaceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).AnalyticOutputSettingAnalyticsWorkspaceId = (string) content.GetValueForProperty("AnalyticOutputSettingAnalyticsWorkspaceId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).AnalyticOutputSettingAnalyticsWorkspaceId, global::System.Convert.ToString); - } - if (content.Contains("ClusterServicePrincipalApplicationId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).ClusterServicePrincipalApplicationId = (string) content.GetValueForProperty("ClusterServicePrincipalApplicationId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).ClusterServicePrincipalApplicationId, global::System.Convert.ToString); - } - if (content.Contains("ClusterServicePrincipalPassword")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).ClusterServicePrincipalPassword = (System.Security.SecureString) content.GetValueForProperty("ClusterServicePrincipalPassword",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).ClusterServicePrincipalPassword, (object ss) => (System.Security.SecureString)ss); - } - if (content.Contains("ClusterServicePrincipalId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).ClusterServicePrincipalId = (string) content.GetValueForProperty("ClusterServicePrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).ClusterServicePrincipalId, global::System.Convert.ToString); - } - if (content.Contains("ClusterServicePrincipalTenantId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).ClusterServicePrincipalTenantId = (string) content.GetValueForProperty("ClusterServicePrincipalTenantId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).ClusterServicePrincipalTenantId, global::System.Convert.ToString); - } - if (content.Contains("CommandOutputSettingAssociatedIdentity")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).CommandOutputSettingAssociatedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIdentitySelector) content.GetValueForProperty("CommandOutputSettingAssociatedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).CommandOutputSettingAssociatedIdentity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IdentitySelectorTypeConverter.ConvertFrom); - } - if (content.Contains("ComputeDeploymentThresholdGrouping")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).ComputeDeploymentThresholdGrouping = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdGrouping) content.GetValueForProperty("ComputeDeploymentThresholdGrouping",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).ComputeDeploymentThresholdGrouping, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdGrouping.CreateFrom); - } - if (content.Contains("ComputeDeploymentThresholdType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).ComputeDeploymentThresholdType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdType) content.GetValueForProperty("ComputeDeploymentThresholdType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).ComputeDeploymentThresholdType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdType.CreateFrom); - } - if (content.Contains("ComputeDeploymentThresholdValue")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).ComputeDeploymentThresholdValue = (long) content.GetValueForProperty("ComputeDeploymentThresholdValue",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).ComputeDeploymentThresholdValue, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("RuntimeProtectionConfigurationEnforcementLevel")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).RuntimeProtectionConfigurationEnforcementLevel = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RuntimeProtectionEnforcementLevel?) content.GetValueForProperty("RuntimeProtectionConfigurationEnforcementLevel",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).RuntimeProtectionConfigurationEnforcementLevel, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RuntimeProtectionEnforcementLevel.CreateFrom); - } - if (content.Contains("SecretArchiveKeyVaultId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).SecretArchiveKeyVaultId = (string) content.GetValueForProperty("SecretArchiveKeyVaultId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).SecretArchiveKeyVaultId, global::System.Convert.ToString); - } - if (content.Contains("SecretArchiveUseKeyVault")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).SecretArchiveUseKeyVault = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterSecretArchiveEnabled?) content.GetValueForProperty("SecretArchiveUseKeyVault",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).SecretArchiveUseKeyVault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterSecretArchiveEnabled.CreateFrom); - } - if (content.Contains("SecretArchiveSettingAssociatedIdentity")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).SecretArchiveSettingAssociatedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIdentitySelector) content.GetValueForProperty("SecretArchiveSettingAssociatedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).SecretArchiveSettingAssociatedIdentity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IdentitySelectorTypeConverter.ConvertFrom); - } - if (content.Contains("UpdateStrategyMaxUnavailable")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).UpdateStrategyMaxUnavailable = (long?) content.GetValueForProperty("UpdateStrategyMaxUnavailable",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).UpdateStrategyMaxUnavailable, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("UpdateStrategyType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).UpdateStrategyType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterUpdateStrategyType) content.GetValueForProperty("UpdateStrategyType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).UpdateStrategyType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterUpdateStrategyType.CreateFrom); - } - if (content.Contains("UpdateStrategyThresholdType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).UpdateStrategyThresholdType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdType) content.GetValueForProperty("UpdateStrategyThresholdType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).UpdateStrategyThresholdType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdType.CreateFrom); - } - if (content.Contains("UpdateStrategyThresholdValue")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).UpdateStrategyThresholdValue = (long) content.GetValueForProperty("UpdateStrategyThresholdValue",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).UpdateStrategyThresholdValue, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("UpdateStrategyWaitTimeMinute")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).UpdateStrategyWaitTimeMinute = (long?) content.GetValueForProperty("UpdateStrategyWaitTimeMinute",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).UpdateStrategyWaitTimeMinute, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("AnalyticsOutputSettingsAssociatedIdentityType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).AnalyticsOutputSettingsAssociatedIdentityType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType?) content.GetValueForProperty("AnalyticsOutputSettingsAssociatedIdentityType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).AnalyticsOutputSettingsAssociatedIdentityType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType.CreateFrom); - } - if (content.Contains("AnalyticsOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).AnalyticsOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId = (string) content.GetValueForProperty("AnalyticsOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).AnalyticsOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId, global::System.Convert.ToString); - } - if (content.Contains("CommandOutputSettingsAssociatedIdentityType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).CommandOutputSettingsAssociatedIdentityType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType?) content.GetValueForProperty("CommandOutputSettingsAssociatedIdentityType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).CommandOutputSettingsAssociatedIdentityType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType.CreateFrom); - } - if (content.Contains("CommandOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).CommandOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId = (string) content.GetValueForProperty("CommandOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).CommandOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId, global::System.Convert.ToString); - } - if (content.Contains("SecretArchiveSettingsAssociatedIdentityType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).SecretArchiveSettingsAssociatedIdentityType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType?) content.GetValueForProperty("SecretArchiveSettingsAssociatedIdentityType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).SecretArchiveSettingsAssociatedIdentityType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType.CreateFrom); - } - if (content.Contains("SecretArchiveSettingsAssociatedIdentityUserAssignedIdentityResourceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).SecretArchiveSettingsAssociatedIdentityUserAssignedIdentityResourceId = (string) content.GetValueForProperty("SecretArchiveSettingsAssociatedIdentityUserAssignedIdentityResourceId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal)this).SecretArchiveSettingsAssociatedIdentityUserAssignedIdentityResourceId, 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.NetworkCloud.Models.Api20250201.IClusterPatchProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new ClusterPatchProperties(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.NetworkCloud.Models.Api20250201.IClusterPatchProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new ClusterPatchProperties(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.NetworkCloud.Models.Api20250201.IClusterPatchProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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(); - } - } - /// ClusterPatchProperties represents the properties of the cluster for patching. - [System.ComponentModel.TypeConverter(typeof(ClusterPatchPropertiesTypeConverter))] - public partial interface IClusterPatchProperties - - { - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterPatchProperties.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterPatchProperties.cs deleted file mode 100644 index f402b83d88e2..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterPatchProperties.cs +++ /dev/null @@ -1,765 +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.NetworkCloud.Models.Api20250201 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; - - /// ClusterPatchProperties represents the properties of the cluster for patching. - public partial class ClusterPatchProperties : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchProperties, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal - { - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackDefinition _aggregatorOrSingleRackDefinition; - - /// - /// The rack definition that is intended to reflect only a single rack in a single rack cluster, or an aggregator rack in - /// a multi-rack cluster. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackDefinition AggregatorOrSingleRackDefinition { get => (this._aggregatorOrSingleRackDefinition = this._aggregatorOrSingleRackDefinition ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.RackDefinition()); set => this._aggregatorOrSingleRackDefinition = value; } - - /// - /// The zone name used for this rack when created. Availability zones are used for workload placement. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string AggregatorOrSingleRackDefinitionAvailabilityZone { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackDefinitionInternal)AggregatorOrSingleRackDefinition).AvailabilityZone; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackDefinitionInternal)AggregatorOrSingleRackDefinition).AvailabilityZone = value ?? null; } - - /// The unordered list of bare metal machine configuration. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineConfigurationData[] AggregatorOrSingleRackDefinitionBareMetalMachineConfigurationData { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackDefinitionInternal)AggregatorOrSingleRackDefinition).BareMetalMachineConfigurationData; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackDefinitionInternal)AggregatorOrSingleRackDefinition).BareMetalMachineConfigurationData = value ?? null /* arrayOf */; } - - /// The resource ID of the network rack that matches this rack definition. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string AggregatorOrSingleRackDefinitionNetworkRackId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackDefinitionInternal)AggregatorOrSingleRackDefinition).NetworkRackId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackDefinitionInternal)AggregatorOrSingleRackDefinition).NetworkRackId = value ?? null; } - - /// The free-form description of the rack's location. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string AggregatorOrSingleRackDefinitionRackLocation { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackDefinitionInternal)AggregatorOrSingleRackDefinition).RackLocation; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackDefinitionInternal)AggregatorOrSingleRackDefinition).RackLocation = value ?? null; } - - /// - /// The unique identifier for the rack within Network Cloud cluster. An alternate unique alphanumeric value other than a serial - /// number may be provided if desired. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string AggregatorOrSingleRackDefinitionRackSerialNumber { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackDefinitionInternal)AggregatorOrSingleRackDefinition).RackSerialNumber; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackDefinitionInternal)AggregatorOrSingleRackDefinition).RackSerialNumber = value ?? null; } - - /// The resource ID of the sku for the rack being added. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string AggregatorOrSingleRackDefinitionRackSkuId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackDefinitionInternal)AggregatorOrSingleRackDefinition).RackSkuId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackDefinitionInternal)AggregatorOrSingleRackDefinition).RackSkuId = value ?? null; } - - /// The list of storage appliance configuration data for this rack. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceConfigurationData[] AggregatorOrSingleRackDefinitionStorageApplianceConfigurationData { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackDefinitionInternal)AggregatorOrSingleRackDefinition).StorageApplianceConfigurationData; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackDefinitionInternal)AggregatorOrSingleRackDefinition).StorageApplianceConfigurationData = value ?? null /* arrayOf */; } - - /// - /// The resource ID of the analytics workspace that is to be used by the specified identity. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string AnalyticOutputSettingAnalyticsWorkspaceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAnalyticsOutputSettingsInternal)AnalyticsOutputSetting).AnalyticsWorkspaceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAnalyticsOutputSettingsInternal)AnalyticsOutputSetting).AnalyticsWorkspaceId = value ?? null; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAnalyticsOutputSettings _analyticsOutputSetting; - - /// - /// The settings for the log analytics workspace used for output of logs from this cluster. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAnalyticsOutputSettings AnalyticsOutputSetting { get => (this._analyticsOutputSetting = this._analyticsOutputSetting ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AnalyticsOutputSettings()); set => this._analyticsOutputSetting = value; } - - /// The type of managed identity that is being selected. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType? AnalyticsOutputSettingsAssociatedIdentityType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAnalyticsOutputSettingsInternal)AnalyticsOutputSetting).AssociatedIdentityType; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAnalyticsOutputSettingsInternal)AnalyticsOutputSetting).AssociatedIdentityType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType)""); } - - /// - /// The user assigned managed identity resource ID to use. Mutually exclusive with a system assigned identity type. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string AnalyticsOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAnalyticsOutputSettingsInternal)AnalyticsOutputSetting).AssociatedIdentityUserAssignedIdentityResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAnalyticsOutputSettingsInternal)AnalyticsOutputSetting).AssociatedIdentityUserAssignedIdentityResourceId = value ?? null; } - - /// Backing field for property. - private string _clusterLocation; - - /// - /// The customer-provided location information to identify where the cluster resides. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string ClusterLocation { get => this._clusterLocation; set => this._clusterLocation = value; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IServicePrincipalInformation _clusterServicePrincipal; - - /// - /// The service principal to be used by the cluster during Arc Appliance installation. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IServicePrincipalInformation ClusterServicePrincipal { get => (this._clusterServicePrincipal = this._clusterServicePrincipal ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ServicePrincipalInformation()); set => this._clusterServicePrincipal = value; } - - /// The application ID, also known as client ID, of the service principal. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string ClusterServicePrincipalApplicationId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IServicePrincipalInformationInternal)ClusterServicePrincipal).ApplicationId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IServicePrincipalInformationInternal)ClusterServicePrincipal).ApplicationId = value ?? null; } - - /// The principal ID, also known as the object ID, of the service principal. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string ClusterServicePrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IServicePrincipalInformationInternal)ClusterServicePrincipal).PrincipalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IServicePrincipalInformationInternal)ClusterServicePrincipal).PrincipalId = value ?? null; } - - /// The password of the service principal. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public System.Security.SecureString ClusterServicePrincipalPassword { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IServicePrincipalInformationInternal)ClusterServicePrincipal).Password; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IServicePrincipalInformationInternal)ClusterServicePrincipal).Password = value ?? null; } - - /// - /// The tenant ID, also known as the directory ID, of the tenant in which the service principal is created. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string ClusterServicePrincipalTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IServicePrincipalInformationInternal)ClusterServicePrincipal).TenantId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IServicePrincipalInformationInternal)ClusterServicePrincipal).TenantId = value ?? null; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICommandOutputSettings _commandOutputSetting; - - /// - /// The settings for commands run in this cluster, such as bare metal machine run read only commands and data extracts. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICommandOutputSettings CommandOutputSetting { get => (this._commandOutputSetting = this._commandOutputSetting ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.CommandOutputSettings()); set => this._commandOutputSetting = value; } - - /// - /// The URL of the storage account container that is to be used by the specified identities. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string CommandOutputSettingContainerUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICommandOutputSettingsInternal)CommandOutputSetting).ContainerUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICommandOutputSettingsInternal)CommandOutputSetting).ContainerUrl = value ?? null; } - - /// The type of managed identity that is being selected. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType? CommandOutputSettingsAssociatedIdentityType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICommandOutputSettingsInternal)CommandOutputSetting).AssociatedIdentityType; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICommandOutputSettingsInternal)CommandOutputSetting).AssociatedIdentityType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType)""); } - - /// - /// The user assigned managed identity resource ID to use. Mutually exclusive with a system assigned identity type. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string CommandOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICommandOutputSettingsInternal)CommandOutputSetting).AssociatedIdentityUserAssignedIdentityResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICommandOutputSettingsInternal)CommandOutputSetting).AssociatedIdentityUserAssignedIdentityResourceId = value ?? null; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IValidationThreshold _computeDeploymentThreshold; - - /// - /// The validation threshold indicating the allowable failures of compute machines during environment validation and deployment. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IValidationThreshold ComputeDeploymentThreshold { get => (this._computeDeploymentThreshold = this._computeDeploymentThreshold ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ValidationThreshold()); set => this._computeDeploymentThreshold = value; } - - /// Selection of how the type evaluation is applied to the cluster calculation. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdGrouping? ComputeDeploymentThresholdGrouping { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IValidationThresholdInternal)ComputeDeploymentThreshold).Grouping; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IValidationThresholdInternal)ComputeDeploymentThreshold).Grouping = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdGrouping)""); } - - /// Selection of how the threshold should be evaluated. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdType? ComputeDeploymentThresholdType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IValidationThresholdInternal)ComputeDeploymentThreshold).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IValidationThresholdInternal)ComputeDeploymentThreshold).Type = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdType)""); } - - /// The numeric threshold value. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public long? ComputeDeploymentThresholdValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IValidationThresholdInternal)ComputeDeploymentThreshold).Value; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IValidationThresholdInternal)ComputeDeploymentThreshold).Value = value ?? default(long); } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackDefinition[] _computeRackDefinition; - - /// - /// The list of rack definitions for the compute racks in a multi-rack cluster, or an empty list in a single-rack cluster. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackDefinition[] ComputeRackDefinition { get => this._computeRackDefinition; set => this._computeRackDefinition = value; } - - /// Internal Acessors for AggregatorOrSingleRackDefinition - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackDefinition Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal.AggregatorOrSingleRackDefinition { get => (this._aggregatorOrSingleRackDefinition = this._aggregatorOrSingleRackDefinition ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.RackDefinition()); set { {_aggregatorOrSingleRackDefinition = value;} } } - - /// Internal Acessors for AnalyticOutputSettingAssociatedIdentity - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIdentitySelector Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal.AnalyticOutputSettingAssociatedIdentity { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAnalyticsOutputSettingsInternal)AnalyticsOutputSetting).AssociatedIdentity; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAnalyticsOutputSettingsInternal)AnalyticsOutputSetting).AssociatedIdentity = value; } - - /// Internal Acessors for AnalyticsOutputSetting - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAnalyticsOutputSettings Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal.AnalyticsOutputSetting { get => (this._analyticsOutputSetting = this._analyticsOutputSetting ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AnalyticsOutputSettings()); set { {_analyticsOutputSetting = value;} } } - - /// Internal Acessors for ClusterServicePrincipal - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IServicePrincipalInformation Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal.ClusterServicePrincipal { get => (this._clusterServicePrincipal = this._clusterServicePrincipal ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ServicePrincipalInformation()); set { {_clusterServicePrincipal = value;} } } - - /// Internal Acessors for CommandOutputSetting - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICommandOutputSettings Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal.CommandOutputSetting { get => (this._commandOutputSetting = this._commandOutputSetting ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.CommandOutputSettings()); set { {_commandOutputSetting = value;} } } - - /// Internal Acessors for CommandOutputSettingAssociatedIdentity - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIdentitySelector Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal.CommandOutputSettingAssociatedIdentity { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICommandOutputSettingsInternal)CommandOutputSetting).AssociatedIdentity; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICommandOutputSettingsInternal)CommandOutputSetting).AssociatedIdentity = value; } - - /// Internal Acessors for ComputeDeploymentThreshold - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IValidationThreshold Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal.ComputeDeploymentThreshold { get => (this._computeDeploymentThreshold = this._computeDeploymentThreshold ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ValidationThreshold()); set { {_computeDeploymentThreshold = value;} } } - - /// Internal Acessors for RuntimeProtectionConfiguration - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRuntimeProtectionConfiguration Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal.RuntimeProtectionConfiguration { get => (this._runtimeProtectionConfiguration = this._runtimeProtectionConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.RuntimeProtectionConfiguration()); set { {_runtimeProtectionConfiguration = value;} } } - - /// Internal Acessors for SecretArchive - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterSecretArchive Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal.SecretArchive { get => (this._secretArchive = this._secretArchive ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ClusterSecretArchive()); set { {_secretArchive = value;} } } - - /// Internal Acessors for SecretArchiveSetting - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretArchiveSettings Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal.SecretArchiveSetting { get => (this._secretArchiveSetting = this._secretArchiveSetting ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.SecretArchiveSettings()); set { {_secretArchiveSetting = value;} } } - - /// Internal Acessors for SecretArchiveSettingAssociatedIdentity - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIdentitySelector Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal.SecretArchiveSettingAssociatedIdentity { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretArchiveSettingsInternal)SecretArchiveSetting).AssociatedIdentity; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretArchiveSettingsInternal)SecretArchiveSetting).AssociatedIdentity = value; } - - /// Internal Acessors for UpdateStrategy - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterUpdateStrategy Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal.UpdateStrategy { get => (this._updateStrategy = this._updateStrategy ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ClusterUpdateStrategy()); set { {_updateStrategy = value;} } } - - /// Internal Acessors for VulnerabilityScanningSetting - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVulnerabilityScanningSettingsPatch Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchPropertiesInternal.VulnerabilityScanningSetting { get => (this._vulnerabilityScanningSetting = this._vulnerabilityScanningSetting ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.VulnerabilityScanningSettingsPatch()); set { {_vulnerabilityScanningSetting = value;} } } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRuntimeProtectionConfiguration _runtimeProtectionConfiguration; - - /// The settings for cluster runtime protection. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRuntimeProtectionConfiguration RuntimeProtectionConfiguration { get => (this._runtimeProtectionConfiguration = this._runtimeProtectionConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.RuntimeProtectionConfiguration()); set => this._runtimeProtectionConfiguration = value; } - - /// The mode of operation for runtime protection. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RuntimeProtectionEnforcementLevel? RuntimeProtectionConfigurationEnforcementLevel { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRuntimeProtectionConfigurationInternal)RuntimeProtectionConfiguration).EnforcementLevel; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRuntimeProtectionConfigurationInternal)RuntimeProtectionConfiguration).EnforcementLevel = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RuntimeProtectionEnforcementLevel)""); } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterSecretArchive _secretArchive; - - /// - /// The configuration for use of a key vault to store secrets for later retrieval by the operator. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterSecretArchive SecretArchive { get => (this._secretArchive = this._secretArchive ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ClusterSecretArchive()); set => this._secretArchive = value; } - - /// The resource ID of the key vault to archive the secrets of the cluster. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string SecretArchiveKeyVaultId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterSecretArchiveInternal)SecretArchive).KeyVaultId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterSecretArchiveInternal)SecretArchive).KeyVaultId = value ?? null; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretArchiveSettings _secretArchiveSetting; - - /// The settings for the secret archive used to hold credentials for the cluster. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretArchiveSettings SecretArchiveSetting { get => (this._secretArchiveSetting = this._secretArchiveSetting ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.SecretArchiveSettings()); set => this._secretArchiveSetting = value; } - - /// The URI for the key vault used as the secret archive. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string SecretArchiveSettingVaultUri { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretArchiveSettingsInternal)SecretArchiveSetting).VaultUri; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretArchiveSettingsInternal)SecretArchiveSetting).VaultUri = value ?? null; } - - /// The type of managed identity that is being selected. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType? SecretArchiveSettingsAssociatedIdentityType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretArchiveSettingsInternal)SecretArchiveSetting).AssociatedIdentityType; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretArchiveSettingsInternal)SecretArchiveSetting).AssociatedIdentityType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType)""); } - - /// - /// The user assigned managed identity resource ID to use. Mutually exclusive with a system assigned identity type. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string SecretArchiveSettingsAssociatedIdentityUserAssignedIdentityResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretArchiveSettingsInternal)SecretArchiveSetting).AssociatedIdentityUserAssignedIdentityResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretArchiveSettingsInternal)SecretArchiveSetting).AssociatedIdentityUserAssignedIdentityResourceId = value ?? null; } - - /// - /// The indicator if the specified key vault should be used to archive the secrets of the cluster. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterSecretArchiveEnabled? SecretArchiveUseKeyVault { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterSecretArchiveInternal)SecretArchive).UseKeyVault; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterSecretArchiveInternal)SecretArchive).UseKeyVault = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterSecretArchiveEnabled)""); } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterUpdateStrategy _updateStrategy; - - /// The strategy for updating the cluster. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterUpdateStrategy UpdateStrategy { get => (this._updateStrategy = this._updateStrategy ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ClusterUpdateStrategy()); set => this._updateStrategy = value; } - - /// - /// The maximum number of worker nodes that can be offline within the increment of update, e.g., rack-by-rack. - /// Limited by the maximum number of machines in the increment. Defaults to the whole increment size. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public long? UpdateStrategyMaxUnavailable { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterUpdateStrategyInternal)UpdateStrategy).MaxUnavailable; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterUpdateStrategyInternal)UpdateStrategy).MaxUnavailable = value ?? default(long); } - - /// Selection of how the threshold should be evaluated. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdType? UpdateStrategyThresholdType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterUpdateStrategyInternal)UpdateStrategy).ThresholdType; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterUpdateStrategyInternal)UpdateStrategy).ThresholdType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdType)""); } - - /// The numeric threshold value. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public long? UpdateStrategyThresholdValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterUpdateStrategyInternal)UpdateStrategy).ThresholdValue; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterUpdateStrategyInternal)UpdateStrategy).ThresholdValue = value ?? default(long); } - - /// The mode of operation for runtime protection. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterUpdateStrategyType? UpdateStrategyType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterUpdateStrategyInternal)UpdateStrategy).StrategyType; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterUpdateStrategyInternal)UpdateStrategy).StrategyType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterUpdateStrategyType)""); } - - /// The time to wait between the increments of update defined by the strategy. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public long? UpdateStrategyWaitTimeMinute { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterUpdateStrategyInternal)UpdateStrategy).WaitTimeMinute; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterUpdateStrategyInternal)UpdateStrategy).WaitTimeMinute = value ?? default(long); } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVulnerabilityScanningSettingsPatch _vulnerabilityScanningSetting; - - /// The settings for how security vulnerability scanning is applied to the cluster. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVulnerabilityScanningSettingsPatch VulnerabilityScanningSetting { get => (this._vulnerabilityScanningSetting = this._vulnerabilityScanningSetting ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.VulnerabilityScanningSettingsPatch()); set => this._vulnerabilityScanningSetting = value; } - - /// The mode selection for container vulnerability scanning. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VulnerabilityScanningSettingsContainerScan? VulnerabilityScanningSettingContainerScan { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVulnerabilityScanningSettingsPatchInternal)VulnerabilityScanningSetting).ContainerScan; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVulnerabilityScanningSettingsPatchInternal)VulnerabilityScanningSetting).ContainerScan = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VulnerabilityScanningSettingsContainerScan)""); } - - /// Creates an new instance. - public ClusterPatchProperties() - { - - } - } - /// ClusterPatchProperties represents the properties of the cluster for patching. - public partial interface IClusterPatchProperties : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable - { - /// - /// The zone name used for this rack when created. Availability zones are used for workload placement. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The zone name used for this rack when created. Availability zones are used for workload placement.", - SerializedName = @"availabilityZone", - PossibleTypes = new [] { typeof(string) })] - string AggregatorOrSingleRackDefinitionAvailabilityZone { get; set; } - /// The unordered list of bare metal machine configuration. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The unordered list of bare metal machine configuration.", - SerializedName = @"bareMetalMachineConfigurationData", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineConfigurationData) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineConfigurationData[] AggregatorOrSingleRackDefinitionBareMetalMachineConfigurationData { get; set; } - /// The resource ID of the network rack that matches this rack definition. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The resource ID of the network rack that matches this rack definition.", - SerializedName = @"networkRackId", - PossibleTypes = new [] { typeof(string) })] - string AggregatorOrSingleRackDefinitionNetworkRackId { get; set; } - /// The free-form description of the rack's location. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The free-form description of the rack's location.", - SerializedName = @"rackLocation", - PossibleTypes = new [] { typeof(string) })] - string AggregatorOrSingleRackDefinitionRackLocation { get; set; } - /// - /// The unique identifier for the rack within Network Cloud cluster. An alternate unique alphanumeric value other than a serial - /// number may be provided if desired. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The unique identifier for the rack within Network Cloud cluster. An alternate unique alphanumeric value other than a serial number may be provided if desired.", - SerializedName = @"rackSerialNumber", - PossibleTypes = new [] { typeof(string) })] - string AggregatorOrSingleRackDefinitionRackSerialNumber { get; set; } - /// The resource ID of the sku for the rack being added. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The resource ID of the sku for the rack being added.", - SerializedName = @"rackSkuId", - PossibleTypes = new [] { typeof(string) })] - string AggregatorOrSingleRackDefinitionRackSkuId { get; set; } - /// The list of storage appliance configuration data for this rack. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The list of storage appliance configuration data for this rack.", - SerializedName = @"storageApplianceConfigurationData", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceConfigurationData) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceConfigurationData[] AggregatorOrSingleRackDefinitionStorageApplianceConfigurationData { get; set; } - /// - /// The resource ID of the analytics workspace that is to be used by the specified identity. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The resource ID of the analytics workspace that is to be used by the specified identity.", - SerializedName = @"analyticsWorkspaceId", - PossibleTypes = new [] { typeof(string) })] - string AnalyticOutputSettingAnalyticsWorkspaceId { get; set; } - /// The type of managed identity that is being selected. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The type of managed identity that is being selected.", - SerializedName = @"identityType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType? AnalyticsOutputSettingsAssociatedIdentityType { get; set; } - /// - /// The user assigned managed identity resource ID to use. Mutually exclusive with a system assigned identity type. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The user assigned managed identity resource ID to use. Mutually exclusive with a system assigned identity type.", - SerializedName = @"userAssignedIdentityResourceId", - PossibleTypes = new [] { typeof(string) })] - string AnalyticsOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId { get; set; } - /// - /// The customer-provided location information to identify where the cluster resides. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The customer-provided location information to identify where the cluster resides.", - SerializedName = @"clusterLocation", - PossibleTypes = new [] { typeof(string) })] - string ClusterLocation { get; set; } - /// The application ID, also known as client ID, of the service principal. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The application ID, also known as client ID, of the service principal.", - SerializedName = @"applicationId", - PossibleTypes = new [] { typeof(string) })] - string ClusterServicePrincipalApplicationId { get; set; } - /// The principal ID, also known as the object ID, of the service principal. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The principal ID, also known as the object ID, of the service principal.", - SerializedName = @"principalId", - PossibleTypes = new [] { typeof(string) })] - string ClusterServicePrincipalId { get; set; } - /// The password of the service principal. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The password of the service principal.", - SerializedName = @"password", - PossibleTypes = new [] { typeof(System.Security.SecureString) })] - System.Security.SecureString ClusterServicePrincipalPassword { get; set; } - /// - /// The tenant ID, also known as the directory ID, of the tenant in which the service principal is created. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The tenant ID, also known as the directory ID, of the tenant in which the service principal is created.", - SerializedName = @"tenantId", - PossibleTypes = new [] { typeof(string) })] - string ClusterServicePrincipalTenantId { get; set; } - /// - /// The URL of the storage account container that is to be used by the specified identities. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The URL of the storage account container that is to be used by the specified identities.", - SerializedName = @"containerUrl", - PossibleTypes = new [] { typeof(string) })] - string CommandOutputSettingContainerUrl { get; set; } - /// The type of managed identity that is being selected. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The type of managed identity that is being selected.", - SerializedName = @"identityType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType? CommandOutputSettingsAssociatedIdentityType { get; set; } - /// - /// The user assigned managed identity resource ID to use. Mutually exclusive with a system assigned identity type. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The user assigned managed identity resource ID to use. Mutually exclusive with a system assigned identity type.", - SerializedName = @"userAssignedIdentityResourceId", - PossibleTypes = new [] { typeof(string) })] - string CommandOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId { get; set; } - /// Selection of how the type evaluation is applied to the cluster calculation. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Selection of how the type evaluation is applied to the cluster calculation.", - SerializedName = @"grouping", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdGrouping) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdGrouping? ComputeDeploymentThresholdGrouping { get; set; } - /// Selection of how the threshold should be evaluated. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Selection of how the threshold should be evaluated.", - SerializedName = @"type", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdType) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdType? ComputeDeploymentThresholdType { get; set; } - /// The numeric threshold value. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The numeric threshold value.", - SerializedName = @"value", - PossibleTypes = new [] { typeof(long) })] - long? ComputeDeploymentThresholdValue { get; set; } - /// - /// The list of rack definitions for the compute racks in a multi-rack cluster, or an empty list in a single-rack cluster. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The list of rack definitions for the compute racks in a multi-rack cluster, or an empty list in a single-rack cluster.", - SerializedName = @"computeRackDefinitions", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackDefinition) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackDefinition[] ComputeRackDefinition { get; set; } - /// The mode of operation for runtime protection. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The mode of operation for runtime protection.", - SerializedName = @"enforcementLevel", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RuntimeProtectionEnforcementLevel) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RuntimeProtectionEnforcementLevel? RuntimeProtectionConfigurationEnforcementLevel { get; set; } - /// The resource ID of the key vault to archive the secrets of the cluster. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The resource ID of the key vault to archive the secrets of the cluster.", - SerializedName = @"keyVaultId", - PossibleTypes = new [] { typeof(string) })] - string SecretArchiveKeyVaultId { get; set; } - /// The URI for the key vault used as the secret archive. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The URI for the key vault used as the secret archive.", - SerializedName = @"vaultUri", - PossibleTypes = new [] { typeof(string) })] - string SecretArchiveSettingVaultUri { get; set; } - /// The type of managed identity that is being selected. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The type of managed identity that is being selected.", - SerializedName = @"identityType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType? SecretArchiveSettingsAssociatedIdentityType { get; set; } - /// - /// The user assigned managed identity resource ID to use. Mutually exclusive with a system assigned identity type. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The user assigned managed identity resource ID to use. Mutually exclusive with a system assigned identity type.", - SerializedName = @"userAssignedIdentityResourceId", - PossibleTypes = new [] { typeof(string) })] - string SecretArchiveSettingsAssociatedIdentityUserAssignedIdentityResourceId { get; set; } - /// - /// The indicator if the specified key vault should be used to archive the secrets of the cluster. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The indicator if the specified key vault should be used to archive the secrets of the cluster.", - SerializedName = @"useKeyVault", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterSecretArchiveEnabled) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterSecretArchiveEnabled? SecretArchiveUseKeyVault { get; set; } - /// - /// The maximum number of worker nodes that can be offline within the increment of update, e.g., rack-by-rack. - /// Limited by the maximum number of machines in the increment. Defaults to the whole increment size. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The maximum number of worker nodes that can be offline within the increment of update, e.g., rack-by-rack. - Limited by the maximum number of machines in the increment. Defaults to the whole increment size.", - SerializedName = @"maxUnavailable", - PossibleTypes = new [] { typeof(long) })] - long? UpdateStrategyMaxUnavailable { get; set; } - /// Selection of how the threshold should be evaluated. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Selection of how the threshold should be evaluated.", - SerializedName = @"thresholdType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdType) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdType? UpdateStrategyThresholdType { get; set; } - /// The numeric threshold value. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The numeric threshold value.", - SerializedName = @"thresholdValue", - PossibleTypes = new [] { typeof(long) })] - long? UpdateStrategyThresholdValue { get; set; } - /// The mode of operation for runtime protection. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The mode of operation for runtime protection.", - SerializedName = @"strategyType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterUpdateStrategyType) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterUpdateStrategyType? UpdateStrategyType { get; set; } - /// The time to wait between the increments of update defined by the strategy. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The time to wait between the increments of update defined by the strategy.", - SerializedName = @"waitTimeMinutes", - PossibleTypes = new [] { typeof(long) })] - long? UpdateStrategyWaitTimeMinute { get; set; } - /// The mode selection for container vulnerability scanning. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The mode selection for container vulnerability scanning.", - SerializedName = @"containerScan", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VulnerabilityScanningSettingsContainerScan) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VulnerabilityScanningSettingsContainerScan? VulnerabilityScanningSettingContainerScan { get; set; } - - } - /// ClusterPatchProperties represents the properties of the cluster for patching. - internal partial interface IClusterPatchPropertiesInternal - - { - /// - /// The rack definition that is intended to reflect only a single rack in a single rack cluster, or an aggregator rack in - /// a multi-rack cluster. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackDefinition AggregatorOrSingleRackDefinition { get; set; } - /// - /// The zone name used for this rack when created. Availability zones are used for workload placement. - /// - string AggregatorOrSingleRackDefinitionAvailabilityZone { get; set; } - /// The unordered list of bare metal machine configuration. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineConfigurationData[] AggregatorOrSingleRackDefinitionBareMetalMachineConfigurationData { get; set; } - /// The resource ID of the network rack that matches this rack definition. - string AggregatorOrSingleRackDefinitionNetworkRackId { get; set; } - /// The free-form description of the rack's location. - string AggregatorOrSingleRackDefinitionRackLocation { get; set; } - /// - /// The unique identifier for the rack within Network Cloud cluster. An alternate unique alphanumeric value other than a serial - /// number may be provided if desired. - /// - string AggregatorOrSingleRackDefinitionRackSerialNumber { get; set; } - /// The resource ID of the sku for the rack being added. - string AggregatorOrSingleRackDefinitionRackSkuId { get; set; } - /// The list of storage appliance configuration data for this rack. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceConfigurationData[] AggregatorOrSingleRackDefinitionStorageApplianceConfigurationData { get; set; } - /// - /// The resource ID of the analytics workspace that is to be used by the specified identity. - /// - string AnalyticOutputSettingAnalyticsWorkspaceId { get; set; } - /// - /// The selection of the managed identity to use with this analytics workspace. The identity type must be either system assigned - /// or user assigned. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIdentitySelector AnalyticOutputSettingAssociatedIdentity { get; set; } - /// - /// The settings for the log analytics workspace used for output of logs from this cluster. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAnalyticsOutputSettings AnalyticsOutputSetting { get; set; } - /// The type of managed identity that is being selected. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType? AnalyticsOutputSettingsAssociatedIdentityType { get; set; } - /// - /// The user assigned managed identity resource ID to use. Mutually exclusive with a system assigned identity type. - /// - string AnalyticsOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId { get; set; } - /// - /// The customer-provided location information to identify where the cluster resides. - /// - string ClusterLocation { get; set; } - /// - /// The service principal to be used by the cluster during Arc Appliance installation. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IServicePrincipalInformation ClusterServicePrincipal { get; set; } - /// The application ID, also known as client ID, of the service principal. - string ClusterServicePrincipalApplicationId { get; set; } - /// The principal ID, also known as the object ID, of the service principal. - string ClusterServicePrincipalId { get; set; } - /// The password of the service principal. - System.Security.SecureString ClusterServicePrincipalPassword { get; set; } - /// - /// The tenant ID, also known as the directory ID, of the tenant in which the service principal is created. - /// - string ClusterServicePrincipalTenantId { get; set; } - /// - /// The settings for commands run in this cluster, such as bare metal machine run read only commands and data extracts. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICommandOutputSettings CommandOutputSetting { get; set; } - /// - /// The selection of the managed identity to use with this storage account container. The identity type must be either system - /// assigned or user assigned. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIdentitySelector CommandOutputSettingAssociatedIdentity { get; set; } - /// - /// The URL of the storage account container that is to be used by the specified identities. - /// - string CommandOutputSettingContainerUrl { get; set; } - /// The type of managed identity that is being selected. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType? CommandOutputSettingsAssociatedIdentityType { get; set; } - /// - /// The user assigned managed identity resource ID to use. Mutually exclusive with a system assigned identity type. - /// - string CommandOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId { get; set; } - /// - /// The validation threshold indicating the allowable failures of compute machines during environment validation and deployment. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IValidationThreshold ComputeDeploymentThreshold { get; set; } - /// Selection of how the type evaluation is applied to the cluster calculation. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdGrouping? ComputeDeploymentThresholdGrouping { get; set; } - /// Selection of how the threshold should be evaluated. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdType? ComputeDeploymentThresholdType { get; set; } - /// The numeric threshold value. - long? ComputeDeploymentThresholdValue { get; set; } - /// - /// The list of rack definitions for the compute racks in a multi-rack cluster, or an empty list in a single-rack cluster. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackDefinition[] ComputeRackDefinition { get; set; } - /// The settings for cluster runtime protection. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRuntimeProtectionConfiguration RuntimeProtectionConfiguration { get; set; } - /// The mode of operation for runtime protection. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RuntimeProtectionEnforcementLevel? RuntimeProtectionConfigurationEnforcementLevel { get; set; } - /// - /// The configuration for use of a key vault to store secrets for later retrieval by the operator. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterSecretArchive SecretArchive { get; set; } - /// The resource ID of the key vault to archive the secrets of the cluster. - string SecretArchiveKeyVaultId { get; set; } - /// The settings for the secret archive used to hold credentials for the cluster. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretArchiveSettings SecretArchiveSetting { get; set; } - /// - /// The selection of the managed identity to use with this vault URI. The identity type must be either system assigned or - /// user assigned. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIdentitySelector SecretArchiveSettingAssociatedIdentity { get; set; } - /// The URI for the key vault used as the secret archive. - string SecretArchiveSettingVaultUri { get; set; } - /// The type of managed identity that is being selected. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType? SecretArchiveSettingsAssociatedIdentityType { get; set; } - /// - /// The user assigned managed identity resource ID to use. Mutually exclusive with a system assigned identity type. - /// - string SecretArchiveSettingsAssociatedIdentityUserAssignedIdentityResourceId { get; set; } - /// - /// The indicator if the specified key vault should be used to archive the secrets of the cluster. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterSecretArchiveEnabled? SecretArchiveUseKeyVault { get; set; } - /// The strategy for updating the cluster. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterUpdateStrategy UpdateStrategy { get; set; } - /// - /// The maximum number of worker nodes that can be offline within the increment of update, e.g., rack-by-rack. - /// Limited by the maximum number of machines in the increment. Defaults to the whole increment size. - /// - long? UpdateStrategyMaxUnavailable { get; set; } - /// Selection of how the threshold should be evaluated. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdType? UpdateStrategyThresholdType { get; set; } - /// The numeric threshold value. - long? UpdateStrategyThresholdValue { get; set; } - /// The mode of operation for runtime protection. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterUpdateStrategyType? UpdateStrategyType { get; set; } - /// The time to wait between the increments of update defined by the strategy. - long? UpdateStrategyWaitTimeMinute { get; set; } - /// The settings for how security vulnerability scanning is applied to the cluster. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVulnerabilityScanningSettingsPatch VulnerabilityScanningSetting { get; set; } - /// The mode selection for container vulnerability scanning. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VulnerabilityScanningSettingsContainerScan? VulnerabilityScanningSettingContainerScan { get; set; } - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterProperties.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterProperties.PowerShell.cs deleted file mode 100644 index 6769f6d07832..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterProperties.PowerShell.cs +++ /dev/null @@ -1,788 +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.NetworkCloud.Models.Api20250201 -{ - using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; - - /// ClusterProperties represents the properties of a cluster. - [System.ComponentModel.TypeConverter(typeof(ClusterPropertiesTypeConverter))] - public partial class ClusterProperties - { - - /// - /// 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 ClusterProperties(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("AggregatorOrSingleRackDefinition")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).AggregatorOrSingleRackDefinition = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackDefinition) content.GetValueForProperty("AggregatorOrSingleRackDefinition",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).AggregatorOrSingleRackDefinition, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.RackDefinitionTypeConverter.ConvertFrom); - } - if (content.Contains("AnalyticsOutputSetting")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).AnalyticsOutputSetting = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAnalyticsOutputSettings) content.GetValueForProperty("AnalyticsOutputSetting",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).AnalyticsOutputSetting, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AnalyticsOutputSettingsTypeConverter.ConvertFrom); - } - if (content.Contains("ClusterCapacity")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).ClusterCapacity = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterCapacity) content.GetValueForProperty("ClusterCapacity",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).ClusterCapacity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ClusterCapacityTypeConverter.ConvertFrom); - } - if (content.Contains("ClusterExtendedLocation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).ClusterExtendedLocation = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocation) content.GetValueForProperty("ClusterExtendedLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).ClusterExtendedLocation, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ExtendedLocationTypeConverter.ConvertFrom); - } - if (content.Contains("ClusterServicePrincipal")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).ClusterServicePrincipal = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IServicePrincipalInformation) content.GetValueForProperty("ClusterServicePrincipal",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).ClusterServicePrincipal, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ServicePrincipalInformationTypeConverter.ConvertFrom); - } - if (content.Contains("CommandOutputSetting")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).CommandOutputSetting = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICommandOutputSettings) content.GetValueForProperty("CommandOutputSetting",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).CommandOutputSetting, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.CommandOutputSettingsTypeConverter.ConvertFrom); - } - if (content.Contains("ComputeDeploymentThreshold")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).ComputeDeploymentThreshold = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IValidationThreshold) content.GetValueForProperty("ComputeDeploymentThreshold",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).ComputeDeploymentThreshold, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ValidationThresholdTypeConverter.ConvertFrom); - } - if (content.Contains("HybridAksExtendedLocation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).HybridAksExtendedLocation = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocation) content.GetValueForProperty("HybridAksExtendedLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).HybridAksExtendedLocation, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ExtendedLocationTypeConverter.ConvertFrom); - } - if (content.Contains("ManagedResourceGroupConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).ManagedResourceGroupConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IManagedResourceGroupConfiguration) content.GetValueForProperty("ManagedResourceGroupConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).ManagedResourceGroupConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ManagedResourceGroupConfigurationTypeConverter.ConvertFrom); - } - if (content.Contains("RuntimeProtectionConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).RuntimeProtectionConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRuntimeProtectionConfiguration) content.GetValueForProperty("RuntimeProtectionConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).RuntimeProtectionConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.RuntimeProtectionConfigurationTypeConverter.ConvertFrom); - } - if (content.Contains("SecretArchive")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).SecretArchive = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterSecretArchive) content.GetValueForProperty("SecretArchive",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).SecretArchive, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ClusterSecretArchiveTypeConverter.ConvertFrom); - } - if (content.Contains("SecretArchiveSetting")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).SecretArchiveSetting = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretArchiveSettings) content.GetValueForProperty("SecretArchiveSetting",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).SecretArchiveSetting, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.SecretArchiveSettingsTypeConverter.ConvertFrom); - } - if (content.Contains("UpdateStrategy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).UpdateStrategy = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterUpdateStrategy) content.GetValueForProperty("UpdateStrategy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).UpdateStrategy, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ClusterUpdateStrategyTypeConverter.ConvertFrom); - } - if (content.Contains("VulnerabilityScanningSetting")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).VulnerabilityScanningSetting = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVulnerabilityScanningSettings) content.GetValueForProperty("VulnerabilityScanningSetting",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).VulnerabilityScanningSetting, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.VulnerabilityScanningSettingsTypeConverter.ConvertFrom); - } - if (content.Contains("AnalyticsWorkspaceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).AnalyticsWorkspaceId = (string) content.GetValueForProperty("AnalyticsWorkspaceId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).AnalyticsWorkspaceId, global::System.Convert.ToString); - } - if (content.Contains("AvailableUpgradeVersion")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).AvailableUpgradeVersion = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterAvailableUpgradeVersion[]) content.GetValueForProperty("AvailableUpgradeVersion",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).AvailableUpgradeVersion, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ClusterAvailableUpgradeVersionTypeConverter.ConvertFrom)); - } - if (content.Contains("ClusterConnectionStatus")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).ClusterConnectionStatus = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterConnectionStatus?) content.GetValueForProperty("ClusterConnectionStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).ClusterConnectionStatus, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterConnectionStatus.CreateFrom); - } - if (content.Contains("ClusterLocation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).ClusterLocation = (string) content.GetValueForProperty("ClusterLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).ClusterLocation, global::System.Convert.ToString); - } - if (content.Contains("ClusterManagerConnectionStatus")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).ClusterManagerConnectionStatus = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterManagerConnectionStatus?) content.GetValueForProperty("ClusterManagerConnectionStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).ClusterManagerConnectionStatus, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterManagerConnectionStatus.CreateFrom); - } - if (content.Contains("ClusterManagerId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).ClusterManagerId = (string) content.GetValueForProperty("ClusterManagerId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).ClusterManagerId, global::System.Convert.ToString); - } - if (content.Contains("ClusterType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).ClusterType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterType) content.GetValueForProperty("ClusterType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).ClusterType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterType.CreateFrom); - } - if (content.Contains("ClusterVersion")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).ClusterVersion = (string) content.GetValueForProperty("ClusterVersion",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).ClusterVersion, global::System.Convert.ToString); - } - if (content.Contains("ComputeRackDefinition")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).ComputeRackDefinition = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackDefinition[]) content.GetValueForProperty("ComputeRackDefinition",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).ComputeRackDefinition, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.RackDefinitionTypeConverter.ConvertFrom)); - } - if (content.Contains("DetailedStatus")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).DetailedStatus = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterDetailedStatus?) content.GetValueForProperty("DetailedStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).DetailedStatus, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterDetailedStatus.CreateFrom); - } - if (content.Contains("DetailedStatusMessage")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).DetailedStatusMessage = (string) content.GetValueForProperty("DetailedStatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).DetailedStatusMessage, global::System.Convert.ToString); - } - if (content.Contains("ManualActionCount")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).ManualActionCount = (long?) content.GetValueForProperty("ManualActionCount",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).ManualActionCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("NetworkFabricId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).NetworkFabricId = (string) content.GetValueForProperty("NetworkFabricId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).NetworkFabricId, global::System.Convert.ToString); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterProvisioningState.CreateFrom); - } - if (content.Contains("SupportExpiryDate")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).SupportExpiryDate = (string) content.GetValueForProperty("SupportExpiryDate",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).SupportExpiryDate, global::System.Convert.ToString); - } - if (content.Contains("WorkloadResourceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).WorkloadResourceId = (string[]) content.GetValueForProperty("WorkloadResourceId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).WorkloadResourceId, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("CommandOutputSettingContainerUrl")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).CommandOutputSettingContainerUrl = (string) content.GetValueForProperty("CommandOutputSettingContainerUrl",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).CommandOutputSettingContainerUrl, global::System.Convert.ToString); - } - if (content.Contains("ManagedResourceGroupConfigurationLocation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).ManagedResourceGroupConfigurationLocation = (string) content.GetValueForProperty("ManagedResourceGroupConfigurationLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).ManagedResourceGroupConfigurationLocation, global::System.Convert.ToString); - } - if (content.Contains("ManagedResourceGroupConfigurationName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).ManagedResourceGroupConfigurationName = (string) content.GetValueForProperty("ManagedResourceGroupConfigurationName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).ManagedResourceGroupConfigurationName, global::System.Convert.ToString); - } - if (content.Contains("SecretArchiveSettingVaultUri")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).SecretArchiveSettingVaultUri = (string) content.GetValueForProperty("SecretArchiveSettingVaultUri",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).SecretArchiveSettingVaultUri, global::System.Convert.ToString); - } - if (content.Contains("VulnerabilityScanningSettingContainerScan")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).VulnerabilityScanningSettingContainerScan = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VulnerabilityScanningSettingsContainerScan?) content.GetValueForProperty("VulnerabilityScanningSettingContainerScan",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).VulnerabilityScanningSettingContainerScan, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VulnerabilityScanningSettingsContainerScan.CreateFrom); - } - if (content.Contains("AggregatorOrSingleRackDefinitionAvailabilityZone")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).AggregatorOrSingleRackDefinitionAvailabilityZone = (string) content.GetValueForProperty("AggregatorOrSingleRackDefinitionAvailabilityZone",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).AggregatorOrSingleRackDefinitionAvailabilityZone, global::System.Convert.ToString); - } - if (content.Contains("AggregatorOrSingleRackDefinitionBareMetalMachineConfigurationData")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).AggregatorOrSingleRackDefinitionBareMetalMachineConfigurationData = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineConfigurationData[]) content.GetValueForProperty("AggregatorOrSingleRackDefinitionBareMetalMachineConfigurationData",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).AggregatorOrSingleRackDefinitionBareMetalMachineConfigurationData, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BareMetalMachineConfigurationDataTypeConverter.ConvertFrom)); - } - if (content.Contains("AggregatorOrSingleRackDefinitionNetworkRackId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).AggregatorOrSingleRackDefinitionNetworkRackId = (string) content.GetValueForProperty("AggregatorOrSingleRackDefinitionNetworkRackId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).AggregatorOrSingleRackDefinitionNetworkRackId, global::System.Convert.ToString); - } - if (content.Contains("AggregatorOrSingleRackDefinitionRackLocation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).AggregatorOrSingleRackDefinitionRackLocation = (string) content.GetValueForProperty("AggregatorOrSingleRackDefinitionRackLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).AggregatorOrSingleRackDefinitionRackLocation, global::System.Convert.ToString); - } - if (content.Contains("AggregatorOrSingleRackDefinitionRackSerialNumber")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).AggregatorOrSingleRackDefinitionRackSerialNumber = (string) content.GetValueForProperty("AggregatorOrSingleRackDefinitionRackSerialNumber",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).AggregatorOrSingleRackDefinitionRackSerialNumber, global::System.Convert.ToString); - } - if (content.Contains("AggregatorOrSingleRackDefinitionRackSkuId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).AggregatorOrSingleRackDefinitionRackSkuId = (string) content.GetValueForProperty("AggregatorOrSingleRackDefinitionRackSkuId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).AggregatorOrSingleRackDefinitionRackSkuId, global::System.Convert.ToString); - } - if (content.Contains("AggregatorOrSingleRackDefinitionStorageApplianceConfigurationData")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).AggregatorOrSingleRackDefinitionStorageApplianceConfigurationData = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceConfigurationData[]) content.GetValueForProperty("AggregatorOrSingleRackDefinitionStorageApplianceConfigurationData",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).AggregatorOrSingleRackDefinitionStorageApplianceConfigurationData, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.StorageApplianceConfigurationDataTypeConverter.ConvertFrom)); - } - if (content.Contains("AnalyticOutputSettingAssociatedIdentity")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).AnalyticOutputSettingAssociatedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIdentitySelector) content.GetValueForProperty("AnalyticOutputSettingAssociatedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).AnalyticOutputSettingAssociatedIdentity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IdentitySelectorTypeConverter.ConvertFrom); - } - if (content.Contains("AnalyticOutputSettingAnalyticsWorkspaceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).AnalyticOutputSettingAnalyticsWorkspaceId = (string) content.GetValueForProperty("AnalyticOutputSettingAnalyticsWorkspaceId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).AnalyticOutputSettingAnalyticsWorkspaceId, global::System.Convert.ToString); - } - if (content.Contains("ClusterCapacityAvailableApplianceStorageGb")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).ClusterCapacityAvailableApplianceStorageGb = (long?) content.GetValueForProperty("ClusterCapacityAvailableApplianceStorageGb",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).ClusterCapacityAvailableApplianceStorageGb, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("ClusterCapacityAvailableCoreCount")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).ClusterCapacityAvailableCoreCount = (long?) content.GetValueForProperty("ClusterCapacityAvailableCoreCount",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).ClusterCapacityAvailableCoreCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("ClusterCapacityAvailableHostStorageGb")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).ClusterCapacityAvailableHostStorageGb = (long?) content.GetValueForProperty("ClusterCapacityAvailableHostStorageGb",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).ClusterCapacityAvailableHostStorageGb, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("ClusterCapacityAvailableMemoryGb")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).ClusterCapacityAvailableMemoryGb = (long?) content.GetValueForProperty("ClusterCapacityAvailableMemoryGb",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).ClusterCapacityAvailableMemoryGb, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("ClusterCapacityTotalApplianceStorageGb")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).ClusterCapacityTotalApplianceStorageGb = (long?) content.GetValueForProperty("ClusterCapacityTotalApplianceStorageGb",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).ClusterCapacityTotalApplianceStorageGb, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("ClusterCapacityTotalCoreCount")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).ClusterCapacityTotalCoreCount = (long?) content.GetValueForProperty("ClusterCapacityTotalCoreCount",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).ClusterCapacityTotalCoreCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("ClusterCapacityTotalHostStorageGb")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).ClusterCapacityTotalHostStorageGb = (long?) content.GetValueForProperty("ClusterCapacityTotalHostStorageGb",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).ClusterCapacityTotalHostStorageGb, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("ClusterCapacityTotalMemoryGb")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).ClusterCapacityTotalMemoryGb = (long?) content.GetValueForProperty("ClusterCapacityTotalMemoryGb",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).ClusterCapacityTotalMemoryGb, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("ClusterExtendedLocationName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).ClusterExtendedLocationName = (string) content.GetValueForProperty("ClusterExtendedLocationName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).ClusterExtendedLocationName, global::System.Convert.ToString); - } - if (content.Contains("ClusterExtendedLocationType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).ClusterExtendedLocationType = (string) content.GetValueForProperty("ClusterExtendedLocationType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).ClusterExtendedLocationType, global::System.Convert.ToString); - } - if (content.Contains("ClusterServicePrincipalApplicationId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).ClusterServicePrincipalApplicationId = (string) content.GetValueForProperty("ClusterServicePrincipalApplicationId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).ClusterServicePrincipalApplicationId, global::System.Convert.ToString); - } - if (content.Contains("ClusterServicePrincipalPassword")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).ClusterServicePrincipalPassword = (System.Security.SecureString) content.GetValueForProperty("ClusterServicePrincipalPassword",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).ClusterServicePrincipalPassword, (object ss) => (System.Security.SecureString)ss); - } - if (content.Contains("ClusterServicePrincipalId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).ClusterServicePrincipalId = (string) content.GetValueForProperty("ClusterServicePrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).ClusterServicePrincipalId, global::System.Convert.ToString); - } - if (content.Contains("ClusterServicePrincipalTenantId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).ClusterServicePrincipalTenantId = (string) content.GetValueForProperty("ClusterServicePrincipalTenantId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).ClusterServicePrincipalTenantId, global::System.Convert.ToString); - } - if (content.Contains("CommandOutputSettingAssociatedIdentity")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).CommandOutputSettingAssociatedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIdentitySelector) content.GetValueForProperty("CommandOutputSettingAssociatedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).CommandOutputSettingAssociatedIdentity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IdentitySelectorTypeConverter.ConvertFrom); - } - if (content.Contains("ComputeDeploymentThresholdGrouping")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).ComputeDeploymentThresholdGrouping = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdGrouping) content.GetValueForProperty("ComputeDeploymentThresholdGrouping",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).ComputeDeploymentThresholdGrouping, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdGrouping.CreateFrom); - } - if (content.Contains("ComputeDeploymentThresholdType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).ComputeDeploymentThresholdType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdType) content.GetValueForProperty("ComputeDeploymentThresholdType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).ComputeDeploymentThresholdType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdType.CreateFrom); - } - if (content.Contains("ComputeDeploymentThresholdValue")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).ComputeDeploymentThresholdValue = (long) content.GetValueForProperty("ComputeDeploymentThresholdValue",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).ComputeDeploymentThresholdValue, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("HybridAkExtendedLocationName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).HybridAkExtendedLocationName = (string) content.GetValueForProperty("HybridAkExtendedLocationName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).HybridAkExtendedLocationName, global::System.Convert.ToString); - } - if (content.Contains("HybridAkExtendedLocationType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).HybridAkExtendedLocationType = (string) content.GetValueForProperty("HybridAkExtendedLocationType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).HybridAkExtendedLocationType, global::System.Convert.ToString); - } - if (content.Contains("RuntimeProtectionConfigurationEnforcementLevel")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).RuntimeProtectionConfigurationEnforcementLevel = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RuntimeProtectionEnforcementLevel?) content.GetValueForProperty("RuntimeProtectionConfigurationEnforcementLevel",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).RuntimeProtectionConfigurationEnforcementLevel, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RuntimeProtectionEnforcementLevel.CreateFrom); - } - if (content.Contains("SecretArchiveKeyVaultId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).SecretArchiveKeyVaultId = (string) content.GetValueForProperty("SecretArchiveKeyVaultId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).SecretArchiveKeyVaultId, global::System.Convert.ToString); - } - if (content.Contains("SecretArchiveUseKeyVault")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).SecretArchiveUseKeyVault = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterSecretArchiveEnabled?) content.GetValueForProperty("SecretArchiveUseKeyVault",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).SecretArchiveUseKeyVault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterSecretArchiveEnabled.CreateFrom); - } - if (content.Contains("SecretArchiveSettingAssociatedIdentity")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).SecretArchiveSettingAssociatedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIdentitySelector) content.GetValueForProperty("SecretArchiveSettingAssociatedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).SecretArchiveSettingAssociatedIdentity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IdentitySelectorTypeConverter.ConvertFrom); - } - if (content.Contains("UpdateStrategyMaxUnavailable")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).UpdateStrategyMaxUnavailable = (long?) content.GetValueForProperty("UpdateStrategyMaxUnavailable",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).UpdateStrategyMaxUnavailable, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("UpdateStrategyType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).UpdateStrategyType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterUpdateStrategyType) content.GetValueForProperty("UpdateStrategyType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).UpdateStrategyType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterUpdateStrategyType.CreateFrom); - } - if (content.Contains("UpdateStrategyThresholdType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).UpdateStrategyThresholdType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdType) content.GetValueForProperty("UpdateStrategyThresholdType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).UpdateStrategyThresholdType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdType.CreateFrom); - } - if (content.Contains("UpdateStrategyThresholdValue")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).UpdateStrategyThresholdValue = (long) content.GetValueForProperty("UpdateStrategyThresholdValue",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).UpdateStrategyThresholdValue, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("UpdateStrategyWaitTimeMinute")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).UpdateStrategyWaitTimeMinute = (long?) content.GetValueForProperty("UpdateStrategyWaitTimeMinute",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).UpdateStrategyWaitTimeMinute, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("AnalyticsOutputSettingsAssociatedIdentityType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).AnalyticsOutputSettingsAssociatedIdentityType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType?) content.GetValueForProperty("AnalyticsOutputSettingsAssociatedIdentityType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).AnalyticsOutputSettingsAssociatedIdentityType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType.CreateFrom); - } - if (content.Contains("AnalyticsOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).AnalyticsOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId = (string) content.GetValueForProperty("AnalyticsOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).AnalyticsOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId, global::System.Convert.ToString); - } - if (content.Contains("CommandOutputSettingsAssociatedIdentityType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).CommandOutputSettingsAssociatedIdentityType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType?) content.GetValueForProperty("CommandOutputSettingsAssociatedIdentityType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).CommandOutputSettingsAssociatedIdentityType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType.CreateFrom); - } - if (content.Contains("CommandOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).CommandOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId = (string) content.GetValueForProperty("CommandOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).CommandOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId, global::System.Convert.ToString); - } - if (content.Contains("SecretArchiveSettingsAssociatedIdentityType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).SecretArchiveSettingsAssociatedIdentityType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType?) content.GetValueForProperty("SecretArchiveSettingsAssociatedIdentityType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).SecretArchiveSettingsAssociatedIdentityType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType.CreateFrom); - } - if (content.Contains("SecretArchiveSettingsAssociatedIdentityUserAssignedIdentityResourceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).SecretArchiveSettingsAssociatedIdentityUserAssignedIdentityResourceId = (string) content.GetValueForProperty("SecretArchiveSettingsAssociatedIdentityUserAssignedIdentityResourceId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).SecretArchiveSettingsAssociatedIdentityUserAssignedIdentityResourceId, 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 ClusterProperties(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("AggregatorOrSingleRackDefinition")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).AggregatorOrSingleRackDefinition = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackDefinition) content.GetValueForProperty("AggregatorOrSingleRackDefinition",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).AggregatorOrSingleRackDefinition, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.RackDefinitionTypeConverter.ConvertFrom); - } - if (content.Contains("AnalyticsOutputSetting")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).AnalyticsOutputSetting = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAnalyticsOutputSettings) content.GetValueForProperty("AnalyticsOutputSetting",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).AnalyticsOutputSetting, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AnalyticsOutputSettingsTypeConverter.ConvertFrom); - } - if (content.Contains("ClusterCapacity")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).ClusterCapacity = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterCapacity) content.GetValueForProperty("ClusterCapacity",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).ClusterCapacity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ClusterCapacityTypeConverter.ConvertFrom); - } - if (content.Contains("ClusterExtendedLocation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).ClusterExtendedLocation = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocation) content.GetValueForProperty("ClusterExtendedLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).ClusterExtendedLocation, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ExtendedLocationTypeConverter.ConvertFrom); - } - if (content.Contains("ClusterServicePrincipal")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).ClusterServicePrincipal = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IServicePrincipalInformation) content.GetValueForProperty("ClusterServicePrincipal",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).ClusterServicePrincipal, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ServicePrincipalInformationTypeConverter.ConvertFrom); - } - if (content.Contains("CommandOutputSetting")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).CommandOutputSetting = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICommandOutputSettings) content.GetValueForProperty("CommandOutputSetting",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).CommandOutputSetting, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.CommandOutputSettingsTypeConverter.ConvertFrom); - } - if (content.Contains("ComputeDeploymentThreshold")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).ComputeDeploymentThreshold = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IValidationThreshold) content.GetValueForProperty("ComputeDeploymentThreshold",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).ComputeDeploymentThreshold, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ValidationThresholdTypeConverter.ConvertFrom); - } - if (content.Contains("HybridAksExtendedLocation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).HybridAksExtendedLocation = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocation) content.GetValueForProperty("HybridAksExtendedLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).HybridAksExtendedLocation, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ExtendedLocationTypeConverter.ConvertFrom); - } - if (content.Contains("ManagedResourceGroupConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).ManagedResourceGroupConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IManagedResourceGroupConfiguration) content.GetValueForProperty("ManagedResourceGroupConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).ManagedResourceGroupConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ManagedResourceGroupConfigurationTypeConverter.ConvertFrom); - } - if (content.Contains("RuntimeProtectionConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).RuntimeProtectionConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRuntimeProtectionConfiguration) content.GetValueForProperty("RuntimeProtectionConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).RuntimeProtectionConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.RuntimeProtectionConfigurationTypeConverter.ConvertFrom); - } - if (content.Contains("SecretArchive")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).SecretArchive = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterSecretArchive) content.GetValueForProperty("SecretArchive",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).SecretArchive, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ClusterSecretArchiveTypeConverter.ConvertFrom); - } - if (content.Contains("SecretArchiveSetting")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).SecretArchiveSetting = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretArchiveSettings) content.GetValueForProperty("SecretArchiveSetting",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).SecretArchiveSetting, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.SecretArchiveSettingsTypeConverter.ConvertFrom); - } - if (content.Contains("UpdateStrategy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).UpdateStrategy = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterUpdateStrategy) content.GetValueForProperty("UpdateStrategy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).UpdateStrategy, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ClusterUpdateStrategyTypeConverter.ConvertFrom); - } - if (content.Contains("VulnerabilityScanningSetting")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).VulnerabilityScanningSetting = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVulnerabilityScanningSettings) content.GetValueForProperty("VulnerabilityScanningSetting",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).VulnerabilityScanningSetting, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.VulnerabilityScanningSettingsTypeConverter.ConvertFrom); - } - if (content.Contains("AnalyticsWorkspaceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).AnalyticsWorkspaceId = (string) content.GetValueForProperty("AnalyticsWorkspaceId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).AnalyticsWorkspaceId, global::System.Convert.ToString); - } - if (content.Contains("AvailableUpgradeVersion")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).AvailableUpgradeVersion = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterAvailableUpgradeVersion[]) content.GetValueForProperty("AvailableUpgradeVersion",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).AvailableUpgradeVersion, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ClusterAvailableUpgradeVersionTypeConverter.ConvertFrom)); - } - if (content.Contains("ClusterConnectionStatus")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).ClusterConnectionStatus = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterConnectionStatus?) content.GetValueForProperty("ClusterConnectionStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).ClusterConnectionStatus, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterConnectionStatus.CreateFrom); - } - if (content.Contains("ClusterLocation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).ClusterLocation = (string) content.GetValueForProperty("ClusterLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).ClusterLocation, global::System.Convert.ToString); - } - if (content.Contains("ClusterManagerConnectionStatus")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).ClusterManagerConnectionStatus = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterManagerConnectionStatus?) content.GetValueForProperty("ClusterManagerConnectionStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).ClusterManagerConnectionStatus, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterManagerConnectionStatus.CreateFrom); - } - if (content.Contains("ClusterManagerId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).ClusterManagerId = (string) content.GetValueForProperty("ClusterManagerId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).ClusterManagerId, global::System.Convert.ToString); - } - if (content.Contains("ClusterType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).ClusterType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterType) content.GetValueForProperty("ClusterType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).ClusterType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterType.CreateFrom); - } - if (content.Contains("ClusterVersion")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).ClusterVersion = (string) content.GetValueForProperty("ClusterVersion",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).ClusterVersion, global::System.Convert.ToString); - } - if (content.Contains("ComputeRackDefinition")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).ComputeRackDefinition = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackDefinition[]) content.GetValueForProperty("ComputeRackDefinition",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).ComputeRackDefinition, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.RackDefinitionTypeConverter.ConvertFrom)); - } - if (content.Contains("DetailedStatus")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).DetailedStatus = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterDetailedStatus?) content.GetValueForProperty("DetailedStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).DetailedStatus, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterDetailedStatus.CreateFrom); - } - if (content.Contains("DetailedStatusMessage")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).DetailedStatusMessage = (string) content.GetValueForProperty("DetailedStatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).DetailedStatusMessage, global::System.Convert.ToString); - } - if (content.Contains("ManualActionCount")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).ManualActionCount = (long?) content.GetValueForProperty("ManualActionCount",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).ManualActionCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("NetworkFabricId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).NetworkFabricId = (string) content.GetValueForProperty("NetworkFabricId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).NetworkFabricId, global::System.Convert.ToString); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterProvisioningState.CreateFrom); - } - if (content.Contains("SupportExpiryDate")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).SupportExpiryDate = (string) content.GetValueForProperty("SupportExpiryDate",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).SupportExpiryDate, global::System.Convert.ToString); - } - if (content.Contains("WorkloadResourceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).WorkloadResourceId = (string[]) content.GetValueForProperty("WorkloadResourceId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).WorkloadResourceId, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("CommandOutputSettingContainerUrl")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).CommandOutputSettingContainerUrl = (string) content.GetValueForProperty("CommandOutputSettingContainerUrl",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).CommandOutputSettingContainerUrl, global::System.Convert.ToString); - } - if (content.Contains("ManagedResourceGroupConfigurationLocation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).ManagedResourceGroupConfigurationLocation = (string) content.GetValueForProperty("ManagedResourceGroupConfigurationLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).ManagedResourceGroupConfigurationLocation, global::System.Convert.ToString); - } - if (content.Contains("ManagedResourceGroupConfigurationName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).ManagedResourceGroupConfigurationName = (string) content.GetValueForProperty("ManagedResourceGroupConfigurationName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).ManagedResourceGroupConfigurationName, global::System.Convert.ToString); - } - if (content.Contains("SecretArchiveSettingVaultUri")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).SecretArchiveSettingVaultUri = (string) content.GetValueForProperty("SecretArchiveSettingVaultUri",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).SecretArchiveSettingVaultUri, global::System.Convert.ToString); - } - if (content.Contains("VulnerabilityScanningSettingContainerScan")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).VulnerabilityScanningSettingContainerScan = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VulnerabilityScanningSettingsContainerScan?) content.GetValueForProperty("VulnerabilityScanningSettingContainerScan",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).VulnerabilityScanningSettingContainerScan, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VulnerabilityScanningSettingsContainerScan.CreateFrom); - } - if (content.Contains("AggregatorOrSingleRackDefinitionAvailabilityZone")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).AggregatorOrSingleRackDefinitionAvailabilityZone = (string) content.GetValueForProperty("AggregatorOrSingleRackDefinitionAvailabilityZone",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).AggregatorOrSingleRackDefinitionAvailabilityZone, global::System.Convert.ToString); - } - if (content.Contains("AggregatorOrSingleRackDefinitionBareMetalMachineConfigurationData")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).AggregatorOrSingleRackDefinitionBareMetalMachineConfigurationData = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineConfigurationData[]) content.GetValueForProperty("AggregatorOrSingleRackDefinitionBareMetalMachineConfigurationData",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).AggregatorOrSingleRackDefinitionBareMetalMachineConfigurationData, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BareMetalMachineConfigurationDataTypeConverter.ConvertFrom)); - } - if (content.Contains("AggregatorOrSingleRackDefinitionNetworkRackId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).AggregatorOrSingleRackDefinitionNetworkRackId = (string) content.GetValueForProperty("AggregatorOrSingleRackDefinitionNetworkRackId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).AggregatorOrSingleRackDefinitionNetworkRackId, global::System.Convert.ToString); - } - if (content.Contains("AggregatorOrSingleRackDefinitionRackLocation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).AggregatorOrSingleRackDefinitionRackLocation = (string) content.GetValueForProperty("AggregatorOrSingleRackDefinitionRackLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).AggregatorOrSingleRackDefinitionRackLocation, global::System.Convert.ToString); - } - if (content.Contains("AggregatorOrSingleRackDefinitionRackSerialNumber")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).AggregatorOrSingleRackDefinitionRackSerialNumber = (string) content.GetValueForProperty("AggregatorOrSingleRackDefinitionRackSerialNumber",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).AggregatorOrSingleRackDefinitionRackSerialNumber, global::System.Convert.ToString); - } - if (content.Contains("AggregatorOrSingleRackDefinitionRackSkuId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).AggregatorOrSingleRackDefinitionRackSkuId = (string) content.GetValueForProperty("AggregatorOrSingleRackDefinitionRackSkuId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).AggregatorOrSingleRackDefinitionRackSkuId, global::System.Convert.ToString); - } - if (content.Contains("AggregatorOrSingleRackDefinitionStorageApplianceConfigurationData")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).AggregatorOrSingleRackDefinitionStorageApplianceConfigurationData = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceConfigurationData[]) content.GetValueForProperty("AggregatorOrSingleRackDefinitionStorageApplianceConfigurationData",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).AggregatorOrSingleRackDefinitionStorageApplianceConfigurationData, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.StorageApplianceConfigurationDataTypeConverter.ConvertFrom)); - } - if (content.Contains("AnalyticOutputSettingAssociatedIdentity")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).AnalyticOutputSettingAssociatedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIdentitySelector) content.GetValueForProperty("AnalyticOutputSettingAssociatedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).AnalyticOutputSettingAssociatedIdentity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IdentitySelectorTypeConverter.ConvertFrom); - } - if (content.Contains("AnalyticOutputSettingAnalyticsWorkspaceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).AnalyticOutputSettingAnalyticsWorkspaceId = (string) content.GetValueForProperty("AnalyticOutputSettingAnalyticsWorkspaceId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).AnalyticOutputSettingAnalyticsWorkspaceId, global::System.Convert.ToString); - } - if (content.Contains("ClusterCapacityAvailableApplianceStorageGb")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).ClusterCapacityAvailableApplianceStorageGb = (long?) content.GetValueForProperty("ClusterCapacityAvailableApplianceStorageGb",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).ClusterCapacityAvailableApplianceStorageGb, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("ClusterCapacityAvailableCoreCount")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).ClusterCapacityAvailableCoreCount = (long?) content.GetValueForProperty("ClusterCapacityAvailableCoreCount",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).ClusterCapacityAvailableCoreCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("ClusterCapacityAvailableHostStorageGb")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).ClusterCapacityAvailableHostStorageGb = (long?) content.GetValueForProperty("ClusterCapacityAvailableHostStorageGb",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).ClusterCapacityAvailableHostStorageGb, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("ClusterCapacityAvailableMemoryGb")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).ClusterCapacityAvailableMemoryGb = (long?) content.GetValueForProperty("ClusterCapacityAvailableMemoryGb",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).ClusterCapacityAvailableMemoryGb, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("ClusterCapacityTotalApplianceStorageGb")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).ClusterCapacityTotalApplianceStorageGb = (long?) content.GetValueForProperty("ClusterCapacityTotalApplianceStorageGb",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).ClusterCapacityTotalApplianceStorageGb, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("ClusterCapacityTotalCoreCount")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).ClusterCapacityTotalCoreCount = (long?) content.GetValueForProperty("ClusterCapacityTotalCoreCount",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).ClusterCapacityTotalCoreCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("ClusterCapacityTotalHostStorageGb")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).ClusterCapacityTotalHostStorageGb = (long?) content.GetValueForProperty("ClusterCapacityTotalHostStorageGb",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).ClusterCapacityTotalHostStorageGb, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("ClusterCapacityTotalMemoryGb")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).ClusterCapacityTotalMemoryGb = (long?) content.GetValueForProperty("ClusterCapacityTotalMemoryGb",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).ClusterCapacityTotalMemoryGb, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("ClusterExtendedLocationName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).ClusterExtendedLocationName = (string) content.GetValueForProperty("ClusterExtendedLocationName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).ClusterExtendedLocationName, global::System.Convert.ToString); - } - if (content.Contains("ClusterExtendedLocationType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).ClusterExtendedLocationType = (string) content.GetValueForProperty("ClusterExtendedLocationType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).ClusterExtendedLocationType, global::System.Convert.ToString); - } - if (content.Contains("ClusterServicePrincipalApplicationId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).ClusterServicePrincipalApplicationId = (string) content.GetValueForProperty("ClusterServicePrincipalApplicationId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).ClusterServicePrincipalApplicationId, global::System.Convert.ToString); - } - if (content.Contains("ClusterServicePrincipalPassword")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).ClusterServicePrincipalPassword = (System.Security.SecureString) content.GetValueForProperty("ClusterServicePrincipalPassword",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).ClusterServicePrincipalPassword, (object ss) => (System.Security.SecureString)ss); - } - if (content.Contains("ClusterServicePrincipalId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).ClusterServicePrincipalId = (string) content.GetValueForProperty("ClusterServicePrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).ClusterServicePrincipalId, global::System.Convert.ToString); - } - if (content.Contains("ClusterServicePrincipalTenantId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).ClusterServicePrincipalTenantId = (string) content.GetValueForProperty("ClusterServicePrincipalTenantId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).ClusterServicePrincipalTenantId, global::System.Convert.ToString); - } - if (content.Contains("CommandOutputSettingAssociatedIdentity")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).CommandOutputSettingAssociatedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIdentitySelector) content.GetValueForProperty("CommandOutputSettingAssociatedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).CommandOutputSettingAssociatedIdentity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IdentitySelectorTypeConverter.ConvertFrom); - } - if (content.Contains("ComputeDeploymentThresholdGrouping")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).ComputeDeploymentThresholdGrouping = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdGrouping) content.GetValueForProperty("ComputeDeploymentThresholdGrouping",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).ComputeDeploymentThresholdGrouping, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdGrouping.CreateFrom); - } - if (content.Contains("ComputeDeploymentThresholdType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).ComputeDeploymentThresholdType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdType) content.GetValueForProperty("ComputeDeploymentThresholdType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).ComputeDeploymentThresholdType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdType.CreateFrom); - } - if (content.Contains("ComputeDeploymentThresholdValue")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).ComputeDeploymentThresholdValue = (long) content.GetValueForProperty("ComputeDeploymentThresholdValue",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).ComputeDeploymentThresholdValue, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("HybridAkExtendedLocationName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).HybridAkExtendedLocationName = (string) content.GetValueForProperty("HybridAkExtendedLocationName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).HybridAkExtendedLocationName, global::System.Convert.ToString); - } - if (content.Contains("HybridAkExtendedLocationType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).HybridAkExtendedLocationType = (string) content.GetValueForProperty("HybridAkExtendedLocationType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).HybridAkExtendedLocationType, global::System.Convert.ToString); - } - if (content.Contains("RuntimeProtectionConfigurationEnforcementLevel")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).RuntimeProtectionConfigurationEnforcementLevel = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RuntimeProtectionEnforcementLevel?) content.GetValueForProperty("RuntimeProtectionConfigurationEnforcementLevel",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).RuntimeProtectionConfigurationEnforcementLevel, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RuntimeProtectionEnforcementLevel.CreateFrom); - } - if (content.Contains("SecretArchiveKeyVaultId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).SecretArchiveKeyVaultId = (string) content.GetValueForProperty("SecretArchiveKeyVaultId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).SecretArchiveKeyVaultId, global::System.Convert.ToString); - } - if (content.Contains("SecretArchiveUseKeyVault")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).SecretArchiveUseKeyVault = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterSecretArchiveEnabled?) content.GetValueForProperty("SecretArchiveUseKeyVault",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).SecretArchiveUseKeyVault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterSecretArchiveEnabled.CreateFrom); - } - if (content.Contains("SecretArchiveSettingAssociatedIdentity")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).SecretArchiveSettingAssociatedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIdentitySelector) content.GetValueForProperty("SecretArchiveSettingAssociatedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).SecretArchiveSettingAssociatedIdentity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IdentitySelectorTypeConverter.ConvertFrom); - } - if (content.Contains("UpdateStrategyMaxUnavailable")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).UpdateStrategyMaxUnavailable = (long?) content.GetValueForProperty("UpdateStrategyMaxUnavailable",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).UpdateStrategyMaxUnavailable, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("UpdateStrategyType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).UpdateStrategyType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterUpdateStrategyType) content.GetValueForProperty("UpdateStrategyType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).UpdateStrategyType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterUpdateStrategyType.CreateFrom); - } - if (content.Contains("UpdateStrategyThresholdType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).UpdateStrategyThresholdType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdType) content.GetValueForProperty("UpdateStrategyThresholdType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).UpdateStrategyThresholdType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdType.CreateFrom); - } - if (content.Contains("UpdateStrategyThresholdValue")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).UpdateStrategyThresholdValue = (long) content.GetValueForProperty("UpdateStrategyThresholdValue",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).UpdateStrategyThresholdValue, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("UpdateStrategyWaitTimeMinute")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).UpdateStrategyWaitTimeMinute = (long?) content.GetValueForProperty("UpdateStrategyWaitTimeMinute",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).UpdateStrategyWaitTimeMinute, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("AnalyticsOutputSettingsAssociatedIdentityType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).AnalyticsOutputSettingsAssociatedIdentityType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType?) content.GetValueForProperty("AnalyticsOutputSettingsAssociatedIdentityType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).AnalyticsOutputSettingsAssociatedIdentityType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType.CreateFrom); - } - if (content.Contains("AnalyticsOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).AnalyticsOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId = (string) content.GetValueForProperty("AnalyticsOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).AnalyticsOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId, global::System.Convert.ToString); - } - if (content.Contains("CommandOutputSettingsAssociatedIdentityType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).CommandOutputSettingsAssociatedIdentityType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType?) content.GetValueForProperty("CommandOutputSettingsAssociatedIdentityType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).CommandOutputSettingsAssociatedIdentityType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType.CreateFrom); - } - if (content.Contains("CommandOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).CommandOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId = (string) content.GetValueForProperty("CommandOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).CommandOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId, global::System.Convert.ToString); - } - if (content.Contains("SecretArchiveSettingsAssociatedIdentityType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).SecretArchiveSettingsAssociatedIdentityType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType?) content.GetValueForProperty("SecretArchiveSettingsAssociatedIdentityType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).SecretArchiveSettingsAssociatedIdentityType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType.CreateFrom); - } - if (content.Contains("SecretArchiveSettingsAssociatedIdentityUserAssignedIdentityResourceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).SecretArchiveSettingsAssociatedIdentityUserAssignedIdentityResourceId = (string) content.GetValueForProperty("SecretArchiveSettingsAssociatedIdentityUserAssignedIdentityResourceId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal)this).SecretArchiveSettingsAssociatedIdentityUserAssignedIdentityResourceId, 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.NetworkCloud.Models.Api20250201.IClusterProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new ClusterProperties(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.NetworkCloud.Models.Api20250201.IClusterProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new ClusterProperties(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.NetworkCloud.Models.Api20250201.IClusterProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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(); - } - } - /// ClusterProperties represents the properties of a cluster. - [System.ComponentModel.TypeConverter(typeof(ClusterPropertiesTypeConverter))] - public partial interface IClusterProperties - - { - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterProperties.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterProperties.cs deleted file mode 100644 index cce8862e0471..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterProperties.cs +++ /dev/null @@ -1,1364 +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.NetworkCloud.Models.Api20250201 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; - - /// ClusterProperties represents the properties of a cluster. - public partial class ClusterProperties : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterProperties, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal - { - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackDefinition _aggregatorOrSingleRackDefinition; - - /// - /// The rack definition that is intended to reflect only a single rack in a single rack cluster, or an aggregator rack in - /// a multi-rack cluster. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackDefinition AggregatorOrSingleRackDefinition { get => (this._aggregatorOrSingleRackDefinition = this._aggregatorOrSingleRackDefinition ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.RackDefinition()); set => this._aggregatorOrSingleRackDefinition = value; } - - /// - /// The zone name used for this rack when created. Availability zones are used for workload placement. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string AggregatorOrSingleRackDefinitionAvailabilityZone { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackDefinitionInternal)AggregatorOrSingleRackDefinition).AvailabilityZone; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackDefinitionInternal)AggregatorOrSingleRackDefinition).AvailabilityZone = value ?? null; } - - /// The unordered list of bare metal machine configuration. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineConfigurationData[] AggregatorOrSingleRackDefinitionBareMetalMachineConfigurationData { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackDefinitionInternal)AggregatorOrSingleRackDefinition).BareMetalMachineConfigurationData; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackDefinitionInternal)AggregatorOrSingleRackDefinition).BareMetalMachineConfigurationData = value ?? null /* arrayOf */; } - - /// The resource ID of the network rack that matches this rack definition. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string AggregatorOrSingleRackDefinitionNetworkRackId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackDefinitionInternal)AggregatorOrSingleRackDefinition).NetworkRackId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackDefinitionInternal)AggregatorOrSingleRackDefinition).NetworkRackId = value ; } - - /// The free-form description of the rack's location. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string AggregatorOrSingleRackDefinitionRackLocation { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackDefinitionInternal)AggregatorOrSingleRackDefinition).RackLocation; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackDefinitionInternal)AggregatorOrSingleRackDefinition).RackLocation = value ?? null; } - - /// - /// The unique identifier for the rack within Network Cloud cluster. An alternate unique alphanumeric value other than a serial - /// number may be provided if desired. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string AggregatorOrSingleRackDefinitionRackSerialNumber { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackDefinitionInternal)AggregatorOrSingleRackDefinition).RackSerialNumber; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackDefinitionInternal)AggregatorOrSingleRackDefinition).RackSerialNumber = value ; } - - /// The resource ID of the sku for the rack being added. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string AggregatorOrSingleRackDefinitionRackSkuId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackDefinitionInternal)AggregatorOrSingleRackDefinition).RackSkuId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackDefinitionInternal)AggregatorOrSingleRackDefinition).RackSkuId = value ; } - - /// The list of storage appliance configuration data for this rack. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceConfigurationData[] AggregatorOrSingleRackDefinitionStorageApplianceConfigurationData { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackDefinitionInternal)AggregatorOrSingleRackDefinition).StorageApplianceConfigurationData; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackDefinitionInternal)AggregatorOrSingleRackDefinition).StorageApplianceConfigurationData = value ?? null /* arrayOf */; } - - /// - /// The resource ID of the analytics workspace that is to be used by the specified identity. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string AnalyticOutputSettingAnalyticsWorkspaceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAnalyticsOutputSettingsInternal)AnalyticsOutputSetting).AnalyticsWorkspaceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAnalyticsOutputSettingsInternal)AnalyticsOutputSetting).AnalyticsWorkspaceId = value ?? null; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAnalyticsOutputSettings _analyticsOutputSetting; - - /// - /// The settings for the log analytics workspace used for output of logs from this cluster. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAnalyticsOutputSettings AnalyticsOutputSetting { get => (this._analyticsOutputSetting = this._analyticsOutputSetting ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AnalyticsOutputSettings()); set => this._analyticsOutputSetting = value; } - - /// The type of managed identity that is being selected. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType? AnalyticsOutputSettingsAssociatedIdentityType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAnalyticsOutputSettingsInternal)AnalyticsOutputSetting).AssociatedIdentityType; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAnalyticsOutputSettingsInternal)AnalyticsOutputSetting).AssociatedIdentityType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType)""); } - - /// - /// The user assigned managed identity resource ID to use. Mutually exclusive with a system assigned identity type. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string AnalyticsOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAnalyticsOutputSettingsInternal)AnalyticsOutputSetting).AssociatedIdentityUserAssignedIdentityResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAnalyticsOutputSettingsInternal)AnalyticsOutputSetting).AssociatedIdentityUserAssignedIdentityResourceId = value ?? null; } - - /// Backing field for property. - private string _analyticsWorkspaceId; - - /// - /// Field Deprecated. The resource ID of the Log Analytics Workspace that will be used for storing relevant logs. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string AnalyticsWorkspaceId { get => this._analyticsWorkspaceId; set => this._analyticsWorkspaceId = value; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterAvailableUpgradeVersion[] _availableUpgradeVersion; - - /// The list of cluster runtime version upgrades available for this cluster. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterAvailableUpgradeVersion[] AvailableUpgradeVersion { get => this._availableUpgradeVersion; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterCapacity _clusterCapacity; - - /// The capacity supported by this cluster. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterCapacity ClusterCapacity { get => (this._clusterCapacity = this._clusterCapacity ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ClusterCapacity()); } - - /// - /// The remaining appliance-based storage in GB available for workload use. Measured in gibibytes. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public long? ClusterCapacityAvailableApplianceStorageGb { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterCapacityInternal)ClusterCapacity).AvailableApplianceStorageGb; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterCapacityInternal)ClusterCapacity).AvailableApplianceStorageGb = value ?? default(long); } - - /// - /// The remaining number of cores that are available in this cluster for workload use. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public long? ClusterCapacityAvailableCoreCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterCapacityInternal)ClusterCapacity).AvailableCoreCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterCapacityInternal)ClusterCapacity).AvailableCoreCount = value ?? default(long); } - - /// - /// The remaining machine or host-based storage in GB available for workload use. Measured in gibibytes. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public long? ClusterCapacityAvailableHostStorageGb { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterCapacityInternal)ClusterCapacity).AvailableHostStorageGb; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterCapacityInternal)ClusterCapacity).AvailableHostStorageGb = value ?? default(long); } - - /// - /// The remaining memory in GB that are available in this cluster for workload use. Measured in gibibytes. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public long? ClusterCapacityAvailableMemoryGb { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterCapacityInternal)ClusterCapacity).AvailableMemoryGb; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterCapacityInternal)ClusterCapacity).AvailableMemoryGb = value ?? default(long); } - - /// - /// The total appliance-based storage in GB supported by this cluster for workload use. Measured in gibibytes. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public long? ClusterCapacityTotalApplianceStorageGb { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterCapacityInternal)ClusterCapacity).TotalApplianceStorageGb; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterCapacityInternal)ClusterCapacity).TotalApplianceStorageGb = value ?? default(long); } - - /// The total number of cores that are supported by this cluster for workload use. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public long? ClusterCapacityTotalCoreCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterCapacityInternal)ClusterCapacity).TotalCoreCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterCapacityInternal)ClusterCapacity).TotalCoreCount = value ?? default(long); } - - /// - /// The total machine or host-based storage in GB supported by this cluster for workload use. Measured in gibibytes. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public long? ClusterCapacityTotalHostStorageGb { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterCapacityInternal)ClusterCapacity).TotalHostStorageGb; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterCapacityInternal)ClusterCapacity).TotalHostStorageGb = value ?? default(long); } - - /// - /// The total memory supported by this cluster for workload use. Measured in gibibytes. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public long? ClusterCapacityTotalMemoryGb { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterCapacityInternal)ClusterCapacity).TotalMemoryGb; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterCapacityInternal)ClusterCapacity).TotalMemoryGb = value ?? default(long); } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterConnectionStatus? _clusterConnectionStatus; - - /// The latest heartbeat status between the cluster manager and the cluster. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterConnectionStatus? ClusterConnectionStatus { get => this._clusterConnectionStatus; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocation _clusterExtendedLocation; - - /// - /// The extended location (custom location) that represents the cluster's control plane location. This extended location is - /// used to route the requests of child objects of the cluster that are handled by the platform operator. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocation ClusterExtendedLocation { get => (this._clusterExtendedLocation = this._clusterExtendedLocation ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ExtendedLocation()); } - - /// The resource ID of the extended location on which the resource will be created. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string ClusterExtendedLocationName { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocationInternal)ClusterExtendedLocation).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocationInternal)ClusterExtendedLocation).Name = value ?? null; } - - /// The extended location type, for example, CustomLocation. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string ClusterExtendedLocationType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocationInternal)ClusterExtendedLocation).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocationInternal)ClusterExtendedLocation).Type = value ?? null; } - - /// Backing field for property. - private string _clusterLocation; - - /// - /// The customer-provided location information to identify where the cluster resides. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string ClusterLocation { get => this._clusterLocation; set => this._clusterLocation = value; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterManagerConnectionStatus? _clusterManagerConnectionStatus; - - /// The latest connectivity status between cluster manager and the cluster. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterManagerConnectionStatus? ClusterManagerConnectionStatus { get => this._clusterManagerConnectionStatus; } - - /// Backing field for property. - private string _clusterManagerId; - - /// - /// The resource ID of the cluster manager that manages this cluster. This is set by the Cluster Manager when the cluster - /// is created. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string ClusterManagerId { get => this._clusterManagerId; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IServicePrincipalInformation _clusterServicePrincipal; - - /// - /// The service principal to be used by the cluster during Arc Appliance installation. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IServicePrincipalInformation ClusterServicePrincipal { get => (this._clusterServicePrincipal = this._clusterServicePrincipal ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ServicePrincipalInformation()); set => this._clusterServicePrincipal = value; } - - /// The application ID, also known as client ID, of the service principal. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string ClusterServicePrincipalApplicationId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IServicePrincipalInformationInternal)ClusterServicePrincipal).ApplicationId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IServicePrincipalInformationInternal)ClusterServicePrincipal).ApplicationId = value ?? null; } - - /// The principal ID, also known as the object ID, of the service principal. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string ClusterServicePrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IServicePrincipalInformationInternal)ClusterServicePrincipal).PrincipalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IServicePrincipalInformationInternal)ClusterServicePrincipal).PrincipalId = value ?? null; } - - /// The password of the service principal. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public System.Security.SecureString ClusterServicePrincipalPassword { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IServicePrincipalInformationInternal)ClusterServicePrincipal).Password; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IServicePrincipalInformationInternal)ClusterServicePrincipal).Password = value ?? null; } - - /// - /// The tenant ID, also known as the directory ID, of the tenant in which the service principal is created. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string ClusterServicePrincipalTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IServicePrincipalInformationInternal)ClusterServicePrincipal).TenantId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IServicePrincipalInformationInternal)ClusterServicePrincipal).TenantId = value ?? null; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterType _clusterType; - - /// The type of rack configuration for the cluster. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterType ClusterType { get => this._clusterType; set => this._clusterType = value; } - - /// Backing field for property. - private string _clusterVersion; - - /// The current runtime version of the cluster. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string ClusterVersion { get => this._clusterVersion; set => this._clusterVersion = value; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICommandOutputSettings _commandOutputSetting; - - /// - /// The settings for commands run in this cluster, such as bare metal machine run read only commands and data extracts. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICommandOutputSettings CommandOutputSetting { get => (this._commandOutputSetting = this._commandOutputSetting ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.CommandOutputSettings()); set => this._commandOutputSetting = value; } - - /// - /// The URL of the storage account container that is to be used by the specified identities. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string CommandOutputSettingContainerUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICommandOutputSettingsInternal)CommandOutputSetting).ContainerUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICommandOutputSettingsInternal)CommandOutputSetting).ContainerUrl = value ?? null; } - - /// The type of managed identity that is being selected. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType? CommandOutputSettingsAssociatedIdentityType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICommandOutputSettingsInternal)CommandOutputSetting).AssociatedIdentityType; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICommandOutputSettingsInternal)CommandOutputSetting).AssociatedIdentityType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType)""); } - - /// - /// The user assigned managed identity resource ID to use. Mutually exclusive with a system assigned identity type. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string CommandOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICommandOutputSettingsInternal)CommandOutputSetting).AssociatedIdentityUserAssignedIdentityResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICommandOutputSettingsInternal)CommandOutputSetting).AssociatedIdentityUserAssignedIdentityResourceId = value ?? null; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IValidationThreshold _computeDeploymentThreshold; - - /// - /// The validation threshold indicating the allowable failures of compute machines during environment validation and deployment. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IValidationThreshold ComputeDeploymentThreshold { get => (this._computeDeploymentThreshold = this._computeDeploymentThreshold ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ValidationThreshold()); set => this._computeDeploymentThreshold = value; } - - /// Selection of how the type evaluation is applied to the cluster calculation. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdGrouping? ComputeDeploymentThresholdGrouping { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IValidationThresholdInternal)ComputeDeploymentThreshold).Grouping; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IValidationThresholdInternal)ComputeDeploymentThreshold).Grouping = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdGrouping)""); } - - /// Selection of how the threshold should be evaluated. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdType? ComputeDeploymentThresholdType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IValidationThresholdInternal)ComputeDeploymentThreshold).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IValidationThresholdInternal)ComputeDeploymentThreshold).Type = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdType)""); } - - /// The numeric threshold value. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public long? ComputeDeploymentThresholdValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IValidationThresholdInternal)ComputeDeploymentThreshold).Value; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IValidationThresholdInternal)ComputeDeploymentThreshold).Value = value ?? default(long); } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackDefinition[] _computeRackDefinition; - - /// - /// The list of rack definitions for the compute racks in a multi-rack - /// cluster, or an empty list in a single-rack cluster. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackDefinition[] ComputeRackDefinition { get => this._computeRackDefinition; set => this._computeRackDefinition = value; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterDetailedStatus? _detailedStatus; - - /// The current detailed status of the cluster. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterDetailedStatus? DetailedStatus { get => this._detailedStatus; } - - /// Backing field for property. - private string _detailedStatusMessage; - - /// The descriptive message about the detailed status. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string DetailedStatusMessage { get => this._detailedStatusMessage; } - - /// The resource ID of the extended location on which the resource will be created. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string HybridAkExtendedLocationName { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocationInternal)HybridAksExtendedLocation).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocationInternal)HybridAksExtendedLocation).Name = value ?? null; } - - /// The extended location type, for example, CustomLocation. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string HybridAkExtendedLocationType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocationInternal)HybridAksExtendedLocation).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocationInternal)HybridAksExtendedLocation).Type = value ?? null; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocation _hybridAksExtendedLocation; - - /// - /// Field Deprecated. This field will not be populated in an upcoming version. The extended location (custom location) that - /// represents the Hybrid AKS control plane location. This extended location is used when creating provisioned clusters (Hybrid - /// AKS clusters). - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocation HybridAksExtendedLocation { get => (this._hybridAksExtendedLocation = this._hybridAksExtendedLocation ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ExtendedLocation()); } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IManagedResourceGroupConfiguration _managedResourceGroupConfiguration; - - /// The configuration of the managed resource group associated with the resource. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IManagedResourceGroupConfiguration ManagedResourceGroupConfiguration { get => (this._managedResourceGroupConfiguration = this._managedResourceGroupConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ManagedResourceGroupConfiguration()); set => this._managedResourceGroupConfiguration = value; } - - /// - /// The location of the managed resource group. If not specified, the location of the parent resource is chosen. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string ManagedResourceGroupConfigurationLocation { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IManagedResourceGroupConfigurationInternal)ManagedResourceGroupConfiguration).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IManagedResourceGroupConfigurationInternal)ManagedResourceGroupConfiguration).Location = value ?? null; } - - /// - /// The name for the managed resource group. If not specified, the unique name is automatically generated. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string ManagedResourceGroupConfigurationName { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IManagedResourceGroupConfigurationInternal)ManagedResourceGroupConfiguration).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IManagedResourceGroupConfigurationInternal)ManagedResourceGroupConfiguration).Name = value ?? null; } - - /// Backing field for property. - private long? _manualActionCount; - - /// The count of Manual Action Taken (MAT) events that have not been validated. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public long? ManualActionCount { get => this._manualActionCount; } - - /// Internal Acessors for AggregatorOrSingleRackDefinition - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackDefinition Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal.AggregatorOrSingleRackDefinition { get => (this._aggregatorOrSingleRackDefinition = this._aggregatorOrSingleRackDefinition ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.RackDefinition()); set { {_aggregatorOrSingleRackDefinition = value;} } } - - /// Internal Acessors for AnalyticOutputSettingAssociatedIdentity - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIdentitySelector Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal.AnalyticOutputSettingAssociatedIdentity { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAnalyticsOutputSettingsInternal)AnalyticsOutputSetting).AssociatedIdentity; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAnalyticsOutputSettingsInternal)AnalyticsOutputSetting).AssociatedIdentity = value; } - - /// Internal Acessors for AnalyticsOutputSetting - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAnalyticsOutputSettings Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal.AnalyticsOutputSetting { get => (this._analyticsOutputSetting = this._analyticsOutputSetting ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AnalyticsOutputSettings()); set { {_analyticsOutputSetting = value;} } } - - /// Internal Acessors for AvailableUpgradeVersion - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterAvailableUpgradeVersion[] Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal.AvailableUpgradeVersion { get => this._availableUpgradeVersion; set { {_availableUpgradeVersion = value;} } } - - /// Internal Acessors for ClusterCapacity - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterCapacity Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal.ClusterCapacity { get => (this._clusterCapacity = this._clusterCapacity ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ClusterCapacity()); set { {_clusterCapacity = value;} } } - - /// Internal Acessors for ClusterConnectionStatus - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterConnectionStatus? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal.ClusterConnectionStatus { get => this._clusterConnectionStatus; set { {_clusterConnectionStatus = value;} } } - - /// Internal Acessors for ClusterExtendedLocation - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocation Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal.ClusterExtendedLocation { get => (this._clusterExtendedLocation = this._clusterExtendedLocation ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ExtendedLocation()); set { {_clusterExtendedLocation = value;} } } - - /// Internal Acessors for ClusterManagerConnectionStatus - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterManagerConnectionStatus? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal.ClusterManagerConnectionStatus { get => this._clusterManagerConnectionStatus; set { {_clusterManagerConnectionStatus = value;} } } - - /// Internal Acessors for ClusterManagerId - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal.ClusterManagerId { get => this._clusterManagerId; set { {_clusterManagerId = value;} } } - - /// Internal Acessors for ClusterServicePrincipal - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IServicePrincipalInformation Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal.ClusterServicePrincipal { get => (this._clusterServicePrincipal = this._clusterServicePrincipal ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ServicePrincipalInformation()); set { {_clusterServicePrincipal = value;} } } - - /// Internal Acessors for CommandOutputSetting - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICommandOutputSettings Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal.CommandOutputSetting { get => (this._commandOutputSetting = this._commandOutputSetting ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.CommandOutputSettings()); set { {_commandOutputSetting = value;} } } - - /// Internal Acessors for CommandOutputSettingAssociatedIdentity - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIdentitySelector Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal.CommandOutputSettingAssociatedIdentity { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICommandOutputSettingsInternal)CommandOutputSetting).AssociatedIdentity; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICommandOutputSettingsInternal)CommandOutputSetting).AssociatedIdentity = value; } - - /// Internal Acessors for ComputeDeploymentThreshold - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IValidationThreshold Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal.ComputeDeploymentThreshold { get => (this._computeDeploymentThreshold = this._computeDeploymentThreshold ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ValidationThreshold()); set { {_computeDeploymentThreshold = value;} } } - - /// Internal Acessors for DetailedStatus - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterDetailedStatus? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal.DetailedStatus { get => this._detailedStatus; set { {_detailedStatus = value;} } } - - /// Internal Acessors for DetailedStatusMessage - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal.DetailedStatusMessage { get => this._detailedStatusMessage; set { {_detailedStatusMessage = value;} } } - - /// Internal Acessors for HybridAksExtendedLocation - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocation Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal.HybridAksExtendedLocation { get => (this._hybridAksExtendedLocation = this._hybridAksExtendedLocation ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ExtendedLocation()); set { {_hybridAksExtendedLocation = value;} } } - - /// Internal Acessors for ManagedResourceGroupConfiguration - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IManagedResourceGroupConfiguration Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal.ManagedResourceGroupConfiguration { get => (this._managedResourceGroupConfiguration = this._managedResourceGroupConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ManagedResourceGroupConfiguration()); set { {_managedResourceGroupConfiguration = value;} } } - - /// Internal Acessors for ManualActionCount - long? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal.ManualActionCount { get => this._manualActionCount; set { {_manualActionCount = value;} } } - - /// Internal Acessors for ProvisioningState - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterProvisioningState? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal.ProvisioningState { get => this._provisioningState; set { {_provisioningState = value;} } } - - /// Internal Acessors for RuntimeProtectionConfiguration - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRuntimeProtectionConfiguration Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal.RuntimeProtectionConfiguration { get => (this._runtimeProtectionConfiguration = this._runtimeProtectionConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.RuntimeProtectionConfiguration()); set { {_runtimeProtectionConfiguration = value;} } } - - /// Internal Acessors for SecretArchive - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterSecretArchive Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal.SecretArchive { get => (this._secretArchive = this._secretArchive ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ClusterSecretArchive()); set { {_secretArchive = value;} } } - - /// Internal Acessors for SecretArchiveSetting - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretArchiveSettings Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal.SecretArchiveSetting { get => (this._secretArchiveSetting = this._secretArchiveSetting ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.SecretArchiveSettings()); set { {_secretArchiveSetting = value;} } } - - /// Internal Acessors for SecretArchiveSettingAssociatedIdentity - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIdentitySelector Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal.SecretArchiveSettingAssociatedIdentity { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretArchiveSettingsInternal)SecretArchiveSetting).AssociatedIdentity; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretArchiveSettingsInternal)SecretArchiveSetting).AssociatedIdentity = value; } - - /// Internal Acessors for SupportExpiryDate - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal.SupportExpiryDate { get => this._supportExpiryDate; set { {_supportExpiryDate = value;} } } - - /// Internal Acessors for UpdateStrategy - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterUpdateStrategy Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal.UpdateStrategy { get => (this._updateStrategy = this._updateStrategy ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ClusterUpdateStrategy()); set { {_updateStrategy = value;} } } - - /// Internal Acessors for VulnerabilityScanningSetting - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVulnerabilityScanningSettings Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal.VulnerabilityScanningSetting { get => (this._vulnerabilityScanningSetting = this._vulnerabilityScanningSetting ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.VulnerabilityScanningSettings()); set { {_vulnerabilityScanningSetting = value;} } } - - /// Internal Acessors for WorkloadResourceId - string[] Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPropertiesInternal.WorkloadResourceId { get => this._workloadResourceId; set { {_workloadResourceId = value;} } } - - /// Backing field for property. - private string _networkFabricId; - - /// The resource ID of the Network Fabric associated with the cluster. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string NetworkFabricId { get => this._networkFabricId; set => this._networkFabricId = value; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterProvisioningState? _provisioningState; - - /// The provisioning state of the cluster. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterProvisioningState? ProvisioningState { get => this._provisioningState; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRuntimeProtectionConfiguration _runtimeProtectionConfiguration; - - /// The settings for cluster runtime protection. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRuntimeProtectionConfiguration RuntimeProtectionConfiguration { get => (this._runtimeProtectionConfiguration = this._runtimeProtectionConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.RuntimeProtectionConfiguration()); set => this._runtimeProtectionConfiguration = value; } - - /// The mode of operation for runtime protection. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RuntimeProtectionEnforcementLevel? RuntimeProtectionConfigurationEnforcementLevel { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRuntimeProtectionConfigurationInternal)RuntimeProtectionConfiguration).EnforcementLevel; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRuntimeProtectionConfigurationInternal)RuntimeProtectionConfiguration).EnforcementLevel = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RuntimeProtectionEnforcementLevel)""); } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterSecretArchive _secretArchive; - - /// - /// The configuration for use of a key vault to store secrets for later retrieval by the operator. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterSecretArchive SecretArchive { get => (this._secretArchive = this._secretArchive ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ClusterSecretArchive()); set => this._secretArchive = value; } - - /// The resource ID of the key vault to archive the secrets of the cluster. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string SecretArchiveKeyVaultId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterSecretArchiveInternal)SecretArchive).KeyVaultId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterSecretArchiveInternal)SecretArchive).KeyVaultId = value ?? null; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretArchiveSettings _secretArchiveSetting; - - /// The settings for the secret archive used to hold credentials for the cluster. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretArchiveSettings SecretArchiveSetting { get => (this._secretArchiveSetting = this._secretArchiveSetting ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.SecretArchiveSettings()); set => this._secretArchiveSetting = value; } - - /// The URI for the key vault used as the secret archive. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string SecretArchiveSettingVaultUri { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretArchiveSettingsInternal)SecretArchiveSetting).VaultUri; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretArchiveSettingsInternal)SecretArchiveSetting).VaultUri = value ?? null; } - - /// The type of managed identity that is being selected. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType? SecretArchiveSettingsAssociatedIdentityType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretArchiveSettingsInternal)SecretArchiveSetting).AssociatedIdentityType; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretArchiveSettingsInternal)SecretArchiveSetting).AssociatedIdentityType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType)""); } - - /// - /// The user assigned managed identity resource ID to use. Mutually exclusive with a system assigned identity type. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string SecretArchiveSettingsAssociatedIdentityUserAssignedIdentityResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretArchiveSettingsInternal)SecretArchiveSetting).AssociatedIdentityUserAssignedIdentityResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretArchiveSettingsInternal)SecretArchiveSetting).AssociatedIdentityUserAssignedIdentityResourceId = value ?? null; } - - /// - /// The indicator if the specified key vault should be used to archive the secrets of the cluster. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterSecretArchiveEnabled? SecretArchiveUseKeyVault { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterSecretArchiveInternal)SecretArchive).UseKeyVault; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterSecretArchiveInternal)SecretArchive).UseKeyVault = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterSecretArchiveEnabled)""); } - - /// Backing field for property. - private string _supportExpiryDate; - - /// The support end date of the runtime version of the cluster. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string SupportExpiryDate { get => this._supportExpiryDate; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterUpdateStrategy _updateStrategy; - - /// The strategy for updating the cluster. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterUpdateStrategy UpdateStrategy { get => (this._updateStrategy = this._updateStrategy ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ClusterUpdateStrategy()); set => this._updateStrategy = value; } - - /// - /// The maximum number of worker nodes that can be offline within the increment of update, e.g., rack-by-rack. - /// Limited by the maximum number of machines in the increment. Defaults to the whole increment size. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public long? UpdateStrategyMaxUnavailable { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterUpdateStrategyInternal)UpdateStrategy).MaxUnavailable; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterUpdateStrategyInternal)UpdateStrategy).MaxUnavailable = value ?? default(long); } - - /// Selection of how the threshold should be evaluated. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdType? UpdateStrategyThresholdType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterUpdateStrategyInternal)UpdateStrategy).ThresholdType; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterUpdateStrategyInternal)UpdateStrategy).ThresholdType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdType)""); } - - /// The numeric threshold value. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public long? UpdateStrategyThresholdValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterUpdateStrategyInternal)UpdateStrategy).ThresholdValue; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterUpdateStrategyInternal)UpdateStrategy).ThresholdValue = value ?? default(long); } - - /// The mode of operation for runtime protection. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterUpdateStrategyType? UpdateStrategyType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterUpdateStrategyInternal)UpdateStrategy).StrategyType; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterUpdateStrategyInternal)UpdateStrategy).StrategyType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterUpdateStrategyType)""); } - - /// The time to wait between the increments of update defined by the strategy. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public long? UpdateStrategyWaitTimeMinute { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterUpdateStrategyInternal)UpdateStrategy).WaitTimeMinute; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterUpdateStrategyInternal)UpdateStrategy).WaitTimeMinute = value ?? default(long); } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVulnerabilityScanningSettings _vulnerabilityScanningSetting; - - /// The settings for how security vulnerability scanning is applied to the cluster. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVulnerabilityScanningSettings VulnerabilityScanningSetting { get => (this._vulnerabilityScanningSetting = this._vulnerabilityScanningSetting ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.VulnerabilityScanningSettings()); set => this._vulnerabilityScanningSetting = value; } - - /// The mode selection for container vulnerability scanning. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VulnerabilityScanningSettingsContainerScan? VulnerabilityScanningSettingContainerScan { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVulnerabilityScanningSettingsInternal)VulnerabilityScanningSetting).ContainerScan; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVulnerabilityScanningSettingsInternal)VulnerabilityScanningSetting).ContainerScan = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VulnerabilityScanningSettingsContainerScan)""); } - - /// Backing field for property. - private string[] _workloadResourceId; - - /// The list of workload resource IDs that are hosted within this cluster. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string[] WorkloadResourceId { get => this._workloadResourceId; } - - /// Creates an new instance. - public ClusterProperties() - { - - } - } - /// ClusterProperties represents the properties of a cluster. - public partial interface IClusterProperties : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable - { - /// - /// The zone name used for this rack when created. Availability zones are used for workload placement. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The zone name used for this rack when created. Availability zones are used for workload placement.", - SerializedName = @"availabilityZone", - PossibleTypes = new [] { typeof(string) })] - string AggregatorOrSingleRackDefinitionAvailabilityZone { get; set; } - /// The unordered list of bare metal machine configuration. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The unordered list of bare metal machine configuration.", - SerializedName = @"bareMetalMachineConfigurationData", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineConfigurationData) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineConfigurationData[] AggregatorOrSingleRackDefinitionBareMetalMachineConfigurationData { get; set; } - /// The resource ID of the network rack that matches this rack definition. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The resource ID of the network rack that matches this rack definition.", - SerializedName = @"networkRackId", - PossibleTypes = new [] { typeof(string) })] - string AggregatorOrSingleRackDefinitionNetworkRackId { get; set; } - /// The free-form description of the rack's location. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The free-form description of the rack's location.", - SerializedName = @"rackLocation", - PossibleTypes = new [] { typeof(string) })] - string AggregatorOrSingleRackDefinitionRackLocation { get; set; } - /// - /// The unique identifier for the rack within Network Cloud cluster. An alternate unique alphanumeric value other than a serial - /// number may be provided if desired. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The unique identifier for the rack within Network Cloud cluster. An alternate unique alphanumeric value other than a serial number may be provided if desired.", - SerializedName = @"rackSerialNumber", - PossibleTypes = new [] { typeof(string) })] - string AggregatorOrSingleRackDefinitionRackSerialNumber { get; set; } - /// The resource ID of the sku for the rack being added. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The resource ID of the sku for the rack being added.", - SerializedName = @"rackSkuId", - PossibleTypes = new [] { typeof(string) })] - string AggregatorOrSingleRackDefinitionRackSkuId { get; set; } - /// The list of storage appliance configuration data for this rack. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The list of storage appliance configuration data for this rack.", - SerializedName = @"storageApplianceConfigurationData", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceConfigurationData) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceConfigurationData[] AggregatorOrSingleRackDefinitionStorageApplianceConfigurationData { get; set; } - /// - /// The resource ID of the analytics workspace that is to be used by the specified identity. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The resource ID of the analytics workspace that is to be used by the specified identity.", - SerializedName = @"analyticsWorkspaceId", - PossibleTypes = new [] { typeof(string) })] - string AnalyticOutputSettingAnalyticsWorkspaceId { get; set; } - /// The type of managed identity that is being selected. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The type of managed identity that is being selected.", - SerializedName = @"identityType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType? AnalyticsOutputSettingsAssociatedIdentityType { get; set; } - /// - /// The user assigned managed identity resource ID to use. Mutually exclusive with a system assigned identity type. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The user assigned managed identity resource ID to use. Mutually exclusive with a system assigned identity type.", - SerializedName = @"userAssignedIdentityResourceId", - PossibleTypes = new [] { typeof(string) })] - string AnalyticsOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId { get; set; } - /// - /// Field Deprecated. The resource ID of the Log Analytics Workspace that will be used for storing relevant logs. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Field Deprecated. The resource ID of the Log Analytics Workspace that will be used for storing relevant logs.", - SerializedName = @"analyticsWorkspaceId", - PossibleTypes = new [] { typeof(string) })] - string AnalyticsWorkspaceId { get; set; } - /// The list of cluster runtime version upgrades available for this cluster. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The list of cluster runtime version upgrades available for this cluster.", - SerializedName = @"availableUpgradeVersions", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterAvailableUpgradeVersion) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterAvailableUpgradeVersion[] AvailableUpgradeVersion { get; } - /// - /// The remaining appliance-based storage in GB available for workload use. Measured in gibibytes. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The remaining appliance-based storage in GB available for workload use. Measured in gibibytes.", - SerializedName = @"availableApplianceStorageGB", - PossibleTypes = new [] { typeof(long) })] - long? ClusterCapacityAvailableApplianceStorageGb { get; set; } - /// - /// The remaining number of cores that are available in this cluster for workload use. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The remaining number of cores that are available in this cluster for workload use.", - SerializedName = @"availableCoreCount", - PossibleTypes = new [] { typeof(long) })] - long? ClusterCapacityAvailableCoreCount { get; set; } - /// - /// The remaining machine or host-based storage in GB available for workload use. Measured in gibibytes. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The remaining machine or host-based storage in GB available for workload use. Measured in gibibytes.", - SerializedName = @"availableHostStorageGB", - PossibleTypes = new [] { typeof(long) })] - long? ClusterCapacityAvailableHostStorageGb { get; set; } - /// - /// The remaining memory in GB that are available in this cluster for workload use. Measured in gibibytes. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The remaining memory in GB that are available in this cluster for workload use. Measured in gibibytes.", - SerializedName = @"availableMemoryGB", - PossibleTypes = new [] { typeof(long) })] - long? ClusterCapacityAvailableMemoryGb { get; set; } - /// - /// The total appliance-based storage in GB supported by this cluster for workload use. Measured in gibibytes. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The total appliance-based storage in GB supported by this cluster for workload use. Measured in gibibytes.", - SerializedName = @"totalApplianceStorageGB", - PossibleTypes = new [] { typeof(long) })] - long? ClusterCapacityTotalApplianceStorageGb { get; set; } - /// The total number of cores that are supported by this cluster for workload use. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The total number of cores that are supported by this cluster for workload use.", - SerializedName = @"totalCoreCount", - PossibleTypes = new [] { typeof(long) })] - long? ClusterCapacityTotalCoreCount { get; set; } - /// - /// The total machine or host-based storage in GB supported by this cluster for workload use. Measured in gibibytes. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The total machine or host-based storage in GB supported by this cluster for workload use. Measured in gibibytes.", - SerializedName = @"totalHostStorageGB", - PossibleTypes = new [] { typeof(long) })] - long? ClusterCapacityTotalHostStorageGb { get; set; } - /// - /// The total memory supported by this cluster for workload use. Measured in gibibytes. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The total memory supported by this cluster for workload use. Measured in gibibytes.", - SerializedName = @"totalMemoryGB", - PossibleTypes = new [] { typeof(long) })] - long? ClusterCapacityTotalMemoryGb { get; set; } - /// The latest heartbeat status between the cluster manager and the cluster. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The latest heartbeat status between the cluster manager and the cluster.", - SerializedName = @"clusterConnectionStatus", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterConnectionStatus) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterConnectionStatus? ClusterConnectionStatus { get; } - /// The resource ID of the extended location on which the resource will be created. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The resource ID of the extended location on which the resource will be created.", - SerializedName = @"name", - PossibleTypes = new [] { typeof(string) })] - string ClusterExtendedLocationName { get; set; } - /// The extended location type, for example, CustomLocation. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The extended location type, for example, CustomLocation.", - SerializedName = @"type", - PossibleTypes = new [] { typeof(string) })] - string ClusterExtendedLocationType { get; set; } - /// - /// The customer-provided location information to identify where the cluster resides. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The customer-provided location information to identify where the cluster resides.", - SerializedName = @"clusterLocation", - PossibleTypes = new [] { typeof(string) })] - string ClusterLocation { get; set; } - /// The latest connectivity status between cluster manager and the cluster. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The latest connectivity status between cluster manager and the cluster.", - SerializedName = @"clusterManagerConnectionStatus", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterManagerConnectionStatus) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterManagerConnectionStatus? ClusterManagerConnectionStatus { get; } - /// - /// The resource ID of the cluster manager that manages this cluster. This is set by the Cluster Manager when the cluster - /// is created. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The resource ID of the cluster manager that manages this cluster. This is set by the Cluster Manager when the cluster is created.", - SerializedName = @"clusterManagerId", - PossibleTypes = new [] { typeof(string) })] - string ClusterManagerId { get; } - /// The application ID, also known as client ID, of the service principal. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The application ID, also known as client ID, of the service principal.", - SerializedName = @"applicationId", - PossibleTypes = new [] { typeof(string) })] - string ClusterServicePrincipalApplicationId { get; set; } - /// The principal ID, also known as the object ID, of the service principal. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The principal ID, also known as the object ID, of the service principal.", - SerializedName = @"principalId", - PossibleTypes = new [] { typeof(string) })] - string ClusterServicePrincipalId { get; set; } - /// The password of the service principal. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The password of the service principal.", - SerializedName = @"password", - PossibleTypes = new [] { typeof(System.Security.SecureString) })] - System.Security.SecureString ClusterServicePrincipalPassword { get; set; } - /// - /// The tenant ID, also known as the directory ID, of the tenant in which the service principal is created. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The tenant ID, also known as the directory ID, of the tenant in which the service principal is created.", - SerializedName = @"tenantId", - PossibleTypes = new [] { typeof(string) })] - string ClusterServicePrincipalTenantId { get; set; } - /// The type of rack configuration for the cluster. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The type of rack configuration for the cluster.", - SerializedName = @"clusterType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterType) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterType ClusterType { get; set; } - /// The current runtime version of the cluster. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The current runtime version of the cluster.", - SerializedName = @"clusterVersion", - PossibleTypes = new [] { typeof(string) })] - string ClusterVersion { get; set; } - /// - /// The URL of the storage account container that is to be used by the specified identities. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The URL of the storage account container that is to be used by the specified identities.", - SerializedName = @"containerUrl", - PossibleTypes = new [] { typeof(string) })] - string CommandOutputSettingContainerUrl { get; set; } - /// The type of managed identity that is being selected. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The type of managed identity that is being selected.", - SerializedName = @"identityType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType? CommandOutputSettingsAssociatedIdentityType { get; set; } - /// - /// The user assigned managed identity resource ID to use. Mutually exclusive with a system assigned identity type. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The user assigned managed identity resource ID to use. Mutually exclusive with a system assigned identity type.", - SerializedName = @"userAssignedIdentityResourceId", - PossibleTypes = new [] { typeof(string) })] - string CommandOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId { get; set; } - /// Selection of how the type evaluation is applied to the cluster calculation. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Selection of how the type evaluation is applied to the cluster calculation.", - SerializedName = @"grouping", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdGrouping) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdGrouping? ComputeDeploymentThresholdGrouping { get; set; } - /// Selection of how the threshold should be evaluated. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Selection of how the threshold should be evaluated.", - SerializedName = @"type", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdType) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdType? ComputeDeploymentThresholdType { get; set; } - /// The numeric threshold value. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The numeric threshold value.", - SerializedName = @"value", - PossibleTypes = new [] { typeof(long) })] - long? ComputeDeploymentThresholdValue { get; set; } - /// - /// The list of rack definitions for the compute racks in a multi-rack - /// cluster, or an empty list in a single-rack cluster. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The list of rack definitions for the compute racks in a multi-rack - cluster, or an empty list in a single-rack cluster.", - SerializedName = @"computeRackDefinitions", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackDefinition) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackDefinition[] ComputeRackDefinition { get; set; } - /// The current detailed status of the cluster. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The current detailed status of the cluster.", - SerializedName = @"detailedStatus", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterDetailedStatus) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterDetailedStatus? DetailedStatus { get; } - /// The descriptive message about the detailed status. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The descriptive message about the detailed status.", - SerializedName = @"detailedStatusMessage", - PossibleTypes = new [] { typeof(string) })] - string DetailedStatusMessage { get; } - /// The resource ID of the extended location on which the resource will be created. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The resource ID of the extended location on which the resource will be created.", - SerializedName = @"name", - PossibleTypes = new [] { typeof(string) })] - string HybridAkExtendedLocationName { get; set; } - /// The extended location type, for example, CustomLocation. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The extended location type, for example, CustomLocation.", - SerializedName = @"type", - PossibleTypes = new [] { typeof(string) })] - string HybridAkExtendedLocationType { get; set; } - /// - /// The location of the managed resource group. If not specified, the location of the parent resource is chosen. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The location of the managed resource group. If not specified, the location of the parent resource is chosen.", - SerializedName = @"location", - PossibleTypes = new [] { typeof(string) })] - string ManagedResourceGroupConfigurationLocation { get; set; } - /// - /// The name for the managed resource group. If not specified, the unique name is automatically generated. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The name for the managed resource group. If not specified, the unique name is automatically generated.", - SerializedName = @"name", - PossibleTypes = new [] { typeof(string) })] - string ManagedResourceGroupConfigurationName { get; set; } - /// The count of Manual Action Taken (MAT) events that have not been validated. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The count of Manual Action Taken (MAT) events that have not been validated.", - SerializedName = @"manualActionCount", - PossibleTypes = new [] { typeof(long) })] - long? ManualActionCount { get; } - /// The resource ID of the Network Fabric associated with the cluster. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The resource ID of the Network Fabric associated with the cluster.", - SerializedName = @"networkFabricId", - PossibleTypes = new [] { typeof(string) })] - string NetworkFabricId { get; set; } - /// The provisioning state of the cluster. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The provisioning state of the cluster.", - SerializedName = @"provisioningState", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterProvisioningState) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterProvisioningState? ProvisioningState { get; } - /// The mode of operation for runtime protection. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The mode of operation for runtime protection.", - SerializedName = @"enforcementLevel", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RuntimeProtectionEnforcementLevel) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RuntimeProtectionEnforcementLevel? RuntimeProtectionConfigurationEnforcementLevel { get; set; } - /// The resource ID of the key vault to archive the secrets of the cluster. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The resource ID of the key vault to archive the secrets of the cluster.", - SerializedName = @"keyVaultId", - PossibleTypes = new [] { typeof(string) })] - string SecretArchiveKeyVaultId { get; set; } - /// The URI for the key vault used as the secret archive. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The URI for the key vault used as the secret archive.", - SerializedName = @"vaultUri", - PossibleTypes = new [] { typeof(string) })] - string SecretArchiveSettingVaultUri { get; set; } - /// The type of managed identity that is being selected. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The type of managed identity that is being selected.", - SerializedName = @"identityType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType? SecretArchiveSettingsAssociatedIdentityType { get; set; } - /// - /// The user assigned managed identity resource ID to use. Mutually exclusive with a system assigned identity type. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The user assigned managed identity resource ID to use. Mutually exclusive with a system assigned identity type.", - SerializedName = @"userAssignedIdentityResourceId", - PossibleTypes = new [] { typeof(string) })] - string SecretArchiveSettingsAssociatedIdentityUserAssignedIdentityResourceId { get; set; } - /// - /// The indicator if the specified key vault should be used to archive the secrets of the cluster. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The indicator if the specified key vault should be used to archive the secrets of the cluster.", - SerializedName = @"useKeyVault", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterSecretArchiveEnabled) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterSecretArchiveEnabled? SecretArchiveUseKeyVault { get; set; } - /// The support end date of the runtime version of the cluster. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The support end date of the runtime version of the cluster.", - SerializedName = @"supportExpiryDate", - PossibleTypes = new [] { typeof(string) })] - string SupportExpiryDate { get; } - /// - /// The maximum number of worker nodes that can be offline within the increment of update, e.g., rack-by-rack. - /// Limited by the maximum number of machines in the increment. Defaults to the whole increment size. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The maximum number of worker nodes that can be offline within the increment of update, e.g., rack-by-rack. - Limited by the maximum number of machines in the increment. Defaults to the whole increment size.", - SerializedName = @"maxUnavailable", - PossibleTypes = new [] { typeof(long) })] - long? UpdateStrategyMaxUnavailable { get; set; } - /// Selection of how the threshold should be evaluated. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Selection of how the threshold should be evaluated.", - SerializedName = @"thresholdType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdType) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdType? UpdateStrategyThresholdType { get; set; } - /// The numeric threshold value. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The numeric threshold value.", - SerializedName = @"thresholdValue", - PossibleTypes = new [] { typeof(long) })] - long? UpdateStrategyThresholdValue { get; set; } - /// The mode of operation for runtime protection. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The mode of operation for runtime protection.", - SerializedName = @"strategyType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterUpdateStrategyType) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterUpdateStrategyType? UpdateStrategyType { get; set; } - /// The time to wait between the increments of update defined by the strategy. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The time to wait between the increments of update defined by the strategy.", - SerializedName = @"waitTimeMinutes", - PossibleTypes = new [] { typeof(long) })] - long? UpdateStrategyWaitTimeMinute { get; set; } - /// The mode selection for container vulnerability scanning. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The mode selection for container vulnerability scanning.", - SerializedName = @"containerScan", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VulnerabilityScanningSettingsContainerScan) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VulnerabilityScanningSettingsContainerScan? VulnerabilityScanningSettingContainerScan { get; set; } - /// The list of workload resource IDs that are hosted within this cluster. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The list of workload resource IDs that are hosted within this cluster.", - SerializedName = @"workloadResourceIds", - PossibleTypes = new [] { typeof(string) })] - string[] WorkloadResourceId { get; } - - } - /// ClusterProperties represents the properties of a cluster. - internal partial interface IClusterPropertiesInternal - - { - /// - /// The rack definition that is intended to reflect only a single rack in a single rack cluster, or an aggregator rack in - /// a multi-rack cluster. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackDefinition AggregatorOrSingleRackDefinition { get; set; } - /// - /// The zone name used for this rack when created. Availability zones are used for workload placement. - /// - string AggregatorOrSingleRackDefinitionAvailabilityZone { get; set; } - /// The unordered list of bare metal machine configuration. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineConfigurationData[] AggregatorOrSingleRackDefinitionBareMetalMachineConfigurationData { get; set; } - /// The resource ID of the network rack that matches this rack definition. - string AggregatorOrSingleRackDefinitionNetworkRackId { get; set; } - /// The free-form description of the rack's location. - string AggregatorOrSingleRackDefinitionRackLocation { get; set; } - /// - /// The unique identifier for the rack within Network Cloud cluster. An alternate unique alphanumeric value other than a serial - /// number may be provided if desired. - /// - string AggregatorOrSingleRackDefinitionRackSerialNumber { get; set; } - /// The resource ID of the sku for the rack being added. - string AggregatorOrSingleRackDefinitionRackSkuId { get; set; } - /// The list of storage appliance configuration data for this rack. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceConfigurationData[] AggregatorOrSingleRackDefinitionStorageApplianceConfigurationData { get; set; } - /// - /// The resource ID of the analytics workspace that is to be used by the specified identity. - /// - string AnalyticOutputSettingAnalyticsWorkspaceId { get; set; } - /// - /// The selection of the managed identity to use with this analytics workspace. The identity type must be either system assigned - /// or user assigned. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIdentitySelector AnalyticOutputSettingAssociatedIdentity { get; set; } - /// - /// The settings for the log analytics workspace used for output of logs from this cluster. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAnalyticsOutputSettings AnalyticsOutputSetting { get; set; } - /// The type of managed identity that is being selected. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType? AnalyticsOutputSettingsAssociatedIdentityType { get; set; } - /// - /// The user assigned managed identity resource ID to use. Mutually exclusive with a system assigned identity type. - /// - string AnalyticsOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId { get; set; } - /// - /// Field Deprecated. The resource ID of the Log Analytics Workspace that will be used for storing relevant logs. - /// - string AnalyticsWorkspaceId { get; set; } - /// The list of cluster runtime version upgrades available for this cluster. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterAvailableUpgradeVersion[] AvailableUpgradeVersion { get; set; } - /// The capacity supported by this cluster. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterCapacity ClusterCapacity { get; set; } - /// - /// The remaining appliance-based storage in GB available for workload use. Measured in gibibytes. - /// - long? ClusterCapacityAvailableApplianceStorageGb { get; set; } - /// - /// The remaining number of cores that are available in this cluster for workload use. - /// - long? ClusterCapacityAvailableCoreCount { get; set; } - /// - /// The remaining machine or host-based storage in GB available for workload use. Measured in gibibytes. - /// - long? ClusterCapacityAvailableHostStorageGb { get; set; } - /// - /// The remaining memory in GB that are available in this cluster for workload use. Measured in gibibytes. - /// - long? ClusterCapacityAvailableMemoryGb { get; set; } - /// - /// The total appliance-based storage in GB supported by this cluster for workload use. Measured in gibibytes. - /// - long? ClusterCapacityTotalApplianceStorageGb { get; set; } - /// The total number of cores that are supported by this cluster for workload use. - long? ClusterCapacityTotalCoreCount { get; set; } - /// - /// The total machine or host-based storage in GB supported by this cluster for workload use. Measured in gibibytes. - /// - long? ClusterCapacityTotalHostStorageGb { get; set; } - /// - /// The total memory supported by this cluster for workload use. Measured in gibibytes. - /// - long? ClusterCapacityTotalMemoryGb { get; set; } - /// The latest heartbeat status between the cluster manager and the cluster. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterConnectionStatus? ClusterConnectionStatus { get; set; } - /// - /// The extended location (custom location) that represents the cluster's control plane location. This extended location is - /// used to route the requests of child objects of the cluster that are handled by the platform operator. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocation ClusterExtendedLocation { get; set; } - /// The resource ID of the extended location on which the resource will be created. - string ClusterExtendedLocationName { get; set; } - /// The extended location type, for example, CustomLocation. - string ClusterExtendedLocationType { get; set; } - /// - /// The customer-provided location information to identify where the cluster resides. - /// - string ClusterLocation { get; set; } - /// The latest connectivity status between cluster manager and the cluster. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterManagerConnectionStatus? ClusterManagerConnectionStatus { get; set; } - /// - /// The resource ID of the cluster manager that manages this cluster. This is set by the Cluster Manager when the cluster - /// is created. - /// - string ClusterManagerId { get; set; } - /// - /// The service principal to be used by the cluster during Arc Appliance installation. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IServicePrincipalInformation ClusterServicePrincipal { get; set; } - /// The application ID, also known as client ID, of the service principal. - string ClusterServicePrincipalApplicationId { get; set; } - /// The principal ID, also known as the object ID, of the service principal. - string ClusterServicePrincipalId { get; set; } - /// The password of the service principal. - System.Security.SecureString ClusterServicePrincipalPassword { get; set; } - /// - /// The tenant ID, also known as the directory ID, of the tenant in which the service principal is created. - /// - string ClusterServicePrincipalTenantId { get; set; } - /// The type of rack configuration for the cluster. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterType ClusterType { get; set; } - /// The current runtime version of the cluster. - string ClusterVersion { get; set; } - /// - /// The settings for commands run in this cluster, such as bare metal machine run read only commands and data extracts. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICommandOutputSettings CommandOutputSetting { get; set; } - /// - /// The selection of the managed identity to use with this storage account container. The identity type must be either system - /// assigned or user assigned. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIdentitySelector CommandOutputSettingAssociatedIdentity { get; set; } - /// - /// The URL of the storage account container that is to be used by the specified identities. - /// - string CommandOutputSettingContainerUrl { get; set; } - /// The type of managed identity that is being selected. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType? CommandOutputSettingsAssociatedIdentityType { get; set; } - /// - /// The user assigned managed identity resource ID to use. Mutually exclusive with a system assigned identity type. - /// - string CommandOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId { get; set; } - /// - /// The validation threshold indicating the allowable failures of compute machines during environment validation and deployment. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IValidationThreshold ComputeDeploymentThreshold { get; set; } - /// Selection of how the type evaluation is applied to the cluster calculation. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdGrouping? ComputeDeploymentThresholdGrouping { get; set; } - /// Selection of how the threshold should be evaluated. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdType? ComputeDeploymentThresholdType { get; set; } - /// The numeric threshold value. - long? ComputeDeploymentThresholdValue { get; set; } - /// - /// The list of rack definitions for the compute racks in a multi-rack - /// cluster, or an empty list in a single-rack cluster. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackDefinition[] ComputeRackDefinition { get; set; } - /// The current detailed status of the cluster. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterDetailedStatus? DetailedStatus { get; set; } - /// The descriptive message about the detailed status. - string DetailedStatusMessage { get; set; } - /// The resource ID of the extended location on which the resource will be created. - string HybridAkExtendedLocationName { get; set; } - /// The extended location type, for example, CustomLocation. - string HybridAkExtendedLocationType { get; set; } - /// - /// Field Deprecated. This field will not be populated in an upcoming version. The extended location (custom location) that - /// represents the Hybrid AKS control plane location. This extended location is used when creating provisioned clusters (Hybrid - /// AKS clusters). - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocation HybridAksExtendedLocation { get; set; } - /// The configuration of the managed resource group associated with the resource. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IManagedResourceGroupConfiguration ManagedResourceGroupConfiguration { get; set; } - /// - /// The location of the managed resource group. If not specified, the location of the parent resource is chosen. - /// - string ManagedResourceGroupConfigurationLocation { get; set; } - /// - /// The name for the managed resource group. If not specified, the unique name is automatically generated. - /// - string ManagedResourceGroupConfigurationName { get; set; } - /// The count of Manual Action Taken (MAT) events that have not been validated. - long? ManualActionCount { get; set; } - /// The resource ID of the Network Fabric associated with the cluster. - string NetworkFabricId { get; set; } - /// The provisioning state of the cluster. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterProvisioningState? ProvisioningState { get; set; } - /// The settings for cluster runtime protection. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRuntimeProtectionConfiguration RuntimeProtectionConfiguration { get; set; } - /// The mode of operation for runtime protection. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RuntimeProtectionEnforcementLevel? RuntimeProtectionConfigurationEnforcementLevel { get; set; } - /// - /// The configuration for use of a key vault to store secrets for later retrieval by the operator. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterSecretArchive SecretArchive { get; set; } - /// The resource ID of the key vault to archive the secrets of the cluster. - string SecretArchiveKeyVaultId { get; set; } - /// The settings for the secret archive used to hold credentials for the cluster. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretArchiveSettings SecretArchiveSetting { get; set; } - /// - /// The selection of the managed identity to use with this vault URI. The identity type must be either system assigned or - /// user assigned. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIdentitySelector SecretArchiveSettingAssociatedIdentity { get; set; } - /// The URI for the key vault used as the secret archive. - string SecretArchiveSettingVaultUri { get; set; } - /// The type of managed identity that is being selected. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType? SecretArchiveSettingsAssociatedIdentityType { get; set; } - /// - /// The user assigned managed identity resource ID to use. Mutually exclusive with a system assigned identity type. - /// - string SecretArchiveSettingsAssociatedIdentityUserAssignedIdentityResourceId { get; set; } - /// - /// The indicator if the specified key vault should be used to archive the secrets of the cluster. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterSecretArchiveEnabled? SecretArchiveUseKeyVault { get; set; } - /// The support end date of the runtime version of the cluster. - string SupportExpiryDate { get; set; } - /// The strategy for updating the cluster. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterUpdateStrategy UpdateStrategy { get; set; } - /// - /// The maximum number of worker nodes that can be offline within the increment of update, e.g., rack-by-rack. - /// Limited by the maximum number of machines in the increment. Defaults to the whole increment size. - /// - long? UpdateStrategyMaxUnavailable { get; set; } - /// Selection of how the threshold should be evaluated. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdType? UpdateStrategyThresholdType { get; set; } - /// The numeric threshold value. - long? UpdateStrategyThresholdValue { get; set; } - /// The mode of operation for runtime protection. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterUpdateStrategyType? UpdateStrategyType { get; set; } - /// The time to wait between the increments of update defined by the strategy. - long? UpdateStrategyWaitTimeMinute { get; set; } - /// The settings for how security vulnerability scanning is applied to the cluster. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVulnerabilityScanningSettings VulnerabilityScanningSetting { get; set; } - /// The mode selection for container vulnerability scanning. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VulnerabilityScanningSettingsContainerScan? VulnerabilityScanningSettingContainerScan { get; set; } - /// The list of workload resource IDs that are hosted within this cluster. - string[] WorkloadResourceId { get; set; } - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterScanRuntimeParameters.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterScanRuntimeParameters.cs deleted file mode 100644 index d991bb91b768..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterScanRuntimeParameters.cs +++ /dev/null @@ -1,53 +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.NetworkCloud.Models.Api20250201 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; - - /// - /// ClusterScanRuntimeParameters defines the parameters for the cluster scan runtime operation. - /// - public partial class ClusterScanRuntimeParameters : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterScanRuntimeParameters, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterScanRuntimeParametersInternal - { - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterScanRuntimeParametersScanActivity? _scanActivity; - - /// The choice of if the scan operation should run the scan. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterScanRuntimeParametersScanActivity? ScanActivity { get => this._scanActivity; set => this._scanActivity = value; } - - /// Creates an new instance. - public ClusterScanRuntimeParameters() - { - - } - } - /// ClusterScanRuntimeParameters defines the parameters for the cluster scan runtime operation. - public partial interface IClusterScanRuntimeParameters : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable - { - /// The choice of if the scan operation should run the scan. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The choice of if the scan operation should run the scan.", - SerializedName = @"scanActivity", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterScanRuntimeParametersScanActivity) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterScanRuntimeParametersScanActivity? ScanActivity { get; set; } - - } - /// ClusterScanRuntimeParameters defines the parameters for the cluster scan runtime operation. - internal partial interface IClusterScanRuntimeParametersInternal - - { - /// The choice of if the scan operation should run the scan. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterScanRuntimeParametersScanActivity? ScanActivity { get; set; } - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterUpdateStrategy.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterUpdateStrategy.PowerShell.cs deleted file mode 100644 index afc669b286bb..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterUpdateStrategy.PowerShell.cs +++ /dev/null @@ -1,196 +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.NetworkCloud.Models.Api20250201 -{ - using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; - - /// ClusterUpdateStrategy represents the strategy for updating the cluster. - [System.ComponentModel.TypeConverter(typeof(ClusterUpdateStrategyTypeConverter))] - public partial class ClusterUpdateStrategy - { - - /// - /// 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 ClusterUpdateStrategy(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("MaxUnavailable")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterUpdateStrategyInternal)this).MaxUnavailable = (long?) content.GetValueForProperty("MaxUnavailable",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterUpdateStrategyInternal)this).MaxUnavailable, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("StrategyType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterUpdateStrategyInternal)this).StrategyType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterUpdateStrategyType) content.GetValueForProperty("StrategyType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterUpdateStrategyInternal)this).StrategyType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterUpdateStrategyType.CreateFrom); - } - if (content.Contains("ThresholdType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterUpdateStrategyInternal)this).ThresholdType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdType) content.GetValueForProperty("ThresholdType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterUpdateStrategyInternal)this).ThresholdType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdType.CreateFrom); - } - if (content.Contains("ThresholdValue")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterUpdateStrategyInternal)this).ThresholdValue = (long) content.GetValueForProperty("ThresholdValue",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterUpdateStrategyInternal)this).ThresholdValue, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("WaitTimeMinute")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterUpdateStrategyInternal)this).WaitTimeMinute = (long?) content.GetValueForProperty("WaitTimeMinute",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterUpdateStrategyInternal)this).WaitTimeMinute, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal ClusterUpdateStrategy(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("MaxUnavailable")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterUpdateStrategyInternal)this).MaxUnavailable = (long?) content.GetValueForProperty("MaxUnavailable",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterUpdateStrategyInternal)this).MaxUnavailable, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("StrategyType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterUpdateStrategyInternal)this).StrategyType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterUpdateStrategyType) content.GetValueForProperty("StrategyType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterUpdateStrategyInternal)this).StrategyType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterUpdateStrategyType.CreateFrom); - } - if (content.Contains("ThresholdType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterUpdateStrategyInternal)this).ThresholdType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdType) content.GetValueForProperty("ThresholdType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterUpdateStrategyInternal)this).ThresholdType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdType.CreateFrom); - } - if (content.Contains("ThresholdValue")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterUpdateStrategyInternal)this).ThresholdValue = (long) content.GetValueForProperty("ThresholdValue",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterUpdateStrategyInternal)this).ThresholdValue, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("WaitTimeMinute")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterUpdateStrategyInternal)this).WaitTimeMinute = (long?) content.GetValueForProperty("WaitTimeMinute",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterUpdateStrategyInternal)this).WaitTimeMinute, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - 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.NetworkCloud.Models.Api20250201.IClusterUpdateStrategy DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new ClusterUpdateStrategy(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.NetworkCloud.Models.Api20250201.IClusterUpdateStrategy DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new ClusterUpdateStrategy(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.NetworkCloud.Models.Api20250201.IClusterUpdateStrategy FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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(); - } - } - /// ClusterUpdateStrategy represents the strategy for updating the cluster. - [System.ComponentModel.TypeConverter(typeof(ClusterUpdateStrategyTypeConverter))] - public partial interface IClusterUpdateStrategy - - { - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/CommandOutputSettings.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/CommandOutputSettings.PowerShell.cs deleted file mode 100644 index 89e16d4f667d..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/CommandOutputSettings.PowerShell.cs +++ /dev/null @@ -1,192 +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.NetworkCloud.Models.Api20250201 -{ - using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; - - /// - /// CommandOutputSettings represents the settings for commands run within the cluster such as bare metal machine run read-only - /// commands. - /// - [System.ComponentModel.TypeConverter(typeof(CommandOutputSettingsTypeConverter))] - public partial class CommandOutputSettings - { - - /// - /// 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 CommandOutputSettings(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("AssociatedIdentity")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICommandOutputSettingsInternal)this).AssociatedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIdentitySelector) content.GetValueForProperty("AssociatedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICommandOutputSettingsInternal)this).AssociatedIdentity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IdentitySelectorTypeConverter.ConvertFrom); - } - if (content.Contains("ContainerUrl")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICommandOutputSettingsInternal)this).ContainerUrl = (string) content.GetValueForProperty("ContainerUrl",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICommandOutputSettingsInternal)this).ContainerUrl, global::System.Convert.ToString); - } - if (content.Contains("AssociatedIdentityType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICommandOutputSettingsInternal)this).AssociatedIdentityType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType?) content.GetValueForProperty("AssociatedIdentityType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICommandOutputSettingsInternal)this).AssociatedIdentityType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType.CreateFrom); - } - if (content.Contains("AssociatedIdentityUserAssignedIdentityResourceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICommandOutputSettingsInternal)this).AssociatedIdentityUserAssignedIdentityResourceId = (string) content.GetValueForProperty("AssociatedIdentityUserAssignedIdentityResourceId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICommandOutputSettingsInternal)this).AssociatedIdentityUserAssignedIdentityResourceId, 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 CommandOutputSettings(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("AssociatedIdentity")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICommandOutputSettingsInternal)this).AssociatedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIdentitySelector) content.GetValueForProperty("AssociatedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICommandOutputSettingsInternal)this).AssociatedIdentity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IdentitySelectorTypeConverter.ConvertFrom); - } - if (content.Contains("ContainerUrl")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICommandOutputSettingsInternal)this).ContainerUrl = (string) content.GetValueForProperty("ContainerUrl",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICommandOutputSettingsInternal)this).ContainerUrl, global::System.Convert.ToString); - } - if (content.Contains("AssociatedIdentityType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICommandOutputSettingsInternal)this).AssociatedIdentityType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType?) content.GetValueForProperty("AssociatedIdentityType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICommandOutputSettingsInternal)this).AssociatedIdentityType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType.CreateFrom); - } - if (content.Contains("AssociatedIdentityUserAssignedIdentityResourceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICommandOutputSettingsInternal)this).AssociatedIdentityUserAssignedIdentityResourceId = (string) content.GetValueForProperty("AssociatedIdentityUserAssignedIdentityResourceId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICommandOutputSettingsInternal)this).AssociatedIdentityUserAssignedIdentityResourceId, 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.NetworkCloud.Models.Api20250201.ICommandOutputSettings DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new CommandOutputSettings(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.NetworkCloud.Models.Api20250201.ICommandOutputSettings DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new CommandOutputSettings(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.NetworkCloud.Models.Api20250201.ICommandOutputSettings FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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(); - } - } - /// CommandOutputSettings represents the settings for commands run within the cluster such as bare metal machine run read-only - /// commands. - [System.ComponentModel.TypeConverter(typeof(CommandOutputSettingsTypeConverter))] - public partial interface ICommandOutputSettings - - { - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/CommandOutputSettings.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/CommandOutputSettings.cs deleted file mode 100644 index e4e25150becd..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/CommandOutputSettings.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.NetworkCloud.Models.Api20250201 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; - - /// - /// CommandOutputSettings represents the settings for commands run within the cluster such as bare metal machine run read-only - /// commands. - /// - public partial class CommandOutputSettings : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICommandOutputSettings, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICommandOutputSettingsInternal - { - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIdentitySelector _associatedIdentity; - - /// - /// The selection of the managed identity to use with this storage account container. The identity type must be either system - /// assigned or user assigned. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIdentitySelector AssociatedIdentity { get => (this._associatedIdentity = this._associatedIdentity ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IdentitySelector()); set => this._associatedIdentity = value; } - - /// The type of managed identity that is being selected. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType? AssociatedIdentityType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIdentitySelectorInternal)AssociatedIdentity).IdentityType; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIdentitySelectorInternal)AssociatedIdentity).IdentityType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType)""); } - - /// - /// The user assigned managed identity resource ID to use. Mutually exclusive with a system assigned identity type. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string AssociatedIdentityUserAssignedIdentityResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIdentitySelectorInternal)AssociatedIdentity).UserAssignedIdentityResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIdentitySelectorInternal)AssociatedIdentity).UserAssignedIdentityResourceId = value ?? null; } - - /// Backing field for property. - private string _containerUrl; - - /// - /// The URL of the storage account container that is to be used by the specified identities. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string ContainerUrl { get => this._containerUrl; set => this._containerUrl = value; } - - /// Internal Acessors for AssociatedIdentity - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIdentitySelector Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICommandOutputSettingsInternal.AssociatedIdentity { get => (this._associatedIdentity = this._associatedIdentity ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IdentitySelector()); set { {_associatedIdentity = value;} } } - - /// Creates an new instance. - public CommandOutputSettings() - { - - } - } - /// CommandOutputSettings represents the settings for commands run within the cluster such as bare metal machine run read-only - /// commands. - public partial interface ICommandOutputSettings : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable - { - /// The type of managed identity that is being selected. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The type of managed identity that is being selected.", - SerializedName = @"identityType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType? AssociatedIdentityType { get; set; } - /// - /// The user assigned managed identity resource ID to use. Mutually exclusive with a system assigned identity type. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The user assigned managed identity resource ID to use. Mutually exclusive with a system assigned identity type.", - SerializedName = @"userAssignedIdentityResourceId", - PossibleTypes = new [] { typeof(string) })] - string AssociatedIdentityUserAssignedIdentityResourceId { get; set; } - /// - /// The URL of the storage account container that is to be used by the specified identities. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The URL of the storage account container that is to be used by the specified identities.", - SerializedName = @"containerUrl", - PossibleTypes = new [] { typeof(string) })] - string ContainerUrl { get; set; } - - } - /// CommandOutputSettings represents the settings for commands run within the cluster such as bare metal machine run read-only - /// commands. - internal partial interface ICommandOutputSettingsInternal - - { - /// - /// The selection of the managed identity to use with this storage account container. The identity type must be either system - /// assigned or user assigned. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIdentitySelector AssociatedIdentity { get; set; } - /// The type of managed identity that is being selected. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType? AssociatedIdentityType { get; set; } - /// - /// The user assigned managed identity resource ID to use. Mutually exclusive with a system assigned identity type. - /// - string AssociatedIdentityUserAssignedIdentityResourceId { get; set; } - /// - /// The URL of the storage account container that is to be used by the specified identities. - /// - string ContainerUrl { get; set; } - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/Console.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/Console.PowerShell.cs deleted file mode 100644 index 10d1d7b51599..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/Console.PowerShell.cs +++ /dev/null @@ -1,364 +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.NetworkCloud.Models.Api20250201 -{ - using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; - - /// Console represents the console of an on-premises Network Cloud virtual machine. - [System.ComponentModel.TypeConverter(typeof(ConsoleTypeConverter))] - public partial class Console - { - - /// - /// 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 Console(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("ExtendedLocation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsoleInternal)this).ExtendedLocation = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocation) content.GetValueForProperty("ExtendedLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsoleInternal)this).ExtendedLocation, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ExtendedLocationTypeConverter.ConvertFrom); - } - if (content.Contains("Property")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsoleInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsoleProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsoleInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ConsolePropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Etag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsoleInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsoleInternal)this).Etag, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)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("SystemDataCreatedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataLastModifiedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("SystemData")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.SystemDataTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Type, global::System.Convert.ToString); - } - if (content.Contains("Tag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.TrackedResourceTagsTypeConverter.ConvertFrom); - } - if (content.Contains("Location")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); - } - if (content.Contains("ExtendedLocationName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsoleInternal)this).ExtendedLocationName = (string) content.GetValueForProperty("ExtendedLocationName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsoleInternal)this).ExtendedLocationName, global::System.Convert.ToString); - } - if (content.Contains("ExtendedLocationType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsoleInternal)this).ExtendedLocationType = (string) content.GetValueForProperty("ExtendedLocationType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsoleInternal)this).ExtendedLocationType, global::System.Convert.ToString); - } - if (content.Contains("SshPublicKey")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsoleInternal)this).SshPublicKey = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey) content.GetValueForProperty("SshPublicKey",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsoleInternal)this).SshPublicKey, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.SshPublicKeyTypeConverter.ConvertFrom); - } - if (content.Contains("DetailedStatus")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsoleInternal)this).DetailedStatus = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ConsoleDetailedStatus?) content.GetValueForProperty("DetailedStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsoleInternal)this).DetailedStatus, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ConsoleDetailedStatus.CreateFrom); - } - if (content.Contains("DetailedStatusMessage")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsoleInternal)this).DetailedStatusMessage = (string) content.GetValueForProperty("DetailedStatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsoleInternal)this).DetailedStatusMessage, global::System.Convert.ToString); - } - if (content.Contains("Enabled")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsoleInternal)this).Enabled = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ConsoleEnabled) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsoleInternal)this).Enabled, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ConsoleEnabled.CreateFrom); - } - if (content.Contains("Expiration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsoleInternal)this).Expiration = (global::System.DateTime?) content.GetValueForProperty("Expiration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsoleInternal)this).Expiration, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("PrivateLinkServiceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsoleInternal)this).PrivateLinkServiceId = (string) content.GetValueForProperty("PrivateLinkServiceId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsoleInternal)this).PrivateLinkServiceId, global::System.Convert.ToString); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsoleInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ConsoleProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsoleInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ConsoleProvisioningState.CreateFrom); - } - if (content.Contains("VirtualMachineAccessId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsoleInternal)this).VirtualMachineAccessId = (string) content.GetValueForProperty("VirtualMachineAccessId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsoleInternal)this).VirtualMachineAccessId, global::System.Convert.ToString); - } - if (content.Contains("SshPublicKeyData")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsoleInternal)this).SshPublicKeyData = (string) content.GetValueForProperty("SshPublicKeyData",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsoleInternal)this).SshPublicKeyData, 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 Console(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("ExtendedLocation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsoleInternal)this).ExtendedLocation = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocation) content.GetValueForProperty("ExtendedLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsoleInternal)this).ExtendedLocation, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ExtendedLocationTypeConverter.ConvertFrom); - } - if (content.Contains("Property")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsoleInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsoleProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsoleInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ConsolePropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Etag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsoleInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsoleInternal)this).Etag, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)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("SystemDataCreatedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataLastModifiedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("SystemData")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.SystemDataTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Type, global::System.Convert.ToString); - } - if (content.Contains("Tag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.TrackedResourceTagsTypeConverter.ConvertFrom); - } - if (content.Contains("Location")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); - } - if (content.Contains("ExtendedLocationName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsoleInternal)this).ExtendedLocationName = (string) content.GetValueForProperty("ExtendedLocationName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsoleInternal)this).ExtendedLocationName, global::System.Convert.ToString); - } - if (content.Contains("ExtendedLocationType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsoleInternal)this).ExtendedLocationType = (string) content.GetValueForProperty("ExtendedLocationType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsoleInternal)this).ExtendedLocationType, global::System.Convert.ToString); - } - if (content.Contains("SshPublicKey")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsoleInternal)this).SshPublicKey = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey) content.GetValueForProperty("SshPublicKey",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsoleInternal)this).SshPublicKey, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.SshPublicKeyTypeConverter.ConvertFrom); - } - if (content.Contains("DetailedStatus")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsoleInternal)this).DetailedStatus = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ConsoleDetailedStatus?) content.GetValueForProperty("DetailedStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsoleInternal)this).DetailedStatus, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ConsoleDetailedStatus.CreateFrom); - } - if (content.Contains("DetailedStatusMessage")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsoleInternal)this).DetailedStatusMessage = (string) content.GetValueForProperty("DetailedStatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsoleInternal)this).DetailedStatusMessage, global::System.Convert.ToString); - } - if (content.Contains("Enabled")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsoleInternal)this).Enabled = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ConsoleEnabled) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsoleInternal)this).Enabled, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ConsoleEnabled.CreateFrom); - } - if (content.Contains("Expiration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsoleInternal)this).Expiration = (global::System.DateTime?) content.GetValueForProperty("Expiration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsoleInternal)this).Expiration, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("PrivateLinkServiceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsoleInternal)this).PrivateLinkServiceId = (string) content.GetValueForProperty("PrivateLinkServiceId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsoleInternal)this).PrivateLinkServiceId, global::System.Convert.ToString); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsoleInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ConsoleProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsoleInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ConsoleProvisioningState.CreateFrom); - } - if (content.Contains("VirtualMachineAccessId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsoleInternal)this).VirtualMachineAccessId = (string) content.GetValueForProperty("VirtualMachineAccessId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsoleInternal)this).VirtualMachineAccessId, global::System.Convert.ToString); - } - if (content.Contains("SshPublicKeyData")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsoleInternal)this).SshPublicKeyData = (string) content.GetValueForProperty("SshPublicKeyData",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsoleInternal)this).SshPublicKeyData, 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.NetworkCloud.Models.Api20250201.IConsole DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new Console(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.NetworkCloud.Models.Api20250201.IConsole DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new Console(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.NetworkCloud.Models.Api20250201.IConsole FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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(); - } - } - /// Console represents the console of an on-premises Network Cloud virtual machine. - [System.ComponentModel.TypeConverter(typeof(ConsoleTypeConverter))] - public partial interface IConsole - - { - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/Console.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/Console.cs deleted file mode 100644 index b7aa682db7e7..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/Console.cs +++ /dev/null @@ -1,346 +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.NetworkCloud.Models.Api20250201 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; - - /// Console represents the console of an on-premises Network Cloud virtual machine. - public partial class Console : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsole, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsoleInternal, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IValidates - { - /// - /// Backing field for Inherited model - /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResource __trackedResource = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.TrackedResource(); - - /// The more detailed status of the console. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ConsoleDetailedStatus? DetailedStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsolePropertiesInternal)Property).DetailedStatus; } - - /// The descriptive message about the current detailed status. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string DetailedStatusMessage { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsolePropertiesInternal)Property).DetailedStatusMessage; } - - /// The indicator of whether the console access is enabled. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ConsoleEnabled Enabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsolePropertiesInternal)Property).Enabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsolePropertiesInternal)Property).Enabled = value ; } - - /// Backing field for property. - private string _etag; - - /// Resource ETag. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string Etag { get => this._etag; } - - /// The date and time after which the key will be disallowed access. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public global::System.DateTime? Expiration { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsolePropertiesInternal)Property).Expiration; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsolePropertiesInternal)Property).Expiration = value ?? default(global::System.DateTime); } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocation _extendedLocation; - - /// - /// The extended location of the cluster manager associated with the cluster this virtual machine is created on. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocation ExtendedLocation { get => (this._extendedLocation = this._extendedLocation ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ExtendedLocation()); set => this._extendedLocation = value; } - - /// The resource ID of the extended location on which the resource will be created. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string ExtendedLocationName { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocationInternal)ExtendedLocation).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocationInternal)ExtendedLocation).Name = value ; } - - /// The extended location type, for example, CustomLocation. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string ExtendedLocationType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocationInternal)ExtendedLocation).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocationInternal)ExtendedLocation).Type = value ; } - - /// - /// Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).Id; } - - /// The geo-location where the resource lives - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)__trackedResource).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)__trackedResource).Location = value ; } - - /// Internal Acessors for DetailedStatus - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ConsoleDetailedStatus? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsoleInternal.DetailedStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsolePropertiesInternal)Property).DetailedStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsolePropertiesInternal)Property).DetailedStatus = value; } - - /// Internal Acessors for DetailedStatusMessage - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsoleInternal.DetailedStatusMessage { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsolePropertiesInternal)Property).DetailedStatusMessage; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsolePropertiesInternal)Property).DetailedStatusMessage = value; } - - /// Internal Acessors for Etag - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsoleInternal.Etag { get => this._etag; set { {_etag = value;} } } - - /// Internal Acessors for ExtendedLocation - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocation Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsoleInternal.ExtendedLocation { get => (this._extendedLocation = this._extendedLocation ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ExtendedLocation()); set { {_extendedLocation = value;} } } - - /// Internal Acessors for PrivateLinkServiceId - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsoleInternal.PrivateLinkServiceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsolePropertiesInternal)Property).PrivateLinkServiceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsolePropertiesInternal)Property).PrivateLinkServiceId = value; } - - /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsoleProperties Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsoleInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ConsoleProperties()); set { {_property = value;} } } - - /// Internal Acessors for ProvisioningState - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ConsoleProvisioningState? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsoleInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsolePropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsolePropertiesInternal)Property).ProvisioningState = value; } - - /// Internal Acessors for SshPublicKey - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsoleInternal.SshPublicKey { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsolePropertiesInternal)Property).SshPublicKey; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsolePropertiesInternal)Property).SshPublicKey = value; } - - /// Internal Acessors for VirtualMachineAccessId - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsoleInternal.VirtualMachineAccessId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsolePropertiesInternal)Property).VirtualMachineAccessId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsolePropertiesInternal)Property).VirtualMachineAccessId = value; } - - /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).Id = value; } - - /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).Name = value; } - - /// Internal Acessors for SystemData - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ISystemData Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal.SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemData; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemData = value; } - - /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).Type = value; } - - /// The name of the resource - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).Name; } - - /// - /// The resource ID of the private link service that is used to provide virtual machine console access. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string PrivateLinkServiceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsolePropertiesInternal)Property).PrivateLinkServiceId; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsoleProperties _property; - - /// The list of the resource properties. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsoleProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ConsoleProperties()); set => this._property = value; } - - /// The provisioning state of the virtual machine console. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ConsoleProvisioningState? ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsolePropertiesInternal)Property).ProvisioningState; } - - /// Gets the resource group name - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string ResourceGroupName { get => (new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Success ? new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Groups["resourceGroupName"].Value : null); } - - /// The SSH public key data. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string SshPublicKeyData { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsolePropertiesInternal)Property).SshPublicKeyData; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsolePropertiesInternal)Property).SshPublicKeyData = value ; } - - /// - /// Azure Resource Manager metadata containing createdBy and modifiedBy information. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ISystemData SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemData; } - - /// The timestamp of resource creation (UTC). - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataCreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataCreatedAt = value ?? default(global::System.DateTime); } - - /// The identity that created the resource. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataCreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataCreatedBy = value ?? null; } - - /// The type of identity that created the resource. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType? SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataCreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataCreatedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType)""); } - - /// The timestamp of resource last modification (UTC) - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataLastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataLastModifiedAt = value ?? default(global::System.DateTime); } - - /// The identity that last modified the resource. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataLastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataLastModifiedBy = value ?? null; } - - /// The type of identity that last modified the resource. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType? SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataLastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataLastModifiedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType)""); } - - /// Resource tags. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)__trackedResource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.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.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).Type; } - - /// - /// The unique identifier for the virtual machine that is used to access the console. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string VirtualMachineAccessId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsolePropertiesInternal)Property).VirtualMachineAccessId; } - - /// Creates an new instance. - public Console() - { - - } - - /// Validates that this object meets the validation criteria. - /// an instance that will receive validation - /// events. - /// - /// A that will be complete when validation is completed. - /// - public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) - { - await eventListener.AssertNotNull(nameof(__trackedResource), __trackedResource); - await eventListener.AssertObjectIsValid(nameof(__trackedResource), __trackedResource); - } - } - /// Console represents the console of an on-premises Network Cloud virtual machine. - public partial interface IConsole : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResource - { - /// The more detailed status of the console. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The more detailed status of the console.", - SerializedName = @"detailedStatus", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ConsoleDetailedStatus) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ConsoleDetailedStatus? DetailedStatus { get; } - /// The descriptive message about the current detailed status. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The descriptive message about the current detailed status.", - SerializedName = @"detailedStatusMessage", - PossibleTypes = new [] { typeof(string) })] - string DetailedStatusMessage { get; } - /// The indicator of whether the console access is enabled. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The indicator of whether the console access is enabled.", - SerializedName = @"enabled", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ConsoleEnabled) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ConsoleEnabled Enabled { get; set; } - /// Resource ETag. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"Resource ETag.", - SerializedName = @"etag", - PossibleTypes = new [] { typeof(string) })] - string Etag { get; } - /// The date and time after which the key will be disallowed access. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The date and time after which the key will be disallowed access.", - SerializedName = @"expiration", - PossibleTypes = new [] { typeof(global::System.DateTime) })] - global::System.DateTime? Expiration { get; set; } - /// The resource ID of the extended location on which the resource will be created. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The resource ID of the extended location on which the resource will be created.", - SerializedName = @"name", - PossibleTypes = new [] { typeof(string) })] - string ExtendedLocationName { get; set; } - /// The extended location type, for example, CustomLocation. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The extended location type, for example, CustomLocation.", - SerializedName = @"type", - PossibleTypes = new [] { typeof(string) })] - string ExtendedLocationType { get; set; } - /// - /// The resource ID of the private link service that is used to provide virtual machine console access. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The resource ID of the private link service that is used to provide virtual machine console access.", - SerializedName = @"privateLinkServiceId", - PossibleTypes = new [] { typeof(string) })] - string PrivateLinkServiceId { get; } - /// The provisioning state of the virtual machine console. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The provisioning state of the virtual machine console.", - SerializedName = @"provisioningState", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ConsoleProvisioningState) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ConsoleProvisioningState? ProvisioningState { get; } - /// The SSH public key data. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The SSH public key data.", - SerializedName = @"keyData", - PossibleTypes = new [] { typeof(string) })] - string SshPublicKeyData { get; set; } - /// - /// The unique identifier for the virtual machine that is used to access the console. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The unique identifier for the virtual machine that is used to access the console.", - SerializedName = @"virtualMachineAccessId", - PossibleTypes = new [] { typeof(string) })] - string VirtualMachineAccessId { get; } - - } - /// Console represents the console of an on-premises Network Cloud virtual machine. - internal partial interface IConsoleInternal : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal - { - /// The more detailed status of the console. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ConsoleDetailedStatus? DetailedStatus { get; set; } - /// The descriptive message about the current detailed status. - string DetailedStatusMessage { get; set; } - /// The indicator of whether the console access is enabled. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ConsoleEnabled Enabled { get; set; } - /// Resource ETag. - string Etag { get; set; } - /// The date and time after which the key will be disallowed access. - global::System.DateTime? Expiration { get; set; } - /// - /// The extended location of the cluster manager associated with the cluster this virtual machine is created on. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocation ExtendedLocation { get; set; } - /// The resource ID of the extended location on which the resource will be created. - string ExtendedLocationName { get; set; } - /// The extended location type, for example, CustomLocation. - string ExtendedLocationType { get; set; } - /// - /// The resource ID of the private link service that is used to provide virtual machine console access. - /// - string PrivateLinkServiceId { get; set; } - /// The list of the resource properties. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsoleProperties Property { get; set; } - /// The provisioning state of the virtual machine console. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ConsoleProvisioningState? ProvisioningState { get; set; } - /// - /// The SSH public key that will be provisioned for user access. The user is expected to have the corresponding SSH private - /// key for logging in. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey SshPublicKey { get; set; } - /// The SSH public key data. - string SshPublicKeyData { get; set; } - /// - /// The unique identifier for the virtual machine that is used to access the console. - /// - string VirtualMachineAccessId { get; set; } - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ConsolePatchParameters.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ConsolePatchParameters.PowerShell.cs deleted file mode 100644 index f13bfc491ec5..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ConsolePatchParameters.PowerShell.cs +++ /dev/null @@ -1,208 +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.NetworkCloud.Models.Api20250201 -{ - using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; - - /// - /// ConsolePatchParameters represents the body of the request to patch the virtual machine console. - /// - [System.ComponentModel.TypeConverter(typeof(ConsolePatchParametersTypeConverter))] - public partial class ConsolePatchParameters - { - - /// - /// 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 ConsolePatchParameters(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.NetworkCloud.Models.Api20250201.IConsolePatchParametersInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsolePatchProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsolePatchParametersInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ConsolePatchPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Tag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsolePatchParametersInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsolePatchParametersTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsolePatchParametersInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ConsolePatchParametersTagsTypeConverter.ConvertFrom); - } - if (content.Contains("SshPublicKey")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsolePatchParametersInternal)this).SshPublicKey = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey) content.GetValueForProperty("SshPublicKey",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsolePatchParametersInternal)this).SshPublicKey, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.SshPublicKeyTypeConverter.ConvertFrom); - } - if (content.Contains("Enabled")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsolePatchParametersInternal)this).Enabled = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ConsoleEnabled?) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsolePatchParametersInternal)this).Enabled, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ConsoleEnabled.CreateFrom); - } - if (content.Contains("Expiration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsolePatchParametersInternal)this).Expiration = (global::System.DateTime?) content.GetValueForProperty("Expiration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsolePatchParametersInternal)this).Expiration, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("SshPublicKeyData")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsolePatchParametersInternal)this).SshPublicKeyData = (string) content.GetValueForProperty("SshPublicKeyData",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsolePatchParametersInternal)this).SshPublicKeyData, 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 ConsolePatchParameters(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.NetworkCloud.Models.Api20250201.IConsolePatchParametersInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsolePatchProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsolePatchParametersInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ConsolePatchPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Tag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsolePatchParametersInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsolePatchParametersTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsolePatchParametersInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ConsolePatchParametersTagsTypeConverter.ConvertFrom); - } - if (content.Contains("SshPublicKey")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsolePatchParametersInternal)this).SshPublicKey = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey) content.GetValueForProperty("SshPublicKey",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsolePatchParametersInternal)this).SshPublicKey, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.SshPublicKeyTypeConverter.ConvertFrom); - } - if (content.Contains("Enabled")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsolePatchParametersInternal)this).Enabled = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ConsoleEnabled?) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsolePatchParametersInternal)this).Enabled, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ConsoleEnabled.CreateFrom); - } - if (content.Contains("Expiration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsolePatchParametersInternal)this).Expiration = (global::System.DateTime?) content.GetValueForProperty("Expiration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsolePatchParametersInternal)this).Expiration, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("SshPublicKeyData")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsolePatchParametersInternal)this).SshPublicKeyData = (string) content.GetValueForProperty("SshPublicKeyData",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsolePatchParametersInternal)this).SshPublicKeyData, 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.NetworkCloud.Models.Api20250201.IConsolePatchParameters DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new ConsolePatchParameters(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.NetworkCloud.Models.Api20250201.IConsolePatchParameters DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new ConsolePatchParameters(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.NetworkCloud.Models.Api20250201.IConsolePatchParameters FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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(); - } - } - /// ConsolePatchParameters represents the body of the request to patch the virtual machine console. - [System.ComponentModel.TypeConverter(typeof(ConsolePatchParametersTypeConverter))] - public partial interface IConsolePatchParameters - - { - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ConsolePatchParameters.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ConsolePatchParameters.cs deleted file mode 100644 index 4618e61db0ba..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ConsolePatchParameters.cs +++ /dev/null @@ -1,115 +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.NetworkCloud.Models.Api20250201 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; - - /// - /// ConsolePatchParameters represents the body of the request to patch the virtual machine console. - /// - public partial class ConsolePatchParameters : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsolePatchParameters, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsolePatchParametersInternal - { - - /// The indicator of whether the console access is enabled. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ConsoleEnabled? Enabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsolePatchPropertiesInternal)Property).Enabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsolePatchPropertiesInternal)Property).Enabled = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ConsoleEnabled)""); } - - /// The date and time after which the key will be disallowed access. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public global::System.DateTime? Expiration { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsolePatchPropertiesInternal)Property).Expiration; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsolePatchPropertiesInternal)Property).Expiration = value ?? default(global::System.DateTime); } - - /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsolePatchProperties Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsolePatchParametersInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ConsolePatchProperties()); set { {_property = value;} } } - - /// Internal Acessors for SshPublicKey - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsolePatchParametersInternal.SshPublicKey { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsolePatchPropertiesInternal)Property).SshPublicKey; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsolePatchPropertiesInternal)Property).SshPublicKey = value; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsolePatchProperties _property; - - /// The list of the resource properties. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsolePatchProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ConsolePatchProperties()); set => this._property = value; } - - /// The SSH public key data. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string SshPublicKeyData { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsolePatchPropertiesInternal)Property).SshPublicKeyData; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsolePatchPropertiesInternal)Property).SshPublicKeyData = value ?? null; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsolePatchParametersTags _tag; - - /// The Azure resource tags that will replace the existing ones. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsolePatchParametersTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ConsolePatchParametersTags()); set => this._tag = value; } - - /// Creates an new instance. - public ConsolePatchParameters() - { - - } - } - /// ConsolePatchParameters represents the body of the request to patch the virtual machine console. - public partial interface IConsolePatchParameters : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable - { - /// The indicator of whether the console access is enabled. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The indicator of whether the console access is enabled.", - SerializedName = @"enabled", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ConsoleEnabled) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ConsoleEnabled? Enabled { get; set; } - /// The date and time after which the key will be disallowed access. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The date and time after which the key will be disallowed access.", - SerializedName = @"expiration", - PossibleTypes = new [] { typeof(global::System.DateTime) })] - global::System.DateTime? Expiration { get; set; } - /// The SSH public key data. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The SSH public key data.", - SerializedName = @"keyData", - PossibleTypes = new [] { typeof(string) })] - string SshPublicKeyData { get; set; } - /// The Azure resource tags that will replace the existing ones. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The Azure resource tags that will replace the existing ones.", - SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsolePatchParametersTags) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsolePatchParametersTags Tag { get; set; } - - } - /// ConsolePatchParameters represents the body of the request to patch the virtual machine console. - internal partial interface IConsolePatchParametersInternal - - { - /// The indicator of whether the console access is enabled. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ConsoleEnabled? Enabled { get; set; } - /// The date and time after which the key will be disallowed access. - global::System.DateTime? Expiration { get; set; } - /// The list of the resource properties. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsolePatchProperties Property { get; set; } - /// - /// The SSH public key that will be provisioned for user access. The user is expected to have the corresponding SSH private - /// key for logging in. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey SshPublicKey { get; set; } - /// The SSH public key data. - string SshPublicKeyData { get; set; } - /// The Azure resource tags that will replace the existing ones. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsolePatchParametersTags Tag { get; set; } - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ConsolePatchProperties.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ConsolePatchProperties.PowerShell.cs deleted file mode 100644 index 1773dc15ae65..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ConsolePatchProperties.PowerShell.cs +++ /dev/null @@ -1,192 +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.NetworkCloud.Models.Api20250201 -{ - using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; - - /// - /// ConsolePatchProperties represents the properties of the virtual machine console that can be patched. - /// - [System.ComponentModel.TypeConverter(typeof(ConsolePatchPropertiesTypeConverter))] - public partial class ConsolePatchProperties - { - - /// - /// 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 ConsolePatchProperties(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("SshPublicKey")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsolePatchPropertiesInternal)this).SshPublicKey = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey) content.GetValueForProperty("SshPublicKey",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsolePatchPropertiesInternal)this).SshPublicKey, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.SshPublicKeyTypeConverter.ConvertFrom); - } - if (content.Contains("Enabled")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsolePatchPropertiesInternal)this).Enabled = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ConsoleEnabled?) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsolePatchPropertiesInternal)this).Enabled, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ConsoleEnabled.CreateFrom); - } - if (content.Contains("Expiration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsolePatchPropertiesInternal)this).Expiration = (global::System.DateTime?) content.GetValueForProperty("Expiration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsolePatchPropertiesInternal)this).Expiration, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("SshPublicKeyData")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsolePatchPropertiesInternal)this).SshPublicKeyData = (string) content.GetValueForProperty("SshPublicKeyData",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsolePatchPropertiesInternal)this).SshPublicKeyData, 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 ConsolePatchProperties(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("SshPublicKey")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsolePatchPropertiesInternal)this).SshPublicKey = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey) content.GetValueForProperty("SshPublicKey",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsolePatchPropertiesInternal)this).SshPublicKey, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.SshPublicKeyTypeConverter.ConvertFrom); - } - if (content.Contains("Enabled")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsolePatchPropertiesInternal)this).Enabled = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ConsoleEnabled?) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsolePatchPropertiesInternal)this).Enabled, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ConsoleEnabled.CreateFrom); - } - if (content.Contains("Expiration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsolePatchPropertiesInternal)this).Expiration = (global::System.DateTime?) content.GetValueForProperty("Expiration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsolePatchPropertiesInternal)this).Expiration, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("SshPublicKeyData")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsolePatchPropertiesInternal)this).SshPublicKeyData = (string) content.GetValueForProperty("SshPublicKeyData",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsolePatchPropertiesInternal)this).SshPublicKeyData, 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.NetworkCloud.Models.Api20250201.IConsolePatchProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new ConsolePatchProperties(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.NetworkCloud.Models.Api20250201.IConsolePatchProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new ConsolePatchProperties(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.NetworkCloud.Models.Api20250201.IConsolePatchProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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(); - } - } - /// ConsolePatchProperties represents the properties of the virtual machine console that can be patched. - [System.ComponentModel.TypeConverter(typeof(ConsolePatchPropertiesTypeConverter))] - public partial interface IConsolePatchProperties - - { - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ConsolePatchProperties.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ConsolePatchProperties.cs deleted file mode 100644 index 2b53d4e293c5..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ConsolePatchProperties.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.NetworkCloud.Models.Api20250201 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; - - /// - /// ConsolePatchProperties represents the properties of the virtual machine console that can be patched. - /// - public partial class ConsolePatchProperties : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsolePatchProperties, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsolePatchPropertiesInternal - { - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ConsoleEnabled? _enabled; - - /// The indicator of whether the console access is enabled. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ConsoleEnabled? Enabled { get => this._enabled; set => this._enabled = value; } - - /// Backing field for property. - private global::System.DateTime? _expiration; - - /// The date and time after which the key will be disallowed access. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public global::System.DateTime? Expiration { get => this._expiration; set => this._expiration = value; } - - /// Internal Acessors for SshPublicKey - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsolePatchPropertiesInternal.SshPublicKey { get => (this._sshPublicKey = this._sshPublicKey ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.SshPublicKey()); set { {_sshPublicKey = value;} } } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey _sshPublicKey; - - /// - /// The SSH public key that will be provisioned for user access. The user is expected to have the corresponding SSH private - /// key for logging in. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey SshPublicKey { get => (this._sshPublicKey = this._sshPublicKey ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.SshPublicKey()); set => this._sshPublicKey = value; } - - /// The SSH public key data. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string SshPublicKeyData { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKeyInternal)SshPublicKey).KeyData; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKeyInternal)SshPublicKey).KeyData = value ?? null; } - - /// Creates an new instance. - public ConsolePatchProperties() - { - - } - } - /// ConsolePatchProperties represents the properties of the virtual machine console that can be patched. - public partial interface IConsolePatchProperties : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable - { - /// The indicator of whether the console access is enabled. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The indicator of whether the console access is enabled.", - SerializedName = @"enabled", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ConsoleEnabled) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ConsoleEnabled? Enabled { get; set; } - /// The date and time after which the key will be disallowed access. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The date and time after which the key will be disallowed access.", - SerializedName = @"expiration", - PossibleTypes = new [] { typeof(global::System.DateTime) })] - global::System.DateTime? Expiration { get; set; } - /// The SSH public key data. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The SSH public key data.", - SerializedName = @"keyData", - PossibleTypes = new [] { typeof(string) })] - string SshPublicKeyData { get; set; } - - } - /// ConsolePatchProperties represents the properties of the virtual machine console that can be patched. - internal partial interface IConsolePatchPropertiesInternal - - { - /// The indicator of whether the console access is enabled. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ConsoleEnabled? Enabled { get; set; } - /// The date and time after which the key will be disallowed access. - global::System.DateTime? Expiration { get; set; } - /// - /// The SSH public key that will be provisioned for user access. The user is expected to have the corresponding SSH private - /// key for logging in. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey SshPublicKey { get; set; } - /// The SSH public key data. - string SshPublicKeyData { get; set; } - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ConsoleProperties.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ConsoleProperties.PowerShell.cs deleted file mode 100644 index ce7799f19ff2..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ConsoleProperties.PowerShell.cs +++ /dev/null @@ -1,228 +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.NetworkCloud.Models.Api20250201 -{ - using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; - - /// ConsoleProperties represents the properties of the virtual machine console. - [System.ComponentModel.TypeConverter(typeof(ConsolePropertiesTypeConverter))] - public partial class ConsoleProperties - { - - /// - /// 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 ConsoleProperties(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("SshPublicKey")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsolePropertiesInternal)this).SshPublicKey = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey) content.GetValueForProperty("SshPublicKey",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsolePropertiesInternal)this).SshPublicKey, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.SshPublicKeyTypeConverter.ConvertFrom); - } - if (content.Contains("DetailedStatus")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsolePropertiesInternal)this).DetailedStatus = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ConsoleDetailedStatus?) content.GetValueForProperty("DetailedStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsolePropertiesInternal)this).DetailedStatus, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ConsoleDetailedStatus.CreateFrom); - } - if (content.Contains("DetailedStatusMessage")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsolePropertiesInternal)this).DetailedStatusMessage = (string) content.GetValueForProperty("DetailedStatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsolePropertiesInternal)this).DetailedStatusMessage, global::System.Convert.ToString); - } - if (content.Contains("Enabled")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsolePropertiesInternal)this).Enabled = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ConsoleEnabled) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsolePropertiesInternal)this).Enabled, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ConsoleEnabled.CreateFrom); - } - if (content.Contains("Expiration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsolePropertiesInternal)this).Expiration = (global::System.DateTime?) content.GetValueForProperty("Expiration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsolePropertiesInternal)this).Expiration, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("PrivateLinkServiceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsolePropertiesInternal)this).PrivateLinkServiceId = (string) content.GetValueForProperty("PrivateLinkServiceId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsolePropertiesInternal)this).PrivateLinkServiceId, global::System.Convert.ToString); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsolePropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ConsoleProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsolePropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ConsoleProvisioningState.CreateFrom); - } - if (content.Contains("VirtualMachineAccessId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsolePropertiesInternal)this).VirtualMachineAccessId = (string) content.GetValueForProperty("VirtualMachineAccessId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsolePropertiesInternal)this).VirtualMachineAccessId, global::System.Convert.ToString); - } - if (content.Contains("SshPublicKeyData")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsolePropertiesInternal)this).SshPublicKeyData = (string) content.GetValueForProperty("SshPublicKeyData",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsolePropertiesInternal)this).SshPublicKeyData, 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 ConsoleProperties(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("SshPublicKey")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsolePropertiesInternal)this).SshPublicKey = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey) content.GetValueForProperty("SshPublicKey",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsolePropertiesInternal)this).SshPublicKey, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.SshPublicKeyTypeConverter.ConvertFrom); - } - if (content.Contains("DetailedStatus")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsolePropertiesInternal)this).DetailedStatus = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ConsoleDetailedStatus?) content.GetValueForProperty("DetailedStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsolePropertiesInternal)this).DetailedStatus, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ConsoleDetailedStatus.CreateFrom); - } - if (content.Contains("DetailedStatusMessage")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsolePropertiesInternal)this).DetailedStatusMessage = (string) content.GetValueForProperty("DetailedStatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsolePropertiesInternal)this).DetailedStatusMessage, global::System.Convert.ToString); - } - if (content.Contains("Enabled")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsolePropertiesInternal)this).Enabled = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ConsoleEnabled) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsolePropertiesInternal)this).Enabled, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ConsoleEnabled.CreateFrom); - } - if (content.Contains("Expiration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsolePropertiesInternal)this).Expiration = (global::System.DateTime?) content.GetValueForProperty("Expiration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsolePropertiesInternal)this).Expiration, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("PrivateLinkServiceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsolePropertiesInternal)this).PrivateLinkServiceId = (string) content.GetValueForProperty("PrivateLinkServiceId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsolePropertiesInternal)this).PrivateLinkServiceId, global::System.Convert.ToString); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsolePropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ConsoleProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsolePropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ConsoleProvisioningState.CreateFrom); - } - if (content.Contains("VirtualMachineAccessId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsolePropertiesInternal)this).VirtualMachineAccessId = (string) content.GetValueForProperty("VirtualMachineAccessId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsolePropertiesInternal)this).VirtualMachineAccessId, global::System.Convert.ToString); - } - if (content.Contains("SshPublicKeyData")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsolePropertiesInternal)this).SshPublicKeyData = (string) content.GetValueForProperty("SshPublicKeyData",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsolePropertiesInternal)this).SshPublicKeyData, 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.NetworkCloud.Models.Api20250201.IConsoleProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new ConsoleProperties(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.NetworkCloud.Models.Api20250201.IConsoleProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new ConsoleProperties(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.NetworkCloud.Models.Api20250201.IConsoleProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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(); - } - } - /// ConsoleProperties represents the properties of the virtual machine console. - [System.ComponentModel.TypeConverter(typeof(ConsolePropertiesTypeConverter))] - public partial interface IConsoleProperties - - { - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ConsoleProperties.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ConsoleProperties.cs deleted file mode 100644 index d088ffa4b8c9..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ConsoleProperties.cs +++ /dev/null @@ -1,212 +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.NetworkCloud.Models.Api20250201 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; - - /// ConsoleProperties represents the properties of the virtual machine console. - public partial class ConsoleProperties : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsoleProperties, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsolePropertiesInternal - { - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ConsoleDetailedStatus? _detailedStatus; - - /// The more detailed status of the console. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ConsoleDetailedStatus? DetailedStatus { get => this._detailedStatus; } - - /// Backing field for property. - private string _detailedStatusMessage; - - /// The descriptive message about the current detailed status. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string DetailedStatusMessage { get => this._detailedStatusMessage; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ConsoleEnabled _enabled; - - /// The indicator of whether the console access is enabled. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ConsoleEnabled Enabled { get => this._enabled; set => this._enabled = value; } - - /// Backing field for property. - private global::System.DateTime? _expiration; - - /// The date and time after which the key will be disallowed access. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public global::System.DateTime? Expiration { get => this._expiration; set => this._expiration = value; } - - /// Internal Acessors for DetailedStatus - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ConsoleDetailedStatus? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsolePropertiesInternal.DetailedStatus { get => this._detailedStatus; set { {_detailedStatus = value;} } } - - /// Internal Acessors for DetailedStatusMessage - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsolePropertiesInternal.DetailedStatusMessage { get => this._detailedStatusMessage; set { {_detailedStatusMessage = value;} } } - - /// Internal Acessors for PrivateLinkServiceId - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsolePropertiesInternal.PrivateLinkServiceId { get => this._privateLinkServiceId; set { {_privateLinkServiceId = value;} } } - - /// Internal Acessors for ProvisioningState - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ConsoleProvisioningState? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsolePropertiesInternal.ProvisioningState { get => this._provisioningState; set { {_provisioningState = value;} } } - - /// Internal Acessors for SshPublicKey - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsolePropertiesInternal.SshPublicKey { get => (this._sshPublicKey = this._sshPublicKey ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.SshPublicKey()); set { {_sshPublicKey = value;} } } - - /// Internal Acessors for VirtualMachineAccessId - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsolePropertiesInternal.VirtualMachineAccessId { get => this._virtualMachineAccessId; set { {_virtualMachineAccessId = value;} } } - - /// Backing field for property. - private string _privateLinkServiceId; - - /// - /// The resource ID of the private link service that is used to provide virtual machine console access. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string PrivateLinkServiceId { get => this._privateLinkServiceId; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ConsoleProvisioningState? _provisioningState; - - /// The provisioning state of the virtual machine console. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ConsoleProvisioningState? ProvisioningState { get => this._provisioningState; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey _sshPublicKey; - - /// - /// The SSH public key that will be provisioned for user access. The user is expected to have the corresponding SSH private - /// key for logging in. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey SshPublicKey { get => (this._sshPublicKey = this._sshPublicKey ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.SshPublicKey()); set => this._sshPublicKey = value; } - - /// The SSH public key data. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string SshPublicKeyData { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKeyInternal)SshPublicKey).KeyData; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKeyInternal)SshPublicKey).KeyData = value ; } - - /// Backing field for property. - private string _virtualMachineAccessId; - - /// - /// The unique identifier for the virtual machine that is used to access the console. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string VirtualMachineAccessId { get => this._virtualMachineAccessId; } - - /// Creates an new instance. - public ConsoleProperties() - { - - } - } - /// ConsoleProperties represents the properties of the virtual machine console. - public partial interface IConsoleProperties : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable - { - /// The more detailed status of the console. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The more detailed status of the console.", - SerializedName = @"detailedStatus", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ConsoleDetailedStatus) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ConsoleDetailedStatus? DetailedStatus { get; } - /// The descriptive message about the current detailed status. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The descriptive message about the current detailed status.", - SerializedName = @"detailedStatusMessage", - PossibleTypes = new [] { typeof(string) })] - string DetailedStatusMessage { get; } - /// The indicator of whether the console access is enabled. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The indicator of whether the console access is enabled.", - SerializedName = @"enabled", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ConsoleEnabled) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ConsoleEnabled Enabled { get; set; } - /// The date and time after which the key will be disallowed access. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The date and time after which the key will be disallowed access.", - SerializedName = @"expiration", - PossibleTypes = new [] { typeof(global::System.DateTime) })] - global::System.DateTime? Expiration { get; set; } - /// - /// The resource ID of the private link service that is used to provide virtual machine console access. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The resource ID of the private link service that is used to provide virtual machine console access.", - SerializedName = @"privateLinkServiceId", - PossibleTypes = new [] { typeof(string) })] - string PrivateLinkServiceId { get; } - /// The provisioning state of the virtual machine console. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The provisioning state of the virtual machine console.", - SerializedName = @"provisioningState", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ConsoleProvisioningState) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ConsoleProvisioningState? ProvisioningState { get; } - /// The SSH public key data. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The SSH public key data.", - SerializedName = @"keyData", - PossibleTypes = new [] { typeof(string) })] - string SshPublicKeyData { get; set; } - /// - /// The unique identifier for the virtual machine that is used to access the console. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The unique identifier for the virtual machine that is used to access the console.", - SerializedName = @"virtualMachineAccessId", - PossibleTypes = new [] { typeof(string) })] - string VirtualMachineAccessId { get; } - - } - /// ConsoleProperties represents the properties of the virtual machine console. - internal partial interface IConsolePropertiesInternal - - { - /// The more detailed status of the console. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ConsoleDetailedStatus? DetailedStatus { get; set; } - /// The descriptive message about the current detailed status. - string DetailedStatusMessage { get; set; } - /// The indicator of whether the console access is enabled. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ConsoleEnabled Enabled { get; set; } - /// The date and time after which the key will be disallowed access. - global::System.DateTime? Expiration { get; set; } - /// - /// The resource ID of the private link service that is used to provide virtual machine console access. - /// - string PrivateLinkServiceId { get; set; } - /// The provisioning state of the virtual machine console. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ConsoleProvisioningState? ProvisioningState { get; set; } - /// - /// The SSH public key that will be provisioned for user access. The user is expected to have the corresponding SSH private - /// key for logging in. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey SshPublicKey { get; set; } - /// The SSH public key data. - string SshPublicKeyData { get; set; } - /// - /// The unique identifier for the virtual machine that is used to access the console. - /// - string VirtualMachineAccessId { get; set; } - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ControlPlaneNodeConfiguration.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ControlPlaneNodeConfiguration.PowerShell.cs deleted file mode 100644 index 4960ed0f787f..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ControlPlaneNodeConfiguration.PowerShell.cs +++ /dev/null @@ -1,210 +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.NetworkCloud.Models.Api20250201 -{ - using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; - - /// - /// ControlPlaneNodeConfiguration represents the selection of virtual machines and size of the control plane for a Kubernetes - /// cluster. - /// - [System.ComponentModel.TypeConverter(typeof(ControlPlaneNodeConfigurationTypeConverter))] - public partial class ControlPlaneNodeConfiguration - { - - /// - /// 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 ControlPlaneNodeConfiguration(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("AdministratorConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IControlPlaneNodeConfigurationInternal)this).AdministratorConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministratorConfiguration) content.GetValueForProperty("AdministratorConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IControlPlaneNodeConfigurationInternal)this).AdministratorConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AdministratorConfigurationTypeConverter.ConvertFrom); - } - if (content.Contains("AvailabilityZone")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IControlPlaneNodeConfigurationInternal)this).AvailabilityZone = (string[]) content.GetValueForProperty("AvailabilityZone",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IControlPlaneNodeConfigurationInternal)this).AvailabilityZone, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("Count")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IControlPlaneNodeConfigurationInternal)this).Count = (long) content.GetValueForProperty("Count",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IControlPlaneNodeConfigurationInternal)this).Count, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("VMSkuName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IControlPlaneNodeConfigurationInternal)this).VMSkuName = (string) content.GetValueForProperty("VMSkuName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IControlPlaneNodeConfigurationInternal)this).VMSkuName, global::System.Convert.ToString); - } - if (content.Contains("AdministratorConfigurationAdminUsername")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IControlPlaneNodeConfigurationInternal)this).AdministratorConfigurationAdminUsername = (string) content.GetValueForProperty("AdministratorConfigurationAdminUsername",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IControlPlaneNodeConfigurationInternal)this).AdministratorConfigurationAdminUsername, global::System.Convert.ToString); - } - if (content.Contains("AdministratorConfigurationSshPublicKey")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IControlPlaneNodeConfigurationInternal)this).AdministratorConfigurationSshPublicKey = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey[]) content.GetValueForProperty("AdministratorConfigurationSshPublicKey",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IControlPlaneNodeConfigurationInternal)this).AdministratorConfigurationSshPublicKey, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.SshPublicKeyTypeConverter.ConvertFrom)); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal ControlPlaneNodeConfiguration(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("AdministratorConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IControlPlaneNodeConfigurationInternal)this).AdministratorConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministratorConfiguration) content.GetValueForProperty("AdministratorConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IControlPlaneNodeConfigurationInternal)this).AdministratorConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AdministratorConfigurationTypeConverter.ConvertFrom); - } - if (content.Contains("AvailabilityZone")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IControlPlaneNodeConfigurationInternal)this).AvailabilityZone = (string[]) content.GetValueForProperty("AvailabilityZone",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IControlPlaneNodeConfigurationInternal)this).AvailabilityZone, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("Count")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IControlPlaneNodeConfigurationInternal)this).Count = (long) content.GetValueForProperty("Count",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IControlPlaneNodeConfigurationInternal)this).Count, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("VMSkuName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IControlPlaneNodeConfigurationInternal)this).VMSkuName = (string) content.GetValueForProperty("VMSkuName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IControlPlaneNodeConfigurationInternal)this).VMSkuName, global::System.Convert.ToString); - } - if (content.Contains("AdministratorConfigurationAdminUsername")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IControlPlaneNodeConfigurationInternal)this).AdministratorConfigurationAdminUsername = (string) content.GetValueForProperty("AdministratorConfigurationAdminUsername",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IControlPlaneNodeConfigurationInternal)this).AdministratorConfigurationAdminUsername, global::System.Convert.ToString); - } - if (content.Contains("AdministratorConfigurationSshPublicKey")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IControlPlaneNodeConfigurationInternal)this).AdministratorConfigurationSshPublicKey = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey[]) content.GetValueForProperty("AdministratorConfigurationSshPublicKey",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IControlPlaneNodeConfigurationInternal)this).AdministratorConfigurationSshPublicKey, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.SshPublicKeyTypeConverter.ConvertFrom)); - } - AfterDeserializePSObject(content); - } - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IControlPlaneNodeConfiguration DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new ControlPlaneNodeConfiguration(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.NetworkCloud.Models.Api20250201.IControlPlaneNodeConfiguration DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new ControlPlaneNodeConfiguration(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.NetworkCloud.Models.Api20250201.IControlPlaneNodeConfiguration FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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(); - } - } - /// ControlPlaneNodeConfiguration represents the selection of virtual machines and size of the control plane for a Kubernetes - /// cluster. - [System.ComponentModel.TypeConverter(typeof(ControlPlaneNodeConfigurationTypeConverter))] - public partial interface IControlPlaneNodeConfiguration - - { - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ControlPlaneNodeConfiguration.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ControlPlaneNodeConfiguration.cs deleted file mode 100644 index 64db228d543c..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ControlPlaneNodeConfiguration.cs +++ /dev/null @@ -1,157 +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.NetworkCloud.Models.Api20250201 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; - - /// - /// ControlPlaneNodeConfiguration represents the selection of virtual machines and size of the control plane for a Kubernetes - /// cluster. - /// - public partial class ControlPlaneNodeConfiguration : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IControlPlaneNodeConfiguration, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IControlPlaneNodeConfigurationInternal - { - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministratorConfiguration _administratorConfiguration; - - /// The administrator credentials to be used for the nodes in the control plane. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministratorConfiguration AdministratorConfiguration { get => (this._administratorConfiguration = this._administratorConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AdministratorConfiguration()); set => this._administratorConfiguration = value; } - - /// - /// The user name for the administrator that will be applied to the operating systems that run Kubernetes nodes. If not supplied, - /// a user name will be chosen by the service. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string AdministratorConfigurationAdminUsername { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministratorConfigurationInternal)AdministratorConfiguration).AdminUsername; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministratorConfigurationInternal)AdministratorConfiguration).AdminUsername = value ?? null; } - - /// - /// The SSH configuration for the operating systems that run the nodes in the Kubernetes cluster. In some cases, specification - /// of public keys may be required to produce a working environment. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey[] AdministratorConfigurationSshPublicKey { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministratorConfigurationInternal)AdministratorConfiguration).SshPublicKey; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministratorConfigurationInternal)AdministratorConfiguration).SshPublicKey = value ?? null /* arrayOf */; } - - /// Backing field for property. - private string[] _availabilityZone; - - /// - /// The list of availability zones of the Network Cloud cluster to be used for the provisioning of nodes in the control plane. - /// If not specified, all availability zones will be used. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string[] AvailabilityZone { get => this._availabilityZone; set => this._availabilityZone = value; } - - /// Backing field for property. - private long _count; - - /// The number of virtual machines that use this configuration. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public long Count { get => this._count; set => this._count = value; } - - /// Internal Acessors for AdministratorConfiguration - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministratorConfiguration Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IControlPlaneNodeConfigurationInternal.AdministratorConfiguration { get => (this._administratorConfiguration = this._administratorConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AdministratorConfiguration()); set { {_administratorConfiguration = value;} } } - - /// Backing field for property. - private string _vMSkuName; - - /// The name of the VM SKU supplied during creation. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string VMSkuName { get => this._vMSkuName; set => this._vMSkuName = value; } - - /// Creates an new instance. - public ControlPlaneNodeConfiguration() - { - - } - } - /// ControlPlaneNodeConfiguration represents the selection of virtual machines and size of the control plane for a Kubernetes - /// cluster. - public partial interface IControlPlaneNodeConfiguration : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable - { - /// - /// The user name for the administrator that will be applied to the operating systems that run Kubernetes nodes. If not supplied, - /// a user name will be chosen by the service. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The user name for the administrator that will be applied to the operating systems that run Kubernetes nodes. If not supplied, a user name will be chosen by the service.", - SerializedName = @"adminUsername", - PossibleTypes = new [] { typeof(string) })] - string AdministratorConfigurationAdminUsername { get; set; } - /// - /// The SSH configuration for the operating systems that run the nodes in the Kubernetes cluster. In some cases, specification - /// of public keys may be required to produce a working environment. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The SSH configuration for the operating systems that run the nodes in the Kubernetes cluster. In some cases, specification of public keys may be required to produce a working environment.", - SerializedName = @"sshPublicKeys", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey[] AdministratorConfigurationSshPublicKey { get; set; } - /// - /// The list of availability zones of the Network Cloud cluster to be used for the provisioning of nodes in the control plane. - /// If not specified, all availability zones will be used. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The list of availability zones of the Network Cloud cluster to be used for the provisioning of nodes in the control plane. If not specified, all availability zones will be used.", - SerializedName = @"availabilityZones", - PossibleTypes = new [] { typeof(string) })] - string[] AvailabilityZone { get; set; } - /// The number of virtual machines that use this configuration. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The number of virtual machines that use this configuration.", - SerializedName = @"count", - PossibleTypes = new [] { typeof(long) })] - long Count { get; set; } - /// The name of the VM SKU supplied during creation. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The name of the VM SKU supplied during creation.", - SerializedName = @"vmSkuName", - PossibleTypes = new [] { typeof(string) })] - string VMSkuName { get; set; } - - } - /// ControlPlaneNodeConfiguration represents the selection of virtual machines and size of the control plane for a Kubernetes - /// cluster. - internal partial interface IControlPlaneNodeConfigurationInternal - - { - /// The administrator credentials to be used for the nodes in the control plane. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministratorConfiguration AdministratorConfiguration { get; set; } - /// - /// The user name for the administrator that will be applied to the operating systems that run Kubernetes nodes. If not supplied, - /// a user name will be chosen by the service. - /// - string AdministratorConfigurationAdminUsername { get; set; } - /// - /// The SSH configuration for the operating systems that run the nodes in the Kubernetes cluster. In some cases, specification - /// of public keys may be required to produce a working environment. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey[] AdministratorConfigurationSshPublicKey { get; set; } - /// - /// The list of availability zones of the Network Cloud cluster to be used for the provisioning of nodes in the control plane. - /// If not specified, all availability zones will be used. - /// - string[] AvailabilityZone { get; set; } - /// The number of virtual machines that use this configuration. - long Count { get; set; } - /// The name of the VM SKU supplied during creation. - string VMSkuName { get; set; } - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ControlPlaneNodePatchConfiguration.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ControlPlaneNodePatchConfiguration.PowerShell.cs deleted file mode 100644 index ddf2020ebb73..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ControlPlaneNodePatchConfiguration.PowerShell.cs +++ /dev/null @@ -1,188 +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.NetworkCloud.Models.Api20250201 -{ - using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; - - /// - /// ControlPlaneNodePatchConfiguration represents the properties of the control plane that can be patched for this Kubernetes - /// cluster. - /// - [System.ComponentModel.TypeConverter(typeof(ControlPlaneNodePatchConfigurationTypeConverter))] - public partial class ControlPlaneNodePatchConfiguration - { - - /// - /// 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 ControlPlaneNodePatchConfiguration(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("AdministratorConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IControlPlaneNodePatchConfigurationInternal)this).AdministratorConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministratorConfigurationPatch) content.GetValueForProperty("AdministratorConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IControlPlaneNodePatchConfigurationInternal)this).AdministratorConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AdministratorConfigurationPatchTypeConverter.ConvertFrom); - } - if (content.Contains("Count")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IControlPlaneNodePatchConfigurationInternal)this).Count = (long?) content.GetValueForProperty("Count",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IControlPlaneNodePatchConfigurationInternal)this).Count, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("AdministratorConfigurationSshPublicKey")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IControlPlaneNodePatchConfigurationInternal)this).AdministratorConfigurationSshPublicKey = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey[]) content.GetValueForProperty("AdministratorConfigurationSshPublicKey",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IControlPlaneNodePatchConfigurationInternal)this).AdministratorConfigurationSshPublicKey, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.SshPublicKeyTypeConverter.ConvertFrom)); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal ControlPlaneNodePatchConfiguration(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("AdministratorConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IControlPlaneNodePatchConfigurationInternal)this).AdministratorConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministratorConfigurationPatch) content.GetValueForProperty("AdministratorConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IControlPlaneNodePatchConfigurationInternal)this).AdministratorConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AdministratorConfigurationPatchTypeConverter.ConvertFrom); - } - if (content.Contains("Count")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IControlPlaneNodePatchConfigurationInternal)this).Count = (long?) content.GetValueForProperty("Count",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IControlPlaneNodePatchConfigurationInternal)this).Count, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("AdministratorConfigurationSshPublicKey")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IControlPlaneNodePatchConfigurationInternal)this).AdministratorConfigurationSshPublicKey = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey[]) content.GetValueForProperty("AdministratorConfigurationSshPublicKey",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IControlPlaneNodePatchConfigurationInternal)this).AdministratorConfigurationSshPublicKey, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.SshPublicKeyTypeConverter.ConvertFrom)); - } - AfterDeserializePSObject(content); - } - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IControlPlaneNodePatchConfiguration DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new ControlPlaneNodePatchConfiguration(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.NetworkCloud.Models.Api20250201.IControlPlaneNodePatchConfiguration DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new ControlPlaneNodePatchConfiguration(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.NetworkCloud.Models.Api20250201.IControlPlaneNodePatchConfiguration FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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(); - } - } - /// ControlPlaneNodePatchConfiguration represents the properties of the control plane that can be patched for this Kubernetes - /// cluster. - [System.ComponentModel.TypeConverter(typeof(ControlPlaneNodePatchConfigurationTypeConverter))] - public partial interface IControlPlaneNodePatchConfiguration - - { - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ControlPlaneNodePatchConfiguration.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ControlPlaneNodePatchConfiguration.cs deleted file mode 100644 index 261b3e77f2e9..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ControlPlaneNodePatchConfiguration.cs +++ /dev/null @@ -1,88 +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.NetworkCloud.Models.Api20250201 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; - - /// - /// ControlPlaneNodePatchConfiguration represents the properties of the control plane that can be patched for this Kubernetes - /// cluster. - /// - public partial class ControlPlaneNodePatchConfiguration : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IControlPlaneNodePatchConfiguration, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IControlPlaneNodePatchConfigurationInternal - { - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministratorConfigurationPatch _administratorConfiguration; - - /// The configuration of administrator credentials for the control plane nodes. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministratorConfigurationPatch AdministratorConfiguration { get => (this._administratorConfiguration = this._administratorConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AdministratorConfigurationPatch()); set => this._administratorConfiguration = value; } - - /// - /// SshPublicKey represents the public key used to authenticate with a resource through SSH. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey[] AdministratorConfigurationSshPublicKey { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministratorConfigurationPatchInternal)AdministratorConfiguration).SshPublicKey; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministratorConfigurationPatchInternal)AdministratorConfiguration).SshPublicKey = value ?? null /* arrayOf */; } - - /// Backing field for property. - private long? _count; - - /// The number of virtual machines that use this configuration. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public long? Count { get => this._count; set => this._count = value; } - - /// Internal Acessors for AdministratorConfiguration - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministratorConfigurationPatch Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IControlPlaneNodePatchConfigurationInternal.AdministratorConfiguration { get => (this._administratorConfiguration = this._administratorConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AdministratorConfigurationPatch()); set { {_administratorConfiguration = value;} } } - - /// Creates an new instance. - public ControlPlaneNodePatchConfiguration() - { - - } - } - /// ControlPlaneNodePatchConfiguration represents the properties of the control plane that can be patched for this Kubernetes - /// cluster. - public partial interface IControlPlaneNodePatchConfiguration : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable - { - /// - /// SshPublicKey represents the public key used to authenticate with a resource through SSH. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"SshPublicKey represents the public key used to authenticate with a resource through SSH.", - SerializedName = @"sshPublicKeys", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey[] AdministratorConfigurationSshPublicKey { get; set; } - /// The number of virtual machines that use this configuration. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The number of virtual machines that use this configuration.", - SerializedName = @"count", - PossibleTypes = new [] { typeof(long) })] - long? Count { get; set; } - - } - /// ControlPlaneNodePatchConfiguration represents the properties of the control plane that can be patched for this Kubernetes - /// cluster. - internal partial interface IControlPlaneNodePatchConfigurationInternal - - { - /// The configuration of administrator credentials for the control plane nodes. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministratorConfigurationPatch AdministratorConfiguration { get; set; } - /// - /// SshPublicKey represents the public key used to authenticate with a resource through SSH. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey[] AdministratorConfigurationSshPublicKey { get; set; } - /// The number of virtual machines that use this configuration. - long? Count { get; set; } - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/FeatureStatus.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/FeatureStatus.PowerShell.cs deleted file mode 100644 index 1074097749bb..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/FeatureStatus.PowerShell.cs +++ /dev/null @@ -1,188 +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.NetworkCloud.Models.Api20250201 -{ - using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; - - /// FeatureStatus contains information regarding a Kubernetes cluster feature. - [System.ComponentModel.TypeConverter(typeof(FeatureStatusTypeConverter))] - public partial class FeatureStatus - { - - /// - /// 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.NetworkCloud.Models.Api20250201.IFeatureStatus DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new FeatureStatus(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.NetworkCloud.Models.Api20250201.IFeatureStatus DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new FeatureStatus(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal FeatureStatus(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("DetailedStatus")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IFeatureStatusInternal)this).DetailedStatus = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.FeatureDetailedStatus?) content.GetValueForProperty("DetailedStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IFeatureStatusInternal)this).DetailedStatus, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.FeatureDetailedStatus.CreateFrom); - } - if (content.Contains("DetailedStatusMessage")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IFeatureStatusInternal)this).DetailedStatusMessage = (string) content.GetValueForProperty("DetailedStatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IFeatureStatusInternal)this).DetailedStatusMessage, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IFeatureStatusInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IFeatureStatusInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Version")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IFeatureStatusInternal)this).Version = (string) content.GetValueForProperty("Version",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IFeatureStatusInternal)this).Version, 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 FeatureStatus(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("DetailedStatus")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IFeatureStatusInternal)this).DetailedStatus = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.FeatureDetailedStatus?) content.GetValueForProperty("DetailedStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IFeatureStatusInternal)this).DetailedStatus, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.FeatureDetailedStatus.CreateFrom); - } - if (content.Contains("DetailedStatusMessage")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IFeatureStatusInternal)this).DetailedStatusMessage = (string) content.GetValueForProperty("DetailedStatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IFeatureStatusInternal)this).DetailedStatusMessage, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IFeatureStatusInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IFeatureStatusInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Version")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IFeatureStatusInternal)this).Version = (string) content.GetValueForProperty("Version",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IFeatureStatusInternal)this).Version, 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.NetworkCloud.Models.Api20250201.IFeatureStatus FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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(); - } - } - /// FeatureStatus contains information regarding a Kubernetes cluster feature. - [System.ComponentModel.TypeConverter(typeof(FeatureStatusTypeConverter))] - public partial interface IFeatureStatus - - { - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/HardwareInventory.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/HardwareInventory.PowerShell.cs deleted file mode 100644 index afc32bbd5cca..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/HardwareInventory.PowerShell.cs +++ /dev/null @@ -1,184 +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.NetworkCloud.Models.Api20250201 -{ - using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; - - /// - /// HardwareInventory represents the hardware configuration of this machine as exposed to the customer, including information - /// acquired from the model/sku information and from the ironic inspector. - /// - [System.ComponentModel.TypeConverter(typeof(HardwareInventoryTypeConverter))] - public partial class HardwareInventory - { - - /// - /// 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.NetworkCloud.Models.Api20250201.IHardwareInventory DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new HardwareInventory(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.NetworkCloud.Models.Api20250201.IHardwareInventory DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new HardwareInventory(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.NetworkCloud.Models.Api20250201.IHardwareInventory FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal HardwareInventory(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("AdditionalHostInformation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IHardwareInventoryInternal)this).AdditionalHostInformation = (string) content.GetValueForProperty("AdditionalHostInformation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IHardwareInventoryInternal)this).AdditionalHostInformation, global::System.Convert.ToString); - } - if (content.Contains("Interface")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IHardwareInventoryInternal)this).Interface = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IHardwareInventoryNetworkInterface[]) content.GetValueForProperty("Interface",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IHardwareInventoryInternal)this).Interface, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.HardwareInventoryNetworkInterfaceTypeConverter.ConvertFrom)); - } - if (content.Contains("Nic")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IHardwareInventoryInternal)this).Nic = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INic[]) content.GetValueForProperty("Nic",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IHardwareInventoryInternal)this).Nic, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.NicTypeConverter.ConvertFrom)); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal HardwareInventory(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("AdditionalHostInformation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IHardwareInventoryInternal)this).AdditionalHostInformation = (string) content.GetValueForProperty("AdditionalHostInformation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IHardwareInventoryInternal)this).AdditionalHostInformation, global::System.Convert.ToString); - } - if (content.Contains("Interface")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IHardwareInventoryInternal)this).Interface = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IHardwareInventoryNetworkInterface[]) content.GetValueForProperty("Interface",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IHardwareInventoryInternal)this).Interface, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.HardwareInventoryNetworkInterfaceTypeConverter.ConvertFrom)); - } - if (content.Contains("Nic")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IHardwareInventoryInternal)this).Nic = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INic[]) content.GetValueForProperty("Nic",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IHardwareInventoryInternal)this).Nic, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.NicTypeConverter.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.NetworkCloud.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(); - } - } - /// HardwareInventory represents the hardware configuration of this machine as exposed to the customer, including information - /// acquired from the model/sku information and from the ironic inspector. - [System.ComponentModel.TypeConverter(typeof(HardwareInventoryTypeConverter))] - public partial interface IHardwareInventory - - { - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/HardwareInventory.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/HardwareInventory.cs deleted file mode 100644 index c4db6f717cc5..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/HardwareInventory.cs +++ /dev/null @@ -1,123 +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.NetworkCloud.Models.Api20250201 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; - - /// - /// HardwareInventory represents the hardware configuration of this machine as exposed to the customer, including information - /// acquired from the model/sku information and from the ironic inspector. - /// - public partial class HardwareInventory : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IHardwareInventory, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IHardwareInventoryInternal - { - - /// Backing field for property. - private string _additionalHostInformation; - - /// - /// Freeform data extracted from the environment about this machine. This information varies depending on the specific hardware - /// and configuration. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string AdditionalHostInformation { get => this._additionalHostInformation; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IHardwareInventoryNetworkInterface[] _interface; - - /// - /// The list of network interfaces and associated details for the bare metal machine. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IHardwareInventoryNetworkInterface[] Interface { get => this._interface; } - - /// Internal Acessors for AdditionalHostInformation - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IHardwareInventoryInternal.AdditionalHostInformation { get => this._additionalHostInformation; set { {_additionalHostInformation = value;} } } - - /// Internal Acessors for Interface - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IHardwareInventoryNetworkInterface[] Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IHardwareInventoryInternal.Interface { get => this._interface; set { {_interface = value;} } } - - /// Internal Acessors for Nic - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INic[] Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IHardwareInventoryInternal.Nic { get => this._nic; set { {_nic = value;} } } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INic[] _nic; - - /// - /// Field Deprecated. Will be removed in an upcoming version. The list of network interface cards and associated details for - /// the bare metal machine. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INic[] Nic { get => this._nic; } - - /// Creates an new instance. - public HardwareInventory() - { - - } - } - /// HardwareInventory represents the hardware configuration of this machine as exposed to the customer, including information - /// acquired from the model/sku information and from the ironic inspector. - public partial interface IHardwareInventory : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable - { - /// - /// Freeform data extracted from the environment about this machine. This information varies depending on the specific hardware - /// and configuration. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"Freeform data extracted from the environment about this machine. This information varies depending on the specific hardware and configuration.", - SerializedName = @"additionalHostInformation", - PossibleTypes = new [] { typeof(string) })] - string AdditionalHostInformation { get; } - /// - /// The list of network interfaces and associated details for the bare metal machine. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The list of network interfaces and associated details for the bare metal machine.", - SerializedName = @"interfaces", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IHardwareInventoryNetworkInterface) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IHardwareInventoryNetworkInterface[] Interface { get; } - /// - /// Field Deprecated. Will be removed in an upcoming version. The list of network interface cards and associated details for - /// the bare metal machine. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"Field Deprecated. Will be removed in an upcoming version. The list of network interface cards and associated details for the bare metal machine.", - SerializedName = @"nics", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INic) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INic[] Nic { get; } - - } - /// HardwareInventory represents the hardware configuration of this machine as exposed to the customer, including information - /// acquired from the model/sku information and from the ironic inspector. - internal partial interface IHardwareInventoryInternal - - { - /// - /// Freeform data extracted from the environment about this machine. This information varies depending on the specific hardware - /// and configuration. - /// - string AdditionalHostInformation { get; set; } - /// - /// The list of network interfaces and associated details for the bare metal machine. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IHardwareInventoryNetworkInterface[] Interface { get; set; } - /// - /// Field Deprecated. Will be removed in an upcoming version. The list of network interface cards and associated details for - /// the bare metal machine. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INic[] Nic { get; set; } - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/HardwareInventoryNetworkInterface.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/HardwareInventoryNetworkInterface.PowerShell.cs deleted file mode 100644 index c862fd924786..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/HardwareInventoryNetworkInterface.PowerShell.cs +++ /dev/null @@ -1,194 +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.NetworkCloud.Models.Api20250201 -{ - using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; - - /// - /// HardwareInventoryNetworkInterface represents the network interface details as part of a hardware inventory. - /// - [System.ComponentModel.TypeConverter(typeof(HardwareInventoryNetworkInterfaceTypeConverter))] - public partial class HardwareInventoryNetworkInterface - { - - /// - /// 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.NetworkCloud.Models.Api20250201.IHardwareInventoryNetworkInterface DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new HardwareInventoryNetworkInterface(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.NetworkCloud.Models.Api20250201.IHardwareInventoryNetworkInterface DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new HardwareInventoryNetworkInterface(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.NetworkCloud.Models.Api20250201.IHardwareInventoryNetworkInterface FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal HardwareInventoryNetworkInterface(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("LinkStatus")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IHardwareInventoryNetworkInterfaceInternal)this).LinkStatus = (string) content.GetValueForProperty("LinkStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IHardwareInventoryNetworkInterfaceInternal)this).LinkStatus, global::System.Convert.ToString); - } - if (content.Contains("MacAddress")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IHardwareInventoryNetworkInterfaceInternal)this).MacAddress = (string) content.GetValueForProperty("MacAddress",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IHardwareInventoryNetworkInterfaceInternal)this).MacAddress, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IHardwareInventoryNetworkInterfaceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IHardwareInventoryNetworkInterfaceInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("NetworkInterfaceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IHardwareInventoryNetworkInterfaceInternal)this).NetworkInterfaceId = (string) content.GetValueForProperty("NetworkInterfaceId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IHardwareInventoryNetworkInterfaceInternal)this).NetworkInterfaceId, 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 HardwareInventoryNetworkInterface(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("LinkStatus")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IHardwareInventoryNetworkInterfaceInternal)this).LinkStatus = (string) content.GetValueForProperty("LinkStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IHardwareInventoryNetworkInterfaceInternal)this).LinkStatus, global::System.Convert.ToString); - } - if (content.Contains("MacAddress")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IHardwareInventoryNetworkInterfaceInternal)this).MacAddress = (string) content.GetValueForProperty("MacAddress",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IHardwareInventoryNetworkInterfaceInternal)this).MacAddress, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IHardwareInventoryNetworkInterfaceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IHardwareInventoryNetworkInterfaceInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("NetworkInterfaceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IHardwareInventoryNetworkInterfaceInternal)this).NetworkInterfaceId = (string) content.GetValueForProperty("NetworkInterfaceId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IHardwareInventoryNetworkInterfaceInternal)this).NetworkInterfaceId, 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.NetworkCloud.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(); - } - } - /// HardwareInventoryNetworkInterface represents the network interface details as part of a hardware inventory. - [System.ComponentModel.TypeConverter(typeof(HardwareInventoryNetworkInterfaceTypeConverter))] - public partial interface IHardwareInventoryNetworkInterface - - { - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/HardwareValidationStatus.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/HardwareValidationStatus.cs deleted file mode 100644 index 14309ae84e89..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/HardwareValidationStatus.cs +++ /dev/null @@ -1,76 +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.NetworkCloud.Models.Api20250201 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; - - /// - /// HardwareValidationStatus represents the latest hardware validation details performed for this bare metal machine. - /// - public partial class HardwareValidationStatus : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IHardwareValidationStatus, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IHardwareValidationStatusInternal - { - - /// Backing field for property. - private global::System.DateTime? _lastValidationTime; - - /// The timestamp of the hardware validation execution. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public global::System.DateTime? LastValidationTime { get => this._lastValidationTime; } - - /// Internal Acessors for LastValidationTime - global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IHardwareValidationStatusInternal.LastValidationTime { get => this._lastValidationTime; set { {_lastValidationTime = value;} } } - - /// Internal Acessors for Result - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineHardwareValidationResult? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IHardwareValidationStatusInternal.Result { get => this._result; set { {_result = value;} } } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineHardwareValidationResult? _result; - - /// The outcome of the hardware validation. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineHardwareValidationResult? Result { get => this._result; } - - /// Creates an new instance. - public HardwareValidationStatus() - { - - } - } - /// HardwareValidationStatus represents the latest hardware validation details performed for this bare metal machine. - public partial interface IHardwareValidationStatus : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable - { - /// The timestamp of the hardware validation execution. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The timestamp of the hardware validation execution.", - SerializedName = @"lastValidationTime", - PossibleTypes = new [] { typeof(global::System.DateTime) })] - global::System.DateTime? LastValidationTime { get; } - /// The outcome of the hardware validation. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The outcome of the hardware validation.", - SerializedName = @"result", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineHardwareValidationResult) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineHardwareValidationResult? Result { get; } - - } - /// HardwareValidationStatus represents the latest hardware validation details performed for this bare metal machine. - internal partial interface IHardwareValidationStatusInternal - - { - /// The timestamp of the hardware validation execution. - global::System.DateTime? LastValidationTime { get; set; } - /// The outcome of the hardware validation. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineHardwareValidationResult? Result { get; set; } - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/IPAddressPool.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/IPAddressPool.PowerShell.cs deleted file mode 100644 index 8c82e7394d47..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/IPAddressPool.PowerShell.cs +++ /dev/null @@ -1,190 +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.NetworkCloud.Models.Api20250201 -{ - using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; - - /// - /// IpAddressPool represents a pool of IP addresses that can be allocated to a service. - /// - [System.ComponentModel.TypeConverter(typeof(IPAddressPoolTypeConverter))] - public partial class IPAddressPool - { - - /// - /// 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.NetworkCloud.Models.Api20250201.IIPAddressPool DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new IPAddressPool(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.NetworkCloud.Models.Api20250201.IIPAddressPool DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new IPAddressPool(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.NetworkCloud.Models.Api20250201.IIPAddressPool FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal IPAddressPool(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("Address")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIPAddressPoolInternal)this).Address = (string[]) content.GetValueForProperty("Address",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIPAddressPoolInternal)this).Address, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("AutoAssign")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIPAddressPoolInternal)this).AutoAssign = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BfdEnabled?) content.GetValueForProperty("AutoAssign",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIPAddressPoolInternal)this).AutoAssign, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BfdEnabled.CreateFrom); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIPAddressPoolInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIPAddressPoolInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("OnlyUseHostIP")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIPAddressPoolInternal)this).OnlyUseHostIP = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BfdEnabled?) content.GetValueForProperty("OnlyUseHostIP",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIPAddressPoolInternal)this).OnlyUseHostIP, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BfdEnabled.CreateFrom); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal IPAddressPool(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("Address")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIPAddressPoolInternal)this).Address = (string[]) content.GetValueForProperty("Address",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIPAddressPoolInternal)this).Address, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("AutoAssign")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIPAddressPoolInternal)this).AutoAssign = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BfdEnabled?) content.GetValueForProperty("AutoAssign",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIPAddressPoolInternal)this).AutoAssign, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BfdEnabled.CreateFrom); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIPAddressPoolInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIPAddressPoolInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("OnlyUseHostIP")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIPAddressPoolInternal)this).OnlyUseHostIP = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BfdEnabled?) content.GetValueForProperty("OnlyUseHostIP",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIPAddressPoolInternal)this).OnlyUseHostIP, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BfdEnabled.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.NetworkCloud.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(); - } - } - /// IpAddressPool represents a pool of IP addresses that can be allocated to a service. - [System.ComponentModel.TypeConverter(typeof(IPAddressPoolTypeConverter))] - public partial interface IIPAddressPool - - { - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/IPAddressPool.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/IPAddressPool.json.cs deleted file mode 100644 index 2035ea1a3cbe..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/IPAddressPool.json.cs +++ /dev/null @@ -1,124 +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.NetworkCloud.Models.Api20250201 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; - - /// - /// IpAddressPool represents a pool of IP addresses that can be allocated to a service. - /// - public partial class IPAddressPool - { - - /// - /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object - /// before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The JsonNode that should be deserialized into this object. - - partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json); - - /// - /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The JSON container that the serialization result will be placed in. - - partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container); - - /// - /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of - /// the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the - /// output parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The JsonNode that should be deserialized into this object. - /// Determines if the rest of the deserialization should be processed, or if the method should return - /// instantly. - - partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json, ref bool returnNow); - - /// - /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the - /// object before it is serialized. - /// If you wish to disable the default serialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The JSON container that the serialization result will be placed in. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, ref bool returnNow); - - /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIPAddressPool. - /// - /// a to deserialize from. - /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIPAddressPool. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIPAddressPool FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) - { - return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new IPAddressPool(json) : null; - } - - /// - /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject into a new instance of . - /// - /// A Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject instance to deserialize from. - internal IPAddressPool(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) - { - bool returnNow = false; - BeforeFromJson(json, ref returnNow); - if (returnNow) - { - return; - } - {_address = If( json?.PropertyT("addresses"), out var __jsonAddresses) ? If( __jsonAddresses as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : Address;} - {_autoAssign = If( json?.PropertyT("autoAssign"), out var __jsonAutoAssign) ? (string)__jsonAutoAssign : (string)AutoAssign;} - {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} - {_onlyUseHostIP = If( json?.PropertyT("onlyUseHostIps"), out var __jsonOnlyUseHostIps) ? (string)__jsonOnlyUseHostIps : (string)OnlyUseHostIP;} - AfterFromJson(json); - } - - /// - /// Serializes this instance of into a . - /// - /// The container to serialize this object into. If the caller - /// passes in null, a new instance will be created and returned to the caller. - /// Allows the caller to choose the depth of the serialization. See . - /// - /// a serialized instance of as a . - /// - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode) - { - container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject(); - - bool returnNow = false; - BeforeToJson(ref container, ref returnNow); - if (returnNow) - { - return container; - } - if (null != this._address) - { - var __w = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.XNodeArray(); - foreach( var __x in this._address ) - { - AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); - } - container.Add("addresses",__w); - } - AddIf( null != (((object)this._autoAssign)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._autoAssign.ToString()) : null, "autoAssign" ,container.Add ); - AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); - AddIf( null != (((object)this._onlyUseHostIP)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._onlyUseHostIP.ToString()) : null, "onlyUseHostIps" ,container.Add ); - AfterToJson(ref container); - return container; - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/InitialAgentPoolConfiguration.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/InitialAgentPoolConfiguration.PowerShell.cs deleted file mode 100644 index 2a50aed68bb2..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/InitialAgentPoolConfiguration.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.NetworkCloud.Models.Api20250201 -{ - using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; - - /// - /// InitialAgentPoolConfiguration specifies the configuration of a pool of virtual machines that are initially defined with - /// a Kubernetes cluster. - /// - [System.ComponentModel.TypeConverter(typeof(InitialAgentPoolConfigurationTypeConverter))] - public partial class InitialAgentPoolConfiguration - { - - /// - /// 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.NetworkCloud.Models.Api20250201.IInitialAgentPoolConfiguration DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new InitialAgentPoolConfiguration(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.NetworkCloud.Models.Api20250201.IInitialAgentPoolConfiguration DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new InitialAgentPoolConfiguration(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.NetworkCloud.Models.Api20250201.IInitialAgentPoolConfiguration FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal InitialAgentPoolConfiguration(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("AdministratorConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IInitialAgentPoolConfigurationInternal)this).AdministratorConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministratorConfiguration) content.GetValueForProperty("AdministratorConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IInitialAgentPoolConfigurationInternal)this).AdministratorConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AdministratorConfigurationTypeConverter.ConvertFrom); - } - if (content.Contains("AgentOption")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IInitialAgentPoolConfigurationInternal)this).AgentOption = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentOptions) content.GetValueForProperty("AgentOption",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IInitialAgentPoolConfigurationInternal)this).AgentOption, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AgentOptionsTypeConverter.ConvertFrom); - } - if (content.Contains("AttachedNetworkConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IInitialAgentPoolConfigurationInternal)this).AttachedNetworkConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAttachedNetworkConfiguration) content.GetValueForProperty("AttachedNetworkConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IInitialAgentPoolConfigurationInternal)this).AttachedNetworkConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AttachedNetworkConfigurationTypeConverter.ConvertFrom); - } - if (content.Contains("UpgradeSetting")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IInitialAgentPoolConfigurationInternal)this).UpgradeSetting = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolUpgradeSettings) content.GetValueForProperty("UpgradeSetting",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IInitialAgentPoolConfigurationInternal)this).UpgradeSetting, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AgentPoolUpgradeSettingsTypeConverter.ConvertFrom); - } - if (content.Contains("AvailabilityZone")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IInitialAgentPoolConfigurationInternal)this).AvailabilityZone = (string[]) content.GetValueForProperty("AvailabilityZone",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IInitialAgentPoolConfigurationInternal)this).AvailabilityZone, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("Count")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IInitialAgentPoolConfigurationInternal)this).Count = (long) content.GetValueForProperty("Count",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IInitialAgentPoolConfigurationInternal)this).Count, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("Label")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IInitialAgentPoolConfigurationInternal)this).Label = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesLabel[]) content.GetValueForProperty("Label",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IInitialAgentPoolConfigurationInternal)this).Label, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.KubernetesLabelTypeConverter.ConvertFrom)); - } - if (content.Contains("Mode")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IInitialAgentPoolConfigurationInternal)this).Mode = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.AgentPoolMode) content.GetValueForProperty("Mode",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IInitialAgentPoolConfigurationInternal)this).Mode, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.AgentPoolMode.CreateFrom); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IInitialAgentPoolConfigurationInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IInitialAgentPoolConfigurationInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Taint")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IInitialAgentPoolConfigurationInternal)this).Taint = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesLabel[]) content.GetValueForProperty("Taint",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IInitialAgentPoolConfigurationInternal)this).Taint, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.KubernetesLabelTypeConverter.ConvertFrom)); - } - if (content.Contains("VMSkuName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IInitialAgentPoolConfigurationInternal)this).VMSkuName = (string) content.GetValueForProperty("VMSkuName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IInitialAgentPoolConfigurationInternal)this).VMSkuName, global::System.Convert.ToString); - } - if (content.Contains("AdministratorConfigurationAdminUsername")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IInitialAgentPoolConfigurationInternal)this).AdministratorConfigurationAdminUsername = (string) content.GetValueForProperty("AdministratorConfigurationAdminUsername",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IInitialAgentPoolConfigurationInternal)this).AdministratorConfigurationAdminUsername, global::System.Convert.ToString); - } - if (content.Contains("AgentOptionHugepagesCount")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IInitialAgentPoolConfigurationInternal)this).AgentOptionHugepagesCount = (long) content.GetValueForProperty("AgentOptionHugepagesCount",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IInitialAgentPoolConfigurationInternal)this).AgentOptionHugepagesCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("AgentOptionHugepagesSize")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IInitialAgentPoolConfigurationInternal)this).AgentOptionHugepagesSize = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HugepagesSize?) content.GetValueForProperty("AgentOptionHugepagesSize",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IInitialAgentPoolConfigurationInternal)this).AgentOptionHugepagesSize, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HugepagesSize.CreateFrom); - } - if (content.Contains("AttachedNetworkConfigurationL2Network")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IInitialAgentPoolConfigurationInternal)this).AttachedNetworkConfigurationL2Network = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkAttachmentConfiguration[]) content.GetValueForProperty("AttachedNetworkConfigurationL2Network",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IInitialAgentPoolConfigurationInternal)this).AttachedNetworkConfigurationL2Network, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.L2NetworkAttachmentConfigurationTypeConverter.ConvertFrom)); - } - if (content.Contains("AttachedNetworkConfigurationL3Network")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IInitialAgentPoolConfigurationInternal)this).AttachedNetworkConfigurationL3Network = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkAttachmentConfiguration[]) content.GetValueForProperty("AttachedNetworkConfigurationL3Network",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IInitialAgentPoolConfigurationInternal)this).AttachedNetworkConfigurationL3Network, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.L3NetworkAttachmentConfigurationTypeConverter.ConvertFrom)); - } - if (content.Contains("AttachedNetworkConfigurationTrunkedNetwork")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IInitialAgentPoolConfigurationInternal)this).AttachedNetworkConfigurationTrunkedNetwork = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkAttachmentConfiguration[]) content.GetValueForProperty("AttachedNetworkConfigurationTrunkedNetwork",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IInitialAgentPoolConfigurationInternal)this).AttachedNetworkConfigurationTrunkedNetwork, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.TrunkedNetworkAttachmentConfigurationTypeConverter.ConvertFrom)); - } - if (content.Contains("AdministratorConfigurationSshPublicKey")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IInitialAgentPoolConfigurationInternal)this).AdministratorConfigurationSshPublicKey = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey[]) content.GetValueForProperty("AdministratorConfigurationSshPublicKey",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IInitialAgentPoolConfigurationInternal)this).AdministratorConfigurationSshPublicKey, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.SshPublicKeyTypeConverter.ConvertFrom)); - } - if (content.Contains("UpgradeSettingDrainTimeout")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IInitialAgentPoolConfigurationInternal)this).UpgradeSettingDrainTimeout = (long?) content.GetValueForProperty("UpgradeSettingDrainTimeout",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IInitialAgentPoolConfigurationInternal)this).UpgradeSettingDrainTimeout, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("UpgradeSettingMaxSurge")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IInitialAgentPoolConfigurationInternal)this).UpgradeSettingMaxSurge = (string) content.GetValueForProperty("UpgradeSettingMaxSurge",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IInitialAgentPoolConfigurationInternal)this).UpgradeSettingMaxSurge, global::System.Convert.ToString); - } - if (content.Contains("UpgradeSettingMaxUnavailable")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IInitialAgentPoolConfigurationInternal)this).UpgradeSettingMaxUnavailable = (string) content.GetValueForProperty("UpgradeSettingMaxUnavailable",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IInitialAgentPoolConfigurationInternal)this).UpgradeSettingMaxUnavailable, 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 InitialAgentPoolConfiguration(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("AdministratorConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IInitialAgentPoolConfigurationInternal)this).AdministratorConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministratorConfiguration) content.GetValueForProperty("AdministratorConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IInitialAgentPoolConfigurationInternal)this).AdministratorConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AdministratorConfigurationTypeConverter.ConvertFrom); - } - if (content.Contains("AgentOption")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IInitialAgentPoolConfigurationInternal)this).AgentOption = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentOptions) content.GetValueForProperty("AgentOption",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IInitialAgentPoolConfigurationInternal)this).AgentOption, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AgentOptionsTypeConverter.ConvertFrom); - } - if (content.Contains("AttachedNetworkConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IInitialAgentPoolConfigurationInternal)this).AttachedNetworkConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAttachedNetworkConfiguration) content.GetValueForProperty("AttachedNetworkConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IInitialAgentPoolConfigurationInternal)this).AttachedNetworkConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AttachedNetworkConfigurationTypeConverter.ConvertFrom); - } - if (content.Contains("UpgradeSetting")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IInitialAgentPoolConfigurationInternal)this).UpgradeSetting = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolUpgradeSettings) content.GetValueForProperty("UpgradeSetting",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IInitialAgentPoolConfigurationInternal)this).UpgradeSetting, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AgentPoolUpgradeSettingsTypeConverter.ConvertFrom); - } - if (content.Contains("AvailabilityZone")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IInitialAgentPoolConfigurationInternal)this).AvailabilityZone = (string[]) content.GetValueForProperty("AvailabilityZone",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IInitialAgentPoolConfigurationInternal)this).AvailabilityZone, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("Count")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IInitialAgentPoolConfigurationInternal)this).Count = (long) content.GetValueForProperty("Count",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IInitialAgentPoolConfigurationInternal)this).Count, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("Label")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IInitialAgentPoolConfigurationInternal)this).Label = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesLabel[]) content.GetValueForProperty("Label",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IInitialAgentPoolConfigurationInternal)this).Label, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.KubernetesLabelTypeConverter.ConvertFrom)); - } - if (content.Contains("Mode")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IInitialAgentPoolConfigurationInternal)this).Mode = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.AgentPoolMode) content.GetValueForProperty("Mode",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IInitialAgentPoolConfigurationInternal)this).Mode, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.AgentPoolMode.CreateFrom); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IInitialAgentPoolConfigurationInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IInitialAgentPoolConfigurationInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Taint")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IInitialAgentPoolConfigurationInternal)this).Taint = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesLabel[]) content.GetValueForProperty("Taint",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IInitialAgentPoolConfigurationInternal)this).Taint, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.KubernetesLabelTypeConverter.ConvertFrom)); - } - if (content.Contains("VMSkuName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IInitialAgentPoolConfigurationInternal)this).VMSkuName = (string) content.GetValueForProperty("VMSkuName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IInitialAgentPoolConfigurationInternal)this).VMSkuName, global::System.Convert.ToString); - } - if (content.Contains("AdministratorConfigurationAdminUsername")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IInitialAgentPoolConfigurationInternal)this).AdministratorConfigurationAdminUsername = (string) content.GetValueForProperty("AdministratorConfigurationAdminUsername",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IInitialAgentPoolConfigurationInternal)this).AdministratorConfigurationAdminUsername, global::System.Convert.ToString); - } - if (content.Contains("AgentOptionHugepagesCount")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IInitialAgentPoolConfigurationInternal)this).AgentOptionHugepagesCount = (long) content.GetValueForProperty("AgentOptionHugepagesCount",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IInitialAgentPoolConfigurationInternal)this).AgentOptionHugepagesCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("AgentOptionHugepagesSize")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IInitialAgentPoolConfigurationInternal)this).AgentOptionHugepagesSize = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HugepagesSize?) content.GetValueForProperty("AgentOptionHugepagesSize",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IInitialAgentPoolConfigurationInternal)this).AgentOptionHugepagesSize, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HugepagesSize.CreateFrom); - } - if (content.Contains("AttachedNetworkConfigurationL2Network")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IInitialAgentPoolConfigurationInternal)this).AttachedNetworkConfigurationL2Network = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkAttachmentConfiguration[]) content.GetValueForProperty("AttachedNetworkConfigurationL2Network",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IInitialAgentPoolConfigurationInternal)this).AttachedNetworkConfigurationL2Network, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.L2NetworkAttachmentConfigurationTypeConverter.ConvertFrom)); - } - if (content.Contains("AttachedNetworkConfigurationL3Network")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IInitialAgentPoolConfigurationInternal)this).AttachedNetworkConfigurationL3Network = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkAttachmentConfiguration[]) content.GetValueForProperty("AttachedNetworkConfigurationL3Network",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IInitialAgentPoolConfigurationInternal)this).AttachedNetworkConfigurationL3Network, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.L3NetworkAttachmentConfigurationTypeConverter.ConvertFrom)); - } - if (content.Contains("AttachedNetworkConfigurationTrunkedNetwork")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IInitialAgentPoolConfigurationInternal)this).AttachedNetworkConfigurationTrunkedNetwork = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkAttachmentConfiguration[]) content.GetValueForProperty("AttachedNetworkConfigurationTrunkedNetwork",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IInitialAgentPoolConfigurationInternal)this).AttachedNetworkConfigurationTrunkedNetwork, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.TrunkedNetworkAttachmentConfigurationTypeConverter.ConvertFrom)); - } - if (content.Contains("AdministratorConfigurationSshPublicKey")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IInitialAgentPoolConfigurationInternal)this).AdministratorConfigurationSshPublicKey = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey[]) content.GetValueForProperty("AdministratorConfigurationSshPublicKey",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IInitialAgentPoolConfigurationInternal)this).AdministratorConfigurationSshPublicKey, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.SshPublicKeyTypeConverter.ConvertFrom)); - } - if (content.Contains("UpgradeSettingDrainTimeout")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IInitialAgentPoolConfigurationInternal)this).UpgradeSettingDrainTimeout = (long?) content.GetValueForProperty("UpgradeSettingDrainTimeout",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IInitialAgentPoolConfigurationInternal)this).UpgradeSettingDrainTimeout, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("UpgradeSettingMaxSurge")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IInitialAgentPoolConfigurationInternal)this).UpgradeSettingMaxSurge = (string) content.GetValueForProperty("UpgradeSettingMaxSurge",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IInitialAgentPoolConfigurationInternal)this).UpgradeSettingMaxSurge, global::System.Convert.ToString); - } - if (content.Contains("UpgradeSettingMaxUnavailable")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IInitialAgentPoolConfigurationInternal)this).UpgradeSettingMaxUnavailable = (string) content.GetValueForProperty("UpgradeSettingMaxUnavailable",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IInitialAgentPoolConfigurationInternal)this).UpgradeSettingMaxUnavailable, 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.NetworkCloud.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(); - } - } - /// InitialAgentPoolConfiguration specifies the configuration of a pool of virtual machines that are initially defined with - /// a Kubernetes cluster. - [System.ComponentModel.TypeConverter(typeof(InitialAgentPoolConfigurationTypeConverter))] - public partial interface IInitialAgentPoolConfiguration - - { - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/InitialAgentPoolConfiguration.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/InitialAgentPoolConfiguration.cs deleted file mode 100644 index b87887413ec2..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/InitialAgentPoolConfiguration.cs +++ /dev/null @@ -1,440 +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.NetworkCloud.Models.Api20250201 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; - - /// - /// InitialAgentPoolConfiguration specifies the configuration of a pool of virtual machines that are initially defined with - /// a Kubernetes cluster. - /// - public partial class InitialAgentPoolConfiguration : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IInitialAgentPoolConfiguration, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IInitialAgentPoolConfigurationInternal - { - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministratorConfiguration _administratorConfiguration; - - /// The administrator credentials to be used for the nodes in this agent pool. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministratorConfiguration AdministratorConfiguration { get => (this._administratorConfiguration = this._administratorConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AdministratorConfiguration()); set => this._administratorConfiguration = value; } - - /// - /// The user name for the administrator that will be applied to the operating systems that run Kubernetes nodes. If not supplied, - /// a user name will be chosen by the service. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string AdministratorConfigurationAdminUsername { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministratorConfigurationInternal)AdministratorConfiguration).AdminUsername; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministratorConfigurationInternal)AdministratorConfiguration).AdminUsername = value ?? null; } - - /// - /// The SSH configuration for the operating systems that run the nodes in the Kubernetes cluster. In some cases, specification - /// of public keys may be required to produce a working environment. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey[] AdministratorConfigurationSshPublicKey { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministratorConfigurationInternal)AdministratorConfiguration).SshPublicKey; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministratorConfigurationInternal)AdministratorConfiguration).SshPublicKey = value ?? null /* arrayOf */; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentOptions _agentOption; - - /// The configurations that will be applied to each agent in this agent pool. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentOptions AgentOption { get => (this._agentOption = this._agentOption ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AgentOptions()); set => this._agentOption = value; } - - /// The number of hugepages to allocate. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public long? AgentOptionHugepagesCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentOptionsInternal)AgentOption).HugepagesCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentOptionsInternal)AgentOption).HugepagesCount = value ?? default(long); } - - /// The size of the hugepages to allocate. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HugepagesSize? AgentOptionHugepagesSize { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentOptionsInternal)AgentOption).HugepagesSize; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentOptionsInternal)AgentOption).HugepagesSize = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HugepagesSize)""); } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAttachedNetworkConfiguration _attachedNetworkConfiguration; - - /// - /// The configuration of networks being attached to the agent pool for use by the workloads that run on this Kubernetes cluster. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAttachedNetworkConfiguration AttachedNetworkConfiguration { get => (this._attachedNetworkConfiguration = this._attachedNetworkConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AttachedNetworkConfiguration()); set => this._attachedNetworkConfiguration = value; } - - /// The list of Layer 2 Networks and related configuration for attachment. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkAttachmentConfiguration[] AttachedNetworkConfigurationL2Network { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAttachedNetworkConfigurationInternal)AttachedNetworkConfiguration).L2Network; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAttachedNetworkConfigurationInternal)AttachedNetworkConfiguration).L2Network = value ?? null /* arrayOf */; } - - /// The list of Layer 3 Networks and related configuration for attachment. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkAttachmentConfiguration[] AttachedNetworkConfigurationL3Network { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAttachedNetworkConfigurationInternal)AttachedNetworkConfiguration).L3Network; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAttachedNetworkConfigurationInternal)AttachedNetworkConfiguration).L3Network = value ?? null /* arrayOf */; } - - /// The list of Trunked Networks and related configuration for attachment. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkAttachmentConfiguration[] AttachedNetworkConfigurationTrunkedNetwork { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAttachedNetworkConfigurationInternal)AttachedNetworkConfiguration).TrunkedNetwork; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAttachedNetworkConfigurationInternal)AttachedNetworkConfiguration).TrunkedNetwork = value ?? null /* arrayOf */; } - - /// Backing field for property. - private string[] _availabilityZone; - - /// - /// The list of availability zones of the Network Cloud cluster used for the provisioning of nodes in this agent pool. If - /// not specified, all availability zones will be used. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string[] AvailabilityZone { get => this._availabilityZone; set => this._availabilityZone = value; } - - /// Backing field for property. - private long _count; - - /// The number of virtual machines that use this configuration. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public long Count { get => this._count; set => this._count = value; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesLabel[] _label; - - /// The labels applied to the nodes in this agent pool. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesLabel[] Label { get => this._label; set => this._label = value; } - - /// Internal Acessors for AdministratorConfiguration - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministratorConfiguration Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IInitialAgentPoolConfigurationInternal.AdministratorConfiguration { get => (this._administratorConfiguration = this._administratorConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AdministratorConfiguration()); set { {_administratorConfiguration = value;} } } - - /// Internal Acessors for AgentOption - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentOptions Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IInitialAgentPoolConfigurationInternal.AgentOption { get => (this._agentOption = this._agentOption ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AgentOptions()); set { {_agentOption = value;} } } - - /// Internal Acessors for AttachedNetworkConfiguration - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAttachedNetworkConfiguration Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IInitialAgentPoolConfigurationInternal.AttachedNetworkConfiguration { get => (this._attachedNetworkConfiguration = this._attachedNetworkConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AttachedNetworkConfiguration()); set { {_attachedNetworkConfiguration = value;} } } - - /// Internal Acessors for UpgradeSetting - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolUpgradeSettings Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IInitialAgentPoolConfigurationInternal.UpgradeSetting { get => (this._upgradeSetting = this._upgradeSetting ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AgentPoolUpgradeSettings()); set { {_upgradeSetting = value;} } } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.AgentPoolMode _mode; - - /// - /// The selection of how this agent pool is utilized, either as a system pool or a user pool. System pools run the features - /// and critical services for the Kubernetes Cluster, while user pools are dedicated to user workloads. Every Kubernetes cluster - /// must contain at least one system node pool with at least one node. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.AgentPoolMode Mode { get => this._mode; set => this._mode = value; } - - /// Backing field for property. - private string _name; - - /// - /// The name that will be used for the agent pool resource representing this agent pool. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string Name { get => this._name; set => this._name = value; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesLabel[] _taint; - - /// The taints applied to the nodes in this agent pool. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesLabel[] Taint { get => this._taint; set => this._taint = value; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolUpgradeSettings _upgradeSetting; - - /// The configuration of the agent pool. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolUpgradeSettings UpgradeSetting { get => (this._upgradeSetting = this._upgradeSetting ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AgentPoolUpgradeSettings()); set => this._upgradeSetting = value; } - - /// - /// The maximum time in seconds that is allowed for a node drain to complete before proceeding with the upgrade of the agent - /// pool. If not specified during creation, a value of 1800 seconds is used. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public long? UpgradeSettingDrainTimeout { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolUpgradeSettingsInternal)UpgradeSetting).DrainTimeout; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolUpgradeSettingsInternal)UpgradeSetting).DrainTimeout = value ?? default(long); } - - /// - /// The maximum number or percentage of nodes that are surged during upgrade. This can either be set to an integer (e.g. '5') - /// or a percentage (e.g. '50%'). If a percentage is specified, it is the percentage of the total agent pool size at the time - /// of the upgrade. For percentages, fractional nodes are rounded up. If not specified during creation, a value of 1 is used. - /// One of MaxSurge and MaxUnavailable must be greater than 0. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string UpgradeSettingMaxSurge { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolUpgradeSettingsInternal)UpgradeSetting).MaxSurge; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolUpgradeSettingsInternal)UpgradeSetting).MaxSurge = value ?? null; } - - /// - /// The maximum number or percentage of nodes that can be unavailable during upgrade. This can either be set to an integer - /// (e.g. '5') or a percentage (e.g. '50%'). If a percentage is specified, it is the percentage of the total agent pool size - /// at the time of the upgrade. For percentages, fractional nodes are rounded up. If not specified during creation, a value - /// of 0 is used. One of MaxSurge and MaxUnavailable must be greater than 0. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string UpgradeSettingMaxUnavailable { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolUpgradeSettingsInternal)UpgradeSetting).MaxUnavailable; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolUpgradeSettingsInternal)UpgradeSetting).MaxUnavailable = value ?? null; } - - /// Backing field for property. - private string _vMSkuName; - - /// - /// The name of the VM SKU that determines the size of resources allocated for node VMs. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string VMSkuName { get => this._vMSkuName; set => this._vMSkuName = value; } - - /// Creates an new instance. - public InitialAgentPoolConfiguration() - { - - } - } - /// InitialAgentPoolConfiguration specifies the configuration of a pool of virtual machines that are initially defined with - /// a Kubernetes cluster. - public partial interface IInitialAgentPoolConfiguration : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable - { - /// - /// The user name for the administrator that will be applied to the operating systems that run Kubernetes nodes. If not supplied, - /// a user name will be chosen by the service. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The user name for the administrator that will be applied to the operating systems that run Kubernetes nodes. If not supplied, a user name will be chosen by the service.", - SerializedName = @"adminUsername", - PossibleTypes = new [] { typeof(string) })] - string AdministratorConfigurationAdminUsername { get; set; } - /// - /// The SSH configuration for the operating systems that run the nodes in the Kubernetes cluster. In some cases, specification - /// of public keys may be required to produce a working environment. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The SSH configuration for the operating systems that run the nodes in the Kubernetes cluster. In some cases, specification of public keys may be required to produce a working environment.", - SerializedName = @"sshPublicKeys", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey[] AdministratorConfigurationSshPublicKey { get; set; } - /// The number of hugepages to allocate. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The number of hugepages to allocate.", - SerializedName = @"hugepagesCount", - PossibleTypes = new [] { typeof(long) })] - long? AgentOptionHugepagesCount { get; set; } - /// The size of the hugepages to allocate. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The size of the hugepages to allocate.", - SerializedName = @"hugepagesSize", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HugepagesSize) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HugepagesSize? AgentOptionHugepagesSize { get; set; } - /// The list of Layer 2 Networks and related configuration for attachment. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The list of Layer 2 Networks and related configuration for attachment.", - SerializedName = @"l2Networks", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkAttachmentConfiguration) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkAttachmentConfiguration[] AttachedNetworkConfigurationL2Network { get; set; } - /// The list of Layer 3 Networks and related configuration for attachment. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The list of Layer 3 Networks and related configuration for attachment.", - SerializedName = @"l3Networks", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkAttachmentConfiguration) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkAttachmentConfiguration[] AttachedNetworkConfigurationL3Network { get; set; } - /// The list of Trunked Networks and related configuration for attachment. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The list of Trunked Networks and related configuration for attachment.", - SerializedName = @"trunkedNetworks", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkAttachmentConfiguration) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkAttachmentConfiguration[] AttachedNetworkConfigurationTrunkedNetwork { get; set; } - /// - /// The list of availability zones of the Network Cloud cluster used for the provisioning of nodes in this agent pool. If - /// not specified, all availability zones will be used. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The list of availability zones of the Network Cloud cluster used for the provisioning of nodes in this agent pool. If not specified, all availability zones will be used.", - SerializedName = @"availabilityZones", - PossibleTypes = new [] { typeof(string) })] - string[] AvailabilityZone { get; set; } - /// The number of virtual machines that use this configuration. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The number of virtual machines that use this configuration.", - SerializedName = @"count", - PossibleTypes = new [] { typeof(long) })] - long Count { get; set; } - /// The labels applied to the nodes in this agent pool. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The labels applied to the nodes in this agent pool.", - SerializedName = @"labels", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesLabel) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesLabel[] Label { get; set; } - /// - /// The selection of how this agent pool is utilized, either as a system pool or a user pool. System pools run the features - /// and critical services for the Kubernetes Cluster, while user pools are dedicated to user workloads. Every Kubernetes cluster - /// must contain at least one system node pool with at least one node. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The selection of how this agent pool is utilized, either as a system pool or a user pool. System pools run the features and critical services for the Kubernetes Cluster, while user pools are dedicated to user workloads. Every Kubernetes cluster must contain at least one system node pool with at least one node.", - SerializedName = @"mode", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.AgentPoolMode) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.AgentPoolMode Mode { get; set; } - /// - /// The name that will be used for the agent pool resource representing this agent pool. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The name that will be used for the agent pool resource representing this agent pool.", - SerializedName = @"name", - PossibleTypes = new [] { typeof(string) })] - string Name { get; set; } - /// The taints applied to the nodes in this agent pool. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The taints applied to the nodes in this agent pool.", - SerializedName = @"taints", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesLabel) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesLabel[] Taint { get; set; } - /// - /// The maximum time in seconds that is allowed for a node drain to complete before proceeding with the upgrade of the agent - /// pool. If not specified during creation, a value of 1800 seconds is used. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The maximum time in seconds that is allowed for a node drain to complete before proceeding with the upgrade of the agent pool. If not specified during creation, a value of 1800 seconds is used.", - SerializedName = @"drainTimeout", - PossibleTypes = new [] { typeof(long) })] - long? UpgradeSettingDrainTimeout { get; set; } - /// - /// The maximum number or percentage of nodes that are surged during upgrade. This can either be set to an integer (e.g. '5') - /// or a percentage (e.g. '50%'). If a percentage is specified, it is the percentage of the total agent pool size at the time - /// of the upgrade. For percentages, fractional nodes are rounded up. If not specified during creation, a value of 1 is used. - /// One of MaxSurge and MaxUnavailable must be greater than 0. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The maximum number or percentage of nodes that are surged during upgrade. This can either be set to an integer (e.g. '5') or a percentage (e.g. '50%'). If a percentage is specified, it is the percentage of the total agent pool size at the time of the upgrade. For percentages, fractional nodes are rounded up. If not specified during creation, a value of 1 is used. One of MaxSurge and MaxUnavailable must be greater than 0.", - SerializedName = @"maxSurge", - PossibleTypes = new [] { typeof(string) })] - string UpgradeSettingMaxSurge { get; set; } - /// - /// The maximum number or percentage of nodes that can be unavailable during upgrade. This can either be set to an integer - /// (e.g. '5') or a percentage (e.g. '50%'). If a percentage is specified, it is the percentage of the total agent pool size - /// at the time of the upgrade. For percentages, fractional nodes are rounded up. If not specified during creation, a value - /// of 0 is used. One of MaxSurge and MaxUnavailable must be greater than 0. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The maximum number or percentage of nodes that can be unavailable during upgrade. This can either be set to an integer (e.g. '5') or a percentage (e.g. '50%'). If a percentage is specified, it is the percentage of the total agent pool size at the time of the upgrade. For percentages, fractional nodes are rounded up. If not specified during creation, a value of 0 is used. One of MaxSurge and MaxUnavailable must be greater than 0.", - SerializedName = @"maxUnavailable", - PossibleTypes = new [] { typeof(string) })] - string UpgradeSettingMaxUnavailable { get; set; } - /// - /// The name of the VM SKU that determines the size of resources allocated for node VMs. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The name of the VM SKU that determines the size of resources allocated for node VMs.", - SerializedName = @"vmSkuName", - PossibleTypes = new [] { typeof(string) })] - string VMSkuName { get; set; } - - } - /// InitialAgentPoolConfiguration specifies the configuration of a pool of virtual machines that are initially defined with - /// a Kubernetes cluster. - internal partial interface IInitialAgentPoolConfigurationInternal - - { - /// The administrator credentials to be used for the nodes in this agent pool. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministratorConfiguration AdministratorConfiguration { get; set; } - /// - /// The user name for the administrator that will be applied to the operating systems that run Kubernetes nodes. If not supplied, - /// a user name will be chosen by the service. - /// - string AdministratorConfigurationAdminUsername { get; set; } - /// - /// The SSH configuration for the operating systems that run the nodes in the Kubernetes cluster. In some cases, specification - /// of public keys may be required to produce a working environment. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey[] AdministratorConfigurationSshPublicKey { get; set; } - /// The configurations that will be applied to each agent in this agent pool. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentOptions AgentOption { get; set; } - /// The number of hugepages to allocate. - long? AgentOptionHugepagesCount { get; set; } - /// The size of the hugepages to allocate. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HugepagesSize? AgentOptionHugepagesSize { get; set; } - /// - /// The configuration of networks being attached to the agent pool for use by the workloads that run on this Kubernetes cluster. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAttachedNetworkConfiguration AttachedNetworkConfiguration { get; set; } - /// The list of Layer 2 Networks and related configuration for attachment. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkAttachmentConfiguration[] AttachedNetworkConfigurationL2Network { get; set; } - /// The list of Layer 3 Networks and related configuration for attachment. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkAttachmentConfiguration[] AttachedNetworkConfigurationL3Network { get; set; } - /// The list of Trunked Networks and related configuration for attachment. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkAttachmentConfiguration[] AttachedNetworkConfigurationTrunkedNetwork { get; set; } - /// - /// The list of availability zones of the Network Cloud cluster used for the provisioning of nodes in this agent pool. If - /// not specified, all availability zones will be used. - /// - string[] AvailabilityZone { get; set; } - /// The number of virtual machines that use this configuration. - long Count { get; set; } - /// The labels applied to the nodes in this agent pool. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesLabel[] Label { get; set; } - /// - /// The selection of how this agent pool is utilized, either as a system pool or a user pool. System pools run the features - /// and critical services for the Kubernetes Cluster, while user pools are dedicated to user workloads. Every Kubernetes cluster - /// must contain at least one system node pool with at least one node. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.AgentPoolMode Mode { get; set; } - /// - /// The name that will be used for the agent pool resource representing this agent pool. - /// - string Name { get; set; } - /// The taints applied to the nodes in this agent pool. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesLabel[] Taint { get; set; } - /// The configuration of the agent pool. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolUpgradeSettings UpgradeSetting { get; set; } - /// - /// The maximum time in seconds that is allowed for a node drain to complete before proceeding with the upgrade of the agent - /// pool. If not specified during creation, a value of 1800 seconds is used. - /// - long? UpgradeSettingDrainTimeout { get; set; } - /// - /// The maximum number or percentage of nodes that are surged during upgrade. This can either be set to an integer (e.g. '5') - /// or a percentage (e.g. '50%'). If a percentage is specified, it is the percentage of the total agent pool size at the time - /// of the upgrade. For percentages, fractional nodes are rounded up. If not specified during creation, a value of 1 is used. - /// One of MaxSurge and MaxUnavailable must be greater than 0. - /// - string UpgradeSettingMaxSurge { get; set; } - /// - /// The maximum number or percentage of nodes that can be unavailable during upgrade. This can either be set to an integer - /// (e.g. '5') or a percentage (e.g. '50%'). If a percentage is specified, it is the percentage of the total agent pool size - /// at the time of the upgrade. For percentages, fractional nodes are rounded up. If not specified during creation, a value - /// of 0 is used. One of MaxSurge and MaxUnavailable must be greater than 0. - /// - string UpgradeSettingMaxUnavailable { get; set; } - /// - /// The name of the VM SKU that determines the size of resources allocated for node VMs. - /// - string VMSkuName { get; set; } - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/InitialAgentPoolConfiguration.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/InitialAgentPoolConfiguration.json.cs deleted file mode 100644 index 24782027d752..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/InitialAgentPoolConfiguration.json.cs +++ /dev/null @@ -1,155 +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.NetworkCloud.Models.Api20250201 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; - - /// - /// InitialAgentPoolConfiguration specifies the configuration of a pool of virtual machines that are initially defined with - /// a Kubernetes cluster. - /// - public partial class InitialAgentPoolConfiguration - { - - /// - /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object - /// before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The JsonNode that should be deserialized into this object. - - partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json); - - /// - /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The JSON container that the serialization result will be placed in. - - partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container); - - /// - /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of - /// the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the - /// output parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The JsonNode that should be deserialized into this object. - /// Determines if the rest of the deserialization should be processed, or if the method should return - /// instantly. - - partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json, ref bool returnNow); - - /// - /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the - /// object before it is serialized. - /// If you wish to disable the default serialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The JSON container that the serialization result will be placed in. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, ref bool returnNow); - - /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IInitialAgentPoolConfiguration. - /// - /// a to deserialize from. - /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IInitialAgentPoolConfiguration. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IInitialAgentPoolConfiguration FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) - { - return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new InitialAgentPoolConfiguration(json) : null; - } - - /// - /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject into a new instance of . - /// - /// A Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject instance to deserialize from. - internal InitialAgentPoolConfiguration(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) - { - bool returnNow = false; - BeforeFromJson(json, ref returnNow); - if (returnNow) - { - return; - } - {_administratorConfiguration = If( json?.PropertyT("administratorConfiguration"), out var __jsonAdministratorConfiguration) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AdministratorConfiguration.FromJson(__jsonAdministratorConfiguration) : AdministratorConfiguration;} - {_agentOption = If( json?.PropertyT("agentOptions"), out var __jsonAgentOptions) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AgentOptions.FromJson(__jsonAgentOptions) : AgentOption;} - {_attachedNetworkConfiguration = If( json?.PropertyT("attachedNetworkConfiguration"), out var __jsonAttachedNetworkConfiguration) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AttachedNetworkConfiguration.FromJson(__jsonAttachedNetworkConfiguration) : AttachedNetworkConfiguration;} - {_upgradeSetting = If( json?.PropertyT("upgradeSettings"), out var __jsonUpgradeSettings) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AgentPoolUpgradeSettings.FromJson(__jsonUpgradeSettings) : UpgradeSetting;} - {_availabilityZone = If( json?.PropertyT("availabilityZones"), out var __jsonAvailabilityZones) ? If( __jsonAvailabilityZones as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : AvailabilityZone;} - {_count = If( json?.PropertyT("count"), out var __jsonCount) ? (long)__jsonCount : Count;} - {_label = If( json?.PropertyT("labels"), out var __jsonLabels) ? If( __jsonLabels as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IKubernetesLabel) (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.KubernetesLabel.FromJson(__p) )) ))() : null : Label;} - {_mode = If( json?.PropertyT("mode"), out var __jsonMode) ? (string)__jsonMode : (string)Mode;} - {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} - {_taint = If( json?.PropertyT("taints"), out var __jsonTaints) ? If( __jsonTaints as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonArray, out var __l) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__l, (__k)=>(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesLabel) (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.KubernetesLabel.FromJson(__k) )) ))() : null : Taint;} - {_vMSkuName = If( json?.PropertyT("vmSkuName"), out var __jsonVMSkuName) ? (string)__jsonVMSkuName : (string)VMSkuName;} - AfterFromJson(json); - } - - /// - /// Serializes this instance of into a . - /// - /// The container to serialize this object into. If the caller - /// passes in null, a new instance will be created and returned to the caller. - /// Allows the caller to choose the depth of the serialization. See . - /// - /// a serialized instance of as a . - /// - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode) - { - container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject(); - - bool returnNow = false; - BeforeToJson(ref container, ref returnNow); - if (returnNow) - { - return container; - } - AddIf( null != this._administratorConfiguration ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) this._administratorConfiguration.ToJson(null,serializationMode) : null, "administratorConfiguration" ,container.Add ); - AddIf( null != this._agentOption ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) this._agentOption.ToJson(null,serializationMode) : null, "agentOptions" ,container.Add ); - AddIf( null != this._attachedNetworkConfiguration ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) this._attachedNetworkConfiguration.ToJson(null,serializationMode) : null, "attachedNetworkConfiguration" ,container.Add ); - AddIf( null != this._upgradeSetting ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) this._upgradeSetting.ToJson(null,serializationMode) : null, "upgradeSettings" ,container.Add ); - if (null != this._availabilityZone) - { - var __w = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.XNodeArray(); - foreach( var __x in this._availabilityZone ) - { - AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); - } - container.Add("availabilityZones",__w); - } - AddIf( (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNumber(this._count), "count" ,container.Add ); - if (null != this._label) - { - var __r = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.XNodeArray(); - foreach( var __s in this._label ) - { - AddIf(__s?.ToJson(null, serializationMode) ,__r.Add); - } - container.Add("labels",__r); - } - AddIf( null != (((object)this._mode)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._mode.ToString()) : null, "mode" ,container.Add ); - AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); - if (null != this._taint) - { - var __m = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.XNodeArray(); - foreach( var __n in this._taint ) - { - AddIf(__n?.ToJson(null, serializationMode) ,__m.Add); - } - container.Add("taints",__m); - } - AddIf( null != (((object)this._vMSkuName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._vMSkuName.ToString()) : null, "vmSkuName" ,container.Add ); - AfterToJson(ref container); - return container; - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KeySetUser.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KeySetUser.PowerShell.cs deleted file mode 100644 index ee5978a5c815..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KeySetUser.PowerShell.cs +++ /dev/null @@ -1,196 +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.NetworkCloud.Models.Api20250201 -{ - using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; - - /// KeySetUser represents the properties of the user in the key set. - [System.ComponentModel.TypeConverter(typeof(KeySetUserTypeConverter))] - public partial class KeySetUser - { - - /// - /// 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.NetworkCloud.Models.Api20250201.IKeySetUser DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new KeySetUser(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.NetworkCloud.Models.Api20250201.IKeySetUser DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new KeySetUser(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.NetworkCloud.Models.Api20250201.IKeySetUser FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal KeySetUser(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("SshPublicKey")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKeySetUserInternal)this).SshPublicKey = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey) content.GetValueForProperty("SshPublicKey",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKeySetUserInternal)this).SshPublicKey, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.SshPublicKeyTypeConverter.ConvertFrom); - } - if (content.Contains("AzureUserName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKeySetUserInternal)this).AzureUserName = (string) content.GetValueForProperty("AzureUserName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKeySetUserInternal)this).AzureUserName, global::System.Convert.ToString); - } - if (content.Contains("Description")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKeySetUserInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKeySetUserInternal)this).Description, global::System.Convert.ToString); - } - if (content.Contains("UserPrincipalName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKeySetUserInternal)this).UserPrincipalName = (string) content.GetValueForProperty("UserPrincipalName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKeySetUserInternal)this).UserPrincipalName, global::System.Convert.ToString); - } - if (content.Contains("SshPublicKeyData")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKeySetUserInternal)this).SshPublicKeyData = (string) content.GetValueForProperty("SshPublicKeyData",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKeySetUserInternal)this).SshPublicKeyData, 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 KeySetUser(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("SshPublicKey")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKeySetUserInternal)this).SshPublicKey = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey) content.GetValueForProperty("SshPublicKey",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKeySetUserInternal)this).SshPublicKey, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.SshPublicKeyTypeConverter.ConvertFrom); - } - if (content.Contains("AzureUserName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKeySetUserInternal)this).AzureUserName = (string) content.GetValueForProperty("AzureUserName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKeySetUserInternal)this).AzureUserName, global::System.Convert.ToString); - } - if (content.Contains("Description")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKeySetUserInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKeySetUserInternal)this).Description, global::System.Convert.ToString); - } - if (content.Contains("UserPrincipalName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKeySetUserInternal)this).UserPrincipalName = (string) content.GetValueForProperty("UserPrincipalName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKeySetUserInternal)this).UserPrincipalName, global::System.Convert.ToString); - } - if (content.Contains("SshPublicKeyData")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKeySetUserInternal)this).SshPublicKeyData = (string) content.GetValueForProperty("SshPublicKeyData",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKeySetUserInternal)this).SshPublicKeyData, 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.NetworkCloud.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(); - } - } - /// KeySetUser represents the properties of the user in the key set. - [System.ComponentModel.TypeConverter(typeof(KeySetUserTypeConverter))] - public partial interface IKeySetUser - - { - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesCluster.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesCluster.PowerShell.cs deleted file mode 100644 index f7079dec2dcf..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesCluster.PowerShell.cs +++ /dev/null @@ -1,644 +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.NetworkCloud.Models.Api20250201 -{ - using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; - - /// KubernetesCluster represents the Kubernetes cluster hosted on Network Cloud. - [System.ComponentModel.TypeConverter(typeof(KubernetesClusterTypeConverter))] - public partial class KubernetesCluster - { - - /// - /// 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.NetworkCloud.Models.Api20250201.IKubernetesCluster DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new KubernetesCluster(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.NetworkCloud.Models.Api20250201.IKubernetesCluster DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new KubernetesCluster(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.NetworkCloud.Models.Api20250201.IKubernetesCluster FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal KubernetesCluster(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("ExtendedLocation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).ExtendedLocation = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocation) content.GetValueForProperty("ExtendedLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).ExtendedLocation, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ExtendedLocationTypeConverter.ConvertFrom); - } - if (content.Contains("Property")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.KubernetesClusterPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Etag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).Etag, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)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("SystemDataCreatedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataLastModifiedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("SystemData")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.SystemDataTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Type, global::System.Convert.ToString); - } - if (content.Contains("Tag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.TrackedResourceTagsTypeConverter.ConvertFrom); - } - if (content.Contains("Location")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); - } - if (content.Contains("ExtendedLocationName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).ExtendedLocationName = (string) content.GetValueForProperty("ExtendedLocationName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).ExtendedLocationName, global::System.Convert.ToString); - } - if (content.Contains("ExtendedLocationType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).ExtendedLocationType = (string) content.GetValueForProperty("ExtendedLocationType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).ExtendedLocationType, global::System.Convert.ToString); - } - if (content.Contains("AadConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).AadConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAadConfiguration) content.GetValueForProperty("AadConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).AadConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AadConfigurationTypeConverter.ConvertFrom); - } - if (content.Contains("AdministratorConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).AdministratorConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministratorConfiguration) content.GetValueForProperty("AdministratorConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).AdministratorConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AdministratorConfigurationTypeConverter.ConvertFrom); - } - if (content.Contains("NetworkConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).NetworkConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkConfiguration) content.GetValueForProperty("NetworkConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).NetworkConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.NetworkConfigurationTypeConverter.ConvertFrom); - } - if (content.Contains("ControlPlaneNodeConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).ControlPlaneNodeConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IControlPlaneNodeConfiguration) content.GetValueForProperty("ControlPlaneNodeConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).ControlPlaneNodeConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ControlPlaneNodeConfigurationTypeConverter.ConvertFrom); - } - if (content.Contains("ManagedResourceGroupConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).ManagedResourceGroupConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IManagedResourceGroupConfiguration) content.GetValueForProperty("ManagedResourceGroupConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).ManagedResourceGroupConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ManagedResourceGroupConfigurationTypeConverter.ConvertFrom); - } - if (content.Contains("AttachedNetworkId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).AttachedNetworkId = (string[]) content.GetValueForProperty("AttachedNetworkId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).AttachedNetworkId, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("AvailableUpgrade")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).AvailableUpgrade = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAvailableUpgrade[]) content.GetValueForProperty("AvailableUpgrade",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).AvailableUpgrade, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AvailableUpgradeTypeConverter.ConvertFrom)); - } - if (content.Contains("ClusterId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).ClusterId = (string) content.GetValueForProperty("ClusterId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).ClusterId, global::System.Convert.ToString); - } - if (content.Contains("ConnectedClusterId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).ConnectedClusterId = (string) content.GetValueForProperty("ConnectedClusterId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).ConnectedClusterId, global::System.Convert.ToString); - } - if (content.Contains("ControlPlaneKubernetesVersion")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).ControlPlaneKubernetesVersion = (string) content.GetValueForProperty("ControlPlaneKubernetesVersion",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).ControlPlaneKubernetesVersion, global::System.Convert.ToString); - } - if (content.Contains("DetailedStatus")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).DetailedStatus = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterDetailedStatus?) content.GetValueForProperty("DetailedStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).DetailedStatus, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterDetailedStatus.CreateFrom); - } - if (content.Contains("DetailedStatusMessage")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).DetailedStatusMessage = (string) content.GetValueForProperty("DetailedStatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).DetailedStatusMessage, global::System.Convert.ToString); - } - if (content.Contains("FeatureStatuses")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).FeatureStatuses = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IFeatureStatus[]) content.GetValueForProperty("FeatureStatuses",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).FeatureStatuses, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.FeatureStatusTypeConverter.ConvertFrom)); - } - if (content.Contains("InitialAgentPoolConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).InitialAgentPoolConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IInitialAgentPoolConfiguration[]) content.GetValueForProperty("InitialAgentPoolConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).InitialAgentPoolConfiguration, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.InitialAgentPoolConfigurationTypeConverter.ConvertFrom)); - } - if (content.Contains("KubernetesVersion")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).KubernetesVersion = (string) content.GetValueForProperty("KubernetesVersion",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).KubernetesVersion, global::System.Convert.ToString); - } - if (content.Contains("Node")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).Node = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterNode[]) content.GetValueForProperty("Node",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).Node, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.KubernetesClusterNodeTypeConverter.ConvertFrom)); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterProvisioningState.CreateFrom); - } - if (content.Contains("AdminUsername")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).AdminUsername = (string) content.GetValueForProperty("AdminUsername",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).AdminUsername, global::System.Convert.ToString); - } - if (content.Contains("ControlPlaneNodeConfigurationAdministratorConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).ControlPlaneNodeConfigurationAdministratorConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministratorConfiguration) content.GetValueForProperty("ControlPlaneNodeConfigurationAdministratorConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).ControlPlaneNodeConfigurationAdministratorConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AdministratorConfigurationTypeConverter.ConvertFrom); - } - if (content.Contains("ControlPlaneNodeConfigurationAvailabilityZone")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).ControlPlaneNodeConfigurationAvailabilityZone = (string[]) content.GetValueForProperty("ControlPlaneNodeConfigurationAvailabilityZone",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).ControlPlaneNodeConfigurationAvailabilityZone, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("ControlPlaneNodeConfigurationCount")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).ControlPlaneNodeConfigurationCount = (long) content.GetValueForProperty("ControlPlaneNodeConfigurationCount",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).ControlPlaneNodeConfigurationCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("ManagedResourceGroupConfigurationLocation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).ManagedResourceGroupConfigurationLocation = (string) content.GetValueForProperty("ManagedResourceGroupConfigurationLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).ManagedResourceGroupConfigurationLocation, global::System.Convert.ToString); - } - if (content.Contains("ManagedResourceGroupConfigurationName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).ManagedResourceGroupConfigurationName = (string) content.GetValueForProperty("ManagedResourceGroupConfigurationName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).ManagedResourceGroupConfigurationName, global::System.Convert.ToString); - } - if (content.Contains("NetworkConfigurationPodCidr")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).NetworkConfigurationPodCidr = (string[]) content.GetValueForProperty("NetworkConfigurationPodCidr",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).NetworkConfigurationPodCidr, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("NetworkConfigurationServiceCidr")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).NetworkConfigurationServiceCidr = (string[]) content.GetValueForProperty("NetworkConfigurationServiceCidr",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).NetworkConfigurationServiceCidr, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("AadConfigurationAdminGroupObjectId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).AadConfigurationAdminGroupObjectId = (string[]) content.GetValueForProperty("AadConfigurationAdminGroupObjectId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).AadConfigurationAdminGroupObjectId, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("SshPublicKey")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).SshPublicKey = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey[]) content.GetValueForProperty("SshPublicKey",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).SshPublicKey, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.SshPublicKeyTypeConverter.ConvertFrom)); - } - if (content.Contains("ControlPlaneNodeConfigurationVMSkuName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).ControlPlaneNodeConfigurationVMSkuName = (string) content.GetValueForProperty("ControlPlaneNodeConfigurationVMSkuName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).ControlPlaneNodeConfigurationVMSkuName, global::System.Convert.ToString); - } - if (content.Contains("ControlPlaneNodeConfigurationAdministratorConfigurationAdminUsername")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).ControlPlaneNodeConfigurationAdministratorConfigurationAdminUsername = (string) content.GetValueForProperty("ControlPlaneNodeConfigurationAdministratorConfigurationAdminUsername",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).ControlPlaneNodeConfigurationAdministratorConfigurationAdminUsername, global::System.Convert.ToString); - } - if (content.Contains("NetworkConfigurationAttachedNetworkConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).NetworkConfigurationAttachedNetworkConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAttachedNetworkConfiguration) content.GetValueForProperty("NetworkConfigurationAttachedNetworkConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).NetworkConfigurationAttachedNetworkConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AttachedNetworkConfigurationTypeConverter.ConvertFrom); - } - if (content.Contains("NetworkConfigurationBgpServiceLoadBalancerConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).NetworkConfigurationBgpServiceLoadBalancerConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBgpServiceLoadBalancerConfiguration) content.GetValueForProperty("NetworkConfigurationBgpServiceLoadBalancerConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).NetworkConfigurationBgpServiceLoadBalancerConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BgpServiceLoadBalancerConfigurationTypeConverter.ConvertFrom); - } - if (content.Contains("NetworkConfigurationL2ServiceLoadBalancerConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).NetworkConfigurationL2ServiceLoadBalancerConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2ServiceLoadBalancerConfiguration) content.GetValueForProperty("NetworkConfigurationL2ServiceLoadBalancerConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).NetworkConfigurationL2ServiceLoadBalancerConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.L2ServiceLoadBalancerConfigurationTypeConverter.ConvertFrom); - } - if (content.Contains("NetworkConfigurationCloudServicesNetworkId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).NetworkConfigurationCloudServicesNetworkId = (string) content.GetValueForProperty("NetworkConfigurationCloudServicesNetworkId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).NetworkConfigurationCloudServicesNetworkId, global::System.Convert.ToString); - } - if (content.Contains("NetworkConfigurationCniNetworkId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).NetworkConfigurationCniNetworkId = (string) content.GetValueForProperty("NetworkConfigurationCniNetworkId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).NetworkConfigurationCniNetworkId, global::System.Convert.ToString); - } - if (content.Contains("NetworkConfigurationDnsServiceIP")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).NetworkConfigurationDnsServiceIP = (string) content.GetValueForProperty("NetworkConfigurationDnsServiceIP",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).NetworkConfigurationDnsServiceIP, global::System.Convert.ToString); - } - if (content.Contains("AttachedNetworkConfigurationL2Network")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).AttachedNetworkConfigurationL2Network = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkAttachmentConfiguration[]) content.GetValueForProperty("AttachedNetworkConfigurationL2Network",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).AttachedNetworkConfigurationL2Network, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.L2NetworkAttachmentConfigurationTypeConverter.ConvertFrom)); - } - if (content.Contains("AttachedNetworkConfigurationL3Network")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).AttachedNetworkConfigurationL3Network = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkAttachmentConfiguration[]) content.GetValueForProperty("AttachedNetworkConfigurationL3Network",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).AttachedNetworkConfigurationL3Network, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.L3NetworkAttachmentConfigurationTypeConverter.ConvertFrom)); - } - if (content.Contains("AttachedNetworkConfigurationTrunkedNetwork")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).AttachedNetworkConfigurationTrunkedNetwork = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkAttachmentConfiguration[]) content.GetValueForProperty("AttachedNetworkConfigurationTrunkedNetwork",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).AttachedNetworkConfigurationTrunkedNetwork, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.TrunkedNetworkAttachmentConfigurationTypeConverter.ConvertFrom)); - } - if (content.Contains("BgpServiceLoadBalancerConfigurationBgpAdvertisement")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).BgpServiceLoadBalancerConfigurationBgpAdvertisement = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBgpAdvertisement[]) content.GetValueForProperty("BgpServiceLoadBalancerConfigurationBgpAdvertisement",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).BgpServiceLoadBalancerConfigurationBgpAdvertisement, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BgpAdvertisementTypeConverter.ConvertFrom)); - } - if (content.Contains("BgpServiceLoadBalancerConfigurationBgpPeer")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).BgpServiceLoadBalancerConfigurationBgpPeer = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IServiceLoadBalancerBgpPeer[]) content.GetValueForProperty("BgpServiceLoadBalancerConfigurationBgpPeer",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).BgpServiceLoadBalancerConfigurationBgpPeer, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ServiceLoadBalancerBgpPeerTypeConverter.ConvertFrom)); - } - if (content.Contains("ControlPlaneNodeConfigurationAdministratorConfigurationSshPublicKey")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).ControlPlaneNodeConfigurationAdministratorConfigurationSshPublicKey = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey[]) content.GetValueForProperty("ControlPlaneNodeConfigurationAdministratorConfigurationSshPublicKey",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).ControlPlaneNodeConfigurationAdministratorConfigurationSshPublicKey, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.SshPublicKeyTypeConverter.ConvertFrom)); - } - if (content.Contains("BgpServiceLoadBalancerConfigurationFabricPeeringEnabled")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).BgpServiceLoadBalancerConfigurationFabricPeeringEnabled = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.FabricPeeringEnabled?) content.GetValueForProperty("BgpServiceLoadBalancerConfigurationFabricPeeringEnabled",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).BgpServiceLoadBalancerConfigurationFabricPeeringEnabled, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.FabricPeeringEnabled.CreateFrom); - } - if (content.Contains("BgpServiceLoadBalancerConfigurationIPAddressPool")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).BgpServiceLoadBalancerConfigurationIPAddressPool = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIPAddressPool[]) content.GetValueForProperty("BgpServiceLoadBalancerConfigurationIPAddressPool",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).BgpServiceLoadBalancerConfigurationIPAddressPool, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IPAddressPoolTypeConverter.ConvertFrom)); - } - if (content.Contains("L2ServiceLoadBalancerConfigurationIPAddressPool")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).L2ServiceLoadBalancerConfigurationIPAddressPool = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIPAddressPool[]) content.GetValueForProperty("L2ServiceLoadBalancerConfigurationIPAddressPool",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).L2ServiceLoadBalancerConfigurationIPAddressPool, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IPAddressPoolTypeConverter.ConvertFrom)); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal KubernetesCluster(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("ExtendedLocation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).ExtendedLocation = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocation) content.GetValueForProperty("ExtendedLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).ExtendedLocation, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ExtendedLocationTypeConverter.ConvertFrom); - } - if (content.Contains("Property")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.KubernetesClusterPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Etag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).Etag, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)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("SystemDataCreatedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataLastModifiedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("SystemData")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.SystemDataTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Type, global::System.Convert.ToString); - } - if (content.Contains("Tag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.TrackedResourceTagsTypeConverter.ConvertFrom); - } - if (content.Contains("Location")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); - } - if (content.Contains("ExtendedLocationName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).ExtendedLocationName = (string) content.GetValueForProperty("ExtendedLocationName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).ExtendedLocationName, global::System.Convert.ToString); - } - if (content.Contains("ExtendedLocationType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).ExtendedLocationType = (string) content.GetValueForProperty("ExtendedLocationType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).ExtendedLocationType, global::System.Convert.ToString); - } - if (content.Contains("AadConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).AadConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAadConfiguration) content.GetValueForProperty("AadConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).AadConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AadConfigurationTypeConverter.ConvertFrom); - } - if (content.Contains("AdministratorConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).AdministratorConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministratorConfiguration) content.GetValueForProperty("AdministratorConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).AdministratorConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AdministratorConfigurationTypeConverter.ConvertFrom); - } - if (content.Contains("NetworkConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).NetworkConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkConfiguration) content.GetValueForProperty("NetworkConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).NetworkConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.NetworkConfigurationTypeConverter.ConvertFrom); - } - if (content.Contains("ControlPlaneNodeConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).ControlPlaneNodeConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IControlPlaneNodeConfiguration) content.GetValueForProperty("ControlPlaneNodeConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).ControlPlaneNodeConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ControlPlaneNodeConfigurationTypeConverter.ConvertFrom); - } - if (content.Contains("ManagedResourceGroupConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).ManagedResourceGroupConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IManagedResourceGroupConfiguration) content.GetValueForProperty("ManagedResourceGroupConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).ManagedResourceGroupConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ManagedResourceGroupConfigurationTypeConverter.ConvertFrom); - } - if (content.Contains("AttachedNetworkId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).AttachedNetworkId = (string[]) content.GetValueForProperty("AttachedNetworkId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).AttachedNetworkId, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("AvailableUpgrade")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).AvailableUpgrade = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAvailableUpgrade[]) content.GetValueForProperty("AvailableUpgrade",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).AvailableUpgrade, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AvailableUpgradeTypeConverter.ConvertFrom)); - } - if (content.Contains("ClusterId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).ClusterId = (string) content.GetValueForProperty("ClusterId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).ClusterId, global::System.Convert.ToString); - } - if (content.Contains("ConnectedClusterId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).ConnectedClusterId = (string) content.GetValueForProperty("ConnectedClusterId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).ConnectedClusterId, global::System.Convert.ToString); - } - if (content.Contains("ControlPlaneKubernetesVersion")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).ControlPlaneKubernetesVersion = (string) content.GetValueForProperty("ControlPlaneKubernetesVersion",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).ControlPlaneKubernetesVersion, global::System.Convert.ToString); - } - if (content.Contains("DetailedStatus")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).DetailedStatus = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterDetailedStatus?) content.GetValueForProperty("DetailedStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).DetailedStatus, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterDetailedStatus.CreateFrom); - } - if (content.Contains("DetailedStatusMessage")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).DetailedStatusMessage = (string) content.GetValueForProperty("DetailedStatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).DetailedStatusMessage, global::System.Convert.ToString); - } - if (content.Contains("FeatureStatuses")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).FeatureStatuses = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IFeatureStatus[]) content.GetValueForProperty("FeatureStatuses",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).FeatureStatuses, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.FeatureStatusTypeConverter.ConvertFrom)); - } - if (content.Contains("InitialAgentPoolConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).InitialAgentPoolConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IInitialAgentPoolConfiguration[]) content.GetValueForProperty("InitialAgentPoolConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).InitialAgentPoolConfiguration, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.InitialAgentPoolConfigurationTypeConverter.ConvertFrom)); - } - if (content.Contains("KubernetesVersion")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).KubernetesVersion = (string) content.GetValueForProperty("KubernetesVersion",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).KubernetesVersion, global::System.Convert.ToString); - } - if (content.Contains("Node")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).Node = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterNode[]) content.GetValueForProperty("Node",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).Node, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.KubernetesClusterNodeTypeConverter.ConvertFrom)); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterProvisioningState.CreateFrom); - } - if (content.Contains("AdminUsername")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).AdminUsername = (string) content.GetValueForProperty("AdminUsername",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).AdminUsername, global::System.Convert.ToString); - } - if (content.Contains("ControlPlaneNodeConfigurationAdministratorConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).ControlPlaneNodeConfigurationAdministratorConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministratorConfiguration) content.GetValueForProperty("ControlPlaneNodeConfigurationAdministratorConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).ControlPlaneNodeConfigurationAdministratorConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AdministratorConfigurationTypeConverter.ConvertFrom); - } - if (content.Contains("ControlPlaneNodeConfigurationAvailabilityZone")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).ControlPlaneNodeConfigurationAvailabilityZone = (string[]) content.GetValueForProperty("ControlPlaneNodeConfigurationAvailabilityZone",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).ControlPlaneNodeConfigurationAvailabilityZone, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("ControlPlaneNodeConfigurationCount")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).ControlPlaneNodeConfigurationCount = (long) content.GetValueForProperty("ControlPlaneNodeConfigurationCount",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).ControlPlaneNodeConfigurationCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("ManagedResourceGroupConfigurationLocation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).ManagedResourceGroupConfigurationLocation = (string) content.GetValueForProperty("ManagedResourceGroupConfigurationLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).ManagedResourceGroupConfigurationLocation, global::System.Convert.ToString); - } - if (content.Contains("ManagedResourceGroupConfigurationName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).ManagedResourceGroupConfigurationName = (string) content.GetValueForProperty("ManagedResourceGroupConfigurationName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).ManagedResourceGroupConfigurationName, global::System.Convert.ToString); - } - if (content.Contains("NetworkConfigurationPodCidr")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).NetworkConfigurationPodCidr = (string[]) content.GetValueForProperty("NetworkConfigurationPodCidr",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).NetworkConfigurationPodCidr, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("NetworkConfigurationServiceCidr")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).NetworkConfigurationServiceCidr = (string[]) content.GetValueForProperty("NetworkConfigurationServiceCidr",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).NetworkConfigurationServiceCidr, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("AadConfigurationAdminGroupObjectId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).AadConfigurationAdminGroupObjectId = (string[]) content.GetValueForProperty("AadConfigurationAdminGroupObjectId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).AadConfigurationAdminGroupObjectId, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("SshPublicKey")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).SshPublicKey = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey[]) content.GetValueForProperty("SshPublicKey",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).SshPublicKey, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.SshPublicKeyTypeConverter.ConvertFrom)); - } - if (content.Contains("ControlPlaneNodeConfigurationVMSkuName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).ControlPlaneNodeConfigurationVMSkuName = (string) content.GetValueForProperty("ControlPlaneNodeConfigurationVMSkuName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).ControlPlaneNodeConfigurationVMSkuName, global::System.Convert.ToString); - } - if (content.Contains("ControlPlaneNodeConfigurationAdministratorConfigurationAdminUsername")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).ControlPlaneNodeConfigurationAdministratorConfigurationAdminUsername = (string) content.GetValueForProperty("ControlPlaneNodeConfigurationAdministratorConfigurationAdminUsername",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).ControlPlaneNodeConfigurationAdministratorConfigurationAdminUsername, global::System.Convert.ToString); - } - if (content.Contains("NetworkConfigurationAttachedNetworkConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).NetworkConfigurationAttachedNetworkConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAttachedNetworkConfiguration) content.GetValueForProperty("NetworkConfigurationAttachedNetworkConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).NetworkConfigurationAttachedNetworkConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AttachedNetworkConfigurationTypeConverter.ConvertFrom); - } - if (content.Contains("NetworkConfigurationBgpServiceLoadBalancerConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).NetworkConfigurationBgpServiceLoadBalancerConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBgpServiceLoadBalancerConfiguration) content.GetValueForProperty("NetworkConfigurationBgpServiceLoadBalancerConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).NetworkConfigurationBgpServiceLoadBalancerConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BgpServiceLoadBalancerConfigurationTypeConverter.ConvertFrom); - } - if (content.Contains("NetworkConfigurationL2ServiceLoadBalancerConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).NetworkConfigurationL2ServiceLoadBalancerConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2ServiceLoadBalancerConfiguration) content.GetValueForProperty("NetworkConfigurationL2ServiceLoadBalancerConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).NetworkConfigurationL2ServiceLoadBalancerConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.L2ServiceLoadBalancerConfigurationTypeConverter.ConvertFrom); - } - if (content.Contains("NetworkConfigurationCloudServicesNetworkId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).NetworkConfigurationCloudServicesNetworkId = (string) content.GetValueForProperty("NetworkConfigurationCloudServicesNetworkId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).NetworkConfigurationCloudServicesNetworkId, global::System.Convert.ToString); - } - if (content.Contains("NetworkConfigurationCniNetworkId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).NetworkConfigurationCniNetworkId = (string) content.GetValueForProperty("NetworkConfigurationCniNetworkId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).NetworkConfigurationCniNetworkId, global::System.Convert.ToString); - } - if (content.Contains("NetworkConfigurationDnsServiceIP")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).NetworkConfigurationDnsServiceIP = (string) content.GetValueForProperty("NetworkConfigurationDnsServiceIP",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).NetworkConfigurationDnsServiceIP, global::System.Convert.ToString); - } - if (content.Contains("AttachedNetworkConfigurationL2Network")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).AttachedNetworkConfigurationL2Network = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkAttachmentConfiguration[]) content.GetValueForProperty("AttachedNetworkConfigurationL2Network",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).AttachedNetworkConfigurationL2Network, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.L2NetworkAttachmentConfigurationTypeConverter.ConvertFrom)); - } - if (content.Contains("AttachedNetworkConfigurationL3Network")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).AttachedNetworkConfigurationL3Network = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkAttachmentConfiguration[]) content.GetValueForProperty("AttachedNetworkConfigurationL3Network",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).AttachedNetworkConfigurationL3Network, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.L3NetworkAttachmentConfigurationTypeConverter.ConvertFrom)); - } - if (content.Contains("AttachedNetworkConfigurationTrunkedNetwork")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).AttachedNetworkConfigurationTrunkedNetwork = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkAttachmentConfiguration[]) content.GetValueForProperty("AttachedNetworkConfigurationTrunkedNetwork",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).AttachedNetworkConfigurationTrunkedNetwork, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.TrunkedNetworkAttachmentConfigurationTypeConverter.ConvertFrom)); - } - if (content.Contains("BgpServiceLoadBalancerConfigurationBgpAdvertisement")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).BgpServiceLoadBalancerConfigurationBgpAdvertisement = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBgpAdvertisement[]) content.GetValueForProperty("BgpServiceLoadBalancerConfigurationBgpAdvertisement",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).BgpServiceLoadBalancerConfigurationBgpAdvertisement, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BgpAdvertisementTypeConverter.ConvertFrom)); - } - if (content.Contains("BgpServiceLoadBalancerConfigurationBgpPeer")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).BgpServiceLoadBalancerConfigurationBgpPeer = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IServiceLoadBalancerBgpPeer[]) content.GetValueForProperty("BgpServiceLoadBalancerConfigurationBgpPeer",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).BgpServiceLoadBalancerConfigurationBgpPeer, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ServiceLoadBalancerBgpPeerTypeConverter.ConvertFrom)); - } - if (content.Contains("ControlPlaneNodeConfigurationAdministratorConfigurationSshPublicKey")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).ControlPlaneNodeConfigurationAdministratorConfigurationSshPublicKey = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey[]) content.GetValueForProperty("ControlPlaneNodeConfigurationAdministratorConfigurationSshPublicKey",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).ControlPlaneNodeConfigurationAdministratorConfigurationSshPublicKey, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.SshPublicKeyTypeConverter.ConvertFrom)); - } - if (content.Contains("BgpServiceLoadBalancerConfigurationFabricPeeringEnabled")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).BgpServiceLoadBalancerConfigurationFabricPeeringEnabled = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.FabricPeeringEnabled?) content.GetValueForProperty("BgpServiceLoadBalancerConfigurationFabricPeeringEnabled",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).BgpServiceLoadBalancerConfigurationFabricPeeringEnabled, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.FabricPeeringEnabled.CreateFrom); - } - if (content.Contains("BgpServiceLoadBalancerConfigurationIPAddressPool")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).BgpServiceLoadBalancerConfigurationIPAddressPool = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIPAddressPool[]) content.GetValueForProperty("BgpServiceLoadBalancerConfigurationIPAddressPool",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).BgpServiceLoadBalancerConfigurationIPAddressPool, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IPAddressPoolTypeConverter.ConvertFrom)); - } - if (content.Contains("L2ServiceLoadBalancerConfigurationIPAddressPool")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).L2ServiceLoadBalancerConfigurationIPAddressPool = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIPAddressPool[]) content.GetValueForProperty("L2ServiceLoadBalancerConfigurationIPAddressPool",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal)this).L2ServiceLoadBalancerConfigurationIPAddressPool, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IPAddressPoolTypeConverter.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.NetworkCloud.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(); - } - } - /// KubernetesCluster represents the Kubernetes cluster hosted on Network Cloud. - [System.ComponentModel.TypeConverter(typeof(KubernetesClusterTypeConverter))] - public partial interface IKubernetesCluster - - { - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesCluster.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesCluster.cs deleted file mode 100644 index 7afa132586db..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesCluster.cs +++ /dev/null @@ -1,920 +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.NetworkCloud.Models.Api20250201 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; - - /// KubernetesCluster represents the Kubernetes cluster hosted on Network Cloud. - public partial class KubernetesCluster : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesCluster, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IValidates - { - /// - /// Backing field for Inherited model - /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResource __trackedResource = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.TrackedResource(); - - /// - /// The list of Azure Active Directory group object IDs that will have an administrative role on the Kubernetes cluster. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string[] AadConfigurationAdminGroupObjectId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)Property).AadConfigurationAdminGroupObjectId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)Property).AadConfigurationAdminGroupObjectId = value ?? null /* arrayOf */; } - - /// - /// The user name for the administrator that will be applied to the operating systems that run Kubernetes nodes. If not supplied, - /// a user name will be chosen by the service. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string AdminUsername { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)Property).AdminUsername; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)Property).AdminUsername = value ?? null; } - - /// The list of Layer 2 Networks and related configuration for attachment. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkAttachmentConfiguration[] AttachedNetworkConfigurationL2Network { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)Property).AttachedNetworkConfigurationL2Network; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)Property).AttachedNetworkConfigurationL2Network = value ?? null /* arrayOf */; } - - /// The list of Layer 3 Networks and related configuration for attachment. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkAttachmentConfiguration[] AttachedNetworkConfigurationL3Network { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)Property).AttachedNetworkConfigurationL3Network; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)Property).AttachedNetworkConfigurationL3Network = value ?? null /* arrayOf */; } - - /// The list of Trunked Networks and related configuration for attachment. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkAttachmentConfiguration[] AttachedNetworkConfigurationTrunkedNetwork { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)Property).AttachedNetworkConfigurationTrunkedNetwork; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)Property).AttachedNetworkConfigurationTrunkedNetwork = value ?? null /* arrayOf */; } - - /// - /// The full list of network resource IDs that are attached to this cluster, including those attached only to specific agent - /// pools. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string[] AttachedNetworkId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)Property).AttachedNetworkId; } - - /// The list of versions that this Kubernetes cluster can be upgraded to. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAvailableUpgrade[] AvailableUpgrade { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)Property).AvailableUpgrade; } - - /// - /// The association of IP address pools to the communities and peers, allowing for announcement of IPs. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBgpAdvertisement[] BgpServiceLoadBalancerConfigurationBgpAdvertisement { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)Property).BgpServiceLoadBalancerConfigurationBgpAdvertisement; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)Property).BgpServiceLoadBalancerConfigurationBgpAdvertisement = value ?? null /* arrayOf */; } - - /// - /// The list of additional BgpPeer entities that the Kubernetes cluster will peer with. All peering must be explicitly defined. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IServiceLoadBalancerBgpPeer[] BgpServiceLoadBalancerConfigurationBgpPeer { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)Property).BgpServiceLoadBalancerConfigurationBgpPeer; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)Property).BgpServiceLoadBalancerConfigurationBgpPeer = value ?? null /* arrayOf */; } - - /// The indicator to specify if the load balancer peers with the network fabric. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.FabricPeeringEnabled? BgpServiceLoadBalancerConfigurationFabricPeeringEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)Property).BgpServiceLoadBalancerConfigurationFabricPeeringEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)Property).BgpServiceLoadBalancerConfigurationFabricPeeringEnabled = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.FabricPeeringEnabled)""); } - - /// - /// The list of pools of IP addresses that can be allocated to load balancer services. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIPAddressPool[] BgpServiceLoadBalancerConfigurationIPAddressPool { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)Property).BgpServiceLoadBalancerConfigurationIPAddressPool; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)Property).BgpServiceLoadBalancerConfigurationIPAddressPool = value ?? null /* arrayOf */; } - - /// The resource ID of the Network Cloud cluster. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string ClusterId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)Property).ClusterId; } - - /// - /// The resource ID of the connected cluster set up when this Kubernetes cluster is created. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string ConnectedClusterId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)Property).ConnectedClusterId; } - - /// The current running version of Kubernetes on the control plane. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string ControlPlaneKubernetesVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)Property).ControlPlaneKubernetesVersion; } - - /// - /// The user name for the administrator that will be applied to the operating systems that run Kubernetes nodes. If not supplied, - /// a user name will be chosen by the service. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string ControlPlaneNodeConfigurationAdministratorConfigurationAdminUsername { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)Property).ControlPlaneNodeConfigurationAdministratorConfigurationAdminUsername; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)Property).ControlPlaneNodeConfigurationAdministratorConfigurationAdminUsername = value ?? null; } - - /// - /// The SSH configuration for the operating systems that run the nodes in the Kubernetes cluster. In some cases, specification - /// of public keys may be required to produce a working environment. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey[] ControlPlaneNodeConfigurationAdministratorConfigurationSshPublicKey { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)Property).ControlPlaneNodeConfigurationAdministratorConfigurationSshPublicKey; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)Property).ControlPlaneNodeConfigurationAdministratorConfigurationSshPublicKey = value ?? null /* arrayOf */; } - - /// - /// The list of availability zones of the Network Cloud cluster to be used for the provisioning of nodes in the control plane. - /// If not specified, all availability zones will be used. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string[] ControlPlaneNodeConfigurationAvailabilityZone { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)Property).ControlPlaneNodeConfigurationAvailabilityZone; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)Property).ControlPlaneNodeConfigurationAvailabilityZone = value ?? null /* arrayOf */; } - - /// The number of virtual machines that use this configuration. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public long ControlPlaneNodeConfigurationCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)Property).ControlPlaneNodeConfigurationCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)Property).ControlPlaneNodeConfigurationCount = value ; } - - /// The name of the VM SKU supplied during creation. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string ControlPlaneNodeConfigurationVMSkuName { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)Property).ControlPlaneNodeConfigurationVMSkuName; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)Property).ControlPlaneNodeConfigurationVMSkuName = value ; } - - /// The current status of the Kubernetes cluster. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterDetailedStatus? DetailedStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)Property).DetailedStatus; } - - /// The descriptive message about the current detailed status. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string DetailedStatusMessage { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)Property).DetailedStatusMessage; } - - /// Backing field for property. - private string _etag; - - /// Resource ETag. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string Etag { get => this._etag; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocation _extendedLocation; - - /// The extended location of the cluster associated with the resource. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocation ExtendedLocation { get => (this._extendedLocation = this._extendedLocation ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ExtendedLocation()); set => this._extendedLocation = value; } - - /// The resource ID of the extended location on which the resource will be created. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string ExtendedLocationName { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocationInternal)ExtendedLocation).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocationInternal)ExtendedLocation).Name = value ; } - - /// The extended location type, for example, CustomLocation. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string ExtendedLocationType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocationInternal)ExtendedLocation).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocationInternal)ExtendedLocation).Type = value ; } - - /// The current feature settings. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IFeatureStatus[] FeatureStatuses { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)Property).FeatureStatuses; } - - /// - /// Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).Id; } - - /// - /// The agent pools that are created with this Kubernetes cluster for running critical system services and workloads. This - /// data in this field is only used during creation, and the field will be empty following the creation of the Kubernetes - /// Cluster. After creation, the management of agent pools is done using the agentPools sub-resource. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IInitialAgentPoolConfiguration[] InitialAgentPoolConfiguration { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)Property).InitialAgentPoolConfiguration; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)Property).InitialAgentPoolConfiguration = value ; } - - /// The Kubernetes version for this cluster. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string KubernetesVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)Property).KubernetesVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)Property).KubernetesVersion = value ; } - - /// - /// The list of pools of IP addresses that can be allocated to load balancer services. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIPAddressPool[] L2ServiceLoadBalancerConfigurationIPAddressPool { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)Property).L2ServiceLoadBalancerConfigurationIPAddressPool; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)Property).L2ServiceLoadBalancerConfigurationIPAddressPool = value ?? null /* arrayOf */; } - - /// The geo-location where the resource lives - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)__trackedResource).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)__trackedResource).Location = value ; } - - /// - /// The location of the managed resource group. If not specified, the location of the parent resource is chosen. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string ManagedResourceGroupConfigurationLocation { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)Property).ManagedResourceGroupConfigurationLocation; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)Property).ManagedResourceGroupConfigurationLocation = value ?? null; } - - /// - /// The name for the managed resource group. If not specified, the unique name is automatically generated. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string ManagedResourceGroupConfigurationName { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)Property).ManagedResourceGroupConfigurationName; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)Property).ManagedResourceGroupConfigurationName = value ?? null; } - - /// Internal Acessors for AadConfiguration - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAadConfiguration Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal.AadConfiguration { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)Property).AadConfiguration; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)Property).AadConfiguration = value; } - - /// Internal Acessors for AdministratorConfiguration - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministratorConfiguration Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal.AdministratorConfiguration { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)Property).AdministratorConfiguration; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)Property).AdministratorConfiguration = value; } - - /// Internal Acessors for AttachedNetworkId - string[] Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal.AttachedNetworkId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)Property).AttachedNetworkId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)Property).AttachedNetworkId = value; } - - /// Internal Acessors for AvailableUpgrade - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAvailableUpgrade[] Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal.AvailableUpgrade { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)Property).AvailableUpgrade; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)Property).AvailableUpgrade = value; } - - /// Internal Acessors for ClusterId - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal.ClusterId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)Property).ClusterId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)Property).ClusterId = value; } - - /// Internal Acessors for ConnectedClusterId - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal.ConnectedClusterId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)Property).ConnectedClusterId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)Property).ConnectedClusterId = value; } - - /// Internal Acessors for ControlPlaneKubernetesVersion - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal.ControlPlaneKubernetesVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)Property).ControlPlaneKubernetesVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)Property).ControlPlaneKubernetesVersion = value; } - - /// Internal Acessors for ControlPlaneNodeConfiguration - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IControlPlaneNodeConfiguration Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal.ControlPlaneNodeConfiguration { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)Property).ControlPlaneNodeConfiguration; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)Property).ControlPlaneNodeConfiguration = value; } - - /// Internal Acessors for ControlPlaneNodeConfigurationAdministratorConfiguration - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministratorConfiguration Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal.ControlPlaneNodeConfigurationAdministratorConfiguration { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)Property).ControlPlaneNodeConfigurationAdministratorConfiguration; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)Property).ControlPlaneNodeConfigurationAdministratorConfiguration = value; } - - /// Internal Acessors for DetailedStatus - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterDetailedStatus? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal.DetailedStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)Property).DetailedStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)Property).DetailedStatus = value; } - - /// Internal Acessors for DetailedStatusMessage - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal.DetailedStatusMessage { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)Property).DetailedStatusMessage; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)Property).DetailedStatusMessage = value; } - - /// Internal Acessors for Etag - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal.Etag { get => this._etag; set { {_etag = value;} } } - - /// Internal Acessors for ExtendedLocation - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocation Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal.ExtendedLocation { get => (this._extendedLocation = this._extendedLocation ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ExtendedLocation()); set { {_extendedLocation = value;} } } - - /// Internal Acessors for FeatureStatuses - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IFeatureStatus[] Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal.FeatureStatuses { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)Property).FeatureStatuses; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)Property).FeatureStatuses = value; } - - /// Internal Acessors for ManagedResourceGroupConfiguration - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IManagedResourceGroupConfiguration Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal.ManagedResourceGroupConfiguration { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)Property).ManagedResourceGroupConfiguration; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)Property).ManagedResourceGroupConfiguration = value; } - - /// Internal Acessors for NetworkConfiguration - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkConfiguration Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal.NetworkConfiguration { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)Property).NetworkConfiguration; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)Property).NetworkConfiguration = value; } - - /// Internal Acessors for NetworkConfigurationAttachedNetworkConfiguration - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAttachedNetworkConfiguration Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal.NetworkConfigurationAttachedNetworkConfiguration { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)Property).NetworkConfigurationAttachedNetworkConfiguration; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)Property).NetworkConfigurationAttachedNetworkConfiguration = value; } - - /// Internal Acessors for NetworkConfigurationBgpServiceLoadBalancerConfiguration - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBgpServiceLoadBalancerConfiguration Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal.NetworkConfigurationBgpServiceLoadBalancerConfiguration { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)Property).NetworkConfigurationBgpServiceLoadBalancerConfiguration; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)Property).NetworkConfigurationBgpServiceLoadBalancerConfiguration = value; } - - /// Internal Acessors for NetworkConfigurationL2ServiceLoadBalancerConfiguration - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2ServiceLoadBalancerConfiguration Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal.NetworkConfigurationL2ServiceLoadBalancerConfiguration { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)Property).NetworkConfigurationL2ServiceLoadBalancerConfiguration; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)Property).NetworkConfigurationL2ServiceLoadBalancerConfiguration = value; } - - /// Internal Acessors for Node - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterNode[] Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal.Node { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)Property).Node; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)Property).Node = value; } - - /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterProperties Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.KubernetesClusterProperties()); set { {_property = value;} } } - - /// Internal Acessors for ProvisioningState - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterProvisioningState? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)Property).ProvisioningState = value; } - - /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).Id = value; } - - /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).Name = value; } - - /// Internal Acessors for SystemData - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ISystemData Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal.SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemData; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemData = value; } - - /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).Type = value; } - - /// The name of the resource - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).Name; } - - /// The resource ID of the associated Cloud Services network. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string NetworkConfigurationCloudServicesNetworkId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)Property).NetworkConfigurationCloudServicesNetworkId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)Property).NetworkConfigurationCloudServicesNetworkId = value ; } - - /// - /// The resource ID of the Layer 3 network that is used for creation of the Container Networking Interface network. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string NetworkConfigurationCniNetworkId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)Property).NetworkConfigurationCniNetworkId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)Property).NetworkConfigurationCniNetworkId = value ; } - - /// - /// The IP address assigned to the Kubernetes DNS service. It must be within the Kubernetes service address range specified - /// in service CIDR. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string NetworkConfigurationDnsServiceIP { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)Property).NetworkConfigurationDnsServiceIP; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)Property).NetworkConfigurationDnsServiceIP = value ?? null; } - - /// - /// The CIDR notation IP ranges from which to assign pod IPs. One IPv4 CIDR is expected for single-stack networking. Two CIDRs, - /// one for each IP family (IPv4/IPv6), is expected for dual-stack networking. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string[] NetworkConfigurationPodCidr { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)Property).NetworkConfigurationPodCidr; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)Property).NetworkConfigurationPodCidr = value ?? null /* arrayOf */; } - - /// - /// The CIDR notation IP ranges from which to assign service IPs. One IPv4 CIDR is expected for single-stack networking. Two - /// CIDRs, one for each IP family (IPv4/IPv6), is expected for dual-stack networking. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string[] NetworkConfigurationServiceCidr { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)Property).NetworkConfigurationServiceCidr; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)Property).NetworkConfigurationServiceCidr = value ?? null /* arrayOf */; } - - /// The details of the nodes in this cluster. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterNode[] Node { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)Property).Node; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterProperties _property; - - /// The list of the resource properties. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.KubernetesClusterProperties()); set => this._property = value; } - - /// The provisioning state of the Kubernetes cluster resource. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterProvisioningState? ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)Property).ProvisioningState; } - - /// Gets the resource group name - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string ResourceGroupName { get => (new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Success ? new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Groups["resourceGroupName"].Value : null); } - - /// - /// The SSH configuration for the operating systems that run the nodes in the Kubernetes cluster. In some cases, specification - /// of public keys may be required to produce a working environment. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey[] SshPublicKey { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)Property).SshPublicKey; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)Property).SshPublicKey = value ?? null /* arrayOf */; } - - /// - /// Azure Resource Manager metadata containing createdBy and modifiedBy information. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ISystemData SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemData; } - - /// The timestamp of resource creation (UTC). - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataCreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataCreatedAt = value ?? default(global::System.DateTime); } - - /// The identity that created the resource. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataCreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataCreatedBy = value ?? null; } - - /// The type of identity that created the resource. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType? SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataCreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataCreatedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType)""); } - - /// The timestamp of resource last modification (UTC) - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataLastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataLastModifiedAt = value ?? default(global::System.DateTime); } - - /// The identity that last modified the resource. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataLastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataLastModifiedBy = value ?? null; } - - /// The type of identity that last modified the resource. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType? SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataLastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataLastModifiedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType)""); } - - /// Resource tags. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)__trackedResource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.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.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).Type; } - - /// Creates an new instance. - public KubernetesCluster() - { - - } - - /// Validates that this object meets the validation criteria. - /// an instance that will receive validation - /// events. - /// - /// A that will be complete when validation is completed. - /// - public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) - { - await eventListener.AssertNotNull(nameof(__trackedResource), __trackedResource); - await eventListener.AssertObjectIsValid(nameof(__trackedResource), __trackedResource); - } - } - /// KubernetesCluster represents the Kubernetes cluster hosted on Network Cloud. - public partial interface IKubernetesCluster : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResource - { - /// - /// The list of Azure Active Directory group object IDs that will have an administrative role on the Kubernetes cluster. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The list of Azure Active Directory group object IDs that will have an administrative role on the Kubernetes cluster.", - SerializedName = @"adminGroupObjectIds", - PossibleTypes = new [] { typeof(string) })] - string[] AadConfigurationAdminGroupObjectId { get; set; } - /// - /// The user name for the administrator that will be applied to the operating systems that run Kubernetes nodes. If not supplied, - /// a user name will be chosen by the service. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The user name for the administrator that will be applied to the operating systems that run Kubernetes nodes. If not supplied, a user name will be chosen by the service.", - SerializedName = @"adminUsername", - PossibleTypes = new [] { typeof(string) })] - string AdminUsername { get; set; } - /// The list of Layer 2 Networks and related configuration for attachment. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The list of Layer 2 Networks and related configuration for attachment.", - SerializedName = @"l2Networks", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkAttachmentConfiguration) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkAttachmentConfiguration[] AttachedNetworkConfigurationL2Network { get; set; } - /// The list of Layer 3 Networks and related configuration for attachment. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The list of Layer 3 Networks and related configuration for attachment.", - SerializedName = @"l3Networks", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkAttachmentConfiguration) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkAttachmentConfiguration[] AttachedNetworkConfigurationL3Network { get; set; } - /// The list of Trunked Networks and related configuration for attachment. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The list of Trunked Networks and related configuration for attachment.", - SerializedName = @"trunkedNetworks", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkAttachmentConfiguration) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkAttachmentConfiguration[] AttachedNetworkConfigurationTrunkedNetwork { get; set; } - /// - /// The full list of network resource IDs that are attached to this cluster, including those attached only to specific agent - /// pools. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The full list of network resource IDs that are attached to this cluster, including those attached only to specific agent pools.", - SerializedName = @"attachedNetworkIds", - PossibleTypes = new [] { typeof(string) })] - string[] AttachedNetworkId { get; } - /// The list of versions that this Kubernetes cluster can be upgraded to. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The list of versions that this Kubernetes cluster can be upgraded to.", - SerializedName = @"availableUpgrades", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAvailableUpgrade) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAvailableUpgrade[] AvailableUpgrade { get; } - /// - /// The association of IP address pools to the communities and peers, allowing for announcement of IPs. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The association of IP address pools to the communities and peers, allowing for announcement of IPs.", - SerializedName = @"bgpAdvertisements", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBgpAdvertisement) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBgpAdvertisement[] BgpServiceLoadBalancerConfigurationBgpAdvertisement { get; set; } - /// - /// The list of additional BgpPeer entities that the Kubernetes cluster will peer with. All peering must be explicitly defined. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The list of additional BgpPeer entities that the Kubernetes cluster will peer with. All peering must be explicitly defined.", - SerializedName = @"bgpPeers", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IServiceLoadBalancerBgpPeer) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IServiceLoadBalancerBgpPeer[] BgpServiceLoadBalancerConfigurationBgpPeer { get; set; } - /// The indicator to specify if the load balancer peers with the network fabric. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The indicator to specify if the load balancer peers with the network fabric.", - SerializedName = @"fabricPeeringEnabled", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.FabricPeeringEnabled) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.FabricPeeringEnabled? BgpServiceLoadBalancerConfigurationFabricPeeringEnabled { get; set; } - /// - /// The list of pools of IP addresses that can be allocated to load balancer services. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The list of pools of IP addresses that can be allocated to load balancer services.", - SerializedName = @"ipAddressPools", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIPAddressPool) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIPAddressPool[] BgpServiceLoadBalancerConfigurationIPAddressPool { get; set; } - /// The resource ID of the Network Cloud cluster. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The resource ID of the Network Cloud cluster.", - SerializedName = @"clusterId", - PossibleTypes = new [] { typeof(string) })] - string ClusterId { get; } - /// - /// The resource ID of the connected cluster set up when this Kubernetes cluster is created. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The resource ID of the connected cluster set up when this Kubernetes cluster is created.", - SerializedName = @"connectedClusterId", - PossibleTypes = new [] { typeof(string) })] - string ConnectedClusterId { get; } - /// The current running version of Kubernetes on the control plane. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The current running version of Kubernetes on the control plane.", - SerializedName = @"controlPlaneKubernetesVersion", - PossibleTypes = new [] { typeof(string) })] - string ControlPlaneKubernetesVersion { get; } - /// - /// The user name for the administrator that will be applied to the operating systems that run Kubernetes nodes. If not supplied, - /// a user name will be chosen by the service. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The user name for the administrator that will be applied to the operating systems that run Kubernetes nodes. If not supplied, a user name will be chosen by the service.", - SerializedName = @"adminUsername", - PossibleTypes = new [] { typeof(string) })] - string ControlPlaneNodeConfigurationAdministratorConfigurationAdminUsername { get; set; } - /// - /// The SSH configuration for the operating systems that run the nodes in the Kubernetes cluster. In some cases, specification - /// of public keys may be required to produce a working environment. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The SSH configuration for the operating systems that run the nodes in the Kubernetes cluster. In some cases, specification of public keys may be required to produce a working environment.", - SerializedName = @"sshPublicKeys", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey[] ControlPlaneNodeConfigurationAdministratorConfigurationSshPublicKey { get; set; } - /// - /// The list of availability zones of the Network Cloud cluster to be used for the provisioning of nodes in the control plane. - /// If not specified, all availability zones will be used. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The list of availability zones of the Network Cloud cluster to be used for the provisioning of nodes in the control plane. If not specified, all availability zones will be used.", - SerializedName = @"availabilityZones", - PossibleTypes = new [] { typeof(string) })] - string[] ControlPlaneNodeConfigurationAvailabilityZone { get; set; } - /// The number of virtual machines that use this configuration. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The number of virtual machines that use this configuration.", - SerializedName = @"count", - PossibleTypes = new [] { typeof(long) })] - long ControlPlaneNodeConfigurationCount { get; set; } - /// The name of the VM SKU supplied during creation. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The name of the VM SKU supplied during creation.", - SerializedName = @"vmSkuName", - PossibleTypes = new [] { typeof(string) })] - string ControlPlaneNodeConfigurationVMSkuName { get; set; } - /// The current status of the Kubernetes cluster. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The current status of the Kubernetes cluster.", - SerializedName = @"detailedStatus", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterDetailedStatus) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterDetailedStatus? DetailedStatus { get; } - /// The descriptive message about the current detailed status. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The descriptive message about the current detailed status.", - SerializedName = @"detailedStatusMessage", - PossibleTypes = new [] { typeof(string) })] - string DetailedStatusMessage { get; } - /// Resource ETag. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"Resource ETag.", - SerializedName = @"etag", - PossibleTypes = new [] { typeof(string) })] - string Etag { get; } - /// The resource ID of the extended location on which the resource will be created. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The resource ID of the extended location on which the resource will be created.", - SerializedName = @"name", - PossibleTypes = new [] { typeof(string) })] - string ExtendedLocationName { get; set; } - /// The extended location type, for example, CustomLocation. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The extended location type, for example, CustomLocation.", - SerializedName = @"type", - PossibleTypes = new [] { typeof(string) })] - string ExtendedLocationType { get; set; } - /// The current feature settings. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The current feature settings.", - SerializedName = @"featureStatuses", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IFeatureStatus) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IFeatureStatus[] FeatureStatuses { get; } - /// - /// The agent pools that are created with this Kubernetes cluster for running critical system services and workloads. This - /// data in this field is only used during creation, and the field will be empty following the creation of the Kubernetes - /// Cluster. After creation, the management of agent pools is done using the agentPools sub-resource. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The agent pools that are created with this Kubernetes cluster for running critical system services and workloads. This data in this field is only used during creation, and the field will be empty following the creation of the Kubernetes Cluster. After creation, the management of agent pools is done using the agentPools sub-resource.", - SerializedName = @"initialAgentPoolConfigurations", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IInitialAgentPoolConfiguration) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IInitialAgentPoolConfiguration[] InitialAgentPoolConfiguration { get; set; } - /// The Kubernetes version for this cluster. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The Kubernetes version for this cluster.", - SerializedName = @"kubernetesVersion", - PossibleTypes = new [] { typeof(string) })] - string KubernetesVersion { get; set; } - /// - /// The list of pools of IP addresses that can be allocated to load balancer services. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The list of pools of IP addresses that can be allocated to load balancer services.", - SerializedName = @"ipAddressPools", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIPAddressPool) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIPAddressPool[] L2ServiceLoadBalancerConfigurationIPAddressPool { get; set; } - /// - /// The location of the managed resource group. If not specified, the location of the parent resource is chosen. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The location of the managed resource group. If not specified, the location of the parent resource is chosen.", - SerializedName = @"location", - PossibleTypes = new [] { typeof(string) })] - string ManagedResourceGroupConfigurationLocation { get; set; } - /// - /// The name for the managed resource group. If not specified, the unique name is automatically generated. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The name for the managed resource group. If not specified, the unique name is automatically generated.", - SerializedName = @"name", - PossibleTypes = new [] { typeof(string) })] - string ManagedResourceGroupConfigurationName { get; set; } - /// The resource ID of the associated Cloud Services network. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The resource ID of the associated Cloud Services network.", - SerializedName = @"cloudServicesNetworkId", - PossibleTypes = new [] { typeof(string) })] - string NetworkConfigurationCloudServicesNetworkId { get; set; } - /// - /// The resource ID of the Layer 3 network that is used for creation of the Container Networking Interface network. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The resource ID of the Layer 3 network that is used for creation of the Container Networking Interface network.", - SerializedName = @"cniNetworkId", - PossibleTypes = new [] { typeof(string) })] - string NetworkConfigurationCniNetworkId { get; set; } - /// - /// The IP address assigned to the Kubernetes DNS service. It must be within the Kubernetes service address range specified - /// in service CIDR. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The IP address assigned to the Kubernetes DNS service. It must be within the Kubernetes service address range specified in service CIDR.", - SerializedName = @"dnsServiceIp", - PossibleTypes = new [] { typeof(string) })] - string NetworkConfigurationDnsServiceIP { get; set; } - /// - /// The CIDR notation IP ranges from which to assign pod IPs. One IPv4 CIDR is expected for single-stack networking. Two CIDRs, - /// one for each IP family (IPv4/IPv6), is expected for dual-stack networking. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The CIDR notation IP ranges from which to assign pod IPs. One IPv4 CIDR is expected for single-stack networking. Two CIDRs, one for each IP family (IPv4/IPv6), is expected for dual-stack networking.", - SerializedName = @"podCidrs", - PossibleTypes = new [] { typeof(string) })] - string[] NetworkConfigurationPodCidr { get; set; } - /// - /// The CIDR notation IP ranges from which to assign service IPs. One IPv4 CIDR is expected for single-stack networking. Two - /// CIDRs, one for each IP family (IPv4/IPv6), is expected for dual-stack networking. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The CIDR notation IP ranges from which to assign service IPs. One IPv4 CIDR is expected for single-stack networking. Two CIDRs, one for each IP family (IPv4/IPv6), is expected for dual-stack networking.", - SerializedName = @"serviceCidrs", - PossibleTypes = new [] { typeof(string) })] - string[] NetworkConfigurationServiceCidr { get; set; } - /// The details of the nodes in this cluster. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The details of the nodes in this cluster.", - SerializedName = @"nodes", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterNode) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterNode[] Node { get; } - /// The provisioning state of the Kubernetes cluster resource. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The provisioning state of the Kubernetes cluster resource.", - SerializedName = @"provisioningState", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterProvisioningState) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterProvisioningState? ProvisioningState { get; } - /// - /// The SSH configuration for the operating systems that run the nodes in the Kubernetes cluster. In some cases, specification - /// of public keys may be required to produce a working environment. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The SSH configuration for the operating systems that run the nodes in the Kubernetes cluster. In some cases, specification of public keys may be required to produce a working environment.", - SerializedName = @"sshPublicKeys", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey[] SshPublicKey { get; set; } - - } - /// KubernetesCluster represents the Kubernetes cluster hosted on Network Cloud. - internal partial interface IKubernetesClusterInternal : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal - { - /// The Azure Active Directory Integration properties. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAadConfiguration AadConfiguration { get; set; } - /// - /// The list of Azure Active Directory group object IDs that will have an administrative role on the Kubernetes cluster. - /// - string[] AadConfigurationAdminGroupObjectId { get; set; } - /// - /// The user name for the administrator that will be applied to the operating systems that run Kubernetes nodes. If not supplied, - /// a user name will be chosen by the service. - /// - string AdminUsername { get; set; } - /// - /// The administrative credentials that will be applied to the control plane and agent pool nodes that do not specify their - /// own values. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministratorConfiguration AdministratorConfiguration { get; set; } - /// The list of Layer 2 Networks and related configuration for attachment. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkAttachmentConfiguration[] AttachedNetworkConfigurationL2Network { get; set; } - /// The list of Layer 3 Networks and related configuration for attachment. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkAttachmentConfiguration[] AttachedNetworkConfigurationL3Network { get; set; } - /// The list of Trunked Networks and related configuration for attachment. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkAttachmentConfiguration[] AttachedNetworkConfigurationTrunkedNetwork { get; set; } - /// - /// The full list of network resource IDs that are attached to this cluster, including those attached only to specific agent - /// pools. - /// - string[] AttachedNetworkId { get; set; } - /// The list of versions that this Kubernetes cluster can be upgraded to. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAvailableUpgrade[] AvailableUpgrade { get; set; } - /// - /// The association of IP address pools to the communities and peers, allowing for announcement of IPs. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBgpAdvertisement[] BgpServiceLoadBalancerConfigurationBgpAdvertisement { get; set; } - /// - /// The list of additional BgpPeer entities that the Kubernetes cluster will peer with. All peering must be explicitly defined. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IServiceLoadBalancerBgpPeer[] BgpServiceLoadBalancerConfigurationBgpPeer { get; set; } - /// The indicator to specify if the load balancer peers with the network fabric. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.FabricPeeringEnabled? BgpServiceLoadBalancerConfigurationFabricPeeringEnabled { get; set; } - /// - /// The list of pools of IP addresses that can be allocated to load balancer services. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIPAddressPool[] BgpServiceLoadBalancerConfigurationIPAddressPool { get; set; } - /// The resource ID of the Network Cloud cluster. - string ClusterId { get; set; } - /// - /// The resource ID of the connected cluster set up when this Kubernetes cluster is created. - /// - string ConnectedClusterId { get; set; } - /// The current running version of Kubernetes on the control plane. - string ControlPlaneKubernetesVersion { get; set; } - /// The defining characteristics of the control plane for this Kubernetes Cluster. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IControlPlaneNodeConfiguration ControlPlaneNodeConfiguration { get; set; } - /// The administrator credentials to be used for the nodes in the control plane. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministratorConfiguration ControlPlaneNodeConfigurationAdministratorConfiguration { get; set; } - /// - /// The user name for the administrator that will be applied to the operating systems that run Kubernetes nodes. If not supplied, - /// a user name will be chosen by the service. - /// - string ControlPlaneNodeConfigurationAdministratorConfigurationAdminUsername { get; set; } - /// - /// The SSH configuration for the operating systems that run the nodes in the Kubernetes cluster. In some cases, specification - /// of public keys may be required to produce a working environment. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey[] ControlPlaneNodeConfigurationAdministratorConfigurationSshPublicKey { get; set; } - /// - /// The list of availability zones of the Network Cloud cluster to be used for the provisioning of nodes in the control plane. - /// If not specified, all availability zones will be used. - /// - string[] ControlPlaneNodeConfigurationAvailabilityZone { get; set; } - /// The number of virtual machines that use this configuration. - long ControlPlaneNodeConfigurationCount { get; set; } - /// The name of the VM SKU supplied during creation. - string ControlPlaneNodeConfigurationVMSkuName { get; set; } - /// The current status of the Kubernetes cluster. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterDetailedStatus? DetailedStatus { get; set; } - /// The descriptive message about the current detailed status. - string DetailedStatusMessage { get; set; } - /// Resource ETag. - string Etag { get; set; } - /// The extended location of the cluster associated with the resource. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocation ExtendedLocation { get; set; } - /// The resource ID of the extended location on which the resource will be created. - string ExtendedLocationName { get; set; } - /// The extended location type, for example, CustomLocation. - string ExtendedLocationType { get; set; } - /// The current feature settings. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IFeatureStatus[] FeatureStatuses { get; set; } - /// - /// The agent pools that are created with this Kubernetes cluster for running critical system services and workloads. This - /// data in this field is only used during creation, and the field will be empty following the creation of the Kubernetes - /// Cluster. After creation, the management of agent pools is done using the agentPools sub-resource. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IInitialAgentPoolConfiguration[] InitialAgentPoolConfiguration { get; set; } - /// The Kubernetes version for this cluster. - string KubernetesVersion { get; set; } - /// - /// The list of pools of IP addresses that can be allocated to load balancer services. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIPAddressPool[] L2ServiceLoadBalancerConfigurationIPAddressPool { get; set; } - /// The configuration of the managed resource group associated with the resource. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IManagedResourceGroupConfiguration ManagedResourceGroupConfiguration { get; set; } - /// - /// The location of the managed resource group. If not specified, the location of the parent resource is chosen. - /// - string ManagedResourceGroupConfigurationLocation { get; set; } - /// - /// The name for the managed resource group. If not specified, the unique name is automatically generated. - /// - string ManagedResourceGroupConfigurationName { get; set; } - /// - /// The configuration of the Kubernetes cluster networking, including the attachment of networks that span the cluster. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkConfiguration NetworkConfiguration { get; set; } - /// - /// The configuration of networks being attached to the cluster for use by the workloads that run on this Kubernetes cluster. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAttachedNetworkConfiguration NetworkConfigurationAttachedNetworkConfiguration { get; set; } - /// - /// The configuration of the BGP service load balancer for this Kubernetes cluster. A maximum of one service load balancer - /// may be specified, either Layer 2 or BGP. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBgpServiceLoadBalancerConfiguration NetworkConfigurationBgpServiceLoadBalancerConfiguration { get; set; } - /// The resource ID of the associated Cloud Services network. - string NetworkConfigurationCloudServicesNetworkId { get; set; } - /// - /// The resource ID of the Layer 3 network that is used for creation of the Container Networking Interface network. - /// - string NetworkConfigurationCniNetworkId { get; set; } - /// - /// The IP address assigned to the Kubernetes DNS service. It must be within the Kubernetes service address range specified - /// in service CIDR. - /// - string NetworkConfigurationDnsServiceIP { get; set; } - /// - /// The configuration of the Layer 2 service load balancer for this Kubernetes cluster. A maximum of one service load balancer - /// may be specified, either Layer 2 or BGP. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2ServiceLoadBalancerConfiguration NetworkConfigurationL2ServiceLoadBalancerConfiguration { get; set; } - /// - /// The CIDR notation IP ranges from which to assign pod IPs. One IPv4 CIDR is expected for single-stack networking. Two CIDRs, - /// one for each IP family (IPv4/IPv6), is expected for dual-stack networking. - /// - string[] NetworkConfigurationPodCidr { get; set; } - /// - /// The CIDR notation IP ranges from which to assign service IPs. One IPv4 CIDR is expected for single-stack networking. Two - /// CIDRs, one for each IP family (IPv4/IPv6), is expected for dual-stack networking. - /// - string[] NetworkConfigurationServiceCidr { get; set; } - /// The details of the nodes in this cluster. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterNode[] Node { get; set; } - /// The list of the resource properties. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterProperties Property { get; set; } - /// The provisioning state of the Kubernetes cluster resource. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterProvisioningState? ProvisioningState { get; set; } - /// - /// The SSH configuration for the operating systems that run the nodes in the Kubernetes cluster. In some cases, specification - /// of public keys may be required to produce a working environment. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey[] SshPublicKey { get; set; } - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesClusterFeature.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesClusterFeature.PowerShell.cs deleted file mode 100644 index 2b11865570c1..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesClusterFeature.PowerShell.cs +++ /dev/null @@ -1,326 +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.NetworkCloud.Models.Api20250201 -{ - using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; - - /// KubernetesClusterFeature represents the feature of a Kubernetes cluster. - [System.ComponentModel.TypeConverter(typeof(KubernetesClusterFeatureTypeConverter))] - public partial class KubernetesClusterFeature - { - - /// - /// 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.NetworkCloud.Models.Api20250201.IKubernetesClusterFeature DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new KubernetesClusterFeature(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.NetworkCloud.Models.Api20250201.IKubernetesClusterFeature DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new KubernetesClusterFeature(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.NetworkCloud.Models.Api20250201.IKubernetesClusterFeature FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal KubernetesClusterFeature(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.NetworkCloud.Models.Api20250201.IKubernetesClusterFeatureInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeatureProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeatureInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.KubernetesClusterFeaturePropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Etag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeatureInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeatureInternal)this).Etag, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)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("SystemDataCreatedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataLastModifiedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("SystemData")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.SystemDataTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Type, global::System.Convert.ToString); - } - if (content.Contains("Tag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.TrackedResourceTagsTypeConverter.ConvertFrom); - } - if (content.Contains("Location")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); - } - if (content.Contains("AvailabilityLifecycle")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeatureInternal)this).AvailabilityLifecycle = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterFeatureAvailabilityLifecycle?) content.GetValueForProperty("AvailabilityLifecycle",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeatureInternal)this).AvailabilityLifecycle, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterFeatureAvailabilityLifecycle.CreateFrom); - } - if (content.Contains("DetailedStatus")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeatureInternal)this).DetailedStatus = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterFeatureDetailedStatus?) content.GetValueForProperty("DetailedStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeatureInternal)this).DetailedStatus, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterFeatureDetailedStatus.CreateFrom); - } - if (content.Contains("DetailedStatusMessage")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeatureInternal)this).DetailedStatusMessage = (string) content.GetValueForProperty("DetailedStatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeatureInternal)this).DetailedStatusMessage, global::System.Convert.ToString); - } - if (content.Contains("Option")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeatureInternal)this).Option = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStringKeyValuePair[]) content.GetValueForProperty("Option",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeatureInternal)this).Option, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.StringKeyValuePairTypeConverter.ConvertFrom)); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeatureInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterFeatureProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeatureInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterFeatureProvisioningState.CreateFrom); - } - if (content.Contains("Required")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeatureInternal)this).Required = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterFeatureRequired?) content.GetValueForProperty("Required",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeatureInternal)this).Required, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterFeatureRequired.CreateFrom); - } - if (content.Contains("Version")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeatureInternal)this).Version = (string) content.GetValueForProperty("Version",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeatureInternal)this).Version, 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 KubernetesClusterFeature(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.NetworkCloud.Models.Api20250201.IKubernetesClusterFeatureInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeatureProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeatureInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.KubernetesClusterFeaturePropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Etag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeatureInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeatureInternal)this).Etag, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)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("SystemDataCreatedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataLastModifiedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("SystemData")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.SystemDataTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Type, global::System.Convert.ToString); - } - if (content.Contains("Tag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.TrackedResourceTagsTypeConverter.ConvertFrom); - } - if (content.Contains("Location")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); - } - if (content.Contains("AvailabilityLifecycle")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeatureInternal)this).AvailabilityLifecycle = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterFeatureAvailabilityLifecycle?) content.GetValueForProperty("AvailabilityLifecycle",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeatureInternal)this).AvailabilityLifecycle, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterFeatureAvailabilityLifecycle.CreateFrom); - } - if (content.Contains("DetailedStatus")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeatureInternal)this).DetailedStatus = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterFeatureDetailedStatus?) content.GetValueForProperty("DetailedStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeatureInternal)this).DetailedStatus, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterFeatureDetailedStatus.CreateFrom); - } - if (content.Contains("DetailedStatusMessage")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeatureInternal)this).DetailedStatusMessage = (string) content.GetValueForProperty("DetailedStatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeatureInternal)this).DetailedStatusMessage, global::System.Convert.ToString); - } - if (content.Contains("Option")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeatureInternal)this).Option = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStringKeyValuePair[]) content.GetValueForProperty("Option",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeatureInternal)this).Option, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.StringKeyValuePairTypeConverter.ConvertFrom)); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeatureInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterFeatureProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeatureInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterFeatureProvisioningState.CreateFrom); - } - if (content.Contains("Required")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeatureInternal)this).Required = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterFeatureRequired?) content.GetValueForProperty("Required",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeatureInternal)this).Required, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterFeatureRequired.CreateFrom); - } - if (content.Contains("Version")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeatureInternal)this).Version = (string) content.GetValueForProperty("Version",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeatureInternal)this).Version, 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.NetworkCloud.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(); - } - } - /// KubernetesClusterFeature represents the feature of a Kubernetes cluster. - [System.ComponentModel.TypeConverter(typeof(KubernetesClusterFeatureTypeConverter))] - public partial interface IKubernetesClusterFeature - - { - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesClusterFeature.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesClusterFeature.cs deleted file mode 100644 index bd95580e375c..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesClusterFeature.cs +++ /dev/null @@ -1,280 +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.NetworkCloud.Models.Api20250201 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; - - /// KubernetesClusterFeature represents the feature of a Kubernetes cluster. - public partial class KubernetesClusterFeature : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeature, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeatureInternal, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IValidates - { - /// - /// Backing field for Inherited model - /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResource __trackedResource = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.TrackedResource(); - - /// The lifecycle indicator of the feature. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterFeatureAvailabilityLifecycle? AvailabilityLifecycle { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeaturePropertiesInternal)Property).AvailabilityLifecycle; } - - /// The detailed status of the feature. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterFeatureDetailedStatus? DetailedStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeaturePropertiesInternal)Property).DetailedStatus; } - - /// The descriptive message for the detailed status of the feature. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string DetailedStatusMessage { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeaturePropertiesInternal)Property).DetailedStatusMessage; } - - /// Backing field for property. - private string _etag; - - /// Resource ETag. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string Etag { get => this._etag; } - - /// - /// Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).Id; } - - /// The geo-location where the resource lives - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)__trackedResource).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)__trackedResource).Location = value ; } - - /// Internal Acessors for AvailabilityLifecycle - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterFeatureAvailabilityLifecycle? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeatureInternal.AvailabilityLifecycle { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeaturePropertiesInternal)Property).AvailabilityLifecycle; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeaturePropertiesInternal)Property).AvailabilityLifecycle = value; } - - /// Internal Acessors for DetailedStatus - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterFeatureDetailedStatus? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeatureInternal.DetailedStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeaturePropertiesInternal)Property).DetailedStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeaturePropertiesInternal)Property).DetailedStatus = value; } - - /// Internal Acessors for DetailedStatusMessage - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeatureInternal.DetailedStatusMessage { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeaturePropertiesInternal)Property).DetailedStatusMessage; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeaturePropertiesInternal)Property).DetailedStatusMessage = value; } - - /// Internal Acessors for Etag - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeatureInternal.Etag { get => this._etag; set { {_etag = value;} } } - - /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeatureProperties Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeatureInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.KubernetesClusterFeatureProperties()); set { {_property = value;} } } - - /// Internal Acessors for ProvisioningState - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterFeatureProvisioningState? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeatureInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeaturePropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeaturePropertiesInternal)Property).ProvisioningState = value; } - - /// Internal Acessors for Required - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterFeatureRequired? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeatureInternal.Required { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeaturePropertiesInternal)Property).Required; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeaturePropertiesInternal)Property).Required = value; } - - /// Internal Acessors for Version - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeatureInternal.Version { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeaturePropertiesInternal)Property).Version; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeaturePropertiesInternal)Property).Version = value; } - - /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).Id = value; } - - /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).Name = value; } - - /// Internal Acessors for SystemData - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ISystemData Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal.SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemData; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemData = value; } - - /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).Type = value; } - - /// The name of the resource - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).Name; } - - /// The configured options for the feature. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStringKeyValuePair[] Option { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeaturePropertiesInternal)Property).Option; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeaturePropertiesInternal)Property).Option = value ?? null /* arrayOf */; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeatureProperties _property; - - /// The list of the resource properties. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeatureProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.KubernetesClusterFeatureProperties()); set => this._property = value; } - - /// The provisioning state of the Kubernetes cluster feature. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterFeatureProvisioningState? ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeaturePropertiesInternal)Property).ProvisioningState; } - - /// - /// The indicator of if the feature is required or optional. Optional features may be deleted by the user, while required - /// features are managed with the kubernetes cluster lifecycle. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterFeatureRequired? Required { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeaturePropertiesInternal)Property).Required; } - - /// Gets the resource group name - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string ResourceGroupName { get => (new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Success ? new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Groups["resourceGroupName"].Value : null); } - - /// - /// Azure Resource Manager metadata containing createdBy and modifiedBy information. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ISystemData SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemData; } - - /// The timestamp of resource creation (UTC). - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataCreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataCreatedAt = value ?? default(global::System.DateTime); } - - /// The identity that created the resource. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataCreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataCreatedBy = value ?? null; } - - /// The type of identity that created the resource. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType? SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataCreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataCreatedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType)""); } - - /// The timestamp of resource last modification (UTC) - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataLastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataLastModifiedAt = value ?? default(global::System.DateTime); } - - /// The identity that last modified the resource. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataLastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataLastModifiedBy = value ?? null; } - - /// The type of identity that last modified the resource. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType? SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataLastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataLastModifiedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType)""); } - - /// Resource tags. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)__trackedResource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.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.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).Type; } - - /// The version of the feature. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string Version { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeaturePropertiesInternal)Property).Version; } - - /// Creates an new instance. - public KubernetesClusterFeature() - { - - } - - /// Validates that this object meets the validation criteria. - /// an instance that will receive validation - /// events. - /// - /// A that will be complete when validation is completed. - /// - public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) - { - await eventListener.AssertNotNull(nameof(__trackedResource), __trackedResource); - await eventListener.AssertObjectIsValid(nameof(__trackedResource), __trackedResource); - } - } - /// KubernetesClusterFeature represents the feature of a Kubernetes cluster. - public partial interface IKubernetesClusterFeature : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResource - { - /// The lifecycle indicator of the feature. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The lifecycle indicator of the feature.", - SerializedName = @"availabilityLifecycle", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterFeatureAvailabilityLifecycle) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterFeatureAvailabilityLifecycle? AvailabilityLifecycle { get; } - /// The detailed status of the feature. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The detailed status of the feature.", - SerializedName = @"detailedStatus", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterFeatureDetailedStatus) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterFeatureDetailedStatus? DetailedStatus { get; } - /// The descriptive message for the detailed status of the feature. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The descriptive message for the detailed status of the feature.", - SerializedName = @"detailedStatusMessage", - PossibleTypes = new [] { typeof(string) })] - string DetailedStatusMessage { get; } - /// Resource ETag. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"Resource ETag.", - SerializedName = @"etag", - PossibleTypes = new [] { typeof(string) })] - string Etag { get; } - /// The configured options for the feature. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The configured options for the feature.", - SerializedName = @"options", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStringKeyValuePair) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStringKeyValuePair[] Option { get; set; } - /// The provisioning state of the Kubernetes cluster feature. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The provisioning state of the Kubernetes cluster feature.", - SerializedName = @"provisioningState", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterFeatureProvisioningState) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterFeatureProvisioningState? ProvisioningState { get; } - /// - /// The indicator of if the feature is required or optional. Optional features may be deleted by the user, while required - /// features are managed with the kubernetes cluster lifecycle. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The indicator of if the feature is required or optional. Optional features may be deleted by the user, while required features are managed with the kubernetes cluster lifecycle.", - SerializedName = @"required", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterFeatureRequired) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterFeatureRequired? Required { get; } - /// The version of the feature. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The version of the feature.", - SerializedName = @"version", - PossibleTypes = new [] { typeof(string) })] - string Version { get; } - - } - /// KubernetesClusterFeature represents the feature of a Kubernetes cluster. - internal partial interface IKubernetesClusterFeatureInternal : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal - { - /// The lifecycle indicator of the feature. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterFeatureAvailabilityLifecycle? AvailabilityLifecycle { get; set; } - /// The detailed status of the feature. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterFeatureDetailedStatus? DetailedStatus { get; set; } - /// The descriptive message for the detailed status of the feature. - string DetailedStatusMessage { get; set; } - /// Resource ETag. - string Etag { get; set; } - /// The configured options for the feature. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStringKeyValuePair[] Option { get; set; } - /// The list of the resource properties. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeatureProperties Property { get; set; } - /// The provisioning state of the Kubernetes cluster feature. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterFeatureProvisioningState? ProvisioningState { get; set; } - /// - /// The indicator of if the feature is required or optional. Optional features may be deleted by the user, while required - /// features are managed with the kubernetes cluster lifecycle. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterFeatureRequired? Required { get; set; } - /// The version of the feature. - string Version { get; set; } - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesClusterFeatureList.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesClusterFeatureList.cs deleted file mode 100644 index 66102e609af1..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesClusterFeatureList.cs +++ /dev/null @@ -1,70 +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.NetworkCloud.Models.Api20250201 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; - - /// - /// KubernetesClusterFeatureList represents the list of Kubernetes cluster feature resources. - /// - public partial class KubernetesClusterFeatureList : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeatureList, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeatureListInternal - { - - /// Backing field for property. - private string _nextLink; - - /// The link used to get the next page of operations. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string NextLink { get => this._nextLink; set => this._nextLink = value; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeature[] _value; - - /// The list of Kubernetes cluster features. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeature[] Value { get => this._value; set => this._value = value; } - - /// Creates an new instance. - public KubernetesClusterFeatureList() - { - - } - } - /// KubernetesClusterFeatureList represents the list of Kubernetes cluster feature resources. - public partial interface IKubernetesClusterFeatureList : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable - { - /// The link used to get the next page of operations. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The link used to get the next page of operations.", - SerializedName = @"nextLink", - PossibleTypes = new [] { typeof(string) })] - string NextLink { get; set; } - /// The list of Kubernetes cluster features. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The list of Kubernetes cluster features.", - SerializedName = @"value", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeature) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeature[] Value { get; set; } - - } - /// KubernetesClusterFeatureList represents the list of Kubernetes cluster feature resources. - internal partial interface IKubernetesClusterFeatureListInternal - - { - /// The link used to get the next page of operations. - string NextLink { get; set; } - /// The list of Kubernetes cluster features. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeature[] Value { get; set; } - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesClusterFeaturePatchParameters.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesClusterFeaturePatchParameters.PowerShell.cs deleted file mode 100644 index 6b3fafc03978..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesClusterFeaturePatchParameters.PowerShell.cs +++ /dev/null @@ -1,187 +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.NetworkCloud.Models.Api20250201 -{ - using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; - - /// - /// KubernetesClusterFeaturePatchParameters represents the body of the request to patch the Kubernetes cluster feature. - /// - [System.ComponentModel.TypeConverter(typeof(KubernetesClusterFeaturePatchParametersTypeConverter))] - public partial class KubernetesClusterFeaturePatchParameters - { - - /// - /// 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.NetworkCloud.Models.Api20250201.IKubernetesClusterFeaturePatchParameters DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new KubernetesClusterFeaturePatchParameters(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.NetworkCloud.Models.Api20250201.IKubernetesClusterFeaturePatchParameters DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new KubernetesClusterFeaturePatchParameters(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.NetworkCloud.Models.Api20250201.IKubernetesClusterFeaturePatchParameters FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal KubernetesClusterFeaturePatchParameters(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.NetworkCloud.Models.Api20250201.IKubernetesClusterFeaturePatchParametersInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeaturePatchProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeaturePatchParametersInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.KubernetesClusterFeaturePatchPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Tag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeaturePatchParametersInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeaturePatchParametersTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeaturePatchParametersInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.KubernetesClusterFeaturePatchParametersTagsTypeConverter.ConvertFrom); - } - if (content.Contains("Option")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeaturePatchParametersInternal)this).Option = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStringKeyValuePair[]) content.GetValueForProperty("Option",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeaturePatchParametersInternal)this).Option, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.StringKeyValuePairTypeConverter.ConvertFrom)); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal KubernetesClusterFeaturePatchParameters(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.NetworkCloud.Models.Api20250201.IKubernetesClusterFeaturePatchParametersInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeaturePatchProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeaturePatchParametersInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.KubernetesClusterFeaturePatchPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Tag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeaturePatchParametersInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeaturePatchParametersTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeaturePatchParametersInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.KubernetesClusterFeaturePatchParametersTagsTypeConverter.ConvertFrom); - } - if (content.Contains("Option")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeaturePatchParametersInternal)this).Option = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStringKeyValuePair[]) content.GetValueForProperty("Option",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeaturePatchParametersInternal)this).Option, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.StringKeyValuePairTypeConverter.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.NetworkCloud.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(); - } - } - /// KubernetesClusterFeaturePatchParameters represents the body of the request to patch the Kubernetes cluster feature. - [System.ComponentModel.TypeConverter(typeof(KubernetesClusterFeaturePatchParametersTypeConverter))] - public partial interface IKubernetesClusterFeaturePatchParameters - - { - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesClusterFeaturePatchParameters.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesClusterFeaturePatchParameters.cs deleted file mode 100644 index 76458b066e11..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesClusterFeaturePatchParameters.cs +++ /dev/null @@ -1,79 +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.NetworkCloud.Models.Api20250201 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; - - /// - /// KubernetesClusterFeaturePatchParameters represents the body of the request to patch the Kubernetes cluster feature. - /// - public partial class KubernetesClusterFeaturePatchParameters : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeaturePatchParameters, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeaturePatchParametersInternal - { - - /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeaturePatchProperties Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeaturePatchParametersInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.KubernetesClusterFeaturePatchProperties()); set { {_property = value;} } } - - /// The configured options for the feature. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStringKeyValuePair[] Option { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeaturePatchPropertiesInternal)Property).Option; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeaturePatchPropertiesInternal)Property).Option = value ?? null /* arrayOf */; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeaturePatchProperties _property; - - /// The list of the resource properties. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeaturePatchProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.KubernetesClusterFeaturePatchProperties()); set => this._property = value; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeaturePatchParametersTags _tag; - - /// The Azure resource tags that will replace the existing ones. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeaturePatchParametersTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.KubernetesClusterFeaturePatchParametersTags()); set => this._tag = value; } - - /// Creates an new instance. - public KubernetesClusterFeaturePatchParameters() - { - - } - } - /// KubernetesClusterFeaturePatchParameters represents the body of the request to patch the Kubernetes cluster feature. - public partial interface IKubernetesClusterFeaturePatchParameters : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable - { - /// The configured options for the feature. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The configured options for the feature.", - SerializedName = @"options", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStringKeyValuePair) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStringKeyValuePair[] Option { get; set; } - /// The Azure resource tags that will replace the existing ones. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The Azure resource tags that will replace the existing ones.", - SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeaturePatchParametersTags) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeaturePatchParametersTags Tag { get; set; } - - } - /// KubernetesClusterFeaturePatchParameters represents the body of the request to patch the Kubernetes cluster feature. - internal partial interface IKubernetesClusterFeaturePatchParametersInternal - - { - /// The configured options for the feature. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStringKeyValuePair[] Option { get; set; } - /// The list of the resource properties. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeaturePatchProperties Property { get; set; } - /// The Azure resource tags that will replace the existing ones. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeaturePatchParametersTags Tag { get; set; } - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesClusterFeaturePatchProperties.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesClusterFeaturePatchProperties.cs deleted file mode 100644 index 6d0fc0367e7d..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesClusterFeaturePatchProperties.cs +++ /dev/null @@ -1,53 +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.NetworkCloud.Models.Api20250201 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; - - /// - /// KubernetesClusterFeaturePatchProperties represents the Kubernetes cluster feature properties for patching. - /// - public partial class KubernetesClusterFeaturePatchProperties : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeaturePatchProperties, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeaturePatchPropertiesInternal - { - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStringKeyValuePair[] _option; - - /// The configured options for the feature. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStringKeyValuePair[] Option { get => this._option; set => this._option = value; } - - /// Creates an new instance. - public KubernetesClusterFeaturePatchProperties() - { - - } - } - /// KubernetesClusterFeaturePatchProperties represents the Kubernetes cluster feature properties for patching. - public partial interface IKubernetesClusterFeaturePatchProperties : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable - { - /// The configured options for the feature. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The configured options for the feature.", - SerializedName = @"options", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStringKeyValuePair) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStringKeyValuePair[] Option { get; set; } - - } - /// KubernetesClusterFeaturePatchProperties represents the Kubernetes cluster feature properties for patching. - internal partial interface IKubernetesClusterFeaturePatchPropertiesInternal - - { - /// The configured options for the feature. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStringKeyValuePair[] Option { get; set; } - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesClusterFeatureProperties.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesClusterFeatureProperties.PowerShell.cs deleted file mode 100644 index 5fc4e2493013..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesClusterFeatureProperties.PowerShell.cs +++ /dev/null @@ -1,218 +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.NetworkCloud.Models.Api20250201 -{ - using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; - - /// - /// KubernetesClusterFeatureProperties represents the properties of a Kubernetes cluster feature. - /// - [System.ComponentModel.TypeConverter(typeof(KubernetesClusterFeaturePropertiesTypeConverter))] - public partial class KubernetesClusterFeatureProperties - { - - /// - /// 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.NetworkCloud.Models.Api20250201.IKubernetesClusterFeatureProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new KubernetesClusterFeatureProperties(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.NetworkCloud.Models.Api20250201.IKubernetesClusterFeatureProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new KubernetesClusterFeatureProperties(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.NetworkCloud.Models.Api20250201.IKubernetesClusterFeatureProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal KubernetesClusterFeatureProperties(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("AvailabilityLifecycle")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeaturePropertiesInternal)this).AvailabilityLifecycle = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterFeatureAvailabilityLifecycle?) content.GetValueForProperty("AvailabilityLifecycle",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeaturePropertiesInternal)this).AvailabilityLifecycle, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterFeatureAvailabilityLifecycle.CreateFrom); - } - if (content.Contains("DetailedStatus")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeaturePropertiesInternal)this).DetailedStatus = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterFeatureDetailedStatus?) content.GetValueForProperty("DetailedStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeaturePropertiesInternal)this).DetailedStatus, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterFeatureDetailedStatus.CreateFrom); - } - if (content.Contains("DetailedStatusMessage")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeaturePropertiesInternal)this).DetailedStatusMessage = (string) content.GetValueForProperty("DetailedStatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeaturePropertiesInternal)this).DetailedStatusMessage, global::System.Convert.ToString); - } - if (content.Contains("Option")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeaturePropertiesInternal)this).Option = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStringKeyValuePair[]) content.GetValueForProperty("Option",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeaturePropertiesInternal)this).Option, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.StringKeyValuePairTypeConverter.ConvertFrom)); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeaturePropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterFeatureProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeaturePropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterFeatureProvisioningState.CreateFrom); - } - if (content.Contains("Required")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeaturePropertiesInternal)this).Required = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterFeatureRequired?) content.GetValueForProperty("Required",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeaturePropertiesInternal)this).Required, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterFeatureRequired.CreateFrom); - } - if (content.Contains("Version")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeaturePropertiesInternal)this).Version = (string) content.GetValueForProperty("Version",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeaturePropertiesInternal)this).Version, 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 KubernetesClusterFeatureProperties(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("AvailabilityLifecycle")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeaturePropertiesInternal)this).AvailabilityLifecycle = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterFeatureAvailabilityLifecycle?) content.GetValueForProperty("AvailabilityLifecycle",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeaturePropertiesInternal)this).AvailabilityLifecycle, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterFeatureAvailabilityLifecycle.CreateFrom); - } - if (content.Contains("DetailedStatus")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeaturePropertiesInternal)this).DetailedStatus = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterFeatureDetailedStatus?) content.GetValueForProperty("DetailedStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeaturePropertiesInternal)this).DetailedStatus, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterFeatureDetailedStatus.CreateFrom); - } - if (content.Contains("DetailedStatusMessage")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeaturePropertiesInternal)this).DetailedStatusMessage = (string) content.GetValueForProperty("DetailedStatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeaturePropertiesInternal)this).DetailedStatusMessage, global::System.Convert.ToString); - } - if (content.Contains("Option")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeaturePropertiesInternal)this).Option = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStringKeyValuePair[]) content.GetValueForProperty("Option",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeaturePropertiesInternal)this).Option, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.StringKeyValuePairTypeConverter.ConvertFrom)); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeaturePropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterFeatureProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeaturePropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterFeatureProvisioningState.CreateFrom); - } - if (content.Contains("Required")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeaturePropertiesInternal)this).Required = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterFeatureRequired?) content.GetValueForProperty("Required",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeaturePropertiesInternal)this).Required, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterFeatureRequired.CreateFrom); - } - if (content.Contains("Version")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeaturePropertiesInternal)this).Version = (string) content.GetValueForProperty("Version",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeaturePropertiesInternal)this).Version, 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.NetworkCloud.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(); - } - } - /// KubernetesClusterFeatureProperties represents the properties of a Kubernetes cluster feature. - [System.ComponentModel.TypeConverter(typeof(KubernetesClusterFeaturePropertiesTypeConverter))] - public partial interface IKubernetesClusterFeatureProperties - - { - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesClusterFeatureProperties.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesClusterFeatureProperties.cs deleted file mode 100644 index 5640f9b3853a..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesClusterFeatureProperties.cs +++ /dev/null @@ -1,182 +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.NetworkCloud.Models.Api20250201 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; - - /// - /// KubernetesClusterFeatureProperties represents the properties of a Kubernetes cluster feature. - /// - public partial class KubernetesClusterFeatureProperties : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeatureProperties, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeaturePropertiesInternal - { - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterFeatureAvailabilityLifecycle? _availabilityLifecycle; - - /// The lifecycle indicator of the feature. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterFeatureAvailabilityLifecycle? AvailabilityLifecycle { get => this._availabilityLifecycle; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterFeatureDetailedStatus? _detailedStatus; - - /// The detailed status of the feature. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterFeatureDetailedStatus? DetailedStatus { get => this._detailedStatus; } - - /// Backing field for property. - private string _detailedStatusMessage; - - /// The descriptive message for the detailed status of the feature. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string DetailedStatusMessage { get => this._detailedStatusMessage; } - - /// Internal Acessors for AvailabilityLifecycle - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterFeatureAvailabilityLifecycle? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeaturePropertiesInternal.AvailabilityLifecycle { get => this._availabilityLifecycle; set { {_availabilityLifecycle = value;} } } - - /// Internal Acessors for DetailedStatus - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterFeatureDetailedStatus? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeaturePropertiesInternal.DetailedStatus { get => this._detailedStatus; set { {_detailedStatus = value;} } } - - /// Internal Acessors for DetailedStatusMessage - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeaturePropertiesInternal.DetailedStatusMessage { get => this._detailedStatusMessage; set { {_detailedStatusMessage = value;} } } - - /// Internal Acessors for ProvisioningState - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterFeatureProvisioningState? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeaturePropertiesInternal.ProvisioningState { get => this._provisioningState; set { {_provisioningState = value;} } } - - /// Internal Acessors for Required - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterFeatureRequired? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeaturePropertiesInternal.Required { get => this._required; set { {_required = value;} } } - - /// Internal Acessors for Version - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeaturePropertiesInternal.Version { get => this._version; set { {_version = value;} } } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStringKeyValuePair[] _option; - - /// The configured options for the feature. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStringKeyValuePair[] Option { get => this._option; set => this._option = value; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterFeatureProvisioningState? _provisioningState; - - /// The provisioning state of the Kubernetes cluster feature. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterFeatureProvisioningState? ProvisioningState { get => this._provisioningState; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterFeatureRequired? _required; - - /// - /// The indicator of if the feature is required or optional. Optional features may be deleted by the user, while required - /// features are managed with the kubernetes cluster lifecycle. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterFeatureRequired? Required { get => this._required; } - - /// Backing field for property. - private string _version; - - /// The version of the feature. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string Version { get => this._version; } - - /// Creates an new instance. - public KubernetesClusterFeatureProperties() - { - - } - } - /// KubernetesClusterFeatureProperties represents the properties of a Kubernetes cluster feature. - public partial interface IKubernetesClusterFeatureProperties : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable - { - /// The lifecycle indicator of the feature. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The lifecycle indicator of the feature.", - SerializedName = @"availabilityLifecycle", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterFeatureAvailabilityLifecycle) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterFeatureAvailabilityLifecycle? AvailabilityLifecycle { get; } - /// The detailed status of the feature. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The detailed status of the feature.", - SerializedName = @"detailedStatus", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterFeatureDetailedStatus) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterFeatureDetailedStatus? DetailedStatus { get; } - /// The descriptive message for the detailed status of the feature. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The descriptive message for the detailed status of the feature.", - SerializedName = @"detailedStatusMessage", - PossibleTypes = new [] { typeof(string) })] - string DetailedStatusMessage { get; } - /// The configured options for the feature. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The configured options for the feature.", - SerializedName = @"options", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStringKeyValuePair) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStringKeyValuePair[] Option { get; set; } - /// The provisioning state of the Kubernetes cluster feature. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The provisioning state of the Kubernetes cluster feature.", - SerializedName = @"provisioningState", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterFeatureProvisioningState) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterFeatureProvisioningState? ProvisioningState { get; } - /// - /// The indicator of if the feature is required or optional. Optional features may be deleted by the user, while required - /// features are managed with the kubernetes cluster lifecycle. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The indicator of if the feature is required or optional. Optional features may be deleted by the user, while required features are managed with the kubernetes cluster lifecycle.", - SerializedName = @"required", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterFeatureRequired) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterFeatureRequired? Required { get; } - /// The version of the feature. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The version of the feature.", - SerializedName = @"version", - PossibleTypes = new [] { typeof(string) })] - string Version { get; } - - } - /// KubernetesClusterFeatureProperties represents the properties of a Kubernetes cluster feature. - internal partial interface IKubernetesClusterFeaturePropertiesInternal - - { - /// The lifecycle indicator of the feature. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterFeatureAvailabilityLifecycle? AvailabilityLifecycle { get; set; } - /// The detailed status of the feature. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterFeatureDetailedStatus? DetailedStatus { get; set; } - /// The descriptive message for the detailed status of the feature. - string DetailedStatusMessage { get; set; } - /// The configured options for the feature. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStringKeyValuePair[] Option { get; set; } - /// The provisioning state of the Kubernetes cluster feature. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterFeatureProvisioningState? ProvisioningState { get; set; } - /// - /// The indicator of if the feature is required or optional. Optional features may be deleted by the user, while required - /// features are managed with the kubernetes cluster lifecycle. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterFeatureRequired? Required { get; set; } - /// The version of the feature. - string Version { get; set; } - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesClusterNode.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesClusterNode.PowerShell.cs deleted file mode 100644 index 89ea7412a710..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesClusterNode.PowerShell.cs +++ /dev/null @@ -1,300 +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.NetworkCloud.Models.Api20250201 -{ - using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; - - /// KubernetesClusterNode represents the details of a node in a Kubernetes cluster. - [System.ComponentModel.TypeConverter(typeof(KubernetesClusterNodeTypeConverter))] - public partial class KubernetesClusterNode - { - - /// - /// 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.NetworkCloud.Models.Api20250201.IKubernetesClusterNode DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new KubernetesClusterNode(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.NetworkCloud.Models.Api20250201.IKubernetesClusterNode DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new KubernetesClusterNode(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.NetworkCloud.Models.Api20250201.IKubernetesClusterNode FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal KubernetesClusterNode(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("AgentPoolId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterNodeInternal)this).AgentPoolId = (string) content.GetValueForProperty("AgentPoolId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterNodeInternal)this).AgentPoolId, global::System.Convert.ToString); - } - if (content.Contains("AvailabilityZone")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterNodeInternal)this).AvailabilityZone = (string) content.GetValueForProperty("AvailabilityZone",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterNodeInternal)this).AvailabilityZone, global::System.Convert.ToString); - } - if (content.Contains("BareMetalMachineId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterNodeInternal)this).BareMetalMachineId = (string) content.GetValueForProperty("BareMetalMachineId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterNodeInternal)this).BareMetalMachineId, global::System.Convert.ToString); - } - if (content.Contains("CpuCore")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterNodeInternal)this).CpuCore = (long?) content.GetValueForProperty("CpuCore",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterNodeInternal)this).CpuCore, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("DetailedStatus")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterNodeInternal)this).DetailedStatus = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterNodeDetailedStatus?) content.GetValueForProperty("DetailedStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterNodeInternal)this).DetailedStatus, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterNodeDetailedStatus.CreateFrom); - } - if (content.Contains("DetailedStatusMessage")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterNodeInternal)this).DetailedStatusMessage = (string) content.GetValueForProperty("DetailedStatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterNodeInternal)this).DetailedStatusMessage, global::System.Convert.ToString); - } - if (content.Contains("DiskSizeGb")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterNodeInternal)this).DiskSizeGb = (long?) content.GetValueForProperty("DiskSizeGb",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterNodeInternal)this).DiskSizeGb, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("Image")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterNodeInternal)this).Image = (string) content.GetValueForProperty("Image",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterNodeInternal)this).Image, global::System.Convert.ToString); - } - if (content.Contains("KubernetesVersion")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterNodeInternal)this).KubernetesVersion = (string) content.GetValueForProperty("KubernetesVersion",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterNodeInternal)this).KubernetesVersion, global::System.Convert.ToString); - } - if (content.Contains("Label")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterNodeInternal)this).Label = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesLabel[]) content.GetValueForProperty("Label",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterNodeInternal)this).Label, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.KubernetesLabelTypeConverter.ConvertFrom)); - } - if (content.Contains("MemorySizeGb")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterNodeInternal)this).MemorySizeGb = (long?) content.GetValueForProperty("MemorySizeGb",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterNodeInternal)this).MemorySizeGb, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("Mode")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterNodeInternal)this).Mode = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.AgentPoolMode?) content.GetValueForProperty("Mode",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterNodeInternal)this).Mode, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.AgentPoolMode.CreateFrom); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterNodeInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterNodeInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("NetworkAttachment")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterNodeInternal)this).NetworkAttachment = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkAttachment[]) content.GetValueForProperty("NetworkAttachment",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterNodeInternal)this).NetworkAttachment, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.NetworkAttachmentTypeConverter.ConvertFrom)); - } - if (content.Contains("PowerState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterNodeInternal)this).PowerState = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesNodePowerState?) content.GetValueForProperty("PowerState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterNodeInternal)this).PowerState, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesNodePowerState.CreateFrom); - } - if (content.Contains("Role")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterNodeInternal)this).Role = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesNodeRole?) content.GetValueForProperty("Role",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterNodeInternal)this).Role, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesNodeRole.CreateFrom); - } - if (content.Contains("Taint")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterNodeInternal)this).Taint = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesLabel[]) content.GetValueForProperty("Taint",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterNodeInternal)this).Taint, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.KubernetesLabelTypeConverter.ConvertFrom)); - } - if (content.Contains("VMSkuName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterNodeInternal)this).VMSkuName = (string) content.GetValueForProperty("VMSkuName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterNodeInternal)this).VMSkuName, 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 KubernetesClusterNode(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("AgentPoolId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterNodeInternal)this).AgentPoolId = (string) content.GetValueForProperty("AgentPoolId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterNodeInternal)this).AgentPoolId, global::System.Convert.ToString); - } - if (content.Contains("AvailabilityZone")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterNodeInternal)this).AvailabilityZone = (string) content.GetValueForProperty("AvailabilityZone",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterNodeInternal)this).AvailabilityZone, global::System.Convert.ToString); - } - if (content.Contains("BareMetalMachineId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterNodeInternal)this).BareMetalMachineId = (string) content.GetValueForProperty("BareMetalMachineId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterNodeInternal)this).BareMetalMachineId, global::System.Convert.ToString); - } - if (content.Contains("CpuCore")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterNodeInternal)this).CpuCore = (long?) content.GetValueForProperty("CpuCore",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterNodeInternal)this).CpuCore, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("DetailedStatus")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterNodeInternal)this).DetailedStatus = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterNodeDetailedStatus?) content.GetValueForProperty("DetailedStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterNodeInternal)this).DetailedStatus, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterNodeDetailedStatus.CreateFrom); - } - if (content.Contains("DetailedStatusMessage")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterNodeInternal)this).DetailedStatusMessage = (string) content.GetValueForProperty("DetailedStatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterNodeInternal)this).DetailedStatusMessage, global::System.Convert.ToString); - } - if (content.Contains("DiskSizeGb")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterNodeInternal)this).DiskSizeGb = (long?) content.GetValueForProperty("DiskSizeGb",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterNodeInternal)this).DiskSizeGb, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("Image")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterNodeInternal)this).Image = (string) content.GetValueForProperty("Image",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterNodeInternal)this).Image, global::System.Convert.ToString); - } - if (content.Contains("KubernetesVersion")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterNodeInternal)this).KubernetesVersion = (string) content.GetValueForProperty("KubernetesVersion",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterNodeInternal)this).KubernetesVersion, global::System.Convert.ToString); - } - if (content.Contains("Label")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterNodeInternal)this).Label = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesLabel[]) content.GetValueForProperty("Label",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterNodeInternal)this).Label, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.KubernetesLabelTypeConverter.ConvertFrom)); - } - if (content.Contains("MemorySizeGb")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterNodeInternal)this).MemorySizeGb = (long?) content.GetValueForProperty("MemorySizeGb",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterNodeInternal)this).MemorySizeGb, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("Mode")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterNodeInternal)this).Mode = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.AgentPoolMode?) content.GetValueForProperty("Mode",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterNodeInternal)this).Mode, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.AgentPoolMode.CreateFrom); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterNodeInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterNodeInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("NetworkAttachment")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterNodeInternal)this).NetworkAttachment = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkAttachment[]) content.GetValueForProperty("NetworkAttachment",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterNodeInternal)this).NetworkAttachment, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.NetworkAttachmentTypeConverter.ConvertFrom)); - } - if (content.Contains("PowerState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterNodeInternal)this).PowerState = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesNodePowerState?) content.GetValueForProperty("PowerState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterNodeInternal)this).PowerState, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesNodePowerState.CreateFrom); - } - if (content.Contains("Role")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterNodeInternal)this).Role = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesNodeRole?) content.GetValueForProperty("Role",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterNodeInternal)this).Role, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesNodeRole.CreateFrom); - } - if (content.Contains("Taint")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterNodeInternal)this).Taint = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesLabel[]) content.GetValueForProperty("Taint",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterNodeInternal)this).Taint, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.KubernetesLabelTypeConverter.ConvertFrom)); - } - if (content.Contains("VMSkuName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterNodeInternal)this).VMSkuName = (string) content.GetValueForProperty("VMSkuName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterNodeInternal)this).VMSkuName, 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.NetworkCloud.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(); - } - } - /// KubernetesClusterNode represents the details of a node in a Kubernetes cluster. - [System.ComponentModel.TypeConverter(typeof(KubernetesClusterNodeTypeConverter))] - public partial interface IKubernetesClusterNode - - { - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesClusterNode.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesClusterNode.cs deleted file mode 100644 index 836e9741b1a6..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesClusterNode.cs +++ /dev/null @@ -1,442 +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.NetworkCloud.Models.Api20250201 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; - - /// KubernetesClusterNode represents the details of a node in a Kubernetes cluster. - public partial class KubernetesClusterNode : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterNode, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterNodeInternal - { - - /// Backing field for property. - private string _agentPoolId; - - /// - /// The resource ID of the agent pool that this node belongs to. This value is not represented on control plane nodes. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string AgentPoolId { get => this._agentPoolId; } - - /// Backing field for property. - private string _availabilityZone; - - /// The availability zone this node is running within. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string AvailabilityZone { get => this._availabilityZone; } - - /// Backing field for property. - private string _bareMetalMachineId; - - /// The resource ID of the bare metal machine that hosts this node. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string BareMetalMachineId { get => this._bareMetalMachineId; } - - /// Backing field for property. - private long? _cpuCore; - - /// - /// The number of CPU cores configured for this node, derived from the VM SKU specified. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public long? CpuCore { get => this._cpuCore; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterNodeDetailedStatus? _detailedStatus; - - /// The detailed state of this node. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterNodeDetailedStatus? DetailedStatus { get => this._detailedStatus; } - - /// Backing field for property. - private string _detailedStatusMessage; - - /// The descriptive message about the current detailed status. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string DetailedStatusMessage { get => this._detailedStatusMessage; } - - /// Backing field for property. - private long? _diskSizeGb; - - /// - /// The size of the disk configured for this node. Allocations are measured in gibibytes. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public long? DiskSizeGb { get => this._diskSizeGb; } - - /// Backing field for property. - private string _image; - - /// The machine image used to deploy this node. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string Image { get => this._image; } - - /// Backing field for property. - private string _kubernetesVersion; - - /// - /// The currently running version of Kubernetes and bundled features running on this node. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string KubernetesVersion { get => this._kubernetesVersion; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesLabel[] _label; - - /// - /// The list of labels on this node that have been assigned to the agent pool containing this node. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesLabel[] Label { get => this._label; } - - /// Backing field for property. - private long? _memorySizeGb; - - /// - /// The amount of memory configured for this node, derived from the vm SKU specified. Allocations are measured in gibibytes. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public long? MemorySizeGb { get => this._memorySizeGb; } - - /// Internal Acessors for AgentPoolId - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterNodeInternal.AgentPoolId { get => this._agentPoolId; set { {_agentPoolId = value;} } } - - /// Internal Acessors for AvailabilityZone - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterNodeInternal.AvailabilityZone { get => this._availabilityZone; set { {_availabilityZone = value;} } } - - /// Internal Acessors for BareMetalMachineId - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterNodeInternal.BareMetalMachineId { get => this._bareMetalMachineId; set { {_bareMetalMachineId = value;} } } - - /// Internal Acessors for CpuCore - long? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterNodeInternal.CpuCore { get => this._cpuCore; set { {_cpuCore = value;} } } - - /// Internal Acessors for DetailedStatus - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterNodeDetailedStatus? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterNodeInternal.DetailedStatus { get => this._detailedStatus; set { {_detailedStatus = value;} } } - - /// Internal Acessors for DetailedStatusMessage - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterNodeInternal.DetailedStatusMessage { get => this._detailedStatusMessage; set { {_detailedStatusMessage = value;} } } - - /// Internal Acessors for DiskSizeGb - long? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterNodeInternal.DiskSizeGb { get => this._diskSizeGb; set { {_diskSizeGb = value;} } } - - /// Internal Acessors for Image - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterNodeInternal.Image { get => this._image; set { {_image = value;} } } - - /// Internal Acessors for KubernetesVersion - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterNodeInternal.KubernetesVersion { get => this._kubernetesVersion; set { {_kubernetesVersion = value;} } } - - /// Internal Acessors for Label - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesLabel[] Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterNodeInternal.Label { get => this._label; set { {_label = value;} } } - - /// Internal Acessors for MemorySizeGb - long? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterNodeInternal.MemorySizeGb { get => this._memorySizeGb; set { {_memorySizeGb = value;} } } - - /// Internal Acessors for Mode - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.AgentPoolMode? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterNodeInternal.Mode { get => this._mode; set { {_mode = value;} } } - - /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterNodeInternal.Name { get => this._name; set { {_name = value;} } } - - /// Internal Acessors for NetworkAttachment - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkAttachment[] Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterNodeInternal.NetworkAttachment { get => this._networkAttachment; set { {_networkAttachment = value;} } } - - /// Internal Acessors for PowerState - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesNodePowerState? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterNodeInternal.PowerState { get => this._powerState; set { {_powerState = value;} } } - - /// Internal Acessors for Role - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesNodeRole? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterNodeInternal.Role { get => this._role; set { {_role = value;} } } - - /// Internal Acessors for Taint - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesLabel[] Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterNodeInternal.Taint { get => this._taint; set { {_taint = value;} } } - - /// Internal Acessors for VMSkuName - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterNodeInternal.VMSkuName { get => this._vMSkuName; set { {_vMSkuName = value;} } } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.AgentPoolMode? _mode; - - /// - /// The mode of the agent pool containing this node. Not applicable for control plane nodes. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.AgentPoolMode? Mode { get => this._mode; } - - /// Backing field for property. - private string _name; - - /// The name of this node, as realized in the Kubernetes cluster. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string Name { get => this._name; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkAttachment[] _networkAttachment; - - /// The NetworkAttachments made to this node. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkAttachment[] NetworkAttachment { get => this._networkAttachment; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesNodePowerState? _powerState; - - /// The power state of this node. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesNodePowerState? PowerState { get => this._powerState; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesNodeRole? _role; - - /// The role of this node in the cluster. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesNodeRole? Role { get => this._role; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesLabel[] _taint; - - /// - /// The list of taints that have been assigned to the agent pool containing this node. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesLabel[] Taint { get => this._taint; } - - /// Backing field for property. - private string _vMSkuName; - - /// The VM SKU name that was used to create this cluster node. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string VMSkuName { get => this._vMSkuName; } - - /// Creates an new instance. - public KubernetesClusterNode() - { - - } - } - /// KubernetesClusterNode represents the details of a node in a Kubernetes cluster. - public partial interface IKubernetesClusterNode : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable - { - /// - /// The resource ID of the agent pool that this node belongs to. This value is not represented on control plane nodes. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The resource ID of the agent pool that this node belongs to. This value is not represented on control plane nodes.", - SerializedName = @"agentPoolId", - PossibleTypes = new [] { typeof(string) })] - string AgentPoolId { get; } - /// The availability zone this node is running within. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The availability zone this node is running within.", - SerializedName = @"availabilityZone", - PossibleTypes = new [] { typeof(string) })] - string AvailabilityZone { get; } - /// The resource ID of the bare metal machine that hosts this node. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The resource ID of the bare metal machine that hosts this node.", - SerializedName = @"bareMetalMachineId", - PossibleTypes = new [] { typeof(string) })] - string BareMetalMachineId { get; } - /// - /// The number of CPU cores configured for this node, derived from the VM SKU specified. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The number of CPU cores configured for this node, derived from the VM SKU specified.", - SerializedName = @"cpuCores", - PossibleTypes = new [] { typeof(long) })] - long? CpuCore { get; } - /// The detailed state of this node. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The detailed state of this node.", - SerializedName = @"detailedStatus", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterNodeDetailedStatus) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterNodeDetailedStatus? DetailedStatus { get; } - /// The descriptive message about the current detailed status. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The descriptive message about the current detailed status.", - SerializedName = @"detailedStatusMessage", - PossibleTypes = new [] { typeof(string) })] - string DetailedStatusMessage { get; } - /// - /// The size of the disk configured for this node. Allocations are measured in gibibytes. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The size of the disk configured for this node. Allocations are measured in gibibytes.", - SerializedName = @"diskSizeGB", - PossibleTypes = new [] { typeof(long) })] - long? DiskSizeGb { get; } - /// The machine image used to deploy this node. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The machine image used to deploy this node.", - SerializedName = @"image", - PossibleTypes = new [] { typeof(string) })] - string Image { get; } - /// - /// The currently running version of Kubernetes and bundled features running on this node. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The currently running version of Kubernetes and bundled features running on this node.", - SerializedName = @"kubernetesVersion", - PossibleTypes = new [] { typeof(string) })] - string KubernetesVersion { get; } - /// - /// The list of labels on this node that have been assigned to the agent pool containing this node. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The list of labels on this node that have been assigned to the agent pool containing this node.", - SerializedName = @"labels", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesLabel) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesLabel[] Label { get; } - /// - /// The amount of memory configured for this node, derived from the vm SKU specified. Allocations are measured in gibibytes. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The amount of memory configured for this node, derived from the vm SKU specified. Allocations are measured in gibibytes.", - SerializedName = @"memorySizeGB", - PossibleTypes = new [] { typeof(long) })] - long? MemorySizeGb { get; } - /// - /// The mode of the agent pool containing this node. Not applicable for control plane nodes. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The mode of the agent pool containing this node. Not applicable for control plane nodes.", - SerializedName = @"mode", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.AgentPoolMode) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.AgentPoolMode? Mode { get; } - /// The name of this node, as realized in the Kubernetes cluster. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The name of this node, as realized in the Kubernetes cluster.", - SerializedName = @"name", - PossibleTypes = new [] { typeof(string) })] - string Name { get; } - /// The NetworkAttachments made to this node. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The NetworkAttachments made to this node.", - SerializedName = @"networkAttachments", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkAttachment) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkAttachment[] NetworkAttachment { get; } - /// The power state of this node. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The power state of this node.", - SerializedName = @"powerState", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesNodePowerState) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesNodePowerState? PowerState { get; } - /// The role of this node in the cluster. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The role of this node in the cluster.", - SerializedName = @"role", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesNodeRole) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesNodeRole? Role { get; } - /// - /// The list of taints that have been assigned to the agent pool containing this node. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The list of taints that have been assigned to the agent pool containing this node.", - SerializedName = @"taints", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesLabel) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesLabel[] Taint { get; } - /// The VM SKU name that was used to create this cluster node. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The VM SKU name that was used to create this cluster node.", - SerializedName = @"vmSkuName", - PossibleTypes = new [] { typeof(string) })] - string VMSkuName { get; } - - } - /// KubernetesClusterNode represents the details of a node in a Kubernetes cluster. - internal partial interface IKubernetesClusterNodeInternal - - { - /// - /// The resource ID of the agent pool that this node belongs to. This value is not represented on control plane nodes. - /// - string AgentPoolId { get; set; } - /// The availability zone this node is running within. - string AvailabilityZone { get; set; } - /// The resource ID of the bare metal machine that hosts this node. - string BareMetalMachineId { get; set; } - /// - /// The number of CPU cores configured for this node, derived from the VM SKU specified. - /// - long? CpuCore { get; set; } - /// The detailed state of this node. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterNodeDetailedStatus? DetailedStatus { get; set; } - /// The descriptive message about the current detailed status. - string DetailedStatusMessage { get; set; } - /// - /// The size of the disk configured for this node. Allocations are measured in gibibytes. - /// - long? DiskSizeGb { get; set; } - /// The machine image used to deploy this node. - string Image { get; set; } - /// - /// The currently running version of Kubernetes and bundled features running on this node. - /// - string KubernetesVersion { get; set; } - /// - /// The list of labels on this node that have been assigned to the agent pool containing this node. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesLabel[] Label { get; set; } - /// - /// The amount of memory configured for this node, derived from the vm SKU specified. Allocations are measured in gibibytes. - /// - long? MemorySizeGb { get; set; } - /// - /// The mode of the agent pool containing this node. Not applicable for control plane nodes. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.AgentPoolMode? Mode { get; set; } - /// The name of this node, as realized in the Kubernetes cluster. - string Name { get; set; } - /// The NetworkAttachments made to this node. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkAttachment[] NetworkAttachment { get; set; } - /// The power state of this node. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesNodePowerState? PowerState { get; set; } - /// The role of this node in the cluster. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesNodeRole? Role { get; set; } - /// - /// The list of taints that have been assigned to the agent pool containing this node. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesLabel[] Taint { get; set; } - /// The VM SKU name that was used to create this cluster node. - string VMSkuName { get; set; } - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesClusterPatchParameters.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesClusterPatchParameters.PowerShell.cs deleted file mode 100644 index 5da04fcb1125..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesClusterPatchParameters.PowerShell.cs +++ /dev/null @@ -1,232 +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.NetworkCloud.Models.Api20250201 -{ - using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; - - /// - /// KubernetesClusterPatchParameters represents the body of the request to patch the Hybrid AKS cluster. - /// - [System.ComponentModel.TypeConverter(typeof(KubernetesClusterPatchParametersTypeConverter))] - public partial class KubernetesClusterPatchParameters - { - - /// - /// 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.NetworkCloud.Models.Api20250201.IKubernetesClusterPatchParameters DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new KubernetesClusterPatchParameters(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.NetworkCloud.Models.Api20250201.IKubernetesClusterPatchParameters DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new KubernetesClusterPatchParameters(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.NetworkCloud.Models.Api20250201.IKubernetesClusterPatchParameters FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal KubernetesClusterPatchParameters(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.NetworkCloud.Models.Api20250201.IKubernetesClusterPatchParametersInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPatchProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPatchParametersInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.KubernetesClusterPatchPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Tag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPatchParametersInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPatchParametersTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPatchParametersInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.KubernetesClusterPatchParametersTagsTypeConverter.ConvertFrom); - } - if (content.Contains("AdministratorConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPatchParametersInternal)this).AdministratorConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministratorConfigurationPatch) content.GetValueForProperty("AdministratorConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPatchParametersInternal)this).AdministratorConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AdministratorConfigurationPatchTypeConverter.ConvertFrom); - } - if (content.Contains("ControlPlaneNodeConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPatchParametersInternal)this).ControlPlaneNodeConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IControlPlaneNodePatchConfiguration) content.GetValueForProperty("ControlPlaneNodeConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPatchParametersInternal)this).ControlPlaneNodeConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ControlPlaneNodePatchConfigurationTypeConverter.ConvertFrom); - } - if (content.Contains("KubernetesVersion")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPatchParametersInternal)this).KubernetesVersion = (string) content.GetValueForProperty("KubernetesVersion",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPatchParametersInternal)this).KubernetesVersion, global::System.Convert.ToString); - } - if (content.Contains("SshPublicKey")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPatchParametersInternal)this).SshPublicKey = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey[]) content.GetValueForProperty("SshPublicKey",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPatchParametersInternal)this).SshPublicKey, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.SshPublicKeyTypeConverter.ConvertFrom)); - } - if (content.Contains("ControlPlaneNodeConfigurationAdministratorConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPatchParametersInternal)this).ControlPlaneNodeConfigurationAdministratorConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministratorConfigurationPatch) content.GetValueForProperty("ControlPlaneNodeConfigurationAdministratorConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPatchParametersInternal)this).ControlPlaneNodeConfigurationAdministratorConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AdministratorConfigurationPatchTypeConverter.ConvertFrom); - } - if (content.Contains("ControlPlaneNodeConfigurationCount")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPatchParametersInternal)this).ControlPlaneNodeConfigurationCount = (long?) content.GetValueForProperty("ControlPlaneNodeConfigurationCount",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPatchParametersInternal)this).ControlPlaneNodeConfigurationCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("ControlPlaneNodeConfigurationAdministratorConfigurationSshPublicKey")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPatchParametersInternal)this).ControlPlaneNodeConfigurationAdministratorConfigurationSshPublicKey = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey[]) content.GetValueForProperty("ControlPlaneNodeConfigurationAdministratorConfigurationSshPublicKey",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPatchParametersInternal)this).ControlPlaneNodeConfigurationAdministratorConfigurationSshPublicKey, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.SshPublicKeyTypeConverter.ConvertFrom)); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal KubernetesClusterPatchParameters(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.NetworkCloud.Models.Api20250201.IKubernetesClusterPatchParametersInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPatchProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPatchParametersInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.KubernetesClusterPatchPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Tag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPatchParametersInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPatchParametersTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPatchParametersInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.KubernetesClusterPatchParametersTagsTypeConverter.ConvertFrom); - } - if (content.Contains("AdministratorConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPatchParametersInternal)this).AdministratorConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministratorConfigurationPatch) content.GetValueForProperty("AdministratorConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPatchParametersInternal)this).AdministratorConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AdministratorConfigurationPatchTypeConverter.ConvertFrom); - } - if (content.Contains("ControlPlaneNodeConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPatchParametersInternal)this).ControlPlaneNodeConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IControlPlaneNodePatchConfiguration) content.GetValueForProperty("ControlPlaneNodeConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPatchParametersInternal)this).ControlPlaneNodeConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ControlPlaneNodePatchConfigurationTypeConverter.ConvertFrom); - } - if (content.Contains("KubernetesVersion")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPatchParametersInternal)this).KubernetesVersion = (string) content.GetValueForProperty("KubernetesVersion",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPatchParametersInternal)this).KubernetesVersion, global::System.Convert.ToString); - } - if (content.Contains("SshPublicKey")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPatchParametersInternal)this).SshPublicKey = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey[]) content.GetValueForProperty("SshPublicKey",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPatchParametersInternal)this).SshPublicKey, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.SshPublicKeyTypeConverter.ConvertFrom)); - } - if (content.Contains("ControlPlaneNodeConfigurationAdministratorConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPatchParametersInternal)this).ControlPlaneNodeConfigurationAdministratorConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministratorConfigurationPatch) content.GetValueForProperty("ControlPlaneNodeConfigurationAdministratorConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPatchParametersInternal)this).ControlPlaneNodeConfigurationAdministratorConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AdministratorConfigurationPatchTypeConverter.ConvertFrom); - } - if (content.Contains("ControlPlaneNodeConfigurationCount")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPatchParametersInternal)this).ControlPlaneNodeConfigurationCount = (long?) content.GetValueForProperty("ControlPlaneNodeConfigurationCount",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPatchParametersInternal)this).ControlPlaneNodeConfigurationCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("ControlPlaneNodeConfigurationAdministratorConfigurationSshPublicKey")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPatchParametersInternal)this).ControlPlaneNodeConfigurationAdministratorConfigurationSshPublicKey = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey[]) content.GetValueForProperty("ControlPlaneNodeConfigurationAdministratorConfigurationSshPublicKey",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPatchParametersInternal)this).ControlPlaneNodeConfigurationAdministratorConfigurationSshPublicKey, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.SshPublicKeyTypeConverter.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.NetworkCloud.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(); - } - } - /// KubernetesClusterPatchParameters represents the body of the request to patch the Hybrid AKS cluster. - [System.ComponentModel.TypeConverter(typeof(KubernetesClusterPatchParametersTypeConverter))] - public partial interface IKubernetesClusterPatchParameters - - { - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesClusterPatchParameters.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesClusterPatchParameters.cs deleted file mode 100644 index e2d2d8ee0266..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesClusterPatchParameters.cs +++ /dev/null @@ -1,150 +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.NetworkCloud.Models.Api20250201 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; - - /// - /// KubernetesClusterPatchParameters represents the body of the request to patch the Hybrid AKS cluster. - /// - public partial class KubernetesClusterPatchParameters : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPatchParameters, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPatchParametersInternal - { - - /// - /// SshPublicKey represents the public key used to authenticate with a resource through SSH. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey[] ControlPlaneNodeConfigurationAdministratorConfigurationSshPublicKey { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPatchPropertiesInternal)Property).ControlPlaneNodeConfigurationAdministratorConfigurationSshPublicKey; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPatchPropertiesInternal)Property).ControlPlaneNodeConfigurationAdministratorConfigurationSshPublicKey = value ?? null /* arrayOf */; } - - /// The number of virtual machines that use this configuration. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public long? ControlPlaneNodeConfigurationCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPatchPropertiesInternal)Property).ControlPlaneNodeConfigurationCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPatchPropertiesInternal)Property).ControlPlaneNodeConfigurationCount = value ?? default(long); } - - /// The Kubernetes version for this cluster. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string KubernetesVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPatchPropertiesInternal)Property).KubernetesVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPatchPropertiesInternal)Property).KubernetesVersion = value ?? null; } - - /// Internal Acessors for AdministratorConfiguration - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministratorConfigurationPatch Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPatchParametersInternal.AdministratorConfiguration { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPatchPropertiesInternal)Property).AdministratorConfiguration; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPatchPropertiesInternal)Property).AdministratorConfiguration = value; } - - /// Internal Acessors for ControlPlaneNodeConfiguration - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IControlPlaneNodePatchConfiguration Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPatchParametersInternal.ControlPlaneNodeConfiguration { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPatchPropertiesInternal)Property).ControlPlaneNodeConfiguration; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPatchPropertiesInternal)Property).ControlPlaneNodeConfiguration = value; } - - /// Internal Acessors for ControlPlaneNodeConfigurationAdministratorConfiguration - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministratorConfigurationPatch Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPatchParametersInternal.ControlPlaneNodeConfigurationAdministratorConfiguration { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPatchPropertiesInternal)Property).ControlPlaneNodeConfigurationAdministratorConfiguration; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPatchPropertiesInternal)Property).ControlPlaneNodeConfigurationAdministratorConfiguration = value; } - - /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPatchProperties Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPatchParametersInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.KubernetesClusterPatchProperties()); set { {_property = value;} } } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPatchProperties _property; - - /// The list of the resource properties. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPatchProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.KubernetesClusterPatchProperties()); set => this._property = value; } - - /// - /// SshPublicKey represents the public key used to authenticate with a resource through SSH. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey[] SshPublicKey { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPatchPropertiesInternal)Property).SshPublicKey; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPatchPropertiesInternal)Property).SshPublicKey = value ?? null /* arrayOf */; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPatchParametersTags _tag; - - /// The Azure resource tags that will replace the existing ones. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPatchParametersTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.KubernetesClusterPatchParametersTags()); set => this._tag = value; } - - /// Creates an new instance. - public KubernetesClusterPatchParameters() - { - - } - } - /// KubernetesClusterPatchParameters represents the body of the request to patch the Hybrid AKS cluster. - public partial interface IKubernetesClusterPatchParameters : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable - { - /// - /// SshPublicKey represents the public key used to authenticate with a resource through SSH. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"SshPublicKey represents the public key used to authenticate with a resource through SSH.", - SerializedName = @"sshPublicKeys", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey[] ControlPlaneNodeConfigurationAdministratorConfigurationSshPublicKey { get; set; } - /// The number of virtual machines that use this configuration. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The number of virtual machines that use this configuration.", - SerializedName = @"count", - PossibleTypes = new [] { typeof(long) })] - long? ControlPlaneNodeConfigurationCount { get; set; } - /// The Kubernetes version for this cluster. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The Kubernetes version for this cluster.", - SerializedName = @"kubernetesVersion", - PossibleTypes = new [] { typeof(string) })] - string KubernetesVersion { get; set; } - /// - /// SshPublicKey represents the public key used to authenticate with a resource through SSH. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"SshPublicKey represents the public key used to authenticate with a resource through SSH.", - SerializedName = @"sshPublicKeys", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey[] SshPublicKey { get; set; } - /// The Azure resource tags that will replace the existing ones. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The Azure resource tags that will replace the existing ones.", - SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPatchParametersTags) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPatchParametersTags Tag { get; set; } - - } - /// KubernetesClusterPatchParameters represents the body of the request to patch the Hybrid AKS cluster. - internal partial interface IKubernetesClusterPatchParametersInternal - - { - /// The configuration of the default administrator credentials. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministratorConfigurationPatch AdministratorConfiguration { get; set; } - /// - /// The defining characteristics of the control plane that can be patched for this Kubernetes cluster. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IControlPlaneNodePatchConfiguration ControlPlaneNodeConfiguration { get; set; } - /// The configuration of administrator credentials for the control plane nodes. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministratorConfigurationPatch ControlPlaneNodeConfigurationAdministratorConfiguration { get; set; } - /// - /// SshPublicKey represents the public key used to authenticate with a resource through SSH. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey[] ControlPlaneNodeConfigurationAdministratorConfigurationSshPublicKey { get; set; } - /// The number of virtual machines that use this configuration. - long? ControlPlaneNodeConfigurationCount { get; set; } - /// The Kubernetes version for this cluster. - string KubernetesVersion { get; set; } - /// The list of the resource properties. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPatchProperties Property { get; set; } - /// - /// SshPublicKey represents the public key used to authenticate with a resource through SSH. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey[] SshPublicKey { get; set; } - /// The Azure resource tags that will replace the existing ones. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPatchParametersTags Tag { get; set; } - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesClusterPatchProperties.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesClusterPatchProperties.PowerShell.cs deleted file mode 100644 index edaca3c61aec..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesClusterPatchProperties.PowerShell.cs +++ /dev/null @@ -1,216 +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.NetworkCloud.Models.Api20250201 -{ - using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; - - /// - /// KubernetesClusterPatchProperties represents the properties of the Kubernetes cluster that can be patched. - /// - [System.ComponentModel.TypeConverter(typeof(KubernetesClusterPatchPropertiesTypeConverter))] - public partial class KubernetesClusterPatchProperties - { - - /// - /// 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.NetworkCloud.Models.Api20250201.IKubernetesClusterPatchProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new KubernetesClusterPatchProperties(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.NetworkCloud.Models.Api20250201.IKubernetesClusterPatchProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new KubernetesClusterPatchProperties(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.NetworkCloud.Models.Api20250201.IKubernetesClusterPatchProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal KubernetesClusterPatchProperties(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("AdministratorConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPatchPropertiesInternal)this).AdministratorConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministratorConfigurationPatch) content.GetValueForProperty("AdministratorConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPatchPropertiesInternal)this).AdministratorConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AdministratorConfigurationPatchTypeConverter.ConvertFrom); - } - if (content.Contains("ControlPlaneNodeConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPatchPropertiesInternal)this).ControlPlaneNodeConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IControlPlaneNodePatchConfiguration) content.GetValueForProperty("ControlPlaneNodeConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPatchPropertiesInternal)this).ControlPlaneNodeConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ControlPlaneNodePatchConfigurationTypeConverter.ConvertFrom); - } - if (content.Contains("KubernetesVersion")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPatchPropertiesInternal)this).KubernetesVersion = (string) content.GetValueForProperty("KubernetesVersion",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPatchPropertiesInternal)this).KubernetesVersion, global::System.Convert.ToString); - } - if (content.Contains("SshPublicKey")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPatchPropertiesInternal)this).SshPublicKey = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey[]) content.GetValueForProperty("SshPublicKey",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPatchPropertiesInternal)this).SshPublicKey, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.SshPublicKeyTypeConverter.ConvertFrom)); - } - if (content.Contains("ControlPlaneNodeConfigurationAdministratorConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPatchPropertiesInternal)this).ControlPlaneNodeConfigurationAdministratorConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministratorConfigurationPatch) content.GetValueForProperty("ControlPlaneNodeConfigurationAdministratorConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPatchPropertiesInternal)this).ControlPlaneNodeConfigurationAdministratorConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AdministratorConfigurationPatchTypeConverter.ConvertFrom); - } - if (content.Contains("ControlPlaneNodeConfigurationCount")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPatchPropertiesInternal)this).ControlPlaneNodeConfigurationCount = (long?) content.GetValueForProperty("ControlPlaneNodeConfigurationCount",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPatchPropertiesInternal)this).ControlPlaneNodeConfigurationCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("ControlPlaneNodeConfigurationAdministratorConfigurationSshPublicKey")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPatchPropertiesInternal)this).ControlPlaneNodeConfigurationAdministratorConfigurationSshPublicKey = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey[]) content.GetValueForProperty("ControlPlaneNodeConfigurationAdministratorConfigurationSshPublicKey",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPatchPropertiesInternal)this).ControlPlaneNodeConfigurationAdministratorConfigurationSshPublicKey, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.SshPublicKeyTypeConverter.ConvertFrom)); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal KubernetesClusterPatchProperties(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("AdministratorConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPatchPropertiesInternal)this).AdministratorConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministratorConfigurationPatch) content.GetValueForProperty("AdministratorConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPatchPropertiesInternal)this).AdministratorConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AdministratorConfigurationPatchTypeConverter.ConvertFrom); - } - if (content.Contains("ControlPlaneNodeConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPatchPropertiesInternal)this).ControlPlaneNodeConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IControlPlaneNodePatchConfiguration) content.GetValueForProperty("ControlPlaneNodeConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPatchPropertiesInternal)this).ControlPlaneNodeConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ControlPlaneNodePatchConfigurationTypeConverter.ConvertFrom); - } - if (content.Contains("KubernetesVersion")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPatchPropertiesInternal)this).KubernetesVersion = (string) content.GetValueForProperty("KubernetesVersion",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPatchPropertiesInternal)this).KubernetesVersion, global::System.Convert.ToString); - } - if (content.Contains("SshPublicKey")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPatchPropertiesInternal)this).SshPublicKey = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey[]) content.GetValueForProperty("SshPublicKey",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPatchPropertiesInternal)this).SshPublicKey, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.SshPublicKeyTypeConverter.ConvertFrom)); - } - if (content.Contains("ControlPlaneNodeConfigurationAdministratorConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPatchPropertiesInternal)this).ControlPlaneNodeConfigurationAdministratorConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministratorConfigurationPatch) content.GetValueForProperty("ControlPlaneNodeConfigurationAdministratorConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPatchPropertiesInternal)this).ControlPlaneNodeConfigurationAdministratorConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AdministratorConfigurationPatchTypeConverter.ConvertFrom); - } - if (content.Contains("ControlPlaneNodeConfigurationCount")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPatchPropertiesInternal)this).ControlPlaneNodeConfigurationCount = (long?) content.GetValueForProperty("ControlPlaneNodeConfigurationCount",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPatchPropertiesInternal)this).ControlPlaneNodeConfigurationCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("ControlPlaneNodeConfigurationAdministratorConfigurationSshPublicKey")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPatchPropertiesInternal)this).ControlPlaneNodeConfigurationAdministratorConfigurationSshPublicKey = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey[]) content.GetValueForProperty("ControlPlaneNodeConfigurationAdministratorConfigurationSshPublicKey",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPatchPropertiesInternal)this).ControlPlaneNodeConfigurationAdministratorConfigurationSshPublicKey, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.SshPublicKeyTypeConverter.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.NetworkCloud.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(); - } - } - /// KubernetesClusterPatchProperties represents the properties of the Kubernetes cluster that can be patched. - [System.ComponentModel.TypeConverter(typeof(KubernetesClusterPatchPropertiesTypeConverter))] - public partial interface IKubernetesClusterPatchProperties - - { - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesClusterPatchProperties.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesClusterPatchProperties.cs deleted file mode 100644 index efedb75916c5..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesClusterPatchProperties.cs +++ /dev/null @@ -1,140 +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.NetworkCloud.Models.Api20250201 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; - - /// - /// KubernetesClusterPatchProperties represents the properties of the Kubernetes cluster that can be patched. - /// - public partial class KubernetesClusterPatchProperties : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPatchProperties, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPatchPropertiesInternal - { - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministratorConfigurationPatch _administratorConfiguration; - - /// The configuration of the default administrator credentials. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministratorConfigurationPatch AdministratorConfiguration { get => (this._administratorConfiguration = this._administratorConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AdministratorConfigurationPatch()); set => this._administratorConfiguration = value; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IControlPlaneNodePatchConfiguration _controlPlaneNodeConfiguration; - - /// - /// The defining characteristics of the control plane that can be patched for this Kubernetes cluster. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IControlPlaneNodePatchConfiguration ControlPlaneNodeConfiguration { get => (this._controlPlaneNodeConfiguration = this._controlPlaneNodeConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ControlPlaneNodePatchConfiguration()); set => this._controlPlaneNodeConfiguration = value; } - - /// - /// SshPublicKey represents the public key used to authenticate with a resource through SSH. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey[] ControlPlaneNodeConfigurationAdministratorConfigurationSshPublicKey { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IControlPlaneNodePatchConfigurationInternal)ControlPlaneNodeConfiguration).AdministratorConfigurationSshPublicKey; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IControlPlaneNodePatchConfigurationInternal)ControlPlaneNodeConfiguration).AdministratorConfigurationSshPublicKey = value ?? null /* arrayOf */; } - - /// The number of virtual machines that use this configuration. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public long? ControlPlaneNodeConfigurationCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IControlPlaneNodePatchConfigurationInternal)ControlPlaneNodeConfiguration).Count; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IControlPlaneNodePatchConfigurationInternal)ControlPlaneNodeConfiguration).Count = value ?? default(long); } - - /// Backing field for property. - private string _kubernetesVersion; - - /// The Kubernetes version for this cluster. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string KubernetesVersion { get => this._kubernetesVersion; set => this._kubernetesVersion = value; } - - /// Internal Acessors for AdministratorConfiguration - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministratorConfigurationPatch Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPatchPropertiesInternal.AdministratorConfiguration { get => (this._administratorConfiguration = this._administratorConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AdministratorConfigurationPatch()); set { {_administratorConfiguration = value;} } } - - /// Internal Acessors for ControlPlaneNodeConfiguration - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IControlPlaneNodePatchConfiguration Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPatchPropertiesInternal.ControlPlaneNodeConfiguration { get => (this._controlPlaneNodeConfiguration = this._controlPlaneNodeConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ControlPlaneNodePatchConfiguration()); set { {_controlPlaneNodeConfiguration = value;} } } - - /// Internal Acessors for ControlPlaneNodeConfigurationAdministratorConfiguration - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministratorConfigurationPatch Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPatchPropertiesInternal.ControlPlaneNodeConfigurationAdministratorConfiguration { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IControlPlaneNodePatchConfigurationInternal)ControlPlaneNodeConfiguration).AdministratorConfiguration; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IControlPlaneNodePatchConfigurationInternal)ControlPlaneNodeConfiguration).AdministratorConfiguration = value; } - - /// - /// SshPublicKey represents the public key used to authenticate with a resource through SSH. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey[] SshPublicKey { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministratorConfigurationPatchInternal)AdministratorConfiguration).SshPublicKey; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministratorConfigurationPatchInternal)AdministratorConfiguration).SshPublicKey = value ?? null /* arrayOf */; } - - /// Creates an new instance. - public KubernetesClusterPatchProperties() - { - - } - } - /// KubernetesClusterPatchProperties represents the properties of the Kubernetes cluster that can be patched. - public partial interface IKubernetesClusterPatchProperties : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable - { - /// - /// SshPublicKey represents the public key used to authenticate with a resource through SSH. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"SshPublicKey represents the public key used to authenticate with a resource through SSH.", - SerializedName = @"sshPublicKeys", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey[] ControlPlaneNodeConfigurationAdministratorConfigurationSshPublicKey { get; set; } - /// The number of virtual machines that use this configuration. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The number of virtual machines that use this configuration.", - SerializedName = @"count", - PossibleTypes = new [] { typeof(long) })] - long? ControlPlaneNodeConfigurationCount { get; set; } - /// The Kubernetes version for this cluster. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The Kubernetes version for this cluster.", - SerializedName = @"kubernetesVersion", - PossibleTypes = new [] { typeof(string) })] - string KubernetesVersion { get; set; } - /// - /// SshPublicKey represents the public key used to authenticate with a resource through SSH. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"SshPublicKey represents the public key used to authenticate with a resource through SSH.", - SerializedName = @"sshPublicKeys", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey[] SshPublicKey { get; set; } - - } - /// KubernetesClusterPatchProperties represents the properties of the Kubernetes cluster that can be patched. - internal partial interface IKubernetesClusterPatchPropertiesInternal - - { - /// The configuration of the default administrator credentials. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministratorConfigurationPatch AdministratorConfiguration { get; set; } - /// - /// The defining characteristics of the control plane that can be patched for this Kubernetes cluster. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IControlPlaneNodePatchConfiguration ControlPlaneNodeConfiguration { get; set; } - /// The configuration of administrator credentials for the control plane nodes. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministratorConfigurationPatch ControlPlaneNodeConfigurationAdministratorConfiguration { get; set; } - /// - /// SshPublicKey represents the public key used to authenticate with a resource through SSH. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey[] ControlPlaneNodeConfigurationAdministratorConfigurationSshPublicKey { get; set; } - /// The number of virtual machines that use this configuration. - long? ControlPlaneNodeConfigurationCount { get; set; } - /// The Kubernetes version for this cluster. - string KubernetesVersion { get; set; } - /// - /// SshPublicKey represents the public key used to authenticate with a resource through SSH. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey[] SshPublicKey { get; set; } - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesClusterProperties.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesClusterProperties.PowerShell.cs deleted file mode 100644 index 14e05f107208..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesClusterProperties.PowerShell.cs +++ /dev/null @@ -1,512 +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.NetworkCloud.Models.Api20250201 -{ - using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; - - /// - /// KubernetesClusterProperties represents the properties of Kubernetes cluster resource. - /// - [System.ComponentModel.TypeConverter(typeof(KubernetesClusterPropertiesTypeConverter))] - public partial class KubernetesClusterProperties - { - - /// - /// 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.NetworkCloud.Models.Api20250201.IKubernetesClusterProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new KubernetesClusterProperties(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.NetworkCloud.Models.Api20250201.IKubernetesClusterProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new KubernetesClusterProperties(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.NetworkCloud.Models.Api20250201.IKubernetesClusterProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal KubernetesClusterProperties(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("AadConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).AadConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAadConfiguration) content.GetValueForProperty("AadConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).AadConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AadConfigurationTypeConverter.ConvertFrom); - } - if (content.Contains("AdministratorConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).AdministratorConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministratorConfiguration) content.GetValueForProperty("AdministratorConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).AdministratorConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AdministratorConfigurationTypeConverter.ConvertFrom); - } - if (content.Contains("ControlPlaneNodeConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).ControlPlaneNodeConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IControlPlaneNodeConfiguration) content.GetValueForProperty("ControlPlaneNodeConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).ControlPlaneNodeConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ControlPlaneNodeConfigurationTypeConverter.ConvertFrom); - } - if (content.Contains("ManagedResourceGroupConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).ManagedResourceGroupConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IManagedResourceGroupConfiguration) content.GetValueForProperty("ManagedResourceGroupConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).ManagedResourceGroupConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ManagedResourceGroupConfigurationTypeConverter.ConvertFrom); - } - if (content.Contains("NetworkConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).NetworkConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkConfiguration) content.GetValueForProperty("NetworkConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).NetworkConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.NetworkConfigurationTypeConverter.ConvertFrom); - } - if (content.Contains("AttachedNetworkId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).AttachedNetworkId = (string[]) content.GetValueForProperty("AttachedNetworkId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).AttachedNetworkId, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("AvailableUpgrade")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).AvailableUpgrade = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAvailableUpgrade[]) content.GetValueForProperty("AvailableUpgrade",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).AvailableUpgrade, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AvailableUpgradeTypeConverter.ConvertFrom)); - } - if (content.Contains("ClusterId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).ClusterId = (string) content.GetValueForProperty("ClusterId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).ClusterId, global::System.Convert.ToString); - } - if (content.Contains("ConnectedClusterId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).ConnectedClusterId = (string) content.GetValueForProperty("ConnectedClusterId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).ConnectedClusterId, global::System.Convert.ToString); - } - if (content.Contains("ControlPlaneKubernetesVersion")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).ControlPlaneKubernetesVersion = (string) content.GetValueForProperty("ControlPlaneKubernetesVersion",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).ControlPlaneKubernetesVersion, global::System.Convert.ToString); - } - if (content.Contains("DetailedStatus")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).DetailedStatus = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterDetailedStatus?) content.GetValueForProperty("DetailedStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).DetailedStatus, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterDetailedStatus.CreateFrom); - } - if (content.Contains("DetailedStatusMessage")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).DetailedStatusMessage = (string) content.GetValueForProperty("DetailedStatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).DetailedStatusMessage, global::System.Convert.ToString); - } - if (content.Contains("FeatureStatuses")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).FeatureStatuses = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IFeatureStatus[]) content.GetValueForProperty("FeatureStatuses",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).FeatureStatuses, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.FeatureStatusTypeConverter.ConvertFrom)); - } - if (content.Contains("InitialAgentPoolConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).InitialAgentPoolConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IInitialAgentPoolConfiguration[]) content.GetValueForProperty("InitialAgentPoolConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).InitialAgentPoolConfiguration, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.InitialAgentPoolConfigurationTypeConverter.ConvertFrom)); - } - if (content.Contains("KubernetesVersion")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).KubernetesVersion = (string) content.GetValueForProperty("KubernetesVersion",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).KubernetesVersion, global::System.Convert.ToString); - } - if (content.Contains("Node")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).Node = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterNode[]) content.GetValueForProperty("Node",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).Node, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.KubernetesClusterNodeTypeConverter.ConvertFrom)); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterProvisioningState.CreateFrom); - } - if (content.Contains("AdminUsername")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).AdminUsername = (string) content.GetValueForProperty("AdminUsername",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).AdminUsername, global::System.Convert.ToString); - } - if (content.Contains("ControlPlaneNodeConfigurationAdministratorConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).ControlPlaneNodeConfigurationAdministratorConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministratorConfiguration) content.GetValueForProperty("ControlPlaneNodeConfigurationAdministratorConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).ControlPlaneNodeConfigurationAdministratorConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AdministratorConfigurationTypeConverter.ConvertFrom); - } - if (content.Contains("ControlPlaneNodeConfigurationAvailabilityZone")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).ControlPlaneNodeConfigurationAvailabilityZone = (string[]) content.GetValueForProperty("ControlPlaneNodeConfigurationAvailabilityZone",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).ControlPlaneNodeConfigurationAvailabilityZone, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("ControlPlaneNodeConfigurationCount")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).ControlPlaneNodeConfigurationCount = (long) content.GetValueForProperty("ControlPlaneNodeConfigurationCount",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).ControlPlaneNodeConfigurationCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("ManagedResourceGroupConfigurationLocation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).ManagedResourceGroupConfigurationLocation = (string) content.GetValueForProperty("ManagedResourceGroupConfigurationLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).ManagedResourceGroupConfigurationLocation, global::System.Convert.ToString); - } - if (content.Contains("ManagedResourceGroupConfigurationName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).ManagedResourceGroupConfigurationName = (string) content.GetValueForProperty("ManagedResourceGroupConfigurationName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).ManagedResourceGroupConfigurationName, global::System.Convert.ToString); - } - if (content.Contains("NetworkConfigurationPodCidr")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).NetworkConfigurationPodCidr = (string[]) content.GetValueForProperty("NetworkConfigurationPodCidr",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).NetworkConfigurationPodCidr, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("NetworkConfigurationServiceCidr")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).NetworkConfigurationServiceCidr = (string[]) content.GetValueForProperty("NetworkConfigurationServiceCidr",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).NetworkConfigurationServiceCidr, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("AadConfigurationAdminGroupObjectId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).AadConfigurationAdminGroupObjectId = (string[]) content.GetValueForProperty("AadConfigurationAdminGroupObjectId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).AadConfigurationAdminGroupObjectId, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("SshPublicKey")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).SshPublicKey = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey[]) content.GetValueForProperty("SshPublicKey",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).SshPublicKey, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.SshPublicKeyTypeConverter.ConvertFrom)); - } - if (content.Contains("ControlPlaneNodeConfigurationVMSkuName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).ControlPlaneNodeConfigurationVMSkuName = (string) content.GetValueForProperty("ControlPlaneNodeConfigurationVMSkuName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).ControlPlaneNodeConfigurationVMSkuName, global::System.Convert.ToString); - } - if (content.Contains("ControlPlaneNodeConfigurationAdministratorConfigurationAdminUsername")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).ControlPlaneNodeConfigurationAdministratorConfigurationAdminUsername = (string) content.GetValueForProperty("ControlPlaneNodeConfigurationAdministratorConfigurationAdminUsername",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).ControlPlaneNodeConfigurationAdministratorConfigurationAdminUsername, global::System.Convert.ToString); - } - if (content.Contains("NetworkConfigurationAttachedNetworkConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).NetworkConfigurationAttachedNetworkConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAttachedNetworkConfiguration) content.GetValueForProperty("NetworkConfigurationAttachedNetworkConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).NetworkConfigurationAttachedNetworkConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AttachedNetworkConfigurationTypeConverter.ConvertFrom); - } - if (content.Contains("NetworkConfigurationBgpServiceLoadBalancerConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).NetworkConfigurationBgpServiceLoadBalancerConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBgpServiceLoadBalancerConfiguration) content.GetValueForProperty("NetworkConfigurationBgpServiceLoadBalancerConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).NetworkConfigurationBgpServiceLoadBalancerConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BgpServiceLoadBalancerConfigurationTypeConverter.ConvertFrom); - } - if (content.Contains("NetworkConfigurationL2ServiceLoadBalancerConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).NetworkConfigurationL2ServiceLoadBalancerConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2ServiceLoadBalancerConfiguration) content.GetValueForProperty("NetworkConfigurationL2ServiceLoadBalancerConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).NetworkConfigurationL2ServiceLoadBalancerConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.L2ServiceLoadBalancerConfigurationTypeConverter.ConvertFrom); - } - if (content.Contains("NetworkConfigurationCloudServicesNetworkId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).NetworkConfigurationCloudServicesNetworkId = (string) content.GetValueForProperty("NetworkConfigurationCloudServicesNetworkId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).NetworkConfigurationCloudServicesNetworkId, global::System.Convert.ToString); - } - if (content.Contains("NetworkConfigurationCniNetworkId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).NetworkConfigurationCniNetworkId = (string) content.GetValueForProperty("NetworkConfigurationCniNetworkId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).NetworkConfigurationCniNetworkId, global::System.Convert.ToString); - } - if (content.Contains("NetworkConfigurationDnsServiceIP")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).NetworkConfigurationDnsServiceIP = (string) content.GetValueForProperty("NetworkConfigurationDnsServiceIP",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).NetworkConfigurationDnsServiceIP, global::System.Convert.ToString); - } - if (content.Contains("AttachedNetworkConfigurationL2Network")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).AttachedNetworkConfigurationL2Network = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkAttachmentConfiguration[]) content.GetValueForProperty("AttachedNetworkConfigurationL2Network",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).AttachedNetworkConfigurationL2Network, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.L2NetworkAttachmentConfigurationTypeConverter.ConvertFrom)); - } - if (content.Contains("AttachedNetworkConfigurationL3Network")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).AttachedNetworkConfigurationL3Network = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkAttachmentConfiguration[]) content.GetValueForProperty("AttachedNetworkConfigurationL3Network",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).AttachedNetworkConfigurationL3Network, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.L3NetworkAttachmentConfigurationTypeConverter.ConvertFrom)); - } - if (content.Contains("AttachedNetworkConfigurationTrunkedNetwork")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).AttachedNetworkConfigurationTrunkedNetwork = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkAttachmentConfiguration[]) content.GetValueForProperty("AttachedNetworkConfigurationTrunkedNetwork",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).AttachedNetworkConfigurationTrunkedNetwork, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.TrunkedNetworkAttachmentConfigurationTypeConverter.ConvertFrom)); - } - if (content.Contains("BgpServiceLoadBalancerConfigurationBgpAdvertisement")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).BgpServiceLoadBalancerConfigurationBgpAdvertisement = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBgpAdvertisement[]) content.GetValueForProperty("BgpServiceLoadBalancerConfigurationBgpAdvertisement",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).BgpServiceLoadBalancerConfigurationBgpAdvertisement, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BgpAdvertisementTypeConverter.ConvertFrom)); - } - if (content.Contains("BgpServiceLoadBalancerConfigurationBgpPeer")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).BgpServiceLoadBalancerConfigurationBgpPeer = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IServiceLoadBalancerBgpPeer[]) content.GetValueForProperty("BgpServiceLoadBalancerConfigurationBgpPeer",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).BgpServiceLoadBalancerConfigurationBgpPeer, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ServiceLoadBalancerBgpPeerTypeConverter.ConvertFrom)); - } - if (content.Contains("ControlPlaneNodeConfigurationAdministratorConfigurationSshPublicKey")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).ControlPlaneNodeConfigurationAdministratorConfigurationSshPublicKey = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey[]) content.GetValueForProperty("ControlPlaneNodeConfigurationAdministratorConfigurationSshPublicKey",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).ControlPlaneNodeConfigurationAdministratorConfigurationSshPublicKey, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.SshPublicKeyTypeConverter.ConvertFrom)); - } - if (content.Contains("BgpServiceLoadBalancerConfigurationFabricPeeringEnabled")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).BgpServiceLoadBalancerConfigurationFabricPeeringEnabled = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.FabricPeeringEnabled?) content.GetValueForProperty("BgpServiceLoadBalancerConfigurationFabricPeeringEnabled",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).BgpServiceLoadBalancerConfigurationFabricPeeringEnabled, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.FabricPeeringEnabled.CreateFrom); - } - if (content.Contains("BgpServiceLoadBalancerConfigurationIPAddressPool")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).BgpServiceLoadBalancerConfigurationIPAddressPool = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIPAddressPool[]) content.GetValueForProperty("BgpServiceLoadBalancerConfigurationIPAddressPool",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).BgpServiceLoadBalancerConfigurationIPAddressPool, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IPAddressPoolTypeConverter.ConvertFrom)); - } - if (content.Contains("L2ServiceLoadBalancerConfigurationIPAddressPool")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).L2ServiceLoadBalancerConfigurationIPAddressPool = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIPAddressPool[]) content.GetValueForProperty("L2ServiceLoadBalancerConfigurationIPAddressPool",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).L2ServiceLoadBalancerConfigurationIPAddressPool, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IPAddressPoolTypeConverter.ConvertFrom)); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal KubernetesClusterProperties(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("AadConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).AadConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAadConfiguration) content.GetValueForProperty("AadConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).AadConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AadConfigurationTypeConverter.ConvertFrom); - } - if (content.Contains("AdministratorConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).AdministratorConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministratorConfiguration) content.GetValueForProperty("AdministratorConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).AdministratorConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AdministratorConfigurationTypeConverter.ConvertFrom); - } - if (content.Contains("ControlPlaneNodeConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).ControlPlaneNodeConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IControlPlaneNodeConfiguration) content.GetValueForProperty("ControlPlaneNodeConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).ControlPlaneNodeConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ControlPlaneNodeConfigurationTypeConverter.ConvertFrom); - } - if (content.Contains("ManagedResourceGroupConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).ManagedResourceGroupConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IManagedResourceGroupConfiguration) content.GetValueForProperty("ManagedResourceGroupConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).ManagedResourceGroupConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ManagedResourceGroupConfigurationTypeConverter.ConvertFrom); - } - if (content.Contains("NetworkConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).NetworkConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkConfiguration) content.GetValueForProperty("NetworkConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).NetworkConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.NetworkConfigurationTypeConverter.ConvertFrom); - } - if (content.Contains("AttachedNetworkId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).AttachedNetworkId = (string[]) content.GetValueForProperty("AttachedNetworkId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).AttachedNetworkId, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("AvailableUpgrade")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).AvailableUpgrade = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAvailableUpgrade[]) content.GetValueForProperty("AvailableUpgrade",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).AvailableUpgrade, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AvailableUpgradeTypeConverter.ConvertFrom)); - } - if (content.Contains("ClusterId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).ClusterId = (string) content.GetValueForProperty("ClusterId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).ClusterId, global::System.Convert.ToString); - } - if (content.Contains("ConnectedClusterId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).ConnectedClusterId = (string) content.GetValueForProperty("ConnectedClusterId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).ConnectedClusterId, global::System.Convert.ToString); - } - if (content.Contains("ControlPlaneKubernetesVersion")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).ControlPlaneKubernetesVersion = (string) content.GetValueForProperty("ControlPlaneKubernetesVersion",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).ControlPlaneKubernetesVersion, global::System.Convert.ToString); - } - if (content.Contains("DetailedStatus")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).DetailedStatus = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterDetailedStatus?) content.GetValueForProperty("DetailedStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).DetailedStatus, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterDetailedStatus.CreateFrom); - } - if (content.Contains("DetailedStatusMessage")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).DetailedStatusMessage = (string) content.GetValueForProperty("DetailedStatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).DetailedStatusMessage, global::System.Convert.ToString); - } - if (content.Contains("FeatureStatuses")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).FeatureStatuses = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IFeatureStatus[]) content.GetValueForProperty("FeatureStatuses",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).FeatureStatuses, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.FeatureStatusTypeConverter.ConvertFrom)); - } - if (content.Contains("InitialAgentPoolConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).InitialAgentPoolConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IInitialAgentPoolConfiguration[]) content.GetValueForProperty("InitialAgentPoolConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).InitialAgentPoolConfiguration, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.InitialAgentPoolConfigurationTypeConverter.ConvertFrom)); - } - if (content.Contains("KubernetesVersion")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).KubernetesVersion = (string) content.GetValueForProperty("KubernetesVersion",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).KubernetesVersion, global::System.Convert.ToString); - } - if (content.Contains("Node")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).Node = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterNode[]) content.GetValueForProperty("Node",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).Node, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.KubernetesClusterNodeTypeConverter.ConvertFrom)); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterProvisioningState.CreateFrom); - } - if (content.Contains("AdminUsername")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).AdminUsername = (string) content.GetValueForProperty("AdminUsername",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).AdminUsername, global::System.Convert.ToString); - } - if (content.Contains("ControlPlaneNodeConfigurationAdministratorConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).ControlPlaneNodeConfigurationAdministratorConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministratorConfiguration) content.GetValueForProperty("ControlPlaneNodeConfigurationAdministratorConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).ControlPlaneNodeConfigurationAdministratorConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AdministratorConfigurationTypeConverter.ConvertFrom); - } - if (content.Contains("ControlPlaneNodeConfigurationAvailabilityZone")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).ControlPlaneNodeConfigurationAvailabilityZone = (string[]) content.GetValueForProperty("ControlPlaneNodeConfigurationAvailabilityZone",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).ControlPlaneNodeConfigurationAvailabilityZone, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("ControlPlaneNodeConfigurationCount")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).ControlPlaneNodeConfigurationCount = (long) content.GetValueForProperty("ControlPlaneNodeConfigurationCount",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).ControlPlaneNodeConfigurationCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("ManagedResourceGroupConfigurationLocation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).ManagedResourceGroupConfigurationLocation = (string) content.GetValueForProperty("ManagedResourceGroupConfigurationLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).ManagedResourceGroupConfigurationLocation, global::System.Convert.ToString); - } - if (content.Contains("ManagedResourceGroupConfigurationName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).ManagedResourceGroupConfigurationName = (string) content.GetValueForProperty("ManagedResourceGroupConfigurationName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).ManagedResourceGroupConfigurationName, global::System.Convert.ToString); - } - if (content.Contains("NetworkConfigurationPodCidr")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).NetworkConfigurationPodCidr = (string[]) content.GetValueForProperty("NetworkConfigurationPodCidr",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).NetworkConfigurationPodCidr, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("NetworkConfigurationServiceCidr")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).NetworkConfigurationServiceCidr = (string[]) content.GetValueForProperty("NetworkConfigurationServiceCidr",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).NetworkConfigurationServiceCidr, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("AadConfigurationAdminGroupObjectId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).AadConfigurationAdminGroupObjectId = (string[]) content.GetValueForProperty("AadConfigurationAdminGroupObjectId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).AadConfigurationAdminGroupObjectId, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("SshPublicKey")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).SshPublicKey = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey[]) content.GetValueForProperty("SshPublicKey",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).SshPublicKey, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.SshPublicKeyTypeConverter.ConvertFrom)); - } - if (content.Contains("ControlPlaneNodeConfigurationVMSkuName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).ControlPlaneNodeConfigurationVMSkuName = (string) content.GetValueForProperty("ControlPlaneNodeConfigurationVMSkuName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).ControlPlaneNodeConfigurationVMSkuName, global::System.Convert.ToString); - } - if (content.Contains("ControlPlaneNodeConfigurationAdministratorConfigurationAdminUsername")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).ControlPlaneNodeConfigurationAdministratorConfigurationAdminUsername = (string) content.GetValueForProperty("ControlPlaneNodeConfigurationAdministratorConfigurationAdminUsername",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).ControlPlaneNodeConfigurationAdministratorConfigurationAdminUsername, global::System.Convert.ToString); - } - if (content.Contains("NetworkConfigurationAttachedNetworkConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).NetworkConfigurationAttachedNetworkConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAttachedNetworkConfiguration) content.GetValueForProperty("NetworkConfigurationAttachedNetworkConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).NetworkConfigurationAttachedNetworkConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AttachedNetworkConfigurationTypeConverter.ConvertFrom); - } - if (content.Contains("NetworkConfigurationBgpServiceLoadBalancerConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).NetworkConfigurationBgpServiceLoadBalancerConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBgpServiceLoadBalancerConfiguration) content.GetValueForProperty("NetworkConfigurationBgpServiceLoadBalancerConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).NetworkConfigurationBgpServiceLoadBalancerConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BgpServiceLoadBalancerConfigurationTypeConverter.ConvertFrom); - } - if (content.Contains("NetworkConfigurationL2ServiceLoadBalancerConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).NetworkConfigurationL2ServiceLoadBalancerConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2ServiceLoadBalancerConfiguration) content.GetValueForProperty("NetworkConfigurationL2ServiceLoadBalancerConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).NetworkConfigurationL2ServiceLoadBalancerConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.L2ServiceLoadBalancerConfigurationTypeConverter.ConvertFrom); - } - if (content.Contains("NetworkConfigurationCloudServicesNetworkId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).NetworkConfigurationCloudServicesNetworkId = (string) content.GetValueForProperty("NetworkConfigurationCloudServicesNetworkId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).NetworkConfigurationCloudServicesNetworkId, global::System.Convert.ToString); - } - if (content.Contains("NetworkConfigurationCniNetworkId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).NetworkConfigurationCniNetworkId = (string) content.GetValueForProperty("NetworkConfigurationCniNetworkId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).NetworkConfigurationCniNetworkId, global::System.Convert.ToString); - } - if (content.Contains("NetworkConfigurationDnsServiceIP")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).NetworkConfigurationDnsServiceIP = (string) content.GetValueForProperty("NetworkConfigurationDnsServiceIP",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).NetworkConfigurationDnsServiceIP, global::System.Convert.ToString); - } - if (content.Contains("AttachedNetworkConfigurationL2Network")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).AttachedNetworkConfigurationL2Network = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkAttachmentConfiguration[]) content.GetValueForProperty("AttachedNetworkConfigurationL2Network",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).AttachedNetworkConfigurationL2Network, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.L2NetworkAttachmentConfigurationTypeConverter.ConvertFrom)); - } - if (content.Contains("AttachedNetworkConfigurationL3Network")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).AttachedNetworkConfigurationL3Network = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkAttachmentConfiguration[]) content.GetValueForProperty("AttachedNetworkConfigurationL3Network",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).AttachedNetworkConfigurationL3Network, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.L3NetworkAttachmentConfigurationTypeConverter.ConvertFrom)); - } - if (content.Contains("AttachedNetworkConfigurationTrunkedNetwork")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).AttachedNetworkConfigurationTrunkedNetwork = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkAttachmentConfiguration[]) content.GetValueForProperty("AttachedNetworkConfigurationTrunkedNetwork",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).AttachedNetworkConfigurationTrunkedNetwork, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.TrunkedNetworkAttachmentConfigurationTypeConverter.ConvertFrom)); - } - if (content.Contains("BgpServiceLoadBalancerConfigurationBgpAdvertisement")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).BgpServiceLoadBalancerConfigurationBgpAdvertisement = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBgpAdvertisement[]) content.GetValueForProperty("BgpServiceLoadBalancerConfigurationBgpAdvertisement",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).BgpServiceLoadBalancerConfigurationBgpAdvertisement, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BgpAdvertisementTypeConverter.ConvertFrom)); - } - if (content.Contains("BgpServiceLoadBalancerConfigurationBgpPeer")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).BgpServiceLoadBalancerConfigurationBgpPeer = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IServiceLoadBalancerBgpPeer[]) content.GetValueForProperty("BgpServiceLoadBalancerConfigurationBgpPeer",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).BgpServiceLoadBalancerConfigurationBgpPeer, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ServiceLoadBalancerBgpPeerTypeConverter.ConvertFrom)); - } - if (content.Contains("ControlPlaneNodeConfigurationAdministratorConfigurationSshPublicKey")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).ControlPlaneNodeConfigurationAdministratorConfigurationSshPublicKey = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey[]) content.GetValueForProperty("ControlPlaneNodeConfigurationAdministratorConfigurationSshPublicKey",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).ControlPlaneNodeConfigurationAdministratorConfigurationSshPublicKey, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.SshPublicKeyTypeConverter.ConvertFrom)); - } - if (content.Contains("BgpServiceLoadBalancerConfigurationFabricPeeringEnabled")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).BgpServiceLoadBalancerConfigurationFabricPeeringEnabled = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.FabricPeeringEnabled?) content.GetValueForProperty("BgpServiceLoadBalancerConfigurationFabricPeeringEnabled",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).BgpServiceLoadBalancerConfigurationFabricPeeringEnabled, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.FabricPeeringEnabled.CreateFrom); - } - if (content.Contains("BgpServiceLoadBalancerConfigurationIPAddressPool")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).BgpServiceLoadBalancerConfigurationIPAddressPool = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIPAddressPool[]) content.GetValueForProperty("BgpServiceLoadBalancerConfigurationIPAddressPool",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).BgpServiceLoadBalancerConfigurationIPAddressPool, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IPAddressPoolTypeConverter.ConvertFrom)); - } - if (content.Contains("L2ServiceLoadBalancerConfigurationIPAddressPool")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).L2ServiceLoadBalancerConfigurationIPAddressPool = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIPAddressPool[]) content.GetValueForProperty("L2ServiceLoadBalancerConfigurationIPAddressPool",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal)this).L2ServiceLoadBalancerConfigurationIPAddressPool, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IPAddressPoolTypeConverter.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.NetworkCloud.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(); - } - } - /// KubernetesClusterProperties represents the properties of Kubernetes cluster resource. - [System.ComponentModel.TypeConverter(typeof(KubernetesClusterPropertiesTypeConverter))] - public partial interface IKubernetesClusterProperties - - { - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesClusterProperties.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesClusterProperties.cs deleted file mode 100644 index 544525c29a9c..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesClusterProperties.cs +++ /dev/null @@ -1,837 +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.NetworkCloud.Models.Api20250201 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; - - /// - /// KubernetesClusterProperties represents the properties of Kubernetes cluster resource. - /// - public partial class KubernetesClusterProperties : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterProperties, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal - { - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAadConfiguration _aadConfiguration; - - /// The Azure Active Directory Integration properties. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAadConfiguration AadConfiguration { get => (this._aadConfiguration = this._aadConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AadConfiguration()); set => this._aadConfiguration = value; } - - /// - /// The list of Azure Active Directory group object IDs that will have an administrative role on the Kubernetes cluster. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string[] AadConfigurationAdminGroupObjectId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAadConfigurationInternal)AadConfiguration).AdminGroupObjectId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAadConfigurationInternal)AadConfiguration).AdminGroupObjectId = value ?? null /* arrayOf */; } - - /// - /// The user name for the administrator that will be applied to the operating systems that run Kubernetes nodes. If not supplied, - /// a user name will be chosen by the service. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string AdminUsername { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministratorConfigurationInternal)AdministratorConfiguration).AdminUsername; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministratorConfigurationInternal)AdministratorConfiguration).AdminUsername = value ?? null; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministratorConfiguration _administratorConfiguration; - - /// - /// The administrative credentials that will be applied to the control plane and agent pool nodes that do not specify their - /// own values. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministratorConfiguration AdministratorConfiguration { get => (this._administratorConfiguration = this._administratorConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AdministratorConfiguration()); set => this._administratorConfiguration = value; } - - /// The list of Layer 2 Networks and related configuration for attachment. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkAttachmentConfiguration[] AttachedNetworkConfigurationL2Network { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkConfigurationInternal)NetworkConfiguration).AttachedNetworkConfigurationL2Network; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkConfigurationInternal)NetworkConfiguration).AttachedNetworkConfigurationL2Network = value ?? null /* arrayOf */; } - - /// The list of Layer 3 Networks and related configuration for attachment. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkAttachmentConfiguration[] AttachedNetworkConfigurationL3Network { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkConfigurationInternal)NetworkConfiguration).AttachedNetworkConfigurationL3Network; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkConfigurationInternal)NetworkConfiguration).AttachedNetworkConfigurationL3Network = value ?? null /* arrayOf */; } - - /// The list of Trunked Networks and related configuration for attachment. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkAttachmentConfiguration[] AttachedNetworkConfigurationTrunkedNetwork { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkConfigurationInternal)NetworkConfiguration).AttachedNetworkConfigurationTrunkedNetwork; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkConfigurationInternal)NetworkConfiguration).AttachedNetworkConfigurationTrunkedNetwork = value ?? null /* arrayOf */; } - - /// Backing field for property. - private string[] _attachedNetworkId; - - /// - /// The full list of network resource IDs that are attached to this cluster, including those attached only to specific agent - /// pools. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string[] AttachedNetworkId { get => this._attachedNetworkId; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAvailableUpgrade[] _availableUpgrade; - - /// The list of versions that this Kubernetes cluster can be upgraded to. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAvailableUpgrade[] AvailableUpgrade { get => this._availableUpgrade; } - - /// - /// The association of IP address pools to the communities and peers, allowing for announcement of IPs. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBgpAdvertisement[] BgpServiceLoadBalancerConfigurationBgpAdvertisement { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkConfigurationInternal)NetworkConfiguration).BgpServiceLoadBalancerConfigurationBgpAdvertisement; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkConfigurationInternal)NetworkConfiguration).BgpServiceLoadBalancerConfigurationBgpAdvertisement = value ?? null /* arrayOf */; } - - /// - /// The list of additional BgpPeer entities that the Kubernetes cluster will peer with. All peering must be explicitly defined. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IServiceLoadBalancerBgpPeer[] BgpServiceLoadBalancerConfigurationBgpPeer { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkConfigurationInternal)NetworkConfiguration).BgpServiceLoadBalancerConfigurationBgpPeer; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkConfigurationInternal)NetworkConfiguration).BgpServiceLoadBalancerConfigurationBgpPeer = value ?? null /* arrayOf */; } - - /// The indicator to specify if the load balancer peers with the network fabric. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.FabricPeeringEnabled? BgpServiceLoadBalancerConfigurationFabricPeeringEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkConfigurationInternal)NetworkConfiguration).BgpServiceLoadBalancerConfigurationFabricPeeringEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkConfigurationInternal)NetworkConfiguration).BgpServiceLoadBalancerConfigurationFabricPeeringEnabled = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.FabricPeeringEnabled)""); } - - /// - /// The list of pools of IP addresses that can be allocated to load balancer services. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIPAddressPool[] BgpServiceLoadBalancerConfigurationIPAddressPool { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkConfigurationInternal)NetworkConfiguration).BgpServiceLoadBalancerConfigurationIPAddressPool; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkConfigurationInternal)NetworkConfiguration).BgpServiceLoadBalancerConfigurationIPAddressPool = value ?? null /* arrayOf */; } - - /// Backing field for property. - private string _clusterId; - - /// The resource ID of the Network Cloud cluster. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string ClusterId { get => this._clusterId; } - - /// Backing field for property. - private string _connectedClusterId; - - /// - /// The resource ID of the connected cluster set up when this Kubernetes cluster is created. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string ConnectedClusterId { get => this._connectedClusterId; } - - /// Backing field for property. - private string _controlPlaneKubernetesVersion; - - /// The current running version of Kubernetes on the control plane. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string ControlPlaneKubernetesVersion { get => this._controlPlaneKubernetesVersion; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IControlPlaneNodeConfiguration _controlPlaneNodeConfiguration; - - /// The defining characteristics of the control plane for this Kubernetes Cluster. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IControlPlaneNodeConfiguration ControlPlaneNodeConfiguration { get => (this._controlPlaneNodeConfiguration = this._controlPlaneNodeConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ControlPlaneNodeConfiguration()); set => this._controlPlaneNodeConfiguration = value; } - - /// - /// The user name for the administrator that will be applied to the operating systems that run Kubernetes nodes. If not supplied, - /// a user name will be chosen by the service. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string ControlPlaneNodeConfigurationAdministratorConfigurationAdminUsername { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IControlPlaneNodeConfigurationInternal)ControlPlaneNodeConfiguration).AdministratorConfigurationAdminUsername; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IControlPlaneNodeConfigurationInternal)ControlPlaneNodeConfiguration).AdministratorConfigurationAdminUsername = value ?? null; } - - /// - /// The SSH configuration for the operating systems that run the nodes in the Kubernetes cluster. In some cases, specification - /// of public keys may be required to produce a working environment. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey[] ControlPlaneNodeConfigurationAdministratorConfigurationSshPublicKey { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IControlPlaneNodeConfigurationInternal)ControlPlaneNodeConfiguration).AdministratorConfigurationSshPublicKey; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IControlPlaneNodeConfigurationInternal)ControlPlaneNodeConfiguration).AdministratorConfigurationSshPublicKey = value ?? null /* arrayOf */; } - - /// - /// The list of availability zones of the Network Cloud cluster to be used for the provisioning of nodes in the control plane. - /// If not specified, all availability zones will be used. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string[] ControlPlaneNodeConfigurationAvailabilityZone { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IControlPlaneNodeConfigurationInternal)ControlPlaneNodeConfiguration).AvailabilityZone; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IControlPlaneNodeConfigurationInternal)ControlPlaneNodeConfiguration).AvailabilityZone = value ?? null /* arrayOf */; } - - /// The number of virtual machines that use this configuration. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public long ControlPlaneNodeConfigurationCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IControlPlaneNodeConfigurationInternal)ControlPlaneNodeConfiguration).Count; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IControlPlaneNodeConfigurationInternal)ControlPlaneNodeConfiguration).Count = value ; } - - /// The name of the VM SKU supplied during creation. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string ControlPlaneNodeConfigurationVMSkuName { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IControlPlaneNodeConfigurationInternal)ControlPlaneNodeConfiguration).VMSkuName; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IControlPlaneNodeConfigurationInternal)ControlPlaneNodeConfiguration).VMSkuName = value ; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterDetailedStatus? _detailedStatus; - - /// The current status of the Kubernetes cluster. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterDetailedStatus? DetailedStatus { get => this._detailedStatus; } - - /// Backing field for property. - private string _detailedStatusMessage; - - /// The descriptive message about the current detailed status. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string DetailedStatusMessage { get => this._detailedStatusMessage; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IFeatureStatus[] _featureStatuses; - - /// The current feature settings. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IFeatureStatus[] FeatureStatuses { get => this._featureStatuses; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IInitialAgentPoolConfiguration[] _initialAgentPoolConfiguration; - - /// - /// The agent pools that are created with this Kubernetes cluster for running critical system services and workloads. This - /// data in this field is only used during creation, and the field will be empty following the creation of the Kubernetes - /// Cluster. After creation, the management of agent pools is done using the agentPools sub-resource. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IInitialAgentPoolConfiguration[] InitialAgentPoolConfiguration { get => this._initialAgentPoolConfiguration; set => this._initialAgentPoolConfiguration = value; } - - /// Backing field for property. - private string _kubernetesVersion; - - /// The Kubernetes version for this cluster. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string KubernetesVersion { get => this._kubernetesVersion; set => this._kubernetesVersion = value; } - - /// - /// The list of pools of IP addresses that can be allocated to load balancer services. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIPAddressPool[] L2ServiceLoadBalancerConfigurationIPAddressPool { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkConfigurationInternal)NetworkConfiguration).L2ServiceLoadBalancerConfigurationIPAddressPool; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkConfigurationInternal)NetworkConfiguration).L2ServiceLoadBalancerConfigurationIPAddressPool = value ?? null /* arrayOf */; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IManagedResourceGroupConfiguration _managedResourceGroupConfiguration; - - /// The configuration of the managed resource group associated with the resource. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IManagedResourceGroupConfiguration ManagedResourceGroupConfiguration { get => (this._managedResourceGroupConfiguration = this._managedResourceGroupConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ManagedResourceGroupConfiguration()); set => this._managedResourceGroupConfiguration = value; } - - /// - /// The location of the managed resource group. If not specified, the location of the parent resource is chosen. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string ManagedResourceGroupConfigurationLocation { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IManagedResourceGroupConfigurationInternal)ManagedResourceGroupConfiguration).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IManagedResourceGroupConfigurationInternal)ManagedResourceGroupConfiguration).Location = value ?? null; } - - /// - /// The name for the managed resource group. If not specified, the unique name is automatically generated. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string ManagedResourceGroupConfigurationName { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IManagedResourceGroupConfigurationInternal)ManagedResourceGroupConfiguration).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IManagedResourceGroupConfigurationInternal)ManagedResourceGroupConfiguration).Name = value ?? null; } - - /// Internal Acessors for AadConfiguration - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAadConfiguration Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal.AadConfiguration { get => (this._aadConfiguration = this._aadConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AadConfiguration()); set { {_aadConfiguration = value;} } } - - /// Internal Acessors for AdministratorConfiguration - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministratorConfiguration Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal.AdministratorConfiguration { get => (this._administratorConfiguration = this._administratorConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AdministratorConfiguration()); set { {_administratorConfiguration = value;} } } - - /// Internal Acessors for AttachedNetworkId - string[] Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal.AttachedNetworkId { get => this._attachedNetworkId; set { {_attachedNetworkId = value;} } } - - /// Internal Acessors for AvailableUpgrade - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAvailableUpgrade[] Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal.AvailableUpgrade { get => this._availableUpgrade; set { {_availableUpgrade = value;} } } - - /// Internal Acessors for ClusterId - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal.ClusterId { get => this._clusterId; set { {_clusterId = value;} } } - - /// Internal Acessors for ConnectedClusterId - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal.ConnectedClusterId { get => this._connectedClusterId; set { {_connectedClusterId = value;} } } - - /// Internal Acessors for ControlPlaneKubernetesVersion - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal.ControlPlaneKubernetesVersion { get => this._controlPlaneKubernetesVersion; set { {_controlPlaneKubernetesVersion = value;} } } - - /// Internal Acessors for ControlPlaneNodeConfiguration - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IControlPlaneNodeConfiguration Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal.ControlPlaneNodeConfiguration { get => (this._controlPlaneNodeConfiguration = this._controlPlaneNodeConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ControlPlaneNodeConfiguration()); set { {_controlPlaneNodeConfiguration = value;} } } - - /// Internal Acessors for ControlPlaneNodeConfigurationAdministratorConfiguration - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministratorConfiguration Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal.ControlPlaneNodeConfigurationAdministratorConfiguration { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IControlPlaneNodeConfigurationInternal)ControlPlaneNodeConfiguration).AdministratorConfiguration; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IControlPlaneNodeConfigurationInternal)ControlPlaneNodeConfiguration).AdministratorConfiguration = value; } - - /// Internal Acessors for DetailedStatus - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterDetailedStatus? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal.DetailedStatus { get => this._detailedStatus; set { {_detailedStatus = value;} } } - - /// Internal Acessors for DetailedStatusMessage - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal.DetailedStatusMessage { get => this._detailedStatusMessage; set { {_detailedStatusMessage = value;} } } - - /// Internal Acessors for FeatureStatuses - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IFeatureStatus[] Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal.FeatureStatuses { get => this._featureStatuses; set { {_featureStatuses = value;} } } - - /// Internal Acessors for ManagedResourceGroupConfiguration - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IManagedResourceGroupConfiguration Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal.ManagedResourceGroupConfiguration { get => (this._managedResourceGroupConfiguration = this._managedResourceGroupConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ManagedResourceGroupConfiguration()); set { {_managedResourceGroupConfiguration = value;} } } - - /// Internal Acessors for NetworkConfiguration - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkConfiguration Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal.NetworkConfiguration { get => (this._networkConfiguration = this._networkConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.NetworkConfiguration()); set { {_networkConfiguration = value;} } } - - /// Internal Acessors for NetworkConfigurationAttachedNetworkConfiguration - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAttachedNetworkConfiguration Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal.NetworkConfigurationAttachedNetworkConfiguration { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkConfigurationInternal)NetworkConfiguration).AttachedNetworkConfiguration; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkConfigurationInternal)NetworkConfiguration).AttachedNetworkConfiguration = value; } - - /// Internal Acessors for NetworkConfigurationBgpServiceLoadBalancerConfiguration - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBgpServiceLoadBalancerConfiguration Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal.NetworkConfigurationBgpServiceLoadBalancerConfiguration { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkConfigurationInternal)NetworkConfiguration).BgpServiceLoadBalancerConfiguration; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkConfigurationInternal)NetworkConfiguration).BgpServiceLoadBalancerConfiguration = value; } - - /// Internal Acessors for NetworkConfigurationL2ServiceLoadBalancerConfiguration - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2ServiceLoadBalancerConfiguration Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal.NetworkConfigurationL2ServiceLoadBalancerConfiguration { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkConfigurationInternal)NetworkConfiguration).L2ServiceLoadBalancerConfiguration; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkConfigurationInternal)NetworkConfiguration).L2ServiceLoadBalancerConfiguration = value; } - - /// Internal Acessors for Node - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterNode[] Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal.Node { get => this._node; set { {_node = value;} } } - - /// Internal Acessors for ProvisioningState - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterProvisioningState? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPropertiesInternal.ProvisioningState { get => this._provisioningState; set { {_provisioningState = value;} } } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkConfiguration _networkConfiguration; - - /// - /// The configuration of the Kubernetes cluster networking, including the attachment of networks that span the cluster. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkConfiguration NetworkConfiguration { get => (this._networkConfiguration = this._networkConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.NetworkConfiguration()); set => this._networkConfiguration = value; } - - /// The resource ID of the associated Cloud Services network. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string NetworkConfigurationCloudServicesNetworkId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkConfigurationInternal)NetworkConfiguration).CloudServicesNetworkId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkConfigurationInternal)NetworkConfiguration).CloudServicesNetworkId = value ; } - - /// - /// The resource ID of the Layer 3 network that is used for creation of the Container Networking Interface network. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string NetworkConfigurationCniNetworkId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkConfigurationInternal)NetworkConfiguration).CniNetworkId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkConfigurationInternal)NetworkConfiguration).CniNetworkId = value ; } - - /// - /// The IP address assigned to the Kubernetes DNS service. It must be within the Kubernetes service address range specified - /// in service CIDR. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string NetworkConfigurationDnsServiceIP { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkConfigurationInternal)NetworkConfiguration).DnsServiceIP; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkConfigurationInternal)NetworkConfiguration).DnsServiceIP = value ?? null; } - - /// - /// The CIDR notation IP ranges from which to assign pod IPs. One IPv4 CIDR is expected for single-stack networking. Two CIDRs, - /// one for each IP family (IPv4/IPv6), is expected for dual-stack networking. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string[] NetworkConfigurationPodCidr { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkConfigurationInternal)NetworkConfiguration).PodCidr; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkConfigurationInternal)NetworkConfiguration).PodCidr = value ?? null /* arrayOf */; } - - /// - /// The CIDR notation IP ranges from which to assign service IPs. One IPv4 CIDR is expected for single-stack networking. Two - /// CIDRs, one for each IP family (IPv4/IPv6), is expected for dual-stack networking. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string[] NetworkConfigurationServiceCidr { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkConfigurationInternal)NetworkConfiguration).ServiceCidr; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkConfigurationInternal)NetworkConfiguration).ServiceCidr = value ?? null /* arrayOf */; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterNode[] _node; - - /// The details of the nodes in this cluster. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterNode[] Node { get => this._node; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterProvisioningState? _provisioningState; - - /// The provisioning state of the Kubernetes cluster resource. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterProvisioningState? ProvisioningState { get => this._provisioningState; } - - /// - /// The SSH configuration for the operating systems that run the nodes in the Kubernetes cluster. In some cases, specification - /// of public keys may be required to produce a working environment. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey[] SshPublicKey { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministratorConfigurationInternal)AdministratorConfiguration).SshPublicKey; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministratorConfigurationInternal)AdministratorConfiguration).SshPublicKey = value ?? null /* arrayOf */; } - - /// Creates an new instance. - public KubernetesClusterProperties() - { - - } - } - /// KubernetesClusterProperties represents the properties of Kubernetes cluster resource. - public partial interface IKubernetesClusterProperties : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable - { - /// - /// The list of Azure Active Directory group object IDs that will have an administrative role on the Kubernetes cluster. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The list of Azure Active Directory group object IDs that will have an administrative role on the Kubernetes cluster.", - SerializedName = @"adminGroupObjectIds", - PossibleTypes = new [] { typeof(string) })] - string[] AadConfigurationAdminGroupObjectId { get; set; } - /// - /// The user name for the administrator that will be applied to the operating systems that run Kubernetes nodes. If not supplied, - /// a user name will be chosen by the service. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The user name for the administrator that will be applied to the operating systems that run Kubernetes nodes. If not supplied, a user name will be chosen by the service.", - SerializedName = @"adminUsername", - PossibleTypes = new [] { typeof(string) })] - string AdminUsername { get; set; } - /// The list of Layer 2 Networks and related configuration for attachment. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The list of Layer 2 Networks and related configuration for attachment.", - SerializedName = @"l2Networks", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkAttachmentConfiguration) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkAttachmentConfiguration[] AttachedNetworkConfigurationL2Network { get; set; } - /// The list of Layer 3 Networks and related configuration for attachment. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The list of Layer 3 Networks and related configuration for attachment.", - SerializedName = @"l3Networks", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkAttachmentConfiguration) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkAttachmentConfiguration[] AttachedNetworkConfigurationL3Network { get; set; } - /// The list of Trunked Networks and related configuration for attachment. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The list of Trunked Networks and related configuration for attachment.", - SerializedName = @"trunkedNetworks", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkAttachmentConfiguration) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkAttachmentConfiguration[] AttachedNetworkConfigurationTrunkedNetwork { get; set; } - /// - /// The full list of network resource IDs that are attached to this cluster, including those attached only to specific agent - /// pools. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The full list of network resource IDs that are attached to this cluster, including those attached only to specific agent pools.", - SerializedName = @"attachedNetworkIds", - PossibleTypes = new [] { typeof(string) })] - string[] AttachedNetworkId { get; } - /// The list of versions that this Kubernetes cluster can be upgraded to. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The list of versions that this Kubernetes cluster can be upgraded to.", - SerializedName = @"availableUpgrades", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAvailableUpgrade) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAvailableUpgrade[] AvailableUpgrade { get; } - /// - /// The association of IP address pools to the communities and peers, allowing for announcement of IPs. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The association of IP address pools to the communities and peers, allowing for announcement of IPs.", - SerializedName = @"bgpAdvertisements", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBgpAdvertisement) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBgpAdvertisement[] BgpServiceLoadBalancerConfigurationBgpAdvertisement { get; set; } - /// - /// The list of additional BgpPeer entities that the Kubernetes cluster will peer with. All peering must be explicitly defined. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The list of additional BgpPeer entities that the Kubernetes cluster will peer with. All peering must be explicitly defined.", - SerializedName = @"bgpPeers", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IServiceLoadBalancerBgpPeer) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IServiceLoadBalancerBgpPeer[] BgpServiceLoadBalancerConfigurationBgpPeer { get; set; } - /// The indicator to specify if the load balancer peers with the network fabric. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The indicator to specify if the load balancer peers with the network fabric.", - SerializedName = @"fabricPeeringEnabled", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.FabricPeeringEnabled) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.FabricPeeringEnabled? BgpServiceLoadBalancerConfigurationFabricPeeringEnabled { get; set; } - /// - /// The list of pools of IP addresses that can be allocated to load balancer services. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The list of pools of IP addresses that can be allocated to load balancer services.", - SerializedName = @"ipAddressPools", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIPAddressPool) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIPAddressPool[] BgpServiceLoadBalancerConfigurationIPAddressPool { get; set; } - /// The resource ID of the Network Cloud cluster. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The resource ID of the Network Cloud cluster.", - SerializedName = @"clusterId", - PossibleTypes = new [] { typeof(string) })] - string ClusterId { get; } - /// - /// The resource ID of the connected cluster set up when this Kubernetes cluster is created. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The resource ID of the connected cluster set up when this Kubernetes cluster is created.", - SerializedName = @"connectedClusterId", - PossibleTypes = new [] { typeof(string) })] - string ConnectedClusterId { get; } - /// The current running version of Kubernetes on the control plane. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The current running version of Kubernetes on the control plane.", - SerializedName = @"controlPlaneKubernetesVersion", - PossibleTypes = new [] { typeof(string) })] - string ControlPlaneKubernetesVersion { get; } - /// - /// The user name for the administrator that will be applied to the operating systems that run Kubernetes nodes. If not supplied, - /// a user name will be chosen by the service. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The user name for the administrator that will be applied to the operating systems that run Kubernetes nodes. If not supplied, a user name will be chosen by the service.", - SerializedName = @"adminUsername", - PossibleTypes = new [] { typeof(string) })] - string ControlPlaneNodeConfigurationAdministratorConfigurationAdminUsername { get; set; } - /// - /// The SSH configuration for the operating systems that run the nodes in the Kubernetes cluster. In some cases, specification - /// of public keys may be required to produce a working environment. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The SSH configuration for the operating systems that run the nodes in the Kubernetes cluster. In some cases, specification of public keys may be required to produce a working environment.", - SerializedName = @"sshPublicKeys", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey[] ControlPlaneNodeConfigurationAdministratorConfigurationSshPublicKey { get; set; } - /// - /// The list of availability zones of the Network Cloud cluster to be used for the provisioning of nodes in the control plane. - /// If not specified, all availability zones will be used. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The list of availability zones of the Network Cloud cluster to be used for the provisioning of nodes in the control plane. If not specified, all availability zones will be used.", - SerializedName = @"availabilityZones", - PossibleTypes = new [] { typeof(string) })] - string[] ControlPlaneNodeConfigurationAvailabilityZone { get; set; } - /// The number of virtual machines that use this configuration. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The number of virtual machines that use this configuration.", - SerializedName = @"count", - PossibleTypes = new [] { typeof(long) })] - long ControlPlaneNodeConfigurationCount { get; set; } - /// The name of the VM SKU supplied during creation. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The name of the VM SKU supplied during creation.", - SerializedName = @"vmSkuName", - PossibleTypes = new [] { typeof(string) })] - string ControlPlaneNodeConfigurationVMSkuName { get; set; } - /// The current status of the Kubernetes cluster. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The current status of the Kubernetes cluster.", - SerializedName = @"detailedStatus", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterDetailedStatus) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterDetailedStatus? DetailedStatus { get; } - /// The descriptive message about the current detailed status. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The descriptive message about the current detailed status.", - SerializedName = @"detailedStatusMessage", - PossibleTypes = new [] { typeof(string) })] - string DetailedStatusMessage { get; } - /// The current feature settings. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The current feature settings.", - SerializedName = @"featureStatuses", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IFeatureStatus) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IFeatureStatus[] FeatureStatuses { get; } - /// - /// The agent pools that are created with this Kubernetes cluster for running critical system services and workloads. This - /// data in this field is only used during creation, and the field will be empty following the creation of the Kubernetes - /// Cluster. After creation, the management of agent pools is done using the agentPools sub-resource. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The agent pools that are created with this Kubernetes cluster for running critical system services and workloads. This data in this field is only used during creation, and the field will be empty following the creation of the Kubernetes Cluster. After creation, the management of agent pools is done using the agentPools sub-resource.", - SerializedName = @"initialAgentPoolConfigurations", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IInitialAgentPoolConfiguration) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IInitialAgentPoolConfiguration[] InitialAgentPoolConfiguration { get; set; } - /// The Kubernetes version for this cluster. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The Kubernetes version for this cluster.", - SerializedName = @"kubernetesVersion", - PossibleTypes = new [] { typeof(string) })] - string KubernetesVersion { get; set; } - /// - /// The list of pools of IP addresses that can be allocated to load balancer services. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The list of pools of IP addresses that can be allocated to load balancer services.", - SerializedName = @"ipAddressPools", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIPAddressPool) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIPAddressPool[] L2ServiceLoadBalancerConfigurationIPAddressPool { get; set; } - /// - /// The location of the managed resource group. If not specified, the location of the parent resource is chosen. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The location of the managed resource group. If not specified, the location of the parent resource is chosen.", - SerializedName = @"location", - PossibleTypes = new [] { typeof(string) })] - string ManagedResourceGroupConfigurationLocation { get; set; } - /// - /// The name for the managed resource group. If not specified, the unique name is automatically generated. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The name for the managed resource group. If not specified, the unique name is automatically generated.", - SerializedName = @"name", - PossibleTypes = new [] { typeof(string) })] - string ManagedResourceGroupConfigurationName { get; set; } - /// The resource ID of the associated Cloud Services network. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The resource ID of the associated Cloud Services network.", - SerializedName = @"cloudServicesNetworkId", - PossibleTypes = new [] { typeof(string) })] - string NetworkConfigurationCloudServicesNetworkId { get; set; } - /// - /// The resource ID of the Layer 3 network that is used for creation of the Container Networking Interface network. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The resource ID of the Layer 3 network that is used for creation of the Container Networking Interface network.", - SerializedName = @"cniNetworkId", - PossibleTypes = new [] { typeof(string) })] - string NetworkConfigurationCniNetworkId { get; set; } - /// - /// The IP address assigned to the Kubernetes DNS service. It must be within the Kubernetes service address range specified - /// in service CIDR. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The IP address assigned to the Kubernetes DNS service. It must be within the Kubernetes service address range specified in service CIDR.", - SerializedName = @"dnsServiceIp", - PossibleTypes = new [] { typeof(string) })] - string NetworkConfigurationDnsServiceIP { get; set; } - /// - /// The CIDR notation IP ranges from which to assign pod IPs. One IPv4 CIDR is expected for single-stack networking. Two CIDRs, - /// one for each IP family (IPv4/IPv6), is expected for dual-stack networking. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The CIDR notation IP ranges from which to assign pod IPs. One IPv4 CIDR is expected for single-stack networking. Two CIDRs, one for each IP family (IPv4/IPv6), is expected for dual-stack networking.", - SerializedName = @"podCidrs", - PossibleTypes = new [] { typeof(string) })] - string[] NetworkConfigurationPodCidr { get; set; } - /// - /// The CIDR notation IP ranges from which to assign service IPs. One IPv4 CIDR is expected for single-stack networking. Two - /// CIDRs, one for each IP family (IPv4/IPv6), is expected for dual-stack networking. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The CIDR notation IP ranges from which to assign service IPs. One IPv4 CIDR is expected for single-stack networking. Two CIDRs, one for each IP family (IPv4/IPv6), is expected for dual-stack networking.", - SerializedName = @"serviceCidrs", - PossibleTypes = new [] { typeof(string) })] - string[] NetworkConfigurationServiceCidr { get; set; } - /// The details of the nodes in this cluster. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The details of the nodes in this cluster.", - SerializedName = @"nodes", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterNode) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterNode[] Node { get; } - /// The provisioning state of the Kubernetes cluster resource. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The provisioning state of the Kubernetes cluster resource.", - SerializedName = @"provisioningState", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterProvisioningState) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterProvisioningState? ProvisioningState { get; } - /// - /// The SSH configuration for the operating systems that run the nodes in the Kubernetes cluster. In some cases, specification - /// of public keys may be required to produce a working environment. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The SSH configuration for the operating systems that run the nodes in the Kubernetes cluster. In some cases, specification of public keys may be required to produce a working environment.", - SerializedName = @"sshPublicKeys", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey[] SshPublicKey { get; set; } - - } - /// KubernetesClusterProperties represents the properties of Kubernetes cluster resource. - internal partial interface IKubernetesClusterPropertiesInternal - - { - /// The Azure Active Directory Integration properties. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAadConfiguration AadConfiguration { get; set; } - /// - /// The list of Azure Active Directory group object IDs that will have an administrative role on the Kubernetes cluster. - /// - string[] AadConfigurationAdminGroupObjectId { get; set; } - /// - /// The user name for the administrator that will be applied to the operating systems that run Kubernetes nodes. If not supplied, - /// a user name will be chosen by the service. - /// - string AdminUsername { get; set; } - /// - /// The administrative credentials that will be applied to the control plane and agent pool nodes that do not specify their - /// own values. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministratorConfiguration AdministratorConfiguration { get; set; } - /// The list of Layer 2 Networks and related configuration for attachment. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkAttachmentConfiguration[] AttachedNetworkConfigurationL2Network { get; set; } - /// The list of Layer 3 Networks and related configuration for attachment. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkAttachmentConfiguration[] AttachedNetworkConfigurationL3Network { get; set; } - /// The list of Trunked Networks and related configuration for attachment. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkAttachmentConfiguration[] AttachedNetworkConfigurationTrunkedNetwork { get; set; } - /// - /// The full list of network resource IDs that are attached to this cluster, including those attached only to specific agent - /// pools. - /// - string[] AttachedNetworkId { get; set; } - /// The list of versions that this Kubernetes cluster can be upgraded to. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAvailableUpgrade[] AvailableUpgrade { get; set; } - /// - /// The association of IP address pools to the communities and peers, allowing for announcement of IPs. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBgpAdvertisement[] BgpServiceLoadBalancerConfigurationBgpAdvertisement { get; set; } - /// - /// The list of additional BgpPeer entities that the Kubernetes cluster will peer with. All peering must be explicitly defined. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IServiceLoadBalancerBgpPeer[] BgpServiceLoadBalancerConfigurationBgpPeer { get; set; } - /// The indicator to specify if the load balancer peers with the network fabric. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.FabricPeeringEnabled? BgpServiceLoadBalancerConfigurationFabricPeeringEnabled { get; set; } - /// - /// The list of pools of IP addresses that can be allocated to load balancer services. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIPAddressPool[] BgpServiceLoadBalancerConfigurationIPAddressPool { get; set; } - /// The resource ID of the Network Cloud cluster. - string ClusterId { get; set; } - /// - /// The resource ID of the connected cluster set up when this Kubernetes cluster is created. - /// - string ConnectedClusterId { get; set; } - /// The current running version of Kubernetes on the control plane. - string ControlPlaneKubernetesVersion { get; set; } - /// The defining characteristics of the control plane for this Kubernetes Cluster. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IControlPlaneNodeConfiguration ControlPlaneNodeConfiguration { get; set; } - /// The administrator credentials to be used for the nodes in the control plane. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministratorConfiguration ControlPlaneNodeConfigurationAdministratorConfiguration { get; set; } - /// - /// The user name for the administrator that will be applied to the operating systems that run Kubernetes nodes. If not supplied, - /// a user name will be chosen by the service. - /// - string ControlPlaneNodeConfigurationAdministratorConfigurationAdminUsername { get; set; } - /// - /// The SSH configuration for the operating systems that run the nodes in the Kubernetes cluster. In some cases, specification - /// of public keys may be required to produce a working environment. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey[] ControlPlaneNodeConfigurationAdministratorConfigurationSshPublicKey { get; set; } - /// - /// The list of availability zones of the Network Cloud cluster to be used for the provisioning of nodes in the control plane. - /// If not specified, all availability zones will be used. - /// - string[] ControlPlaneNodeConfigurationAvailabilityZone { get; set; } - /// The number of virtual machines that use this configuration. - long ControlPlaneNodeConfigurationCount { get; set; } - /// The name of the VM SKU supplied during creation. - string ControlPlaneNodeConfigurationVMSkuName { get; set; } - /// The current status of the Kubernetes cluster. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterDetailedStatus? DetailedStatus { get; set; } - /// The descriptive message about the current detailed status. - string DetailedStatusMessage { get; set; } - /// The current feature settings. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IFeatureStatus[] FeatureStatuses { get; set; } - /// - /// The agent pools that are created with this Kubernetes cluster for running critical system services and workloads. This - /// data in this field is only used during creation, and the field will be empty following the creation of the Kubernetes - /// Cluster. After creation, the management of agent pools is done using the agentPools sub-resource. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IInitialAgentPoolConfiguration[] InitialAgentPoolConfiguration { get; set; } - /// The Kubernetes version for this cluster. - string KubernetesVersion { get; set; } - /// - /// The list of pools of IP addresses that can be allocated to load balancer services. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIPAddressPool[] L2ServiceLoadBalancerConfigurationIPAddressPool { get; set; } - /// The configuration of the managed resource group associated with the resource. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IManagedResourceGroupConfiguration ManagedResourceGroupConfiguration { get; set; } - /// - /// The location of the managed resource group. If not specified, the location of the parent resource is chosen. - /// - string ManagedResourceGroupConfigurationLocation { get; set; } - /// - /// The name for the managed resource group. If not specified, the unique name is automatically generated. - /// - string ManagedResourceGroupConfigurationName { get; set; } - /// - /// The configuration of the Kubernetes cluster networking, including the attachment of networks that span the cluster. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkConfiguration NetworkConfiguration { get; set; } - /// - /// The configuration of networks being attached to the cluster for use by the workloads that run on this Kubernetes cluster. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAttachedNetworkConfiguration NetworkConfigurationAttachedNetworkConfiguration { get; set; } - /// - /// The configuration of the BGP service load balancer for this Kubernetes cluster. A maximum of one service load balancer - /// may be specified, either Layer 2 or BGP. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBgpServiceLoadBalancerConfiguration NetworkConfigurationBgpServiceLoadBalancerConfiguration { get; set; } - /// The resource ID of the associated Cloud Services network. - string NetworkConfigurationCloudServicesNetworkId { get; set; } - /// - /// The resource ID of the Layer 3 network that is used for creation of the Container Networking Interface network. - /// - string NetworkConfigurationCniNetworkId { get; set; } - /// - /// The IP address assigned to the Kubernetes DNS service. It must be within the Kubernetes service address range specified - /// in service CIDR. - /// - string NetworkConfigurationDnsServiceIP { get; set; } - /// - /// The configuration of the Layer 2 service load balancer for this Kubernetes cluster. A maximum of one service load balancer - /// may be specified, either Layer 2 or BGP. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2ServiceLoadBalancerConfiguration NetworkConfigurationL2ServiceLoadBalancerConfiguration { get; set; } - /// - /// The CIDR notation IP ranges from which to assign pod IPs. One IPv4 CIDR is expected for single-stack networking. Two CIDRs, - /// one for each IP family (IPv4/IPv6), is expected for dual-stack networking. - /// - string[] NetworkConfigurationPodCidr { get; set; } - /// - /// The CIDR notation IP ranges from which to assign service IPs. One IPv4 CIDR is expected for single-stack networking. Two - /// CIDRs, one for each IP family (IPv4/IPv6), is expected for dual-stack networking. - /// - string[] NetworkConfigurationServiceCidr { get; set; } - /// The details of the nodes in this cluster. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterNode[] Node { get; set; } - /// The provisioning state of the Kubernetes cluster resource. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterProvisioningState? ProvisioningState { get; set; } - /// - /// The SSH configuration for the operating systems that run the nodes in the Kubernetes cluster. In some cases, specification - /// of public keys may be required to produce a working environment. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey[] SshPublicKey { get; set; } - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesClusterProperties.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesClusterProperties.json.cs deleted file mode 100644 index 759c84e6500d..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesClusterProperties.json.cs +++ /dev/null @@ -1,212 +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.NetworkCloud.Models.Api20250201 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; - - /// - /// KubernetesClusterProperties represents the properties of Kubernetes cluster resource. - /// - public partial class KubernetesClusterProperties - { - - /// - /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object - /// before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The JsonNode that should be deserialized into this object. - - partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json); - - /// - /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The JSON container that the serialization result will be placed in. - - partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container); - - /// - /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of - /// the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the - /// output parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The JsonNode that should be deserialized into this object. - /// Determines if the rest of the deserialization should be processed, or if the method should return - /// instantly. - - partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json, ref bool returnNow); - - /// - /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the - /// object before it is serialized. - /// If you wish to disable the default serialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The JSON container that the serialization result will be placed in. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, ref bool returnNow); - - /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterProperties. - /// - /// a to deserialize from. - /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterProperties. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) - { - return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new KubernetesClusterProperties(json) : null; - } - - /// - /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject into a new instance of . - /// - /// A Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject instance to deserialize from. - internal KubernetesClusterProperties(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) - { - bool returnNow = false; - BeforeFromJson(json, ref returnNow); - if (returnNow) - { - return; - } - {_aadConfiguration = If( json?.PropertyT("aadConfiguration"), out var __jsonAadConfiguration) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AadConfiguration.FromJson(__jsonAadConfiguration) : AadConfiguration;} - {_administratorConfiguration = If( json?.PropertyT("administratorConfiguration"), out var __jsonAdministratorConfiguration) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AdministratorConfiguration.FromJson(__jsonAdministratorConfiguration) : AdministratorConfiguration;} - {_controlPlaneNodeConfiguration = If( json?.PropertyT("controlPlaneNodeConfiguration"), out var __jsonControlPlaneNodeConfiguration) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ControlPlaneNodeConfiguration.FromJson(__jsonControlPlaneNodeConfiguration) : ControlPlaneNodeConfiguration;} - {_managedResourceGroupConfiguration = If( json?.PropertyT("managedResourceGroupConfiguration"), out var __jsonManagedResourceGroupConfiguration) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ManagedResourceGroupConfiguration.FromJson(__jsonManagedResourceGroupConfiguration) : ManagedResourceGroupConfiguration;} - {_networkConfiguration = If( json?.PropertyT("networkConfiguration"), out var __jsonNetworkConfiguration) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.NetworkConfiguration.FromJson(__jsonNetworkConfiguration) : NetworkConfiguration;} - {_attachedNetworkId = If( json?.PropertyT("attachedNetworkIds"), out var __jsonAttachedNetworkIds) ? If( __jsonAttachedNetworkIds as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : AttachedNetworkId;} - {_availableUpgrade = If( json?.PropertyT("availableUpgrades"), out var __jsonAvailableUpgrades) ? If( __jsonAvailableUpgrades as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IAvailableUpgrade) (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AvailableUpgrade.FromJson(__p) )) ))() : null : AvailableUpgrade;} - {_clusterId = If( json?.PropertyT("clusterId"), out var __jsonClusterId) ? (string)__jsonClusterId : (string)ClusterId;} - {_connectedClusterId = If( json?.PropertyT("connectedClusterId"), out var __jsonConnectedClusterId) ? (string)__jsonConnectedClusterId : (string)ConnectedClusterId;} - {_controlPlaneKubernetesVersion = If( json?.PropertyT("controlPlaneKubernetesVersion"), out var __jsonControlPlaneKubernetesVersion) ? (string)__jsonControlPlaneKubernetesVersion : (string)ControlPlaneKubernetesVersion;} - {_detailedStatus = If( json?.PropertyT("detailedStatus"), out var __jsonDetailedStatus) ? (string)__jsonDetailedStatus : (string)DetailedStatus;} - {_detailedStatusMessage = If( json?.PropertyT("detailedStatusMessage"), out var __jsonDetailedStatusMessage) ? (string)__jsonDetailedStatusMessage : (string)DetailedStatusMessage;} - {_featureStatuses = If( json?.PropertyT("featureStatuses"), out var __jsonFeatureStatuses) ? If( __jsonFeatureStatuses as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonArray, out var __l) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__l, (__k)=>(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IFeatureStatus) (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.FeatureStatus.FromJson(__k) )) ))() : null : FeatureStatuses;} - {_initialAgentPoolConfiguration = If( json?.PropertyT("initialAgentPoolConfigurations"), out var __jsonInitialAgentPoolConfigurations) ? If( __jsonInitialAgentPoolConfigurations as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonArray, out var __g) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__g, (__f)=>(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IInitialAgentPoolConfiguration) (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.InitialAgentPoolConfiguration.FromJson(__f) )) ))() : null : InitialAgentPoolConfiguration;} - {_kubernetesVersion = If( json?.PropertyT("kubernetesVersion"), out var __jsonKubernetesVersion) ? (string)__jsonKubernetesVersion : (string)KubernetesVersion;} - {_node = If( json?.PropertyT("nodes"), out var __jsonNodes) ? If( __jsonNodes as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonArray, out var __b) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__b, (__a)=>(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterNode) (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.KubernetesClusterNode.FromJson(__a) )) ))() : null : Node;} - {_provisioningState = If( json?.PropertyT("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)ProvisioningState;} - AfterFromJson(json); - } - - /// - /// Serializes this instance of into a . - /// - /// The container to serialize this object into. If the caller - /// passes in null, a new instance will be created and returned to the caller. - /// Allows the caller to choose the depth of the serialization. See . - /// - /// a serialized instance of as a . - /// - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode) - { - container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject(); - - bool returnNow = false; - BeforeToJson(ref container, ref returnNow); - if (returnNow) - { - return container; - } - AddIf( null != this._aadConfiguration ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) this._aadConfiguration.ToJson(null,serializationMode) : null, "aadConfiguration" ,container.Add ); - AddIf( null != this._administratorConfiguration ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) this._administratorConfiguration.ToJson(null,serializationMode) : null, "administratorConfiguration" ,container.Add ); - AddIf( null != this._controlPlaneNodeConfiguration ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) this._controlPlaneNodeConfiguration.ToJson(null,serializationMode) : null, "controlPlaneNodeConfiguration" ,container.Add ); - AddIf( null != this._managedResourceGroupConfiguration ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) this._managedResourceGroupConfiguration.ToJson(null,serializationMode) : null, "managedResourceGroupConfiguration" ,container.Add ); - AddIf( null != this._networkConfiguration ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) this._networkConfiguration.ToJson(null,serializationMode) : null, "networkConfiguration" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) - { - if (null != this._attachedNetworkId) - { - var __w = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.XNodeArray(); - foreach( var __x in this._attachedNetworkId ) - { - AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); - } - container.Add("attachedNetworkIds",__w); - } - } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) - { - if (null != this._availableUpgrade) - { - var __r = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.XNodeArray(); - foreach( var __s in this._availableUpgrade ) - { - AddIf(__s?.ToJson(null, serializationMode) ,__r.Add); - } - container.Add("availableUpgrades",__r); - } - } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) - { - AddIf( null != (((object)this._clusterId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._clusterId.ToString()) : null, "clusterId" ,container.Add ); - } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) - { - AddIf( null != (((object)this._connectedClusterId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._connectedClusterId.ToString()) : null, "connectedClusterId" ,container.Add ); - } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) - { - AddIf( null != (((object)this._controlPlaneKubernetesVersion)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._controlPlaneKubernetesVersion.ToString()) : null, "controlPlaneKubernetesVersion" ,container.Add ); - } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) - { - AddIf( null != (((object)this._detailedStatus)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._detailedStatus.ToString()) : null, "detailedStatus" ,container.Add ); - } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) - { - AddIf( null != (((object)this._detailedStatusMessage)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._detailedStatusMessage.ToString()) : null, "detailedStatusMessage" ,container.Add ); - } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) - { - if (null != this._featureStatuses) - { - var __m = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.XNodeArray(); - foreach( var __n in this._featureStatuses ) - { - AddIf(__n?.ToJson(null, serializationMode) ,__m.Add); - } - container.Add("featureStatuses",__m); - } - } - if (null != this._initialAgentPoolConfiguration) - { - var __h = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.XNodeArray(); - foreach( var __i in this._initialAgentPoolConfiguration ) - { - AddIf(__i?.ToJson(null, serializationMode) ,__h.Add); - } - container.Add("initialAgentPoolConfigurations",__h); - } - AddIf( null != (((object)this._kubernetesVersion)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._kubernetesVersion.ToString()) : null, "kubernetesVersion" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) - { - if (null != this._node) - { - var __c = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.XNodeArray(); - foreach( var __d in this._node ) - { - AddIf(__d?.ToJson(null, serializationMode) ,__c.Add); - } - container.Add("nodes",__c); - } - } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) - { - AddIf( null != (((object)this._provisioningState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._provisioningState.ToString()) : null, "provisioningState" ,container.Add ); - } - AfterToJson(ref container); - return container; - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/L2Network.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/L2Network.PowerShell.cs deleted file mode 100644 index e46a0cd1907d..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/L2Network.PowerShell.cs +++ /dev/null @@ -1,374 +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.NetworkCloud.Models.Api20250201 -{ - using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; - - /// - /// L2Network represents a network that utilizes a single isolation domain set up for layer-2 resources. - /// - [System.ComponentModel.TypeConverter(typeof(L2NetworkTypeConverter))] - public partial class L2Network - { - - /// - /// 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.NetworkCloud.Models.Api20250201.IL2Network DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new L2Network(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.NetworkCloud.Models.Api20250201.IL2Network DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new L2Network(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.NetworkCloud.Models.Api20250201.IL2Network FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal L2Network(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("ExtendedLocation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkInternal)this).ExtendedLocation = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocation) content.GetValueForProperty("ExtendedLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkInternal)this).ExtendedLocation, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ExtendedLocationTypeConverter.ConvertFrom); - } - if (content.Contains("Property")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.L2NetworkPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Etag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkInternal)this).Etag, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)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("SystemDataCreatedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataLastModifiedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("SystemData")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.SystemDataTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Type, global::System.Convert.ToString); - } - if (content.Contains("Tag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.TrackedResourceTagsTypeConverter.ConvertFrom); - } - if (content.Contains("Location")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); - } - if (content.Contains("ExtendedLocationName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkInternal)this).ExtendedLocationName = (string) content.GetValueForProperty("ExtendedLocationName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkInternal)this).ExtendedLocationName, global::System.Convert.ToString); - } - if (content.Contains("ExtendedLocationType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkInternal)this).ExtendedLocationType = (string) content.GetValueForProperty("ExtendedLocationType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkInternal)this).ExtendedLocationType, global::System.Convert.ToString); - } - if (content.Contains("AssociatedResourceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkInternal)this).AssociatedResourceId = (string[]) content.GetValueForProperty("AssociatedResourceId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkInternal)this).AssociatedResourceId, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("ClusterId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkInternal)this).ClusterId = (string) content.GetValueForProperty("ClusterId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkInternal)this).ClusterId, global::System.Convert.ToString); - } - if (content.Contains("DetailedStatus")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkInternal)this).DetailedStatus = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.L2NetworkDetailedStatus?) content.GetValueForProperty("DetailedStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkInternal)this).DetailedStatus, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.L2NetworkDetailedStatus.CreateFrom); - } - if (content.Contains("DetailedStatusMessage")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkInternal)this).DetailedStatusMessage = (string) content.GetValueForProperty("DetailedStatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkInternal)this).DetailedStatusMessage, global::System.Convert.ToString); - } - if (content.Contains("HybridAksClustersAssociatedId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkInternal)this).HybridAksClustersAssociatedId = (string[]) content.GetValueForProperty("HybridAksClustersAssociatedId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkInternal)this).HybridAksClustersAssociatedId, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("HybridAksPluginType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkInternal)this).HybridAksPluginType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HybridAksPluginType?) content.GetValueForProperty("HybridAksPluginType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkInternal)this).HybridAksPluginType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HybridAksPluginType.CreateFrom); - } - if (content.Contains("InterfaceName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkInternal)this).InterfaceName = (string) content.GetValueForProperty("InterfaceName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkInternal)this).InterfaceName, global::System.Convert.ToString); - } - if (content.Contains("L2IsolationDomainId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkInternal)this).L2IsolationDomainId = (string) content.GetValueForProperty("L2IsolationDomainId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkInternal)this).L2IsolationDomainId, global::System.Convert.ToString); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.L2NetworkProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.L2NetworkProvisioningState.CreateFrom); - } - if (content.Contains("VirtualMachinesAssociatedId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkInternal)this).VirtualMachinesAssociatedId = (string[]) content.GetValueForProperty("VirtualMachinesAssociatedId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkInternal)this).VirtualMachinesAssociatedId, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal L2Network(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("ExtendedLocation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkInternal)this).ExtendedLocation = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocation) content.GetValueForProperty("ExtendedLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkInternal)this).ExtendedLocation, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ExtendedLocationTypeConverter.ConvertFrom); - } - if (content.Contains("Property")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.L2NetworkPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Etag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkInternal)this).Etag, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)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("SystemDataCreatedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataLastModifiedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("SystemData")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.SystemDataTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Type, global::System.Convert.ToString); - } - if (content.Contains("Tag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.TrackedResourceTagsTypeConverter.ConvertFrom); - } - if (content.Contains("Location")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); - } - if (content.Contains("ExtendedLocationName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkInternal)this).ExtendedLocationName = (string) content.GetValueForProperty("ExtendedLocationName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkInternal)this).ExtendedLocationName, global::System.Convert.ToString); - } - if (content.Contains("ExtendedLocationType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkInternal)this).ExtendedLocationType = (string) content.GetValueForProperty("ExtendedLocationType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkInternal)this).ExtendedLocationType, global::System.Convert.ToString); - } - if (content.Contains("AssociatedResourceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkInternal)this).AssociatedResourceId = (string[]) content.GetValueForProperty("AssociatedResourceId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkInternal)this).AssociatedResourceId, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("ClusterId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkInternal)this).ClusterId = (string) content.GetValueForProperty("ClusterId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkInternal)this).ClusterId, global::System.Convert.ToString); - } - if (content.Contains("DetailedStatus")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkInternal)this).DetailedStatus = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.L2NetworkDetailedStatus?) content.GetValueForProperty("DetailedStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkInternal)this).DetailedStatus, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.L2NetworkDetailedStatus.CreateFrom); - } - if (content.Contains("DetailedStatusMessage")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkInternal)this).DetailedStatusMessage = (string) content.GetValueForProperty("DetailedStatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkInternal)this).DetailedStatusMessage, global::System.Convert.ToString); - } - if (content.Contains("HybridAksClustersAssociatedId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkInternal)this).HybridAksClustersAssociatedId = (string[]) content.GetValueForProperty("HybridAksClustersAssociatedId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkInternal)this).HybridAksClustersAssociatedId, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("HybridAksPluginType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkInternal)this).HybridAksPluginType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HybridAksPluginType?) content.GetValueForProperty("HybridAksPluginType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkInternal)this).HybridAksPluginType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HybridAksPluginType.CreateFrom); - } - if (content.Contains("InterfaceName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkInternal)this).InterfaceName = (string) content.GetValueForProperty("InterfaceName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkInternal)this).InterfaceName, global::System.Convert.ToString); - } - if (content.Contains("L2IsolationDomainId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkInternal)this).L2IsolationDomainId = (string) content.GetValueForProperty("L2IsolationDomainId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkInternal)this).L2IsolationDomainId, global::System.Convert.ToString); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.L2NetworkProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.L2NetworkProvisioningState.CreateFrom); - } - if (content.Contains("VirtualMachinesAssociatedId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkInternal)this).VirtualMachinesAssociatedId = (string[]) content.GetValueForProperty("VirtualMachinesAssociatedId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkInternal)this).VirtualMachinesAssociatedId, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - AfterDeserializePSObject(content); - } - - /// Serializes this instance to a json string. - - /// a containing this model serialized to JSON text. - public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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(); - } - } - /// L2Network represents a network that utilizes a single isolation domain set up for layer-2 resources. - [System.ComponentModel.TypeConverter(typeof(L2NetworkTypeConverter))] - public partial interface IL2Network - - { - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/L2Network.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/L2Network.cs deleted file mode 100644 index bae10677f870..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/L2Network.cs +++ /dev/null @@ -1,406 +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.NetworkCloud.Models.Api20250201 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; - - /// - /// L2Network represents a network that utilizes a single isolation domain set up for layer-2 resources. - /// - public partial class L2Network : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2Network, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkInternal, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IValidates - { - /// - /// Backing field for Inherited model - /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResource __trackedResource = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.TrackedResource(); - - /// - /// The list of resource IDs for the other Microsoft.NetworkCloud resources that have attached this network. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string[] AssociatedResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkPropertiesInternal)Property).AssociatedResourceId; } - - /// - /// The resource ID of the Network Cloud cluster this L2 network is associated with. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string ClusterId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkPropertiesInternal)Property).ClusterId; } - - /// The more detailed status of the L2 network. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.L2NetworkDetailedStatus? DetailedStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkPropertiesInternal)Property).DetailedStatus; } - - /// The descriptive message about the current detailed status. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string DetailedStatusMessage { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkPropertiesInternal)Property).DetailedStatusMessage; } - - /// Backing field for property. - private string _etag; - - /// Resource ETag. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string Etag { get => this._etag; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocation _extendedLocation; - - /// The extended location of the cluster associated with the resource. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocation ExtendedLocation { get => (this._extendedLocation = this._extendedLocation ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ExtendedLocation()); set => this._extendedLocation = value; } - - /// The resource ID of the extended location on which the resource will be created. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string ExtendedLocationName { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocationInternal)ExtendedLocation).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocationInternal)ExtendedLocation).Name = value ; } - - /// The extended location type, for example, CustomLocation. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string ExtendedLocationType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocationInternal)ExtendedLocation).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocationInternal)ExtendedLocation).Type = value ; } - - /// - /// Field Deprecated. These fields will be empty/omitted. The list of Hybrid AKS cluster resource ID(s) that are associated - /// with this L2 network. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string[] HybridAksClustersAssociatedId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkPropertiesInternal)Property).HybridAksClustersAssociatedId; } - - /// - /// Field Deprecated. The field was previously optional, now it will have no defined behavior and will be ignored. The network - /// plugin type for Hybrid AKS. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HybridAksPluginType? HybridAksPluginType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkPropertiesInternal)Property).HybridAksPluginType; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkPropertiesInternal)Property).HybridAksPluginType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HybridAksPluginType)""); } - - /// - /// Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).Id; } - - /// - /// The default interface name for this L2 network in the virtual machine. This name can be overridden by the name supplied - /// in the network attachment configuration of that virtual machine. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string InterfaceName { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkPropertiesInternal)Property).InterfaceName; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkPropertiesInternal)Property).InterfaceName = value ?? null; } - - /// The resource ID of the Network Fabric l2IsolationDomain. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string L2IsolationDomainId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkPropertiesInternal)Property).L2IsolationDomainId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkPropertiesInternal)Property).L2IsolationDomainId = value ; } - - /// The geo-location where the resource lives - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)__trackedResource).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)__trackedResource).Location = value ; } - - /// Internal Acessors for AssociatedResourceId - string[] Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkInternal.AssociatedResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkPropertiesInternal)Property).AssociatedResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkPropertiesInternal)Property).AssociatedResourceId = value; } - - /// Internal Acessors for ClusterId - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkInternal.ClusterId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkPropertiesInternal)Property).ClusterId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkPropertiesInternal)Property).ClusterId = value; } - - /// Internal Acessors for DetailedStatus - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.L2NetworkDetailedStatus? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkInternal.DetailedStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkPropertiesInternal)Property).DetailedStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkPropertiesInternal)Property).DetailedStatus = value; } - - /// Internal Acessors for DetailedStatusMessage - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkInternal.DetailedStatusMessage { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkPropertiesInternal)Property).DetailedStatusMessage; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkPropertiesInternal)Property).DetailedStatusMessage = value; } - - /// Internal Acessors for Etag - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkInternal.Etag { get => this._etag; set { {_etag = value;} } } - - /// Internal Acessors for ExtendedLocation - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocation Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkInternal.ExtendedLocation { get => (this._extendedLocation = this._extendedLocation ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ExtendedLocation()); set { {_extendedLocation = value;} } } - - /// Internal Acessors for HybridAksClustersAssociatedId - string[] Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkInternal.HybridAksClustersAssociatedId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkPropertiesInternal)Property).HybridAksClustersAssociatedId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkPropertiesInternal)Property).HybridAksClustersAssociatedId = value; } - - /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkProperties Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.L2NetworkProperties()); set { {_property = value;} } } - - /// Internal Acessors for ProvisioningState - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.L2NetworkProvisioningState? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkPropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkPropertiesInternal)Property).ProvisioningState = value; } - - /// Internal Acessors for VirtualMachinesAssociatedId - string[] Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkInternal.VirtualMachinesAssociatedId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkPropertiesInternal)Property).VirtualMachinesAssociatedId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkPropertiesInternal)Property).VirtualMachinesAssociatedId = value; } - - /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).Id = value; } - - /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).Name = value; } - - /// Internal Acessors for SystemData - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ISystemData Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal.SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemData; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemData = value; } - - /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).Type = value; } - - /// The name of the resource - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).Name; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkProperties _property; - - /// The list of the resource properties. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.L2NetworkProperties()); set => this._property = value; } - - /// The provisioning state of the L2 network. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.L2NetworkProvisioningState? ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkPropertiesInternal)Property).ProvisioningState; } - - /// Gets the resource group name - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string ResourceGroupName { get => (new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Success ? new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Groups["resourceGroupName"].Value : null); } - - /// - /// Azure Resource Manager metadata containing createdBy and modifiedBy information. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ISystemData SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemData; } - - /// The timestamp of resource creation (UTC). - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataCreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataCreatedAt = value ?? default(global::System.DateTime); } - - /// The identity that created the resource. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataCreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataCreatedBy = value ?? null; } - - /// The type of identity that created the resource. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType? SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataCreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataCreatedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType)""); } - - /// The timestamp of resource last modification (UTC) - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataLastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataLastModifiedAt = value ?? default(global::System.DateTime); } - - /// The identity that last modified the resource. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataLastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataLastModifiedBy = value ?? null; } - - /// The type of identity that last modified the resource. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType? SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataLastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataLastModifiedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType)""); } - - /// Resource tags. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)__trackedResource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.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.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).Type; } - - /// - /// Field Deprecated. These fields will be empty/omitted. The list of virtual machine resource ID(s), excluding any Hybrid - /// AKS virtual machines, that are currently using this L2 network. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string[] VirtualMachinesAssociatedId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkPropertiesInternal)Property).VirtualMachinesAssociatedId; } - - /// Creates an new instance. - public L2Network() - { - - } - - /// Validates that this object meets the validation criteria. - /// an instance that will receive validation - /// events. - /// - /// A that will be complete when validation is completed. - /// - public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) - { - await eventListener.AssertNotNull(nameof(__trackedResource), __trackedResource); - await eventListener.AssertObjectIsValid(nameof(__trackedResource), __trackedResource); - } - } - /// L2Network represents a network that utilizes a single isolation domain set up for layer-2 resources. - public partial interface IL2Network : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResource - { - /// - /// The list of resource IDs for the other Microsoft.NetworkCloud resources that have attached this network. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The list of resource IDs for the other Microsoft.NetworkCloud resources that have attached this network.", - SerializedName = @"associatedResourceIds", - PossibleTypes = new [] { typeof(string) })] - string[] AssociatedResourceId { get; } - /// - /// The resource ID of the Network Cloud cluster this L2 network is associated with. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The resource ID of the Network Cloud cluster this L2 network is associated with.", - SerializedName = @"clusterId", - PossibleTypes = new [] { typeof(string) })] - string ClusterId { get; } - /// The more detailed status of the L2 network. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The more detailed status of the L2 network.", - SerializedName = @"detailedStatus", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.L2NetworkDetailedStatus) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.L2NetworkDetailedStatus? DetailedStatus { get; } - /// The descriptive message about the current detailed status. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The descriptive message about the current detailed status.", - SerializedName = @"detailedStatusMessage", - PossibleTypes = new [] { typeof(string) })] - string DetailedStatusMessage { get; } - /// Resource ETag. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"Resource ETag.", - SerializedName = @"etag", - PossibleTypes = new [] { typeof(string) })] - string Etag { get; } - /// The resource ID of the extended location on which the resource will be created. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The resource ID of the extended location on which the resource will be created.", - SerializedName = @"name", - PossibleTypes = new [] { typeof(string) })] - string ExtendedLocationName { get; set; } - /// The extended location type, for example, CustomLocation. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The extended location type, for example, CustomLocation.", - SerializedName = @"type", - PossibleTypes = new [] { typeof(string) })] - string ExtendedLocationType { get; set; } - /// - /// Field Deprecated. These fields will be empty/omitted. The list of Hybrid AKS cluster resource ID(s) that are associated - /// with this L2 network. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"Field Deprecated. These fields will be empty/omitted. The list of Hybrid AKS cluster resource ID(s) that are associated with this L2 network.", - SerializedName = @"hybridAksClustersAssociatedIds", - PossibleTypes = new [] { typeof(string) })] - string[] HybridAksClustersAssociatedId { get; } - /// - /// Field Deprecated. The field was previously optional, now it will have no defined behavior and will be ignored. The network - /// plugin type for Hybrid AKS. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Field Deprecated. The field was previously optional, now it will have no defined behavior and will be ignored. The network plugin type for Hybrid AKS.", - SerializedName = @"hybridAksPluginType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HybridAksPluginType) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HybridAksPluginType? HybridAksPluginType { get; set; } - /// - /// The default interface name for this L2 network in the virtual machine. This name can be overridden by the name supplied - /// in the network attachment configuration of that virtual machine. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The default interface name for this L2 network in the virtual machine. This name can be overridden by the name supplied in the network attachment configuration of that virtual machine.", - SerializedName = @"interfaceName", - PossibleTypes = new [] { typeof(string) })] - string InterfaceName { get; set; } - /// The resource ID of the Network Fabric l2IsolationDomain. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The resource ID of the Network Fabric l2IsolationDomain.", - SerializedName = @"l2IsolationDomainId", - PossibleTypes = new [] { typeof(string) })] - string L2IsolationDomainId { get; set; } - /// The provisioning state of the L2 network. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The provisioning state of the L2 network.", - SerializedName = @"provisioningState", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.L2NetworkProvisioningState) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.L2NetworkProvisioningState? ProvisioningState { get; } - /// - /// Field Deprecated. These fields will be empty/omitted. The list of virtual machine resource ID(s), excluding any Hybrid - /// AKS virtual machines, that are currently using this L2 network. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"Field Deprecated. These fields will be empty/omitted. The list of virtual machine resource ID(s), excluding any Hybrid AKS virtual machines, that are currently using this L2 network.", - SerializedName = @"virtualMachinesAssociatedIds", - PossibleTypes = new [] { typeof(string) })] - string[] VirtualMachinesAssociatedId { get; } - - } - /// L2Network represents a network that utilizes a single isolation domain set up for layer-2 resources. - internal partial interface IL2NetworkInternal : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal - { - /// - /// The list of resource IDs for the other Microsoft.NetworkCloud resources that have attached this network. - /// - string[] AssociatedResourceId { get; set; } - /// - /// The resource ID of the Network Cloud cluster this L2 network is associated with. - /// - string ClusterId { get; set; } - /// The more detailed status of the L2 network. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.L2NetworkDetailedStatus? DetailedStatus { get; set; } - /// The descriptive message about the current detailed status. - string DetailedStatusMessage { get; set; } - /// Resource ETag. - string Etag { get; set; } - /// The extended location of the cluster associated with the resource. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocation ExtendedLocation { get; set; } - /// The resource ID of the extended location on which the resource will be created. - string ExtendedLocationName { get; set; } - /// The extended location type, for example, CustomLocation. - string ExtendedLocationType { get; set; } - /// - /// Field Deprecated. These fields will be empty/omitted. The list of Hybrid AKS cluster resource ID(s) that are associated - /// with this L2 network. - /// - string[] HybridAksClustersAssociatedId { get; set; } - /// - /// Field Deprecated. The field was previously optional, now it will have no defined behavior and will be ignored. The network - /// plugin type for Hybrid AKS. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HybridAksPluginType? HybridAksPluginType { get; set; } - /// - /// The default interface name for this L2 network in the virtual machine. This name can be overridden by the name supplied - /// in the network attachment configuration of that virtual machine. - /// - string InterfaceName { get; set; } - /// The resource ID of the Network Fabric l2IsolationDomain. - string L2IsolationDomainId { get; set; } - /// The list of the resource properties. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkProperties Property { get; set; } - /// The provisioning state of the L2 network. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.L2NetworkProvisioningState? ProvisioningState { get; set; } - /// - /// Field Deprecated. These fields will be empty/omitted. The list of virtual machine resource ID(s), excluding any Hybrid - /// AKS virtual machines, that are currently using this L2 network. - /// - string[] VirtualMachinesAssociatedId { get; set; } - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/L2NetworkList.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/L2NetworkList.cs deleted file mode 100644 index ea4ce94ac42c..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/L2NetworkList.cs +++ /dev/null @@ -1,68 +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.NetworkCloud.Models.Api20250201 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; - - /// L2NetworkList represents a list of L2 networks. - public partial class L2NetworkList : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkList, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkListInternal - { - - /// Backing field for property. - private string _nextLink; - - /// The link used to get the next page of operations. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string NextLink { get => this._nextLink; set => this._nextLink = value; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2Network[] _value; - - /// The list of L2 networks. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2Network[] Value { get => this._value; set => this._value = value; } - - /// Creates an new instance. - public L2NetworkList() - { - - } - } - /// L2NetworkList represents a list of L2 networks. - public partial interface IL2NetworkList : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable - { - /// The link used to get the next page of operations. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The link used to get the next page of operations.", - SerializedName = @"nextLink", - PossibleTypes = new [] { typeof(string) })] - string NextLink { get; set; } - /// The list of L2 networks. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The list of L2 networks.", - SerializedName = @"value", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2Network) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2Network[] Value { get; set; } - - } - /// L2NetworkList represents a list of L2 networks. - internal partial interface IL2NetworkListInternal - - { - /// The link used to get the next page of operations. - string NextLink { get; set; } - /// The list of L2 networks. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2Network[] Value { get; set; } - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/L2NetworkPatchParameters.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/L2NetworkPatchParameters.cs deleted file mode 100644 index 8404f0156af5..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/L2NetworkPatchParameters.cs +++ /dev/null @@ -1,53 +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.NetworkCloud.Models.Api20250201 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; - - /// - /// L2NetworkPatchParameters represents the body of the request to patch the L2 network. - /// - public partial class L2NetworkPatchParameters : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkPatchParameters, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkPatchParametersInternal - { - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkPatchParametersTags _tag; - - /// The Azure resource tags that will replace the existing ones. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkPatchParametersTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.L2NetworkPatchParametersTags()); set => this._tag = value; } - - /// Creates an new instance. - public L2NetworkPatchParameters() - { - - } - } - /// L2NetworkPatchParameters represents the body of the request to patch the L2 network. - public partial interface IL2NetworkPatchParameters : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable - { - /// The Azure resource tags that will replace the existing ones. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The Azure resource tags that will replace the existing ones.", - SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkPatchParametersTags) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkPatchParametersTags Tag { get; set; } - - } - /// L2NetworkPatchParameters represents the body of the request to patch the L2 network. - internal partial interface IL2NetworkPatchParametersInternal - - { - /// The Azure resource tags that will replace the existing ones. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkPatchParametersTags Tag { get; set; } - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/L2NetworkProperties.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/L2NetworkProperties.PowerShell.cs deleted file mode 100644 index 9559fe7c1e6d..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/L2NetworkProperties.PowerShell.cs +++ /dev/null @@ -1,236 +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.NetworkCloud.Models.Api20250201 -{ - using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; - - /// L2NetworkProperties represents properties of the L2 network. - [System.ComponentModel.TypeConverter(typeof(L2NetworkPropertiesTypeConverter))] - public partial class L2NetworkProperties - { - - /// - /// 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.NetworkCloud.Models.Api20250201.IL2NetworkProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new L2NetworkProperties(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.NetworkCloud.Models.Api20250201.IL2NetworkProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new L2NetworkProperties(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.NetworkCloud.Models.Api20250201.IL2NetworkProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal L2NetworkProperties(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("AssociatedResourceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkPropertiesInternal)this).AssociatedResourceId = (string[]) content.GetValueForProperty("AssociatedResourceId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkPropertiesInternal)this).AssociatedResourceId, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("ClusterId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkPropertiesInternal)this).ClusterId = (string) content.GetValueForProperty("ClusterId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkPropertiesInternal)this).ClusterId, global::System.Convert.ToString); - } - if (content.Contains("DetailedStatus")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkPropertiesInternal)this).DetailedStatus = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.L2NetworkDetailedStatus?) content.GetValueForProperty("DetailedStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkPropertiesInternal)this).DetailedStatus, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.L2NetworkDetailedStatus.CreateFrom); - } - if (content.Contains("DetailedStatusMessage")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkPropertiesInternal)this).DetailedStatusMessage = (string) content.GetValueForProperty("DetailedStatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkPropertiesInternal)this).DetailedStatusMessage, global::System.Convert.ToString); - } - if (content.Contains("HybridAksClustersAssociatedId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkPropertiesInternal)this).HybridAksClustersAssociatedId = (string[]) content.GetValueForProperty("HybridAksClustersAssociatedId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkPropertiesInternal)this).HybridAksClustersAssociatedId, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("HybridAksPluginType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkPropertiesInternal)this).HybridAksPluginType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HybridAksPluginType?) content.GetValueForProperty("HybridAksPluginType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkPropertiesInternal)this).HybridAksPluginType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HybridAksPluginType.CreateFrom); - } - if (content.Contains("InterfaceName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkPropertiesInternal)this).InterfaceName = (string) content.GetValueForProperty("InterfaceName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkPropertiesInternal)this).InterfaceName, global::System.Convert.ToString); - } - if (content.Contains("L2IsolationDomainId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkPropertiesInternal)this).L2IsolationDomainId = (string) content.GetValueForProperty("L2IsolationDomainId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkPropertiesInternal)this).L2IsolationDomainId, global::System.Convert.ToString); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkPropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.L2NetworkProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkPropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.L2NetworkProvisioningState.CreateFrom); - } - if (content.Contains("VirtualMachinesAssociatedId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkPropertiesInternal)this).VirtualMachinesAssociatedId = (string[]) content.GetValueForProperty("VirtualMachinesAssociatedId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkPropertiesInternal)this).VirtualMachinesAssociatedId, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal L2NetworkProperties(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("AssociatedResourceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkPropertiesInternal)this).AssociatedResourceId = (string[]) content.GetValueForProperty("AssociatedResourceId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkPropertiesInternal)this).AssociatedResourceId, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("ClusterId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkPropertiesInternal)this).ClusterId = (string) content.GetValueForProperty("ClusterId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkPropertiesInternal)this).ClusterId, global::System.Convert.ToString); - } - if (content.Contains("DetailedStatus")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkPropertiesInternal)this).DetailedStatus = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.L2NetworkDetailedStatus?) content.GetValueForProperty("DetailedStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkPropertiesInternal)this).DetailedStatus, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.L2NetworkDetailedStatus.CreateFrom); - } - if (content.Contains("DetailedStatusMessage")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkPropertiesInternal)this).DetailedStatusMessage = (string) content.GetValueForProperty("DetailedStatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkPropertiesInternal)this).DetailedStatusMessage, global::System.Convert.ToString); - } - if (content.Contains("HybridAksClustersAssociatedId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkPropertiesInternal)this).HybridAksClustersAssociatedId = (string[]) content.GetValueForProperty("HybridAksClustersAssociatedId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkPropertiesInternal)this).HybridAksClustersAssociatedId, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("HybridAksPluginType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkPropertiesInternal)this).HybridAksPluginType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HybridAksPluginType?) content.GetValueForProperty("HybridAksPluginType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkPropertiesInternal)this).HybridAksPluginType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HybridAksPluginType.CreateFrom); - } - if (content.Contains("InterfaceName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkPropertiesInternal)this).InterfaceName = (string) content.GetValueForProperty("InterfaceName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkPropertiesInternal)this).InterfaceName, global::System.Convert.ToString); - } - if (content.Contains("L2IsolationDomainId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkPropertiesInternal)this).L2IsolationDomainId = (string) content.GetValueForProperty("L2IsolationDomainId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkPropertiesInternal)this).L2IsolationDomainId, global::System.Convert.ToString); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkPropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.L2NetworkProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkPropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.L2NetworkProvisioningState.CreateFrom); - } - if (content.Contains("VirtualMachinesAssociatedId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkPropertiesInternal)this).VirtualMachinesAssociatedId = (string[]) content.GetValueForProperty("VirtualMachinesAssociatedId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkPropertiesInternal)this).VirtualMachinesAssociatedId, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - AfterDeserializePSObject(content); - } - - /// Serializes this instance to a json string. - - /// a containing this model serialized to JSON text. - public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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(); - } - } - /// L2NetworkProperties represents properties of the L2 network. - [System.ComponentModel.TypeConverter(typeof(L2NetworkPropertiesTypeConverter))] - public partial interface IL2NetworkProperties - - { - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/L2NetworkProperties.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/L2NetworkProperties.cs deleted file mode 100644 index 3f3e1f6f0bbb..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/L2NetworkProperties.cs +++ /dev/null @@ -1,273 +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.NetworkCloud.Models.Api20250201 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; - - /// L2NetworkProperties represents properties of the L2 network. - public partial class L2NetworkProperties : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkProperties, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkPropertiesInternal - { - - /// Backing field for property. - private string[] _associatedResourceId; - - /// - /// The list of resource IDs for the other Microsoft.NetworkCloud resources that have attached this network. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string[] AssociatedResourceId { get => this._associatedResourceId; } - - /// Backing field for property. - private string _clusterId; - - /// - /// The resource ID of the Network Cloud cluster this L2 network is associated with. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string ClusterId { get => this._clusterId; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.L2NetworkDetailedStatus? _detailedStatus; - - /// The more detailed status of the L2 network. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.L2NetworkDetailedStatus? DetailedStatus { get => this._detailedStatus; } - - /// Backing field for property. - private string _detailedStatusMessage; - - /// The descriptive message about the current detailed status. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string DetailedStatusMessage { get => this._detailedStatusMessage; } - - /// Backing field for property. - private string[] _hybridAksClustersAssociatedId; - - /// - /// Field Deprecated. These fields will be empty/omitted. The list of Hybrid AKS cluster resource ID(s) that are associated - /// with this L2 network. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string[] HybridAksClustersAssociatedId { get => this._hybridAksClustersAssociatedId; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HybridAksPluginType? _hybridAksPluginType; - - /// - /// Field Deprecated. The field was previously optional, now it will have no defined behavior and will be ignored. The network - /// plugin type for Hybrid AKS. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HybridAksPluginType? HybridAksPluginType { get => this._hybridAksPluginType; set => this._hybridAksPluginType = value; } - - /// Backing field for property. - private string _interfaceName; - - /// - /// The default interface name for this L2 network in the virtual machine. This name can be overridden by the name supplied - /// in the network attachment configuration of that virtual machine. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string InterfaceName { get => this._interfaceName; set => this._interfaceName = value; } - - /// Backing field for property. - private string _l2IsolationDomainId; - - /// The resource ID of the Network Fabric l2IsolationDomain. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string L2IsolationDomainId { get => this._l2IsolationDomainId; set => this._l2IsolationDomainId = value; } - - /// Internal Acessors for AssociatedResourceId - string[] Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkPropertiesInternal.AssociatedResourceId { get => this._associatedResourceId; set { {_associatedResourceId = value;} } } - - /// Internal Acessors for ClusterId - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkPropertiesInternal.ClusterId { get => this._clusterId; set { {_clusterId = value;} } } - - /// Internal Acessors for DetailedStatus - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.L2NetworkDetailedStatus? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkPropertiesInternal.DetailedStatus { get => this._detailedStatus; set { {_detailedStatus = value;} } } - - /// Internal Acessors for DetailedStatusMessage - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkPropertiesInternal.DetailedStatusMessage { get => this._detailedStatusMessage; set { {_detailedStatusMessage = value;} } } - - /// Internal Acessors for HybridAksClustersAssociatedId - string[] Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkPropertiesInternal.HybridAksClustersAssociatedId { get => this._hybridAksClustersAssociatedId; set { {_hybridAksClustersAssociatedId = value;} } } - - /// Internal Acessors for ProvisioningState - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.L2NetworkProvisioningState? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkPropertiesInternal.ProvisioningState { get => this._provisioningState; set { {_provisioningState = value;} } } - - /// Internal Acessors for VirtualMachinesAssociatedId - string[] Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkPropertiesInternal.VirtualMachinesAssociatedId { get => this._virtualMachinesAssociatedId; set { {_virtualMachinesAssociatedId = value;} } } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.L2NetworkProvisioningState? _provisioningState; - - /// The provisioning state of the L2 network. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.L2NetworkProvisioningState? ProvisioningState { get => this._provisioningState; } - - /// Backing field for property. - private string[] _virtualMachinesAssociatedId; - - /// - /// Field Deprecated. These fields will be empty/omitted. The list of virtual machine resource ID(s), excluding any Hybrid - /// AKS virtual machines, that are currently using this L2 network. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string[] VirtualMachinesAssociatedId { get => this._virtualMachinesAssociatedId; } - - /// Creates an new instance. - public L2NetworkProperties() - { - - } - } - /// L2NetworkProperties represents properties of the L2 network. - public partial interface IL2NetworkProperties : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable - { - /// - /// The list of resource IDs for the other Microsoft.NetworkCloud resources that have attached this network. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The list of resource IDs for the other Microsoft.NetworkCloud resources that have attached this network.", - SerializedName = @"associatedResourceIds", - PossibleTypes = new [] { typeof(string) })] - string[] AssociatedResourceId { get; } - /// - /// The resource ID of the Network Cloud cluster this L2 network is associated with. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The resource ID of the Network Cloud cluster this L2 network is associated with.", - SerializedName = @"clusterId", - PossibleTypes = new [] { typeof(string) })] - string ClusterId { get; } - /// The more detailed status of the L2 network. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The more detailed status of the L2 network.", - SerializedName = @"detailedStatus", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.L2NetworkDetailedStatus) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.L2NetworkDetailedStatus? DetailedStatus { get; } - /// The descriptive message about the current detailed status. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The descriptive message about the current detailed status.", - SerializedName = @"detailedStatusMessage", - PossibleTypes = new [] { typeof(string) })] - string DetailedStatusMessage { get; } - /// - /// Field Deprecated. These fields will be empty/omitted. The list of Hybrid AKS cluster resource ID(s) that are associated - /// with this L2 network. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"Field Deprecated. These fields will be empty/omitted. The list of Hybrid AKS cluster resource ID(s) that are associated with this L2 network.", - SerializedName = @"hybridAksClustersAssociatedIds", - PossibleTypes = new [] { typeof(string) })] - string[] HybridAksClustersAssociatedId { get; } - /// - /// Field Deprecated. The field was previously optional, now it will have no defined behavior and will be ignored. The network - /// plugin type for Hybrid AKS. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Field Deprecated. The field was previously optional, now it will have no defined behavior and will be ignored. The network plugin type for Hybrid AKS.", - SerializedName = @"hybridAksPluginType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HybridAksPluginType) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HybridAksPluginType? HybridAksPluginType { get; set; } - /// - /// The default interface name for this L2 network in the virtual machine. This name can be overridden by the name supplied - /// in the network attachment configuration of that virtual machine. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The default interface name for this L2 network in the virtual machine. This name can be overridden by the name supplied in the network attachment configuration of that virtual machine.", - SerializedName = @"interfaceName", - PossibleTypes = new [] { typeof(string) })] - string InterfaceName { get; set; } - /// The resource ID of the Network Fabric l2IsolationDomain. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The resource ID of the Network Fabric l2IsolationDomain.", - SerializedName = @"l2IsolationDomainId", - PossibleTypes = new [] { typeof(string) })] - string L2IsolationDomainId { get; set; } - /// The provisioning state of the L2 network. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The provisioning state of the L2 network.", - SerializedName = @"provisioningState", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.L2NetworkProvisioningState) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.L2NetworkProvisioningState? ProvisioningState { get; } - /// - /// Field Deprecated. These fields will be empty/omitted. The list of virtual machine resource ID(s), excluding any Hybrid - /// AKS virtual machines, that are currently using this L2 network. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"Field Deprecated. These fields will be empty/omitted. The list of virtual machine resource ID(s), excluding any Hybrid AKS virtual machines, that are currently using this L2 network.", - SerializedName = @"virtualMachinesAssociatedIds", - PossibleTypes = new [] { typeof(string) })] - string[] VirtualMachinesAssociatedId { get; } - - } - /// L2NetworkProperties represents properties of the L2 network. - internal partial interface IL2NetworkPropertiesInternal - - { - /// - /// The list of resource IDs for the other Microsoft.NetworkCloud resources that have attached this network. - /// - string[] AssociatedResourceId { get; set; } - /// - /// The resource ID of the Network Cloud cluster this L2 network is associated with. - /// - string ClusterId { get; set; } - /// The more detailed status of the L2 network. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.L2NetworkDetailedStatus? DetailedStatus { get; set; } - /// The descriptive message about the current detailed status. - string DetailedStatusMessage { get; set; } - /// - /// Field Deprecated. These fields will be empty/omitted. The list of Hybrid AKS cluster resource ID(s) that are associated - /// with this L2 network. - /// - string[] HybridAksClustersAssociatedId { get; set; } - /// - /// Field Deprecated. The field was previously optional, now it will have no defined behavior and will be ignored. The network - /// plugin type for Hybrid AKS. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HybridAksPluginType? HybridAksPluginType { get; set; } - /// - /// The default interface name for this L2 network in the virtual machine. This name can be overridden by the name supplied - /// in the network attachment configuration of that virtual machine. - /// - string InterfaceName { get; set; } - /// The resource ID of the Network Fabric l2IsolationDomain. - string L2IsolationDomainId { get; set; } - /// The provisioning state of the L2 network. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.L2NetworkProvisioningState? ProvisioningState { get; set; } - /// - /// Field Deprecated. These fields will be empty/omitted. The list of virtual machine resource ID(s), excluding any Hybrid - /// AKS virtual machines, that are currently using this L2 network. - /// - string[] VirtualMachinesAssociatedId { get; set; } - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/L2ServiceLoadBalancerConfiguration.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/L2ServiceLoadBalancerConfiguration.cs deleted file mode 100644 index 6e6a2739f3c1..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/L2ServiceLoadBalancerConfiguration.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.NetworkCloud.Models.Api20250201 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; - - /// - /// L2ServiceLoadBalancerConfiguration represents the configuration of a layer 2 service load balancer. - /// - public partial class L2ServiceLoadBalancerConfiguration : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2ServiceLoadBalancerConfiguration, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2ServiceLoadBalancerConfigurationInternal - { - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIPAddressPool[] _iPAddressPool; - - /// - /// The list of pools of IP addresses that can be allocated to load balancer services. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIPAddressPool[] IPAddressPool { get => this._iPAddressPool; set => this._iPAddressPool = value; } - - /// Creates an new instance. - public L2ServiceLoadBalancerConfiguration() - { - - } - } - /// L2ServiceLoadBalancerConfiguration represents the configuration of a layer 2 service load balancer. - public partial interface IL2ServiceLoadBalancerConfiguration : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable - { - /// - /// The list of pools of IP addresses that can be allocated to load balancer services. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The list of pools of IP addresses that can be allocated to load balancer services.", - SerializedName = @"ipAddressPools", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIPAddressPool) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIPAddressPool[] IPAddressPool { get; set; } - - } - /// L2ServiceLoadBalancerConfiguration represents the configuration of a layer 2 service load balancer. - internal partial interface IL2ServiceLoadBalancerConfigurationInternal - - { - /// - /// The list of pools of IP addresses that can be allocated to load balancer services. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIPAddressPool[] IPAddressPool { get; set; } - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/L3Network.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/L3Network.PowerShell.cs deleted file mode 100644 index 79edbc388e3d..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/L3Network.PowerShell.cs +++ /dev/null @@ -1,414 +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.NetworkCloud.Models.Api20250201 -{ - using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; - - /// - /// L3Network represents a network that utilizes a single isolation domain set up for layer-3 resources. - /// - [System.ComponentModel.TypeConverter(typeof(L3NetworkTypeConverter))] - public partial class L3Network - { - - /// - /// 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.NetworkCloud.Models.Api20250201.IL3Network DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new L3Network(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.NetworkCloud.Models.Api20250201.IL3Network DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new L3Network(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.NetworkCloud.Models.Api20250201.IL3Network FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal L3Network(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("ExtendedLocation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkInternal)this).ExtendedLocation = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocation) content.GetValueForProperty("ExtendedLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkInternal)this).ExtendedLocation, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ExtendedLocationTypeConverter.ConvertFrom); - } - if (content.Contains("Property")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.L3NetworkPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Etag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkInternal)this).Etag, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)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("SystemDataCreatedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataLastModifiedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("SystemData")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.SystemDataTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Type, global::System.Convert.ToString); - } - if (content.Contains("Tag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.TrackedResourceTagsTypeConverter.ConvertFrom); - } - if (content.Contains("Location")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); - } - if (content.Contains("ExtendedLocationName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkInternal)this).ExtendedLocationName = (string) content.GetValueForProperty("ExtendedLocationName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkInternal)this).ExtendedLocationName, global::System.Convert.ToString); - } - if (content.Contains("ExtendedLocationType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkInternal)this).ExtendedLocationType = (string) content.GetValueForProperty("ExtendedLocationType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkInternal)this).ExtendedLocationType, global::System.Convert.ToString); - } - if (content.Contains("AssociatedResourceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkInternal)this).AssociatedResourceId = (string[]) content.GetValueForProperty("AssociatedResourceId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkInternal)this).AssociatedResourceId, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("ClusterId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkInternal)this).ClusterId = (string) content.GetValueForProperty("ClusterId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkInternal)this).ClusterId, global::System.Convert.ToString); - } - if (content.Contains("DetailedStatus")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkInternal)this).DetailedStatus = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.L3NetworkDetailedStatus?) content.GetValueForProperty("DetailedStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkInternal)this).DetailedStatus, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.L3NetworkDetailedStatus.CreateFrom); - } - if (content.Contains("DetailedStatusMessage")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkInternal)this).DetailedStatusMessage = (string) content.GetValueForProperty("DetailedStatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkInternal)this).DetailedStatusMessage, global::System.Convert.ToString); - } - if (content.Contains("HybridAksClustersAssociatedId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkInternal)this).HybridAksClustersAssociatedId = (string[]) content.GetValueForProperty("HybridAksClustersAssociatedId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkInternal)this).HybridAksClustersAssociatedId, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("HybridAksIpamEnabled")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkInternal)this).HybridAksIpamEnabled = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HybridAksIpamEnabled?) content.GetValueForProperty("HybridAksIpamEnabled",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkInternal)this).HybridAksIpamEnabled, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HybridAksIpamEnabled.CreateFrom); - } - if (content.Contains("HybridAksPluginType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkInternal)this).HybridAksPluginType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HybridAksPluginType?) content.GetValueForProperty("HybridAksPluginType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkInternal)this).HybridAksPluginType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HybridAksPluginType.CreateFrom); - } - if (content.Contains("InterfaceName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkInternal)this).InterfaceName = (string) content.GetValueForProperty("InterfaceName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkInternal)this).InterfaceName, global::System.Convert.ToString); - } - if (content.Contains("IPAllocationType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkInternal)this).IPAllocationType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.IPAllocationType?) content.GetValueForProperty("IPAllocationType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkInternal)this).IPAllocationType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.IPAllocationType.CreateFrom); - } - if (content.Contains("Ipv4ConnectedPrefix")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkInternal)this).Ipv4ConnectedPrefix = (string) content.GetValueForProperty("Ipv4ConnectedPrefix",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkInternal)this).Ipv4ConnectedPrefix, global::System.Convert.ToString); - } - if (content.Contains("Ipv6ConnectedPrefix")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkInternal)this).Ipv6ConnectedPrefix = (string) content.GetValueForProperty("Ipv6ConnectedPrefix",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkInternal)this).Ipv6ConnectedPrefix, global::System.Convert.ToString); - } - if (content.Contains("L3IsolationDomainId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkInternal)this).L3IsolationDomainId = (string) content.GetValueForProperty("L3IsolationDomainId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkInternal)this).L3IsolationDomainId, global::System.Convert.ToString); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.L3NetworkProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.L3NetworkProvisioningState.CreateFrom); - } - if (content.Contains("VirtualMachinesAssociatedId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkInternal)this).VirtualMachinesAssociatedId = (string[]) content.GetValueForProperty("VirtualMachinesAssociatedId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkInternal)this).VirtualMachinesAssociatedId, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("Vlan")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkInternal)this).Vlan = (long) content.GetValueForProperty("Vlan",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkInternal)this).Vlan, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal L3Network(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("ExtendedLocation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkInternal)this).ExtendedLocation = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocation) content.GetValueForProperty("ExtendedLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkInternal)this).ExtendedLocation, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ExtendedLocationTypeConverter.ConvertFrom); - } - if (content.Contains("Property")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.L3NetworkPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Etag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkInternal)this).Etag, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)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("SystemDataCreatedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataLastModifiedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("SystemData")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.SystemDataTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Type, global::System.Convert.ToString); - } - if (content.Contains("Tag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.TrackedResourceTagsTypeConverter.ConvertFrom); - } - if (content.Contains("Location")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); - } - if (content.Contains("ExtendedLocationName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkInternal)this).ExtendedLocationName = (string) content.GetValueForProperty("ExtendedLocationName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkInternal)this).ExtendedLocationName, global::System.Convert.ToString); - } - if (content.Contains("ExtendedLocationType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkInternal)this).ExtendedLocationType = (string) content.GetValueForProperty("ExtendedLocationType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkInternal)this).ExtendedLocationType, global::System.Convert.ToString); - } - if (content.Contains("AssociatedResourceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkInternal)this).AssociatedResourceId = (string[]) content.GetValueForProperty("AssociatedResourceId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkInternal)this).AssociatedResourceId, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("ClusterId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkInternal)this).ClusterId = (string) content.GetValueForProperty("ClusterId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkInternal)this).ClusterId, global::System.Convert.ToString); - } - if (content.Contains("DetailedStatus")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkInternal)this).DetailedStatus = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.L3NetworkDetailedStatus?) content.GetValueForProperty("DetailedStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkInternal)this).DetailedStatus, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.L3NetworkDetailedStatus.CreateFrom); - } - if (content.Contains("DetailedStatusMessage")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkInternal)this).DetailedStatusMessage = (string) content.GetValueForProperty("DetailedStatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkInternal)this).DetailedStatusMessage, global::System.Convert.ToString); - } - if (content.Contains("HybridAksClustersAssociatedId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkInternal)this).HybridAksClustersAssociatedId = (string[]) content.GetValueForProperty("HybridAksClustersAssociatedId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkInternal)this).HybridAksClustersAssociatedId, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("HybridAksIpamEnabled")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkInternal)this).HybridAksIpamEnabled = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HybridAksIpamEnabled?) content.GetValueForProperty("HybridAksIpamEnabled",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkInternal)this).HybridAksIpamEnabled, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HybridAksIpamEnabled.CreateFrom); - } - if (content.Contains("HybridAksPluginType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkInternal)this).HybridAksPluginType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HybridAksPluginType?) content.GetValueForProperty("HybridAksPluginType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkInternal)this).HybridAksPluginType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HybridAksPluginType.CreateFrom); - } - if (content.Contains("InterfaceName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkInternal)this).InterfaceName = (string) content.GetValueForProperty("InterfaceName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkInternal)this).InterfaceName, global::System.Convert.ToString); - } - if (content.Contains("IPAllocationType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkInternal)this).IPAllocationType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.IPAllocationType?) content.GetValueForProperty("IPAllocationType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkInternal)this).IPAllocationType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.IPAllocationType.CreateFrom); - } - if (content.Contains("Ipv4ConnectedPrefix")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkInternal)this).Ipv4ConnectedPrefix = (string) content.GetValueForProperty("Ipv4ConnectedPrefix",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkInternal)this).Ipv4ConnectedPrefix, global::System.Convert.ToString); - } - if (content.Contains("Ipv6ConnectedPrefix")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkInternal)this).Ipv6ConnectedPrefix = (string) content.GetValueForProperty("Ipv6ConnectedPrefix",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkInternal)this).Ipv6ConnectedPrefix, global::System.Convert.ToString); - } - if (content.Contains("L3IsolationDomainId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkInternal)this).L3IsolationDomainId = (string) content.GetValueForProperty("L3IsolationDomainId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkInternal)this).L3IsolationDomainId, global::System.Convert.ToString); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.L3NetworkProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.L3NetworkProvisioningState.CreateFrom); - } - if (content.Contains("VirtualMachinesAssociatedId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkInternal)this).VirtualMachinesAssociatedId = (string[]) content.GetValueForProperty("VirtualMachinesAssociatedId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkInternal)this).VirtualMachinesAssociatedId, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("Vlan")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkInternal)this).Vlan = (long) content.GetValueForProperty("Vlan",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkInternal)this).Vlan, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - 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.NetworkCloud.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(); - } - } - /// L3Network represents a network that utilizes a single isolation domain set up for layer-3 resources. - [System.ComponentModel.TypeConverter(typeof(L3NetworkTypeConverter))] - public partial interface IL3Network - - { - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/L3Network.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/L3Network.cs deleted file mode 100644 index fdcd7685b499..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/L3Network.cs +++ /dev/null @@ -1,497 +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.NetworkCloud.Models.Api20250201 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; - - /// - /// L3Network represents a network that utilizes a single isolation domain set up for layer-3 resources. - /// - public partial class L3Network : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3Network, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkInternal, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IValidates - { - /// - /// Backing field for Inherited model - /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResource __trackedResource = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.TrackedResource(); - - /// - /// The list of resource IDs for the other Microsoft.NetworkCloud resources that have attached this network. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string[] AssociatedResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkPropertiesInternal)Property).AssociatedResourceId; } - - /// - /// The resource ID of the Network Cloud cluster this L3 network is associated with. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string ClusterId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkPropertiesInternal)Property).ClusterId; } - - /// The more detailed status of the L3 network. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.L3NetworkDetailedStatus? DetailedStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkPropertiesInternal)Property).DetailedStatus; } - - /// The descriptive message about the current detailed status. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string DetailedStatusMessage { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkPropertiesInternal)Property).DetailedStatusMessage; } - - /// Backing field for property. - private string _etag; - - /// Resource ETag. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string Etag { get => this._etag; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocation _extendedLocation; - - /// The extended location of the cluster associated with the resource. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocation ExtendedLocation { get => (this._extendedLocation = this._extendedLocation ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ExtendedLocation()); set => this._extendedLocation = value; } - - /// The resource ID of the extended location on which the resource will be created. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string ExtendedLocationName { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocationInternal)ExtendedLocation).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocationInternal)ExtendedLocation).Name = value ; } - - /// The extended location type, for example, CustomLocation. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string ExtendedLocationType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocationInternal)ExtendedLocation).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocationInternal)ExtendedLocation).Type = value ; } - - /// - /// Field Deprecated. These fields will be empty/omitted. The list of Hybrid AKS cluster resource IDs that are associated - /// with this L3 network. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string[] HybridAksClustersAssociatedId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkPropertiesInternal)Property).HybridAksClustersAssociatedId; } - - /// - /// Field Deprecated. The field was previously optional, now it will have no defined behavior and will be ignored. The indicator - /// of whether or not to disable IPAM allocation on the network attachment definition injected into the Hybrid AKS Cluster. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HybridAksIpamEnabled? HybridAksIpamEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkPropertiesInternal)Property).HybridAksIpamEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkPropertiesInternal)Property).HybridAksIpamEnabled = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HybridAksIpamEnabled)""); } - - /// - /// Field Deprecated. The field was previously optional, now it will have no defined behavior and will be ignored. The network - /// plugin type for Hybrid AKS. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HybridAksPluginType? HybridAksPluginType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkPropertiesInternal)Property).HybridAksPluginType; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkPropertiesInternal)Property).HybridAksPluginType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HybridAksPluginType)""); } - - /// The type of the IP address allocation, defaulted to "DualStack". - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.IPAllocationType? IPAllocationType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkPropertiesInternal)Property).IPAllocationType; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkPropertiesInternal)Property).IPAllocationType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.IPAllocationType)""); } - - /// - /// Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).Id; } - - /// - /// The default interface name for this L3 network in the virtual machine. This name can be overridden by the name supplied - /// in the network attachment configuration of that virtual machine. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string InterfaceName { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkPropertiesInternal)Property).InterfaceName; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkPropertiesInternal)Property).InterfaceName = value ?? null; } - - /// - /// The IPV4 prefix (CIDR) assigned to this L3 network. Required when the IP allocation type is IPV4 or DualStack. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string Ipv4ConnectedPrefix { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkPropertiesInternal)Property).Ipv4ConnectedPrefix; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkPropertiesInternal)Property).Ipv4ConnectedPrefix = value ?? null; } - - /// - /// The IPV6 prefix (CIDR) assigned to this L3 network. Required when the IP allocation type is IPV6 or DualStack. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string Ipv6ConnectedPrefix { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkPropertiesInternal)Property).Ipv6ConnectedPrefix; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkPropertiesInternal)Property).Ipv6ConnectedPrefix = value ?? null; } - - /// The resource ID of the Network Fabric l3IsolationDomain. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string L3IsolationDomainId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkPropertiesInternal)Property).L3IsolationDomainId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkPropertiesInternal)Property).L3IsolationDomainId = value ; } - - /// The geo-location where the resource lives - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)__trackedResource).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)__trackedResource).Location = value ; } - - /// Internal Acessors for AssociatedResourceId - string[] Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkInternal.AssociatedResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkPropertiesInternal)Property).AssociatedResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkPropertiesInternal)Property).AssociatedResourceId = value; } - - /// Internal Acessors for ClusterId - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkInternal.ClusterId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkPropertiesInternal)Property).ClusterId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkPropertiesInternal)Property).ClusterId = value; } - - /// Internal Acessors for DetailedStatus - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.L3NetworkDetailedStatus? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkInternal.DetailedStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkPropertiesInternal)Property).DetailedStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkPropertiesInternal)Property).DetailedStatus = value; } - - /// Internal Acessors for DetailedStatusMessage - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkInternal.DetailedStatusMessage { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkPropertiesInternal)Property).DetailedStatusMessage; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkPropertiesInternal)Property).DetailedStatusMessage = value; } - - /// Internal Acessors for Etag - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkInternal.Etag { get => this._etag; set { {_etag = value;} } } - - /// Internal Acessors for ExtendedLocation - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocation Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkInternal.ExtendedLocation { get => (this._extendedLocation = this._extendedLocation ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ExtendedLocation()); set { {_extendedLocation = value;} } } - - /// Internal Acessors for HybridAksClustersAssociatedId - string[] Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkInternal.HybridAksClustersAssociatedId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkPropertiesInternal)Property).HybridAksClustersAssociatedId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkPropertiesInternal)Property).HybridAksClustersAssociatedId = value; } - - /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkProperties Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.L3NetworkProperties()); set { {_property = value;} } } - - /// Internal Acessors for ProvisioningState - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.L3NetworkProvisioningState? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkPropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkPropertiesInternal)Property).ProvisioningState = value; } - - /// Internal Acessors for VirtualMachinesAssociatedId - string[] Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkInternal.VirtualMachinesAssociatedId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkPropertiesInternal)Property).VirtualMachinesAssociatedId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkPropertiesInternal)Property).VirtualMachinesAssociatedId = value; } - - /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).Id = value; } - - /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).Name = value; } - - /// Internal Acessors for SystemData - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ISystemData Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal.SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemData; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemData = value; } - - /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).Type = value; } - - /// The name of the resource - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).Name; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkProperties _property; - - /// The list of the resource properties. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.L3NetworkProperties()); set => this._property = value; } - - /// The provisioning state of the L3 network. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.L3NetworkProvisioningState? ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkPropertiesInternal)Property).ProvisioningState; } - - /// Gets the resource group name - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string ResourceGroupName { get => (new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Success ? new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Groups["resourceGroupName"].Value : null); } - - /// - /// Azure Resource Manager metadata containing createdBy and modifiedBy information. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ISystemData SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemData; } - - /// The timestamp of resource creation (UTC). - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataCreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataCreatedAt = value ?? default(global::System.DateTime); } - - /// The identity that created the resource. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataCreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataCreatedBy = value ?? null; } - - /// The type of identity that created the resource. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType? SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataCreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataCreatedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType)""); } - - /// The timestamp of resource last modification (UTC) - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataLastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataLastModifiedAt = value ?? default(global::System.DateTime); } - - /// The identity that last modified the resource. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataLastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataLastModifiedBy = value ?? null; } - - /// The type of identity that last modified the resource. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType? SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataLastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataLastModifiedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType)""); } - - /// Resource tags. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)__trackedResource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.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.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).Type; } - - /// - /// Field Deprecated. These fields will be empty/omitted. The list of virtual machine resource IDs, excluding any Hybrid AKS - /// virtual machines, that are currently using this L3 network. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string[] VirtualMachinesAssociatedId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkPropertiesInternal)Property).VirtualMachinesAssociatedId; } - - /// The VLAN from the l3IsolationDomain that is used for this network. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public long Vlan { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkPropertiesInternal)Property).Vlan; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkPropertiesInternal)Property).Vlan = value ; } - - /// Creates an new instance. - public L3Network() - { - - } - - /// Validates that this object meets the validation criteria. - /// an instance that will receive validation - /// events. - /// - /// A that will be complete when validation is completed. - /// - public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) - { - await eventListener.AssertNotNull(nameof(__trackedResource), __trackedResource); - await eventListener.AssertObjectIsValid(nameof(__trackedResource), __trackedResource); - } - } - /// L3Network represents a network that utilizes a single isolation domain set up for layer-3 resources. - public partial interface IL3Network : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResource - { - /// - /// The list of resource IDs for the other Microsoft.NetworkCloud resources that have attached this network. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The list of resource IDs for the other Microsoft.NetworkCloud resources that have attached this network.", - SerializedName = @"associatedResourceIds", - PossibleTypes = new [] { typeof(string) })] - string[] AssociatedResourceId { get; } - /// - /// The resource ID of the Network Cloud cluster this L3 network is associated with. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The resource ID of the Network Cloud cluster this L3 network is associated with.", - SerializedName = @"clusterId", - PossibleTypes = new [] { typeof(string) })] - string ClusterId { get; } - /// The more detailed status of the L3 network. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The more detailed status of the L3 network.", - SerializedName = @"detailedStatus", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.L3NetworkDetailedStatus) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.L3NetworkDetailedStatus? DetailedStatus { get; } - /// The descriptive message about the current detailed status. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The descriptive message about the current detailed status.", - SerializedName = @"detailedStatusMessage", - PossibleTypes = new [] { typeof(string) })] - string DetailedStatusMessage { get; } - /// Resource ETag. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"Resource ETag.", - SerializedName = @"etag", - PossibleTypes = new [] { typeof(string) })] - string Etag { get; } - /// The resource ID of the extended location on which the resource will be created. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The resource ID of the extended location on which the resource will be created.", - SerializedName = @"name", - PossibleTypes = new [] { typeof(string) })] - string ExtendedLocationName { get; set; } - /// The extended location type, for example, CustomLocation. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The extended location type, for example, CustomLocation.", - SerializedName = @"type", - PossibleTypes = new [] { typeof(string) })] - string ExtendedLocationType { get; set; } - /// - /// Field Deprecated. These fields will be empty/omitted. The list of Hybrid AKS cluster resource IDs that are associated - /// with this L3 network. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"Field Deprecated. These fields will be empty/omitted. The list of Hybrid AKS cluster resource IDs that are associated with this L3 network.", - SerializedName = @"hybridAksClustersAssociatedIds", - PossibleTypes = new [] { typeof(string) })] - string[] HybridAksClustersAssociatedId { get; } - /// - /// Field Deprecated. The field was previously optional, now it will have no defined behavior and will be ignored. The indicator - /// of whether or not to disable IPAM allocation on the network attachment definition injected into the Hybrid AKS Cluster. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Field Deprecated. The field was previously optional, now it will have no defined behavior and will be ignored. The indicator of whether or not to disable IPAM allocation on the network attachment definition injected into the Hybrid AKS Cluster.", - SerializedName = @"hybridAksIpamEnabled", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HybridAksIpamEnabled) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HybridAksIpamEnabled? HybridAksIpamEnabled { get; set; } - /// - /// Field Deprecated. The field was previously optional, now it will have no defined behavior and will be ignored. The network - /// plugin type for Hybrid AKS. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Field Deprecated. The field was previously optional, now it will have no defined behavior and will be ignored. The network plugin type for Hybrid AKS.", - SerializedName = @"hybridAksPluginType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HybridAksPluginType) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HybridAksPluginType? HybridAksPluginType { get; set; } - /// The type of the IP address allocation, defaulted to "DualStack". - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The type of the IP address allocation, defaulted to ""DualStack"".", - SerializedName = @"ipAllocationType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.IPAllocationType) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.IPAllocationType? IPAllocationType { get; set; } - /// - /// The default interface name for this L3 network in the virtual machine. This name can be overridden by the name supplied - /// in the network attachment configuration of that virtual machine. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The default interface name for this L3 network in the virtual machine. This name can be overridden by the name supplied in the network attachment configuration of that virtual machine.", - SerializedName = @"interfaceName", - PossibleTypes = new [] { typeof(string) })] - string InterfaceName { get; set; } - /// - /// The IPV4 prefix (CIDR) assigned to this L3 network. Required when the IP allocation type is IPV4 or DualStack. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The IPV4 prefix (CIDR) assigned to this L3 network. Required when the IP allocation type is IPV4 or DualStack.", - SerializedName = @"ipv4ConnectedPrefix", - PossibleTypes = new [] { typeof(string) })] - string Ipv4ConnectedPrefix { get; set; } - /// - /// The IPV6 prefix (CIDR) assigned to this L3 network. Required when the IP allocation type is IPV6 or DualStack. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The IPV6 prefix (CIDR) assigned to this L3 network. Required when the IP allocation type is IPV6 or DualStack.", - SerializedName = @"ipv6ConnectedPrefix", - PossibleTypes = new [] { typeof(string) })] - string Ipv6ConnectedPrefix { get; set; } - /// The resource ID of the Network Fabric l3IsolationDomain. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The resource ID of the Network Fabric l3IsolationDomain.", - SerializedName = @"l3IsolationDomainId", - PossibleTypes = new [] { typeof(string) })] - string L3IsolationDomainId { get; set; } - /// The provisioning state of the L3 network. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The provisioning state of the L3 network.", - SerializedName = @"provisioningState", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.L3NetworkProvisioningState) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.L3NetworkProvisioningState? ProvisioningState { get; } - /// - /// Field Deprecated. These fields will be empty/omitted. The list of virtual machine resource IDs, excluding any Hybrid AKS - /// virtual machines, that are currently using this L3 network. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"Field Deprecated. These fields will be empty/omitted. The list of virtual machine resource IDs, excluding any Hybrid AKS virtual machines, that are currently using this L3 network.", - SerializedName = @"virtualMachinesAssociatedIds", - PossibleTypes = new [] { typeof(string) })] - string[] VirtualMachinesAssociatedId { get; } - /// The VLAN from the l3IsolationDomain that is used for this network. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The VLAN from the l3IsolationDomain that is used for this network.", - SerializedName = @"vlan", - PossibleTypes = new [] { typeof(long) })] - long Vlan { get; set; } - - } - /// L3Network represents a network that utilizes a single isolation domain set up for layer-3 resources. - internal partial interface IL3NetworkInternal : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal - { - /// - /// The list of resource IDs for the other Microsoft.NetworkCloud resources that have attached this network. - /// - string[] AssociatedResourceId { get; set; } - /// - /// The resource ID of the Network Cloud cluster this L3 network is associated with. - /// - string ClusterId { get; set; } - /// The more detailed status of the L3 network. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.L3NetworkDetailedStatus? DetailedStatus { get; set; } - /// The descriptive message about the current detailed status. - string DetailedStatusMessage { get; set; } - /// Resource ETag. - string Etag { get; set; } - /// The extended location of the cluster associated with the resource. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocation ExtendedLocation { get; set; } - /// The resource ID of the extended location on which the resource will be created. - string ExtendedLocationName { get; set; } - /// The extended location type, for example, CustomLocation. - string ExtendedLocationType { get; set; } - /// - /// Field Deprecated. These fields will be empty/omitted. The list of Hybrid AKS cluster resource IDs that are associated - /// with this L3 network. - /// - string[] HybridAksClustersAssociatedId { get; set; } - /// - /// Field Deprecated. The field was previously optional, now it will have no defined behavior and will be ignored. The indicator - /// of whether or not to disable IPAM allocation on the network attachment definition injected into the Hybrid AKS Cluster. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HybridAksIpamEnabled? HybridAksIpamEnabled { get; set; } - /// - /// Field Deprecated. The field was previously optional, now it will have no defined behavior and will be ignored. The network - /// plugin type for Hybrid AKS. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HybridAksPluginType? HybridAksPluginType { get; set; } - /// The type of the IP address allocation, defaulted to "DualStack". - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.IPAllocationType? IPAllocationType { get; set; } - /// - /// The default interface name for this L3 network in the virtual machine. This name can be overridden by the name supplied - /// in the network attachment configuration of that virtual machine. - /// - string InterfaceName { get; set; } - /// - /// The IPV4 prefix (CIDR) assigned to this L3 network. Required when the IP allocation type is IPV4 or DualStack. - /// - string Ipv4ConnectedPrefix { get; set; } - /// - /// The IPV6 prefix (CIDR) assigned to this L3 network. Required when the IP allocation type is IPV6 or DualStack. - /// - string Ipv6ConnectedPrefix { get; set; } - /// The resource ID of the Network Fabric l3IsolationDomain. - string L3IsolationDomainId { get; set; } - /// The list of the resource properties. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkProperties Property { get; set; } - /// The provisioning state of the L3 network. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.L3NetworkProvisioningState? ProvisioningState { get; set; } - /// - /// Field Deprecated. These fields will be empty/omitted. The list of virtual machine resource IDs, excluding any Hybrid AKS - /// virtual machines, that are currently using this L3 network. - /// - string[] VirtualMachinesAssociatedId { get; set; } - /// The VLAN from the l3IsolationDomain that is used for this network. - long Vlan { get; set; } - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/L3NetworkAttachmentConfiguration.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/L3NetworkAttachmentConfiguration.PowerShell.cs deleted file mode 100644 index 83df5c65b2d3..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/L3NetworkAttachmentConfiguration.PowerShell.cs +++ /dev/null @@ -1,184 +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.NetworkCloud.Models.Api20250201 -{ - using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; - - /// - /// L3NetworkAttachmentConfiguration represents the configuration of the attachment of a Layer 3 network. - /// - [System.ComponentModel.TypeConverter(typeof(L3NetworkAttachmentConfigurationTypeConverter))] - public partial class L3NetworkAttachmentConfiguration - { - - /// - /// 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.NetworkCloud.Models.Api20250201.IL3NetworkAttachmentConfiguration DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new L3NetworkAttachmentConfiguration(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.NetworkCloud.Models.Api20250201.IL3NetworkAttachmentConfiguration DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new L3NetworkAttachmentConfiguration(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.NetworkCloud.Models.Api20250201.IL3NetworkAttachmentConfiguration FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal L3NetworkAttachmentConfiguration(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("IpamEnabled")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkAttachmentConfigurationInternal)this).IpamEnabled = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.L3NetworkConfigurationIpamEnabled?) content.GetValueForProperty("IpamEnabled",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkAttachmentConfigurationInternal)this).IpamEnabled, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.L3NetworkConfigurationIpamEnabled.CreateFrom); - } - if (content.Contains("NetworkId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkAttachmentConfigurationInternal)this).NetworkId = (string) content.GetValueForProperty("NetworkId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkAttachmentConfigurationInternal)this).NetworkId, global::System.Convert.ToString); - } - if (content.Contains("PluginType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkAttachmentConfigurationInternal)this).PluginType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesPluginType?) content.GetValueForProperty("PluginType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkAttachmentConfigurationInternal)this).PluginType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesPluginType.CreateFrom); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal L3NetworkAttachmentConfiguration(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("IpamEnabled")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkAttachmentConfigurationInternal)this).IpamEnabled = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.L3NetworkConfigurationIpamEnabled?) content.GetValueForProperty("IpamEnabled",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkAttachmentConfigurationInternal)this).IpamEnabled, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.L3NetworkConfigurationIpamEnabled.CreateFrom); - } - if (content.Contains("NetworkId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkAttachmentConfigurationInternal)this).NetworkId = (string) content.GetValueForProperty("NetworkId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkAttachmentConfigurationInternal)this).NetworkId, global::System.Convert.ToString); - } - if (content.Contains("PluginType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkAttachmentConfigurationInternal)this).PluginType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesPluginType?) content.GetValueForProperty("PluginType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkAttachmentConfigurationInternal)this).PluginType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesPluginType.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.NetworkCloud.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(); - } - } - /// L3NetworkAttachmentConfiguration represents the configuration of the attachment of a Layer 3 network. - [System.ComponentModel.TypeConverter(typeof(L3NetworkAttachmentConfigurationTypeConverter))] - public partial interface IL3NetworkAttachmentConfiguration - - { - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/L3NetworkAttachmentConfiguration.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/L3NetworkAttachmentConfiguration.cs deleted file mode 100644 index 259f59d703f2..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/L3NetworkAttachmentConfiguration.cs +++ /dev/null @@ -1,93 +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.NetworkCloud.Models.Api20250201 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; - - /// - /// L3NetworkAttachmentConfiguration represents the configuration of the attachment of a Layer 3 network. - /// - public partial class L3NetworkAttachmentConfiguration : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkAttachmentConfiguration, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkAttachmentConfigurationInternal - { - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.L3NetworkConfigurationIpamEnabled? _ipamEnabled; - - /// - /// The indication of whether this network will or will not perform IP address management and allocate IP addresses when attached. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.L3NetworkConfigurationIpamEnabled? IpamEnabled { get => this._ipamEnabled; set => this._ipamEnabled = value; } - - /// Backing field for property. - private string _networkId; - - /// The resource ID of the network that is being configured for attachment. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string NetworkId { get => this._networkId; set => this._networkId = value; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesPluginType? _pluginType; - - /// The indicator of how this network will be utilized by the Kubernetes cluster. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesPluginType? PluginType { get => this._pluginType; set => this._pluginType = value; } - - /// Creates an new instance. - public L3NetworkAttachmentConfiguration() - { - - } - } - /// L3NetworkAttachmentConfiguration represents the configuration of the attachment of a Layer 3 network. - public partial interface IL3NetworkAttachmentConfiguration : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable - { - /// - /// The indication of whether this network will or will not perform IP address management and allocate IP addresses when attached. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The indication of whether this network will or will not perform IP address management and allocate IP addresses when attached.", - SerializedName = @"ipamEnabled", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.L3NetworkConfigurationIpamEnabled) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.L3NetworkConfigurationIpamEnabled? IpamEnabled { get; set; } - /// The resource ID of the network that is being configured for attachment. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The resource ID of the network that is being configured for attachment.", - SerializedName = @"networkId", - PossibleTypes = new [] { typeof(string) })] - string NetworkId { get; set; } - /// The indicator of how this network will be utilized by the Kubernetes cluster. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The indicator of how this network will be utilized by the Kubernetes cluster.", - SerializedName = @"pluginType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesPluginType) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesPluginType? PluginType { get; set; } - - } - /// L3NetworkAttachmentConfiguration represents the configuration of the attachment of a Layer 3 network. - internal partial interface IL3NetworkAttachmentConfigurationInternal - - { - /// - /// The indication of whether this network will or will not perform IP address management and allocate IP addresses when attached. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.L3NetworkConfigurationIpamEnabled? IpamEnabled { get; set; } - /// The resource ID of the network that is being configured for attachment. - string NetworkId { get; set; } - /// The indicator of how this network will be utilized by the Kubernetes cluster. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesPluginType? PluginType { get; set; } - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/L3NetworkList.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/L3NetworkList.cs deleted file mode 100644 index eb9df2c6e5ce..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/L3NetworkList.cs +++ /dev/null @@ -1,68 +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.NetworkCloud.Models.Api20250201 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; - - /// L3NetworkList represents a list of L3 networks. - public partial class L3NetworkList : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkList, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkListInternal - { - - /// Backing field for property. - private string _nextLink; - - /// The link used to get the next page of operations. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string NextLink { get => this._nextLink; set => this._nextLink = value; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3Network[] _value; - - /// The list of L3 networks. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3Network[] Value { get => this._value; set => this._value = value; } - - /// Creates an new instance. - public L3NetworkList() - { - - } - } - /// L3NetworkList represents a list of L3 networks. - public partial interface IL3NetworkList : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable - { - /// The link used to get the next page of operations. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The link used to get the next page of operations.", - SerializedName = @"nextLink", - PossibleTypes = new [] { typeof(string) })] - string NextLink { get; set; } - /// The list of L3 networks. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The list of L3 networks.", - SerializedName = @"value", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3Network) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3Network[] Value { get; set; } - - } - /// L3NetworkList represents a list of L3 networks. - internal partial interface IL3NetworkListInternal - - { - /// The link used to get the next page of operations. - string NextLink { get; set; } - /// The list of L3 networks. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3Network[] Value { get; set; } - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/L3NetworkPatchParameters.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/L3NetworkPatchParameters.cs deleted file mode 100644 index 10bca9cdd492..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/L3NetworkPatchParameters.cs +++ /dev/null @@ -1,53 +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.NetworkCloud.Models.Api20250201 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; - - /// - /// L3NetworkPatchParameters represents the body of the request to patch the cloud services network. - /// - public partial class L3NetworkPatchParameters : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkPatchParameters, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkPatchParametersInternal - { - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkPatchParametersTags _tag; - - /// The Azure resource tags that will replace the existing ones. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkPatchParametersTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.L3NetworkPatchParametersTags()); set => this._tag = value; } - - /// Creates an new instance. - public L3NetworkPatchParameters() - { - - } - } - /// L3NetworkPatchParameters represents the body of the request to patch the cloud services network. - public partial interface IL3NetworkPatchParameters : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable - { - /// The Azure resource tags that will replace the existing ones. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The Azure resource tags that will replace the existing ones.", - SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkPatchParametersTags) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkPatchParametersTags Tag { get; set; } - - } - /// L3NetworkPatchParameters represents the body of the request to patch the cloud services network. - internal partial interface IL3NetworkPatchParametersInternal - - { - /// The Azure resource tags that will replace the existing ones. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkPatchParametersTags Tag { get; set; } - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/L3NetworkProperties.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/L3NetworkProperties.PowerShell.cs deleted file mode 100644 index 77bdf0bf3c0f..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/L3NetworkProperties.PowerShell.cs +++ /dev/null @@ -1,276 +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.NetworkCloud.Models.Api20250201 -{ - using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; - - /// L3NetworkProperties represents properties of the L3 network. - [System.ComponentModel.TypeConverter(typeof(L3NetworkPropertiesTypeConverter))] - public partial class L3NetworkProperties - { - - /// - /// 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.NetworkCloud.Models.Api20250201.IL3NetworkProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new L3NetworkProperties(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.NetworkCloud.Models.Api20250201.IL3NetworkProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new L3NetworkProperties(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.NetworkCloud.Models.Api20250201.IL3NetworkProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal L3NetworkProperties(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("AssociatedResourceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkPropertiesInternal)this).AssociatedResourceId = (string[]) content.GetValueForProperty("AssociatedResourceId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkPropertiesInternal)this).AssociatedResourceId, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("ClusterId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkPropertiesInternal)this).ClusterId = (string) content.GetValueForProperty("ClusterId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkPropertiesInternal)this).ClusterId, global::System.Convert.ToString); - } - if (content.Contains("DetailedStatus")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkPropertiesInternal)this).DetailedStatus = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.L3NetworkDetailedStatus?) content.GetValueForProperty("DetailedStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkPropertiesInternal)this).DetailedStatus, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.L3NetworkDetailedStatus.CreateFrom); - } - if (content.Contains("DetailedStatusMessage")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkPropertiesInternal)this).DetailedStatusMessage = (string) content.GetValueForProperty("DetailedStatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkPropertiesInternal)this).DetailedStatusMessage, global::System.Convert.ToString); - } - if (content.Contains("HybridAksClustersAssociatedId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkPropertiesInternal)this).HybridAksClustersAssociatedId = (string[]) content.GetValueForProperty("HybridAksClustersAssociatedId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkPropertiesInternal)this).HybridAksClustersAssociatedId, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("HybridAksIpamEnabled")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkPropertiesInternal)this).HybridAksIpamEnabled = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HybridAksIpamEnabled?) content.GetValueForProperty("HybridAksIpamEnabled",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkPropertiesInternal)this).HybridAksIpamEnabled, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HybridAksIpamEnabled.CreateFrom); - } - if (content.Contains("HybridAksPluginType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkPropertiesInternal)this).HybridAksPluginType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HybridAksPluginType?) content.GetValueForProperty("HybridAksPluginType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkPropertiesInternal)this).HybridAksPluginType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HybridAksPluginType.CreateFrom); - } - if (content.Contains("InterfaceName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkPropertiesInternal)this).InterfaceName = (string) content.GetValueForProperty("InterfaceName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkPropertiesInternal)this).InterfaceName, global::System.Convert.ToString); - } - if (content.Contains("IPAllocationType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkPropertiesInternal)this).IPAllocationType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.IPAllocationType?) content.GetValueForProperty("IPAllocationType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkPropertiesInternal)this).IPAllocationType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.IPAllocationType.CreateFrom); - } - if (content.Contains("Ipv4ConnectedPrefix")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkPropertiesInternal)this).Ipv4ConnectedPrefix = (string) content.GetValueForProperty("Ipv4ConnectedPrefix",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkPropertiesInternal)this).Ipv4ConnectedPrefix, global::System.Convert.ToString); - } - if (content.Contains("Ipv6ConnectedPrefix")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkPropertiesInternal)this).Ipv6ConnectedPrefix = (string) content.GetValueForProperty("Ipv6ConnectedPrefix",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkPropertiesInternal)this).Ipv6ConnectedPrefix, global::System.Convert.ToString); - } - if (content.Contains("L3IsolationDomainId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkPropertiesInternal)this).L3IsolationDomainId = (string) content.GetValueForProperty("L3IsolationDomainId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkPropertiesInternal)this).L3IsolationDomainId, global::System.Convert.ToString); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkPropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.L3NetworkProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkPropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.L3NetworkProvisioningState.CreateFrom); - } - if (content.Contains("VirtualMachinesAssociatedId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkPropertiesInternal)this).VirtualMachinesAssociatedId = (string[]) content.GetValueForProperty("VirtualMachinesAssociatedId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkPropertiesInternal)this).VirtualMachinesAssociatedId, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("Vlan")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkPropertiesInternal)this).Vlan = (long) content.GetValueForProperty("Vlan",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkPropertiesInternal)this).Vlan, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal L3NetworkProperties(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("AssociatedResourceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkPropertiesInternal)this).AssociatedResourceId = (string[]) content.GetValueForProperty("AssociatedResourceId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkPropertiesInternal)this).AssociatedResourceId, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("ClusterId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkPropertiesInternal)this).ClusterId = (string) content.GetValueForProperty("ClusterId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkPropertiesInternal)this).ClusterId, global::System.Convert.ToString); - } - if (content.Contains("DetailedStatus")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkPropertiesInternal)this).DetailedStatus = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.L3NetworkDetailedStatus?) content.GetValueForProperty("DetailedStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkPropertiesInternal)this).DetailedStatus, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.L3NetworkDetailedStatus.CreateFrom); - } - if (content.Contains("DetailedStatusMessage")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkPropertiesInternal)this).DetailedStatusMessage = (string) content.GetValueForProperty("DetailedStatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkPropertiesInternal)this).DetailedStatusMessage, global::System.Convert.ToString); - } - if (content.Contains("HybridAksClustersAssociatedId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkPropertiesInternal)this).HybridAksClustersAssociatedId = (string[]) content.GetValueForProperty("HybridAksClustersAssociatedId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkPropertiesInternal)this).HybridAksClustersAssociatedId, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("HybridAksIpamEnabled")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkPropertiesInternal)this).HybridAksIpamEnabled = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HybridAksIpamEnabled?) content.GetValueForProperty("HybridAksIpamEnabled",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkPropertiesInternal)this).HybridAksIpamEnabled, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HybridAksIpamEnabled.CreateFrom); - } - if (content.Contains("HybridAksPluginType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkPropertiesInternal)this).HybridAksPluginType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HybridAksPluginType?) content.GetValueForProperty("HybridAksPluginType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkPropertiesInternal)this).HybridAksPluginType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HybridAksPluginType.CreateFrom); - } - if (content.Contains("InterfaceName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkPropertiesInternal)this).InterfaceName = (string) content.GetValueForProperty("InterfaceName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkPropertiesInternal)this).InterfaceName, global::System.Convert.ToString); - } - if (content.Contains("IPAllocationType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkPropertiesInternal)this).IPAllocationType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.IPAllocationType?) content.GetValueForProperty("IPAllocationType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkPropertiesInternal)this).IPAllocationType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.IPAllocationType.CreateFrom); - } - if (content.Contains("Ipv4ConnectedPrefix")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkPropertiesInternal)this).Ipv4ConnectedPrefix = (string) content.GetValueForProperty("Ipv4ConnectedPrefix",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkPropertiesInternal)this).Ipv4ConnectedPrefix, global::System.Convert.ToString); - } - if (content.Contains("Ipv6ConnectedPrefix")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkPropertiesInternal)this).Ipv6ConnectedPrefix = (string) content.GetValueForProperty("Ipv6ConnectedPrefix",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkPropertiesInternal)this).Ipv6ConnectedPrefix, global::System.Convert.ToString); - } - if (content.Contains("L3IsolationDomainId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkPropertiesInternal)this).L3IsolationDomainId = (string) content.GetValueForProperty("L3IsolationDomainId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkPropertiesInternal)this).L3IsolationDomainId, global::System.Convert.ToString); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkPropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.L3NetworkProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkPropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.L3NetworkProvisioningState.CreateFrom); - } - if (content.Contains("VirtualMachinesAssociatedId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkPropertiesInternal)this).VirtualMachinesAssociatedId = (string[]) content.GetValueForProperty("VirtualMachinesAssociatedId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkPropertiesInternal)this).VirtualMachinesAssociatedId, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("Vlan")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkPropertiesInternal)this).Vlan = (long) content.GetValueForProperty("Vlan",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkPropertiesInternal)this).Vlan, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - 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.NetworkCloud.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(); - } - } - /// L3NetworkProperties represents properties of the L3 network. - [System.ComponentModel.TypeConverter(typeof(L3NetworkPropertiesTypeConverter))] - public partial interface IL3NetworkProperties - - { - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/L3NetworkProperties.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/L3NetworkProperties.cs deleted file mode 100644 index 1f33fad19499..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/L3NetworkProperties.cs +++ /dev/null @@ -1,379 +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.NetworkCloud.Models.Api20250201 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; - - /// L3NetworkProperties represents properties of the L3 network. - public partial class L3NetworkProperties : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkProperties, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkPropertiesInternal - { - - /// Backing field for property. - private string[] _associatedResourceId; - - /// - /// The list of resource IDs for the other Microsoft.NetworkCloud resources that have attached this network. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string[] AssociatedResourceId { get => this._associatedResourceId; } - - /// Backing field for property. - private string _clusterId; - - /// - /// The resource ID of the Network Cloud cluster this L3 network is associated with. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string ClusterId { get => this._clusterId; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.L3NetworkDetailedStatus? _detailedStatus; - - /// The more detailed status of the L3 network. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.L3NetworkDetailedStatus? DetailedStatus { get => this._detailedStatus; } - - /// Backing field for property. - private string _detailedStatusMessage; - - /// The descriptive message about the current detailed status. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string DetailedStatusMessage { get => this._detailedStatusMessage; } - - /// Backing field for property. - private string[] _hybridAksClustersAssociatedId; - - /// - /// Field Deprecated. These fields will be empty/omitted. The list of Hybrid AKS cluster resource IDs that are associated - /// with this L3 network. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string[] HybridAksClustersAssociatedId { get => this._hybridAksClustersAssociatedId; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HybridAksIpamEnabled? _hybridAksIpamEnabled; - - /// - /// Field Deprecated. The field was previously optional, now it will have no defined behavior and will be ignored. The indicator - /// of whether or not to disable IPAM allocation on the network attachment definition injected into the Hybrid AKS Cluster. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HybridAksIpamEnabled? HybridAksIpamEnabled { get => this._hybridAksIpamEnabled; set => this._hybridAksIpamEnabled = value; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HybridAksPluginType? _hybridAksPluginType; - - /// - /// Field Deprecated. The field was previously optional, now it will have no defined behavior and will be ignored. The network - /// plugin type for Hybrid AKS. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HybridAksPluginType? HybridAksPluginType { get => this._hybridAksPluginType; set => this._hybridAksPluginType = value; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.IPAllocationType? _iPAllocationType; - - /// The type of the IP address allocation, defaulted to "DualStack". - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.IPAllocationType? IPAllocationType { get => this._iPAllocationType; set => this._iPAllocationType = value; } - - /// Backing field for property. - private string _interfaceName; - - /// - /// The default interface name for this L3 network in the virtual machine. This name can be overridden by the name supplied - /// in the network attachment configuration of that virtual machine. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string InterfaceName { get => this._interfaceName; set => this._interfaceName = value; } - - /// Backing field for property. - private string _ipv4ConnectedPrefix; - - /// - /// The IPV4 prefix (CIDR) assigned to this L3 network. Required when the IP allocation type is IPV4 or DualStack. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string Ipv4ConnectedPrefix { get => this._ipv4ConnectedPrefix; set => this._ipv4ConnectedPrefix = value; } - - /// Backing field for property. - private string _ipv6ConnectedPrefix; - - /// - /// The IPV6 prefix (CIDR) assigned to this L3 network. Required when the IP allocation type is IPV6 or DualStack. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string Ipv6ConnectedPrefix { get => this._ipv6ConnectedPrefix; set => this._ipv6ConnectedPrefix = value; } - - /// Backing field for property. - private string _l3IsolationDomainId; - - /// The resource ID of the Network Fabric l3IsolationDomain. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string L3IsolationDomainId { get => this._l3IsolationDomainId; set => this._l3IsolationDomainId = value; } - - /// Internal Acessors for AssociatedResourceId - string[] Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkPropertiesInternal.AssociatedResourceId { get => this._associatedResourceId; set { {_associatedResourceId = value;} } } - - /// Internal Acessors for ClusterId - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkPropertiesInternal.ClusterId { get => this._clusterId; set { {_clusterId = value;} } } - - /// Internal Acessors for DetailedStatus - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.L3NetworkDetailedStatus? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkPropertiesInternal.DetailedStatus { get => this._detailedStatus; set { {_detailedStatus = value;} } } - - /// Internal Acessors for DetailedStatusMessage - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkPropertiesInternal.DetailedStatusMessage { get => this._detailedStatusMessage; set { {_detailedStatusMessage = value;} } } - - /// Internal Acessors for HybridAksClustersAssociatedId - string[] Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkPropertiesInternal.HybridAksClustersAssociatedId { get => this._hybridAksClustersAssociatedId; set { {_hybridAksClustersAssociatedId = value;} } } - - /// Internal Acessors for ProvisioningState - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.L3NetworkProvisioningState? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkPropertiesInternal.ProvisioningState { get => this._provisioningState; set { {_provisioningState = value;} } } - - /// Internal Acessors for VirtualMachinesAssociatedId - string[] Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkPropertiesInternal.VirtualMachinesAssociatedId { get => this._virtualMachinesAssociatedId; set { {_virtualMachinesAssociatedId = value;} } } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.L3NetworkProvisioningState? _provisioningState; - - /// The provisioning state of the L3 network. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.L3NetworkProvisioningState? ProvisioningState { get => this._provisioningState; } - - /// Backing field for property. - private string[] _virtualMachinesAssociatedId; - - /// - /// Field Deprecated. These fields will be empty/omitted. The list of virtual machine resource IDs, excluding any Hybrid AKS - /// virtual machines, that are currently using this L3 network. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string[] VirtualMachinesAssociatedId { get => this._virtualMachinesAssociatedId; } - - /// Backing field for property. - private long _vlan; - - /// The VLAN from the l3IsolationDomain that is used for this network. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public long Vlan { get => this._vlan; set => this._vlan = value; } - - /// Creates an new instance. - public L3NetworkProperties() - { - - } - } - /// L3NetworkProperties represents properties of the L3 network. - public partial interface IL3NetworkProperties : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable - { - /// - /// The list of resource IDs for the other Microsoft.NetworkCloud resources that have attached this network. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The list of resource IDs for the other Microsoft.NetworkCloud resources that have attached this network.", - SerializedName = @"associatedResourceIds", - PossibleTypes = new [] { typeof(string) })] - string[] AssociatedResourceId { get; } - /// - /// The resource ID of the Network Cloud cluster this L3 network is associated with. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The resource ID of the Network Cloud cluster this L3 network is associated with.", - SerializedName = @"clusterId", - PossibleTypes = new [] { typeof(string) })] - string ClusterId { get; } - /// The more detailed status of the L3 network. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The more detailed status of the L3 network.", - SerializedName = @"detailedStatus", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.L3NetworkDetailedStatus) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.L3NetworkDetailedStatus? DetailedStatus { get; } - /// The descriptive message about the current detailed status. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The descriptive message about the current detailed status.", - SerializedName = @"detailedStatusMessage", - PossibleTypes = new [] { typeof(string) })] - string DetailedStatusMessage { get; } - /// - /// Field Deprecated. These fields will be empty/omitted. The list of Hybrid AKS cluster resource IDs that are associated - /// with this L3 network. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"Field Deprecated. These fields will be empty/omitted. The list of Hybrid AKS cluster resource IDs that are associated with this L3 network.", - SerializedName = @"hybridAksClustersAssociatedIds", - PossibleTypes = new [] { typeof(string) })] - string[] HybridAksClustersAssociatedId { get; } - /// - /// Field Deprecated. The field was previously optional, now it will have no defined behavior and will be ignored. The indicator - /// of whether or not to disable IPAM allocation on the network attachment definition injected into the Hybrid AKS Cluster. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Field Deprecated. The field was previously optional, now it will have no defined behavior and will be ignored. The indicator of whether or not to disable IPAM allocation on the network attachment definition injected into the Hybrid AKS Cluster.", - SerializedName = @"hybridAksIpamEnabled", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HybridAksIpamEnabled) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HybridAksIpamEnabled? HybridAksIpamEnabled { get; set; } - /// - /// Field Deprecated. The field was previously optional, now it will have no defined behavior and will be ignored. The network - /// plugin type for Hybrid AKS. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Field Deprecated. The field was previously optional, now it will have no defined behavior and will be ignored. The network plugin type for Hybrid AKS.", - SerializedName = @"hybridAksPluginType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HybridAksPluginType) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HybridAksPluginType? HybridAksPluginType { get; set; } - /// The type of the IP address allocation, defaulted to "DualStack". - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The type of the IP address allocation, defaulted to ""DualStack"".", - SerializedName = @"ipAllocationType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.IPAllocationType) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.IPAllocationType? IPAllocationType { get; set; } - /// - /// The default interface name for this L3 network in the virtual machine. This name can be overridden by the name supplied - /// in the network attachment configuration of that virtual machine. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The default interface name for this L3 network in the virtual machine. This name can be overridden by the name supplied in the network attachment configuration of that virtual machine.", - SerializedName = @"interfaceName", - PossibleTypes = new [] { typeof(string) })] - string InterfaceName { get; set; } - /// - /// The IPV4 prefix (CIDR) assigned to this L3 network. Required when the IP allocation type is IPV4 or DualStack. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The IPV4 prefix (CIDR) assigned to this L3 network. Required when the IP allocation type is IPV4 or DualStack.", - SerializedName = @"ipv4ConnectedPrefix", - PossibleTypes = new [] { typeof(string) })] - string Ipv4ConnectedPrefix { get; set; } - /// - /// The IPV6 prefix (CIDR) assigned to this L3 network. Required when the IP allocation type is IPV6 or DualStack. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The IPV6 prefix (CIDR) assigned to this L3 network. Required when the IP allocation type is IPV6 or DualStack.", - SerializedName = @"ipv6ConnectedPrefix", - PossibleTypes = new [] { typeof(string) })] - string Ipv6ConnectedPrefix { get; set; } - /// The resource ID of the Network Fabric l3IsolationDomain. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The resource ID of the Network Fabric l3IsolationDomain.", - SerializedName = @"l3IsolationDomainId", - PossibleTypes = new [] { typeof(string) })] - string L3IsolationDomainId { get; set; } - /// The provisioning state of the L3 network. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The provisioning state of the L3 network.", - SerializedName = @"provisioningState", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.L3NetworkProvisioningState) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.L3NetworkProvisioningState? ProvisioningState { get; } - /// - /// Field Deprecated. These fields will be empty/omitted. The list of virtual machine resource IDs, excluding any Hybrid AKS - /// virtual machines, that are currently using this L3 network. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"Field Deprecated. These fields will be empty/omitted. The list of virtual machine resource IDs, excluding any Hybrid AKS virtual machines, that are currently using this L3 network.", - SerializedName = @"virtualMachinesAssociatedIds", - PossibleTypes = new [] { typeof(string) })] - string[] VirtualMachinesAssociatedId { get; } - /// The VLAN from the l3IsolationDomain that is used for this network. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The VLAN from the l3IsolationDomain that is used for this network.", - SerializedName = @"vlan", - PossibleTypes = new [] { typeof(long) })] - long Vlan { get; set; } - - } - /// L3NetworkProperties represents properties of the L3 network. - internal partial interface IL3NetworkPropertiesInternal - - { - /// - /// The list of resource IDs for the other Microsoft.NetworkCloud resources that have attached this network. - /// - string[] AssociatedResourceId { get; set; } - /// - /// The resource ID of the Network Cloud cluster this L3 network is associated with. - /// - string ClusterId { get; set; } - /// The more detailed status of the L3 network. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.L3NetworkDetailedStatus? DetailedStatus { get; set; } - /// The descriptive message about the current detailed status. - string DetailedStatusMessage { get; set; } - /// - /// Field Deprecated. These fields will be empty/omitted. The list of Hybrid AKS cluster resource IDs that are associated - /// with this L3 network. - /// - string[] HybridAksClustersAssociatedId { get; set; } - /// - /// Field Deprecated. The field was previously optional, now it will have no defined behavior and will be ignored. The indicator - /// of whether or not to disable IPAM allocation on the network attachment definition injected into the Hybrid AKS Cluster. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HybridAksIpamEnabled? HybridAksIpamEnabled { get; set; } - /// - /// Field Deprecated. The field was previously optional, now it will have no defined behavior and will be ignored. The network - /// plugin type for Hybrid AKS. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HybridAksPluginType? HybridAksPluginType { get; set; } - /// The type of the IP address allocation, defaulted to "DualStack". - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.IPAllocationType? IPAllocationType { get; set; } - /// - /// The default interface name for this L3 network in the virtual machine. This name can be overridden by the name supplied - /// in the network attachment configuration of that virtual machine. - /// - string InterfaceName { get; set; } - /// - /// The IPV4 prefix (CIDR) assigned to this L3 network. Required when the IP allocation type is IPV4 or DualStack. - /// - string Ipv4ConnectedPrefix { get; set; } - /// - /// The IPV6 prefix (CIDR) assigned to this L3 network. Required when the IP allocation type is IPV6 or DualStack. - /// - string Ipv6ConnectedPrefix { get; set; } - /// The resource ID of the Network Fabric l3IsolationDomain. - string L3IsolationDomainId { get; set; } - /// The provisioning state of the L3 network. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.L3NetworkProvisioningState? ProvisioningState { get; set; } - /// - /// Field Deprecated. These fields will be empty/omitted. The list of virtual machine resource IDs, excluding any Hybrid AKS - /// virtual machines, that are currently using this L3 network. - /// - string[] VirtualMachinesAssociatedId { get; set; } - /// The VLAN from the l3IsolationDomain that is used for this network. - long Vlan { get; set; } - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/L3NetworkProperties.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/L3NetworkProperties.json.cs deleted file mode 100644 index ef11f8ea707c..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/L3NetworkProperties.json.cs +++ /dev/null @@ -1,181 +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.NetworkCloud.Models.Api20250201 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; - - /// L3NetworkProperties represents properties of the L3 network. - public partial class L3NetworkProperties - { - - /// - /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object - /// before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The JsonNode that should be deserialized into this object. - - partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json); - - /// - /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The JSON container that the serialization result will be placed in. - - partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container); - - /// - /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of - /// the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the - /// output parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The JsonNode that should be deserialized into this object. - /// Determines if the rest of the deserialization should be processed, or if the method should return - /// instantly. - - partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json, ref bool returnNow); - - /// - /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the - /// object before it is serialized. - /// If you wish to disable the default serialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The JSON container that the serialization result will be placed in. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, ref bool returnNow); - - /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkProperties. - /// - /// a to deserialize from. - /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkProperties. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) - { - return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new L3NetworkProperties(json) : null; - } - - /// - /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject into a new instance of . - /// - /// A Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject instance to deserialize from. - internal L3NetworkProperties(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) - { - bool returnNow = false; - BeforeFromJson(json, ref returnNow); - if (returnNow) - { - return; - } - {_associatedResourceId = If( json?.PropertyT("associatedResourceIds"), out var __jsonAssociatedResourceIds) ? If( __jsonAssociatedResourceIds as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : AssociatedResourceId;} - {_clusterId = If( json?.PropertyT("clusterId"), out var __jsonClusterId) ? (string)__jsonClusterId : (string)ClusterId;} - {_detailedStatus = If( json?.PropertyT("detailedStatus"), out var __jsonDetailedStatus) ? (string)__jsonDetailedStatus : (string)DetailedStatus;} - {_detailedStatusMessage = If( json?.PropertyT("detailedStatusMessage"), out var __jsonDetailedStatusMessage) ? (string)__jsonDetailedStatusMessage : (string)DetailedStatusMessage;} - {_hybridAksClustersAssociatedId = If( json?.PropertyT("hybridAksClustersAssociatedIds"), out var __jsonHybridAksClustersAssociatedIds) ? If( __jsonHybridAksClustersAssociatedIds as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Json.JsonString __o ? (string)(__o.ToString()) : null)) ))() : null : HybridAksClustersAssociatedId;} - {_hybridAksIpamEnabled = If( json?.PropertyT("hybridAksIpamEnabled"), out var __jsonHybridAksIpamEnabled) ? (string)__jsonHybridAksIpamEnabled : (string)HybridAksIpamEnabled;} - {_hybridAksPluginType = If( json?.PropertyT("hybridAksPluginType"), out var __jsonHybridAksPluginType) ? (string)__jsonHybridAksPluginType : (string)HybridAksPluginType;} - {_interfaceName = If( json?.PropertyT("interfaceName"), out var __jsonInterfaceName) ? (string)__jsonInterfaceName : (string)InterfaceName;} - {_iPAllocationType = If( json?.PropertyT("ipAllocationType"), out var __jsonIPAllocationType) ? (string)__jsonIPAllocationType : (string)IPAllocationType;} - {_ipv4ConnectedPrefix = If( json?.PropertyT("ipv4ConnectedPrefix"), out var __jsonIpv4ConnectedPrefix) ? (string)__jsonIpv4ConnectedPrefix : (string)Ipv4ConnectedPrefix;} - {_ipv6ConnectedPrefix = If( json?.PropertyT("ipv6ConnectedPrefix"), out var __jsonIpv6ConnectedPrefix) ? (string)__jsonIpv6ConnectedPrefix : (string)Ipv6ConnectedPrefix;} - {_l3IsolationDomainId = If( json?.PropertyT("l3IsolationDomainId"), out var __jsonL3IsolationDomainId) ? (string)__jsonL3IsolationDomainId : (string)L3IsolationDomainId;} - {_provisioningState = If( json?.PropertyT("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)ProvisioningState;} - {_virtualMachinesAssociatedId = If( json?.PropertyT("virtualMachinesAssociatedIds"), out var __jsonVirtualMachinesAssociatedIds) ? If( __jsonVirtualMachinesAssociatedIds as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Json.JsonString __j ? (string)(__j.ToString()) : null)) ))() : null : VirtualMachinesAssociatedId;} - {_vlan = If( json?.PropertyT("vlan"), out var __jsonVlan) ? (long)__jsonVlan : Vlan;} - AfterFromJson(json); - } - - /// - /// Serializes this instance of into a . - /// - /// The container to serialize this object into. If the caller - /// passes in null, a new instance will be created and returned to the caller. - /// Allows the caller to choose the depth of the serialization. See . - /// - /// a serialized instance of as a . - /// - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode) - { - container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject(); - - bool returnNow = false; - BeforeToJson(ref container, ref returnNow); - if (returnNow) - { - return container; - } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) - { - if (null != this._associatedResourceId) - { - var __w = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.XNodeArray(); - foreach( var __x in this._associatedResourceId ) - { - AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); - } - container.Add("associatedResourceIds",__w); - } - } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) - { - AddIf( null != (((object)this._clusterId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._clusterId.ToString()) : null, "clusterId" ,container.Add ); - } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) - { - AddIf( null != (((object)this._detailedStatus)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._detailedStatus.ToString()) : null, "detailedStatus" ,container.Add ); - } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) - { - AddIf( null != (((object)this._detailedStatusMessage)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._detailedStatusMessage.ToString()) : null, "detailedStatusMessage" ,container.Add ); - } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) - { - if (null != this._hybridAksClustersAssociatedId) - { - var __r = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.XNodeArray(); - foreach( var __s in this._hybridAksClustersAssociatedId ) - { - AddIf(null != (((object)__s)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(__s.ToString()) : null ,__r.Add); - } - container.Add("hybridAksClustersAssociatedIds",__r); - } - } - AddIf( null != (((object)this._hybridAksIpamEnabled)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._hybridAksIpamEnabled.ToString()) : null, "hybridAksIpamEnabled" ,container.Add ); - AddIf( null != (((object)this._hybridAksPluginType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._hybridAksPluginType.ToString()) : null, "hybridAksPluginType" ,container.Add ); - AddIf( null != (((object)this._interfaceName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._interfaceName.ToString()) : null, "interfaceName" ,container.Add ); - AddIf( null != (((object)this._iPAllocationType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._iPAllocationType.ToString()) : null, "ipAllocationType" ,container.Add ); - AddIf( null != (((object)this._ipv4ConnectedPrefix)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._ipv4ConnectedPrefix.ToString()) : null, "ipv4ConnectedPrefix" ,container.Add ); - AddIf( null != (((object)this._ipv6ConnectedPrefix)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._ipv6ConnectedPrefix.ToString()) : null, "ipv6ConnectedPrefix" ,container.Add ); - AddIf( null != (((object)this._l3IsolationDomainId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._l3IsolationDomainId.ToString()) : null, "l3IsolationDomainId" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) - { - AddIf( null != (((object)this._provisioningState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._provisioningState.ToString()) : null, "provisioningState" ,container.Add ); - } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) - { - if (null != this._virtualMachinesAssociatedId) - { - var __m = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.XNodeArray(); - foreach( var __n in this._virtualMachinesAssociatedId ) - { - AddIf(null != (((object)__n)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(__n.ToString()) : null ,__m.Add); - } - container.Add("virtualMachinesAssociatedIds",__m); - } - } - AddIf( (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNumber(this._vlan), "vlan" ,container.Add ); - AfterToJson(ref container); - return container; - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/MachineDisk.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/MachineDisk.PowerShell.cs deleted file mode 100644 index d016d8d5a238..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/MachineDisk.PowerShell.cs +++ /dev/null @@ -1,180 +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.NetworkCloud.Models.Api20250201 -{ - using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; - - /// Disk represents the properties of the disk. - [System.ComponentModel.TypeConverter(typeof(MachineDiskTypeConverter))] - public partial class MachineDisk - { - - /// - /// 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.NetworkCloud.Models.Api20250201.IMachineDisk DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new MachineDisk(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.NetworkCloud.Models.Api20250201.IMachineDisk DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new MachineDisk(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.NetworkCloud.Models.Api20250201.IMachineDisk FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal MachineDisk(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("CapacityGb")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineDiskInternal)this).CapacityGb = (long?) content.GetValueForProperty("CapacityGb",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineDiskInternal)this).CapacityGb, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("Connection")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineDiskInternal)this).Connection = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.MachineSkuDiskConnectionType?) content.GetValueForProperty("Connection",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineDiskInternal)this).Connection, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.MachineSkuDiskConnectionType.CreateFrom); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineDiskInternal)this).Type = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.DiskType?) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineDiskInternal)this).Type, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.DiskType.CreateFrom); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal MachineDisk(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("CapacityGb")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineDiskInternal)this).CapacityGb = (long?) content.GetValueForProperty("CapacityGb",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineDiskInternal)this).CapacityGb, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("Connection")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineDiskInternal)this).Connection = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.MachineSkuDiskConnectionType?) content.GetValueForProperty("Connection",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineDiskInternal)this).Connection, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.MachineSkuDiskConnectionType.CreateFrom); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineDiskInternal)this).Type = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.DiskType?) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineDiskInternal)this).Type, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.DiskType.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.NetworkCloud.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(); - } - } - /// Disk represents the properties of the disk. - [System.ComponentModel.TypeConverter(typeof(MachineDiskTypeConverter))] - public partial interface IMachineDisk - - { - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/MachineDisk.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/MachineDisk.cs deleted file mode 100644 index 6cac4abccd5c..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/MachineDisk.cs +++ /dev/null @@ -1,94 +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.NetworkCloud.Models.Api20250201 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; - - /// Disk represents the properties of the disk. - public partial class MachineDisk : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineDisk, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineDiskInternal - { - - /// Backing field for property. - private long? _capacityGb; - - /// The maximum amount of storage. Measured in gibibytes. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public long? CapacityGb { get => this._capacityGb; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.MachineSkuDiskConnectionType? _connection; - - /// The connection type of the rack SKU resource. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.MachineSkuDiskConnectionType? Connection { get => this._connection; } - - /// Internal Acessors for CapacityGb - long? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineDiskInternal.CapacityGb { get => this._capacityGb; set { {_capacityGb = value;} } } - - /// Internal Acessors for Connection - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.MachineSkuDiskConnectionType? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineDiskInternal.Connection { get => this._connection; set { {_connection = value;} } } - - /// Internal Acessors for Type - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.DiskType? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineDiskInternal.Type { get => this._type; set { {_type = value;} } } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.DiskType? _type; - - /// The disk type of rack SKU resource. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.DiskType? Type { get => this._type; } - - /// Creates an new instance. - public MachineDisk() - { - - } - } - /// Disk represents the properties of the disk. - public partial interface IMachineDisk : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable - { - /// The maximum amount of storage. Measured in gibibytes. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The maximum amount of storage. Measured in gibibytes.", - SerializedName = @"capacityGB", - PossibleTypes = new [] { typeof(long) })] - long? CapacityGb { get; } - /// The connection type of the rack SKU resource. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The connection type of the rack SKU resource.", - SerializedName = @"connection", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.MachineSkuDiskConnectionType) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.MachineSkuDiskConnectionType? Connection { get; } - /// The disk type of rack SKU resource. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The disk type of rack SKU resource.", - SerializedName = @"type", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.DiskType) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.DiskType? Type { get; } - - } - /// Disk represents the properties of the disk. - internal partial interface IMachineDiskInternal - - { - /// The maximum amount of storage. Measured in gibibytes. - long? CapacityGb { get; set; } - /// The connection type of the rack SKU resource. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.MachineSkuDiskConnectionType? Connection { get; set; } - /// The disk type of rack SKU resource. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.DiskType? Type { get; set; } - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/MachineSkuProperties.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/MachineSkuProperties.PowerShell.cs deleted file mode 100644 index 3253c2beb9c5..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/MachineSkuProperties.PowerShell.cs +++ /dev/null @@ -1,244 +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.NetworkCloud.Models.Api20250201 -{ - using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; - - /// MachineSkuProperties represents the properties of the machine SKU. - [System.ComponentModel.TypeConverter(typeof(MachineSkuPropertiesTypeConverter))] - public partial class MachineSkuProperties - { - - /// - /// 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.NetworkCloud.Models.Api20250201.IMachineSkuProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new MachineSkuProperties(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.NetworkCloud.Models.Api20250201.IMachineSkuProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new MachineSkuProperties(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.NetworkCloud.Models.Api20250201.IMachineSkuProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal MachineSkuProperties(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("BootstrapProtocol")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuPropertiesInternal)this).BootstrapProtocol = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BootstrapProtocol?) content.GetValueForProperty("BootstrapProtocol",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuPropertiesInternal)this).BootstrapProtocol, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BootstrapProtocol.CreateFrom); - } - if (content.Contains("CpuCore")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuPropertiesInternal)this).CpuCore = (long?) content.GetValueForProperty("CpuCore",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuPropertiesInternal)this).CpuCore, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("CpuSocket")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuPropertiesInternal)this).CpuSocket = (long?) content.GetValueForProperty("CpuSocket",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuPropertiesInternal)this).CpuSocket, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("Disk")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuPropertiesInternal)this).Disk = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineDisk[]) content.GetValueForProperty("Disk",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuPropertiesInternal)this).Disk, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.MachineDiskTypeConverter.ConvertFrom)); - } - if (content.Contains("Generation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuPropertiesInternal)this).Generation = (string) content.GetValueForProperty("Generation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuPropertiesInternal)this).Generation, global::System.Convert.ToString); - } - if (content.Contains("HardwareVersion")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuPropertiesInternal)this).HardwareVersion = (string) content.GetValueForProperty("HardwareVersion",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuPropertiesInternal)this).HardwareVersion, global::System.Convert.ToString); - } - if (content.Contains("MemoryCapacityGb")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuPropertiesInternal)this).MemoryCapacityGb = (long?) content.GetValueForProperty("MemoryCapacityGb",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuPropertiesInternal)this).MemoryCapacityGb, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("Model")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuPropertiesInternal)this).Model = (string) content.GetValueForProperty("Model",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuPropertiesInternal)this).Model, global::System.Convert.ToString); - } - if (content.Contains("NetworkInterface")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuPropertiesInternal)this).NetworkInterface = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkInterface[]) content.GetValueForProperty("NetworkInterface",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuPropertiesInternal)this).NetworkInterface, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.NetworkInterfaceTypeConverter.ConvertFrom)); - } - if (content.Contains("TotalThread")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuPropertiesInternal)this).TotalThread = (long?) content.GetValueForProperty("TotalThread",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuPropertiesInternal)this).TotalThread, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("Vendor")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuPropertiesInternal)this).Vendor = (string) content.GetValueForProperty("Vendor",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuPropertiesInternal)this).Vendor, 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 MachineSkuProperties(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("BootstrapProtocol")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuPropertiesInternal)this).BootstrapProtocol = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BootstrapProtocol?) content.GetValueForProperty("BootstrapProtocol",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuPropertiesInternal)this).BootstrapProtocol, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BootstrapProtocol.CreateFrom); - } - if (content.Contains("CpuCore")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuPropertiesInternal)this).CpuCore = (long?) content.GetValueForProperty("CpuCore",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuPropertiesInternal)this).CpuCore, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("CpuSocket")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuPropertiesInternal)this).CpuSocket = (long?) content.GetValueForProperty("CpuSocket",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuPropertiesInternal)this).CpuSocket, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("Disk")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuPropertiesInternal)this).Disk = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineDisk[]) content.GetValueForProperty("Disk",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuPropertiesInternal)this).Disk, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.MachineDiskTypeConverter.ConvertFrom)); - } - if (content.Contains("Generation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuPropertiesInternal)this).Generation = (string) content.GetValueForProperty("Generation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuPropertiesInternal)this).Generation, global::System.Convert.ToString); - } - if (content.Contains("HardwareVersion")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuPropertiesInternal)this).HardwareVersion = (string) content.GetValueForProperty("HardwareVersion",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuPropertiesInternal)this).HardwareVersion, global::System.Convert.ToString); - } - if (content.Contains("MemoryCapacityGb")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuPropertiesInternal)this).MemoryCapacityGb = (long?) content.GetValueForProperty("MemoryCapacityGb",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuPropertiesInternal)this).MemoryCapacityGb, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("Model")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuPropertiesInternal)this).Model = (string) content.GetValueForProperty("Model",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuPropertiesInternal)this).Model, global::System.Convert.ToString); - } - if (content.Contains("NetworkInterface")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuPropertiesInternal)this).NetworkInterface = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkInterface[]) content.GetValueForProperty("NetworkInterface",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuPropertiesInternal)this).NetworkInterface, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.NetworkInterfaceTypeConverter.ConvertFrom)); - } - if (content.Contains("TotalThread")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuPropertiesInternal)this).TotalThread = (long?) content.GetValueForProperty("TotalThread",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuPropertiesInternal)this).TotalThread, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("Vendor")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuPropertiesInternal)this).Vendor = (string) content.GetValueForProperty("Vendor",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuPropertiesInternal)this).Vendor, 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.NetworkCloud.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(); - } - } - /// MachineSkuProperties represents the properties of the machine SKU. - [System.ComponentModel.TypeConverter(typeof(MachineSkuPropertiesTypeConverter))] - public partial interface IMachineSkuProperties - - { - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/MachineSkuProperties.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/MachineSkuProperties.cs deleted file mode 100644 index 50491529a889..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/MachineSkuProperties.cs +++ /dev/null @@ -1,254 +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.NetworkCloud.Models.Api20250201 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; - - /// MachineSkuProperties represents the properties of the machine SKU. - public partial class MachineSkuProperties : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuProperties, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuPropertiesInternal - { - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BootstrapProtocol? _bootstrapProtocol; - - /// The type of bootstrap protocol used. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BootstrapProtocol? BootstrapProtocol { get => this._bootstrapProtocol; } - - /// Backing field for property. - private long? _cpuCore; - - /// The count of CPU cores for this machine. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public long? CpuCore { get => this._cpuCore; } - - /// Backing field for property. - private long? _cpuSocket; - - /// The count of CPU sockets for this machine. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public long? CpuSocket { get => this._cpuSocket; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineDisk[] _disk; - - /// The list of disks. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineDisk[] Disk { get => this._disk; } - - /// Backing field for property. - private string _generation; - - /// The generation of the architecture. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string Generation { get => this._generation; } - - /// Backing field for property. - private string _hardwareVersion; - - /// The hardware version of the machine. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string HardwareVersion { get => this._hardwareVersion; } - - /// Backing field for property. - private long? _memoryCapacityGb; - - /// The maximum amount of memory. Measured in gibibytes. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public long? MemoryCapacityGb { get => this._memoryCapacityGb; } - - /// Internal Acessors for BootstrapProtocol - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BootstrapProtocol? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuPropertiesInternal.BootstrapProtocol { get => this._bootstrapProtocol; set { {_bootstrapProtocol = value;} } } - - /// Internal Acessors for CpuCore - long? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuPropertiesInternal.CpuCore { get => this._cpuCore; set { {_cpuCore = value;} } } - - /// Internal Acessors for CpuSocket - long? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuPropertiesInternal.CpuSocket { get => this._cpuSocket; set { {_cpuSocket = value;} } } - - /// Internal Acessors for Disk - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineDisk[] Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuPropertiesInternal.Disk { get => this._disk; set { {_disk = value;} } } - - /// Internal Acessors for Generation - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuPropertiesInternal.Generation { get => this._generation; set { {_generation = value;} } } - - /// Internal Acessors for HardwareVersion - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuPropertiesInternal.HardwareVersion { get => this._hardwareVersion; set { {_hardwareVersion = value;} } } - - /// Internal Acessors for MemoryCapacityGb - long? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuPropertiesInternal.MemoryCapacityGb { get => this._memoryCapacityGb; set { {_memoryCapacityGb = value;} } } - - /// Internal Acessors for Model - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuPropertiesInternal.Model { get => this._model; set { {_model = value;} } } - - /// Internal Acessors for NetworkInterface - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkInterface[] Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuPropertiesInternal.NetworkInterface { get => this._networkInterface; set { {_networkInterface = value;} } } - - /// Internal Acessors for TotalThread - long? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuPropertiesInternal.TotalThread { get => this._totalThread; set { {_totalThread = value;} } } - - /// Internal Acessors for Vendor - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuPropertiesInternal.Vendor { get => this._vendor; set { {_vendor = value;} } } - - /// Backing field for property. - private string _model; - - /// The model of the machine. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string Model { get => this._model; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkInterface[] _networkInterface; - - /// The list of network interfaces. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkInterface[] NetworkInterface { get => this._networkInterface; } - - /// Backing field for property. - private long? _totalThread; - - /// The count of SMT and physical core threads for this machine. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public long? TotalThread { get => this._totalThread; } - - /// Backing field for property. - private string _vendor; - - /// The make of the machine. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string Vendor { get => this._vendor; } - - /// Creates an new instance. - public MachineSkuProperties() - { - - } - } - /// MachineSkuProperties represents the properties of the machine SKU. - public partial interface IMachineSkuProperties : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable - { - /// The type of bootstrap protocol used. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The type of bootstrap protocol used.", - SerializedName = @"bootstrapProtocol", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BootstrapProtocol) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BootstrapProtocol? BootstrapProtocol { get; } - /// The count of CPU cores for this machine. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The count of CPU cores for this machine.", - SerializedName = @"cpuCores", - PossibleTypes = new [] { typeof(long) })] - long? CpuCore { get; } - /// The count of CPU sockets for this machine. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The count of CPU sockets for this machine.", - SerializedName = @"cpuSockets", - PossibleTypes = new [] { typeof(long) })] - long? CpuSocket { get; } - /// The list of disks. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The list of disks.", - SerializedName = @"disks", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineDisk) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineDisk[] Disk { get; } - /// The generation of the architecture. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The generation of the architecture.", - SerializedName = @"generation", - PossibleTypes = new [] { typeof(string) })] - string Generation { get; } - /// The hardware version of the machine. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The hardware version of the machine.", - SerializedName = @"hardwareVersion", - PossibleTypes = new [] { typeof(string) })] - string HardwareVersion { get; } - /// The maximum amount of memory. Measured in gibibytes. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The maximum amount of memory. Measured in gibibytes.", - SerializedName = @"memoryCapacityGB", - PossibleTypes = new [] { typeof(long) })] - long? MemoryCapacityGb { get; } - /// The model of the machine. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The model of the machine.", - SerializedName = @"model", - PossibleTypes = new [] { typeof(string) })] - string Model { get; } - /// The list of network interfaces. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The list of network interfaces.", - SerializedName = @"networkInterfaces", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkInterface) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkInterface[] NetworkInterface { get; } - /// The count of SMT and physical core threads for this machine. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The count of SMT and physical core threads for this machine.", - SerializedName = @"totalThreads", - PossibleTypes = new [] { typeof(long) })] - long? TotalThread { get; } - /// The make of the machine. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The make of the machine.", - SerializedName = @"vendor", - PossibleTypes = new [] { typeof(string) })] - string Vendor { get; } - - } - /// MachineSkuProperties represents the properties of the machine SKU. - internal partial interface IMachineSkuPropertiesInternal - - { - /// The type of bootstrap protocol used. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BootstrapProtocol? BootstrapProtocol { get; set; } - /// The count of CPU cores for this machine. - long? CpuCore { get; set; } - /// The count of CPU sockets for this machine. - long? CpuSocket { get; set; } - /// The list of disks. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineDisk[] Disk { get; set; } - /// The generation of the architecture. - string Generation { get; set; } - /// The hardware version of the machine. - string HardwareVersion { get; set; } - /// The maximum amount of memory. Measured in gibibytes. - long? MemoryCapacityGb { get; set; } - /// The model of the machine. - string Model { get; set; } - /// The list of network interfaces. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkInterface[] NetworkInterface { get; set; } - /// The count of SMT and physical core threads for this machine. - long? TotalThread { get; set; } - /// The make of the machine. - string Vendor { get; set; } - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/MachineSkuSlot.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/MachineSkuSlot.PowerShell.cs deleted file mode 100644 index 3bc1008175d4..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/MachineSkuSlot.PowerShell.cs +++ /dev/null @@ -1,262 +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.NetworkCloud.Models.Api20250201 -{ - using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; - - /// - /// MachineSkuSlot represents a single SKU and rack slot associated with the machine. - /// - [System.ComponentModel.TypeConverter(typeof(MachineSkuSlotTypeConverter))] - public partial class MachineSkuSlot - { - - /// - /// 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.NetworkCloud.Models.Api20250201.IMachineSkuSlot DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new MachineSkuSlot(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.NetworkCloud.Models.Api20250201.IMachineSkuSlot DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new MachineSkuSlot(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.NetworkCloud.Models.Api20250201.IMachineSkuSlot FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal MachineSkuSlot(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.NetworkCloud.Models.Api20250201.IMachineSkuSlotInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuSlotInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.MachineSkuPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("RackSlot")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuSlotInternal)this).RackSlot = (long?) content.GetValueForProperty("RackSlot",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuSlotInternal)this).RackSlot, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("BootstrapProtocol")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuSlotInternal)this).BootstrapProtocol = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BootstrapProtocol?) content.GetValueForProperty("BootstrapProtocol",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuSlotInternal)this).BootstrapProtocol, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BootstrapProtocol.CreateFrom); - } - if (content.Contains("CpuCore")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuSlotInternal)this).CpuCore = (long?) content.GetValueForProperty("CpuCore",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuSlotInternal)this).CpuCore, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("CpuSocket")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuSlotInternal)this).CpuSocket = (long?) content.GetValueForProperty("CpuSocket",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuSlotInternal)this).CpuSocket, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("Disk")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuSlotInternal)this).Disk = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineDisk[]) content.GetValueForProperty("Disk",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuSlotInternal)this).Disk, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.MachineDiskTypeConverter.ConvertFrom)); - } - if (content.Contains("Generation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuSlotInternal)this).Generation = (string) content.GetValueForProperty("Generation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuSlotInternal)this).Generation, global::System.Convert.ToString); - } - if (content.Contains("HardwareVersion")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuSlotInternal)this).HardwareVersion = (string) content.GetValueForProperty("HardwareVersion",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuSlotInternal)this).HardwareVersion, global::System.Convert.ToString); - } - if (content.Contains("MemoryCapacityGb")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuSlotInternal)this).MemoryCapacityGb = (long?) content.GetValueForProperty("MemoryCapacityGb",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuSlotInternal)this).MemoryCapacityGb, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("Model")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuSlotInternal)this).Model = (string) content.GetValueForProperty("Model",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuSlotInternal)this).Model, global::System.Convert.ToString); - } - if (content.Contains("NetworkInterface")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuSlotInternal)this).NetworkInterface = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkInterface[]) content.GetValueForProperty("NetworkInterface",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuSlotInternal)this).NetworkInterface, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.NetworkInterfaceTypeConverter.ConvertFrom)); - } - if (content.Contains("TotalThread")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuSlotInternal)this).TotalThread = (long?) content.GetValueForProperty("TotalThread",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuSlotInternal)this).TotalThread, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("Vendor")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuSlotInternal)this).Vendor = (string) content.GetValueForProperty("Vendor",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuSlotInternal)this).Vendor, 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 MachineSkuSlot(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.NetworkCloud.Models.Api20250201.IMachineSkuSlotInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuSlotInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.MachineSkuPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("RackSlot")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuSlotInternal)this).RackSlot = (long?) content.GetValueForProperty("RackSlot",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuSlotInternal)this).RackSlot, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("BootstrapProtocol")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuSlotInternal)this).BootstrapProtocol = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BootstrapProtocol?) content.GetValueForProperty("BootstrapProtocol",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuSlotInternal)this).BootstrapProtocol, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BootstrapProtocol.CreateFrom); - } - if (content.Contains("CpuCore")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuSlotInternal)this).CpuCore = (long?) content.GetValueForProperty("CpuCore",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuSlotInternal)this).CpuCore, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("CpuSocket")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuSlotInternal)this).CpuSocket = (long?) content.GetValueForProperty("CpuSocket",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuSlotInternal)this).CpuSocket, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("Disk")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuSlotInternal)this).Disk = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineDisk[]) content.GetValueForProperty("Disk",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuSlotInternal)this).Disk, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.MachineDiskTypeConverter.ConvertFrom)); - } - if (content.Contains("Generation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuSlotInternal)this).Generation = (string) content.GetValueForProperty("Generation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuSlotInternal)this).Generation, global::System.Convert.ToString); - } - if (content.Contains("HardwareVersion")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuSlotInternal)this).HardwareVersion = (string) content.GetValueForProperty("HardwareVersion",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuSlotInternal)this).HardwareVersion, global::System.Convert.ToString); - } - if (content.Contains("MemoryCapacityGb")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuSlotInternal)this).MemoryCapacityGb = (long?) content.GetValueForProperty("MemoryCapacityGb",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuSlotInternal)this).MemoryCapacityGb, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("Model")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuSlotInternal)this).Model = (string) content.GetValueForProperty("Model",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuSlotInternal)this).Model, global::System.Convert.ToString); - } - if (content.Contains("NetworkInterface")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuSlotInternal)this).NetworkInterface = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkInterface[]) content.GetValueForProperty("NetworkInterface",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuSlotInternal)this).NetworkInterface, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.NetworkInterfaceTypeConverter.ConvertFrom)); - } - if (content.Contains("TotalThread")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuSlotInternal)this).TotalThread = (long?) content.GetValueForProperty("TotalThread",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuSlotInternal)this).TotalThread, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("Vendor")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuSlotInternal)this).Vendor = (string) content.GetValueForProperty("Vendor",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuSlotInternal)this).Vendor, 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.NetworkCloud.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(); - } - } - /// MachineSkuSlot represents a single SKU and rack slot associated with the machine. - [System.ComponentModel.TypeConverter(typeof(MachineSkuSlotTypeConverter))] - public partial interface IMachineSkuSlot - - { - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/MachineSkuSlot.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/MachineSkuSlot.cs deleted file mode 100644 index c4152238067d..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/MachineSkuSlot.cs +++ /dev/null @@ -1,255 +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.NetworkCloud.Models.Api20250201 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; - - /// - /// MachineSkuSlot represents a single SKU and rack slot associated with the machine. - /// - public partial class MachineSkuSlot : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuSlot, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuSlotInternal - { - - /// The type of bootstrap protocol used. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BootstrapProtocol? BootstrapProtocol { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuPropertiesInternal)Property).BootstrapProtocol; } - - /// The count of CPU cores for this machine. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public long? CpuCore { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuPropertiesInternal)Property).CpuCore; } - - /// The count of CPU sockets for this machine. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public long? CpuSocket { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuPropertiesInternal)Property).CpuSocket; } - - /// The list of disks. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineDisk[] Disk { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuPropertiesInternal)Property).Disk; } - - /// The generation of the architecture. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string Generation { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuPropertiesInternal)Property).Generation; } - - /// The hardware version of the machine. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string HardwareVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuPropertiesInternal)Property).HardwareVersion; } - - /// The maximum amount of memory. Measured in gibibytes. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public long? MemoryCapacityGb { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuPropertiesInternal)Property).MemoryCapacityGb; } - - /// Internal Acessors for BootstrapProtocol - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BootstrapProtocol? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuSlotInternal.BootstrapProtocol { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuPropertiesInternal)Property).BootstrapProtocol; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuPropertiesInternal)Property).BootstrapProtocol = value; } - - /// Internal Acessors for CpuCore - long? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuSlotInternal.CpuCore { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuPropertiesInternal)Property).CpuCore; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuPropertiesInternal)Property).CpuCore = value; } - - /// Internal Acessors for CpuSocket - long? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuSlotInternal.CpuSocket { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuPropertiesInternal)Property).CpuSocket; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuPropertiesInternal)Property).CpuSocket = value; } - - /// Internal Acessors for Disk - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineDisk[] Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuSlotInternal.Disk { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuPropertiesInternal)Property).Disk; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuPropertiesInternal)Property).Disk = value; } - - /// Internal Acessors for Generation - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuSlotInternal.Generation { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuPropertiesInternal)Property).Generation; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuPropertiesInternal)Property).Generation = value; } - - /// Internal Acessors for HardwareVersion - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuSlotInternal.HardwareVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuPropertiesInternal)Property).HardwareVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuPropertiesInternal)Property).HardwareVersion = value; } - - /// Internal Acessors for MemoryCapacityGb - long? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuSlotInternal.MemoryCapacityGb { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuPropertiesInternal)Property).MemoryCapacityGb; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuPropertiesInternal)Property).MemoryCapacityGb = value; } - - /// Internal Acessors for Model - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuSlotInternal.Model { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuPropertiesInternal)Property).Model; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuPropertiesInternal)Property).Model = value; } - - /// Internal Acessors for NetworkInterface - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkInterface[] Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuSlotInternal.NetworkInterface { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuPropertiesInternal)Property).NetworkInterface; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuPropertiesInternal)Property).NetworkInterface = value; } - - /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuProperties Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuSlotInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.MachineSkuProperties()); set { {_property = value;} } } - - /// Internal Acessors for RackSlot - long? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuSlotInternal.RackSlot { get => this._rackSlot; set { {_rackSlot = value;} } } - - /// Internal Acessors for TotalThread - long? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuSlotInternal.TotalThread { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuPropertiesInternal)Property).TotalThread; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuPropertiesInternal)Property).TotalThread = value; } - - /// Internal Acessors for Vendor - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuSlotInternal.Vendor { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuPropertiesInternal)Property).Vendor; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuPropertiesInternal)Property).Vendor = value; } - - /// The model of the machine. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string Model { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuPropertiesInternal)Property).Model; } - - /// The list of network interfaces. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkInterface[] NetworkInterface { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuPropertiesInternal)Property).NetworkInterface; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuProperties _property; - - /// The list of the resource properties. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.MachineSkuProperties()); set => this._property = value; } - - /// Backing field for property. - private long? _rackSlot; - - /// The position in the rack for the machine. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public long? RackSlot { get => this._rackSlot; } - - /// The count of SMT and physical core threads for this machine. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public long? TotalThread { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuPropertiesInternal)Property).TotalThread; } - - /// The make of the machine. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string Vendor { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuPropertiesInternal)Property).Vendor; } - - /// Creates an new instance. - public MachineSkuSlot() - { - - } - } - /// MachineSkuSlot represents a single SKU and rack slot associated with the machine. - public partial interface IMachineSkuSlot : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable - { - /// The type of bootstrap protocol used. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The type of bootstrap protocol used.", - SerializedName = @"bootstrapProtocol", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BootstrapProtocol) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BootstrapProtocol? BootstrapProtocol { get; } - /// The count of CPU cores for this machine. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The count of CPU cores for this machine.", - SerializedName = @"cpuCores", - PossibleTypes = new [] { typeof(long) })] - long? CpuCore { get; } - /// The count of CPU sockets for this machine. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The count of CPU sockets for this machine.", - SerializedName = @"cpuSockets", - PossibleTypes = new [] { typeof(long) })] - long? CpuSocket { get; } - /// The list of disks. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The list of disks.", - SerializedName = @"disks", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineDisk) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineDisk[] Disk { get; } - /// The generation of the architecture. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The generation of the architecture.", - SerializedName = @"generation", - PossibleTypes = new [] { typeof(string) })] - string Generation { get; } - /// The hardware version of the machine. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The hardware version of the machine.", - SerializedName = @"hardwareVersion", - PossibleTypes = new [] { typeof(string) })] - string HardwareVersion { get; } - /// The maximum amount of memory. Measured in gibibytes. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The maximum amount of memory. Measured in gibibytes.", - SerializedName = @"memoryCapacityGB", - PossibleTypes = new [] { typeof(long) })] - long? MemoryCapacityGb { get; } - /// The model of the machine. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The model of the machine.", - SerializedName = @"model", - PossibleTypes = new [] { typeof(string) })] - string Model { get; } - /// The list of network interfaces. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The list of network interfaces.", - SerializedName = @"networkInterfaces", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkInterface) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkInterface[] NetworkInterface { get; } - /// The position in the rack for the machine. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The position in the rack for the machine.", - SerializedName = @"rackSlot", - PossibleTypes = new [] { typeof(long) })] - long? RackSlot { get; } - /// The count of SMT and physical core threads for this machine. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The count of SMT and physical core threads for this machine.", - SerializedName = @"totalThreads", - PossibleTypes = new [] { typeof(long) })] - long? TotalThread { get; } - /// The make of the machine. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The make of the machine.", - SerializedName = @"vendor", - PossibleTypes = new [] { typeof(string) })] - string Vendor { get; } - - } - /// MachineSkuSlot represents a single SKU and rack slot associated with the machine. - internal partial interface IMachineSkuSlotInternal - - { - /// The type of bootstrap protocol used. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BootstrapProtocol? BootstrapProtocol { get; set; } - /// The count of CPU cores for this machine. - long? CpuCore { get; set; } - /// The count of CPU sockets for this machine. - long? CpuSocket { get; set; } - /// The list of disks. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineDisk[] Disk { get; set; } - /// The generation of the architecture. - string Generation { get; set; } - /// The hardware version of the machine. - string HardwareVersion { get; set; } - /// The maximum amount of memory. Measured in gibibytes. - long? MemoryCapacityGb { get; set; } - /// The model of the machine. - string Model { get; set; } - /// The list of network interfaces. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkInterface[] NetworkInterface { get; set; } - /// The list of the resource properties. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuProperties Property { get; set; } - /// The position in the rack for the machine. - long? RackSlot { get; set; } - /// The count of SMT and physical core threads for this machine. - long? TotalThread { get; set; } - /// The make of the machine. - string Vendor { get; set; } - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/NetworkAttachment.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/NetworkAttachment.PowerShell.cs deleted file mode 100644 index f0a44dd5336f..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/NetworkAttachment.PowerShell.cs +++ /dev/null @@ -1,212 +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.NetworkCloud.Models.Api20250201 -{ - using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; - - /// NetworkAttachment represents the single network attachment. - [System.ComponentModel.TypeConverter(typeof(NetworkAttachmentTypeConverter))] - public partial class NetworkAttachment - { - - /// - /// 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.NetworkCloud.Models.Api20250201.INetworkAttachment DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new NetworkAttachment(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.NetworkCloud.Models.Api20250201.INetworkAttachment DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new NetworkAttachment(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.NetworkCloud.Models.Api20250201.INetworkAttachment FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal NetworkAttachment(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("AttachedNetworkId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkAttachmentInternal)this).AttachedNetworkId = (string) content.GetValueForProperty("AttachedNetworkId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkAttachmentInternal)this).AttachedNetworkId, global::System.Convert.ToString); - } - if (content.Contains("DefaultGateway")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkAttachmentInternal)this).DefaultGateway = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.DefaultGateway?) content.GetValueForProperty("DefaultGateway",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkAttachmentInternal)this).DefaultGateway, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.DefaultGateway.CreateFrom); - } - if (content.Contains("IPAllocationMethod")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkAttachmentInternal)this).IPAllocationMethod = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineIPAllocationMethod) content.GetValueForProperty("IPAllocationMethod",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkAttachmentInternal)this).IPAllocationMethod, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineIPAllocationMethod.CreateFrom); - } - if (content.Contains("Ipv4Address")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkAttachmentInternal)this).Ipv4Address = (string) content.GetValueForProperty("Ipv4Address",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkAttachmentInternal)this).Ipv4Address, global::System.Convert.ToString); - } - if (content.Contains("Ipv6Address")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkAttachmentInternal)this).Ipv6Address = (string) content.GetValueForProperty("Ipv6Address",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkAttachmentInternal)this).Ipv6Address, global::System.Convert.ToString); - } - if (content.Contains("MacAddress")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkAttachmentInternal)this).MacAddress = (string) content.GetValueForProperty("MacAddress",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkAttachmentInternal)this).MacAddress, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkAttachmentInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkAttachmentInternal)this).Name, 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 NetworkAttachment(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("AttachedNetworkId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkAttachmentInternal)this).AttachedNetworkId = (string) content.GetValueForProperty("AttachedNetworkId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkAttachmentInternal)this).AttachedNetworkId, global::System.Convert.ToString); - } - if (content.Contains("DefaultGateway")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkAttachmentInternal)this).DefaultGateway = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.DefaultGateway?) content.GetValueForProperty("DefaultGateway",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkAttachmentInternal)this).DefaultGateway, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.DefaultGateway.CreateFrom); - } - if (content.Contains("IPAllocationMethod")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkAttachmentInternal)this).IPAllocationMethod = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineIPAllocationMethod) content.GetValueForProperty("IPAllocationMethod",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkAttachmentInternal)this).IPAllocationMethod, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineIPAllocationMethod.CreateFrom); - } - if (content.Contains("Ipv4Address")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkAttachmentInternal)this).Ipv4Address = (string) content.GetValueForProperty("Ipv4Address",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkAttachmentInternal)this).Ipv4Address, global::System.Convert.ToString); - } - if (content.Contains("Ipv6Address")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkAttachmentInternal)this).Ipv6Address = (string) content.GetValueForProperty("Ipv6Address",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkAttachmentInternal)this).Ipv6Address, global::System.Convert.ToString); - } - if (content.Contains("MacAddress")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkAttachmentInternal)this).MacAddress = (string) content.GetValueForProperty("MacAddress",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkAttachmentInternal)this).MacAddress, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkAttachmentInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkAttachmentInternal)this).Name, 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.NetworkCloud.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(); - } - } - /// NetworkAttachment represents the single network attachment. - [System.ComponentModel.TypeConverter(typeof(NetworkAttachmentTypeConverter))] - public partial interface INetworkAttachment - - { - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/NetworkConfiguration.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/NetworkConfiguration.PowerShell.cs deleted file mode 100644 index b7497c425290..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/NetworkConfiguration.PowerShell.cs +++ /dev/null @@ -1,286 +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.NetworkCloud.Models.Api20250201 -{ - using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; - - /// - /// NetworkConfiguration specifies the Kubernetes cluster network related configuration. - /// - [System.ComponentModel.TypeConverter(typeof(NetworkConfigurationTypeConverter))] - public partial class NetworkConfiguration - { - - /// - /// 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.NetworkCloud.Models.Api20250201.INetworkConfiguration DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new NetworkConfiguration(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.NetworkCloud.Models.Api20250201.INetworkConfiguration DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new NetworkConfiguration(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.NetworkCloud.Models.Api20250201.INetworkConfiguration FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal NetworkConfiguration(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("AttachedNetworkConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkConfigurationInternal)this).AttachedNetworkConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAttachedNetworkConfiguration) content.GetValueForProperty("AttachedNetworkConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkConfigurationInternal)this).AttachedNetworkConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AttachedNetworkConfigurationTypeConverter.ConvertFrom); - } - if (content.Contains("BgpServiceLoadBalancerConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkConfigurationInternal)this).BgpServiceLoadBalancerConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBgpServiceLoadBalancerConfiguration) content.GetValueForProperty("BgpServiceLoadBalancerConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkConfigurationInternal)this).BgpServiceLoadBalancerConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BgpServiceLoadBalancerConfigurationTypeConverter.ConvertFrom); - } - if (content.Contains("L2ServiceLoadBalancerConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkConfigurationInternal)this).L2ServiceLoadBalancerConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2ServiceLoadBalancerConfiguration) content.GetValueForProperty("L2ServiceLoadBalancerConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkConfigurationInternal)this).L2ServiceLoadBalancerConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.L2ServiceLoadBalancerConfigurationTypeConverter.ConvertFrom); - } - if (content.Contains("CloudServicesNetworkId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkConfigurationInternal)this).CloudServicesNetworkId = (string) content.GetValueForProperty("CloudServicesNetworkId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkConfigurationInternal)this).CloudServicesNetworkId, global::System.Convert.ToString); - } - if (content.Contains("CniNetworkId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkConfigurationInternal)this).CniNetworkId = (string) content.GetValueForProperty("CniNetworkId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkConfigurationInternal)this).CniNetworkId, global::System.Convert.ToString); - } - if (content.Contains("DnsServiceIP")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkConfigurationInternal)this).DnsServiceIP = (string) content.GetValueForProperty("DnsServiceIP",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkConfigurationInternal)this).DnsServiceIP, global::System.Convert.ToString); - } - if (content.Contains("PodCidr")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkConfigurationInternal)this).PodCidr = (string[]) content.GetValueForProperty("PodCidr",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkConfigurationInternal)this).PodCidr, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("ServiceCidr")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkConfigurationInternal)this).ServiceCidr = (string[]) content.GetValueForProperty("ServiceCidr",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkConfigurationInternal)this).ServiceCidr, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("AttachedNetworkConfigurationL2Network")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkConfigurationInternal)this).AttachedNetworkConfigurationL2Network = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkAttachmentConfiguration[]) content.GetValueForProperty("AttachedNetworkConfigurationL2Network",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkConfigurationInternal)this).AttachedNetworkConfigurationL2Network, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.L2NetworkAttachmentConfigurationTypeConverter.ConvertFrom)); - } - if (content.Contains("AttachedNetworkConfigurationL3Network")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkConfigurationInternal)this).AttachedNetworkConfigurationL3Network = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkAttachmentConfiguration[]) content.GetValueForProperty("AttachedNetworkConfigurationL3Network",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkConfigurationInternal)this).AttachedNetworkConfigurationL3Network, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.L3NetworkAttachmentConfigurationTypeConverter.ConvertFrom)); - } - if (content.Contains("AttachedNetworkConfigurationTrunkedNetwork")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkConfigurationInternal)this).AttachedNetworkConfigurationTrunkedNetwork = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkAttachmentConfiguration[]) content.GetValueForProperty("AttachedNetworkConfigurationTrunkedNetwork",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkConfigurationInternal)this).AttachedNetworkConfigurationTrunkedNetwork, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.TrunkedNetworkAttachmentConfigurationTypeConverter.ConvertFrom)); - } - if (content.Contains("BgpServiceLoadBalancerConfigurationBgpAdvertisement")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkConfigurationInternal)this).BgpServiceLoadBalancerConfigurationBgpAdvertisement = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBgpAdvertisement[]) content.GetValueForProperty("BgpServiceLoadBalancerConfigurationBgpAdvertisement",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkConfigurationInternal)this).BgpServiceLoadBalancerConfigurationBgpAdvertisement, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BgpAdvertisementTypeConverter.ConvertFrom)); - } - if (content.Contains("BgpServiceLoadBalancerConfigurationBgpPeer")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkConfigurationInternal)this).BgpServiceLoadBalancerConfigurationBgpPeer = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IServiceLoadBalancerBgpPeer[]) content.GetValueForProperty("BgpServiceLoadBalancerConfigurationBgpPeer",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkConfigurationInternal)this).BgpServiceLoadBalancerConfigurationBgpPeer, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ServiceLoadBalancerBgpPeerTypeConverter.ConvertFrom)); - } - if (content.Contains("BgpServiceLoadBalancerConfigurationFabricPeeringEnabled")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkConfigurationInternal)this).BgpServiceLoadBalancerConfigurationFabricPeeringEnabled = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.FabricPeeringEnabled?) content.GetValueForProperty("BgpServiceLoadBalancerConfigurationFabricPeeringEnabled",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkConfigurationInternal)this).BgpServiceLoadBalancerConfigurationFabricPeeringEnabled, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.FabricPeeringEnabled.CreateFrom); - } - if (content.Contains("BgpServiceLoadBalancerConfigurationIPAddressPool")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkConfigurationInternal)this).BgpServiceLoadBalancerConfigurationIPAddressPool = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIPAddressPool[]) content.GetValueForProperty("BgpServiceLoadBalancerConfigurationIPAddressPool",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkConfigurationInternal)this).BgpServiceLoadBalancerConfigurationIPAddressPool, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IPAddressPoolTypeConverter.ConvertFrom)); - } - if (content.Contains("L2ServiceLoadBalancerConfigurationIPAddressPool")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkConfigurationInternal)this).L2ServiceLoadBalancerConfigurationIPAddressPool = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIPAddressPool[]) content.GetValueForProperty("L2ServiceLoadBalancerConfigurationIPAddressPool",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkConfigurationInternal)this).L2ServiceLoadBalancerConfigurationIPAddressPool, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IPAddressPoolTypeConverter.ConvertFrom)); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal NetworkConfiguration(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("AttachedNetworkConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkConfigurationInternal)this).AttachedNetworkConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAttachedNetworkConfiguration) content.GetValueForProperty("AttachedNetworkConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkConfigurationInternal)this).AttachedNetworkConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AttachedNetworkConfigurationTypeConverter.ConvertFrom); - } - if (content.Contains("BgpServiceLoadBalancerConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkConfigurationInternal)this).BgpServiceLoadBalancerConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBgpServiceLoadBalancerConfiguration) content.GetValueForProperty("BgpServiceLoadBalancerConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkConfigurationInternal)this).BgpServiceLoadBalancerConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BgpServiceLoadBalancerConfigurationTypeConverter.ConvertFrom); - } - if (content.Contains("L2ServiceLoadBalancerConfiguration")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkConfigurationInternal)this).L2ServiceLoadBalancerConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2ServiceLoadBalancerConfiguration) content.GetValueForProperty("L2ServiceLoadBalancerConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkConfigurationInternal)this).L2ServiceLoadBalancerConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.L2ServiceLoadBalancerConfigurationTypeConverter.ConvertFrom); - } - if (content.Contains("CloudServicesNetworkId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkConfigurationInternal)this).CloudServicesNetworkId = (string) content.GetValueForProperty("CloudServicesNetworkId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkConfigurationInternal)this).CloudServicesNetworkId, global::System.Convert.ToString); - } - if (content.Contains("CniNetworkId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkConfigurationInternal)this).CniNetworkId = (string) content.GetValueForProperty("CniNetworkId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkConfigurationInternal)this).CniNetworkId, global::System.Convert.ToString); - } - if (content.Contains("DnsServiceIP")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkConfigurationInternal)this).DnsServiceIP = (string) content.GetValueForProperty("DnsServiceIP",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkConfigurationInternal)this).DnsServiceIP, global::System.Convert.ToString); - } - if (content.Contains("PodCidr")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkConfigurationInternal)this).PodCidr = (string[]) content.GetValueForProperty("PodCidr",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkConfigurationInternal)this).PodCidr, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("ServiceCidr")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkConfigurationInternal)this).ServiceCidr = (string[]) content.GetValueForProperty("ServiceCidr",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkConfigurationInternal)this).ServiceCidr, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("AttachedNetworkConfigurationL2Network")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkConfigurationInternal)this).AttachedNetworkConfigurationL2Network = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkAttachmentConfiguration[]) content.GetValueForProperty("AttachedNetworkConfigurationL2Network",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkConfigurationInternal)this).AttachedNetworkConfigurationL2Network, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.L2NetworkAttachmentConfigurationTypeConverter.ConvertFrom)); - } - if (content.Contains("AttachedNetworkConfigurationL3Network")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkConfigurationInternal)this).AttachedNetworkConfigurationL3Network = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkAttachmentConfiguration[]) content.GetValueForProperty("AttachedNetworkConfigurationL3Network",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkConfigurationInternal)this).AttachedNetworkConfigurationL3Network, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.L3NetworkAttachmentConfigurationTypeConverter.ConvertFrom)); - } - if (content.Contains("AttachedNetworkConfigurationTrunkedNetwork")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkConfigurationInternal)this).AttachedNetworkConfigurationTrunkedNetwork = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkAttachmentConfiguration[]) content.GetValueForProperty("AttachedNetworkConfigurationTrunkedNetwork",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkConfigurationInternal)this).AttachedNetworkConfigurationTrunkedNetwork, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.TrunkedNetworkAttachmentConfigurationTypeConverter.ConvertFrom)); - } - if (content.Contains("BgpServiceLoadBalancerConfigurationBgpAdvertisement")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkConfigurationInternal)this).BgpServiceLoadBalancerConfigurationBgpAdvertisement = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBgpAdvertisement[]) content.GetValueForProperty("BgpServiceLoadBalancerConfigurationBgpAdvertisement",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkConfigurationInternal)this).BgpServiceLoadBalancerConfigurationBgpAdvertisement, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BgpAdvertisementTypeConverter.ConvertFrom)); - } - if (content.Contains("BgpServiceLoadBalancerConfigurationBgpPeer")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkConfigurationInternal)this).BgpServiceLoadBalancerConfigurationBgpPeer = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IServiceLoadBalancerBgpPeer[]) content.GetValueForProperty("BgpServiceLoadBalancerConfigurationBgpPeer",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkConfigurationInternal)this).BgpServiceLoadBalancerConfigurationBgpPeer, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ServiceLoadBalancerBgpPeerTypeConverter.ConvertFrom)); - } - if (content.Contains("BgpServiceLoadBalancerConfigurationFabricPeeringEnabled")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkConfigurationInternal)this).BgpServiceLoadBalancerConfigurationFabricPeeringEnabled = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.FabricPeeringEnabled?) content.GetValueForProperty("BgpServiceLoadBalancerConfigurationFabricPeeringEnabled",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkConfigurationInternal)this).BgpServiceLoadBalancerConfigurationFabricPeeringEnabled, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.FabricPeeringEnabled.CreateFrom); - } - if (content.Contains("BgpServiceLoadBalancerConfigurationIPAddressPool")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkConfigurationInternal)this).BgpServiceLoadBalancerConfigurationIPAddressPool = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIPAddressPool[]) content.GetValueForProperty("BgpServiceLoadBalancerConfigurationIPAddressPool",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkConfigurationInternal)this).BgpServiceLoadBalancerConfigurationIPAddressPool, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IPAddressPoolTypeConverter.ConvertFrom)); - } - if (content.Contains("L2ServiceLoadBalancerConfigurationIPAddressPool")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkConfigurationInternal)this).L2ServiceLoadBalancerConfigurationIPAddressPool = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIPAddressPool[]) content.GetValueForProperty("L2ServiceLoadBalancerConfigurationIPAddressPool",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkConfigurationInternal)this).L2ServiceLoadBalancerConfigurationIPAddressPool, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IPAddressPoolTypeConverter.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.NetworkCloud.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(); - } - } - /// NetworkConfiguration specifies the Kubernetes cluster network related configuration. - [System.ComponentModel.TypeConverter(typeof(NetworkConfigurationTypeConverter))] - public partial interface INetworkConfiguration - - { - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/NetworkConfiguration.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/NetworkConfiguration.cs deleted file mode 100644 index ac1cf109c121..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/NetworkConfiguration.cs +++ /dev/null @@ -1,342 +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.NetworkCloud.Models.Api20250201 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; - - /// - /// NetworkConfiguration specifies the Kubernetes cluster network related configuration. - /// - public partial class NetworkConfiguration : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkConfiguration, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkConfigurationInternal - { - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAttachedNetworkConfiguration _attachedNetworkConfiguration; - - /// - /// The configuration of networks being attached to the cluster for use by the workloads that run on this Kubernetes cluster. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAttachedNetworkConfiguration AttachedNetworkConfiguration { get => (this._attachedNetworkConfiguration = this._attachedNetworkConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AttachedNetworkConfiguration()); set => this._attachedNetworkConfiguration = value; } - - /// The list of Layer 2 Networks and related configuration for attachment. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkAttachmentConfiguration[] AttachedNetworkConfigurationL2Network { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAttachedNetworkConfigurationInternal)AttachedNetworkConfiguration).L2Network; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAttachedNetworkConfigurationInternal)AttachedNetworkConfiguration).L2Network = value ?? null /* arrayOf */; } - - /// The list of Layer 3 Networks and related configuration for attachment. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkAttachmentConfiguration[] AttachedNetworkConfigurationL3Network { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAttachedNetworkConfigurationInternal)AttachedNetworkConfiguration).L3Network; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAttachedNetworkConfigurationInternal)AttachedNetworkConfiguration).L3Network = value ?? null /* arrayOf */; } - - /// The list of Trunked Networks and related configuration for attachment. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkAttachmentConfiguration[] AttachedNetworkConfigurationTrunkedNetwork { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAttachedNetworkConfigurationInternal)AttachedNetworkConfiguration).TrunkedNetwork; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAttachedNetworkConfigurationInternal)AttachedNetworkConfiguration).TrunkedNetwork = value ?? null /* arrayOf */; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBgpServiceLoadBalancerConfiguration _bgpServiceLoadBalancerConfiguration; - - /// - /// The configuration of the BGP service load balancer for this Kubernetes cluster. A maximum of one service load balancer - /// may be specified, either Layer 2 or BGP. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBgpServiceLoadBalancerConfiguration BgpServiceLoadBalancerConfiguration { get => (this._bgpServiceLoadBalancerConfiguration = this._bgpServiceLoadBalancerConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BgpServiceLoadBalancerConfiguration()); set => this._bgpServiceLoadBalancerConfiguration = value; } - - /// - /// The association of IP address pools to the communities and peers, allowing for announcement of IPs. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBgpAdvertisement[] BgpServiceLoadBalancerConfigurationBgpAdvertisement { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBgpServiceLoadBalancerConfigurationInternal)BgpServiceLoadBalancerConfiguration).BgpAdvertisement; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBgpServiceLoadBalancerConfigurationInternal)BgpServiceLoadBalancerConfiguration).BgpAdvertisement = value ?? null /* arrayOf */; } - - /// - /// The list of additional BgpPeer entities that the Kubernetes cluster will peer with. All peering must be explicitly defined. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IServiceLoadBalancerBgpPeer[] BgpServiceLoadBalancerConfigurationBgpPeer { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBgpServiceLoadBalancerConfigurationInternal)BgpServiceLoadBalancerConfiguration).BgpPeer; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBgpServiceLoadBalancerConfigurationInternal)BgpServiceLoadBalancerConfiguration).BgpPeer = value ?? null /* arrayOf */; } - - /// The indicator to specify if the load balancer peers with the network fabric. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.FabricPeeringEnabled? BgpServiceLoadBalancerConfigurationFabricPeeringEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBgpServiceLoadBalancerConfigurationInternal)BgpServiceLoadBalancerConfiguration).FabricPeeringEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBgpServiceLoadBalancerConfigurationInternal)BgpServiceLoadBalancerConfiguration).FabricPeeringEnabled = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.FabricPeeringEnabled)""); } - - /// - /// The list of pools of IP addresses that can be allocated to load balancer services. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIPAddressPool[] BgpServiceLoadBalancerConfigurationIPAddressPool { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBgpServiceLoadBalancerConfigurationInternal)BgpServiceLoadBalancerConfiguration).IPAddressPool; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBgpServiceLoadBalancerConfigurationInternal)BgpServiceLoadBalancerConfiguration).IPAddressPool = value ?? null /* arrayOf */; } - - /// Backing field for property. - private string _cloudServicesNetworkId; - - /// The resource ID of the associated Cloud Services network. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string CloudServicesNetworkId { get => this._cloudServicesNetworkId; set => this._cloudServicesNetworkId = value; } - - /// Backing field for property. - private string _cniNetworkId; - - /// - /// The resource ID of the Layer 3 network that is used for creation of the Container Networking Interface network. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string CniNetworkId { get => this._cniNetworkId; set => this._cniNetworkId = value; } - - /// Backing field for property. - private string _dnsServiceIP; - - /// - /// The IP address assigned to the Kubernetes DNS service. It must be within the Kubernetes service address range specified - /// in service CIDR. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string DnsServiceIP { get => this._dnsServiceIP; set => this._dnsServiceIP = value; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2ServiceLoadBalancerConfiguration _l2ServiceLoadBalancerConfiguration; - - /// - /// The configuration of the Layer 2 service load balancer for this Kubernetes cluster. A maximum of one service load balancer - /// may be specified, either Layer 2 or BGP. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2ServiceLoadBalancerConfiguration L2ServiceLoadBalancerConfiguration { get => (this._l2ServiceLoadBalancerConfiguration = this._l2ServiceLoadBalancerConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.L2ServiceLoadBalancerConfiguration()); set => this._l2ServiceLoadBalancerConfiguration = value; } - - /// - /// The list of pools of IP addresses that can be allocated to load balancer services. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIPAddressPool[] L2ServiceLoadBalancerConfigurationIPAddressPool { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2ServiceLoadBalancerConfigurationInternal)L2ServiceLoadBalancerConfiguration).IPAddressPool; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2ServiceLoadBalancerConfigurationInternal)L2ServiceLoadBalancerConfiguration).IPAddressPool = value ?? null /* arrayOf */; } - - /// Internal Acessors for AttachedNetworkConfiguration - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAttachedNetworkConfiguration Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkConfigurationInternal.AttachedNetworkConfiguration { get => (this._attachedNetworkConfiguration = this._attachedNetworkConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AttachedNetworkConfiguration()); set { {_attachedNetworkConfiguration = value;} } } - - /// Internal Acessors for BgpServiceLoadBalancerConfiguration - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBgpServiceLoadBalancerConfiguration Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkConfigurationInternal.BgpServiceLoadBalancerConfiguration { get => (this._bgpServiceLoadBalancerConfiguration = this._bgpServiceLoadBalancerConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BgpServiceLoadBalancerConfiguration()); set { {_bgpServiceLoadBalancerConfiguration = value;} } } - - /// Internal Acessors for L2ServiceLoadBalancerConfiguration - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2ServiceLoadBalancerConfiguration Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkConfigurationInternal.L2ServiceLoadBalancerConfiguration { get => (this._l2ServiceLoadBalancerConfiguration = this._l2ServiceLoadBalancerConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.L2ServiceLoadBalancerConfiguration()); set { {_l2ServiceLoadBalancerConfiguration = value;} } } - - /// Backing field for property. - private string[] _podCidr; - - /// - /// The CIDR notation IP ranges from which to assign pod IPs. One IPv4 CIDR is expected for single-stack networking. Two CIDRs, - /// one for each IP family (IPv4/IPv6), is expected for dual-stack networking. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string[] PodCidr { get => this._podCidr; set => this._podCidr = value; } - - /// Backing field for property. - private string[] _serviceCidr; - - /// - /// The CIDR notation IP ranges from which to assign service IPs. One IPv4 CIDR is expected for single-stack networking. Two - /// CIDRs, one for each IP family (IPv4/IPv6), is expected for dual-stack networking. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string[] ServiceCidr { get => this._serviceCidr; set => this._serviceCidr = value; } - - /// Creates an new instance. - public NetworkConfiguration() - { - - } - } - /// NetworkConfiguration specifies the Kubernetes cluster network related configuration. - public partial interface INetworkConfiguration : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable - { - /// The list of Layer 2 Networks and related configuration for attachment. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The list of Layer 2 Networks and related configuration for attachment.", - SerializedName = @"l2Networks", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkAttachmentConfiguration) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkAttachmentConfiguration[] AttachedNetworkConfigurationL2Network { get; set; } - /// The list of Layer 3 Networks and related configuration for attachment. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The list of Layer 3 Networks and related configuration for attachment.", - SerializedName = @"l3Networks", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkAttachmentConfiguration) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkAttachmentConfiguration[] AttachedNetworkConfigurationL3Network { get; set; } - /// The list of Trunked Networks and related configuration for attachment. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The list of Trunked Networks and related configuration for attachment.", - SerializedName = @"trunkedNetworks", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkAttachmentConfiguration) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkAttachmentConfiguration[] AttachedNetworkConfigurationTrunkedNetwork { get; set; } - /// - /// The association of IP address pools to the communities and peers, allowing for announcement of IPs. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The association of IP address pools to the communities and peers, allowing for announcement of IPs.", - SerializedName = @"bgpAdvertisements", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBgpAdvertisement) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBgpAdvertisement[] BgpServiceLoadBalancerConfigurationBgpAdvertisement { get; set; } - /// - /// The list of additional BgpPeer entities that the Kubernetes cluster will peer with. All peering must be explicitly defined. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The list of additional BgpPeer entities that the Kubernetes cluster will peer with. All peering must be explicitly defined.", - SerializedName = @"bgpPeers", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IServiceLoadBalancerBgpPeer) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IServiceLoadBalancerBgpPeer[] BgpServiceLoadBalancerConfigurationBgpPeer { get; set; } - /// The indicator to specify if the load balancer peers with the network fabric. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The indicator to specify if the load balancer peers with the network fabric.", - SerializedName = @"fabricPeeringEnabled", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.FabricPeeringEnabled) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.FabricPeeringEnabled? BgpServiceLoadBalancerConfigurationFabricPeeringEnabled { get; set; } - /// - /// The list of pools of IP addresses that can be allocated to load balancer services. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The list of pools of IP addresses that can be allocated to load balancer services.", - SerializedName = @"ipAddressPools", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIPAddressPool) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIPAddressPool[] BgpServiceLoadBalancerConfigurationIPAddressPool { get; set; } - /// The resource ID of the associated Cloud Services network. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The resource ID of the associated Cloud Services network.", - SerializedName = @"cloudServicesNetworkId", - PossibleTypes = new [] { typeof(string) })] - string CloudServicesNetworkId { get; set; } - /// - /// The resource ID of the Layer 3 network that is used for creation of the Container Networking Interface network. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The resource ID of the Layer 3 network that is used for creation of the Container Networking Interface network.", - SerializedName = @"cniNetworkId", - PossibleTypes = new [] { typeof(string) })] - string CniNetworkId { get; set; } - /// - /// The IP address assigned to the Kubernetes DNS service. It must be within the Kubernetes service address range specified - /// in service CIDR. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The IP address assigned to the Kubernetes DNS service. It must be within the Kubernetes service address range specified in service CIDR.", - SerializedName = @"dnsServiceIp", - PossibleTypes = new [] { typeof(string) })] - string DnsServiceIP { get; set; } - /// - /// The list of pools of IP addresses that can be allocated to load balancer services. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The list of pools of IP addresses that can be allocated to load balancer services.", - SerializedName = @"ipAddressPools", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIPAddressPool) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIPAddressPool[] L2ServiceLoadBalancerConfigurationIPAddressPool { get; set; } - /// - /// The CIDR notation IP ranges from which to assign pod IPs. One IPv4 CIDR is expected for single-stack networking. Two CIDRs, - /// one for each IP family (IPv4/IPv6), is expected for dual-stack networking. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The CIDR notation IP ranges from which to assign pod IPs. One IPv4 CIDR is expected for single-stack networking. Two CIDRs, one for each IP family (IPv4/IPv6), is expected for dual-stack networking.", - SerializedName = @"podCidrs", - PossibleTypes = new [] { typeof(string) })] - string[] PodCidr { get; set; } - /// - /// The CIDR notation IP ranges from which to assign service IPs. One IPv4 CIDR is expected for single-stack networking. Two - /// CIDRs, one for each IP family (IPv4/IPv6), is expected for dual-stack networking. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The CIDR notation IP ranges from which to assign service IPs. One IPv4 CIDR is expected for single-stack networking. Two CIDRs, one for each IP family (IPv4/IPv6), is expected for dual-stack networking.", - SerializedName = @"serviceCidrs", - PossibleTypes = new [] { typeof(string) })] - string[] ServiceCidr { get; set; } - - } - /// NetworkConfiguration specifies the Kubernetes cluster network related configuration. - internal partial interface INetworkConfigurationInternal - - { - /// - /// The configuration of networks being attached to the cluster for use by the workloads that run on this Kubernetes cluster. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAttachedNetworkConfiguration AttachedNetworkConfiguration { get; set; } - /// The list of Layer 2 Networks and related configuration for attachment. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkAttachmentConfiguration[] AttachedNetworkConfigurationL2Network { get; set; } - /// The list of Layer 3 Networks and related configuration for attachment. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkAttachmentConfiguration[] AttachedNetworkConfigurationL3Network { get; set; } - /// The list of Trunked Networks and related configuration for attachment. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkAttachmentConfiguration[] AttachedNetworkConfigurationTrunkedNetwork { get; set; } - /// - /// The configuration of the BGP service load balancer for this Kubernetes cluster. A maximum of one service load balancer - /// may be specified, either Layer 2 or BGP. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBgpServiceLoadBalancerConfiguration BgpServiceLoadBalancerConfiguration { get; set; } - /// - /// The association of IP address pools to the communities and peers, allowing for announcement of IPs. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBgpAdvertisement[] BgpServiceLoadBalancerConfigurationBgpAdvertisement { get; set; } - /// - /// The list of additional BgpPeer entities that the Kubernetes cluster will peer with. All peering must be explicitly defined. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IServiceLoadBalancerBgpPeer[] BgpServiceLoadBalancerConfigurationBgpPeer { get; set; } - /// The indicator to specify if the load balancer peers with the network fabric. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.FabricPeeringEnabled? BgpServiceLoadBalancerConfigurationFabricPeeringEnabled { get; set; } - /// - /// The list of pools of IP addresses that can be allocated to load balancer services. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIPAddressPool[] BgpServiceLoadBalancerConfigurationIPAddressPool { get; set; } - /// The resource ID of the associated Cloud Services network. - string CloudServicesNetworkId { get; set; } - /// - /// The resource ID of the Layer 3 network that is used for creation of the Container Networking Interface network. - /// - string CniNetworkId { get; set; } - /// - /// The IP address assigned to the Kubernetes DNS service. It must be within the Kubernetes service address range specified - /// in service CIDR. - /// - string DnsServiceIP { get; set; } - /// - /// The configuration of the Layer 2 service load balancer for this Kubernetes cluster. A maximum of one service load balancer - /// may be specified, either Layer 2 or BGP. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2ServiceLoadBalancerConfiguration L2ServiceLoadBalancerConfiguration { get; set; } - /// - /// The list of pools of IP addresses that can be allocated to load balancer services. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIPAddressPool[] L2ServiceLoadBalancerConfigurationIPAddressPool { get; set; } - /// - /// The CIDR notation IP ranges from which to assign pod IPs. One IPv4 CIDR is expected for single-stack networking. Two CIDRs, - /// one for each IP family (IPv4/IPv6), is expected for dual-stack networking. - /// - string[] PodCidr { get; set; } - /// - /// The CIDR notation IP ranges from which to assign service IPs. One IPv4 CIDR is expected for single-stack networking. Two - /// CIDRs, one for each IP family (IPv4/IPv6), is expected for dual-stack networking. - /// - string[] ServiceCidr { get; set; } - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/NetworkConfiguration.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/NetworkConfiguration.json.cs deleted file mode 100644 index 45c37376a81b..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/NetworkConfiguration.json.cs +++ /dev/null @@ -1,140 +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.NetworkCloud.Models.Api20250201 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; - - /// - /// NetworkConfiguration specifies the Kubernetes cluster network related configuration. - /// - public partial class NetworkConfiguration - { - - /// - /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object - /// before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The JsonNode that should be deserialized into this object. - - partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json); - - /// - /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The JSON container that the serialization result will be placed in. - - partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container); - - /// - /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of - /// the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the - /// output parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The JsonNode that should be deserialized into this object. - /// Determines if the rest of the deserialization should be processed, or if the method should return - /// instantly. - - partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json, ref bool returnNow); - - /// - /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the - /// object before it is serialized. - /// If you wish to disable the default serialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The JSON container that the serialization result will be placed in. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, ref bool returnNow); - - /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkConfiguration. - /// - /// a to deserialize from. - /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkConfiguration. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkConfiguration FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) - { - return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new NetworkConfiguration(json) : null; - } - - /// - /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject into a new instance of . - /// - /// A Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject instance to deserialize from. - internal NetworkConfiguration(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) - { - bool returnNow = false; - BeforeFromJson(json, ref returnNow); - if (returnNow) - { - return; - } - {_attachedNetworkConfiguration = If( json?.PropertyT("attachedNetworkConfiguration"), out var __jsonAttachedNetworkConfiguration) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AttachedNetworkConfiguration.FromJson(__jsonAttachedNetworkConfiguration) : AttachedNetworkConfiguration;} - {_bgpServiceLoadBalancerConfiguration = If( json?.PropertyT("bgpServiceLoadBalancerConfiguration"), out var __jsonBgpServiceLoadBalancerConfiguration) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BgpServiceLoadBalancerConfiguration.FromJson(__jsonBgpServiceLoadBalancerConfiguration) : BgpServiceLoadBalancerConfiguration;} - {_l2ServiceLoadBalancerConfiguration = If( json?.PropertyT("l2ServiceLoadBalancerConfiguration"), out var __jsonL2ServiceLoadBalancerConfiguration) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.L2ServiceLoadBalancerConfiguration.FromJson(__jsonL2ServiceLoadBalancerConfiguration) : L2ServiceLoadBalancerConfiguration;} - {_cloudServicesNetworkId = If( json?.PropertyT("cloudServicesNetworkId"), out var __jsonCloudServicesNetworkId) ? (string)__jsonCloudServicesNetworkId : (string)CloudServicesNetworkId;} - {_cniNetworkId = If( json?.PropertyT("cniNetworkId"), out var __jsonCniNetworkId) ? (string)__jsonCniNetworkId : (string)CniNetworkId;} - {_dnsServiceIP = If( json?.PropertyT("dnsServiceIp"), out var __jsonDnsServiceIP) ? (string)__jsonDnsServiceIP : (string)DnsServiceIP;} - {_podCidr = If( json?.PropertyT("podCidrs"), out var __jsonPodCidrs) ? If( __jsonPodCidrs as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : PodCidr;} - {_serviceCidr = If( json?.PropertyT("serviceCidrs"), out var __jsonServiceCidrs) ? If( __jsonServiceCidrs as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Json.JsonString __o ? (string)(__o.ToString()) : null)) ))() : null : ServiceCidr;} - AfterFromJson(json); - } - - /// - /// Serializes this instance of into a . - /// - /// The container to serialize this object into. If the caller - /// passes in null, a new instance will be created and returned to the caller. - /// Allows the caller to choose the depth of the serialization. See . - /// - /// a serialized instance of as a . - /// - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode) - { - container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject(); - - bool returnNow = false; - BeforeToJson(ref container, ref returnNow); - if (returnNow) - { - return container; - } - AddIf( null != this._attachedNetworkConfiguration ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) this._attachedNetworkConfiguration.ToJson(null,serializationMode) : null, "attachedNetworkConfiguration" ,container.Add ); - AddIf( null != this._bgpServiceLoadBalancerConfiguration ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) this._bgpServiceLoadBalancerConfiguration.ToJson(null,serializationMode) : null, "bgpServiceLoadBalancerConfiguration" ,container.Add ); - AddIf( null != this._l2ServiceLoadBalancerConfiguration ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) this._l2ServiceLoadBalancerConfiguration.ToJson(null,serializationMode) : null, "l2ServiceLoadBalancerConfiguration" ,container.Add ); - AddIf( null != (((object)this._cloudServicesNetworkId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._cloudServicesNetworkId.ToString()) : null, "cloudServicesNetworkId" ,container.Add ); - AddIf( null != (((object)this._cniNetworkId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._cniNetworkId.ToString()) : null, "cniNetworkId" ,container.Add ); - AddIf( null != (((object)this._dnsServiceIP)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._dnsServiceIP.ToString()) : null, "dnsServiceIp" ,container.Add ); - if (null != this._podCidr) - { - var __w = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.XNodeArray(); - foreach( var __x in this._podCidr ) - { - AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); - } - container.Add("podCidrs",__w); - } - if (null != this._serviceCidr) - { - var __r = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.XNodeArray(); - foreach( var __s in this._serviceCidr ) - { - AddIf(null != (((object)__s)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(__s.ToString()) : null ,__r.Add); - } - container.Add("serviceCidrs",__r); - } - AfterToJson(ref container); - return container; - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/NetworkInterface.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/NetworkInterface.PowerShell.cs deleted file mode 100644 index 2003f6a5d95d..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/NetworkInterface.PowerShell.cs +++ /dev/null @@ -1,212 +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.NetworkCloud.Models.Api20250201 -{ - using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; - - /// NetworkInterface represents properties of the network interface. - [System.ComponentModel.TypeConverter(typeof(NetworkInterfaceTypeConverter))] - public partial class NetworkInterface - { - - /// - /// 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.NetworkCloud.Models.Api20250201.INetworkInterface DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new NetworkInterface(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.NetworkCloud.Models.Api20250201.INetworkInterface DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new NetworkInterface(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.NetworkCloud.Models.Api20250201.INetworkInterface FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal NetworkInterface(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("Address")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkInterfaceInternal)this).Address = (string) content.GetValueForProperty("Address",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkInterfaceInternal)this).Address, global::System.Convert.ToString); - } - if (content.Contains("DeviceConnectionType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkInterfaceInternal)this).DeviceConnectionType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.DeviceConnectionType?) content.GetValueForProperty("DeviceConnectionType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkInterfaceInternal)this).DeviceConnectionType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.DeviceConnectionType.CreateFrom); - } - if (content.Contains("Model")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkInterfaceInternal)this).Model = (string) content.GetValueForProperty("Model",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkInterfaceInternal)this).Model, global::System.Convert.ToString); - } - if (content.Contains("PhysicalSlot")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkInterfaceInternal)this).PhysicalSlot = (long?) content.GetValueForProperty("PhysicalSlot",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkInterfaceInternal)this).PhysicalSlot, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("PortCount")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkInterfaceInternal)this).PortCount = (long?) content.GetValueForProperty("PortCount",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkInterfaceInternal)this).PortCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("PortSpeed")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkInterfaceInternal)this).PortSpeed = (long?) content.GetValueForProperty("PortSpeed",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkInterfaceInternal)this).PortSpeed, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("Vendor")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkInterfaceInternal)this).Vendor = (string) content.GetValueForProperty("Vendor",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkInterfaceInternal)this).Vendor, 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 NetworkInterface(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("Address")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkInterfaceInternal)this).Address = (string) content.GetValueForProperty("Address",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkInterfaceInternal)this).Address, global::System.Convert.ToString); - } - if (content.Contains("DeviceConnectionType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkInterfaceInternal)this).DeviceConnectionType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.DeviceConnectionType?) content.GetValueForProperty("DeviceConnectionType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkInterfaceInternal)this).DeviceConnectionType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.DeviceConnectionType.CreateFrom); - } - if (content.Contains("Model")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkInterfaceInternal)this).Model = (string) content.GetValueForProperty("Model",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkInterfaceInternal)this).Model, global::System.Convert.ToString); - } - if (content.Contains("PhysicalSlot")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkInterfaceInternal)this).PhysicalSlot = (long?) content.GetValueForProperty("PhysicalSlot",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkInterfaceInternal)this).PhysicalSlot, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("PortCount")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkInterfaceInternal)this).PortCount = (long?) content.GetValueForProperty("PortCount",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkInterfaceInternal)this).PortCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("PortSpeed")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkInterfaceInternal)this).PortSpeed = (long?) content.GetValueForProperty("PortSpeed",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkInterfaceInternal)this).PortSpeed, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("Vendor")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkInterfaceInternal)this).Vendor = (string) content.GetValueForProperty("Vendor",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkInterfaceInternal)this).Vendor, 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.NetworkCloud.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(); - } - } - /// NetworkInterface represents properties of the network interface. - [System.ComponentModel.TypeConverter(typeof(NetworkInterfaceTypeConverter))] - public partial interface INetworkInterface - - { - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/Nic.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/Nic.PowerShell.cs deleted file mode 100644 index 6bf9f9246b89..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/Nic.PowerShell.cs +++ /dev/null @@ -1,214 +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.NetworkCloud.Models.Api20250201 -{ - using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; - - /// - /// Type Deprecated. Will be removed in an upcoming version. Nic represents the network interface card details. - /// - [System.ComponentModel.TypeConverter(typeof(NicTypeConverter))] - public partial class Nic - { - - /// - /// 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.NetworkCloud.Models.Api20250201.INic DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new Nic(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.NetworkCloud.Models.Api20250201.INic DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new Nic(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.NetworkCloud.Models.Api20250201.INic FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal Nic(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("LldpNeighbor")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INicInternal)this).LldpNeighbor = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ILldpNeighbor) content.GetValueForProperty("LldpNeighbor",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INicInternal)this).LldpNeighbor, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.LldpNeighborTypeConverter.ConvertFrom); - } - if (content.Contains("MacAddress")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INicInternal)this).MacAddress = (string) content.GetValueForProperty("MacAddress",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INicInternal)this).MacAddress, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INicInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INicInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("LldpNeighborPortDescription")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INicInternal)this).LldpNeighborPortDescription = (string) content.GetValueForProperty("LldpNeighborPortDescription",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INicInternal)this).LldpNeighborPortDescription, global::System.Convert.ToString); - } - if (content.Contains("LldpNeighborPortName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INicInternal)this).LldpNeighborPortName = (string) content.GetValueForProperty("LldpNeighborPortName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INicInternal)this).LldpNeighborPortName, global::System.Convert.ToString); - } - if (content.Contains("LldpNeighborSystemDescription")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INicInternal)this).LldpNeighborSystemDescription = (string) content.GetValueForProperty("LldpNeighborSystemDescription",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INicInternal)this).LldpNeighborSystemDescription, global::System.Convert.ToString); - } - if (content.Contains("LldpNeighborSystemName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INicInternal)this).LldpNeighborSystemName = (string) content.GetValueForProperty("LldpNeighborSystemName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INicInternal)this).LldpNeighborSystemName, 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 Nic(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("LldpNeighbor")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INicInternal)this).LldpNeighbor = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ILldpNeighbor) content.GetValueForProperty("LldpNeighbor",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INicInternal)this).LldpNeighbor, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.LldpNeighborTypeConverter.ConvertFrom); - } - if (content.Contains("MacAddress")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INicInternal)this).MacAddress = (string) content.GetValueForProperty("MacAddress",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INicInternal)this).MacAddress, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INicInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INicInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("LldpNeighborPortDescription")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INicInternal)this).LldpNeighborPortDescription = (string) content.GetValueForProperty("LldpNeighborPortDescription",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INicInternal)this).LldpNeighborPortDescription, global::System.Convert.ToString); - } - if (content.Contains("LldpNeighborPortName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INicInternal)this).LldpNeighborPortName = (string) content.GetValueForProperty("LldpNeighborPortName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INicInternal)this).LldpNeighborPortName, global::System.Convert.ToString); - } - if (content.Contains("LldpNeighborSystemDescription")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INicInternal)this).LldpNeighborSystemDescription = (string) content.GetValueForProperty("LldpNeighborSystemDescription",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INicInternal)this).LldpNeighborSystemDescription, global::System.Convert.ToString); - } - if (content.Contains("LldpNeighborSystemName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INicInternal)this).LldpNeighborSystemName = (string) content.GetValueForProperty("LldpNeighborSystemName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INicInternal)this).LldpNeighborSystemName, 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.NetworkCloud.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(); - } - } - /// Type Deprecated. Will be removed in an upcoming version. Nic represents the network interface card details. - [System.ComponentModel.TypeConverter(typeof(NicTypeConverter))] - public partial interface INic - - { - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/Nic.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/Nic.cs deleted file mode 100644 index 68805b0224ed..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/Nic.cs +++ /dev/null @@ -1,156 +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.NetworkCloud.Models.Api20250201 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; - - /// - /// Type Deprecated. Will be removed in an upcoming version. Nic represents the network interface card details. - /// - public partial class Nic : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INic, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INicInternal - { - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ILldpNeighbor _lldpNeighbor; - - /// The information about the device connected to this NIC. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ILldpNeighbor LldpNeighbor { get => (this._lldpNeighbor = this._lldpNeighbor ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.LldpNeighbor()); } - - /// The descriptive information about the port on the connected device. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string LldpNeighborPortDescription { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ILldpNeighborInternal)LldpNeighbor).PortDescription; } - - /// The system-assigned name of the port on the connected device. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string LldpNeighborPortName { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ILldpNeighborInternal)LldpNeighbor).PortName; } - - /// The descriptive information about the connected device. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string LldpNeighborSystemDescription { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ILldpNeighborInternal)LldpNeighbor).SystemDescription; } - - /// The system-assigned name of the connected device. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string LldpNeighborSystemName { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ILldpNeighborInternal)LldpNeighbor).SystemName; } - - /// Backing field for property. - private string _macAddress; - - /// The MAC address associated with this NIC. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string MacAddress { get => this._macAddress; } - - /// Internal Acessors for LldpNeighbor - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ILldpNeighbor Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INicInternal.LldpNeighbor { get => (this._lldpNeighbor = this._lldpNeighbor ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.LldpNeighbor()); set { {_lldpNeighbor = value;} } } - - /// Internal Acessors for LldpNeighborPortDescription - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INicInternal.LldpNeighborPortDescription { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ILldpNeighborInternal)LldpNeighbor).PortDescription; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ILldpNeighborInternal)LldpNeighbor).PortDescription = value; } - - /// Internal Acessors for LldpNeighborPortName - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INicInternal.LldpNeighborPortName { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ILldpNeighborInternal)LldpNeighbor).PortName; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ILldpNeighborInternal)LldpNeighbor).PortName = value; } - - /// Internal Acessors for LldpNeighborSystemDescription - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INicInternal.LldpNeighborSystemDescription { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ILldpNeighborInternal)LldpNeighbor).SystemDescription; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ILldpNeighborInternal)LldpNeighbor).SystemDescription = value; } - - /// Internal Acessors for LldpNeighborSystemName - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INicInternal.LldpNeighborSystemName { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ILldpNeighborInternal)LldpNeighbor).SystemName; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ILldpNeighborInternal)LldpNeighbor).SystemName = value; } - - /// Internal Acessors for MacAddress - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INicInternal.MacAddress { get => this._macAddress; set { {_macAddress = value;} } } - - /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INicInternal.Name { get => this._name; set { {_name = value;} } } - - /// Backing field for property. - private string _name; - - /// The name of the NIC/interface. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string Name { get => this._name; } - - /// Creates an new instance. - public Nic() - { - - } - } - /// Type Deprecated. Will be removed in an upcoming version. Nic represents the network interface card details. - public partial interface INic : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable - { - /// The descriptive information about the port on the connected device. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The descriptive information about the port on the connected device.", - SerializedName = @"portDescription", - PossibleTypes = new [] { typeof(string) })] - string LldpNeighborPortDescription { get; } - /// The system-assigned name of the port on the connected device. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The system-assigned name of the port on the connected device.", - SerializedName = @"portName", - PossibleTypes = new [] { typeof(string) })] - string LldpNeighborPortName { get; } - /// The descriptive information about the connected device. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The descriptive information about the connected device.", - SerializedName = @"systemDescription", - PossibleTypes = new [] { typeof(string) })] - string LldpNeighborSystemDescription { get; } - /// The system-assigned name of the connected device. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The system-assigned name of the connected device.", - SerializedName = @"systemName", - PossibleTypes = new [] { typeof(string) })] - string LldpNeighborSystemName { get; } - /// The MAC address associated with this NIC. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The MAC address associated with this NIC.", - SerializedName = @"macAddress", - PossibleTypes = new [] { typeof(string) })] - string MacAddress { get; } - /// The name of the NIC/interface. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The name of the NIC/interface.", - SerializedName = @"name", - PossibleTypes = new [] { typeof(string) })] - string Name { get; } - - } - /// Type Deprecated. Will be removed in an upcoming version. Nic represents the network interface card details. - internal partial interface INicInternal - - { - /// The information about the device connected to this NIC. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ILldpNeighbor LldpNeighbor { get; set; } - /// The descriptive information about the port on the connected device. - string LldpNeighborPortDescription { get; set; } - /// The system-assigned name of the port on the connected device. - string LldpNeighborPortName { get; set; } - /// The descriptive information about the connected device. - string LldpNeighborSystemDescription { get; set; } - /// The system-assigned name of the connected device. - string LldpNeighborSystemName { get; set; } - /// The MAC address associated with this NIC. - string MacAddress { get; set; } - /// The name of the NIC/interface. - string Name { get; set; } - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/NodePoolAdministratorConfigurationPatch.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/NodePoolAdministratorConfigurationPatch.cs deleted file mode 100644 index 98247a572f35..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/NodePoolAdministratorConfigurationPatch.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.NetworkCloud.Models.Api20250201 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; - - /// - /// NodePoolAdministratorConfigurationPatch represents the patching capabilities for the administrator configuration. - /// - public partial class NodePoolAdministratorConfigurationPatch : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INodePoolAdministratorConfigurationPatch, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INodePoolAdministratorConfigurationPatchInternal - { - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey[] _sshPublicKey; - - /// - /// SshPublicKey represents the public key used to authenticate with a resource through SSH. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey[] SshPublicKey { get => this._sshPublicKey; set => this._sshPublicKey = value; } - - /// Creates an new instance. - public NodePoolAdministratorConfigurationPatch() - { - - } - } - /// NodePoolAdministratorConfigurationPatch represents the patching capabilities for the administrator configuration. - public partial interface INodePoolAdministratorConfigurationPatch : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable - { - /// - /// SshPublicKey represents the public key used to authenticate with a resource through SSH. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"SshPublicKey represents the public key used to authenticate with a resource through SSH.", - SerializedName = @"sshPublicKeys", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey[] SshPublicKey { get; set; } - - } - /// NodePoolAdministratorConfigurationPatch represents the patching capabilities for the administrator configuration. - internal partial interface INodePoolAdministratorConfigurationPatchInternal - - { - /// - /// SshPublicKey represents the public key used to authenticate with a resource through SSH. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey[] SshPublicKey { get; set; } - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/OSDisk.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/OSDisk.PowerShell.cs deleted file mode 100644 index 6696a59f36a8..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/OSDisk.PowerShell.cs +++ /dev/null @@ -1,180 +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.NetworkCloud.Models.Api20250201 -{ - using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; - - /// OsDisk represents configuration of the boot disk. - [System.ComponentModel.TypeConverter(typeof(OSDiskTypeConverter))] - public partial class OSDisk - { - - /// - /// 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.NetworkCloud.Models.Api20250201.IOSDisk DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new OSDisk(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.NetworkCloud.Models.Api20250201.IOSDisk DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new OSDisk(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.NetworkCloud.Models.Api20250201.IOSDisk FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal OSDisk(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("CreateOption")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOSDiskInternal)this).CreateOption = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.OSDiskCreateOption?) content.GetValueForProperty("CreateOption",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOSDiskInternal)this).CreateOption, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.OSDiskCreateOption.CreateFrom); - } - if (content.Contains("DeleteOption")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOSDiskInternal)this).DeleteOption = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.OSDiskDeleteOption?) content.GetValueForProperty("DeleteOption",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOSDiskInternal)this).DeleteOption, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.OSDiskDeleteOption.CreateFrom); - } - if (content.Contains("DiskSizeGb")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOSDiskInternal)this).DiskSizeGb = (long) content.GetValueForProperty("DiskSizeGb",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOSDiskInternal)this).DiskSizeGb, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal OSDisk(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("CreateOption")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOSDiskInternal)this).CreateOption = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.OSDiskCreateOption?) content.GetValueForProperty("CreateOption",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOSDiskInternal)this).CreateOption, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.OSDiskCreateOption.CreateFrom); - } - if (content.Contains("DeleteOption")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOSDiskInternal)this).DeleteOption = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.OSDiskDeleteOption?) content.GetValueForProperty("DeleteOption",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOSDiskInternal)this).DeleteOption, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.OSDiskDeleteOption.CreateFrom); - } - if (content.Contains("DiskSizeGb")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOSDiskInternal)this).DiskSizeGb = (long) content.GetValueForProperty("DiskSizeGb",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOSDiskInternal)this).DiskSizeGb, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - 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.NetworkCloud.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(); - } - } - /// OsDisk represents configuration of the boot disk. - [System.ComponentModel.TypeConverter(typeof(OSDiskTypeConverter))] - public partial interface IOSDisk - - { - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/OSDisk.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/OSDisk.cs deleted file mode 100644 index cc38c91d4d57..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/OSDisk.cs +++ /dev/null @@ -1,91 +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.NetworkCloud.Models.Api20250201 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; - - /// OsDisk represents configuration of the boot disk. - public partial class OSDisk : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOSDisk, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOSDiskInternal - { - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.OSDiskCreateOption? _createOption; - - /// The strategy for creating the OS disk. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.OSDiskCreateOption? CreateOption { get => this._createOption; set => this._createOption = value; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.OSDiskDeleteOption? _deleteOption; - - /// The strategy for deleting the OS disk. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.OSDiskDeleteOption? DeleteOption { get => this._deleteOption; set => this._deleteOption = value; } - - /// Backing field for property. - private long _diskSizeGb; - - /// - /// The size of the disk. Required if the createOption is Ephemeral. Allocations are measured in gibibytes. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public long DiskSizeGb { get => this._diskSizeGb; set => this._diskSizeGb = value; } - - /// Creates an new instance. - public OSDisk() - { - - } - } - /// OsDisk represents configuration of the boot disk. - public partial interface IOSDisk : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable - { - /// The strategy for creating the OS disk. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The strategy for creating the OS disk.", - SerializedName = @"createOption", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.OSDiskCreateOption) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.OSDiskCreateOption? CreateOption { get; set; } - /// The strategy for deleting the OS disk. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The strategy for deleting the OS disk.", - SerializedName = @"deleteOption", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.OSDiskDeleteOption) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.OSDiskDeleteOption? DeleteOption { get; set; } - /// - /// The size of the disk. Required if the createOption is Ephemeral. Allocations are measured in gibibytes. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The size of the disk. Required if the createOption is Ephemeral. Allocations are measured in gibibytes.", - SerializedName = @"diskSizeGB", - PossibleTypes = new [] { typeof(long) })] - long DiskSizeGb { get; set; } - - } - /// OsDisk represents configuration of the boot disk. - internal partial interface IOSDiskInternal - - { - /// The strategy for creating the OS disk. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.OSDiskCreateOption? CreateOption { get; set; } - /// The strategy for deleting the OS disk. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.OSDiskDeleteOption? DeleteOption { get; set; } - /// - /// The size of the disk. Required if the createOption is Ephemeral. Allocations are measured in gibibytes. - /// - long DiskSizeGb { get; set; } - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/OperationStatusResult.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/OperationStatusResult.PowerShell.cs deleted file mode 100644 index 7b5540b07f87..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/OperationStatusResult.PowerShell.cs +++ /dev/null @@ -1,308 +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.NetworkCloud.Models.Api20250201 -{ - using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; - - /// The current status of an async operation. - [System.ComponentModel.TypeConverter(typeof(OperationStatusResultTypeConverter))] - public partial class OperationStatusResult - { - - /// - /// 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.NetworkCloud.Models.Api20250201.IOperationStatusResult DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new OperationStatusResult(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.NetworkCloud.Models.Api20250201.IOperationStatusResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new OperationStatusResult(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.NetworkCloud.Models.Api20250201.IOperationStatusResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal OperationStatusResult(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("Error")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOperationStatusResultInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorDetail) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOperationStatusResultInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ErrorDetailTypeConverter.ConvertFrom); - } - if (content.Contains("Property")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOperationStatusResultInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOperationStatusResultProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOperationStatusResultInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.OperationStatusResultPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("EndTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOperationStatusResultInternal)this).EndTime = (global::System.DateTime?) content.GetValueForProperty("EndTime",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOperationStatusResultInternal)this).EndTime, (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.NetworkCloud.Models.Api20250201.IOperationStatusResultInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOperationStatusResultInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOperationStatusResultInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOperationStatusResultInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Operation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOperationStatusResultInternal)this).Operation = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOperationStatusResult[]) content.GetValueForProperty("Operation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOperationStatusResultInternal)this).Operation, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.OperationStatusResultTypeConverter.ConvertFrom)); - } - if (content.Contains("PercentComplete")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOperationStatusResultInternal)this).PercentComplete = (float?) content.GetValueForProperty("PercentComplete",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOperationStatusResultInternal)this).PercentComplete, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); - } - if (content.Contains("ResourceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOperationStatusResultInternal)this).ResourceId = (string) content.GetValueForProperty("ResourceId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOperationStatusResultInternal)this).ResourceId, global::System.Convert.ToString); - } - if (content.Contains("StartTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOperationStatusResultInternal)this).StartTime = (global::System.DateTime?) content.GetValueForProperty("StartTime",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOperationStatusResultInternal)this).StartTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("Status")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOperationStatusResultInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOperationStatusResultInternal)this).Status, global::System.Convert.ToString); - } - if (content.Contains("Code")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOperationStatusResultInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOperationStatusResultInternal)this).Code, global::System.Convert.ToString); - } - if (content.Contains("Message")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOperationStatusResultInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOperationStatusResultInternal)this).Message, global::System.Convert.ToString); - } - if (content.Contains("Target")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOperationStatusResultInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOperationStatusResultInternal)this).Target, global::System.Convert.ToString); - } - if (content.Contains("Detail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOperationStatusResultInternal)this).Detail = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorDetail[]) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOperationStatusResultInternal)this).Detail, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ErrorDetailTypeConverter.ConvertFrom)); - } - if (content.Contains("AdditionalInfo")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOperationStatusResultInternal)this).AdditionalInfo = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorAdditionalInfo[]) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOperationStatusResultInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ErrorAdditionalInfoTypeConverter.ConvertFrom)); - } - if (content.Contains("ExitCode")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOperationStatusResultInternal)this).ExitCode = (string) content.GetValueForProperty("ExitCode",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOperationStatusResultInternal)this).ExitCode, global::System.Convert.ToString); - } - if (content.Contains("OutputHead")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOperationStatusResultInternal)this).OutputHead = (string) content.GetValueForProperty("OutputHead",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOperationStatusResultInternal)this).OutputHead, global::System.Convert.ToString); - } - if (content.Contains("ResultRef")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOperationStatusResultInternal)this).ResultRef = (string) content.GetValueForProperty("ResultRef",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOperationStatusResultInternal)this).ResultRef, global::System.Convert.ToString); - } - if (content.Contains("ResultUrl")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOperationStatusResultInternal)this).ResultUrl = (string) content.GetValueForProperty("ResultUrl",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOperationStatusResultInternal)this).ResultUrl, 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 OperationStatusResult(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("Error")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOperationStatusResultInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorDetail) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOperationStatusResultInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ErrorDetailTypeConverter.ConvertFrom); - } - if (content.Contains("Property")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOperationStatusResultInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOperationStatusResultProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOperationStatusResultInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.OperationStatusResultPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("EndTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOperationStatusResultInternal)this).EndTime = (global::System.DateTime?) content.GetValueForProperty("EndTime",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOperationStatusResultInternal)this).EndTime, (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.NetworkCloud.Models.Api20250201.IOperationStatusResultInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOperationStatusResultInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOperationStatusResultInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOperationStatusResultInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Operation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOperationStatusResultInternal)this).Operation = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOperationStatusResult[]) content.GetValueForProperty("Operation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOperationStatusResultInternal)this).Operation, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.OperationStatusResultTypeConverter.ConvertFrom)); - } - if (content.Contains("PercentComplete")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOperationStatusResultInternal)this).PercentComplete = (float?) content.GetValueForProperty("PercentComplete",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOperationStatusResultInternal)this).PercentComplete, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); - } - if (content.Contains("ResourceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOperationStatusResultInternal)this).ResourceId = (string) content.GetValueForProperty("ResourceId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOperationStatusResultInternal)this).ResourceId, global::System.Convert.ToString); - } - if (content.Contains("StartTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOperationStatusResultInternal)this).StartTime = (global::System.DateTime?) content.GetValueForProperty("StartTime",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOperationStatusResultInternal)this).StartTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("Status")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOperationStatusResultInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOperationStatusResultInternal)this).Status, global::System.Convert.ToString); - } - if (content.Contains("Code")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOperationStatusResultInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOperationStatusResultInternal)this).Code, global::System.Convert.ToString); - } - if (content.Contains("Message")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOperationStatusResultInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOperationStatusResultInternal)this).Message, global::System.Convert.ToString); - } - if (content.Contains("Target")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOperationStatusResultInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOperationStatusResultInternal)this).Target, global::System.Convert.ToString); - } - if (content.Contains("Detail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOperationStatusResultInternal)this).Detail = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorDetail[]) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOperationStatusResultInternal)this).Detail, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ErrorDetailTypeConverter.ConvertFrom)); - } - if (content.Contains("AdditionalInfo")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOperationStatusResultInternal)this).AdditionalInfo = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorAdditionalInfo[]) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOperationStatusResultInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ErrorAdditionalInfoTypeConverter.ConvertFrom)); - } - if (content.Contains("ExitCode")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOperationStatusResultInternal)this).ExitCode = (string) content.GetValueForProperty("ExitCode",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOperationStatusResultInternal)this).ExitCode, global::System.Convert.ToString); - } - if (content.Contains("OutputHead")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOperationStatusResultInternal)this).OutputHead = (string) content.GetValueForProperty("OutputHead",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOperationStatusResultInternal)this).OutputHead, global::System.Convert.ToString); - } - if (content.Contains("ResultRef")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOperationStatusResultInternal)this).ResultRef = (string) content.GetValueForProperty("ResultRef",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOperationStatusResultInternal)this).ResultRef, global::System.Convert.ToString); - } - if (content.Contains("ResultUrl")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOperationStatusResultInternal)this).ResultUrl = (string) content.GetValueForProperty("ResultUrl",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOperationStatusResultInternal)this).ResultUrl, 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.NetworkCloud.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 current status of an async operation. - [System.ComponentModel.TypeConverter(typeof(OperationStatusResultTypeConverter))] - public partial interface IOperationStatusResult - - { - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/OperationStatusResult.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/OperationStatusResult.cs deleted file mode 100644 index 5da555c726a9..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/OperationStatusResult.cs +++ /dev/null @@ -1,398 +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.NetworkCloud.Models.Api20250201 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; - - /// The current status of an async operation. - public partial class OperationStatusResult : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOperationStatusResult, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOperationStatusResultInternal - { - - /// The error additional info. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorAdditionalInfo[] AdditionalInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorDetailInternal)Error).AdditionalInfo; } - - /// The error code. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorDetailInternal)Error).Code; } - - /// The error details. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorDetail[] Detail { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorDetailInternal)Error).Detail; } - - /// Backing field for property. - private global::System.DateTime? _endTime; - - /// The end time of the operation. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public global::System.DateTime? EndTime { get => this._endTime; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorDetail _error; - - /// If present, details of the operation error. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorDetail Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ErrorDetail()); } - - /// - /// For actions that run commands or scripts, the exit code of the script execution. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string ExitCode { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOperationStatusResultPropertiesInternal)Property).ExitCode; } - - /// Backing field for property. - private string _id; - - /// Fully qualified ID for the async operation. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string Id { get => this._id; } - - /// The error message. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorDetailInternal)Error).Message; } - - /// Internal Acessors for AdditionalInfo - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorAdditionalInfo[] Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOperationStatusResultInternal.AdditionalInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorDetailInternal)Error).AdditionalInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorDetailInternal)Error).AdditionalInfo = value; } - - /// Internal Acessors for Code - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOperationStatusResultInternal.Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorDetailInternal)Error).Code; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorDetailInternal)Error).Code = value; } - - /// Internal Acessors for Detail - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorDetail[] Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOperationStatusResultInternal.Detail { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorDetailInternal)Error).Detail; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorDetailInternal)Error).Detail = value; } - - /// Internal Acessors for EndTime - global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOperationStatusResultInternal.EndTime { get => this._endTime; set { {_endTime = value;} } } - - /// Internal Acessors for Error - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorDetail Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOperationStatusResultInternal.Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ErrorDetail()); set { {_error = value;} } } - - /// Internal Acessors for ExitCode - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOperationStatusResultInternal.ExitCode { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOperationStatusResultPropertiesInternal)Property).ExitCode; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOperationStatusResultPropertiesInternal)Property).ExitCode = value; } - - /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOperationStatusResultInternal.Id { get => this._id; set { {_id = value;} } } - - /// Internal Acessors for Message - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOperationStatusResultInternal.Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorDetailInternal)Error).Message; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorDetailInternal)Error).Message = value; } - - /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOperationStatusResultInternal.Name { get => this._name; set { {_name = value;} } } - - /// Internal Acessors for Operation - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOperationStatusResult[] Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOperationStatusResultInternal.Operation { get => this._operation; set { {_operation = value;} } } - - /// Internal Acessors for OutputHead - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOperationStatusResultInternal.OutputHead { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOperationStatusResultPropertiesInternal)Property).OutputHead; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOperationStatusResultPropertiesInternal)Property).OutputHead = value; } - - /// Internal Acessors for PercentComplete - float? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOperationStatusResultInternal.PercentComplete { get => this._percentComplete; set { {_percentComplete = value;} } } - - /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOperationStatusResultProperties Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOperationStatusResultInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.OperationStatusResultProperties()); set { {_property = value;} } } - - /// Internal Acessors for ResourceId - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOperationStatusResultInternal.ResourceId { get => this._resourceId; set { {_resourceId = value;} } } - - /// Internal Acessors for ResultRef - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOperationStatusResultInternal.ResultRef { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOperationStatusResultPropertiesInternal)Property).ResultRef; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOperationStatusResultPropertiesInternal)Property).ResultRef = value; } - - /// Internal Acessors for ResultUrl - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOperationStatusResultInternal.ResultUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOperationStatusResultPropertiesInternal)Property).ResultUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOperationStatusResultPropertiesInternal)Property).ResultUrl = value; } - - /// Internal Acessors for StartTime - global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOperationStatusResultInternal.StartTime { get => this._startTime; set { {_startTime = value;} } } - - /// Internal Acessors for Target - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOperationStatusResultInternal.Target { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorDetailInternal)Error).Target; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorDetailInternal)Error).Target = value; } - - /// Backing field for property. - private string _name; - - /// Name of the async operation. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string Name { get => this._name; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOperationStatusResult[] _operation; - - /// The operations list. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOperationStatusResult[] Operation { get => this._operation; } - - /// - /// For actions that run commands or scripts, the leading bytes of the output of the script execution. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string OutputHead { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOperationStatusResultPropertiesInternal)Property).OutputHead; } - - /// Backing field for property. - private float? _percentComplete; - - /// Percent of the operation that is complete. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public float? PercentComplete { get => this._percentComplete; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOperationStatusResultProperties _property; - - /// The additional properties of the operation status result. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOperationStatusResultProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.OperationStatusResultProperties()); set => this._property = value; } - - /// Backing field for property. - private string _resourceId; - - /// - /// Fully qualified ID of the resource against which the original async operation was started. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string ResourceId { get => this._resourceId; } - - /// - /// For actions that run commands or scripts, a reference to the location of the result. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string ResultRef { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOperationStatusResultPropertiesInternal)Property).ResultRef; } - - /// - /// For actions that run commands or scripts, the URL where the full output of the script output can be retrieved. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string ResultUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOperationStatusResultPropertiesInternal)Property).ResultUrl; } - - /// Backing field for property. - private global::System.DateTime? _startTime; - - /// The start time of the operation. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public global::System.DateTime? StartTime { get => this._startTime; } - - /// Backing field for property. - private string _status; - - /// Operation status. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string Status { get => this._status; set => this._status = value; } - - /// The error target. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string Target { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorDetailInternal)Error).Target; } - - /// Creates an new instance. - public OperationStatusResult() - { - - } - } - /// The current status of an async operation. - public partial interface IOperationStatusResult : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable - { - /// The error additional info. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The error additional info.", - SerializedName = @"additionalInfo", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorAdditionalInfo) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorAdditionalInfo[] AdditionalInfo { get; } - /// The error code. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The error code.", - SerializedName = @"code", - PossibleTypes = new [] { typeof(string) })] - string Code { get; } - /// The error details. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The error details.", - SerializedName = @"details", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorDetail) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorDetail[] Detail { get; } - /// The end time of the operation. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The end time of the operation.", - SerializedName = @"endTime", - PossibleTypes = new [] { typeof(global::System.DateTime) })] - global::System.DateTime? EndTime { get; } - /// - /// For actions that run commands or scripts, the exit code of the script execution. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"For actions that run commands or scripts, the exit code of the script execution.", - SerializedName = @"exitCode", - PossibleTypes = new [] { typeof(string) })] - string ExitCode { get; } - /// Fully qualified ID for the async operation. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"Fully qualified ID for the async operation.", - SerializedName = @"id", - PossibleTypes = new [] { typeof(string) })] - string Id { get; } - /// The error message. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The error message.", - SerializedName = @"message", - PossibleTypes = new [] { typeof(string) })] - string Message { get; } - /// Name of the async operation. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"Name of the async operation.", - SerializedName = @"name", - PossibleTypes = new [] { typeof(string) })] - string Name { get; } - /// The operations list. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The operations list.", - SerializedName = @"operations", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOperationStatusResult) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOperationStatusResult[] Operation { get; } - /// - /// For actions that run commands or scripts, the leading bytes of the output of the script execution. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"For actions that run commands or scripts, the leading bytes of the output of the script execution.", - SerializedName = @"outputHead", - PossibleTypes = new [] { typeof(string) })] - string OutputHead { get; } - /// Percent of the operation that is complete. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"Percent of the operation that is complete.", - SerializedName = @"percentComplete", - PossibleTypes = new [] { typeof(float) })] - float? PercentComplete { get; } - /// - /// Fully qualified ID of the resource against which the original async operation was started. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"Fully qualified ID of the resource against which the original async operation was started.", - SerializedName = @"resourceId", - PossibleTypes = new [] { typeof(string) })] - string ResourceId { get; } - /// - /// For actions that run commands or scripts, a reference to the location of the result. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"For actions that run commands or scripts, a reference to the location of the result.", - SerializedName = @"resultRef", - PossibleTypes = new [] { typeof(string) })] - string ResultRef { get; } - /// - /// For actions that run commands or scripts, the URL where the full output of the script output can be retrieved. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"For actions that run commands or scripts, the URL where the full output of the script output can be retrieved.", - SerializedName = @"resultUrl", - PossibleTypes = new [] { typeof(string) })] - string ResultUrl { get; } - /// The start time of the operation. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The start time of the operation.", - SerializedName = @"startTime", - PossibleTypes = new [] { typeof(global::System.DateTime) })] - global::System.DateTime? StartTime { get; } - /// Operation status. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"Operation status.", - SerializedName = @"status", - PossibleTypes = new [] { typeof(string) })] - string Status { get; set; } - /// The error target. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The error target.", - SerializedName = @"target", - PossibleTypes = new [] { typeof(string) })] - string Target { get; } - - } - /// The current status of an async operation. - internal partial interface IOperationStatusResultInternal - - { - /// The error additional info. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorAdditionalInfo[] AdditionalInfo { get; set; } - /// The error code. - string Code { get; set; } - /// The error details. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorDetail[] Detail { get; set; } - /// The end time of the operation. - global::System.DateTime? EndTime { get; set; } - /// If present, details of the operation error. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorDetail Error { get; set; } - /// - /// For actions that run commands or scripts, the exit code of the script execution. - /// - string ExitCode { get; set; } - /// Fully qualified ID for the async operation. - string Id { get; set; } - /// The error message. - string Message { get; set; } - /// Name of the async operation. - string Name { get; set; } - /// The operations list. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOperationStatusResult[] Operation { get; set; } - /// - /// For actions that run commands or scripts, the leading bytes of the output of the script execution. - /// - string OutputHead { get; set; } - /// Percent of the operation that is complete. - float? PercentComplete { get; set; } - /// The additional properties of the operation status result. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOperationStatusResultProperties Property { get; set; } - /// - /// Fully qualified ID of the resource against which the original async operation was started. - /// - string ResourceId { get; set; } - /// - /// For actions that run commands or scripts, a reference to the location of the result. - /// - string ResultRef { get; set; } - /// - /// For actions that run commands or scripts, the URL where the full output of the script output can be retrieved. - /// - string ResultUrl { get; set; } - /// The start time of the operation. - global::System.DateTime? StartTime { get; set; } - /// Operation status. - string Status { get; set; } - /// The error target. - string Target { get; set; } - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/OperationStatusResultProperties.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/OperationStatusResultProperties.PowerShell.cs deleted file mode 100644 index aafa0c798eaa..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/OperationStatusResultProperties.PowerShell.cs +++ /dev/null @@ -1,192 +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.NetworkCloud.Models.Api20250201 -{ - using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; - - /// - /// OperationStatusResultProperties represents additional properties of the operation status result. - /// - [System.ComponentModel.TypeConverter(typeof(OperationStatusResultPropertiesTypeConverter))] - public partial class OperationStatusResultProperties - { - - /// - /// 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.NetworkCloud.Models.Api20250201.IOperationStatusResultProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new OperationStatusResultProperties(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.NetworkCloud.Models.Api20250201.IOperationStatusResultProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new OperationStatusResultProperties(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.NetworkCloud.Models.Api20250201.IOperationStatusResultProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal OperationStatusResultProperties(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("ExitCode")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOperationStatusResultPropertiesInternal)this).ExitCode = (string) content.GetValueForProperty("ExitCode",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOperationStatusResultPropertiesInternal)this).ExitCode, global::System.Convert.ToString); - } - if (content.Contains("OutputHead")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOperationStatusResultPropertiesInternal)this).OutputHead = (string) content.GetValueForProperty("OutputHead",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOperationStatusResultPropertiesInternal)this).OutputHead, global::System.Convert.ToString); - } - if (content.Contains("ResultRef")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOperationStatusResultPropertiesInternal)this).ResultRef = (string) content.GetValueForProperty("ResultRef",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOperationStatusResultPropertiesInternal)this).ResultRef, global::System.Convert.ToString); - } - if (content.Contains("ResultUrl")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOperationStatusResultPropertiesInternal)this).ResultUrl = (string) content.GetValueForProperty("ResultUrl",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOperationStatusResultPropertiesInternal)this).ResultUrl, 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 OperationStatusResultProperties(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("ExitCode")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOperationStatusResultPropertiesInternal)this).ExitCode = (string) content.GetValueForProperty("ExitCode",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOperationStatusResultPropertiesInternal)this).ExitCode, global::System.Convert.ToString); - } - if (content.Contains("OutputHead")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOperationStatusResultPropertiesInternal)this).OutputHead = (string) content.GetValueForProperty("OutputHead",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOperationStatusResultPropertiesInternal)this).OutputHead, global::System.Convert.ToString); - } - if (content.Contains("ResultRef")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOperationStatusResultPropertiesInternal)this).ResultRef = (string) content.GetValueForProperty("ResultRef",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOperationStatusResultPropertiesInternal)this).ResultRef, global::System.Convert.ToString); - } - if (content.Contains("ResultUrl")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOperationStatusResultPropertiesInternal)this).ResultUrl = (string) content.GetValueForProperty("ResultUrl",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOperationStatusResultPropertiesInternal)this).ResultUrl, 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.NetworkCloud.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(); - } - } - /// OperationStatusResultProperties represents additional properties of the operation status result. - [System.ComponentModel.TypeConverter(typeof(OperationStatusResultPropertiesTypeConverter))] - public partial interface IOperationStatusResultProperties - - { - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/Rack.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/Rack.PowerShell.cs deleted file mode 100644 index b8a11133a718..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/Rack.PowerShell.cs +++ /dev/null @@ -1,358 +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.NetworkCloud.Models.Api20250201 -{ - using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; - - /// - /// Rack represents the hardware of the rack and is dependent upon the cluster for lifecycle. - /// - [System.ComponentModel.TypeConverter(typeof(RackTypeConverter))] - public partial class Rack - { - - /// - /// 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.NetworkCloud.Models.Api20250201.IRack DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new Rack(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.NetworkCloud.Models.Api20250201.IRack DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new Rack(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.NetworkCloud.Models.Api20250201.IRack FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal Rack(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("ExtendedLocation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackInternal)this).ExtendedLocation = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocation) content.GetValueForProperty("ExtendedLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackInternal)this).ExtendedLocation, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ExtendedLocationTypeConverter.ConvertFrom); - } - if (content.Contains("Property")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.RackPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Etag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackInternal)this).Etag, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)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("SystemDataCreatedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataLastModifiedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("SystemData")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.SystemDataTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Type, global::System.Convert.ToString); - } - if (content.Contains("Tag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.TrackedResourceTagsTypeConverter.ConvertFrom); - } - if (content.Contains("Location")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); - } - if (content.Contains("ExtendedLocationName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackInternal)this).ExtendedLocationName = (string) content.GetValueForProperty("ExtendedLocationName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackInternal)this).ExtendedLocationName, global::System.Convert.ToString); - } - if (content.Contains("ExtendedLocationType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackInternal)this).ExtendedLocationType = (string) content.GetValueForProperty("ExtendedLocationType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackInternal)this).ExtendedLocationType, global::System.Convert.ToString); - } - if (content.Contains("AvailabilityZone")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackInternal)this).AvailabilityZone = (string) content.GetValueForProperty("AvailabilityZone",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackInternal)this).AvailabilityZone, global::System.Convert.ToString); - } - if (content.Contains("ClusterId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackInternal)this).ClusterId = (string) content.GetValueForProperty("ClusterId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackInternal)this).ClusterId, global::System.Convert.ToString); - } - if (content.Contains("DetailedStatus")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackInternal)this).DetailedStatus = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RackDetailedStatus?) content.GetValueForProperty("DetailedStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackInternal)this).DetailedStatus, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RackDetailedStatus.CreateFrom); - } - if (content.Contains("DetailedStatusMessage")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackInternal)this).DetailedStatusMessage = (string) content.GetValueForProperty("DetailedStatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackInternal)this).DetailedStatusMessage, global::System.Convert.ToString); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RackProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RackProvisioningState.CreateFrom); - } - if (content.Contains("RackLocation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackInternal)this).RackLocation = (string) content.GetValueForProperty("RackLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackInternal)this).RackLocation, global::System.Convert.ToString); - } - if (content.Contains("SerialNumber")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackInternal)this).SerialNumber = (string) content.GetValueForProperty("SerialNumber",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackInternal)this).SerialNumber, global::System.Convert.ToString); - } - if (content.Contains("SkuId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackInternal)this).SkuId = (string) content.GetValueForProperty("SkuId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackInternal)this).SkuId, 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 Rack(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("ExtendedLocation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackInternal)this).ExtendedLocation = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocation) content.GetValueForProperty("ExtendedLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackInternal)this).ExtendedLocation, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ExtendedLocationTypeConverter.ConvertFrom); - } - if (content.Contains("Property")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.RackPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Etag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackInternal)this).Etag, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)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("SystemDataCreatedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataLastModifiedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("SystemData")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.SystemDataTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Type, global::System.Convert.ToString); - } - if (content.Contains("Tag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.TrackedResourceTagsTypeConverter.ConvertFrom); - } - if (content.Contains("Location")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); - } - if (content.Contains("ExtendedLocationName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackInternal)this).ExtendedLocationName = (string) content.GetValueForProperty("ExtendedLocationName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackInternal)this).ExtendedLocationName, global::System.Convert.ToString); - } - if (content.Contains("ExtendedLocationType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackInternal)this).ExtendedLocationType = (string) content.GetValueForProperty("ExtendedLocationType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackInternal)this).ExtendedLocationType, global::System.Convert.ToString); - } - if (content.Contains("AvailabilityZone")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackInternal)this).AvailabilityZone = (string) content.GetValueForProperty("AvailabilityZone",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackInternal)this).AvailabilityZone, global::System.Convert.ToString); - } - if (content.Contains("ClusterId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackInternal)this).ClusterId = (string) content.GetValueForProperty("ClusterId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackInternal)this).ClusterId, global::System.Convert.ToString); - } - if (content.Contains("DetailedStatus")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackInternal)this).DetailedStatus = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RackDetailedStatus?) content.GetValueForProperty("DetailedStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackInternal)this).DetailedStatus, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RackDetailedStatus.CreateFrom); - } - if (content.Contains("DetailedStatusMessage")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackInternal)this).DetailedStatusMessage = (string) content.GetValueForProperty("DetailedStatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackInternal)this).DetailedStatusMessage, global::System.Convert.ToString); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RackProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RackProvisioningState.CreateFrom); - } - if (content.Contains("RackLocation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackInternal)this).RackLocation = (string) content.GetValueForProperty("RackLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackInternal)this).RackLocation, global::System.Convert.ToString); - } - if (content.Contains("SerialNumber")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackInternal)this).SerialNumber = (string) content.GetValueForProperty("SerialNumber",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackInternal)this).SerialNumber, global::System.Convert.ToString); - } - if (content.Contains("SkuId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackInternal)this).SkuId = (string) content.GetValueForProperty("SkuId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackInternal)this).SkuId, 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.NetworkCloud.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(); - } - } - /// Rack represents the hardware of the rack and is dependent upon the cluster for lifecycle. - [System.ComponentModel.TypeConverter(typeof(RackTypeConverter))] - public partial interface IRack - - { - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/Rack.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/Rack.cs deleted file mode 100644 index 2f688093b83c..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/Rack.cs +++ /dev/null @@ -1,351 +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.NetworkCloud.Models.Api20250201 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; - - /// - /// Rack represents the hardware of the rack and is dependent upon the cluster for lifecycle. - /// - public partial class Rack : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRack, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackInternal, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IValidates - { - /// - /// Backing field for Inherited model - /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResource __trackedResource = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.TrackedResource(); - - /// - /// The value that will be used for machines in this rack to represent the availability zones that can be referenced by Hybrid - /// AKS Clusters for node arrangement. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string AvailabilityZone { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackPropertiesInternal)Property).AvailabilityZone; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackPropertiesInternal)Property).AvailabilityZone = value ; } - - /// - /// The resource ID of the cluster the rack is created for. This value is set when the rack is created by the cluster. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string ClusterId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackPropertiesInternal)Property).ClusterId; } - - /// The more detailed status of the rack. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RackDetailedStatus? DetailedStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackPropertiesInternal)Property).DetailedStatus; } - - /// The descriptive message about the current detailed status. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string DetailedStatusMessage { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackPropertiesInternal)Property).DetailedStatusMessage; } - - /// Backing field for property. - private string _etag; - - /// Resource ETag. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string Etag { get => this._etag; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocation _extendedLocation; - - /// The extended location of the cluster associated with the resource. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocation ExtendedLocation { get => (this._extendedLocation = this._extendedLocation ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ExtendedLocation()); set => this._extendedLocation = value; } - - /// The resource ID of the extended location on which the resource will be created. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string ExtendedLocationName { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocationInternal)ExtendedLocation).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocationInternal)ExtendedLocation).Name = value ; } - - /// The extended location type, for example, CustomLocation. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string ExtendedLocationType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocationInternal)ExtendedLocation).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocationInternal)ExtendedLocation).Type = value ; } - - /// - /// Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).Id; } - - /// The geo-location where the resource lives - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)__trackedResource).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)__trackedResource).Location = value ; } - - /// Internal Acessors for ClusterId - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackInternal.ClusterId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackPropertiesInternal)Property).ClusterId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackPropertiesInternal)Property).ClusterId = value; } - - /// Internal Acessors for DetailedStatus - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RackDetailedStatus? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackInternal.DetailedStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackPropertiesInternal)Property).DetailedStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackPropertiesInternal)Property).DetailedStatus = value; } - - /// Internal Acessors for DetailedStatusMessage - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackInternal.DetailedStatusMessage { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackPropertiesInternal)Property).DetailedStatusMessage; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackPropertiesInternal)Property).DetailedStatusMessage = value; } - - /// Internal Acessors for Etag - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackInternal.Etag { get => this._etag; set { {_etag = value;} } } - - /// Internal Acessors for ExtendedLocation - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocation Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackInternal.ExtendedLocation { get => (this._extendedLocation = this._extendedLocation ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ExtendedLocation()); set { {_extendedLocation = value;} } } - - /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackProperties Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.RackProperties()); set { {_property = value;} } } - - /// Internal Acessors for ProvisioningState - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RackProvisioningState? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackPropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackPropertiesInternal)Property).ProvisioningState = value; } - - /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).Id = value; } - - /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).Name = value; } - - /// Internal Acessors for SystemData - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ISystemData Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal.SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemData; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemData = value; } - - /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).Type = value; } - - /// The name of the resource - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).Name; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackProperties _property; - - /// The list of the resource properties. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.RackProperties()); set => this._property = value; } - - /// The provisioning state of the rack resource. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RackProvisioningState? ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackPropertiesInternal)Property).ProvisioningState; } - - /// - /// The free-form description of the rack location. (e.g. “DTN Datacenter, Floor 3, Isle 9, Rack 2B”) - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string RackLocation { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackPropertiesInternal)Property).RackLocation; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackPropertiesInternal)Property).RackLocation = value ; } - - /// Gets the resource group name - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string ResourceGroupName { get => (new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Success ? new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Groups["resourceGroupName"].Value : null); } - - /// - /// The unique identifier for the rack within Network Cloud cluster. An alternate unique alphanumeric value other than a serial - /// number may be provided if desired. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string SerialNumber { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackPropertiesInternal)Property).RackSerialNumber; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackPropertiesInternal)Property).RackSerialNumber = value ; } - - /// The SKU for the rack. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string SkuId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackPropertiesInternal)Property).RackSkuId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackPropertiesInternal)Property).RackSkuId = value ; } - - /// - /// Azure Resource Manager metadata containing createdBy and modifiedBy information. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ISystemData SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemData; } - - /// The timestamp of resource creation (UTC). - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataCreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataCreatedAt = value ?? default(global::System.DateTime); } - - /// The identity that created the resource. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataCreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataCreatedBy = value ?? null; } - - /// The type of identity that created the resource. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType? SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataCreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataCreatedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType)""); } - - /// The timestamp of resource last modification (UTC) - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataLastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataLastModifiedAt = value ?? default(global::System.DateTime); } - - /// The identity that last modified the resource. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataLastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataLastModifiedBy = value ?? null; } - - /// The type of identity that last modified the resource. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType? SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataLastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataLastModifiedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType)""); } - - /// Resource tags. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)__trackedResource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.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.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).Type; } - - /// Creates an new instance. - public Rack() - { - - } - - /// Validates that this object meets the validation criteria. - /// an instance that will receive validation - /// events. - /// - /// A that will be complete when validation is completed. - /// - public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) - { - await eventListener.AssertNotNull(nameof(__trackedResource), __trackedResource); - await eventListener.AssertObjectIsValid(nameof(__trackedResource), __trackedResource); - } - } - /// Rack represents the hardware of the rack and is dependent upon the cluster for lifecycle. - public partial interface IRack : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResource - { - /// - /// The value that will be used for machines in this rack to represent the availability zones that can be referenced by Hybrid - /// AKS Clusters for node arrangement. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The value that will be used for machines in this rack to represent the availability zones that can be referenced by Hybrid AKS Clusters for node arrangement.", - SerializedName = @"availabilityZone", - PossibleTypes = new [] { typeof(string) })] - string AvailabilityZone { get; set; } - /// - /// The resource ID of the cluster the rack is created for. This value is set when the rack is created by the cluster. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The resource ID of the cluster the rack is created for. This value is set when the rack is created by the cluster.", - SerializedName = @"clusterId", - PossibleTypes = new [] { typeof(string) })] - string ClusterId { get; } - /// The more detailed status of the rack. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The more detailed status of the rack.", - SerializedName = @"detailedStatus", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RackDetailedStatus) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RackDetailedStatus? DetailedStatus { get; } - /// The descriptive message about the current detailed status. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The descriptive message about the current detailed status.", - SerializedName = @"detailedStatusMessage", - PossibleTypes = new [] { typeof(string) })] - string DetailedStatusMessage { get; } - /// Resource ETag. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"Resource ETag.", - SerializedName = @"etag", - PossibleTypes = new [] { typeof(string) })] - string Etag { get; } - /// The resource ID of the extended location on which the resource will be created. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The resource ID of the extended location on which the resource will be created.", - SerializedName = @"name", - PossibleTypes = new [] { typeof(string) })] - string ExtendedLocationName { get; set; } - /// The extended location type, for example, CustomLocation. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The extended location type, for example, CustomLocation.", - SerializedName = @"type", - PossibleTypes = new [] { typeof(string) })] - string ExtendedLocationType { get; set; } - /// The provisioning state of the rack resource. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The provisioning state of the rack resource.", - SerializedName = @"provisioningState", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RackProvisioningState) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RackProvisioningState? ProvisioningState { get; } - /// - /// The free-form description of the rack location. (e.g. “DTN Datacenter, Floor 3, Isle 9, Rack 2B”) - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The free-form description of the rack location. (e.g. “DTN Datacenter, Floor 3, Isle 9, Rack 2B”)", - SerializedName = @"rackLocation", - PossibleTypes = new [] { typeof(string) })] - string RackLocation { get; set; } - /// - /// The unique identifier for the rack within Network Cloud cluster. An alternate unique alphanumeric value other than a serial - /// number may be provided if desired. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The unique identifier for the rack within Network Cloud cluster. An alternate unique alphanumeric value other than a serial number may be provided if desired.", - SerializedName = @"rackSerialNumber", - PossibleTypes = new [] { typeof(string) })] - string SerialNumber { get; set; } - /// The SKU for the rack. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The SKU for the rack.", - SerializedName = @"rackSkuId", - PossibleTypes = new [] { typeof(string) })] - string SkuId { get; set; } - - } - /// Rack represents the hardware of the rack and is dependent upon the cluster for lifecycle. - internal partial interface IRackInternal : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal - { - /// - /// The value that will be used for machines in this rack to represent the availability zones that can be referenced by Hybrid - /// AKS Clusters for node arrangement. - /// - string AvailabilityZone { get; set; } - /// - /// The resource ID of the cluster the rack is created for. This value is set when the rack is created by the cluster. - /// - string ClusterId { get; set; } - /// The more detailed status of the rack. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RackDetailedStatus? DetailedStatus { get; set; } - /// The descriptive message about the current detailed status. - string DetailedStatusMessage { get; set; } - /// Resource ETag. - string Etag { get; set; } - /// The extended location of the cluster associated with the resource. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocation ExtendedLocation { get; set; } - /// The resource ID of the extended location on which the resource will be created. - string ExtendedLocationName { get; set; } - /// The extended location type, for example, CustomLocation. - string ExtendedLocationType { get; set; } - /// The list of the resource properties. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackProperties Property { get; set; } - /// The provisioning state of the rack resource. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RackProvisioningState? ProvisioningState { get; set; } - /// - /// The free-form description of the rack location. (e.g. “DTN Datacenter, Floor 3, Isle 9, Rack 2B”) - /// - string RackLocation { get; set; } - /// - /// The unique identifier for the rack within Network Cloud cluster. An alternate unique alphanumeric value other than a serial - /// number may be provided if desired. - /// - string SerialNumber { get; set; } - /// The SKU for the rack. - string SkuId { get; set; } - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/RackDefinition.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/RackDefinition.PowerShell.cs deleted file mode 100644 index 6c2260ef4e46..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/RackDefinition.PowerShell.cs +++ /dev/null @@ -1,212 +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.NetworkCloud.Models.Api20250201 -{ - using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; - - /// RackDefinition represents details regarding the rack. - [System.ComponentModel.TypeConverter(typeof(RackDefinitionTypeConverter))] - public partial class RackDefinition - { - - /// - /// 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.NetworkCloud.Models.Api20250201.IRackDefinition DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new RackDefinition(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.NetworkCloud.Models.Api20250201.IRackDefinition DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new RackDefinition(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.NetworkCloud.Models.Api20250201.IRackDefinition FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal RackDefinition(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("AvailabilityZone")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackDefinitionInternal)this).AvailabilityZone = (string) content.GetValueForProperty("AvailabilityZone",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackDefinitionInternal)this).AvailabilityZone, global::System.Convert.ToString); - } - if (content.Contains("BareMetalMachineConfigurationData")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackDefinitionInternal)this).BareMetalMachineConfigurationData = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineConfigurationData[]) content.GetValueForProperty("BareMetalMachineConfigurationData",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackDefinitionInternal)this).BareMetalMachineConfigurationData, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BareMetalMachineConfigurationDataTypeConverter.ConvertFrom)); - } - if (content.Contains("NetworkRackId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackDefinitionInternal)this).NetworkRackId = (string) content.GetValueForProperty("NetworkRackId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackDefinitionInternal)this).NetworkRackId, global::System.Convert.ToString); - } - if (content.Contains("RackLocation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackDefinitionInternal)this).RackLocation = (string) content.GetValueForProperty("RackLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackDefinitionInternal)this).RackLocation, global::System.Convert.ToString); - } - if (content.Contains("RackSerialNumber")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackDefinitionInternal)this).RackSerialNumber = (string) content.GetValueForProperty("RackSerialNumber",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackDefinitionInternal)this).RackSerialNumber, global::System.Convert.ToString); - } - if (content.Contains("RackSkuId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackDefinitionInternal)this).RackSkuId = (string) content.GetValueForProperty("RackSkuId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackDefinitionInternal)this).RackSkuId, global::System.Convert.ToString); - } - if (content.Contains("StorageApplianceConfigurationData")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackDefinitionInternal)this).StorageApplianceConfigurationData = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceConfigurationData[]) content.GetValueForProperty("StorageApplianceConfigurationData",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackDefinitionInternal)this).StorageApplianceConfigurationData, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.StorageApplianceConfigurationDataTypeConverter.ConvertFrom)); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal RackDefinition(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("AvailabilityZone")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackDefinitionInternal)this).AvailabilityZone = (string) content.GetValueForProperty("AvailabilityZone",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackDefinitionInternal)this).AvailabilityZone, global::System.Convert.ToString); - } - if (content.Contains("BareMetalMachineConfigurationData")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackDefinitionInternal)this).BareMetalMachineConfigurationData = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineConfigurationData[]) content.GetValueForProperty("BareMetalMachineConfigurationData",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackDefinitionInternal)this).BareMetalMachineConfigurationData, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BareMetalMachineConfigurationDataTypeConverter.ConvertFrom)); - } - if (content.Contains("NetworkRackId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackDefinitionInternal)this).NetworkRackId = (string) content.GetValueForProperty("NetworkRackId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackDefinitionInternal)this).NetworkRackId, global::System.Convert.ToString); - } - if (content.Contains("RackLocation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackDefinitionInternal)this).RackLocation = (string) content.GetValueForProperty("RackLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackDefinitionInternal)this).RackLocation, global::System.Convert.ToString); - } - if (content.Contains("RackSerialNumber")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackDefinitionInternal)this).RackSerialNumber = (string) content.GetValueForProperty("RackSerialNumber",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackDefinitionInternal)this).RackSerialNumber, global::System.Convert.ToString); - } - if (content.Contains("RackSkuId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackDefinitionInternal)this).RackSkuId = (string) content.GetValueForProperty("RackSkuId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackDefinitionInternal)this).RackSkuId, global::System.Convert.ToString); - } - if (content.Contains("StorageApplianceConfigurationData")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackDefinitionInternal)this).StorageApplianceConfigurationData = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceConfigurationData[]) content.GetValueForProperty("StorageApplianceConfigurationData",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackDefinitionInternal)this).StorageApplianceConfigurationData, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.StorageApplianceConfigurationDataTypeConverter.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.NetworkCloud.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(); - } - } - /// RackDefinition represents details regarding the rack. - [System.ComponentModel.TypeConverter(typeof(RackDefinitionTypeConverter))] - public partial interface IRackDefinition - - { - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/RackList.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/RackList.cs deleted file mode 100644 index 9e37538e68f5..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/RackList.cs +++ /dev/null @@ -1,68 +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.NetworkCloud.Models.Api20250201 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; - - /// RackList represents a list of racks. - public partial class RackList : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackList, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackListInternal - { - - /// Backing field for property. - private string _nextLink; - - /// The link used to get the next page of operations. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string NextLink { get => this._nextLink; set => this._nextLink = value; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRack[] _value; - - /// The list of racks. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRack[] Value { get => this._value; set => this._value = value; } - - /// Creates an new instance. - public RackList() - { - - } - } - /// RackList represents a list of racks. - public partial interface IRackList : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable - { - /// The link used to get the next page of operations. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The link used to get the next page of operations.", - SerializedName = @"nextLink", - PossibleTypes = new [] { typeof(string) })] - string NextLink { get; set; } - /// The list of racks. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The list of racks.", - SerializedName = @"value", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRack) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRack[] Value { get; set; } - - } - /// RackList represents a list of racks. - internal partial interface IRackListInternal - - { - /// The link used to get the next page of operations. - string NextLink { get; set; } - /// The list of racks. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRack[] Value { get; set; } - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/RackPatchParameters.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/RackPatchParameters.PowerShell.cs deleted file mode 100644 index b856c5d0b8b1..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/RackPatchParameters.PowerShell.cs +++ /dev/null @@ -1,190 +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.NetworkCloud.Models.Api20250201 -{ - using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; - - /// - /// RackPatchParameters represents the body of the request to patch the rack properties. - /// - [System.ComponentModel.TypeConverter(typeof(RackPatchParametersTypeConverter))] - public partial class RackPatchParameters - { - - /// - /// 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.NetworkCloud.Models.Api20250201.IRackPatchParameters DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new RackPatchParameters(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.NetworkCloud.Models.Api20250201.IRackPatchParameters DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new RackPatchParameters(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.NetworkCloud.Models.Api20250201.IRackPatchParameters FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal RackPatchParameters(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.NetworkCloud.Models.Api20250201.IRackPatchParametersInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRacksPatchProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackPatchParametersInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.RacksPatchPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Tag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackPatchParametersInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackPatchParametersTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackPatchParametersInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.RackPatchParametersTagsTypeConverter.ConvertFrom); - } - if (content.Contains("RackLocation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackPatchParametersInternal)this).RackLocation = (string) content.GetValueForProperty("RackLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackPatchParametersInternal)this).RackLocation, global::System.Convert.ToString); - } - if (content.Contains("RackSerialNumber")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackPatchParametersInternal)this).RackSerialNumber = (string) content.GetValueForProperty("RackSerialNumber",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackPatchParametersInternal)this).RackSerialNumber, 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 RackPatchParameters(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.NetworkCloud.Models.Api20250201.IRackPatchParametersInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRacksPatchProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackPatchParametersInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.RacksPatchPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Tag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackPatchParametersInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackPatchParametersTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackPatchParametersInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.RackPatchParametersTagsTypeConverter.ConvertFrom); - } - if (content.Contains("RackLocation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackPatchParametersInternal)this).RackLocation = (string) content.GetValueForProperty("RackLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackPatchParametersInternal)this).RackLocation, global::System.Convert.ToString); - } - if (content.Contains("RackSerialNumber")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackPatchParametersInternal)this).RackSerialNumber = (string) content.GetValueForProperty("RackSerialNumber",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackPatchParametersInternal)this).RackSerialNumber, 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.NetworkCloud.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(); - } - } - /// RackPatchParameters represents the body of the request to patch the rack properties. - [System.ComponentModel.TypeConverter(typeof(RackPatchParametersTypeConverter))] - public partial interface IRackPatchParameters - - { - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/RackPatchParameters.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/RackPatchParameters.cs deleted file mode 100644 index e710e53946f7..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/RackPatchParameters.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.NetworkCloud.Models.Api20250201 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; - - /// - /// RackPatchParameters represents the body of the request to patch the rack properties. - /// - public partial class RackPatchParameters : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackPatchParameters, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackPatchParametersInternal - { - - /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRacksPatchProperties Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackPatchParametersInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.RacksPatchProperties()); set { {_property = value;} } } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRacksPatchProperties _property; - - /// The list of the resource properties. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRacksPatchProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.RacksPatchProperties()); set => this._property = value; } - - /// - /// The free-form description of the rack location. (e.g. “DTN Datacenter, Floor 3, Isle 9, Rack 2B”) - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string RackLocation { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRacksPatchPropertiesInternal)Property).RackLocation; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRacksPatchPropertiesInternal)Property).RackLocation = value ?? null; } - - /// The globally unique identifier for the rack. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string RackSerialNumber { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRacksPatchPropertiesInternal)Property).RackSerialNumber; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRacksPatchPropertiesInternal)Property).RackSerialNumber = value ?? null; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackPatchParametersTags _tag; - - /// The Azure resource tags that will replace the existing ones. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackPatchParametersTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.RackPatchParametersTags()); set => this._tag = value; } - - /// Creates an new instance. - public RackPatchParameters() - { - - } - } - /// RackPatchParameters represents the body of the request to patch the rack properties. - public partial interface IRackPatchParameters : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable - { - /// - /// The free-form description of the rack location. (e.g. “DTN Datacenter, Floor 3, Isle 9, Rack 2B”) - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The free-form description of the rack location. (e.g. “DTN Datacenter, Floor 3, Isle 9, Rack 2B”)", - SerializedName = @"rackLocation", - PossibleTypes = new [] { typeof(string) })] - string RackLocation { get; set; } - /// The globally unique identifier for the rack. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The globally unique identifier for the rack.", - SerializedName = @"rackSerialNumber", - PossibleTypes = new [] { typeof(string) })] - string RackSerialNumber { get; set; } - /// The Azure resource tags that will replace the existing ones. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The Azure resource tags that will replace the existing ones.", - SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackPatchParametersTags) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackPatchParametersTags Tag { get; set; } - - } - /// RackPatchParameters represents the body of the request to patch the rack properties. - internal partial interface IRackPatchParametersInternal - - { - /// The list of the resource properties. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRacksPatchProperties Property { get; set; } - /// - /// The free-form description of the rack location. (e.g. “DTN Datacenter, Floor 3, Isle 9, Rack 2B”) - /// - string RackLocation { get; set; } - /// The globally unique identifier for the rack. - string RackSerialNumber { get; set; } - /// The Azure resource tags that will replace the existing ones. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackPatchParametersTags Tag { get; set; } - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/RackProperties.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/RackProperties.PowerShell.cs deleted file mode 100644 index 879b6a259b31..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/RackProperties.PowerShell.cs +++ /dev/null @@ -1,220 +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.NetworkCloud.Models.Api20250201 -{ - using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; - - /// RackProperties represents the properties of the rack. - [System.ComponentModel.TypeConverter(typeof(RackPropertiesTypeConverter))] - public partial class RackProperties - { - - /// - /// 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.NetworkCloud.Models.Api20250201.IRackProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new RackProperties(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.NetworkCloud.Models.Api20250201.IRackProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new RackProperties(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.NetworkCloud.Models.Api20250201.IRackProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal RackProperties(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("AvailabilityZone")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackPropertiesInternal)this).AvailabilityZone = (string) content.GetValueForProperty("AvailabilityZone",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackPropertiesInternal)this).AvailabilityZone, global::System.Convert.ToString); - } - if (content.Contains("ClusterId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackPropertiesInternal)this).ClusterId = (string) content.GetValueForProperty("ClusterId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackPropertiesInternal)this).ClusterId, global::System.Convert.ToString); - } - if (content.Contains("DetailedStatus")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackPropertiesInternal)this).DetailedStatus = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RackDetailedStatus?) content.GetValueForProperty("DetailedStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackPropertiesInternal)this).DetailedStatus, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RackDetailedStatus.CreateFrom); - } - if (content.Contains("DetailedStatusMessage")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackPropertiesInternal)this).DetailedStatusMessage = (string) content.GetValueForProperty("DetailedStatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackPropertiesInternal)this).DetailedStatusMessage, global::System.Convert.ToString); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackPropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RackProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackPropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RackProvisioningState.CreateFrom); - } - if (content.Contains("RackLocation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackPropertiesInternal)this).RackLocation = (string) content.GetValueForProperty("RackLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackPropertiesInternal)this).RackLocation, global::System.Convert.ToString); - } - if (content.Contains("RackSerialNumber")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackPropertiesInternal)this).RackSerialNumber = (string) content.GetValueForProperty("RackSerialNumber",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackPropertiesInternal)this).RackSerialNumber, global::System.Convert.ToString); - } - if (content.Contains("RackSkuId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackPropertiesInternal)this).RackSkuId = (string) content.GetValueForProperty("RackSkuId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackPropertiesInternal)this).RackSkuId, 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 RackProperties(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("AvailabilityZone")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackPropertiesInternal)this).AvailabilityZone = (string) content.GetValueForProperty("AvailabilityZone",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackPropertiesInternal)this).AvailabilityZone, global::System.Convert.ToString); - } - if (content.Contains("ClusterId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackPropertiesInternal)this).ClusterId = (string) content.GetValueForProperty("ClusterId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackPropertiesInternal)this).ClusterId, global::System.Convert.ToString); - } - if (content.Contains("DetailedStatus")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackPropertiesInternal)this).DetailedStatus = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RackDetailedStatus?) content.GetValueForProperty("DetailedStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackPropertiesInternal)this).DetailedStatus, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RackDetailedStatus.CreateFrom); - } - if (content.Contains("DetailedStatusMessage")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackPropertiesInternal)this).DetailedStatusMessage = (string) content.GetValueForProperty("DetailedStatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackPropertiesInternal)this).DetailedStatusMessage, global::System.Convert.ToString); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackPropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RackProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackPropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RackProvisioningState.CreateFrom); - } - if (content.Contains("RackLocation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackPropertiesInternal)this).RackLocation = (string) content.GetValueForProperty("RackLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackPropertiesInternal)this).RackLocation, global::System.Convert.ToString); - } - if (content.Contains("RackSerialNumber")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackPropertiesInternal)this).RackSerialNumber = (string) content.GetValueForProperty("RackSerialNumber",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackPropertiesInternal)this).RackSerialNumber, global::System.Convert.ToString); - } - if (content.Contains("RackSkuId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackPropertiesInternal)this).RackSkuId = (string) content.GetValueForProperty("RackSkuId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackPropertiesInternal)this).RackSkuId, 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.NetworkCloud.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(); - } - } - /// RackProperties represents the properties of the rack. - [System.ComponentModel.TypeConverter(typeof(RackPropertiesTypeConverter))] - public partial interface IRackProperties - - { - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/RackSku.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/RackSku.PowerShell.cs deleted file mode 100644 index 8ef28f63634e..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/RackSku.PowerShell.cs +++ /dev/null @@ -1,308 +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.NetworkCloud.Models.Api20250201 -{ - using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; - - /// RackSku represents the SKU information of the rack. - [System.ComponentModel.TypeConverter(typeof(RackSkuTypeConverter))] - public partial class RackSku - { - - /// - /// 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.NetworkCloud.Models.Api20250201.IRackSku DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new RackSku(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.NetworkCloud.Models.Api20250201.IRackSku DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new RackSku(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.NetworkCloud.Models.Api20250201.IRackSku FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal RackSku(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.NetworkCloud.Models.Api20250201.IRackSkuInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackSkuProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackSkuInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.RackSkuPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("SystemDataCreatedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)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("SystemDataCreatedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataLastModifiedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("SystemData")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.SystemDataTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Type, global::System.Convert.ToString); - } - if (content.Contains("ComputeMachine")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackSkuInternal)this).ComputeMachine = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuSlot[]) content.GetValueForProperty("ComputeMachine",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackSkuInternal)this).ComputeMachine, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.MachineSkuSlotTypeConverter.ConvertFrom)); - } - if (content.Contains("ControllerMachine")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackSkuInternal)this).ControllerMachine = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuSlot[]) content.GetValueForProperty("ControllerMachine",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackSkuInternal)this).ControllerMachine, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.MachineSkuSlotTypeConverter.ConvertFrom)); - } - if (content.Contains("Description")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackSkuInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackSkuInternal)this).Description, global::System.Convert.ToString); - } - if (content.Contains("MaxClusterSlot")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackSkuInternal)this).MaxClusterSlot = (long?) content.GetValueForProperty("MaxClusterSlot",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackSkuInternal)this).MaxClusterSlot, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackSkuInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RackSkuProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackSkuInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RackSkuProvisioningState.CreateFrom); - } - if (content.Contains("RackType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackSkuInternal)this).RackType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RackSkuType?) content.GetValueForProperty("RackType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackSkuInternal)this).RackType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RackSkuType.CreateFrom); - } - if (content.Contains("StorageAppliance")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackSkuInternal)this).StorageAppliance = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceSkuSlot[]) content.GetValueForProperty("StorageAppliance",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackSkuInternal)this).StorageAppliance, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.StorageApplianceSkuSlotTypeConverter.ConvertFrom)); - } - if (content.Contains("SupportedRackSkuId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackSkuInternal)this).SupportedRackSkuId = (string[]) content.GetValueForProperty("SupportedRackSkuId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackSkuInternal)this).SupportedRackSkuId, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal RackSku(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.NetworkCloud.Models.Api20250201.IRackSkuInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackSkuProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackSkuInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.RackSkuPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("SystemDataCreatedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)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("SystemDataCreatedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataLastModifiedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("SystemData")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.SystemDataTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Type, global::System.Convert.ToString); - } - if (content.Contains("ComputeMachine")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackSkuInternal)this).ComputeMachine = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuSlot[]) content.GetValueForProperty("ComputeMachine",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackSkuInternal)this).ComputeMachine, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.MachineSkuSlotTypeConverter.ConvertFrom)); - } - if (content.Contains("ControllerMachine")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackSkuInternal)this).ControllerMachine = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuSlot[]) content.GetValueForProperty("ControllerMachine",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackSkuInternal)this).ControllerMachine, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.MachineSkuSlotTypeConverter.ConvertFrom)); - } - if (content.Contains("Description")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackSkuInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackSkuInternal)this).Description, global::System.Convert.ToString); - } - if (content.Contains("MaxClusterSlot")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackSkuInternal)this).MaxClusterSlot = (long?) content.GetValueForProperty("MaxClusterSlot",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackSkuInternal)this).MaxClusterSlot, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackSkuInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RackSkuProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackSkuInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RackSkuProvisioningState.CreateFrom); - } - if (content.Contains("RackType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackSkuInternal)this).RackType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RackSkuType?) content.GetValueForProperty("RackType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackSkuInternal)this).RackType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RackSkuType.CreateFrom); - } - if (content.Contains("StorageAppliance")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackSkuInternal)this).StorageAppliance = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceSkuSlot[]) content.GetValueForProperty("StorageAppliance",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackSkuInternal)this).StorageAppliance, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.StorageApplianceSkuSlotTypeConverter.ConvertFrom)); - } - if (content.Contains("SupportedRackSkuId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackSkuInternal)this).SupportedRackSkuId = (string[]) content.GetValueForProperty("SupportedRackSkuId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackSkuInternal)this).SupportedRackSkuId, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - AfterDeserializePSObject(content); - } - - /// Serializes this instance to a json string. - - /// a containing this model serialized to JSON text. - public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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(); - } - } - /// RackSku represents the SKU information of the rack. - [System.ComponentModel.TypeConverter(typeof(RackSkuTypeConverter))] - public partial interface IRackSku - - { - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/RackSku.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/RackSku.cs deleted file mode 100644 index 4900cba100af..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/RackSku.cs +++ /dev/null @@ -1,290 +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.NetworkCloud.Models.Api20250201 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; - - /// RackSku represents the SKU information of the rack. - public partial class RackSku : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackSku, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackSkuInternal, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IValidates - { - /// - /// Backing field for Inherited model - /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.Resource(); - - /// - /// The list of machine SKUs and associated rack slot for the compute-dedicated machines in this rack model. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuSlot[] ComputeMachine { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackSkuPropertiesInternal)Property).ComputeMachine; } - - /// - /// The list of machine SKUs and associated rack slot for the control-plane dedicated machines in this rack model. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuSlot[] ControllerMachine { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackSkuPropertiesInternal)Property).ControllerMachine; } - - /// The free-form text describing the rack. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string Description { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackSkuPropertiesInternal)Property).Description; } - - /// - /// Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__resource).Id; } - - /// - /// The maximum number of compute racks supported by an aggregator rack. 0 if this is a compute rack or a rack for a single - /// rack cluster(rackType="Single"). - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public long? MaxClusterSlot { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackSkuPropertiesInternal)Property).MaxClusterSlot; } - - /// Internal Acessors for ComputeMachine - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuSlot[] Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackSkuInternal.ComputeMachine { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackSkuPropertiesInternal)Property).ComputeMachine; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackSkuPropertiesInternal)Property).ComputeMachine = value; } - - /// Internal Acessors for ControllerMachine - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuSlot[] Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackSkuInternal.ControllerMachine { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackSkuPropertiesInternal)Property).ControllerMachine; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackSkuPropertiesInternal)Property).ControllerMachine = value; } - - /// Internal Acessors for Description - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackSkuInternal.Description { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackSkuPropertiesInternal)Property).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackSkuPropertiesInternal)Property).Description = value; } - - /// Internal Acessors for MaxClusterSlot - long? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackSkuInternal.MaxClusterSlot { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackSkuPropertiesInternal)Property).MaxClusterSlot; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackSkuPropertiesInternal)Property).MaxClusterSlot = value; } - - /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackSkuProperties Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackSkuInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.RackSkuProperties()); set { {_property = value;} } } - - /// Internal Acessors for ProvisioningState - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RackSkuProvisioningState? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackSkuInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackSkuPropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackSkuPropertiesInternal)Property).ProvisioningState = value; } - - /// Internal Acessors for RackType - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RackSkuType? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackSkuInternal.RackType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackSkuPropertiesInternal)Property).RackType; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackSkuPropertiesInternal)Property).RackType = value; } - - /// Internal Acessors for StorageAppliance - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceSkuSlot[] Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackSkuInternal.StorageAppliance { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackSkuPropertiesInternal)Property).StorageAppliance; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackSkuPropertiesInternal)Property).StorageAppliance = value; } - - /// Internal Acessors for SupportedRackSkuId - string[] Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackSkuInternal.SupportedRackSkuId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackSkuPropertiesInternal)Property).SupportedRackSkuId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackSkuPropertiesInternal)Property).SupportedRackSkuId = value; } - - /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__resource).Id = value; } - - /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__resource).Name = value; } - - /// Internal Acessors for SystemData - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ISystemData Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal.SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__resource).SystemData; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__resource).SystemData = value; } - - /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__resource).Type = value; } - - /// The name of the resource - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__resource).Name; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackSkuProperties _property; - - /// The list of the resource properties. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackSkuProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.RackSkuProperties()); set => this._property = value; } - - /// The provisioning state of the rack SKU resource. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RackSkuProvisioningState? ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackSkuPropertiesInternal)Property).ProvisioningState; } - - /// The type of the rack. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RackSkuType? RackType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackSkuPropertiesInternal)Property).RackType; } - - /// Gets the resource group name - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string ResourceGroupName { get => (new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Success ? new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Groups["resourceGroupName"].Value : null); } - - /// - /// The list of appliance SKUs and associated rack slot for the storage appliance(s) in this rack model. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceSkuSlot[] StorageAppliance { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackSkuPropertiesInternal)Property).StorageAppliance; } - - /// The list of supported SKUs if the rack is an aggregator. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string[] SupportedRackSkuId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackSkuPropertiesInternal)Property).SupportedRackSkuId; } - - /// - /// Azure Resource Manager metadata containing createdBy and modifiedBy information. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ISystemData SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__resource).SystemData; } - - /// The timestamp of resource creation (UTC). - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__resource).SystemDataCreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__resource).SystemDataCreatedAt = value ?? default(global::System.DateTime); } - - /// The identity that created the resource. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__resource).SystemDataCreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__resource).SystemDataCreatedBy = value ?? null; } - - /// The type of identity that created the resource. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType? SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__resource).SystemDataCreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__resource).SystemDataCreatedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType)""); } - - /// The timestamp of resource last modification (UTC) - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__resource).SystemDataLastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__resource).SystemDataLastModifiedAt = value ?? default(global::System.DateTime); } - - /// The identity that last modified the resource. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__resource).SystemDataLastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__resource).SystemDataLastModifiedBy = value ?? null; } - - /// The type of identity that last modified the resource. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType? SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__resource).SystemDataLastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__resource).SystemDataLastModifiedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType)""); } - - /// - /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__resource).Type; } - - /// Creates an new instance. - public RackSku() - { - - } - - /// Validates that this object meets the validation criteria. - /// an instance that will receive validation - /// events. - /// - /// A that will be complete when validation is completed. - /// - public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) - { - await eventListener.AssertNotNull(nameof(__resource), __resource); - await eventListener.AssertObjectIsValid(nameof(__resource), __resource); - } - } - /// RackSku represents the SKU information of the rack. - public partial interface IRackSku : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResource - { - /// - /// The list of machine SKUs and associated rack slot for the compute-dedicated machines in this rack model. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The list of machine SKUs and associated rack slot for the compute-dedicated machines in this rack model.", - SerializedName = @"computeMachines", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuSlot) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuSlot[] ComputeMachine { get; } - /// - /// The list of machine SKUs and associated rack slot for the control-plane dedicated machines in this rack model. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The list of machine SKUs and associated rack slot for the control-plane dedicated machines in this rack model.", - SerializedName = @"controllerMachines", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuSlot) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuSlot[] ControllerMachine { get; } - /// The free-form text describing the rack. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The free-form text describing the rack.", - SerializedName = @"description", - PossibleTypes = new [] { typeof(string) })] - string Description { get; } - /// - /// The maximum number of compute racks supported by an aggregator rack. 0 if this is a compute rack or a rack for a single - /// rack cluster(rackType="Single"). - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The maximum number of compute racks supported by an aggregator rack. 0 if this is a compute rack or a rack for a single rack cluster(rackType=""Single"").", - SerializedName = @"maxClusterSlots", - PossibleTypes = new [] { typeof(long) })] - long? MaxClusterSlot { get; } - /// The provisioning state of the rack SKU resource. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The provisioning state of the rack SKU resource.", - SerializedName = @"provisioningState", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RackSkuProvisioningState) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RackSkuProvisioningState? ProvisioningState { get; } - /// The type of the rack. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The type of the rack.", - SerializedName = @"rackType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RackSkuType) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RackSkuType? RackType { get; } - /// - /// The list of appliance SKUs and associated rack slot for the storage appliance(s) in this rack model. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The list of appliance SKUs and associated rack slot for the storage appliance(s) in this rack model.", - SerializedName = @"storageAppliances", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceSkuSlot) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceSkuSlot[] StorageAppliance { get; } - /// The list of supported SKUs if the rack is an aggregator. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The list of supported SKUs if the rack is an aggregator.", - SerializedName = @"supportedRackSkuIds", - PossibleTypes = new [] { typeof(string) })] - string[] SupportedRackSkuId { get; } - - } - /// RackSku represents the SKU information of the rack. - internal partial interface IRackSkuInternal : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal - { - /// - /// The list of machine SKUs and associated rack slot for the compute-dedicated machines in this rack model. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuSlot[] ComputeMachine { get; set; } - /// - /// The list of machine SKUs and associated rack slot for the control-plane dedicated machines in this rack model. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuSlot[] ControllerMachine { get; set; } - /// The free-form text describing the rack. - string Description { get; set; } - /// - /// The maximum number of compute racks supported by an aggregator rack. 0 if this is a compute rack or a rack for a single - /// rack cluster(rackType="Single"). - /// - long? MaxClusterSlot { get; set; } - /// The list of the resource properties. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackSkuProperties Property { get; set; } - /// The provisioning state of the rack SKU resource. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RackSkuProvisioningState? ProvisioningState { get; set; } - /// The type of the rack. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RackSkuType? RackType { get; set; } - /// - /// The list of appliance SKUs and associated rack slot for the storage appliance(s) in this rack model. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceSkuSlot[] StorageAppliance { get; set; } - /// The list of supported SKUs if the rack is an aggregator. - string[] SupportedRackSkuId { get; set; } - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/RackSkuList.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/RackSkuList.cs deleted file mode 100644 index 9de443b2a6d4..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/RackSkuList.cs +++ /dev/null @@ -1,68 +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.NetworkCloud.Models.Api20250201 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; - - /// RackSkuList represents a list of rack SKUs. - public partial class RackSkuList : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackSkuList, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackSkuListInternal - { - - /// Backing field for property. - private string _nextLink; - - /// The link used to get the next page of operations. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string NextLink { get => this._nextLink; set => this._nextLink = value; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackSku[] _value; - - /// The list of Rack SKUs. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackSku[] Value { get => this._value; set => this._value = value; } - - /// Creates an new instance. - public RackSkuList() - { - - } - } - /// RackSkuList represents a list of rack SKUs. - public partial interface IRackSkuList : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable - { - /// The link used to get the next page of operations. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The link used to get the next page of operations.", - SerializedName = @"nextLink", - PossibleTypes = new [] { typeof(string) })] - string NextLink { get; set; } - /// The list of Rack SKUs. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The list of Rack SKUs.", - SerializedName = @"value", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackSku) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackSku[] Value { get; set; } - - } - /// RackSkuList represents a list of rack SKUs. - internal partial interface IRackSkuListInternal - - { - /// The link used to get the next page of operations. - string NextLink { get; set; } - /// The list of Rack SKUs. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackSku[] Value { get; set; } - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/RackSkuProperties.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/RackSkuProperties.PowerShell.cs deleted file mode 100644 index db734dcb460d..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/RackSkuProperties.PowerShell.cs +++ /dev/null @@ -1,224 +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.NetworkCloud.Models.Api20250201 -{ - using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; - - /// - /// RackSkuProperties represents the properties of compute-related hardware for a rack. This supports both aggregator and - /// compute racks. - /// - [System.ComponentModel.TypeConverter(typeof(RackSkuPropertiesTypeConverter))] - public partial class RackSkuProperties - { - - /// - /// 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.NetworkCloud.Models.Api20250201.IRackSkuProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new RackSkuProperties(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.NetworkCloud.Models.Api20250201.IRackSkuProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new RackSkuProperties(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.NetworkCloud.Models.Api20250201.IRackSkuProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal RackSkuProperties(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("ComputeMachine")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackSkuPropertiesInternal)this).ComputeMachine = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuSlot[]) content.GetValueForProperty("ComputeMachine",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackSkuPropertiesInternal)this).ComputeMachine, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.MachineSkuSlotTypeConverter.ConvertFrom)); - } - if (content.Contains("ControllerMachine")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackSkuPropertiesInternal)this).ControllerMachine = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuSlot[]) content.GetValueForProperty("ControllerMachine",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackSkuPropertiesInternal)this).ControllerMachine, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.MachineSkuSlotTypeConverter.ConvertFrom)); - } - if (content.Contains("Description")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackSkuPropertiesInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackSkuPropertiesInternal)this).Description, global::System.Convert.ToString); - } - if (content.Contains("MaxClusterSlot")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackSkuPropertiesInternal)this).MaxClusterSlot = (long?) content.GetValueForProperty("MaxClusterSlot",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackSkuPropertiesInternal)this).MaxClusterSlot, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackSkuPropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RackSkuProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackSkuPropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RackSkuProvisioningState.CreateFrom); - } - if (content.Contains("RackType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackSkuPropertiesInternal)this).RackType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RackSkuType?) content.GetValueForProperty("RackType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackSkuPropertiesInternal)this).RackType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RackSkuType.CreateFrom); - } - if (content.Contains("StorageAppliance")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackSkuPropertiesInternal)this).StorageAppliance = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceSkuSlot[]) content.GetValueForProperty("StorageAppliance",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackSkuPropertiesInternal)this).StorageAppliance, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.StorageApplianceSkuSlotTypeConverter.ConvertFrom)); - } - if (content.Contains("SupportedRackSkuId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackSkuPropertiesInternal)this).SupportedRackSkuId = (string[]) content.GetValueForProperty("SupportedRackSkuId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackSkuPropertiesInternal)this).SupportedRackSkuId, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal RackSkuProperties(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("ComputeMachine")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackSkuPropertiesInternal)this).ComputeMachine = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuSlot[]) content.GetValueForProperty("ComputeMachine",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackSkuPropertiesInternal)this).ComputeMachine, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.MachineSkuSlotTypeConverter.ConvertFrom)); - } - if (content.Contains("ControllerMachine")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackSkuPropertiesInternal)this).ControllerMachine = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuSlot[]) content.GetValueForProperty("ControllerMachine",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackSkuPropertiesInternal)this).ControllerMachine, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.MachineSkuSlotTypeConverter.ConvertFrom)); - } - if (content.Contains("Description")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackSkuPropertiesInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackSkuPropertiesInternal)this).Description, global::System.Convert.ToString); - } - if (content.Contains("MaxClusterSlot")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackSkuPropertiesInternal)this).MaxClusterSlot = (long?) content.GetValueForProperty("MaxClusterSlot",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackSkuPropertiesInternal)this).MaxClusterSlot, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackSkuPropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RackSkuProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackSkuPropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RackSkuProvisioningState.CreateFrom); - } - if (content.Contains("RackType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackSkuPropertiesInternal)this).RackType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RackSkuType?) content.GetValueForProperty("RackType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackSkuPropertiesInternal)this).RackType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RackSkuType.CreateFrom); - } - if (content.Contains("StorageAppliance")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackSkuPropertiesInternal)this).StorageAppliance = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceSkuSlot[]) content.GetValueForProperty("StorageAppliance",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackSkuPropertiesInternal)this).StorageAppliance, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.StorageApplianceSkuSlotTypeConverter.ConvertFrom)); - } - if (content.Contains("SupportedRackSkuId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackSkuPropertiesInternal)this).SupportedRackSkuId = (string[]) content.GetValueForProperty("SupportedRackSkuId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackSkuPropertiesInternal)this).SupportedRackSkuId, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - AfterDeserializePSObject(content); - } - - /// Serializes this instance to a json string. - - /// a containing this model serialized to JSON text. - public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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(); - } - } - /// RackSkuProperties represents the properties of compute-related hardware for a rack. This supports both aggregator and - /// compute racks. - [System.ComponentModel.TypeConverter(typeof(RackSkuPropertiesTypeConverter))] - public partial interface IRackSkuProperties - - { - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/RackSkuProperties.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/RackSkuProperties.cs deleted file mode 100644 index e1b76bb5790b..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/RackSkuProperties.cs +++ /dev/null @@ -1,226 +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.NetworkCloud.Models.Api20250201 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; - - /// - /// RackSkuProperties represents the properties of compute-related hardware for a rack. This supports both aggregator and - /// compute racks. - /// - public partial class RackSkuProperties : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackSkuProperties, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackSkuPropertiesInternal - { - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuSlot[] _computeMachine; - - /// - /// The list of machine SKUs and associated rack slot for the compute-dedicated machines in this rack model. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuSlot[] ComputeMachine { get => this._computeMachine; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuSlot[] _controllerMachine; - - /// - /// The list of machine SKUs and associated rack slot for the control-plane dedicated machines in this rack model. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuSlot[] ControllerMachine { get => this._controllerMachine; } - - /// Backing field for property. - private string _description; - - /// The free-form text describing the rack. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string Description { get => this._description; } - - /// Backing field for property. - private long? _maxClusterSlot; - - /// - /// The maximum number of compute racks supported by an aggregator rack. 0 if this is a compute rack or a rack for a single - /// rack cluster(rackType="Single"). - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public long? MaxClusterSlot { get => this._maxClusterSlot; } - - /// Internal Acessors for ComputeMachine - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuSlot[] Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackSkuPropertiesInternal.ComputeMachine { get => this._computeMachine; set { {_computeMachine = value;} } } - - /// Internal Acessors for ControllerMachine - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuSlot[] Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackSkuPropertiesInternal.ControllerMachine { get => this._controllerMachine; set { {_controllerMachine = value;} } } - - /// Internal Acessors for Description - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackSkuPropertiesInternal.Description { get => this._description; set { {_description = value;} } } - - /// Internal Acessors for MaxClusterSlot - long? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackSkuPropertiesInternal.MaxClusterSlot { get => this._maxClusterSlot; set { {_maxClusterSlot = value;} } } - - /// Internal Acessors for ProvisioningState - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RackSkuProvisioningState? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackSkuPropertiesInternal.ProvisioningState { get => this._provisioningState; set { {_provisioningState = value;} } } - - /// Internal Acessors for RackType - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RackSkuType? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackSkuPropertiesInternal.RackType { get => this._rackType; set { {_rackType = value;} } } - - /// Internal Acessors for StorageAppliance - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceSkuSlot[] Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackSkuPropertiesInternal.StorageAppliance { get => this._storageAppliance; set { {_storageAppliance = value;} } } - - /// Internal Acessors for SupportedRackSkuId - string[] Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackSkuPropertiesInternal.SupportedRackSkuId { get => this._supportedRackSkuId; set { {_supportedRackSkuId = value;} } } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RackSkuProvisioningState? _provisioningState; - - /// The provisioning state of the rack SKU resource. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RackSkuProvisioningState? ProvisioningState { get => this._provisioningState; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RackSkuType? _rackType; - - /// The type of the rack. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RackSkuType? RackType { get => this._rackType; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceSkuSlot[] _storageAppliance; - - /// - /// The list of appliance SKUs and associated rack slot for the storage appliance(s) in this rack model. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceSkuSlot[] StorageAppliance { get => this._storageAppliance; } - - /// Backing field for property. - private string[] _supportedRackSkuId; - - /// The list of supported SKUs if the rack is an aggregator. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string[] SupportedRackSkuId { get => this._supportedRackSkuId; } - - /// Creates an new instance. - public RackSkuProperties() - { - - } - } - /// RackSkuProperties represents the properties of compute-related hardware for a rack. This supports both aggregator and - /// compute racks. - public partial interface IRackSkuProperties : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable - { - /// - /// The list of machine SKUs and associated rack slot for the compute-dedicated machines in this rack model. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The list of machine SKUs and associated rack slot for the compute-dedicated machines in this rack model.", - SerializedName = @"computeMachines", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuSlot) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuSlot[] ComputeMachine { get; } - /// - /// The list of machine SKUs and associated rack slot for the control-plane dedicated machines in this rack model. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The list of machine SKUs and associated rack slot for the control-plane dedicated machines in this rack model.", - SerializedName = @"controllerMachines", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuSlot) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuSlot[] ControllerMachine { get; } - /// The free-form text describing the rack. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The free-form text describing the rack.", - SerializedName = @"description", - PossibleTypes = new [] { typeof(string) })] - string Description { get; } - /// - /// The maximum number of compute racks supported by an aggregator rack. 0 if this is a compute rack or a rack for a single - /// rack cluster(rackType="Single"). - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The maximum number of compute racks supported by an aggregator rack. 0 if this is a compute rack or a rack for a single rack cluster(rackType=""Single"").", - SerializedName = @"maxClusterSlots", - PossibleTypes = new [] { typeof(long) })] - long? MaxClusterSlot { get; } - /// The provisioning state of the rack SKU resource. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The provisioning state of the rack SKU resource.", - SerializedName = @"provisioningState", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RackSkuProvisioningState) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RackSkuProvisioningState? ProvisioningState { get; } - /// The type of the rack. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The type of the rack.", - SerializedName = @"rackType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RackSkuType) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RackSkuType? RackType { get; } - /// - /// The list of appliance SKUs and associated rack slot for the storage appliance(s) in this rack model. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The list of appliance SKUs and associated rack slot for the storage appliance(s) in this rack model.", - SerializedName = @"storageAppliances", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceSkuSlot) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceSkuSlot[] StorageAppliance { get; } - /// The list of supported SKUs if the rack is an aggregator. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The list of supported SKUs if the rack is an aggregator.", - SerializedName = @"supportedRackSkuIds", - PossibleTypes = new [] { typeof(string) })] - string[] SupportedRackSkuId { get; } - - } - /// RackSkuProperties represents the properties of compute-related hardware for a rack. This supports both aggregator and - /// compute racks. - internal partial interface IRackSkuPropertiesInternal - - { - /// - /// The list of machine SKUs and associated rack slot for the compute-dedicated machines in this rack model. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuSlot[] ComputeMachine { get; set; } - /// - /// The list of machine SKUs and associated rack slot for the control-plane dedicated machines in this rack model. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuSlot[] ControllerMachine { get; set; } - /// The free-form text describing the rack. - string Description { get; set; } - /// - /// The maximum number of compute racks supported by an aggregator rack. 0 if this is a compute rack or a rack for a single - /// rack cluster(rackType="Single"). - /// - long? MaxClusterSlot { get; set; } - /// The provisioning state of the rack SKU resource. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RackSkuProvisioningState? ProvisioningState { get; set; } - /// The type of the rack. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RackSkuType? RackType { get; set; } - /// - /// The list of appliance SKUs and associated rack slot for the storage appliance(s) in this rack model. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceSkuSlot[] StorageAppliance { get; set; } - /// The list of supported SKUs if the rack is an aggregator. - string[] SupportedRackSkuId { get; set; } - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/RuntimeProtectionConfiguration.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/RuntimeProtectionConfiguration.cs deleted file mode 100644 index 485e6192e0ee..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/RuntimeProtectionConfiguration.cs +++ /dev/null @@ -1,53 +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.NetworkCloud.Models.Api20250201 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; - - /// - /// RuntimeProtectionConfiguration represents the runtime protection configuration for the cluster. - /// - public partial class RuntimeProtectionConfiguration : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRuntimeProtectionConfiguration, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRuntimeProtectionConfigurationInternal - { - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RuntimeProtectionEnforcementLevel? _enforcementLevel; - - /// The mode of operation for runtime protection. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RuntimeProtectionEnforcementLevel? EnforcementLevel { get => this._enforcementLevel; set => this._enforcementLevel = value; } - - /// Creates an new instance. - public RuntimeProtectionConfiguration() - { - - } - } - /// RuntimeProtectionConfiguration represents the runtime protection configuration for the cluster. - public partial interface IRuntimeProtectionConfiguration : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable - { - /// The mode of operation for runtime protection. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The mode of operation for runtime protection.", - SerializedName = @"enforcementLevel", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RuntimeProtectionEnforcementLevel) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RuntimeProtectionEnforcementLevel? EnforcementLevel { get; set; } - - } - /// RuntimeProtectionConfiguration represents the runtime protection configuration for the cluster. - internal partial interface IRuntimeProtectionConfigurationInternal - - { - /// The mode of operation for runtime protection. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RuntimeProtectionEnforcementLevel? EnforcementLevel { get; set; } - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/RuntimeProtectionStatus.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/RuntimeProtectionStatus.PowerShell.cs deleted file mode 100644 index 0a1b8686f037..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/RuntimeProtectionStatus.PowerShell.cs +++ /dev/null @@ -1,200 +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.NetworkCloud.Models.Api20250201 -{ - using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; - - /// - /// RuntimeProtectionStatus represents the runtime protection status of the bare metal machine. - /// - [System.ComponentModel.TypeConverter(typeof(RuntimeProtectionStatusTypeConverter))] - public partial class RuntimeProtectionStatus - { - - /// - /// 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.NetworkCloud.Models.Api20250201.IRuntimeProtectionStatus DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new RuntimeProtectionStatus(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.NetworkCloud.Models.Api20250201.IRuntimeProtectionStatus DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new RuntimeProtectionStatus(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.NetworkCloud.Models.Api20250201.IRuntimeProtectionStatus FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal RuntimeProtectionStatus(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("DefinitionsLastUpdated")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRuntimeProtectionStatusInternal)this).DefinitionsLastUpdated = (global::System.DateTime?) content.GetValueForProperty("DefinitionsLastUpdated",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRuntimeProtectionStatusInternal)this).DefinitionsLastUpdated, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("DefinitionsVersion")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRuntimeProtectionStatusInternal)this).DefinitionsVersion = (string) content.GetValueForProperty("DefinitionsVersion",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRuntimeProtectionStatusInternal)this).DefinitionsVersion, global::System.Convert.ToString); - } - if (content.Contains("ScanCompletedTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRuntimeProtectionStatusInternal)this).ScanCompletedTime = (global::System.DateTime?) content.GetValueForProperty("ScanCompletedTime",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRuntimeProtectionStatusInternal)this).ScanCompletedTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("ScanScheduledTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRuntimeProtectionStatusInternal)this).ScanScheduledTime = (global::System.DateTime?) content.GetValueForProperty("ScanScheduledTime",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRuntimeProtectionStatusInternal)this).ScanScheduledTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("ScanStartedTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRuntimeProtectionStatusInternal)this).ScanStartedTime = (global::System.DateTime?) content.GetValueForProperty("ScanStartedTime",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRuntimeProtectionStatusInternal)this).ScanStartedTime, (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 RuntimeProtectionStatus(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("DefinitionsLastUpdated")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRuntimeProtectionStatusInternal)this).DefinitionsLastUpdated = (global::System.DateTime?) content.GetValueForProperty("DefinitionsLastUpdated",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRuntimeProtectionStatusInternal)this).DefinitionsLastUpdated, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("DefinitionsVersion")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRuntimeProtectionStatusInternal)this).DefinitionsVersion = (string) content.GetValueForProperty("DefinitionsVersion",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRuntimeProtectionStatusInternal)this).DefinitionsVersion, global::System.Convert.ToString); - } - if (content.Contains("ScanCompletedTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRuntimeProtectionStatusInternal)this).ScanCompletedTime = (global::System.DateTime?) content.GetValueForProperty("ScanCompletedTime",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRuntimeProtectionStatusInternal)this).ScanCompletedTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("ScanScheduledTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRuntimeProtectionStatusInternal)this).ScanScheduledTime = (global::System.DateTime?) content.GetValueForProperty("ScanScheduledTime",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRuntimeProtectionStatusInternal)this).ScanScheduledTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("ScanStartedTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRuntimeProtectionStatusInternal)this).ScanStartedTime = (global::System.DateTime?) content.GetValueForProperty("ScanStartedTime",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRuntimeProtectionStatusInternal)this).ScanStartedTime, (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.NetworkCloud.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(); - } - } - /// RuntimeProtectionStatus represents the runtime protection status of the bare metal machine. - [System.ComponentModel.TypeConverter(typeof(RuntimeProtectionStatusTypeConverter))] - public partial interface IRuntimeProtectionStatus - - { - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/SecretArchiveSettings.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/SecretArchiveSettings.PowerShell.cs deleted file mode 100644 index 28a7a936fbf3..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/SecretArchiveSettings.PowerShell.cs +++ /dev/null @@ -1,190 +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.NetworkCloud.Models.Api20250201 -{ - using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; - - /// - /// SecretArchiveSettings represents the settings for the secret archive used to hold credentials for the cluster. - /// - [System.ComponentModel.TypeConverter(typeof(SecretArchiveSettingsTypeConverter))] - public partial class SecretArchiveSettings - { - - /// - /// 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.NetworkCloud.Models.Api20250201.ISecretArchiveSettings DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new SecretArchiveSettings(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.NetworkCloud.Models.Api20250201.ISecretArchiveSettings DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new SecretArchiveSettings(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.NetworkCloud.Models.Api20250201.ISecretArchiveSettings FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal SecretArchiveSettings(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("AssociatedIdentity")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretArchiveSettingsInternal)this).AssociatedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIdentitySelector) content.GetValueForProperty("AssociatedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretArchiveSettingsInternal)this).AssociatedIdentity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IdentitySelectorTypeConverter.ConvertFrom); - } - if (content.Contains("VaultUri")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretArchiveSettingsInternal)this).VaultUri = (string) content.GetValueForProperty("VaultUri",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretArchiveSettingsInternal)this).VaultUri, global::System.Convert.ToString); - } - if (content.Contains("AssociatedIdentityType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretArchiveSettingsInternal)this).AssociatedIdentityType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType?) content.GetValueForProperty("AssociatedIdentityType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretArchiveSettingsInternal)this).AssociatedIdentityType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType.CreateFrom); - } - if (content.Contains("AssociatedIdentityUserAssignedIdentityResourceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretArchiveSettingsInternal)this).AssociatedIdentityUserAssignedIdentityResourceId = (string) content.GetValueForProperty("AssociatedIdentityUserAssignedIdentityResourceId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretArchiveSettingsInternal)this).AssociatedIdentityUserAssignedIdentityResourceId, 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 SecretArchiveSettings(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("AssociatedIdentity")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretArchiveSettingsInternal)this).AssociatedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIdentitySelector) content.GetValueForProperty("AssociatedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretArchiveSettingsInternal)this).AssociatedIdentity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IdentitySelectorTypeConverter.ConvertFrom); - } - if (content.Contains("VaultUri")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretArchiveSettingsInternal)this).VaultUri = (string) content.GetValueForProperty("VaultUri",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretArchiveSettingsInternal)this).VaultUri, global::System.Convert.ToString); - } - if (content.Contains("AssociatedIdentityType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretArchiveSettingsInternal)this).AssociatedIdentityType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType?) content.GetValueForProperty("AssociatedIdentityType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretArchiveSettingsInternal)this).AssociatedIdentityType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType.CreateFrom); - } - if (content.Contains("AssociatedIdentityUserAssignedIdentityResourceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretArchiveSettingsInternal)this).AssociatedIdentityUserAssignedIdentityResourceId = (string) content.GetValueForProperty("AssociatedIdentityUserAssignedIdentityResourceId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretArchiveSettingsInternal)this).AssociatedIdentityUserAssignedIdentityResourceId, 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.NetworkCloud.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(); - } - } - /// SecretArchiveSettings represents the settings for the secret archive used to hold credentials for the cluster. - [System.ComponentModel.TypeConverter(typeof(SecretArchiveSettingsTypeConverter))] - public partial interface ISecretArchiveSettings - - { - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/SecretArchiveSettings.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/SecretArchiveSettings.cs deleted file mode 100644 index 7c04b7e75c77..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/SecretArchiveSettings.cs +++ /dev/null @@ -1,105 +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.NetworkCloud.Models.Api20250201 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; - - /// - /// SecretArchiveSettings represents the settings for the secret archive used to hold credentials for the cluster. - /// - public partial class SecretArchiveSettings : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretArchiveSettings, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretArchiveSettingsInternal - { - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIdentitySelector _associatedIdentity; - - /// - /// The selection of the managed identity to use with this vault URI. The identity type must be either system assigned or - /// user assigned. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIdentitySelector AssociatedIdentity { get => (this._associatedIdentity = this._associatedIdentity ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IdentitySelector()); set => this._associatedIdentity = value; } - - /// The type of managed identity that is being selected. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType? AssociatedIdentityType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIdentitySelectorInternal)AssociatedIdentity).IdentityType; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIdentitySelectorInternal)AssociatedIdentity).IdentityType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType)""); } - - /// - /// The user assigned managed identity resource ID to use. Mutually exclusive with a system assigned identity type. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string AssociatedIdentityUserAssignedIdentityResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIdentitySelectorInternal)AssociatedIdentity).UserAssignedIdentityResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIdentitySelectorInternal)AssociatedIdentity).UserAssignedIdentityResourceId = value ?? null; } - - /// Internal Acessors for AssociatedIdentity - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIdentitySelector Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretArchiveSettingsInternal.AssociatedIdentity { get => (this._associatedIdentity = this._associatedIdentity ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IdentitySelector()); set { {_associatedIdentity = value;} } } - - /// Backing field for property. - private string _vaultUri; - - /// The URI for the key vault used as the secret archive. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string VaultUri { get => this._vaultUri; set => this._vaultUri = value; } - - /// Creates an new instance. - public SecretArchiveSettings() - { - - } - } - /// SecretArchiveSettings represents the settings for the secret archive used to hold credentials for the cluster. - public partial interface ISecretArchiveSettings : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable - { - /// The type of managed identity that is being selected. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The type of managed identity that is being selected.", - SerializedName = @"identityType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType? AssociatedIdentityType { get; set; } - /// - /// The user assigned managed identity resource ID to use. Mutually exclusive with a system assigned identity type. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The user assigned managed identity resource ID to use. Mutually exclusive with a system assigned identity type.", - SerializedName = @"userAssignedIdentityResourceId", - PossibleTypes = new [] { typeof(string) })] - string AssociatedIdentityUserAssignedIdentityResourceId { get; set; } - /// The URI for the key vault used as the secret archive. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The URI for the key vault used as the secret archive.", - SerializedName = @"vaultUri", - PossibleTypes = new [] { typeof(string) })] - string VaultUri { get; set; } - - } - /// SecretArchiveSettings represents the settings for the secret archive used to hold credentials for the cluster. - internal partial interface ISecretArchiveSettingsInternal - - { - /// - /// The selection of the managed identity to use with this vault URI. The identity type must be either system assigned or - /// user assigned. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIdentitySelector AssociatedIdentity { get; set; } - /// The type of managed identity that is being selected. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType? AssociatedIdentityType { get; set; } - /// - /// The user assigned managed identity resource ID to use. Mutually exclusive with a system assigned identity type. - /// - string AssociatedIdentityUserAssignedIdentityResourceId { get; set; } - /// The URI for the key vault used as the secret archive. - string VaultUri { get; set; } - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/SecretRotationStatus.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/SecretRotationStatus.PowerShell.cs deleted file mode 100644 index 32e6aa5997cb..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/SecretRotationStatus.PowerShell.cs +++ /dev/null @@ -1,220 +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.NetworkCloud.Models.Api20250201 -{ - using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; - - /// SecretRotationStatus represents the status of a secret rotation. - [System.ComponentModel.TypeConverter(typeof(SecretRotationStatusTypeConverter))] - public partial class SecretRotationStatus - { - - /// - /// 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.NetworkCloud.Models.Api20250201.ISecretRotationStatus DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new SecretRotationStatus(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.NetworkCloud.Models.Api20250201.ISecretRotationStatus DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new SecretRotationStatus(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.NetworkCloud.Models.Api20250201.ISecretRotationStatus FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal SecretRotationStatus(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("SecretArchiveReference")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretRotationStatusInternal)this).SecretArchiveReference = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretArchiveReference) content.GetValueForProperty("SecretArchiveReference",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretRotationStatusInternal)this).SecretArchiveReference, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.SecretArchiveReferenceTypeConverter.ConvertFrom); - } - if (content.Contains("ExpirePeriodDay")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretRotationStatusInternal)this).ExpirePeriodDay = (long?) content.GetValueForProperty("ExpirePeriodDay",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretRotationStatusInternal)this).ExpirePeriodDay, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("LastRotationTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretRotationStatusInternal)this).LastRotationTime = (global::System.DateTime?) content.GetValueForProperty("LastRotationTime",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretRotationStatusInternal)this).LastRotationTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("RotationPeriodDay")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretRotationStatusInternal)this).RotationPeriodDay = (long?) content.GetValueForProperty("RotationPeriodDay",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretRotationStatusInternal)this).RotationPeriodDay, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("SecretType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretRotationStatusInternal)this).SecretType = (string) content.GetValueForProperty("SecretType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretRotationStatusInternal)this).SecretType, global::System.Convert.ToString); - } - if (content.Contains("SecretArchiveReferenceSecretName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretRotationStatusInternal)this).SecretArchiveReferenceSecretName = (string) content.GetValueForProperty("SecretArchiveReferenceSecretName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretRotationStatusInternal)this).SecretArchiveReferenceSecretName, global::System.Convert.ToString); - } - if (content.Contains("SecretArchiveReferenceSecretVersion")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretRotationStatusInternal)this).SecretArchiveReferenceSecretVersion = (string) content.GetValueForProperty("SecretArchiveReferenceSecretVersion",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretRotationStatusInternal)this).SecretArchiveReferenceSecretVersion, global::System.Convert.ToString); - } - if (content.Contains("SecretArchiveReferenceKeyVaultId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretRotationStatusInternal)this).SecretArchiveReferenceKeyVaultId = (string) content.GetValueForProperty("SecretArchiveReferenceKeyVaultId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretRotationStatusInternal)this).SecretArchiveReferenceKeyVaultId, 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 SecretRotationStatus(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("SecretArchiveReference")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretRotationStatusInternal)this).SecretArchiveReference = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretArchiveReference) content.GetValueForProperty("SecretArchiveReference",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretRotationStatusInternal)this).SecretArchiveReference, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.SecretArchiveReferenceTypeConverter.ConvertFrom); - } - if (content.Contains("ExpirePeriodDay")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretRotationStatusInternal)this).ExpirePeriodDay = (long?) content.GetValueForProperty("ExpirePeriodDay",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretRotationStatusInternal)this).ExpirePeriodDay, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("LastRotationTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretRotationStatusInternal)this).LastRotationTime = (global::System.DateTime?) content.GetValueForProperty("LastRotationTime",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretRotationStatusInternal)this).LastRotationTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("RotationPeriodDay")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretRotationStatusInternal)this).RotationPeriodDay = (long?) content.GetValueForProperty("RotationPeriodDay",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretRotationStatusInternal)this).RotationPeriodDay, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("SecretType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretRotationStatusInternal)this).SecretType = (string) content.GetValueForProperty("SecretType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretRotationStatusInternal)this).SecretType, global::System.Convert.ToString); - } - if (content.Contains("SecretArchiveReferenceSecretName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretRotationStatusInternal)this).SecretArchiveReferenceSecretName = (string) content.GetValueForProperty("SecretArchiveReferenceSecretName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretRotationStatusInternal)this).SecretArchiveReferenceSecretName, global::System.Convert.ToString); - } - if (content.Contains("SecretArchiveReferenceSecretVersion")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretRotationStatusInternal)this).SecretArchiveReferenceSecretVersion = (string) content.GetValueForProperty("SecretArchiveReferenceSecretVersion",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretRotationStatusInternal)this).SecretArchiveReferenceSecretVersion, global::System.Convert.ToString); - } - if (content.Contains("SecretArchiveReferenceKeyVaultId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretRotationStatusInternal)this).SecretArchiveReferenceKeyVaultId = (string) content.GetValueForProperty("SecretArchiveReferenceKeyVaultId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretRotationStatusInternal)this).SecretArchiveReferenceKeyVaultId, 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.NetworkCloud.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(); - } - } - /// SecretRotationStatus represents the status of a secret rotation. - [System.ComponentModel.TypeConverter(typeof(SecretRotationStatusTypeConverter))] - public partial interface ISecretRotationStatus - - { - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/SecretRotationStatus.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/SecretRotationStatus.cs deleted file mode 100644 index 789a9dbf369b..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/SecretRotationStatus.cs +++ /dev/null @@ -1,177 +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.NetworkCloud.Models.Api20250201 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; - - /// SecretRotationStatus represents the status of a secret rotation. - public partial class SecretRotationStatus : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretRotationStatus, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretRotationStatusInternal - { - - /// Backing field for property. - private long? _expirePeriodDay; - - /// The maximum number of days the secret may be used before it must be changed. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public long? ExpirePeriodDay { get => this._expirePeriodDay; } - - /// Backing field for property. - private global::System.DateTime? _lastRotationTime; - - /// The date and time when the secret was last changed. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public global::System.DateTime? LastRotationTime { get => this._lastRotationTime; } - - /// Internal Acessors for ExpirePeriodDay - long? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretRotationStatusInternal.ExpirePeriodDay { get => this._expirePeriodDay; set { {_expirePeriodDay = value;} } } - - /// Internal Acessors for LastRotationTime - global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretRotationStatusInternal.LastRotationTime { get => this._lastRotationTime; set { {_lastRotationTime = value;} } } - - /// Internal Acessors for RotationPeriodDay - long? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretRotationStatusInternal.RotationPeriodDay { get => this._rotationPeriodDay; set { {_rotationPeriodDay = value;} } } - - /// Internal Acessors for SecretArchiveReference - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretArchiveReference Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretRotationStatusInternal.SecretArchiveReference { get => (this._secretArchiveReference = this._secretArchiveReference ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.SecretArchiveReference()); set { {_secretArchiveReference = value;} } } - - /// Internal Acessors for SecretArchiveReferenceKeyVaultId - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretRotationStatusInternal.SecretArchiveReferenceKeyVaultId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretArchiveReferenceInternal)SecretArchiveReference).KeyVaultId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretArchiveReferenceInternal)SecretArchiveReference).KeyVaultId = value; } - - /// Internal Acessors for SecretArchiveReferenceSecretName - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretRotationStatusInternal.SecretArchiveReferenceSecretName { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretArchiveReferenceInternal)SecretArchiveReference).SecretName; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretArchiveReferenceInternal)SecretArchiveReference).SecretName = value; } - - /// Internal Acessors for SecretArchiveReferenceSecretVersion - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretRotationStatusInternal.SecretArchiveReferenceSecretVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretArchiveReferenceInternal)SecretArchiveReference).SecretVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretArchiveReferenceInternal)SecretArchiveReference).SecretVersion = value; } - - /// Internal Acessors for SecretType - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretRotationStatusInternal.SecretType { get => this._secretType; set { {_secretType = value;} } } - - /// Backing field for property. - private long? _rotationPeriodDay; - - /// The number of days a secret exists before rotations will be attempted. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public long? RotationPeriodDay { get => this._rotationPeriodDay; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretArchiveReference _secretArchiveReference; - - /// The reference to the secret in a key vault. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretArchiveReference SecretArchiveReference { get => (this._secretArchiveReference = this._secretArchiveReference ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.SecretArchiveReference()); } - - /// The resource ID of the key vault containing the secret. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string SecretArchiveReferenceKeyVaultId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretArchiveReferenceInternal)SecretArchiveReference).KeyVaultId; } - - /// The name of the secret in the key vault. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string SecretArchiveReferenceSecretName { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretArchiveReferenceInternal)SecretArchiveReference).SecretName; } - - /// The version of the secret in the key vault. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string SecretArchiveReferenceSecretVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretArchiveReferenceInternal)SecretArchiveReference).SecretVersion; } - - /// Backing field for property. - private string _secretType; - - /// The type name used to identify the purpose of the secret. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string SecretType { get => this._secretType; } - - /// Creates an new instance. - public SecretRotationStatus() - { - - } - } - /// SecretRotationStatus represents the status of a secret rotation. - public partial interface ISecretRotationStatus : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable - { - /// The maximum number of days the secret may be used before it must be changed. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The maximum number of days the secret may be used before it must be changed.", - SerializedName = @"expirePeriodDays", - PossibleTypes = new [] { typeof(long) })] - long? ExpirePeriodDay { get; } - /// The date and time when the secret was last changed. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The date and time when the secret was last changed.", - SerializedName = @"lastRotationTime", - PossibleTypes = new [] { typeof(global::System.DateTime) })] - global::System.DateTime? LastRotationTime { get; } - /// The number of days a secret exists before rotations will be attempted. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The number of days a secret exists before rotations will be attempted.", - SerializedName = @"rotationPeriodDays", - PossibleTypes = new [] { typeof(long) })] - long? RotationPeriodDay { get; } - /// The resource ID of the key vault containing the secret. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The resource ID of the key vault containing the secret.", - SerializedName = @"keyVaultId", - PossibleTypes = new [] { typeof(string) })] - string SecretArchiveReferenceKeyVaultId { get; } - /// The name of the secret in the key vault. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The name of the secret in the key vault.", - SerializedName = @"secretName", - PossibleTypes = new [] { typeof(string) })] - string SecretArchiveReferenceSecretName { get; } - /// The version of the secret in the key vault. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The version of the secret in the key vault.", - SerializedName = @"secretVersion", - PossibleTypes = new [] { typeof(string) })] - string SecretArchiveReferenceSecretVersion { get; } - /// The type name used to identify the purpose of the secret. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The type name used to identify the purpose of the secret.", - SerializedName = @"secretType", - PossibleTypes = new [] { typeof(string) })] - string SecretType { get; } - - } - /// SecretRotationStatus represents the status of a secret rotation. - internal partial interface ISecretRotationStatusInternal - - { - /// The maximum number of days the secret may be used before it must be changed. - long? ExpirePeriodDay { get; set; } - /// The date and time when the secret was last changed. - global::System.DateTime? LastRotationTime { get; set; } - /// The number of days a secret exists before rotations will be attempted. - long? RotationPeriodDay { get; set; } - /// The reference to the secret in a key vault. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretArchiveReference SecretArchiveReference { get; set; } - /// The resource ID of the key vault containing the secret. - string SecretArchiveReferenceKeyVaultId { get; set; } - /// The name of the secret in the key vault. - string SecretArchiveReferenceSecretName { get; set; } - /// The version of the secret in the key vault. - string SecretArchiveReferenceSecretVersion { get; set; } - /// The type name used to identify the purpose of the secret. - string SecretType { get; set; } - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ServiceLoadBalancerBgpPeer.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ServiceLoadBalancerBgpPeer.PowerShell.cs deleted file mode 100644 index 507b77c8095b..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ServiceLoadBalancerBgpPeer.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.NetworkCloud.Models.Api20250201 -{ - using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; - - /// - /// ServiceLoadBalancerBgpPeer represents the configuration of the BGP service load balancer for the Kubernetes cluster. - /// - [System.ComponentModel.TypeConverter(typeof(ServiceLoadBalancerBgpPeerTypeConverter))] - public partial class ServiceLoadBalancerBgpPeer - { - - /// - /// 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.NetworkCloud.Models.Api20250201.IServiceLoadBalancerBgpPeer DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new ServiceLoadBalancerBgpPeer(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.NetworkCloud.Models.Api20250201.IServiceLoadBalancerBgpPeer DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new ServiceLoadBalancerBgpPeer(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.NetworkCloud.Models.Api20250201.IServiceLoadBalancerBgpPeer FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal ServiceLoadBalancerBgpPeer(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("BfdEnabled")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IServiceLoadBalancerBgpPeerInternal)this).BfdEnabled = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BfdEnabled?) content.GetValueForProperty("BfdEnabled",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IServiceLoadBalancerBgpPeerInternal)this).BfdEnabled, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BfdEnabled.CreateFrom); - } - if (content.Contains("BgpMultiHop")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IServiceLoadBalancerBgpPeerInternal)this).BgpMultiHop = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BgpMultiHop?) content.GetValueForProperty("BgpMultiHop",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IServiceLoadBalancerBgpPeerInternal)this).BgpMultiHop, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BgpMultiHop.CreateFrom); - } - if (content.Contains("HoldTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IServiceLoadBalancerBgpPeerInternal)this).HoldTime = (string) content.GetValueForProperty("HoldTime",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IServiceLoadBalancerBgpPeerInternal)this).HoldTime, global::System.Convert.ToString); - } - if (content.Contains("KeepAliveTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IServiceLoadBalancerBgpPeerInternal)this).KeepAliveTime = (string) content.GetValueForProperty("KeepAliveTime",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IServiceLoadBalancerBgpPeerInternal)this).KeepAliveTime, global::System.Convert.ToString); - } - if (content.Contains("MyAsn")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IServiceLoadBalancerBgpPeerInternal)this).MyAsn = (long?) content.GetValueForProperty("MyAsn",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IServiceLoadBalancerBgpPeerInternal)this).MyAsn, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IServiceLoadBalancerBgpPeerInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IServiceLoadBalancerBgpPeerInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Password")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IServiceLoadBalancerBgpPeerInternal)this).Password = (string) content.GetValueForProperty("Password",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IServiceLoadBalancerBgpPeerInternal)this).Password, global::System.Convert.ToString); - } - if (content.Contains("PeerAddress")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IServiceLoadBalancerBgpPeerInternal)this).PeerAddress = (string) content.GetValueForProperty("PeerAddress",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IServiceLoadBalancerBgpPeerInternal)this).PeerAddress, global::System.Convert.ToString); - } - if (content.Contains("PeerAsn")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IServiceLoadBalancerBgpPeerInternal)this).PeerAsn = (long) content.GetValueForProperty("PeerAsn",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IServiceLoadBalancerBgpPeerInternal)this).PeerAsn, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("PeerPort")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IServiceLoadBalancerBgpPeerInternal)this).PeerPort = (long?) content.GetValueForProperty("PeerPort",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IServiceLoadBalancerBgpPeerInternal)this).PeerPort, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal ServiceLoadBalancerBgpPeer(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("BfdEnabled")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IServiceLoadBalancerBgpPeerInternal)this).BfdEnabled = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BfdEnabled?) content.GetValueForProperty("BfdEnabled",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IServiceLoadBalancerBgpPeerInternal)this).BfdEnabled, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BfdEnabled.CreateFrom); - } - if (content.Contains("BgpMultiHop")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IServiceLoadBalancerBgpPeerInternal)this).BgpMultiHop = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BgpMultiHop?) content.GetValueForProperty("BgpMultiHop",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IServiceLoadBalancerBgpPeerInternal)this).BgpMultiHop, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BgpMultiHop.CreateFrom); - } - if (content.Contains("HoldTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IServiceLoadBalancerBgpPeerInternal)this).HoldTime = (string) content.GetValueForProperty("HoldTime",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IServiceLoadBalancerBgpPeerInternal)this).HoldTime, global::System.Convert.ToString); - } - if (content.Contains("KeepAliveTime")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IServiceLoadBalancerBgpPeerInternal)this).KeepAliveTime = (string) content.GetValueForProperty("KeepAliveTime",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IServiceLoadBalancerBgpPeerInternal)this).KeepAliveTime, global::System.Convert.ToString); - } - if (content.Contains("MyAsn")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IServiceLoadBalancerBgpPeerInternal)this).MyAsn = (long?) content.GetValueForProperty("MyAsn",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IServiceLoadBalancerBgpPeerInternal)this).MyAsn, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IServiceLoadBalancerBgpPeerInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IServiceLoadBalancerBgpPeerInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Password")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IServiceLoadBalancerBgpPeerInternal)this).Password = (string) content.GetValueForProperty("Password",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IServiceLoadBalancerBgpPeerInternal)this).Password, global::System.Convert.ToString); - } - if (content.Contains("PeerAddress")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IServiceLoadBalancerBgpPeerInternal)this).PeerAddress = (string) content.GetValueForProperty("PeerAddress",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IServiceLoadBalancerBgpPeerInternal)this).PeerAddress, global::System.Convert.ToString); - } - if (content.Contains("PeerAsn")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IServiceLoadBalancerBgpPeerInternal)this).PeerAsn = (long) content.GetValueForProperty("PeerAsn",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IServiceLoadBalancerBgpPeerInternal)this).PeerAsn, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("PeerPort")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IServiceLoadBalancerBgpPeerInternal)this).PeerPort = (long?) content.GetValueForProperty("PeerPort",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IServiceLoadBalancerBgpPeerInternal)this).PeerPort, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - 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.NetworkCloud.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(); - } - } - /// ServiceLoadBalancerBgpPeer represents the configuration of the BGP service load balancer for the Kubernetes cluster. - [System.ComponentModel.TypeConverter(typeof(ServiceLoadBalancerBgpPeerTypeConverter))] - public partial interface IServiceLoadBalancerBgpPeer - - { - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ServiceLoadBalancerBgpPeer.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ServiceLoadBalancerBgpPeer.json.cs deleted file mode 100644 index 4b3a155f29f6..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ServiceLoadBalancerBgpPeer.json.cs +++ /dev/null @@ -1,128 +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.NetworkCloud.Models.Api20250201 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; - - /// - /// ServiceLoadBalancerBgpPeer represents the configuration of the BGP service load balancer for the Kubernetes cluster. - /// - public partial class ServiceLoadBalancerBgpPeer - { - - /// - /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object - /// before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The JsonNode that should be deserialized into this object. - - partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json); - - /// - /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The JSON container that the serialization result will be placed in. - - partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container); - - /// - /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of - /// the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the - /// output parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The JsonNode that should be deserialized into this object. - /// Determines if the rest of the deserialization should be processed, or if the method should return - /// instantly. - - partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json, ref bool returnNow); - - /// - /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the - /// object before it is serialized. - /// If you wish to disable the default serialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The JSON container that the serialization result will be placed in. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, ref bool returnNow); - - /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IServiceLoadBalancerBgpPeer. - /// - /// a to deserialize from. - /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IServiceLoadBalancerBgpPeer. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IServiceLoadBalancerBgpPeer FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) - { - return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new ServiceLoadBalancerBgpPeer(json) : null; - } - - /// - /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject into a new instance of . - /// - /// A Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject instance to deserialize from. - internal ServiceLoadBalancerBgpPeer(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) - { - bool returnNow = false; - BeforeFromJson(json, ref returnNow); - if (returnNow) - { - return; - } - {_bfdEnabled = If( json?.PropertyT("bfdEnabled"), out var __jsonBfdEnabled) ? (string)__jsonBfdEnabled : (string)BfdEnabled;} - {_bgpMultiHop = If( json?.PropertyT("bgpMultiHop"), out var __jsonBgpMultiHop) ? (string)__jsonBgpMultiHop : (string)BgpMultiHop;} - {_holdTime = If( json?.PropertyT("holdTime"), out var __jsonHoldTime) ? (string)__jsonHoldTime : (string)HoldTime;} - {_keepAliveTime = If( json?.PropertyT("keepAliveTime"), out var __jsonKeepAliveTime) ? (string)__jsonKeepAliveTime : (string)KeepAliveTime;} - {_myAsn = If( json?.PropertyT("myAsn"), out var __jsonMyAsn) ? (long?)__jsonMyAsn : MyAsn;} - {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} - {_password = If( json?.PropertyT("password"), out var __jsonPassword) ? (string)__jsonPassword : (string)Password;} - {_peerAddress = If( json?.PropertyT("peerAddress"), out var __jsonPeerAddress) ? (string)__jsonPeerAddress : (string)PeerAddress;} - {_peerAsn = If( json?.PropertyT("peerAsn"), out var __jsonPeerAsn) ? (long)__jsonPeerAsn : PeerAsn;} - {_peerPort = If( json?.PropertyT("peerPort"), out var __jsonPeerPort) ? (long?)__jsonPeerPort : PeerPort;} - AfterFromJson(json); - } - - /// - /// Serializes this instance of into a . - /// - /// The container to serialize this object into. If the caller - /// passes in null, a new instance will be created and returned to the caller. - /// Allows the caller to choose the depth of the serialization. See . - /// - /// a serialized instance of as a . - /// - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode) - { - container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject(); - - bool returnNow = false; - BeforeToJson(ref container, ref returnNow); - if (returnNow) - { - return container; - } - AddIf( null != (((object)this._bfdEnabled)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._bfdEnabled.ToString()) : null, "bfdEnabled" ,container.Add ); - AddIf( null != (((object)this._bgpMultiHop)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._bgpMultiHop.ToString()) : null, "bgpMultiHop" ,container.Add ); - AddIf( null != (((object)this._holdTime)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._holdTime.ToString()) : null, "holdTime" ,container.Add ); - AddIf( null != (((object)this._keepAliveTime)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._keepAliveTime.ToString()) : null, "keepAliveTime" ,container.Add ); - AddIf( null != this._myAsn ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNumber((long)this._myAsn) : null, "myAsn" ,container.Add ); - AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); - AddIf( null != (((object)this._password)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._password.ToString()) : null, "password" ,container.Add ); - AddIf( null != (((object)this._peerAddress)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._peerAddress.ToString()) : null, "peerAddress" ,container.Add ); - AddIf( (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNumber(this._peerAsn), "peerAsn" ,container.Add ); - AddIf( null != this._peerPort ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNumber((long)this._peerPort) : null, "peerPort" ,container.Add ); - AfterToJson(ref container); - return container; - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ServicePrincipalInformation.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ServicePrincipalInformation.PowerShell.cs deleted file mode 100644 index b38f44df8c22..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ServicePrincipalInformation.PowerShell.cs +++ /dev/null @@ -1,194 +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.NetworkCloud.Models.Api20250201 -{ - using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; - - /// - /// ServicePrincipalInformation represents the details of the service principal to be used by the cluster during Arc Appliance - /// installation. - /// - [System.ComponentModel.TypeConverter(typeof(ServicePrincipalInformationTypeConverter))] - public partial class ServicePrincipalInformation - { - - /// - /// 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.NetworkCloud.Models.Api20250201.IServicePrincipalInformation DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new ServicePrincipalInformation(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.NetworkCloud.Models.Api20250201.IServicePrincipalInformation DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new ServicePrincipalInformation(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.NetworkCloud.Models.Api20250201.IServicePrincipalInformation FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal ServicePrincipalInformation(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.NetworkCloud.Models.Api20250201.IServicePrincipalInformationInternal)this).ApplicationId = (string) content.GetValueForProperty("ApplicationId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IServicePrincipalInformationInternal)this).ApplicationId, global::System.Convert.ToString); - } - if (content.Contains("Password")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IServicePrincipalInformationInternal)this).Password = (System.Security.SecureString) content.GetValueForProperty("Password",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IServicePrincipalInformationInternal)this).Password, (object ss) => (System.Security.SecureString)ss); - } - if (content.Contains("PrincipalId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IServicePrincipalInformationInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IServicePrincipalInformationInternal)this).PrincipalId, global::System.Convert.ToString); - } - if (content.Contains("TenantId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IServicePrincipalInformationInternal)this).TenantId = (string) content.GetValueForProperty("TenantId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IServicePrincipalInformationInternal)this).TenantId, 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 ServicePrincipalInformation(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.NetworkCloud.Models.Api20250201.IServicePrincipalInformationInternal)this).ApplicationId = (string) content.GetValueForProperty("ApplicationId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IServicePrincipalInformationInternal)this).ApplicationId, global::System.Convert.ToString); - } - if (content.Contains("Password")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IServicePrincipalInformationInternal)this).Password = (System.Security.SecureString) content.GetValueForProperty("Password",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IServicePrincipalInformationInternal)this).Password, (object ss) => (System.Security.SecureString)ss); - } - if (content.Contains("PrincipalId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IServicePrincipalInformationInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IServicePrincipalInformationInternal)this).PrincipalId, global::System.Convert.ToString); - } - if (content.Contains("TenantId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IServicePrincipalInformationInternal)this).TenantId = (string) content.GetValueForProperty("TenantId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IServicePrincipalInformationInternal)this).TenantId, 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.NetworkCloud.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(); - } - } - /// ServicePrincipalInformation represents the details of the service principal to be used by the cluster during Arc Appliance - /// installation. - [System.ComponentModel.TypeConverter(typeof(ServicePrincipalInformationTypeConverter))] - public partial interface IServicePrincipalInformation - - { - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/StorageAppliance.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/StorageAppliance.PowerShell.cs deleted file mode 100644 index 25afcedbe282..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/StorageAppliance.PowerShell.cs +++ /dev/null @@ -1,452 +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.NetworkCloud.Models.Api20250201 -{ - using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; - - /// StorageAppliance represents on-premises Network Cloud storage appliance. - [System.ComponentModel.TypeConverter(typeof(StorageApplianceTypeConverter))] - public partial class StorageAppliance - { - - /// - /// 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.NetworkCloud.Models.Api20250201.IStorageAppliance DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new StorageAppliance(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.NetworkCloud.Models.Api20250201.IStorageAppliance DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new StorageAppliance(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.NetworkCloud.Models.Api20250201.IStorageAppliance FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal StorageAppliance(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("ExtendedLocation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceInternal)this).ExtendedLocation = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocation) content.GetValueForProperty("ExtendedLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceInternal)this).ExtendedLocation, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ExtendedLocationTypeConverter.ConvertFrom); - } - if (content.Contains("Property")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.StorageAppliancePropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Etag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceInternal)this).Etag, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)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("SystemDataCreatedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataLastModifiedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("SystemData")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.SystemDataTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Type, global::System.Convert.ToString); - } - if (content.Contains("Tag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.TrackedResourceTagsTypeConverter.ConvertFrom); - } - if (content.Contains("Location")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); - } - if (content.Contains("ExtendedLocationName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceInternal)this).ExtendedLocationName = (string) content.GetValueForProperty("ExtendedLocationName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceInternal)this).ExtendedLocationName, global::System.Convert.ToString); - } - if (content.Contains("ExtendedLocationType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceInternal)this).ExtendedLocationType = (string) content.GetValueForProperty("ExtendedLocationType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceInternal)this).ExtendedLocationType, global::System.Convert.ToString); - } - if (content.Contains("AdministratorCredentials")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceInternal)this).AdministratorCredentials = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministrativeCredentials) content.GetValueForProperty("AdministratorCredentials",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceInternal)this).AdministratorCredentials, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AdministrativeCredentialsTypeConverter.ConvertFrom); - } - if (content.Contains("Capacity")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceInternal)this).Capacity = (long?) content.GetValueForProperty("Capacity",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceInternal)this).Capacity, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("CapacityUsed")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceInternal)this).CapacityUsed = (long?) content.GetValueForProperty("CapacityUsed",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceInternal)this).CapacityUsed, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("ClusterId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceInternal)this).ClusterId = (string) content.GetValueForProperty("ClusterId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceInternal)this).ClusterId, global::System.Convert.ToString); - } - if (content.Contains("DetailedStatus")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceInternal)this).DetailedStatus = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.StorageApplianceDetailedStatus?) content.GetValueForProperty("DetailedStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceInternal)this).DetailedStatus, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.StorageApplianceDetailedStatus.CreateFrom); - } - if (content.Contains("DetailedStatusMessage")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceInternal)this).DetailedStatusMessage = (string) content.GetValueForProperty("DetailedStatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceInternal)this).DetailedStatusMessage, global::System.Convert.ToString); - } - if (content.Contains("ManagementIpv4Address")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceInternal)this).ManagementIpv4Address = (string) content.GetValueForProperty("ManagementIpv4Address",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceInternal)this).ManagementIpv4Address, global::System.Convert.ToString); - } - if (content.Contains("Manufacturer")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceInternal)this).Manufacturer = (string) content.GetValueForProperty("Manufacturer",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceInternal)this).Manufacturer, global::System.Convert.ToString); - } - if (content.Contains("Model")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceInternal)this).Model = (string) content.GetValueForProperty("Model",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceInternal)this).Model, global::System.Convert.ToString); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.StorageApplianceProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.StorageApplianceProvisioningState.CreateFrom); - } - if (content.Contains("RackId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceInternal)this).RackId = (string) content.GetValueForProperty("RackId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceInternal)this).RackId, global::System.Convert.ToString); - } - if (content.Contains("RackSlot")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceInternal)this).RackSlot = (long) content.GetValueForProperty("RackSlot",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceInternal)this).RackSlot, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("RemoteVendorManagementFeature")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceInternal)this).RemoteVendorManagementFeature = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RemoteVendorManagementFeature?) content.GetValueForProperty("RemoteVendorManagementFeature",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceInternal)this).RemoteVendorManagementFeature, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RemoteVendorManagementFeature.CreateFrom); - } - if (content.Contains("RemoteVendorManagementStatus")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceInternal)this).RemoteVendorManagementStatus = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RemoteVendorManagementStatus?) content.GetValueForProperty("RemoteVendorManagementStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceInternal)this).RemoteVendorManagementStatus, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RemoteVendorManagementStatus.CreateFrom); - } - if (content.Contains("SecretRotationStatus")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceInternal)this).SecretRotationStatus = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretRotationStatus[]) content.GetValueForProperty("SecretRotationStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceInternal)this).SecretRotationStatus, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.SecretRotationStatusTypeConverter.ConvertFrom)); - } - if (content.Contains("SerialNumber")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceInternal)this).SerialNumber = (string) content.GetValueForProperty("SerialNumber",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceInternal)this).SerialNumber, global::System.Convert.ToString); - } - if (content.Contains("SkuId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceInternal)this).SkuId = (string) content.GetValueForProperty("SkuId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceInternal)this).SkuId, global::System.Convert.ToString); - } - if (content.Contains("Version")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceInternal)this).Version = (string) content.GetValueForProperty("Version",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceInternal)this).Version, global::System.Convert.ToString); - } - if (content.Contains("AdministratorCredentialsPassword")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceInternal)this).AdministratorCredentialsPassword = (System.Security.SecureString) content.GetValueForProperty("AdministratorCredentialsPassword",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceInternal)this).AdministratorCredentialsPassword, (object ss) => (System.Security.SecureString)ss); - } - if (content.Contains("AdministratorCredentialsUsername")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceInternal)this).AdministratorCredentialsUsername = (string) content.GetValueForProperty("AdministratorCredentialsUsername",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceInternal)this).AdministratorCredentialsUsername, 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 StorageAppliance(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("ExtendedLocation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceInternal)this).ExtendedLocation = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocation) content.GetValueForProperty("ExtendedLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceInternal)this).ExtendedLocation, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ExtendedLocationTypeConverter.ConvertFrom); - } - if (content.Contains("Property")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.StorageAppliancePropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Etag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceInternal)this).Etag, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)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("SystemDataCreatedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataLastModifiedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("SystemData")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.SystemDataTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Type, global::System.Convert.ToString); - } - if (content.Contains("Tag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.TrackedResourceTagsTypeConverter.ConvertFrom); - } - if (content.Contains("Location")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); - } - if (content.Contains("ExtendedLocationName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceInternal)this).ExtendedLocationName = (string) content.GetValueForProperty("ExtendedLocationName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceInternal)this).ExtendedLocationName, global::System.Convert.ToString); - } - if (content.Contains("ExtendedLocationType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceInternal)this).ExtendedLocationType = (string) content.GetValueForProperty("ExtendedLocationType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceInternal)this).ExtendedLocationType, global::System.Convert.ToString); - } - if (content.Contains("AdministratorCredentials")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceInternal)this).AdministratorCredentials = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministrativeCredentials) content.GetValueForProperty("AdministratorCredentials",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceInternal)this).AdministratorCredentials, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AdministrativeCredentialsTypeConverter.ConvertFrom); - } - if (content.Contains("Capacity")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceInternal)this).Capacity = (long?) content.GetValueForProperty("Capacity",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceInternal)this).Capacity, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("CapacityUsed")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceInternal)this).CapacityUsed = (long?) content.GetValueForProperty("CapacityUsed",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceInternal)this).CapacityUsed, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("ClusterId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceInternal)this).ClusterId = (string) content.GetValueForProperty("ClusterId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceInternal)this).ClusterId, global::System.Convert.ToString); - } - if (content.Contains("DetailedStatus")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceInternal)this).DetailedStatus = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.StorageApplianceDetailedStatus?) content.GetValueForProperty("DetailedStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceInternal)this).DetailedStatus, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.StorageApplianceDetailedStatus.CreateFrom); - } - if (content.Contains("DetailedStatusMessage")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceInternal)this).DetailedStatusMessage = (string) content.GetValueForProperty("DetailedStatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceInternal)this).DetailedStatusMessage, global::System.Convert.ToString); - } - if (content.Contains("ManagementIpv4Address")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceInternal)this).ManagementIpv4Address = (string) content.GetValueForProperty("ManagementIpv4Address",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceInternal)this).ManagementIpv4Address, global::System.Convert.ToString); - } - if (content.Contains("Manufacturer")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceInternal)this).Manufacturer = (string) content.GetValueForProperty("Manufacturer",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceInternal)this).Manufacturer, global::System.Convert.ToString); - } - if (content.Contains("Model")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceInternal)this).Model = (string) content.GetValueForProperty("Model",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceInternal)this).Model, global::System.Convert.ToString); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.StorageApplianceProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.StorageApplianceProvisioningState.CreateFrom); - } - if (content.Contains("RackId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceInternal)this).RackId = (string) content.GetValueForProperty("RackId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceInternal)this).RackId, global::System.Convert.ToString); - } - if (content.Contains("RackSlot")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceInternal)this).RackSlot = (long) content.GetValueForProperty("RackSlot",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceInternal)this).RackSlot, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("RemoteVendorManagementFeature")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceInternal)this).RemoteVendorManagementFeature = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RemoteVendorManagementFeature?) content.GetValueForProperty("RemoteVendorManagementFeature",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceInternal)this).RemoteVendorManagementFeature, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RemoteVendorManagementFeature.CreateFrom); - } - if (content.Contains("RemoteVendorManagementStatus")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceInternal)this).RemoteVendorManagementStatus = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RemoteVendorManagementStatus?) content.GetValueForProperty("RemoteVendorManagementStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceInternal)this).RemoteVendorManagementStatus, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RemoteVendorManagementStatus.CreateFrom); - } - if (content.Contains("SecretRotationStatus")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceInternal)this).SecretRotationStatus = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretRotationStatus[]) content.GetValueForProperty("SecretRotationStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceInternal)this).SecretRotationStatus, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.SecretRotationStatusTypeConverter.ConvertFrom)); - } - if (content.Contains("SerialNumber")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceInternal)this).SerialNumber = (string) content.GetValueForProperty("SerialNumber",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceInternal)this).SerialNumber, global::System.Convert.ToString); - } - if (content.Contains("SkuId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceInternal)this).SkuId = (string) content.GetValueForProperty("SkuId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceInternal)this).SkuId, global::System.Convert.ToString); - } - if (content.Contains("Version")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceInternal)this).Version = (string) content.GetValueForProperty("Version",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceInternal)this).Version, global::System.Convert.ToString); - } - if (content.Contains("AdministratorCredentialsPassword")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceInternal)this).AdministratorCredentialsPassword = (System.Security.SecureString) content.GetValueForProperty("AdministratorCredentialsPassword",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceInternal)this).AdministratorCredentialsPassword, (object ss) => (System.Security.SecureString)ss); - } - if (content.Contains("AdministratorCredentialsUsername")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceInternal)this).AdministratorCredentialsUsername = (string) content.GetValueForProperty("AdministratorCredentialsUsername",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceInternal)this).AdministratorCredentialsUsername, 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.NetworkCloud.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(); - } - } - /// StorageAppliance represents on-premises Network Cloud storage appliance. - [System.ComponentModel.TypeConverter(typeof(StorageApplianceTypeConverter))] - public partial interface IStorageAppliance - - { - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/StorageAppliance.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/StorageAppliance.cs deleted file mode 100644 index 283331cc2db3..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/StorageAppliance.cs +++ /dev/null @@ -1,526 +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.NetworkCloud.Models.Api20250201 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; - - /// StorageAppliance represents on-premises Network Cloud storage appliance. - public partial class StorageAppliance : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliance, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceInternal, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IValidates - { - /// - /// Backing field for Inherited model - /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResource __trackedResource = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.TrackedResource(); - - /// The password of the administrator of the device used during initialization. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public System.Security.SecureString AdministratorCredentialsPassword { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePropertiesInternal)Property).AdministratorCredentialsPassword; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePropertiesInternal)Property).AdministratorCredentialsPassword = value ; } - - /// The username of the administrator of the device used during initialization. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string AdministratorCredentialsUsername { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePropertiesInternal)Property).AdministratorCredentialsUsername; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePropertiesInternal)Property).AdministratorCredentialsUsername = value ; } - - /// The total capacity of the storage appliance. Measured in GiB. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public long? Capacity { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePropertiesInternal)Property).Capacity; } - - /// The amount of storage consumed. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public long? CapacityUsed { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePropertiesInternal)Property).CapacityUsed; } - - /// - /// The resource ID of the cluster this storage appliance is associated with. Measured in GiB. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string ClusterId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePropertiesInternal)Property).ClusterId; } - - /// The detailed status of the storage appliance. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.StorageApplianceDetailedStatus? DetailedStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePropertiesInternal)Property).DetailedStatus; } - - /// The descriptive message about the current detailed status. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string DetailedStatusMessage { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePropertiesInternal)Property).DetailedStatusMessage; } - - /// Backing field for property. - private string _etag; - - /// Resource ETag. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string Etag { get => this._etag; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocation _extendedLocation; - - /// The extended location of the cluster associated with the resource. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocation ExtendedLocation { get => (this._extendedLocation = this._extendedLocation ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ExtendedLocation()); set => this._extendedLocation = value; } - - /// The resource ID of the extended location on which the resource will be created. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string ExtendedLocationName { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocationInternal)ExtendedLocation).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocationInternal)ExtendedLocation).Name = value ; } - - /// The extended location type, for example, CustomLocation. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string ExtendedLocationType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocationInternal)ExtendedLocation).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocationInternal)ExtendedLocation).Type = value ; } - - /// - /// Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).Id; } - - /// The geo-location where the resource lives - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)__trackedResource).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)__trackedResource).Location = value ; } - - /// The endpoint for the management interface of the storage appliance. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string ManagementIpv4Address { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePropertiesInternal)Property).ManagementIpv4Address; } - - /// The manufacturer of the storage appliance. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string Manufacturer { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePropertiesInternal)Property).Manufacturer; } - - /// Internal Acessors for AdministratorCredentials - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministrativeCredentials Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceInternal.AdministratorCredentials { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePropertiesInternal)Property).AdministratorCredentials; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePropertiesInternal)Property).AdministratorCredentials = value; } - - /// Internal Acessors for Capacity - long? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceInternal.Capacity { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePropertiesInternal)Property).Capacity; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePropertiesInternal)Property).Capacity = value; } - - /// Internal Acessors for CapacityUsed - long? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceInternal.CapacityUsed { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePropertiesInternal)Property).CapacityUsed; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePropertiesInternal)Property).CapacityUsed = value; } - - /// Internal Acessors for ClusterId - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceInternal.ClusterId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePropertiesInternal)Property).ClusterId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePropertiesInternal)Property).ClusterId = value; } - - /// Internal Acessors for DetailedStatus - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.StorageApplianceDetailedStatus? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceInternal.DetailedStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePropertiesInternal)Property).DetailedStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePropertiesInternal)Property).DetailedStatus = value; } - - /// Internal Acessors for DetailedStatusMessage - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceInternal.DetailedStatusMessage { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePropertiesInternal)Property).DetailedStatusMessage; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePropertiesInternal)Property).DetailedStatusMessage = value; } - - /// Internal Acessors for Etag - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceInternal.Etag { get => this._etag; set { {_etag = value;} } } - - /// Internal Acessors for ExtendedLocation - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocation Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceInternal.ExtendedLocation { get => (this._extendedLocation = this._extendedLocation ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ExtendedLocation()); set { {_extendedLocation = value;} } } - - /// Internal Acessors for ManagementIpv4Address - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceInternal.ManagementIpv4Address { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePropertiesInternal)Property).ManagementIpv4Address; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePropertiesInternal)Property).ManagementIpv4Address = value; } - - /// Internal Acessors for Manufacturer - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceInternal.Manufacturer { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePropertiesInternal)Property).Manufacturer; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePropertiesInternal)Property).Manufacturer = value; } - - /// Internal Acessors for Model - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceInternal.Model { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePropertiesInternal)Property).Model; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePropertiesInternal)Property).Model = value; } - - /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceProperties Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.StorageApplianceProperties()); set { {_property = value;} } } - - /// Internal Acessors for ProvisioningState - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.StorageApplianceProvisioningState? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePropertiesInternal)Property).ProvisioningState = value; } - - /// Internal Acessors for RemoteVendorManagementFeature - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RemoteVendorManagementFeature? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceInternal.RemoteVendorManagementFeature { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePropertiesInternal)Property).RemoteVendorManagementFeature; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePropertiesInternal)Property).RemoteVendorManagementFeature = value; } - - /// Internal Acessors for RemoteVendorManagementStatus - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RemoteVendorManagementStatus? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceInternal.RemoteVendorManagementStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePropertiesInternal)Property).RemoteVendorManagementStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePropertiesInternal)Property).RemoteVendorManagementStatus = value; } - - /// Internal Acessors for SecretRotationStatus - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretRotationStatus[] Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceInternal.SecretRotationStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePropertiesInternal)Property).SecretRotationStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePropertiesInternal)Property).SecretRotationStatus = value; } - - /// Internal Acessors for Version - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceInternal.Version { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePropertiesInternal)Property).Version; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePropertiesInternal)Property).Version = value; } - - /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).Id = value; } - - /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).Name = value; } - - /// Internal Acessors for SystemData - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ISystemData Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal.SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemData; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemData = value; } - - /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).Type = value; } - - /// The model of the storage appliance. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string Model { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePropertiesInternal)Property).Model; } - - /// The name of the resource - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).Name; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceProperties _property; - - /// The list of the resource properties. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.StorageApplianceProperties()); set => this._property = value; } - - /// The provisioning state of the storage appliance. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.StorageApplianceProvisioningState? ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePropertiesInternal)Property).ProvisioningState; } - - /// The resource ID of the rack where this storage appliance resides. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string RackId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePropertiesInternal)Property).RackId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePropertiesInternal)Property).RackId = value ; } - - /// The slot the storage appliance is in the rack based on the BOM configuration. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public long RackSlot { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePropertiesInternal)Property).RackSlot; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePropertiesInternal)Property).RackSlot = value ; } - - /// - /// The indicator of whether the storage appliance supports remote vendor management. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RemoteVendorManagementFeature? RemoteVendorManagementFeature { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePropertiesInternal)Property).RemoteVendorManagementFeature; } - - /// - /// The indicator of whether the remote vendor management feature is enabled or disabled, or unsupported if it is an unsupported - /// feature. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RemoteVendorManagementStatus? RemoteVendorManagementStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePropertiesInternal)Property).RemoteVendorManagementStatus; } - - /// Gets the resource group name - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string ResourceGroupName { get => (new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Success ? new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Groups["resourceGroupName"].Value : null); } - - /// The list of statuses that represent secret rotation activity. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretRotationStatus[] SecretRotationStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePropertiesInternal)Property).SecretRotationStatus; } - - /// The serial number for the storage appliance. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string SerialNumber { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePropertiesInternal)Property).SerialNumber; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePropertiesInternal)Property).SerialNumber = value ; } - - /// The SKU for the storage appliance. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string SkuId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePropertiesInternal)Property).StorageApplianceSkuId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePropertiesInternal)Property).StorageApplianceSkuId = value ; } - - /// - /// Azure Resource Manager metadata containing createdBy and modifiedBy information. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ISystemData SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemData; } - - /// The timestamp of resource creation (UTC). - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataCreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataCreatedAt = value ?? default(global::System.DateTime); } - - /// The identity that created the resource. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataCreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataCreatedBy = value ?? null; } - - /// The type of identity that created the resource. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType? SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataCreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataCreatedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType)""); } - - /// The timestamp of resource last modification (UTC) - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataLastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataLastModifiedAt = value ?? default(global::System.DateTime); } - - /// The identity that last modified the resource. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataLastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataLastModifiedBy = value ?? null; } - - /// The type of identity that last modified the resource. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType? SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataLastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataLastModifiedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType)""); } - - /// Resource tags. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)__trackedResource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.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.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).Type; } - - /// The version of the storage appliance. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string Version { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePropertiesInternal)Property).Version; } - - /// Creates an new instance. - public StorageAppliance() - { - - } - - /// Validates that this object meets the validation criteria. - /// an instance that will receive validation - /// events. - /// - /// A that will be complete when validation is completed. - /// - public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) - { - await eventListener.AssertNotNull(nameof(__trackedResource), __trackedResource); - await eventListener.AssertObjectIsValid(nameof(__trackedResource), __trackedResource); - } - } - /// StorageAppliance represents on-premises Network Cloud storage appliance. - public partial interface IStorageAppliance : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResource - { - /// The password of the administrator of the device used during initialization. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The password of the administrator of the device used during initialization.", - SerializedName = @"password", - PossibleTypes = new [] { typeof(System.Security.SecureString) })] - System.Security.SecureString AdministratorCredentialsPassword { get; set; } - /// The username of the administrator of the device used during initialization. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The username of the administrator of the device used during initialization.", - SerializedName = @"username", - PossibleTypes = new [] { typeof(string) })] - string AdministratorCredentialsUsername { get; set; } - /// The total capacity of the storage appliance. Measured in GiB. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The total capacity of the storage appliance. Measured in GiB.", - SerializedName = @"capacity", - PossibleTypes = new [] { typeof(long) })] - long? Capacity { get; } - /// The amount of storage consumed. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The amount of storage consumed.", - SerializedName = @"capacityUsed", - PossibleTypes = new [] { typeof(long) })] - long? CapacityUsed { get; } - /// - /// The resource ID of the cluster this storage appliance is associated with. Measured in GiB. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The resource ID of the cluster this storage appliance is associated with. Measured in GiB.", - SerializedName = @"clusterId", - PossibleTypes = new [] { typeof(string) })] - string ClusterId { get; } - /// The detailed status of the storage appliance. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The detailed status of the storage appliance.", - SerializedName = @"detailedStatus", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.StorageApplianceDetailedStatus) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.StorageApplianceDetailedStatus? DetailedStatus { get; } - /// The descriptive message about the current detailed status. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The descriptive message about the current detailed status.", - SerializedName = @"detailedStatusMessage", - PossibleTypes = new [] { typeof(string) })] - string DetailedStatusMessage { get; } - /// Resource ETag. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"Resource ETag.", - SerializedName = @"etag", - PossibleTypes = new [] { typeof(string) })] - string Etag { get; } - /// The resource ID of the extended location on which the resource will be created. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The resource ID of the extended location on which the resource will be created.", - SerializedName = @"name", - PossibleTypes = new [] { typeof(string) })] - string ExtendedLocationName { get; set; } - /// The extended location type, for example, CustomLocation. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The extended location type, for example, CustomLocation.", - SerializedName = @"type", - PossibleTypes = new [] { typeof(string) })] - string ExtendedLocationType { get; set; } - /// The endpoint for the management interface of the storage appliance. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The endpoint for the management interface of the storage appliance.", - SerializedName = @"managementIpv4Address", - PossibleTypes = new [] { typeof(string) })] - string ManagementIpv4Address { get; } - /// The manufacturer of the storage appliance. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The manufacturer of the storage appliance.", - SerializedName = @"manufacturer", - PossibleTypes = new [] { typeof(string) })] - string Manufacturer { get; } - /// The model of the storage appliance. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The model of the storage appliance.", - SerializedName = @"model", - PossibleTypes = new [] { typeof(string) })] - string Model { get; } - /// The provisioning state of the storage appliance. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The provisioning state of the storage appliance.", - SerializedName = @"provisioningState", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.StorageApplianceProvisioningState) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.StorageApplianceProvisioningState? ProvisioningState { get; } - /// The resource ID of the rack where this storage appliance resides. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The resource ID of the rack where this storage appliance resides.", - SerializedName = @"rackId", - PossibleTypes = new [] { typeof(string) })] - string RackId { get; set; } - /// The slot the storage appliance is in the rack based on the BOM configuration. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The slot the storage appliance is in the rack based on the BOM configuration.", - SerializedName = @"rackSlot", - PossibleTypes = new [] { typeof(long) })] - long RackSlot { get; set; } - /// - /// The indicator of whether the storage appliance supports remote vendor management. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The indicator of whether the storage appliance supports remote vendor management.", - SerializedName = @"remoteVendorManagementFeature", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RemoteVendorManagementFeature) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RemoteVendorManagementFeature? RemoteVendorManagementFeature { get; } - /// - /// The indicator of whether the remote vendor management feature is enabled or disabled, or unsupported if it is an unsupported - /// feature. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The indicator of whether the remote vendor management feature is enabled or disabled, or unsupported if it is an unsupported feature.", - SerializedName = @"remoteVendorManagementStatus", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RemoteVendorManagementStatus) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RemoteVendorManagementStatus? RemoteVendorManagementStatus { get; } - /// The list of statuses that represent secret rotation activity. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The list of statuses that represent secret rotation activity.", - SerializedName = @"secretRotationStatus", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretRotationStatus) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretRotationStatus[] SecretRotationStatus { get; } - /// The serial number for the storage appliance. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The serial number for the storage appliance.", - SerializedName = @"serialNumber", - PossibleTypes = new [] { typeof(string) })] - string SerialNumber { get; set; } - /// The SKU for the storage appliance. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The SKU for the storage appliance.", - SerializedName = @"storageApplianceSkuId", - PossibleTypes = new [] { typeof(string) })] - string SkuId { get; set; } - /// The version of the storage appliance. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The version of the storage appliance.", - SerializedName = @"version", - PossibleTypes = new [] { typeof(string) })] - string Version { get; } - - } - /// StorageAppliance represents on-premises Network Cloud storage appliance. - internal partial interface IStorageApplianceInternal : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal - { - /// The credentials of the administrative interface on this storage appliance. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministrativeCredentials AdministratorCredentials { get; set; } - /// The password of the administrator of the device used during initialization. - System.Security.SecureString AdministratorCredentialsPassword { get; set; } - /// The username of the administrator of the device used during initialization. - string AdministratorCredentialsUsername { get; set; } - /// The total capacity of the storage appliance. Measured in GiB. - long? Capacity { get; set; } - /// The amount of storage consumed. - long? CapacityUsed { get; set; } - /// - /// The resource ID of the cluster this storage appliance is associated with. Measured in GiB. - /// - string ClusterId { get; set; } - /// The detailed status of the storage appliance. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.StorageApplianceDetailedStatus? DetailedStatus { get; set; } - /// The descriptive message about the current detailed status. - string DetailedStatusMessage { get; set; } - /// Resource ETag. - string Etag { get; set; } - /// The extended location of the cluster associated with the resource. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocation ExtendedLocation { get; set; } - /// The resource ID of the extended location on which the resource will be created. - string ExtendedLocationName { get; set; } - /// The extended location type, for example, CustomLocation. - string ExtendedLocationType { get; set; } - /// The endpoint for the management interface of the storage appliance. - string ManagementIpv4Address { get; set; } - /// The manufacturer of the storage appliance. - string Manufacturer { get; set; } - /// The model of the storage appliance. - string Model { get; set; } - /// The list of the resource properties. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceProperties Property { get; set; } - /// The provisioning state of the storage appliance. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.StorageApplianceProvisioningState? ProvisioningState { get; set; } - /// The resource ID of the rack where this storage appliance resides. - string RackId { get; set; } - /// The slot the storage appliance is in the rack based on the BOM configuration. - long RackSlot { get; set; } - /// - /// The indicator of whether the storage appliance supports remote vendor management. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RemoteVendorManagementFeature? RemoteVendorManagementFeature { get; set; } - /// - /// The indicator of whether the remote vendor management feature is enabled or disabled, or unsupported if it is an unsupported - /// feature. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RemoteVendorManagementStatus? RemoteVendorManagementStatus { get; set; } - /// The list of statuses that represent secret rotation activity. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretRotationStatus[] SecretRotationStatus { get; set; } - /// The serial number for the storage appliance. - string SerialNumber { get; set; } - /// The SKU for the storage appliance. - string SkuId { get; set; } - /// The version of the storage appliance. - string Version { get; set; } - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/StorageApplianceConfigurationData.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/StorageApplianceConfigurationData.PowerShell.cs deleted file mode 100644 index 04638d2ffeea..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/StorageApplianceConfigurationData.PowerShell.cs +++ /dev/null @@ -1,210 +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.NetworkCloud.Models.Api20250201 -{ - using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; - - /// - /// StorageApplianceConfigurationData represents configuration for the storage application. - /// - [System.ComponentModel.TypeConverter(typeof(StorageApplianceConfigurationDataTypeConverter))] - public partial class StorageApplianceConfigurationData - { - - /// - /// 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.NetworkCloud.Models.Api20250201.IStorageApplianceConfigurationData DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new StorageApplianceConfigurationData(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.NetworkCloud.Models.Api20250201.IStorageApplianceConfigurationData DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new StorageApplianceConfigurationData(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.NetworkCloud.Models.Api20250201.IStorageApplianceConfigurationData FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal StorageApplianceConfigurationData(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("AdminCredentials")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceConfigurationDataInternal)this).AdminCredentials = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministrativeCredentials) content.GetValueForProperty("AdminCredentials",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceConfigurationDataInternal)this).AdminCredentials, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AdministrativeCredentialsTypeConverter.ConvertFrom); - } - if (content.Contains("RackSlot")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceConfigurationDataInternal)this).RackSlot = (long) content.GetValueForProperty("RackSlot",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceConfigurationDataInternal)this).RackSlot, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("SerialNumber")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceConfigurationDataInternal)this).SerialNumber = (string) content.GetValueForProperty("SerialNumber",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceConfigurationDataInternal)this).SerialNumber, global::System.Convert.ToString); - } - if (content.Contains("StorageApplianceName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceConfigurationDataInternal)this).StorageApplianceName = (string) content.GetValueForProperty("StorageApplianceName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceConfigurationDataInternal)this).StorageApplianceName, global::System.Convert.ToString); - } - if (content.Contains("AdminCredentialsPassword")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceConfigurationDataInternal)this).AdminCredentialsPassword = (System.Security.SecureString) content.GetValueForProperty("AdminCredentialsPassword",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceConfigurationDataInternal)this).AdminCredentialsPassword, (object ss) => (System.Security.SecureString)ss); - } - if (content.Contains("AdminCredentialsUsername")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceConfigurationDataInternal)this).AdminCredentialsUsername = (string) content.GetValueForProperty("AdminCredentialsUsername",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceConfigurationDataInternal)this).AdminCredentialsUsername, 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 StorageApplianceConfigurationData(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("AdminCredentials")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceConfigurationDataInternal)this).AdminCredentials = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministrativeCredentials) content.GetValueForProperty("AdminCredentials",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceConfigurationDataInternal)this).AdminCredentials, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AdministrativeCredentialsTypeConverter.ConvertFrom); - } - if (content.Contains("RackSlot")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceConfigurationDataInternal)this).RackSlot = (long) content.GetValueForProperty("RackSlot",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceConfigurationDataInternal)this).RackSlot, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("SerialNumber")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceConfigurationDataInternal)this).SerialNumber = (string) content.GetValueForProperty("SerialNumber",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceConfigurationDataInternal)this).SerialNumber, global::System.Convert.ToString); - } - if (content.Contains("StorageApplianceName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceConfigurationDataInternal)this).StorageApplianceName = (string) content.GetValueForProperty("StorageApplianceName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceConfigurationDataInternal)this).StorageApplianceName, global::System.Convert.ToString); - } - if (content.Contains("AdminCredentialsPassword")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceConfigurationDataInternal)this).AdminCredentialsPassword = (System.Security.SecureString) content.GetValueForProperty("AdminCredentialsPassword",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceConfigurationDataInternal)this).AdminCredentialsPassword, (object ss) => (System.Security.SecureString)ss); - } - if (content.Contains("AdminCredentialsUsername")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceConfigurationDataInternal)this).AdminCredentialsUsername = (string) content.GetValueForProperty("AdminCredentialsUsername",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceConfigurationDataInternal)this).AdminCredentialsUsername, 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.NetworkCloud.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(); - } - } - /// StorageApplianceConfigurationData represents configuration for the storage application. - [System.ComponentModel.TypeConverter(typeof(StorageApplianceConfigurationDataTypeConverter))] - public partial interface IStorageApplianceConfigurationData - - { - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/StorageApplianceList.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/StorageApplianceList.cs deleted file mode 100644 index f5d3c3e42b1a..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/StorageApplianceList.cs +++ /dev/null @@ -1,68 +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.NetworkCloud.Models.Api20250201 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; - - /// StorageApplianceList represents a list of storage appliances. - public partial class StorageApplianceList : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceList, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceListInternal - { - - /// Backing field for property. - private string _nextLink; - - /// The link used to get the next page of operations. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string NextLink { get => this._nextLink; set => this._nextLink = value; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliance[] _value; - - /// The list of storage appliances. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliance[] Value { get => this._value; set => this._value = value; } - - /// Creates an new instance. - public StorageApplianceList() - { - - } - } - /// StorageApplianceList represents a list of storage appliances. - public partial interface IStorageApplianceList : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable - { - /// The link used to get the next page of operations. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The link used to get the next page of operations.", - SerializedName = @"nextLink", - PossibleTypes = new [] { typeof(string) })] - string NextLink { get; set; } - /// The list of storage appliances. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The list of storage appliances.", - SerializedName = @"value", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliance) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliance[] Value { get; set; } - - } - /// StorageApplianceList represents a list of storage appliances. - internal partial interface IStorageApplianceListInternal - - { - /// The link used to get the next page of operations. - string NextLink { get; set; } - /// The list of storage appliances. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliance[] Value { get; set; } - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/StorageAppliancePatchParameters.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/StorageAppliancePatchParameters.PowerShell.cs deleted file mode 100644 index ce976c03b530..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/StorageAppliancePatchParameters.PowerShell.cs +++ /dev/null @@ -1,184 +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.NetworkCloud.Models.Api20250201 -{ - using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; - - /// - /// StorageAppliancePatchParameters represents the body of the request to patch storage appliance properties. - /// - [System.ComponentModel.TypeConverter(typeof(StorageAppliancePatchParametersTypeConverter))] - public partial class StorageAppliancePatchParameters - { - - /// - /// 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.NetworkCloud.Models.Api20250201.IStorageAppliancePatchParameters DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new StorageAppliancePatchParameters(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.NetworkCloud.Models.Api20250201.IStorageAppliancePatchParameters DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new StorageAppliancePatchParameters(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.NetworkCloud.Models.Api20250201.IStorageAppliancePatchParameters FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal StorageAppliancePatchParameters(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.NetworkCloud.Models.Api20250201.IStorageAppliancePatchParametersInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePatchProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePatchParametersInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.StorageAppliancePatchPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Tag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePatchParametersInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePatchParametersTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePatchParametersInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.StorageAppliancePatchParametersTagsTypeConverter.ConvertFrom); - } - if (content.Contains("SerialNumber")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePatchParametersInternal)this).SerialNumber = (string) content.GetValueForProperty("SerialNumber",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePatchParametersInternal)this).SerialNumber, 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 StorageAppliancePatchParameters(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.NetworkCloud.Models.Api20250201.IStorageAppliancePatchParametersInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePatchProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePatchParametersInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.StorageAppliancePatchPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Tag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePatchParametersInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePatchParametersTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePatchParametersInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.StorageAppliancePatchParametersTagsTypeConverter.ConvertFrom); - } - if (content.Contains("SerialNumber")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePatchParametersInternal)this).SerialNumber = (string) content.GetValueForProperty("SerialNumber",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePatchParametersInternal)this).SerialNumber, 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.NetworkCloud.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(); - } - } - /// StorageAppliancePatchParameters represents the body of the request to patch storage appliance properties. - [System.ComponentModel.TypeConverter(typeof(StorageAppliancePatchParametersTypeConverter))] - public partial interface IStorageAppliancePatchParameters - - { - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/StorageAppliancePatchParameters.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/StorageAppliancePatchParameters.cs deleted file mode 100644 index 8e69f3834d9d..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/StorageAppliancePatchParameters.cs +++ /dev/null @@ -1,79 +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.NetworkCloud.Models.Api20250201 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; - - /// - /// StorageAppliancePatchParameters represents the body of the request to patch storage appliance properties. - /// - public partial class StorageAppliancePatchParameters : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePatchParameters, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePatchParametersInternal - { - - /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePatchProperties Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePatchParametersInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.StorageAppliancePatchProperties()); set { {_property = value;} } } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePatchProperties _property; - - /// The list of the resource properties. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePatchProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.StorageAppliancePatchProperties()); set => this._property = value; } - - /// The serial number for the storage appliance. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string SerialNumber { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePatchPropertiesInternal)Property).SerialNumber; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePatchPropertiesInternal)Property).SerialNumber = value ?? null; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePatchParametersTags _tag; - - /// The Azure resource tags that will replace the existing ones. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePatchParametersTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.StorageAppliancePatchParametersTags()); set => this._tag = value; } - - /// Creates an new instance. - public StorageAppliancePatchParameters() - { - - } - } - /// StorageAppliancePatchParameters represents the body of the request to patch storage appliance properties. - public partial interface IStorageAppliancePatchParameters : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable - { - /// The serial number for the storage appliance. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The serial number for the storage appliance.", - SerializedName = @"serialNumber", - PossibleTypes = new [] { typeof(string) })] - string SerialNumber { get; set; } - /// The Azure resource tags that will replace the existing ones. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The Azure resource tags that will replace the existing ones.", - SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePatchParametersTags) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePatchParametersTags Tag { get; set; } - - } - /// StorageAppliancePatchParameters represents the body of the request to patch storage appliance properties. - internal partial interface IStorageAppliancePatchParametersInternal - - { - /// The list of the resource properties. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePatchProperties Property { get; set; } - /// The serial number for the storage appliance. - string SerialNumber { get; set; } - /// The Azure resource tags that will replace the existing ones. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePatchParametersTags Tag { get; set; } - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/StorageApplianceProperties.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/StorageApplianceProperties.PowerShell.cs deleted file mode 100644 index 9644d42b474d..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/StorageApplianceProperties.PowerShell.cs +++ /dev/null @@ -1,318 +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.NetworkCloud.Models.Api20250201 -{ - using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; - - /// StorageApplianceProperties represents the properties of the storage appliance. - [System.ComponentModel.TypeConverter(typeof(StorageAppliancePropertiesTypeConverter))] - public partial class StorageApplianceProperties - { - - /// - /// 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.NetworkCloud.Models.Api20250201.IStorageApplianceProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new StorageApplianceProperties(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.NetworkCloud.Models.Api20250201.IStorageApplianceProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new StorageApplianceProperties(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.NetworkCloud.Models.Api20250201.IStorageApplianceProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal StorageApplianceProperties(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("AdministratorCredentials")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePropertiesInternal)this).AdministratorCredentials = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministrativeCredentials) content.GetValueForProperty("AdministratorCredentials",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePropertiesInternal)this).AdministratorCredentials, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AdministrativeCredentialsTypeConverter.ConvertFrom); - } - if (content.Contains("Capacity")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePropertiesInternal)this).Capacity = (long?) content.GetValueForProperty("Capacity",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePropertiesInternal)this).Capacity, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("CapacityUsed")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePropertiesInternal)this).CapacityUsed = (long?) content.GetValueForProperty("CapacityUsed",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePropertiesInternal)this).CapacityUsed, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("ClusterId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePropertiesInternal)this).ClusterId = (string) content.GetValueForProperty("ClusterId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePropertiesInternal)this).ClusterId, global::System.Convert.ToString); - } - if (content.Contains("DetailedStatus")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePropertiesInternal)this).DetailedStatus = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.StorageApplianceDetailedStatus?) content.GetValueForProperty("DetailedStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePropertiesInternal)this).DetailedStatus, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.StorageApplianceDetailedStatus.CreateFrom); - } - if (content.Contains("DetailedStatusMessage")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePropertiesInternal)this).DetailedStatusMessage = (string) content.GetValueForProperty("DetailedStatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePropertiesInternal)this).DetailedStatusMessage, global::System.Convert.ToString); - } - if (content.Contains("ManagementIpv4Address")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePropertiesInternal)this).ManagementIpv4Address = (string) content.GetValueForProperty("ManagementIpv4Address",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePropertiesInternal)this).ManagementIpv4Address, global::System.Convert.ToString); - } - if (content.Contains("Manufacturer")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePropertiesInternal)this).Manufacturer = (string) content.GetValueForProperty("Manufacturer",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePropertiesInternal)this).Manufacturer, global::System.Convert.ToString); - } - if (content.Contains("Model")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePropertiesInternal)this).Model = (string) content.GetValueForProperty("Model",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePropertiesInternal)this).Model, global::System.Convert.ToString); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.StorageApplianceProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.StorageApplianceProvisioningState.CreateFrom); - } - if (content.Contains("RackId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePropertiesInternal)this).RackId = (string) content.GetValueForProperty("RackId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePropertiesInternal)this).RackId, global::System.Convert.ToString); - } - if (content.Contains("RackSlot")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePropertiesInternal)this).RackSlot = (long) content.GetValueForProperty("RackSlot",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePropertiesInternal)this).RackSlot, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("RemoteVendorManagementFeature")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePropertiesInternal)this).RemoteVendorManagementFeature = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RemoteVendorManagementFeature?) content.GetValueForProperty("RemoteVendorManagementFeature",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePropertiesInternal)this).RemoteVendorManagementFeature, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RemoteVendorManagementFeature.CreateFrom); - } - if (content.Contains("RemoteVendorManagementStatus")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePropertiesInternal)this).RemoteVendorManagementStatus = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RemoteVendorManagementStatus?) content.GetValueForProperty("RemoteVendorManagementStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePropertiesInternal)this).RemoteVendorManagementStatus, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RemoteVendorManagementStatus.CreateFrom); - } - if (content.Contains("SecretRotationStatus")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePropertiesInternal)this).SecretRotationStatus = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretRotationStatus[]) content.GetValueForProperty("SecretRotationStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePropertiesInternal)this).SecretRotationStatus, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.SecretRotationStatusTypeConverter.ConvertFrom)); - } - if (content.Contains("SerialNumber")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePropertiesInternal)this).SerialNumber = (string) content.GetValueForProperty("SerialNumber",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePropertiesInternal)this).SerialNumber, global::System.Convert.ToString); - } - if (content.Contains("StorageApplianceSkuId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePropertiesInternal)this).StorageApplianceSkuId = (string) content.GetValueForProperty("StorageApplianceSkuId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePropertiesInternal)this).StorageApplianceSkuId, global::System.Convert.ToString); - } - if (content.Contains("Version")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePropertiesInternal)this).Version = (string) content.GetValueForProperty("Version",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePropertiesInternal)this).Version, global::System.Convert.ToString); - } - if (content.Contains("AdministratorCredentialsPassword")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePropertiesInternal)this).AdministratorCredentialsPassword = (System.Security.SecureString) content.GetValueForProperty("AdministratorCredentialsPassword",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePropertiesInternal)this).AdministratorCredentialsPassword, (object ss) => (System.Security.SecureString)ss); - } - if (content.Contains("AdministratorCredentialsUsername")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePropertiesInternal)this).AdministratorCredentialsUsername = (string) content.GetValueForProperty("AdministratorCredentialsUsername",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePropertiesInternal)this).AdministratorCredentialsUsername, 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 StorageApplianceProperties(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("AdministratorCredentials")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePropertiesInternal)this).AdministratorCredentials = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministrativeCredentials) content.GetValueForProperty("AdministratorCredentials",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePropertiesInternal)this).AdministratorCredentials, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AdministrativeCredentialsTypeConverter.ConvertFrom); - } - if (content.Contains("Capacity")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePropertiesInternal)this).Capacity = (long?) content.GetValueForProperty("Capacity",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePropertiesInternal)this).Capacity, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("CapacityUsed")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePropertiesInternal)this).CapacityUsed = (long?) content.GetValueForProperty("CapacityUsed",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePropertiesInternal)this).CapacityUsed, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("ClusterId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePropertiesInternal)this).ClusterId = (string) content.GetValueForProperty("ClusterId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePropertiesInternal)this).ClusterId, global::System.Convert.ToString); - } - if (content.Contains("DetailedStatus")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePropertiesInternal)this).DetailedStatus = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.StorageApplianceDetailedStatus?) content.GetValueForProperty("DetailedStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePropertiesInternal)this).DetailedStatus, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.StorageApplianceDetailedStatus.CreateFrom); - } - if (content.Contains("DetailedStatusMessage")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePropertiesInternal)this).DetailedStatusMessage = (string) content.GetValueForProperty("DetailedStatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePropertiesInternal)this).DetailedStatusMessage, global::System.Convert.ToString); - } - if (content.Contains("ManagementIpv4Address")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePropertiesInternal)this).ManagementIpv4Address = (string) content.GetValueForProperty("ManagementIpv4Address",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePropertiesInternal)this).ManagementIpv4Address, global::System.Convert.ToString); - } - if (content.Contains("Manufacturer")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePropertiesInternal)this).Manufacturer = (string) content.GetValueForProperty("Manufacturer",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePropertiesInternal)this).Manufacturer, global::System.Convert.ToString); - } - if (content.Contains("Model")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePropertiesInternal)this).Model = (string) content.GetValueForProperty("Model",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePropertiesInternal)this).Model, global::System.Convert.ToString); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.StorageApplianceProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.StorageApplianceProvisioningState.CreateFrom); - } - if (content.Contains("RackId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePropertiesInternal)this).RackId = (string) content.GetValueForProperty("RackId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePropertiesInternal)this).RackId, global::System.Convert.ToString); - } - if (content.Contains("RackSlot")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePropertiesInternal)this).RackSlot = (long) content.GetValueForProperty("RackSlot",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePropertiesInternal)this).RackSlot, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("RemoteVendorManagementFeature")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePropertiesInternal)this).RemoteVendorManagementFeature = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RemoteVendorManagementFeature?) content.GetValueForProperty("RemoteVendorManagementFeature",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePropertiesInternal)this).RemoteVendorManagementFeature, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RemoteVendorManagementFeature.CreateFrom); - } - if (content.Contains("RemoteVendorManagementStatus")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePropertiesInternal)this).RemoteVendorManagementStatus = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RemoteVendorManagementStatus?) content.GetValueForProperty("RemoteVendorManagementStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePropertiesInternal)this).RemoteVendorManagementStatus, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RemoteVendorManagementStatus.CreateFrom); - } - if (content.Contains("SecretRotationStatus")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePropertiesInternal)this).SecretRotationStatus = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretRotationStatus[]) content.GetValueForProperty("SecretRotationStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePropertiesInternal)this).SecretRotationStatus, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.SecretRotationStatusTypeConverter.ConvertFrom)); - } - if (content.Contains("SerialNumber")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePropertiesInternal)this).SerialNumber = (string) content.GetValueForProperty("SerialNumber",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePropertiesInternal)this).SerialNumber, global::System.Convert.ToString); - } - if (content.Contains("StorageApplianceSkuId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePropertiesInternal)this).StorageApplianceSkuId = (string) content.GetValueForProperty("StorageApplianceSkuId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePropertiesInternal)this).StorageApplianceSkuId, global::System.Convert.ToString); - } - if (content.Contains("Version")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePropertiesInternal)this).Version = (string) content.GetValueForProperty("Version",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePropertiesInternal)this).Version, global::System.Convert.ToString); - } - if (content.Contains("AdministratorCredentialsPassword")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePropertiesInternal)this).AdministratorCredentialsPassword = (System.Security.SecureString) content.GetValueForProperty("AdministratorCredentialsPassword",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePropertiesInternal)this).AdministratorCredentialsPassword, (object ss) => (System.Security.SecureString)ss); - } - if (content.Contains("AdministratorCredentialsUsername")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePropertiesInternal)this).AdministratorCredentialsUsername = (string) content.GetValueForProperty("AdministratorCredentialsUsername",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePropertiesInternal)this).AdministratorCredentialsUsername, 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.NetworkCloud.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(); - } - } - /// StorageApplianceProperties represents the properties of the storage appliance. - [System.ComponentModel.TypeConverter(typeof(StorageAppliancePropertiesTypeConverter))] - public partial interface IStorageApplianceProperties - - { - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/StorageApplianceProperties.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/StorageApplianceProperties.cs deleted file mode 100644 index 95f2397d2e52..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/StorageApplianceProperties.cs +++ /dev/null @@ -1,423 +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.NetworkCloud.Models.Api20250201 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; - - /// StorageApplianceProperties represents the properties of the storage appliance. - public partial class StorageApplianceProperties : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceProperties, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePropertiesInternal - { - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministrativeCredentials _administratorCredentials; - - /// The credentials of the administrative interface on this storage appliance. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministrativeCredentials AdministratorCredentials { get => (this._administratorCredentials = this._administratorCredentials ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AdministrativeCredentials()); set => this._administratorCredentials = value; } - - /// The password of the administrator of the device used during initialization. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public System.Security.SecureString AdministratorCredentialsPassword { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministrativeCredentialsInternal)AdministratorCredentials).Password; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministrativeCredentialsInternal)AdministratorCredentials).Password = value ; } - - /// The username of the administrator of the device used during initialization. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string AdministratorCredentialsUsername { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministrativeCredentialsInternal)AdministratorCredentials).Username; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministrativeCredentialsInternal)AdministratorCredentials).Username = value ; } - - /// Backing field for property. - private long? _capacity; - - /// The total capacity of the storage appliance. Measured in GiB. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public long? Capacity { get => this._capacity; } - - /// Backing field for property. - private long? _capacityUsed; - - /// The amount of storage consumed. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public long? CapacityUsed { get => this._capacityUsed; } - - /// Backing field for property. - private string _clusterId; - - /// - /// The resource ID of the cluster this storage appliance is associated with. Measured in GiB. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string ClusterId { get => this._clusterId; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.StorageApplianceDetailedStatus? _detailedStatus; - - /// The detailed status of the storage appliance. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.StorageApplianceDetailedStatus? DetailedStatus { get => this._detailedStatus; } - - /// Backing field for property. - private string _detailedStatusMessage; - - /// The descriptive message about the current detailed status. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string DetailedStatusMessage { get => this._detailedStatusMessage; } - - /// Backing field for property. - private string _managementIpv4Address; - - /// The endpoint for the management interface of the storage appliance. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string ManagementIpv4Address { get => this._managementIpv4Address; } - - /// Backing field for property. - private string _manufacturer; - - /// The manufacturer of the storage appliance. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string Manufacturer { get => this._manufacturer; } - - /// Internal Acessors for AdministratorCredentials - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministrativeCredentials Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePropertiesInternal.AdministratorCredentials { get => (this._administratorCredentials = this._administratorCredentials ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AdministrativeCredentials()); set { {_administratorCredentials = value;} } } - - /// Internal Acessors for Capacity - long? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePropertiesInternal.Capacity { get => this._capacity; set { {_capacity = value;} } } - - /// Internal Acessors for CapacityUsed - long? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePropertiesInternal.CapacityUsed { get => this._capacityUsed; set { {_capacityUsed = value;} } } - - /// Internal Acessors for ClusterId - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePropertiesInternal.ClusterId { get => this._clusterId; set { {_clusterId = value;} } } - - /// Internal Acessors for DetailedStatus - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.StorageApplianceDetailedStatus? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePropertiesInternal.DetailedStatus { get => this._detailedStatus; set { {_detailedStatus = value;} } } - - /// Internal Acessors for DetailedStatusMessage - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePropertiesInternal.DetailedStatusMessage { get => this._detailedStatusMessage; set { {_detailedStatusMessage = value;} } } - - /// Internal Acessors for ManagementIpv4Address - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePropertiesInternal.ManagementIpv4Address { get => this._managementIpv4Address; set { {_managementIpv4Address = value;} } } - - /// Internal Acessors for Manufacturer - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePropertiesInternal.Manufacturer { get => this._manufacturer; set { {_manufacturer = value;} } } - - /// Internal Acessors for Model - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePropertiesInternal.Model { get => this._model; set { {_model = value;} } } - - /// Internal Acessors for ProvisioningState - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.StorageApplianceProvisioningState? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePropertiesInternal.ProvisioningState { get => this._provisioningState; set { {_provisioningState = value;} } } - - /// Internal Acessors for RemoteVendorManagementFeature - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RemoteVendorManagementFeature? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePropertiesInternal.RemoteVendorManagementFeature { get => this._remoteVendorManagementFeature; set { {_remoteVendorManagementFeature = value;} } } - - /// Internal Acessors for RemoteVendorManagementStatus - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RemoteVendorManagementStatus? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePropertiesInternal.RemoteVendorManagementStatus { get => this._remoteVendorManagementStatus; set { {_remoteVendorManagementStatus = value;} } } - - /// Internal Acessors for SecretRotationStatus - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretRotationStatus[] Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePropertiesInternal.SecretRotationStatus { get => this._secretRotationStatus; set { {_secretRotationStatus = value;} } } - - /// Internal Acessors for Version - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePropertiesInternal.Version { get => this._version; set { {_version = value;} } } - - /// Backing field for property. - private string _model; - - /// The model of the storage appliance. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string Model { get => this._model; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.StorageApplianceProvisioningState? _provisioningState; - - /// The provisioning state of the storage appliance. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.StorageApplianceProvisioningState? ProvisioningState { get => this._provisioningState; } - - /// Backing field for property. - private string _rackId; - - /// The resource ID of the rack where this storage appliance resides. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string RackId { get => this._rackId; set => this._rackId = value; } - - /// Backing field for property. - private long _rackSlot; - - /// The slot the storage appliance is in the rack based on the BOM configuration. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public long RackSlot { get => this._rackSlot; set => this._rackSlot = value; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RemoteVendorManagementFeature? _remoteVendorManagementFeature; - - /// - /// The indicator of whether the storage appliance supports remote vendor management. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RemoteVendorManagementFeature? RemoteVendorManagementFeature { get => this._remoteVendorManagementFeature; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RemoteVendorManagementStatus? _remoteVendorManagementStatus; - - /// - /// The indicator of whether the remote vendor management feature is enabled or disabled, or unsupported if it is an unsupported - /// feature. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RemoteVendorManagementStatus? RemoteVendorManagementStatus { get => this._remoteVendorManagementStatus; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretRotationStatus[] _secretRotationStatus; - - /// The list of statuses that represent secret rotation activity. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretRotationStatus[] SecretRotationStatus { get => this._secretRotationStatus; } - - /// Backing field for property. - private string _serialNumber; - - /// The serial number for the storage appliance. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string SerialNumber { get => this._serialNumber; set => this._serialNumber = value; } - - /// Backing field for property. - private string _storageApplianceSkuId; - - /// The SKU for the storage appliance. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string StorageApplianceSkuId { get => this._storageApplianceSkuId; set => this._storageApplianceSkuId = value; } - - /// Backing field for property. - private string _version; - - /// The version of the storage appliance. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string Version { get => this._version; } - - /// Creates an new instance. - public StorageApplianceProperties() - { - - } - } - /// StorageApplianceProperties represents the properties of the storage appliance. - public partial interface IStorageApplianceProperties : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable - { - /// The password of the administrator of the device used during initialization. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The password of the administrator of the device used during initialization.", - SerializedName = @"password", - PossibleTypes = new [] { typeof(System.Security.SecureString) })] - System.Security.SecureString AdministratorCredentialsPassword { get; set; } - /// The username of the administrator of the device used during initialization. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The username of the administrator of the device used during initialization.", - SerializedName = @"username", - PossibleTypes = new [] { typeof(string) })] - string AdministratorCredentialsUsername { get; set; } - /// The total capacity of the storage appliance. Measured in GiB. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The total capacity of the storage appliance. Measured in GiB.", - SerializedName = @"capacity", - PossibleTypes = new [] { typeof(long) })] - long? Capacity { get; } - /// The amount of storage consumed. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The amount of storage consumed.", - SerializedName = @"capacityUsed", - PossibleTypes = new [] { typeof(long) })] - long? CapacityUsed { get; } - /// - /// The resource ID of the cluster this storage appliance is associated with. Measured in GiB. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The resource ID of the cluster this storage appliance is associated with. Measured in GiB.", - SerializedName = @"clusterId", - PossibleTypes = new [] { typeof(string) })] - string ClusterId { get; } - /// The detailed status of the storage appliance. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The detailed status of the storage appliance.", - SerializedName = @"detailedStatus", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.StorageApplianceDetailedStatus) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.StorageApplianceDetailedStatus? DetailedStatus { get; } - /// The descriptive message about the current detailed status. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The descriptive message about the current detailed status.", - SerializedName = @"detailedStatusMessage", - PossibleTypes = new [] { typeof(string) })] - string DetailedStatusMessage { get; } - /// The endpoint for the management interface of the storage appliance. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The endpoint for the management interface of the storage appliance.", - SerializedName = @"managementIpv4Address", - PossibleTypes = new [] { typeof(string) })] - string ManagementIpv4Address { get; } - /// The manufacturer of the storage appliance. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The manufacturer of the storage appliance.", - SerializedName = @"manufacturer", - PossibleTypes = new [] { typeof(string) })] - string Manufacturer { get; } - /// The model of the storage appliance. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The model of the storage appliance.", - SerializedName = @"model", - PossibleTypes = new [] { typeof(string) })] - string Model { get; } - /// The provisioning state of the storage appliance. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The provisioning state of the storage appliance.", - SerializedName = @"provisioningState", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.StorageApplianceProvisioningState) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.StorageApplianceProvisioningState? ProvisioningState { get; } - /// The resource ID of the rack where this storage appliance resides. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The resource ID of the rack where this storage appliance resides.", - SerializedName = @"rackId", - PossibleTypes = new [] { typeof(string) })] - string RackId { get; set; } - /// The slot the storage appliance is in the rack based on the BOM configuration. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The slot the storage appliance is in the rack based on the BOM configuration.", - SerializedName = @"rackSlot", - PossibleTypes = new [] { typeof(long) })] - long RackSlot { get; set; } - /// - /// The indicator of whether the storage appliance supports remote vendor management. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The indicator of whether the storage appliance supports remote vendor management.", - SerializedName = @"remoteVendorManagementFeature", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RemoteVendorManagementFeature) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RemoteVendorManagementFeature? RemoteVendorManagementFeature { get; } - /// - /// The indicator of whether the remote vendor management feature is enabled or disabled, or unsupported if it is an unsupported - /// feature. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The indicator of whether the remote vendor management feature is enabled or disabled, or unsupported if it is an unsupported feature.", - SerializedName = @"remoteVendorManagementStatus", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RemoteVendorManagementStatus) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RemoteVendorManagementStatus? RemoteVendorManagementStatus { get; } - /// The list of statuses that represent secret rotation activity. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The list of statuses that represent secret rotation activity.", - SerializedName = @"secretRotationStatus", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretRotationStatus) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretRotationStatus[] SecretRotationStatus { get; } - /// The serial number for the storage appliance. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The serial number for the storage appliance.", - SerializedName = @"serialNumber", - PossibleTypes = new [] { typeof(string) })] - string SerialNumber { get; set; } - /// The SKU for the storage appliance. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The SKU for the storage appliance.", - SerializedName = @"storageApplianceSkuId", - PossibleTypes = new [] { typeof(string) })] - string StorageApplianceSkuId { get; set; } - /// The version of the storage appliance. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The version of the storage appliance.", - SerializedName = @"version", - PossibleTypes = new [] { typeof(string) })] - string Version { get; } - - } - /// StorageApplianceProperties represents the properties of the storage appliance. - internal partial interface IStorageAppliancePropertiesInternal - - { - /// The credentials of the administrative interface on this storage appliance. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministrativeCredentials AdministratorCredentials { get; set; } - /// The password of the administrator of the device used during initialization. - System.Security.SecureString AdministratorCredentialsPassword { get; set; } - /// The username of the administrator of the device used during initialization. - string AdministratorCredentialsUsername { get; set; } - /// The total capacity of the storage appliance. Measured in GiB. - long? Capacity { get; set; } - /// The amount of storage consumed. - long? CapacityUsed { get; set; } - /// - /// The resource ID of the cluster this storage appliance is associated with. Measured in GiB. - /// - string ClusterId { get; set; } - /// The detailed status of the storage appliance. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.StorageApplianceDetailedStatus? DetailedStatus { get; set; } - /// The descriptive message about the current detailed status. - string DetailedStatusMessage { get; set; } - /// The endpoint for the management interface of the storage appliance. - string ManagementIpv4Address { get; set; } - /// The manufacturer of the storage appliance. - string Manufacturer { get; set; } - /// The model of the storage appliance. - string Model { get; set; } - /// The provisioning state of the storage appliance. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.StorageApplianceProvisioningState? ProvisioningState { get; set; } - /// The resource ID of the rack where this storage appliance resides. - string RackId { get; set; } - /// The slot the storage appliance is in the rack based on the BOM configuration. - long RackSlot { get; set; } - /// - /// The indicator of whether the storage appliance supports remote vendor management. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RemoteVendorManagementFeature? RemoteVendorManagementFeature { get; set; } - /// - /// The indicator of whether the remote vendor management feature is enabled or disabled, or unsupported if it is an unsupported - /// feature. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RemoteVendorManagementStatus? RemoteVendorManagementStatus { get; set; } - /// The list of statuses that represent secret rotation activity. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretRotationStatus[] SecretRotationStatus { get; set; } - /// The serial number for the storage appliance. - string SerialNumber { get; set; } - /// The SKU for the storage appliance. - string StorageApplianceSkuId { get; set; } - /// The version of the storage appliance. - string Version { get; set; } - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/StorageApplianceSkuSlot.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/StorageApplianceSkuSlot.PowerShell.cs deleted file mode 100644 index cdd5bdbe90d5..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/StorageApplianceSkuSlot.PowerShell.cs +++ /dev/null @@ -1,192 +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.NetworkCloud.Models.Api20250201 -{ - using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; - - /// - /// StorageApplianceSkuSlot represents the single SKU and rack slot associated with the storage appliance. - /// - [System.ComponentModel.TypeConverter(typeof(StorageApplianceSkuSlotTypeConverter))] - public partial class StorageApplianceSkuSlot - { - - /// - /// 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.NetworkCloud.Models.Api20250201.IStorageApplianceSkuSlot DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new StorageApplianceSkuSlot(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.NetworkCloud.Models.Api20250201.IStorageApplianceSkuSlot DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new StorageApplianceSkuSlot(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.NetworkCloud.Models.Api20250201.IStorageApplianceSkuSlot FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal StorageApplianceSkuSlot(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.NetworkCloud.Models.Api20250201.IStorageApplianceSkuSlotInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceSkuProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceSkuSlotInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.StorageApplianceSkuPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("RackSlot")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceSkuSlotInternal)this).RackSlot = (long?) content.GetValueForProperty("RackSlot",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceSkuSlotInternal)this).RackSlot, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("CapacityGb")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceSkuSlotInternal)this).CapacityGb = (long?) content.GetValueForProperty("CapacityGb",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceSkuSlotInternal)this).CapacityGb, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("Model")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceSkuSlotInternal)this).Model = (string) content.GetValueForProperty("Model",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceSkuSlotInternal)this).Model, 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 StorageApplianceSkuSlot(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.NetworkCloud.Models.Api20250201.IStorageApplianceSkuSlotInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceSkuProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceSkuSlotInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.StorageApplianceSkuPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("RackSlot")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceSkuSlotInternal)this).RackSlot = (long?) content.GetValueForProperty("RackSlot",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceSkuSlotInternal)this).RackSlot, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("CapacityGb")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceSkuSlotInternal)this).CapacityGb = (long?) content.GetValueForProperty("CapacityGb",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceSkuSlotInternal)this).CapacityGb, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("Model")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceSkuSlotInternal)this).Model = (string) content.GetValueForProperty("Model",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceSkuSlotInternal)this).Model, 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.NetworkCloud.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(); - } - } - /// StorageApplianceSkuSlot represents the single SKU and rack slot associated with the storage appliance. - [System.ComponentModel.TypeConverter(typeof(StorageApplianceSkuSlotTypeConverter))] - public partial interface IStorageApplianceSkuSlot - - { - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/StorageApplianceSkuSlot.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/StorageApplianceSkuSlot.cs deleted file mode 100644 index 3fd43e6856f0..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/StorageApplianceSkuSlot.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.NetworkCloud.Models.Api20250201 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; - - /// - /// StorageApplianceSkuSlot represents the single SKU and rack slot associated with the storage appliance. - /// - public partial class StorageApplianceSkuSlot : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceSkuSlot, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceSkuSlotInternal - { - - /// The maximum capacity of the storage appliance. Measured in gibibytes. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public long? CapacityGb { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceSkuPropertiesInternal)Property).CapacityGb; } - - /// Internal Acessors for CapacityGb - long? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceSkuSlotInternal.CapacityGb { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceSkuPropertiesInternal)Property).CapacityGb; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceSkuPropertiesInternal)Property).CapacityGb = value; } - - /// Internal Acessors for Model - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceSkuSlotInternal.Model { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceSkuPropertiesInternal)Property).Model; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceSkuPropertiesInternal)Property).Model = value; } - - /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceSkuProperties Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceSkuSlotInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.StorageApplianceSkuProperties()); set { {_property = value;} } } - - /// Internal Acessors for RackSlot - long? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceSkuSlotInternal.RackSlot { get => this._rackSlot; set { {_rackSlot = value;} } } - - /// The model of the storage appliance. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string Model { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceSkuPropertiesInternal)Property).Model; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceSkuProperties _property; - - /// The list of the resource properties. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceSkuProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.StorageApplianceSkuProperties()); set => this._property = value; } - - /// Backing field for property. - private long? _rackSlot; - - /// The position in the rack for the storage appliance. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public long? RackSlot { get => this._rackSlot; } - - /// Creates an new instance. - public StorageApplianceSkuSlot() - { - - } - } - /// StorageApplianceSkuSlot represents the single SKU and rack slot associated with the storage appliance. - public partial interface IStorageApplianceSkuSlot : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable - { - /// The maximum capacity of the storage appliance. Measured in gibibytes. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The maximum capacity of the storage appliance. Measured in gibibytes.", - SerializedName = @"capacityGB", - PossibleTypes = new [] { typeof(long) })] - long? CapacityGb { get; } - /// The model of the storage appliance. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The model of the storage appliance.", - SerializedName = @"model", - PossibleTypes = new [] { typeof(string) })] - string Model { get; } - /// The position in the rack for the storage appliance. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The position in the rack for the storage appliance.", - SerializedName = @"rackSlot", - PossibleTypes = new [] { typeof(long) })] - long? RackSlot { get; } - - } - /// StorageApplianceSkuSlot represents the single SKU and rack slot associated with the storage appliance. - internal partial interface IStorageApplianceSkuSlotInternal - - { - /// The maximum capacity of the storage appliance. Measured in gibibytes. - long? CapacityGb { get; set; } - /// The model of the storage appliance. - string Model { get; set; } - /// The list of the resource properties. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceSkuProperties Property { get; set; } - /// The position in the rack for the storage appliance. - long? RackSlot { get; set; } - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/StorageProfile.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/StorageProfile.PowerShell.cs deleted file mode 100644 index 0cfa84a1d2f9..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/StorageProfile.PowerShell.cs +++ /dev/null @@ -1,196 +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.NetworkCloud.Models.Api20250201 -{ - using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; - - /// StorageProfile represents information about a disk. - [System.ComponentModel.TypeConverter(typeof(StorageProfileTypeConverter))] - public partial class StorageProfile - { - - /// - /// 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.NetworkCloud.Models.Api20250201.IStorageProfile DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new StorageProfile(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.NetworkCloud.Models.Api20250201.IStorageProfile DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new StorageProfile(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.NetworkCloud.Models.Api20250201.IStorageProfile FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal StorageProfile(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("OSDisk")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageProfileInternal)this).OSDisk = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOSDisk) content.GetValueForProperty("OSDisk",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageProfileInternal)this).OSDisk, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.OSDiskTypeConverter.ConvertFrom); - } - if (content.Contains("VolumeAttachment")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageProfileInternal)this).VolumeAttachment = (string[]) content.GetValueForProperty("VolumeAttachment",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageProfileInternal)this).VolumeAttachment, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("OSDiskCreateOption")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageProfileInternal)this).OSDiskCreateOption = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.OSDiskCreateOption?) content.GetValueForProperty("OSDiskCreateOption",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageProfileInternal)this).OSDiskCreateOption, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.OSDiskCreateOption.CreateFrom); - } - if (content.Contains("OSDiskDeleteOption")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageProfileInternal)this).OSDiskDeleteOption = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.OSDiskDeleteOption?) content.GetValueForProperty("OSDiskDeleteOption",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageProfileInternal)this).OSDiskDeleteOption, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.OSDiskDeleteOption.CreateFrom); - } - if (content.Contains("OSDiskSizeGb")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageProfileInternal)this).OSDiskSizeGb = (long) content.GetValueForProperty("OSDiskSizeGb",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageProfileInternal)this).OSDiskSizeGb, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal StorageProfile(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("OSDisk")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageProfileInternal)this).OSDisk = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOSDisk) content.GetValueForProperty("OSDisk",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageProfileInternal)this).OSDisk, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.OSDiskTypeConverter.ConvertFrom); - } - if (content.Contains("VolumeAttachment")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageProfileInternal)this).VolumeAttachment = (string[]) content.GetValueForProperty("VolumeAttachment",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageProfileInternal)this).VolumeAttachment, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("OSDiskCreateOption")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageProfileInternal)this).OSDiskCreateOption = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.OSDiskCreateOption?) content.GetValueForProperty("OSDiskCreateOption",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageProfileInternal)this).OSDiskCreateOption, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.OSDiskCreateOption.CreateFrom); - } - if (content.Contains("OSDiskDeleteOption")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageProfileInternal)this).OSDiskDeleteOption = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.OSDiskDeleteOption?) content.GetValueForProperty("OSDiskDeleteOption",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageProfileInternal)this).OSDiskDeleteOption, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.OSDiskDeleteOption.CreateFrom); - } - if (content.Contains("OSDiskSizeGb")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageProfileInternal)this).OSDiskSizeGb = (long) content.GetValueForProperty("OSDiskSizeGb",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageProfileInternal)this).OSDiskSizeGb, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - 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.NetworkCloud.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(); - } - } - /// StorageProfile represents information about a disk. - [System.ComponentModel.TypeConverter(typeof(StorageProfileTypeConverter))] - public partial interface IStorageProfile - - { - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/StorageProfile.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/StorageProfile.cs deleted file mode 100644 index 8bcd9137ac85..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/StorageProfile.cs +++ /dev/null @@ -1,117 +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.NetworkCloud.Models.Api20250201 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; - - /// StorageProfile represents information about a disk. - public partial class StorageProfile : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageProfile, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageProfileInternal - { - - /// Internal Acessors for OSDisk - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOSDisk Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageProfileInternal.OSDisk { get => (this._oSDisk = this._oSDisk ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.OSDisk()); set { {_oSDisk = value;} } } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOSDisk _oSDisk; - - /// The disk to use with this virtual machine. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOSDisk OSDisk { get => (this._oSDisk = this._oSDisk ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.OSDisk()); set => this._oSDisk = value; } - - /// The strategy for creating the OS disk. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.OSDiskCreateOption? OSDiskCreateOption { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOSDiskInternal)OSDisk).CreateOption; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOSDiskInternal)OSDisk).CreateOption = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.OSDiskCreateOption)""); } - - /// The strategy for deleting the OS disk. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.OSDiskDeleteOption? OSDiskDeleteOption { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOSDiskInternal)OSDisk).DeleteOption; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOSDiskInternal)OSDisk).DeleteOption = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.OSDiskDeleteOption)""); } - - /// - /// The size of the disk. Required if the createOption is Ephemeral. Allocations are measured in gibibytes. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public long OSDiskSizeGb { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOSDiskInternal)OSDisk).DiskSizeGb; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOSDiskInternal)OSDisk).DiskSizeGb = value ; } - - /// Backing field for property. - private string[] _volumeAttachment; - - /// - /// The resource IDs of volumes that are requested to be attached to the virtual machine. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string[] VolumeAttachment { get => this._volumeAttachment; set => this._volumeAttachment = value; } - - /// Creates an new instance. - public StorageProfile() - { - - } - } - /// StorageProfile represents information about a disk. - public partial interface IStorageProfile : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable - { - /// The strategy for creating the OS disk. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The strategy for creating the OS disk.", - SerializedName = @"createOption", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.OSDiskCreateOption) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.OSDiskCreateOption? OSDiskCreateOption { get; set; } - /// The strategy for deleting the OS disk. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The strategy for deleting the OS disk.", - SerializedName = @"deleteOption", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.OSDiskDeleteOption) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.OSDiskDeleteOption? OSDiskDeleteOption { get; set; } - /// - /// The size of the disk. Required if the createOption is Ephemeral. Allocations are measured in gibibytes. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The size of the disk. Required if the createOption is Ephemeral. Allocations are measured in gibibytes.", - SerializedName = @"diskSizeGB", - PossibleTypes = new [] { typeof(long) })] - long OSDiskSizeGb { get; set; } - /// - /// The resource IDs of volumes that are requested to be attached to the virtual machine. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The resource IDs of volumes that are requested to be attached to the virtual machine.", - SerializedName = @"volumeAttachments", - PossibleTypes = new [] { typeof(string) })] - string[] VolumeAttachment { get; set; } - - } - /// StorageProfile represents information about a disk. - internal partial interface IStorageProfileInternal - - { - /// The disk to use with this virtual machine. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOSDisk OSDisk { get; set; } - /// The strategy for creating the OS disk. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.OSDiskCreateOption? OSDiskCreateOption { get; set; } - /// The strategy for deleting the OS disk. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.OSDiskDeleteOption? OSDiskDeleteOption { get; set; } - /// - /// The size of the disk. Required if the createOption is Ephemeral. Allocations are measured in gibibytes. - /// - long OSDiskSizeGb { get; set; } - /// - /// The resource IDs of volumes that are requested to be attached to the virtual machine. - /// - string[] VolumeAttachment { get; set; } - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/TagsParameter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/TagsParameter.cs deleted file mode 100644 index df90da567c38..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/TagsParameter.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.NetworkCloud.Models.Api20250201 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; - - /// TagsParameter represents the resource tags. - public partial class TagsParameter : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITagsParameter, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITagsParameterInternal - { - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITagsParameterTags _tag; - - /// The Azure resource tags that will replace the existing ones. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITagsParameterTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.TagsParameterTags()); set => this._tag = value; } - - /// Creates an new instance. - public TagsParameter() - { - - } - } - /// TagsParameter represents the resource tags. - public partial interface ITagsParameter : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable - { - /// The Azure resource tags that will replace the existing ones. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The Azure resource tags that will replace the existing ones.", - SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITagsParameterTags) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITagsParameterTags Tag { get; set; } - - } - /// TagsParameter represents the resource tags. - internal partial interface ITagsParameterInternal - - { - /// The Azure resource tags that will replace the existing ones. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITagsParameterTags Tag { get; set; } - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/TrunkedNetwork.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/TrunkedNetwork.PowerShell.cs deleted file mode 100644 index 8f50c0d8e17e..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/TrunkedNetwork.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.NetworkCloud.Models.Api20250201 -{ - using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; - - /// - /// TrunkedNetwork represents a network that utilizes multiple isolation domains and specified VLANs to create a trunked network. - /// - [System.ComponentModel.TypeConverter(typeof(TrunkedNetworkTypeConverter))] - public partial class TrunkedNetwork - { - - /// - /// 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.NetworkCloud.Models.Api20250201.ITrunkedNetwork DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new TrunkedNetwork(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.NetworkCloud.Models.Api20250201.ITrunkedNetwork DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new TrunkedNetwork(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.NetworkCloud.Models.Api20250201.ITrunkedNetwork FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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 TrunkedNetwork(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("ExtendedLocation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkInternal)this).ExtendedLocation = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocation) content.GetValueForProperty("ExtendedLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkInternal)this).ExtendedLocation, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ExtendedLocationTypeConverter.ConvertFrom); - } - if (content.Contains("Property")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.TrunkedNetworkPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Etag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkInternal)this).Etag, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)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("SystemDataCreatedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataLastModifiedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("SystemData")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.SystemDataTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Type, global::System.Convert.ToString); - } - if (content.Contains("Tag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.TrackedResourceTagsTypeConverter.ConvertFrom); - } - if (content.Contains("Location")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); - } - if (content.Contains("ExtendedLocationName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkInternal)this).ExtendedLocationName = (string) content.GetValueForProperty("ExtendedLocationName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkInternal)this).ExtendedLocationName, global::System.Convert.ToString); - } - if (content.Contains("ExtendedLocationType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkInternal)this).ExtendedLocationType = (string) content.GetValueForProperty("ExtendedLocationType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkInternal)this).ExtendedLocationType, global::System.Convert.ToString); - } - if (content.Contains("AssociatedResourceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkInternal)this).AssociatedResourceId = (string[]) content.GetValueForProperty("AssociatedResourceId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkInternal)this).AssociatedResourceId, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("ClusterId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkInternal)this).ClusterId = (string) content.GetValueForProperty("ClusterId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkInternal)this).ClusterId, global::System.Convert.ToString); - } - if (content.Contains("DetailedStatus")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkInternal)this).DetailedStatus = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.TrunkedNetworkDetailedStatus?) content.GetValueForProperty("DetailedStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkInternal)this).DetailedStatus, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.TrunkedNetworkDetailedStatus.CreateFrom); - } - if (content.Contains("DetailedStatusMessage")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkInternal)this).DetailedStatusMessage = (string) content.GetValueForProperty("DetailedStatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkInternal)this).DetailedStatusMessage, global::System.Convert.ToString); - } - if (content.Contains("HybridAksClustersAssociatedId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkInternal)this).HybridAksClustersAssociatedId = (string[]) content.GetValueForProperty("HybridAksClustersAssociatedId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkInternal)this).HybridAksClustersAssociatedId, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("HybridAksPluginType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkInternal)this).HybridAksPluginType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HybridAksPluginType?) content.GetValueForProperty("HybridAksPluginType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkInternal)this).HybridAksPluginType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HybridAksPluginType.CreateFrom); - } - if (content.Contains("InterfaceName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkInternal)this).InterfaceName = (string) content.GetValueForProperty("InterfaceName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkInternal)this).InterfaceName, global::System.Convert.ToString); - } - if (content.Contains("IsolationDomainId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkInternal)this).IsolationDomainId = (string[]) content.GetValueForProperty("IsolationDomainId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkInternal)this).IsolationDomainId, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.TrunkedNetworkProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.TrunkedNetworkProvisioningState.CreateFrom); - } - if (content.Contains("VirtualMachinesAssociatedId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkInternal)this).VirtualMachinesAssociatedId = (string[]) content.GetValueForProperty("VirtualMachinesAssociatedId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkInternal)this).VirtualMachinesAssociatedId, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("Vlan")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkInternal)this).Vlan = (long[]) content.GetValueForProperty("Vlan",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkInternal)this).Vlan, __y => TypeConverterExtensions.SelectToArray(__y, (__w)=> (long) global::System.Convert.ChangeType(__w, typeof(long)))); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal TrunkedNetwork(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("ExtendedLocation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkInternal)this).ExtendedLocation = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocation) content.GetValueForProperty("ExtendedLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkInternal)this).ExtendedLocation, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ExtendedLocationTypeConverter.ConvertFrom); - } - if (content.Contains("Property")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.TrunkedNetworkPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Etag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkInternal)this).Etag, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)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("SystemDataCreatedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataLastModifiedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("SystemData")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.SystemDataTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Type, global::System.Convert.ToString); - } - if (content.Contains("Tag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.TrackedResourceTagsTypeConverter.ConvertFrom); - } - if (content.Contains("Location")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); - } - if (content.Contains("ExtendedLocationName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkInternal)this).ExtendedLocationName = (string) content.GetValueForProperty("ExtendedLocationName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkInternal)this).ExtendedLocationName, global::System.Convert.ToString); - } - if (content.Contains("ExtendedLocationType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkInternal)this).ExtendedLocationType = (string) content.GetValueForProperty("ExtendedLocationType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkInternal)this).ExtendedLocationType, global::System.Convert.ToString); - } - if (content.Contains("AssociatedResourceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkInternal)this).AssociatedResourceId = (string[]) content.GetValueForProperty("AssociatedResourceId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkInternal)this).AssociatedResourceId, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("ClusterId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkInternal)this).ClusterId = (string) content.GetValueForProperty("ClusterId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkInternal)this).ClusterId, global::System.Convert.ToString); - } - if (content.Contains("DetailedStatus")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkInternal)this).DetailedStatus = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.TrunkedNetworkDetailedStatus?) content.GetValueForProperty("DetailedStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkInternal)this).DetailedStatus, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.TrunkedNetworkDetailedStatus.CreateFrom); - } - if (content.Contains("DetailedStatusMessage")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkInternal)this).DetailedStatusMessage = (string) content.GetValueForProperty("DetailedStatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkInternal)this).DetailedStatusMessage, global::System.Convert.ToString); - } - if (content.Contains("HybridAksClustersAssociatedId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkInternal)this).HybridAksClustersAssociatedId = (string[]) content.GetValueForProperty("HybridAksClustersAssociatedId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkInternal)this).HybridAksClustersAssociatedId, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("HybridAksPluginType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkInternal)this).HybridAksPluginType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HybridAksPluginType?) content.GetValueForProperty("HybridAksPluginType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkInternal)this).HybridAksPluginType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HybridAksPluginType.CreateFrom); - } - if (content.Contains("InterfaceName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkInternal)this).InterfaceName = (string) content.GetValueForProperty("InterfaceName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkInternal)this).InterfaceName, global::System.Convert.ToString); - } - if (content.Contains("IsolationDomainId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkInternal)this).IsolationDomainId = (string[]) content.GetValueForProperty("IsolationDomainId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkInternal)this).IsolationDomainId, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.TrunkedNetworkProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.TrunkedNetworkProvisioningState.CreateFrom); - } - if (content.Contains("VirtualMachinesAssociatedId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkInternal)this).VirtualMachinesAssociatedId = (string[]) content.GetValueForProperty("VirtualMachinesAssociatedId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkInternal)this).VirtualMachinesAssociatedId, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("Vlan")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkInternal)this).Vlan = (long[]) content.GetValueForProperty("Vlan",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkInternal)this).Vlan, __y => TypeConverterExtensions.SelectToArray(__y, (__w)=> (long) global::System.Convert.ChangeType(__w, typeof(long)))); - } - AfterDeserializePSObject(content); - } - } - /// TrunkedNetwork represents a network that utilizes multiple isolation domains and specified VLANs to create a trunked network. - [System.ComponentModel.TypeConverter(typeof(TrunkedNetworkTypeConverter))] - public partial interface ITrunkedNetwork - - { - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/TrunkedNetwork.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/TrunkedNetwork.cs deleted file mode 100644 index 14d6340e3790..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/TrunkedNetwork.cs +++ /dev/null @@ -1,429 +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.NetworkCloud.Models.Api20250201 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; - - /// - /// TrunkedNetwork represents a network that utilizes multiple isolation domains and specified VLANs to create a trunked network. - /// - public partial class TrunkedNetwork : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetwork, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkInternal, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IValidates - { - /// - /// Backing field for Inherited model - /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResource __trackedResource = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.TrackedResource(); - - /// - /// The list of resource IDs for the other Microsoft.NetworkCloud resources that have attached this network. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string[] AssociatedResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkPropertiesInternal)Property).AssociatedResourceId; } - - /// - /// The resource ID of the Network Cloud cluster this trunked network is associated with. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string ClusterId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkPropertiesInternal)Property).ClusterId; } - - /// The more detailed status of the trunked network. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.TrunkedNetworkDetailedStatus? DetailedStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkPropertiesInternal)Property).DetailedStatus; } - - /// The descriptive message about the current detailed status. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string DetailedStatusMessage { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkPropertiesInternal)Property).DetailedStatusMessage; } - - /// Backing field for property. - private string _etag; - - /// Resource ETag. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string Etag { get => this._etag; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocation _extendedLocation; - - /// The extended location of the cluster associated with the resource. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocation ExtendedLocation { get => (this._extendedLocation = this._extendedLocation ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ExtendedLocation()); set => this._extendedLocation = value; } - - /// The resource ID of the extended location on which the resource will be created. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string ExtendedLocationName { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocationInternal)ExtendedLocation).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocationInternal)ExtendedLocation).Name = value ; } - - /// The extended location type, for example, CustomLocation. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string ExtendedLocationType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocationInternal)ExtendedLocation).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocationInternal)ExtendedLocation).Type = value ; } - - /// - /// Field Deprecated. These fields will be empty/omitted. The list of Hybrid AKS cluster resource IDs that are associated - /// with this trunked network. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string[] HybridAksClustersAssociatedId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkPropertiesInternal)Property).HybridAksClustersAssociatedId; } - - /// - /// Field Deprecated. The field was previously optional, now it will have no defined behavior and will be ignored. The network - /// plugin type for Hybrid AKS. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HybridAksPluginType? HybridAksPluginType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkPropertiesInternal)Property).HybridAksPluginType; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkPropertiesInternal)Property).HybridAksPluginType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HybridAksPluginType)""); } - - /// - /// Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).Id; } - - /// - /// The default interface name for this trunked network in the virtual machine. This name can be overridden by the name supplied - /// in the network attachment configuration of that virtual machine. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string InterfaceName { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkPropertiesInternal)Property).InterfaceName; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkPropertiesInternal)Property).InterfaceName = value ?? null; } - - /// - /// The list of resource IDs representing the Network Fabric isolation domains. It can be any combination of l2IsolationDomain - /// and l3IsolationDomain resources. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string[] IsolationDomainId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkPropertiesInternal)Property).IsolationDomainId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkPropertiesInternal)Property).IsolationDomainId = value ; } - - /// The geo-location where the resource lives - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)__trackedResource).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)__trackedResource).Location = value ; } - - /// Internal Acessors for AssociatedResourceId - string[] Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkInternal.AssociatedResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkPropertiesInternal)Property).AssociatedResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkPropertiesInternal)Property).AssociatedResourceId = value; } - - /// Internal Acessors for ClusterId - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkInternal.ClusterId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkPropertiesInternal)Property).ClusterId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkPropertiesInternal)Property).ClusterId = value; } - - /// Internal Acessors for DetailedStatus - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.TrunkedNetworkDetailedStatus? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkInternal.DetailedStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkPropertiesInternal)Property).DetailedStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkPropertiesInternal)Property).DetailedStatus = value; } - - /// Internal Acessors for DetailedStatusMessage - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkInternal.DetailedStatusMessage { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkPropertiesInternal)Property).DetailedStatusMessage; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkPropertiesInternal)Property).DetailedStatusMessage = value; } - - /// Internal Acessors for Etag - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkInternal.Etag { get => this._etag; set { {_etag = value;} } } - - /// Internal Acessors for ExtendedLocation - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocation Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkInternal.ExtendedLocation { get => (this._extendedLocation = this._extendedLocation ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ExtendedLocation()); set { {_extendedLocation = value;} } } - - /// Internal Acessors for HybridAksClustersAssociatedId - string[] Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkInternal.HybridAksClustersAssociatedId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkPropertiesInternal)Property).HybridAksClustersAssociatedId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkPropertiesInternal)Property).HybridAksClustersAssociatedId = value; } - - /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkProperties Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.TrunkedNetworkProperties()); set { {_property = value;} } } - - /// Internal Acessors for ProvisioningState - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.TrunkedNetworkProvisioningState? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkPropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkPropertiesInternal)Property).ProvisioningState = value; } - - /// Internal Acessors for VirtualMachinesAssociatedId - string[] Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkInternal.VirtualMachinesAssociatedId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkPropertiesInternal)Property).VirtualMachinesAssociatedId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkPropertiesInternal)Property).VirtualMachinesAssociatedId = value; } - - /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).Id = value; } - - /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).Name = value; } - - /// Internal Acessors for SystemData - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ISystemData Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal.SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemData; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemData = value; } - - /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).Type = value; } - - /// The name of the resource - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).Name; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkProperties _property; - - /// The list of the resource properties. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.TrunkedNetworkProperties()); set => this._property = value; } - - /// The provisioning state of the trunked network. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.TrunkedNetworkProvisioningState? ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkPropertiesInternal)Property).ProvisioningState; } - - /// Gets the resource group name - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string ResourceGroupName { get => (new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Success ? new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Groups["resourceGroupName"].Value : null); } - - /// - /// Azure Resource Manager metadata containing createdBy and modifiedBy information. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ISystemData SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemData; } - - /// The timestamp of resource creation (UTC). - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataCreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataCreatedAt = value ?? default(global::System.DateTime); } - - /// The identity that created the resource. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataCreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataCreatedBy = value ?? null; } - - /// The type of identity that created the resource. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType? SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataCreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataCreatedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType)""); } - - /// The timestamp of resource last modification (UTC) - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataLastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataLastModifiedAt = value ?? default(global::System.DateTime); } - - /// The identity that last modified the resource. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataLastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataLastModifiedBy = value ?? null; } - - /// The type of identity that last modified the resource. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType? SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataLastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataLastModifiedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType)""); } - - /// Resource tags. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)__trackedResource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.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.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).Type; } - - /// - /// Field Deprecated. These fields will be empty/omitted. The list of virtual machine resource IDs, excluding any Hybrid AKS - /// virtual machines, that are currently using this trunked network. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string[] VirtualMachinesAssociatedId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkPropertiesInternal)Property).VirtualMachinesAssociatedId; } - - /// The list of vlans that are selected from the isolation domains for trunking. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public long[] Vlan { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkPropertiesInternal)Property).Vlan; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkPropertiesInternal)Property).Vlan = value ; } - - /// Creates an new instance. - public TrunkedNetwork() - { - - } - - /// Validates that this object meets the validation criteria. - /// an instance that will receive validation - /// events. - /// - /// A that will be complete when validation is completed. - /// - public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) - { - await eventListener.AssertNotNull(nameof(__trackedResource), __trackedResource); - await eventListener.AssertObjectIsValid(nameof(__trackedResource), __trackedResource); - } - } - /// TrunkedNetwork represents a network that utilizes multiple isolation domains and specified VLANs to create a trunked network. - public partial interface ITrunkedNetwork : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResource - { - /// - /// The list of resource IDs for the other Microsoft.NetworkCloud resources that have attached this network. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The list of resource IDs for the other Microsoft.NetworkCloud resources that have attached this network.", - SerializedName = @"associatedResourceIds", - PossibleTypes = new [] { typeof(string) })] - string[] AssociatedResourceId { get; } - /// - /// The resource ID of the Network Cloud cluster this trunked network is associated with. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The resource ID of the Network Cloud cluster this trunked network is associated with.", - SerializedName = @"clusterId", - PossibleTypes = new [] { typeof(string) })] - string ClusterId { get; } - /// The more detailed status of the trunked network. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The more detailed status of the trunked network.", - SerializedName = @"detailedStatus", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.TrunkedNetworkDetailedStatus) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.TrunkedNetworkDetailedStatus? DetailedStatus { get; } - /// The descriptive message about the current detailed status. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The descriptive message about the current detailed status.", - SerializedName = @"detailedStatusMessage", - PossibleTypes = new [] { typeof(string) })] - string DetailedStatusMessage { get; } - /// Resource ETag. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"Resource ETag.", - SerializedName = @"etag", - PossibleTypes = new [] { typeof(string) })] - string Etag { get; } - /// The resource ID of the extended location on which the resource will be created. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The resource ID of the extended location on which the resource will be created.", - SerializedName = @"name", - PossibleTypes = new [] { typeof(string) })] - string ExtendedLocationName { get; set; } - /// The extended location type, for example, CustomLocation. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The extended location type, for example, CustomLocation.", - SerializedName = @"type", - PossibleTypes = new [] { typeof(string) })] - string ExtendedLocationType { get; set; } - /// - /// Field Deprecated. These fields will be empty/omitted. The list of Hybrid AKS cluster resource IDs that are associated - /// with this trunked network. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"Field Deprecated. These fields will be empty/omitted. The list of Hybrid AKS cluster resource IDs that are associated with this trunked network.", - SerializedName = @"hybridAksClustersAssociatedIds", - PossibleTypes = new [] { typeof(string) })] - string[] HybridAksClustersAssociatedId { get; } - /// - /// Field Deprecated. The field was previously optional, now it will have no defined behavior and will be ignored. The network - /// plugin type for Hybrid AKS. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Field Deprecated. The field was previously optional, now it will have no defined behavior and will be ignored. The network plugin type for Hybrid AKS.", - SerializedName = @"hybridAksPluginType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HybridAksPluginType) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HybridAksPluginType? HybridAksPluginType { get; set; } - /// - /// The default interface name for this trunked network in the virtual machine. This name can be overridden by the name supplied - /// in the network attachment configuration of that virtual machine. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The default interface name for this trunked network in the virtual machine. This name can be overridden by the name supplied in the network attachment configuration of that virtual machine.", - SerializedName = @"interfaceName", - PossibleTypes = new [] { typeof(string) })] - string InterfaceName { get; set; } - /// - /// The list of resource IDs representing the Network Fabric isolation domains. It can be any combination of l2IsolationDomain - /// and l3IsolationDomain resources. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The list of resource IDs representing the Network Fabric isolation domains. It can be any combination of l2IsolationDomain and l3IsolationDomain resources.", - SerializedName = @"isolationDomainIds", - PossibleTypes = new [] { typeof(string) })] - string[] IsolationDomainId { get; set; } - /// The provisioning state of the trunked network. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The provisioning state of the trunked network.", - SerializedName = @"provisioningState", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.TrunkedNetworkProvisioningState) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.TrunkedNetworkProvisioningState? ProvisioningState { get; } - /// - /// Field Deprecated. These fields will be empty/omitted. The list of virtual machine resource IDs, excluding any Hybrid AKS - /// virtual machines, that are currently using this trunked network. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"Field Deprecated. These fields will be empty/omitted. The list of virtual machine resource IDs, excluding any Hybrid AKS virtual machines, that are currently using this trunked network.", - SerializedName = @"virtualMachinesAssociatedIds", - PossibleTypes = new [] { typeof(string) })] - string[] VirtualMachinesAssociatedId { get; } - /// The list of vlans that are selected from the isolation domains for trunking. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The list of vlans that are selected from the isolation domains for trunking.", - SerializedName = @"vlans", - PossibleTypes = new [] { typeof(long) })] - long[] Vlan { get; set; } - - } - /// TrunkedNetwork represents a network that utilizes multiple isolation domains and specified VLANs to create a trunked network. - internal partial interface ITrunkedNetworkInternal : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal - { - /// - /// The list of resource IDs for the other Microsoft.NetworkCloud resources that have attached this network. - /// - string[] AssociatedResourceId { get; set; } - /// - /// The resource ID of the Network Cloud cluster this trunked network is associated with. - /// - string ClusterId { get; set; } - /// The more detailed status of the trunked network. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.TrunkedNetworkDetailedStatus? DetailedStatus { get; set; } - /// The descriptive message about the current detailed status. - string DetailedStatusMessage { get; set; } - /// Resource ETag. - string Etag { get; set; } - /// The extended location of the cluster associated with the resource. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocation ExtendedLocation { get; set; } - /// The resource ID of the extended location on which the resource will be created. - string ExtendedLocationName { get; set; } - /// The extended location type, for example, CustomLocation. - string ExtendedLocationType { get; set; } - /// - /// Field Deprecated. These fields will be empty/omitted. The list of Hybrid AKS cluster resource IDs that are associated - /// with this trunked network. - /// - string[] HybridAksClustersAssociatedId { get; set; } - /// - /// Field Deprecated. The field was previously optional, now it will have no defined behavior and will be ignored. The network - /// plugin type for Hybrid AKS. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HybridAksPluginType? HybridAksPluginType { get; set; } - /// - /// The default interface name for this trunked network in the virtual machine. This name can be overridden by the name supplied - /// in the network attachment configuration of that virtual machine. - /// - string InterfaceName { get; set; } - /// - /// The list of resource IDs representing the Network Fabric isolation domains. It can be any combination of l2IsolationDomain - /// and l3IsolationDomain resources. - /// - string[] IsolationDomainId { get; set; } - /// The list of the resource properties. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkProperties Property { get; set; } - /// The provisioning state of the trunked network. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.TrunkedNetworkProvisioningState? ProvisioningState { get; set; } - /// - /// Field Deprecated. These fields will be empty/omitted. The list of virtual machine resource IDs, excluding any Hybrid AKS - /// virtual machines, that are currently using this trunked network. - /// - string[] VirtualMachinesAssociatedId { get; set; } - /// The list of vlans that are selected from the isolation domains for trunking. - long[] Vlan { get; set; } - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/TrunkedNetworkList.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/TrunkedNetworkList.cs deleted file mode 100644 index 824daa135798..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/TrunkedNetworkList.cs +++ /dev/null @@ -1,68 +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.NetworkCloud.Models.Api20250201 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; - - /// TrunkedNetworkList represents a list of trunked networks. - public partial class TrunkedNetworkList : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkList, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkListInternal - { - - /// Backing field for property. - private string _nextLink; - - /// The link used to get the next page of operations. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string NextLink { get => this._nextLink; set => this._nextLink = value; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetwork[] _value; - - /// The list of trunked networks. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetwork[] Value { get => this._value; set => this._value = value; } - - /// Creates an new instance. - public TrunkedNetworkList() - { - - } - } - /// TrunkedNetworkList represents a list of trunked networks. - public partial interface ITrunkedNetworkList : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable - { - /// The link used to get the next page of operations. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The link used to get the next page of operations.", - SerializedName = @"nextLink", - PossibleTypes = new [] { typeof(string) })] - string NextLink { get; set; } - /// The list of trunked networks. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The list of trunked networks.", - SerializedName = @"value", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetwork) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetwork[] Value { get; set; } - - } - /// TrunkedNetworkList represents a list of trunked networks. - internal partial interface ITrunkedNetworkListInternal - - { - /// The link used to get the next page of operations. - string NextLink { get; set; } - /// The list of trunked networks. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetwork[] Value { get; set; } - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/TrunkedNetworkPatchParameters.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/TrunkedNetworkPatchParameters.cs deleted file mode 100644 index 74389d4b8a4b..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/TrunkedNetworkPatchParameters.cs +++ /dev/null @@ -1,53 +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.NetworkCloud.Models.Api20250201 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; - - /// - /// TrunkedNetworkPatchParameters represents the body of the request to patch the Trunked network. - /// - public partial class TrunkedNetworkPatchParameters : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkPatchParameters, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkPatchParametersInternal - { - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkPatchParametersTags _tag; - - /// The Azure resource tags that will replace the existing ones. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkPatchParametersTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.TrunkedNetworkPatchParametersTags()); set => this._tag = value; } - - /// Creates an new instance. - public TrunkedNetworkPatchParameters() - { - - } - } - /// TrunkedNetworkPatchParameters represents the body of the request to patch the Trunked network. - public partial interface ITrunkedNetworkPatchParameters : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable - { - /// The Azure resource tags that will replace the existing ones. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The Azure resource tags that will replace the existing ones.", - SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkPatchParametersTags) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkPatchParametersTags Tag { get; set; } - - } - /// TrunkedNetworkPatchParameters represents the body of the request to patch the Trunked network. - internal partial interface ITrunkedNetworkPatchParametersInternal - - { - /// The Azure resource tags that will replace the existing ones. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkPatchParametersTags Tag { get; set; } - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/TrunkedNetworkProperties.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/TrunkedNetworkProperties.PowerShell.cs deleted file mode 100644 index 45eccca6a1b2..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/TrunkedNetworkProperties.PowerShell.cs +++ /dev/null @@ -1,246 +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.NetworkCloud.Models.Api20250201 -{ - using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; - - /// TrunkedNetworkProperties represents properties of the trunked network. - [System.ComponentModel.TypeConverter(typeof(TrunkedNetworkPropertiesTypeConverter))] - public partial class TrunkedNetworkProperties - { - - /// - /// 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.NetworkCloud.Models.Api20250201.ITrunkedNetworkProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new TrunkedNetworkProperties(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.NetworkCloud.Models.Api20250201.ITrunkedNetworkProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new TrunkedNetworkProperties(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.NetworkCloud.Models.Api20250201.ITrunkedNetworkProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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 TrunkedNetworkProperties(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("AssociatedResourceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkPropertiesInternal)this).AssociatedResourceId = (string[]) content.GetValueForProperty("AssociatedResourceId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkPropertiesInternal)this).AssociatedResourceId, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("ClusterId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkPropertiesInternal)this).ClusterId = (string) content.GetValueForProperty("ClusterId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkPropertiesInternal)this).ClusterId, global::System.Convert.ToString); - } - if (content.Contains("DetailedStatus")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkPropertiesInternal)this).DetailedStatus = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.TrunkedNetworkDetailedStatus?) content.GetValueForProperty("DetailedStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkPropertiesInternal)this).DetailedStatus, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.TrunkedNetworkDetailedStatus.CreateFrom); - } - if (content.Contains("DetailedStatusMessage")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkPropertiesInternal)this).DetailedStatusMessage = (string) content.GetValueForProperty("DetailedStatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkPropertiesInternal)this).DetailedStatusMessage, global::System.Convert.ToString); - } - if (content.Contains("HybridAksClustersAssociatedId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkPropertiesInternal)this).HybridAksClustersAssociatedId = (string[]) content.GetValueForProperty("HybridAksClustersAssociatedId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkPropertiesInternal)this).HybridAksClustersAssociatedId, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("HybridAksPluginType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkPropertiesInternal)this).HybridAksPluginType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HybridAksPluginType?) content.GetValueForProperty("HybridAksPluginType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkPropertiesInternal)this).HybridAksPluginType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HybridAksPluginType.CreateFrom); - } - if (content.Contains("InterfaceName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkPropertiesInternal)this).InterfaceName = (string) content.GetValueForProperty("InterfaceName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkPropertiesInternal)this).InterfaceName, global::System.Convert.ToString); - } - if (content.Contains("IsolationDomainId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkPropertiesInternal)this).IsolationDomainId = (string[]) content.GetValueForProperty("IsolationDomainId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkPropertiesInternal)this).IsolationDomainId, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkPropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.TrunkedNetworkProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkPropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.TrunkedNetworkProvisioningState.CreateFrom); - } - if (content.Contains("VirtualMachinesAssociatedId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkPropertiesInternal)this).VirtualMachinesAssociatedId = (string[]) content.GetValueForProperty("VirtualMachinesAssociatedId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkPropertiesInternal)this).VirtualMachinesAssociatedId, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("Vlan")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkPropertiesInternal)this).Vlan = (long[]) content.GetValueForProperty("Vlan",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkPropertiesInternal)this).Vlan, __y => TypeConverterExtensions.SelectToArray(__y, (__w)=> (long) global::System.Convert.ChangeType(__w, typeof(long)))); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal TrunkedNetworkProperties(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("AssociatedResourceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkPropertiesInternal)this).AssociatedResourceId = (string[]) content.GetValueForProperty("AssociatedResourceId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkPropertiesInternal)this).AssociatedResourceId, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("ClusterId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkPropertiesInternal)this).ClusterId = (string) content.GetValueForProperty("ClusterId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkPropertiesInternal)this).ClusterId, global::System.Convert.ToString); - } - if (content.Contains("DetailedStatus")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkPropertiesInternal)this).DetailedStatus = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.TrunkedNetworkDetailedStatus?) content.GetValueForProperty("DetailedStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkPropertiesInternal)this).DetailedStatus, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.TrunkedNetworkDetailedStatus.CreateFrom); - } - if (content.Contains("DetailedStatusMessage")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkPropertiesInternal)this).DetailedStatusMessage = (string) content.GetValueForProperty("DetailedStatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkPropertiesInternal)this).DetailedStatusMessage, global::System.Convert.ToString); - } - if (content.Contains("HybridAksClustersAssociatedId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkPropertiesInternal)this).HybridAksClustersAssociatedId = (string[]) content.GetValueForProperty("HybridAksClustersAssociatedId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkPropertiesInternal)this).HybridAksClustersAssociatedId, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("HybridAksPluginType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkPropertiesInternal)this).HybridAksPluginType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HybridAksPluginType?) content.GetValueForProperty("HybridAksPluginType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkPropertiesInternal)this).HybridAksPluginType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HybridAksPluginType.CreateFrom); - } - if (content.Contains("InterfaceName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkPropertiesInternal)this).InterfaceName = (string) content.GetValueForProperty("InterfaceName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkPropertiesInternal)this).InterfaceName, global::System.Convert.ToString); - } - if (content.Contains("IsolationDomainId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkPropertiesInternal)this).IsolationDomainId = (string[]) content.GetValueForProperty("IsolationDomainId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkPropertiesInternal)this).IsolationDomainId, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkPropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.TrunkedNetworkProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkPropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.TrunkedNetworkProvisioningState.CreateFrom); - } - if (content.Contains("VirtualMachinesAssociatedId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkPropertiesInternal)this).VirtualMachinesAssociatedId = (string[]) content.GetValueForProperty("VirtualMachinesAssociatedId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkPropertiesInternal)this).VirtualMachinesAssociatedId, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("Vlan")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkPropertiesInternal)this).Vlan = (long[]) content.GetValueForProperty("Vlan",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkPropertiesInternal)this).Vlan, __y => TypeConverterExtensions.SelectToArray(__y, (__w)=> (long) global::System.Convert.ChangeType(__w, typeof(long)))); - } - AfterDeserializePSObject(content); - } - } - /// TrunkedNetworkProperties represents properties of the trunked network. - [System.ComponentModel.TypeConverter(typeof(TrunkedNetworkPropertiesTypeConverter))] - public partial interface ITrunkedNetworkProperties - - { - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/TrunkedNetworkProperties.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/TrunkedNetworkProperties.cs deleted file mode 100644 index 223c46869c39..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/TrunkedNetworkProperties.cs +++ /dev/null @@ -1,299 +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.NetworkCloud.Models.Api20250201 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; - - /// TrunkedNetworkProperties represents properties of the trunked network. - public partial class TrunkedNetworkProperties : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkProperties, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkPropertiesInternal - { - - /// Backing field for property. - private string[] _associatedResourceId; - - /// - /// The list of resource IDs for the other Microsoft.NetworkCloud resources that have attached this network. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string[] AssociatedResourceId { get => this._associatedResourceId; } - - /// Backing field for property. - private string _clusterId; - - /// - /// The resource ID of the Network Cloud cluster this trunked network is associated with. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string ClusterId { get => this._clusterId; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.TrunkedNetworkDetailedStatus? _detailedStatus; - - /// The more detailed status of the trunked network. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.TrunkedNetworkDetailedStatus? DetailedStatus { get => this._detailedStatus; } - - /// Backing field for property. - private string _detailedStatusMessage; - - /// The descriptive message about the current detailed status. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string DetailedStatusMessage { get => this._detailedStatusMessage; } - - /// Backing field for property. - private string[] _hybridAksClustersAssociatedId; - - /// - /// Field Deprecated. These fields will be empty/omitted. The list of Hybrid AKS cluster resource IDs that are associated - /// with this trunked network. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string[] HybridAksClustersAssociatedId { get => this._hybridAksClustersAssociatedId; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HybridAksPluginType? _hybridAksPluginType; - - /// - /// Field Deprecated. The field was previously optional, now it will have no defined behavior and will be ignored. The network - /// plugin type for Hybrid AKS. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HybridAksPluginType? HybridAksPluginType { get => this._hybridAksPluginType; set => this._hybridAksPluginType = value; } - - /// Backing field for property. - private string _interfaceName; - - /// - /// The default interface name for this trunked network in the virtual machine. This name can be overridden by the name supplied - /// in the network attachment configuration of that virtual machine. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string InterfaceName { get => this._interfaceName; set => this._interfaceName = value; } - - /// Backing field for property. - private string[] _isolationDomainId; - - /// - /// The list of resource IDs representing the Network Fabric isolation domains. It can be any combination of l2IsolationDomain - /// and l3IsolationDomain resources. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string[] IsolationDomainId { get => this._isolationDomainId; set => this._isolationDomainId = value; } - - /// Internal Acessors for AssociatedResourceId - string[] Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkPropertiesInternal.AssociatedResourceId { get => this._associatedResourceId; set { {_associatedResourceId = value;} } } - - /// Internal Acessors for ClusterId - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkPropertiesInternal.ClusterId { get => this._clusterId; set { {_clusterId = value;} } } - - /// Internal Acessors for DetailedStatus - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.TrunkedNetworkDetailedStatus? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkPropertiesInternal.DetailedStatus { get => this._detailedStatus; set { {_detailedStatus = value;} } } - - /// Internal Acessors for DetailedStatusMessage - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkPropertiesInternal.DetailedStatusMessage { get => this._detailedStatusMessage; set { {_detailedStatusMessage = value;} } } - - /// Internal Acessors for HybridAksClustersAssociatedId - string[] Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkPropertiesInternal.HybridAksClustersAssociatedId { get => this._hybridAksClustersAssociatedId; set { {_hybridAksClustersAssociatedId = value;} } } - - /// Internal Acessors for ProvisioningState - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.TrunkedNetworkProvisioningState? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkPropertiesInternal.ProvisioningState { get => this._provisioningState; set { {_provisioningState = value;} } } - - /// Internal Acessors for VirtualMachinesAssociatedId - string[] Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkPropertiesInternal.VirtualMachinesAssociatedId { get => this._virtualMachinesAssociatedId; set { {_virtualMachinesAssociatedId = value;} } } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.TrunkedNetworkProvisioningState? _provisioningState; - - /// The provisioning state of the trunked network. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.TrunkedNetworkProvisioningState? ProvisioningState { get => this._provisioningState; } - - /// Backing field for property. - private string[] _virtualMachinesAssociatedId; - - /// - /// Field Deprecated. These fields will be empty/omitted. The list of virtual machine resource IDs, excluding any Hybrid AKS - /// virtual machines, that are currently using this trunked network. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string[] VirtualMachinesAssociatedId { get => this._virtualMachinesAssociatedId; } - - /// Backing field for property. - private long[] _vlan; - - /// The list of vlans that are selected from the isolation domains for trunking. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public long[] Vlan { get => this._vlan; set => this._vlan = value; } - - /// Creates an new instance. - public TrunkedNetworkProperties() - { - - } - } - /// TrunkedNetworkProperties represents properties of the trunked network. - public partial interface ITrunkedNetworkProperties : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable - { - /// - /// The list of resource IDs for the other Microsoft.NetworkCloud resources that have attached this network. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The list of resource IDs for the other Microsoft.NetworkCloud resources that have attached this network.", - SerializedName = @"associatedResourceIds", - PossibleTypes = new [] { typeof(string) })] - string[] AssociatedResourceId { get; } - /// - /// The resource ID of the Network Cloud cluster this trunked network is associated with. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The resource ID of the Network Cloud cluster this trunked network is associated with.", - SerializedName = @"clusterId", - PossibleTypes = new [] { typeof(string) })] - string ClusterId { get; } - /// The more detailed status of the trunked network. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The more detailed status of the trunked network.", - SerializedName = @"detailedStatus", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.TrunkedNetworkDetailedStatus) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.TrunkedNetworkDetailedStatus? DetailedStatus { get; } - /// The descriptive message about the current detailed status. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The descriptive message about the current detailed status.", - SerializedName = @"detailedStatusMessage", - PossibleTypes = new [] { typeof(string) })] - string DetailedStatusMessage { get; } - /// - /// Field Deprecated. These fields will be empty/omitted. The list of Hybrid AKS cluster resource IDs that are associated - /// with this trunked network. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"Field Deprecated. These fields will be empty/omitted. The list of Hybrid AKS cluster resource IDs that are associated with this trunked network.", - SerializedName = @"hybridAksClustersAssociatedIds", - PossibleTypes = new [] { typeof(string) })] - string[] HybridAksClustersAssociatedId { get; } - /// - /// Field Deprecated. The field was previously optional, now it will have no defined behavior and will be ignored. The network - /// plugin type for Hybrid AKS. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Field Deprecated. The field was previously optional, now it will have no defined behavior and will be ignored. The network plugin type for Hybrid AKS.", - SerializedName = @"hybridAksPluginType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HybridAksPluginType) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HybridAksPluginType? HybridAksPluginType { get; set; } - /// - /// The default interface name for this trunked network in the virtual machine. This name can be overridden by the name supplied - /// in the network attachment configuration of that virtual machine. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The default interface name for this trunked network in the virtual machine. This name can be overridden by the name supplied in the network attachment configuration of that virtual machine.", - SerializedName = @"interfaceName", - PossibleTypes = new [] { typeof(string) })] - string InterfaceName { get; set; } - /// - /// The list of resource IDs representing the Network Fabric isolation domains. It can be any combination of l2IsolationDomain - /// and l3IsolationDomain resources. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The list of resource IDs representing the Network Fabric isolation domains. It can be any combination of l2IsolationDomain and l3IsolationDomain resources.", - SerializedName = @"isolationDomainIds", - PossibleTypes = new [] { typeof(string) })] - string[] IsolationDomainId { get; set; } - /// The provisioning state of the trunked network. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The provisioning state of the trunked network.", - SerializedName = @"provisioningState", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.TrunkedNetworkProvisioningState) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.TrunkedNetworkProvisioningState? ProvisioningState { get; } - /// - /// Field Deprecated. These fields will be empty/omitted. The list of virtual machine resource IDs, excluding any Hybrid AKS - /// virtual machines, that are currently using this trunked network. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"Field Deprecated. These fields will be empty/omitted. The list of virtual machine resource IDs, excluding any Hybrid AKS virtual machines, that are currently using this trunked network.", - SerializedName = @"virtualMachinesAssociatedIds", - PossibleTypes = new [] { typeof(string) })] - string[] VirtualMachinesAssociatedId { get; } - /// The list of vlans that are selected from the isolation domains for trunking. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The list of vlans that are selected from the isolation domains for trunking.", - SerializedName = @"vlans", - PossibleTypes = new [] { typeof(long) })] - long[] Vlan { get; set; } - - } - /// TrunkedNetworkProperties represents properties of the trunked network. - internal partial interface ITrunkedNetworkPropertiesInternal - - { - /// - /// The list of resource IDs for the other Microsoft.NetworkCloud resources that have attached this network. - /// - string[] AssociatedResourceId { get; set; } - /// - /// The resource ID of the Network Cloud cluster this trunked network is associated with. - /// - string ClusterId { get; set; } - /// The more detailed status of the trunked network. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.TrunkedNetworkDetailedStatus? DetailedStatus { get; set; } - /// The descriptive message about the current detailed status. - string DetailedStatusMessage { get; set; } - /// - /// Field Deprecated. These fields will be empty/omitted. The list of Hybrid AKS cluster resource IDs that are associated - /// with this trunked network. - /// - string[] HybridAksClustersAssociatedId { get; set; } - /// - /// Field Deprecated. The field was previously optional, now it will have no defined behavior and will be ignored. The network - /// plugin type for Hybrid AKS. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HybridAksPluginType? HybridAksPluginType { get; set; } - /// - /// The default interface name for this trunked network in the virtual machine. This name can be overridden by the name supplied - /// in the network attachment configuration of that virtual machine. - /// - string InterfaceName { get; set; } - /// - /// The list of resource IDs representing the Network Fabric isolation domains. It can be any combination of l2IsolationDomain - /// and l3IsolationDomain resources. - /// - string[] IsolationDomainId { get; set; } - /// The provisioning state of the trunked network. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.TrunkedNetworkProvisioningState? ProvisioningState { get; set; } - /// - /// Field Deprecated. These fields will be empty/omitted. The list of virtual machine resource IDs, excluding any Hybrid AKS - /// virtual machines, that are currently using this trunked network. - /// - string[] VirtualMachinesAssociatedId { get; set; } - /// The list of vlans that are selected from the isolation domains for trunking. - long[] Vlan { get; set; } - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/TrunkedNetworkProperties.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/TrunkedNetworkProperties.json.cs deleted file mode 100644 index c0380a6ce098..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/TrunkedNetworkProperties.json.cs +++ /dev/null @@ -1,189 +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.NetworkCloud.Models.Api20250201 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; - - /// TrunkedNetworkProperties represents properties of the trunked network. - public partial class TrunkedNetworkProperties - { - - /// - /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object - /// before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The JsonNode that should be deserialized into this object. - - partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json); - - /// - /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The JSON container that the serialization result will be placed in. - - partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container); - - /// - /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of - /// the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the - /// output parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The JsonNode that should be deserialized into this object. - /// Determines if the rest of the deserialization should be processed, or if the method should return - /// instantly. - - partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json, ref bool returnNow); - - /// - /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the - /// object before it is serialized. - /// If you wish to disable the default serialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The JSON container that the serialization result will be placed in. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, ref bool returnNow); - - /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkProperties. - /// - /// a to deserialize from. - /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkProperties. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) - { - return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new TrunkedNetworkProperties(json) : null; - } - - /// - /// Serializes this instance of into a . - /// - /// The container to serialize this object into. If the caller - /// passes in null, a new instance will be created and returned to the caller. - /// Allows the caller to choose the depth of the serialization. See . - /// - /// a serialized instance of as a . - /// - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode) - { - container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject(); - - bool returnNow = false; - BeforeToJson(ref container, ref returnNow); - if (returnNow) - { - return container; - } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) - { - if (null != this._associatedResourceId) - { - var __w = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.XNodeArray(); - foreach( var __x in this._associatedResourceId ) - { - AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); - } - container.Add("associatedResourceIds",__w); - } - } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) - { - AddIf( null != (((object)this._clusterId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._clusterId.ToString()) : null, "clusterId" ,container.Add ); - } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) - { - AddIf( null != (((object)this._detailedStatus)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._detailedStatus.ToString()) : null, "detailedStatus" ,container.Add ); - } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) - { - AddIf( null != (((object)this._detailedStatusMessage)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._detailedStatusMessage.ToString()) : null, "detailedStatusMessage" ,container.Add ); - } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) - { - if (null != this._hybridAksClustersAssociatedId) - { - var __r = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.XNodeArray(); - foreach( var __s in this._hybridAksClustersAssociatedId ) - { - AddIf(null != (((object)__s)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(__s.ToString()) : null ,__r.Add); - } - container.Add("hybridAksClustersAssociatedIds",__r); - } - } - AddIf( null != (((object)this._hybridAksPluginType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._hybridAksPluginType.ToString()) : null, "hybridAksPluginType" ,container.Add ); - AddIf( null != (((object)this._interfaceName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._interfaceName.ToString()) : null, "interfaceName" ,container.Add ); - if (null != this._isolationDomainId) - { - var __m = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.XNodeArray(); - foreach( var __n in this._isolationDomainId ) - { - AddIf(null != (((object)__n)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(__n.ToString()) : null ,__m.Add); - } - container.Add("isolationDomainIds",__m); - } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) - { - AddIf( null != (((object)this._provisioningState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._provisioningState.ToString()) : null, "provisioningState" ,container.Add ); - } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) - { - if (null != this._virtualMachinesAssociatedId) - { - var __h = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.XNodeArray(); - foreach( var __i in this._virtualMachinesAssociatedId ) - { - AddIf(null != (((object)__i)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(__i.ToString()) : null ,__h.Add); - } - container.Add("virtualMachinesAssociatedIds",__h); - } - } - if (null != this._vlan) - { - var __c = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.XNodeArray(); - foreach( var __d in this._vlan ) - { - AddIf((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNumber(__d) ,__c.Add); - } - container.Add("vlans",__c); - } - AfterToJson(ref container); - return container; - } - - /// - /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject into a new instance of . - /// - /// A Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject instance to deserialize from. - internal TrunkedNetworkProperties(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) - { - bool returnNow = false; - BeforeFromJson(json, ref returnNow); - if (returnNow) - { - return; - } - {_associatedResourceId = If( json?.PropertyT("associatedResourceIds"), out var __jsonAssociatedResourceIds) ? If( __jsonAssociatedResourceIds as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : AssociatedResourceId;} - {_clusterId = If( json?.PropertyT("clusterId"), out var __jsonClusterId) ? (string)__jsonClusterId : (string)ClusterId;} - {_detailedStatus = If( json?.PropertyT("detailedStatus"), out var __jsonDetailedStatus) ? (string)__jsonDetailedStatus : (string)DetailedStatus;} - {_detailedStatusMessage = If( json?.PropertyT("detailedStatusMessage"), out var __jsonDetailedStatusMessage) ? (string)__jsonDetailedStatusMessage : (string)DetailedStatusMessage;} - {_hybridAksClustersAssociatedId = If( json?.PropertyT("hybridAksClustersAssociatedIds"), out var __jsonHybridAksClustersAssociatedIds) ? If( __jsonHybridAksClustersAssociatedIds as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Json.JsonString __o ? (string)(__o.ToString()) : null)) ))() : null : HybridAksClustersAssociatedId;} - {_hybridAksPluginType = If( json?.PropertyT("hybridAksPluginType"), out var __jsonHybridAksPluginType) ? (string)__jsonHybridAksPluginType : (string)HybridAksPluginType;} - {_interfaceName = If( json?.PropertyT("interfaceName"), out var __jsonInterfaceName) ? (string)__jsonInterfaceName : (string)InterfaceName;} - {_isolationDomainId = If( json?.PropertyT("isolationDomainIds"), out var __jsonIsolationDomainIds) ? If( __jsonIsolationDomainIds as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Json.JsonString __j ? (string)(__j.ToString()) : null)) ))() : null : IsolationDomainId;} - {_provisioningState = If( json?.PropertyT("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)ProvisioningState;} - {_virtualMachinesAssociatedId = If( json?.PropertyT("virtualMachinesAssociatedIds"), out var __jsonVirtualMachinesAssociatedIds) ? If( __jsonVirtualMachinesAssociatedIds as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Json.JsonString __e ? (string)(__e.ToString()) : null)) ))() : null : VirtualMachinesAssociatedId;} - {_vlan = If( json?.PropertyT("vlans"), out var __jsonVlans) ? If( __jsonVlans as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonArray, out var __b) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__b, (__a)=>(long) (__a is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNumber ___z ? (long)___z : default(long))) ))() : null : Vlan;} - AfterFromJson(json); - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ValidationThreshold.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ValidationThreshold.PowerShell.cs deleted file mode 100644 index 6c22ba09f09a..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ValidationThreshold.PowerShell.cs +++ /dev/null @@ -1,182 +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.NetworkCloud.Models.Api20250201 -{ - using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; - - /// - /// ValidationThreshold indicates allowed machine and node hardware and deployment failures. - /// - [System.ComponentModel.TypeConverter(typeof(ValidationThresholdTypeConverter))] - public partial class ValidationThreshold - { - - /// - /// 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.NetworkCloud.Models.Api20250201.IValidationThreshold DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new ValidationThreshold(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.NetworkCloud.Models.Api20250201.IValidationThreshold DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new ValidationThreshold(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.NetworkCloud.Models.Api20250201.IValidationThreshold FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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 ValidationThreshold(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("Grouping")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IValidationThresholdInternal)this).Grouping = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdGrouping) content.GetValueForProperty("Grouping",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IValidationThresholdInternal)this).Grouping, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdGrouping.CreateFrom); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IValidationThresholdInternal)this).Type = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdType) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IValidationThresholdInternal)this).Type, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdType.CreateFrom); - } - if (content.Contains("Value")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IValidationThresholdInternal)this).Value = (long) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IValidationThresholdInternal)this).Value, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal ValidationThreshold(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("Grouping")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IValidationThresholdInternal)this).Grouping = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdGrouping) content.GetValueForProperty("Grouping",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IValidationThresholdInternal)this).Grouping, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdGrouping.CreateFrom); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IValidationThresholdInternal)this).Type = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdType) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IValidationThresholdInternal)this).Type, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdType.CreateFrom); - } - if (content.Contains("Value")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IValidationThresholdInternal)this).Value = (long) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IValidationThresholdInternal)this).Value, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - AfterDeserializePSObject(content); - } - } - /// ValidationThreshold indicates allowed machine and node hardware and deployment failures. - [System.ComponentModel.TypeConverter(typeof(ValidationThresholdTypeConverter))] - public partial interface IValidationThreshold - - { - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ValidationThreshold.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ValidationThreshold.cs deleted file mode 100644 index c8aba6803bfc..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ValidationThreshold.cs +++ /dev/null @@ -1,87 +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.NetworkCloud.Models.Api20250201 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; - - /// - /// ValidationThreshold indicates allowed machine and node hardware and deployment failures. - /// - public partial class ValidationThreshold : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IValidationThreshold, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IValidationThresholdInternal - { - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdGrouping _grouping; - - /// Selection of how the type evaluation is applied to the cluster calculation. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdGrouping Grouping { get => this._grouping; set => this._grouping = value; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdType _type; - - /// Selection of how the threshold should be evaluated. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdType Type { get => this._type; set => this._type = value; } - - /// Backing field for property. - private long _value; - - /// The numeric threshold value. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public long Value { get => this._value; set => this._value = value; } - - /// Creates an new instance. - public ValidationThreshold() - { - - } - } - /// ValidationThreshold indicates allowed machine and node hardware and deployment failures. - public partial interface IValidationThreshold : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable - { - /// Selection of how the type evaluation is applied to the cluster calculation. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"Selection of how the type evaluation is applied to the cluster calculation.", - SerializedName = @"grouping", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdGrouping) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdGrouping Grouping { get; set; } - /// Selection of how the threshold should be evaluated. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"Selection of how the threshold should be evaluated.", - SerializedName = @"type", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdType) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdType Type { get; set; } - /// The numeric threshold value. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The numeric threshold value.", - SerializedName = @"value", - PossibleTypes = new [] { typeof(long) })] - long Value { get; set; } - - } - /// ValidationThreshold indicates allowed machine and node hardware and deployment failures. - internal partial interface IValidationThresholdInternal - - { - /// Selection of how the type evaluation is applied to the cluster calculation. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdGrouping Grouping { get; set; } - /// Selection of how the threshold should be evaluated. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdType Type { get; set; } - /// The numeric threshold value. - long Value { get; set; } - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VirtualMachine.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VirtualMachine.PowerShell.cs deleted file mode 100644 index 68e56926d023..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VirtualMachine.PowerShell.cs +++ /dev/null @@ -1,628 +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.NetworkCloud.Models.Api20250201 -{ - using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; - - /// VirtualMachine represents the on-premises Network Cloud virtual machine. - [System.ComponentModel.TypeConverter(typeof(VirtualMachineTypeConverter))] - public partial class VirtualMachine - { - - /// - /// 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.NetworkCloud.Models.Api20250201.IVirtualMachine DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new VirtualMachine(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.NetworkCloud.Models.Api20250201.IVirtualMachine DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new VirtualMachine(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.NetworkCloud.Models.Api20250201.IVirtualMachine FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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 VirtualMachine(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("ExtendedLocation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).ExtendedLocation = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocation) content.GetValueForProperty("ExtendedLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).ExtendedLocation, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ExtendedLocationTypeConverter.ConvertFrom); - } - if (content.Contains("Property")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.VirtualMachinePropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Etag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).Etag, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)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("SystemDataCreatedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataLastModifiedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("SystemData")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.SystemDataTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Type, global::System.Convert.ToString); - } - if (content.Contains("Tag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.TrackedResourceTagsTypeConverter.ConvertFrom); - } - if (content.Contains("Location")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); - } - if (content.Contains("ExtendedLocationName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).ExtendedLocationName = (string) content.GetValueForProperty("ExtendedLocationName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).ExtendedLocationName, global::System.Convert.ToString); - } - if (content.Contains("ExtendedLocationType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).ExtendedLocationType = (string) content.GetValueForProperty("ExtendedLocationType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).ExtendedLocationType, global::System.Convert.ToString); - } - if (content.Contains("StorageProfile")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).StorageProfile = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageProfile) content.GetValueForProperty("StorageProfile",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).StorageProfile, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.StorageProfileTypeConverter.ConvertFrom); - } - if (content.Contains("CloudServicesNetworkAttachment")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).CloudServicesNetworkAttachment = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkAttachment) content.GetValueForProperty("CloudServicesNetworkAttachment",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).CloudServicesNetworkAttachment, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.NetworkAttachmentTypeConverter.ConvertFrom); - } - if (content.Contains("ConsoleExtendedLocation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).ConsoleExtendedLocation = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocation) content.GetValueForProperty("ConsoleExtendedLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).ConsoleExtendedLocation, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ExtendedLocationTypeConverter.ConvertFrom); - } - if (content.Contains("VMImageRepositoryCredentials")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).VMImageRepositoryCredentials = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IImageRepositoryCredentials) content.GetValueForProperty("VMImageRepositoryCredentials",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).VMImageRepositoryCredentials, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ImageRepositoryCredentialsTypeConverter.ConvertFrom); - } - if (content.Contains("AdminUsername")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).AdminUsername = (string) content.GetValueForProperty("AdminUsername",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).AdminUsername, global::System.Convert.ToString); - } - if (content.Contains("AvailabilityZone")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).AvailabilityZone = (string) content.GetValueForProperty("AvailabilityZone",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).AvailabilityZone, global::System.Convert.ToString); - } - if (content.Contains("BareMetalMachineId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).BareMetalMachineId = (string) content.GetValueForProperty("BareMetalMachineId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).BareMetalMachineId, global::System.Convert.ToString); - } - if (content.Contains("BootMethod")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).BootMethod = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineBootMethod?) content.GetValueForProperty("BootMethod",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).BootMethod, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineBootMethod.CreateFrom); - } - if (content.Contains("ClusterId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).ClusterId = (string) content.GetValueForProperty("ClusterId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).ClusterId, global::System.Convert.ToString); - } - if (content.Contains("CpuCore")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).CpuCore = (long) content.GetValueForProperty("CpuCore",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).CpuCore, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("DetailedStatus")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).DetailedStatus = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineDetailedStatus?) content.GetValueForProperty("DetailedStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).DetailedStatus, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineDetailedStatus.CreateFrom); - } - if (content.Contains("DetailedStatusMessage")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).DetailedStatusMessage = (string) content.GetValueForProperty("DetailedStatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).DetailedStatusMessage, global::System.Convert.ToString); - } - if (content.Contains("IsolateEmulatorThread")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).IsolateEmulatorThread = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineIsolateEmulatorThread?) content.GetValueForProperty("IsolateEmulatorThread",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).IsolateEmulatorThread, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineIsolateEmulatorThread.CreateFrom); - } - if (content.Contains("MemorySizeGb")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).MemorySizeGb = (long) content.GetValueForProperty("MemorySizeGb",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).MemorySizeGb, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("NetworkAttachment")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).NetworkAttachment = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkAttachment[]) content.GetValueForProperty("NetworkAttachment",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).NetworkAttachment, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.NetworkAttachmentTypeConverter.ConvertFrom)); - } - if (content.Contains("NetworkData")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).NetworkData = (string) content.GetValueForProperty("NetworkData",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).NetworkData, global::System.Convert.ToString); - } - if (content.Contains("PlacementHint")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).PlacementHint = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePlacementHint[]) content.GetValueForProperty("PlacementHint",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).PlacementHint, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.VirtualMachinePlacementHintTypeConverter.ConvertFrom)); - } - if (content.Contains("PowerState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).PowerState = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachinePowerState?) content.GetValueForProperty("PowerState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).PowerState, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachinePowerState.CreateFrom); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineProvisioningState.CreateFrom); - } - if (content.Contains("SshPublicKey")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).SshPublicKey = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey[]) content.GetValueForProperty("SshPublicKey",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).SshPublicKey, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.SshPublicKeyTypeConverter.ConvertFrom)); - } - if (content.Contains("UserData")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).UserData = (string) content.GetValueForProperty("UserData",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).UserData, global::System.Convert.ToString); - } - if (content.Contains("VirtioInterface")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).VirtioInterface = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineVirtioInterfaceType?) content.GetValueForProperty("VirtioInterface",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).VirtioInterface, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineVirtioInterfaceType.CreateFrom); - } - if (content.Contains("VMDeviceModel")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).VMDeviceModel = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineDeviceModelType?) content.GetValueForProperty("VMDeviceModel",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).VMDeviceModel, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineDeviceModelType.CreateFrom); - } - if (content.Contains("VMImage")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).VMImage = (string) content.GetValueForProperty("VMImage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).VMImage, global::System.Convert.ToString); - } - if (content.Contains("Volume")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).Volume = (string[]) content.GetValueForProperty("Volume",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).Volume, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("CloudServiceNetworkAttachmentDefaultGateway")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).CloudServiceNetworkAttachmentDefaultGateway = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.DefaultGateway?) content.GetValueForProperty("CloudServiceNetworkAttachmentDefaultGateway",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).CloudServiceNetworkAttachmentDefaultGateway, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.DefaultGateway.CreateFrom); - } - if (content.Contains("StorageProfileOSDisk")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).StorageProfileOSDisk = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOSDisk) content.GetValueForProperty("StorageProfileOSDisk",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).StorageProfileOSDisk, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.OSDiskTypeConverter.ConvertFrom); - } - if (content.Contains("StorageProfileVolumeAttachment")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).StorageProfileVolumeAttachment = (string[]) content.GetValueForProperty("StorageProfileVolumeAttachment",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).StorageProfileVolumeAttachment, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("CloudServiceNetworkAttachmentAttachedNetworkId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).CloudServiceNetworkAttachmentAttachedNetworkId = (string) content.GetValueForProperty("CloudServiceNetworkAttachmentAttachedNetworkId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).CloudServiceNetworkAttachmentAttachedNetworkId, global::System.Convert.ToString); - } - if (content.Contains("CloudServiceNetworkAttachmentIPAllocationMethod")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).CloudServiceNetworkAttachmentIPAllocationMethod = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineIPAllocationMethod) content.GetValueForProperty("CloudServiceNetworkAttachmentIPAllocationMethod",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).CloudServiceNetworkAttachmentIPAllocationMethod, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineIPAllocationMethod.CreateFrom); - } - if (content.Contains("CloudServiceNetworkAttachmentIpv4Address")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).CloudServiceNetworkAttachmentIpv4Address = (string) content.GetValueForProperty("CloudServiceNetworkAttachmentIpv4Address",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).CloudServiceNetworkAttachmentIpv4Address, global::System.Convert.ToString); - } - if (content.Contains("CloudServiceNetworkAttachmentIpv6Address")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).CloudServiceNetworkAttachmentIpv6Address = (string) content.GetValueForProperty("CloudServiceNetworkAttachmentIpv6Address",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).CloudServiceNetworkAttachmentIpv6Address, global::System.Convert.ToString); - } - if (content.Contains("CloudServiceNetworkAttachmentMacAddress")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).CloudServiceNetworkAttachmentMacAddress = (string) content.GetValueForProperty("CloudServiceNetworkAttachmentMacAddress",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).CloudServiceNetworkAttachmentMacAddress, global::System.Convert.ToString); - } - if (content.Contains("CloudServiceNetworkAttachmentName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).CloudServiceNetworkAttachmentName = (string) content.GetValueForProperty("CloudServiceNetworkAttachmentName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).CloudServiceNetworkAttachmentName, global::System.Convert.ToString); - } - if (content.Contains("ConsoleExtendedLocationName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).ConsoleExtendedLocationName = (string) content.GetValueForProperty("ConsoleExtendedLocationName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).ConsoleExtendedLocationName, global::System.Convert.ToString); - } - if (content.Contains("ConsoleExtendedLocationType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).ConsoleExtendedLocationType = (string) content.GetValueForProperty("ConsoleExtendedLocationType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).ConsoleExtendedLocationType, global::System.Convert.ToString); - } - if (content.Contains("VMImageRepositoryCredentialsPassword")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).VMImageRepositoryCredentialsPassword = (System.Security.SecureString) content.GetValueForProperty("VMImageRepositoryCredentialsPassword",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).VMImageRepositoryCredentialsPassword, (object ss) => (System.Security.SecureString)ss); - } - if (content.Contains("VMImageRepositoryCredentialsRegistryUrl")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).VMImageRepositoryCredentialsRegistryUrl = (string) content.GetValueForProperty("VMImageRepositoryCredentialsRegistryUrl",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).VMImageRepositoryCredentialsRegistryUrl, global::System.Convert.ToString); - } - if (content.Contains("VMImageRepositoryCredentialsUsername")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).VMImageRepositoryCredentialsUsername = (string) content.GetValueForProperty("VMImageRepositoryCredentialsUsername",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).VMImageRepositoryCredentialsUsername, global::System.Convert.ToString); - } - if (content.Contains("OSDiskCreateOption")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).OSDiskCreateOption = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.OSDiskCreateOption?) content.GetValueForProperty("OSDiskCreateOption",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).OSDiskCreateOption, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.OSDiskCreateOption.CreateFrom); - } - if (content.Contains("OSDiskDeleteOption")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).OSDiskDeleteOption = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.OSDiskDeleteOption?) content.GetValueForProperty("OSDiskDeleteOption",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).OSDiskDeleteOption, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.OSDiskDeleteOption.CreateFrom); - } - if (content.Contains("OSDiskSizeGb")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).OSDiskSizeGb = (long) content.GetValueForProperty("OSDiskSizeGb",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).OSDiskSizeGb, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal VirtualMachine(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("ExtendedLocation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).ExtendedLocation = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocation) content.GetValueForProperty("ExtendedLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).ExtendedLocation, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ExtendedLocationTypeConverter.ConvertFrom); - } - if (content.Contains("Property")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.VirtualMachinePropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Etag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).Etag, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)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("SystemDataCreatedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataLastModifiedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("SystemData")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.SystemDataTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Type, global::System.Convert.ToString); - } - if (content.Contains("Tag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.TrackedResourceTagsTypeConverter.ConvertFrom); - } - if (content.Contains("Location")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); - } - if (content.Contains("ExtendedLocationName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).ExtendedLocationName = (string) content.GetValueForProperty("ExtendedLocationName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).ExtendedLocationName, global::System.Convert.ToString); - } - if (content.Contains("ExtendedLocationType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).ExtendedLocationType = (string) content.GetValueForProperty("ExtendedLocationType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).ExtendedLocationType, global::System.Convert.ToString); - } - if (content.Contains("StorageProfile")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).StorageProfile = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageProfile) content.GetValueForProperty("StorageProfile",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).StorageProfile, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.StorageProfileTypeConverter.ConvertFrom); - } - if (content.Contains("CloudServicesNetworkAttachment")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).CloudServicesNetworkAttachment = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkAttachment) content.GetValueForProperty("CloudServicesNetworkAttachment",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).CloudServicesNetworkAttachment, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.NetworkAttachmentTypeConverter.ConvertFrom); - } - if (content.Contains("ConsoleExtendedLocation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).ConsoleExtendedLocation = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocation) content.GetValueForProperty("ConsoleExtendedLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).ConsoleExtendedLocation, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ExtendedLocationTypeConverter.ConvertFrom); - } - if (content.Contains("VMImageRepositoryCredentials")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).VMImageRepositoryCredentials = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IImageRepositoryCredentials) content.GetValueForProperty("VMImageRepositoryCredentials",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).VMImageRepositoryCredentials, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ImageRepositoryCredentialsTypeConverter.ConvertFrom); - } - if (content.Contains("AdminUsername")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).AdminUsername = (string) content.GetValueForProperty("AdminUsername",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).AdminUsername, global::System.Convert.ToString); - } - if (content.Contains("AvailabilityZone")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).AvailabilityZone = (string) content.GetValueForProperty("AvailabilityZone",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).AvailabilityZone, global::System.Convert.ToString); - } - if (content.Contains("BareMetalMachineId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).BareMetalMachineId = (string) content.GetValueForProperty("BareMetalMachineId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).BareMetalMachineId, global::System.Convert.ToString); - } - if (content.Contains("BootMethod")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).BootMethod = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineBootMethod?) content.GetValueForProperty("BootMethod",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).BootMethod, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineBootMethod.CreateFrom); - } - if (content.Contains("ClusterId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).ClusterId = (string) content.GetValueForProperty("ClusterId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).ClusterId, global::System.Convert.ToString); - } - if (content.Contains("CpuCore")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).CpuCore = (long) content.GetValueForProperty("CpuCore",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).CpuCore, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("DetailedStatus")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).DetailedStatus = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineDetailedStatus?) content.GetValueForProperty("DetailedStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).DetailedStatus, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineDetailedStatus.CreateFrom); - } - if (content.Contains("DetailedStatusMessage")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).DetailedStatusMessage = (string) content.GetValueForProperty("DetailedStatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).DetailedStatusMessage, global::System.Convert.ToString); - } - if (content.Contains("IsolateEmulatorThread")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).IsolateEmulatorThread = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineIsolateEmulatorThread?) content.GetValueForProperty("IsolateEmulatorThread",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).IsolateEmulatorThread, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineIsolateEmulatorThread.CreateFrom); - } - if (content.Contains("MemorySizeGb")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).MemorySizeGb = (long) content.GetValueForProperty("MemorySizeGb",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).MemorySizeGb, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("NetworkAttachment")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).NetworkAttachment = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkAttachment[]) content.GetValueForProperty("NetworkAttachment",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).NetworkAttachment, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.NetworkAttachmentTypeConverter.ConvertFrom)); - } - if (content.Contains("NetworkData")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).NetworkData = (string) content.GetValueForProperty("NetworkData",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).NetworkData, global::System.Convert.ToString); - } - if (content.Contains("PlacementHint")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).PlacementHint = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePlacementHint[]) content.GetValueForProperty("PlacementHint",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).PlacementHint, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.VirtualMachinePlacementHintTypeConverter.ConvertFrom)); - } - if (content.Contains("PowerState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).PowerState = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachinePowerState?) content.GetValueForProperty("PowerState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).PowerState, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachinePowerState.CreateFrom); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineProvisioningState.CreateFrom); - } - if (content.Contains("SshPublicKey")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).SshPublicKey = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey[]) content.GetValueForProperty("SshPublicKey",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).SshPublicKey, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.SshPublicKeyTypeConverter.ConvertFrom)); - } - if (content.Contains("UserData")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).UserData = (string) content.GetValueForProperty("UserData",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).UserData, global::System.Convert.ToString); - } - if (content.Contains("VirtioInterface")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).VirtioInterface = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineVirtioInterfaceType?) content.GetValueForProperty("VirtioInterface",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).VirtioInterface, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineVirtioInterfaceType.CreateFrom); - } - if (content.Contains("VMDeviceModel")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).VMDeviceModel = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineDeviceModelType?) content.GetValueForProperty("VMDeviceModel",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).VMDeviceModel, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineDeviceModelType.CreateFrom); - } - if (content.Contains("VMImage")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).VMImage = (string) content.GetValueForProperty("VMImage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).VMImage, global::System.Convert.ToString); - } - if (content.Contains("Volume")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).Volume = (string[]) content.GetValueForProperty("Volume",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).Volume, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("CloudServiceNetworkAttachmentDefaultGateway")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).CloudServiceNetworkAttachmentDefaultGateway = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.DefaultGateway?) content.GetValueForProperty("CloudServiceNetworkAttachmentDefaultGateway",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).CloudServiceNetworkAttachmentDefaultGateway, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.DefaultGateway.CreateFrom); - } - if (content.Contains("StorageProfileOSDisk")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).StorageProfileOSDisk = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOSDisk) content.GetValueForProperty("StorageProfileOSDisk",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).StorageProfileOSDisk, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.OSDiskTypeConverter.ConvertFrom); - } - if (content.Contains("StorageProfileVolumeAttachment")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).StorageProfileVolumeAttachment = (string[]) content.GetValueForProperty("StorageProfileVolumeAttachment",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).StorageProfileVolumeAttachment, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("CloudServiceNetworkAttachmentAttachedNetworkId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).CloudServiceNetworkAttachmentAttachedNetworkId = (string) content.GetValueForProperty("CloudServiceNetworkAttachmentAttachedNetworkId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).CloudServiceNetworkAttachmentAttachedNetworkId, global::System.Convert.ToString); - } - if (content.Contains("CloudServiceNetworkAttachmentIPAllocationMethod")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).CloudServiceNetworkAttachmentIPAllocationMethod = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineIPAllocationMethod) content.GetValueForProperty("CloudServiceNetworkAttachmentIPAllocationMethod",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).CloudServiceNetworkAttachmentIPAllocationMethod, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineIPAllocationMethod.CreateFrom); - } - if (content.Contains("CloudServiceNetworkAttachmentIpv4Address")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).CloudServiceNetworkAttachmentIpv4Address = (string) content.GetValueForProperty("CloudServiceNetworkAttachmentIpv4Address",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).CloudServiceNetworkAttachmentIpv4Address, global::System.Convert.ToString); - } - if (content.Contains("CloudServiceNetworkAttachmentIpv6Address")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).CloudServiceNetworkAttachmentIpv6Address = (string) content.GetValueForProperty("CloudServiceNetworkAttachmentIpv6Address",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).CloudServiceNetworkAttachmentIpv6Address, global::System.Convert.ToString); - } - if (content.Contains("CloudServiceNetworkAttachmentMacAddress")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).CloudServiceNetworkAttachmentMacAddress = (string) content.GetValueForProperty("CloudServiceNetworkAttachmentMacAddress",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).CloudServiceNetworkAttachmentMacAddress, global::System.Convert.ToString); - } - if (content.Contains("CloudServiceNetworkAttachmentName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).CloudServiceNetworkAttachmentName = (string) content.GetValueForProperty("CloudServiceNetworkAttachmentName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).CloudServiceNetworkAttachmentName, global::System.Convert.ToString); - } - if (content.Contains("ConsoleExtendedLocationName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).ConsoleExtendedLocationName = (string) content.GetValueForProperty("ConsoleExtendedLocationName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).ConsoleExtendedLocationName, global::System.Convert.ToString); - } - if (content.Contains("ConsoleExtendedLocationType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).ConsoleExtendedLocationType = (string) content.GetValueForProperty("ConsoleExtendedLocationType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).ConsoleExtendedLocationType, global::System.Convert.ToString); - } - if (content.Contains("VMImageRepositoryCredentialsPassword")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).VMImageRepositoryCredentialsPassword = (System.Security.SecureString) content.GetValueForProperty("VMImageRepositoryCredentialsPassword",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).VMImageRepositoryCredentialsPassword, (object ss) => (System.Security.SecureString)ss); - } - if (content.Contains("VMImageRepositoryCredentialsRegistryUrl")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).VMImageRepositoryCredentialsRegistryUrl = (string) content.GetValueForProperty("VMImageRepositoryCredentialsRegistryUrl",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).VMImageRepositoryCredentialsRegistryUrl, global::System.Convert.ToString); - } - if (content.Contains("VMImageRepositoryCredentialsUsername")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).VMImageRepositoryCredentialsUsername = (string) content.GetValueForProperty("VMImageRepositoryCredentialsUsername",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).VMImageRepositoryCredentialsUsername, global::System.Convert.ToString); - } - if (content.Contains("OSDiskCreateOption")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).OSDiskCreateOption = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.OSDiskCreateOption?) content.GetValueForProperty("OSDiskCreateOption",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).OSDiskCreateOption, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.OSDiskCreateOption.CreateFrom); - } - if (content.Contains("OSDiskDeleteOption")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).OSDiskDeleteOption = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.OSDiskDeleteOption?) content.GetValueForProperty("OSDiskDeleteOption",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).OSDiskDeleteOption, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.OSDiskDeleteOption.CreateFrom); - } - if (content.Contains("OSDiskSizeGb")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).OSDiskSizeGb = (long) content.GetValueForProperty("OSDiskSizeGb",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal)this).OSDiskSizeGb, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - AfterDeserializePSObject(content); - } - } - /// VirtualMachine represents the on-premises Network Cloud virtual machine. - [System.ComponentModel.TypeConverter(typeof(VirtualMachineTypeConverter))] - public partial interface IVirtualMachine - - { - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VirtualMachine.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VirtualMachine.cs deleted file mode 100644 index c0569a918210..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VirtualMachine.cs +++ /dev/null @@ -1,951 +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.NetworkCloud.Models.Api20250201 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; - - /// VirtualMachine represents the on-premises Network Cloud virtual machine. - public partial class VirtualMachine : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachine, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IValidates - { - /// - /// Backing field for Inherited model - /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResource __trackedResource = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.TrackedResource(); - - /// - /// The name of the administrator to which the ssh public keys will be added into the authorized keys. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string AdminUsername { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)Property).AdminUsername; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)Property).AdminUsername = value ; } - - /// The cluster availability zone containing this virtual machine. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string AvailabilityZone { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)Property).AvailabilityZone; } - - /// The resource ID of the bare metal machine that hosts the virtual machine. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string BareMetalMachineId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)Property).BareMetalMachineId; } - - /// Selects the boot method for the virtual machine. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineBootMethod? BootMethod { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)Property).BootMethod; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)Property).BootMethod = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineBootMethod)""); } - - /// - /// The resource ID of the associated network attached to the virtual machine. - /// It can be one of cloudServicesNetwork, l3Network, l2Network or trunkedNetwork resources. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string CloudServiceNetworkAttachmentAttachedNetworkId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)Property).CloudServiceNetworkAttachmentAttachedNetworkId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)Property).CloudServiceNetworkAttachmentAttachedNetworkId = value ; } - - /// - /// The indicator of whether this is the default gateway. - /// Only one of the attached networks (including the CloudServicesNetwork attachment) for a single machine may be specified - /// as True. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.DefaultGateway? CloudServiceNetworkAttachmentDefaultGateway { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)Property).CloudServiceNetworkAttachmentDefaultGateway; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)Property).CloudServiceNetworkAttachmentDefaultGateway = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.DefaultGateway)""); } - - /// - /// The IP allocation mechanism for the virtual machine. - /// Dynamic and Static are only valid for l3Network which may also specify Disabled. - /// Otherwise, Disabled is the only permitted value. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineIPAllocationMethod CloudServiceNetworkAttachmentIPAllocationMethod { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)Property).CloudServiceNetworkAttachmentIPAllocationMethod; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)Property).CloudServiceNetworkAttachmentIPAllocationMethod = value ; } - - /// - /// The IPv4 address of the virtual machine. - /// This field is used only if the attached network has IPAllocationType of IPV4 or DualStack. - /// If IPAllocationMethod is: - /// Static - this field must contain a user specified IPv4 address from within the subnet specified in the attached network. - /// Dynamic - this field is read-only, but will be populated with an address from within the subnet specified in the attached - /// network. - /// Disabled - this field will be empty. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string CloudServiceNetworkAttachmentIpv4Address { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)Property).CloudServiceNetworkAttachmentIpv4Address; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)Property).CloudServiceNetworkAttachmentIpv4Address = value ?? null; } - - /// - /// The IPv6 address of the virtual machine. - /// This field is used only if the attached network has IPAllocationType of IPV6 or DualStack. - /// If IPAllocationMethod is: - /// Static - this field must contain an IPv6 address range from within the range specified in the attached network. - /// Dynamic - this field is read-only, but will be populated with an range from within the subnet specified in the attached - /// network. - /// Disabled - this field will be empty. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string CloudServiceNetworkAttachmentIpv6Address { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)Property).CloudServiceNetworkAttachmentIpv6Address; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)Property).CloudServiceNetworkAttachmentIpv6Address = value ?? null; } - - /// - /// The MAC address of the interface for the virtual machine that corresponds to this network attachment. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string CloudServiceNetworkAttachmentMacAddress { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)Property).CloudServiceNetworkAttachmentMacAddress; } - - /// - /// The associated network's interface name. - /// If specified, the network attachment name has a maximum length of 15 characters and must be unique to this virtual machine. - /// If the user doesn’t specify this value, the default interface name of the network resource will be used. - /// For a CloudServicesNetwork resource, this name will be ignored. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string CloudServiceNetworkAttachmentName { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)Property).CloudServiceNetworkAttachmentName; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)Property).CloudServiceNetworkAttachmentName = value ?? null; } - - /// The resource ID of the cluster the virtual machine is created for. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string ClusterId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)Property).ClusterId; } - - /// The resource ID of the extended location on which the resource will be created. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string ConsoleExtendedLocationName { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)Property).ConsoleExtendedLocationName; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)Property).ConsoleExtendedLocationName = value ?? null; } - - /// The extended location type, for example, CustomLocation. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string ConsoleExtendedLocationType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)Property).ConsoleExtendedLocationType; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)Property).ConsoleExtendedLocationType = value ?? null; } - - /// The number of CPU cores in the virtual machine. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public long CpuCore { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)Property).CpuCore; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)Property).CpuCore = value ; } - - /// The more detailed status of the virtual machine. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineDetailedStatus? DetailedStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)Property).DetailedStatus; } - - /// The descriptive message about the current detailed status. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string DetailedStatusMessage { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)Property).DetailedStatusMessage; } - - /// Backing field for property. - private string _etag; - - /// Resource ETag. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string Etag { get => this._etag; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocation _extendedLocation; - - /// The extended location of the cluster associated with the resource. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocation ExtendedLocation { get => (this._extendedLocation = this._extendedLocation ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ExtendedLocation()); set => this._extendedLocation = value; } - - /// The resource ID of the extended location on which the resource will be created. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string ExtendedLocationName { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocationInternal)ExtendedLocation).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocationInternal)ExtendedLocation).Name = value ; } - - /// The extended location type, for example, CustomLocation. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string ExtendedLocationType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocationInternal)ExtendedLocation).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocationInternal)ExtendedLocation).Type = value ; } - - /// - /// Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).Id; } - - /// - /// Field Deprecated, the value will be ignored if provided. The indicator of whether one of the specified CPU cores is isolated - /// to run the emulator thread for this virtual machine. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineIsolateEmulatorThread? IsolateEmulatorThread { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)Property).IsolateEmulatorThread; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)Property).IsolateEmulatorThread = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineIsolateEmulatorThread)""); } - - /// The geo-location where the resource lives - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)__trackedResource).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)__trackedResource).Location = value ; } - - /// The memory size of the virtual machine. Allocations are measured in gibibytes. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public long MemorySizeGb { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)Property).MemorySizeGb; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)Property).MemorySizeGb = value ; } - - /// Internal Acessors for AvailabilityZone - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal.AvailabilityZone { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)Property).AvailabilityZone; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)Property).AvailabilityZone = value; } - - /// Internal Acessors for BareMetalMachineId - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal.BareMetalMachineId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)Property).BareMetalMachineId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)Property).BareMetalMachineId = value; } - - /// Internal Acessors for CloudServiceNetworkAttachmentMacAddress - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal.CloudServiceNetworkAttachmentMacAddress { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)Property).CloudServiceNetworkAttachmentMacAddress; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)Property).CloudServiceNetworkAttachmentMacAddress = value; } - - /// Internal Acessors for CloudServicesNetworkAttachment - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkAttachment Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal.CloudServicesNetworkAttachment { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)Property).CloudServicesNetworkAttachment; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)Property).CloudServicesNetworkAttachment = value; } - - /// Internal Acessors for ClusterId - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal.ClusterId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)Property).ClusterId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)Property).ClusterId = value; } - - /// Internal Acessors for ConsoleExtendedLocation - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocation Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal.ConsoleExtendedLocation { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)Property).ConsoleExtendedLocation; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)Property).ConsoleExtendedLocation = value; } - - /// Internal Acessors for DetailedStatus - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineDetailedStatus? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal.DetailedStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)Property).DetailedStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)Property).DetailedStatus = value; } - - /// Internal Acessors for DetailedStatusMessage - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal.DetailedStatusMessage { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)Property).DetailedStatusMessage; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)Property).DetailedStatusMessage = value; } - - /// Internal Acessors for Etag - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal.Etag { get => this._etag; set { {_etag = value;} } } - - /// Internal Acessors for ExtendedLocation - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocation Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal.ExtendedLocation { get => (this._extendedLocation = this._extendedLocation ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ExtendedLocation()); set { {_extendedLocation = value;} } } - - /// Internal Acessors for PowerState - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachinePowerState? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal.PowerState { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)Property).PowerState; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)Property).PowerState = value; } - - /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineProperties Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.VirtualMachineProperties()); set { {_property = value;} } } - - /// Internal Acessors for ProvisioningState - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineProvisioningState? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)Property).ProvisioningState = value; } - - /// Internal Acessors for StorageProfile - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageProfile Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal.StorageProfile { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)Property).StorageProfile; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)Property).StorageProfile = value; } - - /// Internal Acessors for StorageProfileOSDisk - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOSDisk Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal.StorageProfileOSDisk { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)Property).StorageProfileOSDisk; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)Property).StorageProfileOSDisk = value; } - - /// Internal Acessors for VMImageRepositoryCredentials - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IImageRepositoryCredentials Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal.VMImageRepositoryCredentials { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)Property).VMImageRepositoryCredentials; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)Property).VMImageRepositoryCredentials = value; } - - /// Internal Acessors for Volume - string[] Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineInternal.Volume { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)Property).Volume; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)Property).Volume = value; } - - /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).Id = value; } - - /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).Name = value; } - - /// Internal Acessors for SystemData - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ISystemData Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal.SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemData; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemData = value; } - - /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).Type = value; } - - /// The name of the resource - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).Name; } - - /// The list of network attachments to the virtual machine. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkAttachment[] NetworkAttachment { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)Property).NetworkAttachment; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)Property).NetworkAttachment = value ?? null /* arrayOf */; } - - /// The Base64 encoded cloud-init network data. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string NetworkData { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)Property).NetworkData; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)Property).NetworkData = value ?? null; } - - /// The strategy for creating the OS disk. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.OSDiskCreateOption? OSDiskCreateOption { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)Property).OSDiskCreateOption; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)Property).OSDiskCreateOption = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.OSDiskCreateOption)""); } - - /// The strategy for deleting the OS disk. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.OSDiskDeleteOption? OSDiskDeleteOption { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)Property).OSDiskDeleteOption; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)Property).OSDiskDeleteOption = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.OSDiskDeleteOption)""); } - - /// - /// The size of the disk. Required if the createOption is Ephemeral. Allocations are measured in gibibytes. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public long OSDiskSizeGb { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)Property).OSDiskSizeGb; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)Property).OSDiskSizeGb = value ; } - - /// The scheduling hints for the virtual machine. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePlacementHint[] PlacementHint { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)Property).PlacementHint; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)Property).PlacementHint = value ?? null /* arrayOf */; } - - /// The power state of the virtual machine. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachinePowerState? PowerState { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)Property).PowerState; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineProperties _property; - - /// The list of the resource properties. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.VirtualMachineProperties()); set => this._property = value; } - - /// The provisioning state of the virtual machine. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineProvisioningState? ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)Property).ProvisioningState; } - - /// Gets the resource group name - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string ResourceGroupName { get => (new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Success ? new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Groups["resourceGroupName"].Value : null); } - - /// - /// The list of ssh public keys. Each key will be added to the virtual machine using the cloud-init ssh_authorized_keys mechanism - /// for the adminUsername. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey[] SshPublicKey { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)Property).SshPublicKey; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)Property).SshPublicKey = value ?? null /* arrayOf */; } - - /// - /// The resource IDs of volumes that are requested to be attached to the virtual machine. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string[] StorageProfileVolumeAttachment { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)Property).StorageProfileVolumeAttachment; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)Property).StorageProfileVolumeAttachment = value ?? null /* arrayOf */; } - - /// - /// Azure Resource Manager metadata containing createdBy and modifiedBy information. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ISystemData SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemData; } - - /// The timestamp of resource creation (UTC). - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataCreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataCreatedAt = value ?? default(global::System.DateTime); } - - /// The identity that created the resource. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataCreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataCreatedBy = value ?? null; } - - /// The type of identity that created the resource. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType? SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataCreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataCreatedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType)""); } - - /// The timestamp of resource last modification (UTC) - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataLastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataLastModifiedAt = value ?? default(global::System.DateTime); } - - /// The identity that last modified the resource. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataLastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataLastModifiedBy = value ?? null; } - - /// The type of identity that last modified the resource. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType? SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataLastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataLastModifiedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType)""); } - - /// Resource tags. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)__trackedResource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.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.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).Type; } - - /// The Base64 encoded cloud-init user data. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string UserData { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)Property).UserData; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)Property).UserData = value ?? null; } - - /// The type of the device model to use. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineDeviceModelType? VMDeviceModel { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)Property).VMDeviceModel; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)Property).VMDeviceModel = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineDeviceModelType)""); } - - /// - /// The virtual machine image that is currently provisioned to the OS disk, using the full url and tag notation used to pull - /// the image. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string VMImage { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)Property).VMImage; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)Property).VMImage = value ; } - - /// The password or token used to access an image in the target repository. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public System.Security.SecureString VMImageRepositoryCredentialsPassword { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)Property).VMImageRepositoryCredentialsPassword; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)Property).VMImageRepositoryCredentialsPassword = value ?? null; } - - /// - /// The URL of the authentication server used to validate the repository credentials. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string VMImageRepositoryCredentialsRegistryUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)Property).VMImageRepositoryCredentialsRegistryUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)Property).VMImageRepositoryCredentialsRegistryUrl = value ?? null; } - - /// The username used to access an image in the target repository. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string VMImageRepositoryCredentialsUsername { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)Property).VMImageRepositoryCredentialsUsername; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)Property).VMImageRepositoryCredentialsUsername = value ?? null; } - - /// - /// Field Deprecated, use virtualizationModel instead. The type of the virtio interface. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineVirtioInterfaceType? VirtioInterface { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)Property).VirtioInterface; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)Property).VirtioInterface = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineVirtioInterfaceType)""); } - - /// The resource IDs of volumes that are attached to the virtual machine. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string[] Volume { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)Property).Volume; } - - /// Validates that this object meets the validation criteria. - /// an instance that will receive validation - /// events. - /// - /// A that will be complete when validation is completed. - /// - public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) - { - await eventListener.AssertNotNull(nameof(__trackedResource), __trackedResource); - await eventListener.AssertObjectIsValid(nameof(__trackedResource), __trackedResource); - } - - /// Creates an new instance. - public VirtualMachine() - { - - } - } - /// VirtualMachine represents the on-premises Network Cloud virtual machine. - public partial interface IVirtualMachine : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResource - { - /// - /// The name of the administrator to which the ssh public keys will be added into the authorized keys. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The name of the administrator to which the ssh public keys will be added into the authorized keys.", - SerializedName = @"adminUsername", - PossibleTypes = new [] { typeof(string) })] - string AdminUsername { get; set; } - /// The cluster availability zone containing this virtual machine. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The cluster availability zone containing this virtual machine.", - SerializedName = @"availabilityZone", - PossibleTypes = new [] { typeof(string) })] - string AvailabilityZone { get; } - /// The resource ID of the bare metal machine that hosts the virtual machine. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The resource ID of the bare metal machine that hosts the virtual machine.", - SerializedName = @"bareMetalMachineId", - PossibleTypes = new [] { typeof(string) })] - string BareMetalMachineId { get; } - /// Selects the boot method for the virtual machine. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Selects the boot method for the virtual machine.", - SerializedName = @"bootMethod", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineBootMethod) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineBootMethod? BootMethod { get; set; } - /// - /// The resource ID of the associated network attached to the virtual machine. - /// It can be one of cloudServicesNetwork, l3Network, l2Network or trunkedNetwork resources. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The resource ID of the associated network attached to the virtual machine. - It can be one of cloudServicesNetwork, l3Network, l2Network or trunkedNetwork resources.", - SerializedName = @"attachedNetworkId", - PossibleTypes = new [] { typeof(string) })] - string CloudServiceNetworkAttachmentAttachedNetworkId { get; set; } - /// - /// The indicator of whether this is the default gateway. - /// Only one of the attached networks (including the CloudServicesNetwork attachment) for a single machine may be specified - /// as True. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The indicator of whether this is the default gateway. - Only one of the attached networks (including the CloudServicesNetwork attachment) for a single machine may be specified as True.", - SerializedName = @"defaultGateway", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.DefaultGateway) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.DefaultGateway? CloudServiceNetworkAttachmentDefaultGateway { get; set; } - /// - /// The IP allocation mechanism for the virtual machine. - /// Dynamic and Static are only valid for l3Network which may also specify Disabled. - /// Otherwise, Disabled is the only permitted value. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The IP allocation mechanism for the virtual machine. - Dynamic and Static are only valid for l3Network which may also specify Disabled. - Otherwise, Disabled is the only permitted value.", - SerializedName = @"ipAllocationMethod", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineIPAllocationMethod) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineIPAllocationMethod CloudServiceNetworkAttachmentIPAllocationMethod { get; set; } - /// - /// The IPv4 address of the virtual machine. - /// This field is used only if the attached network has IPAllocationType of IPV4 or DualStack. - /// If IPAllocationMethod is: - /// Static - this field must contain a user specified IPv4 address from within the subnet specified in the attached network. - /// Dynamic - this field is read-only, but will be populated with an address from within the subnet specified in the attached - /// network. - /// Disabled - this field will be empty. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The IPv4 address of the virtual machine. - - This field is used only if the attached network has IPAllocationType of IPV4 or DualStack. - - If IPAllocationMethod is: - Static - this field must contain a user specified IPv4 address from within the subnet specified in the attached network. - Dynamic - this field is read-only, but will be populated with an address from within the subnet specified in the attached network. - Disabled - this field will be empty.", - SerializedName = @"ipv4Address", - PossibleTypes = new [] { typeof(string) })] - string CloudServiceNetworkAttachmentIpv4Address { get; set; } - /// - /// The IPv6 address of the virtual machine. - /// This field is used only if the attached network has IPAllocationType of IPV6 or DualStack. - /// If IPAllocationMethod is: - /// Static - this field must contain an IPv6 address range from within the range specified in the attached network. - /// Dynamic - this field is read-only, but will be populated with an range from within the subnet specified in the attached - /// network. - /// Disabled - this field will be empty. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The IPv6 address of the virtual machine. - - This field is used only if the attached network has IPAllocationType of IPV6 or DualStack. - - If IPAllocationMethod is: - Static - this field must contain an IPv6 address range from within the range specified in the attached network. - Dynamic - this field is read-only, but will be populated with an range from within the subnet specified in the attached network. - Disabled - this field will be empty.", - SerializedName = @"ipv6Address", - PossibleTypes = new [] { typeof(string) })] - string CloudServiceNetworkAttachmentIpv6Address { get; set; } - /// - /// The MAC address of the interface for the virtual machine that corresponds to this network attachment. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The MAC address of the interface for the virtual machine that corresponds to this network attachment.", - SerializedName = @"macAddress", - PossibleTypes = new [] { typeof(string) })] - string CloudServiceNetworkAttachmentMacAddress { get; } - /// - /// The associated network's interface name. - /// If specified, the network attachment name has a maximum length of 15 characters and must be unique to this virtual machine. - /// If the user doesn’t specify this value, the default interface name of the network resource will be used. - /// For a CloudServicesNetwork resource, this name will be ignored. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The associated network's interface name. - If specified, the network attachment name has a maximum length of 15 characters and must be unique to this virtual machine. - If the user doesn’t specify this value, the default interface name of the network resource will be used. - For a CloudServicesNetwork resource, this name will be ignored.", - SerializedName = @"networkAttachmentName", - PossibleTypes = new [] { typeof(string) })] - string CloudServiceNetworkAttachmentName { get; set; } - /// The resource ID of the cluster the virtual machine is created for. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The resource ID of the cluster the virtual machine is created for.", - SerializedName = @"clusterId", - PossibleTypes = new [] { typeof(string) })] - string ClusterId { get; } - /// The resource ID of the extended location on which the resource will be created. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The resource ID of the extended location on which the resource will be created.", - SerializedName = @"name", - PossibleTypes = new [] { typeof(string) })] - string ConsoleExtendedLocationName { get; set; } - /// The extended location type, for example, CustomLocation. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The extended location type, for example, CustomLocation.", - SerializedName = @"type", - PossibleTypes = new [] { typeof(string) })] - string ConsoleExtendedLocationType { get; set; } - /// The number of CPU cores in the virtual machine. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The number of CPU cores in the virtual machine.", - SerializedName = @"cpuCores", - PossibleTypes = new [] { typeof(long) })] - long CpuCore { get; set; } - /// The more detailed status of the virtual machine. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The more detailed status of the virtual machine.", - SerializedName = @"detailedStatus", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineDetailedStatus) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineDetailedStatus? DetailedStatus { get; } - /// The descriptive message about the current detailed status. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The descriptive message about the current detailed status.", - SerializedName = @"detailedStatusMessage", - PossibleTypes = new [] { typeof(string) })] - string DetailedStatusMessage { get; } - /// Resource ETag. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"Resource ETag.", - SerializedName = @"etag", - PossibleTypes = new [] { typeof(string) })] - string Etag { get; } - /// The resource ID of the extended location on which the resource will be created. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The resource ID of the extended location on which the resource will be created.", - SerializedName = @"name", - PossibleTypes = new [] { typeof(string) })] - string ExtendedLocationName { get; set; } - /// The extended location type, for example, CustomLocation. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The extended location type, for example, CustomLocation.", - SerializedName = @"type", - PossibleTypes = new [] { typeof(string) })] - string ExtendedLocationType { get; set; } - /// - /// Field Deprecated, the value will be ignored if provided. The indicator of whether one of the specified CPU cores is isolated - /// to run the emulator thread for this virtual machine. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Field Deprecated, the value will be ignored if provided. The indicator of whether one of the specified CPU cores is isolated to run the emulator thread for this virtual machine.", - SerializedName = @"isolateEmulatorThread", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineIsolateEmulatorThread) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineIsolateEmulatorThread? IsolateEmulatorThread { get; set; } - /// The memory size of the virtual machine. Allocations are measured in gibibytes. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The memory size of the virtual machine. Allocations are measured in gibibytes.", - SerializedName = @"memorySizeGB", - PossibleTypes = new [] { typeof(long) })] - long MemorySizeGb { get; set; } - /// The list of network attachments to the virtual machine. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The list of network attachments to the virtual machine.", - SerializedName = @"networkAttachments", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkAttachment) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkAttachment[] NetworkAttachment { get; set; } - /// The Base64 encoded cloud-init network data. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The Base64 encoded cloud-init network data.", - SerializedName = @"networkData", - PossibleTypes = new [] { typeof(string) })] - string NetworkData { get; set; } - /// The strategy for creating the OS disk. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The strategy for creating the OS disk.", - SerializedName = @"createOption", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.OSDiskCreateOption) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.OSDiskCreateOption? OSDiskCreateOption { get; set; } - /// The strategy for deleting the OS disk. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The strategy for deleting the OS disk.", - SerializedName = @"deleteOption", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.OSDiskDeleteOption) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.OSDiskDeleteOption? OSDiskDeleteOption { get; set; } - /// - /// The size of the disk. Required if the createOption is Ephemeral. Allocations are measured in gibibytes. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The size of the disk. Required if the createOption is Ephemeral. Allocations are measured in gibibytes.", - SerializedName = @"diskSizeGB", - PossibleTypes = new [] { typeof(long) })] - long OSDiskSizeGb { get; set; } - /// The scheduling hints for the virtual machine. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The scheduling hints for the virtual machine.", - SerializedName = @"placementHints", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePlacementHint) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePlacementHint[] PlacementHint { get; set; } - /// The power state of the virtual machine. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The power state of the virtual machine.", - SerializedName = @"powerState", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachinePowerState) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachinePowerState? PowerState { get; } - /// The provisioning state of the virtual machine. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The provisioning state of the virtual machine.", - SerializedName = @"provisioningState", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineProvisioningState) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineProvisioningState? ProvisioningState { get; } - /// - /// The list of ssh public keys. Each key will be added to the virtual machine using the cloud-init ssh_authorized_keys mechanism - /// for the adminUsername. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The list of ssh public keys. Each key will be added to the virtual machine using the cloud-init ssh_authorized_keys mechanism for the adminUsername.", - SerializedName = @"sshPublicKeys", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey[] SshPublicKey { get; set; } - /// - /// The resource IDs of volumes that are requested to be attached to the virtual machine. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The resource IDs of volumes that are requested to be attached to the virtual machine.", - SerializedName = @"volumeAttachments", - PossibleTypes = new [] { typeof(string) })] - string[] StorageProfileVolumeAttachment { get; set; } - /// The Base64 encoded cloud-init user data. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The Base64 encoded cloud-init user data.", - SerializedName = @"userData", - PossibleTypes = new [] { typeof(string) })] - string UserData { get; set; } - /// The type of the device model to use. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The type of the device model to use.", - SerializedName = @"vmDeviceModel", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineDeviceModelType) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineDeviceModelType? VMDeviceModel { get; set; } - /// - /// The virtual machine image that is currently provisioned to the OS disk, using the full url and tag notation used to pull - /// the image. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The virtual machine image that is currently provisioned to the OS disk, using the full url and tag notation used to pull the image.", - SerializedName = @"vmImage", - PossibleTypes = new [] { typeof(string) })] - string VMImage { get; set; } - /// The password or token used to access an image in the target repository. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The password or token used to access an image in the target repository.", - SerializedName = @"password", - PossibleTypes = new [] { typeof(System.Security.SecureString) })] - System.Security.SecureString VMImageRepositoryCredentialsPassword { get; set; } - /// - /// The URL of the authentication server used to validate the repository credentials. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The URL of the authentication server used to validate the repository credentials.", - SerializedName = @"registryUrl", - PossibleTypes = new [] { typeof(string) })] - string VMImageRepositoryCredentialsRegistryUrl { get; set; } - /// The username used to access an image in the target repository. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The username used to access an image in the target repository.", - SerializedName = @"username", - PossibleTypes = new [] { typeof(string) })] - string VMImageRepositoryCredentialsUsername { get; set; } - /// - /// Field Deprecated, use virtualizationModel instead. The type of the virtio interface. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Field Deprecated, use virtualizationModel instead. The type of the virtio interface.", - SerializedName = @"virtioInterface", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineVirtioInterfaceType) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineVirtioInterfaceType? VirtioInterface { get; set; } - /// The resource IDs of volumes that are attached to the virtual machine. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The resource IDs of volumes that are attached to the virtual machine.", - SerializedName = @"volumes", - PossibleTypes = new [] { typeof(string) })] - string[] Volume { get; } - - } - /// VirtualMachine represents the on-premises Network Cloud virtual machine. - internal partial interface IVirtualMachineInternal : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal - { - /// - /// The name of the administrator to which the ssh public keys will be added into the authorized keys. - /// - string AdminUsername { get; set; } - /// The cluster availability zone containing this virtual machine. - string AvailabilityZone { get; set; } - /// The resource ID of the bare metal machine that hosts the virtual machine. - string BareMetalMachineId { get; set; } - /// Selects the boot method for the virtual machine. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineBootMethod? BootMethod { get; set; } - /// - /// The resource ID of the associated network attached to the virtual machine. - /// It can be one of cloudServicesNetwork, l3Network, l2Network or trunkedNetwork resources. - /// - string CloudServiceNetworkAttachmentAttachedNetworkId { get; set; } - /// - /// The indicator of whether this is the default gateway. - /// Only one of the attached networks (including the CloudServicesNetwork attachment) for a single machine may be specified - /// as True. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.DefaultGateway? CloudServiceNetworkAttachmentDefaultGateway { get; set; } - /// - /// The IP allocation mechanism for the virtual machine. - /// Dynamic and Static are only valid for l3Network which may also specify Disabled. - /// Otherwise, Disabled is the only permitted value. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineIPAllocationMethod CloudServiceNetworkAttachmentIPAllocationMethod { get; set; } - /// - /// The IPv4 address of the virtual machine. - /// This field is used only if the attached network has IPAllocationType of IPV4 or DualStack. - /// If IPAllocationMethod is: - /// Static - this field must contain a user specified IPv4 address from within the subnet specified in the attached network. - /// Dynamic - this field is read-only, but will be populated with an address from within the subnet specified in the attached - /// network. - /// Disabled - this field will be empty. - /// - string CloudServiceNetworkAttachmentIpv4Address { get; set; } - /// - /// The IPv6 address of the virtual machine. - /// This field is used only if the attached network has IPAllocationType of IPV6 or DualStack. - /// If IPAllocationMethod is: - /// Static - this field must contain an IPv6 address range from within the range specified in the attached network. - /// Dynamic - this field is read-only, but will be populated with an range from within the subnet specified in the attached - /// network. - /// Disabled - this field will be empty. - /// - string CloudServiceNetworkAttachmentIpv6Address { get; set; } - /// - /// The MAC address of the interface for the virtual machine that corresponds to this network attachment. - /// - string CloudServiceNetworkAttachmentMacAddress { get; set; } - /// - /// The associated network's interface name. - /// If specified, the network attachment name has a maximum length of 15 characters and must be unique to this virtual machine. - /// If the user doesn’t specify this value, the default interface name of the network resource will be used. - /// For a CloudServicesNetwork resource, this name will be ignored. - /// - string CloudServiceNetworkAttachmentName { get; set; } - /// - /// The cloud service network that provides platform-level services for the virtual machine. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkAttachment CloudServicesNetworkAttachment { get; set; } - /// The resource ID of the cluster the virtual machine is created for. - string ClusterId { get; set; } - /// The extended location to use for creation of a VM console resource. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocation ConsoleExtendedLocation { get; set; } - /// The resource ID of the extended location on which the resource will be created. - string ConsoleExtendedLocationName { get; set; } - /// The extended location type, for example, CustomLocation. - string ConsoleExtendedLocationType { get; set; } - /// The number of CPU cores in the virtual machine. - long CpuCore { get; set; } - /// The more detailed status of the virtual machine. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineDetailedStatus? DetailedStatus { get; set; } - /// The descriptive message about the current detailed status. - string DetailedStatusMessage { get; set; } - /// Resource ETag. - string Etag { get; set; } - /// The extended location of the cluster associated with the resource. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocation ExtendedLocation { get; set; } - /// The resource ID of the extended location on which the resource will be created. - string ExtendedLocationName { get; set; } - /// The extended location type, for example, CustomLocation. - string ExtendedLocationType { get; set; } - /// - /// Field Deprecated, the value will be ignored if provided. The indicator of whether one of the specified CPU cores is isolated - /// to run the emulator thread for this virtual machine. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineIsolateEmulatorThread? IsolateEmulatorThread { get; set; } - /// The memory size of the virtual machine. Allocations are measured in gibibytes. - long MemorySizeGb { get; set; } - /// The list of network attachments to the virtual machine. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkAttachment[] NetworkAttachment { get; set; } - /// The Base64 encoded cloud-init network data. - string NetworkData { get; set; } - /// The strategy for creating the OS disk. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.OSDiskCreateOption? OSDiskCreateOption { get; set; } - /// The strategy for deleting the OS disk. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.OSDiskDeleteOption? OSDiskDeleteOption { get; set; } - /// - /// The size of the disk. Required if the createOption is Ephemeral. Allocations are measured in gibibytes. - /// - long OSDiskSizeGb { get; set; } - /// The scheduling hints for the virtual machine. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePlacementHint[] PlacementHint { get; set; } - /// The power state of the virtual machine. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachinePowerState? PowerState { get; set; } - /// The list of the resource properties. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineProperties Property { get; set; } - /// The provisioning state of the virtual machine. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineProvisioningState? ProvisioningState { get; set; } - /// - /// The list of ssh public keys. Each key will be added to the virtual machine using the cloud-init ssh_authorized_keys mechanism - /// for the adminUsername. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey[] SshPublicKey { get; set; } - /// - /// The storage profile that specifies size and other parameters about the disks related to the virtual machine. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageProfile StorageProfile { get; set; } - /// The disk to use with this virtual machine. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOSDisk StorageProfileOSDisk { get; set; } - /// - /// The resource IDs of volumes that are requested to be attached to the virtual machine. - /// - string[] StorageProfileVolumeAttachment { get; set; } - /// The Base64 encoded cloud-init user data. - string UserData { get; set; } - /// The type of the device model to use. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineDeviceModelType? VMDeviceModel { get; set; } - /// - /// The virtual machine image that is currently provisioned to the OS disk, using the full url and tag notation used to pull - /// the image. - /// - string VMImage { get; set; } - /// - /// The credentials used to login to the image repository that has access to the specified image. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IImageRepositoryCredentials VMImageRepositoryCredentials { get; set; } - /// The password or token used to access an image in the target repository. - System.Security.SecureString VMImageRepositoryCredentialsPassword { get; set; } - /// - /// The URL of the authentication server used to validate the repository credentials. - /// - string VMImageRepositoryCredentialsRegistryUrl { get; set; } - /// The username used to access an image in the target repository. - string VMImageRepositoryCredentialsUsername { get; set; } - /// - /// Field Deprecated, use virtualizationModel instead. The type of the virtio interface. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineVirtioInterfaceType? VirtioInterface { get; set; } - /// The resource IDs of volumes that are attached to the virtual machine. - string[] Volume { get; set; } - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VirtualMachineList.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VirtualMachineList.cs deleted file mode 100644 index acec36db5b1c..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VirtualMachineList.cs +++ /dev/null @@ -1,68 +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.NetworkCloud.Models.Api20250201 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; - - /// VirtualMachineList represents a list of virtual machines. - public partial class VirtualMachineList : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineList, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineListInternal - { - - /// Backing field for property. - private string _nextLink; - - /// The link used to get the next page of operations. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string NextLink { get => this._nextLink; set => this._nextLink = value; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachine[] _value; - - /// The list of virtual machines. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachine[] Value { get => this._value; set => this._value = value; } - - /// Creates an new instance. - public VirtualMachineList() - { - - } - } - /// VirtualMachineList represents a list of virtual machines. - public partial interface IVirtualMachineList : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable - { - /// The link used to get the next page of operations. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The link used to get the next page of operations.", - SerializedName = @"nextLink", - PossibleTypes = new [] { typeof(string) })] - string NextLink { get; set; } - /// The list of virtual machines. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The list of virtual machines.", - SerializedName = @"value", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachine) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachine[] Value { get; set; } - - } - /// VirtualMachineList represents a list of virtual machines. - internal partial interface IVirtualMachineListInternal - - { - /// The link used to get the next page of operations. - string NextLink { get; set; } - /// The list of virtual machines. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachine[] Value { get; set; } - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VirtualMachinePatchParameters.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VirtualMachinePatchParameters.PowerShell.cs deleted file mode 100644 index 013875022034..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VirtualMachinePatchParameters.PowerShell.cs +++ /dev/null @@ -1,208 +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.NetworkCloud.Models.Api20250201 -{ - using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; - - /// - /// VirtualMachinePatchParameters represents the body of the request to patch the virtual machine. - /// - [System.ComponentModel.TypeConverter(typeof(VirtualMachinePatchParametersTypeConverter))] - public partial class VirtualMachinePatchParameters - { - - /// - /// 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.NetworkCloud.Models.Api20250201.IVirtualMachinePatchParameters DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new VirtualMachinePatchParameters(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.NetworkCloud.Models.Api20250201.IVirtualMachinePatchParameters DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new VirtualMachinePatchParameters(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.NetworkCloud.Models.Api20250201.IVirtualMachinePatchParameters FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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 VirtualMachinePatchParameters(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.NetworkCloud.Models.Api20250201.IVirtualMachinePatchParametersInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePatchProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePatchParametersInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.VirtualMachinePatchPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Tag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePatchParametersInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePatchParametersTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePatchParametersInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.VirtualMachinePatchParametersTagsTypeConverter.ConvertFrom); - } - if (content.Contains("VMImageRepositoryCredentials")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePatchParametersInternal)this).VMImageRepositoryCredentials = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IImageRepositoryCredentials) content.GetValueForProperty("VMImageRepositoryCredentials",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePatchParametersInternal)this).VMImageRepositoryCredentials, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ImageRepositoryCredentialsTypeConverter.ConvertFrom); - } - if (content.Contains("VMImageRepositoryCredentialsPassword")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePatchParametersInternal)this).VMImageRepositoryCredentialsPassword = (System.Security.SecureString) content.GetValueForProperty("VMImageRepositoryCredentialsPassword",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePatchParametersInternal)this).VMImageRepositoryCredentialsPassword, (object ss) => (System.Security.SecureString)ss); - } - if (content.Contains("VMImageRepositoryCredentialsRegistryUrl")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePatchParametersInternal)this).VMImageRepositoryCredentialsRegistryUrl = (string) content.GetValueForProperty("VMImageRepositoryCredentialsRegistryUrl",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePatchParametersInternal)this).VMImageRepositoryCredentialsRegistryUrl, global::System.Convert.ToString); - } - if (content.Contains("VMImageRepositoryCredentialsUsername")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePatchParametersInternal)this).VMImageRepositoryCredentialsUsername = (string) content.GetValueForProperty("VMImageRepositoryCredentialsUsername",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePatchParametersInternal)this).VMImageRepositoryCredentialsUsername, 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 VirtualMachinePatchParameters(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.NetworkCloud.Models.Api20250201.IVirtualMachinePatchParametersInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePatchProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePatchParametersInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.VirtualMachinePatchPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Tag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePatchParametersInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePatchParametersTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePatchParametersInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.VirtualMachinePatchParametersTagsTypeConverter.ConvertFrom); - } - if (content.Contains("VMImageRepositoryCredentials")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePatchParametersInternal)this).VMImageRepositoryCredentials = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IImageRepositoryCredentials) content.GetValueForProperty("VMImageRepositoryCredentials",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePatchParametersInternal)this).VMImageRepositoryCredentials, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ImageRepositoryCredentialsTypeConverter.ConvertFrom); - } - if (content.Contains("VMImageRepositoryCredentialsPassword")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePatchParametersInternal)this).VMImageRepositoryCredentialsPassword = (System.Security.SecureString) content.GetValueForProperty("VMImageRepositoryCredentialsPassword",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePatchParametersInternal)this).VMImageRepositoryCredentialsPassword, (object ss) => (System.Security.SecureString)ss); - } - if (content.Contains("VMImageRepositoryCredentialsRegistryUrl")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePatchParametersInternal)this).VMImageRepositoryCredentialsRegistryUrl = (string) content.GetValueForProperty("VMImageRepositoryCredentialsRegistryUrl",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePatchParametersInternal)this).VMImageRepositoryCredentialsRegistryUrl, global::System.Convert.ToString); - } - if (content.Contains("VMImageRepositoryCredentialsUsername")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePatchParametersInternal)this).VMImageRepositoryCredentialsUsername = (string) content.GetValueForProperty("VMImageRepositoryCredentialsUsername",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePatchParametersInternal)this).VMImageRepositoryCredentialsUsername, global::System.Convert.ToString); - } - AfterDeserializePSObject(content); - } - } - /// VirtualMachinePatchParameters represents the body of the request to patch the virtual machine. - [System.ComponentModel.TypeConverter(typeof(VirtualMachinePatchParametersTypeConverter))] - public partial interface IVirtualMachinePatchParameters - - { - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VirtualMachinePatchParameters.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VirtualMachinePatchParameters.cs deleted file mode 100644 index 85d83f66f094..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VirtualMachinePatchParameters.cs +++ /dev/null @@ -1,120 +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.NetworkCloud.Models.Api20250201 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; - - /// - /// VirtualMachinePatchParameters represents the body of the request to patch the virtual machine. - /// - public partial class VirtualMachinePatchParameters : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePatchParameters, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePatchParametersInternal - { - - /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePatchProperties Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePatchParametersInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.VirtualMachinePatchProperties()); set { {_property = value;} } } - - /// Internal Acessors for VMImageRepositoryCredentials - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IImageRepositoryCredentials Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePatchParametersInternal.VMImageRepositoryCredentials { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePatchPropertiesInternal)Property).VMImageRepositoryCredentials; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePatchPropertiesInternal)Property).VMImageRepositoryCredentials = value; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePatchProperties _property; - - /// The list of the resource properties. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePatchProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.VirtualMachinePatchProperties()); set => this._property = value; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePatchParametersTags _tag; - - /// The Azure resource tags that will replace the existing ones. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePatchParametersTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.VirtualMachinePatchParametersTags()); set => this._tag = value; } - - /// The password or token used to access an image in the target repository. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public System.Security.SecureString VMImageRepositoryCredentialsPassword { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePatchPropertiesInternal)Property).VMImageRepositoryCredentialsPassword; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePatchPropertiesInternal)Property).VMImageRepositoryCredentialsPassword = value ?? null; } - - /// - /// The URL of the authentication server used to validate the repository credentials. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string VMImageRepositoryCredentialsRegistryUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePatchPropertiesInternal)Property).VMImageRepositoryCredentialsRegistryUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePatchPropertiesInternal)Property).VMImageRepositoryCredentialsRegistryUrl = value ?? null; } - - /// The username used to access an image in the target repository. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string VMImageRepositoryCredentialsUsername { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePatchPropertiesInternal)Property).VMImageRepositoryCredentialsUsername; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePatchPropertiesInternal)Property).VMImageRepositoryCredentialsUsername = value ?? null; } - - /// Creates an new instance. - public VirtualMachinePatchParameters() - { - - } - } - /// VirtualMachinePatchParameters represents the body of the request to patch the virtual machine. - public partial interface IVirtualMachinePatchParameters : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable - { - /// The Azure resource tags that will replace the existing ones. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The Azure resource tags that will replace the existing ones.", - SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePatchParametersTags) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePatchParametersTags Tag { get; set; } - /// The password or token used to access an image in the target repository. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The password or token used to access an image in the target repository.", - SerializedName = @"password", - PossibleTypes = new [] { typeof(System.Security.SecureString) })] - System.Security.SecureString VMImageRepositoryCredentialsPassword { get; set; } - /// - /// The URL of the authentication server used to validate the repository credentials. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The URL of the authentication server used to validate the repository credentials.", - SerializedName = @"registryUrl", - PossibleTypes = new [] { typeof(string) })] - string VMImageRepositoryCredentialsRegistryUrl { get; set; } - /// The username used to access an image in the target repository. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The username used to access an image in the target repository.", - SerializedName = @"username", - PossibleTypes = new [] { typeof(string) })] - string VMImageRepositoryCredentialsUsername { get; set; } - - } - /// VirtualMachinePatchParameters represents the body of the request to patch the virtual machine. - internal partial interface IVirtualMachinePatchParametersInternal - - { - /// The list of the resource properties. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePatchProperties Property { get; set; } - /// The Azure resource tags that will replace the existing ones. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePatchParametersTags Tag { get; set; } - /// - /// The credentials used to login to the image repository that has access to the specified image. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IImageRepositoryCredentials VMImageRepositoryCredentials { get; set; } - /// The password or token used to access an image in the target repository. - System.Security.SecureString VMImageRepositoryCredentialsPassword { get; set; } - /// - /// The URL of the authentication server used to validate the repository credentials. - /// - string VMImageRepositoryCredentialsRegistryUrl { get; set; } - /// The username used to access an image in the target repository. - string VMImageRepositoryCredentialsUsername { get; set; } - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VirtualMachinePatchProperties.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VirtualMachinePatchProperties.PowerShell.cs deleted file mode 100644 index fd37fbb6241c..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VirtualMachinePatchProperties.PowerShell.cs +++ /dev/null @@ -1,192 +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.NetworkCloud.Models.Api20250201 -{ - using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; - - /// - /// VirtualMachinePatchProperties represents the properties of the virtual machine that can be patched. - /// - [System.ComponentModel.TypeConverter(typeof(VirtualMachinePatchPropertiesTypeConverter))] - public partial class VirtualMachinePatchProperties - { - - /// - /// 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.NetworkCloud.Models.Api20250201.IVirtualMachinePatchProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new VirtualMachinePatchProperties(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.NetworkCloud.Models.Api20250201.IVirtualMachinePatchProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new VirtualMachinePatchProperties(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.NetworkCloud.Models.Api20250201.IVirtualMachinePatchProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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 VirtualMachinePatchProperties(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("VMImageRepositoryCredentials")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePatchPropertiesInternal)this).VMImageRepositoryCredentials = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IImageRepositoryCredentials) content.GetValueForProperty("VMImageRepositoryCredentials",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePatchPropertiesInternal)this).VMImageRepositoryCredentials, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ImageRepositoryCredentialsTypeConverter.ConvertFrom); - } - if (content.Contains("VMImageRepositoryCredentialsPassword")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePatchPropertiesInternal)this).VMImageRepositoryCredentialsPassword = (System.Security.SecureString) content.GetValueForProperty("VMImageRepositoryCredentialsPassword",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePatchPropertiesInternal)this).VMImageRepositoryCredentialsPassword, (object ss) => (System.Security.SecureString)ss); - } - if (content.Contains("VMImageRepositoryCredentialsRegistryUrl")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePatchPropertiesInternal)this).VMImageRepositoryCredentialsRegistryUrl = (string) content.GetValueForProperty("VMImageRepositoryCredentialsRegistryUrl",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePatchPropertiesInternal)this).VMImageRepositoryCredentialsRegistryUrl, global::System.Convert.ToString); - } - if (content.Contains("VMImageRepositoryCredentialsUsername")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePatchPropertiesInternal)this).VMImageRepositoryCredentialsUsername = (string) content.GetValueForProperty("VMImageRepositoryCredentialsUsername",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePatchPropertiesInternal)this).VMImageRepositoryCredentialsUsername, 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 VirtualMachinePatchProperties(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("VMImageRepositoryCredentials")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePatchPropertiesInternal)this).VMImageRepositoryCredentials = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IImageRepositoryCredentials) content.GetValueForProperty("VMImageRepositoryCredentials",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePatchPropertiesInternal)this).VMImageRepositoryCredentials, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ImageRepositoryCredentialsTypeConverter.ConvertFrom); - } - if (content.Contains("VMImageRepositoryCredentialsPassword")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePatchPropertiesInternal)this).VMImageRepositoryCredentialsPassword = (System.Security.SecureString) content.GetValueForProperty("VMImageRepositoryCredentialsPassword",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePatchPropertiesInternal)this).VMImageRepositoryCredentialsPassword, (object ss) => (System.Security.SecureString)ss); - } - if (content.Contains("VMImageRepositoryCredentialsRegistryUrl")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePatchPropertiesInternal)this).VMImageRepositoryCredentialsRegistryUrl = (string) content.GetValueForProperty("VMImageRepositoryCredentialsRegistryUrl",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePatchPropertiesInternal)this).VMImageRepositoryCredentialsRegistryUrl, global::System.Convert.ToString); - } - if (content.Contains("VMImageRepositoryCredentialsUsername")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePatchPropertiesInternal)this).VMImageRepositoryCredentialsUsername = (string) content.GetValueForProperty("VMImageRepositoryCredentialsUsername",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePatchPropertiesInternal)this).VMImageRepositoryCredentialsUsername, global::System.Convert.ToString); - } - AfterDeserializePSObject(content); - } - } - /// VirtualMachinePatchProperties represents the properties of the virtual machine that can be patched. - [System.ComponentModel.TypeConverter(typeof(VirtualMachinePatchPropertiesTypeConverter))] - public partial interface IVirtualMachinePatchProperties - - { - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VirtualMachinePatchProperties.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VirtualMachinePatchProperties.cs deleted file mode 100644 index 98d3cba4717a..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VirtualMachinePatchProperties.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.NetworkCloud.Models.Api20250201 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; - - /// - /// VirtualMachinePatchProperties represents the properties of the virtual machine that can be patched. - /// - public partial class VirtualMachinePatchProperties : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePatchProperties, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePatchPropertiesInternal - { - - /// Internal Acessors for VMImageRepositoryCredentials - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IImageRepositoryCredentials Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePatchPropertiesInternal.VMImageRepositoryCredentials { get => (this._vMImageRepositoryCredentials = this._vMImageRepositoryCredentials ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ImageRepositoryCredentials()); set { {_vMImageRepositoryCredentials = value;} } } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IImageRepositoryCredentials _vMImageRepositoryCredentials; - - /// - /// The credentials used to login to the image repository that has access to the specified image. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IImageRepositoryCredentials VMImageRepositoryCredentials { get => (this._vMImageRepositoryCredentials = this._vMImageRepositoryCredentials ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ImageRepositoryCredentials()); set => this._vMImageRepositoryCredentials = value; } - - /// The password or token used to access an image in the target repository. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public System.Security.SecureString VMImageRepositoryCredentialsPassword { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IImageRepositoryCredentialsInternal)VMImageRepositoryCredentials).Password; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IImageRepositoryCredentialsInternal)VMImageRepositoryCredentials).Password = value ?? null; } - - /// - /// The URL of the authentication server used to validate the repository credentials. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string VMImageRepositoryCredentialsRegistryUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IImageRepositoryCredentialsInternal)VMImageRepositoryCredentials).RegistryUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IImageRepositoryCredentialsInternal)VMImageRepositoryCredentials).RegistryUrl = value ?? null; } - - /// The username used to access an image in the target repository. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string VMImageRepositoryCredentialsUsername { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IImageRepositoryCredentialsInternal)VMImageRepositoryCredentials).Username; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IImageRepositoryCredentialsInternal)VMImageRepositoryCredentials).Username = value ?? null; } - - /// Creates an new instance. - public VirtualMachinePatchProperties() - { - - } - } - /// VirtualMachinePatchProperties represents the properties of the virtual machine that can be patched. - public partial interface IVirtualMachinePatchProperties : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable - { - /// The password or token used to access an image in the target repository. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The password or token used to access an image in the target repository.", - SerializedName = @"password", - PossibleTypes = new [] { typeof(System.Security.SecureString) })] - System.Security.SecureString VMImageRepositoryCredentialsPassword { get; set; } - /// - /// The URL of the authentication server used to validate the repository credentials. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The URL of the authentication server used to validate the repository credentials.", - SerializedName = @"registryUrl", - PossibleTypes = new [] { typeof(string) })] - string VMImageRepositoryCredentialsRegistryUrl { get; set; } - /// The username used to access an image in the target repository. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The username used to access an image in the target repository.", - SerializedName = @"username", - PossibleTypes = new [] { typeof(string) })] - string VMImageRepositoryCredentialsUsername { get; set; } - - } - /// VirtualMachinePatchProperties represents the properties of the virtual machine that can be patched. - internal partial interface IVirtualMachinePatchPropertiesInternal - - { - /// - /// The credentials used to login to the image repository that has access to the specified image. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IImageRepositoryCredentials VMImageRepositoryCredentials { get; set; } - /// The password or token used to access an image in the target repository. - System.Security.SecureString VMImageRepositoryCredentialsPassword { get; set; } - /// - /// The URL of the authentication server used to validate the repository credentials. - /// - string VMImageRepositoryCredentialsRegistryUrl { get; set; } - /// The username used to access an image in the target repository. - string VMImageRepositoryCredentialsUsername { get; set; } - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VirtualMachinePlacementHint.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VirtualMachinePlacementHint.PowerShell.cs deleted file mode 100644 index d47e9930edc9..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VirtualMachinePlacementHint.PowerShell.cs +++ /dev/null @@ -1,192 +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.NetworkCloud.Models.Api20250201 -{ - using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; - - /// - /// VirtualMachinePlacementHint represents a single scheduling hint of the virtual machine. - /// - [System.ComponentModel.TypeConverter(typeof(VirtualMachinePlacementHintTypeConverter))] - public partial class VirtualMachinePlacementHint - { - - /// - /// 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.NetworkCloud.Models.Api20250201.IVirtualMachinePlacementHint DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new VirtualMachinePlacementHint(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.NetworkCloud.Models.Api20250201.IVirtualMachinePlacementHint DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new VirtualMachinePlacementHint(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.NetworkCloud.Models.Api20250201.IVirtualMachinePlacementHint FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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 VirtualMachinePlacementHint(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("HintType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePlacementHintInternal)this).HintType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachinePlacementHintType) content.GetValueForProperty("HintType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePlacementHintInternal)this).HintType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachinePlacementHintType.CreateFrom); - } - if (content.Contains("ResourceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePlacementHintInternal)this).ResourceId = (string) content.GetValueForProperty("ResourceId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePlacementHintInternal)this).ResourceId, global::System.Convert.ToString); - } - if (content.Contains("SchedulingExecution")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePlacementHintInternal)this).SchedulingExecution = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineSchedulingExecution) content.GetValueForProperty("SchedulingExecution",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePlacementHintInternal)this).SchedulingExecution, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineSchedulingExecution.CreateFrom); - } - if (content.Contains("Scope")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePlacementHintInternal)this).Scope = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachinePlacementHintPodAffinityScope) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePlacementHintInternal)this).Scope, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachinePlacementHintPodAffinityScope.CreateFrom); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal VirtualMachinePlacementHint(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("HintType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePlacementHintInternal)this).HintType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachinePlacementHintType) content.GetValueForProperty("HintType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePlacementHintInternal)this).HintType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachinePlacementHintType.CreateFrom); - } - if (content.Contains("ResourceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePlacementHintInternal)this).ResourceId = (string) content.GetValueForProperty("ResourceId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePlacementHintInternal)this).ResourceId, global::System.Convert.ToString); - } - if (content.Contains("SchedulingExecution")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePlacementHintInternal)this).SchedulingExecution = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineSchedulingExecution) content.GetValueForProperty("SchedulingExecution",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePlacementHintInternal)this).SchedulingExecution, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineSchedulingExecution.CreateFrom); - } - if (content.Contains("Scope")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePlacementHintInternal)this).Scope = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachinePlacementHintPodAffinityScope) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePlacementHintInternal)this).Scope, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachinePlacementHintPodAffinityScope.CreateFrom); - } - AfterDeserializePSObject(content); - } - } - /// VirtualMachinePlacementHint represents a single scheduling hint of the virtual machine. - [System.ComponentModel.TypeConverter(typeof(VirtualMachinePlacementHintTypeConverter))] - public partial interface IVirtualMachinePlacementHint - - { - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VirtualMachinePlacementHint.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VirtualMachinePlacementHint.cs deleted file mode 100644 index 2b712f138f87..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VirtualMachinePlacementHint.cs +++ /dev/null @@ -1,134 +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.NetworkCloud.Models.Api20250201 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; - - /// - /// VirtualMachinePlacementHint represents a single scheduling hint of the virtual machine. - /// - public partial class VirtualMachinePlacementHint : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePlacementHint, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePlacementHintInternal - { - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachinePlacementHintType _hintType; - - /// - /// The specification of whether this hint supports affinity or anti-affinity with the referenced resources. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachinePlacementHintType HintType { get => this._hintType; set => this._hintType = value; } - - /// Backing field for property. - private string _resourceId; - - /// - /// The resource ID of the target object that the placement hints will be checked against, e.g., the bare metal node to host - /// the virtual machine. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string ResourceId { get => this._resourceId; set => this._resourceId = value; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineSchedulingExecution _schedulingExecution; - - /// - /// The indicator of whether the hint is a hard or soft requirement during scheduling. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineSchedulingExecution SchedulingExecution { get => this._schedulingExecution; set => this._schedulingExecution = value; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachinePlacementHintPodAffinityScope _scope; - - /// - /// The scope for the virtual machine affinity or anti-affinity placement hint. It should always be "Machine" in the case - /// of node affinity. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachinePlacementHintPodAffinityScope Scope { get => this._scope; set => this._scope = value; } - - /// Creates an new instance. - public VirtualMachinePlacementHint() - { - - } - } - /// VirtualMachinePlacementHint represents a single scheduling hint of the virtual machine. - public partial interface IVirtualMachinePlacementHint : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable - { - /// - /// The specification of whether this hint supports affinity or anti-affinity with the referenced resources. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The specification of whether this hint supports affinity or anti-affinity with the referenced resources.", - SerializedName = @"hintType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachinePlacementHintType) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachinePlacementHintType HintType { get; set; } - /// - /// The resource ID of the target object that the placement hints will be checked against, e.g., the bare metal node to host - /// the virtual machine. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The resource ID of the target object that the placement hints will be checked against, e.g., the bare metal node to host the virtual machine.", - SerializedName = @"resourceId", - PossibleTypes = new [] { typeof(string) })] - string ResourceId { get; set; } - /// - /// The indicator of whether the hint is a hard or soft requirement during scheduling. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The indicator of whether the hint is a hard or soft requirement during scheduling.", - SerializedName = @"schedulingExecution", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineSchedulingExecution) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineSchedulingExecution SchedulingExecution { get; set; } - /// - /// The scope for the virtual machine affinity or anti-affinity placement hint. It should always be "Machine" in the case - /// of node affinity. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The scope for the virtual machine affinity or anti-affinity placement hint. It should always be ""Machine"" in the case of node affinity.", - SerializedName = @"scope", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachinePlacementHintPodAffinityScope) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachinePlacementHintPodAffinityScope Scope { get; set; } - - } - /// VirtualMachinePlacementHint represents a single scheduling hint of the virtual machine. - internal partial interface IVirtualMachinePlacementHintInternal - - { - /// - /// The specification of whether this hint supports affinity or anti-affinity with the referenced resources. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachinePlacementHintType HintType { get; set; } - /// - /// The resource ID of the target object that the placement hints will be checked against, e.g., the bare metal node to host - /// the virtual machine. - /// - string ResourceId { get; set; } - /// - /// The indicator of whether the hint is a hard or soft requirement during scheduling. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineSchedulingExecution SchedulingExecution { get; set; } - /// - /// The scope for the virtual machine affinity or anti-affinity placement hint. It should always be "Machine" in the case - /// of node affinity. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachinePlacementHintPodAffinityScope Scope { get; set; } - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VirtualMachinePowerOffParameters.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VirtualMachinePowerOffParameters.cs deleted file mode 100644 index fcc2d1af273d..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VirtualMachinePowerOffParameters.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.NetworkCloud.Models.Api20250201 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; - - /// - /// VirtualMachinePowerOffParameters represents the body of the request to power off virtual machine. - /// - public partial class VirtualMachinePowerOffParameters : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePowerOffParameters, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePowerOffParametersInternal - { - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.SkipShutdown? _skipShutdown; - - /// - /// The indicator of whether to skip the graceful OS shutdown and power off the virtual machine immediately. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.SkipShutdown? SkipShutdown { get => this._skipShutdown; set => this._skipShutdown = value; } - - /// Creates an new instance. - public VirtualMachinePowerOffParameters() - { - - } - } - /// VirtualMachinePowerOffParameters represents the body of the request to power off virtual machine. - public partial interface IVirtualMachinePowerOffParameters : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable - { - /// - /// The indicator of whether to skip the graceful OS shutdown and power off the virtual machine immediately. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The indicator of whether to skip the graceful OS shutdown and power off the virtual machine immediately.", - SerializedName = @"skipShutdown", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.SkipShutdown) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.SkipShutdown? SkipShutdown { get; set; } - - } - /// VirtualMachinePowerOffParameters represents the body of the request to power off virtual machine. - internal partial interface IVirtualMachinePowerOffParametersInternal - - { - /// - /// The indicator of whether to skip the graceful OS shutdown and power off the virtual machine immediately. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.SkipShutdown? SkipShutdown { get; set; } - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VirtualMachineProperties.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VirtualMachineProperties.PowerShell.cs deleted file mode 100644 index 3808bc877486..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VirtualMachineProperties.PowerShell.cs +++ /dev/null @@ -1,494 +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.NetworkCloud.Models.Api20250201 -{ - using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; - - /// VirtualMachineProperties represents the properties of the virtual machine. - [System.ComponentModel.TypeConverter(typeof(VirtualMachinePropertiesTypeConverter))] - public partial class VirtualMachineProperties - { - - /// - /// 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.NetworkCloud.Models.Api20250201.IVirtualMachineProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new VirtualMachineProperties(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.NetworkCloud.Models.Api20250201.IVirtualMachineProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new VirtualMachineProperties(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.NetworkCloud.Models.Api20250201.IVirtualMachineProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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 VirtualMachineProperties(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("CloudServicesNetworkAttachment")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)this).CloudServicesNetworkAttachment = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkAttachment) content.GetValueForProperty("CloudServicesNetworkAttachment",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)this).CloudServicesNetworkAttachment, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.NetworkAttachmentTypeConverter.ConvertFrom); - } - if (content.Contains("ConsoleExtendedLocation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)this).ConsoleExtendedLocation = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocation) content.GetValueForProperty("ConsoleExtendedLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)this).ConsoleExtendedLocation, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ExtendedLocationTypeConverter.ConvertFrom); - } - if (content.Contains("StorageProfile")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)this).StorageProfile = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageProfile) content.GetValueForProperty("StorageProfile",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)this).StorageProfile, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.StorageProfileTypeConverter.ConvertFrom); - } - if (content.Contains("VMImageRepositoryCredentials")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)this).VMImageRepositoryCredentials = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IImageRepositoryCredentials) content.GetValueForProperty("VMImageRepositoryCredentials",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)this).VMImageRepositoryCredentials, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ImageRepositoryCredentialsTypeConverter.ConvertFrom); - } - if (content.Contains("AdminUsername")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)this).AdminUsername = (string) content.GetValueForProperty("AdminUsername",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)this).AdminUsername, global::System.Convert.ToString); - } - if (content.Contains("AvailabilityZone")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)this).AvailabilityZone = (string) content.GetValueForProperty("AvailabilityZone",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)this).AvailabilityZone, global::System.Convert.ToString); - } - if (content.Contains("BareMetalMachineId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)this).BareMetalMachineId = (string) content.GetValueForProperty("BareMetalMachineId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)this).BareMetalMachineId, global::System.Convert.ToString); - } - if (content.Contains("BootMethod")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)this).BootMethod = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineBootMethod?) content.GetValueForProperty("BootMethod",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)this).BootMethod, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineBootMethod.CreateFrom); - } - if (content.Contains("ClusterId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)this).ClusterId = (string) content.GetValueForProperty("ClusterId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)this).ClusterId, global::System.Convert.ToString); - } - if (content.Contains("CpuCore")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)this).CpuCore = (long) content.GetValueForProperty("CpuCore",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)this).CpuCore, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("DetailedStatus")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)this).DetailedStatus = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineDetailedStatus?) content.GetValueForProperty("DetailedStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)this).DetailedStatus, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineDetailedStatus.CreateFrom); - } - if (content.Contains("DetailedStatusMessage")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)this).DetailedStatusMessage = (string) content.GetValueForProperty("DetailedStatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)this).DetailedStatusMessage, global::System.Convert.ToString); - } - if (content.Contains("IsolateEmulatorThread")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)this).IsolateEmulatorThread = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineIsolateEmulatorThread?) content.GetValueForProperty("IsolateEmulatorThread",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)this).IsolateEmulatorThread, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineIsolateEmulatorThread.CreateFrom); - } - if (content.Contains("MemorySizeGb")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)this).MemorySizeGb = (long) content.GetValueForProperty("MemorySizeGb",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)this).MemorySizeGb, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("NetworkAttachment")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)this).NetworkAttachment = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkAttachment[]) content.GetValueForProperty("NetworkAttachment",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)this).NetworkAttachment, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.NetworkAttachmentTypeConverter.ConvertFrom)); - } - if (content.Contains("NetworkData")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)this).NetworkData = (string) content.GetValueForProperty("NetworkData",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)this).NetworkData, global::System.Convert.ToString); - } - if (content.Contains("PlacementHint")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)this).PlacementHint = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePlacementHint[]) content.GetValueForProperty("PlacementHint",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)this).PlacementHint, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.VirtualMachinePlacementHintTypeConverter.ConvertFrom)); - } - if (content.Contains("PowerState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)this).PowerState = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachinePowerState?) content.GetValueForProperty("PowerState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)this).PowerState, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachinePowerState.CreateFrom); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineProvisioningState.CreateFrom); - } - if (content.Contains("SshPublicKey")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)this).SshPublicKey = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey[]) content.GetValueForProperty("SshPublicKey",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)this).SshPublicKey, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.SshPublicKeyTypeConverter.ConvertFrom)); - } - if (content.Contains("UserData")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)this).UserData = (string) content.GetValueForProperty("UserData",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)this).UserData, global::System.Convert.ToString); - } - if (content.Contains("VirtioInterface")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)this).VirtioInterface = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineVirtioInterfaceType?) content.GetValueForProperty("VirtioInterface",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)this).VirtioInterface, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineVirtioInterfaceType.CreateFrom); - } - if (content.Contains("VMDeviceModel")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)this).VMDeviceModel = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineDeviceModelType?) content.GetValueForProperty("VMDeviceModel",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)this).VMDeviceModel, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineDeviceModelType.CreateFrom); - } - if (content.Contains("VMImage")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)this).VMImage = (string) content.GetValueForProperty("VMImage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)this).VMImage, global::System.Convert.ToString); - } - if (content.Contains("Volume")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)this).Volume = (string[]) content.GetValueForProperty("Volume",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)this).Volume, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("CloudServiceNetworkAttachmentDefaultGateway")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)this).CloudServiceNetworkAttachmentDefaultGateway = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.DefaultGateway?) content.GetValueForProperty("CloudServiceNetworkAttachmentDefaultGateway",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)this).CloudServiceNetworkAttachmentDefaultGateway, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.DefaultGateway.CreateFrom); - } - if (content.Contains("StorageProfileOSDisk")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)this).StorageProfileOSDisk = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOSDisk) content.GetValueForProperty("StorageProfileOSDisk",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)this).StorageProfileOSDisk, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.OSDiskTypeConverter.ConvertFrom); - } - if (content.Contains("StorageProfileVolumeAttachment")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)this).StorageProfileVolumeAttachment = (string[]) content.GetValueForProperty("StorageProfileVolumeAttachment",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)this).StorageProfileVolumeAttachment, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("CloudServiceNetworkAttachmentAttachedNetworkId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)this).CloudServiceNetworkAttachmentAttachedNetworkId = (string) content.GetValueForProperty("CloudServiceNetworkAttachmentAttachedNetworkId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)this).CloudServiceNetworkAttachmentAttachedNetworkId, global::System.Convert.ToString); - } - if (content.Contains("CloudServiceNetworkAttachmentIPAllocationMethod")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)this).CloudServiceNetworkAttachmentIPAllocationMethod = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineIPAllocationMethod) content.GetValueForProperty("CloudServiceNetworkAttachmentIPAllocationMethod",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)this).CloudServiceNetworkAttachmentIPAllocationMethod, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineIPAllocationMethod.CreateFrom); - } - if (content.Contains("CloudServiceNetworkAttachmentIpv4Address")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)this).CloudServiceNetworkAttachmentIpv4Address = (string) content.GetValueForProperty("CloudServiceNetworkAttachmentIpv4Address",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)this).CloudServiceNetworkAttachmentIpv4Address, global::System.Convert.ToString); - } - if (content.Contains("CloudServiceNetworkAttachmentIpv6Address")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)this).CloudServiceNetworkAttachmentIpv6Address = (string) content.GetValueForProperty("CloudServiceNetworkAttachmentIpv6Address",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)this).CloudServiceNetworkAttachmentIpv6Address, global::System.Convert.ToString); - } - if (content.Contains("CloudServiceNetworkAttachmentMacAddress")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)this).CloudServiceNetworkAttachmentMacAddress = (string) content.GetValueForProperty("CloudServiceNetworkAttachmentMacAddress",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)this).CloudServiceNetworkAttachmentMacAddress, global::System.Convert.ToString); - } - if (content.Contains("CloudServiceNetworkAttachmentName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)this).CloudServiceNetworkAttachmentName = (string) content.GetValueForProperty("CloudServiceNetworkAttachmentName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)this).CloudServiceNetworkAttachmentName, global::System.Convert.ToString); - } - if (content.Contains("ConsoleExtendedLocationName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)this).ConsoleExtendedLocationName = (string) content.GetValueForProperty("ConsoleExtendedLocationName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)this).ConsoleExtendedLocationName, global::System.Convert.ToString); - } - if (content.Contains("ConsoleExtendedLocationType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)this).ConsoleExtendedLocationType = (string) content.GetValueForProperty("ConsoleExtendedLocationType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)this).ConsoleExtendedLocationType, global::System.Convert.ToString); - } - if (content.Contains("VMImageRepositoryCredentialsPassword")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)this).VMImageRepositoryCredentialsPassword = (System.Security.SecureString) content.GetValueForProperty("VMImageRepositoryCredentialsPassword",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)this).VMImageRepositoryCredentialsPassword, (object ss) => (System.Security.SecureString)ss); - } - if (content.Contains("VMImageRepositoryCredentialsRegistryUrl")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)this).VMImageRepositoryCredentialsRegistryUrl = (string) content.GetValueForProperty("VMImageRepositoryCredentialsRegistryUrl",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)this).VMImageRepositoryCredentialsRegistryUrl, global::System.Convert.ToString); - } - if (content.Contains("VMImageRepositoryCredentialsUsername")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)this).VMImageRepositoryCredentialsUsername = (string) content.GetValueForProperty("VMImageRepositoryCredentialsUsername",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)this).VMImageRepositoryCredentialsUsername, global::System.Convert.ToString); - } - if (content.Contains("OSDiskCreateOption")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)this).OSDiskCreateOption = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.OSDiskCreateOption?) content.GetValueForProperty("OSDiskCreateOption",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)this).OSDiskCreateOption, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.OSDiskCreateOption.CreateFrom); - } - if (content.Contains("OSDiskDeleteOption")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)this).OSDiskDeleteOption = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.OSDiskDeleteOption?) content.GetValueForProperty("OSDiskDeleteOption",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)this).OSDiskDeleteOption, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.OSDiskDeleteOption.CreateFrom); - } - if (content.Contains("OSDiskSizeGb")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)this).OSDiskSizeGb = (long) content.GetValueForProperty("OSDiskSizeGb",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)this).OSDiskSizeGb, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal VirtualMachineProperties(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("CloudServicesNetworkAttachment")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)this).CloudServicesNetworkAttachment = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkAttachment) content.GetValueForProperty("CloudServicesNetworkAttachment",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)this).CloudServicesNetworkAttachment, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.NetworkAttachmentTypeConverter.ConvertFrom); - } - if (content.Contains("ConsoleExtendedLocation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)this).ConsoleExtendedLocation = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocation) content.GetValueForProperty("ConsoleExtendedLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)this).ConsoleExtendedLocation, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ExtendedLocationTypeConverter.ConvertFrom); - } - if (content.Contains("StorageProfile")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)this).StorageProfile = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageProfile) content.GetValueForProperty("StorageProfile",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)this).StorageProfile, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.StorageProfileTypeConverter.ConvertFrom); - } - if (content.Contains("VMImageRepositoryCredentials")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)this).VMImageRepositoryCredentials = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IImageRepositoryCredentials) content.GetValueForProperty("VMImageRepositoryCredentials",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)this).VMImageRepositoryCredentials, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ImageRepositoryCredentialsTypeConverter.ConvertFrom); - } - if (content.Contains("AdminUsername")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)this).AdminUsername = (string) content.GetValueForProperty("AdminUsername",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)this).AdminUsername, global::System.Convert.ToString); - } - if (content.Contains("AvailabilityZone")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)this).AvailabilityZone = (string) content.GetValueForProperty("AvailabilityZone",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)this).AvailabilityZone, global::System.Convert.ToString); - } - if (content.Contains("BareMetalMachineId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)this).BareMetalMachineId = (string) content.GetValueForProperty("BareMetalMachineId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)this).BareMetalMachineId, global::System.Convert.ToString); - } - if (content.Contains("BootMethod")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)this).BootMethod = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineBootMethod?) content.GetValueForProperty("BootMethod",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)this).BootMethod, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineBootMethod.CreateFrom); - } - if (content.Contains("ClusterId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)this).ClusterId = (string) content.GetValueForProperty("ClusterId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)this).ClusterId, global::System.Convert.ToString); - } - if (content.Contains("CpuCore")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)this).CpuCore = (long) content.GetValueForProperty("CpuCore",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)this).CpuCore, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("DetailedStatus")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)this).DetailedStatus = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineDetailedStatus?) content.GetValueForProperty("DetailedStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)this).DetailedStatus, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineDetailedStatus.CreateFrom); - } - if (content.Contains("DetailedStatusMessage")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)this).DetailedStatusMessage = (string) content.GetValueForProperty("DetailedStatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)this).DetailedStatusMessage, global::System.Convert.ToString); - } - if (content.Contains("IsolateEmulatorThread")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)this).IsolateEmulatorThread = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineIsolateEmulatorThread?) content.GetValueForProperty("IsolateEmulatorThread",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)this).IsolateEmulatorThread, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineIsolateEmulatorThread.CreateFrom); - } - if (content.Contains("MemorySizeGb")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)this).MemorySizeGb = (long) content.GetValueForProperty("MemorySizeGb",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)this).MemorySizeGb, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("NetworkAttachment")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)this).NetworkAttachment = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkAttachment[]) content.GetValueForProperty("NetworkAttachment",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)this).NetworkAttachment, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.NetworkAttachmentTypeConverter.ConvertFrom)); - } - if (content.Contains("NetworkData")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)this).NetworkData = (string) content.GetValueForProperty("NetworkData",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)this).NetworkData, global::System.Convert.ToString); - } - if (content.Contains("PlacementHint")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)this).PlacementHint = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePlacementHint[]) content.GetValueForProperty("PlacementHint",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)this).PlacementHint, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.VirtualMachinePlacementHintTypeConverter.ConvertFrom)); - } - if (content.Contains("PowerState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)this).PowerState = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachinePowerState?) content.GetValueForProperty("PowerState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)this).PowerState, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachinePowerState.CreateFrom); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineProvisioningState.CreateFrom); - } - if (content.Contains("SshPublicKey")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)this).SshPublicKey = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey[]) content.GetValueForProperty("SshPublicKey",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)this).SshPublicKey, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.SshPublicKeyTypeConverter.ConvertFrom)); - } - if (content.Contains("UserData")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)this).UserData = (string) content.GetValueForProperty("UserData",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)this).UserData, global::System.Convert.ToString); - } - if (content.Contains("VirtioInterface")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)this).VirtioInterface = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineVirtioInterfaceType?) content.GetValueForProperty("VirtioInterface",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)this).VirtioInterface, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineVirtioInterfaceType.CreateFrom); - } - if (content.Contains("VMDeviceModel")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)this).VMDeviceModel = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineDeviceModelType?) content.GetValueForProperty("VMDeviceModel",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)this).VMDeviceModel, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineDeviceModelType.CreateFrom); - } - if (content.Contains("VMImage")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)this).VMImage = (string) content.GetValueForProperty("VMImage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)this).VMImage, global::System.Convert.ToString); - } - if (content.Contains("Volume")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)this).Volume = (string[]) content.GetValueForProperty("Volume",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)this).Volume, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("CloudServiceNetworkAttachmentDefaultGateway")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)this).CloudServiceNetworkAttachmentDefaultGateway = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.DefaultGateway?) content.GetValueForProperty("CloudServiceNetworkAttachmentDefaultGateway",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)this).CloudServiceNetworkAttachmentDefaultGateway, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.DefaultGateway.CreateFrom); - } - if (content.Contains("StorageProfileOSDisk")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)this).StorageProfileOSDisk = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOSDisk) content.GetValueForProperty("StorageProfileOSDisk",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)this).StorageProfileOSDisk, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.OSDiskTypeConverter.ConvertFrom); - } - if (content.Contains("StorageProfileVolumeAttachment")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)this).StorageProfileVolumeAttachment = (string[]) content.GetValueForProperty("StorageProfileVolumeAttachment",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)this).StorageProfileVolumeAttachment, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("CloudServiceNetworkAttachmentAttachedNetworkId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)this).CloudServiceNetworkAttachmentAttachedNetworkId = (string) content.GetValueForProperty("CloudServiceNetworkAttachmentAttachedNetworkId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)this).CloudServiceNetworkAttachmentAttachedNetworkId, global::System.Convert.ToString); - } - if (content.Contains("CloudServiceNetworkAttachmentIPAllocationMethod")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)this).CloudServiceNetworkAttachmentIPAllocationMethod = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineIPAllocationMethod) content.GetValueForProperty("CloudServiceNetworkAttachmentIPAllocationMethod",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)this).CloudServiceNetworkAttachmentIPAllocationMethod, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineIPAllocationMethod.CreateFrom); - } - if (content.Contains("CloudServiceNetworkAttachmentIpv4Address")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)this).CloudServiceNetworkAttachmentIpv4Address = (string) content.GetValueForProperty("CloudServiceNetworkAttachmentIpv4Address",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)this).CloudServiceNetworkAttachmentIpv4Address, global::System.Convert.ToString); - } - if (content.Contains("CloudServiceNetworkAttachmentIpv6Address")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)this).CloudServiceNetworkAttachmentIpv6Address = (string) content.GetValueForProperty("CloudServiceNetworkAttachmentIpv6Address",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)this).CloudServiceNetworkAttachmentIpv6Address, global::System.Convert.ToString); - } - if (content.Contains("CloudServiceNetworkAttachmentMacAddress")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)this).CloudServiceNetworkAttachmentMacAddress = (string) content.GetValueForProperty("CloudServiceNetworkAttachmentMacAddress",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)this).CloudServiceNetworkAttachmentMacAddress, global::System.Convert.ToString); - } - if (content.Contains("CloudServiceNetworkAttachmentName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)this).CloudServiceNetworkAttachmentName = (string) content.GetValueForProperty("CloudServiceNetworkAttachmentName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)this).CloudServiceNetworkAttachmentName, global::System.Convert.ToString); - } - if (content.Contains("ConsoleExtendedLocationName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)this).ConsoleExtendedLocationName = (string) content.GetValueForProperty("ConsoleExtendedLocationName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)this).ConsoleExtendedLocationName, global::System.Convert.ToString); - } - if (content.Contains("ConsoleExtendedLocationType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)this).ConsoleExtendedLocationType = (string) content.GetValueForProperty("ConsoleExtendedLocationType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)this).ConsoleExtendedLocationType, global::System.Convert.ToString); - } - if (content.Contains("VMImageRepositoryCredentialsPassword")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)this).VMImageRepositoryCredentialsPassword = (System.Security.SecureString) content.GetValueForProperty("VMImageRepositoryCredentialsPassword",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)this).VMImageRepositoryCredentialsPassword, (object ss) => (System.Security.SecureString)ss); - } - if (content.Contains("VMImageRepositoryCredentialsRegistryUrl")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)this).VMImageRepositoryCredentialsRegistryUrl = (string) content.GetValueForProperty("VMImageRepositoryCredentialsRegistryUrl",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)this).VMImageRepositoryCredentialsRegistryUrl, global::System.Convert.ToString); - } - if (content.Contains("VMImageRepositoryCredentialsUsername")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)this).VMImageRepositoryCredentialsUsername = (string) content.GetValueForProperty("VMImageRepositoryCredentialsUsername",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)this).VMImageRepositoryCredentialsUsername, global::System.Convert.ToString); - } - if (content.Contains("OSDiskCreateOption")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)this).OSDiskCreateOption = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.OSDiskCreateOption?) content.GetValueForProperty("OSDiskCreateOption",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)this).OSDiskCreateOption, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.OSDiskCreateOption.CreateFrom); - } - if (content.Contains("OSDiskDeleteOption")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)this).OSDiskDeleteOption = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.OSDiskDeleteOption?) content.GetValueForProperty("OSDiskDeleteOption",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)this).OSDiskDeleteOption, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.OSDiskDeleteOption.CreateFrom); - } - if (content.Contains("OSDiskSizeGb")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)this).OSDiskSizeGb = (long) content.GetValueForProperty("OSDiskSizeGb",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal)this).OSDiskSizeGb, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - AfterDeserializePSObject(content); - } - } - /// VirtualMachineProperties represents the properties of the virtual machine. - [System.ComponentModel.TypeConverter(typeof(VirtualMachinePropertiesTypeConverter))] - public partial interface IVirtualMachineProperties - - { - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VirtualMachineProperties.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VirtualMachineProperties.cs deleted file mode 100644 index f9fbe671eecc..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VirtualMachineProperties.cs +++ /dev/null @@ -1,887 +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.NetworkCloud.Models.Api20250201 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; - - /// VirtualMachineProperties represents the properties of the virtual machine. - public partial class VirtualMachineProperties : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineProperties, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal - { - - /// Backing field for property. - private string _adminUsername; - - /// - /// The name of the administrator to which the ssh public keys will be added into the authorized keys. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string AdminUsername { get => this._adminUsername; set => this._adminUsername = value; } - - /// Backing field for property. - private string _availabilityZone; - - /// The cluster availability zone containing this virtual machine. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string AvailabilityZone { get => this._availabilityZone; } - - /// Backing field for property. - private string _bareMetalMachineId; - - /// The resource ID of the bare metal machine that hosts the virtual machine. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string BareMetalMachineId { get => this._bareMetalMachineId; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineBootMethod? _bootMethod; - - /// Selects the boot method for the virtual machine. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineBootMethod? BootMethod { get => this._bootMethod; set => this._bootMethod = value; } - - /// - /// The resource ID of the associated network attached to the virtual machine. - /// It can be one of cloudServicesNetwork, l3Network, l2Network or trunkedNetwork resources. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string CloudServiceNetworkAttachmentAttachedNetworkId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkAttachmentInternal)CloudServicesNetworkAttachment).AttachedNetworkId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkAttachmentInternal)CloudServicesNetworkAttachment).AttachedNetworkId = value ; } - - /// - /// The indicator of whether this is the default gateway. - /// Only one of the attached networks (including the CloudServicesNetwork attachment) for a single machine may be specified - /// as True. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.DefaultGateway? CloudServiceNetworkAttachmentDefaultGateway { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkAttachmentInternal)CloudServicesNetworkAttachment).DefaultGateway; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkAttachmentInternal)CloudServicesNetworkAttachment).DefaultGateway = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.DefaultGateway)""); } - - /// - /// The IP allocation mechanism for the virtual machine. - /// Dynamic and Static are only valid for l3Network which may also specify Disabled. - /// Otherwise, Disabled is the only permitted value. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineIPAllocationMethod CloudServiceNetworkAttachmentIPAllocationMethod { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkAttachmentInternal)CloudServicesNetworkAttachment).IPAllocationMethod; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkAttachmentInternal)CloudServicesNetworkAttachment).IPAllocationMethod = value ; } - - /// - /// The IPv4 address of the virtual machine. - /// This field is used only if the attached network has IPAllocationType of IPV4 or DualStack. - /// If IPAllocationMethod is: - /// Static - this field must contain a user specified IPv4 address from within the subnet specified in the attached network. - /// Dynamic - this field is read-only, but will be populated with an address from within the subnet specified in the attached - /// network. - /// Disabled - this field will be empty. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string CloudServiceNetworkAttachmentIpv4Address { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkAttachmentInternal)CloudServicesNetworkAttachment).Ipv4Address; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkAttachmentInternal)CloudServicesNetworkAttachment).Ipv4Address = value ?? null; } - - /// - /// The IPv6 address of the virtual machine. - /// This field is used only if the attached network has IPAllocationType of IPV6 or DualStack. - /// If IPAllocationMethod is: - /// Static - this field must contain an IPv6 address range from within the range specified in the attached network. - /// Dynamic - this field is read-only, but will be populated with an range from within the subnet specified in the attached - /// network. - /// Disabled - this field will be empty. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string CloudServiceNetworkAttachmentIpv6Address { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkAttachmentInternal)CloudServicesNetworkAttachment).Ipv6Address; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkAttachmentInternal)CloudServicesNetworkAttachment).Ipv6Address = value ?? null; } - - /// - /// The MAC address of the interface for the virtual machine that corresponds to this network attachment. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string CloudServiceNetworkAttachmentMacAddress { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkAttachmentInternal)CloudServicesNetworkAttachment).MacAddress; } - - /// - /// The associated network's interface name. - /// If specified, the network attachment name has a maximum length of 15 characters and must be unique to this virtual machine. - /// If the user doesn’t specify this value, the default interface name of the network resource will be used. - /// For a CloudServicesNetwork resource, this name will be ignored. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string CloudServiceNetworkAttachmentName { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkAttachmentInternal)CloudServicesNetworkAttachment).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkAttachmentInternal)CloudServicesNetworkAttachment).Name = value ?? null; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkAttachment _cloudServicesNetworkAttachment; - - /// - /// The cloud service network that provides platform-level services for the virtual machine. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkAttachment CloudServicesNetworkAttachment { get => (this._cloudServicesNetworkAttachment = this._cloudServicesNetworkAttachment ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.NetworkAttachment()); set => this._cloudServicesNetworkAttachment = value; } - - /// Backing field for property. - private string _clusterId; - - /// The resource ID of the cluster the virtual machine is created for. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string ClusterId { get => this._clusterId; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocation _consoleExtendedLocation; - - /// The extended location to use for creation of a VM console resource. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocation ConsoleExtendedLocation { get => (this._consoleExtendedLocation = this._consoleExtendedLocation ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ExtendedLocation()); set => this._consoleExtendedLocation = value; } - - /// The resource ID of the extended location on which the resource will be created. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string ConsoleExtendedLocationName { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocationInternal)ConsoleExtendedLocation).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocationInternal)ConsoleExtendedLocation).Name = value ?? null; } - - /// The extended location type, for example, CustomLocation. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string ConsoleExtendedLocationType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocationInternal)ConsoleExtendedLocation).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocationInternal)ConsoleExtendedLocation).Type = value ?? null; } - - /// Backing field for property. - private long _cpuCore; - - /// The number of CPU cores in the virtual machine. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public long CpuCore { get => this._cpuCore; set => this._cpuCore = value; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineDetailedStatus? _detailedStatus; - - /// The more detailed status of the virtual machine. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineDetailedStatus? DetailedStatus { get => this._detailedStatus; } - - /// Backing field for property. - private string _detailedStatusMessage; - - /// The descriptive message about the current detailed status. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string DetailedStatusMessage { get => this._detailedStatusMessage; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineIsolateEmulatorThread? _isolateEmulatorThread; - - /// - /// Field Deprecated, the value will be ignored if provided. The indicator of whether one of the specified CPU cores is isolated - /// to run the emulator thread for this virtual machine. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineIsolateEmulatorThread? IsolateEmulatorThread { get => this._isolateEmulatorThread; set => this._isolateEmulatorThread = value; } - - /// Backing field for property. - private long _memorySizeGb; - - /// The memory size of the virtual machine. Allocations are measured in gibibytes. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public long MemorySizeGb { get => this._memorySizeGb; set => this._memorySizeGb = value; } - - /// Internal Acessors for AvailabilityZone - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal.AvailabilityZone { get => this._availabilityZone; set { {_availabilityZone = value;} } } - - /// Internal Acessors for BareMetalMachineId - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal.BareMetalMachineId { get => this._bareMetalMachineId; set { {_bareMetalMachineId = value;} } } - - /// Internal Acessors for CloudServiceNetworkAttachmentMacAddress - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal.CloudServiceNetworkAttachmentMacAddress { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkAttachmentInternal)CloudServicesNetworkAttachment).MacAddress; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkAttachmentInternal)CloudServicesNetworkAttachment).MacAddress = value; } - - /// Internal Acessors for CloudServicesNetworkAttachment - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkAttachment Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal.CloudServicesNetworkAttachment { get => (this._cloudServicesNetworkAttachment = this._cloudServicesNetworkAttachment ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.NetworkAttachment()); set { {_cloudServicesNetworkAttachment = value;} } } - - /// Internal Acessors for ClusterId - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal.ClusterId { get => this._clusterId; set { {_clusterId = value;} } } - - /// Internal Acessors for ConsoleExtendedLocation - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocation Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal.ConsoleExtendedLocation { get => (this._consoleExtendedLocation = this._consoleExtendedLocation ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ExtendedLocation()); set { {_consoleExtendedLocation = value;} } } - - /// Internal Acessors for DetailedStatus - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineDetailedStatus? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal.DetailedStatus { get => this._detailedStatus; set { {_detailedStatus = value;} } } - - /// Internal Acessors for DetailedStatusMessage - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal.DetailedStatusMessage { get => this._detailedStatusMessage; set { {_detailedStatusMessage = value;} } } - - /// Internal Acessors for PowerState - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachinePowerState? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal.PowerState { get => this._powerState; set { {_powerState = value;} } } - - /// Internal Acessors for ProvisioningState - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineProvisioningState? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal.ProvisioningState { get => this._provisioningState; set { {_provisioningState = value;} } } - - /// Internal Acessors for StorageProfile - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageProfile Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal.StorageProfile { get => (this._storageProfile = this._storageProfile ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.StorageProfile()); set { {_storageProfile = value;} } } - - /// Internal Acessors for StorageProfileOSDisk - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOSDisk Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal.StorageProfileOSDisk { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageProfileInternal)StorageProfile).OSDisk; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageProfileInternal)StorageProfile).OSDisk = value; } - - /// Internal Acessors for VMImageRepositoryCredentials - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IImageRepositoryCredentials Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal.VMImageRepositoryCredentials { get => (this._vMImageRepositoryCredentials = this._vMImageRepositoryCredentials ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ImageRepositoryCredentials()); set { {_vMImageRepositoryCredentials = value;} } } - - /// Internal Acessors for Volume - string[] Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePropertiesInternal.Volume { get => this._volume; set { {_volume = value;} } } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkAttachment[] _networkAttachment; - - /// The list of network attachments to the virtual machine. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkAttachment[] NetworkAttachment { get => this._networkAttachment; set => this._networkAttachment = value; } - - /// Backing field for property. - private string _networkData; - - /// The Base64 encoded cloud-init network data. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string NetworkData { get => this._networkData; set => this._networkData = value; } - - /// The strategy for creating the OS disk. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.OSDiskCreateOption? OSDiskCreateOption { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageProfileInternal)StorageProfile).OSDiskCreateOption; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageProfileInternal)StorageProfile).OSDiskCreateOption = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.OSDiskCreateOption)""); } - - /// The strategy for deleting the OS disk. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.OSDiskDeleteOption? OSDiskDeleteOption { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageProfileInternal)StorageProfile).OSDiskDeleteOption; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageProfileInternal)StorageProfile).OSDiskDeleteOption = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.OSDiskDeleteOption)""); } - - /// - /// The size of the disk. Required if the createOption is Ephemeral. Allocations are measured in gibibytes. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public long OSDiskSizeGb { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageProfileInternal)StorageProfile).OSDiskSizeGb; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageProfileInternal)StorageProfile).OSDiskSizeGb = value ; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePlacementHint[] _placementHint; - - /// The scheduling hints for the virtual machine. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePlacementHint[] PlacementHint { get => this._placementHint; set => this._placementHint = value; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachinePowerState? _powerState; - - /// The power state of the virtual machine. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachinePowerState? PowerState { get => this._powerState; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineProvisioningState? _provisioningState; - - /// The provisioning state of the virtual machine. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineProvisioningState? ProvisioningState { get => this._provisioningState; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey[] _sshPublicKey; - - /// - /// The list of ssh public keys. Each key will be added to the virtual machine using the cloud-init ssh_authorized_keys mechanism - /// for the adminUsername. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey[] SshPublicKey { get => this._sshPublicKey; set => this._sshPublicKey = value; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageProfile _storageProfile; - - /// - /// The storage profile that specifies size and other parameters about the disks related to the virtual machine. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageProfile StorageProfile { get => (this._storageProfile = this._storageProfile ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.StorageProfile()); set => this._storageProfile = value; } - - /// - /// The resource IDs of volumes that are requested to be attached to the virtual machine. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string[] StorageProfileVolumeAttachment { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageProfileInternal)StorageProfile).VolumeAttachment; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageProfileInternal)StorageProfile).VolumeAttachment = value ?? null /* arrayOf */; } - - /// Backing field for property. - private string _userData; - - /// The Base64 encoded cloud-init user data. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string UserData { get => this._userData; set => this._userData = value; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineDeviceModelType? _vMDeviceModel; - - /// The type of the device model to use. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineDeviceModelType? VMDeviceModel { get => this._vMDeviceModel; set => this._vMDeviceModel = value; } - - /// Backing field for property. - private string _vMImage; - - /// - /// The virtual machine image that is currently provisioned to the OS disk, using the full url and tag notation used to pull - /// the image. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string VMImage { get => this._vMImage; set => this._vMImage = value; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IImageRepositoryCredentials _vMImageRepositoryCredentials; - - /// - /// The credentials used to login to the image repository that has access to the specified image. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IImageRepositoryCredentials VMImageRepositoryCredentials { get => (this._vMImageRepositoryCredentials = this._vMImageRepositoryCredentials ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ImageRepositoryCredentials()); set => this._vMImageRepositoryCredentials = value; } - - /// The password or token used to access an image in the target repository. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public System.Security.SecureString VMImageRepositoryCredentialsPassword { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IImageRepositoryCredentialsInternal)VMImageRepositoryCredentials).Password; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IImageRepositoryCredentialsInternal)VMImageRepositoryCredentials).Password = value ?? null; } - - /// - /// The URL of the authentication server used to validate the repository credentials. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string VMImageRepositoryCredentialsRegistryUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IImageRepositoryCredentialsInternal)VMImageRepositoryCredentials).RegistryUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IImageRepositoryCredentialsInternal)VMImageRepositoryCredentials).RegistryUrl = value ?? null; } - - /// The username used to access an image in the target repository. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string VMImageRepositoryCredentialsUsername { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IImageRepositoryCredentialsInternal)VMImageRepositoryCredentials).Username; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IImageRepositoryCredentialsInternal)VMImageRepositoryCredentials).Username = value ?? null; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineVirtioInterfaceType? _virtioInterface; - - /// - /// Field Deprecated, use virtualizationModel instead. The type of the virtio interface. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineVirtioInterfaceType? VirtioInterface { get => this._virtioInterface; set => this._virtioInterface = value; } - - /// Backing field for property. - private string[] _volume; - - /// The resource IDs of volumes that are attached to the virtual machine. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string[] Volume { get => this._volume; } - - /// Creates an new instance. - public VirtualMachineProperties() - { - - } - } - /// VirtualMachineProperties represents the properties of the virtual machine. - public partial interface IVirtualMachineProperties : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable - { - /// - /// The name of the administrator to which the ssh public keys will be added into the authorized keys. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The name of the administrator to which the ssh public keys will be added into the authorized keys.", - SerializedName = @"adminUsername", - PossibleTypes = new [] { typeof(string) })] - string AdminUsername { get; set; } - /// The cluster availability zone containing this virtual machine. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The cluster availability zone containing this virtual machine.", - SerializedName = @"availabilityZone", - PossibleTypes = new [] { typeof(string) })] - string AvailabilityZone { get; } - /// The resource ID of the bare metal machine that hosts the virtual machine. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The resource ID of the bare metal machine that hosts the virtual machine.", - SerializedName = @"bareMetalMachineId", - PossibleTypes = new [] { typeof(string) })] - string BareMetalMachineId { get; } - /// Selects the boot method for the virtual machine. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Selects the boot method for the virtual machine.", - SerializedName = @"bootMethod", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineBootMethod) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineBootMethod? BootMethod { get; set; } - /// - /// The resource ID of the associated network attached to the virtual machine. - /// It can be one of cloudServicesNetwork, l3Network, l2Network or trunkedNetwork resources. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The resource ID of the associated network attached to the virtual machine. - It can be one of cloudServicesNetwork, l3Network, l2Network or trunkedNetwork resources.", - SerializedName = @"attachedNetworkId", - PossibleTypes = new [] { typeof(string) })] - string CloudServiceNetworkAttachmentAttachedNetworkId { get; set; } - /// - /// The indicator of whether this is the default gateway. - /// Only one of the attached networks (including the CloudServicesNetwork attachment) for a single machine may be specified - /// as True. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The indicator of whether this is the default gateway. - Only one of the attached networks (including the CloudServicesNetwork attachment) for a single machine may be specified as True.", - SerializedName = @"defaultGateway", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.DefaultGateway) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.DefaultGateway? CloudServiceNetworkAttachmentDefaultGateway { get; set; } - /// - /// The IP allocation mechanism for the virtual machine. - /// Dynamic and Static are only valid for l3Network which may also specify Disabled. - /// Otherwise, Disabled is the only permitted value. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The IP allocation mechanism for the virtual machine. - Dynamic and Static are only valid for l3Network which may also specify Disabled. - Otherwise, Disabled is the only permitted value.", - SerializedName = @"ipAllocationMethod", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineIPAllocationMethod) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineIPAllocationMethod CloudServiceNetworkAttachmentIPAllocationMethod { get; set; } - /// - /// The IPv4 address of the virtual machine. - /// This field is used only if the attached network has IPAllocationType of IPV4 or DualStack. - /// If IPAllocationMethod is: - /// Static - this field must contain a user specified IPv4 address from within the subnet specified in the attached network. - /// Dynamic - this field is read-only, but will be populated with an address from within the subnet specified in the attached - /// network. - /// Disabled - this field will be empty. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The IPv4 address of the virtual machine. - - This field is used only if the attached network has IPAllocationType of IPV4 or DualStack. - - If IPAllocationMethod is: - Static - this field must contain a user specified IPv4 address from within the subnet specified in the attached network. - Dynamic - this field is read-only, but will be populated with an address from within the subnet specified in the attached network. - Disabled - this field will be empty.", - SerializedName = @"ipv4Address", - PossibleTypes = new [] { typeof(string) })] - string CloudServiceNetworkAttachmentIpv4Address { get; set; } - /// - /// The IPv6 address of the virtual machine. - /// This field is used only if the attached network has IPAllocationType of IPV6 or DualStack. - /// If IPAllocationMethod is: - /// Static - this field must contain an IPv6 address range from within the range specified in the attached network. - /// Dynamic - this field is read-only, but will be populated with an range from within the subnet specified in the attached - /// network. - /// Disabled - this field will be empty. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The IPv6 address of the virtual machine. - - This field is used only if the attached network has IPAllocationType of IPV6 or DualStack. - - If IPAllocationMethod is: - Static - this field must contain an IPv6 address range from within the range specified in the attached network. - Dynamic - this field is read-only, but will be populated with an range from within the subnet specified in the attached network. - Disabled - this field will be empty.", - SerializedName = @"ipv6Address", - PossibleTypes = new [] { typeof(string) })] - string CloudServiceNetworkAttachmentIpv6Address { get; set; } - /// - /// The MAC address of the interface for the virtual machine that corresponds to this network attachment. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The MAC address of the interface for the virtual machine that corresponds to this network attachment.", - SerializedName = @"macAddress", - PossibleTypes = new [] { typeof(string) })] - string CloudServiceNetworkAttachmentMacAddress { get; } - /// - /// The associated network's interface name. - /// If specified, the network attachment name has a maximum length of 15 characters and must be unique to this virtual machine. - /// If the user doesn’t specify this value, the default interface name of the network resource will be used. - /// For a CloudServicesNetwork resource, this name will be ignored. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The associated network's interface name. - If specified, the network attachment name has a maximum length of 15 characters and must be unique to this virtual machine. - If the user doesn’t specify this value, the default interface name of the network resource will be used. - For a CloudServicesNetwork resource, this name will be ignored.", - SerializedName = @"networkAttachmentName", - PossibleTypes = new [] { typeof(string) })] - string CloudServiceNetworkAttachmentName { get; set; } - /// The resource ID of the cluster the virtual machine is created for. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The resource ID of the cluster the virtual machine is created for.", - SerializedName = @"clusterId", - PossibleTypes = new [] { typeof(string) })] - string ClusterId { get; } - /// The resource ID of the extended location on which the resource will be created. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The resource ID of the extended location on which the resource will be created.", - SerializedName = @"name", - PossibleTypes = new [] { typeof(string) })] - string ConsoleExtendedLocationName { get; set; } - /// The extended location type, for example, CustomLocation. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The extended location type, for example, CustomLocation.", - SerializedName = @"type", - PossibleTypes = new [] { typeof(string) })] - string ConsoleExtendedLocationType { get; set; } - /// The number of CPU cores in the virtual machine. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The number of CPU cores in the virtual machine.", - SerializedName = @"cpuCores", - PossibleTypes = new [] { typeof(long) })] - long CpuCore { get; set; } - /// The more detailed status of the virtual machine. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The more detailed status of the virtual machine.", - SerializedName = @"detailedStatus", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineDetailedStatus) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineDetailedStatus? DetailedStatus { get; } - /// The descriptive message about the current detailed status. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The descriptive message about the current detailed status.", - SerializedName = @"detailedStatusMessage", - PossibleTypes = new [] { typeof(string) })] - string DetailedStatusMessage { get; } - /// - /// Field Deprecated, the value will be ignored if provided. The indicator of whether one of the specified CPU cores is isolated - /// to run the emulator thread for this virtual machine. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Field Deprecated, the value will be ignored if provided. The indicator of whether one of the specified CPU cores is isolated to run the emulator thread for this virtual machine.", - SerializedName = @"isolateEmulatorThread", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineIsolateEmulatorThread) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineIsolateEmulatorThread? IsolateEmulatorThread { get; set; } - /// The memory size of the virtual machine. Allocations are measured in gibibytes. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The memory size of the virtual machine. Allocations are measured in gibibytes.", - SerializedName = @"memorySizeGB", - PossibleTypes = new [] { typeof(long) })] - long MemorySizeGb { get; set; } - /// The list of network attachments to the virtual machine. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The list of network attachments to the virtual machine.", - SerializedName = @"networkAttachments", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkAttachment) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkAttachment[] NetworkAttachment { get; set; } - /// The Base64 encoded cloud-init network data. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The Base64 encoded cloud-init network data.", - SerializedName = @"networkData", - PossibleTypes = new [] { typeof(string) })] - string NetworkData { get; set; } - /// The strategy for creating the OS disk. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The strategy for creating the OS disk.", - SerializedName = @"createOption", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.OSDiskCreateOption) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.OSDiskCreateOption? OSDiskCreateOption { get; set; } - /// The strategy for deleting the OS disk. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The strategy for deleting the OS disk.", - SerializedName = @"deleteOption", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.OSDiskDeleteOption) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.OSDiskDeleteOption? OSDiskDeleteOption { get; set; } - /// - /// The size of the disk. Required if the createOption is Ephemeral. Allocations are measured in gibibytes. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The size of the disk. Required if the createOption is Ephemeral. Allocations are measured in gibibytes.", - SerializedName = @"diskSizeGB", - PossibleTypes = new [] { typeof(long) })] - long OSDiskSizeGb { get; set; } - /// The scheduling hints for the virtual machine. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The scheduling hints for the virtual machine.", - SerializedName = @"placementHints", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePlacementHint) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePlacementHint[] PlacementHint { get; set; } - /// The power state of the virtual machine. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The power state of the virtual machine.", - SerializedName = @"powerState", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachinePowerState) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachinePowerState? PowerState { get; } - /// The provisioning state of the virtual machine. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The provisioning state of the virtual machine.", - SerializedName = @"provisioningState", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineProvisioningState) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineProvisioningState? ProvisioningState { get; } - /// - /// The list of ssh public keys. Each key will be added to the virtual machine using the cloud-init ssh_authorized_keys mechanism - /// for the adminUsername. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The list of ssh public keys. Each key will be added to the virtual machine using the cloud-init ssh_authorized_keys mechanism for the adminUsername.", - SerializedName = @"sshPublicKeys", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey[] SshPublicKey { get; set; } - /// - /// The resource IDs of volumes that are requested to be attached to the virtual machine. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The resource IDs of volumes that are requested to be attached to the virtual machine.", - SerializedName = @"volumeAttachments", - PossibleTypes = new [] { typeof(string) })] - string[] StorageProfileVolumeAttachment { get; set; } - /// The Base64 encoded cloud-init user data. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The Base64 encoded cloud-init user data.", - SerializedName = @"userData", - PossibleTypes = new [] { typeof(string) })] - string UserData { get; set; } - /// The type of the device model to use. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The type of the device model to use.", - SerializedName = @"vmDeviceModel", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineDeviceModelType) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineDeviceModelType? VMDeviceModel { get; set; } - /// - /// The virtual machine image that is currently provisioned to the OS disk, using the full url and tag notation used to pull - /// the image. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The virtual machine image that is currently provisioned to the OS disk, using the full url and tag notation used to pull the image.", - SerializedName = @"vmImage", - PossibleTypes = new [] { typeof(string) })] - string VMImage { get; set; } - /// The password or token used to access an image in the target repository. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The password or token used to access an image in the target repository.", - SerializedName = @"password", - PossibleTypes = new [] { typeof(System.Security.SecureString) })] - System.Security.SecureString VMImageRepositoryCredentialsPassword { get; set; } - /// - /// The URL of the authentication server used to validate the repository credentials. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The URL of the authentication server used to validate the repository credentials.", - SerializedName = @"registryUrl", - PossibleTypes = new [] { typeof(string) })] - string VMImageRepositoryCredentialsRegistryUrl { get; set; } - /// The username used to access an image in the target repository. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The username used to access an image in the target repository.", - SerializedName = @"username", - PossibleTypes = new [] { typeof(string) })] - string VMImageRepositoryCredentialsUsername { get; set; } - /// - /// Field Deprecated, use virtualizationModel instead. The type of the virtio interface. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Field Deprecated, use virtualizationModel instead. The type of the virtio interface.", - SerializedName = @"virtioInterface", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineVirtioInterfaceType) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineVirtioInterfaceType? VirtioInterface { get; set; } - /// The resource IDs of volumes that are attached to the virtual machine. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The resource IDs of volumes that are attached to the virtual machine.", - SerializedName = @"volumes", - PossibleTypes = new [] { typeof(string) })] - string[] Volume { get; } - - } - /// VirtualMachineProperties represents the properties of the virtual machine. - internal partial interface IVirtualMachinePropertiesInternal - - { - /// - /// The name of the administrator to which the ssh public keys will be added into the authorized keys. - /// - string AdminUsername { get; set; } - /// The cluster availability zone containing this virtual machine. - string AvailabilityZone { get; set; } - /// The resource ID of the bare metal machine that hosts the virtual machine. - string BareMetalMachineId { get; set; } - /// Selects the boot method for the virtual machine. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineBootMethod? BootMethod { get; set; } - /// - /// The resource ID of the associated network attached to the virtual machine. - /// It can be one of cloudServicesNetwork, l3Network, l2Network or trunkedNetwork resources. - /// - string CloudServiceNetworkAttachmentAttachedNetworkId { get; set; } - /// - /// The indicator of whether this is the default gateway. - /// Only one of the attached networks (including the CloudServicesNetwork attachment) for a single machine may be specified - /// as True. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.DefaultGateway? CloudServiceNetworkAttachmentDefaultGateway { get; set; } - /// - /// The IP allocation mechanism for the virtual machine. - /// Dynamic and Static are only valid for l3Network which may also specify Disabled. - /// Otherwise, Disabled is the only permitted value. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineIPAllocationMethod CloudServiceNetworkAttachmentIPAllocationMethod { get; set; } - /// - /// The IPv4 address of the virtual machine. - /// This field is used only if the attached network has IPAllocationType of IPV4 or DualStack. - /// If IPAllocationMethod is: - /// Static - this field must contain a user specified IPv4 address from within the subnet specified in the attached network. - /// Dynamic - this field is read-only, but will be populated with an address from within the subnet specified in the attached - /// network. - /// Disabled - this field will be empty. - /// - string CloudServiceNetworkAttachmentIpv4Address { get; set; } - /// - /// The IPv6 address of the virtual machine. - /// This field is used only if the attached network has IPAllocationType of IPV6 or DualStack. - /// If IPAllocationMethod is: - /// Static - this field must contain an IPv6 address range from within the range specified in the attached network. - /// Dynamic - this field is read-only, but will be populated with an range from within the subnet specified in the attached - /// network. - /// Disabled - this field will be empty. - /// - string CloudServiceNetworkAttachmentIpv6Address { get; set; } - /// - /// The MAC address of the interface for the virtual machine that corresponds to this network attachment. - /// - string CloudServiceNetworkAttachmentMacAddress { get; set; } - /// - /// The associated network's interface name. - /// If specified, the network attachment name has a maximum length of 15 characters and must be unique to this virtual machine. - /// If the user doesn’t specify this value, the default interface name of the network resource will be used. - /// For a CloudServicesNetwork resource, this name will be ignored. - /// - string CloudServiceNetworkAttachmentName { get; set; } - /// - /// The cloud service network that provides platform-level services for the virtual machine. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkAttachment CloudServicesNetworkAttachment { get; set; } - /// The resource ID of the cluster the virtual machine is created for. - string ClusterId { get; set; } - /// The extended location to use for creation of a VM console resource. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocation ConsoleExtendedLocation { get; set; } - /// The resource ID of the extended location on which the resource will be created. - string ConsoleExtendedLocationName { get; set; } - /// The extended location type, for example, CustomLocation. - string ConsoleExtendedLocationType { get; set; } - /// The number of CPU cores in the virtual machine. - long CpuCore { get; set; } - /// The more detailed status of the virtual machine. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineDetailedStatus? DetailedStatus { get; set; } - /// The descriptive message about the current detailed status. - string DetailedStatusMessage { get; set; } - /// - /// Field Deprecated, the value will be ignored if provided. The indicator of whether one of the specified CPU cores is isolated - /// to run the emulator thread for this virtual machine. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineIsolateEmulatorThread? IsolateEmulatorThread { get; set; } - /// The memory size of the virtual machine. Allocations are measured in gibibytes. - long MemorySizeGb { get; set; } - /// The list of network attachments to the virtual machine. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkAttachment[] NetworkAttachment { get; set; } - /// The Base64 encoded cloud-init network data. - string NetworkData { get; set; } - /// The strategy for creating the OS disk. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.OSDiskCreateOption? OSDiskCreateOption { get; set; } - /// The strategy for deleting the OS disk. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.OSDiskDeleteOption? OSDiskDeleteOption { get; set; } - /// - /// The size of the disk. Required if the createOption is Ephemeral. Allocations are measured in gibibytes. - /// - long OSDiskSizeGb { get; set; } - /// The scheduling hints for the virtual machine. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePlacementHint[] PlacementHint { get; set; } - /// The power state of the virtual machine. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachinePowerState? PowerState { get; set; } - /// The provisioning state of the virtual machine. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineProvisioningState? ProvisioningState { get; set; } - /// - /// The list of ssh public keys. Each key will be added to the virtual machine using the cloud-init ssh_authorized_keys mechanism - /// for the adminUsername. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey[] SshPublicKey { get; set; } - /// - /// The storage profile that specifies size and other parameters about the disks related to the virtual machine. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageProfile StorageProfile { get; set; } - /// The disk to use with this virtual machine. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOSDisk StorageProfileOSDisk { get; set; } - /// - /// The resource IDs of volumes that are requested to be attached to the virtual machine. - /// - string[] StorageProfileVolumeAttachment { get; set; } - /// The Base64 encoded cloud-init user data. - string UserData { get; set; } - /// The type of the device model to use. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineDeviceModelType? VMDeviceModel { get; set; } - /// - /// The virtual machine image that is currently provisioned to the OS disk, using the full url and tag notation used to pull - /// the image. - /// - string VMImage { get; set; } - /// - /// The credentials used to login to the image repository that has access to the specified image. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IImageRepositoryCredentials VMImageRepositoryCredentials { get; set; } - /// The password or token used to access an image in the target repository. - System.Security.SecureString VMImageRepositoryCredentialsPassword { get; set; } - /// - /// The URL of the authentication server used to validate the repository credentials. - /// - string VMImageRepositoryCredentialsRegistryUrl { get; set; } - /// The username used to access an image in the target repository. - string VMImageRepositoryCredentialsUsername { get; set; } - /// - /// Field Deprecated, use virtualizationModel instead. The type of the virtio interface. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineVirtioInterfaceType? VirtioInterface { get; set; } - /// The resource IDs of volumes that are attached to the virtual machine. - string[] Volume { get; set; } - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VirtualMachineProperties.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VirtualMachineProperties.json.cs deleted file mode 100644 index ca3292f732ec..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VirtualMachineProperties.json.cs +++ /dev/null @@ -1,212 +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.NetworkCloud.Models.Api20250201 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; - - /// VirtualMachineProperties represents the properties of the virtual machine. - public partial class VirtualMachineProperties - { - - /// - /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object - /// before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The JsonNode that should be deserialized into this object. - - partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json); - - /// - /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The JSON container that the serialization result will be placed in. - - partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container); - - /// - /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of - /// the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the - /// output parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The JsonNode that should be deserialized into this object. - /// Determines if the rest of the deserialization should be processed, or if the method should return - /// instantly. - - partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json, ref bool returnNow); - - /// - /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the - /// object before it is serialized. - /// If you wish to disable the default serialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The JSON container that the serialization result will be placed in. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, ref bool returnNow); - - /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineProperties. - /// - /// a to deserialize from. - /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineProperties. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) - { - return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new VirtualMachineProperties(json) : null; - } - - /// - /// Serializes this instance of into a . - /// - /// The container to serialize this object into. If the caller - /// passes in null, a new instance will be created and returned to the caller. - /// Allows the caller to choose the depth of the serialization. See . - /// - /// a serialized instance of as a . - /// - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode) - { - container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject(); - - bool returnNow = false; - BeforeToJson(ref container, ref returnNow); - if (returnNow) - { - return container; - } - AddIf( null != this._cloudServicesNetworkAttachment ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) this._cloudServicesNetworkAttachment.ToJson(null,serializationMode) : null, "cloudServicesNetworkAttachment" ,container.Add ); - AddIf( null != this._consoleExtendedLocation ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) this._consoleExtendedLocation.ToJson(null,serializationMode) : null, "consoleExtendedLocation" ,container.Add ); - AddIf( null != this._storageProfile ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) this._storageProfile.ToJson(null,serializationMode) : null, "storageProfile" ,container.Add ); - AddIf( null != this._vMImageRepositoryCredentials ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) this._vMImageRepositoryCredentials.ToJson(null,serializationMode) : null, "vmImageRepositoryCredentials" ,container.Add ); - AddIf( null != (((object)this._adminUsername)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._adminUsername.ToString()) : null, "adminUsername" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) - { - AddIf( null != (((object)this._availabilityZone)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._availabilityZone.ToString()) : null, "availabilityZone" ,container.Add ); - } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) - { - AddIf( null != (((object)this._bareMetalMachineId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._bareMetalMachineId.ToString()) : null, "bareMetalMachineId" ,container.Add ); - } - AddIf( null != (((object)this._bootMethod)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._bootMethod.ToString()) : null, "bootMethod" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) - { - AddIf( null != (((object)this._clusterId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._clusterId.ToString()) : null, "clusterId" ,container.Add ); - } - AddIf( (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNumber(this._cpuCore), "cpuCores" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) - { - AddIf( null != (((object)this._detailedStatus)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._detailedStatus.ToString()) : null, "detailedStatus" ,container.Add ); - } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) - { - AddIf( null != (((object)this._detailedStatusMessage)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._detailedStatusMessage.ToString()) : null, "detailedStatusMessage" ,container.Add ); - } - AddIf( null != (((object)this._isolateEmulatorThread)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._isolateEmulatorThread.ToString()) : null, "isolateEmulatorThread" ,container.Add ); - AddIf( (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNumber(this._memorySizeGb), "memorySizeGB" ,container.Add ); - if (null != this._networkAttachment) - { - var __w = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.XNodeArray(); - foreach( var __x in this._networkAttachment ) - { - AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); - } - container.Add("networkAttachments",__w); - } - AddIf( null != (((object)this._networkData)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._networkData.ToString()) : null, "networkData" ,container.Add ); - if (null != this._placementHint) - { - var __r = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.XNodeArray(); - foreach( var __s in this._placementHint ) - { - AddIf(__s?.ToJson(null, serializationMode) ,__r.Add); - } - container.Add("placementHints",__r); - } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) - { - AddIf( null != (((object)this._powerState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._powerState.ToString()) : null, "powerState" ,container.Add ); - } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) - { - AddIf( null != (((object)this._provisioningState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._provisioningState.ToString()) : null, "provisioningState" ,container.Add ); - } - if (null != this._sshPublicKey) - { - var __m = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.XNodeArray(); - foreach( var __n in this._sshPublicKey ) - { - AddIf(__n?.ToJson(null, serializationMode) ,__m.Add); - } - container.Add("sshPublicKeys",__m); - } - AddIf( null != (((object)this._userData)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._userData.ToString()) : null, "userData" ,container.Add ); - AddIf( null != (((object)this._virtioInterface)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._virtioInterface.ToString()) : null, "virtioInterface" ,container.Add ); - AddIf( null != (((object)this._vMDeviceModel)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._vMDeviceModel.ToString()) : null, "vmDeviceModel" ,container.Add ); - AddIf( null != (((object)this._vMImage)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._vMImage.ToString()) : null, "vmImage" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) - { - if (null != this._volume) - { - var __h = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.XNodeArray(); - foreach( var __i in this._volume ) - { - AddIf(null != (((object)__i)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(__i.ToString()) : null ,__h.Add); - } - container.Add("volumes",__h); - } - } - AfterToJson(ref container); - return container; - } - - /// - /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject into a new instance of . - /// - /// A Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject instance to deserialize from. - internal VirtualMachineProperties(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) - { - bool returnNow = false; - BeforeFromJson(json, ref returnNow); - if (returnNow) - { - return; - } - {_cloudServicesNetworkAttachment = If( json?.PropertyT("cloudServicesNetworkAttachment"), out var __jsonCloudServicesNetworkAttachment) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.NetworkAttachment.FromJson(__jsonCloudServicesNetworkAttachment) : CloudServicesNetworkAttachment;} - {_consoleExtendedLocation = If( json?.PropertyT("consoleExtendedLocation"), out var __jsonConsoleExtendedLocation) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ExtendedLocation.FromJson(__jsonConsoleExtendedLocation) : ConsoleExtendedLocation;} - {_storageProfile = If( json?.PropertyT("storageProfile"), out var __jsonStorageProfile) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.StorageProfile.FromJson(__jsonStorageProfile) : StorageProfile;} - {_vMImageRepositoryCredentials = If( json?.PropertyT("vmImageRepositoryCredentials"), out var __jsonVMImageRepositoryCredentials) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ImageRepositoryCredentials.FromJson(__jsonVMImageRepositoryCredentials) : VMImageRepositoryCredentials;} - {_adminUsername = If( json?.PropertyT("adminUsername"), out var __jsonAdminUsername) ? (string)__jsonAdminUsername : (string)AdminUsername;} - {_availabilityZone = If( json?.PropertyT("availabilityZone"), out var __jsonAvailabilityZone) ? (string)__jsonAvailabilityZone : (string)AvailabilityZone;} - {_bareMetalMachineId = If( json?.PropertyT("bareMetalMachineId"), out var __jsonBareMetalMachineId) ? (string)__jsonBareMetalMachineId : (string)BareMetalMachineId;} - {_bootMethod = If( json?.PropertyT("bootMethod"), out var __jsonBootMethod) ? (string)__jsonBootMethod : (string)BootMethod;} - {_clusterId = If( json?.PropertyT("clusterId"), out var __jsonClusterId) ? (string)__jsonClusterId : (string)ClusterId;} - {_cpuCore = If( json?.PropertyT("cpuCores"), out var __jsonCpuCores) ? (long)__jsonCpuCores : CpuCore;} - {_detailedStatus = If( json?.PropertyT("detailedStatus"), out var __jsonDetailedStatus) ? (string)__jsonDetailedStatus : (string)DetailedStatus;} - {_detailedStatusMessage = If( json?.PropertyT("detailedStatusMessage"), out var __jsonDetailedStatusMessage) ? (string)__jsonDetailedStatusMessage : (string)DetailedStatusMessage;} - {_isolateEmulatorThread = If( json?.PropertyT("isolateEmulatorThread"), out var __jsonIsolateEmulatorThread) ? (string)__jsonIsolateEmulatorThread : (string)IsolateEmulatorThread;} - {_memorySizeGb = If( json?.PropertyT("memorySizeGB"), out var __jsonMemorySizeGb) ? (long)__jsonMemorySizeGb : MemorySizeGb;} - {_networkAttachment = If( json?.PropertyT("networkAttachments"), out var __jsonNetworkAttachments) ? If( __jsonNetworkAttachments as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.INetworkAttachment) (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.NetworkAttachment.FromJson(__u) )) ))() : null : NetworkAttachment;} - {_networkData = If( json?.PropertyT("networkData"), out var __jsonNetworkData) ? (string)__jsonNetworkData : (string)NetworkData;} - {_placementHint = If( json?.PropertyT("placementHints"), out var __jsonPlacementHints) ? If( __jsonPlacementHints as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IVirtualMachinePlacementHint) (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.VirtualMachinePlacementHint.FromJson(__p) )) ))() : null : PlacementHint;} - {_powerState = If( json?.PropertyT("powerState"), out var __jsonPowerState) ? (string)__jsonPowerState : (string)PowerState;} - {_provisioningState = If( json?.PropertyT("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)ProvisioningState;} - {_sshPublicKey = If( json?.PropertyT("sshPublicKeys"), out var __jsonSshPublicKeys) ? If( __jsonSshPublicKeys as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonArray, out var __l) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__l, (__k)=>(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey) (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.SshPublicKey.FromJson(__k) )) ))() : null : SshPublicKey;} - {_userData = If( json?.PropertyT("userData"), out var __jsonUserData) ? (string)__jsonUserData : (string)UserData;} - {_virtioInterface = If( json?.PropertyT("virtioInterface"), out var __jsonVirtioInterface) ? (string)__jsonVirtioInterface : (string)VirtioInterface;} - {_vMDeviceModel = If( json?.PropertyT("vmDeviceModel"), out var __jsonVMDeviceModel) ? (string)__jsonVMDeviceModel : (string)VMDeviceModel;} - {_vMImage = If( json?.PropertyT("vmImage"), out var __jsonVMImage) ? (string)__jsonVMImage : (string)VMImage;} - {_volume = If( json?.PropertyT("volumes"), out var __jsonVolumes) ? If( __jsonVolumes as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Json.JsonString __e ? (string)(__e.ToString()) : null)) ))() : null : Volume;} - AfterFromJson(json); - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/Volume.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/Volume.PowerShell.cs deleted file mode 100644 index f7fe72226beb..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/Volume.PowerShell.cs +++ /dev/null @@ -1,342 +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.NetworkCloud.Models.Api20250201 -{ - using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; - - /// - /// Volume represents storage made available for use by resources running on the cluster. - /// - [System.ComponentModel.TypeConverter(typeof(VolumeTypeConverter))] - public partial class Volume - { - - /// - /// 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.NetworkCloud.Models.Api20250201.IVolume DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new Volume(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.NetworkCloud.Models.Api20250201.IVolume DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new Volume(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.NetworkCloud.Models.Api20250201.IVolume FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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 Volume(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("ExtendedLocation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolumeInternal)this).ExtendedLocation = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocation) content.GetValueForProperty("ExtendedLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolumeInternal)this).ExtendedLocation, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ExtendedLocationTypeConverter.ConvertFrom); - } - if (content.Contains("Property")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolumeInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolumeProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolumeInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.VolumePropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Etag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolumeInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolumeInternal)this).Etag, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)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("SystemDataCreatedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataLastModifiedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("SystemData")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.SystemDataTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Type, global::System.Convert.ToString); - } - if (content.Contains("Tag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.TrackedResourceTagsTypeConverter.ConvertFrom); - } - if (content.Contains("Location")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); - } - if (content.Contains("ExtendedLocationName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolumeInternal)this).ExtendedLocationName = (string) content.GetValueForProperty("ExtendedLocationName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolumeInternal)this).ExtendedLocationName, global::System.Convert.ToString); - } - if (content.Contains("ExtendedLocationType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolumeInternal)this).ExtendedLocationType = (string) content.GetValueForProperty("ExtendedLocationType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolumeInternal)this).ExtendedLocationType, global::System.Convert.ToString); - } - if (content.Contains("AttachedTo")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolumeInternal)this).AttachedTo = (string[]) content.GetValueForProperty("AttachedTo",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolumeInternal)this).AttachedTo, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("DetailedStatus")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolumeInternal)this).DetailedStatus = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VolumeDetailedStatus?) content.GetValueForProperty("DetailedStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolumeInternal)this).DetailedStatus, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VolumeDetailedStatus.CreateFrom); - } - if (content.Contains("DetailedStatusMessage")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolumeInternal)this).DetailedStatusMessage = (string) content.GetValueForProperty("DetailedStatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolumeInternal)this).DetailedStatusMessage, global::System.Convert.ToString); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolumeInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VolumeProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolumeInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VolumeProvisioningState.CreateFrom); - } - if (content.Contains("SerialNumber")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolumeInternal)this).SerialNumber = (string) content.GetValueForProperty("SerialNumber",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolumeInternal)this).SerialNumber, global::System.Convert.ToString); - } - if (content.Contains("SizeMiB")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolumeInternal)this).SizeMiB = (long) content.GetValueForProperty("SizeMiB",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolumeInternal)this).SizeMiB, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal Volume(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("ExtendedLocation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolumeInternal)this).ExtendedLocation = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocation) content.GetValueForProperty("ExtendedLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolumeInternal)this).ExtendedLocation, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ExtendedLocationTypeConverter.ConvertFrom); - } - if (content.Contains("Property")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolumeInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolumeProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolumeInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.VolumePropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Etag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolumeInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolumeInternal)this).Etag, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)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("SystemDataCreatedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataLastModifiedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("SystemData")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.SystemDataTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Type, global::System.Convert.ToString); - } - if (content.Contains("Tag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.TrackedResourceTagsTypeConverter.ConvertFrom); - } - if (content.Contains("Location")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); - } - if (content.Contains("ExtendedLocationName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolumeInternal)this).ExtendedLocationName = (string) content.GetValueForProperty("ExtendedLocationName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolumeInternal)this).ExtendedLocationName, global::System.Convert.ToString); - } - if (content.Contains("ExtendedLocationType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolumeInternal)this).ExtendedLocationType = (string) content.GetValueForProperty("ExtendedLocationType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolumeInternal)this).ExtendedLocationType, global::System.Convert.ToString); - } - if (content.Contains("AttachedTo")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolumeInternal)this).AttachedTo = (string[]) content.GetValueForProperty("AttachedTo",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolumeInternal)this).AttachedTo, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("DetailedStatus")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolumeInternal)this).DetailedStatus = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VolumeDetailedStatus?) content.GetValueForProperty("DetailedStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolumeInternal)this).DetailedStatus, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VolumeDetailedStatus.CreateFrom); - } - if (content.Contains("DetailedStatusMessage")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolumeInternal)this).DetailedStatusMessage = (string) content.GetValueForProperty("DetailedStatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolumeInternal)this).DetailedStatusMessage, global::System.Convert.ToString); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolumeInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VolumeProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolumeInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VolumeProvisioningState.CreateFrom); - } - if (content.Contains("SerialNumber")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolumeInternal)this).SerialNumber = (string) content.GetValueForProperty("SerialNumber",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolumeInternal)this).SerialNumber, global::System.Convert.ToString); - } - if (content.Contains("SizeMiB")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolumeInternal)this).SizeMiB = (long) content.GetValueForProperty("SizeMiB",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolumeInternal)this).SizeMiB, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - AfterDeserializePSObject(content); - } - } - /// Volume represents storage made available for use by resources running on the cluster. - [System.ComponentModel.TypeConverter(typeof(VolumeTypeConverter))] - public partial interface IVolume - - { - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/Volume.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/Volume.cs deleted file mode 100644 index 3563652bf020..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/Volume.cs +++ /dev/null @@ -1,302 +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.NetworkCloud.Models.Api20250201 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; - - /// - /// Volume represents storage made available for use by resources running on the cluster. - /// - public partial class Volume : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolume, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolumeInternal, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IValidates - { - /// - /// Backing field for Inherited model - /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResource __trackedResource = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.TrackedResource(); - - /// - /// The list of resource IDs that attach the volume. It may include virtual machines and Hybrid AKS clusters. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string[] AttachedTo { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolumePropertiesInternal)Property).AttachedTo; } - - /// The more detailed status of the volume. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VolumeDetailedStatus? DetailedStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolumePropertiesInternal)Property).DetailedStatus; } - - /// The descriptive message about the current detailed status. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string DetailedStatusMessage { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolumePropertiesInternal)Property).DetailedStatusMessage; } - - /// Backing field for property. - private string _etag; - - /// Resource ETag. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string Etag { get => this._etag; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocation _extendedLocation; - - /// The extended location of the cluster associated with the resource. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocation ExtendedLocation { get => (this._extendedLocation = this._extendedLocation ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ExtendedLocation()); set => this._extendedLocation = value; } - - /// The resource ID of the extended location on which the resource will be created. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string ExtendedLocationName { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocationInternal)ExtendedLocation).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocationInternal)ExtendedLocation).Name = value ; } - - /// The extended location type, for example, CustomLocation. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string ExtendedLocationType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocationInternal)ExtendedLocation).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocationInternal)ExtendedLocation).Type = value ; } - - /// - /// Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).Id; } - - /// The geo-location where the resource lives - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)__trackedResource).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)__trackedResource).Location = value ; } - - /// Internal Acessors for AttachedTo - string[] Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolumeInternal.AttachedTo { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolumePropertiesInternal)Property).AttachedTo; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolumePropertiesInternal)Property).AttachedTo = value; } - - /// Internal Acessors for DetailedStatus - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VolumeDetailedStatus? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolumeInternal.DetailedStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolumePropertiesInternal)Property).DetailedStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolumePropertiesInternal)Property).DetailedStatus = value; } - - /// Internal Acessors for DetailedStatusMessage - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolumeInternal.DetailedStatusMessage { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolumePropertiesInternal)Property).DetailedStatusMessage; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolumePropertiesInternal)Property).DetailedStatusMessage = value; } - - /// Internal Acessors for Etag - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolumeInternal.Etag { get => this._etag; set { {_etag = value;} } } - - /// Internal Acessors for ExtendedLocation - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocation Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolumeInternal.ExtendedLocation { get => (this._extendedLocation = this._extendedLocation ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ExtendedLocation()); set { {_extendedLocation = value;} } } - - /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolumeProperties Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolumeInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.VolumeProperties()); set { {_property = value;} } } - - /// Internal Acessors for ProvisioningState - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VolumeProvisioningState? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolumeInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolumePropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolumePropertiesInternal)Property).ProvisioningState = value; } - - /// Internal Acessors for SerialNumber - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolumeInternal.SerialNumber { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolumePropertiesInternal)Property).SerialNumber; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolumePropertiesInternal)Property).SerialNumber = value; } - - /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).Id = value; } - - /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).Name = value; } - - /// Internal Acessors for SystemData - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ISystemData Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal.SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemData; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemData = value; } - - /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).Type = value; } - - /// The name of the resource - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).Name; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolumeProperties _property; - - /// The list of the resource properties. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolumeProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.VolumeProperties()); set => this._property = value; } - - /// The provisioning state of the volume. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VolumeProvisioningState? ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolumePropertiesInternal)Property).ProvisioningState; } - - /// Gets the resource group name - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string ResourceGroupName { get => (new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Success ? new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Groups["resourceGroupName"].Value : null); } - - /// The unique identifier of the volume. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string SerialNumber { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolumePropertiesInternal)Property).SerialNumber; } - - /// The size of the allocation for this volume in Mebibytes. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public long SizeMiB { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolumePropertiesInternal)Property).SizeMiB; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolumePropertiesInternal)Property).SizeMiB = value ; } - - /// - /// Azure Resource Manager metadata containing createdBy and modifiedBy information. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ISystemData SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemData; } - - /// The timestamp of resource creation (UTC). - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataCreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataCreatedAt = value ?? default(global::System.DateTime); } - - /// The identity that created the resource. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataCreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataCreatedBy = value ?? null; } - - /// The type of identity that created the resource. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType? SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataCreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataCreatedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType)""); } - - /// The timestamp of resource last modification (UTC) - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataLastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataLastModifiedAt = value ?? default(global::System.DateTime); } - - /// The identity that last modified the resource. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataLastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataLastModifiedBy = value ?? null; } - - /// The type of identity that last modified the resource. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType? SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataLastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).SystemDataLastModifiedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType)""); } - - /// Resource tags. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)__trackedResource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.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.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__trackedResource).Type; } - - /// Validates that this object meets the validation criteria. - /// an instance that will receive validation - /// events. - /// - /// A that will be complete when validation is completed. - /// - public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) - { - await eventListener.AssertNotNull(nameof(__trackedResource), __trackedResource); - await eventListener.AssertObjectIsValid(nameof(__trackedResource), __trackedResource); - } - - /// Creates an new instance. - public Volume() - { - - } - } - /// Volume represents storage made available for use by resources running on the cluster. - public partial interface IVolume : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResource - { - /// - /// The list of resource IDs that attach the volume. It may include virtual machines and Hybrid AKS clusters. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The list of resource IDs that attach the volume. It may include virtual machines and Hybrid AKS clusters.", - SerializedName = @"attachedTo", - PossibleTypes = new [] { typeof(string) })] - string[] AttachedTo { get; } - /// The more detailed status of the volume. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The more detailed status of the volume.", - SerializedName = @"detailedStatus", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VolumeDetailedStatus) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VolumeDetailedStatus? DetailedStatus { get; } - /// The descriptive message about the current detailed status. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The descriptive message about the current detailed status.", - SerializedName = @"detailedStatusMessage", - PossibleTypes = new [] { typeof(string) })] - string DetailedStatusMessage { get; } - /// Resource ETag. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"Resource ETag.", - SerializedName = @"etag", - PossibleTypes = new [] { typeof(string) })] - string Etag { get; } - /// The resource ID of the extended location on which the resource will be created. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The resource ID of the extended location on which the resource will be created.", - SerializedName = @"name", - PossibleTypes = new [] { typeof(string) })] - string ExtendedLocationName { get; set; } - /// The extended location type, for example, CustomLocation. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The extended location type, for example, CustomLocation.", - SerializedName = @"type", - PossibleTypes = new [] { typeof(string) })] - string ExtendedLocationType { get; set; } - /// The provisioning state of the volume. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The provisioning state of the volume.", - SerializedName = @"provisioningState", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VolumeProvisioningState) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VolumeProvisioningState? ProvisioningState { get; } - /// The unique identifier of the volume. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The unique identifier of the volume.", - SerializedName = @"serialNumber", - PossibleTypes = new [] { typeof(string) })] - string SerialNumber { get; } - /// The size of the allocation for this volume in Mebibytes. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The size of the allocation for this volume in Mebibytes.", - SerializedName = @"sizeMiB", - PossibleTypes = new [] { typeof(long) })] - long SizeMiB { get; set; } - - } - /// Volume represents storage made available for use by resources running on the cluster. - internal partial interface IVolumeInternal : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal - { - /// - /// The list of resource IDs that attach the volume. It may include virtual machines and Hybrid AKS clusters. - /// - string[] AttachedTo { get; set; } - /// The more detailed status of the volume. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VolumeDetailedStatus? DetailedStatus { get; set; } - /// The descriptive message about the current detailed status. - string DetailedStatusMessage { get; set; } - /// Resource ETag. - string Etag { get; set; } - /// The extended location of the cluster associated with the resource. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocation ExtendedLocation { get; set; } - /// The resource ID of the extended location on which the resource will be created. - string ExtendedLocationName { get; set; } - /// The extended location type, for example, CustomLocation. - string ExtendedLocationType { get; set; } - /// The list of the resource properties. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolumeProperties Property { get; set; } - /// The provisioning state of the volume. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VolumeProvisioningState? ProvisioningState { get; set; } - /// The unique identifier of the volume. - string SerialNumber { get; set; } - /// The size of the allocation for this volume in Mebibytes. - long SizeMiB { get; set; } - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VolumeList.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VolumeList.cs deleted file mode 100644 index 072c89df7d7a..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VolumeList.cs +++ /dev/null @@ -1,68 +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.NetworkCloud.Models.Api20250201 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; - - /// VolumeList represents a list of volumes. - public partial class VolumeList : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolumeList, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolumeListInternal - { - - /// Backing field for property. - private string _nextLink; - - /// The link used to get the next page of operations. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string NextLink { get => this._nextLink; set => this._nextLink = value; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolume[] _value; - - /// The list of volumes. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolume[] Value { get => this._value; set => this._value = value; } - - /// Creates an new instance. - public VolumeList() - { - - } - } - /// VolumeList represents a list of volumes. - public partial interface IVolumeList : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable - { - /// The link used to get the next page of operations. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The link used to get the next page of operations.", - SerializedName = @"nextLink", - PossibleTypes = new [] { typeof(string) })] - string NextLink { get; set; } - /// The list of volumes. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The list of volumes.", - SerializedName = @"value", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolume) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolume[] Value { get; set; } - - } - /// VolumeList represents a list of volumes. - internal partial interface IVolumeListInternal - - { - /// The link used to get the next page of operations. - string NextLink { get; set; } - /// The list of volumes. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolume[] Value { get; set; } - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VolumePatchParameters.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VolumePatchParameters.cs deleted file mode 100644 index eb1705ece985..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VolumePatchParameters.cs +++ /dev/null @@ -1,53 +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.NetworkCloud.Models.Api20250201 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; - - /// - /// VolumePatchParameters represents the body of the request to patch the volume resource. - /// - public partial class VolumePatchParameters : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolumePatchParameters, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolumePatchParametersInternal - { - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolumePatchParametersTags _tag; - - /// The Azure resource tags that will replace the existing ones. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolumePatchParametersTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.VolumePatchParametersTags()); set => this._tag = value; } - - /// Creates an new instance. - public VolumePatchParameters() - { - - } - } - /// VolumePatchParameters represents the body of the request to patch the volume resource. - public partial interface IVolumePatchParameters : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable - { - /// The Azure resource tags that will replace the existing ones. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The Azure resource tags that will replace the existing ones.", - SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolumePatchParametersTags) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolumePatchParametersTags Tag { get; set; } - - } - /// VolumePatchParameters represents the body of the request to patch the volume resource. - internal partial interface IVolumePatchParametersInternal - - { - /// The Azure resource tags that will replace the existing ones. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolumePatchParametersTags Tag { get; set; } - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VolumeProperties.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VolumeProperties.PowerShell.cs deleted file mode 100644 index 5c0f282c6688..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VolumeProperties.PowerShell.cs +++ /dev/null @@ -1,204 +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.NetworkCloud.Models.Api20250201 -{ - using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; - - /// VolumeProperties represents properties of the volume resource. - [System.ComponentModel.TypeConverter(typeof(VolumePropertiesTypeConverter))] - public partial class VolumeProperties - { - - /// - /// 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.NetworkCloud.Models.Api20250201.IVolumeProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new VolumeProperties(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.NetworkCloud.Models.Api20250201.IVolumeProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new VolumeProperties(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.NetworkCloud.Models.Api20250201.IVolumeProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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 VolumeProperties(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("AttachedTo")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolumePropertiesInternal)this).AttachedTo = (string[]) content.GetValueForProperty("AttachedTo",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolumePropertiesInternal)this).AttachedTo, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("DetailedStatus")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolumePropertiesInternal)this).DetailedStatus = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VolumeDetailedStatus?) content.GetValueForProperty("DetailedStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolumePropertiesInternal)this).DetailedStatus, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VolumeDetailedStatus.CreateFrom); - } - if (content.Contains("DetailedStatusMessage")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolumePropertiesInternal)this).DetailedStatusMessage = (string) content.GetValueForProperty("DetailedStatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolumePropertiesInternal)this).DetailedStatusMessage, global::System.Convert.ToString); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolumePropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VolumeProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolumePropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VolumeProvisioningState.CreateFrom); - } - if (content.Contains("SerialNumber")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolumePropertiesInternal)this).SerialNumber = (string) content.GetValueForProperty("SerialNumber",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolumePropertiesInternal)this).SerialNumber, global::System.Convert.ToString); - } - if (content.Contains("SizeMiB")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolumePropertiesInternal)this).SizeMiB = (long) content.GetValueForProperty("SizeMiB",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolumePropertiesInternal)this).SizeMiB, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal VolumeProperties(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("AttachedTo")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolumePropertiesInternal)this).AttachedTo = (string[]) content.GetValueForProperty("AttachedTo",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolumePropertiesInternal)this).AttachedTo, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("DetailedStatus")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolumePropertiesInternal)this).DetailedStatus = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VolumeDetailedStatus?) content.GetValueForProperty("DetailedStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolumePropertiesInternal)this).DetailedStatus, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VolumeDetailedStatus.CreateFrom); - } - if (content.Contains("DetailedStatusMessage")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolumePropertiesInternal)this).DetailedStatusMessage = (string) content.GetValueForProperty("DetailedStatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolumePropertiesInternal)this).DetailedStatusMessage, global::System.Convert.ToString); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolumePropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VolumeProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolumePropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VolumeProvisioningState.CreateFrom); - } - if (content.Contains("SerialNumber")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolumePropertiesInternal)this).SerialNumber = (string) content.GetValueForProperty("SerialNumber",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolumePropertiesInternal)this).SerialNumber, global::System.Convert.ToString); - } - if (content.Contains("SizeMiB")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolumePropertiesInternal)this).SizeMiB = (long) content.GetValueForProperty("SizeMiB",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolumePropertiesInternal)this).SizeMiB, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - AfterDeserializePSObject(content); - } - } - /// VolumeProperties represents properties of the volume resource. - [System.ComponentModel.TypeConverter(typeof(VolumePropertiesTypeConverter))] - public partial interface IVolumeProperties - - { - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VolumeProperties.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VolumeProperties.cs deleted file mode 100644 index 3525a1403431..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VolumeProperties.cs +++ /dev/null @@ -1,157 +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.NetworkCloud.Models.Api20250201 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; - - /// VolumeProperties represents properties of the volume resource. - public partial class VolumeProperties : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolumeProperties, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolumePropertiesInternal - { - - /// Backing field for property. - private string[] _attachedTo; - - /// - /// The list of resource IDs that attach the volume. It may include virtual machines and Hybrid AKS clusters. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string[] AttachedTo { get => this._attachedTo; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VolumeDetailedStatus? _detailedStatus; - - /// The more detailed status of the volume. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VolumeDetailedStatus? DetailedStatus { get => this._detailedStatus; } - - /// Backing field for property. - private string _detailedStatusMessage; - - /// The descriptive message about the current detailed status. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string DetailedStatusMessage { get => this._detailedStatusMessage; } - - /// Internal Acessors for AttachedTo - string[] Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolumePropertiesInternal.AttachedTo { get => this._attachedTo; set { {_attachedTo = value;} } } - - /// Internal Acessors for DetailedStatus - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VolumeDetailedStatus? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolumePropertiesInternal.DetailedStatus { get => this._detailedStatus; set { {_detailedStatus = value;} } } - - /// Internal Acessors for DetailedStatusMessage - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolumePropertiesInternal.DetailedStatusMessage { get => this._detailedStatusMessage; set { {_detailedStatusMessage = value;} } } - - /// Internal Acessors for ProvisioningState - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VolumeProvisioningState? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolumePropertiesInternal.ProvisioningState { get => this._provisioningState; set { {_provisioningState = value;} } } - - /// Internal Acessors for SerialNumber - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolumePropertiesInternal.SerialNumber { get => this._serialNumber; set { {_serialNumber = value;} } } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VolumeProvisioningState? _provisioningState; - - /// The provisioning state of the volume. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VolumeProvisioningState? ProvisioningState { get => this._provisioningState; } - - /// Backing field for property. - private string _serialNumber; - - /// The unique identifier of the volume. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string SerialNumber { get => this._serialNumber; } - - /// Backing field for property. - private long _sizeMiB; - - /// The size of the allocation for this volume in Mebibytes. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public long SizeMiB { get => this._sizeMiB; set => this._sizeMiB = value; } - - /// Creates an new instance. - public VolumeProperties() - { - - } - } - /// VolumeProperties represents properties of the volume resource. - public partial interface IVolumeProperties : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable - { - /// - /// The list of resource IDs that attach the volume. It may include virtual machines and Hybrid AKS clusters. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The list of resource IDs that attach the volume. It may include virtual machines and Hybrid AKS clusters.", - SerializedName = @"attachedTo", - PossibleTypes = new [] { typeof(string) })] - string[] AttachedTo { get; } - /// The more detailed status of the volume. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The more detailed status of the volume.", - SerializedName = @"detailedStatus", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VolumeDetailedStatus) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VolumeDetailedStatus? DetailedStatus { get; } - /// The descriptive message about the current detailed status. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The descriptive message about the current detailed status.", - SerializedName = @"detailedStatusMessage", - PossibleTypes = new [] { typeof(string) })] - string DetailedStatusMessage { get; } - /// The provisioning state of the volume. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The provisioning state of the volume.", - SerializedName = @"provisioningState", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VolumeProvisioningState) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VolumeProvisioningState? ProvisioningState { get; } - /// The unique identifier of the volume. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The unique identifier of the volume.", - SerializedName = @"serialNumber", - PossibleTypes = new [] { typeof(string) })] - string SerialNumber { get; } - /// The size of the allocation for this volume in Mebibytes. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The size of the allocation for this volume in Mebibytes.", - SerializedName = @"sizeMiB", - PossibleTypes = new [] { typeof(long) })] - long SizeMiB { get; set; } - - } - /// VolumeProperties represents properties of the volume resource. - internal partial interface IVolumePropertiesInternal - - { - /// - /// The list of resource IDs that attach the volume. It may include virtual machines and Hybrid AKS clusters. - /// - string[] AttachedTo { get; set; } - /// The more detailed status of the volume. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VolumeDetailedStatus? DetailedStatus { get; set; } - /// The descriptive message about the current detailed status. - string DetailedStatusMessage { get; set; } - /// The provisioning state of the volume. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VolumeProvisioningState? ProvisioningState { get; set; } - /// The unique identifier of the volume. - string SerialNumber { get; set; } - /// The size of the allocation for this volume in Mebibytes. - long SizeMiB { get; set; } - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VulnerabilityScanningSettings.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VulnerabilityScanningSettings.cs deleted file mode 100644 index 578d69c1ff0a..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VulnerabilityScanningSettings.cs +++ /dev/null @@ -1,53 +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.NetworkCloud.Models.Api20250201 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; - - /// - /// VulnerabilityScanningSettings represents the settings for how security vulnerability scanning is applied to the cluster. - /// - public partial class VulnerabilityScanningSettings : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVulnerabilityScanningSettings, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVulnerabilityScanningSettingsInternal - { - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VulnerabilityScanningSettingsContainerScan? _containerScan; - - /// The mode selection for container vulnerability scanning. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VulnerabilityScanningSettingsContainerScan? ContainerScan { get => this._containerScan; set => this._containerScan = value; } - - /// Creates an new instance. - public VulnerabilityScanningSettings() - { - - } - } - /// VulnerabilityScanningSettings represents the settings for how security vulnerability scanning is applied to the cluster. - public partial interface IVulnerabilityScanningSettings : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable - { - /// The mode selection for container vulnerability scanning. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The mode selection for container vulnerability scanning.", - SerializedName = @"containerScan", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VulnerabilityScanningSettingsContainerScan) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VulnerabilityScanningSettingsContainerScan? ContainerScan { get; set; } - - } - /// VulnerabilityScanningSettings represents the settings for how security vulnerability scanning is applied to the cluster. - internal partial interface IVulnerabilityScanningSettingsInternal - - { - /// The mode selection for container vulnerability scanning. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VulnerabilityScanningSettingsContainerScan? ContainerScan { get; set; } - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VulnerabilityScanningSettingsPatch.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VulnerabilityScanningSettingsPatch.cs deleted file mode 100644 index 4148d16c0805..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VulnerabilityScanningSettingsPatch.cs +++ /dev/null @@ -1,53 +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.NetworkCloud.Models.Api20250201 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; - - /// - /// VulnerabilityScanningSettingsPatch represents the settings for how security vulnerability scanning is applied to the cluster. - /// - public partial class VulnerabilityScanningSettingsPatch : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVulnerabilityScanningSettingsPatch, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVulnerabilityScanningSettingsPatchInternal - { - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VulnerabilityScanningSettingsContainerScan? _containerScan; - - /// The mode selection for container vulnerability scanning. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VulnerabilityScanningSettingsContainerScan? ContainerScan { get => this._containerScan; set => this._containerScan = value; } - - /// Creates an new instance. - public VulnerabilityScanningSettingsPatch() - { - - } - } - /// VulnerabilityScanningSettingsPatch represents the settings for how security vulnerability scanning is applied to the cluster. - public partial interface IVulnerabilityScanningSettingsPatch : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable - { - /// The mode selection for container vulnerability scanning. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The mode selection for container vulnerability scanning.", - SerializedName = @"containerScan", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VulnerabilityScanningSettingsContainerScan) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VulnerabilityScanningSettingsContainerScan? ContainerScan { get; set; } - - } - /// VulnerabilityScanningSettingsPatch represents the settings for how security vulnerability scanning is applied to the cluster. - internal partial interface IVulnerabilityScanningSettingsPatchInternal - - { - /// The mode selection for container vulnerability scanning. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VulnerabilityScanningSettingsContainerScan? ContainerScan { get; set; } - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api50/ErrorDetail.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api50/ErrorDetail.PowerShell.cs deleted file mode 100644 index 41969496f614..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api50/ErrorDetail.PowerShell.cs +++ /dev/null @@ -1,196 +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.NetworkCloud.Models.Api50 -{ - using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; - - /// The error detail. - [System.ComponentModel.TypeConverter(typeof(ErrorDetailTypeConverter))] - public partial class ErrorDetail - { - - /// - /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the - /// object before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Collections.IDictionary content that should be used. - - partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); - - /// - /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object - /// before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Management.Automation.PSObject content that should be used. - - partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); - - /// - /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Collections.IDictionary content that should be used. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); - - /// - /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Management.Automation.PSObject content that should be used. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); - - /// - /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior - /// - /// /// instance serialized to a string, normally it is a Json - /// /// set returnNow to true if you provide a customized OverrideToString function - - partial void OverrideToString(ref string stringResult, ref bool returnNow); - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorDetail DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new ErrorDetail(content); - } - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorDetail DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new ErrorDetail(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal ErrorDetail(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("Code")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorDetailInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorDetailInternal)this).Code, global::System.Convert.ToString); - } - if (content.Contains("Message")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorDetailInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorDetailInternal)this).Message, global::System.Convert.ToString); - } - if (content.Contains("Target")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorDetailInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorDetailInternal)this).Target, global::System.Convert.ToString); - } - if (content.Contains("Detail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorDetailInternal)this).Detail = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorDetail[]) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorDetailInternal)this).Detail, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ErrorDetailTypeConverter.ConvertFrom)); - } - if (content.Contains("AdditionalInfo")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorDetailInternal)this).AdditionalInfo = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorAdditionalInfo[]) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorDetailInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ErrorAdditionalInfoTypeConverter.ConvertFrom)); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal ErrorDetail(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("Code")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorDetailInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorDetailInternal)this).Code, global::System.Convert.ToString); - } - if (content.Contains("Message")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorDetailInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorDetailInternal)this).Message, global::System.Convert.ToString); - } - if (content.Contains("Target")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorDetailInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorDetailInternal)this).Target, global::System.Convert.ToString); - } - if (content.Contains("Detail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorDetailInternal)this).Detail = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorDetail[]) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorDetailInternal)this).Detail, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ErrorDetailTypeConverter.ConvertFrom)); - } - if (content.Contains("AdditionalInfo")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorDetailInternal)this).AdditionalInfo = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorAdditionalInfo[]) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorDetailInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ErrorAdditionalInfoTypeConverter.ConvertFrom)); - } - AfterDeserializePSObject(content); - } - - /// - /// Creates a new instance of , deserializing the content from a json string. - /// - /// a string containing a JSON serialized instance of this model. - /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorDetail FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.SerializationMode.IncludeAll)?.ToString(); - - public override string ToString() - { - var returnNow = false; - var result = global::System.String.Empty; - OverrideToString(ref result, ref returnNow); - if (returnNow) - { - return result; - } - return ToJsonString(); - } - } - /// The error detail. - [System.ComponentModel.TypeConverter(typeof(ErrorDetailTypeConverter))] - public partial interface IErrorDetail - - { - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api50/ErrorDetail.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api50/ErrorDetail.cs deleted file mode 100644 index 0e132db1bc54..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api50/ErrorDetail.cs +++ /dev/null @@ -1,134 +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.NetworkCloud.Models.Api50 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; - - /// The error detail. - public partial class ErrorDetail : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorDetail, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorDetailInternal - { - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorAdditionalInfo[] _additionalInfo; - - /// The error additional info. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorAdditionalInfo[] AdditionalInfo { get => this._additionalInfo; } - - /// Backing field for property. - private string _code; - - /// The error code. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string Code { get => this._code; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorDetail[] _detail; - - /// The error details. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorDetail[] Detail { get => this._detail; } - - /// Backing field for property. - private string _message; - - /// The error message. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string Message { get => this._message; } - - /// Internal Acessors for AdditionalInfo - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorAdditionalInfo[] Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorDetailInternal.AdditionalInfo { get => this._additionalInfo; set { {_additionalInfo = value;} } } - - /// Internal Acessors for Code - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorDetailInternal.Code { get => this._code; set { {_code = value;} } } - - /// Internal Acessors for Detail - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorDetail[] Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorDetailInternal.Detail { get => this._detail; set { {_detail = value;} } } - - /// Internal Acessors for Message - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorDetailInternal.Message { get => this._message; set { {_message = value;} } } - - /// Internal Acessors for Target - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorDetailInternal.Target { get => this._target; set { {_target = value;} } } - - /// Backing field for property. - private string _target; - - /// The error target. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string Target { get => this._target; } - - /// Creates an new instance. - public ErrorDetail() - { - - } - } - /// The error detail. - public partial interface IErrorDetail : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable - { - /// The error additional info. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The error additional info.", - SerializedName = @"additionalInfo", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorAdditionalInfo) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorAdditionalInfo[] AdditionalInfo { get; } - /// The error code. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The error code.", - SerializedName = @"code", - PossibleTypes = new [] { typeof(string) })] - string Code { get; } - /// The error details. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The error details.", - SerializedName = @"details", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorDetail) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorDetail[] Detail { get; } - /// The error message. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The error message.", - SerializedName = @"message", - PossibleTypes = new [] { typeof(string) })] - string Message { get; } - /// The error target. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The error target.", - SerializedName = @"target", - PossibleTypes = new [] { typeof(string) })] - string Target { get; } - - } - /// The error detail. - internal partial interface IErrorDetailInternal - - { - /// The error additional info. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorAdditionalInfo[] AdditionalInfo { get; set; } - /// The error code. - string Code { get; set; } - /// The error details. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorDetail[] Detail { get; set; } - /// The error message. - string Message { get; set; } - /// The error target. - string Target { get; set; } - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api50/ErrorResponse.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api50/ErrorResponse.PowerShell.cs deleted file mode 100644 index 7f25a98b1795..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api50/ErrorResponse.PowerShell.cs +++ /dev/null @@ -1,208 +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.NetworkCloud.Models.Api50 -{ - using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; - - /// - /// Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows - /// the OData error response format.). - /// - [System.ComponentModel.TypeConverter(typeof(ErrorResponseTypeConverter))] - public partial class ErrorResponse - { - - /// - /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the - /// object before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Collections.IDictionary content that should be used. - - partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); - - /// - /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object - /// before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Management.Automation.PSObject content that should be used. - - partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); - - /// - /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Collections.IDictionary content that should be used. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); - - /// - /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Management.Automation.PSObject content that should be used. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); - - /// - /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior - /// - /// /// instance serialized to a string, normally it is a Json - /// /// set returnNow to true if you provide a customized OverrideToString function - - partial void OverrideToString(ref string stringResult, ref bool returnNow); - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorResponse DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new ErrorResponse(content); - } - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorResponse DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new ErrorResponse(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal ErrorResponse(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("Error")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorResponseInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorDetail) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorResponseInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ErrorDetailTypeConverter.ConvertFrom); - } - if (content.Contains("Code")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorResponseInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorResponseInternal)this).Code, global::System.Convert.ToString); - } - if (content.Contains("Message")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorResponseInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorResponseInternal)this).Message, global::System.Convert.ToString); - } - if (content.Contains("Target")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorResponseInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorResponseInternal)this).Target, global::System.Convert.ToString); - } - if (content.Contains("Detail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorResponseInternal)this).Detail = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorDetail[]) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorResponseInternal)this).Detail, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ErrorDetailTypeConverter.ConvertFrom)); - } - if (content.Contains("AdditionalInfo")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorResponseInternal)this).AdditionalInfo = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorAdditionalInfo[]) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorResponseInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ErrorAdditionalInfoTypeConverter.ConvertFrom)); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal ErrorResponse(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("Error")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorResponseInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorDetail) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorResponseInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ErrorDetailTypeConverter.ConvertFrom); - } - if (content.Contains("Code")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorResponseInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorResponseInternal)this).Code, global::System.Convert.ToString); - } - if (content.Contains("Message")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorResponseInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorResponseInternal)this).Message, global::System.Convert.ToString); - } - if (content.Contains("Target")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorResponseInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorResponseInternal)this).Target, global::System.Convert.ToString); - } - if (content.Contains("Detail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorResponseInternal)this).Detail = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorDetail[]) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorResponseInternal)this).Detail, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ErrorDetailTypeConverter.ConvertFrom)); - } - if (content.Contains("AdditionalInfo")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorResponseInternal)this).AdditionalInfo = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorAdditionalInfo[]) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorResponseInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ErrorAdditionalInfoTypeConverter.ConvertFrom)); - } - AfterDeserializePSObject(content); - } - - /// - /// Creates a new instance of , deserializing the content from a json string. - /// - /// a string containing a JSON serialized instance of this model. - /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorResponse FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.SerializationMode.IncludeAll)?.ToString(); - - public override string ToString() - { - var returnNow = false; - var result = global::System.String.Empty; - OverrideToString(ref result, ref returnNow); - if (returnNow) - { - return result; - } - return ToJsonString(); - } - } - /// Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows - /// the OData error response format.). - [System.ComponentModel.TypeConverter(typeof(ErrorResponseTypeConverter))] - public partial interface IErrorResponse - - { - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api50/ErrorResponse.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api50/ErrorResponse.TypeConverter.cs deleted file mode 100644 index bb8ff91ff331..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api50/ErrorResponse.TypeConverter.cs +++ /dev/null @@ -1,147 +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.NetworkCloud.Models.Api50 -{ - using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; - - /// - /// A PowerShell PSTypeConverter to support converting to an instance of - /// - public partial class ErrorResponseTypeConverter : global::System.Management.Automation.PSTypeConverter - { - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false. - /// - public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); - - /// - /// Determines if the converter can convert the parameter to the - /// type. - /// - /// the instance to check if it can be converted to the type. - /// - /// true if the instance could be converted to a type, otherwise false - /// - public static bool CanConvertFrom(dynamic sourceValue) - { - if (null == sourceValue) - { - return true; - } - global::System.Type type = sourceValue.GetType(); - if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) - { - // we say yest to PSObjects - return true; - } - if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) - { - // we say yest to Hashtables/dictionaries - return true; - } - try - { - if (null != sourceValue.ToJsonString()) - { - return true; - } - } - catch - { - // Not one of our objects - } - try - { - string text = sourceValue.ToString()?.Trim(); - return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonType.Object; - } - catch - { - // Doesn't look like it can be treated as JSON - } - return false; - } - - /// - /// Determines if the parameter can be converted to the - /// parameter - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false - /// - public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; - - /// - /// Converts the parameter to the parameter using and - /// - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// - /// an instance of , or null if there is no suitable conversion. - /// - public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); - - /// - /// Converts the parameter into an instance of - /// - /// the value to convert into an instance of . - /// - /// an instance of , or null if there is no suitable conversion. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorResponse ConvertFrom(dynamic sourceValue) - { - if (null == sourceValue) - { - return null; - } - global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorResponse).IsAssignableFrom(type)) - { - return sourceValue; - } - try - { - return ErrorResponse.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; - } - catch - { - // Unable to use JSON pattern - } - if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) - { - return ErrorResponse.DeserializeFromPSObject(sourceValue); - } - if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) - { - return ErrorResponse.DeserializeFromDictionary(sourceValue); - } - return null; - } - - /// NotImplemented -- this will return null - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// will always return null. - public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api50/ErrorResponse.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api50/ErrorResponse.cs deleted file mode 100644 index 78b9f4560e5b..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api50/ErrorResponse.cs +++ /dev/null @@ -1,136 +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.NetworkCloud.Models.Api50 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; - - /// - /// Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows - /// the OData error response format.). - /// - public partial class ErrorResponse : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorResponse, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorResponseInternal - { - - /// The error additional info. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorAdditionalInfo[] AdditionalInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorDetailInternal)Error).AdditionalInfo; } - - /// The error code. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorDetailInternal)Error).Code; } - - /// The error details. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorDetail[] Detail { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorDetailInternal)Error).Detail; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorDetail _error; - - /// The error object. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorDetail Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ErrorDetail()); set => this._error = value; } - - /// The error message. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorDetailInternal)Error).Message; } - - /// Internal Acessors for AdditionalInfo - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorAdditionalInfo[] Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorResponseInternal.AdditionalInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorDetailInternal)Error).AdditionalInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorDetailInternal)Error).AdditionalInfo = value; } - - /// Internal Acessors for Code - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorResponseInternal.Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorDetailInternal)Error).Code; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorDetailInternal)Error).Code = value; } - - /// Internal Acessors for Detail - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorDetail[] Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorResponseInternal.Detail { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorDetailInternal)Error).Detail; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorDetailInternal)Error).Detail = value; } - - /// Internal Acessors for Error - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorDetail Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorResponseInternal.Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ErrorDetail()); set { {_error = value;} } } - - /// Internal Acessors for Message - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorResponseInternal.Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorDetailInternal)Error).Message; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorDetailInternal)Error).Message = value; } - - /// Internal Acessors for Target - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorResponseInternal.Target { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorDetailInternal)Error).Target; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorDetailInternal)Error).Target = value; } - - /// The error target. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string Target { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorDetailInternal)Error).Target; } - - /// Creates an new instance. - public ErrorResponse() - { - - } - } - /// Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows - /// the OData error response format.). - public partial interface IErrorResponse : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable - { - /// The error additional info. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The error additional info.", - SerializedName = @"additionalInfo", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorAdditionalInfo) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorAdditionalInfo[] AdditionalInfo { get; } - /// The error code. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The error code.", - SerializedName = @"code", - PossibleTypes = new [] { typeof(string) })] - string Code { get; } - /// The error details. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The error details.", - SerializedName = @"details", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorDetail) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorDetail[] Detail { get; } - /// The error message. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The error message.", - SerializedName = @"message", - PossibleTypes = new [] { typeof(string) })] - string Message { get; } - /// The error target. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The error target.", - SerializedName = @"target", - PossibleTypes = new [] { typeof(string) })] - string Target { get; } - - } - /// Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows - /// the OData error response format.). - internal partial interface IErrorResponseInternal - - { - /// The error additional info. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorAdditionalInfo[] AdditionalInfo { get; set; } - /// The error code. - string Code { get; set; } - /// The error details. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorDetail[] Detail { get; set; } - /// The error object. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorDetail Error { get; set; } - /// The error message. - string Message { get; set; } - /// The error target. - string Target { get; set; } - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api50/ErrorResponse.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api50/ErrorResponse.json.cs deleted file mode 100644 index ca409a2b3b4f..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api50/ErrorResponse.json.cs +++ /dev/null @@ -1,111 +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.NetworkCloud.Models.Api50 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; - - /// - /// Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows - /// the OData error response format.). - /// - public partial class ErrorResponse - { - - /// - /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object - /// before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The JsonNode that should be deserialized into this object. - - partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json); - - /// - /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The JSON container that the serialization result will be placed in. - - partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container); - - /// - /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of - /// the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the - /// output parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The JsonNode that should be deserialized into this object. - /// Determines if the rest of the deserialization should be processed, or if the method should return - /// instantly. - - partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json, ref bool returnNow); - - /// - /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the - /// object before it is serialized. - /// If you wish to disable the default serialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The JSON container that the serialization result will be placed in. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, ref bool returnNow); - - /// - /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject into a new instance of . - /// - /// A Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject instance to deserialize from. - internal ErrorResponse(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) - { - bool returnNow = false; - BeforeFromJson(json, ref returnNow); - if (returnNow) - { - return; - } - {_error = If( json?.PropertyT("error"), out var __jsonError) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ErrorDetail.FromJson(__jsonError) : Error;} - AfterFromJson(json); - } - - /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorResponse. - /// - /// a to deserialize from. - /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorResponse. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorResponse FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) - { - return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new ErrorResponse(json) : null; - } - - /// - /// Serializes this instance of into a . - /// - /// The container to serialize this object into. If the caller - /// passes in null, a new instance will be created and returned to the caller. - /// Allows the caller to choose the depth of the serialization. See . - /// - /// a serialized instance of as a . - /// - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode) - { - container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject(); - - bool returnNow = false; - BeforeToJson(ref container, ref returnNow); - if (returnNow) - { - return container; - } - AddIf( null != this._error ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) this._error.ToJson(null,serializationMode) : null, "error" ,container.Add ); - AfterToJson(ref container); - return container; - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api50/ManagedServiceIdentity.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api50/ManagedServiceIdentity.PowerShell.cs deleted file mode 100644 index a0b5236e3401..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api50/ManagedServiceIdentity.PowerShell.cs +++ /dev/null @@ -1,188 +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.NetworkCloud.Models.Api50 -{ - using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; - - /// Managed service identity (system assigned and/or user assigned identities) - [System.ComponentModel.TypeConverter(typeof(ManagedServiceIdentityTypeConverter))] - public partial class ManagedServiceIdentity - { - - /// - /// 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.NetworkCloud.Models.Api50.IManagedServiceIdentity DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new ManagedServiceIdentity(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.NetworkCloud.Models.Api50.IManagedServiceIdentity DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new ManagedServiceIdentity(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.NetworkCloud.Models.Api50.IManagedServiceIdentity FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal ManagedServiceIdentity(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("PrincipalId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IManagedServiceIdentityInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IManagedServiceIdentityInternal)this).PrincipalId, global::System.Convert.ToString); - } - if (content.Contains("TenantId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IManagedServiceIdentityInternal)this).TenantId = (string) content.GetValueForProperty("TenantId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IManagedServiceIdentityInternal)this).TenantId, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IManagedServiceIdentityInternal)this).Type = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentityType) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IManagedServiceIdentityInternal)this).Type, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentityType.CreateFrom); - } - if (content.Contains("UserAssignedIdentity")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IManagedServiceIdentityInternal)this).UserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IUserAssignedIdentities) content.GetValueForProperty("UserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IManagedServiceIdentityInternal)this).UserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.UserAssignedIdentitiesTypeConverter.ConvertFrom); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal ManagedServiceIdentity(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("PrincipalId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IManagedServiceIdentityInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IManagedServiceIdentityInternal)this).PrincipalId, global::System.Convert.ToString); - } - if (content.Contains("TenantId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IManagedServiceIdentityInternal)this).TenantId = (string) content.GetValueForProperty("TenantId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IManagedServiceIdentityInternal)this).TenantId, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IManagedServiceIdentityInternal)this).Type = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentityType) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IManagedServiceIdentityInternal)this).Type, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentityType.CreateFrom); - } - if (content.Contains("UserAssignedIdentity")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IManagedServiceIdentityInternal)this).UserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IUserAssignedIdentities) content.GetValueForProperty("UserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IManagedServiceIdentityInternal)this).UserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.UserAssignedIdentitiesTypeConverter.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.NetworkCloud.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(); - } - } - /// Managed service identity (system assigned and/or user assigned identities) - [System.ComponentModel.TypeConverter(typeof(ManagedServiceIdentityTypeConverter))] - public partial interface IManagedServiceIdentity - - { - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api50/ManagedServiceIdentity.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api50/ManagedServiceIdentity.TypeConverter.cs deleted file mode 100644 index af931604e4db..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api50/ManagedServiceIdentity.TypeConverter.cs +++ /dev/null @@ -1,147 +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.NetworkCloud.Models.Api50 -{ - using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; - - /// - /// A PowerShell PSTypeConverter to support converting to an instance of - /// - public partial class ManagedServiceIdentityTypeConverter : global::System.Management.Automation.PSTypeConverter - { - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false. - /// - public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); - - /// - /// Determines if the converter can convert the parameter to the - /// type. - /// - /// the instance to check if it can be converted to the type. - /// - /// true if the instance could be converted to a type, otherwise false - /// - public static bool CanConvertFrom(dynamic sourceValue) - { - if (null == sourceValue) - { - return true; - } - global::System.Type type = sourceValue.GetType(); - if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) - { - // we say yest to PSObjects - return true; - } - if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) - { - // we say yest to Hashtables/dictionaries - return true; - } - try - { - if (null != sourceValue.ToJsonString()) - { - return true; - } - } - catch - { - // Not one of our objects - } - try - { - string text = sourceValue.ToString()?.Trim(); - return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonType.Object; - } - catch - { - // Doesn't look like it can be treated as JSON - } - return false; - } - - /// - /// Determines if the parameter can be converted to the - /// parameter - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false - /// - public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; - - /// - /// Converts the parameter to the parameter using and - /// - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// - /// an instance of , or null if there is no suitable conversion. - /// - public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); - - /// - /// Converts the parameter into an instance of - /// - /// the value to convert into an instance of . - /// - /// an instance of , or null if there is no suitable conversion. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IManagedServiceIdentity ConvertFrom(dynamic sourceValue) - { - if (null == sourceValue) - { - return null; - } - global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IManagedServiceIdentity).IsAssignableFrom(type)) - { - return sourceValue; - } - try - { - return ManagedServiceIdentity.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; - } - catch - { - // Unable to use JSON pattern - } - if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) - { - return ManagedServiceIdentity.DeserializeFromPSObject(sourceValue); - } - if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) - { - return ManagedServiceIdentity.DeserializeFromDictionary(sourceValue); - } - return null; - } - - /// NotImplemented -- this will return null - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// will always return null. - public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api50/ManagedServiceIdentity.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api50/ManagedServiceIdentity.cs deleted file mode 100644 index 4cdff22d345d..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api50/ManagedServiceIdentity.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.NetworkCloud.Models.Api50 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; - - /// Managed service identity (system assigned and/or user assigned identities) - public partial class ManagedServiceIdentity : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IManagedServiceIdentity, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IManagedServiceIdentityInternal - { - - /// Internal Acessors for PrincipalId - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IManagedServiceIdentityInternal.PrincipalId { get => this._principalId; set { {_principalId = value;} } } - - /// Internal Acessors for TenantId - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IManagedServiceIdentityInternal.TenantId { get => this._tenantId; set { {_tenantId = value;} } } - - /// Backing field for property. - private string _principalId; - - /// - /// The service principal ID of the system assigned identity. This property will only be provided for a system assigned identity. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string PrincipalId { get => this._principalId; } - - /// Backing field for property. - private string _tenantId; - - /// - /// The tenant ID of the system assigned identity. This property will only be provided for a system assigned identity. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string TenantId { get => this._tenantId; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentityType _type; - - /// - /// Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentityType Type { get => this._type; set => this._type = value; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IUserAssignedIdentities _userAssignedIdentity; - - /// - /// 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.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IUserAssignedIdentities UserAssignedIdentity { get => (this._userAssignedIdentity = this._userAssignedIdentity ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.UserAssignedIdentities()); set => this._userAssignedIdentity = value; } - - /// Creates an new instance. - public ManagedServiceIdentity() - { - - } - } - /// Managed service identity (system assigned and/or user assigned identities) - public partial interface IManagedServiceIdentity : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable - { - /// - /// The service principal ID of the system assigned identity. This property will only be provided for a system assigned identity. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - 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) })] - string PrincipalId { get; } - /// - /// The tenant ID of the system assigned identity. This property will only be provided for a system assigned identity. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - 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) })] - string TenantId { get; } - /// - /// Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - 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.NetworkCloud.Support.ManagedServiceIdentityType) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentityType 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.NetworkCloud.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.NetworkCloud.Models.Api50.IUserAssignedIdentities) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IUserAssignedIdentities UserAssignedIdentity { get; set; } - - } - /// Managed service identity (system assigned and/or user assigned identities) - internal partial interface IManagedServiceIdentityInternal - - { - /// - /// The service principal ID of the system assigned identity. This property will only be provided for a system assigned identity. - /// - string PrincipalId { get; set; } - /// - /// The tenant ID of the system assigned identity. This property will only be provided for a system assigned identity. - /// - string TenantId { get; set; } - /// - /// Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentityType 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.NetworkCloud.Models.Api50.IUserAssignedIdentities UserAssignedIdentity { get; set; } - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api50/ManagedServiceIdentity.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api50/ManagedServiceIdentity.json.cs deleted file mode 100644 index 9478f4f47bf6..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api50/ManagedServiceIdentity.json.cs +++ /dev/null @@ -1,120 +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.NetworkCloud.Models.Api50 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; - - /// Managed service identity (system assigned and/or user assigned identities) - public partial class ManagedServiceIdentity - { - - /// - /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object - /// before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The JsonNode that should be deserialized into this object. - - partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json); - - /// - /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The JSON container that the serialization result will be placed in. - - partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container); - - /// - /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of - /// the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the - /// output parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The JsonNode that should be deserialized into this object. - /// Determines if the rest of the deserialization should be processed, or if the method should return - /// instantly. - - partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json, ref bool returnNow); - - /// - /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the - /// object before it is serialized. - /// If you wish to disable the default serialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The JSON container that the serialization result will be placed in. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, ref bool returnNow); - - /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IManagedServiceIdentity. - /// - /// a to deserialize from. - /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IManagedServiceIdentity. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IManagedServiceIdentity FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) - { - return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new ManagedServiceIdentity(json) : null; - } - - /// - /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject into a new instance of . - /// - /// A Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject instance to deserialize from. - internal ManagedServiceIdentity(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) - { - bool returnNow = false; - BeforeFromJson(json, ref returnNow); - if (returnNow) - { - return; - } - {_principalId = If( json?.PropertyT("principalId"), out var __jsonPrincipalId) ? (string)__jsonPrincipalId : (string)PrincipalId;} - {_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.NetworkCloud.Models.Api50.UserAssignedIdentities.FromJson(__jsonUserAssignedIdentities) : UserAssignedIdentity;} - AfterFromJson(json); - } - - /// - /// Serializes this instance of into a . - /// - /// The container to serialize this object into. If the caller - /// passes in null, a new instance will be created and returned to the caller. - /// Allows the caller to choose the depth of the serialization. See . - /// - /// a serialized instance of as a . - /// - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode) - { - container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject(); - - bool returnNow = false; - BeforeToJson(ref container, ref returnNow); - if (returnNow) - { - return container; - } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) - { - AddIf( null != (((object)this._principalId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._principalId.ToString()) : null, "principalId" ,container.Add ); - } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) - { - AddIf( null != (((object)this._tenantId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._tenantId.ToString()) : null, "tenantId" ,container.Add ); - } - AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._type.ToString()) : null, "type" ,container.Add ); - AddIf( null != this._userAssignedIdentity ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) this._userAssignedIdentity.ToJson(null,serializationMode) : null, "userAssignedIdentities" ,container.Add ); - AfterToJson(ref container); - return container; - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api50/Operation.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api50/Operation.PowerShell.cs deleted file mode 100644 index fea197dcb92c..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api50/Operation.PowerShell.cs +++ /dev/null @@ -1,230 +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.NetworkCloud.Models.Api50 -{ - using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; - - /// - /// Details of a REST API operation, returned from the Resource Provider Operations API - /// - [System.ComponentModel.TypeConverter(typeof(OperationTypeConverter))] - public partial class Operation - { - - /// - /// 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.NetworkCloud.Models.Api50.IOperation DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new Operation(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.NetworkCloud.Models.Api50.IOperation DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new Operation(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.NetworkCloud.Models.Api50.IOperation FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal Operation(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("Display")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IOperationInternal)this).Display = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IOperationDisplay) content.GetValueForProperty("Display",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IOperationInternal)this).Display, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.OperationDisplayTypeConverter.ConvertFrom); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IOperationInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IOperationInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("IsDataAction")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IOperationInternal)this).IsDataAction = (bool?) content.GetValueForProperty("IsDataAction",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IOperationInternal)this).IsDataAction, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("Origin")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IOperationInternal)this).Origin = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.Origin?) content.GetValueForProperty("Origin",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IOperationInternal)this).Origin, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.Origin.CreateFrom); - } - if (content.Contains("ActionType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IOperationInternal)this).ActionType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ActionType?) content.GetValueForProperty("ActionType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IOperationInternal)this).ActionType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ActionType.CreateFrom); - } - if (content.Contains("DisplayProvider")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IOperationInternal)this).DisplayProvider = (string) content.GetValueForProperty("DisplayProvider",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IOperationInternal)this).DisplayProvider, global::System.Convert.ToString); - } - if (content.Contains("DisplayResource")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IOperationInternal)this).DisplayResource = (string) content.GetValueForProperty("DisplayResource",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IOperationInternal)this).DisplayResource, global::System.Convert.ToString); - } - if (content.Contains("DisplayOperation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IOperationInternal)this).DisplayOperation = (string) content.GetValueForProperty("DisplayOperation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IOperationInternal)this).DisplayOperation, global::System.Convert.ToString); - } - if (content.Contains("DisplayDescription")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IOperationInternal)this).DisplayDescription = (string) content.GetValueForProperty("DisplayDescription",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IOperationInternal)this).DisplayDescription, 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 Operation(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("Display")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IOperationInternal)this).Display = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IOperationDisplay) content.GetValueForProperty("Display",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IOperationInternal)this).Display, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.OperationDisplayTypeConverter.ConvertFrom); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IOperationInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IOperationInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("IsDataAction")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IOperationInternal)this).IsDataAction = (bool?) content.GetValueForProperty("IsDataAction",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IOperationInternal)this).IsDataAction, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("Origin")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IOperationInternal)this).Origin = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.Origin?) content.GetValueForProperty("Origin",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IOperationInternal)this).Origin, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.Origin.CreateFrom); - } - if (content.Contains("ActionType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IOperationInternal)this).ActionType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ActionType?) content.GetValueForProperty("ActionType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IOperationInternal)this).ActionType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ActionType.CreateFrom); - } - if (content.Contains("DisplayProvider")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IOperationInternal)this).DisplayProvider = (string) content.GetValueForProperty("DisplayProvider",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IOperationInternal)this).DisplayProvider, global::System.Convert.ToString); - } - if (content.Contains("DisplayResource")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IOperationInternal)this).DisplayResource = (string) content.GetValueForProperty("DisplayResource",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IOperationInternal)this).DisplayResource, global::System.Convert.ToString); - } - if (content.Contains("DisplayOperation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IOperationInternal)this).DisplayOperation = (string) content.GetValueForProperty("DisplayOperation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IOperationInternal)this).DisplayOperation, global::System.Convert.ToString); - } - if (content.Contains("DisplayDescription")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IOperationInternal)this).DisplayDescription = (string) content.GetValueForProperty("DisplayDescription",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IOperationInternal)this).DisplayDescription, 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.NetworkCloud.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 a REST API operation, returned from the Resource Provider Operations API - [System.ComponentModel.TypeConverter(typeof(OperationTypeConverter))] - public partial interface IOperation - - { - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api50/Operation.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api50/Operation.TypeConverter.cs deleted file mode 100644 index 784acac36b2e..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api50/Operation.TypeConverter.cs +++ /dev/null @@ -1,146 +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.NetworkCloud.Models.Api50 -{ - using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; - - /// - /// A PowerShell PSTypeConverter to support converting to an instance of - /// - public partial class OperationTypeConverter : global::System.Management.Automation.PSTypeConverter - { - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false. - /// - public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); - - /// - /// Determines if the converter can convert the parameter to the type. - /// - /// the instance to check if it can be converted to the type. - /// - /// true if the instance could be converted to a type, otherwise false - /// - public static bool CanConvertFrom(dynamic sourceValue) - { - if (null == sourceValue) - { - return true; - } - global::System.Type type = sourceValue.GetType(); - if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) - { - // we say yest to PSObjects - return true; - } - if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) - { - // we say yest to Hashtables/dictionaries - return true; - } - try - { - if (null != sourceValue.ToJsonString()) - { - return true; - } - } - catch - { - // Not one of our objects - } - try - { - string text = sourceValue.ToString()?.Trim(); - return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonType.Object; - } - catch - { - // Doesn't look like it can be treated as JSON - } - return false; - } - - /// - /// Determines if the parameter can be converted to the - /// parameter - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false - /// - public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; - - /// - /// Converts the parameter to the parameter using and - /// - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// - /// an instance of , or null if there is no suitable conversion. - /// - public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); - - /// - /// Converts the parameter into an instance of - /// - /// the value to convert into an instance of . - /// - /// an instance of , or null if there is no suitable conversion. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IOperation ConvertFrom(dynamic sourceValue) - { - if (null == sourceValue) - { - return null; - } - global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IOperation).IsAssignableFrom(type)) - { - return sourceValue; - } - try - { - return Operation.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; - } - catch - { - // Unable to use JSON pattern - } - if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) - { - return Operation.DeserializeFromPSObject(sourceValue); - } - if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) - { - return Operation.DeserializeFromDictionary(sourceValue); - } - return null; - } - - /// NotImplemented -- this will return null - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// will always return null. - public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api50/Operation.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api50/Operation.cs deleted file mode 100644 index 50f1b7c5c135..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api50/Operation.cs +++ /dev/null @@ -1,256 +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.NetworkCloud.Models.Api50 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; - - /// - /// Details of a REST API operation, returned from the Resource Provider Operations API - /// - public partial class Operation : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IOperation, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IOperationInternal - { - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ActionType? _actionType; - - /// - /// Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ActionType? ActionType { get => this._actionType; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IOperationDisplay _display; - - /// Localized display information for this particular operation. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IOperationDisplay Display { get => (this._display = this._display ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.OperationDisplay()); set => this._display = value; } - - /// - /// The short, localized friendly description of the operation; suitable for tool tips and detailed views. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string DisplayDescription { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IOperationDisplayInternal)Display).Description; } - - /// - /// The concise, localized friendly name for the operation; suitable for dropdowns. E.g. "Create or Update Virtual Machine", - /// "Restart Virtual Machine". - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string DisplayOperation { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IOperationDisplayInternal)Display).Operation; } - - /// - /// The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or "Microsoft Compute". - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string DisplayProvider { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IOperationDisplayInternal)Display).Provider; } - - /// - /// The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or "Job Schedule Collections". - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string DisplayResource { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IOperationDisplayInternal)Display).Resource; } - - /// Backing field for property. - private bool? _isDataAction; - - /// - /// Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for ARM/control-plane - /// operations. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public bool? IsDataAction { get => this._isDataAction; } - - /// Internal Acessors for ActionType - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ActionType? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IOperationInternal.ActionType { get => this._actionType; set { {_actionType = value;} } } - - /// Internal Acessors for Display - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IOperationDisplay Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IOperationInternal.Display { get => (this._display = this._display ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.OperationDisplay()); set { {_display = value;} } } - - /// Internal Acessors for DisplayDescription - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IOperationInternal.DisplayDescription { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IOperationDisplayInternal)Display).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IOperationDisplayInternal)Display).Description = value; } - - /// Internal Acessors for DisplayOperation - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IOperationInternal.DisplayOperation { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IOperationDisplayInternal)Display).Operation; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IOperationDisplayInternal)Display).Operation = value; } - - /// Internal Acessors for DisplayProvider - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IOperationInternal.DisplayProvider { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IOperationDisplayInternal)Display).Provider; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IOperationDisplayInternal)Display).Provider = value; } - - /// Internal Acessors for DisplayResource - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IOperationInternal.DisplayResource { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IOperationDisplayInternal)Display).Resource; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IOperationDisplayInternal)Display).Resource = value; } - - /// Internal Acessors for IsDataAction - bool? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IOperationInternal.IsDataAction { get => this._isDataAction; set { {_isDataAction = value;} } } - - /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IOperationInternal.Name { get => this._name; set { {_name = value;} } } - - /// Internal Acessors for Origin - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.Origin? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IOperationInternal.Origin { get => this._origin; set { {_origin = value;} } } - - /// Backing field for property. - private string _name; - - /// - /// The name of the operation, as per Resource-Based Access Control (RBAC). Examples: "Microsoft.Compute/virtualMachines/write", - /// "Microsoft.Compute/virtualMachines/capture/action" - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string Name { get => this._name; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.Origin? _origin; - - /// - /// The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is - /// "user,system" - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.Origin? Origin { get => this._origin; } - - /// Creates an new instance. - public Operation() - { - - } - } - /// Details of a REST API operation, returned from the Resource Provider Operations API - public partial interface IOperation : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable - { - /// - /// Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"Enum. Indicates the action type. ""Internal"" refers to actions that are for internal only APIs.", - SerializedName = @"actionType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ActionType) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ActionType? ActionType { get; } - /// - /// The short, localized friendly description of the operation; suitable for tool tips and detailed views. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The short, localized friendly description of the operation; suitable for tool tips and detailed views.", - SerializedName = @"description", - PossibleTypes = new [] { typeof(string) })] - string DisplayDescription { get; } - /// - /// The concise, localized friendly name for the operation; suitable for dropdowns. E.g. "Create or Update Virtual Machine", - /// "Restart Virtual Machine". - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The concise, localized friendly name for the operation; suitable for dropdowns. E.g. ""Create or Update Virtual Machine"", ""Restart Virtual Machine"".", - SerializedName = @"operation", - PossibleTypes = new [] { typeof(string) })] - string DisplayOperation { get; } - /// - /// The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or "Microsoft Compute". - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The localized friendly form of the resource provider name, e.g. ""Microsoft Monitoring Insights"" or ""Microsoft Compute"".", - SerializedName = @"provider", - PossibleTypes = new [] { typeof(string) })] - string DisplayProvider { get; } - /// - /// The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or "Job Schedule Collections". - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The localized friendly name of the resource type related to this operation. E.g. ""Virtual Machines"" or ""Job Schedule Collections"".", - SerializedName = @"resource", - PossibleTypes = new [] { typeof(string) })] - string DisplayResource { get; } - /// - /// Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for ARM/control-plane - /// operations. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"Whether the operation applies to data-plane. This is ""true"" for data-plane operations and ""false"" for ARM/control-plane operations.", - SerializedName = @"isDataAction", - PossibleTypes = new [] { typeof(bool) })] - bool? IsDataAction { get; } - /// - /// The name of the operation, as per Resource-Based Access Control (RBAC). Examples: "Microsoft.Compute/virtualMachines/write", - /// "Microsoft.Compute/virtualMachines/capture/action" - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The name of the operation, as per Resource-Based Access Control (RBAC). Examples: ""Microsoft.Compute/virtualMachines/write"", ""Microsoft.Compute/virtualMachines/capture/action""", - SerializedName = @"name", - PossibleTypes = new [] { typeof(string) })] - string Name { get; } - /// - /// The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is - /// "user,system" - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is ""user,system""", - SerializedName = @"origin", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.Origin) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.Origin? Origin { get; } - - } - /// Details of a REST API operation, returned from the Resource Provider Operations API - internal partial interface IOperationInternal - - { - /// - /// Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ActionType? ActionType { get; set; } - /// Localized display information for this particular operation. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IOperationDisplay Display { get; set; } - /// - /// The short, localized friendly description of the operation; suitable for tool tips and detailed views. - /// - string DisplayDescription { get; set; } - /// - /// The concise, localized friendly name for the operation; suitable for dropdowns. E.g. "Create or Update Virtual Machine", - /// "Restart Virtual Machine". - /// - string DisplayOperation { get; set; } - /// - /// The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or "Microsoft Compute". - /// - string DisplayProvider { get; set; } - /// - /// The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or "Job Schedule Collections". - /// - string DisplayResource { get; set; } - /// - /// Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for ARM/control-plane - /// operations. - /// - bool? IsDataAction { get; set; } - /// - /// The name of the operation, as per Resource-Based Access Control (RBAC). Examples: "Microsoft.Compute/virtualMachines/write", - /// "Microsoft.Compute/virtualMachines/capture/action" - /// - string Name { get; set; } - /// - /// The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is - /// "user,system" - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.Origin? Origin { get; set; } - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api50/Operation.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api50/Operation.json.cs deleted file mode 100644 index 2bf7792dd003..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api50/Operation.json.cs +++ /dev/null @@ -1,130 +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.NetworkCloud.Models.Api50 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; - - /// - /// Details of a REST API operation, returned from the Resource Provider Operations API - /// - public partial class Operation - { - - /// - /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object - /// before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The JsonNode that should be deserialized into this object. - - partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json); - - /// - /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The JSON container that the serialization result will be placed in. - - partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container); - - /// - /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of - /// the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the - /// output parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The JsonNode that should be deserialized into this object. - /// Determines if the rest of the deserialization should be processed, or if the method should return - /// instantly. - - partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json, ref bool returnNow); - - /// - /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the - /// object before it is serialized. - /// If you wish to disable the default serialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The JSON container that the serialization result will be placed in. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, ref bool returnNow); - - /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IOperation. - /// - /// a to deserialize from. - /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IOperation. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IOperation FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) - { - return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new Operation(json) : null; - } - - /// - /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject into a new instance of . - /// - /// A Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject instance to deserialize from. - internal Operation(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) - { - bool returnNow = false; - BeforeFromJson(json, ref returnNow); - if (returnNow) - { - return; - } - {_display = If( json?.PropertyT("display"), out var __jsonDisplay) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.OperationDisplay.FromJson(__jsonDisplay) : Display;} - {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} - {_isDataAction = If( json?.PropertyT("isDataAction"), out var __jsonIsDataAction) ? (bool?)__jsonIsDataAction : IsDataAction;} - {_origin = If( json?.PropertyT("origin"), out var __jsonOrigin) ? (string)__jsonOrigin : (string)Origin;} - {_actionType = If( json?.PropertyT("actionType"), out var __jsonActionType) ? (string)__jsonActionType : (string)ActionType;} - AfterFromJson(json); - } - - /// - /// Serializes this instance of into a . - /// - /// The container to serialize this object into. If the caller - /// passes in null, a new instance will be created and returned to the caller. - /// Allows the caller to choose the depth of the serialization. See . - /// - /// a serialized instance of as a . - /// - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode) - { - container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject(); - - bool returnNow = false; - BeforeToJson(ref container, ref returnNow); - if (returnNow) - { - return container; - } - AddIf( null != this._display ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) this._display.ToJson(null,serializationMode) : null, "display" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) - { - AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); - } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) - { - AddIf( null != this._isDataAction ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonBoolean((bool)this._isDataAction) : null, "isDataAction" ,container.Add ); - } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) - { - AddIf( null != (((object)this._origin)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._origin.ToString()) : null, "origin" ,container.Add ); - } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) - { - AddIf( null != (((object)this._actionType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._actionType.ToString()) : null, "actionType" ,container.Add ); - } - AfterToJson(ref container); - return container; - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api50/OperationDisplay.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api50/OperationDisplay.PowerShell.cs deleted file mode 100644 index 3bbfb134a1d9..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api50/OperationDisplay.PowerShell.cs +++ /dev/null @@ -1,188 +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.NetworkCloud.Models.Api50 -{ - using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; - - /// Localized display information for this particular operation. - [System.ComponentModel.TypeConverter(typeof(OperationDisplayTypeConverter))] - public partial class OperationDisplay - { - - /// - /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the - /// object before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Collections.IDictionary content that should be used. - - partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); - - /// - /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object - /// before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Management.Automation.PSObject content that should be used. - - partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); - - /// - /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Collections.IDictionary content that should be used. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); - - /// - /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Management.Automation.PSObject content that should be used. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); - - /// - /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior - /// - /// /// instance serialized to a string, normally it is a Json - /// /// set returnNow to true if you provide a customized OverrideToString function - - partial void OverrideToString(ref string stringResult, ref bool returnNow); - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IOperationDisplay DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new OperationDisplay(content); - } - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IOperationDisplay DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new OperationDisplay(content); - } - - /// - /// Creates a new instance of , deserializing the content from a json string. - /// - /// a string containing a JSON serialized instance of this model. - /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IOperationDisplay FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal OperationDisplay(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("Provider")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IOperationDisplayInternal)this).Provider = (string) content.GetValueForProperty("Provider",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IOperationDisplayInternal)this).Provider, global::System.Convert.ToString); - } - if (content.Contains("Resource")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IOperationDisplayInternal)this).Resource = (string) content.GetValueForProperty("Resource",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IOperationDisplayInternal)this).Resource, global::System.Convert.ToString); - } - if (content.Contains("Operation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IOperationDisplayInternal)this).Operation = (string) content.GetValueForProperty("Operation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IOperationDisplayInternal)this).Operation, global::System.Convert.ToString); - } - if (content.Contains("Description")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IOperationDisplayInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IOperationDisplayInternal)this).Description, global::System.Convert.ToString); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal OperationDisplay(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("Provider")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IOperationDisplayInternal)this).Provider = (string) content.GetValueForProperty("Provider",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IOperationDisplayInternal)this).Provider, global::System.Convert.ToString); - } - if (content.Contains("Resource")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IOperationDisplayInternal)this).Resource = (string) content.GetValueForProperty("Resource",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IOperationDisplayInternal)this).Resource, global::System.Convert.ToString); - } - if (content.Contains("Operation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IOperationDisplayInternal)this).Operation = (string) content.GetValueForProperty("Operation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IOperationDisplayInternal)this).Operation, global::System.Convert.ToString); - } - if (content.Contains("Description")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IOperationDisplayInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IOperationDisplayInternal)this).Description, 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.NetworkCloud.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(); - } - } - /// Localized display information for this particular operation. - [System.ComponentModel.TypeConverter(typeof(OperationDisplayTypeConverter))] - public partial interface IOperationDisplay - - { - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api50/OperationDisplay.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api50/OperationDisplay.TypeConverter.cs deleted file mode 100644 index dfe4f55cbcdc..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api50/OperationDisplay.TypeConverter.cs +++ /dev/null @@ -1,147 +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.NetworkCloud.Models.Api50 -{ - using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; - - /// - /// A PowerShell PSTypeConverter to support converting to an instance of - /// - public partial class OperationDisplayTypeConverter : global::System.Management.Automation.PSTypeConverter - { - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false. - /// - public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); - - /// - /// Determines if the converter can convert the parameter to the - /// type. - /// - /// the instance to check if it can be converted to the type. - /// - /// true if the instance could be converted to a type, otherwise false - /// - public static bool CanConvertFrom(dynamic sourceValue) - { - if (null == sourceValue) - { - return true; - } - global::System.Type type = sourceValue.GetType(); - if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) - { - // we say yest to PSObjects - return true; - } - if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) - { - // we say yest to Hashtables/dictionaries - return true; - } - try - { - if (null != sourceValue.ToJsonString()) - { - return true; - } - } - catch - { - // Not one of our objects - } - try - { - string text = sourceValue.ToString()?.Trim(); - return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonType.Object; - } - catch - { - // Doesn't look like it can be treated as JSON - } - return false; - } - - /// - /// Determines if the parameter can be converted to the - /// parameter - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false - /// - public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; - - /// - /// Converts the parameter to the parameter using and - /// - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// - /// an instance of , or null if there is no suitable conversion. - /// - public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); - - /// - /// Converts the parameter into an instance of - /// - /// the value to convert into an instance of . - /// - /// an instance of , or null if there is no suitable conversion. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IOperationDisplay ConvertFrom(dynamic sourceValue) - { - if (null == sourceValue) - { - return null; - } - global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IOperationDisplay).IsAssignableFrom(type)) - { - return sourceValue; - } - try - { - return OperationDisplay.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; - } - catch - { - // Unable to use JSON pattern - } - if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) - { - return OperationDisplay.DeserializeFromPSObject(sourceValue); - } - if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) - { - return OperationDisplay.DeserializeFromDictionary(sourceValue); - } - return null; - } - - /// NotImplemented -- this will return null - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// will always return null. - public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api50/OperationDisplay.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api50/OperationDisplay.cs deleted file mode 100644 index 43f1949d031a..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api50/OperationDisplay.cs +++ /dev/null @@ -1,141 +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.NetworkCloud.Models.Api50 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; - - /// Localized display information for this particular operation. - public partial class OperationDisplay : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IOperationDisplay, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IOperationDisplayInternal - { - - /// Backing field for property. - private string _description; - - /// - /// The short, localized friendly description of the operation; suitable for tool tips and detailed views. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string Description { get => this._description; } - - /// Internal Acessors for Description - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IOperationDisplayInternal.Description { get => this._description; set { {_description = value;} } } - - /// Internal Acessors for Operation - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IOperationDisplayInternal.Operation { get => this._operation; set { {_operation = value;} } } - - /// Internal Acessors for Provider - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IOperationDisplayInternal.Provider { get => this._provider; set { {_provider = value;} } } - - /// Internal Acessors for Resource - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IOperationDisplayInternal.Resource { get => this._resource; set { {_resource = value;} } } - - /// Backing field for property. - private string _operation; - - /// - /// The concise, localized friendly name for the operation; suitable for dropdowns. E.g. "Create or Update Virtual Machine", - /// "Restart Virtual Machine". - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string Operation { get => this._operation; } - - /// Backing field for property. - private string _provider; - - /// - /// The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or "Microsoft Compute". - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string Provider { get => this._provider; } - - /// Backing field for property. - private string _resource; - - /// - /// The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or "Job Schedule Collections". - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string Resource { get => this._resource; } - - /// Creates an new instance. - public OperationDisplay() - { - - } - } - /// Localized display information for this particular operation. - public partial interface IOperationDisplay : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable - { - /// - /// The short, localized friendly description of the operation; suitable for tool tips and detailed views. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The short, localized friendly description of the operation; suitable for tool tips and detailed views.", - SerializedName = @"description", - PossibleTypes = new [] { typeof(string) })] - string Description { get; } - /// - /// The concise, localized friendly name for the operation; suitable for dropdowns. E.g. "Create or Update Virtual Machine", - /// "Restart Virtual Machine". - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The concise, localized friendly name for the operation; suitable for dropdowns. E.g. ""Create or Update Virtual Machine"", ""Restart Virtual Machine"".", - SerializedName = @"operation", - PossibleTypes = new [] { typeof(string) })] - string Operation { get; } - /// - /// The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or "Microsoft Compute". - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The localized friendly form of the resource provider name, e.g. ""Microsoft Monitoring Insights"" or ""Microsoft Compute"".", - SerializedName = @"provider", - PossibleTypes = new [] { typeof(string) })] - string Provider { get; } - /// - /// The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or "Job Schedule Collections". - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The localized friendly name of the resource type related to this operation. E.g. ""Virtual Machines"" or ""Job Schedule Collections"".", - SerializedName = @"resource", - PossibleTypes = new [] { typeof(string) })] - string Resource { get; } - - } - /// Localized display information for this particular operation. - internal partial interface IOperationDisplayInternal - - { - /// - /// The short, localized friendly description of the operation; suitable for tool tips and detailed views. - /// - string Description { get; set; } - /// - /// The concise, localized friendly name for the operation; suitable for dropdowns. E.g. "Create or Update Virtual Machine", - /// "Restart Virtual Machine". - /// - string Operation { get; set; } - /// - /// The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or "Microsoft Compute". - /// - string Provider { get; set; } - /// - /// The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or "Job Schedule Collections". - /// - string Resource { get; set; } - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api50/OperationDisplay.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api50/OperationDisplay.json.cs deleted file mode 100644 index cea34d63b9f4..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api50/OperationDisplay.json.cs +++ /dev/null @@ -1,126 +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.NetworkCloud.Models.Api50 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; - - /// Localized display information for this particular operation. - public partial class OperationDisplay - { - - /// - /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object - /// before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The JsonNode that should be deserialized into this object. - - partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json); - - /// - /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The JSON container that the serialization result will be placed in. - - partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container); - - /// - /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of - /// the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the - /// output parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The JsonNode that should be deserialized into this object. - /// Determines if the rest of the deserialization should be processed, or if the method should return - /// instantly. - - partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json, ref bool returnNow); - - /// - /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the - /// object before it is serialized. - /// If you wish to disable the default serialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The JSON container that the serialization result will be placed in. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, ref bool returnNow); - - /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IOperationDisplay. - /// - /// a to deserialize from. - /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IOperationDisplay. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IOperationDisplay FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) - { - return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new OperationDisplay(json) : null; - } - - /// - /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject into a new instance of . - /// - /// A Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject instance to deserialize from. - internal OperationDisplay(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) - { - bool returnNow = false; - BeforeFromJson(json, ref returnNow); - if (returnNow) - { - return; - } - {_provider = If( json?.PropertyT("provider"), out var __jsonProvider) ? (string)__jsonProvider : (string)Provider;} - {_resource = If( json?.PropertyT("resource"), out var __jsonResource) ? (string)__jsonResource : (string)Resource;} - {_operation = If( json?.PropertyT("operation"), out var __jsonOperation) ? (string)__jsonOperation : (string)Operation;} - {_description = If( json?.PropertyT("description"), out var __jsonDescription) ? (string)__jsonDescription : (string)Description;} - AfterFromJson(json); - } - - /// - /// Serializes this instance of into a . - /// - /// The container to serialize this object into. If the caller - /// passes in null, a new instance will be created and returned to the caller. - /// Allows the caller to choose the depth of the serialization. See . - /// - /// a serialized instance of as a . - /// - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode) - { - container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject(); - - bool returnNow = false; - BeforeToJson(ref container, ref returnNow); - if (returnNow) - { - return container; - } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) - { - AddIf( null != (((object)this._provider)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._provider.ToString()) : null, "provider" ,container.Add ); - } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) - { - AddIf( null != (((object)this._resource)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._resource.ToString()) : null, "resource" ,container.Add ); - } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) - { - AddIf( null != (((object)this._operation)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._operation.ToString()) : null, "operation" ,container.Add ); - } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) - { - AddIf( null != (((object)this._description)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._description.ToString()) : null, "description" ,container.Add ); - } - AfterToJson(ref container); - return container; - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api50/OperationListResult.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api50/OperationListResult.PowerShell.cs deleted file mode 100644 index 68556f456dd4..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api50/OperationListResult.PowerShell.cs +++ /dev/null @@ -1,176 +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.NetworkCloud.Models.Api50 -{ - using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; - - /// - /// A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of - /// results. - /// - [System.ComponentModel.TypeConverter(typeof(OperationListResultTypeConverter))] - public partial class OperationListResult - { - - /// - /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the - /// object before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Collections.IDictionary content that should be used. - - partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); - - /// - /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object - /// before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Management.Automation.PSObject content that should be used. - - partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); - - /// - /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Collections.IDictionary content that should be used. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); - - /// - /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Management.Automation.PSObject content that should be used. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); - - /// - /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior - /// - /// /// instance serialized to a string, normally it is a Json - /// /// set returnNow to true if you provide a customized OverrideToString function - - partial void OverrideToString(ref string stringResult, ref bool returnNow); - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IOperationListResult DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new OperationListResult(content); - } - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IOperationListResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new OperationListResult(content); - } - - /// - /// Creates a new instance of , deserializing the content from a json string. - /// - /// a string containing a JSON serialized instance of this model. - /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IOperationListResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal OperationListResult(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("Value")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IOperationListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IOperation[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IOperationListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.OperationTypeConverter.ConvertFrom)); - } - if (content.Contains("NextLink")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IOperationListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IOperationListResultInternal)this).NextLink, global::System.Convert.ToString); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal OperationListResult(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("Value")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IOperationListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IOperation[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IOperationListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.OperationTypeConverter.ConvertFrom)); - } - if (content.Contains("NextLink")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IOperationListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IOperationListResultInternal)this).NextLink, global::System.Convert.ToString); - } - AfterDeserializePSObject(content); - } - - /// Serializes this instance to a json string. - - /// a containing this model serialized to JSON text. - public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeAll)?.ToString(); - - public override string ToString() - { - var returnNow = false; - var result = global::System.String.Empty; - OverrideToString(ref result, ref returnNow); - if (returnNow) - { - return result; - } - return ToJsonString(); - } - } - /// A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of - /// results. - [System.ComponentModel.TypeConverter(typeof(OperationListResultTypeConverter))] - public partial interface IOperationListResult - - { - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api50/OperationListResult.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api50/OperationListResult.TypeConverter.cs deleted file mode 100644 index 8f6fa0ffb4ba..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api50/OperationListResult.TypeConverter.cs +++ /dev/null @@ -1,147 +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.NetworkCloud.Models.Api50 -{ - using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; - - /// - /// A PowerShell PSTypeConverter to support converting to an instance of - /// - public partial class OperationListResultTypeConverter : global::System.Management.Automation.PSTypeConverter - { - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false. - /// - public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); - - /// - /// Determines if the converter can convert the parameter to the - /// type. - /// - /// the instance to check if it can be converted to the type. - /// - /// true if the instance could be converted to a type, otherwise false - /// - public static bool CanConvertFrom(dynamic sourceValue) - { - if (null == sourceValue) - { - return true; - } - global::System.Type type = sourceValue.GetType(); - if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) - { - // we say yest to PSObjects - return true; - } - if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) - { - // we say yest to Hashtables/dictionaries - return true; - } - try - { - if (null != sourceValue.ToJsonString()) - { - return true; - } - } - catch - { - // Not one of our objects - } - try - { - string text = sourceValue.ToString()?.Trim(); - return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonType.Object; - } - catch - { - // Doesn't look like it can be treated as JSON - } - return false; - } - - /// - /// Determines if the parameter can be converted to the - /// parameter - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false - /// - public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; - - /// - /// Converts the parameter to the parameter using and - /// - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// - /// an instance of , or null if there is no suitable conversion. - /// - public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); - - /// - /// Converts the parameter into an instance of - /// - /// the value to convert into an instance of . - /// - /// an instance of , or null if there is no suitable conversion. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IOperationListResult ConvertFrom(dynamic sourceValue) - { - if (null == sourceValue) - { - return null; - } - global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IOperationListResult).IsAssignableFrom(type)) - { - return sourceValue; - } - try - { - return OperationListResult.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; - } - catch - { - // Unable to use JSON pattern - } - if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) - { - return OperationListResult.DeserializeFromPSObject(sourceValue); - } - if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) - { - return OperationListResult.DeserializeFromDictionary(sourceValue); - } - return null; - } - - /// NotImplemented -- this will return null - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// will always return null. - public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api50/OperationListResult.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api50/OperationListResult.cs deleted file mode 100644 index a6500b9c0438..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api50/OperationListResult.cs +++ /dev/null @@ -1,79 +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.NetworkCloud.Models.Api50 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; - - /// - /// A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of - /// results. - /// - public partial class OperationListResult : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IOperationListResult, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IOperationListResultInternal - { - - /// Internal Acessors for NextLink - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IOperationListResultInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } - - /// Internal Acessors for Value - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IOperation[] Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IOperationListResultInternal.Value { get => this._value; set { {_value = value;} } } - - /// Backing field for property. - private string _nextLink; - - /// URL to get the next set of operation list results (if there are any). - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string NextLink { get => this._nextLink; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IOperation[] _value; - - /// List of operations supported by the resource provider - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IOperation[] Value { get => this._value; } - - /// Creates an new instance. - public OperationListResult() - { - - } - } - /// A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of - /// results. - public partial interface IOperationListResult : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable - { - /// URL to get the next set of operation list results (if there are any). - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"URL to get the next set of operation list results (if there are any).", - SerializedName = @"nextLink", - PossibleTypes = new [] { typeof(string) })] - string NextLink { get; } - /// List of operations supported by the resource provider - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"List of operations supported by the resource provider", - SerializedName = @"value", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IOperation) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IOperation[] Value { get; } - - } - /// A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of - /// results. - internal partial interface IOperationListResultInternal - - { - /// URL to get the next set of operation list results (if there are any). - string NextLink { get; set; } - /// List of operations supported by the resource provider - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IOperation[] Value { get; set; } - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api50/OperationListResult.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api50/OperationListResult.json.cs deleted file mode 100644 index e19b5719ee28..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api50/OperationListResult.json.cs +++ /dev/null @@ -1,127 +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.NetworkCloud.Models.Api50 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; - - /// - /// A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of - /// results. - /// - public partial class OperationListResult - { - - /// - /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object - /// before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The JsonNode that should be deserialized into this object. - - partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json); - - /// - /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The JSON container that the serialization result will be placed in. - - partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container); - - /// - /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of - /// the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the - /// output parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The JsonNode that should be deserialized into this object. - /// Determines if the rest of the deserialization should be processed, or if the method should return - /// instantly. - - partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json, ref bool returnNow); - - /// - /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the - /// object before it is serialized. - /// If you wish to disable the default serialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The JSON container that the serialization result will be placed in. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, ref bool returnNow); - - /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IOperationListResult. - /// - /// a to deserialize from. - /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IOperationListResult. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IOperationListResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) - { - return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new OperationListResult(json) : null; - } - - /// - /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject into a new instance of . - /// - /// A Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject instance to deserialize from. - internal OperationListResult(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) - { - bool returnNow = false; - BeforeFromJson(json, ref returnNow); - if (returnNow) - { - return; - } - {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api50.IOperation) (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.Operation.FromJson(__u) )) ))() : null : Value;} - {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)NextLink;} - AfterFromJson(json); - } - - /// - /// Serializes this instance of into a . - /// - /// The container to serialize this object into. If the caller - /// passes in null, a new instance will be created and returned to the caller. - /// Allows the caller to choose the depth of the serialization. See . - /// - /// a serialized instance of as a . - /// - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode) - { - container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject(); - - bool returnNow = false; - BeforeToJson(ref container, ref returnNow); - if (returnNow) - { - return container; - } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) - { - if (null != this._value) - { - var __w = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.XNodeArray(); - foreach( var __x in this._value ) - { - AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); - } - container.Add("value",__w); - } - } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) - { - AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); - } - AfterToJson(ref container); - return container; - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api50/Resource.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api50/Resource.PowerShell.cs deleted file mode 100644 index e01feafb254e..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api50/Resource.PowerShell.cs +++ /dev/null @@ -1,238 +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.NetworkCloud.Models.Api50 -{ - using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; - - /// - /// Common fields that are returned in the response for all Azure Resource Manager resources - /// - [System.ComponentModel.TypeConverter(typeof(ResourceTypeConverter))] - public partial class Resource - { - - /// - /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the - /// object before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Collections.IDictionary content that should be used. - - partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); - - /// - /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object - /// before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Management.Automation.PSObject content that should be used. - - partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); - - /// - /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Collections.IDictionary content that should be used. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); - - /// - /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Management.Automation.PSObject content that should be used. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); - - /// - /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior - /// - /// /// instance serialized to a string, normally it is a Json - /// /// set returnNow to true if you provide a customized OverrideToString function - - partial void OverrideToString(ref string stringResult, ref bool returnNow); - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResource DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new Resource(content); - } - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new Resource(content); - } - - /// - /// Creates a new instance of , deserializing the content from a json string. - /// - /// a string containing a JSON serialized instance of this model. - /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal Resource(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("SystemData")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.SystemDataTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Type, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)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("SystemDataCreatedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataLastModifiedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)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 Resource(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("SystemData")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.SystemDataTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Type, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)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("SystemDataCreatedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataLastModifiedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)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.NetworkCloud.Runtime.SerializationMode.IncludeAll)?.ToString(); - - public override string ToString() - { - var returnNow = false; - var result = global::System.String.Empty; - OverrideToString(ref result, ref returnNow); - if (returnNow) - { - return result; - } - return ToJsonString(); - } - } - /// Common fields that are returned in the response for all Azure Resource Manager resources - [System.ComponentModel.TypeConverter(typeof(ResourceTypeConverter))] - public partial interface IResource - - { - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api50/Resource.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api50/Resource.TypeConverter.cs deleted file mode 100644 index d29f7c22b133..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api50/Resource.TypeConverter.cs +++ /dev/null @@ -1,146 +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.NetworkCloud.Models.Api50 -{ - using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; - - /// - /// A PowerShell PSTypeConverter to support converting to an instance of - /// - public partial class ResourceTypeConverter : global::System.Management.Automation.PSTypeConverter - { - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false. - /// - public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); - - /// - /// Determines if the converter can convert the parameter to the type. - /// - /// the instance to check if it can be converted to the type. - /// - /// true if the instance could be converted to a type, otherwise false - /// - public static bool CanConvertFrom(dynamic sourceValue) - { - if (null == sourceValue) - { - return true; - } - global::System.Type type = sourceValue.GetType(); - if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) - { - // we say yest to PSObjects - return true; - } - if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) - { - // we say yest to Hashtables/dictionaries - return true; - } - try - { - if (null != sourceValue.ToJsonString()) - { - return true; - } - } - catch - { - // Not one of our objects - } - try - { - string text = sourceValue.ToString()?.Trim(); - return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonType.Object; - } - catch - { - // Doesn't look like it can be treated as JSON - } - return false; - } - - /// - /// Determines if the parameter can be converted to the - /// parameter - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false - /// - public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; - - /// - /// Converts the parameter to the parameter using and - /// - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// - /// an instance of , or null if there is no suitable conversion. - /// - public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); - - /// - /// Converts the parameter into an instance of - /// - /// the value to convert into an instance of . - /// - /// an instance of , or null if there is no suitable conversion. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResource ConvertFrom(dynamic sourceValue) - { - if (null == sourceValue) - { - return null; - } - global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResource).IsAssignableFrom(type)) - { - return sourceValue; - } - try - { - return Resource.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; - } - catch - { - // Unable to use JSON pattern - } - if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) - { - return Resource.DeserializeFromPSObject(sourceValue); - } - if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) - { - return Resource.DeserializeFromDictionary(sourceValue); - } - return null; - } - - /// NotImplemented -- this will return null - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// will always return null. - public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api50/Resource.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api50/Resource.cs deleted file mode 100644 index 7074e361b8e8..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api50/Resource.cs +++ /dev/null @@ -1,208 +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.NetworkCloud.Models.Api50 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; - - /// - /// Common fields that are returned in the response for all Azure Resource Manager resources - /// - public partial class Resource : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResource, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal - { - - /// Backing field for property. - private string _id; - - /// - /// Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string Id { get => this._id; } - - /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal.Id { get => this._id; set { {_id = value;} } } - - /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal.Name { get => this._name; set { {_name = value;} } } - - /// Internal Acessors for SystemData - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ISystemData Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal.SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.SystemData()); set { {_systemData = value;} } } - - /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal.Type { get => this._type; set { {_type = value;} } } - - /// Backing field for property. - private string _name; - - /// The name of the resource - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string Name { get => this._name; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ISystemData _systemData; - - /// - /// Azure Resource Manager metadata containing createdBy and modifiedBy information. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ISystemData SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.SystemData()); } - - /// The timestamp of resource creation (UTC). - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ISystemDataInternal)SystemData).CreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ISystemDataInternal)SystemData).CreatedAt = value ?? default(global::System.DateTime); } - - /// The identity that created the resource. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ISystemDataInternal)SystemData).CreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ISystemDataInternal)SystemData).CreatedBy = value ?? null; } - - /// The type of identity that created the resource. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType? SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ISystemDataInternal)SystemData).CreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ISystemDataInternal)SystemData).CreatedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType)""); } - - /// The timestamp of resource last modification (UTC) - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ISystemDataInternal)SystemData).LastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ISystemDataInternal)SystemData).LastModifiedAt = value ?? default(global::System.DateTime); } - - /// The identity that last modified the resource. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ISystemDataInternal)SystemData).LastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ISystemDataInternal)SystemData).LastModifiedBy = value ?? null; } - - /// The type of identity that last modified the resource. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType? SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ISystemDataInternal)SystemData).LastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ISystemDataInternal)SystemData).LastModifiedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType)""); } - - /// Backing field for property. - private string _type; - - /// - /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string Type { get => this._type; } - - /// Creates an new instance. - public Resource() - { - - } - } - /// Common fields that are returned in the response for all Azure Resource Manager resources - public partial interface IResource : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable - { - /// - /// Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"Fully qualified resource ID for the resource. E.g. ""/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}""", - SerializedName = @"id", - PossibleTypes = new [] { typeof(string) })] - string Id { get; } - /// The name of the resource - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The name of the resource", - SerializedName = @"name", - PossibleTypes = new [] { typeof(string) })] - string Name { get; } - /// The timestamp of resource creation (UTC). - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The timestamp of resource creation (UTC).", - SerializedName = @"createdAt", - PossibleTypes = new [] { typeof(global::System.DateTime) })] - global::System.DateTime? SystemDataCreatedAt { get; set; } - /// The identity that created the resource. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The identity that created the resource.", - SerializedName = @"createdBy", - PossibleTypes = new [] { typeof(string) })] - string SystemDataCreatedBy { get; set; } - /// The type of identity that created the resource. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The type of identity that created the resource.", - SerializedName = @"createdByType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType? SystemDataCreatedByType { get; set; } - /// The timestamp of resource last modification (UTC) - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The timestamp of resource last modification (UTC)", - SerializedName = @"lastModifiedAt", - PossibleTypes = new [] { typeof(global::System.DateTime) })] - global::System.DateTime? SystemDataLastModifiedAt { get; set; } - /// The identity that last modified the resource. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The identity that last modified the resource.", - SerializedName = @"lastModifiedBy", - PossibleTypes = new [] { typeof(string) })] - string SystemDataLastModifiedBy { get; set; } - /// The type of identity that last modified the resource. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The type of identity that last modified the resource.", - SerializedName = @"lastModifiedByType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType? SystemDataLastModifiedByType { get; set; } - /// - /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The type of the resource. E.g. ""Microsoft.Compute/virtualMachines"" or ""Microsoft.Storage/storageAccounts""", - SerializedName = @"type", - PossibleTypes = new [] { typeof(string) })] - string Type { get; } - - } - /// Common fields that are returned in the response for all Azure Resource Manager resources - internal partial interface IResourceInternal - - { - /// - /// Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" - /// - string Id { get; set; } - /// The name of the resource - string Name { get; set; } - /// - /// Azure Resource Manager metadata containing createdBy and modifiedBy information. - /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.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.NetworkCloud.Support.CreatedByType? SystemDataCreatedByType { get; set; } - /// The timestamp of resource last modification (UTC) - global::System.DateTime? SystemDataLastModifiedAt { get; set; } - /// The identity that last modified the resource. - string SystemDataLastModifiedBy { get; set; } - /// The type of identity that last modified the resource. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType? SystemDataLastModifiedByType { get; set; } - /// - /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - /// - string Type { get; set; } - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api50/Resource.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api50/Resource.json.cs deleted file mode 100644 index 2c4fb4fe1e5a..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api50/Resource.json.cs +++ /dev/null @@ -1,128 +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.NetworkCloud.Models.Api50 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; - - /// - /// Common fields that are returned in the response for all Azure Resource Manager resources - /// - public partial class Resource - { - - /// - /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object - /// before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The JsonNode that should be deserialized into this object. - - partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json); - - /// - /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The JSON container that the serialization result will be placed in. - - partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container); - - /// - /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of - /// the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the - /// output parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The JsonNode that should be deserialized into this object. - /// Determines if the rest of the deserialization should be processed, or if the method should return - /// instantly. - - partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json, ref bool returnNow); - - /// - /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the - /// object before it is serialized. - /// If you wish to disable the default serialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The JSON container that the serialization result will be placed in. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, ref bool returnNow); - - /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResource. - /// - /// a to deserialize from. - /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResource. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) - { - return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new Resource(json) : null; - } - - /// - /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject into a new instance of . - /// - /// A Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject instance to deserialize from. - internal Resource(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) - { - bool returnNow = false; - BeforeFromJson(json, ref returnNow); - if (returnNow) - { - return; - } - {_systemData = If( json?.PropertyT("systemData"), out var __jsonSystemData) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.SystemData.FromJson(__jsonSystemData) : SystemData;} - {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} - {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} - {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)Type;} - AfterFromJson(json); - } - - /// - /// Serializes this instance of into a . - /// - /// The container to serialize this object into. If the caller - /// passes in null, a new instance will be created and returned to the caller. - /// Allows the caller to choose the depth of the serialization. See . - /// - /// a serialized instance of as a . - /// - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode) - { - container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject(); - - bool returnNow = false; - BeforeToJson(ref container, ref returnNow); - if (returnNow) - { - return container; - } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) - { - AddIf( null != this._systemData ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) this._systemData.ToJson(null,serializationMode) : null, "systemData" ,container.Add ); - } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) - { - AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); - } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) - { - AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); - } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) - { - AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._type.ToString()) : null, "type" ,container.Add ); - } - AfterToJson(ref container); - return container; - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api50/SystemData.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api50/SystemData.PowerShell.cs deleted file mode 100644 index 8104219c9626..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api50/SystemData.PowerShell.cs +++ /dev/null @@ -1,204 +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.NetworkCloud.Models.Api50 -{ - using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; - - /// Metadata pertaining to creation and last modification of the resource. - [System.ComponentModel.TypeConverter(typeof(SystemDataTypeConverter))] - public partial class SystemData - { - - /// - /// 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.NetworkCloud.Models.Api50.ISystemData DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new SystemData(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.NetworkCloud.Models.Api50.ISystemData DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new SystemData(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.NetworkCloud.Models.Api50.ISystemData FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal SystemData(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("CreatedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ISystemDataInternal)this).CreatedBy = (string) content.GetValueForProperty("CreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ISystemDataInternal)this).CreatedBy, global::System.Convert.ToString); - } - if (content.Contains("CreatedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ISystemDataInternal)this).CreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType?) content.GetValueForProperty("CreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ISystemDataInternal)this).CreatedByType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType.CreateFrom); - } - if (content.Contains("CreatedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ISystemDataInternal)this).CreatedAt = (global::System.DateTime?) content.GetValueForProperty("CreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.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.NetworkCloud.Models.Api50.ISystemDataInternal)this).LastModifiedBy = (string) content.GetValueForProperty("LastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ISystemDataInternal)this).LastModifiedBy, global::System.Convert.ToString); - } - if (content.Contains("LastModifiedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ISystemDataInternal)this).LastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType?) content.GetValueForProperty("LastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ISystemDataInternal)this).LastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType.CreateFrom); - } - if (content.Contains("LastModifiedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ISystemDataInternal)this).LastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("LastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.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 . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal SystemData(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("CreatedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ISystemDataInternal)this).CreatedBy = (string) content.GetValueForProperty("CreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ISystemDataInternal)this).CreatedBy, global::System.Convert.ToString); - } - if (content.Contains("CreatedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ISystemDataInternal)this).CreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType?) content.GetValueForProperty("CreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ISystemDataInternal)this).CreatedByType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType.CreateFrom); - } - if (content.Contains("CreatedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ISystemDataInternal)this).CreatedAt = (global::System.DateTime?) content.GetValueForProperty("CreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.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.NetworkCloud.Models.Api50.ISystemDataInternal)this).LastModifiedBy = (string) content.GetValueForProperty("LastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ISystemDataInternal)this).LastModifiedBy, global::System.Convert.ToString); - } - if (content.Contains("LastModifiedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ISystemDataInternal)this).LastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType?) content.GetValueForProperty("LastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ISystemDataInternal)this).LastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType.CreateFrom); - } - if (content.Contains("LastModifiedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ISystemDataInternal)this).LastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("LastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.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); - } - - /// Serializes this instance to a json string. - - /// a containing this model serialized to JSON text. - public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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(); - } - } - /// Metadata pertaining to creation and last modification of the resource. - [System.ComponentModel.TypeConverter(typeof(SystemDataTypeConverter))] - public partial interface ISystemData - - { - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api50/SystemData.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api50/SystemData.TypeConverter.cs deleted file mode 100644 index d7523f2a7ac4..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api50/SystemData.TypeConverter.cs +++ /dev/null @@ -1,146 +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.NetworkCloud.Models.Api50 -{ - using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; - - /// - /// A PowerShell PSTypeConverter to support converting to an instance of - /// - public partial class SystemDataTypeConverter : global::System.Management.Automation.PSTypeConverter - { - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false. - /// - public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); - - /// - /// Determines if the converter can convert the parameter to the type. - /// - /// the instance to check if it can be converted to the type. - /// - /// true if the instance could be converted to a type, otherwise false - /// - public static bool CanConvertFrom(dynamic sourceValue) - { - if (null == sourceValue) - { - return true; - } - global::System.Type type = sourceValue.GetType(); - if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) - { - // we say yest to PSObjects - return true; - } - if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) - { - // we say yest to Hashtables/dictionaries - return true; - } - try - { - if (null != sourceValue.ToJsonString()) - { - return true; - } - } - catch - { - // Not one of our objects - } - try - { - string text = sourceValue.ToString()?.Trim(); - return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonType.Object; - } - catch - { - // Doesn't look like it can be treated as JSON - } - return false; - } - - /// - /// Determines if the parameter can be converted to the - /// parameter - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false - /// - public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; - - /// - /// Converts the parameter to the parameter using and - /// - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// - /// an instance of , or null if there is no suitable conversion. - /// - public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); - - /// - /// Converts the parameter into an instance of - /// - /// the value to convert into an instance of . - /// - /// an instance of , or null if there is no suitable conversion. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ISystemData ConvertFrom(dynamic sourceValue) - { - if (null == sourceValue) - { - return null; - } - global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ISystemData).IsAssignableFrom(type)) - { - return sourceValue; - } - try - { - return SystemData.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; - } - catch - { - // Unable to use JSON pattern - } - if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) - { - return SystemData.DeserializeFromPSObject(sourceValue); - } - if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) - { - return SystemData.DeserializeFromDictionary(sourceValue); - } - return null; - } - - /// NotImplemented -- this will return null - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// will always return null. - public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api50/SystemData.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api50/SystemData.cs deleted file mode 100644 index 0eec1e480855..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api50/SystemData.cs +++ /dev/null @@ -1,136 +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.NetworkCloud.Models.Api50 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; - - /// Metadata pertaining to creation and last modification of the resource. - public partial class SystemData : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ISystemData, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ISystemDataInternal - { - - /// Backing field for property. - private global::System.DateTime? _createdAt; - - /// The timestamp of resource creation (UTC). - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public global::System.DateTime? CreatedAt { get => this._createdAt; set => this._createdAt = value; } - - /// Backing field for property. - private string _createdBy; - - /// The identity that created the resource. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string CreatedBy { get => this._createdBy; set => this._createdBy = value; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType? _createdByType; - - /// The type of identity that created the resource. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType? CreatedByType { get => this._createdByType; set => this._createdByType = value; } - - /// Backing field for property. - private global::System.DateTime? _lastModifiedAt; - - /// The timestamp of resource last modification (UTC) - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public global::System.DateTime? LastModifiedAt { get => this._lastModifiedAt; set => this._lastModifiedAt = value; } - - /// Backing field for property. - private string _lastModifiedBy; - - /// The identity that last modified the resource. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string LastModifiedBy { get => this._lastModifiedBy; set => this._lastModifiedBy = value; } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType? _lastModifiedByType; - - /// The type of identity that last modified the resource. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType? LastModifiedByType { get => this._lastModifiedByType; set => this._lastModifiedByType = value; } - - /// Creates an new instance. - public SystemData() - { - - } - } - /// Metadata pertaining to creation and last modification of the resource. - public partial interface ISystemData : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable - { - /// The timestamp of resource creation (UTC). - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The timestamp of resource creation (UTC).", - SerializedName = @"createdAt", - PossibleTypes = new [] { typeof(global::System.DateTime) })] - global::System.DateTime? CreatedAt { get; set; } - /// The identity that created the resource. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The identity that created the resource.", - SerializedName = @"createdBy", - PossibleTypes = new [] { typeof(string) })] - string CreatedBy { get; set; } - /// The type of identity that created the resource. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The type of identity that created the resource.", - SerializedName = @"createdByType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType? CreatedByType { get; set; } - /// The timestamp of resource last modification (UTC) - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The timestamp of resource last modification (UTC)", - SerializedName = @"lastModifiedAt", - PossibleTypes = new [] { typeof(global::System.DateTime) })] - global::System.DateTime? LastModifiedAt { get; set; } - /// The identity that last modified the resource. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The identity that last modified the resource.", - SerializedName = @"lastModifiedBy", - PossibleTypes = new [] { typeof(string) })] - string LastModifiedBy { get; set; } - /// The type of identity that last modified the resource. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"The type of identity that last modified the resource.", - SerializedName = @"lastModifiedByType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType? LastModifiedByType { get; set; } - - } - /// Metadata pertaining to creation and last modification of the resource. - internal partial interface ISystemDataInternal - - { - /// The timestamp of resource creation (UTC). - global::System.DateTime? CreatedAt { get; set; } - /// The identity that created the resource. - string CreatedBy { get; set; } - /// The type of identity that created the resource. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType? CreatedByType { get; set; } - /// The timestamp of resource last modification (UTC) - global::System.DateTime? LastModifiedAt { get; set; } - /// The identity that last modified the resource. - string LastModifiedBy { get; set; } - /// The type of identity that last modified the resource. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType? LastModifiedByType { get; set; } - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api50/SystemData.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api50/SystemData.json.cs deleted file mode 100644 index bbe7d08c9cdb..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api50/SystemData.json.cs +++ /dev/null @@ -1,118 +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.NetworkCloud.Models.Api50 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; - - /// Metadata pertaining to creation and last modification of the resource. - public partial class SystemData - { - - /// - /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object - /// before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The JsonNode that should be deserialized into this object. - - partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json); - - /// - /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The JSON container that the serialization result will be placed in. - - partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container); - - /// - /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of - /// the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the - /// output parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The JsonNode that should be deserialized into this object. - /// Determines if the rest of the deserialization should be processed, or if the method should return - /// instantly. - - partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json, ref bool returnNow); - - /// - /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the - /// object before it is serialized. - /// If you wish to disable the default serialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The JSON container that the serialization result will be placed in. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, ref bool returnNow); - - /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ISystemData. - /// - /// a to deserialize from. - /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ISystemData. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ISystemData FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) - { - return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new SystemData(json) : null; - } - - /// - /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject into a new instance of . - /// - /// A Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject instance to deserialize from. - internal SystemData(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) - { - bool returnNow = false; - BeforeFromJson(json, ref returnNow); - if (returnNow) - { - return; - } - {_createdBy = If( json?.PropertyT("createdBy"), out var __jsonCreatedBy) ? (string)__jsonCreatedBy : (string)CreatedBy;} - {_createdByType = If( json?.PropertyT("createdByType"), out var __jsonCreatedByType) ? (string)__jsonCreatedByType : (string)CreatedByType;} - {_createdAt = If( json?.PropertyT("createdAt"), out var __jsonCreatedAt) ? global::System.DateTime.TryParse((string)__jsonCreatedAt, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonCreatedAtValue) ? __jsonCreatedAtValue : CreatedAt : CreatedAt;} - {_lastModifiedBy = If( json?.PropertyT("lastModifiedBy"), out var __jsonLastModifiedBy) ? (string)__jsonLastModifiedBy : (string)LastModifiedBy;} - {_lastModifiedByType = If( json?.PropertyT("lastModifiedByType"), out var __jsonLastModifiedByType) ? (string)__jsonLastModifiedByType : (string)LastModifiedByType;} - {_lastModifiedAt = If( json?.PropertyT("lastModifiedAt"), out var __jsonLastModifiedAt) ? global::System.DateTime.TryParse((string)__jsonLastModifiedAt, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonLastModifiedAtValue) ? __jsonLastModifiedAtValue : LastModifiedAt : LastModifiedAt;} - AfterFromJson(json); - } - - /// - /// Serializes this instance of into a . - /// - /// The container to serialize this object into. If the caller - /// passes in null, a new instance will be created and returned to the caller. - /// Allows the caller to choose the depth of the serialization. See . - /// - /// a serialized instance of as a . - /// - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode) - { - container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject(); - - bool returnNow = false; - BeforeToJson(ref container, ref returnNow); - if (returnNow) - { - return container; - } - AddIf( null != (((object)this._createdBy)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._createdBy.ToString()) : null, "createdBy" ,container.Add ); - AddIf( null != (((object)this._createdByType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._createdByType.ToString()) : null, "createdByType" ,container.Add ); - AddIf( null != this._createdAt ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._createdAt?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "createdAt" ,container.Add ); - AddIf( null != (((object)this._lastModifiedBy)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._lastModifiedBy.ToString()) : null, "lastModifiedBy" ,container.Add ); - AddIf( null != (((object)this._lastModifiedByType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._lastModifiedByType.ToString()) : null, "lastModifiedByType" ,container.Add ); - AddIf( null != this._lastModifiedAt ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._lastModifiedAt?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "lastModifiedAt" ,container.Add ); - AfterToJson(ref container); - return container; - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api50/TrackedResource.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api50/TrackedResource.PowerShell.cs deleted file mode 100644 index 7269944bae2f..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api50/TrackedResource.PowerShell.cs +++ /dev/null @@ -1,254 +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.NetworkCloud.Models.Api50 -{ - using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; - - /// - /// The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location' - /// - [System.ComponentModel.TypeConverter(typeof(TrackedResourceTypeConverter))] - public partial class TrackedResource - { - - /// - /// 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.NetworkCloud.Models.Api50.ITrackedResource DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new TrackedResource(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.NetworkCloud.Models.Api50.ITrackedResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new TrackedResource(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.NetworkCloud.Models.Api50.ITrackedResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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 TrackedResource(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("Tag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.TrackedResourceTagsTypeConverter.ConvertFrom); - } - if (content.Contains("Location")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)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("SystemDataCreatedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataLastModifiedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("SystemData")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.SystemDataTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Type, global::System.Convert.ToString); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal TrackedResource(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("Tag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.TrackedResourceTagsTypeConverter.ConvertFrom); - } - if (content.Contains("Location")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)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("SystemDataCreatedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataLastModifiedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("SystemData")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.SystemDataTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)this).Type, global::System.Convert.ToString); - } - AfterDeserializePSObject(content); - } - } - /// The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location' - [System.ComponentModel.TypeConverter(typeof(TrackedResourceTypeConverter))] - public partial interface ITrackedResource - - { - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api50/TrackedResource.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api50/TrackedResource.TypeConverter.cs deleted file mode 100644 index 932294eb00e1..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api50/TrackedResource.TypeConverter.cs +++ /dev/null @@ -1,147 +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.NetworkCloud.Models.Api50 -{ - using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; - - /// - /// A PowerShell PSTypeConverter to support converting to an instance of - /// - public partial class TrackedResourceTypeConverter : global::System.Management.Automation.PSTypeConverter - { - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false. - /// - public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); - - /// - /// Determines if the converter can convert the parameter to the - /// type. - /// - /// the instance to check if it can be converted to the type. - /// - /// true if the instance could be converted to a type, otherwise false - /// - public static bool CanConvertFrom(dynamic sourceValue) - { - if (null == sourceValue) - { - return true; - } - global::System.Type type = sourceValue.GetType(); - if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) - { - // we say yest to PSObjects - return true; - } - if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) - { - // we say yest to Hashtables/dictionaries - return true; - } - try - { - if (null != sourceValue.ToJsonString()) - { - return true; - } - } - catch - { - // Not one of our objects - } - try - { - string text = sourceValue.ToString()?.Trim(); - return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonType.Object; - } - catch - { - // Doesn't look like it can be treated as JSON - } - return false; - } - - /// - /// Determines if the parameter can be converted to the - /// parameter - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false - /// - public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; - - /// - /// Converts the parameter to the parameter using and - /// - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// - /// an instance of , or null if there is no suitable conversion. - /// - public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); - - /// - /// Converts the parameter into an instance of - /// - /// the value to convert into an instance of . - /// - /// an instance of , or null if there is no suitable conversion. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResource ConvertFrom(dynamic sourceValue) - { - if (null == sourceValue) - { - return null; - } - global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResource).IsAssignableFrom(type)) - { - return sourceValue; - } - try - { - return TrackedResource.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; - } - catch - { - // Unable to use JSON pattern - } - if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) - { - return TrackedResource.DeserializeFromPSObject(sourceValue); - } - if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) - { - return TrackedResource.DeserializeFromDictionary(sourceValue); - } - return null; - } - - /// NotImplemented -- this will return null - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// will always return null. - public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api50/TrackedResource.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api50/TrackedResource.cs deleted file mode 100644 index 7bf121a9f313..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api50/TrackedResource.cs +++ /dev/null @@ -1,147 +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.NetworkCloud.Models.Api50 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; - - /// - /// 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.NetworkCloud.Models.Api50.ITrackedResource, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceInternal, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IValidates - { - /// - /// Backing field for Inherited model - /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.Resource(); - - /// - /// Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__resource).Id; } - - /// Backing field for property. - private string _location; - - /// The geo-location where the resource lives - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string Location { get => this._location; set => this._location = value; } - - /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__resource).Id = value; } - - /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__resource).Name = value; } - - /// Internal Acessors for SystemData - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ISystemData Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal.SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__resource).SystemData; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__resource).SystemData = value; } - - /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__resource).Type = value; } - - /// The name of the resource - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__resource).Name; } - - /// - /// Azure Resource Manager metadata containing createdBy and modifiedBy information. - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ISystemData SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__resource).SystemData; } - - /// The timestamp of resource creation (UTC). - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__resource).SystemDataCreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__resource).SystemDataCreatedAt = value ?? default(global::System.DateTime); } - - /// The identity that created the resource. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__resource).SystemDataCreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__resource).SystemDataCreatedBy = value ?? null; } - - /// The type of identity that created the resource. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType? SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__resource).SystemDataCreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__resource).SystemDataCreatedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType)""); } - - /// The timestamp of resource last modification (UTC) - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__resource).SystemDataLastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__resource).SystemDataLastModifiedAt = value ?? default(global::System.DateTime); } - - /// The identity that last modified the resource. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__resource).SystemDataLastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__resource).SystemDataLastModifiedBy = value ?? null; } - - /// The type of identity that last modified the resource. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType? SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__resource).SystemDataLastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__resource).SystemDataLastModifiedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType)""); } - - /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceTags _tag; - - /// Resource tags. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.TrackedResourceTags()); set => this._tag = value; } - - /// - /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - /// - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] - public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResourceInternal)__resource).Type; } - - /// Creates an new instance. - public TrackedResource() - { - - } - - /// Validates that this object meets the validation criteria. - /// an instance that will receive validation - /// events. - /// - /// A that will be complete when validation is completed. - /// - public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) - { - await eventListener.AssertNotNull(nameof(__resource), __resource); - await eventListener.AssertObjectIsValid(nameof(__resource), __resource); - } - } - /// 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.NetworkCloud.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IResource - { - /// The geo-location where the resource lives - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The geo-location where the resource lives", - SerializedName = @"location", - PossibleTypes = new [] { typeof(string) })] - string Location { get; set; } - /// Resource tags. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = false, - Description = @"Resource tags.", - SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceTags) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.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.NetworkCloud.Models.Api50.IResourceInternal - { - /// The geo-location where the resource lives - string Location { get; set; } - /// Resource tags. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceTags Tag { get; set; } - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api50/TrackedResource.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api50/TrackedResource.json.cs deleted file mode 100644 index ee6d1494f8df..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api50/TrackedResource.json.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.NetworkCloud.Models.Api50 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; - - /// - /// The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location' - /// - public partial class TrackedResource - { - - /// - /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object - /// before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The JsonNode that should be deserialized into this object. - - partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json); - - /// - /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The JSON container that the serialization result will be placed in. - - partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container); - - /// - /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of - /// the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the - /// output parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The JsonNode that should be deserialized into this object. - /// Determines if the rest of the deserialization should be processed, or if the method should return - /// instantly. - - partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json, ref bool returnNow); - - /// - /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the - /// object before it is serialized. - /// If you wish to disable the default serialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The JSON container that the serialization result will be placed in. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, ref bool returnNow); - - /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResource. - /// - /// a to deserialize from. - /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResource. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) - { - return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new TrackedResource(json) : null; - } - - /// - /// Serializes this instance of into a . - /// - /// The container to serialize this object into. If the caller - /// passes in null, a new instance will be created and returned to the caller. - /// Allows the caller to choose the depth of the serialization. See . - /// - /// a serialized instance of as a . - /// - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode) - { - container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject(); - - bool returnNow = false; - BeforeToJson(ref container, ref returnNow); - if (returnNow) - { - return container; - } - __resource?.ToJson(container, serializationMode); - AddIf( null != this._tag ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) this._tag.ToJson(null,serializationMode) : null, "tags" ,container.Add ); - AddIf( null != (((object)this._location)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._location.ToString()) : null, "location" ,container.Add ); - AfterToJson(ref container); - return container; - } - - /// - /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject into a new instance of . - /// - /// A Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject instance to deserialize from. - internal TrackedResource(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) - { - bool returnNow = false; - BeforeFromJson(json, ref returnNow); - if (returnNow) - { - return; - } - __resource = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.Resource(json); - {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.TrackedResourceTags.FromJson(__jsonTags) : Tag;} - {_location = If( json?.PropertyT("location"), out var __jsonLocation) ? (string)__jsonLocation : (string)Location;} - AfterFromJson(json); - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api50/TrackedResourceTags.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api50/TrackedResourceTags.PowerShell.cs deleted file mode 100644 index 6e2688bd6b2d..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api50/TrackedResourceTags.PowerShell.cs +++ /dev/null @@ -1,160 +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.NetworkCloud.Models.Api50 -{ - using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; - - /// Resource tags. - [System.ComponentModel.TypeConverter(typeof(TrackedResourceTagsTypeConverter))] - public partial class TrackedResourceTags - { - - /// - /// 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.NetworkCloud.Models.Api50.ITrackedResourceTags DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new TrackedResourceTags(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.NetworkCloud.Models.Api50.ITrackedResourceTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new TrackedResourceTags(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.NetworkCloud.Models.Api50.ITrackedResourceTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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 TrackedResourceTags(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - // this type is a dictionary; copy elements from source to here. - CopyFrom(content); - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal TrackedResourceTags(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - // this type is a dictionary; copy elements from source to here. - CopyFrom(content); - AfterDeserializePSObject(content); - } - } - /// Resource tags. - [System.ComponentModel.TypeConverter(typeof(TrackedResourceTagsTypeConverter))] - public partial interface ITrackedResourceTags - - { - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api50/TrackedResourceTags.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api50/TrackedResourceTags.TypeConverter.cs deleted file mode 100644 index 9a4648cc98fb..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api50/TrackedResourceTags.TypeConverter.cs +++ /dev/null @@ -1,147 +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.NetworkCloud.Models.Api50 -{ - using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; - - /// - /// A PowerShell PSTypeConverter to support converting to an instance of - /// - public partial class TrackedResourceTagsTypeConverter : global::System.Management.Automation.PSTypeConverter - { - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false. - /// - public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); - - /// - /// Determines if the converter can convert the parameter to the - /// type. - /// - /// the instance to check if it can be converted to the type. - /// - /// true if the instance could be converted to a type, otherwise false - /// - public static bool CanConvertFrom(dynamic sourceValue) - { - if (null == sourceValue) - { - return true; - } - global::System.Type type = sourceValue.GetType(); - if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) - { - // we say yest to PSObjects - return true; - } - if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) - { - // we say yest to Hashtables/dictionaries - return true; - } - try - { - if (null != sourceValue.ToJsonString()) - { - return true; - } - } - catch - { - // Not one of our objects - } - try - { - string text = sourceValue.ToString()?.Trim(); - return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonType.Object; - } - catch - { - // Doesn't look like it can be treated as JSON - } - return false; - } - - /// - /// Determines if the parameter can be converted to the - /// parameter - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false - /// - public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; - - /// - /// Converts the parameter to the parameter using and - /// - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// - /// an instance of , or null if there is no suitable conversion. - /// - public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); - - /// - /// Converts the parameter into an instance of - /// - /// the value to convert into an instance of . - /// - /// an instance of , or null if there is no suitable conversion. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceTags ConvertFrom(dynamic sourceValue) - { - if (null == sourceValue) - { - return null; - } - global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceTags).IsAssignableFrom(type)) - { - return sourceValue; - } - try - { - return TrackedResourceTags.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; - } - catch - { - // Unable to use JSON pattern - } - if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) - { - return TrackedResourceTags.DeserializeFromPSObject(sourceValue); - } - if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) - { - return TrackedResourceTags.DeserializeFromDictionary(sourceValue); - } - return null; - } - - /// NotImplemented -- this will return null - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// will always return null. - public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api50/TrackedResourceTags.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api50/TrackedResourceTags.cs deleted file mode 100644 index 2791db570643..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api50/TrackedResourceTags.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.NetworkCloud.Models.Api50 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; - - /// Resource tags. - public partial class TrackedResourceTags : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceTags, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceTagsInternal - { - - /// Creates an new instance. - public TrackedResourceTags() - { - - } - } - /// Resource tags. - public partial interface ITrackedResourceTags : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IAssociativeArray - { - - } - /// Resource tags. - internal partial interface ITrackedResourceTagsInternal - - { - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api50/TrackedResourceTags.dictionary.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api50/TrackedResourceTags.dictionary.cs deleted file mode 100644 index b48808754a65..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api50/TrackedResourceTags.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.NetworkCloud.Models.Api50 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; - - public partial class TrackedResourceTags : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IAssociativeArray - { - protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); - - global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; } - - int Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; } - - global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; } - - global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IAssociativeArray.Values { get => __additionalProperties.Values; } - - public string this[global::System.String index] { get => __additionalProperties[index]; set => __additionalProperties[index] = value; } - - /// - /// - public void Add(global::System.String key, string value) => __additionalProperties.Add( key, value); - - public void Clear() => __additionalProperties.Clear(); - - /// - public bool ContainsKey(global::System.String key) => __additionalProperties.ContainsKey( key); - - /// - public void CopyFrom(global::System.Collections.IDictionary source) - { - if (null != source) - { - foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) - { - if ((null != property.Key && null != property.Value)) - { - this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); - } - } - } - } - - /// - public bool Remove(global::System.String key) => __additionalProperties.Remove( key); - - /// - /// - public bool TryGetValue(global::System.String key, out string value) => __additionalProperties.TryGetValue( key, out value); - - /// - - public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.TrackedResourceTags source) => source.__additionalProperties; - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api50/TrackedResourceTags.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api50/TrackedResourceTags.json.cs deleted file mode 100644 index 914b96c6e2ae..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api50/TrackedResourceTags.json.cs +++ /dev/null @@ -1,109 +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.NetworkCloud.Models.Api50 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; - - /// Resource tags. - public partial class TrackedResourceTags - { - - /// - /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object - /// before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The JsonNode that should be deserialized into this object. - - partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json); - - /// - /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The JSON container that the serialization result will be placed in. - - partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container); - - /// - /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of - /// the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the - /// output parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The JsonNode that should be deserialized into this object. - /// Determines if the rest of the deserialization should be processed, or if the method should return - /// instantly. - - partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json, ref bool returnNow); - - /// - /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the - /// object before it is serialized. - /// If you wish to disable the default serialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The JSON container that the serialization result will be placed in. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, ref bool returnNow); - - /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceTags. - /// - /// a to deserialize from. - /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceTags. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) - { - return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new TrackedResourceTags(json) : null; - } - - /// - /// Serializes this instance of into a . - /// - /// The container to serialize this object into. If the caller - /// passes in null, a new instance will be created and returned to the caller. - /// Allows the caller to choose the depth of the serialization. See . - /// - /// a serialized instance of as a . - /// - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode) - { - container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject(); - - bool returnNow = false; - BeforeToJson(ref container, ref returnNow); - if (returnNow) - { - return container; - } - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IAssociativeArray)this).AdditionalProperties, container); - AfterToJson(ref container); - return container; - } - - /// - /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject into a new instance of . - /// - /// A Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject instance to deserialize from. - /// - internal TrackedResourceTags(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) - { - bool returnNow = false; - BeforeFromJson(json, ref returnNow); - if (returnNow) - { - return; - } - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IAssociativeArray)this).AdditionalProperties, null ,exclusions ); - AfterFromJson(json); - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api50/UserAssignedIdentities.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api50/UserAssignedIdentities.PowerShell.cs deleted file mode 100644 index 777459d81184..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api50/UserAssignedIdentities.PowerShell.cs +++ /dev/null @@ -1,166 +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.NetworkCloud.Models.Api50 -{ - using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; - - /// - /// 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. - /// - [System.ComponentModel.TypeConverter(typeof(UserAssignedIdentitiesTypeConverter))] - public partial class UserAssignedIdentities - { - - /// - /// 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.NetworkCloud.Models.Api50.IUserAssignedIdentities DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new UserAssignedIdentities(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.NetworkCloud.Models.Api50.IUserAssignedIdentities DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new UserAssignedIdentities(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.NetworkCloud.Models.Api50.IUserAssignedIdentities FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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 UserAssignedIdentities(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - // this type is a dictionary; copy elements from source to here. - CopyFrom(content); - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal UserAssignedIdentities(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - // this type is a dictionary; copy elements from source to here. - CopyFrom(content); - AfterDeserializePSObject(content); - } - } - /// 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. - [System.ComponentModel.TypeConverter(typeof(UserAssignedIdentitiesTypeConverter))] - public partial interface IUserAssignedIdentities - - { - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api50/UserAssignedIdentities.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api50/UserAssignedIdentities.TypeConverter.cs deleted file mode 100644 index 49aa3b4d460c..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api50/UserAssignedIdentities.TypeConverter.cs +++ /dev/null @@ -1,147 +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.NetworkCloud.Models.Api50 -{ - using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; - - /// - /// A PowerShell PSTypeConverter to support converting to an instance of - /// - public partial class UserAssignedIdentitiesTypeConverter : global::System.Management.Automation.PSTypeConverter - { - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false. - /// - public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); - - /// - /// Determines if the converter can convert the parameter to the - /// type. - /// - /// the instance to check if it can be converted to the type. - /// - /// true if the instance could be converted to a type, otherwise false - /// - public static bool CanConvertFrom(dynamic sourceValue) - { - if (null == sourceValue) - { - return true; - } - global::System.Type type = sourceValue.GetType(); - if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) - { - // we say yest to PSObjects - return true; - } - if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) - { - // we say yest to Hashtables/dictionaries - return true; - } - try - { - if (null != sourceValue.ToJsonString()) - { - return true; - } - } - catch - { - // Not one of our objects - } - try - { - string text = sourceValue.ToString()?.Trim(); - return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonType.Object; - } - catch - { - // Doesn't look like it can be treated as JSON - } - return false; - } - - /// - /// Determines if the parameter can be converted to the - /// parameter - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false - /// - public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; - - /// - /// Converts the parameter to the parameter using and - /// - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// - /// an instance of , or null if there is no suitable conversion. - /// - public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); - - /// - /// Converts the parameter into an instance of - /// - /// the value to convert into an instance of . - /// - /// an instance of , or null if there is no suitable conversion. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IUserAssignedIdentities ConvertFrom(dynamic sourceValue) - { - if (null == sourceValue) - { - return null; - } - global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IUserAssignedIdentities).IsAssignableFrom(type)) - { - return sourceValue; - } - try - { - return UserAssignedIdentities.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; - } - catch - { - // Unable to use JSON pattern - } - if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) - { - return UserAssignedIdentities.DeserializeFromPSObject(sourceValue); - } - if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) - { - return UserAssignedIdentities.DeserializeFromDictionary(sourceValue); - } - return null; - } - - /// NotImplemented -- this will return null - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// will always return null. - public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api50/UserAssignedIdentities.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api50/UserAssignedIdentities.cs deleted file mode 100644 index 174a9b863b51..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api50/UserAssignedIdentities.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.NetworkCloud.Models.Api50 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; - - /// - /// 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. - /// - public partial class UserAssignedIdentities : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IUserAssignedIdentities, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IUserAssignedIdentitiesInternal - { - - /// Creates an new instance. - public UserAssignedIdentities() - { - - } - } - /// 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. - public partial interface IUserAssignedIdentities : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IAssociativeArray - { - - } - /// 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. - internal partial interface IUserAssignedIdentitiesInternal - - { - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api50/UserAssignedIdentities.dictionary.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api50/UserAssignedIdentities.dictionary.cs deleted file mode 100644 index bba214ae1586..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api50/UserAssignedIdentities.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.NetworkCloud.Models.Api50 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; - - public partial class UserAssignedIdentities : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IAssociativeArray - { - protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); - - global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; } - - int Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; } - - global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; } - - global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IAssociativeArray.Values { get => __additionalProperties.Values; } - - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IUserAssignedIdentity this[global::System.String index] { get => __additionalProperties[index]; set => __additionalProperties[index] = value; } - - /// - /// - public void Add(global::System.String key, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IUserAssignedIdentity 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.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.Api50.IUserAssignedIdentity value) => __additionalProperties.TryGetValue( key, out value); - - /// - - public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.UserAssignedIdentities source) => source.__additionalProperties; - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api50/UserAssignedIdentities.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api50/UserAssignedIdentities.json.cs deleted file mode 100644 index c8b4f2e38985..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api50/UserAssignedIdentities.json.cs +++ /dev/null @@ -1,113 +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.NetworkCloud.Models.Api50 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; - - /// - /// 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. - /// - public partial class UserAssignedIdentities - { - - /// - /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object - /// before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The JsonNode that should be deserialized into this object. - - partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json); - - /// - /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The JSON container that the serialization result will be placed in. - - partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container); - - /// - /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of - /// the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the - /// output parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The JsonNode that should be deserialized into this object. - /// Determines if the rest of the deserialization should be processed, or if the method should return - /// instantly. - - partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json, ref bool returnNow); - - /// - /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the - /// object before it is serialized. - /// If you wish to disable the default serialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The JSON container that the serialization result will be placed in. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, ref bool returnNow); - - /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IUserAssignedIdentities. - /// - /// a to deserialize from. - /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IUserAssignedIdentities. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IUserAssignedIdentities FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) - { - return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new UserAssignedIdentities(json) : null; - } - - /// - /// Serializes this instance of into a . - /// - /// The container to serialize this object into. If the caller - /// passes in null, a new instance will be created and returned to the caller. - /// Allows the caller to choose the depth of the serialization. See . - /// - /// a serialized instance of as a . - /// - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode) - { - container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject(); - - bool returnNow = false; - BeforeToJson(ref container, ref returnNow); - if (returnNow) - { - return container; - } - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IAssociativeArray)this).AdditionalProperties, container); - AfterToJson(ref container); - return container; - } - - /// - /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject into a new instance of . - /// - /// A Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject instance to deserialize from. - /// - internal UserAssignedIdentities(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) - { - bool returnNow = false; - BeforeFromJson(json, ref returnNow); - if (returnNow) - { - return; - } - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IAssociativeArray)this).AdditionalProperties, (j) => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.UserAssignedIdentity.FromJson(j) ,exclusions ); - AfterFromJson(json); - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api50/UserAssignedIdentity.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api50/UserAssignedIdentity.PowerShell.cs deleted file mode 100644 index c094e74590b4..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api50/UserAssignedIdentity.PowerShell.cs +++ /dev/null @@ -1,172 +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.NetworkCloud.Models.Api50 -{ - using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; - - /// User assigned identity properties - [System.ComponentModel.TypeConverter(typeof(UserAssignedIdentityTypeConverter))] - public partial class UserAssignedIdentity - { - - /// - /// 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.NetworkCloud.Models.Api50.IUserAssignedIdentity DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new UserAssignedIdentity(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.NetworkCloud.Models.Api50.IUserAssignedIdentity DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new UserAssignedIdentity(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.NetworkCloud.Models.Api50.IUserAssignedIdentity FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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 UserAssignedIdentity(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("PrincipalId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IUserAssignedIdentityInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IUserAssignedIdentityInternal)this).PrincipalId, global::System.Convert.ToString); - } - if (content.Contains("ClientId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IUserAssignedIdentityInternal)this).ClientId = (string) content.GetValueForProperty("ClientId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IUserAssignedIdentityInternal)this).ClientId, 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 UserAssignedIdentity(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("PrincipalId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IUserAssignedIdentityInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IUserAssignedIdentityInternal)this).PrincipalId, global::System.Convert.ToString); - } - if (content.Contains("ClientId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IUserAssignedIdentityInternal)this).ClientId = (string) content.GetValueForProperty("ClientId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IUserAssignedIdentityInternal)this).ClientId, global::System.Convert.ToString); - } - AfterDeserializePSObject(content); - } - } - /// User assigned identity properties - [System.ComponentModel.TypeConverter(typeof(UserAssignedIdentityTypeConverter))] - public partial interface IUserAssignedIdentity - - { - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api50/UserAssignedIdentity.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api50/UserAssignedIdentity.TypeConverter.cs deleted file mode 100644 index 910713b8f9a0..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api50/UserAssignedIdentity.TypeConverter.cs +++ /dev/null @@ -1,147 +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.NetworkCloud.Models.Api50 -{ - using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; - - /// - /// A PowerShell PSTypeConverter to support converting to an instance of - /// - public partial class UserAssignedIdentityTypeConverter : global::System.Management.Automation.PSTypeConverter - { - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false. - /// - public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); - - /// - /// Determines if the converter can convert the parameter to the - /// type. - /// - /// the instance to check if it can be converted to the type. - /// - /// true if the instance could be converted to a type, otherwise false - /// - public static bool CanConvertFrom(dynamic sourceValue) - { - if (null == sourceValue) - { - return true; - } - global::System.Type type = sourceValue.GetType(); - if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) - { - // we say yest to PSObjects - return true; - } - if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) - { - // we say yest to Hashtables/dictionaries - return true; - } - try - { - if (null != sourceValue.ToJsonString()) - { - return true; - } - } - catch - { - // Not one of our objects - } - try - { - string text = sourceValue.ToString()?.Trim(); - return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonType.Object; - } - catch - { - // Doesn't look like it can be treated as JSON - } - return false; - } - - /// - /// Determines if the parameter can be converted to the - /// parameter - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false - /// - public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; - - /// - /// Converts the parameter to the parameter using and - /// - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// - /// an instance of , or null if there is no suitable conversion. - /// - public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); - - /// - /// Converts the parameter into an instance of - /// - /// the value to convert into an instance of . - /// - /// an instance of , or null if there is no suitable conversion. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IUserAssignedIdentity ConvertFrom(dynamic sourceValue) - { - if (null == sourceValue) - { - return null; - } - global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IUserAssignedIdentity).IsAssignableFrom(type)) - { - return sourceValue; - } - try - { - return UserAssignedIdentity.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; - } - catch - { - // Unable to use JSON pattern - } - if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) - { - return UserAssignedIdentity.DeserializeFromPSObject(sourceValue); - } - if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) - { - return UserAssignedIdentity.DeserializeFromDictionary(sourceValue); - } - return null; - } - - /// NotImplemented -- this will return null - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// will always return null. - public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api50/UserAssignedIdentity.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api50/UserAssignedIdentity.cs deleted file mode 100644 index 5e4667e089e2..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api50/UserAssignedIdentity.cs +++ /dev/null @@ -1,74 +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.NetworkCloud.Models.Api50 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; - - /// User assigned identity properties - public partial class UserAssignedIdentity : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IUserAssignedIdentity, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IUserAssignedIdentityInternal - { - - /// Backing field for property. - private string _clientId; - - /// The client ID of the assigned identity. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string ClientId { get => this._clientId; } - - /// Internal Acessors for ClientId - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IUserAssignedIdentityInternal.ClientId { get => this._clientId; set { {_clientId = value;} } } - - /// Internal Acessors for PrincipalId - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IUserAssignedIdentityInternal.PrincipalId { get => this._principalId; set { {_principalId = value;} } } - - /// Backing field for property. - private string _principalId; - - /// The principal ID of the assigned identity. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string PrincipalId { get => this._principalId; } - - /// Creates an new instance. - public UserAssignedIdentity() - { - - } - } - /// User assigned identity properties - public partial interface IUserAssignedIdentity : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable - { - /// The client ID of the assigned identity. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The client ID of the assigned identity.", - SerializedName = @"clientId", - PossibleTypes = new [] { typeof(string) })] - string ClientId { get; } - /// The principal ID of the assigned identity. - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = false, - ReadOnly = true, - Description = @"The principal ID of the assigned identity.", - SerializedName = @"principalId", - PossibleTypes = new [] { typeof(string) })] - string PrincipalId { get; } - - } - /// User assigned identity properties - internal partial interface IUserAssignedIdentityInternal - - { - /// The client ID of the assigned identity. - string ClientId { get; set; } - /// The principal ID of the assigned identity. - string PrincipalId { get; set; } - - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api50/UserAssignedIdentity.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api50/UserAssignedIdentity.json.cs deleted file mode 100644 index c2472b5e23ca..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api50/UserAssignedIdentity.json.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.NetworkCloud.Models.Api50 -{ - using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; - - /// User assigned identity properties - public partial class UserAssignedIdentity - { - - /// - /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object - /// before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The JsonNode that should be deserialized into this object. - - partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json); - - /// - /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The JSON container that the serialization result will be placed in. - - partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container); - - /// - /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of - /// the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the - /// output parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The JsonNode that should be deserialized into this object. - /// Determines if the rest of the deserialization should be processed, or if the method should return - /// instantly. - - partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json, ref bool returnNow); - - /// - /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the - /// object before it is serialized. - /// If you wish to disable the default serialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The JSON container that the serialization result will be placed in. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, ref bool returnNow); - - /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IUserAssignedIdentity. - /// - /// a to deserialize from. - /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IUserAssignedIdentity. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IUserAssignedIdentity FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) - { - return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new UserAssignedIdentity(json) : null; - } - - /// - /// Serializes this instance of into a . - /// - /// The container to serialize this object into. If the caller - /// passes in null, a new instance will be created and returned to the caller. - /// Allows the caller to choose the depth of the serialization. See . - /// - /// a serialized instance of as a . - /// - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode) - { - container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject(); - - bool returnNow = false; - BeforeToJson(ref container, ref returnNow); - if (returnNow) - { - return container; - } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) - { - AddIf( null != (((object)this._principalId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._principalId.ToString()) : null, "principalId" ,container.Add ); - } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) - { - AddIf( null != (((object)this._clientId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._clientId.ToString()) : null, "clientId" ,container.Add ); - } - AfterToJson(ref container); - return container; - } - - /// - /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject into a new instance of . - /// - /// A Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject instance to deserialize from. - internal UserAssignedIdentity(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) - { - bool returnNow = false; - BeforeFromJson(json, ref returnNow); - if (returnNow) - { - return; - } - {_principalId = If( json?.PropertyT("principalId"), out var __jsonPrincipalId) ? (string)__jsonPrincipalId : (string)PrincipalId;} - {_clientId = If( json?.PropertyT("clientId"), out var __jsonClientId) ? (string)__jsonClientId : (string)ClientId;} - AfterFromJson(json); - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AttachedNetworkConfiguration.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AttachedNetworkConfiguration.PowerShell.cs new file mode 100644 index 000000000000..af5d84a54084 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AttachedNetworkConfiguration.PowerShell.cs @@ -0,0 +1,182 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + + /// + /// AttachedNetworkConfiguration represents the set of workload networks to attach to a resource. + /// + [System.ComponentModel.TypeConverter(typeof(AttachedNetworkConfigurationTypeConverter))] + public partial class AttachedNetworkConfiguration + { + + /// + /// 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 AttachedNetworkConfiguration(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("L2Network")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAttachedNetworkConfigurationInternal)this).L2Network = (System.Collections.Generic.List) content.GetValueForProperty("L2Network",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAttachedNetworkConfigurationInternal)this).L2Network, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.L2NetworkAttachmentConfigurationTypeConverter.ConvertFrom)); + } + if (content.Contains("L3Network")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAttachedNetworkConfigurationInternal)this).L3Network = (System.Collections.Generic.List) content.GetValueForProperty("L3Network",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAttachedNetworkConfigurationInternal)this).L3Network, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.L3NetworkAttachmentConfigurationTypeConverter.ConvertFrom)); + } + if (content.Contains("TrunkedNetwork")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAttachedNetworkConfigurationInternal)this).TrunkedNetwork = (System.Collections.Generic.List) content.GetValueForProperty("TrunkedNetwork",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAttachedNetworkConfigurationInternal)this).TrunkedNetwork, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.TrunkedNetworkAttachmentConfigurationTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal AttachedNetworkConfiguration(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("L2Network")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAttachedNetworkConfigurationInternal)this).L2Network = (System.Collections.Generic.List) content.GetValueForProperty("L2Network",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAttachedNetworkConfigurationInternal)this).L2Network, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.L2NetworkAttachmentConfigurationTypeConverter.ConvertFrom)); + } + if (content.Contains("L3Network")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAttachedNetworkConfigurationInternal)this).L3Network = (System.Collections.Generic.List) content.GetValueForProperty("L3Network",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAttachedNetworkConfigurationInternal)this).L3Network, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.L3NetworkAttachmentConfigurationTypeConverter.ConvertFrom)); + } + if (content.Contains("TrunkedNetwork")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAttachedNetworkConfigurationInternal)this).TrunkedNetwork = (System.Collections.Generic.List) content.GetValueForProperty("TrunkedNetwork",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAttachedNetworkConfigurationInternal)this).TrunkedNetwork, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.TrunkedNetworkAttachmentConfigurationTypeConverter.ConvertFrom)); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAttachedNetworkConfiguration DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new AttachedNetworkConfiguration(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.NetworkCloud.Models.IAttachedNetworkConfiguration DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new AttachedNetworkConfiguration(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.NetworkCloud.Models.IAttachedNetworkConfiguration FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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(); + } + } + /// AttachedNetworkConfiguration represents the set of workload networks to attach to a resource. + [System.ComponentModel.TypeConverter(typeof(AttachedNetworkConfigurationTypeConverter))] + public partial interface IAttachedNetworkConfiguration + + { + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AttachedNetworkConfiguration.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AttachedNetworkConfiguration.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AttachedNetworkConfiguration.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AttachedNetworkConfiguration.TypeConverter.cs index 0955b3f5231a..eec97fc3d92a 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AttachedNetworkConfiguration.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AttachedNetworkConfiguration.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IAttachedNetworkConfiguration ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAttachedNetworkConfiguration ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAttachedNetworkConfiguration).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAttachedNetworkConfiguration).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AttachedNetworkConfiguration.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AttachedNetworkConfiguration.cs new file mode 100644 index 000000000000..7b01d379e4ad --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AttachedNetworkConfiguration.cs @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + + /// + /// AttachedNetworkConfiguration represents the set of workload networks to attach to a resource. + /// + public partial class AttachedNetworkConfiguration : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAttachedNetworkConfiguration, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAttachedNetworkConfigurationInternal + { + + /// Backing field for property. + private System.Collections.Generic.List _l2Network; + + /// The list of Layer 2 Networks and related configuration for attachment. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public System.Collections.Generic.List L2Network { get => this._l2Network; set => this._l2Network = value; } + + /// Backing field for property. + private System.Collections.Generic.List _l3Network; + + /// The list of Layer 3 Networks and related configuration for attachment. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public System.Collections.Generic.List L3Network { get => this._l3Network; set => this._l3Network = value; } + + /// Backing field for property. + private System.Collections.Generic.List _trunkedNetwork; + + /// The list of Trunked Networks and related configuration for attachment. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public System.Collections.Generic.List TrunkedNetwork { get => this._trunkedNetwork; set => this._trunkedNetwork = value; } + + /// Creates an new instance. + public AttachedNetworkConfiguration() + { + + } + } + /// AttachedNetworkConfiguration represents the set of workload networks to attach to a resource. + public partial interface IAttachedNetworkConfiguration : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable + { + /// The list of Layer 2 Networks and related configuration for attachment. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The list of Layer 2 Networks and related configuration for attachment.", + SerializedName = @"l2Networks", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkAttachmentConfiguration) })] + System.Collections.Generic.List L2Network { get; set; } + /// The list of Layer 3 Networks and related configuration for attachment. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The list of Layer 3 Networks and related configuration for attachment.", + SerializedName = @"l3Networks", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkAttachmentConfiguration) })] + System.Collections.Generic.List L3Network { get; set; } + /// The list of Trunked Networks and related configuration for attachment. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The list of Trunked Networks and related configuration for attachment.", + SerializedName = @"trunkedNetworks", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkAttachmentConfiguration) })] + System.Collections.Generic.List TrunkedNetwork { get; set; } + + } + /// AttachedNetworkConfiguration represents the set of workload networks to attach to a resource. + internal partial interface IAttachedNetworkConfigurationInternal + + { + /// The list of Layer 2 Networks and related configuration for attachment. + System.Collections.Generic.List L2Network { get; set; } + /// The list of Layer 3 Networks and related configuration for attachment. + System.Collections.Generic.List L3Network { get; set; } + /// The list of Trunked Networks and related configuration for attachment. + System.Collections.Generic.List TrunkedNetwork { get; set; } + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AttachedNetworkConfiguration.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AttachedNetworkConfiguration.json.cs new file mode 100644 index 000000000000..033db64139b3 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AttachedNetworkConfiguration.json.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + + /// + /// AttachedNetworkConfiguration represents the set of workload networks to attach to a resource. + /// + public partial class AttachedNetworkConfiguration + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject instance to deserialize from. + internal AttachedNetworkConfiguration(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_l2Network = If( json?.PropertyT("l2Networks"), out var __jsonL2Networks) ? If( __jsonL2Networks as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.IL2NetworkAttachmentConfiguration) (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.L2NetworkAttachmentConfiguration.FromJson(__u) )) ))() : null : _l2Network;} + {_l3Network = If( json?.PropertyT("l3Networks"), out var __jsonL3Networks) ? If( __jsonL3Networks as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.IL3NetworkAttachmentConfiguration) (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.L3NetworkAttachmentConfiguration.FromJson(__p) )) ))() : null : _l3Network;} + {_trunkedNetwork = If( json?.PropertyT("trunkedNetworks"), out var __jsonTrunkedNetworks) ? If( __jsonTrunkedNetworks as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonArray, out var __l) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__l, (__k)=>(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkAttachmentConfiguration) (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.TrunkedNetworkAttachmentConfiguration.FromJson(__k) )) ))() : null : _trunkedNetwork;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAttachedNetworkConfiguration. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAttachedNetworkConfiguration. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAttachedNetworkConfiguration FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new AttachedNetworkConfiguration(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)||serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate)) + { + if (null != this._l2Network) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.XNodeArray(); + foreach( var __x in this._l2Network ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("l2Networks",__w); + } + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)||serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate)) + { + if (null != this._l3Network) + { + var __r = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.XNodeArray(); + foreach( var __s in this._l3Network ) + { + AddIf(__s?.ToJson(null, serializationMode) ,__r.Add); + } + container.Add("l3Networks",__r); + } + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)||serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate)) + { + if (null != this._trunkedNetwork) + { + var __m = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.XNodeArray(); + foreach( var __n in this._trunkedNetwork ) + { + AddIf(__n?.ToJson(null, serializationMode) ,__m.Add); + } + container.Add("trunkedNetworks",__m); + } + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AvailableUpgrade.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AvailableUpgrade.PowerShell.cs similarity index 78% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AvailableUpgrade.PowerShell.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AvailableUpgrade.PowerShell.cs index 1239eb033ef2..61d5fb93564f 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AvailableUpgrade.PowerShell.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AvailableUpgrade.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; @@ -63,7 +63,7 @@ public partial class AvailableUpgrade 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 AvailableUpgrade(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("AvailabilityLifecycle")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAvailableUpgradeInternal)this).AvailabilityLifecycle = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.AvailabilityLifecycle?) content.GetValueForProperty("AvailabilityLifecycle",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAvailableUpgradeInternal)this).AvailabilityLifecycle, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.AvailabilityLifecycle.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAvailableUpgradeInternal)this).AvailabilityLifecycle = (string) content.GetValueForProperty("AvailabilityLifecycle",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAvailableUpgradeInternal)this).AvailabilityLifecycle, global::System.Convert.ToString); } if (content.Contains("Version")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAvailableUpgradeInternal)this).Version = (string) content.GetValueForProperty("Version",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAvailableUpgradeInternal)this).Version, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAvailableUpgradeInternal)this).Version = (string) content.GetValueForProperty("Version",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAvailableUpgradeInternal)this).Version, 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,37 +103,37 @@ internal AvailableUpgrade(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("AvailabilityLifecycle")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAvailableUpgradeInternal)this).AvailabilityLifecycle = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.AvailabilityLifecycle?) content.GetValueForProperty("AvailabilityLifecycle",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAvailableUpgradeInternal)this).AvailabilityLifecycle, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.AvailabilityLifecycle.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAvailableUpgradeInternal)this).AvailabilityLifecycle = (string) content.GetValueForProperty("AvailabilityLifecycle",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAvailableUpgradeInternal)this).AvailabilityLifecycle, global::System.Convert.ToString); } if (content.Contains("Version")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAvailableUpgradeInternal)this).Version = (string) content.GetValueForProperty("Version",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAvailableUpgradeInternal)this).Version, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAvailableUpgradeInternal)this).Version = (string) content.GetValueForProperty("Version",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAvailableUpgradeInternal)this).Version, 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.NetworkCloud.Models.Api20250201.IAvailableUpgrade DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAvailableUpgrade DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new AvailableUpgrade(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.NetworkCloud.Models.Api20250201.IAvailableUpgrade DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAvailableUpgrade DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new AvailableUpgrade(content); } @@ -143,7 +143,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAvailableUpgrade FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAvailableUpgrade FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AvailableUpgrade.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AvailableUpgrade.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AvailableUpgrade.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AvailableUpgrade.TypeConverter.cs index 23d832cf63bb..a9e71aa1f6db 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AvailableUpgrade.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AvailableUpgrade.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IAvailableUpgrade ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAvailableUpgrade ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAvailableUpgrade).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAvailableUpgrade).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AvailableUpgrade.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AvailableUpgrade.cs new file mode 100644 index 000000000000..e72cb9fbf07d --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AvailableUpgrade.cs @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + + /// AvailableUpgrade represents an upgrade available for a Kubernetes cluster. + public partial class AvailableUpgrade : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAvailableUpgrade, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAvailableUpgradeInternal + { + + /// Backing field for property. + private string _availabilityLifecycle; + + /// The version lifecycle indicator. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string AvailabilityLifecycle { get => this._availabilityLifecycle; } + + /// Internal Acessors for AvailabilityLifecycle + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAvailableUpgradeInternal.AvailabilityLifecycle { get => this._availabilityLifecycle; set { {_availabilityLifecycle = value;} } } + + /// Internal Acessors for Version + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAvailableUpgradeInternal.Version { get => this._version; set { {_version = value;} } } + + /// Backing field for property. + private string _version; + + /// The version available for upgrading. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string Version { get => this._version; } + + /// Creates an new instance. + public AvailableUpgrade() + { + + } + } + /// AvailableUpgrade represents an upgrade available for a Kubernetes cluster. + public partial interface IAvailableUpgrade : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable + { + /// The version lifecycle indicator. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The version lifecycle indicator.", + SerializedName = @"availabilityLifecycle", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Preview", "GenerallyAvailable")] + string AvailabilityLifecycle { get; } + /// The version available for upgrading. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The version available for upgrading.", + SerializedName = @"version", + PossibleTypes = new [] { typeof(string) })] + string Version { get; } + + } + /// AvailableUpgrade represents an upgrade available for a Kubernetes cluster. + internal partial interface IAvailableUpgradeInternal + + { + /// The version lifecycle indicator. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Preview", "GenerallyAvailable")] + string AvailabilityLifecycle { get; set; } + /// The version available for upgrading. + string Version { get; set; } + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AvailableUpgrade.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AvailableUpgrade.json.cs similarity index 92% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AvailableUpgrade.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AvailableUpgrade.json.cs index c4b940c06586..294d8992cedd 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/AvailableUpgrade.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/AvailableUpgrade.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -65,19 +65,19 @@ internal AvailableUpgrade(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtim { return; } - {_availabilityLifecycle = If( json?.PropertyT("availabilityLifecycle"), out var __jsonAvailabilityLifecycle) ? (string)__jsonAvailabilityLifecycle : (string)AvailabilityLifecycle;} - {_version = If( json?.PropertyT("version"), out var __jsonVersion) ? (string)__jsonVersion : (string)Version;} + {_availabilityLifecycle = If( json?.PropertyT("availabilityLifecycle"), out var __jsonAvailabilityLifecycle) ? (string)__jsonAvailabilityLifecycle : (string)_availabilityLifecycle;} + {_version = If( json?.PropertyT("version"), out var __jsonVersion) ? (string)__jsonVersion : (string)_version;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAvailableUpgrade. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAvailableUpgrade. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAvailableUpgrade. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAvailableUpgrade. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAvailableUpgrade FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAvailableUpgrade FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new AvailableUpgrade(json) : null; } @@ -101,11 +101,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode ToJ { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._availabilityLifecycle)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._availabilityLifecycle.ToString()) : null, "availabilityLifecycle" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._version)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._version.ToString()) : null, "version" ,container.Add ); } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachine.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachine.PowerShell.cs new file mode 100644 index 000000000000..d1fb5b7d441b --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachine.PowerShell.cs @@ -0,0 +1,644 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + + /// BareMetalMachine represents the physical machine in the rack. + [System.ComponentModel.TypeConverter(typeof(BareMetalMachineTypeConverter))] + public partial class BareMetalMachine + { + + /// + /// 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 BareMetalMachine(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ExtendedLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).ExtendedLocation = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocation) content.GetValueForProperty("ExtendedLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).ExtendedLocation, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ExtendedLocationTypeConverter.ConvertFrom); + } + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BareMetalMachinePropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Etag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).Etag, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)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("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedByType = (string) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedByType = (string) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.TrackedResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("ExtendedLocationName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).ExtendedLocationName = (string) content.GetValueForProperty("ExtendedLocationName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).ExtendedLocationName, global::System.Convert.ToString); + } + if (content.Contains("ExtendedLocationType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).ExtendedLocationType = (string) content.GetValueForProperty("ExtendedLocationType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).ExtendedLocationType, global::System.Convert.ToString); + } + if (content.Contains("HardwareInventory")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).HardwareInventory = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IHardwareInventory) content.GetValueForProperty("HardwareInventory",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).HardwareInventory, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.HardwareInventoryTypeConverter.ConvertFrom); + } + if (content.Contains("BmcCredentials")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).BmcCredentials = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministrativeCredentials) content.GetValueForProperty("BmcCredentials",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).BmcCredentials, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AdministrativeCredentialsTypeConverter.ConvertFrom); + } + if (content.Contains("HardwareValidationStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).HardwareValidationStatus = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IHardwareValidationStatus) content.GetValueForProperty("HardwareValidationStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).HardwareValidationStatus, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.HardwareValidationStatusTypeConverter.ConvertFrom); + } + if (content.Contains("RuntimeProtectionStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).RuntimeProtectionStatus = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRuntimeProtectionStatus) content.GetValueForProperty("RuntimeProtectionStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).RuntimeProtectionStatus, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.RuntimeProtectionStatusTypeConverter.ConvertFrom); + } + if (content.Contains("AssociatedResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).AssociatedResourceId = (System.Collections.Generic.List) content.GetValueForProperty("AssociatedResourceId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).AssociatedResourceId, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("BmcConnectionString")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).BmcConnectionString = (string) content.GetValueForProperty("BmcConnectionString",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).BmcConnectionString, global::System.Convert.ToString); + } + if (content.Contains("BmcMacAddress")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).BmcMacAddress = (string) content.GetValueForProperty("BmcMacAddress",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).BmcMacAddress, global::System.Convert.ToString); + } + if (content.Contains("BootMacAddress")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).BootMacAddress = (string) content.GetValueForProperty("BootMacAddress",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).BootMacAddress, global::System.Convert.ToString); + } + if (content.Contains("ClusterId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).ClusterId = (string) content.GetValueForProperty("ClusterId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).ClusterId, global::System.Convert.ToString); + } + if (content.Contains("CordonStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).CordonStatus = (string) content.GetValueForProperty("CordonStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).CordonStatus, global::System.Convert.ToString); + } + if (content.Contains("DetailedStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).DetailedStatus = (string) content.GetValueForProperty("DetailedStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).DetailedStatus, global::System.Convert.ToString); + } + if (content.Contains("DetailedStatusMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).DetailedStatusMessage = (string) content.GetValueForProperty("DetailedStatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).DetailedStatusMessage, global::System.Convert.ToString); + } + if (content.Contains("HybridAksClustersAssociatedId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).HybridAksClustersAssociatedId = (System.Collections.Generic.List) content.GetValueForProperty("HybridAksClustersAssociatedId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).HybridAksClustersAssociatedId, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("KubernetesNodeName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).KubernetesNodeName = (string) content.GetValueForProperty("KubernetesNodeName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).KubernetesNodeName, global::System.Convert.ToString); + } + if (content.Contains("KubernetesVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).KubernetesVersion = (string) content.GetValueForProperty("KubernetesVersion",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).KubernetesVersion, global::System.Convert.ToString); + } + if (content.Contains("MachineClusterVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).MachineClusterVersion = (string) content.GetValueForProperty("MachineClusterVersion",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).MachineClusterVersion, global::System.Convert.ToString); + } + if (content.Contains("MachineDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).MachineDetail = (string) content.GetValueForProperty("MachineDetail",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).MachineDetail, global::System.Convert.ToString); + } + if (content.Contains("MachineName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).MachineName = (string) content.GetValueForProperty("MachineName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).MachineName, global::System.Convert.ToString); + } + if (content.Contains("MachineRole")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).MachineRole = (System.Collections.Generic.List) content.GetValueForProperty("MachineRole",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).MachineRole, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("MachineSkuId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).MachineSkuId = (string) content.GetValueForProperty("MachineSkuId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).MachineSkuId, global::System.Convert.ToString); + } + if (content.Contains("OamIpv4Address")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).OamIpv4Address = (string) content.GetValueForProperty("OamIpv4Address",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).OamIpv4Address, global::System.Convert.ToString); + } + if (content.Contains("OamIpv6Address")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).OamIpv6Address = (string) content.GetValueForProperty("OamIpv6Address",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).OamIpv6Address, global::System.Convert.ToString); + } + if (content.Contains("OSImage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).OSImage = (string) content.GetValueForProperty("OSImage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).OSImage, global::System.Convert.ToString); + } + if (content.Contains("PowerState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).PowerState = (string) content.GetValueForProperty("PowerState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).PowerState, global::System.Convert.ToString); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("RackId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).RackId = (string) content.GetValueForProperty("RackId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).RackId, global::System.Convert.ToString); + } + if (content.Contains("RackSlot")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).RackSlot = (long) content.GetValueForProperty("RackSlot",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).RackSlot, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("ReadyState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).ReadyState = (string) content.GetValueForProperty("ReadyState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).ReadyState, global::System.Convert.ToString); + } + if (content.Contains("SecretRotationStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).SecretRotationStatus = (System.Collections.Generic.List) content.GetValueForProperty("SecretRotationStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).SecretRotationStatus, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.SecretRotationStatusTypeConverter.ConvertFrom)); + } + if (content.Contains("SerialNumber")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).SerialNumber = (string) content.GetValueForProperty("SerialNumber",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).SerialNumber, global::System.Convert.ToString); + } + if (content.Contains("ServiceTag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).ServiceTag = (string) content.GetValueForProperty("ServiceTag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).ServiceTag, global::System.Convert.ToString); + } + if (content.Contains("VirtualMachinesAssociatedId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).VirtualMachinesAssociatedId = (System.Collections.Generic.List) content.GetValueForProperty("VirtualMachinesAssociatedId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).VirtualMachinesAssociatedId, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("HardwareInventoryInterface")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).HardwareInventoryInterface = (System.Collections.Generic.List) content.GetValueForProperty("HardwareInventoryInterface",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).HardwareInventoryInterface, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.HardwareInventoryNetworkInterfaceTypeConverter.ConvertFrom)); + } + if (content.Contains("HardwareInventoryNic")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).HardwareInventoryNic = (System.Collections.Generic.List) content.GetValueForProperty("HardwareInventoryNic",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).HardwareInventoryNic, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.NicTypeConverter.ConvertFrom)); + } + if (content.Contains("RuntimeProtectionStatusDefinitionsVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).RuntimeProtectionStatusDefinitionsVersion = (string) content.GetValueForProperty("RuntimeProtectionStatusDefinitionsVersion",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).RuntimeProtectionStatusDefinitionsVersion, global::System.Convert.ToString); + } + if (content.Contains("BmcCredentialsPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).BmcCredentialsPassword = (System.Security.SecureString) content.GetValueForProperty("BmcCredentialsPassword",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).BmcCredentialsPassword, (object ss) => (System.Security.SecureString)ss); + } + if (content.Contains("BmcCredentialsUsername")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).BmcCredentialsUsername = (string) content.GetValueForProperty("BmcCredentialsUsername",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).BmcCredentialsUsername, global::System.Convert.ToString); + } + if (content.Contains("HardwareInventoryAdditionalHostInformation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).HardwareInventoryAdditionalHostInformation = (string) content.GetValueForProperty("HardwareInventoryAdditionalHostInformation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).HardwareInventoryAdditionalHostInformation, global::System.Convert.ToString); + } + if (content.Contains("HardwareValidationStatusLastValidationTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).HardwareValidationStatusLastValidationTime = (global::System.DateTime?) content.GetValueForProperty("HardwareValidationStatusLastValidationTime",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).HardwareValidationStatusLastValidationTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("HardwareValidationStatusResult")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).HardwareValidationStatusResult = (string) content.GetValueForProperty("HardwareValidationStatusResult",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).HardwareValidationStatusResult, global::System.Convert.ToString); + } + if (content.Contains("RuntimeProtectionStatusDefinitionsLastUpdated")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).RuntimeProtectionStatusDefinitionsLastUpdated = (global::System.DateTime?) content.GetValueForProperty("RuntimeProtectionStatusDefinitionsLastUpdated",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).RuntimeProtectionStatusDefinitionsLastUpdated, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("RuntimeProtectionStatusScanCompletedTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).RuntimeProtectionStatusScanCompletedTime = (global::System.DateTime?) content.GetValueForProperty("RuntimeProtectionStatusScanCompletedTime",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).RuntimeProtectionStatusScanCompletedTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("RuntimeProtectionStatusScanScheduledTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).RuntimeProtectionStatusScanScheduledTime = (global::System.DateTime?) content.GetValueForProperty("RuntimeProtectionStatusScanScheduledTime",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).RuntimeProtectionStatusScanScheduledTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("RuntimeProtectionStatusScanStartedTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).RuntimeProtectionStatusScanStartedTime = (global::System.DateTime?) content.GetValueForProperty("RuntimeProtectionStatusScanStartedTime",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).RuntimeProtectionStatusScanStartedTime, (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 BareMetalMachine(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ExtendedLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).ExtendedLocation = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocation) content.GetValueForProperty("ExtendedLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).ExtendedLocation, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ExtendedLocationTypeConverter.ConvertFrom); + } + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BareMetalMachinePropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Etag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).Etag, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)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("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedByType = (string) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedByType = (string) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.TrackedResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("ExtendedLocationName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).ExtendedLocationName = (string) content.GetValueForProperty("ExtendedLocationName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).ExtendedLocationName, global::System.Convert.ToString); + } + if (content.Contains("ExtendedLocationType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).ExtendedLocationType = (string) content.GetValueForProperty("ExtendedLocationType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).ExtendedLocationType, global::System.Convert.ToString); + } + if (content.Contains("HardwareInventory")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).HardwareInventory = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IHardwareInventory) content.GetValueForProperty("HardwareInventory",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).HardwareInventory, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.HardwareInventoryTypeConverter.ConvertFrom); + } + if (content.Contains("BmcCredentials")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).BmcCredentials = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministrativeCredentials) content.GetValueForProperty("BmcCredentials",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).BmcCredentials, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AdministrativeCredentialsTypeConverter.ConvertFrom); + } + if (content.Contains("HardwareValidationStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).HardwareValidationStatus = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IHardwareValidationStatus) content.GetValueForProperty("HardwareValidationStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).HardwareValidationStatus, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.HardwareValidationStatusTypeConverter.ConvertFrom); + } + if (content.Contains("RuntimeProtectionStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).RuntimeProtectionStatus = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRuntimeProtectionStatus) content.GetValueForProperty("RuntimeProtectionStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).RuntimeProtectionStatus, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.RuntimeProtectionStatusTypeConverter.ConvertFrom); + } + if (content.Contains("AssociatedResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).AssociatedResourceId = (System.Collections.Generic.List) content.GetValueForProperty("AssociatedResourceId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).AssociatedResourceId, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("BmcConnectionString")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).BmcConnectionString = (string) content.GetValueForProperty("BmcConnectionString",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).BmcConnectionString, global::System.Convert.ToString); + } + if (content.Contains("BmcMacAddress")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).BmcMacAddress = (string) content.GetValueForProperty("BmcMacAddress",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).BmcMacAddress, global::System.Convert.ToString); + } + if (content.Contains("BootMacAddress")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).BootMacAddress = (string) content.GetValueForProperty("BootMacAddress",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).BootMacAddress, global::System.Convert.ToString); + } + if (content.Contains("ClusterId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).ClusterId = (string) content.GetValueForProperty("ClusterId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).ClusterId, global::System.Convert.ToString); + } + if (content.Contains("CordonStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).CordonStatus = (string) content.GetValueForProperty("CordonStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).CordonStatus, global::System.Convert.ToString); + } + if (content.Contains("DetailedStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).DetailedStatus = (string) content.GetValueForProperty("DetailedStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).DetailedStatus, global::System.Convert.ToString); + } + if (content.Contains("DetailedStatusMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).DetailedStatusMessage = (string) content.GetValueForProperty("DetailedStatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).DetailedStatusMessage, global::System.Convert.ToString); + } + if (content.Contains("HybridAksClustersAssociatedId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).HybridAksClustersAssociatedId = (System.Collections.Generic.List) content.GetValueForProperty("HybridAksClustersAssociatedId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).HybridAksClustersAssociatedId, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("KubernetesNodeName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).KubernetesNodeName = (string) content.GetValueForProperty("KubernetesNodeName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).KubernetesNodeName, global::System.Convert.ToString); + } + if (content.Contains("KubernetesVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).KubernetesVersion = (string) content.GetValueForProperty("KubernetesVersion",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).KubernetesVersion, global::System.Convert.ToString); + } + if (content.Contains("MachineClusterVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).MachineClusterVersion = (string) content.GetValueForProperty("MachineClusterVersion",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).MachineClusterVersion, global::System.Convert.ToString); + } + if (content.Contains("MachineDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).MachineDetail = (string) content.GetValueForProperty("MachineDetail",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).MachineDetail, global::System.Convert.ToString); + } + if (content.Contains("MachineName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).MachineName = (string) content.GetValueForProperty("MachineName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).MachineName, global::System.Convert.ToString); + } + if (content.Contains("MachineRole")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).MachineRole = (System.Collections.Generic.List) content.GetValueForProperty("MachineRole",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).MachineRole, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("MachineSkuId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).MachineSkuId = (string) content.GetValueForProperty("MachineSkuId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).MachineSkuId, global::System.Convert.ToString); + } + if (content.Contains("OamIpv4Address")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).OamIpv4Address = (string) content.GetValueForProperty("OamIpv4Address",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).OamIpv4Address, global::System.Convert.ToString); + } + if (content.Contains("OamIpv6Address")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).OamIpv6Address = (string) content.GetValueForProperty("OamIpv6Address",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).OamIpv6Address, global::System.Convert.ToString); + } + if (content.Contains("OSImage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).OSImage = (string) content.GetValueForProperty("OSImage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).OSImage, global::System.Convert.ToString); + } + if (content.Contains("PowerState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).PowerState = (string) content.GetValueForProperty("PowerState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).PowerState, global::System.Convert.ToString); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("RackId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).RackId = (string) content.GetValueForProperty("RackId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).RackId, global::System.Convert.ToString); + } + if (content.Contains("RackSlot")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).RackSlot = (long) content.GetValueForProperty("RackSlot",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).RackSlot, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("ReadyState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).ReadyState = (string) content.GetValueForProperty("ReadyState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).ReadyState, global::System.Convert.ToString); + } + if (content.Contains("SecretRotationStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).SecretRotationStatus = (System.Collections.Generic.List) content.GetValueForProperty("SecretRotationStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).SecretRotationStatus, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.SecretRotationStatusTypeConverter.ConvertFrom)); + } + if (content.Contains("SerialNumber")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).SerialNumber = (string) content.GetValueForProperty("SerialNumber",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).SerialNumber, global::System.Convert.ToString); + } + if (content.Contains("ServiceTag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).ServiceTag = (string) content.GetValueForProperty("ServiceTag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).ServiceTag, global::System.Convert.ToString); + } + if (content.Contains("VirtualMachinesAssociatedId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).VirtualMachinesAssociatedId = (System.Collections.Generic.List) content.GetValueForProperty("VirtualMachinesAssociatedId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).VirtualMachinesAssociatedId, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("HardwareInventoryInterface")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).HardwareInventoryInterface = (System.Collections.Generic.List) content.GetValueForProperty("HardwareInventoryInterface",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).HardwareInventoryInterface, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.HardwareInventoryNetworkInterfaceTypeConverter.ConvertFrom)); + } + if (content.Contains("HardwareInventoryNic")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).HardwareInventoryNic = (System.Collections.Generic.List) content.GetValueForProperty("HardwareInventoryNic",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).HardwareInventoryNic, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.NicTypeConverter.ConvertFrom)); + } + if (content.Contains("RuntimeProtectionStatusDefinitionsVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).RuntimeProtectionStatusDefinitionsVersion = (string) content.GetValueForProperty("RuntimeProtectionStatusDefinitionsVersion",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).RuntimeProtectionStatusDefinitionsVersion, global::System.Convert.ToString); + } + if (content.Contains("BmcCredentialsPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).BmcCredentialsPassword = (System.Security.SecureString) content.GetValueForProperty("BmcCredentialsPassword",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).BmcCredentialsPassword, (object ss) => (System.Security.SecureString)ss); + } + if (content.Contains("BmcCredentialsUsername")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).BmcCredentialsUsername = (string) content.GetValueForProperty("BmcCredentialsUsername",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).BmcCredentialsUsername, global::System.Convert.ToString); + } + if (content.Contains("HardwareInventoryAdditionalHostInformation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).HardwareInventoryAdditionalHostInformation = (string) content.GetValueForProperty("HardwareInventoryAdditionalHostInformation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).HardwareInventoryAdditionalHostInformation, global::System.Convert.ToString); + } + if (content.Contains("HardwareValidationStatusLastValidationTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).HardwareValidationStatusLastValidationTime = (global::System.DateTime?) content.GetValueForProperty("HardwareValidationStatusLastValidationTime",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).HardwareValidationStatusLastValidationTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("HardwareValidationStatusResult")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).HardwareValidationStatusResult = (string) content.GetValueForProperty("HardwareValidationStatusResult",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).HardwareValidationStatusResult, global::System.Convert.ToString); + } + if (content.Contains("RuntimeProtectionStatusDefinitionsLastUpdated")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).RuntimeProtectionStatusDefinitionsLastUpdated = (global::System.DateTime?) content.GetValueForProperty("RuntimeProtectionStatusDefinitionsLastUpdated",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).RuntimeProtectionStatusDefinitionsLastUpdated, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("RuntimeProtectionStatusScanCompletedTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).RuntimeProtectionStatusScanCompletedTime = (global::System.DateTime?) content.GetValueForProperty("RuntimeProtectionStatusScanCompletedTime",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).RuntimeProtectionStatusScanCompletedTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("RuntimeProtectionStatusScanScheduledTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).RuntimeProtectionStatusScanScheduledTime = (global::System.DateTime?) content.GetValueForProperty("RuntimeProtectionStatusScanScheduledTime",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).RuntimeProtectionStatusScanScheduledTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("RuntimeProtectionStatusScanStartedTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).RuntimeProtectionStatusScanStartedTime = (global::System.DateTime?) content.GetValueForProperty("RuntimeProtectionStatusScanStartedTime",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal)this).RuntimeProtectionStatusScanStartedTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachine DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new BareMetalMachine(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.NetworkCloud.Models.IBareMetalMachine DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new BareMetalMachine(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.NetworkCloud.Models.IBareMetalMachine FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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(); + } + } + /// BareMetalMachine represents the physical machine in the rack. + [System.ComponentModel.TypeConverter(typeof(BareMetalMachineTypeConverter))] + public partial interface IBareMetalMachine + + { + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachine.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachine.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachine.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachine.TypeConverter.cs index 3dc92ba7eab8..71b52e4277eb 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachine.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachine.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IBareMetalMachine ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachine ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachine).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachine).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachine.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachine.cs new file mode 100644 index 000000000000..5b629d02155f --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachine.cs @@ -0,0 +1,1132 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + + /// BareMetalMachine represents the physical machine in the rack. + public partial class BareMetalMachine : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachine, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResource __trackedResource = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.TrackedResource(); + + /// + /// The list of resource IDs for the other Microsoft.NetworkCloud resources that have attached this network. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public System.Collections.Generic.List AssociatedResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)Property).AssociatedResourceId; } + + /// + /// The connection string for the baseboard management controller including IP address and protocol. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string BmcConnectionString { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)Property).BmcConnectionString; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)Property).BmcConnectionString = value ; } + + /// The password of the administrator of the device used during initialization. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public System.Security.SecureString BmcCredentialsPassword { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)Property).BmcCredentialsPassword; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)Property).BmcCredentialsPassword = value ; } + + /// The username of the administrator of the device used during initialization. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string BmcCredentialsUsername { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)Property).BmcCredentialsUsername; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)Property).BmcCredentialsUsername = value ; } + + /// The MAC address of the BMC device. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string BmcMacAddress { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)Property).BmcMacAddress; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)Property).BmcMacAddress = value ; } + + /// The MAC address of a NIC connected to the PXE network. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string BootMacAddress { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)Property).BootMacAddress; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)Property).BootMacAddress = value ; } + + /// The resource ID of the cluster this bare metal machine is associated with. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string ClusterId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)Property).ClusterId; } + + /// The cordon status of the bare metal machine. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string CordonStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)Property).CordonStatus; } + + /// The more detailed status of the bare metal machine. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string DetailedStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)Property).DetailedStatus; } + + /// The descriptive message about the current detailed status. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string DetailedStatusMessage { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)Property).DetailedStatusMessage; } + + /// Backing field for property. + private string _etag; + + /// Resource ETag. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string Etag { get => this._etag; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocation _extendedLocation; + + /// The extended location of the cluster associated with the resource. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocation ExtendedLocation { get => (this._extendedLocation = this._extendedLocation ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ExtendedLocation()); set => this._extendedLocation = value; } + + /// The resource ID of the extended location on which the resource will be created. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string ExtendedLocationName { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocationInternal)ExtendedLocation).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocationInternal)ExtendedLocation).Name = value ?? null; } + + /// The extended location type, for example, CustomLocation. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string ExtendedLocationType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocationInternal)ExtendedLocation).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocationInternal)ExtendedLocation).Type = value ?? null; } + + /// + /// Freeform data extracted from the environment about this machine. This information varies depending on the specific hardware + /// and configuration. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string HardwareInventoryAdditionalHostInformation { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)Property).HardwareInventoryAdditionalHostInformation; } + + /// + /// The list of network interfaces and associated details for the bare metal machine. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public System.Collections.Generic.List HardwareInventoryInterface { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)Property).HardwareInventoryInterface; } + + /// + /// Field Deprecated. Will be removed in an upcoming version. The list of network interface cards and associated details for + /// the bare metal machine. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public System.Collections.Generic.List HardwareInventoryNic { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)Property).HardwareInventoryNic; } + + /// The timestamp of the hardware validation execution. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public global::System.DateTime? HardwareValidationStatusLastValidationTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)Property).HardwareValidationStatusLastValidationTime; } + + /// The outcome of the hardware validation. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string HardwareValidationStatusResult { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)Property).HardwareValidationStatusResult; } + + /// + /// Field Deprecated. These fields will be empty/omitted. The list of the resource IDs for the HybridAksClusters that have + /// nodes hosted on this bare metal machine. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public System.Collections.Generic.List HybridAksClustersAssociatedId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)Property).HybridAksClustersAssociatedId; } + + /// + /// Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).Id; } + + /// + /// The name of this machine represented by the host object in the Cluster's Kubernetes control plane. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string KubernetesNodeName { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)Property).KubernetesNodeName; } + + /// The version of Kubernetes running on this machine. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string KubernetesVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)Property).KubernetesVersion; } + + /// The geo-location where the resource lives + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)__trackedResource).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)__trackedResource).Location = value ?? null; } + + /// + /// The cluster version that has been applied to this machine during deployment or a version update. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string MachineClusterVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)Property).MachineClusterVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)Property).MachineClusterVersion = value ?? null; } + + /// The custom details provided by the customer. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string MachineDetail { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)Property).MachineDetail; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)Property).MachineDetail = value ; } + + /// The OS-level hostname assigned to this machine. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string MachineName { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)Property).MachineName; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)Property).MachineName = value ; } + + /// + /// The list of roles that are assigned to the cluster node running on this machine. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public System.Collections.Generic.List MachineRole { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)Property).MachineRole; } + + /// The unique internal identifier of the bare metal machine SKU. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string MachineSkuId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)Property).MachineSkuId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)Property).MachineSkuId = value ; } + + /// Internal Acessors for AssociatedResourceId + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal.AssociatedResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)Property).AssociatedResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)Property).AssociatedResourceId = value ?? null /* arrayOf */; } + + /// Internal Acessors for BmcCredentials + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministrativeCredentials Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal.BmcCredentials { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)Property).BmcCredentials; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)Property).BmcCredentials = value ?? null /* model class */; } + + /// Internal Acessors for ClusterId + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal.ClusterId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)Property).ClusterId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)Property).ClusterId = value ?? null; } + + /// Internal Acessors for CordonStatus + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal.CordonStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)Property).CordonStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)Property).CordonStatus = value ?? null; } + + /// Internal Acessors for DetailedStatus + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal.DetailedStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)Property).DetailedStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)Property).DetailedStatus = value ?? null; } + + /// Internal Acessors for DetailedStatusMessage + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal.DetailedStatusMessage { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)Property).DetailedStatusMessage; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)Property).DetailedStatusMessage = value ?? null; } + + /// Internal Acessors for Etag + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal.Etag { get => this._etag; set { {_etag = value;} } } + + /// Internal Acessors for ExtendedLocation + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocation Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal.ExtendedLocation { get => (this._extendedLocation = this._extendedLocation ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ExtendedLocation()); set { {_extendedLocation = value;} } } + + /// Internal Acessors for HardwareInventory + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IHardwareInventory Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal.HardwareInventory { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)Property).HardwareInventory; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)Property).HardwareInventory = value ?? null /* model class */; } + + /// Internal Acessors for HardwareInventoryAdditionalHostInformation + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal.HardwareInventoryAdditionalHostInformation { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)Property).HardwareInventoryAdditionalHostInformation; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)Property).HardwareInventoryAdditionalHostInformation = value ?? null; } + + /// Internal Acessors for HardwareInventoryInterface + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal.HardwareInventoryInterface { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)Property).HardwareInventoryInterface; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)Property).HardwareInventoryInterface = value ?? null /* arrayOf */; } + + /// Internal Acessors for HardwareInventoryNic + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal.HardwareInventoryNic { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)Property).HardwareInventoryNic; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)Property).HardwareInventoryNic = value ?? null /* arrayOf */; } + + /// Internal Acessors for HardwareValidationStatus + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IHardwareValidationStatus Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal.HardwareValidationStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)Property).HardwareValidationStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)Property).HardwareValidationStatus = value ?? null /* model class */; } + + /// Internal Acessors for HardwareValidationStatusLastValidationTime + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal.HardwareValidationStatusLastValidationTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)Property).HardwareValidationStatusLastValidationTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)Property).HardwareValidationStatusLastValidationTime = value ?? default(global::System.DateTime); } + + /// Internal Acessors for HardwareValidationStatusResult + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal.HardwareValidationStatusResult { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)Property).HardwareValidationStatusResult; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)Property).HardwareValidationStatusResult = value ?? null; } + + /// Internal Acessors for HybridAksClustersAssociatedId + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal.HybridAksClustersAssociatedId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)Property).HybridAksClustersAssociatedId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)Property).HybridAksClustersAssociatedId = value ?? null /* arrayOf */; } + + /// Internal Acessors for KubernetesNodeName + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal.KubernetesNodeName { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)Property).KubernetesNodeName; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)Property).KubernetesNodeName = value ?? null; } + + /// Internal Acessors for KubernetesVersion + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal.KubernetesVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)Property).KubernetesVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)Property).KubernetesVersion = value ?? null; } + + /// Internal Acessors for MachineRole + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal.MachineRole { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)Property).MachineRole; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)Property).MachineRole = value ?? null /* arrayOf */; } + + /// Internal Acessors for OSImage + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal.OSImage { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)Property).OSImage; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)Property).OSImage = value ?? null; } + + /// Internal Acessors for OamIpv4Address + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal.OamIpv4Address { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)Property).OamIpv4Address; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)Property).OamIpv4Address = value ?? null; } + + /// Internal Acessors for OamIpv6Address + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal.OamIpv6Address { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)Property).OamIpv6Address; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)Property).OamIpv6Address = value ?? null; } + + /// Internal Acessors for PowerState + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal.PowerState { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)Property).PowerState; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)Property).PowerState = value ?? null; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineProperties Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BareMetalMachineProperties()); set { {_property = value;} } } + + /// Internal Acessors for ProvisioningState + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)Property).ProvisioningState = value ?? null; } + + /// Internal Acessors for ReadyState + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal.ReadyState { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)Property).ReadyState; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)Property).ReadyState = value ?? null; } + + /// Internal Acessors for RuntimeProtectionStatus + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRuntimeProtectionStatus Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal.RuntimeProtectionStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)Property).RuntimeProtectionStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)Property).RuntimeProtectionStatus = value ?? null /* model class */; } + + /// Internal Acessors for RuntimeProtectionStatusDefinitionsLastUpdated + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal.RuntimeProtectionStatusDefinitionsLastUpdated { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)Property).RuntimeProtectionStatusDefinitionsLastUpdated; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)Property).RuntimeProtectionStatusDefinitionsLastUpdated = value ?? default(global::System.DateTime); } + + /// Internal Acessors for RuntimeProtectionStatusDefinitionsVersion + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal.RuntimeProtectionStatusDefinitionsVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)Property).RuntimeProtectionStatusDefinitionsVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)Property).RuntimeProtectionStatusDefinitionsVersion = value ?? null; } + + /// Internal Acessors for RuntimeProtectionStatusScanCompletedTime + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal.RuntimeProtectionStatusScanCompletedTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)Property).RuntimeProtectionStatusScanCompletedTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)Property).RuntimeProtectionStatusScanCompletedTime = value ?? default(global::System.DateTime); } + + /// Internal Acessors for RuntimeProtectionStatusScanScheduledTime + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal.RuntimeProtectionStatusScanScheduledTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)Property).RuntimeProtectionStatusScanScheduledTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)Property).RuntimeProtectionStatusScanScheduledTime = value ?? default(global::System.DateTime); } + + /// Internal Acessors for RuntimeProtectionStatusScanStartedTime + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal.RuntimeProtectionStatusScanStartedTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)Property).RuntimeProtectionStatusScanStartedTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)Property).RuntimeProtectionStatusScanStartedTime = value ?? default(global::System.DateTime); } + + /// Internal Acessors for SecretRotationStatus + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal.SecretRotationStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)Property).SecretRotationStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)Property).SecretRotationStatus = value ?? null /* arrayOf */; } + + /// Internal Acessors for ServiceTag + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal.ServiceTag { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)Property).ServiceTag; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)Property).ServiceTag = value ?? null; } + + /// Internal Acessors for VirtualMachinesAssociatedId + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineInternal.VirtualMachinesAssociatedId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)Property).VirtualMachinesAssociatedId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)Property).VirtualMachinesAssociatedId = value ?? null /* arrayOf */; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).Id = value ?? null; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).Name = value ?? null; } + + /// Internal Acessors for SystemData + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISystemData Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemData; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemData = value ?? null /* model class */; } + + /// Internal Acessors for SystemDataCreatedAt + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataCreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataCreatedAt = value ?? default(global::System.DateTime); } + + /// Internal Acessors for SystemDataCreatedBy + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataCreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataCreatedBy = value ?? null; } + + /// Internal Acessors for SystemDataCreatedByType + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataCreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataCreatedByType = value ?? null; } + + /// Internal Acessors for SystemDataLastModifiedAt + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedAt = value ?? default(global::System.DateTime); } + + /// Internal Acessors for SystemDataLastModifiedBy + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedBy = value ?? null; } + + /// Internal Acessors for SystemDataLastModifiedByType + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedByType = value ?? null; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).Type = value ?? null; } + + /// The name of the resource + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).Name; } + + /// The image that is currently provisioned to the OS disk. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string OSImage { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)Property).OSImage; } + + /// + /// The IPv4 address that is assigned to the bare metal machine during the cluster deployment. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string OamIpv4Address { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)Property).OamIpv4Address; } + + /// + /// The IPv6 address that is assigned to the bare metal machine during the cluster deployment. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string OamIpv6Address { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)Property).OamIpv6Address; } + + /// The power state derived from the baseboard management controller. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string PowerState { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)Property).PowerState; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineProperties _property; + + /// The list of the resource properties. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BareMetalMachineProperties()); set => this._property = value; } + + /// The provisioning state of the bare metal machine. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)Property).ProvisioningState; } + + /// The resource ID of the rack where this bare metal machine resides. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string RackId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)Property).RackId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)Property).RackId = value ; } + + /// + /// The rack slot in which this bare metal machine is located, ordered from the bottom up i.e. the lowest slot is 1. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public long RackSlot { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)Property).RackSlot; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)Property).RackSlot = value ; } + + /// The indicator of whether the bare metal machine is ready to receive workloads. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string ReadyState { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)Property).ReadyState; } + + /// Gets the resource group name + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string ResourceGroupName { get => (new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Success ? new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Groups["resourceGroupName"].Value : null); } + + /// The timestamp when the malware definitions were last updated. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public global::System.DateTime? RuntimeProtectionStatusDefinitionsLastUpdated { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)Property).RuntimeProtectionStatusDefinitionsLastUpdated; } + + /// The version of the malware definitions. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string RuntimeProtectionStatusDefinitionsVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)Property).RuntimeProtectionStatusDefinitionsVersion; } + + /// + /// The timestamp of the most recently completed scan, or empty if there has never been a scan. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public global::System.DateTime? RuntimeProtectionStatusScanCompletedTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)Property).RuntimeProtectionStatusScanCompletedTime; } + + /// + /// The timestamp of the most recently scheduled scan, or empty if no scan has been scheduled. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public global::System.DateTime? RuntimeProtectionStatusScanScheduledTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)Property).RuntimeProtectionStatusScanScheduledTime; } + + /// + /// The timestamp of the most recently started scan, or empty if there has never been a scan. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public global::System.DateTime? RuntimeProtectionStatusScanStartedTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)Property).RuntimeProtectionStatusScanStartedTime; } + + /// The list of statuses that represent secret rotation activity. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public System.Collections.Generic.List SecretRotationStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)Property).SecretRotationStatus; } + + /// The serial number of the bare metal machine. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string SerialNumber { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)Property).SerialNumber; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)Property).SerialNumber = value ; } + + /// The discovered value of the machine's service tag. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string ServiceTag { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)Property).ServiceTag; } + + /// + /// Azure Resource Manager metadata containing createdBy and modifiedBy information. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISystemData SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemData; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemData = value ?? null /* model class */; } + + /// The timestamp of resource creation (UTC). + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataCreatedAt; } + + /// The identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataCreatedBy; } + + /// The type of identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public string SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataCreatedByType; } + + /// The timestamp of resource last modification (UTC) + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedAt; } + + /// The identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedBy; } + + /// The type of identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public string SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedByType; } + + /// Resource tags. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)__trackedResource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).Type; } + + /// + /// Field Deprecated. These fields will be empty/omitted. The list of the resource IDs for the VirtualMachines that are hosted + /// on this bare metal machine. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public System.Collections.Generic.List VirtualMachinesAssociatedId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)Property).VirtualMachinesAssociatedId; } + + /// Creates an new instance. + public BareMetalMachine() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__trackedResource), __trackedResource); + await eventListener.AssertObjectIsValid(nameof(__trackedResource), __trackedResource); + } + } + /// BareMetalMachine represents the physical machine in the rack. + public partial interface IBareMetalMachine : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResource + { + /// + /// The list of resource IDs for the other Microsoft.NetworkCloud resources that have attached this network. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The list of resource IDs for the other Microsoft.NetworkCloud resources that have attached this network.", + SerializedName = @"associatedResourceIds", + PossibleTypes = new [] { typeof(string) })] + System.Collections.Generic.List AssociatedResourceId { get; } + /// + /// The connection string for the baseboard management controller including IP address and protocol. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The connection string for the baseboard management controller including IP address and protocol.", + SerializedName = @"bmcConnectionString", + PossibleTypes = new [] { typeof(string) })] + string BmcConnectionString { get; set; } + /// The password of the administrator of the device used during initialization. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The password of the administrator of the device used during initialization.", + SerializedName = @"password", + PossibleTypes = new [] { typeof(System.Security.SecureString) })] + System.Security.SecureString BmcCredentialsPassword { get; set; } + /// The username of the administrator of the device used during initialization. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The username of the administrator of the device used during initialization.", + SerializedName = @"username", + PossibleTypes = new [] { typeof(string) })] + string BmcCredentialsUsername { get; set; } + /// The MAC address of the BMC device. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The MAC address of the BMC device.", + SerializedName = @"bmcMacAddress", + PossibleTypes = new [] { typeof(string) })] + string BmcMacAddress { get; set; } + /// The MAC address of a NIC connected to the PXE network. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The MAC address of a NIC connected to the PXE network.", + SerializedName = @"bootMacAddress", + PossibleTypes = new [] { typeof(string) })] + string BootMacAddress { get; set; } + /// The resource ID of the cluster this bare metal machine is associated with. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The resource ID of the cluster this bare metal machine is associated with.", + SerializedName = @"clusterId", + PossibleTypes = new [] { typeof(string) })] + string ClusterId { get; } + /// The cordon status of the bare metal machine. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The cordon status of the bare metal machine.", + SerializedName = @"cordonStatus", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Cordoned", "Uncordoned")] + string CordonStatus { get; } + /// The more detailed status of the bare metal machine. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The more detailed status of the bare metal machine.", + SerializedName = @"detailedStatus", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Preparing", "Error", "Available", "Provisioning", "Provisioned", "Deprovisioning")] + string DetailedStatus { get; } + /// The descriptive message about the current detailed status. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The descriptive message about the current detailed status.", + SerializedName = @"detailedStatusMessage", + PossibleTypes = new [] { typeof(string) })] + string DetailedStatusMessage { get; } + /// Resource ETag. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"Resource ETag.", + SerializedName = @"etag", + PossibleTypes = new [] { typeof(string) })] + string Etag { get; } + /// The resource ID of the extended location on which the resource will be created. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The resource ID of the extended location on which the resource will be created.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string ExtendedLocationName { get; set; } + /// The extended location type, for example, CustomLocation. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The extended location type, for example, CustomLocation.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + string ExtendedLocationType { get; set; } + /// + /// Freeform data extracted from the environment about this machine. This information varies depending on the specific hardware + /// and configuration. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"Freeform data extracted from the environment about this machine. This information varies depending on the specific hardware and configuration.", + SerializedName = @"additionalHostInformation", + PossibleTypes = new [] { typeof(string) })] + string HardwareInventoryAdditionalHostInformation { get; } + /// + /// The list of network interfaces and associated details for the bare metal machine. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The list of network interfaces and associated details for the bare metal machine.", + SerializedName = @"interfaces", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IHardwareInventoryNetworkInterface) })] + System.Collections.Generic.List HardwareInventoryInterface { get; } + /// + /// Field Deprecated. Will be removed in an upcoming version. The list of network interface cards and associated details for + /// the bare metal machine. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"Field Deprecated. Will be removed in an upcoming version. The list of network interface cards and associated details for the bare metal machine.", + SerializedName = @"nics", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INic) })] + System.Collections.Generic.List HardwareInventoryNic { get; } + /// The timestamp of the hardware validation execution. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The timestamp of the hardware validation execution.", + SerializedName = @"lastValidationTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? HardwareValidationStatusLastValidationTime { get; } + /// The outcome of the hardware validation. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The outcome of the hardware validation.", + SerializedName = @"result", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Pass", "Fail")] + string HardwareValidationStatusResult { get; } + /// + /// Field Deprecated. These fields will be empty/omitted. The list of the resource IDs for the HybridAksClusters that have + /// nodes hosted on this bare metal machine. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"Field Deprecated. These fields will be empty/omitted. The list of the resource IDs for the HybridAksClusters that have nodes hosted on this bare metal machine.", + SerializedName = @"hybridAksClustersAssociatedIds", + PossibleTypes = new [] { typeof(string) })] + System.Collections.Generic.List HybridAksClustersAssociatedId { get; } + /// + /// The name of this machine represented by the host object in the Cluster's Kubernetes control plane. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The name of this machine represented by the host object in the Cluster's Kubernetes control plane.", + SerializedName = @"kubernetesNodeName", + PossibleTypes = new [] { typeof(string) })] + string KubernetesNodeName { get; } + /// The version of Kubernetes running on this machine. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The version of Kubernetes running on this machine.", + SerializedName = @"kubernetesVersion", + PossibleTypes = new [] { typeof(string) })] + string KubernetesVersion { get; } + /// + /// The cluster version that has been applied to this machine during deployment or a version update. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The cluster version that has been applied to this machine during deployment or a version update.", + SerializedName = @"machineClusterVersion", + PossibleTypes = new [] { typeof(string) })] + string MachineClusterVersion { get; set; } + /// The custom details provided by the customer. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The custom details provided by the customer.", + SerializedName = @"machineDetails", + PossibleTypes = new [] { typeof(string) })] + string MachineDetail { get; set; } + /// The OS-level hostname assigned to this machine. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The OS-level hostname assigned to this machine.", + SerializedName = @"machineName", + PossibleTypes = new [] { typeof(string) })] + string MachineName { get; set; } + /// + /// The list of roles that are assigned to the cluster node running on this machine. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The list of roles that are assigned to the cluster node running on this machine.", + SerializedName = @"machineRoles", + PossibleTypes = new [] { typeof(string) })] + System.Collections.Generic.List MachineRole { get; } + /// The unique internal identifier of the bare metal machine SKU. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The unique internal identifier of the bare metal machine SKU.", + SerializedName = @"machineSkuId", + PossibleTypes = new [] { typeof(string) })] + string MachineSkuId { get; set; } + /// The image that is currently provisioned to the OS disk. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The image that is currently provisioned to the OS disk.", + SerializedName = @"osImage", + PossibleTypes = new [] { typeof(string) })] + string OSImage { get; } + /// + /// The IPv4 address that is assigned to the bare metal machine during the cluster deployment. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The IPv4 address that is assigned to the bare metal machine during the cluster deployment.", + SerializedName = @"oamIpv4Address", + PossibleTypes = new [] { typeof(string) })] + string OamIpv4Address { get; } + /// + /// The IPv6 address that is assigned to the bare metal machine during the cluster deployment. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The IPv6 address that is assigned to the bare metal machine during the cluster deployment.", + SerializedName = @"oamIpv6Address", + PossibleTypes = new [] { typeof(string) })] + string OamIpv6Address { get; } + /// The power state derived from the baseboard management controller. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The power state derived from the baseboard management controller.", + SerializedName = @"powerState", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("On", "Off")] + string PowerState { get; } + /// The provisioning state of the bare metal machine. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The provisioning state of the bare metal machine.", + SerializedName = @"provisioningState", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Succeeded", "Failed", "Canceled", "Provisioning", "Accepted")] + string ProvisioningState { get; } + /// The resource ID of the rack where this bare metal machine resides. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The resource ID of the rack where this bare metal machine resides.", + SerializedName = @"rackId", + PossibleTypes = new [] { typeof(string) })] + string RackId { get; set; } + /// + /// The rack slot in which this bare metal machine is located, ordered from the bottom up i.e. the lowest slot is 1. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The rack slot in which this bare metal machine is located, ordered from the bottom up i.e. the lowest slot is 1.", + SerializedName = @"rackSlot", + PossibleTypes = new [] { typeof(long) })] + long RackSlot { get; set; } + /// The indicator of whether the bare metal machine is ready to receive workloads. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The indicator of whether the bare metal machine is ready to receive workloads.", + SerializedName = @"readyState", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("True", "False")] + string ReadyState { get; } + /// The timestamp when the malware definitions were last updated. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The timestamp when the malware definitions were last updated.", + SerializedName = @"definitionsLastUpdated", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? RuntimeProtectionStatusDefinitionsLastUpdated { get; } + /// The version of the malware definitions. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The version of the malware definitions.", + SerializedName = @"definitionsVersion", + PossibleTypes = new [] { typeof(string) })] + string RuntimeProtectionStatusDefinitionsVersion { get; } + /// + /// The timestamp of the most recently completed scan, or empty if there has never been a scan. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The timestamp of the most recently completed scan, or empty if there has never been a scan.", + SerializedName = @"scanCompletedTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? RuntimeProtectionStatusScanCompletedTime { get; } + /// + /// The timestamp of the most recently scheduled scan, or empty if no scan has been scheduled. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The timestamp of the most recently scheduled scan, or empty if no scan has been scheduled.", + SerializedName = @"scanScheduledTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? RuntimeProtectionStatusScanScheduledTime { get; } + /// + /// The timestamp of the most recently started scan, or empty if there has never been a scan. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The timestamp of the most recently started scan, or empty if there has never been a scan.", + SerializedName = @"scanStartedTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? RuntimeProtectionStatusScanStartedTime { get; } + /// The list of statuses that represent secret rotation activity. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The list of statuses that represent secret rotation activity.", + SerializedName = @"secretRotationStatus", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISecretRotationStatus) })] + System.Collections.Generic.List SecretRotationStatus { get; } + /// The serial number of the bare metal machine. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The serial number of the bare metal machine.", + SerializedName = @"serialNumber", + PossibleTypes = new [] { typeof(string) })] + string SerialNumber { get; set; } + /// The discovered value of the machine's service tag. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The discovered value of the machine's service tag.", + SerializedName = @"serviceTag", + PossibleTypes = new [] { typeof(string) })] + string ServiceTag { get; } + /// + /// Field Deprecated. These fields will be empty/omitted. The list of the resource IDs for the VirtualMachines that are hosted + /// on this bare metal machine. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"Field Deprecated. These fields will be empty/omitted. The list of the resource IDs for the VirtualMachines that are hosted on this bare metal machine.", + SerializedName = @"virtualMachinesAssociatedIds", + PossibleTypes = new [] { typeof(string) })] + System.Collections.Generic.List VirtualMachinesAssociatedId { get; } + + } + /// BareMetalMachine represents the physical machine in the rack. + internal partial interface IBareMetalMachineInternal : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal + { + /// + /// The list of resource IDs for the other Microsoft.NetworkCloud resources that have attached this network. + /// + System.Collections.Generic.List AssociatedResourceId { get; set; } + /// + /// The connection string for the baseboard management controller including IP address and protocol. + /// + string BmcConnectionString { get; set; } + /// + /// The credentials of the baseboard management controller on this bare metal machine. + /// + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministrativeCredentials BmcCredentials { get; set; } + /// The password of the administrator of the device used during initialization. + System.Security.SecureString BmcCredentialsPassword { get; set; } + /// The username of the administrator of the device used during initialization. + string BmcCredentialsUsername { get; set; } + /// The MAC address of the BMC device. + string BmcMacAddress { get; set; } + /// The MAC address of a NIC connected to the PXE network. + string BootMacAddress { get; set; } + /// The resource ID of the cluster this bare metal machine is associated with. + string ClusterId { get; set; } + /// The cordon status of the bare metal machine. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Cordoned", "Uncordoned")] + string CordonStatus { get; set; } + /// The more detailed status of the bare metal machine. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Preparing", "Error", "Available", "Provisioning", "Provisioned", "Deprovisioning")] + string DetailedStatus { get; set; } + /// The descriptive message about the current detailed status. + string DetailedStatusMessage { get; set; } + /// Resource ETag. + string Etag { get; set; } + /// The extended location of the cluster associated with the resource. + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocation ExtendedLocation { get; set; } + /// The resource ID of the extended location on which the resource will be created. + string ExtendedLocationName { get; set; } + /// The extended location type, for example, CustomLocation. + string ExtendedLocationType { get; set; } + /// + /// The hardware inventory, including information acquired from the model/sku information and from the ironic inspector. + /// + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IHardwareInventory HardwareInventory { get; set; } + /// + /// Freeform data extracted from the environment about this machine. This information varies depending on the specific hardware + /// and configuration. + /// + string HardwareInventoryAdditionalHostInformation { get; set; } + /// + /// The list of network interfaces and associated details for the bare metal machine. + /// + System.Collections.Generic.List HardwareInventoryInterface { get; set; } + /// + /// Field Deprecated. Will be removed in an upcoming version. The list of network interface cards and associated details for + /// the bare metal machine. + /// + System.Collections.Generic.List HardwareInventoryNic { get; set; } + /// + /// The details of the latest hardware validation performed for this bare metal machine. + /// + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IHardwareValidationStatus HardwareValidationStatus { get; set; } + /// The timestamp of the hardware validation execution. + global::System.DateTime? HardwareValidationStatusLastValidationTime { get; set; } + /// The outcome of the hardware validation. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Pass", "Fail")] + string HardwareValidationStatusResult { get; set; } + /// + /// Field Deprecated. These fields will be empty/omitted. The list of the resource IDs for the HybridAksClusters that have + /// nodes hosted on this bare metal machine. + /// + System.Collections.Generic.List HybridAksClustersAssociatedId { get; set; } + /// + /// The name of this machine represented by the host object in the Cluster's Kubernetes control plane. + /// + string KubernetesNodeName { get; set; } + /// The version of Kubernetes running on this machine. + string KubernetesVersion { get; set; } + /// + /// The cluster version that has been applied to this machine during deployment or a version update. + /// + string MachineClusterVersion { get; set; } + /// The custom details provided by the customer. + string MachineDetail { get; set; } + /// The OS-level hostname assigned to this machine. + string MachineName { get; set; } + /// + /// The list of roles that are assigned to the cluster node running on this machine. + /// + System.Collections.Generic.List MachineRole { get; set; } + /// The unique internal identifier of the bare metal machine SKU. + string MachineSkuId { get; set; } + /// The image that is currently provisioned to the OS disk. + string OSImage { get; set; } + /// + /// The IPv4 address that is assigned to the bare metal machine during the cluster deployment. + /// + string OamIpv4Address { get; set; } + /// + /// The IPv6 address that is assigned to the bare metal machine during the cluster deployment. + /// + string OamIpv6Address { get; set; } + /// The power state derived from the baseboard management controller. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("On", "Off")] + string PowerState { get; set; } + /// The list of the resource properties. + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineProperties Property { get; set; } + /// The provisioning state of the bare metal machine. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Succeeded", "Failed", "Canceled", "Provisioning", "Accepted")] + string ProvisioningState { get; set; } + /// The resource ID of the rack where this bare metal machine resides. + string RackId { get; set; } + /// + /// The rack slot in which this bare metal machine is located, ordered from the bottom up i.e. the lowest slot is 1. + /// + long RackSlot { get; set; } + /// The indicator of whether the bare metal machine is ready to receive workloads. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("True", "False")] + string ReadyState { get; set; } + /// The runtime protection status of the bare metal machine. + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRuntimeProtectionStatus RuntimeProtectionStatus { get; set; } + /// The timestamp when the malware definitions were last updated. + global::System.DateTime? RuntimeProtectionStatusDefinitionsLastUpdated { get; set; } + /// The version of the malware definitions. + string RuntimeProtectionStatusDefinitionsVersion { get; set; } + /// + /// The timestamp of the most recently completed scan, or empty if there has never been a scan. + /// + global::System.DateTime? RuntimeProtectionStatusScanCompletedTime { get; set; } + /// + /// The timestamp of the most recently scheduled scan, or empty if no scan has been scheduled. + /// + global::System.DateTime? RuntimeProtectionStatusScanScheduledTime { get; set; } + /// + /// The timestamp of the most recently started scan, or empty if there has never been a scan. + /// + global::System.DateTime? RuntimeProtectionStatusScanStartedTime { get; set; } + /// The list of statuses that represent secret rotation activity. + System.Collections.Generic.List SecretRotationStatus { get; set; } + /// The serial number of the bare metal machine. + string SerialNumber { get; set; } + /// The discovered value of the machine's service tag. + string ServiceTag { get; set; } + /// + /// Field Deprecated. These fields will be empty/omitted. The list of the resource IDs for the VirtualMachines that are hosted + /// on this bare metal machine. + /// + System.Collections.Generic.List VirtualMachinesAssociatedId { get; set; } + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachine.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachine.json.cs similarity index 91% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachine.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachine.json.cs index fd1720f4f2e8..aa8c8e389a16 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachine.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachine.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -65,21 +65,21 @@ internal BareMetalMachine(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtim { return; } - __trackedResource = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.TrackedResource(json); - {_extendedLocation = If( json?.PropertyT("extendedLocation"), out var __jsonExtendedLocation) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ExtendedLocation.FromJson(__jsonExtendedLocation) : ExtendedLocation;} - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BareMetalMachineProperties.FromJson(__jsonProperties) : Property;} - {_etag = If( json?.PropertyT("etag"), out var __jsonEtag) ? (string)__jsonEtag : (string)Etag;} + __trackedResource = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.TrackedResource(json); + {_extendedLocation = If( json?.PropertyT("extendedLocation"), out var __jsonExtendedLocation) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ExtendedLocation.FromJson(__jsonExtendedLocation) : _extendedLocation;} + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BareMetalMachineProperties.FromJson(__jsonProperties) : _property;} + {_etag = If( json?.PropertyT("etag"), out var __jsonEtag) ? (string)__jsonEtag : (string)_etag;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachine. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachine. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachine. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachine. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachine FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachine FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new BareMetalMachine(json) : null; } @@ -106,7 +106,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode ToJ __trackedResource?.ToJson(container, serializationMode); AddIf( null != this._extendedLocation ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) this._extendedLocation.ToJson(null,serializationMode) : null, "extendedLocation" ,container.Add ); AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._etag)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._etag.ToString()) : null, "etag" ,container.Add ); } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineCommandSpecification.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineCommandSpecification.PowerShell.cs similarity index 78% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineCommandSpecification.PowerShell.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineCommandSpecification.PowerShell.cs index 3c7117a60e0b..b651e9104c46 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineCommandSpecification.PowerShell.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineCommandSpecification.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; @@ -66,7 +66,7 @@ public partial class BareMetalMachineCommandSpecification 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,17 +81,17 @@ internal BareMetalMachineCommandSpecification(global::System.Collections.IDictio // actually deserialize if (content.Contains("Argument")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineCommandSpecificationInternal)this).Argument = (string[]) content.GetValueForProperty("Argument",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineCommandSpecificationInternal)this).Argument, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineCommandSpecificationInternal)this).Argument = (System.Collections.Generic.List) content.GetValueForProperty("Argument",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineCommandSpecificationInternal)this).Argument, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("Command")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineCommandSpecificationInternal)this).Command = (string) content.GetValueForProperty("Command",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineCommandSpecificationInternal)this).Command, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineCommandSpecificationInternal)this).Command = (string) content.GetValueForProperty("Command",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineCommandSpecificationInternal)this).Command, 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. @@ -106,39 +106,39 @@ internal BareMetalMachineCommandSpecification(global::System.Management.Automati // actually deserialize if (content.Contains("Argument")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineCommandSpecificationInternal)this).Argument = (string[]) content.GetValueForProperty("Argument",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineCommandSpecificationInternal)this).Argument, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineCommandSpecificationInternal)this).Argument = (System.Collections.Generic.List) content.GetValueForProperty("Argument",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineCommandSpecificationInternal)this).Argument, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("Command")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineCommandSpecificationInternal)this).Command = (string) content.GetValueForProperty("Command",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineCommandSpecificationInternal)this).Command, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineCommandSpecificationInternal)this).Command = (string) content.GetValueForProperty("Command",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineCommandSpecificationInternal)this).Command, 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.NetworkCloud.Models.Api20250201.IBareMetalMachineCommandSpecification DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineCommandSpecification DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new BareMetalMachineCommandSpecification(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.NetworkCloud.Models.Api20250201.IBareMetalMachineCommandSpecification DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineCommandSpecification DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new BareMetalMachineCommandSpecification(content); } @@ -150,7 +150,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201 /// /// an instance of the model class. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineCommandSpecification FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineCommandSpecification FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineCommandSpecification.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineCommandSpecification.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineCommandSpecification.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineCommandSpecification.TypeConverter.cs index 41478368c75b..1fb2dcb54e10 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineCommandSpecification.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineCommandSpecification.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IBareMetalMachineCommandSpecification ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineCommandSpecification ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineCommandSpecification).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineCommandSpecification).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineCommandSpecification.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineCommandSpecification.cs similarity index 83% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineCommandSpecification.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineCommandSpecification.cs index 276607d940fd..d83c97a38db4 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineCommandSpecification.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineCommandSpecification.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -12,18 +12,18 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201 /// machine. /// public partial class BareMetalMachineCommandSpecification : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineCommandSpecification, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineCommandSpecificationInternal + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineCommandSpecification, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineCommandSpecificationInternal { /// Backing field for property. - private string[] _argument; + private System.Collections.Generic.List _argument; /// /// The list of string arguments that will be passed to the script in order as separate arguments. /// [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string[] Argument { get => this._argument; set => this._argument = value; } + public System.Collections.Generic.List Argument { get => this._argument; set => this._argument = value; } /// Backing field for property. private string _command; @@ -49,14 +49,20 @@ public partial interface IBareMetalMachineCommandSpecification : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The list of string arguments that will be passed to the script in order as separate arguments.", SerializedName = @"arguments", PossibleTypes = new [] { typeof(string) })] - string[] Argument { get; set; } + System.Collections.Generic.List Argument { get; set; } /// The command to execute against the bare metal machine. [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The command to execute against the bare metal machine.", SerializedName = @"command", PossibleTypes = new [] { typeof(string) })] @@ -71,7 +77,7 @@ internal partial interface IBareMetalMachineCommandSpecificationInternal /// /// The list of string arguments that will be passed to the script in order as separate arguments. /// - string[] Argument { get; set; } + System.Collections.Generic.List Argument { get; set; } /// The command to execute against the bare metal machine. string Command { get; set; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineCommandSpecification.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineCommandSpecification.json.cs similarity index 91% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineCommandSpecification.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineCommandSpecification.json.cs index 6a074be7ff50..b338deaa1238 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineCommandSpecification.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineCommandSpecification.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -68,19 +68,19 @@ internal BareMetalMachineCommandSpecification(Microsoft.Azure.PowerShell.Cmdlets { return; } - {_argument = If( json?.PropertyT("arguments"), out var __jsonArguments) ? If( __jsonArguments as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : Argument;} - {_command = If( json?.PropertyT("command"), out var __jsonCommand) ? (string)__jsonCommand : (string)Command;} + {_argument = If( json?.PropertyT("arguments"), out var __jsonArguments) ? If( __jsonArguments as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : _argument;} + {_command = If( json?.PropertyT("command"), out var __jsonCommand) ? (string)__jsonCommand : (string)_command;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineCommandSpecification. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineCommandSpecification. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineCommandSpecification. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineCommandSpecification. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineCommandSpecification FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineCommandSpecification FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new BareMetalMachineCommandSpecification(json) : null; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineConfigurationData.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineConfigurationData.PowerShell.cs new file mode 100644 index 000000000000..dc33181bab39 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineConfigurationData.PowerShell.cs @@ -0,0 +1,240 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + + /// + /// BareMetalMachineConfigurationData represents configuration for the bare metal machine. + /// + [System.ComponentModel.TypeConverter(typeof(BareMetalMachineConfigurationDataTypeConverter))] + public partial class BareMetalMachineConfigurationData + { + + /// + /// 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 BareMetalMachineConfigurationData(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("BmcCredentials")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineConfigurationDataInternal)this).BmcCredentials = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministrativeCredentials) content.GetValueForProperty("BmcCredentials",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineConfigurationDataInternal)this).BmcCredentials, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AdministrativeCredentialsTypeConverter.ConvertFrom); + } + if (content.Contains("BmcConnectionString")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineConfigurationDataInternal)this).BmcConnectionString = (string) content.GetValueForProperty("BmcConnectionString",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineConfigurationDataInternal)this).BmcConnectionString, global::System.Convert.ToString); + } + if (content.Contains("BmcMacAddress")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineConfigurationDataInternal)this).BmcMacAddress = (string) content.GetValueForProperty("BmcMacAddress",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineConfigurationDataInternal)this).BmcMacAddress, global::System.Convert.ToString); + } + if (content.Contains("BootMacAddress")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineConfigurationDataInternal)this).BootMacAddress = (string) content.GetValueForProperty("BootMacAddress",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineConfigurationDataInternal)this).BootMacAddress, global::System.Convert.ToString); + } + if (content.Contains("MachineDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineConfigurationDataInternal)this).MachineDetail = (string) content.GetValueForProperty("MachineDetail",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineConfigurationDataInternal)this).MachineDetail, global::System.Convert.ToString); + } + if (content.Contains("MachineName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineConfigurationDataInternal)this).MachineName = (string) content.GetValueForProperty("MachineName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineConfigurationDataInternal)this).MachineName, global::System.Convert.ToString); + } + if (content.Contains("RackSlot")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineConfigurationDataInternal)this).RackSlot = (long) content.GetValueForProperty("RackSlot",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineConfigurationDataInternal)this).RackSlot, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("SerialNumber")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineConfigurationDataInternal)this).SerialNumber = (string) content.GetValueForProperty("SerialNumber",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineConfigurationDataInternal)this).SerialNumber, global::System.Convert.ToString); + } + if (content.Contains("BmcCredentialsPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineConfigurationDataInternal)this).BmcCredentialsPassword = (System.Security.SecureString) content.GetValueForProperty("BmcCredentialsPassword",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineConfigurationDataInternal)this).BmcCredentialsPassword, (object ss) => (System.Security.SecureString)ss); + } + if (content.Contains("BmcCredentialsUsername")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineConfigurationDataInternal)this).BmcCredentialsUsername = (string) content.GetValueForProperty("BmcCredentialsUsername",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineConfigurationDataInternal)this).BmcCredentialsUsername, 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 BareMetalMachineConfigurationData(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("BmcCredentials")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineConfigurationDataInternal)this).BmcCredentials = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministrativeCredentials) content.GetValueForProperty("BmcCredentials",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineConfigurationDataInternal)this).BmcCredentials, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AdministrativeCredentialsTypeConverter.ConvertFrom); + } + if (content.Contains("BmcConnectionString")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineConfigurationDataInternal)this).BmcConnectionString = (string) content.GetValueForProperty("BmcConnectionString",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineConfigurationDataInternal)this).BmcConnectionString, global::System.Convert.ToString); + } + if (content.Contains("BmcMacAddress")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineConfigurationDataInternal)this).BmcMacAddress = (string) content.GetValueForProperty("BmcMacAddress",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineConfigurationDataInternal)this).BmcMacAddress, global::System.Convert.ToString); + } + if (content.Contains("BootMacAddress")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineConfigurationDataInternal)this).BootMacAddress = (string) content.GetValueForProperty("BootMacAddress",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineConfigurationDataInternal)this).BootMacAddress, global::System.Convert.ToString); + } + if (content.Contains("MachineDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineConfigurationDataInternal)this).MachineDetail = (string) content.GetValueForProperty("MachineDetail",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineConfigurationDataInternal)this).MachineDetail, global::System.Convert.ToString); + } + if (content.Contains("MachineName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineConfigurationDataInternal)this).MachineName = (string) content.GetValueForProperty("MachineName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineConfigurationDataInternal)this).MachineName, global::System.Convert.ToString); + } + if (content.Contains("RackSlot")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineConfigurationDataInternal)this).RackSlot = (long) content.GetValueForProperty("RackSlot",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineConfigurationDataInternal)this).RackSlot, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("SerialNumber")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineConfigurationDataInternal)this).SerialNumber = (string) content.GetValueForProperty("SerialNumber",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineConfigurationDataInternal)this).SerialNumber, global::System.Convert.ToString); + } + if (content.Contains("BmcCredentialsPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineConfigurationDataInternal)this).BmcCredentialsPassword = (System.Security.SecureString) content.GetValueForProperty("BmcCredentialsPassword",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineConfigurationDataInternal)this).BmcCredentialsPassword, (object ss) => (System.Security.SecureString)ss); + } + if (content.Contains("BmcCredentialsUsername")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineConfigurationDataInternal)this).BmcCredentialsUsername = (string) content.GetValueForProperty("BmcCredentialsUsername",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineConfigurationDataInternal)this).BmcCredentialsUsername, 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.NetworkCloud.Models.IBareMetalMachineConfigurationData DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new BareMetalMachineConfigurationData(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.NetworkCloud.Models.IBareMetalMachineConfigurationData DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new BareMetalMachineConfigurationData(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.NetworkCloud.Models.IBareMetalMachineConfigurationData FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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(); + } + } + /// BareMetalMachineConfigurationData represents configuration for the bare metal machine. + [System.ComponentModel.TypeConverter(typeof(BareMetalMachineConfigurationDataTypeConverter))] + public partial interface IBareMetalMachineConfigurationData + + { + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineConfigurationData.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineConfigurationData.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineConfigurationData.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineConfigurationData.TypeConverter.cs index 9f593b41685b..c7b293935f6f 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineConfigurationData.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineConfigurationData.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IBareMetalMachineConfigurationData ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineConfigurationData ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineConfigurationData).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineConfigurationData).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineConfigurationData.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineConfigurationData.cs similarity index 85% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineConfigurationData.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineConfigurationData.cs index 65ee945912df..97f353e1b7a5 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineConfigurationData.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineConfigurationData.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -11,8 +11,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201 /// BareMetalMachineConfigurationData represents configuration for the bare metal machine. /// public partial class BareMetalMachineConfigurationData : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineConfigurationData, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineConfigurationDataInternal + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineConfigurationData, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineConfigurationDataInternal { /// Backing field for property. @@ -25,7 +25,7 @@ public partial class BareMetalMachineConfigurationData : public string BmcConnectionString { get => this._bmcConnectionString; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministrativeCredentials _bmcCredentials; + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministrativeCredentials _bmcCredentials; /// /// The credentials of the baseboard management controller on this bare metal machine. The password field is expected to be @@ -33,15 +33,15 @@ public partial class BareMetalMachineConfigurationData : /// the actual password value should be provided instead. /// [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministrativeCredentials BmcCredentials { get => (this._bmcCredentials = this._bmcCredentials ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AdministrativeCredentials()); set => this._bmcCredentials = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministrativeCredentials BmcCredentials { get => (this._bmcCredentials = this._bmcCredentials ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AdministrativeCredentials()); set => this._bmcCredentials = value; } /// The password of the administrator of the device used during initialization. [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public System.Security.SecureString BmcCredentialsPassword { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministrativeCredentialsInternal)BmcCredentials).Password; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministrativeCredentialsInternal)BmcCredentials).Password = value ; } + public System.Security.SecureString BmcCredentialsPassword { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministrativeCredentialsInternal)BmcCredentials).Password; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministrativeCredentialsInternal)BmcCredentials).Password = value ; } /// The username of the administrator of the device used during initialization. [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string BmcCredentialsUsername { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministrativeCredentialsInternal)BmcCredentials).Username; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministrativeCredentialsInternal)BmcCredentials).Username = value ; } + public string BmcCredentialsUsername { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministrativeCredentialsInternal)BmcCredentials).Username; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministrativeCredentialsInternal)BmcCredentials).Username = value ; } /// Backing field for property. private string _bmcMacAddress; @@ -75,10 +75,10 @@ public partial class BareMetalMachineConfigurationData : public string MachineName { get => this._machineName; set => this._machineName = value; } /// Internal Acessors for BmcConnectionString - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineConfigurationDataInternal.BmcConnectionString { get => this._bmcConnectionString; set { {_bmcConnectionString = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineConfigurationDataInternal.BmcConnectionString { get => this._bmcConnectionString; set { {_bmcConnectionString = value;} } } /// Internal Acessors for BmcCredentials - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministrativeCredentials Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineConfigurationDataInternal.BmcCredentials { get => (this._bmcCredentials = this._bmcCredentials ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AdministrativeCredentials()); set { {_bmcCredentials = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministrativeCredentials Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineConfigurationDataInternal.BmcCredentials { get => (this._bmcCredentials = this._bmcCredentials ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AdministrativeCredentials()); set { {_bmcCredentials = value;} } } /// Backing field for property. private long _rackSlot; @@ -112,6 +112,9 @@ public partial interface IBareMetalMachineConfigurationData : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The connection string for the baseboard management controller including IP address and protocol.", SerializedName = @"bmcConnectionString", PossibleTypes = new [] { typeof(string) })] @@ -120,6 +123,9 @@ public partial interface IBareMetalMachineConfigurationData : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The password of the administrator of the device used during initialization.", SerializedName = @"password", PossibleTypes = new [] { typeof(System.Security.SecureString) })] @@ -128,6 +134,9 @@ public partial interface IBareMetalMachineConfigurationData : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The username of the administrator of the device used during initialization.", SerializedName = @"username", PossibleTypes = new [] { typeof(string) })] @@ -136,6 +145,9 @@ public partial interface IBareMetalMachineConfigurationData : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The MAC address of the BMC for this machine.", SerializedName = @"bmcMacAddress", PossibleTypes = new [] { typeof(string) })] @@ -144,6 +156,9 @@ public partial interface IBareMetalMachineConfigurationData : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The MAC address associated with the PXE NIC card.", SerializedName = @"bootMacAddress", PossibleTypes = new [] { typeof(string) })] @@ -152,6 +167,9 @@ public partial interface IBareMetalMachineConfigurationData : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The free-form additional information about the machine, e.g. an asset tag.", SerializedName = @"machineDetails", PossibleTypes = new [] { typeof(string) })] @@ -163,6 +181,9 @@ public partial interface IBareMetalMachineConfigurationData : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The user-provided name for the bare metal machine created from this specification. If not provided, the machine name will be generated programmatically.", SerializedName = @"machineName", @@ -172,6 +193,9 @@ public partial interface IBareMetalMachineConfigurationData : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The slot the physical machine is in the rack based on the BOM configuration.", SerializedName = @"rackSlot", PossibleTypes = new [] { typeof(long) })] @@ -182,6 +206,9 @@ public partial interface IBareMetalMachineConfigurationData : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The serial number of the machine. Hardware suppliers may use an alternate value. For example, service tag.", SerializedName = @"serialNumber", PossibleTypes = new [] { typeof(string) })] @@ -201,7 +228,7 @@ internal partial interface IBareMetalMachineConfigurationDataInternal /// an Azure Key Vault key URL. Until the cluster is converted to utilize managed identity by setting the secret archive settings, /// the actual password value should be provided instead. /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministrativeCredentials BmcCredentials { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministrativeCredentials BmcCredentials { get; set; } /// The password of the administrator of the device used during initialization. System.Security.SecureString BmcCredentialsPassword { get; set; } /// The username of the administrator of the device used during initialization. diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineConfigurationData.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineConfigurationData.json.cs similarity index 92% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineConfigurationData.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineConfigurationData.json.cs index 3e78f97554cc..217a8de9e2d6 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineConfigurationData.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineConfigurationData.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -67,25 +67,25 @@ internal BareMetalMachineConfigurationData(Microsoft.Azure.PowerShell.Cmdlets.Ne { return; } - {_bmcCredentials = If( json?.PropertyT("bmcCredentials"), out var __jsonBmcCredentials) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AdministrativeCredentials.FromJson(__jsonBmcCredentials) : BmcCredentials;} - {_bmcConnectionString = If( json?.PropertyT("bmcConnectionString"), out var __jsonBmcConnectionString) ? (string)__jsonBmcConnectionString : (string)BmcConnectionString;} - {_bmcMacAddress = If( json?.PropertyT("bmcMacAddress"), out var __jsonBmcMacAddress) ? (string)__jsonBmcMacAddress : (string)BmcMacAddress;} - {_bootMacAddress = If( json?.PropertyT("bootMacAddress"), out var __jsonBootMacAddress) ? (string)__jsonBootMacAddress : (string)BootMacAddress;} - {_machineDetail = If( json?.PropertyT("machineDetails"), out var __jsonMachineDetails) ? (string)__jsonMachineDetails : (string)MachineDetail;} - {_machineName = If( json?.PropertyT("machineName"), out var __jsonMachineName) ? (string)__jsonMachineName : (string)MachineName;} - {_rackSlot = If( json?.PropertyT("rackSlot"), out var __jsonRackSlot) ? (long)__jsonRackSlot : RackSlot;} - {_serialNumber = If( json?.PropertyT("serialNumber"), out var __jsonSerialNumber) ? (string)__jsonSerialNumber : (string)SerialNumber;} + {_bmcCredentials = If( json?.PropertyT("bmcCredentials"), out var __jsonBmcCredentials) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AdministrativeCredentials.FromJson(__jsonBmcCredentials) : _bmcCredentials;} + {_bmcConnectionString = If( json?.PropertyT("bmcConnectionString"), out var __jsonBmcConnectionString) ? (string)__jsonBmcConnectionString : (string)_bmcConnectionString;} + {_bmcMacAddress = If( json?.PropertyT("bmcMacAddress"), out var __jsonBmcMacAddress) ? (string)__jsonBmcMacAddress : (string)_bmcMacAddress;} + {_bootMacAddress = If( json?.PropertyT("bootMacAddress"), out var __jsonBootMacAddress) ? (string)__jsonBootMacAddress : (string)_bootMacAddress;} + {_machineDetail = If( json?.PropertyT("machineDetails"), out var __jsonMachineDetails) ? (string)__jsonMachineDetails : (string)_machineDetail;} + {_machineName = If( json?.PropertyT("machineName"), out var __jsonMachineName) ? (string)__jsonMachineName : (string)_machineName;} + {_rackSlot = If( json?.PropertyT("rackSlot"), out var __jsonRackSlot) ? (long)__jsonRackSlot : _rackSlot;} + {_serialNumber = If( json?.PropertyT("serialNumber"), out var __jsonSerialNumber) ? (string)__jsonSerialNumber : (string)_serialNumber;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineConfigurationData. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineConfigurationData. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineConfigurationData. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineConfigurationData. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineConfigurationData FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineConfigurationData FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new BareMetalMachineConfigurationData(json) : null; } @@ -110,7 +110,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode ToJ return container; } AddIf( null != this._bmcCredentials ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) this._bmcCredentials.ToJson(null,serializationMode) : null, "bmcCredentials" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._bmcConnectionString)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._bmcConnectionString.ToString()) : null, "bmcConnectionString" ,container.Add ); } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineCordonParameters.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineCordonParameters.PowerShell.cs similarity index 81% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineCordonParameters.PowerShell.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineCordonParameters.PowerShell.cs index 52b901fff7d6..7ef25ed0dca7 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineCordonParameters.PowerShell.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineCordonParameters.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; @@ -65,7 +65,7 @@ public partial class BareMetalMachineCordonParameters 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 BareMetalMachineCordonParameters(global::System.Collections.IDictionary // actually deserialize if (content.Contains("Evacuate")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineCordonParametersInternal)this).Evacuate = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineEvacuate?) content.GetValueForProperty("Evacuate",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineCordonParametersInternal)this).Evacuate, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineEvacuate.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineCordonParametersInternal)this).Evacuate = (string) content.GetValueForProperty("Evacuate",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineCordonParametersInternal)this).Evacuate, 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. @@ -101,35 +101,33 @@ internal BareMetalMachineCordonParameters(global::System.Management.Automation.P // actually deserialize if (content.Contains("Evacuate")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineCordonParametersInternal)this).Evacuate = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineEvacuate?) content.GetValueForProperty("Evacuate",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineCordonParametersInternal)this).Evacuate, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineEvacuate.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineCordonParametersInternal)this).Evacuate = (string) content.GetValueForProperty("Evacuate",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineCordonParametersInternal)this).Evacuate, 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.NetworkCloud.Models.Api20250201.IBareMetalMachineCordonParameters DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineCordonParameters DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new BareMetalMachineCordonParameters(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.NetworkCloud.Models.Api20250201.IBareMetalMachineCordonParameters DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineCordonParameters DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new BareMetalMachineCordonParameters(content); } @@ -139,7 +137,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineCordonParameters FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineCordonParameters FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineCordonParameters.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineCordonParameters.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineCordonParameters.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineCordonParameters.TypeConverter.cs index e88e10d7b0c1..4d5a6a950335 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineCordonParameters.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineCordonParameters.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IBareMetalMachineCordonParameters ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineCordonParameters ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineCordonParameters).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineCordonParameters).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineCordonParameters.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineCordonParameters.cs new file mode 100644 index 000000000000..8164bbc9f034 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineCordonParameters.cs @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + + /// + /// BareMetalMachineCordonParameters represents the body of the request to evacuate workloads from node on a bare metal machine. + /// + public partial class BareMetalMachineCordonParameters : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineCordonParameters, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineCordonParametersInternal + { + + /// Backing field for property. + private string _evacuate; + + /// + /// The indicator of whether to evacuate the node workload when the bare metal machine is cordoned. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string Evacuate { get => this._evacuate; set => this._evacuate = value; } + + /// Creates an new instance. + public BareMetalMachineCordonParameters() + { + + } + } + /// BareMetalMachineCordonParameters represents the body of the request to evacuate workloads from node on a bare metal machine. + public partial interface IBareMetalMachineCordonParameters : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable + { + /// + /// The indicator of whether to evacuate the node workload when the bare metal machine is cordoned. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The indicator of whether to evacuate the node workload when the bare metal machine is cordoned.", + SerializedName = @"evacuate", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("True", "False")] + string Evacuate { get; set; } + + } + /// BareMetalMachineCordonParameters represents the body of the request to evacuate workloads from node on a bare metal machine. + internal partial interface IBareMetalMachineCordonParametersInternal + + { + /// + /// The indicator of whether to evacuate the node workload when the bare metal machine is cordoned. + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("True", "False")] + string Evacuate { get; set; } + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineCordonParameters.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineCordonParameters.json.cs similarity index 94% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineCordonParameters.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineCordonParameters.json.cs index 87b761d899fe..53a2e00a45cd 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineCordonParameters.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineCordonParameters.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -67,18 +67,18 @@ internal BareMetalMachineCordonParameters(Microsoft.Azure.PowerShell.Cmdlets.Net { return; } - {_evacuate = If( json?.PropertyT("evacuate"), out var __jsonEvacuate) ? (string)__jsonEvacuate : (string)Evacuate;} + {_evacuate = If( json?.PropertyT("evacuate"), out var __jsonEvacuate) ? (string)__jsonEvacuate : (string)_evacuate;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineCordonParameters. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineCordonParameters. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineCordonParameters. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineCordonParameters. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineCordonParameters FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineCordonParameters FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new BareMetalMachineCordonParameters(json) : null; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineKeySet.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineKeySet.PowerShell.cs new file mode 100644 index 000000000000..d90f7c7a9816 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineKeySet.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.NetworkCloud.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + + /// BareMetalMachineKeySet represents the bare metal machine key set. + [System.ComponentModel.TypeConverter(typeof(BareMetalMachineKeySetTypeConverter))] + public partial class BareMetalMachineKeySet + { + + /// + /// 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 BareMetalMachineKeySet(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ExtendedLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetInternal)this).ExtendedLocation = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocation) content.GetValueForProperty("ExtendedLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetInternal)this).ExtendedLocation, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ExtendedLocationTypeConverter.ConvertFrom); + } + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BareMetalMachineKeySetPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Etag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetInternal)this).Etag, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)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("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedByType = (string) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedByType = (string) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.TrackedResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("ExtendedLocationName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetInternal)this).ExtendedLocationName = (string) content.GetValueForProperty("ExtendedLocationName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetInternal)this).ExtendedLocationName, global::System.Convert.ToString); + } + if (content.Contains("ExtendedLocationType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetInternal)this).ExtendedLocationType = (string) content.GetValueForProperty("ExtendedLocationType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetInternal)this).ExtendedLocationType, global::System.Convert.ToString); + } + if (content.Contains("AzureGroupId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetInternal)this).AzureGroupId = (string) content.GetValueForProperty("AzureGroupId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetInternal)this).AzureGroupId, global::System.Convert.ToString); + } + if (content.Contains("DetailedStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetInternal)this).DetailedStatus = (string) content.GetValueForProperty("DetailedStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetInternal)this).DetailedStatus, global::System.Convert.ToString); + } + if (content.Contains("DetailedStatusMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetInternal)this).DetailedStatusMessage = (string) content.GetValueForProperty("DetailedStatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetInternal)this).DetailedStatusMessage, global::System.Convert.ToString); + } + if (content.Contains("Expiration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetInternal)this).Expiration = (global::System.DateTime) content.GetValueForProperty("Expiration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetInternal)this).Expiration, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("JumpHostsAllowed")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetInternal)this).JumpHostsAllowed = (System.Collections.Generic.List) content.GetValueForProperty("JumpHostsAllowed",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetInternal)this).JumpHostsAllowed, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("LastValidation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetInternal)this).LastValidation = (global::System.DateTime?) content.GetValueForProperty("LastValidation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetInternal)this).LastValidation, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("OSGroupName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetInternal)this).OSGroupName = (string) content.GetValueForProperty("OSGroupName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetInternal)this).OSGroupName, global::System.Convert.ToString); + } + if (content.Contains("PrivilegeLevel")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetInternal)this).PrivilegeLevel = (string) content.GetValueForProperty("PrivilegeLevel",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetInternal)this).PrivilegeLevel, global::System.Convert.ToString); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("UserList")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetInternal)this).UserList = (System.Collections.Generic.List) content.GetValueForProperty("UserList",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetInternal)this).UserList, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.KeySetUserTypeConverter.ConvertFrom)); + } + if (content.Contains("UserListStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetInternal)this).UserListStatus = (System.Collections.Generic.List) content.GetValueForProperty("UserListStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetInternal)this).UserListStatus, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.KeySetUserStatusTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal BareMetalMachineKeySet(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ExtendedLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetInternal)this).ExtendedLocation = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocation) content.GetValueForProperty("ExtendedLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetInternal)this).ExtendedLocation, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ExtendedLocationTypeConverter.ConvertFrom); + } + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BareMetalMachineKeySetPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Etag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetInternal)this).Etag, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)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("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedByType = (string) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedByType = (string) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.TrackedResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("ExtendedLocationName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetInternal)this).ExtendedLocationName = (string) content.GetValueForProperty("ExtendedLocationName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetInternal)this).ExtendedLocationName, global::System.Convert.ToString); + } + if (content.Contains("ExtendedLocationType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetInternal)this).ExtendedLocationType = (string) content.GetValueForProperty("ExtendedLocationType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetInternal)this).ExtendedLocationType, global::System.Convert.ToString); + } + if (content.Contains("AzureGroupId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetInternal)this).AzureGroupId = (string) content.GetValueForProperty("AzureGroupId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetInternal)this).AzureGroupId, global::System.Convert.ToString); + } + if (content.Contains("DetailedStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetInternal)this).DetailedStatus = (string) content.GetValueForProperty("DetailedStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetInternal)this).DetailedStatus, global::System.Convert.ToString); + } + if (content.Contains("DetailedStatusMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetInternal)this).DetailedStatusMessage = (string) content.GetValueForProperty("DetailedStatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetInternal)this).DetailedStatusMessage, global::System.Convert.ToString); + } + if (content.Contains("Expiration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetInternal)this).Expiration = (global::System.DateTime) content.GetValueForProperty("Expiration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetInternal)this).Expiration, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("JumpHostsAllowed")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetInternal)this).JumpHostsAllowed = (System.Collections.Generic.List) content.GetValueForProperty("JumpHostsAllowed",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetInternal)this).JumpHostsAllowed, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("LastValidation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetInternal)this).LastValidation = (global::System.DateTime?) content.GetValueForProperty("LastValidation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetInternal)this).LastValidation, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("OSGroupName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetInternal)this).OSGroupName = (string) content.GetValueForProperty("OSGroupName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetInternal)this).OSGroupName, global::System.Convert.ToString); + } + if (content.Contains("PrivilegeLevel")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetInternal)this).PrivilegeLevel = (string) content.GetValueForProperty("PrivilegeLevel",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetInternal)this).PrivilegeLevel, global::System.Convert.ToString); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("UserList")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetInternal)this).UserList = (System.Collections.Generic.List) content.GetValueForProperty("UserList",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetInternal)this).UserList, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.KeySetUserTypeConverter.ConvertFrom)); + } + if (content.Contains("UserListStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetInternal)this).UserListStatus = (System.Collections.Generic.List) content.GetValueForProperty("UserListStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetInternal)this).UserListStatus, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.KeySetUserStatusTypeConverter.ConvertFrom)); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySet DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new BareMetalMachineKeySet(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.NetworkCloud.Models.IBareMetalMachineKeySet DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new BareMetalMachineKeySet(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.NetworkCloud.Models.IBareMetalMachineKeySet FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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(); + } + } + /// BareMetalMachineKeySet represents the bare metal machine key set. + [System.ComponentModel.TypeConverter(typeof(BareMetalMachineKeySetTypeConverter))] + public partial interface IBareMetalMachineKeySet + + { + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineKeySet.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineKeySet.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineKeySet.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineKeySet.TypeConverter.cs index a994a9287086..c7ea95c7998e 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineKeySet.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineKeySet.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySet ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySet ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySet).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySet).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineKeySet.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineKeySet.cs new file mode 100644 index 000000000000..6efd27f5e089 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineKeySet.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.NetworkCloud.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + + /// BareMetalMachineKeySet represents the bare metal machine key set. + public partial class BareMetalMachineKeySet : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySet, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetInternal, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResource __trackedResource = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.TrackedResource(); + + /// + /// The object ID of Azure Active Directory group that all users in the list must be in for access to be granted. Users that + /// are not in the group will not have access. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string AzureGroupId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetPropertiesInternal)Property).AzureGroupId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetPropertiesInternal)Property).AzureGroupId = value ?? null; } + + /// The more detailed status of the key set. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string DetailedStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetPropertiesInternal)Property).DetailedStatus; } + + /// The descriptive message about the current detailed status. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string DetailedStatusMessage { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetPropertiesInternal)Property).DetailedStatusMessage; } + + /// Backing field for property. + private string _etag; + + /// Resource ETag. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string Etag { get => this._etag; } + + /// + /// The date and time after which the users in this key set will be removed from the bare metal machines. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public global::System.DateTime Expiration { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetPropertiesInternal)Property).Expiration; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetPropertiesInternal)Property).Expiration = value ; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocation _extendedLocation; + + /// The extended location of the cluster associated with the resource. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocation ExtendedLocation { get => (this._extendedLocation = this._extendedLocation ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ExtendedLocation()); set => this._extendedLocation = value; } + + /// The resource ID of the extended location on which the resource will be created. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string ExtendedLocationName { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocationInternal)ExtendedLocation).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocationInternal)ExtendedLocation).Name = value ?? null; } + + /// The extended location type, for example, CustomLocation. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string ExtendedLocationType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocationInternal)ExtendedLocation).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocationInternal)ExtendedLocation).Type = value ?? null; } + + /// + /// Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).Id; } + + /// + /// The list of IP addresses of jump hosts with management network access from which a login will be allowed for the users. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public System.Collections.Generic.List JumpHostsAllowed { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetPropertiesInternal)Property).JumpHostsAllowed; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetPropertiesInternal)Property).JumpHostsAllowed = value ; } + + /// The last time this key set was validated. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public global::System.DateTime? LastValidation { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetPropertiesInternal)Property).LastValidation; } + + /// The geo-location where the resource lives + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)__trackedResource).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)__trackedResource).Location = value ?? null; } + + /// Internal Acessors for DetailedStatus + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetInternal.DetailedStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetPropertiesInternal)Property).DetailedStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetPropertiesInternal)Property).DetailedStatus = value ?? null; } + + /// Internal Acessors for DetailedStatusMessage + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetInternal.DetailedStatusMessage { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetPropertiesInternal)Property).DetailedStatusMessage; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetPropertiesInternal)Property).DetailedStatusMessage = value ?? null; } + + /// Internal Acessors for Etag + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetInternal.Etag { get => this._etag; set { {_etag = value;} } } + + /// Internal Acessors for ExtendedLocation + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocation Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetInternal.ExtendedLocation { get => (this._extendedLocation = this._extendedLocation ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ExtendedLocation()); set { {_extendedLocation = value;} } } + + /// Internal Acessors for LastValidation + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetInternal.LastValidation { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetPropertiesInternal)Property).LastValidation; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetPropertiesInternal)Property).LastValidation = value ?? default(global::System.DateTime); } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetProperties Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BareMetalMachineKeySetProperties()); set { {_property = value;} } } + + /// Internal Acessors for ProvisioningState + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetPropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetPropertiesInternal)Property).ProvisioningState = value ?? null; } + + /// Internal Acessors for UserListStatus + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetInternal.UserListStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetPropertiesInternal)Property).UserListStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetPropertiesInternal)Property).UserListStatus = value ?? null /* arrayOf */; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).Id = value ?? null; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).Name = value ?? null; } + + /// Internal Acessors for SystemData + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISystemData Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemData; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemData = value ?? null /* model class */; } + + /// Internal Acessors for SystemDataCreatedAt + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataCreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataCreatedAt = value ?? default(global::System.DateTime); } + + /// Internal Acessors for SystemDataCreatedBy + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataCreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataCreatedBy = value ?? null; } + + /// Internal Acessors for SystemDataCreatedByType + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataCreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataCreatedByType = value ?? null; } + + /// Internal Acessors for SystemDataLastModifiedAt + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedAt = value ?? default(global::System.DateTime); } + + /// Internal Acessors for SystemDataLastModifiedBy + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedBy = value ?? null; } + + /// Internal Acessors for SystemDataLastModifiedByType + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedByType = value ?? null; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).Type = value ?? null; } + + /// The name of the resource + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).Name; } + + /// + /// The name of the group that users will be assigned to on the operating system of the machines. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string OSGroupName { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetPropertiesInternal)Property).OSGroupName; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetPropertiesInternal)Property).OSGroupName = value ?? null; } + + /// The access level allowed for the users in this key set. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string PrivilegeLevel { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetPropertiesInternal)Property).PrivilegeLevel; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetPropertiesInternal)Property).PrivilegeLevel = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetProperties _property; + + /// The list of the resource properties. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BareMetalMachineKeySetProperties()); set => this._property = value; } + + /// The provisioning state of the bare metal machine key set. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetPropertiesInternal)Property).ProvisioningState; } + + /// Gets the resource group name + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string ResourceGroupName { get => (new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Success ? new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Groups["resourceGroupName"].Value : null); } + + /// + /// Azure Resource Manager metadata containing createdBy and modifiedBy information. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISystemData SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemData; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemData = value ?? null /* model class */; } + + /// The timestamp of resource creation (UTC). + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataCreatedAt; } + + /// The identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataCreatedBy; } + + /// The type of identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public string SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataCreatedByType; } + + /// The timestamp of resource last modification (UTC) + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedAt; } + + /// The identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedBy; } + + /// The type of identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public string SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedByType; } + + /// Resource tags. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)__trackedResource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).Type; } + + /// The unique list of permitted users. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public System.Collections.Generic.List UserList { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetPropertiesInternal)Property).UserList; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetPropertiesInternal)Property).UserList = value ; } + + /// The status evaluation of each user. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public System.Collections.Generic.List UserListStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetPropertiesInternal)Property).UserListStatus; } + + /// Creates an new instance. + public BareMetalMachineKeySet() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__trackedResource), __trackedResource); + await eventListener.AssertObjectIsValid(nameof(__trackedResource), __trackedResource); + } + } + /// BareMetalMachineKeySet represents the bare metal machine key set. + public partial interface IBareMetalMachineKeySet : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResource + { + /// + /// The object ID of Azure Active Directory group that all users in the list must be in for access to be granted. Users that + /// are not in the group will not have access. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The object ID of Azure Active Directory group that all users in the list must be in for access to be granted. Users that are not in the group will not have access.", + SerializedName = @"azureGroupId", + PossibleTypes = new [] { typeof(string) })] + string AzureGroupId { get; set; } + /// The more detailed status of the key set. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The more detailed status of the key set.", + SerializedName = @"detailedStatus", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("AllActive", "SomeInvalid", "AllInvalid", "Validating")] + string DetailedStatus { get; } + /// The descriptive message about the current detailed status. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The descriptive message about the current detailed status.", + SerializedName = @"detailedStatusMessage", + PossibleTypes = new [] { typeof(string) })] + string DetailedStatusMessage { get; } + /// Resource ETag. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"Resource ETag.", + SerializedName = @"etag", + PossibleTypes = new [] { typeof(string) })] + string Etag { get; } + /// + /// The date and time after which the users in this key set will be removed from the bare metal machines. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The date and time after which the users in this key set will be removed from the bare metal machines.", + SerializedName = @"expiration", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime Expiration { get; set; } + /// The resource ID of the extended location on which the resource will be created. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The resource ID of the extended location on which the resource will be created.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string ExtendedLocationName { get; set; } + /// The extended location type, for example, CustomLocation. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The extended location type, for example, CustomLocation.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + string ExtendedLocationType { get; set; } + /// + /// The list of IP addresses of jump hosts with management network access from which a login will be allowed for the users. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The list of IP addresses of jump hosts with management network access from which a login will be allowed for the users.", + SerializedName = @"jumpHostsAllowed", + PossibleTypes = new [] { typeof(string) })] + System.Collections.Generic.List JumpHostsAllowed { get; set; } + /// The last time this key set was validated. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The last time this key set was validated.", + SerializedName = @"lastValidation", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? LastValidation { get; } + /// + /// The name of the group that users will be assigned to on the operating system of the machines. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The name of the group that users will be assigned to on the operating system of the machines.", + SerializedName = @"osGroupName", + PossibleTypes = new [] { typeof(string) })] + string OSGroupName { get; set; } + /// The access level allowed for the users in this key set. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The access level allowed for the users in this key set.", + SerializedName = @"privilegeLevel", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Standard", "Superuser")] + string PrivilegeLevel { get; set; } + /// The provisioning state of the bare metal machine key set. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The provisioning state of the bare metal machine key set.", + SerializedName = @"provisioningState", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Succeeded", "Failed", "Canceled", "Accepted", "Provisioning")] + string ProvisioningState { get; } + /// The unique list of permitted users. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The unique list of permitted users.", + SerializedName = @"userList", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKeySetUser) })] + System.Collections.Generic.List UserList { get; set; } + /// The status evaluation of each user. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The status evaluation of each user.", + SerializedName = @"userListStatus", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKeySetUserStatus) })] + System.Collections.Generic.List UserListStatus { get; } + + } + /// BareMetalMachineKeySet represents the bare metal machine key set. + internal partial interface IBareMetalMachineKeySetInternal : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal + { + /// + /// The object ID of Azure Active Directory group that all users in the list must be in for access to be granted. Users that + /// are not in the group will not have access. + /// + string AzureGroupId { get; set; } + /// The more detailed status of the key set. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("AllActive", "SomeInvalid", "AllInvalid", "Validating")] + string DetailedStatus { get; set; } + /// The descriptive message about the current detailed status. + string DetailedStatusMessage { get; set; } + /// Resource ETag. + string Etag { get; set; } + /// + /// The date and time after which the users in this key set will be removed from the bare metal machines. + /// + global::System.DateTime Expiration { get; set; } + /// The extended location of the cluster associated with the resource. + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocation ExtendedLocation { get; set; } + /// The resource ID of the extended location on which the resource will be created. + string ExtendedLocationName { get; set; } + /// The extended location type, for example, CustomLocation. + string ExtendedLocationType { get; set; } + /// + /// The list of IP addresses of jump hosts with management network access from which a login will be allowed for the users. + /// + System.Collections.Generic.List JumpHostsAllowed { get; set; } + /// The last time this key set was validated. + global::System.DateTime? LastValidation { get; set; } + /// + /// The name of the group that users will be assigned to on the operating system of the machines. + /// + string OSGroupName { get; set; } + /// The access level allowed for the users in this key set. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Standard", "Superuser")] + string PrivilegeLevel { get; set; } + /// The list of the resource properties. + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetProperties Property { get; set; } + /// The provisioning state of the bare metal machine key set. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Succeeded", "Failed", "Canceled", "Accepted", "Provisioning")] + string ProvisioningState { get; set; } + /// The unique list of permitted users. + System.Collections.Generic.List UserList { get; set; } + /// The status evaluation of each user. + System.Collections.Generic.List UserListStatus { get; set; } + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineKeySet.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineKeySet.json.cs similarity index 91% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineKeySet.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineKeySet.json.cs index 2f371081fa6e..9deee6435f25 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineKeySet.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineKeySet.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -65,21 +65,21 @@ internal BareMetalMachineKeySet(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud. { return; } - __trackedResource = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.TrackedResource(json); - {_extendedLocation = If( json?.PropertyT("extendedLocation"), out var __jsonExtendedLocation) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ExtendedLocation.FromJson(__jsonExtendedLocation) : ExtendedLocation;} - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BareMetalMachineKeySetProperties.FromJson(__jsonProperties) : Property;} - {_etag = If( json?.PropertyT("etag"), out var __jsonEtag) ? (string)__jsonEtag : (string)Etag;} + __trackedResource = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.TrackedResource(json); + {_extendedLocation = If( json?.PropertyT("extendedLocation"), out var __jsonExtendedLocation) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ExtendedLocation.FromJson(__jsonExtendedLocation) : _extendedLocation;} + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BareMetalMachineKeySetProperties.FromJson(__jsonProperties) : _property;} + {_etag = If( json?.PropertyT("etag"), out var __jsonEtag) ? (string)__jsonEtag : (string)_etag;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySet. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySet. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySet. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySet. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySet FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySet FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new BareMetalMachineKeySet(json) : null; } @@ -106,7 +106,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode ToJ __trackedResource?.ToJson(container, serializationMode); AddIf( null != this._extendedLocation ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) this._extendedLocation.ToJson(null,serializationMode) : null, "extendedLocation" ,container.Add ); AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._etag)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._etag.ToString()) : null, "etag" ,container.Add ); } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineKeySetList.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineKeySetList.PowerShell.cs similarity index 75% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineKeySetList.PowerShell.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineKeySetList.PowerShell.cs index 91026711e0f6..2cdca0b0698d 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineKeySetList.PowerShell.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineKeySetList.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; @@ -63,7 +63,7 @@ public partial class BareMetalMachineKeySetList 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 BareMetalMachineKeySetList(global::System.Collections.IDictionary conte // actually deserialize if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetListInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetListInternal)this).NextLink, global::System.Convert.ToString); } if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySet[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BareMetalMachineKeySetTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetListInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetListInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BareMetalMachineKeySetTypeConverter.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 BareMetalMachineKeySetList(global::System.Management.Automation.PSObjec // actually deserialize if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetListInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetListInternal)this).NextLink, global::System.Convert.ToString); } if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySet[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BareMetalMachineKeySetTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetListInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetListInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BareMetalMachineKeySetTypeConverter.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.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetList DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetList DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new BareMetalMachineKeySetList(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.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new BareMetalMachineKeySetList(content); } @@ -145,7 +143,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineKeySetList.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineKeySetList.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineKeySetList.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineKeySetList.TypeConverter.cs index 598db2b8b1ab..ee7e04de8134 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineKeySetList.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineKeySetList.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetList ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetList ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetList).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetList).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineKeySetList.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineKeySetList.cs new file mode 100644 index 000000000000..1303230bded9 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineKeySetList.cs @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + + /// BareMetalMachineKeySetList represents a list of bare metal machine key sets. + public partial class BareMetalMachineKeySetList : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetList, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetListInternal + { + + /// Backing field for property. + private string _nextLink; + + /// The link used to get the next page of operations. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; set => this._nextLink = value; } + + /// Backing field for property. + private System.Collections.Generic.List _value; + + /// The list of bare metal machine key sets. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public System.Collections.Generic.List Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public BareMetalMachineKeySetList() + { + + } + } + /// BareMetalMachineKeySetList represents a list of bare metal machine key sets. + public partial interface IBareMetalMachineKeySetList : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable + { + /// The link used to get the next page of operations. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The link used to get the next page of operations.", + SerializedName = @"nextLink", + PossibleTypes = new [] { typeof(string) })] + string NextLink { get; set; } + /// The list of bare metal machine key sets. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The list of bare metal machine key sets.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySet) })] + System.Collections.Generic.List Value { get; set; } + + } + /// BareMetalMachineKeySetList represents a list of bare metal machine key sets. + internal partial interface IBareMetalMachineKeySetListInternal + + { + /// The link used to get the next page of operations. + string NextLink { get; set; } + /// The list of bare metal machine key sets. + System.Collections.Generic.List Value { get; set; } + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineKeySetList.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineKeySetList.json.cs similarity index 90% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineKeySetList.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineKeySetList.json.cs index eb620e51d99c..eb8d659b8306 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineKeySetList.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineKeySetList.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -65,19 +65,19 @@ internal BareMetalMachineKeySetList(Microsoft.Azure.PowerShell.Cmdlets.NetworkCl { return; } - {_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.NetworkCloud.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.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySet) (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BareMetalMachineKeySet.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.NetworkCloud.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.NetworkCloud.Models.IBareMetalMachineKeySet) (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BareMetalMachineKeySet.FromJson(__u) )) ))() : null : _value;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetList. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetList. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetList. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetList. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetList FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetList FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new BareMetalMachineKeySetList(json) : null; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineKeySetPatchParameters.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineKeySetPatchParameters.PowerShell.cs new file mode 100644 index 000000000000..9e0959293e88 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineKeySetPatchParameters.PowerShell.cs @@ -0,0 +1,203 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + + /// + /// BareMetalMachineKeySetPatchParameters represents the body of the request to patch the bare metal machine key set. + /// + [System.ComponentModel.TypeConverter(typeof(BareMetalMachineKeySetPatchParametersTypeConverter))] + public partial class BareMetalMachineKeySetPatchParameters + { + + /// + /// 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 BareMetalMachineKeySetPatchParameters(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.NetworkCloud.Models.IBareMetalMachineKeySetPatchParametersInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetPatchProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetPatchParametersInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BareMetalMachineKeySetPatchPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetPatchParametersInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetPatchParametersTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetPatchParametersInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BareMetalMachineKeySetPatchParametersTagsTypeConverter.ConvertFrom); + } + if (content.Contains("Expiration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetPatchParametersInternal)this).Expiration = (global::System.DateTime?) content.GetValueForProperty("Expiration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetPatchParametersInternal)this).Expiration, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("JumpHostsAllowed")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetPatchParametersInternal)this).JumpHostsAllowed = (System.Collections.Generic.List) content.GetValueForProperty("JumpHostsAllowed",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetPatchParametersInternal)this).JumpHostsAllowed, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("UserList")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetPatchParametersInternal)this).UserList = (System.Collections.Generic.List) content.GetValueForProperty("UserList",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetPatchParametersInternal)this).UserList, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.KeySetUserTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal BareMetalMachineKeySetPatchParameters(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.NetworkCloud.Models.IBareMetalMachineKeySetPatchParametersInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetPatchProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetPatchParametersInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BareMetalMachineKeySetPatchPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetPatchParametersInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetPatchParametersTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetPatchParametersInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BareMetalMachineKeySetPatchParametersTagsTypeConverter.ConvertFrom); + } + if (content.Contains("Expiration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetPatchParametersInternal)this).Expiration = (global::System.DateTime?) content.GetValueForProperty("Expiration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetPatchParametersInternal)this).Expiration, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("JumpHostsAllowed")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetPatchParametersInternal)this).JumpHostsAllowed = (System.Collections.Generic.List) content.GetValueForProperty("JumpHostsAllowed",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetPatchParametersInternal)this).JumpHostsAllowed, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("UserList")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetPatchParametersInternal)this).UserList = (System.Collections.Generic.List) content.GetValueForProperty("UserList",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetPatchParametersInternal)this).UserList, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.KeySetUserTypeConverter.ConvertFrom)); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetPatchParameters DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new BareMetalMachineKeySetPatchParameters(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.NetworkCloud.Models.IBareMetalMachineKeySetPatchParameters DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new BareMetalMachineKeySetPatchParameters(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.NetworkCloud.Models.IBareMetalMachineKeySetPatchParameters FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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(); + } + } + /// BareMetalMachineKeySetPatchParameters represents the body of the request to patch the bare metal machine key set. + [System.ComponentModel.TypeConverter(typeof(BareMetalMachineKeySetPatchParametersTypeConverter))] + public partial interface IBareMetalMachineKeySetPatchParameters + + { + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineKeySetPatchParameters.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineKeySetPatchParameters.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineKeySetPatchParameters.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineKeySetPatchParameters.TypeConverter.cs index 45ee6d01b1fd..bde1c98dc152 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineKeySetPatchParameters.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineKeySetPatchParameters.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetPatchParameters ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetPatchParameters ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetPatchParameters).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetPatchParameters).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineKeySetPatchParameters.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineKeySetPatchParameters.cs new file mode 100644 index 000000000000..1d147eae7a6e --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineKeySetPatchParameters.cs @@ -0,0 +1,131 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + + /// + /// BareMetalMachineKeySetPatchParameters represents the body of the request to patch the bare metal machine key set. + /// + public partial class BareMetalMachineKeySetPatchParameters : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetPatchParameters, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetPatchParametersInternal + { + + /// + /// The date and time after which the users in this key set will be removed from the bare metal machines. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public global::System.DateTime? Expiration { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetPatchPropertiesInternal)Property).Expiration; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetPatchPropertiesInternal)Property).Expiration = value ?? default(global::System.DateTime); } + + /// + /// The list of IP addresses of jump hosts with management network access from which a login will be allowed for the users. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public System.Collections.Generic.List JumpHostsAllowed { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetPatchPropertiesInternal)Property).JumpHostsAllowed; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetPatchPropertiesInternal)Property).JumpHostsAllowed = value ?? null /* arrayOf */; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetPatchProperties Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetPatchParametersInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BareMetalMachineKeySetPatchProperties()); set { {_property = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetPatchProperties _property; + + /// The list of the resource properties. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetPatchProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BareMetalMachineKeySetPatchProperties()); set => this._property = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetPatchParametersTags _tag; + + /// The Azure resource tags that will replace the existing ones. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetPatchParametersTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BareMetalMachineKeySetPatchParametersTags()); set => this._tag = value; } + + /// The unique list of permitted users. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public System.Collections.Generic.List UserList { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetPatchPropertiesInternal)Property).UserList; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetPatchPropertiesInternal)Property).UserList = value ?? null /* arrayOf */; } + + /// Creates an new instance. + public BareMetalMachineKeySetPatchParameters() + { + + } + } + /// BareMetalMachineKeySetPatchParameters represents the body of the request to patch the bare metal machine key set. + public partial interface IBareMetalMachineKeySetPatchParameters : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable + { + /// + /// The date and time after which the users in this key set will be removed from the bare metal machines. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The date and time after which the users in this key set will be removed from the bare metal machines.", + SerializedName = @"expiration", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? Expiration { get; set; } + /// + /// The list of IP addresses of jump hosts with management network access from which a login will be allowed for the users. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The list of IP addresses of jump hosts with management network access from which a login will be allowed for the users.", + SerializedName = @"jumpHostsAllowed", + PossibleTypes = new [] { typeof(string) })] + System.Collections.Generic.List JumpHostsAllowed { get; set; } + /// The Azure resource tags that will replace the existing ones. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The Azure resource tags that will replace the existing ones.", + SerializedName = @"tags", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetPatchParametersTags) })] + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetPatchParametersTags Tag { get; set; } + /// The unique list of permitted users. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The unique list of permitted users.", + SerializedName = @"userList", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKeySetUser) })] + System.Collections.Generic.List UserList { get; set; } + + } + /// BareMetalMachineKeySetPatchParameters represents the body of the request to patch the bare metal machine key set. + internal partial interface IBareMetalMachineKeySetPatchParametersInternal + + { + /// + /// The date and time after which the users in this key set will be removed from the bare metal machines. + /// + global::System.DateTime? Expiration { get; set; } + /// + /// The list of IP addresses of jump hosts with management network access from which a login will be allowed for the users. + /// + System.Collections.Generic.List JumpHostsAllowed { get; set; } + /// The list of the resource properties. + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetPatchProperties Property { get; set; } + /// The Azure resource tags that will replace the existing ones. + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetPatchParametersTags Tag { get; set; } + /// The unique list of permitted users. + System.Collections.Generic.List UserList { get; set; } + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineKeySetPatchParameters.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineKeySetPatchParameters.json.cs similarity index 93% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineKeySetPatchParameters.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineKeySetPatchParameters.json.cs index 1be12dd4d375..8bb25565adb6 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineKeySetPatchParameters.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineKeySetPatchParameters.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -67,19 +67,19 @@ internal BareMetalMachineKeySetPatchParameters(Microsoft.Azure.PowerShell.Cmdlet { return; } - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BareMetalMachineKeySetPatchProperties.FromJson(__jsonProperties) : Property;} - {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BareMetalMachineKeySetPatchParametersTags.FromJson(__jsonTags) : Tag;} + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BareMetalMachineKeySetPatchProperties.FromJson(__jsonProperties) : _property;} + {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BareMetalMachineKeySetPatchParametersTags.FromJson(__jsonTags) : _tag;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetPatchParameters. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetPatchParameters. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetPatchParameters. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetPatchParameters. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetPatchParameters FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetPatchParameters FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new BareMetalMachineKeySetPatchParameters(json) : null; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineKeySetPatchParametersTags.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineKeySetPatchParametersTags.PowerShell.cs similarity index 88% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineKeySetPatchParametersTags.PowerShell.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineKeySetPatchParametersTags.PowerShell.cs index a1f6c542af62..3944efccc306 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineKeySetPatchParametersTags.PowerShell.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineKeySetPatchParametersTags.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; @@ -63,7 +63,7 @@ public partial class BareMetalMachineKeySetPatchParametersTags 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 BareMetalMachineKeySetPatchParametersTags(global::System.Collections.ID } /// - /// 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 BareMetalMachineKeySetPatchParametersTags(global::System.Management.Aut } /// - /// 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.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetPatchParametersTags DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetPatchParametersTags DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new BareMetalMachineKeySetPatchParametersTags(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.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetPatchParametersTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetPatchParametersTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new BareMetalMachineKeySetPatchParametersTags(content); } @@ -136,7 +136,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201 /// /// an instance of the model class. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetPatchParametersTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetPatchParametersTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineKeySetPatchParametersTags.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineKeySetPatchParametersTags.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineKeySetPatchParametersTags.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineKeySetPatchParametersTags.TypeConverter.cs index b3c0c9694b30..835742ab94e5 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineKeySetPatchParametersTags.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineKeySetPatchParametersTags.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetPatchParametersTags ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetPatchParametersTags ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetPatchParametersTags).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetPatchParametersTags).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineKeySetPatchParametersTags.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineKeySetPatchParametersTags.cs similarity index 83% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineKeySetPatchParametersTags.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineKeySetPatchParametersTags.cs index 917a57b5dae0..7708075b520f 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineKeySetPatchParametersTags.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineKeySetPatchParametersTags.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; /// The Azure resource tags that will replace the existing ones. public partial class BareMetalMachineKeySetPatchParametersTags : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetPatchParametersTags, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetPatchParametersTagsInternal + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetPatchParametersTags, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetPatchParametersTagsInternal { /// diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineKeySetPatchParametersTags.dictionary.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineKeySetPatchParametersTags.dictionary.cs similarity index 96% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineKeySetPatchParametersTags.dictionary.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineKeySetPatchParametersTags.dictionary.cs index 913af96bf534..a95f00092841 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineKeySetPatchParametersTags.dictionary.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineKeySetPatchParametersTags.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.BareMetalMachineKeySetPatchParametersTags source) => source.__additionalProperties; + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BareMetalMachineKeySetPatchParametersTags source) => source.__additionalProperties; } } \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineKeySetPatchParametersTags.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineKeySetPatchParametersTags.json.cs similarity index 95% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineKeySetPatchParametersTags.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineKeySetPatchParametersTags.json.cs index 9078c372adc9..73677ed2b9c1 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineKeySetPatchParametersTags.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineKeySetPatchParametersTags.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -71,13 +71,13 @@ internal BareMetalMachineKeySetPatchParametersTags(Microsoft.Azure.PowerShell.Cm } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetPatchParametersTags. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetPatchParametersTags. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetPatchParametersTags. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetPatchParametersTags. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetPatchParametersTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetPatchParametersTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new BareMetalMachineKeySetPatchParametersTags(json) : null; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineKeySetPatchProperties.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineKeySetPatchProperties.PowerShell.cs new file mode 100644 index 000000000000..064074fcdbec --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineKeySetPatchProperties.PowerShell.cs @@ -0,0 +1,187 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + + /// + /// BareMetalMachineKeySetPatchProperties represents the properties of bare metal machine key set that can be patched. + /// + [System.ComponentModel.TypeConverter(typeof(BareMetalMachineKeySetPatchPropertiesTypeConverter))] + public partial class BareMetalMachineKeySetPatchProperties + { + + /// + /// 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 BareMetalMachineKeySetPatchProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Expiration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetPatchPropertiesInternal)this).Expiration = (global::System.DateTime?) content.GetValueForProperty("Expiration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetPatchPropertiesInternal)this).Expiration, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("JumpHostsAllowed")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetPatchPropertiesInternal)this).JumpHostsAllowed = (System.Collections.Generic.List) content.GetValueForProperty("JumpHostsAllowed",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetPatchPropertiesInternal)this).JumpHostsAllowed, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("UserList")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetPatchPropertiesInternal)this).UserList = (System.Collections.Generic.List) content.GetValueForProperty("UserList",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetPatchPropertiesInternal)this).UserList, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.KeySetUserTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal BareMetalMachineKeySetPatchProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Expiration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetPatchPropertiesInternal)this).Expiration = (global::System.DateTime?) content.GetValueForProperty("Expiration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetPatchPropertiesInternal)this).Expiration, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("JumpHostsAllowed")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetPatchPropertiesInternal)this).JumpHostsAllowed = (System.Collections.Generic.List) content.GetValueForProperty("JumpHostsAllowed",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetPatchPropertiesInternal)this).JumpHostsAllowed, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("UserList")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetPatchPropertiesInternal)this).UserList = (System.Collections.Generic.List) content.GetValueForProperty("UserList",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetPatchPropertiesInternal)this).UserList, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.KeySetUserTypeConverter.ConvertFrom)); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetPatchProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new BareMetalMachineKeySetPatchProperties(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.NetworkCloud.Models.IBareMetalMachineKeySetPatchProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new BareMetalMachineKeySetPatchProperties(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.NetworkCloud.Models.IBareMetalMachineKeySetPatchProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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(); + } + } + /// BareMetalMachineKeySetPatchProperties represents the properties of bare metal machine key set that can be patched. + [System.ComponentModel.TypeConverter(typeof(BareMetalMachineKeySetPatchPropertiesTypeConverter))] + public partial interface IBareMetalMachineKeySetPatchProperties + + { + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineKeySetPatchProperties.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineKeySetPatchProperties.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineKeySetPatchProperties.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineKeySetPatchProperties.TypeConverter.cs index 1b73cca0b6cc..c1b15ee02007 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineKeySetPatchProperties.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineKeySetPatchProperties.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetPatchProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetPatchProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetPatchProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetPatchProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineKeySetPatchProperties.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineKeySetPatchProperties.cs similarity index 76% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineKeySetPatchProperties.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineKeySetPatchProperties.cs index ce7ac725b206..39a72aab5c2c 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineKeySetPatchProperties.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineKeySetPatchProperties.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -11,8 +11,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201 /// BareMetalMachineKeySetPatchProperties represents the properties of bare metal machine key set that can be patched. /// public partial class BareMetalMachineKeySetPatchProperties : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetPatchProperties, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetPatchPropertiesInternal + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetPatchProperties, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetPatchPropertiesInternal { /// Backing field for property. @@ -25,20 +25,20 @@ public partial class BareMetalMachineKeySetPatchProperties : public global::System.DateTime? Expiration { get => this._expiration; set => this._expiration = value; } /// Backing field for property. - private string[] _jumpHostsAllowed; + private System.Collections.Generic.List _jumpHostsAllowed; /// /// The list of IP addresses of jump hosts with management network access from which a login will be allowed for the users. /// [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string[] JumpHostsAllowed { get => this._jumpHostsAllowed; set => this._jumpHostsAllowed = value; } + public System.Collections.Generic.List JumpHostsAllowed { get => this._jumpHostsAllowed; set => this._jumpHostsAllowed = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKeySetUser[] _userList; + private System.Collections.Generic.List _userList; /// The unique list of permitted users. [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKeySetUser[] UserList { get => this._userList; set => this._userList = value; } + public System.Collections.Generic.List UserList { get => this._userList; set => this._userList = value; } /// Creates an new instance. public BareMetalMachineKeySetPatchProperties() @@ -56,6 +56,9 @@ public partial interface IBareMetalMachineKeySetPatchProperties : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The date and time after which the users in this key set will be removed from the bare metal machines.", SerializedName = @"expiration", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -66,18 +69,24 @@ public partial interface IBareMetalMachineKeySetPatchProperties : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The list of IP addresses of jump hosts with management network access from which a login will be allowed for the users.", SerializedName = @"jumpHostsAllowed", PossibleTypes = new [] { typeof(string) })] - string[] JumpHostsAllowed { get; set; } + System.Collections.Generic.List JumpHostsAllowed { get; set; } /// The unique list of permitted users. [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The unique list of permitted users.", SerializedName = @"userList", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKeySetUser) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKeySetUser[] UserList { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKeySetUser) })] + System.Collections.Generic.List UserList { get; set; } } /// BareMetalMachineKeySetPatchProperties represents the properties of bare metal machine key set that can be patched. @@ -91,9 +100,9 @@ internal partial interface IBareMetalMachineKeySetPatchPropertiesInternal /// /// The list of IP addresses of jump hosts with management network access from which a login will be allowed for the users. /// - string[] JumpHostsAllowed { get; set; } + System.Collections.Generic.List JumpHostsAllowed { get; set; } /// The unique list of permitted users. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKeySetUser[] UserList { get; set; } + System.Collections.Generic.List UserList { get; set; } } } \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineKeySetPatchProperties.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineKeySetPatchProperties.json.cs similarity index 89% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineKeySetPatchProperties.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineKeySetPatchProperties.json.cs index 3a8186a96248..03f4ee937a20 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineKeySetPatchProperties.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineKeySetPatchProperties.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -67,20 +67,20 @@ internal BareMetalMachineKeySetPatchProperties(Microsoft.Azure.PowerShell.Cmdlet { return; } - {_expiration = If( json?.PropertyT("expiration"), out var __jsonExpiration) ? global::System.DateTime.TryParse((string)__jsonExpiration, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonExpirationValue) ? __jsonExpirationValue : Expiration : Expiration;} - {_jumpHostsAllowed = If( json?.PropertyT("jumpHostsAllowed"), out var __jsonJumpHostsAllowed) ? If( __jsonJumpHostsAllowed as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : JumpHostsAllowed;} - {_userList = If( json?.PropertyT("userList"), out var __jsonUserList) ? If( __jsonUserList as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IKeySetUser) (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.KeySetUser.FromJson(__p) )) ))() : null : UserList;} + {_expiration = If( json?.PropertyT("expiration"), out var __jsonExpiration) ? global::System.DateTime.TryParse((string)__jsonExpiration, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonExpirationValue) ? __jsonExpirationValue : _expiration : _expiration;} + {_jumpHostsAllowed = If( json?.PropertyT("jumpHostsAllowed"), out var __jsonJumpHostsAllowed) ? If( __jsonJumpHostsAllowed as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : _jumpHostsAllowed;} + {_userList = If( json?.PropertyT("userList"), out var __jsonUserList) ? If( __jsonUserList as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.IKeySetUser) (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.KeySetUser.FromJson(__p) )) ))() : null : _userList;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetPatchProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetPatchProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetPatchProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetPatchProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetPatchProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetPatchProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new BareMetalMachineKeySetPatchProperties(json) : null; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineKeySetProperties.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineKeySetProperties.PowerShell.cs new file mode 100644 index 000000000000..db134615b7de --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineKeySetProperties.PowerShell.cs @@ -0,0 +1,246 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + + /// + /// BareMetalMachineKeySetProperties represents the properties of bare metal machine key set. + /// + [System.ComponentModel.TypeConverter(typeof(BareMetalMachineKeySetPropertiesTypeConverter))] + public partial class BareMetalMachineKeySetProperties + { + + /// + /// 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 BareMetalMachineKeySetProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("AzureGroupId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetPropertiesInternal)this).AzureGroupId = (string) content.GetValueForProperty("AzureGroupId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetPropertiesInternal)this).AzureGroupId, global::System.Convert.ToString); + } + if (content.Contains("DetailedStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetPropertiesInternal)this).DetailedStatus = (string) content.GetValueForProperty("DetailedStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetPropertiesInternal)this).DetailedStatus, global::System.Convert.ToString); + } + if (content.Contains("DetailedStatusMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetPropertiesInternal)this).DetailedStatusMessage = (string) content.GetValueForProperty("DetailedStatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetPropertiesInternal)this).DetailedStatusMessage, global::System.Convert.ToString); + } + if (content.Contains("Expiration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetPropertiesInternal)this).Expiration = (global::System.DateTime) content.GetValueForProperty("Expiration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetPropertiesInternal)this).Expiration, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("JumpHostsAllowed")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetPropertiesInternal)this).JumpHostsAllowed = (System.Collections.Generic.List) content.GetValueForProperty("JumpHostsAllowed",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetPropertiesInternal)this).JumpHostsAllowed, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("LastValidation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetPropertiesInternal)this).LastValidation = (global::System.DateTime?) content.GetValueForProperty("LastValidation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetPropertiesInternal)this).LastValidation, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("OSGroupName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetPropertiesInternal)this).OSGroupName = (string) content.GetValueForProperty("OSGroupName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetPropertiesInternal)this).OSGroupName, global::System.Convert.ToString); + } + if (content.Contains("PrivilegeLevel")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetPropertiesInternal)this).PrivilegeLevel = (string) content.GetValueForProperty("PrivilegeLevel",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetPropertiesInternal)this).PrivilegeLevel, global::System.Convert.ToString); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetPropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetPropertiesInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("UserList")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetPropertiesInternal)this).UserList = (System.Collections.Generic.List) content.GetValueForProperty("UserList",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetPropertiesInternal)this).UserList, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.KeySetUserTypeConverter.ConvertFrom)); + } + if (content.Contains("UserListStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetPropertiesInternal)this).UserListStatus = (System.Collections.Generic.List) content.GetValueForProperty("UserListStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetPropertiesInternal)this).UserListStatus, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.KeySetUserStatusTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal BareMetalMachineKeySetProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("AzureGroupId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetPropertiesInternal)this).AzureGroupId = (string) content.GetValueForProperty("AzureGroupId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetPropertiesInternal)this).AzureGroupId, global::System.Convert.ToString); + } + if (content.Contains("DetailedStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetPropertiesInternal)this).DetailedStatus = (string) content.GetValueForProperty("DetailedStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetPropertiesInternal)this).DetailedStatus, global::System.Convert.ToString); + } + if (content.Contains("DetailedStatusMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetPropertiesInternal)this).DetailedStatusMessage = (string) content.GetValueForProperty("DetailedStatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetPropertiesInternal)this).DetailedStatusMessage, global::System.Convert.ToString); + } + if (content.Contains("Expiration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetPropertiesInternal)this).Expiration = (global::System.DateTime) content.GetValueForProperty("Expiration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetPropertiesInternal)this).Expiration, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("JumpHostsAllowed")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetPropertiesInternal)this).JumpHostsAllowed = (System.Collections.Generic.List) content.GetValueForProperty("JumpHostsAllowed",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetPropertiesInternal)this).JumpHostsAllowed, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("LastValidation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetPropertiesInternal)this).LastValidation = (global::System.DateTime?) content.GetValueForProperty("LastValidation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetPropertiesInternal)this).LastValidation, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("OSGroupName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetPropertiesInternal)this).OSGroupName = (string) content.GetValueForProperty("OSGroupName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetPropertiesInternal)this).OSGroupName, global::System.Convert.ToString); + } + if (content.Contains("PrivilegeLevel")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetPropertiesInternal)this).PrivilegeLevel = (string) content.GetValueForProperty("PrivilegeLevel",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetPropertiesInternal)this).PrivilegeLevel, global::System.Convert.ToString); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetPropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetPropertiesInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("UserList")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetPropertiesInternal)this).UserList = (System.Collections.Generic.List) content.GetValueForProperty("UserList",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetPropertiesInternal)this).UserList, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.KeySetUserTypeConverter.ConvertFrom)); + } + if (content.Contains("UserListStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetPropertiesInternal)this).UserListStatus = (System.Collections.Generic.List) content.GetValueForProperty("UserListStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetPropertiesInternal)this).UserListStatus, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.KeySetUserStatusTypeConverter.ConvertFrom)); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new BareMetalMachineKeySetProperties(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.NetworkCloud.Models.IBareMetalMachineKeySetProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new BareMetalMachineKeySetProperties(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.NetworkCloud.Models.IBareMetalMachineKeySetProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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(); + } + } + /// BareMetalMachineKeySetProperties represents the properties of bare metal machine key set. + [System.ComponentModel.TypeConverter(typeof(BareMetalMachineKeySetPropertiesTypeConverter))] + public partial interface IBareMetalMachineKeySetProperties + + { + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineKeySetProperties.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineKeySetProperties.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineKeySetProperties.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineKeySetProperties.TypeConverter.cs index 6bbb719176fc..43fa19da049d 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineKeySetProperties.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineKeySetProperties.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineKeySetProperties.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineKeySetProperties.cs new file mode 100644 index 000000000000..797521f1e163 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineKeySetProperties.cs @@ -0,0 +1,304 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + + /// + /// BareMetalMachineKeySetProperties represents the properties of bare metal machine key set. + /// + public partial class BareMetalMachineKeySetProperties : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetProperties, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetPropertiesInternal + { + + /// Backing field for property. + private string _azureGroupId; + + /// + /// The object ID of Azure Active Directory group that all users in the list must be in for access to be granted. Users that + /// are not in the group will not have access. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string AzureGroupId { get => this._azureGroupId; set => this._azureGroupId = value; } + + /// Backing field for property. + private string _detailedStatus; + + /// The more detailed status of the key set. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string DetailedStatus { get => this._detailedStatus; } + + /// Backing field for property. + private string _detailedStatusMessage; + + /// The descriptive message about the current detailed status. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string DetailedStatusMessage { get => this._detailedStatusMessage; } + + /// Backing field for property. + private global::System.DateTime _expiration; + + /// + /// The date and time after which the users in this key set will be removed from the bare metal machines. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public global::System.DateTime Expiration { get => this._expiration; set => this._expiration = value; } + + /// Backing field for property. + private System.Collections.Generic.List _jumpHostsAllowed; + + /// + /// The list of IP addresses of jump hosts with management network access from which a login will be allowed for the users. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public System.Collections.Generic.List JumpHostsAllowed { get => this._jumpHostsAllowed; set => this._jumpHostsAllowed = value; } + + /// Backing field for property. + private global::System.DateTime? _lastValidation; + + /// The last time this key set was validated. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public global::System.DateTime? LastValidation { get => this._lastValidation; } + + /// Internal Acessors for DetailedStatus + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetPropertiesInternal.DetailedStatus { get => this._detailedStatus; set { {_detailedStatus = value;} } } + + /// Internal Acessors for DetailedStatusMessage + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetPropertiesInternal.DetailedStatusMessage { get => this._detailedStatusMessage; set { {_detailedStatusMessage = value;} } } + + /// Internal Acessors for LastValidation + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetPropertiesInternal.LastValidation { get => this._lastValidation; set { {_lastValidation = value;} } } + + /// Internal Acessors for ProvisioningState + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetPropertiesInternal.ProvisioningState { get => this._provisioningState; set { {_provisioningState = value;} } } + + /// Internal Acessors for UserListStatus + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetPropertiesInternal.UserListStatus { get => this._userListStatus; set { {_userListStatus = value;} } } + + /// Backing field for property. + private string _oSGroupName; + + /// + /// The name of the group that users will be assigned to on the operating system of the machines. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string OSGroupName { get => this._oSGroupName; set => this._oSGroupName = value; } + + /// Backing field for property. + private string _privilegeLevel; + + /// The access level allowed for the users in this key set. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string PrivilegeLevel { get => this._privilegeLevel; set => this._privilegeLevel = value; } + + /// Backing field for property. + private string _provisioningState; + + /// The provisioning state of the bare metal machine key set. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string ProvisioningState { get => this._provisioningState; } + + /// Backing field for property. + private System.Collections.Generic.List _userList; + + /// The unique list of permitted users. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public System.Collections.Generic.List UserList { get => this._userList; set => this._userList = value; } + + /// Backing field for property. + private System.Collections.Generic.List _userListStatus; + + /// The status evaluation of each user. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public System.Collections.Generic.List UserListStatus { get => this._userListStatus; } + + /// Creates an new instance. + public BareMetalMachineKeySetProperties() + { + + } + } + /// BareMetalMachineKeySetProperties represents the properties of bare metal machine key set. + public partial interface IBareMetalMachineKeySetProperties : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable + { + /// + /// The object ID of Azure Active Directory group that all users in the list must be in for access to be granted. Users that + /// are not in the group will not have access. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The object ID of Azure Active Directory group that all users in the list must be in for access to be granted. Users that are not in the group will not have access.", + SerializedName = @"azureGroupId", + PossibleTypes = new [] { typeof(string) })] + string AzureGroupId { get; set; } + /// The more detailed status of the key set. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The more detailed status of the key set.", + SerializedName = @"detailedStatus", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("AllActive", "SomeInvalid", "AllInvalid", "Validating")] + string DetailedStatus { get; } + /// The descriptive message about the current detailed status. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The descriptive message about the current detailed status.", + SerializedName = @"detailedStatusMessage", + PossibleTypes = new [] { typeof(string) })] + string DetailedStatusMessage { get; } + /// + /// The date and time after which the users in this key set will be removed from the bare metal machines. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The date and time after which the users in this key set will be removed from the bare metal machines.", + SerializedName = @"expiration", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime Expiration { get; set; } + /// + /// The list of IP addresses of jump hosts with management network access from which a login will be allowed for the users. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The list of IP addresses of jump hosts with management network access from which a login will be allowed for the users.", + SerializedName = @"jumpHostsAllowed", + PossibleTypes = new [] { typeof(string) })] + System.Collections.Generic.List JumpHostsAllowed { get; set; } + /// The last time this key set was validated. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The last time this key set was validated.", + SerializedName = @"lastValidation", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? LastValidation { get; } + /// + /// The name of the group that users will be assigned to on the operating system of the machines. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The name of the group that users will be assigned to on the operating system of the machines.", + SerializedName = @"osGroupName", + PossibleTypes = new [] { typeof(string) })] + string OSGroupName { get; set; } + /// The access level allowed for the users in this key set. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The access level allowed for the users in this key set.", + SerializedName = @"privilegeLevel", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Standard", "Superuser")] + string PrivilegeLevel { get; set; } + /// The provisioning state of the bare metal machine key set. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The provisioning state of the bare metal machine key set.", + SerializedName = @"provisioningState", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Succeeded", "Failed", "Canceled", "Accepted", "Provisioning")] + string ProvisioningState { get; } + /// The unique list of permitted users. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The unique list of permitted users.", + SerializedName = @"userList", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKeySetUser) })] + System.Collections.Generic.List UserList { get; set; } + /// The status evaluation of each user. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The status evaluation of each user.", + SerializedName = @"userListStatus", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKeySetUserStatus) })] + System.Collections.Generic.List UserListStatus { get; } + + } + /// BareMetalMachineKeySetProperties represents the properties of bare metal machine key set. + internal partial interface IBareMetalMachineKeySetPropertiesInternal + + { + /// + /// The object ID of Azure Active Directory group that all users in the list must be in for access to be granted. Users that + /// are not in the group will not have access. + /// + string AzureGroupId { get; set; } + /// The more detailed status of the key set. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("AllActive", "SomeInvalid", "AllInvalid", "Validating")] + string DetailedStatus { get; set; } + /// The descriptive message about the current detailed status. + string DetailedStatusMessage { get; set; } + /// + /// The date and time after which the users in this key set will be removed from the bare metal machines. + /// + global::System.DateTime Expiration { get; set; } + /// + /// The list of IP addresses of jump hosts with management network access from which a login will be allowed for the users. + /// + System.Collections.Generic.List JumpHostsAllowed { get; set; } + /// The last time this key set was validated. + global::System.DateTime? LastValidation { get; set; } + /// + /// The name of the group that users will be assigned to on the operating system of the machines. + /// + string OSGroupName { get; set; } + /// The access level allowed for the users in this key set. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Standard", "Superuser")] + string PrivilegeLevel { get; set; } + /// The provisioning state of the bare metal machine key set. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Succeeded", "Failed", "Canceled", "Accepted", "Provisioning")] + string ProvisioningState { get; set; } + /// The unique list of permitted users. + System.Collections.Generic.List UserList { get; set; } + /// The status evaluation of each user. + System.Collections.Generic.List UserListStatus { get; set; } + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineKeySetProperties.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineKeySetProperties.json.cs similarity index 76% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineKeySetProperties.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineKeySetProperties.json.cs index 124bc26a7f2f..11800d1df23e 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineKeySetProperties.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineKeySetProperties.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -67,28 +67,28 @@ internal BareMetalMachineKeySetProperties(Microsoft.Azure.PowerShell.Cmdlets.Net { return; } - {_azureGroupId = If( json?.PropertyT("azureGroupId"), out var __jsonAzureGroupId) ? (string)__jsonAzureGroupId : (string)AzureGroupId;} - {_detailedStatus = If( json?.PropertyT("detailedStatus"), out var __jsonDetailedStatus) ? (string)__jsonDetailedStatus : (string)DetailedStatus;} - {_detailedStatusMessage = If( json?.PropertyT("detailedStatusMessage"), out var __jsonDetailedStatusMessage) ? (string)__jsonDetailedStatusMessage : (string)DetailedStatusMessage;} - {_expiration = If( json?.PropertyT("expiration"), out var __jsonExpiration) ? global::System.DateTime.TryParse((string)__jsonExpiration, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonExpirationValue) ? __jsonExpirationValue : Expiration : Expiration;} - {_jumpHostsAllowed = If( json?.PropertyT("jumpHostsAllowed"), out var __jsonJumpHostsAllowed) ? If( __jsonJumpHostsAllowed as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : JumpHostsAllowed;} - {_lastValidation = If( json?.PropertyT("lastValidation"), out var __jsonLastValidation) ? global::System.DateTime.TryParse((string)__jsonLastValidation, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonLastValidationValue) ? __jsonLastValidationValue : LastValidation : LastValidation;} - {_oSGroupName = If( json?.PropertyT("osGroupName"), out var __jsonOSGroupName) ? (string)__jsonOSGroupName : (string)OSGroupName;} - {_privilegeLevel = If( json?.PropertyT("privilegeLevel"), out var __jsonPrivilegeLevel) ? (string)__jsonPrivilegeLevel : (string)PrivilegeLevel;} - {_provisioningState = If( json?.PropertyT("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)ProvisioningState;} - {_userList = If( json?.PropertyT("userList"), out var __jsonUserList) ? If( __jsonUserList as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IKeySetUser) (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.KeySetUser.FromJson(__p) )) ))() : null : UserList;} - {_userListStatus = If( json?.PropertyT("userListStatus"), out var __jsonUserListStatus) ? If( __jsonUserListStatus as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonArray, out var __l) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__l, (__k)=>(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKeySetUserStatus) (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.KeySetUserStatus.FromJson(__k) )) ))() : null : UserListStatus;} + {_azureGroupId = If( json?.PropertyT("azureGroupId"), out var __jsonAzureGroupId) ? (string)__jsonAzureGroupId : (string)_azureGroupId;} + {_detailedStatus = If( json?.PropertyT("detailedStatus"), out var __jsonDetailedStatus) ? (string)__jsonDetailedStatus : (string)_detailedStatus;} + {_detailedStatusMessage = If( json?.PropertyT("detailedStatusMessage"), out var __jsonDetailedStatusMessage) ? (string)__jsonDetailedStatusMessage : (string)_detailedStatusMessage;} + {_expiration = If( json?.PropertyT("expiration"), out var __jsonExpiration) ? global::System.DateTime.TryParse((string)__jsonExpiration, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonExpirationValue) ? __jsonExpirationValue : _expiration : _expiration;} + {_jumpHostsAllowed = If( json?.PropertyT("jumpHostsAllowed"), out var __jsonJumpHostsAllowed) ? If( __jsonJumpHostsAllowed as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : _jumpHostsAllowed;} + {_lastValidation = If( json?.PropertyT("lastValidation"), out var __jsonLastValidation) ? global::System.DateTime.TryParse((string)__jsonLastValidation, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonLastValidationValue) ? __jsonLastValidationValue : _lastValidation : _lastValidation;} + {_oSGroupName = If( json?.PropertyT("osGroupName"), out var __jsonOSGroupName) ? (string)__jsonOSGroupName : (string)_oSGroupName;} + {_privilegeLevel = If( json?.PropertyT("privilegeLevel"), out var __jsonPrivilegeLevel) ? (string)__jsonPrivilegeLevel : (string)_privilegeLevel;} + {_provisioningState = If( json?.PropertyT("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)_provisioningState;} + {_userList = If( json?.PropertyT("userList"), out var __jsonUserList) ? If( __jsonUserList as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.IKeySetUser) (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.KeySetUser.FromJson(__p) )) ))() : null : _userList;} + {_userListStatus = If( json?.PropertyT("userListStatus"), out var __jsonUserListStatus) ? If( __jsonUserListStatus as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonArray, out var __l) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__l, (__k)=>(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKeySetUserStatus) (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.KeySetUserStatus.FromJson(__k) )) ))() : null : _userListStatus;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new BareMetalMachineKeySetProperties(json) : null; } @@ -112,12 +112,15 @@ public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode ToJ { return container; } - AddIf( null != (((object)this._azureGroupId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._azureGroupId.ToString()) : null, "azureGroupId" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)||serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate)) + { + AddIf( null != (((object)this._azureGroupId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._azureGroupId.ToString()) : null, "azureGroupId" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._detailedStatus)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._detailedStatus.ToString()) : null, "detailedStatus" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._detailedStatusMessage)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._detailedStatusMessage.ToString()) : null, "detailedStatusMessage" ,container.Add ); } @@ -131,13 +134,19 @@ public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode ToJ } container.Add("jumpHostsAllowed",__w); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != this._lastValidation ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._lastValidation?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "lastValidation" ,container.Add ); } - AddIf( null != (((object)this._oSGroupName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._oSGroupName.ToString()) : null, "osGroupName" ,container.Add ); - AddIf( null != (((object)this._privilegeLevel)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._privilegeLevel.ToString()) : null, "privilegeLevel" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)||serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate)) + { + AddIf( null != (((object)this._oSGroupName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._oSGroupName.ToString()) : null, "osGroupName" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)||serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate)) + { + AddIf( null != (((object)this._privilegeLevel)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._privilegeLevel.ToString()) : null, "privilegeLevel" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._provisioningState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._provisioningState.ToString()) : null, "provisioningState" ,container.Add ); } @@ -150,7 +159,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode ToJ } container.Add("userList",__r); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { if (null != this._userListStatus) { diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineList.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineList.PowerShell.cs similarity index 76% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineList.PowerShell.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineList.PowerShell.cs index 9dbc987d4b7e..485b093962b1 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineList.PowerShell.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineList.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; @@ -63,7 +63,7 @@ public partial class BareMetalMachineList 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 BareMetalMachineList(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineListInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineListInternal)this).NextLink, global::System.Convert.ToString); } if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachine[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BareMetalMachineTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineListInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineListInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BareMetalMachineTypeConverter.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,37 +103,37 @@ internal BareMetalMachineList(global::System.Management.Automation.PSObject cont // actually deserialize if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineListInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineListInternal)this).NextLink, global::System.Convert.ToString); } if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachine[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BareMetalMachineTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineListInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineListInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BareMetalMachineTypeConverter.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.NetworkCloud.Models.Api20250201.IBareMetalMachineList DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineList DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new BareMetalMachineList(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.NetworkCloud.Models.Api20250201.IBareMetalMachineList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new BareMetalMachineList(content); } @@ -143,7 +143,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineList.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineList.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineList.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineList.TypeConverter.cs index 514f1a4c178c..6ff4abcab195 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineList.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineList.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IBareMetalMachineList ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineList ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineList).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineList).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineList.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineList.cs new file mode 100644 index 000000000000..293bfe0057f4 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineList.cs @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + + /// BareMetalMachineList represents a list of bare metal machines. + public partial class BareMetalMachineList : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineList, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineListInternal + { + + /// Backing field for property. + private string _nextLink; + + /// The link used to get the next page of operations. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; set => this._nextLink = value; } + + /// Backing field for property. + private System.Collections.Generic.List _value; + + /// The list of bare metal machines. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public System.Collections.Generic.List Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public BareMetalMachineList() + { + + } + } + /// BareMetalMachineList represents a list of bare metal machines. + public partial interface IBareMetalMachineList : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable + { + /// The link used to get the next page of operations. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The link used to get the next page of operations.", + SerializedName = @"nextLink", + PossibleTypes = new [] { typeof(string) })] + string NextLink { get; set; } + /// The list of bare metal machines. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The list of bare metal machines.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachine) })] + System.Collections.Generic.List Value { get; set; } + + } + /// BareMetalMachineList represents a list of bare metal machines. + internal partial interface IBareMetalMachineListInternal + + { + /// The link used to get the next page of operations. + string NextLink { get; set; } + /// The list of bare metal machines. + System.Collections.Generic.List Value { get; set; } + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineList.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineList.json.cs similarity index 90% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineList.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineList.json.cs index f35e9a0acfc9..50b26e8e4a8e 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineList.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineList.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -65,19 +65,19 @@ internal BareMetalMachineList(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Ru { return; } - {_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.NetworkCloud.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.NetworkCloud.Models.Api20250201.IBareMetalMachine) (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BareMetalMachine.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.NetworkCloud.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.NetworkCloud.Models.IBareMetalMachine) (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BareMetalMachine.FromJson(__u) )) ))() : null : _value;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineList. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineList. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineList. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineList. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineList FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineList FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new BareMetalMachineList(json) : null; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachinePatchParameters.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachinePatchParameters.PowerShell.cs new file mode 100644 index 000000000000..8927841edf3b --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachinePatchParameters.PowerShell.cs @@ -0,0 +1,182 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + + /// + /// BareMetalMachinePatchParameters represents the body of the request to patch bare metal machine properties. + /// + [System.ComponentModel.TypeConverter(typeof(BareMetalMachinePatchParametersTypeConverter))] + public partial class BareMetalMachinePatchParameters + { + + /// + /// 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 BareMetalMachinePatchParameters(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.NetworkCloud.Models.IBareMetalMachinePatchParametersInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePatchProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePatchParametersInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BareMetalMachinePatchPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePatchParametersInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePatchParametersTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePatchParametersInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BareMetalMachinePatchParametersTagsTypeConverter.ConvertFrom); + } + if (content.Contains("MachineDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePatchParametersInternal)this).MachineDetail = (string) content.GetValueForProperty("MachineDetail",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePatchParametersInternal)this).MachineDetail, 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 BareMetalMachinePatchParameters(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.NetworkCloud.Models.IBareMetalMachinePatchParametersInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePatchProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePatchParametersInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BareMetalMachinePatchPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePatchParametersInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePatchParametersTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePatchParametersInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BareMetalMachinePatchParametersTagsTypeConverter.ConvertFrom); + } + if (content.Contains("MachineDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePatchParametersInternal)this).MachineDetail = (string) content.GetValueForProperty("MachineDetail",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePatchParametersInternal)this).MachineDetail, 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.NetworkCloud.Models.IBareMetalMachinePatchParameters DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new BareMetalMachinePatchParameters(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.NetworkCloud.Models.IBareMetalMachinePatchParameters DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new BareMetalMachinePatchParameters(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.NetworkCloud.Models.IBareMetalMachinePatchParameters FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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(); + } + } + /// BareMetalMachinePatchParameters represents the body of the request to patch bare metal machine properties. + [System.ComponentModel.TypeConverter(typeof(BareMetalMachinePatchParametersTypeConverter))] + public partial interface IBareMetalMachinePatchParameters + + { + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachinePatchParameters.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachinePatchParameters.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachinePatchParameters.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachinePatchParameters.TypeConverter.cs index 54fa1f063ebe..c3a30847f00a 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachinePatchParameters.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachinePatchParameters.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IBareMetalMachinePatchParameters ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePatchParameters ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePatchParameters).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePatchParameters).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachinePatchParameters.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachinePatchParameters.cs new file mode 100644 index 000000000000..32c08ced3d1d --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachinePatchParameters.cs @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + + /// + /// BareMetalMachinePatchParameters represents the body of the request to patch bare metal machine properties. + /// + public partial class BareMetalMachinePatchParameters : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePatchParameters, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePatchParametersInternal + { + + /// + /// The details provided by the customer during the creation of rack manifests that allows for custom data to be associated + /// with this machine. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string MachineDetail { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePatchPropertiesInternal)Property).MachineDetail; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePatchPropertiesInternal)Property).MachineDetail = value ?? null; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePatchProperties Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePatchParametersInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BareMetalMachinePatchProperties()); set { {_property = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePatchProperties _property; + + /// The list of the resource properties. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePatchProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BareMetalMachinePatchProperties()); set => this._property = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePatchParametersTags _tag; + + /// The Azure resource tags that will replace the existing ones. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePatchParametersTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BareMetalMachinePatchParametersTags()); set => this._tag = value; } + + /// Creates an new instance. + public BareMetalMachinePatchParameters() + { + + } + } + /// BareMetalMachinePatchParameters represents the body of the request to patch bare metal machine properties. + public partial interface IBareMetalMachinePatchParameters : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable + { + /// + /// The details provided by the customer during the creation of rack manifests that allows for custom data to be associated + /// with this machine. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The details provided by the customer during the creation of rack manifests that allows for custom data to be associated with this machine.", + SerializedName = @"machineDetails", + PossibleTypes = new [] { typeof(string) })] + string MachineDetail { get; set; } + /// The Azure resource tags that will replace the existing ones. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The Azure resource tags that will replace the existing ones.", + SerializedName = @"tags", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePatchParametersTags) })] + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePatchParametersTags Tag { get; set; } + + } + /// BareMetalMachinePatchParameters represents the body of the request to patch bare metal machine properties. + internal partial interface IBareMetalMachinePatchParametersInternal + + { + /// + /// The details provided by the customer during the creation of rack manifests that allows for custom data to be associated + /// with this machine. + /// + string MachineDetail { get; set; } + /// The list of the resource properties. + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePatchProperties Property { get; set; } + /// The Azure resource tags that will replace the existing ones. + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePatchParametersTags Tag { get; set; } + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachinePatchParameters.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachinePatchParameters.json.cs similarity index 93% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachinePatchParameters.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachinePatchParameters.json.cs index 6947f3a759ff..03e63f2be2d8 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachinePatchParameters.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachinePatchParameters.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -67,19 +67,19 @@ internal BareMetalMachinePatchParameters(Microsoft.Azure.PowerShell.Cmdlets.Netw { return; } - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BareMetalMachinePatchProperties.FromJson(__jsonProperties) : Property;} - {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BareMetalMachinePatchParametersTags.FromJson(__jsonTags) : Tag;} + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BareMetalMachinePatchProperties.FromJson(__jsonProperties) : _property;} + {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BareMetalMachinePatchParametersTags.FromJson(__jsonTags) : _tag;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePatchParameters. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePatchParameters. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePatchParameters. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePatchParameters. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePatchParameters FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePatchParameters FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new BareMetalMachinePatchParameters(json) : null; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachinePatchParametersTags.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachinePatchParametersTags.PowerShell.cs similarity index 89% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachinePatchParametersTags.PowerShell.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachinePatchParametersTags.PowerShell.cs index 05bb6050811e..4f7e44877df6 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachinePatchParametersTags.PowerShell.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachinePatchParametersTags.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; @@ -63,7 +63,7 @@ public partial class BareMetalMachinePatchParametersTags 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 BareMetalMachinePatchParametersTags(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. @@ -101,29 +101,29 @@ internal BareMetalMachinePatchParametersTags(global::System.Management.Automatio } /// - /// 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.NetworkCloud.Models.Api20250201.IBareMetalMachinePatchParametersTags DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePatchParametersTags DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new BareMetalMachinePatchParametersTags(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.NetworkCloud.Models.Api20250201.IBareMetalMachinePatchParametersTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePatchParametersTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new BareMetalMachinePatchParametersTags(content); } @@ -135,7 +135,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201 /// /// an instance of the model class. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePatchParametersTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePatchParametersTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachinePatchParametersTags.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachinePatchParametersTags.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachinePatchParametersTags.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachinePatchParametersTags.TypeConverter.cs index b13c7a857f14..dbaa85b4cdf7 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachinePatchParametersTags.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachinePatchParametersTags.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IBareMetalMachinePatchParametersTags ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePatchParametersTags ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePatchParametersTags).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePatchParametersTags).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachinePatchParametersTags.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachinePatchParametersTags.cs similarity index 83% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachinePatchParametersTags.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachinePatchParametersTags.cs index c27f111e2472..d7d9e43cd620 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachinePatchParametersTags.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachinePatchParametersTags.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; /// The Azure resource tags that will replace the existing ones. public partial class BareMetalMachinePatchParametersTags : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePatchParametersTags, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePatchParametersTagsInternal + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePatchParametersTags, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePatchParametersTagsInternal { /// Creates an new instance. diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachinePatchParametersTags.dictionary.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachinePatchParametersTags.dictionary.cs similarity index 96% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachinePatchParametersTags.dictionary.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachinePatchParametersTags.dictionary.cs index ceab4da464ac..d553cfb2d626 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachinePatchParametersTags.dictionary.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachinePatchParametersTags.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.BareMetalMachinePatchParametersTags source) => source.__additionalProperties; + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BareMetalMachinePatchParametersTags source) => source.__additionalProperties; } } \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachinePatchParametersTags.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachinePatchParametersTags.json.cs similarity index 95% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachinePatchParametersTags.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachinePatchParametersTags.json.cs index 31a6cc100ea4..46382c7205b9 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachinePatchParametersTags.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachinePatchParametersTags.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -71,13 +71,13 @@ internal BareMetalMachinePatchParametersTags(Microsoft.Azure.PowerShell.Cmdlets. } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePatchParametersTags. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePatchParametersTags. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePatchParametersTags. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePatchParametersTags. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePatchParametersTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePatchParametersTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new BareMetalMachinePatchParametersTags(json) : null; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachinePatchProperties.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachinePatchProperties.PowerShell.cs similarity index 83% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachinePatchProperties.PowerShell.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachinePatchProperties.PowerShell.cs index e0b053471d93..29c83c05f7b9 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachinePatchProperties.PowerShell.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachinePatchProperties.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; @@ -65,7 +65,7 @@ public partial class BareMetalMachinePatchProperties 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 BareMetalMachinePatchProperties(global::System.Collections.IDictionary // actually deserialize if (content.Contains("MachineDetail")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePatchPropertiesInternal)this).MachineDetail = (string) content.GetValueForProperty("MachineDetail",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePatchPropertiesInternal)this).MachineDetail, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePatchPropertiesInternal)this).MachineDetail = (string) content.GetValueForProperty("MachineDetail",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePatchPropertiesInternal)this).MachineDetail, 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. @@ -101,35 +101,33 @@ internal BareMetalMachinePatchProperties(global::System.Management.Automation.PS // actually deserialize if (content.Contains("MachineDetail")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePatchPropertiesInternal)this).MachineDetail = (string) content.GetValueForProperty("MachineDetail",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePatchPropertiesInternal)this).MachineDetail, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePatchPropertiesInternal)this).MachineDetail = (string) content.GetValueForProperty("MachineDetail",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePatchPropertiesInternal)this).MachineDetail, 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.NetworkCloud.Models.Api20250201.IBareMetalMachinePatchProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePatchProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new BareMetalMachinePatchProperties(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.NetworkCloud.Models.Api20250201.IBareMetalMachinePatchProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePatchProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new BareMetalMachinePatchProperties(content); } @@ -139,7 +137,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePatchProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePatchProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachinePatchProperties.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachinePatchProperties.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachinePatchProperties.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachinePatchProperties.TypeConverter.cs index 897267481800..aa15c966057a 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachinePatchProperties.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachinePatchProperties.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IBareMetalMachinePatchProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePatchProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePatchProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePatchProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachinePatchProperties.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachinePatchProperties.cs similarity index 91% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachinePatchProperties.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachinePatchProperties.cs index 5b41d6d3e1ce..13bf8e641e90 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachinePatchProperties.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachinePatchProperties.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -11,8 +11,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201 /// BareMetalMachinePatchProperties represents the properties of the bare metal machine that can be patched. /// public partial class BareMetalMachinePatchProperties : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePatchProperties, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePatchPropertiesInternal + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePatchProperties, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePatchPropertiesInternal { /// Backing field for property. @@ -42,6 +42,9 @@ public partial interface IBareMetalMachinePatchProperties : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The details provided by the customer during the creation of rack manifests that allows for custom data to be associated with this machine.", SerializedName = @"machineDetails", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachinePatchProperties.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachinePatchProperties.json.cs similarity index 95% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachinePatchProperties.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachinePatchProperties.json.cs index ea2286ce61cf..4d460013fe64 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachinePatchProperties.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachinePatchProperties.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -67,18 +67,18 @@ internal BareMetalMachinePatchProperties(Microsoft.Azure.PowerShell.Cmdlets.Netw { return; } - {_machineDetail = If( json?.PropertyT("machineDetails"), out var __jsonMachineDetails) ? (string)__jsonMachineDetails : (string)MachineDetail;} + {_machineDetail = If( json?.PropertyT("machineDetails"), out var __jsonMachineDetails) ? (string)__jsonMachineDetails : (string)_machineDetail;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePatchProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePatchProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePatchProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePatchProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePatchProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePatchProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new BareMetalMachinePatchProperties(json) : null; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachinePowerOffParameters.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachinePowerOffParameters.PowerShell.cs similarity index 81% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachinePowerOffParameters.PowerShell.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachinePowerOffParameters.PowerShell.cs index c96fc7382c23..a4361cf56375 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachinePowerOffParameters.PowerShell.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachinePowerOffParameters.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; @@ -65,7 +65,7 @@ public partial class BareMetalMachinePowerOffParameters 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 BareMetalMachinePowerOffParameters(global::System.Collections.IDictiona // actually deserialize if (content.Contains("SkipShutdown")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePowerOffParametersInternal)this).SkipShutdown = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineSkipShutdown?) content.GetValueForProperty("SkipShutdown",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePowerOffParametersInternal)this).SkipShutdown, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineSkipShutdown.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePowerOffParametersInternal)this).SkipShutdown = (string) content.GetValueForProperty("SkipShutdown",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePowerOffParametersInternal)this).SkipShutdown, 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. @@ -101,35 +101,35 @@ internal BareMetalMachinePowerOffParameters(global::System.Management.Automation // actually deserialize if (content.Contains("SkipShutdown")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePowerOffParametersInternal)this).SkipShutdown = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineSkipShutdown?) content.GetValueForProperty("SkipShutdown",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePowerOffParametersInternal)this).SkipShutdown, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineSkipShutdown.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePowerOffParametersInternal)this).SkipShutdown = (string) content.GetValueForProperty("SkipShutdown",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePowerOffParametersInternal)this).SkipShutdown, 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.NetworkCloud.Models.Api20250201.IBareMetalMachinePowerOffParameters DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePowerOffParameters DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new BareMetalMachinePowerOffParameters(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.NetworkCloud.Models.Api20250201.IBareMetalMachinePowerOffParameters DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePowerOffParameters DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new BareMetalMachinePowerOffParameters(content); } @@ -141,7 +141,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201 /// /// an instance of the model class. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePowerOffParameters FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePowerOffParameters FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachinePowerOffParameters.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachinePowerOffParameters.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachinePowerOffParameters.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachinePowerOffParameters.TypeConverter.cs index 27c11ff7a4da..ceb66b3250a9 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachinePowerOffParameters.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachinePowerOffParameters.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IBareMetalMachinePowerOffParameters ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePowerOffParameters ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePowerOffParameters).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePowerOffParameters).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachinePowerOffParameters.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachinePowerOffParameters.cs new file mode 100644 index 000000000000..005c0ae4d82b --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachinePowerOffParameters.cs @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + + /// + /// BareMetalMachinePowerOffParameters represents the body of the request to power off bare metal machine. + /// + public partial class BareMetalMachinePowerOffParameters : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePowerOffParameters, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePowerOffParametersInternal + { + + /// Backing field for property. + private string _skipShutdown; + + /// + /// The indicator of whether to skip the graceful OS shutdown and power off the bare metal machine immediately. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string SkipShutdown { get => this._skipShutdown; set => this._skipShutdown = value; } + + /// Creates an new instance. + public BareMetalMachinePowerOffParameters() + { + + } + } + /// BareMetalMachinePowerOffParameters represents the body of the request to power off bare metal machine. + public partial interface IBareMetalMachinePowerOffParameters : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable + { + /// + /// The indicator of whether to skip the graceful OS shutdown and power off the bare metal machine immediately. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The indicator of whether to skip the graceful OS shutdown and power off the bare metal machine immediately.", + SerializedName = @"skipShutdown", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("True", "False")] + string SkipShutdown { get; set; } + + } + /// BareMetalMachinePowerOffParameters represents the body of the request to power off bare metal machine. + internal partial interface IBareMetalMachinePowerOffParametersInternal + + { + /// + /// The indicator of whether to skip the graceful OS shutdown and power off the bare metal machine immediately. + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("True", "False")] + string SkipShutdown { get; set; } + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachinePowerOffParameters.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachinePowerOffParameters.json.cs similarity index 95% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachinePowerOffParameters.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachinePowerOffParameters.json.cs index 2684d663b4b0..0ed70e74082d 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachinePowerOffParameters.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachinePowerOffParameters.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -67,18 +67,18 @@ internal BareMetalMachinePowerOffParameters(Microsoft.Azure.PowerShell.Cmdlets.N { return; } - {_skipShutdown = If( json?.PropertyT("skipShutdown"), out var __jsonSkipShutdown) ? (string)__jsonSkipShutdown : (string)SkipShutdown;} + {_skipShutdown = If( json?.PropertyT("skipShutdown"), out var __jsonSkipShutdown) ? (string)__jsonSkipShutdown : (string)_skipShutdown;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePowerOffParameters. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePowerOffParameters. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePowerOffParameters. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePowerOffParameters. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePowerOffParameters FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePowerOffParameters FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new BareMetalMachinePowerOffParameters(json) : null; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineProperties.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineProperties.PowerShell.cs new file mode 100644 index 000000000000..f0ec27d82aa0 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineProperties.PowerShell.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.NetworkCloud.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + + /// BareMetalMachineProperties represents the properties of a bare metal machine. + [System.ComponentModel.TypeConverter(typeof(BareMetalMachinePropertiesTypeConverter))] + public partial class BareMetalMachineProperties + { + + /// + /// 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 BareMetalMachineProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("BmcCredentials")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).BmcCredentials = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministrativeCredentials) content.GetValueForProperty("BmcCredentials",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).BmcCredentials, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AdministrativeCredentialsTypeConverter.ConvertFrom); + } + if (content.Contains("HardwareInventory")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).HardwareInventory = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IHardwareInventory) content.GetValueForProperty("HardwareInventory",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).HardwareInventory, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.HardwareInventoryTypeConverter.ConvertFrom); + } + if (content.Contains("HardwareValidationStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).HardwareValidationStatus = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IHardwareValidationStatus) content.GetValueForProperty("HardwareValidationStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).HardwareValidationStatus, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.HardwareValidationStatusTypeConverter.ConvertFrom); + } + if (content.Contains("RuntimeProtectionStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).RuntimeProtectionStatus = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRuntimeProtectionStatus) content.GetValueForProperty("RuntimeProtectionStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).RuntimeProtectionStatus, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.RuntimeProtectionStatusTypeConverter.ConvertFrom); + } + if (content.Contains("AssociatedResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).AssociatedResourceId = (System.Collections.Generic.List) content.GetValueForProperty("AssociatedResourceId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).AssociatedResourceId, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("BmcConnectionString")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).BmcConnectionString = (string) content.GetValueForProperty("BmcConnectionString",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).BmcConnectionString, global::System.Convert.ToString); + } + if (content.Contains("BmcMacAddress")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).BmcMacAddress = (string) content.GetValueForProperty("BmcMacAddress",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).BmcMacAddress, global::System.Convert.ToString); + } + if (content.Contains("BootMacAddress")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).BootMacAddress = (string) content.GetValueForProperty("BootMacAddress",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).BootMacAddress, global::System.Convert.ToString); + } + if (content.Contains("ClusterId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).ClusterId = (string) content.GetValueForProperty("ClusterId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).ClusterId, global::System.Convert.ToString); + } + if (content.Contains("CordonStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).CordonStatus = (string) content.GetValueForProperty("CordonStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).CordonStatus, global::System.Convert.ToString); + } + if (content.Contains("DetailedStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).DetailedStatus = (string) content.GetValueForProperty("DetailedStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).DetailedStatus, global::System.Convert.ToString); + } + if (content.Contains("DetailedStatusMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).DetailedStatusMessage = (string) content.GetValueForProperty("DetailedStatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).DetailedStatusMessage, global::System.Convert.ToString); + } + if (content.Contains("HybridAksClustersAssociatedId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).HybridAksClustersAssociatedId = (System.Collections.Generic.List) content.GetValueForProperty("HybridAksClustersAssociatedId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).HybridAksClustersAssociatedId, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("KubernetesNodeName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).KubernetesNodeName = (string) content.GetValueForProperty("KubernetesNodeName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).KubernetesNodeName, global::System.Convert.ToString); + } + if (content.Contains("KubernetesVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).KubernetesVersion = (string) content.GetValueForProperty("KubernetesVersion",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).KubernetesVersion, global::System.Convert.ToString); + } + if (content.Contains("MachineClusterVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).MachineClusterVersion = (string) content.GetValueForProperty("MachineClusterVersion",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).MachineClusterVersion, global::System.Convert.ToString); + } + if (content.Contains("MachineDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).MachineDetail = (string) content.GetValueForProperty("MachineDetail",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).MachineDetail, global::System.Convert.ToString); + } + if (content.Contains("MachineName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).MachineName = (string) content.GetValueForProperty("MachineName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).MachineName, global::System.Convert.ToString); + } + if (content.Contains("MachineRole")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).MachineRole = (System.Collections.Generic.List) content.GetValueForProperty("MachineRole",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).MachineRole, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("MachineSkuId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).MachineSkuId = (string) content.GetValueForProperty("MachineSkuId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).MachineSkuId, global::System.Convert.ToString); + } + if (content.Contains("OamIpv4Address")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).OamIpv4Address = (string) content.GetValueForProperty("OamIpv4Address",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).OamIpv4Address, global::System.Convert.ToString); + } + if (content.Contains("OamIpv6Address")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).OamIpv6Address = (string) content.GetValueForProperty("OamIpv6Address",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).OamIpv6Address, global::System.Convert.ToString); + } + if (content.Contains("OSImage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).OSImage = (string) content.GetValueForProperty("OSImage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).OSImage, global::System.Convert.ToString); + } + if (content.Contains("PowerState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).PowerState = (string) content.GetValueForProperty("PowerState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).PowerState, global::System.Convert.ToString); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("RackId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).RackId = (string) content.GetValueForProperty("RackId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).RackId, global::System.Convert.ToString); + } + if (content.Contains("RackSlot")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).RackSlot = (long) content.GetValueForProperty("RackSlot",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).RackSlot, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("ReadyState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).ReadyState = (string) content.GetValueForProperty("ReadyState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).ReadyState, global::System.Convert.ToString); + } + if (content.Contains("SecretRotationStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).SecretRotationStatus = (System.Collections.Generic.List) content.GetValueForProperty("SecretRotationStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).SecretRotationStatus, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.SecretRotationStatusTypeConverter.ConvertFrom)); + } + if (content.Contains("SerialNumber")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).SerialNumber = (string) content.GetValueForProperty("SerialNumber",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).SerialNumber, global::System.Convert.ToString); + } + if (content.Contains("ServiceTag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).ServiceTag = (string) content.GetValueForProperty("ServiceTag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).ServiceTag, global::System.Convert.ToString); + } + if (content.Contains("VirtualMachinesAssociatedId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).VirtualMachinesAssociatedId = (System.Collections.Generic.List) content.GetValueForProperty("VirtualMachinesAssociatedId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).VirtualMachinesAssociatedId, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("HardwareInventoryInterface")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).HardwareInventoryInterface = (System.Collections.Generic.List) content.GetValueForProperty("HardwareInventoryInterface",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).HardwareInventoryInterface, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.HardwareInventoryNetworkInterfaceTypeConverter.ConvertFrom)); + } + if (content.Contains("HardwareInventoryNic")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).HardwareInventoryNic = (System.Collections.Generic.List) content.GetValueForProperty("HardwareInventoryNic",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).HardwareInventoryNic, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.NicTypeConverter.ConvertFrom)); + } + if (content.Contains("RuntimeProtectionStatusDefinitionsVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).RuntimeProtectionStatusDefinitionsVersion = (string) content.GetValueForProperty("RuntimeProtectionStatusDefinitionsVersion",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).RuntimeProtectionStatusDefinitionsVersion, global::System.Convert.ToString); + } + if (content.Contains("BmcCredentialsPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).BmcCredentialsPassword = (System.Security.SecureString) content.GetValueForProperty("BmcCredentialsPassword",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).BmcCredentialsPassword, (object ss) => (System.Security.SecureString)ss); + } + if (content.Contains("BmcCredentialsUsername")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).BmcCredentialsUsername = (string) content.GetValueForProperty("BmcCredentialsUsername",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).BmcCredentialsUsername, global::System.Convert.ToString); + } + if (content.Contains("HardwareInventoryAdditionalHostInformation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).HardwareInventoryAdditionalHostInformation = (string) content.GetValueForProperty("HardwareInventoryAdditionalHostInformation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).HardwareInventoryAdditionalHostInformation, global::System.Convert.ToString); + } + if (content.Contains("HardwareValidationStatusLastValidationTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).HardwareValidationStatusLastValidationTime = (global::System.DateTime?) content.GetValueForProperty("HardwareValidationStatusLastValidationTime",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).HardwareValidationStatusLastValidationTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("HardwareValidationStatusResult")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).HardwareValidationStatusResult = (string) content.GetValueForProperty("HardwareValidationStatusResult",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).HardwareValidationStatusResult, global::System.Convert.ToString); + } + if (content.Contains("RuntimeProtectionStatusDefinitionsLastUpdated")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).RuntimeProtectionStatusDefinitionsLastUpdated = (global::System.DateTime?) content.GetValueForProperty("RuntimeProtectionStatusDefinitionsLastUpdated",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).RuntimeProtectionStatusDefinitionsLastUpdated, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("RuntimeProtectionStatusScanCompletedTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).RuntimeProtectionStatusScanCompletedTime = (global::System.DateTime?) content.GetValueForProperty("RuntimeProtectionStatusScanCompletedTime",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).RuntimeProtectionStatusScanCompletedTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("RuntimeProtectionStatusScanScheduledTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).RuntimeProtectionStatusScanScheduledTime = (global::System.DateTime?) content.GetValueForProperty("RuntimeProtectionStatusScanScheduledTime",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).RuntimeProtectionStatusScanScheduledTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("RuntimeProtectionStatusScanStartedTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).RuntimeProtectionStatusScanStartedTime = (global::System.DateTime?) content.GetValueForProperty("RuntimeProtectionStatusScanStartedTime",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).RuntimeProtectionStatusScanStartedTime, (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 BareMetalMachineProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("BmcCredentials")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).BmcCredentials = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministrativeCredentials) content.GetValueForProperty("BmcCredentials",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).BmcCredentials, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AdministrativeCredentialsTypeConverter.ConvertFrom); + } + if (content.Contains("HardwareInventory")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).HardwareInventory = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IHardwareInventory) content.GetValueForProperty("HardwareInventory",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).HardwareInventory, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.HardwareInventoryTypeConverter.ConvertFrom); + } + if (content.Contains("HardwareValidationStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).HardwareValidationStatus = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IHardwareValidationStatus) content.GetValueForProperty("HardwareValidationStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).HardwareValidationStatus, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.HardwareValidationStatusTypeConverter.ConvertFrom); + } + if (content.Contains("RuntimeProtectionStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).RuntimeProtectionStatus = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRuntimeProtectionStatus) content.GetValueForProperty("RuntimeProtectionStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).RuntimeProtectionStatus, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.RuntimeProtectionStatusTypeConverter.ConvertFrom); + } + if (content.Contains("AssociatedResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).AssociatedResourceId = (System.Collections.Generic.List) content.GetValueForProperty("AssociatedResourceId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).AssociatedResourceId, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("BmcConnectionString")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).BmcConnectionString = (string) content.GetValueForProperty("BmcConnectionString",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).BmcConnectionString, global::System.Convert.ToString); + } + if (content.Contains("BmcMacAddress")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).BmcMacAddress = (string) content.GetValueForProperty("BmcMacAddress",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).BmcMacAddress, global::System.Convert.ToString); + } + if (content.Contains("BootMacAddress")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).BootMacAddress = (string) content.GetValueForProperty("BootMacAddress",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).BootMacAddress, global::System.Convert.ToString); + } + if (content.Contains("ClusterId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).ClusterId = (string) content.GetValueForProperty("ClusterId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).ClusterId, global::System.Convert.ToString); + } + if (content.Contains("CordonStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).CordonStatus = (string) content.GetValueForProperty("CordonStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).CordonStatus, global::System.Convert.ToString); + } + if (content.Contains("DetailedStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).DetailedStatus = (string) content.GetValueForProperty("DetailedStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).DetailedStatus, global::System.Convert.ToString); + } + if (content.Contains("DetailedStatusMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).DetailedStatusMessage = (string) content.GetValueForProperty("DetailedStatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).DetailedStatusMessage, global::System.Convert.ToString); + } + if (content.Contains("HybridAksClustersAssociatedId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).HybridAksClustersAssociatedId = (System.Collections.Generic.List) content.GetValueForProperty("HybridAksClustersAssociatedId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).HybridAksClustersAssociatedId, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("KubernetesNodeName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).KubernetesNodeName = (string) content.GetValueForProperty("KubernetesNodeName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).KubernetesNodeName, global::System.Convert.ToString); + } + if (content.Contains("KubernetesVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).KubernetesVersion = (string) content.GetValueForProperty("KubernetesVersion",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).KubernetesVersion, global::System.Convert.ToString); + } + if (content.Contains("MachineClusterVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).MachineClusterVersion = (string) content.GetValueForProperty("MachineClusterVersion",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).MachineClusterVersion, global::System.Convert.ToString); + } + if (content.Contains("MachineDetail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).MachineDetail = (string) content.GetValueForProperty("MachineDetail",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).MachineDetail, global::System.Convert.ToString); + } + if (content.Contains("MachineName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).MachineName = (string) content.GetValueForProperty("MachineName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).MachineName, global::System.Convert.ToString); + } + if (content.Contains("MachineRole")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).MachineRole = (System.Collections.Generic.List) content.GetValueForProperty("MachineRole",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).MachineRole, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("MachineSkuId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).MachineSkuId = (string) content.GetValueForProperty("MachineSkuId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).MachineSkuId, global::System.Convert.ToString); + } + if (content.Contains("OamIpv4Address")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).OamIpv4Address = (string) content.GetValueForProperty("OamIpv4Address",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).OamIpv4Address, global::System.Convert.ToString); + } + if (content.Contains("OamIpv6Address")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).OamIpv6Address = (string) content.GetValueForProperty("OamIpv6Address",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).OamIpv6Address, global::System.Convert.ToString); + } + if (content.Contains("OSImage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).OSImage = (string) content.GetValueForProperty("OSImage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).OSImage, global::System.Convert.ToString); + } + if (content.Contains("PowerState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).PowerState = (string) content.GetValueForProperty("PowerState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).PowerState, global::System.Convert.ToString); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("RackId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).RackId = (string) content.GetValueForProperty("RackId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).RackId, global::System.Convert.ToString); + } + if (content.Contains("RackSlot")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).RackSlot = (long) content.GetValueForProperty("RackSlot",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).RackSlot, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("ReadyState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).ReadyState = (string) content.GetValueForProperty("ReadyState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).ReadyState, global::System.Convert.ToString); + } + if (content.Contains("SecretRotationStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).SecretRotationStatus = (System.Collections.Generic.List) content.GetValueForProperty("SecretRotationStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).SecretRotationStatus, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.SecretRotationStatusTypeConverter.ConvertFrom)); + } + if (content.Contains("SerialNumber")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).SerialNumber = (string) content.GetValueForProperty("SerialNumber",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).SerialNumber, global::System.Convert.ToString); + } + if (content.Contains("ServiceTag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).ServiceTag = (string) content.GetValueForProperty("ServiceTag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).ServiceTag, global::System.Convert.ToString); + } + if (content.Contains("VirtualMachinesAssociatedId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).VirtualMachinesAssociatedId = (System.Collections.Generic.List) content.GetValueForProperty("VirtualMachinesAssociatedId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).VirtualMachinesAssociatedId, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("HardwareInventoryInterface")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).HardwareInventoryInterface = (System.Collections.Generic.List) content.GetValueForProperty("HardwareInventoryInterface",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).HardwareInventoryInterface, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.HardwareInventoryNetworkInterfaceTypeConverter.ConvertFrom)); + } + if (content.Contains("HardwareInventoryNic")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).HardwareInventoryNic = (System.Collections.Generic.List) content.GetValueForProperty("HardwareInventoryNic",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).HardwareInventoryNic, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.NicTypeConverter.ConvertFrom)); + } + if (content.Contains("RuntimeProtectionStatusDefinitionsVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).RuntimeProtectionStatusDefinitionsVersion = (string) content.GetValueForProperty("RuntimeProtectionStatusDefinitionsVersion",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).RuntimeProtectionStatusDefinitionsVersion, global::System.Convert.ToString); + } + if (content.Contains("BmcCredentialsPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).BmcCredentialsPassword = (System.Security.SecureString) content.GetValueForProperty("BmcCredentialsPassword",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).BmcCredentialsPassword, (object ss) => (System.Security.SecureString)ss); + } + if (content.Contains("BmcCredentialsUsername")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).BmcCredentialsUsername = (string) content.GetValueForProperty("BmcCredentialsUsername",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).BmcCredentialsUsername, global::System.Convert.ToString); + } + if (content.Contains("HardwareInventoryAdditionalHostInformation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).HardwareInventoryAdditionalHostInformation = (string) content.GetValueForProperty("HardwareInventoryAdditionalHostInformation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).HardwareInventoryAdditionalHostInformation, global::System.Convert.ToString); + } + if (content.Contains("HardwareValidationStatusLastValidationTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).HardwareValidationStatusLastValidationTime = (global::System.DateTime?) content.GetValueForProperty("HardwareValidationStatusLastValidationTime",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).HardwareValidationStatusLastValidationTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("HardwareValidationStatusResult")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).HardwareValidationStatusResult = (string) content.GetValueForProperty("HardwareValidationStatusResult",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).HardwareValidationStatusResult, global::System.Convert.ToString); + } + if (content.Contains("RuntimeProtectionStatusDefinitionsLastUpdated")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).RuntimeProtectionStatusDefinitionsLastUpdated = (global::System.DateTime?) content.GetValueForProperty("RuntimeProtectionStatusDefinitionsLastUpdated",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).RuntimeProtectionStatusDefinitionsLastUpdated, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("RuntimeProtectionStatusScanCompletedTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).RuntimeProtectionStatusScanCompletedTime = (global::System.DateTime?) content.GetValueForProperty("RuntimeProtectionStatusScanCompletedTime",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).RuntimeProtectionStatusScanCompletedTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("RuntimeProtectionStatusScanScheduledTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).RuntimeProtectionStatusScanScheduledTime = (global::System.DateTime?) content.GetValueForProperty("RuntimeProtectionStatusScanScheduledTime",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).RuntimeProtectionStatusScanScheduledTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("RuntimeProtectionStatusScanStartedTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).RuntimeProtectionStatusScanStartedTime = (global::System.DateTime?) content.GetValueForProperty("RuntimeProtectionStatusScanStartedTime",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal)this).RuntimeProtectionStatusScanStartedTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new BareMetalMachineProperties(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.NetworkCloud.Models.IBareMetalMachineProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new BareMetalMachineProperties(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.NetworkCloud.Models.IBareMetalMachineProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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(); + } + } + /// BareMetalMachineProperties represents the properties of a bare metal machine. + [System.ComponentModel.TypeConverter(typeof(BareMetalMachinePropertiesTypeConverter))] + public partial interface IBareMetalMachineProperties + + { + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineProperties.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineProperties.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineProperties.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineProperties.TypeConverter.cs index 85ad4e26b509..108d177d5372 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineProperties.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineProperties.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IBareMetalMachineProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineProperties.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineProperties.cs new file mode 100644 index 000000000000..d6b31628bf33 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineProperties.cs @@ -0,0 +1,1062 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + + /// BareMetalMachineProperties represents the properties of a bare metal machine. + public partial class BareMetalMachineProperties : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineProperties, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal + { + + /// Backing field for property. + private System.Collections.Generic.List _associatedResourceId; + + /// + /// The list of resource IDs for the other Microsoft.NetworkCloud resources that have attached this network. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public System.Collections.Generic.List AssociatedResourceId { get => this._associatedResourceId; } + + /// Backing field for property. + private string _bmcConnectionString; + + /// + /// The connection string for the baseboard management controller including IP address and protocol. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string BmcConnectionString { get => this._bmcConnectionString; set => this._bmcConnectionString = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministrativeCredentials _bmcCredentials; + + /// + /// The credentials of the baseboard management controller on this bare metal machine. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministrativeCredentials BmcCredentials { get => (this._bmcCredentials = this._bmcCredentials ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AdministrativeCredentials()); set => this._bmcCredentials = value; } + + /// The password of the administrator of the device used during initialization. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public System.Security.SecureString BmcCredentialsPassword { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministrativeCredentialsInternal)BmcCredentials).Password; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministrativeCredentialsInternal)BmcCredentials).Password = value ; } + + /// The username of the administrator of the device used during initialization. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string BmcCredentialsUsername { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministrativeCredentialsInternal)BmcCredentials).Username; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministrativeCredentialsInternal)BmcCredentials).Username = value ; } + + /// Backing field for property. + private string _bmcMacAddress; + + /// The MAC address of the BMC device. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string BmcMacAddress { get => this._bmcMacAddress; set => this._bmcMacAddress = value; } + + /// Backing field for property. + private string _bootMacAddress; + + /// The MAC address of a NIC connected to the PXE network. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string BootMacAddress { get => this._bootMacAddress; set => this._bootMacAddress = value; } + + /// Backing field for property. + private string _clusterId; + + /// The resource ID of the cluster this bare metal machine is associated with. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string ClusterId { get => this._clusterId; } + + /// Backing field for property. + private string _cordonStatus; + + /// The cordon status of the bare metal machine. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string CordonStatus { get => this._cordonStatus; } + + /// Backing field for property. + private string _detailedStatus; + + /// The more detailed status of the bare metal machine. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string DetailedStatus { get => this._detailedStatus; } + + /// Backing field for property. + private string _detailedStatusMessage; + + /// The descriptive message about the current detailed status. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string DetailedStatusMessage { get => this._detailedStatusMessage; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IHardwareInventory _hardwareInventory; + + /// + /// The hardware inventory, including information acquired from the model/sku information and from the ironic inspector. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IHardwareInventory HardwareInventory { get => (this._hardwareInventory = this._hardwareInventory ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.HardwareInventory()); } + + /// + /// Freeform data extracted from the environment about this machine. This information varies depending on the specific hardware + /// and configuration. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string HardwareInventoryAdditionalHostInformation { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IHardwareInventoryInternal)HardwareInventory).AdditionalHostInformation; } + + /// + /// The list of network interfaces and associated details for the bare metal machine. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public System.Collections.Generic.List HardwareInventoryInterface { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IHardwareInventoryInternal)HardwareInventory).Interface; } + + /// + /// Field Deprecated. Will be removed in an upcoming version. The list of network interface cards and associated details for + /// the bare metal machine. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public System.Collections.Generic.List HardwareInventoryNic { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IHardwareInventoryInternal)HardwareInventory).Nic; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IHardwareValidationStatus _hardwareValidationStatus; + + /// + /// The details of the latest hardware validation performed for this bare metal machine. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IHardwareValidationStatus HardwareValidationStatus { get => (this._hardwareValidationStatus = this._hardwareValidationStatus ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.HardwareValidationStatus()); } + + /// The timestamp of the hardware validation execution. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public global::System.DateTime? HardwareValidationStatusLastValidationTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IHardwareValidationStatusInternal)HardwareValidationStatus).LastValidationTime; } + + /// The outcome of the hardware validation. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string HardwareValidationStatusResult { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IHardwareValidationStatusInternal)HardwareValidationStatus).Result; } + + /// Backing field for property. + private System.Collections.Generic.List _hybridAksClustersAssociatedId; + + /// + /// Field Deprecated. These fields will be empty/omitted. The list of the resource IDs for the HybridAksClusters that have + /// nodes hosted on this bare metal machine. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public System.Collections.Generic.List HybridAksClustersAssociatedId { get => this._hybridAksClustersAssociatedId; } + + /// Backing field for property. + private string _kubernetesNodeName; + + /// + /// The name of this machine represented by the host object in the Cluster's Kubernetes control plane. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string KubernetesNodeName { get => this._kubernetesNodeName; } + + /// Backing field for property. + private string _kubernetesVersion; + + /// The version of Kubernetes running on this machine. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string KubernetesVersion { get => this._kubernetesVersion; } + + /// Backing field for property. + private string _machineClusterVersion; + + /// + /// The cluster version that has been applied to this machine during deployment or a version update. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string MachineClusterVersion { get => this._machineClusterVersion; set => this._machineClusterVersion = value; } + + /// Backing field for property. + private string _machineDetail; + + /// The custom details provided by the customer. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string MachineDetail { get => this._machineDetail; set => this._machineDetail = value; } + + /// Backing field for property. + private string _machineName; + + /// The OS-level hostname assigned to this machine. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string MachineName { get => this._machineName; set => this._machineName = value; } + + /// Backing field for property. + private System.Collections.Generic.List _machineRole; + + /// + /// The list of roles that are assigned to the cluster node running on this machine. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public System.Collections.Generic.List MachineRole { get => this._machineRole; } + + /// Backing field for property. + private string _machineSkuId; + + /// The unique internal identifier of the bare metal machine SKU. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string MachineSkuId { get => this._machineSkuId; set => this._machineSkuId = value; } + + /// Internal Acessors for AssociatedResourceId + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal.AssociatedResourceId { get => this._associatedResourceId; set { {_associatedResourceId = value;} } } + + /// Internal Acessors for BmcCredentials + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministrativeCredentials Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal.BmcCredentials { get => (this._bmcCredentials = this._bmcCredentials ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AdministrativeCredentials()); set { {_bmcCredentials = value;} } } + + /// Internal Acessors for ClusterId + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal.ClusterId { get => this._clusterId; set { {_clusterId = value;} } } + + /// Internal Acessors for CordonStatus + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal.CordonStatus { get => this._cordonStatus; set { {_cordonStatus = value;} } } + + /// Internal Acessors for DetailedStatus + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal.DetailedStatus { get => this._detailedStatus; set { {_detailedStatus = value;} } } + + /// Internal Acessors for DetailedStatusMessage + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal.DetailedStatusMessage { get => this._detailedStatusMessage; set { {_detailedStatusMessage = value;} } } + + /// Internal Acessors for HardwareInventory + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IHardwareInventory Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal.HardwareInventory { get => (this._hardwareInventory = this._hardwareInventory ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.HardwareInventory()); set { {_hardwareInventory = value;} } } + + /// Internal Acessors for HardwareInventoryAdditionalHostInformation + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal.HardwareInventoryAdditionalHostInformation { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IHardwareInventoryInternal)HardwareInventory).AdditionalHostInformation; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IHardwareInventoryInternal)HardwareInventory).AdditionalHostInformation = value ?? null; } + + /// Internal Acessors for HardwareInventoryInterface + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal.HardwareInventoryInterface { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IHardwareInventoryInternal)HardwareInventory).Interface; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IHardwareInventoryInternal)HardwareInventory).Interface = value ?? null /* arrayOf */; } + + /// Internal Acessors for HardwareInventoryNic + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal.HardwareInventoryNic { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IHardwareInventoryInternal)HardwareInventory).Nic; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IHardwareInventoryInternal)HardwareInventory).Nic = value ?? null /* arrayOf */; } + + /// Internal Acessors for HardwareValidationStatus + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IHardwareValidationStatus Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal.HardwareValidationStatus { get => (this._hardwareValidationStatus = this._hardwareValidationStatus ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.HardwareValidationStatus()); set { {_hardwareValidationStatus = value;} } } + + /// Internal Acessors for HardwareValidationStatusLastValidationTime + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal.HardwareValidationStatusLastValidationTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IHardwareValidationStatusInternal)HardwareValidationStatus).LastValidationTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IHardwareValidationStatusInternal)HardwareValidationStatus).LastValidationTime = value ?? default(global::System.DateTime); } + + /// Internal Acessors for HardwareValidationStatusResult + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal.HardwareValidationStatusResult { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IHardwareValidationStatusInternal)HardwareValidationStatus).Result; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IHardwareValidationStatusInternal)HardwareValidationStatus).Result = value ?? null; } + + /// Internal Acessors for HybridAksClustersAssociatedId + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal.HybridAksClustersAssociatedId { get => this._hybridAksClustersAssociatedId; set { {_hybridAksClustersAssociatedId = value;} } } + + /// Internal Acessors for KubernetesNodeName + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal.KubernetesNodeName { get => this._kubernetesNodeName; set { {_kubernetesNodeName = value;} } } + + /// Internal Acessors for KubernetesVersion + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal.KubernetesVersion { get => this._kubernetesVersion; set { {_kubernetesVersion = value;} } } + + /// Internal Acessors for MachineRole + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal.MachineRole { get => this._machineRole; set { {_machineRole = value;} } } + + /// Internal Acessors for OSImage + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal.OSImage { get => this._oSImage; set { {_oSImage = value;} } } + + /// Internal Acessors for OamIpv4Address + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal.OamIpv4Address { get => this._oamIpv4Address; set { {_oamIpv4Address = value;} } } + + /// Internal Acessors for OamIpv6Address + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal.OamIpv6Address { get => this._oamIpv6Address; set { {_oamIpv6Address = value;} } } + + /// Internal Acessors for PowerState + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal.PowerState { get => this._powerState; set { {_powerState = value;} } } + + /// Internal Acessors for ProvisioningState + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal.ProvisioningState { get => this._provisioningState; set { {_provisioningState = value;} } } + + /// Internal Acessors for ReadyState + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal.ReadyState { get => this._readyState; set { {_readyState = value;} } } + + /// Internal Acessors for RuntimeProtectionStatus + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRuntimeProtectionStatus Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal.RuntimeProtectionStatus { get => (this._runtimeProtectionStatus = this._runtimeProtectionStatus ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.RuntimeProtectionStatus()); set { {_runtimeProtectionStatus = value;} } } + + /// Internal Acessors for RuntimeProtectionStatusDefinitionsLastUpdated + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal.RuntimeProtectionStatusDefinitionsLastUpdated { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRuntimeProtectionStatusInternal)RuntimeProtectionStatus).DefinitionsLastUpdated; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRuntimeProtectionStatusInternal)RuntimeProtectionStatus).DefinitionsLastUpdated = value ?? default(global::System.DateTime); } + + /// Internal Acessors for RuntimeProtectionStatusDefinitionsVersion + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal.RuntimeProtectionStatusDefinitionsVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRuntimeProtectionStatusInternal)RuntimeProtectionStatus).DefinitionsVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRuntimeProtectionStatusInternal)RuntimeProtectionStatus).DefinitionsVersion = value ?? null; } + + /// Internal Acessors for RuntimeProtectionStatusScanCompletedTime + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal.RuntimeProtectionStatusScanCompletedTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRuntimeProtectionStatusInternal)RuntimeProtectionStatus).ScanCompletedTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRuntimeProtectionStatusInternal)RuntimeProtectionStatus).ScanCompletedTime = value ?? default(global::System.DateTime); } + + /// Internal Acessors for RuntimeProtectionStatusScanScheduledTime + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal.RuntimeProtectionStatusScanScheduledTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRuntimeProtectionStatusInternal)RuntimeProtectionStatus).ScanScheduledTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRuntimeProtectionStatusInternal)RuntimeProtectionStatus).ScanScheduledTime = value ?? default(global::System.DateTime); } + + /// Internal Acessors for RuntimeProtectionStatusScanStartedTime + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal.RuntimeProtectionStatusScanStartedTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRuntimeProtectionStatusInternal)RuntimeProtectionStatus).ScanStartedTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRuntimeProtectionStatusInternal)RuntimeProtectionStatus).ScanStartedTime = value ?? default(global::System.DateTime); } + + /// Internal Acessors for SecretRotationStatus + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal.SecretRotationStatus { get => this._secretRotationStatus; set { {_secretRotationStatus = value;} } } + + /// Internal Acessors for ServiceTag + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal.ServiceTag { get => this._serviceTag; set { {_serviceTag = value;} } } + + /// Internal Acessors for VirtualMachinesAssociatedId + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePropertiesInternal.VirtualMachinesAssociatedId { get => this._virtualMachinesAssociatedId; set { {_virtualMachinesAssociatedId = value;} } } + + /// Backing field for property. + private string _oSImage; + + /// The image that is currently provisioned to the OS disk. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string OSImage { get => this._oSImage; } + + /// Backing field for property. + private string _oamIpv4Address; + + /// + /// The IPv4 address that is assigned to the bare metal machine during the cluster deployment. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string OamIpv4Address { get => this._oamIpv4Address; } + + /// Backing field for property. + private string _oamIpv6Address; + + /// + /// The IPv6 address that is assigned to the bare metal machine during the cluster deployment. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string OamIpv6Address { get => this._oamIpv6Address; } + + /// Backing field for property. + private string _powerState; + + /// The power state derived from the baseboard management controller. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string PowerState { get => this._powerState; } + + /// Backing field for property. + private string _provisioningState; + + /// The provisioning state of the bare metal machine. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string ProvisioningState { get => this._provisioningState; } + + /// Backing field for property. + private string _rackId; + + /// The resource ID of the rack where this bare metal machine resides. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string RackId { get => this._rackId; set => this._rackId = value; } + + /// Backing field for property. + private long _rackSlot; + + /// + /// The rack slot in which this bare metal machine is located, ordered from the bottom up i.e. the lowest slot is 1. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public long RackSlot { get => this._rackSlot; set => this._rackSlot = value; } + + /// Backing field for property. + private string _readyState; + + /// The indicator of whether the bare metal machine is ready to receive workloads. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string ReadyState { get => this._readyState; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRuntimeProtectionStatus _runtimeProtectionStatus; + + /// The runtime protection status of the bare metal machine. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRuntimeProtectionStatus RuntimeProtectionStatus { get => (this._runtimeProtectionStatus = this._runtimeProtectionStatus ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.RuntimeProtectionStatus()); } + + /// The timestamp when the malware definitions were last updated. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public global::System.DateTime? RuntimeProtectionStatusDefinitionsLastUpdated { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRuntimeProtectionStatusInternal)RuntimeProtectionStatus).DefinitionsLastUpdated; } + + /// The version of the malware definitions. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string RuntimeProtectionStatusDefinitionsVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRuntimeProtectionStatusInternal)RuntimeProtectionStatus).DefinitionsVersion; } + + /// + /// The timestamp of the most recently completed scan, or empty if there has never been a scan. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public global::System.DateTime? RuntimeProtectionStatusScanCompletedTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRuntimeProtectionStatusInternal)RuntimeProtectionStatus).ScanCompletedTime; } + + /// + /// The timestamp of the most recently scheduled scan, or empty if no scan has been scheduled. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public global::System.DateTime? RuntimeProtectionStatusScanScheduledTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRuntimeProtectionStatusInternal)RuntimeProtectionStatus).ScanScheduledTime; } + + /// + /// The timestamp of the most recently started scan, or empty if there has never been a scan. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public global::System.DateTime? RuntimeProtectionStatusScanStartedTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRuntimeProtectionStatusInternal)RuntimeProtectionStatus).ScanStartedTime; } + + /// Backing field for property. + private System.Collections.Generic.List _secretRotationStatus; + + /// The list of statuses that represent secret rotation activity. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public System.Collections.Generic.List SecretRotationStatus { get => this._secretRotationStatus; } + + /// Backing field for property. + private string _serialNumber; + + /// The serial number of the bare metal machine. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string SerialNumber { get => this._serialNumber; set => this._serialNumber = value; } + + /// Backing field for property. + private string _serviceTag; + + /// The discovered value of the machine's service tag. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string ServiceTag { get => this._serviceTag; } + + /// Backing field for property. + private System.Collections.Generic.List _virtualMachinesAssociatedId; + + /// + /// Field Deprecated. These fields will be empty/omitted. The list of the resource IDs for the VirtualMachines that are hosted + /// on this bare metal machine. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public System.Collections.Generic.List VirtualMachinesAssociatedId { get => this._virtualMachinesAssociatedId; } + + /// Creates an new instance. + public BareMetalMachineProperties() + { + + } + } + /// BareMetalMachineProperties represents the properties of a bare metal machine. + public partial interface IBareMetalMachineProperties : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable + { + /// + /// The list of resource IDs for the other Microsoft.NetworkCloud resources that have attached this network. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The list of resource IDs for the other Microsoft.NetworkCloud resources that have attached this network.", + SerializedName = @"associatedResourceIds", + PossibleTypes = new [] { typeof(string) })] + System.Collections.Generic.List AssociatedResourceId { get; } + /// + /// The connection string for the baseboard management controller including IP address and protocol. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The connection string for the baseboard management controller including IP address and protocol.", + SerializedName = @"bmcConnectionString", + PossibleTypes = new [] { typeof(string) })] + string BmcConnectionString { get; set; } + /// The password of the administrator of the device used during initialization. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The password of the administrator of the device used during initialization.", + SerializedName = @"password", + PossibleTypes = new [] { typeof(System.Security.SecureString) })] + System.Security.SecureString BmcCredentialsPassword { get; set; } + /// The username of the administrator of the device used during initialization. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The username of the administrator of the device used during initialization.", + SerializedName = @"username", + PossibleTypes = new [] { typeof(string) })] + string BmcCredentialsUsername { get; set; } + /// The MAC address of the BMC device. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The MAC address of the BMC device.", + SerializedName = @"bmcMacAddress", + PossibleTypes = new [] { typeof(string) })] + string BmcMacAddress { get; set; } + /// The MAC address of a NIC connected to the PXE network. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The MAC address of a NIC connected to the PXE network.", + SerializedName = @"bootMacAddress", + PossibleTypes = new [] { typeof(string) })] + string BootMacAddress { get; set; } + /// The resource ID of the cluster this bare metal machine is associated with. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The resource ID of the cluster this bare metal machine is associated with.", + SerializedName = @"clusterId", + PossibleTypes = new [] { typeof(string) })] + string ClusterId { get; } + /// The cordon status of the bare metal machine. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The cordon status of the bare metal machine.", + SerializedName = @"cordonStatus", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Cordoned", "Uncordoned")] + string CordonStatus { get; } + /// The more detailed status of the bare metal machine. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The more detailed status of the bare metal machine.", + SerializedName = @"detailedStatus", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Preparing", "Error", "Available", "Provisioning", "Provisioned", "Deprovisioning")] + string DetailedStatus { get; } + /// The descriptive message about the current detailed status. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The descriptive message about the current detailed status.", + SerializedName = @"detailedStatusMessage", + PossibleTypes = new [] { typeof(string) })] + string DetailedStatusMessage { get; } + /// + /// Freeform data extracted from the environment about this machine. This information varies depending on the specific hardware + /// and configuration. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"Freeform data extracted from the environment about this machine. This information varies depending on the specific hardware and configuration.", + SerializedName = @"additionalHostInformation", + PossibleTypes = new [] { typeof(string) })] + string HardwareInventoryAdditionalHostInformation { get; } + /// + /// The list of network interfaces and associated details for the bare metal machine. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The list of network interfaces and associated details for the bare metal machine.", + SerializedName = @"interfaces", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IHardwareInventoryNetworkInterface) })] + System.Collections.Generic.List HardwareInventoryInterface { get; } + /// + /// Field Deprecated. Will be removed in an upcoming version. The list of network interface cards and associated details for + /// the bare metal machine. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"Field Deprecated. Will be removed in an upcoming version. The list of network interface cards and associated details for the bare metal machine.", + SerializedName = @"nics", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INic) })] + System.Collections.Generic.List HardwareInventoryNic { get; } + /// The timestamp of the hardware validation execution. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The timestamp of the hardware validation execution.", + SerializedName = @"lastValidationTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? HardwareValidationStatusLastValidationTime { get; } + /// The outcome of the hardware validation. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The outcome of the hardware validation.", + SerializedName = @"result", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Pass", "Fail")] + string HardwareValidationStatusResult { get; } + /// + /// Field Deprecated. These fields will be empty/omitted. The list of the resource IDs for the HybridAksClusters that have + /// nodes hosted on this bare metal machine. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"Field Deprecated. These fields will be empty/omitted. The list of the resource IDs for the HybridAksClusters that have nodes hosted on this bare metal machine.", + SerializedName = @"hybridAksClustersAssociatedIds", + PossibleTypes = new [] { typeof(string) })] + System.Collections.Generic.List HybridAksClustersAssociatedId { get; } + /// + /// The name of this machine represented by the host object in the Cluster's Kubernetes control plane. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The name of this machine represented by the host object in the Cluster's Kubernetes control plane.", + SerializedName = @"kubernetesNodeName", + PossibleTypes = new [] { typeof(string) })] + string KubernetesNodeName { get; } + /// The version of Kubernetes running on this machine. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The version of Kubernetes running on this machine.", + SerializedName = @"kubernetesVersion", + PossibleTypes = new [] { typeof(string) })] + string KubernetesVersion { get; } + /// + /// The cluster version that has been applied to this machine during deployment or a version update. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The cluster version that has been applied to this machine during deployment or a version update.", + SerializedName = @"machineClusterVersion", + PossibleTypes = new [] { typeof(string) })] + string MachineClusterVersion { get; set; } + /// The custom details provided by the customer. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The custom details provided by the customer.", + SerializedName = @"machineDetails", + PossibleTypes = new [] { typeof(string) })] + string MachineDetail { get; set; } + /// The OS-level hostname assigned to this machine. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The OS-level hostname assigned to this machine.", + SerializedName = @"machineName", + PossibleTypes = new [] { typeof(string) })] + string MachineName { get; set; } + /// + /// The list of roles that are assigned to the cluster node running on this machine. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The list of roles that are assigned to the cluster node running on this machine.", + SerializedName = @"machineRoles", + PossibleTypes = new [] { typeof(string) })] + System.Collections.Generic.List MachineRole { get; } + /// The unique internal identifier of the bare metal machine SKU. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The unique internal identifier of the bare metal machine SKU.", + SerializedName = @"machineSkuId", + PossibleTypes = new [] { typeof(string) })] + string MachineSkuId { get; set; } + /// The image that is currently provisioned to the OS disk. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The image that is currently provisioned to the OS disk.", + SerializedName = @"osImage", + PossibleTypes = new [] { typeof(string) })] + string OSImage { get; } + /// + /// The IPv4 address that is assigned to the bare metal machine during the cluster deployment. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The IPv4 address that is assigned to the bare metal machine during the cluster deployment.", + SerializedName = @"oamIpv4Address", + PossibleTypes = new [] { typeof(string) })] + string OamIpv4Address { get; } + /// + /// The IPv6 address that is assigned to the bare metal machine during the cluster deployment. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The IPv6 address that is assigned to the bare metal machine during the cluster deployment.", + SerializedName = @"oamIpv6Address", + PossibleTypes = new [] { typeof(string) })] + string OamIpv6Address { get; } + /// The power state derived from the baseboard management controller. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The power state derived from the baseboard management controller.", + SerializedName = @"powerState", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("On", "Off")] + string PowerState { get; } + /// The provisioning state of the bare metal machine. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The provisioning state of the bare metal machine.", + SerializedName = @"provisioningState", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Succeeded", "Failed", "Canceled", "Provisioning", "Accepted")] + string ProvisioningState { get; } + /// The resource ID of the rack where this bare metal machine resides. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The resource ID of the rack where this bare metal machine resides.", + SerializedName = @"rackId", + PossibleTypes = new [] { typeof(string) })] + string RackId { get; set; } + /// + /// The rack slot in which this bare metal machine is located, ordered from the bottom up i.e. the lowest slot is 1. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The rack slot in which this bare metal machine is located, ordered from the bottom up i.e. the lowest slot is 1.", + SerializedName = @"rackSlot", + PossibleTypes = new [] { typeof(long) })] + long RackSlot { get; set; } + /// The indicator of whether the bare metal machine is ready to receive workloads. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The indicator of whether the bare metal machine is ready to receive workloads.", + SerializedName = @"readyState", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("True", "False")] + string ReadyState { get; } + /// The timestamp when the malware definitions were last updated. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The timestamp when the malware definitions were last updated.", + SerializedName = @"definitionsLastUpdated", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? RuntimeProtectionStatusDefinitionsLastUpdated { get; } + /// The version of the malware definitions. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The version of the malware definitions.", + SerializedName = @"definitionsVersion", + PossibleTypes = new [] { typeof(string) })] + string RuntimeProtectionStatusDefinitionsVersion { get; } + /// + /// The timestamp of the most recently completed scan, or empty if there has never been a scan. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The timestamp of the most recently completed scan, or empty if there has never been a scan.", + SerializedName = @"scanCompletedTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? RuntimeProtectionStatusScanCompletedTime { get; } + /// + /// The timestamp of the most recently scheduled scan, or empty if no scan has been scheduled. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The timestamp of the most recently scheduled scan, or empty if no scan has been scheduled.", + SerializedName = @"scanScheduledTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? RuntimeProtectionStatusScanScheduledTime { get; } + /// + /// The timestamp of the most recently started scan, or empty if there has never been a scan. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The timestamp of the most recently started scan, or empty if there has never been a scan.", + SerializedName = @"scanStartedTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? RuntimeProtectionStatusScanStartedTime { get; } + /// The list of statuses that represent secret rotation activity. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The list of statuses that represent secret rotation activity.", + SerializedName = @"secretRotationStatus", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISecretRotationStatus) })] + System.Collections.Generic.List SecretRotationStatus { get; } + /// The serial number of the bare metal machine. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The serial number of the bare metal machine.", + SerializedName = @"serialNumber", + PossibleTypes = new [] { typeof(string) })] + string SerialNumber { get; set; } + /// The discovered value of the machine's service tag. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The discovered value of the machine's service tag.", + SerializedName = @"serviceTag", + PossibleTypes = new [] { typeof(string) })] + string ServiceTag { get; } + /// + /// Field Deprecated. These fields will be empty/omitted. The list of the resource IDs for the VirtualMachines that are hosted + /// on this bare metal machine. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"Field Deprecated. These fields will be empty/omitted. The list of the resource IDs for the VirtualMachines that are hosted on this bare metal machine.", + SerializedName = @"virtualMachinesAssociatedIds", + PossibleTypes = new [] { typeof(string) })] + System.Collections.Generic.List VirtualMachinesAssociatedId { get; } + + } + /// BareMetalMachineProperties represents the properties of a bare metal machine. + internal partial interface IBareMetalMachinePropertiesInternal + + { + /// + /// The list of resource IDs for the other Microsoft.NetworkCloud resources that have attached this network. + /// + System.Collections.Generic.List AssociatedResourceId { get; set; } + /// + /// The connection string for the baseboard management controller including IP address and protocol. + /// + string BmcConnectionString { get; set; } + /// + /// The credentials of the baseboard management controller on this bare metal machine. + /// + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministrativeCredentials BmcCredentials { get; set; } + /// The password of the administrator of the device used during initialization. + System.Security.SecureString BmcCredentialsPassword { get; set; } + /// The username of the administrator of the device used during initialization. + string BmcCredentialsUsername { get; set; } + /// The MAC address of the BMC device. + string BmcMacAddress { get; set; } + /// The MAC address of a NIC connected to the PXE network. + string BootMacAddress { get; set; } + /// The resource ID of the cluster this bare metal machine is associated with. + string ClusterId { get; set; } + /// The cordon status of the bare metal machine. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Cordoned", "Uncordoned")] + string CordonStatus { get; set; } + /// The more detailed status of the bare metal machine. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Preparing", "Error", "Available", "Provisioning", "Provisioned", "Deprovisioning")] + string DetailedStatus { get; set; } + /// The descriptive message about the current detailed status. + string DetailedStatusMessage { get; set; } + /// + /// The hardware inventory, including information acquired from the model/sku information and from the ironic inspector. + /// + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IHardwareInventory HardwareInventory { get; set; } + /// + /// Freeform data extracted from the environment about this machine. This information varies depending on the specific hardware + /// and configuration. + /// + string HardwareInventoryAdditionalHostInformation { get; set; } + /// + /// The list of network interfaces and associated details for the bare metal machine. + /// + System.Collections.Generic.List HardwareInventoryInterface { get; set; } + /// + /// Field Deprecated. Will be removed in an upcoming version. The list of network interface cards and associated details for + /// the bare metal machine. + /// + System.Collections.Generic.List HardwareInventoryNic { get; set; } + /// + /// The details of the latest hardware validation performed for this bare metal machine. + /// + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IHardwareValidationStatus HardwareValidationStatus { get; set; } + /// The timestamp of the hardware validation execution. + global::System.DateTime? HardwareValidationStatusLastValidationTime { get; set; } + /// The outcome of the hardware validation. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Pass", "Fail")] + string HardwareValidationStatusResult { get; set; } + /// + /// Field Deprecated. These fields will be empty/omitted. The list of the resource IDs for the HybridAksClusters that have + /// nodes hosted on this bare metal machine. + /// + System.Collections.Generic.List HybridAksClustersAssociatedId { get; set; } + /// + /// The name of this machine represented by the host object in the Cluster's Kubernetes control plane. + /// + string KubernetesNodeName { get; set; } + /// The version of Kubernetes running on this machine. + string KubernetesVersion { get; set; } + /// + /// The cluster version that has been applied to this machine during deployment or a version update. + /// + string MachineClusterVersion { get; set; } + /// The custom details provided by the customer. + string MachineDetail { get; set; } + /// The OS-level hostname assigned to this machine. + string MachineName { get; set; } + /// + /// The list of roles that are assigned to the cluster node running on this machine. + /// + System.Collections.Generic.List MachineRole { get; set; } + /// The unique internal identifier of the bare metal machine SKU. + string MachineSkuId { get; set; } + /// The image that is currently provisioned to the OS disk. + string OSImage { get; set; } + /// + /// The IPv4 address that is assigned to the bare metal machine during the cluster deployment. + /// + string OamIpv4Address { get; set; } + /// + /// The IPv6 address that is assigned to the bare metal machine during the cluster deployment. + /// + string OamIpv6Address { get; set; } + /// The power state derived from the baseboard management controller. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("On", "Off")] + string PowerState { get; set; } + /// The provisioning state of the bare metal machine. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Succeeded", "Failed", "Canceled", "Provisioning", "Accepted")] + string ProvisioningState { get; set; } + /// The resource ID of the rack where this bare metal machine resides. + string RackId { get; set; } + /// + /// The rack slot in which this bare metal machine is located, ordered from the bottom up i.e. the lowest slot is 1. + /// + long RackSlot { get; set; } + /// The indicator of whether the bare metal machine is ready to receive workloads. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("True", "False")] + string ReadyState { get; set; } + /// The runtime protection status of the bare metal machine. + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRuntimeProtectionStatus RuntimeProtectionStatus { get; set; } + /// The timestamp when the malware definitions were last updated. + global::System.DateTime? RuntimeProtectionStatusDefinitionsLastUpdated { get; set; } + /// The version of the malware definitions. + string RuntimeProtectionStatusDefinitionsVersion { get; set; } + /// + /// The timestamp of the most recently completed scan, or empty if there has never been a scan. + /// + global::System.DateTime? RuntimeProtectionStatusScanCompletedTime { get; set; } + /// + /// The timestamp of the most recently scheduled scan, or empty if no scan has been scheduled. + /// + global::System.DateTime? RuntimeProtectionStatusScanScheduledTime { get; set; } + /// + /// The timestamp of the most recently started scan, or empty if there has never been a scan. + /// + global::System.DateTime? RuntimeProtectionStatusScanStartedTime { get; set; } + /// The list of statuses that represent secret rotation activity. + System.Collections.Generic.List SecretRotationStatus { get; set; } + /// The serial number of the bare metal machine. + string SerialNumber { get; set; } + /// The discovered value of the machine's service tag. + string ServiceTag { get; set; } + /// + /// Field Deprecated. These fields will be empty/omitted. The list of the resource IDs for the VirtualMachines that are hosted + /// on this bare metal machine. + /// + System.Collections.Generic.List VirtualMachinesAssociatedId { get; set; } + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineProperties.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineProperties.json.cs similarity index 83% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineProperties.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineProperties.json.cs index abf5ff0866bd..4b18653cfaff 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineProperties.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineProperties.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -65,49 +65,49 @@ internal BareMetalMachineProperties(Microsoft.Azure.PowerShell.Cmdlets.NetworkCl { return; } - {_bmcCredentials = If( json?.PropertyT("bmcCredentials"), out var __jsonBmcCredentials) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AdministrativeCredentials.FromJson(__jsonBmcCredentials) : BmcCredentials;} - {_hardwareInventory = If( json?.PropertyT("hardwareInventory"), out var __jsonHardwareInventory) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.HardwareInventory.FromJson(__jsonHardwareInventory) : HardwareInventory;} - {_hardwareValidationStatus = If( json?.PropertyT("hardwareValidationStatus"), out var __jsonHardwareValidationStatus) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.HardwareValidationStatus.FromJson(__jsonHardwareValidationStatus) : HardwareValidationStatus;} - {_runtimeProtectionStatus = If( json?.PropertyT("runtimeProtectionStatus"), out var __jsonRuntimeProtectionStatus) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.RuntimeProtectionStatus.FromJson(__jsonRuntimeProtectionStatus) : RuntimeProtectionStatus;} - {_associatedResourceId = If( json?.PropertyT("associatedResourceIds"), out var __jsonAssociatedResourceIds) ? If( __jsonAssociatedResourceIds as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : AssociatedResourceId;} - {_bmcConnectionString = If( json?.PropertyT("bmcConnectionString"), out var __jsonBmcConnectionString) ? (string)__jsonBmcConnectionString : (string)BmcConnectionString;} - {_bmcMacAddress = If( json?.PropertyT("bmcMacAddress"), out var __jsonBmcMacAddress) ? (string)__jsonBmcMacAddress : (string)BmcMacAddress;} - {_bootMacAddress = If( json?.PropertyT("bootMacAddress"), out var __jsonBootMacAddress) ? (string)__jsonBootMacAddress : (string)BootMacAddress;} - {_clusterId = If( json?.PropertyT("clusterId"), out var __jsonClusterId) ? (string)__jsonClusterId : (string)ClusterId;} - {_cordonStatus = If( json?.PropertyT("cordonStatus"), out var __jsonCordonStatus) ? (string)__jsonCordonStatus : (string)CordonStatus;} - {_detailedStatus = If( json?.PropertyT("detailedStatus"), out var __jsonDetailedStatus) ? (string)__jsonDetailedStatus : (string)DetailedStatus;} - {_detailedStatusMessage = If( json?.PropertyT("detailedStatusMessage"), out var __jsonDetailedStatusMessage) ? (string)__jsonDetailedStatusMessage : (string)DetailedStatusMessage;} - {_hybridAksClustersAssociatedId = If( json?.PropertyT("hybridAksClustersAssociatedIds"), out var __jsonHybridAksClustersAssociatedIds) ? If( __jsonHybridAksClustersAssociatedIds as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Json.JsonString __o ? (string)(__o.ToString()) : null)) ))() : null : HybridAksClustersAssociatedId;} - {_kubernetesNodeName = If( json?.PropertyT("kubernetesNodeName"), out var __jsonKubernetesNodeName) ? (string)__jsonKubernetesNodeName : (string)KubernetesNodeName;} - {_kubernetesVersion = If( json?.PropertyT("kubernetesVersion"), out var __jsonKubernetesVersion) ? (string)__jsonKubernetesVersion : (string)KubernetesVersion;} - {_machineClusterVersion = If( json?.PropertyT("machineClusterVersion"), out var __jsonMachineClusterVersion) ? (string)__jsonMachineClusterVersion : (string)MachineClusterVersion;} - {_machineDetail = If( json?.PropertyT("machineDetails"), out var __jsonMachineDetails) ? (string)__jsonMachineDetails : (string)MachineDetail;} - {_machineName = If( json?.PropertyT("machineName"), out var __jsonMachineName) ? (string)__jsonMachineName : (string)MachineName;} - {_machineRole = If( json?.PropertyT("machineRoles"), out var __jsonMachineRoles) ? If( __jsonMachineRoles as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Json.JsonString __j ? (string)(__j.ToString()) : null)) ))() : null : MachineRole;} - {_machineSkuId = If( json?.PropertyT("machineSkuId"), out var __jsonMachineSkuId) ? (string)__jsonMachineSkuId : (string)MachineSkuId;} - {_oamIpv4Address = If( json?.PropertyT("oamIpv4Address"), out var __jsonOamIpv4Address) ? (string)__jsonOamIpv4Address : (string)OamIpv4Address;} - {_oamIpv6Address = If( json?.PropertyT("oamIpv6Address"), out var __jsonOamIpv6Address) ? (string)__jsonOamIpv6Address : (string)OamIpv6Address;} - {_oSImage = If( json?.PropertyT("osImage"), out var __jsonOSImage) ? (string)__jsonOSImage : (string)OSImage;} - {_powerState = If( json?.PropertyT("powerState"), out var __jsonPowerState) ? (string)__jsonPowerState : (string)PowerState;} - {_provisioningState = If( json?.PropertyT("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)ProvisioningState;} - {_rackId = If( json?.PropertyT("rackId"), out var __jsonRackId) ? (string)__jsonRackId : (string)RackId;} - {_rackSlot = If( json?.PropertyT("rackSlot"), out var __jsonRackSlot) ? (long)__jsonRackSlot : RackSlot;} - {_readyState = If( json?.PropertyT("readyState"), out var __jsonReadyState) ? (string)__jsonReadyState : (string)ReadyState;} - {_secretRotationStatus = If( json?.PropertyT("secretRotationStatus"), out var __jsonSecretRotationStatus) ? If( __jsonSecretRotationStatus as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonArray, out var __g) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__g, (__f)=>(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretRotationStatus) (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.SecretRotationStatus.FromJson(__f) )) ))() : null : SecretRotationStatus;} - {_serialNumber = If( json?.PropertyT("serialNumber"), out var __jsonSerialNumber) ? (string)__jsonSerialNumber : (string)SerialNumber;} - {_serviceTag = If( json?.PropertyT("serviceTag"), out var __jsonServiceTag) ? (string)__jsonServiceTag : (string)ServiceTag;} - {_virtualMachinesAssociatedId = If( json?.PropertyT("virtualMachinesAssociatedIds"), out var __jsonVirtualMachinesAssociatedIds) ? If( __jsonVirtualMachinesAssociatedIds as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonArray, out var __b) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__b, (__a)=>(string) (__a is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString ___z ? (string)(___z.ToString()) : null)) ))() : null : VirtualMachinesAssociatedId;} + {_bmcCredentials = If( json?.PropertyT("bmcCredentials"), out var __jsonBmcCredentials) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AdministrativeCredentials.FromJson(__jsonBmcCredentials) : _bmcCredentials;} + {_hardwareInventory = If( json?.PropertyT("hardwareInventory"), out var __jsonHardwareInventory) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.HardwareInventory.FromJson(__jsonHardwareInventory) : _hardwareInventory;} + {_hardwareValidationStatus = If( json?.PropertyT("hardwareValidationStatus"), out var __jsonHardwareValidationStatus) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.HardwareValidationStatus.FromJson(__jsonHardwareValidationStatus) : _hardwareValidationStatus;} + {_runtimeProtectionStatus = If( json?.PropertyT("runtimeProtectionStatus"), out var __jsonRuntimeProtectionStatus) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.RuntimeProtectionStatus.FromJson(__jsonRuntimeProtectionStatus) : _runtimeProtectionStatus;} + {_associatedResourceId = If( json?.PropertyT("associatedResourceIds"), out var __jsonAssociatedResourceIds) ? If( __jsonAssociatedResourceIds as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : _associatedResourceId;} + {_bmcConnectionString = If( json?.PropertyT("bmcConnectionString"), out var __jsonBmcConnectionString) ? (string)__jsonBmcConnectionString : (string)_bmcConnectionString;} + {_bmcMacAddress = If( json?.PropertyT("bmcMacAddress"), out var __jsonBmcMacAddress) ? (string)__jsonBmcMacAddress : (string)_bmcMacAddress;} + {_bootMacAddress = If( json?.PropertyT("bootMacAddress"), out var __jsonBootMacAddress) ? (string)__jsonBootMacAddress : (string)_bootMacAddress;} + {_clusterId = If( json?.PropertyT("clusterId"), out var __jsonClusterId) ? (string)__jsonClusterId : (string)_clusterId;} + {_cordonStatus = If( json?.PropertyT("cordonStatus"), out var __jsonCordonStatus) ? (string)__jsonCordonStatus : (string)_cordonStatus;} + {_detailedStatus = If( json?.PropertyT("detailedStatus"), out var __jsonDetailedStatus) ? (string)__jsonDetailedStatus : (string)_detailedStatus;} + {_detailedStatusMessage = If( json?.PropertyT("detailedStatusMessage"), out var __jsonDetailedStatusMessage) ? (string)__jsonDetailedStatusMessage : (string)_detailedStatusMessage;} + {_hybridAksClustersAssociatedId = If( json?.PropertyT("hybridAksClustersAssociatedIds"), out var __jsonHybridAksClustersAssociatedIds) ? If( __jsonHybridAksClustersAssociatedIds as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Json.JsonString __o ? (string)(__o.ToString()) : null)) ))() : null : _hybridAksClustersAssociatedId;} + {_kubernetesNodeName = If( json?.PropertyT("kubernetesNodeName"), out var __jsonKubernetesNodeName) ? (string)__jsonKubernetesNodeName : (string)_kubernetesNodeName;} + {_kubernetesVersion = If( json?.PropertyT("kubernetesVersion"), out var __jsonKubernetesVersion) ? (string)__jsonKubernetesVersion : (string)_kubernetesVersion;} + {_machineClusterVersion = If( json?.PropertyT("machineClusterVersion"), out var __jsonMachineClusterVersion) ? (string)__jsonMachineClusterVersion : (string)_machineClusterVersion;} + {_machineDetail = If( json?.PropertyT("machineDetails"), out var __jsonMachineDetails) ? (string)__jsonMachineDetails : (string)_machineDetail;} + {_machineName = If( json?.PropertyT("machineName"), out var __jsonMachineName) ? (string)__jsonMachineName : (string)_machineName;} + {_machineRole = If( json?.PropertyT("machineRoles"), out var __jsonMachineRoles) ? If( __jsonMachineRoles as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Json.JsonString __j ? (string)(__j.ToString()) : null)) ))() : null : _machineRole;} + {_machineSkuId = If( json?.PropertyT("machineSkuId"), out var __jsonMachineSkuId) ? (string)__jsonMachineSkuId : (string)_machineSkuId;} + {_oamIpv4Address = If( json?.PropertyT("oamIpv4Address"), out var __jsonOamIpv4Address) ? (string)__jsonOamIpv4Address : (string)_oamIpv4Address;} + {_oamIpv6Address = If( json?.PropertyT("oamIpv6Address"), out var __jsonOamIpv6Address) ? (string)__jsonOamIpv6Address : (string)_oamIpv6Address;} + {_oSImage = If( json?.PropertyT("osImage"), out var __jsonOSImage) ? (string)__jsonOSImage : (string)_oSImage;} + {_powerState = If( json?.PropertyT("powerState"), out var __jsonPowerState) ? (string)__jsonPowerState : (string)_powerState;} + {_provisioningState = If( json?.PropertyT("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)_provisioningState;} + {_rackId = If( json?.PropertyT("rackId"), out var __jsonRackId) ? (string)__jsonRackId : (string)_rackId;} + {_rackSlot = If( json?.PropertyT("rackSlot"), out var __jsonRackSlot) ? (long)__jsonRackSlot : _rackSlot;} + {_readyState = If( json?.PropertyT("readyState"), out var __jsonReadyState) ? (string)__jsonReadyState : (string)_readyState;} + {_secretRotationStatus = If( json?.PropertyT("secretRotationStatus"), out var __jsonSecretRotationStatus) ? If( __jsonSecretRotationStatus as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonArray, out var __g) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__g, (__f)=>(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISecretRotationStatus) (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.SecretRotationStatus.FromJson(__f) )) ))() : null : _secretRotationStatus;} + {_serialNumber = If( json?.PropertyT("serialNumber"), out var __jsonSerialNumber) ? (string)__jsonSerialNumber : (string)_serialNumber;} + {_serviceTag = If( json?.PropertyT("serviceTag"), out var __jsonServiceTag) ? (string)__jsonServiceTag : (string)_serviceTag;} + {_virtualMachinesAssociatedId = If( json?.PropertyT("virtualMachinesAssociatedIds"), out var __jsonVirtualMachinesAssociatedIds) ? If( __jsonVirtualMachinesAssociatedIds as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonArray, out var __b) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__b, (__a)=>(string) (__a is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString ___z ? (string)(___z.ToString()) : null)) ))() : null : _virtualMachinesAssociatedId;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new BareMetalMachineProperties(json) : null; } @@ -132,19 +132,19 @@ public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode ToJ return container; } AddIf( null != this._bmcCredentials ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) this._bmcCredentials.ToJson(null,serializationMode) : null, "bmcCredentials" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != this._hardwareInventory ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) this._hardwareInventory.ToJson(null,serializationMode) : null, "hardwareInventory" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != this._hardwareValidationStatus ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) this._hardwareValidationStatus.ToJson(null,serializationMode) : null, "hardwareValidationStatus" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != this._runtimeProtectionStatus ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) this._runtimeProtectionStatus.ToJson(null,serializationMode) : null, "runtimeProtectionStatus" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { if (null != this._associatedResourceId) { @@ -159,23 +159,23 @@ public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode ToJ AddIf( null != (((object)this._bmcConnectionString)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._bmcConnectionString.ToString()) : null, "bmcConnectionString" ,container.Add ); AddIf( null != (((object)this._bmcMacAddress)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._bmcMacAddress.ToString()) : null, "bmcMacAddress" ,container.Add ); AddIf( null != (((object)this._bootMacAddress)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._bootMacAddress.ToString()) : null, "bootMacAddress" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._clusterId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._clusterId.ToString()) : null, "clusterId" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._cordonStatus)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._cordonStatus.ToString()) : null, "cordonStatus" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._detailedStatus)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._detailedStatus.ToString()) : null, "detailedStatus" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._detailedStatusMessage)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._detailedStatusMessage.ToString()) : null, "detailedStatusMessage" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { if (null != this._hybridAksClustersAssociatedId) { @@ -187,18 +187,18 @@ public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode ToJ container.Add("hybridAksClustersAssociatedIds",__r); } } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._kubernetesNodeName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._kubernetesNodeName.ToString()) : null, "kubernetesNodeName" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._kubernetesVersion)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._kubernetesVersion.ToString()) : null, "kubernetesVersion" ,container.Add ); } AddIf( null != (((object)this._machineClusterVersion)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._machineClusterVersion.ToString()) : null, "machineClusterVersion" ,container.Add ); AddIf( null != (((object)this._machineDetail)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._machineDetail.ToString()) : null, "machineDetails" ,container.Add ); AddIf( null != (((object)this._machineName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._machineName.ToString()) : null, "machineName" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { if (null != this._machineRole) { @@ -211,33 +211,33 @@ public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode ToJ } } AddIf( null != (((object)this._machineSkuId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._machineSkuId.ToString()) : null, "machineSkuId" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._oamIpv4Address)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._oamIpv4Address.ToString()) : null, "oamIpv4Address" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._oamIpv6Address)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._oamIpv6Address.ToString()) : null, "oamIpv6Address" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._oSImage)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._oSImage.ToString()) : null, "osImage" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._powerState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._powerState.ToString()) : null, "powerState" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._provisioningState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._provisioningState.ToString()) : null, "provisioningState" ,container.Add ); } AddIf( null != (((object)this._rackId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._rackId.ToString()) : null, "rackId" ,container.Add ); AddIf( (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNumber(this._rackSlot), "rackSlot" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._readyState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._readyState.ToString()) : null, "readyState" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { if (null != this._secretRotationStatus) { @@ -250,11 +250,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode ToJ } } AddIf( null != (((object)this._serialNumber)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._serialNumber.ToString()) : null, "serialNumber" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._serviceTag)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._serviceTag.ToString()) : null, "serviceTag" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { if (null != this._virtualMachinesAssociatedId) { diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineReplaceParameters.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineReplaceParameters.PowerShell.cs new file mode 100644 index 000000000000..ce374719aa4e --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineReplaceParameters.PowerShell.cs @@ -0,0 +1,216 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + + /// + /// BareMetalMachineReplaceParameters represents the body of the request to physically swap a bare metal machine for another. + /// + [System.ComponentModel.TypeConverter(typeof(BareMetalMachineReplaceParametersTypeConverter))] + public partial class BareMetalMachineReplaceParameters + { + + /// + /// 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 BareMetalMachineReplaceParameters(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("BmcCredentials")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineReplaceParametersInternal)this).BmcCredentials = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministrativeCredentials) content.GetValueForProperty("BmcCredentials",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineReplaceParametersInternal)this).BmcCredentials, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AdministrativeCredentialsTypeConverter.ConvertFrom); + } + if (content.Contains("BmcMacAddress")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineReplaceParametersInternal)this).BmcMacAddress = (string) content.GetValueForProperty("BmcMacAddress",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineReplaceParametersInternal)this).BmcMacAddress, global::System.Convert.ToString); + } + if (content.Contains("BootMacAddress")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineReplaceParametersInternal)this).BootMacAddress = (string) content.GetValueForProperty("BootMacAddress",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineReplaceParametersInternal)this).BootMacAddress, global::System.Convert.ToString); + } + if (content.Contains("MachineName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineReplaceParametersInternal)this).MachineName = (string) content.GetValueForProperty("MachineName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineReplaceParametersInternal)this).MachineName, global::System.Convert.ToString); + } + if (content.Contains("SerialNumber")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineReplaceParametersInternal)this).SerialNumber = (string) content.GetValueForProperty("SerialNumber",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineReplaceParametersInternal)this).SerialNumber, global::System.Convert.ToString); + } + if (content.Contains("BmcCredentialsPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineReplaceParametersInternal)this).BmcCredentialsPassword = (System.Security.SecureString) content.GetValueForProperty("BmcCredentialsPassword",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineReplaceParametersInternal)this).BmcCredentialsPassword, (object ss) => (System.Security.SecureString)ss); + } + if (content.Contains("BmcCredentialsUsername")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineReplaceParametersInternal)this).BmcCredentialsUsername = (string) content.GetValueForProperty("BmcCredentialsUsername",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineReplaceParametersInternal)this).BmcCredentialsUsername, 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 BareMetalMachineReplaceParameters(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("BmcCredentials")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineReplaceParametersInternal)this).BmcCredentials = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministrativeCredentials) content.GetValueForProperty("BmcCredentials",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineReplaceParametersInternal)this).BmcCredentials, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AdministrativeCredentialsTypeConverter.ConvertFrom); + } + if (content.Contains("BmcMacAddress")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineReplaceParametersInternal)this).BmcMacAddress = (string) content.GetValueForProperty("BmcMacAddress",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineReplaceParametersInternal)this).BmcMacAddress, global::System.Convert.ToString); + } + if (content.Contains("BootMacAddress")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineReplaceParametersInternal)this).BootMacAddress = (string) content.GetValueForProperty("BootMacAddress",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineReplaceParametersInternal)this).BootMacAddress, global::System.Convert.ToString); + } + if (content.Contains("MachineName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineReplaceParametersInternal)this).MachineName = (string) content.GetValueForProperty("MachineName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineReplaceParametersInternal)this).MachineName, global::System.Convert.ToString); + } + if (content.Contains("SerialNumber")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineReplaceParametersInternal)this).SerialNumber = (string) content.GetValueForProperty("SerialNumber",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineReplaceParametersInternal)this).SerialNumber, global::System.Convert.ToString); + } + if (content.Contains("BmcCredentialsPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineReplaceParametersInternal)this).BmcCredentialsPassword = (System.Security.SecureString) content.GetValueForProperty("BmcCredentialsPassword",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineReplaceParametersInternal)this).BmcCredentialsPassword, (object ss) => (System.Security.SecureString)ss); + } + if (content.Contains("BmcCredentialsUsername")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineReplaceParametersInternal)this).BmcCredentialsUsername = (string) content.GetValueForProperty("BmcCredentialsUsername",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineReplaceParametersInternal)this).BmcCredentialsUsername, 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.NetworkCloud.Models.IBareMetalMachineReplaceParameters DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new BareMetalMachineReplaceParameters(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.NetworkCloud.Models.IBareMetalMachineReplaceParameters DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new BareMetalMachineReplaceParameters(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.NetworkCloud.Models.IBareMetalMachineReplaceParameters FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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(); + } + } + /// BareMetalMachineReplaceParameters represents the body of the request to physically swap a bare metal machine for another. + [System.ComponentModel.TypeConverter(typeof(BareMetalMachineReplaceParametersTypeConverter))] + public partial interface IBareMetalMachineReplaceParameters + + { + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineReplaceParameters.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineReplaceParameters.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineReplaceParameters.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineReplaceParameters.TypeConverter.cs index 8bf75d8f42d2..69a55acea731 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineReplaceParameters.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineReplaceParameters.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IBareMetalMachineReplaceParameters ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineReplaceParameters ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineReplaceParameters).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineReplaceParameters).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineReplaceParameters.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineReplaceParameters.cs similarity index 81% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineReplaceParameters.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineReplaceParameters.cs index 63b9e1e09854..59078ade9a15 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineReplaceParameters.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineReplaceParameters.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -11,12 +11,12 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201 /// BareMetalMachineReplaceParameters represents the body of the request to physically swap a bare metal machine for another. /// public partial class BareMetalMachineReplaceParameters : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineReplaceParameters, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineReplaceParametersInternal + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineReplaceParameters, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineReplaceParametersInternal { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministrativeCredentials _bmcCredentials; + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministrativeCredentials _bmcCredentials; /// /// The credentials of the baseboard management controller on this bare metal machine. The password field is expected to be @@ -24,15 +24,15 @@ public partial class BareMetalMachineReplaceParameters : /// the actual password value should be provided instead. /// [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministrativeCredentials BmcCredentials { get => (this._bmcCredentials = this._bmcCredentials ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AdministrativeCredentials()); set => this._bmcCredentials = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministrativeCredentials BmcCredentials { get => (this._bmcCredentials = this._bmcCredentials ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AdministrativeCredentials()); set => this._bmcCredentials = value; } /// The password of the administrator of the device used during initialization. [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public System.Security.SecureString BmcCredentialsPassword { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministrativeCredentialsInternal)BmcCredentials).Password; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministrativeCredentialsInternal)BmcCredentials).Password = value ?? null; } + public System.Security.SecureString BmcCredentialsPassword { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministrativeCredentialsInternal)BmcCredentials).Password; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministrativeCredentialsInternal)BmcCredentials).Password = value ?? null; } /// The username of the administrator of the device used during initialization. [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string BmcCredentialsUsername { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministrativeCredentialsInternal)BmcCredentials).Username; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministrativeCredentialsInternal)BmcCredentials).Username = value ?? null; } + public string BmcCredentialsUsername { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministrativeCredentialsInternal)BmcCredentials).Username; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministrativeCredentialsInternal)BmcCredentials).Username = value ?? null; } /// Backing field for property. private string _bmcMacAddress; @@ -56,7 +56,7 @@ public partial class BareMetalMachineReplaceParameters : public string MachineName { get => this._machineName; set => this._machineName = value; } /// Internal Acessors for BmcCredentials - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministrativeCredentials Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineReplaceParametersInternal.BmcCredentials { get => (this._bmcCredentials = this._bmcCredentials ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AdministrativeCredentials()); set { {_bmcCredentials = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministrativeCredentials Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineReplaceParametersInternal.BmcCredentials { get => (this._bmcCredentials = this._bmcCredentials ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AdministrativeCredentials()); set { {_bmcCredentials = value;} } } /// Backing field for property. private string _serialNumber; @@ -79,6 +79,9 @@ public partial interface IBareMetalMachineReplaceParameters : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The password of the administrator of the device used during initialization.", SerializedName = @"password", PossibleTypes = new [] { typeof(System.Security.SecureString) })] @@ -87,6 +90,9 @@ public partial interface IBareMetalMachineReplaceParameters : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The username of the administrator of the device used during initialization.", SerializedName = @"username", PossibleTypes = new [] { typeof(string) })] @@ -95,6 +101,9 @@ public partial interface IBareMetalMachineReplaceParameters : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The MAC address of the BMC device.", SerializedName = @"bmcMacAddress", PossibleTypes = new [] { typeof(string) })] @@ -103,6 +112,9 @@ public partial interface IBareMetalMachineReplaceParameters : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The MAC address of a NIC connected to the PXE network.", SerializedName = @"bootMacAddress", PossibleTypes = new [] { typeof(string) })] @@ -111,6 +123,9 @@ public partial interface IBareMetalMachineReplaceParameters : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The OS-level hostname assigned to this machine.", SerializedName = @"machineName", PossibleTypes = new [] { typeof(string) })] @@ -119,6 +134,9 @@ public partial interface IBareMetalMachineReplaceParameters : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The serial number of the bare metal machine.", SerializedName = @"serialNumber", PossibleTypes = new [] { typeof(string) })] @@ -134,7 +152,7 @@ internal partial interface IBareMetalMachineReplaceParametersInternal /// an Azure Key Vault key URL. Until the cluster is converted to utilize managed identity by setting the secret archive settings, /// the actual password value should be provided instead. /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministrativeCredentials BmcCredentials { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministrativeCredentials BmcCredentials { get; set; } /// The password of the administrator of the device used during initialization. System.Security.SecureString BmcCredentialsPassword { get; set; } /// The username of the administrator of the device used during initialization. diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineReplaceParameters.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineReplaceParameters.json.cs similarity index 93% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineReplaceParameters.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineReplaceParameters.json.cs index f10eff78d690..87aef3fc1fb1 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineReplaceParameters.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineReplaceParameters.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -67,22 +67,22 @@ internal BareMetalMachineReplaceParameters(Microsoft.Azure.PowerShell.Cmdlets.Ne { return; } - {_bmcCredentials = If( json?.PropertyT("bmcCredentials"), out var __jsonBmcCredentials) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AdministrativeCredentials.FromJson(__jsonBmcCredentials) : BmcCredentials;} - {_bmcMacAddress = If( json?.PropertyT("bmcMacAddress"), out var __jsonBmcMacAddress) ? (string)__jsonBmcMacAddress : (string)BmcMacAddress;} - {_bootMacAddress = If( json?.PropertyT("bootMacAddress"), out var __jsonBootMacAddress) ? (string)__jsonBootMacAddress : (string)BootMacAddress;} - {_machineName = If( json?.PropertyT("machineName"), out var __jsonMachineName) ? (string)__jsonMachineName : (string)MachineName;} - {_serialNumber = If( json?.PropertyT("serialNumber"), out var __jsonSerialNumber) ? (string)__jsonSerialNumber : (string)SerialNumber;} + {_bmcCredentials = If( json?.PropertyT("bmcCredentials"), out var __jsonBmcCredentials) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AdministrativeCredentials.FromJson(__jsonBmcCredentials) : _bmcCredentials;} + {_bmcMacAddress = If( json?.PropertyT("bmcMacAddress"), out var __jsonBmcMacAddress) ? (string)__jsonBmcMacAddress : (string)_bmcMacAddress;} + {_bootMacAddress = If( json?.PropertyT("bootMacAddress"), out var __jsonBootMacAddress) ? (string)__jsonBootMacAddress : (string)_bootMacAddress;} + {_machineName = If( json?.PropertyT("machineName"), out var __jsonMachineName) ? (string)__jsonMachineName : (string)_machineName;} + {_serialNumber = If( json?.PropertyT("serialNumber"), out var __jsonSerialNumber) ? (string)__jsonSerialNumber : (string)_serialNumber;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineReplaceParameters. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineReplaceParameters. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineReplaceParameters. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineReplaceParameters. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineReplaceParameters FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineReplaceParameters FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new BareMetalMachineReplaceParameters(json) : null; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineRunCommandParameters.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineRunCommandParameters.PowerShell.cs new file mode 100644 index 000000000000..c1e78eecc048 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineRunCommandParameters.PowerShell.cs @@ -0,0 +1,186 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + + /// + /// BareMetalMachineRunCommandParameters represents the body of the request to execute a script on the bare metal machine. + /// + [System.ComponentModel.TypeConverter(typeof(BareMetalMachineRunCommandParametersTypeConverter))] + public partial class BareMetalMachineRunCommandParameters + { + + /// + /// 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 BareMetalMachineRunCommandParameters(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Argument")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineRunCommandParametersInternal)this).Argument = (System.Collections.Generic.List) content.GetValueForProperty("Argument",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineRunCommandParametersInternal)this).Argument, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("LimitTimeSecond")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineRunCommandParametersInternal)this).LimitTimeSecond = (long) content.GetValueForProperty("LimitTimeSecond",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineRunCommandParametersInternal)this).LimitTimeSecond, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("Script")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineRunCommandParametersInternal)this).Script = (string) content.GetValueForProperty("Script",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineRunCommandParametersInternal)this).Script, 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 BareMetalMachineRunCommandParameters(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Argument")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineRunCommandParametersInternal)this).Argument = (System.Collections.Generic.List) content.GetValueForProperty("Argument",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineRunCommandParametersInternal)this).Argument, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("LimitTimeSecond")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineRunCommandParametersInternal)this).LimitTimeSecond = (long) content.GetValueForProperty("LimitTimeSecond",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineRunCommandParametersInternal)this).LimitTimeSecond, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("Script")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineRunCommandParametersInternal)this).Script = (string) content.GetValueForProperty("Script",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineRunCommandParametersInternal)this).Script, 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.NetworkCloud.Models.IBareMetalMachineRunCommandParameters DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new BareMetalMachineRunCommandParameters(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.NetworkCloud.Models.IBareMetalMachineRunCommandParameters DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new BareMetalMachineRunCommandParameters(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.NetworkCloud.Models.IBareMetalMachineRunCommandParameters FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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(); + } + } + /// BareMetalMachineRunCommandParameters represents the body of the request to execute a script on the bare metal machine. + [System.ComponentModel.TypeConverter(typeof(BareMetalMachineRunCommandParametersTypeConverter))] + public partial interface IBareMetalMachineRunCommandParameters + + { + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineRunCommandParameters.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineRunCommandParameters.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineRunCommandParameters.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineRunCommandParameters.TypeConverter.cs index f93b09753d22..918fe51ab12b 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineRunCommandParameters.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineRunCommandParameters.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IBareMetalMachineRunCommandParameters ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineRunCommandParameters ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineRunCommandParameters).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineRunCommandParameters).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineRunCommandParameters.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineRunCommandParameters.cs similarity index 87% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineRunCommandParameters.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineRunCommandParameters.cs index 28d94a685e17..cde1a21a69db 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineRunCommandParameters.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineRunCommandParameters.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -11,18 +11,18 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201 /// BareMetalMachineRunCommandParameters represents the body of the request to execute a script on the bare metal machine. /// public partial class BareMetalMachineRunCommandParameters : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineRunCommandParameters, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineRunCommandParametersInternal + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineRunCommandParameters, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineRunCommandParametersInternal { /// Backing field for property. - private string[] _argument; + private System.Collections.Generic.List _argument; /// /// The list of string arguments that will be passed to the script in order as separate arguments. /// [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string[] Argument { get => this._argument; set => this._argument = value; } + public System.Collections.Generic.List Argument { get => this._argument; set => this._argument = value; } /// Backing field for property. private long _limitTimeSecond; @@ -58,10 +58,13 @@ public partial interface IBareMetalMachineRunCommandParameters : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The list of string arguments that will be passed to the script in order as separate arguments.", SerializedName = @"arguments", PossibleTypes = new [] { typeof(string) })] - string[] Argument { get; set; } + System.Collections.Generic.List Argument { get; set; } /// /// The maximum time the script is allowed to run. /// If the execution time exceeds the maximum, the script will be stopped, any output produced until then will be captured, @@ -70,6 +73,9 @@ public partial interface IBareMetalMachineRunCommandParameters : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The maximum time the script is allowed to run. If the execution time exceeds the maximum, the script will be stopped, any output produced until then will be captured, and the exit code matching a timeout will be returned (252).", SerializedName = @"limitTimeSeconds", @@ -79,6 +85,9 @@ public partial interface IBareMetalMachineRunCommandParameters : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The base64 encoded script to execute on the bare metal machine.", SerializedName = @"script", PossibleTypes = new [] { typeof(string) })] @@ -92,7 +101,7 @@ internal partial interface IBareMetalMachineRunCommandParametersInternal /// /// The list of string arguments that will be passed to the script in order as separate arguments. /// - string[] Argument { get; set; } + System.Collections.Generic.List Argument { get; set; } /// /// The maximum time the script is allowed to run. /// If the execution time exceeds the maximum, the script will be stopped, any output produced until then will be captured, diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineRunCommandParameters.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineRunCommandParameters.json.cs similarity index 91% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineRunCommandParameters.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineRunCommandParameters.json.cs index 1c12ed1a760b..31fe0d536d37 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineRunCommandParameters.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineRunCommandParameters.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -67,20 +67,20 @@ internal BareMetalMachineRunCommandParameters(Microsoft.Azure.PowerShell.Cmdlets { return; } - {_argument = If( json?.PropertyT("arguments"), out var __jsonArguments) ? If( __jsonArguments as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : Argument;} - {_limitTimeSecond = If( json?.PropertyT("limitTimeSeconds"), out var __jsonLimitTimeSeconds) ? (long)__jsonLimitTimeSeconds : LimitTimeSecond;} - {_script = If( json?.PropertyT("script"), out var __jsonScript) ? (string)__jsonScript : (string)Script;} + {_argument = If( json?.PropertyT("arguments"), out var __jsonArguments) ? If( __jsonArguments as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : _argument;} + {_limitTimeSecond = If( json?.PropertyT("limitTimeSeconds"), out var __jsonLimitTimeSeconds) ? (long)__jsonLimitTimeSeconds : _limitTimeSecond;} + {_script = If( json?.PropertyT("script"), out var __jsonScript) ? (string)__jsonScript : (string)_script;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineRunCommandParameters. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineRunCommandParameters. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineRunCommandParameters. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineRunCommandParameters. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineRunCommandParameters FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineRunCommandParameters FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new BareMetalMachineRunCommandParameters(json) : null; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineRunDataExtractsParameters.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineRunDataExtractsParameters.PowerShell.cs new file mode 100644 index 000000000000..bf92573f9e80 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineRunDataExtractsParameters.PowerShell.cs @@ -0,0 +1,181 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + + /// + /// BareMetalMachineRunDataExtractsParameters represents the body of request containing list of curated data extraction commands + /// to run on the bare metal machine. + /// + [System.ComponentModel.TypeConverter(typeof(BareMetalMachineRunDataExtractsParametersTypeConverter))] + public partial class BareMetalMachineRunDataExtractsParameters + { + + /// + /// 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 BareMetalMachineRunDataExtractsParameters(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Command")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineRunDataExtractsParametersInternal)this).Command = (System.Collections.Generic.List) content.GetValueForProperty("Command",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineRunDataExtractsParametersInternal)this).Command, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BareMetalMachineCommandSpecificationTypeConverter.ConvertFrom)); + } + if (content.Contains("LimitTimeSecond")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineRunDataExtractsParametersInternal)this).LimitTimeSecond = (long) content.GetValueForProperty("LimitTimeSecond",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineRunDataExtractsParametersInternal)this).LimitTimeSecond, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal BareMetalMachineRunDataExtractsParameters(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Command")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineRunDataExtractsParametersInternal)this).Command = (System.Collections.Generic.List) content.GetValueForProperty("Command",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineRunDataExtractsParametersInternal)this).Command, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BareMetalMachineCommandSpecificationTypeConverter.ConvertFrom)); + } + if (content.Contains("LimitTimeSecond")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineRunDataExtractsParametersInternal)this).LimitTimeSecond = (long) content.GetValueForProperty("LimitTimeSecond",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineRunDataExtractsParametersInternal)this).LimitTimeSecond, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + 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.NetworkCloud.Models.IBareMetalMachineRunDataExtractsParameters DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new BareMetalMachineRunDataExtractsParameters(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.NetworkCloud.Models.IBareMetalMachineRunDataExtractsParameters DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new BareMetalMachineRunDataExtractsParameters(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.NetworkCloud.Models.IBareMetalMachineRunDataExtractsParameters FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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(); + } + } + /// BareMetalMachineRunDataExtractsParameters represents the body of request containing list of curated data extraction commands + /// to run on the bare metal machine. + [System.ComponentModel.TypeConverter(typeof(BareMetalMachineRunDataExtractsParametersTypeConverter))] + public partial interface IBareMetalMachineRunDataExtractsParameters + + { + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineRunDataExtractsParameters.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineRunDataExtractsParameters.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineRunDataExtractsParameters.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineRunDataExtractsParameters.TypeConverter.cs index 9d1d2330efde..6152db46bab3 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineRunDataExtractsParameters.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineRunDataExtractsParameters.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IBareMetalMachineRunDataExtractsParameters ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineRunDataExtractsParameters ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineRunDataExtractsParameters).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineRunDataExtractsParameters).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineRunDataExtractsParameters.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineRunDataExtractsParameters.cs similarity index 80% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineRunDataExtractsParameters.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineRunDataExtractsParameters.cs index 38554f315c86..e29fe9adabdc 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineRunDataExtractsParameters.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineRunDataExtractsParameters.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -12,18 +12,18 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201 /// to run on the bare metal machine. /// public partial class BareMetalMachineRunDataExtractsParameters : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineRunDataExtractsParameters, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineRunDataExtractsParametersInternal + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineRunDataExtractsParameters, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineRunDataExtractsParametersInternal { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineCommandSpecification[] _command; + private System.Collections.Generic.List _command; /// /// The list of curated data extraction commands to be executed directly against the target machine. /// [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineCommandSpecification[] Command { get => this._command; set => this._command = value; } + public System.Collections.Generic.List Command { get => this._command; set => this._command = value; } /// Backing field for property. private long _limitTimeSecond; @@ -55,10 +55,13 @@ public partial interface IBareMetalMachineRunDataExtractsParameters : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The list of curated data extraction commands to be executed directly against the target machine.", SerializedName = @"commands", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineCommandSpecification) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineCommandSpecification[] Command { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineCommandSpecification) })] + System.Collections.Generic.List Command { get; set; } /// /// The maximum time the commands are allowed to run. /// If the execution time exceeds the maximum, the script will be stopped, any output produced until then will be captured, @@ -67,6 +70,9 @@ public partial interface IBareMetalMachineRunDataExtractsParameters : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The maximum time the commands are allowed to run. If the execution time exceeds the maximum, the script will be stopped, any output produced until then will be captured, and the exit code matching a timeout will be returned (252).", SerializedName = @"limitTimeSeconds", @@ -82,7 +88,7 @@ internal partial interface IBareMetalMachineRunDataExtractsParametersInternal /// /// The list of curated data extraction commands to be executed directly against the target machine. /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineCommandSpecification[] Command { get; set; } + System.Collections.Generic.List Command { get; set; } /// /// The maximum time the commands are allowed to run. /// If the execution time exceeds the maximum, the script will be stopped, any output produced until then will be captured, diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineRunDataExtractsParameters.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineRunDataExtractsParameters.json.cs similarity index 89% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineRunDataExtractsParameters.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineRunDataExtractsParameters.json.cs index fc2ed7d952d7..a35f3afc4084 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineRunDataExtractsParameters.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineRunDataExtractsParameters.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -68,19 +68,19 @@ internal BareMetalMachineRunDataExtractsParameters(Microsoft.Azure.PowerShell.Cm { return; } - {_command = If( json?.PropertyT("commands"), out var __jsonCommands) ? If( __jsonCommands as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IBareMetalMachineCommandSpecification) (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BareMetalMachineCommandSpecification.FromJson(__u) )) ))() : null : Command;} - {_limitTimeSecond = If( json?.PropertyT("limitTimeSeconds"), out var __jsonLimitTimeSeconds) ? (long)__jsonLimitTimeSeconds : LimitTimeSecond;} + {_command = If( json?.PropertyT("commands"), out var __jsonCommands) ? If( __jsonCommands as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.IBareMetalMachineCommandSpecification) (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BareMetalMachineCommandSpecification.FromJson(__u) )) ))() : null : _command;} + {_limitTimeSecond = If( json?.PropertyT("limitTimeSeconds"), out var __jsonLimitTimeSeconds) ? (long)__jsonLimitTimeSeconds : _limitTimeSecond;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineRunDataExtractsParameters. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineRunDataExtractsParameters. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineRunDataExtractsParameters. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineRunDataExtractsParameters. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineRunDataExtractsParameters FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineRunDataExtractsParameters FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new BareMetalMachineRunDataExtractsParameters(json) : null; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineRunReadCommandsParameters.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineRunReadCommandsParameters.PowerShell.cs new file mode 100644 index 000000000000..c0674cb0e936 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineRunReadCommandsParameters.PowerShell.cs @@ -0,0 +1,181 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + + /// + /// BareMetalMachineRunReadCommandsParameters represents the body of request containing list of read-only commands to run + /// on the bare metal machine. + /// + [System.ComponentModel.TypeConverter(typeof(BareMetalMachineRunReadCommandsParametersTypeConverter))] + public partial class BareMetalMachineRunReadCommandsParameters + { + + /// + /// 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 BareMetalMachineRunReadCommandsParameters(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Command")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineRunReadCommandsParametersInternal)this).Command = (System.Collections.Generic.List) content.GetValueForProperty("Command",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineRunReadCommandsParametersInternal)this).Command, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BareMetalMachineCommandSpecificationTypeConverter.ConvertFrom)); + } + if (content.Contains("LimitTimeSecond")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineRunReadCommandsParametersInternal)this).LimitTimeSecond = (long) content.GetValueForProperty("LimitTimeSecond",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineRunReadCommandsParametersInternal)this).LimitTimeSecond, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal BareMetalMachineRunReadCommandsParameters(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Command")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineRunReadCommandsParametersInternal)this).Command = (System.Collections.Generic.List) content.GetValueForProperty("Command",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineRunReadCommandsParametersInternal)this).Command, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BareMetalMachineCommandSpecificationTypeConverter.ConvertFrom)); + } + if (content.Contains("LimitTimeSecond")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineRunReadCommandsParametersInternal)this).LimitTimeSecond = (long) content.GetValueForProperty("LimitTimeSecond",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineRunReadCommandsParametersInternal)this).LimitTimeSecond, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + 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.NetworkCloud.Models.IBareMetalMachineRunReadCommandsParameters DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new BareMetalMachineRunReadCommandsParameters(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.NetworkCloud.Models.IBareMetalMachineRunReadCommandsParameters DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new BareMetalMachineRunReadCommandsParameters(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.NetworkCloud.Models.IBareMetalMachineRunReadCommandsParameters FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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(); + } + } + /// BareMetalMachineRunReadCommandsParameters represents the body of request containing list of read-only commands to run + /// on the bare metal machine. + [System.ComponentModel.TypeConverter(typeof(BareMetalMachineRunReadCommandsParametersTypeConverter))] + public partial interface IBareMetalMachineRunReadCommandsParameters + + { + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineRunReadCommandsParameters.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineRunReadCommandsParameters.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineRunReadCommandsParameters.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineRunReadCommandsParameters.TypeConverter.cs index c9e86c29302a..4dafbfa995e6 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineRunReadCommandsParameters.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineRunReadCommandsParameters.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IBareMetalMachineRunReadCommandsParameters ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineRunReadCommandsParameters ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineRunReadCommandsParameters).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineRunReadCommandsParameters).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineRunReadCommandsParameters.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineRunReadCommandsParameters.cs similarity index 79% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineRunReadCommandsParameters.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineRunReadCommandsParameters.cs index 7f70c624be11..91ddffb915e1 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineRunReadCommandsParameters.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineRunReadCommandsParameters.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -12,18 +12,18 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201 /// on the bare metal machine. /// public partial class BareMetalMachineRunReadCommandsParameters : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineRunReadCommandsParameters, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineRunReadCommandsParametersInternal + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineRunReadCommandsParameters, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineRunReadCommandsParametersInternal { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineCommandSpecification[] _command; + private System.Collections.Generic.List _command; /// /// The list of read-only commands to be executed directly against the target machine. /// [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineCommandSpecification[] Command { get => this._command; set => this._command = value; } + public System.Collections.Generic.List Command { get => this._command; set => this._command = value; } /// Backing field for property. private long _limitTimeSecond; @@ -55,10 +55,13 @@ public partial interface IBareMetalMachineRunReadCommandsParameters : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The list of read-only commands to be executed directly against the target machine.", SerializedName = @"commands", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineCommandSpecification) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineCommandSpecification[] Command { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineCommandSpecification) })] + System.Collections.Generic.List Command { get; set; } /// /// The maximum time the commands are allowed to run. /// If the execution time exceeds the maximum, the script will be stopped, any output produced until then will be captured, @@ -67,6 +70,9 @@ public partial interface IBareMetalMachineRunReadCommandsParameters : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The maximum time the commands are allowed to run. If the execution time exceeds the maximum, the script will be stopped, any output produced until then will be captured, and the exit code matching a timeout will be returned (252).", SerializedName = @"limitTimeSeconds", @@ -82,7 +88,7 @@ internal partial interface IBareMetalMachineRunReadCommandsParametersInternal /// /// The list of read-only commands to be executed directly against the target machine. /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineCommandSpecification[] Command { get; set; } + System.Collections.Generic.List Command { get; set; } /// /// The maximum time the commands are allowed to run. /// If the execution time exceeds the maximum, the script will be stopped, any output produced until then will be captured, diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineRunReadCommandsParameters.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineRunReadCommandsParameters.json.cs similarity index 89% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineRunReadCommandsParameters.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineRunReadCommandsParameters.json.cs index e79cb3f32f0f..2f2071df024e 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BareMetalMachineRunReadCommandsParameters.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BareMetalMachineRunReadCommandsParameters.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -68,19 +68,19 @@ internal BareMetalMachineRunReadCommandsParameters(Microsoft.Azure.PowerShell.Cm { return; } - {_command = If( json?.PropertyT("commands"), out var __jsonCommands) ? If( __jsonCommands as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IBareMetalMachineCommandSpecification) (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BareMetalMachineCommandSpecification.FromJson(__u) )) ))() : null : Command;} - {_limitTimeSecond = If( json?.PropertyT("limitTimeSeconds"), out var __jsonLimitTimeSeconds) ? (long)__jsonLimitTimeSeconds : LimitTimeSecond;} + {_command = If( json?.PropertyT("commands"), out var __jsonCommands) ? If( __jsonCommands as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.IBareMetalMachineCommandSpecification) (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BareMetalMachineCommandSpecification.FromJson(__u) )) ))() : null : _command;} + {_limitTimeSecond = If( json?.PropertyT("limitTimeSeconds"), out var __jsonLimitTimeSeconds) ? (long)__jsonLimitTimeSeconds : _limitTimeSecond;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineRunReadCommandsParameters. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineRunReadCommandsParameters. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineRunReadCommandsParameters. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineRunReadCommandsParameters. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineRunReadCommandsParameters FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineRunReadCommandsParameters FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new BareMetalMachineRunReadCommandsParameters(json) : null; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BgpAdvertisement.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BgpAdvertisement.PowerShell.cs new file mode 100644 index 000000000000..9df9c07d35b2 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BgpAdvertisement.PowerShell.cs @@ -0,0 +1,190 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + + /// + /// BgpAdvertisement represents the association of IP address pools to the communities and peers. + /// + [System.ComponentModel.TypeConverter(typeof(BgpAdvertisementTypeConverter))] + public partial class BgpAdvertisement + { + + /// + /// 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 BgpAdvertisement(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("AdvertiseToFabric")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBgpAdvertisementInternal)this).AdvertiseToFabric = (string) content.GetValueForProperty("AdvertiseToFabric",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBgpAdvertisementInternal)this).AdvertiseToFabric, global::System.Convert.ToString); + } + if (content.Contains("Community")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBgpAdvertisementInternal)this).Community = (System.Collections.Generic.List) content.GetValueForProperty("Community",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBgpAdvertisementInternal)this).Community, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("IPAddressPool")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBgpAdvertisementInternal)this).IPAddressPool = (System.Collections.Generic.List) content.GetValueForProperty("IPAddressPool",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBgpAdvertisementInternal)this).IPAddressPool, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("Peer")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBgpAdvertisementInternal)this).Peer = (System.Collections.Generic.List) content.GetValueForProperty("Peer",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBgpAdvertisementInternal)this).Peer, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal BgpAdvertisement(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("AdvertiseToFabric")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBgpAdvertisementInternal)this).AdvertiseToFabric = (string) content.GetValueForProperty("AdvertiseToFabric",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBgpAdvertisementInternal)this).AdvertiseToFabric, global::System.Convert.ToString); + } + if (content.Contains("Community")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBgpAdvertisementInternal)this).Community = (System.Collections.Generic.List) content.GetValueForProperty("Community",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBgpAdvertisementInternal)this).Community, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("IPAddressPool")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBgpAdvertisementInternal)this).IPAddressPool = (System.Collections.Generic.List) content.GetValueForProperty("IPAddressPool",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBgpAdvertisementInternal)this).IPAddressPool, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("Peer")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBgpAdvertisementInternal)this).Peer = (System.Collections.Generic.List) content.GetValueForProperty("Peer",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBgpAdvertisementInternal)this).Peer, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBgpAdvertisement DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new BgpAdvertisement(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.NetworkCloud.Models.IBgpAdvertisement DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new BgpAdvertisement(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.NetworkCloud.Models.IBgpAdvertisement FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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(); + } + } + /// BgpAdvertisement represents the association of IP address pools to the communities and peers. + [System.ComponentModel.TypeConverter(typeof(BgpAdvertisementTypeConverter))] + public partial interface IBgpAdvertisement + + { + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BgpAdvertisement.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BgpAdvertisement.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BgpAdvertisement.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BgpAdvertisement.TypeConverter.cs index 4d2a662f7e65..82961a8d8c85 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BgpAdvertisement.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BgpAdvertisement.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IBgpAdvertisement ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBgpAdvertisement ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBgpAdvertisement).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBgpAdvertisement).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BgpAdvertisement.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BgpAdvertisement.cs new file mode 100644 index 000000000000..617357f28d06 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BgpAdvertisement.cs @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + + /// + /// BgpAdvertisement represents the association of IP address pools to the communities and peers. + /// + public partial class BgpAdvertisement : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBgpAdvertisement, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBgpAdvertisementInternal + { + + /// Backing field for property. + private string _advertiseToFabric; + + /// + /// The indicator of if this advertisement is also made to the network fabric associated with the Network Cloud Cluster. This + /// field is ignored if fabricPeeringEnabled is set to False. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string AdvertiseToFabric { get => this._advertiseToFabric; set => this._advertiseToFabric = value; } + + /// Backing field for property. + private System.Collections.Generic.List _community; + + /// + /// The names of the BGP communities to be associated with the announcement, utilizing a BGP community string in 1234:1234 + /// format. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public System.Collections.Generic.List Community { get => this._community; set => this._community = value; } + + /// Backing field for property. + private System.Collections.Generic.List _iPAddressPool; + + /// The names of the IP address pools associated with this announcement. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public System.Collections.Generic.List IPAddressPool { get => this._iPAddressPool; set => this._iPAddressPool = value; } + + /// Backing field for property. + private System.Collections.Generic.List _peer; + + /// + /// The names of the BGP peers to limit this advertisement to. If no values are specified, all BGP peers will receive this + /// advertisement. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public System.Collections.Generic.List Peer { get => this._peer; set => this._peer = value; } + + /// Creates an new instance. + public BgpAdvertisement() + { + + } + } + /// BgpAdvertisement represents the association of IP address pools to the communities and peers. + public partial interface IBgpAdvertisement : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable + { + /// + /// The indicator of if this advertisement is also made to the network fabric associated with the Network Cloud Cluster. This + /// field is ignored if fabricPeeringEnabled is set to False. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The indicator of if this advertisement is also made to the network fabric associated with the Network Cloud Cluster. This field is ignored if fabricPeeringEnabled is set to False.", + SerializedName = @"advertiseToFabric", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("True", "False")] + string AdvertiseToFabric { get; set; } + /// + /// The names of the BGP communities to be associated with the announcement, utilizing a BGP community string in 1234:1234 + /// format. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The names of the BGP communities to be associated with the announcement, utilizing a BGP community string in 1234:1234 format.", + SerializedName = @"communities", + PossibleTypes = new [] { typeof(string) })] + System.Collections.Generic.List Community { get; set; } + /// The names of the IP address pools associated with this announcement. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The names of the IP address pools associated with this announcement.", + SerializedName = @"ipAddressPools", + PossibleTypes = new [] { typeof(string) })] + System.Collections.Generic.List IPAddressPool { get; set; } + /// + /// The names of the BGP peers to limit this advertisement to. If no values are specified, all BGP peers will receive this + /// advertisement. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The names of the BGP peers to limit this advertisement to. If no values are specified, all BGP peers will receive this advertisement.", + SerializedName = @"peers", + PossibleTypes = new [] { typeof(string) })] + System.Collections.Generic.List Peer { get; set; } + + } + /// BgpAdvertisement represents the association of IP address pools to the communities and peers. + internal partial interface IBgpAdvertisementInternal + + { + /// + /// The indicator of if this advertisement is also made to the network fabric associated with the Network Cloud Cluster. This + /// field is ignored if fabricPeeringEnabled is set to False. + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("True", "False")] + string AdvertiseToFabric { get; set; } + /// + /// The names of the BGP communities to be associated with the announcement, utilizing a BGP community string in 1234:1234 + /// format. + /// + System.Collections.Generic.List Community { get; set; } + /// The names of the IP address pools associated with this announcement. + System.Collections.Generic.List IPAddressPool { get; set; } + /// + /// The names of the BGP peers to limit this advertisement to. If no values are specified, all BGP peers will receive this + /// advertisement. + /// + System.Collections.Generic.List Peer { get; set; } + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BgpAdvertisement.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BgpAdvertisement.json.cs new file mode 100644 index 000000000000..09b1715b3a9a --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BgpAdvertisement.json.cs @@ -0,0 +1,149 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + + /// + /// BgpAdvertisement represents the association of IP address pools to the communities and peers. + /// + public partial class BgpAdvertisement + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject instance to deserialize from. + internal BgpAdvertisement(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_advertiseToFabric = If( json?.PropertyT("advertiseToFabric"), out var __jsonAdvertiseToFabric) ? (string)__jsonAdvertiseToFabric : (string)_advertiseToFabric;} + {_community = If( json?.PropertyT("communities"), out var __jsonCommunities) ? If( __jsonCommunities as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : _community;} + {_iPAddressPool = If( json?.PropertyT("ipAddressPools"), out var __jsonIPAddressPools) ? If( __jsonIPAddressPools as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Json.JsonString __o ? (string)(__o.ToString()) : null)) ))() : null : _iPAddressPool;} + {_peer = If( json?.PropertyT("peers"), out var __jsonPeers) ? If( __jsonPeers as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Json.JsonString __j ? (string)(__j.ToString()) : null)) ))() : null : _peer;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBgpAdvertisement. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBgpAdvertisement. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBgpAdvertisement FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new BgpAdvertisement(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)||serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate)) + { + AddIf( null != (((object)this._advertiseToFabric)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._advertiseToFabric.ToString()) : null, "advertiseToFabric" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)||serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate)) + { + if (null != this._community) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.XNodeArray(); + foreach( var __x in this._community ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("communities",__w); + } + } + if (null != this._iPAddressPool) + { + var __r = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.XNodeArray(); + foreach( var __s in this._iPAddressPool ) + { + AddIf(null != (((object)__s)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(__s.ToString()) : null ,__r.Add); + } + container.Add("ipAddressPools",__r); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)||serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate)) + { + if (null != this._peer) + { + var __m = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.XNodeArray(); + foreach( var __n in this._peer ) + { + AddIf(null != (((object)__n)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(__n.ToString()) : null ,__m.Add); + } + container.Add("peers",__m); + } + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BgpServiceLoadBalancerConfiguration.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BgpServiceLoadBalancerConfiguration.PowerShell.cs new file mode 100644 index 000000000000..38beafa6300b --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BgpServiceLoadBalancerConfiguration.PowerShell.cs @@ -0,0 +1,194 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + + /// + /// BgpServiceLoadBalancerConfiguration represents the configuration of a BGP service load balancer. + /// + [System.ComponentModel.TypeConverter(typeof(BgpServiceLoadBalancerConfigurationTypeConverter))] + public partial class BgpServiceLoadBalancerConfiguration + { + + /// + /// 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 BgpServiceLoadBalancerConfiguration(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("BgpAdvertisement")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBgpServiceLoadBalancerConfigurationInternal)this).BgpAdvertisement = (System.Collections.Generic.List) content.GetValueForProperty("BgpAdvertisement",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBgpServiceLoadBalancerConfigurationInternal)this).BgpAdvertisement, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BgpAdvertisementTypeConverter.ConvertFrom)); + } + if (content.Contains("BgpPeer")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBgpServiceLoadBalancerConfigurationInternal)this).BgpPeer = (System.Collections.Generic.List) content.GetValueForProperty("BgpPeer",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBgpServiceLoadBalancerConfigurationInternal)this).BgpPeer, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ServiceLoadBalancerBgpPeerTypeConverter.ConvertFrom)); + } + if (content.Contains("FabricPeeringEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBgpServiceLoadBalancerConfigurationInternal)this).FabricPeeringEnabled = (string) content.GetValueForProperty("FabricPeeringEnabled",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBgpServiceLoadBalancerConfigurationInternal)this).FabricPeeringEnabled, global::System.Convert.ToString); + } + if (content.Contains("IPAddressPool")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBgpServiceLoadBalancerConfigurationInternal)this).IPAddressPool = (System.Collections.Generic.List) content.GetValueForProperty("IPAddressPool",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBgpServiceLoadBalancerConfigurationInternal)this).IPAddressPool, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IPAddressPoolTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal BgpServiceLoadBalancerConfiguration(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("BgpAdvertisement")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBgpServiceLoadBalancerConfigurationInternal)this).BgpAdvertisement = (System.Collections.Generic.List) content.GetValueForProperty("BgpAdvertisement",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBgpServiceLoadBalancerConfigurationInternal)this).BgpAdvertisement, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BgpAdvertisementTypeConverter.ConvertFrom)); + } + if (content.Contains("BgpPeer")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBgpServiceLoadBalancerConfigurationInternal)this).BgpPeer = (System.Collections.Generic.List) content.GetValueForProperty("BgpPeer",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBgpServiceLoadBalancerConfigurationInternal)this).BgpPeer, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ServiceLoadBalancerBgpPeerTypeConverter.ConvertFrom)); + } + if (content.Contains("FabricPeeringEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBgpServiceLoadBalancerConfigurationInternal)this).FabricPeeringEnabled = (string) content.GetValueForProperty("FabricPeeringEnabled",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBgpServiceLoadBalancerConfigurationInternal)this).FabricPeeringEnabled, global::System.Convert.ToString); + } + if (content.Contains("IPAddressPool")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBgpServiceLoadBalancerConfigurationInternal)this).IPAddressPool = (System.Collections.Generic.List) content.GetValueForProperty("IPAddressPool",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBgpServiceLoadBalancerConfigurationInternal)this).IPAddressPool, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IPAddressPoolTypeConverter.ConvertFrom)); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBgpServiceLoadBalancerConfiguration DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new BgpServiceLoadBalancerConfiguration(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.NetworkCloud.Models.IBgpServiceLoadBalancerConfiguration DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new BgpServiceLoadBalancerConfiguration(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.NetworkCloud.Models.IBgpServiceLoadBalancerConfiguration FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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(); + } + } + /// BgpServiceLoadBalancerConfiguration represents the configuration of a BGP service load balancer. + [System.ComponentModel.TypeConverter(typeof(BgpServiceLoadBalancerConfigurationTypeConverter))] + public partial interface IBgpServiceLoadBalancerConfiguration + + { + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BgpServiceLoadBalancerConfiguration.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BgpServiceLoadBalancerConfiguration.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BgpServiceLoadBalancerConfiguration.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BgpServiceLoadBalancerConfiguration.TypeConverter.cs index a2cf60d492f1..241ccbabb2c7 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BgpServiceLoadBalancerConfiguration.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BgpServiceLoadBalancerConfiguration.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IBgpServiceLoadBalancerConfiguration ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBgpServiceLoadBalancerConfiguration ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBgpServiceLoadBalancerConfiguration).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBgpServiceLoadBalancerConfiguration).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BgpServiceLoadBalancerConfiguration.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BgpServiceLoadBalancerConfiguration.cs new file mode 100644 index 000000000000..a93a4bb308d4 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BgpServiceLoadBalancerConfiguration.cs @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + + /// + /// BgpServiceLoadBalancerConfiguration represents the configuration of a BGP service load balancer. + /// + public partial class BgpServiceLoadBalancerConfiguration : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBgpServiceLoadBalancerConfiguration, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBgpServiceLoadBalancerConfigurationInternal + { + + /// Backing field for property. + private System.Collections.Generic.List _bgpAdvertisement; + + /// + /// The association of IP address pools to the communities and peers, allowing for announcement of IPs. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public System.Collections.Generic.List BgpAdvertisement { get => this._bgpAdvertisement; set => this._bgpAdvertisement = value; } + + /// Backing field for property. + private System.Collections.Generic.List _bgpPeer; + + /// + /// The list of additional BgpPeer entities that the Kubernetes cluster will peer with. All peering must be explicitly defined. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public System.Collections.Generic.List BgpPeer { get => this._bgpPeer; set => this._bgpPeer = value; } + + /// Backing field for property. + private string _fabricPeeringEnabled; + + /// The indicator to specify if the load balancer peers with the network fabric. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string FabricPeeringEnabled { get => this._fabricPeeringEnabled; set => this._fabricPeeringEnabled = value; } + + /// Backing field for property. + private System.Collections.Generic.List _iPAddressPool; + + /// + /// The list of pools of IP addresses that can be allocated to load balancer services. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public System.Collections.Generic.List IPAddressPool { get => this._iPAddressPool; set => this._iPAddressPool = value; } + + /// Creates an new instance. + public BgpServiceLoadBalancerConfiguration() + { + + } + } + /// BgpServiceLoadBalancerConfiguration represents the configuration of a BGP service load balancer. + public partial interface IBgpServiceLoadBalancerConfiguration : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable + { + /// + /// The association of IP address pools to the communities and peers, allowing for announcement of IPs. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The association of IP address pools to the communities and peers, allowing for announcement of IPs.", + SerializedName = @"bgpAdvertisements", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBgpAdvertisement) })] + System.Collections.Generic.List BgpAdvertisement { get; set; } + /// + /// The list of additional BgpPeer entities that the Kubernetes cluster will peer with. All peering must be explicitly defined. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The list of additional BgpPeer entities that the Kubernetes cluster will peer with. All peering must be explicitly defined.", + SerializedName = @"bgpPeers", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IServiceLoadBalancerBgpPeer) })] + System.Collections.Generic.List BgpPeer { get; set; } + /// The indicator to specify if the load balancer peers with the network fabric. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The indicator to specify if the load balancer peers with the network fabric.", + SerializedName = @"fabricPeeringEnabled", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("True", "False")] + string FabricPeeringEnabled { get; set; } + /// + /// The list of pools of IP addresses that can be allocated to load balancer services. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The list of pools of IP addresses that can be allocated to load balancer services.", + SerializedName = @"ipAddressPools", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IIPAddressPool) })] + System.Collections.Generic.List IPAddressPool { get; set; } + + } + /// BgpServiceLoadBalancerConfiguration represents the configuration of a BGP service load balancer. + internal partial interface IBgpServiceLoadBalancerConfigurationInternal + + { + /// + /// The association of IP address pools to the communities and peers, allowing for announcement of IPs. + /// + System.Collections.Generic.List BgpAdvertisement { get; set; } + /// + /// The list of additional BgpPeer entities that the Kubernetes cluster will peer with. All peering must be explicitly defined. + /// + System.Collections.Generic.List BgpPeer { get; set; } + /// The indicator to specify if the load balancer peers with the network fabric. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("True", "False")] + string FabricPeeringEnabled { get; set; } + /// + /// The list of pools of IP addresses that can be allocated to load balancer services. + /// + System.Collections.Generic.List IPAddressPool { get; set; } + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BgpServiceLoadBalancerConfiguration.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BgpServiceLoadBalancerConfiguration.json.cs new file mode 100644 index 000000000000..8cc6777909c6 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BgpServiceLoadBalancerConfiguration.json.cs @@ -0,0 +1,153 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + + /// + /// BgpServiceLoadBalancerConfiguration represents the configuration of a BGP service load balancer. + /// + public partial class BgpServiceLoadBalancerConfiguration + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject instance to deserialize from. + internal BgpServiceLoadBalancerConfiguration(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_bgpAdvertisement = If( json?.PropertyT("bgpAdvertisements"), out var __jsonBgpAdvertisements) ? If( __jsonBgpAdvertisements as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.IBgpAdvertisement) (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BgpAdvertisement.FromJson(__u) )) ))() : null : _bgpAdvertisement;} + {_bgpPeer = If( json?.PropertyT("bgpPeers"), out var __jsonBgpPeers) ? If( __jsonBgpPeers as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.IServiceLoadBalancerBgpPeer) (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ServiceLoadBalancerBgpPeer.FromJson(__p) )) ))() : null : _bgpPeer;} + {_fabricPeeringEnabled = If( json?.PropertyT("fabricPeeringEnabled"), out var __jsonFabricPeeringEnabled) ? (string)__jsonFabricPeeringEnabled : (string)_fabricPeeringEnabled;} + {_iPAddressPool = If( json?.PropertyT("ipAddressPools"), out var __jsonIPAddressPools) ? If( __jsonIPAddressPools as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonArray, out var __l) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__l, (__k)=>(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IIPAddressPool) (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IPAddressPool.FromJson(__k) )) ))() : null : _iPAddressPool;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBgpServiceLoadBalancerConfiguration. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBgpServiceLoadBalancerConfiguration. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBgpServiceLoadBalancerConfiguration FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new BgpServiceLoadBalancerConfiguration(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)||serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate)) + { + if (null != this._bgpAdvertisement) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.XNodeArray(); + foreach( var __x in this._bgpAdvertisement ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("bgpAdvertisements",__w); + } + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)||serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate)) + { + if (null != this._bgpPeer) + { + var __r = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.XNodeArray(); + foreach( var __s in this._bgpPeer ) + { + AddIf(__s?.ToJson(null, serializationMode) ,__r.Add); + } + container.Add("bgpPeers",__r); + } + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)||serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate)) + { + AddIf( null != (((object)this._fabricPeeringEnabled)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._fabricPeeringEnabled.ToString()) : null, "fabricPeeringEnabled" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)||serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate)) + { + if (null != this._iPAddressPool) + { + var __m = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.XNodeArray(); + foreach( var __n in this._iPAddressPool ) + { + AddIf(__n?.ToJson(null, serializationMode) ,__m.Add); + } + container.Add("ipAddressPools",__m); + } + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BmcKeySet.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BmcKeySet.PowerShell.cs new file mode 100644 index 000000000000..b182e40cda81 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BmcKeySet.PowerShell.cs @@ -0,0 +1,364 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + + /// BmcKeySet represents the baseboard management controller key set. + [System.ComponentModel.TypeConverter(typeof(BmcKeySetTypeConverter))] + public partial class BmcKeySet + { + + /// + /// 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 BmcKeySet(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ExtendedLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetInternal)this).ExtendedLocation = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocation) content.GetValueForProperty("ExtendedLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetInternal)this).ExtendedLocation, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ExtendedLocationTypeConverter.ConvertFrom); + } + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BmcKeySetPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Etag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetInternal)this).Etag, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)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("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedByType = (string) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedByType = (string) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.TrackedResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("ExtendedLocationName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetInternal)this).ExtendedLocationName = (string) content.GetValueForProperty("ExtendedLocationName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetInternal)this).ExtendedLocationName, global::System.Convert.ToString); + } + if (content.Contains("ExtendedLocationType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetInternal)this).ExtendedLocationType = (string) content.GetValueForProperty("ExtendedLocationType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetInternal)this).ExtendedLocationType, global::System.Convert.ToString); + } + if (content.Contains("AzureGroupId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetInternal)this).AzureGroupId = (string) content.GetValueForProperty("AzureGroupId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetInternal)this).AzureGroupId, global::System.Convert.ToString); + } + if (content.Contains("DetailedStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetInternal)this).DetailedStatus = (string) content.GetValueForProperty("DetailedStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetInternal)this).DetailedStatus, global::System.Convert.ToString); + } + if (content.Contains("DetailedStatusMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetInternal)this).DetailedStatusMessage = (string) content.GetValueForProperty("DetailedStatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetInternal)this).DetailedStatusMessage, global::System.Convert.ToString); + } + if (content.Contains("Expiration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetInternal)this).Expiration = (global::System.DateTime) content.GetValueForProperty("Expiration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetInternal)this).Expiration, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("LastValidation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetInternal)this).LastValidation = (global::System.DateTime?) content.GetValueForProperty("LastValidation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetInternal)this).LastValidation, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("PrivilegeLevel")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetInternal)this).PrivilegeLevel = (string) content.GetValueForProperty("PrivilegeLevel",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetInternal)this).PrivilegeLevel, global::System.Convert.ToString); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("UserList")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetInternal)this).UserList = (System.Collections.Generic.List) content.GetValueForProperty("UserList",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetInternal)this).UserList, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.KeySetUserTypeConverter.ConvertFrom)); + } + if (content.Contains("UserListStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetInternal)this).UserListStatus = (System.Collections.Generic.List) content.GetValueForProperty("UserListStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetInternal)this).UserListStatus, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.KeySetUserStatusTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal BmcKeySet(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ExtendedLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetInternal)this).ExtendedLocation = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocation) content.GetValueForProperty("ExtendedLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetInternal)this).ExtendedLocation, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ExtendedLocationTypeConverter.ConvertFrom); + } + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BmcKeySetPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Etag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetInternal)this).Etag, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)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("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedByType = (string) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedByType = (string) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.TrackedResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("ExtendedLocationName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetInternal)this).ExtendedLocationName = (string) content.GetValueForProperty("ExtendedLocationName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetInternal)this).ExtendedLocationName, global::System.Convert.ToString); + } + if (content.Contains("ExtendedLocationType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetInternal)this).ExtendedLocationType = (string) content.GetValueForProperty("ExtendedLocationType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetInternal)this).ExtendedLocationType, global::System.Convert.ToString); + } + if (content.Contains("AzureGroupId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetInternal)this).AzureGroupId = (string) content.GetValueForProperty("AzureGroupId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetInternal)this).AzureGroupId, global::System.Convert.ToString); + } + if (content.Contains("DetailedStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetInternal)this).DetailedStatus = (string) content.GetValueForProperty("DetailedStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetInternal)this).DetailedStatus, global::System.Convert.ToString); + } + if (content.Contains("DetailedStatusMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetInternal)this).DetailedStatusMessage = (string) content.GetValueForProperty("DetailedStatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetInternal)this).DetailedStatusMessage, global::System.Convert.ToString); + } + if (content.Contains("Expiration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetInternal)this).Expiration = (global::System.DateTime) content.GetValueForProperty("Expiration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetInternal)this).Expiration, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("LastValidation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetInternal)this).LastValidation = (global::System.DateTime?) content.GetValueForProperty("LastValidation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetInternal)this).LastValidation, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("PrivilegeLevel")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetInternal)this).PrivilegeLevel = (string) content.GetValueForProperty("PrivilegeLevel",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetInternal)this).PrivilegeLevel, global::System.Convert.ToString); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("UserList")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetInternal)this).UserList = (System.Collections.Generic.List) content.GetValueForProperty("UserList",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetInternal)this).UserList, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.KeySetUserTypeConverter.ConvertFrom)); + } + if (content.Contains("UserListStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetInternal)this).UserListStatus = (System.Collections.Generic.List) content.GetValueForProperty("UserListStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetInternal)this).UserListStatus, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.KeySetUserStatusTypeConverter.ConvertFrom)); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySet DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new BmcKeySet(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.NetworkCloud.Models.IBmcKeySet DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new BmcKeySet(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.NetworkCloud.Models.IBmcKeySet FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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(); + } + } + /// BmcKeySet represents the baseboard management controller key set. + [System.ComponentModel.TypeConverter(typeof(BmcKeySetTypeConverter))] + public partial interface IBmcKeySet + + { + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BmcKeySet.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BmcKeySet.TypeConverter.cs similarity index 98% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BmcKeySet.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BmcKeySet.TypeConverter.cs index 78cd277a3fd1..bf885e98017f 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BmcKeySet.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BmcKeySet.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IBmcKeySet ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySet ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySet).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySet).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BmcKeySet.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BmcKeySet.cs new file mode 100644 index 000000000000..31bb461503c0 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BmcKeySet.cs @@ -0,0 +1,411 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + + /// BmcKeySet represents the baseboard management controller key set. + public partial class BmcKeySet : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySet, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetInternal, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResource __trackedResource = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.TrackedResource(); + + /// + /// The object ID of Azure Active Directory group that all users in the list must be in for access to be granted. Users that + /// are not in the group will not have access. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string AzureGroupId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetPropertiesInternal)Property).AzureGroupId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetPropertiesInternal)Property).AzureGroupId = value ?? null; } + + /// The more detailed status of the key set. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string DetailedStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetPropertiesInternal)Property).DetailedStatus; } + + /// The descriptive message about the current detailed status. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string DetailedStatusMessage { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetPropertiesInternal)Property).DetailedStatusMessage; } + + /// Backing field for property. + private string _etag; + + /// Resource ETag. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string Etag { get => this._etag; } + + /// + /// The date and time after which the users in this key set will be removed from the baseboard management controllers. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public global::System.DateTime Expiration { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetPropertiesInternal)Property).Expiration; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetPropertiesInternal)Property).Expiration = value ; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocation _extendedLocation; + + /// The extended location of the cluster associated with the resource. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocation ExtendedLocation { get => (this._extendedLocation = this._extendedLocation ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ExtendedLocation()); set => this._extendedLocation = value; } + + /// The resource ID of the extended location on which the resource will be created. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string ExtendedLocationName { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocationInternal)ExtendedLocation).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocationInternal)ExtendedLocation).Name = value ?? null; } + + /// The extended location type, for example, CustomLocation. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string ExtendedLocationType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocationInternal)ExtendedLocation).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocationInternal)ExtendedLocation).Type = value ?? null; } + + /// + /// Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).Id; } + + /// The last time this key set was validated. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public global::System.DateTime? LastValidation { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetPropertiesInternal)Property).LastValidation; } + + /// The geo-location where the resource lives + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)__trackedResource).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)__trackedResource).Location = value ?? null; } + + /// Internal Acessors for DetailedStatus + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetInternal.DetailedStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetPropertiesInternal)Property).DetailedStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetPropertiesInternal)Property).DetailedStatus = value ?? null; } + + /// Internal Acessors for DetailedStatusMessage + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetInternal.DetailedStatusMessage { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetPropertiesInternal)Property).DetailedStatusMessage; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetPropertiesInternal)Property).DetailedStatusMessage = value ?? null; } + + /// Internal Acessors for Etag + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetInternal.Etag { get => this._etag; set { {_etag = value;} } } + + /// Internal Acessors for ExtendedLocation + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocation Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetInternal.ExtendedLocation { get => (this._extendedLocation = this._extendedLocation ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ExtendedLocation()); set { {_extendedLocation = value;} } } + + /// Internal Acessors for LastValidation + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetInternal.LastValidation { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetPropertiesInternal)Property).LastValidation; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetPropertiesInternal)Property).LastValidation = value ?? default(global::System.DateTime); } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetProperties Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BmcKeySetProperties()); set { {_property = value;} } } + + /// Internal Acessors for ProvisioningState + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetPropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetPropertiesInternal)Property).ProvisioningState = value ?? null; } + + /// Internal Acessors for UserListStatus + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetInternal.UserListStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetPropertiesInternal)Property).UserListStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetPropertiesInternal)Property).UserListStatus = value ?? null /* arrayOf */; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).Id = value ?? null; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).Name = value ?? null; } + + /// Internal Acessors for SystemData + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISystemData Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemData; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemData = value ?? null /* model class */; } + + /// Internal Acessors for SystemDataCreatedAt + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataCreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataCreatedAt = value ?? default(global::System.DateTime); } + + /// Internal Acessors for SystemDataCreatedBy + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataCreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataCreatedBy = value ?? null; } + + /// Internal Acessors for SystemDataCreatedByType + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataCreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataCreatedByType = value ?? null; } + + /// Internal Acessors for SystemDataLastModifiedAt + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedAt = value ?? default(global::System.DateTime); } + + /// Internal Acessors for SystemDataLastModifiedBy + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedBy = value ?? null; } + + /// Internal Acessors for SystemDataLastModifiedByType + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedByType = value ?? null; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).Type = value ?? null; } + + /// The name of the resource + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).Name; } + + /// The access level allowed for the users in this key set. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string PrivilegeLevel { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetPropertiesInternal)Property).PrivilegeLevel; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetPropertiesInternal)Property).PrivilegeLevel = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetProperties _property; + + /// The list of the resource properties. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BmcKeySetProperties()); set => this._property = value; } + + /// The provisioning state of the baseboard management controller key set. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetPropertiesInternal)Property).ProvisioningState; } + + /// Gets the resource group name + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string ResourceGroupName { get => (new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Success ? new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Groups["resourceGroupName"].Value : null); } + + /// + /// Azure Resource Manager metadata containing createdBy and modifiedBy information. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISystemData SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemData; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemData = value ?? null /* model class */; } + + /// The timestamp of resource creation (UTC). + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataCreatedAt; } + + /// The identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataCreatedBy; } + + /// The type of identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public string SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataCreatedByType; } + + /// The timestamp of resource last modification (UTC) + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedAt; } + + /// The identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedBy; } + + /// The type of identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public string SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedByType; } + + /// Resource tags. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)__trackedResource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).Type; } + + /// The unique list of permitted users. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public System.Collections.Generic.List UserList { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetPropertiesInternal)Property).UserList; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetPropertiesInternal)Property).UserList = value ; } + + /// The status evaluation of each user. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public System.Collections.Generic.List UserListStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetPropertiesInternal)Property).UserListStatus; } + + /// Creates an new instance. + public BmcKeySet() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__trackedResource), __trackedResource); + await eventListener.AssertObjectIsValid(nameof(__trackedResource), __trackedResource); + } + } + /// BmcKeySet represents the baseboard management controller key set. + public partial interface IBmcKeySet : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResource + { + /// + /// The object ID of Azure Active Directory group that all users in the list must be in for access to be granted. Users that + /// are not in the group will not have access. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The object ID of Azure Active Directory group that all users in the list must be in for access to be granted. Users that are not in the group will not have access.", + SerializedName = @"azureGroupId", + PossibleTypes = new [] { typeof(string) })] + string AzureGroupId { get; set; } + /// The more detailed status of the key set. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The more detailed status of the key set.", + SerializedName = @"detailedStatus", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("AllActive", "SomeInvalid", "AllInvalid", "Validating")] + string DetailedStatus { get; } + /// The descriptive message about the current detailed status. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The descriptive message about the current detailed status.", + SerializedName = @"detailedStatusMessage", + PossibleTypes = new [] { typeof(string) })] + string DetailedStatusMessage { get; } + /// Resource ETag. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"Resource ETag.", + SerializedName = @"etag", + PossibleTypes = new [] { typeof(string) })] + string Etag { get; } + /// + /// The date and time after which the users in this key set will be removed from the baseboard management controllers. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The date and time after which the users in this key set will be removed from the baseboard management controllers.", + SerializedName = @"expiration", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime Expiration { get; set; } + /// The resource ID of the extended location on which the resource will be created. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The resource ID of the extended location on which the resource will be created.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string ExtendedLocationName { get; set; } + /// The extended location type, for example, CustomLocation. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The extended location type, for example, CustomLocation.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + string ExtendedLocationType { get; set; } + /// The last time this key set was validated. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The last time this key set was validated.", + SerializedName = @"lastValidation", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? LastValidation { get; } + /// The access level allowed for the users in this key set. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The access level allowed for the users in this key set.", + SerializedName = @"privilegeLevel", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("ReadOnly", "Administrator")] + string PrivilegeLevel { get; set; } + /// The provisioning state of the baseboard management controller key set. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The provisioning state of the baseboard management controller key set.", + SerializedName = @"provisioningState", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Succeeded", "Failed", "Canceled", "Accepted", "Provisioning")] + string ProvisioningState { get; } + /// The unique list of permitted users. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The unique list of permitted users.", + SerializedName = @"userList", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKeySetUser) })] + System.Collections.Generic.List UserList { get; set; } + /// The status evaluation of each user. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The status evaluation of each user.", + SerializedName = @"userListStatus", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKeySetUserStatus) })] + System.Collections.Generic.List UserListStatus { get; } + + } + /// BmcKeySet represents the baseboard management controller key set. + internal partial interface IBmcKeySetInternal : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal + { + /// + /// The object ID of Azure Active Directory group that all users in the list must be in for access to be granted. Users that + /// are not in the group will not have access. + /// + string AzureGroupId { get; set; } + /// The more detailed status of the key set. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("AllActive", "SomeInvalid", "AllInvalid", "Validating")] + string DetailedStatus { get; set; } + /// The descriptive message about the current detailed status. + string DetailedStatusMessage { get; set; } + /// Resource ETag. + string Etag { get; set; } + /// + /// The date and time after which the users in this key set will be removed from the baseboard management controllers. + /// + global::System.DateTime Expiration { get; set; } + /// The extended location of the cluster associated with the resource. + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocation ExtendedLocation { get; set; } + /// The resource ID of the extended location on which the resource will be created. + string ExtendedLocationName { get; set; } + /// The extended location type, for example, CustomLocation. + string ExtendedLocationType { get; set; } + /// The last time this key set was validated. + global::System.DateTime? LastValidation { get; set; } + /// The access level allowed for the users in this key set. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("ReadOnly", "Administrator")] + string PrivilegeLevel { get; set; } + /// The list of the resource properties. + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetProperties Property { get; set; } + /// The provisioning state of the baseboard management controller key set. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Succeeded", "Failed", "Canceled", "Accepted", "Provisioning")] + string ProvisioningState { get; set; } + /// The unique list of permitted users. + System.Collections.Generic.List UserList { get; set; } + /// The status evaluation of each user. + System.Collections.Generic.List UserListStatus { get; set; } + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BmcKeySet.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BmcKeySet.json.cs similarity index 92% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BmcKeySet.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BmcKeySet.json.cs index d0d3bb31ac7a..fcac3238eb9b 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BmcKeySet.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BmcKeySet.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -65,21 +65,21 @@ internal BmcKeySet(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json. { return; } - __trackedResource = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.TrackedResource(json); - {_extendedLocation = If( json?.PropertyT("extendedLocation"), out var __jsonExtendedLocation) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ExtendedLocation.FromJson(__jsonExtendedLocation) : ExtendedLocation;} - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BmcKeySetProperties.FromJson(__jsonProperties) : Property;} - {_etag = If( json?.PropertyT("etag"), out var __jsonEtag) ? (string)__jsonEtag : (string)Etag;} + __trackedResource = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.TrackedResource(json); + {_extendedLocation = If( json?.PropertyT("extendedLocation"), out var __jsonExtendedLocation) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ExtendedLocation.FromJson(__jsonExtendedLocation) : _extendedLocation;} + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BmcKeySetProperties.FromJson(__jsonProperties) : _property;} + {_etag = If( json?.PropertyT("etag"), out var __jsonEtag) ? (string)__jsonEtag : (string)_etag;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySet. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySet. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySet. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySet. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySet FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySet FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new BmcKeySet(json) : null; } @@ -106,7 +106,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode ToJ __trackedResource?.ToJson(container, serializationMode); AddIf( null != this._extendedLocation ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) this._extendedLocation.ToJson(null,serializationMode) : null, "extendedLocation" ,container.Add ); AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._etag)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._etag.ToString()) : null, "etag" ,container.Add ); } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BmcKeySetList.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BmcKeySetList.PowerShell.cs similarity index 77% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BmcKeySetList.PowerShell.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BmcKeySetList.PowerShell.cs index 6ddd1fad5c79..73a8c73aa5e0 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BmcKeySetList.PowerShell.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BmcKeySetList.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; @@ -63,7 +63,7 @@ public partial class BmcKeySetList 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 BmcKeySetList(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetListInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetListInternal)this).NextLink, global::System.Convert.ToString); } if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySet[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BmcKeySetTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetListInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetListInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BmcKeySetTypeConverter.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,37 +103,37 @@ internal BmcKeySetList(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetListInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetListInternal)this).NextLink, global::System.Convert.ToString); } if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySet[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BmcKeySetTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetListInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetListInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BmcKeySetTypeConverter.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.NetworkCloud.Models.Api20250201.IBmcKeySetList DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetList DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new BmcKeySetList(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.NetworkCloud.Models.Api20250201.IBmcKeySetList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new BmcKeySetList(content); } @@ -143,7 +143,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BmcKeySetList.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BmcKeySetList.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BmcKeySetList.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BmcKeySetList.TypeConverter.cs index fa27c69ccb6a..397c3aa424b5 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BmcKeySetList.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BmcKeySetList.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IBmcKeySetList ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetList ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetList).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetList).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BmcKeySetList.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BmcKeySetList.cs similarity index 76% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BmcKeySetList.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BmcKeySetList.cs index d950cb25812a..3bf41e647a67 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BmcKeySetList.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BmcKeySetList.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; /// BmcKeySetList represents a list of baseboard management controller key sets. public partial class BmcKeySetList : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetList, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetListInternal + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetList, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetListInternal { /// Backing field for property. @@ -21,11 +21,11 @@ public partial class BmcKeySetList : public string NextLink { get => this._nextLink; set => this._nextLink = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySet[] _value; + private System.Collections.Generic.List _value; /// The list of baseboard management controller key sets. [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySet[] 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 BmcKeySetList() @@ -41,6 +41,9 @@ public partial interface IBmcKeySetList : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The link used to get the next page of operations.", SerializedName = @"nextLink", PossibleTypes = new [] { typeof(string) })] @@ -49,10 +52,13 @@ public partial interface IBmcKeySetList : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The list of baseboard management controller key sets.", SerializedName = @"value", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySet) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySet[] Value { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySet) })] + System.Collections.Generic.List Value { get; set; } } /// BmcKeySetList represents a list of baseboard management controller key sets. @@ -62,7 +68,7 @@ internal partial interface IBmcKeySetListInternal /// The link used to get the next page of operations. string NextLink { get; set; } /// The list of baseboard management controller key sets. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySet[] Value { get; set; } + System.Collections.Generic.List Value { get; set; } } } \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BmcKeySetList.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BmcKeySetList.json.cs similarity index 90% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BmcKeySetList.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BmcKeySetList.json.cs index e094a60d86a3..92b01a06b263 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BmcKeySetList.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BmcKeySetList.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -65,19 +65,19 @@ internal BmcKeySetList(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.J { return; } - {_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.NetworkCloud.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.NetworkCloud.Models.Api20250201.IBmcKeySet) (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BmcKeySet.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.NetworkCloud.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.NetworkCloud.Models.IBmcKeySet) (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BmcKeySet.FromJson(__u) )) ))() : null : _value;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetList. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetList. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetList. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetList. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetList FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetList FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new BmcKeySetList(json) : null; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BmcKeySetPatchParameters.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BmcKeySetPatchParameters.PowerShell.cs new file mode 100644 index 000000000000..828baa3b855c --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BmcKeySetPatchParameters.PowerShell.cs @@ -0,0 +1,190 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + + /// + /// BmcKeySetPatchParameters represents the body of the request to patch the baseboard management controller key set. + /// + [System.ComponentModel.TypeConverter(typeof(BmcKeySetPatchParametersTypeConverter))] + public partial class BmcKeySetPatchParameters + { + + /// + /// 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 BmcKeySetPatchParameters(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.NetworkCloud.Models.IBmcKeySetPatchParametersInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetPatchProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetPatchParametersInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BmcKeySetPatchPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetPatchParametersInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetPatchParametersTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetPatchParametersInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BmcKeySetPatchParametersTagsTypeConverter.ConvertFrom); + } + if (content.Contains("Expiration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetPatchParametersInternal)this).Expiration = (global::System.DateTime?) content.GetValueForProperty("Expiration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetPatchParametersInternal)this).Expiration, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("UserList")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetPatchParametersInternal)this).UserList = (System.Collections.Generic.List) content.GetValueForProperty("UserList",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetPatchParametersInternal)this).UserList, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.KeySetUserTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal BmcKeySetPatchParameters(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.NetworkCloud.Models.IBmcKeySetPatchParametersInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetPatchProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetPatchParametersInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BmcKeySetPatchPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetPatchParametersInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetPatchParametersTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetPatchParametersInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BmcKeySetPatchParametersTagsTypeConverter.ConvertFrom); + } + if (content.Contains("Expiration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetPatchParametersInternal)this).Expiration = (global::System.DateTime?) content.GetValueForProperty("Expiration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetPatchParametersInternal)this).Expiration, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("UserList")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetPatchParametersInternal)this).UserList = (System.Collections.Generic.List) content.GetValueForProperty("UserList",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetPatchParametersInternal)this).UserList, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.KeySetUserTypeConverter.ConvertFrom)); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetPatchParameters DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new BmcKeySetPatchParameters(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.NetworkCloud.Models.IBmcKeySetPatchParameters DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new BmcKeySetPatchParameters(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.NetworkCloud.Models.IBmcKeySetPatchParameters FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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(); + } + } + /// BmcKeySetPatchParameters represents the body of the request to patch the baseboard management controller key set. + [System.ComponentModel.TypeConverter(typeof(BmcKeySetPatchParametersTypeConverter))] + public partial interface IBmcKeySetPatchParameters + + { + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BmcKeySetPatchParameters.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BmcKeySetPatchParameters.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BmcKeySetPatchParameters.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BmcKeySetPatchParameters.TypeConverter.cs index 760bb01ab321..bd8581b8c1ed 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BmcKeySetPatchParameters.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BmcKeySetPatchParameters.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IBmcKeySetPatchParameters ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetPatchParameters ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetPatchParameters).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetPatchParameters).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BmcKeySetPatchParameters.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BmcKeySetPatchParameters.cs new file mode 100644 index 000000000000..e9034f2a3004 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BmcKeySetPatchParameters.cs @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + + /// + /// BmcKeySetPatchParameters represents the body of the request to patch the baseboard management controller key set. + /// + public partial class BmcKeySetPatchParameters : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetPatchParameters, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetPatchParametersInternal + { + + /// + /// The date and time after which the users in this key set will be removed from the baseboard management controllers. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public global::System.DateTime? Expiration { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetPatchPropertiesInternal)Property).Expiration; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetPatchPropertiesInternal)Property).Expiration = value ?? default(global::System.DateTime); } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetPatchProperties Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetPatchParametersInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BmcKeySetPatchProperties()); set { {_property = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetPatchProperties _property; + + /// The list of the resource properties. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetPatchProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BmcKeySetPatchProperties()); set => this._property = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetPatchParametersTags _tag; + + /// The Azure resource tags that will replace the existing ones. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetPatchParametersTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BmcKeySetPatchParametersTags()); set => this._tag = value; } + + /// The unique list of permitted users. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public System.Collections.Generic.List UserList { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetPatchPropertiesInternal)Property).UserList; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetPatchPropertiesInternal)Property).UserList = value ?? null /* arrayOf */; } + + /// Creates an new instance. + public BmcKeySetPatchParameters() + { + + } + } + /// BmcKeySetPatchParameters represents the body of the request to patch the baseboard management controller key set. + public partial interface IBmcKeySetPatchParameters : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable + { + /// + /// The date and time after which the users in this key set will be removed from the baseboard management controllers. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The date and time after which the users in this key set will be removed from the baseboard management controllers.", + SerializedName = @"expiration", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? Expiration { get; set; } + /// The Azure resource tags that will replace the existing ones. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The Azure resource tags that will replace the existing ones.", + SerializedName = @"tags", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetPatchParametersTags) })] + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetPatchParametersTags Tag { get; set; } + /// The unique list of permitted users. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The unique list of permitted users.", + SerializedName = @"userList", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKeySetUser) })] + System.Collections.Generic.List UserList { get; set; } + + } + /// BmcKeySetPatchParameters represents the body of the request to patch the baseboard management controller key set. + internal partial interface IBmcKeySetPatchParametersInternal + + { + /// + /// The date and time after which the users in this key set will be removed from the baseboard management controllers. + /// + global::System.DateTime? Expiration { get; set; } + /// The list of the resource properties. + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetPatchProperties Property { get; set; } + /// The Azure resource tags that will replace the existing ones. + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetPatchParametersTags Tag { get; set; } + /// The unique list of permitted users. + System.Collections.Generic.List UserList { get; set; } + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BmcKeySetPatchParameters.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BmcKeySetPatchParameters.json.cs similarity index 93% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BmcKeySetPatchParameters.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BmcKeySetPatchParameters.json.cs index fdca15c71b4c..b40f1f40d925 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BmcKeySetPatchParameters.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BmcKeySetPatchParameters.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -67,19 +67,19 @@ internal BmcKeySetPatchParameters(Microsoft.Azure.PowerShell.Cmdlets.NetworkClou { return; } - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BmcKeySetPatchProperties.FromJson(__jsonProperties) : Property;} - {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BmcKeySetPatchParametersTags.FromJson(__jsonTags) : Tag;} + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BmcKeySetPatchProperties.FromJson(__jsonProperties) : _property;} + {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BmcKeySetPatchParametersTags.FromJson(__jsonTags) : _tag;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetPatchParameters. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetPatchParameters. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetPatchParameters. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetPatchParameters. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetPatchParameters FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetPatchParameters FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new BmcKeySetPatchParameters(json) : null; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BmcKeySetPatchParametersTags.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BmcKeySetPatchParametersTags.PowerShell.cs similarity index 89% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BmcKeySetPatchParametersTags.PowerShell.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BmcKeySetPatchParametersTags.PowerShell.cs index 027ad4fa7fea..bd1228c7076b 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BmcKeySetPatchParametersTags.PowerShell.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BmcKeySetPatchParametersTags.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; @@ -63,7 +63,7 @@ public partial class BmcKeySetPatchParametersTags 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 BmcKeySetPatchParametersTags(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. @@ -101,29 +101,27 @@ internal BmcKeySetPatchParametersTags(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 . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetPatchParametersTags DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetPatchParametersTags DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new BmcKeySetPatchParametersTags(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.NetworkCloud.Models.Api20250201.IBmcKeySetPatchParametersTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetPatchParametersTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new BmcKeySetPatchParametersTags(content); } @@ -133,7 +131,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetPatchParametersTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetPatchParametersTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BmcKeySetPatchParametersTags.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BmcKeySetPatchParametersTags.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BmcKeySetPatchParametersTags.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BmcKeySetPatchParametersTags.TypeConverter.cs index ae40d0bec64e..1a65f032c19b 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BmcKeySetPatchParametersTags.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BmcKeySetPatchParametersTags.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IBmcKeySetPatchParametersTags ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetPatchParametersTags ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetPatchParametersTags).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetPatchParametersTags).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BmcKeySetPatchParametersTags.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BmcKeySetPatchParametersTags.cs similarity index 84% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BmcKeySetPatchParametersTags.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BmcKeySetPatchParametersTags.cs index a52ad0bab8c8..0709f814a08d 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BmcKeySetPatchParametersTags.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BmcKeySetPatchParametersTags.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; /// The Azure resource tags that will replace the existing ones. public partial class BmcKeySetPatchParametersTags : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetPatchParametersTags, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetPatchParametersTagsInternal + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetPatchParametersTags, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetPatchParametersTagsInternal { /// Creates an new instance. diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BmcKeySetPatchParametersTags.dictionary.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BmcKeySetPatchParametersTags.dictionary.cs similarity index 96% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BmcKeySetPatchParametersTags.dictionary.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BmcKeySetPatchParametersTags.dictionary.cs index df019d50636b..7cc480986191 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BmcKeySetPatchParametersTags.dictionary.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BmcKeySetPatchParametersTags.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.BmcKeySetPatchParametersTags source) => source.__additionalProperties; + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BmcKeySetPatchParametersTags source) => source.__additionalProperties; } } \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BmcKeySetPatchParametersTags.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BmcKeySetPatchParametersTags.json.cs similarity index 95% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BmcKeySetPatchParametersTags.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BmcKeySetPatchParametersTags.json.cs index 6f2e9dfe8be1..7fd84ffccaf4 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BmcKeySetPatchParametersTags.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BmcKeySetPatchParametersTags.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -71,13 +71,13 @@ internal BmcKeySetPatchParametersTags(Microsoft.Azure.PowerShell.Cmdlets.Network } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetPatchParametersTags. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetPatchParametersTags. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetPatchParametersTags. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetPatchParametersTags. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetPatchParametersTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetPatchParametersTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new BmcKeySetPatchParametersTags(json) : null; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BmcKeySetPatchProperties.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BmcKeySetPatchProperties.PowerShell.cs new file mode 100644 index 000000000000..aea79bf8decd --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BmcKeySetPatchProperties.PowerShell.cs @@ -0,0 +1,174 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + + /// + /// BmcKeySetPatchProperties represents the properties of baseboard management controller key set that are patchable. + /// + [System.ComponentModel.TypeConverter(typeof(BmcKeySetPatchPropertiesTypeConverter))] + public partial class BmcKeySetPatchProperties + { + + /// + /// 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 BmcKeySetPatchProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Expiration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetPatchPropertiesInternal)this).Expiration = (global::System.DateTime?) content.GetValueForProperty("Expiration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetPatchPropertiesInternal)this).Expiration, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("UserList")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetPatchPropertiesInternal)this).UserList = (System.Collections.Generic.List) content.GetValueForProperty("UserList",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetPatchPropertiesInternal)this).UserList, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.KeySetUserTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal BmcKeySetPatchProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Expiration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetPatchPropertiesInternal)this).Expiration = (global::System.DateTime?) content.GetValueForProperty("Expiration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetPatchPropertiesInternal)this).Expiration, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("UserList")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetPatchPropertiesInternal)this).UserList = (System.Collections.Generic.List) content.GetValueForProperty("UserList",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetPatchPropertiesInternal)this).UserList, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.KeySetUserTypeConverter.ConvertFrom)); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetPatchProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new BmcKeySetPatchProperties(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.NetworkCloud.Models.IBmcKeySetPatchProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new BmcKeySetPatchProperties(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.NetworkCloud.Models.IBmcKeySetPatchProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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(); + } + } + /// BmcKeySetPatchProperties represents the properties of baseboard management controller key set that are patchable. + [System.ComponentModel.TypeConverter(typeof(BmcKeySetPatchPropertiesTypeConverter))] + public partial interface IBmcKeySetPatchProperties + + { + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BmcKeySetPatchProperties.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BmcKeySetPatchProperties.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BmcKeySetPatchProperties.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BmcKeySetPatchProperties.TypeConverter.cs index f07c31a76019..01b5dcdb9785 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BmcKeySetPatchProperties.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BmcKeySetPatchProperties.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IBmcKeySetPatchProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetPatchProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetPatchProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetPatchProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BmcKeySetPatchProperties.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BmcKeySetPatchProperties.cs similarity index 78% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BmcKeySetPatchProperties.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BmcKeySetPatchProperties.cs index 5fc06d16e1a8..9dbf80f60714 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BmcKeySetPatchProperties.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BmcKeySetPatchProperties.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -11,8 +11,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201 /// BmcKeySetPatchProperties represents the properties of baseboard management controller key set that are patchable. /// public partial class BmcKeySetPatchProperties : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetPatchProperties, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetPatchPropertiesInternal + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetPatchProperties, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetPatchPropertiesInternal { /// Backing field for property. @@ -25,11 +25,11 @@ public partial class BmcKeySetPatchProperties : public global::System.DateTime? Expiration { get => this._expiration; set => this._expiration = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKeySetUser[] _userList; + private System.Collections.Generic.List _userList; /// The unique list of permitted users. [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKeySetUser[] UserList { get => this._userList; set => this._userList = value; } + public System.Collections.Generic.List UserList { get => this._userList; set => this._userList = value; } /// Creates an new instance. public BmcKeySetPatchProperties() @@ -47,6 +47,9 @@ public partial interface IBmcKeySetPatchProperties : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The date and time after which the users in this key set will be removed from the baseboard management controllers.", SerializedName = @"expiration", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -55,10 +58,13 @@ public partial interface IBmcKeySetPatchProperties : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The unique list of permitted users.", SerializedName = @"userList", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKeySetUser) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKeySetUser[] UserList { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKeySetUser) })] + System.Collections.Generic.List UserList { get; set; } } /// BmcKeySetPatchProperties represents the properties of baseboard management controller key set that are patchable. @@ -70,7 +76,7 @@ internal partial interface IBmcKeySetPatchPropertiesInternal /// global::System.DateTime? Expiration { get; set; } /// The unique list of permitted users. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKeySetUser[] UserList { get; set; } + System.Collections.Generic.List UserList { get; set; } } } \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BmcKeySetPatchProperties.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BmcKeySetPatchProperties.json.cs similarity index 91% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BmcKeySetPatchProperties.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BmcKeySetPatchProperties.json.cs index f103ec1a7803..ddf6daf191c8 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BmcKeySetPatchProperties.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BmcKeySetPatchProperties.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -67,19 +67,19 @@ internal BmcKeySetPatchProperties(Microsoft.Azure.PowerShell.Cmdlets.NetworkClou { return; } - {_expiration = If( json?.PropertyT("expiration"), out var __jsonExpiration) ? global::System.DateTime.TryParse((string)__jsonExpiration, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonExpirationValue) ? __jsonExpirationValue : Expiration : Expiration;} - {_userList = If( json?.PropertyT("userList"), out var __jsonUserList) ? If( __jsonUserList as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IKeySetUser) (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.KeySetUser.FromJson(__u) )) ))() : null : UserList;} + {_expiration = If( json?.PropertyT("expiration"), out var __jsonExpiration) ? global::System.DateTime.TryParse((string)__jsonExpiration, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonExpirationValue) ? __jsonExpirationValue : _expiration : _expiration;} + {_userList = If( json?.PropertyT("userList"), out var __jsonUserList) ? If( __jsonUserList as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.IKeySetUser) (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.KeySetUser.FromJson(__u) )) ))() : null : _userList;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetPatchProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetPatchProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetPatchProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetPatchProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetPatchProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetPatchProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new BmcKeySetPatchProperties(json) : null; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BmcKeySetProperties.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BmcKeySetProperties.PowerShell.cs new file mode 100644 index 000000000000..7203878b82fb --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BmcKeySetProperties.PowerShell.cs @@ -0,0 +1,230 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + + /// + /// BmcKeySetProperties represents the properties of baseboard management controller key set. + /// + [System.ComponentModel.TypeConverter(typeof(BmcKeySetPropertiesTypeConverter))] + public partial class BmcKeySetProperties + { + + /// + /// 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 BmcKeySetProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("AzureGroupId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetPropertiesInternal)this).AzureGroupId = (string) content.GetValueForProperty("AzureGroupId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetPropertiesInternal)this).AzureGroupId, global::System.Convert.ToString); + } + if (content.Contains("DetailedStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetPropertiesInternal)this).DetailedStatus = (string) content.GetValueForProperty("DetailedStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetPropertiesInternal)this).DetailedStatus, global::System.Convert.ToString); + } + if (content.Contains("DetailedStatusMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetPropertiesInternal)this).DetailedStatusMessage = (string) content.GetValueForProperty("DetailedStatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetPropertiesInternal)this).DetailedStatusMessage, global::System.Convert.ToString); + } + if (content.Contains("Expiration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetPropertiesInternal)this).Expiration = (global::System.DateTime) content.GetValueForProperty("Expiration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetPropertiesInternal)this).Expiration, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("LastValidation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetPropertiesInternal)this).LastValidation = (global::System.DateTime?) content.GetValueForProperty("LastValidation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetPropertiesInternal)this).LastValidation, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("PrivilegeLevel")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetPropertiesInternal)this).PrivilegeLevel = (string) content.GetValueForProperty("PrivilegeLevel",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetPropertiesInternal)this).PrivilegeLevel, global::System.Convert.ToString); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetPropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetPropertiesInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("UserList")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetPropertiesInternal)this).UserList = (System.Collections.Generic.List) content.GetValueForProperty("UserList",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetPropertiesInternal)this).UserList, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.KeySetUserTypeConverter.ConvertFrom)); + } + if (content.Contains("UserListStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetPropertiesInternal)this).UserListStatus = (System.Collections.Generic.List) content.GetValueForProperty("UserListStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetPropertiesInternal)this).UserListStatus, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.KeySetUserStatusTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal BmcKeySetProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("AzureGroupId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetPropertiesInternal)this).AzureGroupId = (string) content.GetValueForProperty("AzureGroupId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetPropertiesInternal)this).AzureGroupId, global::System.Convert.ToString); + } + if (content.Contains("DetailedStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetPropertiesInternal)this).DetailedStatus = (string) content.GetValueForProperty("DetailedStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetPropertiesInternal)this).DetailedStatus, global::System.Convert.ToString); + } + if (content.Contains("DetailedStatusMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetPropertiesInternal)this).DetailedStatusMessage = (string) content.GetValueForProperty("DetailedStatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetPropertiesInternal)this).DetailedStatusMessage, global::System.Convert.ToString); + } + if (content.Contains("Expiration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetPropertiesInternal)this).Expiration = (global::System.DateTime) content.GetValueForProperty("Expiration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetPropertiesInternal)this).Expiration, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("LastValidation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetPropertiesInternal)this).LastValidation = (global::System.DateTime?) content.GetValueForProperty("LastValidation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetPropertiesInternal)this).LastValidation, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("PrivilegeLevel")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetPropertiesInternal)this).PrivilegeLevel = (string) content.GetValueForProperty("PrivilegeLevel",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetPropertiesInternal)this).PrivilegeLevel, global::System.Convert.ToString); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetPropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetPropertiesInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("UserList")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetPropertiesInternal)this).UserList = (System.Collections.Generic.List) content.GetValueForProperty("UserList",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetPropertiesInternal)this).UserList, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.KeySetUserTypeConverter.ConvertFrom)); + } + if (content.Contains("UserListStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetPropertiesInternal)this).UserListStatus = (System.Collections.Generic.List) content.GetValueForProperty("UserListStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetPropertiesInternal)this).UserListStatus, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.KeySetUserStatusTypeConverter.ConvertFrom)); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new BmcKeySetProperties(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.NetworkCloud.Models.IBmcKeySetProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new BmcKeySetProperties(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.NetworkCloud.Models.IBmcKeySetProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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(); + } + } + /// BmcKeySetProperties represents the properties of baseboard management controller key set. + [System.ComponentModel.TypeConverter(typeof(BmcKeySetPropertiesTypeConverter))] + public partial interface IBmcKeySetProperties + + { + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BmcKeySetProperties.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BmcKeySetProperties.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BmcKeySetProperties.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BmcKeySetProperties.TypeConverter.cs index 6db591911e2b..39a1c0e15b16 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BmcKeySetProperties.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BmcKeySetProperties.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IBmcKeySetProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BmcKeySetProperties.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BmcKeySetProperties.cs new file mode 100644 index 000000000000..6d9c7f3ce73f --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BmcKeySetProperties.cs @@ -0,0 +1,252 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + + /// + /// BmcKeySetProperties represents the properties of baseboard management controller key set. + /// + public partial class BmcKeySetProperties : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetProperties, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetPropertiesInternal + { + + /// Backing field for property. + private string _azureGroupId; + + /// + /// The object ID of Azure Active Directory group that all users in the list must be in for access to be granted. Users that + /// are not in the group will not have access. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string AzureGroupId { get => this._azureGroupId; set => this._azureGroupId = value; } + + /// Backing field for property. + private string _detailedStatus; + + /// The more detailed status of the key set. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string DetailedStatus { get => this._detailedStatus; } + + /// Backing field for property. + private string _detailedStatusMessage; + + /// The descriptive message about the current detailed status. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string DetailedStatusMessage { get => this._detailedStatusMessage; } + + /// Backing field for property. + private global::System.DateTime _expiration; + + /// + /// The date and time after which the users in this key set will be removed from the baseboard management controllers. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public global::System.DateTime Expiration { get => this._expiration; set => this._expiration = value; } + + /// Backing field for property. + private global::System.DateTime? _lastValidation; + + /// The last time this key set was validated. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public global::System.DateTime? LastValidation { get => this._lastValidation; } + + /// Internal Acessors for DetailedStatus + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetPropertiesInternal.DetailedStatus { get => this._detailedStatus; set { {_detailedStatus = value;} } } + + /// Internal Acessors for DetailedStatusMessage + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetPropertiesInternal.DetailedStatusMessage { get => this._detailedStatusMessage; set { {_detailedStatusMessage = value;} } } + + /// Internal Acessors for LastValidation + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetPropertiesInternal.LastValidation { get => this._lastValidation; set { {_lastValidation = value;} } } + + /// Internal Acessors for ProvisioningState + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetPropertiesInternal.ProvisioningState { get => this._provisioningState; set { {_provisioningState = value;} } } + + /// Internal Acessors for UserListStatus + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetPropertiesInternal.UserListStatus { get => this._userListStatus; set { {_userListStatus = value;} } } + + /// Backing field for property. + private string _privilegeLevel; + + /// The access level allowed for the users in this key set. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string PrivilegeLevel { get => this._privilegeLevel; set => this._privilegeLevel = value; } + + /// Backing field for property. + private string _provisioningState; + + /// The provisioning state of the baseboard management controller key set. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string ProvisioningState { get => this._provisioningState; } + + /// Backing field for property. + private System.Collections.Generic.List _userList; + + /// The unique list of permitted users. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public System.Collections.Generic.List UserList { get => this._userList; set => this._userList = value; } + + /// Backing field for property. + private System.Collections.Generic.List _userListStatus; + + /// The status evaluation of each user. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public System.Collections.Generic.List UserListStatus { get => this._userListStatus; } + + /// Creates an new instance. + public BmcKeySetProperties() + { + + } + } + /// BmcKeySetProperties represents the properties of baseboard management controller key set. + public partial interface IBmcKeySetProperties : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable + { + /// + /// The object ID of Azure Active Directory group that all users in the list must be in for access to be granted. Users that + /// are not in the group will not have access. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The object ID of Azure Active Directory group that all users in the list must be in for access to be granted. Users that are not in the group will not have access.", + SerializedName = @"azureGroupId", + PossibleTypes = new [] { typeof(string) })] + string AzureGroupId { get; set; } + /// The more detailed status of the key set. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The more detailed status of the key set.", + SerializedName = @"detailedStatus", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("AllActive", "SomeInvalid", "AllInvalid", "Validating")] + string DetailedStatus { get; } + /// The descriptive message about the current detailed status. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The descriptive message about the current detailed status.", + SerializedName = @"detailedStatusMessage", + PossibleTypes = new [] { typeof(string) })] + string DetailedStatusMessage { get; } + /// + /// The date and time after which the users in this key set will be removed from the baseboard management controllers. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The date and time after which the users in this key set will be removed from the baseboard management controllers.", + SerializedName = @"expiration", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime Expiration { get; set; } + /// The last time this key set was validated. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The last time this key set was validated.", + SerializedName = @"lastValidation", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? LastValidation { get; } + /// The access level allowed for the users in this key set. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The access level allowed for the users in this key set.", + SerializedName = @"privilegeLevel", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("ReadOnly", "Administrator")] + string PrivilegeLevel { get; set; } + /// The provisioning state of the baseboard management controller key set. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The provisioning state of the baseboard management controller key set.", + SerializedName = @"provisioningState", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Succeeded", "Failed", "Canceled", "Accepted", "Provisioning")] + string ProvisioningState { get; } + /// The unique list of permitted users. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The unique list of permitted users.", + SerializedName = @"userList", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKeySetUser) })] + System.Collections.Generic.List UserList { get; set; } + /// The status evaluation of each user. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The status evaluation of each user.", + SerializedName = @"userListStatus", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKeySetUserStatus) })] + System.Collections.Generic.List UserListStatus { get; } + + } + /// BmcKeySetProperties represents the properties of baseboard management controller key set. + internal partial interface IBmcKeySetPropertiesInternal + + { + /// + /// The object ID of Azure Active Directory group that all users in the list must be in for access to be granted. Users that + /// are not in the group will not have access. + /// + string AzureGroupId { get; set; } + /// The more detailed status of the key set. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("AllActive", "SomeInvalid", "AllInvalid", "Validating")] + string DetailedStatus { get; set; } + /// The descriptive message about the current detailed status. + string DetailedStatusMessage { get; set; } + /// + /// The date and time after which the users in this key set will be removed from the baseboard management controllers. + /// + global::System.DateTime Expiration { get; set; } + /// The last time this key set was validated. + global::System.DateTime? LastValidation { get; set; } + /// The access level allowed for the users in this key set. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("ReadOnly", "Administrator")] + string PrivilegeLevel { get; set; } + /// The provisioning state of the baseboard management controller key set. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Succeeded", "Failed", "Canceled", "Accepted", "Provisioning")] + string ProvisioningState { get; set; } + /// The unique list of permitted users. + System.Collections.Generic.List UserList { get; set; } + /// The status evaluation of each user. + System.Collections.Generic.List UserListStatus { get; set; } + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BmcKeySetProperties.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BmcKeySetProperties.json.cs similarity index 79% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BmcKeySetProperties.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BmcKeySetProperties.json.cs index 4a21417806b5..b687ad057647 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/BmcKeySetProperties.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/BmcKeySetProperties.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -67,26 +67,26 @@ internal BmcKeySetProperties(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Run { return; } - {_azureGroupId = If( json?.PropertyT("azureGroupId"), out var __jsonAzureGroupId) ? (string)__jsonAzureGroupId : (string)AzureGroupId;} - {_detailedStatus = If( json?.PropertyT("detailedStatus"), out var __jsonDetailedStatus) ? (string)__jsonDetailedStatus : (string)DetailedStatus;} - {_detailedStatusMessage = If( json?.PropertyT("detailedStatusMessage"), out var __jsonDetailedStatusMessage) ? (string)__jsonDetailedStatusMessage : (string)DetailedStatusMessage;} - {_expiration = If( json?.PropertyT("expiration"), out var __jsonExpiration) ? global::System.DateTime.TryParse((string)__jsonExpiration, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonExpirationValue) ? __jsonExpirationValue : Expiration : Expiration;} - {_lastValidation = If( json?.PropertyT("lastValidation"), out var __jsonLastValidation) ? global::System.DateTime.TryParse((string)__jsonLastValidation, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonLastValidationValue) ? __jsonLastValidationValue : LastValidation : LastValidation;} - {_privilegeLevel = If( json?.PropertyT("privilegeLevel"), out var __jsonPrivilegeLevel) ? (string)__jsonPrivilegeLevel : (string)PrivilegeLevel;} - {_provisioningState = If( json?.PropertyT("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)ProvisioningState;} - {_userList = If( json?.PropertyT("userList"), out var __jsonUserList) ? If( __jsonUserList as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IKeySetUser) (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.KeySetUser.FromJson(__u) )) ))() : null : UserList;} - {_userListStatus = If( json?.PropertyT("userListStatus"), out var __jsonUserListStatus) ? If( __jsonUserListStatus as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IKeySetUserStatus) (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.KeySetUserStatus.FromJson(__p) )) ))() : null : UserListStatus;} + {_azureGroupId = If( json?.PropertyT("azureGroupId"), out var __jsonAzureGroupId) ? (string)__jsonAzureGroupId : (string)_azureGroupId;} + {_detailedStatus = If( json?.PropertyT("detailedStatus"), out var __jsonDetailedStatus) ? (string)__jsonDetailedStatus : (string)_detailedStatus;} + {_detailedStatusMessage = If( json?.PropertyT("detailedStatusMessage"), out var __jsonDetailedStatusMessage) ? (string)__jsonDetailedStatusMessage : (string)_detailedStatusMessage;} + {_expiration = If( json?.PropertyT("expiration"), out var __jsonExpiration) ? global::System.DateTime.TryParse((string)__jsonExpiration, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonExpirationValue) ? __jsonExpirationValue : _expiration : _expiration;} + {_lastValidation = If( json?.PropertyT("lastValidation"), out var __jsonLastValidation) ? global::System.DateTime.TryParse((string)__jsonLastValidation, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonLastValidationValue) ? __jsonLastValidationValue : _lastValidation : _lastValidation;} + {_privilegeLevel = If( json?.PropertyT("privilegeLevel"), out var __jsonPrivilegeLevel) ? (string)__jsonPrivilegeLevel : (string)_privilegeLevel;} + {_provisioningState = If( json?.PropertyT("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)_provisioningState;} + {_userList = If( json?.PropertyT("userList"), out var __jsonUserList) ? If( __jsonUserList as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.IKeySetUser) (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.KeySetUser.FromJson(__u) )) ))() : null : _userList;} + {_userListStatus = If( json?.PropertyT("userListStatus"), out var __jsonUserListStatus) ? If( __jsonUserListStatus as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.IKeySetUserStatus) (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.KeySetUserStatus.FromJson(__p) )) ))() : null : _userListStatus;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new BmcKeySetProperties(json) : null; } @@ -110,22 +110,28 @@ public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode ToJ { return container; } - AddIf( null != (((object)this._azureGroupId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._azureGroupId.ToString()) : null, "azureGroupId" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)||serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate)) + { + AddIf( null != (((object)this._azureGroupId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._azureGroupId.ToString()) : null, "azureGroupId" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._detailedStatus)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._detailedStatus.ToString()) : null, "detailedStatus" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._detailedStatusMessage)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._detailedStatusMessage.ToString()) : null, "detailedStatusMessage" ,container.Add ); } AddIf( (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._expiration.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)), "expiration" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != this._lastValidation ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._lastValidation?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "lastValidation" ,container.Add ); } - AddIf( null != (((object)this._privilegeLevel)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._privilegeLevel.ToString()) : null, "privilegeLevel" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)||serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate)) + { + AddIf( null != (((object)this._privilegeLevel)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._privilegeLevel.ToString()) : null, "privilegeLevel" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._provisioningState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._provisioningState.ToString()) : null, "provisioningState" ,container.Add ); } @@ -138,7 +144,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode ToJ } container.Add("userList",__w); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { if (null != this._userListStatus) { diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/CloudServicesNetwork.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/CloudServicesNetwork.PowerShell.cs new file mode 100644 index 000000000000..8266c9da8ae3 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/CloudServicesNetwork.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.NetworkCloud.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + + /// + /// Upon creation, the additional services that are provided by the platform will be allocated and + /// represented in the status of this resource. All resources associated with this cloud services network will be part + /// of the same layer 2 (L2) isolation domain. At least one service network must be created but may be reused across many + /// virtual machines and/or Hybrid AKS clusters. + /// + [System.ComponentModel.TypeConverter(typeof(CloudServicesNetworkTypeConverter))] + public partial class CloudServicesNetwork + { + + /// + /// 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 CloudServicesNetwork(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ExtendedLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkInternal)this).ExtendedLocation = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocation) content.GetValueForProperty("ExtendedLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkInternal)this).ExtendedLocation, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ExtendedLocationTypeConverter.ConvertFrom); + } + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.CloudServicesNetworkPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Etag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkInternal)this).Etag, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)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("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedByType = (string) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedByType = (string) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.TrackedResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("ExtendedLocationName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkInternal)this).ExtendedLocationName = (string) content.GetValueForProperty("ExtendedLocationName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkInternal)this).ExtendedLocationName, global::System.Convert.ToString); + } + if (content.Contains("ExtendedLocationType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkInternal)this).ExtendedLocationType = (string) content.GetValueForProperty("ExtendedLocationType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkInternal)this).ExtendedLocationType, global::System.Convert.ToString); + } + if (content.Contains("AdditionalEgressEndpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkInternal)this).AdditionalEgressEndpoint = (System.Collections.Generic.List) content.GetValueForProperty("AdditionalEgressEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkInternal)this).AdditionalEgressEndpoint, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.EgressEndpointTypeConverter.ConvertFrom)); + } + if (content.Contains("AssociatedResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkInternal)this).AssociatedResourceId = (System.Collections.Generic.List) content.GetValueForProperty("AssociatedResourceId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkInternal)this).AssociatedResourceId, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("ClusterId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkInternal)this).ClusterId = (string) content.GetValueForProperty("ClusterId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkInternal)this).ClusterId, global::System.Convert.ToString); + } + if (content.Contains("DetailedStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkInternal)this).DetailedStatus = (string) content.GetValueForProperty("DetailedStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkInternal)this).DetailedStatus, global::System.Convert.ToString); + } + if (content.Contains("DetailedStatusMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkInternal)this).DetailedStatusMessage = (string) content.GetValueForProperty("DetailedStatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkInternal)this).DetailedStatusMessage, global::System.Convert.ToString); + } + if (content.Contains("EnableDefaultEgressEndpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkInternal)this).EnableDefaultEgressEndpoint = (string) content.GetValueForProperty("EnableDefaultEgressEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkInternal)this).EnableDefaultEgressEndpoint, global::System.Convert.ToString); + } + if (content.Contains("EnabledEgressEndpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkInternal)this).EnabledEgressEndpoint = (System.Collections.Generic.List) content.GetValueForProperty("EnabledEgressEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkInternal)this).EnabledEgressEndpoint, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.EgressEndpointTypeConverter.ConvertFrom)); + } + if (content.Contains("HybridAksClustersAssociatedId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkInternal)this).HybridAksClustersAssociatedId = (System.Collections.Generic.List) content.GetValueForProperty("HybridAksClustersAssociatedId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkInternal)this).HybridAksClustersAssociatedId, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("InterfaceName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkInternal)this).InterfaceName = (string) content.GetValueForProperty("InterfaceName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkInternal)this).InterfaceName, global::System.Convert.ToString); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("VirtualMachinesAssociatedId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkInternal)this).VirtualMachinesAssociatedId = (System.Collections.Generic.List) content.GetValueForProperty("VirtualMachinesAssociatedId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkInternal)this).VirtualMachinesAssociatedId, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal CloudServicesNetwork(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ExtendedLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkInternal)this).ExtendedLocation = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocation) content.GetValueForProperty("ExtendedLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkInternal)this).ExtendedLocation, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ExtendedLocationTypeConverter.ConvertFrom); + } + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.CloudServicesNetworkPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Etag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkInternal)this).Etag, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)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("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedByType = (string) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedByType = (string) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.TrackedResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("ExtendedLocationName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkInternal)this).ExtendedLocationName = (string) content.GetValueForProperty("ExtendedLocationName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkInternal)this).ExtendedLocationName, global::System.Convert.ToString); + } + if (content.Contains("ExtendedLocationType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkInternal)this).ExtendedLocationType = (string) content.GetValueForProperty("ExtendedLocationType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkInternal)this).ExtendedLocationType, global::System.Convert.ToString); + } + if (content.Contains("AdditionalEgressEndpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkInternal)this).AdditionalEgressEndpoint = (System.Collections.Generic.List) content.GetValueForProperty("AdditionalEgressEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkInternal)this).AdditionalEgressEndpoint, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.EgressEndpointTypeConverter.ConvertFrom)); + } + if (content.Contains("AssociatedResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkInternal)this).AssociatedResourceId = (System.Collections.Generic.List) content.GetValueForProperty("AssociatedResourceId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkInternal)this).AssociatedResourceId, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("ClusterId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkInternal)this).ClusterId = (string) content.GetValueForProperty("ClusterId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkInternal)this).ClusterId, global::System.Convert.ToString); + } + if (content.Contains("DetailedStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkInternal)this).DetailedStatus = (string) content.GetValueForProperty("DetailedStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkInternal)this).DetailedStatus, global::System.Convert.ToString); + } + if (content.Contains("DetailedStatusMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkInternal)this).DetailedStatusMessage = (string) content.GetValueForProperty("DetailedStatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkInternal)this).DetailedStatusMessage, global::System.Convert.ToString); + } + if (content.Contains("EnableDefaultEgressEndpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkInternal)this).EnableDefaultEgressEndpoint = (string) content.GetValueForProperty("EnableDefaultEgressEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkInternal)this).EnableDefaultEgressEndpoint, global::System.Convert.ToString); + } + if (content.Contains("EnabledEgressEndpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkInternal)this).EnabledEgressEndpoint = (System.Collections.Generic.List) content.GetValueForProperty("EnabledEgressEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkInternal)this).EnabledEgressEndpoint, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.EgressEndpointTypeConverter.ConvertFrom)); + } + if (content.Contains("HybridAksClustersAssociatedId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkInternal)this).HybridAksClustersAssociatedId = (System.Collections.Generic.List) content.GetValueForProperty("HybridAksClustersAssociatedId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkInternal)this).HybridAksClustersAssociatedId, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("InterfaceName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkInternal)this).InterfaceName = (string) content.GetValueForProperty("InterfaceName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkInternal)this).InterfaceName, global::System.Convert.ToString); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("VirtualMachinesAssociatedId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkInternal)this).VirtualMachinesAssociatedId = (System.Collections.Generic.List) content.GetValueForProperty("VirtualMachinesAssociatedId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkInternal)this).VirtualMachinesAssociatedId, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetwork DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new CloudServicesNetwork(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.NetworkCloud.Models.ICloudServicesNetwork DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new CloudServicesNetwork(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.NetworkCloud.Models.ICloudServicesNetwork FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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(); + } + } + /// Upon creation, the additional services that are provided by the platform will be allocated and + /// represented in the status of this resource. All resources associated with this cloud services network will be part + /// of the same layer 2 (L2) isolation domain. At least one service network must be created but may be reused across many + /// virtual machines and/or Hybrid AKS clusters. + [System.ComponentModel.TypeConverter(typeof(CloudServicesNetworkTypeConverter))] + public partial interface ICloudServicesNetwork + + { + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/CloudServicesNetwork.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/CloudServicesNetwork.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/CloudServicesNetwork.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/CloudServicesNetwork.TypeConverter.cs index cb5b8a2a3503..94c8348538fd 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/CloudServicesNetwork.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/CloudServicesNetwork.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.ICloudServicesNetwork ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetwork ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetwork).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetwork).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/CloudServicesNetwork.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/CloudServicesNetwork.cs new file mode 100644 index 000000000000..bdb1bccbaf92 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/CloudServicesNetwork.cs @@ -0,0 +1,507 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + + /// + /// Upon creation, the additional services that are provided by the platform will be allocated and + /// represented in the status of this resource. All resources associated with this cloud services network will be part + /// of the same layer 2 (L2) isolation domain. At least one service network must be created but may be reused across many + /// virtual machines and/or Hybrid AKS clusters. + /// + public partial class CloudServicesNetwork : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetwork, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkInternal, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResource __trackedResource = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.TrackedResource(); + + /// + /// The list of egress endpoints. This allows for connection from a Hybrid AKS cluster to the specified endpoint. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public System.Collections.Generic.List AdditionalEgressEndpoint { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkPropertiesInternal)Property).AdditionalEgressEndpoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkPropertiesInternal)Property).AdditionalEgressEndpoint = value ?? null /* arrayOf */; } + + /// + /// The list of resource IDs for the other Microsoft.NetworkCloud resources that have attached this network. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public System.Collections.Generic.List AssociatedResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkPropertiesInternal)Property).AssociatedResourceId; } + + /// + /// The resource ID of the Network Cloud cluster this cloud services network is associated with. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string ClusterId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkPropertiesInternal)Property).ClusterId; } + + /// The more detailed status of the cloud services network. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string DetailedStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkPropertiesInternal)Property).DetailedStatus; } + + /// The descriptive message about the current detailed status. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string DetailedStatusMessage { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkPropertiesInternal)Property).DetailedStatusMessage; } + + /// + /// The indicator of whether the platform default endpoints are allowed for the egress traffic. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string EnableDefaultEgressEndpoint { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkPropertiesInternal)Property).EnableDefaultEgressEndpoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkPropertiesInternal)Property).EnableDefaultEgressEndpoint = value ?? null; } + + /// + /// The full list of additional and default egress endpoints that are currently enabled. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public System.Collections.Generic.List EnabledEgressEndpoint { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkPropertiesInternal)Property).EnabledEgressEndpoint; } + + /// Backing field for property. + private string _etag; + + /// Resource ETag. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string Etag { get => this._etag; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocation _extendedLocation; + + /// The extended location of the cluster associated with the resource. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocation ExtendedLocation { get => (this._extendedLocation = this._extendedLocation ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ExtendedLocation()); set => this._extendedLocation = value; } + + /// The resource ID of the extended location on which the resource will be created. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string ExtendedLocationName { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocationInternal)ExtendedLocation).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocationInternal)ExtendedLocation).Name = value ?? null; } + + /// The extended location type, for example, CustomLocation. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string ExtendedLocationType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocationInternal)ExtendedLocation).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocationInternal)ExtendedLocation).Type = value ?? null; } + + /// + /// Field Deprecated. These fields will be empty/omitted. The list of Hybrid AKS cluster resource IDs that are associated + /// with this cloud services network. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public System.Collections.Generic.List HybridAksClustersAssociatedId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkPropertiesInternal)Property).HybridAksClustersAssociatedId; } + + /// + /// Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).Id; } + + /// + /// The name of the interface that will be present in the virtual machine to represent this network. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string InterfaceName { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkPropertiesInternal)Property).InterfaceName; } + + /// The geo-location where the resource lives + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)__trackedResource).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)__trackedResource).Location = value ?? null; } + + /// Internal Acessors for AssociatedResourceId + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkInternal.AssociatedResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkPropertiesInternal)Property).AssociatedResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkPropertiesInternal)Property).AssociatedResourceId = value ?? null /* arrayOf */; } + + /// Internal Acessors for ClusterId + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkInternal.ClusterId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkPropertiesInternal)Property).ClusterId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkPropertiesInternal)Property).ClusterId = value ?? null; } + + /// Internal Acessors for DetailedStatus + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkInternal.DetailedStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkPropertiesInternal)Property).DetailedStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkPropertiesInternal)Property).DetailedStatus = value ?? null; } + + /// Internal Acessors for DetailedStatusMessage + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkInternal.DetailedStatusMessage { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkPropertiesInternal)Property).DetailedStatusMessage; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkPropertiesInternal)Property).DetailedStatusMessage = value ?? null; } + + /// Internal Acessors for EnabledEgressEndpoint + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkInternal.EnabledEgressEndpoint { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkPropertiesInternal)Property).EnabledEgressEndpoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkPropertiesInternal)Property).EnabledEgressEndpoint = value ?? null /* arrayOf */; } + + /// Internal Acessors for Etag + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkInternal.Etag { get => this._etag; set { {_etag = value;} } } + + /// Internal Acessors for ExtendedLocation + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocation Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkInternal.ExtendedLocation { get => (this._extendedLocation = this._extendedLocation ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ExtendedLocation()); set { {_extendedLocation = value;} } } + + /// Internal Acessors for HybridAksClustersAssociatedId + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkInternal.HybridAksClustersAssociatedId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkPropertiesInternal)Property).HybridAksClustersAssociatedId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkPropertiesInternal)Property).HybridAksClustersAssociatedId = value ?? null /* arrayOf */; } + + /// Internal Acessors for InterfaceName + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkInternal.InterfaceName { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkPropertiesInternal)Property).InterfaceName; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkPropertiesInternal)Property).InterfaceName = value ?? null; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkProperties Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.CloudServicesNetworkProperties()); set { {_property = value;} } } + + /// Internal Acessors for ProvisioningState + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkPropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkPropertiesInternal)Property).ProvisioningState = value ?? null; } + + /// Internal Acessors for VirtualMachinesAssociatedId + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkInternal.VirtualMachinesAssociatedId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkPropertiesInternal)Property).VirtualMachinesAssociatedId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkPropertiesInternal)Property).VirtualMachinesAssociatedId = value ?? null /* arrayOf */; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).Id = value ?? null; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).Name = value ?? null; } + + /// Internal Acessors for SystemData + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISystemData Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemData; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemData = value ?? null /* model class */; } + + /// Internal Acessors for SystemDataCreatedAt + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataCreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataCreatedAt = value ?? default(global::System.DateTime); } + + /// Internal Acessors for SystemDataCreatedBy + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataCreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataCreatedBy = value ?? null; } + + /// Internal Acessors for SystemDataCreatedByType + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataCreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataCreatedByType = value ?? null; } + + /// Internal Acessors for SystemDataLastModifiedAt + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedAt = value ?? default(global::System.DateTime); } + + /// Internal Acessors for SystemDataLastModifiedBy + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedBy = value ?? null; } + + /// Internal Acessors for SystemDataLastModifiedByType + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedByType = value ?? null; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).Type = value ?? null; } + + /// The name of the resource + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).Name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkProperties _property; + + /// The list of the resource properties. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.CloudServicesNetworkProperties()); set => this._property = value; } + + /// The provisioning state of the cloud services network. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkPropertiesInternal)Property).ProvisioningState; } + + /// Gets the resource group name + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string ResourceGroupName { get => (new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Success ? new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Groups["resourceGroupName"].Value : null); } + + /// + /// Azure Resource Manager metadata containing createdBy and modifiedBy information. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISystemData SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemData; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemData = value ?? null /* model class */; } + + /// The timestamp of resource creation (UTC). + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataCreatedAt; } + + /// The identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataCreatedBy; } + + /// The type of identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public string SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataCreatedByType; } + + /// The timestamp of resource last modification (UTC) + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedAt; } + + /// The identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedBy; } + + /// The type of identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public string SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedByType; } + + /// Resource tags. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)__trackedResource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).Type; } + + /// + /// Field Deprecated. These fields will be empty/omitted. The list of virtual machine resource IDs, excluding any Hybrid AKS + /// virtual machines, that are currently using this cloud services network. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public System.Collections.Generic.List VirtualMachinesAssociatedId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkPropertiesInternal)Property).VirtualMachinesAssociatedId; } + + /// Creates an new instance. + public CloudServicesNetwork() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__trackedResource), __trackedResource); + await eventListener.AssertObjectIsValid(nameof(__trackedResource), __trackedResource); + } + } + /// Upon creation, the additional services that are provided by the platform will be allocated and + /// represented in the status of this resource. All resources associated with this cloud services network will be part + /// of the same layer 2 (L2) isolation domain. At least one service network must be created but may be reused across many + /// virtual machines and/or Hybrid AKS clusters. + public partial interface ICloudServicesNetwork : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResource + { + /// + /// The list of egress endpoints. This allows for connection from a Hybrid AKS cluster to the specified endpoint. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The list of egress endpoints. This allows for connection from a Hybrid AKS cluster to the specified endpoint.", + SerializedName = @"additionalEgressEndpoints", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IEgressEndpoint) })] + System.Collections.Generic.List AdditionalEgressEndpoint { get; set; } + /// + /// The list of resource IDs for the other Microsoft.NetworkCloud resources that have attached this network. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The list of resource IDs for the other Microsoft.NetworkCloud resources that have attached this network.", + SerializedName = @"associatedResourceIds", + PossibleTypes = new [] { typeof(string) })] + System.Collections.Generic.List AssociatedResourceId { get; } + /// + /// The resource ID of the Network Cloud cluster this cloud services network is associated with. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The resource ID of the Network Cloud cluster this cloud services network is associated with.", + SerializedName = @"clusterId", + PossibleTypes = new [] { typeof(string) })] + string ClusterId { get; } + /// The more detailed status of the cloud services network. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The more detailed status of the cloud services network.", + SerializedName = @"detailedStatus", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Error", "Available", "Provisioning")] + string DetailedStatus { get; } + /// The descriptive message about the current detailed status. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The descriptive message about the current detailed status.", + SerializedName = @"detailedStatusMessage", + PossibleTypes = new [] { typeof(string) })] + string DetailedStatusMessage { get; } + /// + /// The indicator of whether the platform default endpoints are allowed for the egress traffic. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The indicator of whether the platform default endpoints are allowed for the egress traffic.", + SerializedName = @"enableDefaultEgressEndpoints", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("True", "False")] + string EnableDefaultEgressEndpoint { get; set; } + /// + /// The full list of additional and default egress endpoints that are currently enabled. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The full list of additional and default egress endpoints that are currently enabled.", + SerializedName = @"enabledEgressEndpoints", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IEgressEndpoint) })] + System.Collections.Generic.List EnabledEgressEndpoint { get; } + /// Resource ETag. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"Resource ETag.", + SerializedName = @"etag", + PossibleTypes = new [] { typeof(string) })] + string Etag { get; } + /// The resource ID of the extended location on which the resource will be created. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The resource ID of the extended location on which the resource will be created.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string ExtendedLocationName { get; set; } + /// The extended location type, for example, CustomLocation. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The extended location type, for example, CustomLocation.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + string ExtendedLocationType { get; set; } + /// + /// Field Deprecated. These fields will be empty/omitted. The list of Hybrid AKS cluster resource IDs that are associated + /// with this cloud services network. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"Field Deprecated. These fields will be empty/omitted. The list of Hybrid AKS cluster resource IDs that are associated with this cloud services network.", + SerializedName = @"hybridAksClustersAssociatedIds", + PossibleTypes = new [] { typeof(string) })] + System.Collections.Generic.List HybridAksClustersAssociatedId { get; } + /// + /// The name of the interface that will be present in the virtual machine to represent this network. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The name of the interface that will be present in the virtual machine to represent this network.", + SerializedName = @"interfaceName", + PossibleTypes = new [] { typeof(string) })] + string InterfaceName { get; } + /// The provisioning state of the cloud services network. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The provisioning state of the cloud services network.", + SerializedName = @"provisioningState", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Succeeded", "Failed", "Canceled", "Provisioning", "Accepted")] + string ProvisioningState { get; } + /// + /// Field Deprecated. These fields will be empty/omitted. The list of virtual machine resource IDs, excluding any Hybrid AKS + /// virtual machines, that are currently using this cloud services network. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"Field Deprecated. These fields will be empty/omitted. The list of virtual machine resource IDs, excluding any Hybrid AKS virtual machines, that are currently using this cloud services network.", + SerializedName = @"virtualMachinesAssociatedIds", + PossibleTypes = new [] { typeof(string) })] + System.Collections.Generic.List VirtualMachinesAssociatedId { get; } + + } + /// Upon creation, the additional services that are provided by the platform will be allocated and + /// represented in the status of this resource. All resources associated with this cloud services network will be part + /// of the same layer 2 (L2) isolation domain. At least one service network must be created but may be reused across many + /// virtual machines and/or Hybrid AKS clusters. + internal partial interface ICloudServicesNetworkInternal : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal + { + /// + /// The list of egress endpoints. This allows for connection from a Hybrid AKS cluster to the specified endpoint. + /// + System.Collections.Generic.List AdditionalEgressEndpoint { get; set; } + /// + /// The list of resource IDs for the other Microsoft.NetworkCloud resources that have attached this network. + /// + System.Collections.Generic.List AssociatedResourceId { get; set; } + /// + /// The resource ID of the Network Cloud cluster this cloud services network is associated with. + /// + string ClusterId { get; set; } + /// The more detailed status of the cloud services network. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Error", "Available", "Provisioning")] + string DetailedStatus { get; set; } + /// The descriptive message about the current detailed status. + string DetailedStatusMessage { get; set; } + /// + /// The indicator of whether the platform default endpoints are allowed for the egress traffic. + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("True", "False")] + string EnableDefaultEgressEndpoint { get; set; } + /// + /// The full list of additional and default egress endpoints that are currently enabled. + /// + System.Collections.Generic.List EnabledEgressEndpoint { get; set; } + /// Resource ETag. + string Etag { get; set; } + /// The extended location of the cluster associated with the resource. + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocation ExtendedLocation { get; set; } + /// The resource ID of the extended location on which the resource will be created. + string ExtendedLocationName { get; set; } + /// The extended location type, for example, CustomLocation. + string ExtendedLocationType { get; set; } + /// + /// Field Deprecated. These fields will be empty/omitted. The list of Hybrid AKS cluster resource IDs that are associated + /// with this cloud services network. + /// + System.Collections.Generic.List HybridAksClustersAssociatedId { get; set; } + /// + /// The name of the interface that will be present in the virtual machine to represent this network. + /// + string InterfaceName { get; set; } + /// The list of the resource properties. + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkProperties Property { get; set; } + /// The provisioning state of the cloud services network. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Succeeded", "Failed", "Canceled", "Provisioning", "Accepted")] + string ProvisioningState { get; set; } + /// + /// Field Deprecated. These fields will be empty/omitted. The list of virtual machine resource IDs, excluding any Hybrid AKS + /// virtual machines, that are currently using this cloud services network. + /// + System.Collections.Generic.List VirtualMachinesAssociatedId { get; set; } + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/CloudServicesNetwork.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/CloudServicesNetwork.json.cs similarity index 92% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/CloudServicesNetwork.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/CloudServicesNetwork.json.cs index aa199bce87bb..7b17c8db337e 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/CloudServicesNetwork.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/CloudServicesNetwork.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -70,21 +70,21 @@ internal CloudServicesNetwork(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Ru { return; } - __trackedResource = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.TrackedResource(json); - {_extendedLocation = If( json?.PropertyT("extendedLocation"), out var __jsonExtendedLocation) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ExtendedLocation.FromJson(__jsonExtendedLocation) : ExtendedLocation;} - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.CloudServicesNetworkProperties.FromJson(__jsonProperties) : Property;} - {_etag = If( json?.PropertyT("etag"), out var __jsonEtag) ? (string)__jsonEtag : (string)Etag;} + __trackedResource = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.TrackedResource(json); + {_extendedLocation = If( json?.PropertyT("extendedLocation"), out var __jsonExtendedLocation) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ExtendedLocation.FromJson(__jsonExtendedLocation) : _extendedLocation;} + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.CloudServicesNetworkProperties.FromJson(__jsonProperties) : _property;} + {_etag = If( json?.PropertyT("etag"), out var __jsonEtag) ? (string)__jsonEtag : (string)_etag;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetwork. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetwork. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetwork. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetwork. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetwork FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetwork FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new CloudServicesNetwork(json) : null; } @@ -111,7 +111,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode ToJ __trackedResource?.ToJson(container, serializationMode); AddIf( null != this._extendedLocation ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) this._extendedLocation.ToJson(null,serializationMode) : null, "extendedLocation" ,container.Add ); AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._etag)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._etag.ToString()) : null, "etag" ,container.Add ); } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/CloudServicesNetworkList.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/CloudServicesNetworkList.PowerShell.cs similarity index 76% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/CloudServicesNetworkList.PowerShell.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/CloudServicesNetworkList.PowerShell.cs index 8e9f60712424..62cb3b66f2e4 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/CloudServicesNetworkList.PowerShell.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/CloudServicesNetworkList.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; @@ -63,7 +63,7 @@ public partial class CloudServicesNetworkList 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 CloudServicesNetworkList(global::System.Collections.IDictionary content // actually deserialize if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkListInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkListInternal)this).NextLink, global::System.Convert.ToString); } if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetwork[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.CloudServicesNetworkTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkListInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkListInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.CloudServicesNetworkTypeConverter.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 CloudServicesNetworkList(global::System.Management.Automation.PSObject // actually deserialize if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkListInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkListInternal)this).NextLink, global::System.Convert.ToString); } if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetwork[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.CloudServicesNetworkTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkListInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkListInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.CloudServicesNetworkTypeConverter.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.NetworkCloud.Models.Api20250201.ICloudServicesNetworkList DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkList DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new CloudServicesNetworkList(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.NetworkCloud.Models.Api20250201.ICloudServicesNetworkList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new CloudServicesNetworkList(content); } @@ -145,7 +143,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/CloudServicesNetworkList.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/CloudServicesNetworkList.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/CloudServicesNetworkList.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/CloudServicesNetworkList.TypeConverter.cs index 063e60bd1faf..4027d14b1ca6 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/CloudServicesNetworkList.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/CloudServicesNetworkList.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.ICloudServicesNetworkList ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkList ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkList).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkList).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/CloudServicesNetworkList.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/CloudServicesNetworkList.cs new file mode 100644 index 000000000000..6e6914cc544a --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/CloudServicesNetworkList.cs @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + + /// CloudServicesNetworkList represents a list of cloud services networks. + public partial class CloudServicesNetworkList : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkList, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkListInternal + { + + /// Backing field for property. + private string _nextLink; + + /// The link used to get the next page of operations. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; set => this._nextLink = value; } + + /// Backing field for property. + private System.Collections.Generic.List _value; + + /// The list of cloud services networks. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public System.Collections.Generic.List Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public CloudServicesNetworkList() + { + + } + } + /// CloudServicesNetworkList represents a list of cloud services networks. + public partial interface ICloudServicesNetworkList : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable + { + /// The link used to get the next page of operations. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The link used to get the next page of operations.", + SerializedName = @"nextLink", + PossibleTypes = new [] { typeof(string) })] + string NextLink { get; set; } + /// The list of cloud services networks. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The list of cloud services networks.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetwork) })] + System.Collections.Generic.List Value { get; set; } + + } + /// CloudServicesNetworkList represents a list of cloud services networks. + internal partial interface ICloudServicesNetworkListInternal + + { + /// The link used to get the next page of operations. + string NextLink { get; set; } + /// The list of cloud services networks. + System.Collections.Generic.List Value { get; set; } + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/CloudServicesNetworkList.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/CloudServicesNetworkList.json.cs similarity index 90% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/CloudServicesNetworkList.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/CloudServicesNetworkList.json.cs index e6ee005dc802..eaa05175f981 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/CloudServicesNetworkList.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/CloudServicesNetworkList.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -65,19 +65,19 @@ internal CloudServicesNetworkList(Microsoft.Azure.PowerShell.Cmdlets.NetworkClou { return; } - {_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.NetworkCloud.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.NetworkCloud.Models.Api20250201.ICloudServicesNetwork) (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.CloudServicesNetwork.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.NetworkCloud.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.NetworkCloud.Models.ICloudServicesNetwork) (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.CloudServicesNetwork.FromJson(__u) )) ))() : null : _value;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkList. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkList. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkList. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkList. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkList FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkList FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new CloudServicesNetworkList(json) : null; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/CloudServicesNetworkPatchParameters.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/CloudServicesNetworkPatchParameters.PowerShell.cs new file mode 100644 index 000000000000..d26ed1da517e --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/CloudServicesNetworkPatchParameters.PowerShell.cs @@ -0,0 +1,194 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + + /// + /// CloudServicesNetworkPatchParameters represents the body of the request to patch the cloud services network. + /// + [System.ComponentModel.TypeConverter(typeof(CloudServicesNetworkPatchParametersTypeConverter))] + public partial class CloudServicesNetworkPatchParameters + { + + /// + /// 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 CloudServicesNetworkPatchParameters(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.NetworkCloud.Models.ICloudServicesNetworkPatchParametersInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkPatchProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkPatchParametersInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.CloudServicesNetworkPatchPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkPatchParametersInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkPatchParametersTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkPatchParametersInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.CloudServicesNetworkPatchParametersTagsTypeConverter.ConvertFrom); + } + if (content.Contains("AdditionalEgressEndpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkPatchParametersInternal)this).AdditionalEgressEndpoint = (System.Collections.Generic.List) content.GetValueForProperty("AdditionalEgressEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkPatchParametersInternal)this).AdditionalEgressEndpoint, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.EgressEndpointTypeConverter.ConvertFrom)); + } + if (content.Contains("EnableDefaultEgressEndpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkPatchParametersInternal)this).EnableDefaultEgressEndpoint = (string) content.GetValueForProperty("EnableDefaultEgressEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkPatchParametersInternal)this).EnableDefaultEgressEndpoint, 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 CloudServicesNetworkPatchParameters(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.NetworkCloud.Models.ICloudServicesNetworkPatchParametersInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkPatchProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkPatchParametersInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.CloudServicesNetworkPatchPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkPatchParametersInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkPatchParametersTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkPatchParametersInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.CloudServicesNetworkPatchParametersTagsTypeConverter.ConvertFrom); + } + if (content.Contains("AdditionalEgressEndpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkPatchParametersInternal)this).AdditionalEgressEndpoint = (System.Collections.Generic.List) content.GetValueForProperty("AdditionalEgressEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkPatchParametersInternal)this).AdditionalEgressEndpoint, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.EgressEndpointTypeConverter.ConvertFrom)); + } + if (content.Contains("EnableDefaultEgressEndpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkPatchParametersInternal)this).EnableDefaultEgressEndpoint = (string) content.GetValueForProperty("EnableDefaultEgressEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkPatchParametersInternal)this).EnableDefaultEgressEndpoint, 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.NetworkCloud.Models.ICloudServicesNetworkPatchParameters DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new CloudServicesNetworkPatchParameters(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.NetworkCloud.Models.ICloudServicesNetworkPatchParameters DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new CloudServicesNetworkPatchParameters(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.NetworkCloud.Models.ICloudServicesNetworkPatchParameters FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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(); + } + } + /// CloudServicesNetworkPatchParameters represents the body of the request to patch the cloud services network. + [System.ComponentModel.TypeConverter(typeof(CloudServicesNetworkPatchParametersTypeConverter))] + public partial interface ICloudServicesNetworkPatchParameters + + { + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/CloudServicesNetworkPatchParameters.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/CloudServicesNetworkPatchParameters.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/CloudServicesNetworkPatchParameters.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/CloudServicesNetworkPatchParameters.TypeConverter.cs index 5e141395c802..71839c3b0bff 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/CloudServicesNetworkPatchParameters.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/CloudServicesNetworkPatchParameters.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.ICloudServicesNetworkPatchParameters ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkPatchParameters ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkPatchParameters).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkPatchParameters).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/CloudServicesNetworkPatchParameters.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/CloudServicesNetworkPatchParameters.cs new file mode 100644 index 000000000000..99e9b2da675b --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/CloudServicesNetworkPatchParameters.cs @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + + /// + /// CloudServicesNetworkPatchParameters represents the body of the request to patch the cloud services network. + /// + public partial class CloudServicesNetworkPatchParameters : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkPatchParameters, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkPatchParametersInternal + { + + /// + /// The list of egress endpoints. This allows for connection from a Hybrid AKS cluster to the specified endpoint. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public System.Collections.Generic.List AdditionalEgressEndpoint { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkPatchPropertiesInternal)Property).AdditionalEgressEndpoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkPatchPropertiesInternal)Property).AdditionalEgressEndpoint = value ?? null /* arrayOf */; } + + /// + /// The indicator of whether the platform default endpoints are allowed for the egress traffic. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string EnableDefaultEgressEndpoint { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkPatchPropertiesInternal)Property).EnableDefaultEgressEndpoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkPatchPropertiesInternal)Property).EnableDefaultEgressEndpoint = value ?? null; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkPatchProperties Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkPatchParametersInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.CloudServicesNetworkPatchProperties()); set { {_property = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkPatchProperties _property; + + /// The list of the resource properties. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkPatchProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.CloudServicesNetworkPatchProperties()); set => this._property = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkPatchParametersTags _tag; + + /// The Azure resource tags that will replace the existing ones. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkPatchParametersTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.CloudServicesNetworkPatchParametersTags()); set => this._tag = value; } + + /// Creates an new instance. + public CloudServicesNetworkPatchParameters() + { + + } + } + /// CloudServicesNetworkPatchParameters represents the body of the request to patch the cloud services network. + public partial interface ICloudServicesNetworkPatchParameters : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable + { + /// + /// The list of egress endpoints. This allows for connection from a Hybrid AKS cluster to the specified endpoint. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The list of egress endpoints. This allows for connection from a Hybrid AKS cluster to the specified endpoint.", + SerializedName = @"additionalEgressEndpoints", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IEgressEndpoint) })] + System.Collections.Generic.List AdditionalEgressEndpoint { get; set; } + /// + /// The indicator of whether the platform default endpoints are allowed for the egress traffic. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The indicator of whether the platform default endpoints are allowed for the egress traffic.", + SerializedName = @"enableDefaultEgressEndpoints", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("True", "False")] + string EnableDefaultEgressEndpoint { get; set; } + /// The Azure resource tags that will replace the existing ones. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The Azure resource tags that will replace the existing ones.", + SerializedName = @"tags", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkPatchParametersTags) })] + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkPatchParametersTags Tag { get; set; } + + } + /// CloudServicesNetworkPatchParameters represents the body of the request to patch the cloud services network. + internal partial interface ICloudServicesNetworkPatchParametersInternal + + { + /// + /// The list of egress endpoints. This allows for connection from a Hybrid AKS cluster to the specified endpoint. + /// + System.Collections.Generic.List AdditionalEgressEndpoint { get; set; } + /// + /// The indicator of whether the platform default endpoints are allowed for the egress traffic. + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("True", "False")] + string EnableDefaultEgressEndpoint { get; set; } + /// The list of the resource properties. + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkPatchProperties Property { get; set; } + /// The Azure resource tags that will replace the existing ones. + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkPatchParametersTags Tag { get; set; } + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/CloudServicesNetworkPatchParameters.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/CloudServicesNetworkPatchParameters.json.cs similarity index 93% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/CloudServicesNetworkPatchParameters.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/CloudServicesNetworkPatchParameters.json.cs index 576ec79de05a..877962ef1822 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/CloudServicesNetworkPatchParameters.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/CloudServicesNetworkPatchParameters.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -67,19 +67,19 @@ internal CloudServicesNetworkPatchParameters(Microsoft.Azure.PowerShell.Cmdlets. { return; } - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.CloudServicesNetworkPatchProperties.FromJson(__jsonProperties) : Property;} - {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.CloudServicesNetworkPatchParametersTags.FromJson(__jsonTags) : Tag;} + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.CloudServicesNetworkPatchProperties.FromJson(__jsonProperties) : _property;} + {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.CloudServicesNetworkPatchParametersTags.FromJson(__jsonTags) : _tag;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkPatchParameters. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkPatchParameters. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkPatchParameters. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkPatchParameters. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkPatchParameters FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkPatchParameters FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new CloudServicesNetworkPatchParameters(json) : null; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/CloudServicesNetworkPatchParametersTags.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/CloudServicesNetworkPatchParametersTags.PowerShell.cs similarity index 88% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/CloudServicesNetworkPatchParametersTags.PowerShell.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/CloudServicesNetworkPatchParametersTags.PowerShell.cs index 9fc770b7c7a9..49cc5121b6c1 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/CloudServicesNetworkPatchParametersTags.PowerShell.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/CloudServicesNetworkPatchParametersTags.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; @@ -63,7 +63,7 @@ public partial class CloudServicesNetworkPatchParametersTags 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 CloudServicesNetworkPatchParametersTags(global::System.Collections.IDic } /// - /// 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 CloudServicesNetworkPatchParametersTags(global::System.Management.Autom } /// - /// 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.NetworkCloud.Models.Api20250201.ICloudServicesNetworkPatchParametersTags DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkPatchParametersTags DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new CloudServicesNetworkPatchParametersTags(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.NetworkCloud.Models.Api20250201.ICloudServicesNetworkPatchParametersTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkPatchParametersTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new CloudServicesNetworkPatchParametersTags(content); } @@ -136,7 +136,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201 /// /// an instance of the model class. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkPatchParametersTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkPatchParametersTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/CloudServicesNetworkPatchParametersTags.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/CloudServicesNetworkPatchParametersTags.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/CloudServicesNetworkPatchParametersTags.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/CloudServicesNetworkPatchParametersTags.TypeConverter.cs index 3d7ad88fd5f7..7d549c11f213 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/CloudServicesNetworkPatchParametersTags.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/CloudServicesNetworkPatchParametersTags.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.ICloudServicesNetworkPatchParametersTags ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkPatchParametersTags ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkPatchParametersTags).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkPatchParametersTags).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/CloudServicesNetworkPatchParametersTags.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/CloudServicesNetworkPatchParametersTags.cs similarity index 83% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/CloudServicesNetworkPatchParametersTags.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/CloudServicesNetworkPatchParametersTags.cs index ed296926a761..c50cb6187abb 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/CloudServicesNetworkPatchParametersTags.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/CloudServicesNetworkPatchParametersTags.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; /// The Azure resource tags that will replace the existing ones. public partial class CloudServicesNetworkPatchParametersTags : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkPatchParametersTags, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkPatchParametersTagsInternal + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkPatchParametersTags, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkPatchParametersTagsInternal { /// Creates an new instance. diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/CloudServicesNetworkPatchParametersTags.dictionary.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/CloudServicesNetworkPatchParametersTags.dictionary.cs similarity index 96% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/CloudServicesNetworkPatchParametersTags.dictionary.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/CloudServicesNetworkPatchParametersTags.dictionary.cs index c0680c530572..842adb6d2ee0 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/CloudServicesNetworkPatchParametersTags.dictionary.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/CloudServicesNetworkPatchParametersTags.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.CloudServicesNetworkPatchParametersTags source) => source.__additionalProperties; + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.CloudServicesNetworkPatchParametersTags source) => source.__additionalProperties; } } \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/CloudServicesNetworkPatchParametersTags.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/CloudServicesNetworkPatchParametersTags.json.cs similarity index 95% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/CloudServicesNetworkPatchParametersTags.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/CloudServicesNetworkPatchParametersTags.json.cs index 3b9b3626c27a..5bc9b18b4542 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/CloudServicesNetworkPatchParametersTags.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/CloudServicesNetworkPatchParametersTags.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -71,13 +71,13 @@ internal CloudServicesNetworkPatchParametersTags(Microsoft.Azure.PowerShell.Cmdl } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkPatchParametersTags. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkPatchParametersTags. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkPatchParametersTags. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkPatchParametersTags. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkPatchParametersTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkPatchParametersTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new CloudServicesNetworkPatchParametersTags(json) : null; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/CloudServicesNetworkPatchProperties.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/CloudServicesNetworkPatchProperties.PowerShell.cs new file mode 100644 index 000000000000..5e3b57643794 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/CloudServicesNetworkPatchProperties.PowerShell.cs @@ -0,0 +1,180 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + + /// + /// CloudServicesNetworkPatchProperties represents the properties of the cloud services network that can be updated using + /// a patch request. + /// + [System.ComponentModel.TypeConverter(typeof(CloudServicesNetworkPatchPropertiesTypeConverter))] + public partial class CloudServicesNetworkPatchProperties + { + + /// + /// 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 CloudServicesNetworkPatchProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("AdditionalEgressEndpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkPatchPropertiesInternal)this).AdditionalEgressEndpoint = (System.Collections.Generic.List) content.GetValueForProperty("AdditionalEgressEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkPatchPropertiesInternal)this).AdditionalEgressEndpoint, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.EgressEndpointTypeConverter.ConvertFrom)); + } + if (content.Contains("EnableDefaultEgressEndpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkPatchPropertiesInternal)this).EnableDefaultEgressEndpoint = (string) content.GetValueForProperty("EnableDefaultEgressEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkPatchPropertiesInternal)this).EnableDefaultEgressEndpoint, 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 CloudServicesNetworkPatchProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("AdditionalEgressEndpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkPatchPropertiesInternal)this).AdditionalEgressEndpoint = (System.Collections.Generic.List) content.GetValueForProperty("AdditionalEgressEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkPatchPropertiesInternal)this).AdditionalEgressEndpoint, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.EgressEndpointTypeConverter.ConvertFrom)); + } + if (content.Contains("EnableDefaultEgressEndpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkPatchPropertiesInternal)this).EnableDefaultEgressEndpoint = (string) content.GetValueForProperty("EnableDefaultEgressEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkPatchPropertiesInternal)this).EnableDefaultEgressEndpoint, 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.NetworkCloud.Models.ICloudServicesNetworkPatchProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new CloudServicesNetworkPatchProperties(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.NetworkCloud.Models.ICloudServicesNetworkPatchProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new CloudServicesNetworkPatchProperties(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.NetworkCloud.Models.ICloudServicesNetworkPatchProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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(); + } + } + /// CloudServicesNetworkPatchProperties represents the properties of the cloud services network that can be updated using + /// a patch request. + [System.ComponentModel.TypeConverter(typeof(CloudServicesNetworkPatchPropertiesTypeConverter))] + public partial interface ICloudServicesNetworkPatchProperties + + { + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/CloudServicesNetworkPatchProperties.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/CloudServicesNetworkPatchProperties.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/CloudServicesNetworkPatchProperties.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/CloudServicesNetworkPatchProperties.TypeConverter.cs index 0d3df07ea5a5..e70e1bf9cdf2 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/CloudServicesNetworkPatchProperties.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/CloudServicesNetworkPatchProperties.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.ICloudServicesNetworkPatchProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkPatchProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkPatchProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkPatchProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/CloudServicesNetworkPatchProperties.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/CloudServicesNetworkPatchProperties.cs new file mode 100644 index 000000000000..4e217270ca77 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/CloudServicesNetworkPatchProperties.cs @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + + /// + /// CloudServicesNetworkPatchProperties represents the properties of the cloud services network that can be updated using + /// a patch request. + /// + public partial class CloudServicesNetworkPatchProperties : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkPatchProperties, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkPatchPropertiesInternal + { + + /// Backing field for property. + private System.Collections.Generic.List _additionalEgressEndpoint; + + /// + /// The list of egress endpoints. This allows for connection from a Hybrid AKS cluster to the specified endpoint. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public System.Collections.Generic.List AdditionalEgressEndpoint { get => this._additionalEgressEndpoint; set => this._additionalEgressEndpoint = value; } + + /// Backing field for property. + private string _enableDefaultEgressEndpoint; + + /// + /// The indicator of whether the platform default endpoints are allowed for the egress traffic. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string EnableDefaultEgressEndpoint { get => this._enableDefaultEgressEndpoint; set => this._enableDefaultEgressEndpoint = value; } + + /// Creates an new instance. + public CloudServicesNetworkPatchProperties() + { + + } + } + /// CloudServicesNetworkPatchProperties represents the properties of the cloud services network that can be updated using + /// a patch request. + public partial interface ICloudServicesNetworkPatchProperties : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable + { + /// + /// The list of egress endpoints. This allows for connection from a Hybrid AKS cluster to the specified endpoint. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The list of egress endpoints. This allows for connection from a Hybrid AKS cluster to the specified endpoint.", + SerializedName = @"additionalEgressEndpoints", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IEgressEndpoint) })] + System.Collections.Generic.List AdditionalEgressEndpoint { get; set; } + /// + /// The indicator of whether the platform default endpoints are allowed for the egress traffic. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The indicator of whether the platform default endpoints are allowed for the egress traffic.", + SerializedName = @"enableDefaultEgressEndpoints", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("True", "False")] + string EnableDefaultEgressEndpoint { get; set; } + + } + /// CloudServicesNetworkPatchProperties represents the properties of the cloud services network that can be updated using + /// a patch request. + internal partial interface ICloudServicesNetworkPatchPropertiesInternal + + { + /// + /// The list of egress endpoints. This allows for connection from a Hybrid AKS cluster to the specified endpoint. + /// + System.Collections.Generic.List AdditionalEgressEndpoint { get; set; } + /// + /// The indicator of whether the platform default endpoints are allowed for the egress traffic. + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("True", "False")] + string EnableDefaultEgressEndpoint { get; set; } + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/CloudServicesNetworkPatchProperties.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/CloudServicesNetworkPatchProperties.json.cs similarity index 90% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/CloudServicesNetworkPatchProperties.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/CloudServicesNetworkPatchProperties.json.cs index 6747a19320e8..64b40258581d 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/CloudServicesNetworkPatchProperties.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/CloudServicesNetworkPatchProperties.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -68,19 +68,19 @@ internal CloudServicesNetworkPatchProperties(Microsoft.Azure.PowerShell.Cmdlets. { return; } - {_additionalEgressEndpoint = If( json?.PropertyT("additionalEgressEndpoints"), out var __jsonAdditionalEgressEndpoints) ? If( __jsonAdditionalEgressEndpoints as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IEgressEndpoint) (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.EgressEndpoint.FromJson(__u) )) ))() : null : AdditionalEgressEndpoint;} - {_enableDefaultEgressEndpoint = If( json?.PropertyT("enableDefaultEgressEndpoints"), out var __jsonEnableDefaultEgressEndpoints) ? (string)__jsonEnableDefaultEgressEndpoints : (string)EnableDefaultEgressEndpoint;} + {_additionalEgressEndpoint = If( json?.PropertyT("additionalEgressEndpoints"), out var __jsonAdditionalEgressEndpoints) ? If( __jsonAdditionalEgressEndpoints as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.IEgressEndpoint) (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.EgressEndpoint.FromJson(__u) )) ))() : null : _additionalEgressEndpoint;} + {_enableDefaultEgressEndpoint = If( json?.PropertyT("enableDefaultEgressEndpoints"), out var __jsonEnableDefaultEgressEndpoints) ? (string)__jsonEnableDefaultEgressEndpoints : (string)_enableDefaultEgressEndpoint;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkPatchProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkPatchProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkPatchProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkPatchProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkPatchProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkPatchProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new CloudServicesNetworkPatchProperties(json) : null; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/CloudServicesNetworkProperties.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/CloudServicesNetworkProperties.PowerShell.cs new file mode 100644 index 000000000000..3e369d43feed --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/CloudServicesNetworkProperties.PowerShell.cs @@ -0,0 +1,246 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + + /// + /// CloudServicesNetworkProperties represents properties of the cloud services network. + /// + [System.ComponentModel.TypeConverter(typeof(CloudServicesNetworkPropertiesTypeConverter))] + public partial class CloudServicesNetworkProperties + { + + /// + /// 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 CloudServicesNetworkProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("AdditionalEgressEndpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkPropertiesInternal)this).AdditionalEgressEndpoint = (System.Collections.Generic.List) content.GetValueForProperty("AdditionalEgressEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkPropertiesInternal)this).AdditionalEgressEndpoint, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.EgressEndpointTypeConverter.ConvertFrom)); + } + if (content.Contains("AssociatedResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkPropertiesInternal)this).AssociatedResourceId = (System.Collections.Generic.List) content.GetValueForProperty("AssociatedResourceId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkPropertiesInternal)this).AssociatedResourceId, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("ClusterId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkPropertiesInternal)this).ClusterId = (string) content.GetValueForProperty("ClusterId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkPropertiesInternal)this).ClusterId, global::System.Convert.ToString); + } + if (content.Contains("DetailedStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkPropertiesInternal)this).DetailedStatus = (string) content.GetValueForProperty("DetailedStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkPropertiesInternal)this).DetailedStatus, global::System.Convert.ToString); + } + if (content.Contains("DetailedStatusMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkPropertiesInternal)this).DetailedStatusMessage = (string) content.GetValueForProperty("DetailedStatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkPropertiesInternal)this).DetailedStatusMessage, global::System.Convert.ToString); + } + if (content.Contains("EnableDefaultEgressEndpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkPropertiesInternal)this).EnableDefaultEgressEndpoint = (string) content.GetValueForProperty("EnableDefaultEgressEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkPropertiesInternal)this).EnableDefaultEgressEndpoint, global::System.Convert.ToString); + } + if (content.Contains("EnabledEgressEndpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkPropertiesInternal)this).EnabledEgressEndpoint = (System.Collections.Generic.List) content.GetValueForProperty("EnabledEgressEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkPropertiesInternal)this).EnabledEgressEndpoint, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.EgressEndpointTypeConverter.ConvertFrom)); + } + if (content.Contains("HybridAksClustersAssociatedId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkPropertiesInternal)this).HybridAksClustersAssociatedId = (System.Collections.Generic.List) content.GetValueForProperty("HybridAksClustersAssociatedId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkPropertiesInternal)this).HybridAksClustersAssociatedId, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("InterfaceName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkPropertiesInternal)this).InterfaceName = (string) content.GetValueForProperty("InterfaceName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkPropertiesInternal)this).InterfaceName, global::System.Convert.ToString); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkPropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkPropertiesInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("VirtualMachinesAssociatedId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkPropertiesInternal)this).VirtualMachinesAssociatedId = (System.Collections.Generic.List) content.GetValueForProperty("VirtualMachinesAssociatedId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkPropertiesInternal)this).VirtualMachinesAssociatedId, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal CloudServicesNetworkProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("AdditionalEgressEndpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkPropertiesInternal)this).AdditionalEgressEndpoint = (System.Collections.Generic.List) content.GetValueForProperty("AdditionalEgressEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkPropertiesInternal)this).AdditionalEgressEndpoint, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.EgressEndpointTypeConverter.ConvertFrom)); + } + if (content.Contains("AssociatedResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkPropertiesInternal)this).AssociatedResourceId = (System.Collections.Generic.List) content.GetValueForProperty("AssociatedResourceId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkPropertiesInternal)this).AssociatedResourceId, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("ClusterId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkPropertiesInternal)this).ClusterId = (string) content.GetValueForProperty("ClusterId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkPropertiesInternal)this).ClusterId, global::System.Convert.ToString); + } + if (content.Contains("DetailedStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkPropertiesInternal)this).DetailedStatus = (string) content.GetValueForProperty("DetailedStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkPropertiesInternal)this).DetailedStatus, global::System.Convert.ToString); + } + if (content.Contains("DetailedStatusMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkPropertiesInternal)this).DetailedStatusMessage = (string) content.GetValueForProperty("DetailedStatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkPropertiesInternal)this).DetailedStatusMessage, global::System.Convert.ToString); + } + if (content.Contains("EnableDefaultEgressEndpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkPropertiesInternal)this).EnableDefaultEgressEndpoint = (string) content.GetValueForProperty("EnableDefaultEgressEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkPropertiesInternal)this).EnableDefaultEgressEndpoint, global::System.Convert.ToString); + } + if (content.Contains("EnabledEgressEndpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkPropertiesInternal)this).EnabledEgressEndpoint = (System.Collections.Generic.List) content.GetValueForProperty("EnabledEgressEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkPropertiesInternal)this).EnabledEgressEndpoint, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.EgressEndpointTypeConverter.ConvertFrom)); + } + if (content.Contains("HybridAksClustersAssociatedId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkPropertiesInternal)this).HybridAksClustersAssociatedId = (System.Collections.Generic.List) content.GetValueForProperty("HybridAksClustersAssociatedId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkPropertiesInternal)this).HybridAksClustersAssociatedId, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("InterfaceName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkPropertiesInternal)this).InterfaceName = (string) content.GetValueForProperty("InterfaceName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkPropertiesInternal)this).InterfaceName, global::System.Convert.ToString); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkPropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkPropertiesInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("VirtualMachinesAssociatedId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkPropertiesInternal)this).VirtualMachinesAssociatedId = (System.Collections.Generic.List) content.GetValueForProperty("VirtualMachinesAssociatedId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkPropertiesInternal)this).VirtualMachinesAssociatedId, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new CloudServicesNetworkProperties(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.NetworkCloud.Models.ICloudServicesNetworkProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new CloudServicesNetworkProperties(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.NetworkCloud.Models.ICloudServicesNetworkProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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(); + } + } + /// CloudServicesNetworkProperties represents properties of the cloud services network. + [System.ComponentModel.TypeConverter(typeof(CloudServicesNetworkPropertiesTypeConverter))] + public partial interface ICloudServicesNetworkProperties + + { + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/CloudServicesNetworkProperties.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/CloudServicesNetworkProperties.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/CloudServicesNetworkProperties.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/CloudServicesNetworkProperties.TypeConverter.cs index dac78cae3b2c..dd912e9195d6 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/CloudServicesNetworkProperties.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/CloudServicesNetworkProperties.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.ICloudServicesNetworkProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/CloudServicesNetworkProperties.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/CloudServicesNetworkProperties.cs new file mode 100644 index 000000000000..ad60b621db8c --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/CloudServicesNetworkProperties.cs @@ -0,0 +1,343 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + + /// + /// CloudServicesNetworkProperties represents properties of the cloud services network. + /// + public partial class CloudServicesNetworkProperties : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkProperties, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkPropertiesInternal + { + + /// Backing field for property. + private System.Collections.Generic.List _additionalEgressEndpoint; + + /// + /// The list of egress endpoints. This allows for connection from a Hybrid AKS cluster to the specified endpoint. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public System.Collections.Generic.List AdditionalEgressEndpoint { get => this._additionalEgressEndpoint; set => this._additionalEgressEndpoint = value; } + + /// Backing field for property. + private System.Collections.Generic.List _associatedResourceId; + + /// + /// The list of resource IDs for the other Microsoft.NetworkCloud resources that have attached this network. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public System.Collections.Generic.List AssociatedResourceId { get => this._associatedResourceId; } + + /// Backing field for property. + private string _clusterId; + + /// + /// The resource ID of the Network Cloud cluster this cloud services network is associated with. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string ClusterId { get => this._clusterId; } + + /// Backing field for property. + private string _detailedStatus; + + /// The more detailed status of the cloud services network. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string DetailedStatus { get => this._detailedStatus; } + + /// Backing field for property. + private string _detailedStatusMessage; + + /// The descriptive message about the current detailed status. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string DetailedStatusMessage { get => this._detailedStatusMessage; } + + /// Backing field for property. + private string _enableDefaultEgressEndpoint; + + /// + /// The indicator of whether the platform default endpoints are allowed for the egress traffic. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string EnableDefaultEgressEndpoint { get => this._enableDefaultEgressEndpoint; set => this._enableDefaultEgressEndpoint = value; } + + /// Backing field for property. + private System.Collections.Generic.List _enabledEgressEndpoint; + + /// + /// The full list of additional and default egress endpoints that are currently enabled. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public System.Collections.Generic.List EnabledEgressEndpoint { get => this._enabledEgressEndpoint; } + + /// Backing field for property. + private System.Collections.Generic.List _hybridAksClustersAssociatedId; + + /// + /// Field Deprecated. These fields will be empty/omitted. The list of Hybrid AKS cluster resource IDs that are associated + /// with this cloud services network. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public System.Collections.Generic.List HybridAksClustersAssociatedId { get => this._hybridAksClustersAssociatedId; } + + /// Backing field for property. + private string _interfaceName; + + /// + /// The name of the interface that will be present in the virtual machine to represent this network. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string InterfaceName { get => this._interfaceName; } + + /// Internal Acessors for AssociatedResourceId + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkPropertiesInternal.AssociatedResourceId { get => this._associatedResourceId; set { {_associatedResourceId = value;} } } + + /// Internal Acessors for ClusterId + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkPropertiesInternal.ClusterId { get => this._clusterId; set { {_clusterId = value;} } } + + /// Internal Acessors for DetailedStatus + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkPropertiesInternal.DetailedStatus { get => this._detailedStatus; set { {_detailedStatus = value;} } } + + /// Internal Acessors for DetailedStatusMessage + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkPropertiesInternal.DetailedStatusMessage { get => this._detailedStatusMessage; set { {_detailedStatusMessage = value;} } } + + /// Internal Acessors for EnabledEgressEndpoint + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkPropertiesInternal.EnabledEgressEndpoint { get => this._enabledEgressEndpoint; set { {_enabledEgressEndpoint = value;} } } + + /// Internal Acessors for HybridAksClustersAssociatedId + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkPropertiesInternal.HybridAksClustersAssociatedId { get => this._hybridAksClustersAssociatedId; set { {_hybridAksClustersAssociatedId = value;} } } + + /// Internal Acessors for InterfaceName + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkPropertiesInternal.InterfaceName { get => this._interfaceName; set { {_interfaceName = value;} } } + + /// Internal Acessors for ProvisioningState + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkPropertiesInternal.ProvisioningState { get => this._provisioningState; set { {_provisioningState = value;} } } + + /// Internal Acessors for VirtualMachinesAssociatedId + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkPropertiesInternal.VirtualMachinesAssociatedId { get => this._virtualMachinesAssociatedId; set { {_virtualMachinesAssociatedId = value;} } } + + /// Backing field for property. + private string _provisioningState; + + /// The provisioning state of the cloud services network. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string ProvisioningState { get => this._provisioningState; } + + /// Backing field for property. + private System.Collections.Generic.List _virtualMachinesAssociatedId; + + /// + /// Field Deprecated. These fields will be empty/omitted. The list of virtual machine resource IDs, excluding any Hybrid AKS + /// virtual machines, that are currently using this cloud services network. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public System.Collections.Generic.List VirtualMachinesAssociatedId { get => this._virtualMachinesAssociatedId; } + + /// Creates an new instance. + public CloudServicesNetworkProperties() + { + + } + } + /// CloudServicesNetworkProperties represents properties of the cloud services network. + public partial interface ICloudServicesNetworkProperties : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable + { + /// + /// The list of egress endpoints. This allows for connection from a Hybrid AKS cluster to the specified endpoint. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The list of egress endpoints. This allows for connection from a Hybrid AKS cluster to the specified endpoint.", + SerializedName = @"additionalEgressEndpoints", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IEgressEndpoint) })] + System.Collections.Generic.List AdditionalEgressEndpoint { get; set; } + /// + /// The list of resource IDs for the other Microsoft.NetworkCloud resources that have attached this network. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The list of resource IDs for the other Microsoft.NetworkCloud resources that have attached this network.", + SerializedName = @"associatedResourceIds", + PossibleTypes = new [] { typeof(string) })] + System.Collections.Generic.List AssociatedResourceId { get; } + /// + /// The resource ID of the Network Cloud cluster this cloud services network is associated with. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The resource ID of the Network Cloud cluster this cloud services network is associated with.", + SerializedName = @"clusterId", + PossibleTypes = new [] { typeof(string) })] + string ClusterId { get; } + /// The more detailed status of the cloud services network. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The more detailed status of the cloud services network.", + SerializedName = @"detailedStatus", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Error", "Available", "Provisioning")] + string DetailedStatus { get; } + /// The descriptive message about the current detailed status. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The descriptive message about the current detailed status.", + SerializedName = @"detailedStatusMessage", + PossibleTypes = new [] { typeof(string) })] + string DetailedStatusMessage { get; } + /// + /// The indicator of whether the platform default endpoints are allowed for the egress traffic. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The indicator of whether the platform default endpoints are allowed for the egress traffic.", + SerializedName = @"enableDefaultEgressEndpoints", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("True", "False")] + string EnableDefaultEgressEndpoint { get; set; } + /// + /// The full list of additional and default egress endpoints that are currently enabled. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The full list of additional and default egress endpoints that are currently enabled.", + SerializedName = @"enabledEgressEndpoints", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IEgressEndpoint) })] + System.Collections.Generic.List EnabledEgressEndpoint { get; } + /// + /// Field Deprecated. These fields will be empty/omitted. The list of Hybrid AKS cluster resource IDs that are associated + /// with this cloud services network. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"Field Deprecated. These fields will be empty/omitted. The list of Hybrid AKS cluster resource IDs that are associated with this cloud services network.", + SerializedName = @"hybridAksClustersAssociatedIds", + PossibleTypes = new [] { typeof(string) })] + System.Collections.Generic.List HybridAksClustersAssociatedId { get; } + /// + /// The name of the interface that will be present in the virtual machine to represent this network. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The name of the interface that will be present in the virtual machine to represent this network.", + SerializedName = @"interfaceName", + PossibleTypes = new [] { typeof(string) })] + string InterfaceName { get; } + /// The provisioning state of the cloud services network. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The provisioning state of the cloud services network.", + SerializedName = @"provisioningState", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Succeeded", "Failed", "Canceled", "Provisioning", "Accepted")] + string ProvisioningState { get; } + /// + /// Field Deprecated. These fields will be empty/omitted. The list of virtual machine resource IDs, excluding any Hybrid AKS + /// virtual machines, that are currently using this cloud services network. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"Field Deprecated. These fields will be empty/omitted. The list of virtual machine resource IDs, excluding any Hybrid AKS virtual machines, that are currently using this cloud services network.", + SerializedName = @"virtualMachinesAssociatedIds", + PossibleTypes = new [] { typeof(string) })] + System.Collections.Generic.List VirtualMachinesAssociatedId { get; } + + } + /// CloudServicesNetworkProperties represents properties of the cloud services network. + internal partial interface ICloudServicesNetworkPropertiesInternal + + { + /// + /// The list of egress endpoints. This allows for connection from a Hybrid AKS cluster to the specified endpoint. + /// + System.Collections.Generic.List AdditionalEgressEndpoint { get; set; } + /// + /// The list of resource IDs for the other Microsoft.NetworkCloud resources that have attached this network. + /// + System.Collections.Generic.List AssociatedResourceId { get; set; } + /// + /// The resource ID of the Network Cloud cluster this cloud services network is associated with. + /// + string ClusterId { get; set; } + /// The more detailed status of the cloud services network. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Error", "Available", "Provisioning")] + string DetailedStatus { get; set; } + /// The descriptive message about the current detailed status. + string DetailedStatusMessage { get; set; } + /// + /// The indicator of whether the platform default endpoints are allowed for the egress traffic. + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("True", "False")] + string EnableDefaultEgressEndpoint { get; set; } + /// + /// The full list of additional and default egress endpoints that are currently enabled. + /// + System.Collections.Generic.List EnabledEgressEndpoint { get; set; } + /// + /// Field Deprecated. These fields will be empty/omitted. The list of Hybrid AKS cluster resource IDs that are associated + /// with this cloud services network. + /// + System.Collections.Generic.List HybridAksClustersAssociatedId { get; set; } + /// + /// The name of the interface that will be present in the virtual machine to represent this network. + /// + string InterfaceName { get; set; } + /// The provisioning state of the cloud services network. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Succeeded", "Failed", "Canceled", "Provisioning", "Accepted")] + string ProvisioningState { get; set; } + /// + /// Field Deprecated. These fields will be empty/omitted. The list of virtual machine resource IDs, excluding any Hybrid AKS + /// virtual machines, that are currently using this cloud services network. + /// + System.Collections.Generic.List VirtualMachinesAssociatedId { get; set; } + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/CloudServicesNetworkProperties.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/CloudServicesNetworkProperties.json.cs similarity index 82% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/CloudServicesNetworkProperties.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/CloudServicesNetworkProperties.json.cs index e147fdf83301..f74812699ed7 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/CloudServicesNetworkProperties.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/CloudServicesNetworkProperties.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -67,28 +67,28 @@ internal CloudServicesNetworkProperties(Microsoft.Azure.PowerShell.Cmdlets.Netwo { return; } - {_additionalEgressEndpoint = If( json?.PropertyT("additionalEgressEndpoints"), out var __jsonAdditionalEgressEndpoints) ? If( __jsonAdditionalEgressEndpoints as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IEgressEndpoint) (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.EgressEndpoint.FromJson(__u) )) ))() : null : AdditionalEgressEndpoint;} - {_associatedResourceId = If( json?.PropertyT("associatedResourceIds"), out var __jsonAssociatedResourceIds) ? If( __jsonAssociatedResourceIds as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Json.JsonString __o ? (string)(__o.ToString()) : null)) ))() : null : AssociatedResourceId;} - {_clusterId = If( json?.PropertyT("clusterId"), out var __jsonClusterId) ? (string)__jsonClusterId : (string)ClusterId;} - {_detailedStatus = If( json?.PropertyT("detailedStatus"), out var __jsonDetailedStatus) ? (string)__jsonDetailedStatus : (string)DetailedStatus;} - {_detailedStatusMessage = If( json?.PropertyT("detailedStatusMessage"), out var __jsonDetailedStatusMessage) ? (string)__jsonDetailedStatusMessage : (string)DetailedStatusMessage;} - {_enableDefaultEgressEndpoint = If( json?.PropertyT("enableDefaultEgressEndpoints"), out var __jsonEnableDefaultEgressEndpoints) ? (string)__jsonEnableDefaultEgressEndpoints : (string)EnableDefaultEgressEndpoint;} - {_enabledEgressEndpoint = If( json?.PropertyT("enabledEgressEndpoints"), out var __jsonEnabledEgressEndpoints) ? If( __jsonEnabledEgressEndpoints as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonArray, out var __l) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__l, (__k)=>(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IEgressEndpoint) (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.EgressEndpoint.FromJson(__k) )) ))() : null : EnabledEgressEndpoint;} - {_hybridAksClustersAssociatedId = If( json?.PropertyT("hybridAksClustersAssociatedIds"), out var __jsonHybridAksClustersAssociatedIds) ? If( __jsonHybridAksClustersAssociatedIds as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Json.JsonString __e ? (string)(__e.ToString()) : null)) ))() : null : HybridAksClustersAssociatedId;} - {_interfaceName = If( json?.PropertyT("interfaceName"), out var __jsonInterfaceName) ? (string)__jsonInterfaceName : (string)InterfaceName;} - {_provisioningState = If( json?.PropertyT("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)ProvisioningState;} - {_virtualMachinesAssociatedId = If( json?.PropertyT("virtualMachinesAssociatedIds"), out var __jsonVirtualMachinesAssociatedIds) ? If( __jsonVirtualMachinesAssociatedIds as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonArray, out var __b) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__b, (__a)=>(string) (__a is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString ___z ? (string)(___z.ToString()) : null)) ))() : null : VirtualMachinesAssociatedId;} + {_additionalEgressEndpoint = If( json?.PropertyT("additionalEgressEndpoints"), out var __jsonAdditionalEgressEndpoints) ? If( __jsonAdditionalEgressEndpoints as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.IEgressEndpoint) (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.EgressEndpoint.FromJson(__u) )) ))() : null : _additionalEgressEndpoint;} + {_associatedResourceId = If( json?.PropertyT("associatedResourceIds"), out var __jsonAssociatedResourceIds) ? If( __jsonAssociatedResourceIds as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Json.JsonString __o ? (string)(__o.ToString()) : null)) ))() : null : _associatedResourceId;} + {_clusterId = If( json?.PropertyT("clusterId"), out var __jsonClusterId) ? (string)__jsonClusterId : (string)_clusterId;} + {_detailedStatus = If( json?.PropertyT("detailedStatus"), out var __jsonDetailedStatus) ? (string)__jsonDetailedStatus : (string)_detailedStatus;} + {_detailedStatusMessage = If( json?.PropertyT("detailedStatusMessage"), out var __jsonDetailedStatusMessage) ? (string)__jsonDetailedStatusMessage : (string)_detailedStatusMessage;} + {_enableDefaultEgressEndpoint = If( json?.PropertyT("enableDefaultEgressEndpoints"), out var __jsonEnableDefaultEgressEndpoints) ? (string)__jsonEnableDefaultEgressEndpoints : (string)_enableDefaultEgressEndpoint;} + {_enabledEgressEndpoint = If( json?.PropertyT("enabledEgressEndpoints"), out var __jsonEnabledEgressEndpoints) ? If( __jsonEnabledEgressEndpoints as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonArray, out var __l) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__l, (__k)=>(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IEgressEndpoint) (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.EgressEndpoint.FromJson(__k) )) ))() : null : _enabledEgressEndpoint;} + {_hybridAksClustersAssociatedId = If( json?.PropertyT("hybridAksClustersAssociatedIds"), out var __jsonHybridAksClustersAssociatedIds) ? If( __jsonHybridAksClustersAssociatedIds as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Json.JsonString __e ? (string)(__e.ToString()) : null)) ))() : null : _hybridAksClustersAssociatedId;} + {_interfaceName = If( json?.PropertyT("interfaceName"), out var __jsonInterfaceName) ? (string)__jsonInterfaceName : (string)_interfaceName;} + {_provisioningState = If( json?.PropertyT("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)_provisioningState;} + {_virtualMachinesAssociatedId = If( json?.PropertyT("virtualMachinesAssociatedIds"), out var __jsonVirtualMachinesAssociatedIds) ? If( __jsonVirtualMachinesAssociatedIds as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonArray, out var __b) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__b, (__a)=>(string) (__a is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString ___z ? (string)(___z.ToString()) : null)) ))() : null : _virtualMachinesAssociatedId;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new CloudServicesNetworkProperties(json) : null; } @@ -121,7 +121,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode ToJ } container.Add("additionalEgressEndpoints",__w); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { if (null != this._associatedResourceId) { @@ -133,20 +133,20 @@ public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode ToJ container.Add("associatedResourceIds",__r); } } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._clusterId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._clusterId.ToString()) : null, "clusterId" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._detailedStatus)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._detailedStatus.ToString()) : null, "detailedStatus" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._detailedStatusMessage)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._detailedStatusMessage.ToString()) : null, "detailedStatusMessage" ,container.Add ); } AddIf( null != (((object)this._enableDefaultEgressEndpoint)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._enableDefaultEgressEndpoint.ToString()) : null, "enableDefaultEgressEndpoints" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { if (null != this._enabledEgressEndpoint) { @@ -158,7 +158,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode ToJ container.Add("enabledEgressEndpoints",__m); } } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { if (null != this._hybridAksClustersAssociatedId) { @@ -170,15 +170,15 @@ public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode ToJ container.Add("hybridAksClustersAssociatedIds",__h); } } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._interfaceName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._interfaceName.ToString()) : null, "interfaceName" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._provisioningState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._provisioningState.ToString()) : null, "provisioningState" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { if (null != this._virtualMachinesAssociatedId) { diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Cluster.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Cluster.PowerShell.cs new file mode 100644 index 000000000000..36ea1c303fd1 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Cluster.PowerShell.cs @@ -0,0 +1,964 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + + /// Cluster represents the on-premises Network Cloud cluster. + [System.ComponentModel.TypeConverter(typeof(ClusterTypeConverter))] + public partial class Cluster + { + + /// + /// 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 Cluster(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ExtendedLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).ExtendedLocation = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocation) content.GetValueForProperty("ExtendedLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).ExtendedLocation, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ExtendedLocationTypeConverter.ConvertFrom); + } + if (content.Contains("Identity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).Identity = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IManagedServiceIdentity) content.GetValueForProperty("Identity",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).Identity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ManagedServiceIdentityTypeConverter.ConvertFrom); + } + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Etag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).Etag, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)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("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedByType = (string) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedByType = (string) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.TrackedResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("ExtendedLocationName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).ExtendedLocationName = (string) content.GetValueForProperty("ExtendedLocationName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).ExtendedLocationName, global::System.Convert.ToString); + } + if (content.Contains("ExtendedLocationType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).ExtendedLocationType = (string) content.GetValueForProperty("ExtendedLocationType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).ExtendedLocationType, global::System.Convert.ToString); + } + if (content.Contains("Capacity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).Capacity = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterCapacity) content.GetValueForProperty("Capacity",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).Capacity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterCapacityTypeConverter.ConvertFrom); + } + if (content.Contains("ClusterType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).ClusterType = (string) content.GetValueForProperty("ClusterType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).ClusterType, global::System.Convert.ToString); + } + if (content.Contains("IdentityPrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).IdentityPrincipalId = (string) content.GetValueForProperty("IdentityPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).IdentityPrincipalId, global::System.Convert.ToString); + } + if (content.Contains("IdentityTenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).IdentityTenantId = (string) content.GetValueForProperty("IdentityTenantId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).IdentityTenantId, global::System.Convert.ToString); + } + if (content.Contains("IdentityType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).IdentityType = (string) content.GetValueForProperty("IdentityType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).IdentityType, global::System.Convert.ToString); + } + if (content.Contains("IdentityUserAssignedIdentity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IUserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.UserAssignedIdentitiesTypeConverter.ConvertFrom); + } + if (content.Contains("AggregatorOrSingleRackDefinition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).AggregatorOrSingleRackDefinition = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackDefinition) content.GetValueForProperty("AggregatorOrSingleRackDefinition",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).AggregatorOrSingleRackDefinition, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.RackDefinitionTypeConverter.ConvertFrom); + } + if (content.Contains("AnalyticsOutputSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).AnalyticsOutputSetting = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAnalyticsOutputSettings) content.GetValueForProperty("AnalyticsOutputSetting",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).AnalyticsOutputSetting, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AnalyticsOutputSettingsTypeConverter.ConvertFrom); + } + if (content.Contains("ClusterExtendedLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).ClusterExtendedLocation = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocation) content.GetValueForProperty("ClusterExtendedLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).ClusterExtendedLocation, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ExtendedLocationTypeConverter.ConvertFrom); + } + if (content.Contains("ServicePrincipal")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).ServicePrincipal = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IServicePrincipalInformation) content.GetValueForProperty("ServicePrincipal",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).ServicePrincipal, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ServicePrincipalInformationTypeConverter.ConvertFrom); + } + if (content.Contains("CommandOutputSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).CommandOutputSetting = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICommandOutputSettings) content.GetValueForProperty("CommandOutputSetting",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).CommandOutputSetting, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.CommandOutputSettingsTypeConverter.ConvertFrom); + } + if (content.Contains("ComputeDeploymentThreshold")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).ComputeDeploymentThreshold = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IValidationThreshold) content.GetValueForProperty("ComputeDeploymentThreshold",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).ComputeDeploymentThreshold, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ValidationThresholdTypeConverter.ConvertFrom); + } + if (content.Contains("HybridAksExtendedLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).HybridAksExtendedLocation = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocation) content.GetValueForProperty("HybridAksExtendedLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).HybridAksExtendedLocation, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ExtendedLocationTypeConverter.ConvertFrom); + } + if (content.Contains("ManagedResourceGroupConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).ManagedResourceGroupConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IManagedResourceGroupConfiguration) content.GetValueForProperty("ManagedResourceGroupConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).ManagedResourceGroupConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ManagedResourceGroupConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("RuntimeProtectionConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).RuntimeProtectionConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRuntimeProtectionConfiguration) content.GetValueForProperty("RuntimeProtectionConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).RuntimeProtectionConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.RuntimeProtectionConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("SecretArchive")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).SecretArchive = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterSecretArchive) content.GetValueForProperty("SecretArchive",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).SecretArchive, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterSecretArchiveTypeConverter.ConvertFrom); + } + if (content.Contains("SecretArchiveSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).SecretArchiveSetting = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISecretArchiveSettings) content.GetValueForProperty("SecretArchiveSetting",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).SecretArchiveSetting, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.SecretArchiveSettingsTypeConverter.ConvertFrom); + } + if (content.Contains("UpdateStrategy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).UpdateStrategy = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterUpdateStrategy) content.GetValueForProperty("UpdateStrategy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).UpdateStrategy, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterUpdateStrategyTypeConverter.ConvertFrom); + } + if (content.Contains("VulnerabilityScanningSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).VulnerabilityScanningSetting = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVulnerabilityScanningSettings) content.GetValueForProperty("VulnerabilityScanningSetting",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).VulnerabilityScanningSetting, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.VulnerabilityScanningSettingsTypeConverter.ConvertFrom); + } + if (content.Contains("AnalyticsWorkspaceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).AnalyticsWorkspaceId = (string) content.GetValueForProperty("AnalyticsWorkspaceId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).AnalyticsWorkspaceId, global::System.Convert.ToString); + } + if (content.Contains("AvailableUpgradeVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).AvailableUpgradeVersion = (System.Collections.Generic.List) content.GetValueForProperty("AvailableUpgradeVersion",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).AvailableUpgradeVersion, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterAvailableUpgradeVersionTypeConverter.ConvertFrom)); + } + if (content.Contains("ConnectionStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).ConnectionStatus = (string) content.GetValueForProperty("ConnectionStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).ConnectionStatus, global::System.Convert.ToString); + } + if (content.Contains("ClusterLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).ClusterLocation = (string) content.GetValueForProperty("ClusterLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).ClusterLocation, global::System.Convert.ToString); + } + if (content.Contains("ManagerConnectionStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).ManagerConnectionStatus = (string) content.GetValueForProperty("ManagerConnectionStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).ManagerConnectionStatus, global::System.Convert.ToString); + } + if (content.Contains("ManagerId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).ManagerId = (string) content.GetValueForProperty("ManagerId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).ManagerId, global::System.Convert.ToString); + } + if (content.Contains("Version")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).Version = (string) content.GetValueForProperty("Version",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).Version, global::System.Convert.ToString); + } + if (content.Contains("ComputeRackDefinition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).ComputeRackDefinition = (System.Collections.Generic.List) content.GetValueForProperty("ComputeRackDefinition",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).ComputeRackDefinition, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.RackDefinitionTypeConverter.ConvertFrom)); + } + if (content.Contains("DetailedStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).DetailedStatus = (string) content.GetValueForProperty("DetailedStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).DetailedStatus, global::System.Convert.ToString); + } + if (content.Contains("DetailedStatusMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).DetailedStatusMessage = (string) content.GetValueForProperty("DetailedStatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).DetailedStatusMessage, global::System.Convert.ToString); + } + if (content.Contains("ManualActionCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).ManualActionCount = (long?) content.GetValueForProperty("ManualActionCount",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).ManualActionCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("NetworkFabricId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).NetworkFabricId = (string) content.GetValueForProperty("NetworkFabricId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).NetworkFabricId, global::System.Convert.ToString); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("SupportExpiryDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).SupportExpiryDate = (string) content.GetValueForProperty("SupportExpiryDate",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).SupportExpiryDate, global::System.Convert.ToString); + } + if (content.Contains("WorkloadResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).WorkloadResourceId = (System.Collections.Generic.List) content.GetValueForProperty("WorkloadResourceId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).WorkloadResourceId, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("CommandOutputSettingContainerUrl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).CommandOutputSettingContainerUrl = (string) content.GetValueForProperty("CommandOutputSettingContainerUrl",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).CommandOutputSettingContainerUrl, global::System.Convert.ToString); + } + if (content.Contains("ManagedResourceGroupConfigurationLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).ManagedResourceGroupConfigurationLocation = (string) content.GetValueForProperty("ManagedResourceGroupConfigurationLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).ManagedResourceGroupConfigurationLocation, global::System.Convert.ToString); + } + if (content.Contains("ManagedResourceGroupConfigurationName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).ManagedResourceGroupConfigurationName = (string) content.GetValueForProperty("ManagedResourceGroupConfigurationName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).ManagedResourceGroupConfigurationName, global::System.Convert.ToString); + } + if (content.Contains("SecretArchiveSettingVaultUri")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).SecretArchiveSettingVaultUri = (string) content.GetValueForProperty("SecretArchiveSettingVaultUri",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).SecretArchiveSettingVaultUri, global::System.Convert.ToString); + } + if (content.Contains("VulnerabilityScanningSettingContainerScan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).VulnerabilityScanningSettingContainerScan = (string) content.GetValueForProperty("VulnerabilityScanningSettingContainerScan",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).VulnerabilityScanningSettingContainerScan, global::System.Convert.ToString); + } + if (content.Contains("AggregatorOrSingleRackDefinitionAvailabilityZone")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).AggregatorOrSingleRackDefinitionAvailabilityZone = (string) content.GetValueForProperty("AggregatorOrSingleRackDefinitionAvailabilityZone",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).AggregatorOrSingleRackDefinitionAvailabilityZone, global::System.Convert.ToString); + } + if (content.Contains("AggregatorOrSingleRackDefinitionBareMetalMachineConfigurationData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).AggregatorOrSingleRackDefinitionBareMetalMachineConfigurationData = (System.Collections.Generic.List) content.GetValueForProperty("AggregatorOrSingleRackDefinitionBareMetalMachineConfigurationData",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).AggregatorOrSingleRackDefinitionBareMetalMachineConfigurationData, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BareMetalMachineConfigurationDataTypeConverter.ConvertFrom)); + } + if (content.Contains("AggregatorOrSingleRackDefinitionNetworkRackId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).AggregatorOrSingleRackDefinitionNetworkRackId = (string) content.GetValueForProperty("AggregatorOrSingleRackDefinitionNetworkRackId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).AggregatorOrSingleRackDefinitionNetworkRackId, global::System.Convert.ToString); + } + if (content.Contains("AggregatorOrSingleRackDefinitionRackLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).AggregatorOrSingleRackDefinitionRackLocation = (string) content.GetValueForProperty("AggregatorOrSingleRackDefinitionRackLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).AggregatorOrSingleRackDefinitionRackLocation, global::System.Convert.ToString); + } + if (content.Contains("AggregatorOrSingleRackDefinitionRackSerialNumber")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).AggregatorOrSingleRackDefinitionRackSerialNumber = (string) content.GetValueForProperty("AggregatorOrSingleRackDefinitionRackSerialNumber",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).AggregatorOrSingleRackDefinitionRackSerialNumber, global::System.Convert.ToString); + } + if (content.Contains("AggregatorOrSingleRackDefinitionRackSkuId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).AggregatorOrSingleRackDefinitionRackSkuId = (string) content.GetValueForProperty("AggregatorOrSingleRackDefinitionRackSkuId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).AggregatorOrSingleRackDefinitionRackSkuId, global::System.Convert.ToString); + } + if (content.Contains("AggregatorOrSingleRackDefinitionStorageApplianceConfigurationData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).AggregatorOrSingleRackDefinitionStorageApplianceConfigurationData = (System.Collections.Generic.List) content.GetValueForProperty("AggregatorOrSingleRackDefinitionStorageApplianceConfigurationData",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).AggregatorOrSingleRackDefinitionStorageApplianceConfigurationData, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.StorageApplianceConfigurationDataTypeConverter.ConvertFrom)); + } + if (content.Contains("AnalyticOutputSettingAssociatedIdentity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).AnalyticOutputSettingAssociatedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IIdentitySelector) content.GetValueForProperty("AnalyticOutputSettingAssociatedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).AnalyticOutputSettingAssociatedIdentity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IdentitySelectorTypeConverter.ConvertFrom); + } + if (content.Contains("AnalyticOutputSettingAnalyticsWorkspaceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).AnalyticOutputSettingAnalyticsWorkspaceId = (string) content.GetValueForProperty("AnalyticOutputSettingAnalyticsWorkspaceId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).AnalyticOutputSettingAnalyticsWorkspaceId, global::System.Convert.ToString); + } + if (content.Contains("CapacityAvailableApplianceStorageGb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).CapacityAvailableApplianceStorageGb = (long?) content.GetValueForProperty("CapacityAvailableApplianceStorageGb",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).CapacityAvailableApplianceStorageGb, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("CapacityAvailableCoreCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).CapacityAvailableCoreCount = (long?) content.GetValueForProperty("CapacityAvailableCoreCount",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).CapacityAvailableCoreCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("CapacityAvailableHostStorageGb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).CapacityAvailableHostStorageGb = (long?) content.GetValueForProperty("CapacityAvailableHostStorageGb",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).CapacityAvailableHostStorageGb, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("CapacityAvailableMemoryGb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).CapacityAvailableMemoryGb = (long?) content.GetValueForProperty("CapacityAvailableMemoryGb",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).CapacityAvailableMemoryGb, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("CapacityTotalApplianceStorageGb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).CapacityTotalApplianceStorageGb = (long?) content.GetValueForProperty("CapacityTotalApplianceStorageGb",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).CapacityTotalApplianceStorageGb, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("CapacityTotalCoreCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).CapacityTotalCoreCount = (long?) content.GetValueForProperty("CapacityTotalCoreCount",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).CapacityTotalCoreCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("CapacityTotalHostStorageGb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).CapacityTotalHostStorageGb = (long?) content.GetValueForProperty("CapacityTotalHostStorageGb",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).CapacityTotalHostStorageGb, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("CapacityTotalMemoryGb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).CapacityTotalMemoryGb = (long?) content.GetValueForProperty("CapacityTotalMemoryGb",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).CapacityTotalMemoryGb, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("ClusterExtendedLocationName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).ClusterExtendedLocationName = (string) content.GetValueForProperty("ClusterExtendedLocationName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).ClusterExtendedLocationName, global::System.Convert.ToString); + } + if (content.Contains("ClusterExtendedLocationType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).ClusterExtendedLocationType = (string) content.GetValueForProperty("ClusterExtendedLocationType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).ClusterExtendedLocationType, global::System.Convert.ToString); + } + if (content.Contains("ServicePrincipalApplicationId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).ServicePrincipalApplicationId = (string) content.GetValueForProperty("ServicePrincipalApplicationId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).ServicePrincipalApplicationId, global::System.Convert.ToString); + } + if (content.Contains("ServicePrincipalPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).ServicePrincipalPassword = (System.Security.SecureString) content.GetValueForProperty("ServicePrincipalPassword",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).ServicePrincipalPassword, (object ss) => (System.Security.SecureString)ss); + } + if (content.Contains("ServicePrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).ServicePrincipalId = (string) content.GetValueForProperty("ServicePrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).ServicePrincipalId, global::System.Convert.ToString); + } + if (content.Contains("ServicePrincipalTenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).ServicePrincipalTenantId = (string) content.GetValueForProperty("ServicePrincipalTenantId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).ServicePrincipalTenantId, global::System.Convert.ToString); + } + if (content.Contains("CommandOutputSettingAssociatedIdentity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).CommandOutputSettingAssociatedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IIdentitySelector) content.GetValueForProperty("CommandOutputSettingAssociatedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).CommandOutputSettingAssociatedIdentity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IdentitySelectorTypeConverter.ConvertFrom); + } + if (content.Contains("ComputeDeploymentThresholdGrouping")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).ComputeDeploymentThresholdGrouping = (string) content.GetValueForProperty("ComputeDeploymentThresholdGrouping",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).ComputeDeploymentThresholdGrouping, global::System.Convert.ToString); + } + if (content.Contains("ComputeDeploymentThresholdType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).ComputeDeploymentThresholdType = (string) content.GetValueForProperty("ComputeDeploymentThresholdType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).ComputeDeploymentThresholdType, global::System.Convert.ToString); + } + if (content.Contains("ComputeDeploymentThresholdValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).ComputeDeploymentThresholdValue = (long?) content.GetValueForProperty("ComputeDeploymentThresholdValue",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).ComputeDeploymentThresholdValue, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("HybridAkExtendedLocationName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).HybridAkExtendedLocationName = (string) content.GetValueForProperty("HybridAkExtendedLocationName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).HybridAkExtendedLocationName, global::System.Convert.ToString); + } + if (content.Contains("HybridAkExtendedLocationType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).HybridAkExtendedLocationType = (string) content.GetValueForProperty("HybridAkExtendedLocationType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).HybridAkExtendedLocationType, global::System.Convert.ToString); + } + if (content.Contains("RuntimeProtectionConfigurationEnforcementLevel")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).RuntimeProtectionConfigurationEnforcementLevel = (string) content.GetValueForProperty("RuntimeProtectionConfigurationEnforcementLevel",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).RuntimeProtectionConfigurationEnforcementLevel, global::System.Convert.ToString); + } + if (content.Contains("SecretArchiveKeyVaultId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).SecretArchiveKeyVaultId = (string) content.GetValueForProperty("SecretArchiveKeyVaultId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).SecretArchiveKeyVaultId, global::System.Convert.ToString); + } + if (content.Contains("SecretArchiveUseKeyVault")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).SecretArchiveUseKeyVault = (string) content.GetValueForProperty("SecretArchiveUseKeyVault",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).SecretArchiveUseKeyVault, global::System.Convert.ToString); + } + if (content.Contains("SecretArchiveSettingAssociatedIdentity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).SecretArchiveSettingAssociatedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IIdentitySelector) content.GetValueForProperty("SecretArchiveSettingAssociatedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).SecretArchiveSettingAssociatedIdentity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IdentitySelectorTypeConverter.ConvertFrom); + } + if (content.Contains("UpdateStrategyMaxUnavailable")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).UpdateStrategyMaxUnavailable = (long?) content.GetValueForProperty("UpdateStrategyMaxUnavailable",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).UpdateStrategyMaxUnavailable, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("UpdateStrategyType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).UpdateStrategyType = (string) content.GetValueForProperty("UpdateStrategyType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).UpdateStrategyType, global::System.Convert.ToString); + } + if (content.Contains("UpdateStrategyThresholdType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).UpdateStrategyThresholdType = (string) content.GetValueForProperty("UpdateStrategyThresholdType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).UpdateStrategyThresholdType, global::System.Convert.ToString); + } + if (content.Contains("UpdateStrategyThresholdValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).UpdateStrategyThresholdValue = (long?) content.GetValueForProperty("UpdateStrategyThresholdValue",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).UpdateStrategyThresholdValue, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("UpdateStrategyWaitTimeMinute")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).UpdateStrategyWaitTimeMinute = (long?) content.GetValueForProperty("UpdateStrategyWaitTimeMinute",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).UpdateStrategyWaitTimeMinute, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("AnalyticsOutputSettingsAssociatedIdentityType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).AnalyticsOutputSettingsAssociatedIdentityType = (string) content.GetValueForProperty("AnalyticsOutputSettingsAssociatedIdentityType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).AnalyticsOutputSettingsAssociatedIdentityType, global::System.Convert.ToString); + } + if (content.Contains("AnalyticsOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).AnalyticsOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId = (string) content.GetValueForProperty("AnalyticsOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).AnalyticsOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId, global::System.Convert.ToString); + } + if (content.Contains("AssociatedIdentityType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).AssociatedIdentityType = (string) content.GetValueForProperty("AssociatedIdentityType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).AssociatedIdentityType, global::System.Convert.ToString); + } + if (content.Contains("AssociatedIdentityUserAssignedIdentityResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).AssociatedIdentityUserAssignedIdentityResourceId = (string) content.GetValueForProperty("AssociatedIdentityUserAssignedIdentityResourceId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).AssociatedIdentityUserAssignedIdentityResourceId, global::System.Convert.ToString); + } + if (content.Contains("SecretArchiveSettingsAssociatedIdentityType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).SecretArchiveSettingsAssociatedIdentityType = (string) content.GetValueForProperty("SecretArchiveSettingsAssociatedIdentityType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).SecretArchiveSettingsAssociatedIdentityType, global::System.Convert.ToString); + } + if (content.Contains("SecretArchiveSettingsAssociatedIdentityUserAssignedIdentityResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).SecretArchiveSettingsAssociatedIdentityUserAssignedIdentityResourceId = (string) content.GetValueForProperty("SecretArchiveSettingsAssociatedIdentityUserAssignedIdentityResourceId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).SecretArchiveSettingsAssociatedIdentityUserAssignedIdentityResourceId, 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 Cluster(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ExtendedLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).ExtendedLocation = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocation) content.GetValueForProperty("ExtendedLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).ExtendedLocation, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ExtendedLocationTypeConverter.ConvertFrom); + } + if (content.Contains("Identity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).Identity = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IManagedServiceIdentity) content.GetValueForProperty("Identity",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).Identity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ManagedServiceIdentityTypeConverter.ConvertFrom); + } + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Etag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).Etag, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)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("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedByType = (string) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedByType = (string) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.TrackedResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("ExtendedLocationName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).ExtendedLocationName = (string) content.GetValueForProperty("ExtendedLocationName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).ExtendedLocationName, global::System.Convert.ToString); + } + if (content.Contains("ExtendedLocationType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).ExtendedLocationType = (string) content.GetValueForProperty("ExtendedLocationType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).ExtendedLocationType, global::System.Convert.ToString); + } + if (content.Contains("Capacity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).Capacity = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterCapacity) content.GetValueForProperty("Capacity",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).Capacity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterCapacityTypeConverter.ConvertFrom); + } + if (content.Contains("ClusterType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).ClusterType = (string) content.GetValueForProperty("ClusterType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).ClusterType, global::System.Convert.ToString); + } + if (content.Contains("IdentityPrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).IdentityPrincipalId = (string) content.GetValueForProperty("IdentityPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).IdentityPrincipalId, global::System.Convert.ToString); + } + if (content.Contains("IdentityTenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).IdentityTenantId = (string) content.GetValueForProperty("IdentityTenantId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).IdentityTenantId, global::System.Convert.ToString); + } + if (content.Contains("IdentityType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).IdentityType = (string) content.GetValueForProperty("IdentityType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).IdentityType, global::System.Convert.ToString); + } + if (content.Contains("IdentityUserAssignedIdentity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IUserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.UserAssignedIdentitiesTypeConverter.ConvertFrom); + } + if (content.Contains("AggregatorOrSingleRackDefinition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).AggregatorOrSingleRackDefinition = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackDefinition) content.GetValueForProperty("AggregatorOrSingleRackDefinition",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).AggregatorOrSingleRackDefinition, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.RackDefinitionTypeConverter.ConvertFrom); + } + if (content.Contains("AnalyticsOutputSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).AnalyticsOutputSetting = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAnalyticsOutputSettings) content.GetValueForProperty("AnalyticsOutputSetting",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).AnalyticsOutputSetting, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AnalyticsOutputSettingsTypeConverter.ConvertFrom); + } + if (content.Contains("ClusterExtendedLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).ClusterExtendedLocation = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocation) content.GetValueForProperty("ClusterExtendedLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).ClusterExtendedLocation, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ExtendedLocationTypeConverter.ConvertFrom); + } + if (content.Contains("ServicePrincipal")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).ServicePrincipal = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IServicePrincipalInformation) content.GetValueForProperty("ServicePrincipal",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).ServicePrincipal, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ServicePrincipalInformationTypeConverter.ConvertFrom); + } + if (content.Contains("CommandOutputSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).CommandOutputSetting = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICommandOutputSettings) content.GetValueForProperty("CommandOutputSetting",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).CommandOutputSetting, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.CommandOutputSettingsTypeConverter.ConvertFrom); + } + if (content.Contains("ComputeDeploymentThreshold")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).ComputeDeploymentThreshold = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IValidationThreshold) content.GetValueForProperty("ComputeDeploymentThreshold",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).ComputeDeploymentThreshold, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ValidationThresholdTypeConverter.ConvertFrom); + } + if (content.Contains("HybridAksExtendedLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).HybridAksExtendedLocation = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocation) content.GetValueForProperty("HybridAksExtendedLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).HybridAksExtendedLocation, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ExtendedLocationTypeConverter.ConvertFrom); + } + if (content.Contains("ManagedResourceGroupConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).ManagedResourceGroupConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IManagedResourceGroupConfiguration) content.GetValueForProperty("ManagedResourceGroupConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).ManagedResourceGroupConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ManagedResourceGroupConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("RuntimeProtectionConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).RuntimeProtectionConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRuntimeProtectionConfiguration) content.GetValueForProperty("RuntimeProtectionConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).RuntimeProtectionConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.RuntimeProtectionConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("SecretArchive")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).SecretArchive = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterSecretArchive) content.GetValueForProperty("SecretArchive",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).SecretArchive, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterSecretArchiveTypeConverter.ConvertFrom); + } + if (content.Contains("SecretArchiveSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).SecretArchiveSetting = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISecretArchiveSettings) content.GetValueForProperty("SecretArchiveSetting",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).SecretArchiveSetting, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.SecretArchiveSettingsTypeConverter.ConvertFrom); + } + if (content.Contains("UpdateStrategy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).UpdateStrategy = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterUpdateStrategy) content.GetValueForProperty("UpdateStrategy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).UpdateStrategy, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterUpdateStrategyTypeConverter.ConvertFrom); + } + if (content.Contains("VulnerabilityScanningSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).VulnerabilityScanningSetting = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVulnerabilityScanningSettings) content.GetValueForProperty("VulnerabilityScanningSetting",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).VulnerabilityScanningSetting, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.VulnerabilityScanningSettingsTypeConverter.ConvertFrom); + } + if (content.Contains("AnalyticsWorkspaceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).AnalyticsWorkspaceId = (string) content.GetValueForProperty("AnalyticsWorkspaceId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).AnalyticsWorkspaceId, global::System.Convert.ToString); + } + if (content.Contains("AvailableUpgradeVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).AvailableUpgradeVersion = (System.Collections.Generic.List) content.GetValueForProperty("AvailableUpgradeVersion",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).AvailableUpgradeVersion, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterAvailableUpgradeVersionTypeConverter.ConvertFrom)); + } + if (content.Contains("ConnectionStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).ConnectionStatus = (string) content.GetValueForProperty("ConnectionStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).ConnectionStatus, global::System.Convert.ToString); + } + if (content.Contains("ClusterLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).ClusterLocation = (string) content.GetValueForProperty("ClusterLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).ClusterLocation, global::System.Convert.ToString); + } + if (content.Contains("ManagerConnectionStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).ManagerConnectionStatus = (string) content.GetValueForProperty("ManagerConnectionStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).ManagerConnectionStatus, global::System.Convert.ToString); + } + if (content.Contains("ManagerId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).ManagerId = (string) content.GetValueForProperty("ManagerId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).ManagerId, global::System.Convert.ToString); + } + if (content.Contains("Version")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).Version = (string) content.GetValueForProperty("Version",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).Version, global::System.Convert.ToString); + } + if (content.Contains("ComputeRackDefinition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).ComputeRackDefinition = (System.Collections.Generic.List) content.GetValueForProperty("ComputeRackDefinition",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).ComputeRackDefinition, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.RackDefinitionTypeConverter.ConvertFrom)); + } + if (content.Contains("DetailedStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).DetailedStatus = (string) content.GetValueForProperty("DetailedStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).DetailedStatus, global::System.Convert.ToString); + } + if (content.Contains("DetailedStatusMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).DetailedStatusMessage = (string) content.GetValueForProperty("DetailedStatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).DetailedStatusMessage, global::System.Convert.ToString); + } + if (content.Contains("ManualActionCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).ManualActionCount = (long?) content.GetValueForProperty("ManualActionCount",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).ManualActionCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("NetworkFabricId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).NetworkFabricId = (string) content.GetValueForProperty("NetworkFabricId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).NetworkFabricId, global::System.Convert.ToString); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("SupportExpiryDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).SupportExpiryDate = (string) content.GetValueForProperty("SupportExpiryDate",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).SupportExpiryDate, global::System.Convert.ToString); + } + if (content.Contains("WorkloadResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).WorkloadResourceId = (System.Collections.Generic.List) content.GetValueForProperty("WorkloadResourceId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).WorkloadResourceId, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("CommandOutputSettingContainerUrl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).CommandOutputSettingContainerUrl = (string) content.GetValueForProperty("CommandOutputSettingContainerUrl",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).CommandOutputSettingContainerUrl, global::System.Convert.ToString); + } + if (content.Contains("ManagedResourceGroupConfigurationLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).ManagedResourceGroupConfigurationLocation = (string) content.GetValueForProperty("ManagedResourceGroupConfigurationLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).ManagedResourceGroupConfigurationLocation, global::System.Convert.ToString); + } + if (content.Contains("ManagedResourceGroupConfigurationName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).ManagedResourceGroupConfigurationName = (string) content.GetValueForProperty("ManagedResourceGroupConfigurationName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).ManagedResourceGroupConfigurationName, global::System.Convert.ToString); + } + if (content.Contains("SecretArchiveSettingVaultUri")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).SecretArchiveSettingVaultUri = (string) content.GetValueForProperty("SecretArchiveSettingVaultUri",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).SecretArchiveSettingVaultUri, global::System.Convert.ToString); + } + if (content.Contains("VulnerabilityScanningSettingContainerScan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).VulnerabilityScanningSettingContainerScan = (string) content.GetValueForProperty("VulnerabilityScanningSettingContainerScan",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).VulnerabilityScanningSettingContainerScan, global::System.Convert.ToString); + } + if (content.Contains("AggregatorOrSingleRackDefinitionAvailabilityZone")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).AggregatorOrSingleRackDefinitionAvailabilityZone = (string) content.GetValueForProperty("AggregatorOrSingleRackDefinitionAvailabilityZone",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).AggregatorOrSingleRackDefinitionAvailabilityZone, global::System.Convert.ToString); + } + if (content.Contains("AggregatorOrSingleRackDefinitionBareMetalMachineConfigurationData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).AggregatorOrSingleRackDefinitionBareMetalMachineConfigurationData = (System.Collections.Generic.List) content.GetValueForProperty("AggregatorOrSingleRackDefinitionBareMetalMachineConfigurationData",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).AggregatorOrSingleRackDefinitionBareMetalMachineConfigurationData, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BareMetalMachineConfigurationDataTypeConverter.ConvertFrom)); + } + if (content.Contains("AggregatorOrSingleRackDefinitionNetworkRackId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).AggregatorOrSingleRackDefinitionNetworkRackId = (string) content.GetValueForProperty("AggregatorOrSingleRackDefinitionNetworkRackId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).AggregatorOrSingleRackDefinitionNetworkRackId, global::System.Convert.ToString); + } + if (content.Contains("AggregatorOrSingleRackDefinitionRackLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).AggregatorOrSingleRackDefinitionRackLocation = (string) content.GetValueForProperty("AggregatorOrSingleRackDefinitionRackLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).AggregatorOrSingleRackDefinitionRackLocation, global::System.Convert.ToString); + } + if (content.Contains("AggregatorOrSingleRackDefinitionRackSerialNumber")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).AggregatorOrSingleRackDefinitionRackSerialNumber = (string) content.GetValueForProperty("AggregatorOrSingleRackDefinitionRackSerialNumber",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).AggregatorOrSingleRackDefinitionRackSerialNumber, global::System.Convert.ToString); + } + if (content.Contains("AggregatorOrSingleRackDefinitionRackSkuId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).AggregatorOrSingleRackDefinitionRackSkuId = (string) content.GetValueForProperty("AggregatorOrSingleRackDefinitionRackSkuId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).AggregatorOrSingleRackDefinitionRackSkuId, global::System.Convert.ToString); + } + if (content.Contains("AggregatorOrSingleRackDefinitionStorageApplianceConfigurationData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).AggregatorOrSingleRackDefinitionStorageApplianceConfigurationData = (System.Collections.Generic.List) content.GetValueForProperty("AggregatorOrSingleRackDefinitionStorageApplianceConfigurationData",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).AggregatorOrSingleRackDefinitionStorageApplianceConfigurationData, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.StorageApplianceConfigurationDataTypeConverter.ConvertFrom)); + } + if (content.Contains("AnalyticOutputSettingAssociatedIdentity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).AnalyticOutputSettingAssociatedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IIdentitySelector) content.GetValueForProperty("AnalyticOutputSettingAssociatedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).AnalyticOutputSettingAssociatedIdentity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IdentitySelectorTypeConverter.ConvertFrom); + } + if (content.Contains("AnalyticOutputSettingAnalyticsWorkspaceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).AnalyticOutputSettingAnalyticsWorkspaceId = (string) content.GetValueForProperty("AnalyticOutputSettingAnalyticsWorkspaceId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).AnalyticOutputSettingAnalyticsWorkspaceId, global::System.Convert.ToString); + } + if (content.Contains("CapacityAvailableApplianceStorageGb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).CapacityAvailableApplianceStorageGb = (long?) content.GetValueForProperty("CapacityAvailableApplianceStorageGb",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).CapacityAvailableApplianceStorageGb, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("CapacityAvailableCoreCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).CapacityAvailableCoreCount = (long?) content.GetValueForProperty("CapacityAvailableCoreCount",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).CapacityAvailableCoreCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("CapacityAvailableHostStorageGb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).CapacityAvailableHostStorageGb = (long?) content.GetValueForProperty("CapacityAvailableHostStorageGb",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).CapacityAvailableHostStorageGb, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("CapacityAvailableMemoryGb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).CapacityAvailableMemoryGb = (long?) content.GetValueForProperty("CapacityAvailableMemoryGb",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).CapacityAvailableMemoryGb, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("CapacityTotalApplianceStorageGb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).CapacityTotalApplianceStorageGb = (long?) content.GetValueForProperty("CapacityTotalApplianceStorageGb",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).CapacityTotalApplianceStorageGb, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("CapacityTotalCoreCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).CapacityTotalCoreCount = (long?) content.GetValueForProperty("CapacityTotalCoreCount",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).CapacityTotalCoreCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("CapacityTotalHostStorageGb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).CapacityTotalHostStorageGb = (long?) content.GetValueForProperty("CapacityTotalHostStorageGb",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).CapacityTotalHostStorageGb, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("CapacityTotalMemoryGb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).CapacityTotalMemoryGb = (long?) content.GetValueForProperty("CapacityTotalMemoryGb",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).CapacityTotalMemoryGb, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("ClusterExtendedLocationName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).ClusterExtendedLocationName = (string) content.GetValueForProperty("ClusterExtendedLocationName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).ClusterExtendedLocationName, global::System.Convert.ToString); + } + if (content.Contains("ClusterExtendedLocationType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).ClusterExtendedLocationType = (string) content.GetValueForProperty("ClusterExtendedLocationType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).ClusterExtendedLocationType, global::System.Convert.ToString); + } + if (content.Contains("ServicePrincipalApplicationId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).ServicePrincipalApplicationId = (string) content.GetValueForProperty("ServicePrincipalApplicationId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).ServicePrincipalApplicationId, global::System.Convert.ToString); + } + if (content.Contains("ServicePrincipalPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).ServicePrincipalPassword = (System.Security.SecureString) content.GetValueForProperty("ServicePrincipalPassword",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).ServicePrincipalPassword, (object ss) => (System.Security.SecureString)ss); + } + if (content.Contains("ServicePrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).ServicePrincipalId = (string) content.GetValueForProperty("ServicePrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).ServicePrincipalId, global::System.Convert.ToString); + } + if (content.Contains("ServicePrincipalTenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).ServicePrincipalTenantId = (string) content.GetValueForProperty("ServicePrincipalTenantId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).ServicePrincipalTenantId, global::System.Convert.ToString); + } + if (content.Contains("CommandOutputSettingAssociatedIdentity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).CommandOutputSettingAssociatedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IIdentitySelector) content.GetValueForProperty("CommandOutputSettingAssociatedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).CommandOutputSettingAssociatedIdentity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IdentitySelectorTypeConverter.ConvertFrom); + } + if (content.Contains("ComputeDeploymentThresholdGrouping")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).ComputeDeploymentThresholdGrouping = (string) content.GetValueForProperty("ComputeDeploymentThresholdGrouping",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).ComputeDeploymentThresholdGrouping, global::System.Convert.ToString); + } + if (content.Contains("ComputeDeploymentThresholdType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).ComputeDeploymentThresholdType = (string) content.GetValueForProperty("ComputeDeploymentThresholdType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).ComputeDeploymentThresholdType, global::System.Convert.ToString); + } + if (content.Contains("ComputeDeploymentThresholdValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).ComputeDeploymentThresholdValue = (long?) content.GetValueForProperty("ComputeDeploymentThresholdValue",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).ComputeDeploymentThresholdValue, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("HybridAkExtendedLocationName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).HybridAkExtendedLocationName = (string) content.GetValueForProperty("HybridAkExtendedLocationName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).HybridAkExtendedLocationName, global::System.Convert.ToString); + } + if (content.Contains("HybridAkExtendedLocationType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).HybridAkExtendedLocationType = (string) content.GetValueForProperty("HybridAkExtendedLocationType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).HybridAkExtendedLocationType, global::System.Convert.ToString); + } + if (content.Contains("RuntimeProtectionConfigurationEnforcementLevel")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).RuntimeProtectionConfigurationEnforcementLevel = (string) content.GetValueForProperty("RuntimeProtectionConfigurationEnforcementLevel",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).RuntimeProtectionConfigurationEnforcementLevel, global::System.Convert.ToString); + } + if (content.Contains("SecretArchiveKeyVaultId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).SecretArchiveKeyVaultId = (string) content.GetValueForProperty("SecretArchiveKeyVaultId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).SecretArchiveKeyVaultId, global::System.Convert.ToString); + } + if (content.Contains("SecretArchiveUseKeyVault")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).SecretArchiveUseKeyVault = (string) content.GetValueForProperty("SecretArchiveUseKeyVault",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).SecretArchiveUseKeyVault, global::System.Convert.ToString); + } + if (content.Contains("SecretArchiveSettingAssociatedIdentity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).SecretArchiveSettingAssociatedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IIdentitySelector) content.GetValueForProperty("SecretArchiveSettingAssociatedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).SecretArchiveSettingAssociatedIdentity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IdentitySelectorTypeConverter.ConvertFrom); + } + if (content.Contains("UpdateStrategyMaxUnavailable")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).UpdateStrategyMaxUnavailable = (long?) content.GetValueForProperty("UpdateStrategyMaxUnavailable",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).UpdateStrategyMaxUnavailable, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("UpdateStrategyType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).UpdateStrategyType = (string) content.GetValueForProperty("UpdateStrategyType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).UpdateStrategyType, global::System.Convert.ToString); + } + if (content.Contains("UpdateStrategyThresholdType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).UpdateStrategyThresholdType = (string) content.GetValueForProperty("UpdateStrategyThresholdType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).UpdateStrategyThresholdType, global::System.Convert.ToString); + } + if (content.Contains("UpdateStrategyThresholdValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).UpdateStrategyThresholdValue = (long?) content.GetValueForProperty("UpdateStrategyThresholdValue",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).UpdateStrategyThresholdValue, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("UpdateStrategyWaitTimeMinute")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).UpdateStrategyWaitTimeMinute = (long?) content.GetValueForProperty("UpdateStrategyWaitTimeMinute",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).UpdateStrategyWaitTimeMinute, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("AnalyticsOutputSettingsAssociatedIdentityType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).AnalyticsOutputSettingsAssociatedIdentityType = (string) content.GetValueForProperty("AnalyticsOutputSettingsAssociatedIdentityType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).AnalyticsOutputSettingsAssociatedIdentityType, global::System.Convert.ToString); + } + if (content.Contains("AnalyticsOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).AnalyticsOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId = (string) content.GetValueForProperty("AnalyticsOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).AnalyticsOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId, global::System.Convert.ToString); + } + if (content.Contains("AssociatedIdentityType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).AssociatedIdentityType = (string) content.GetValueForProperty("AssociatedIdentityType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).AssociatedIdentityType, global::System.Convert.ToString); + } + if (content.Contains("AssociatedIdentityUserAssignedIdentityResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).AssociatedIdentityUserAssignedIdentityResourceId = (string) content.GetValueForProperty("AssociatedIdentityUserAssignedIdentityResourceId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).AssociatedIdentityUserAssignedIdentityResourceId, global::System.Convert.ToString); + } + if (content.Contains("SecretArchiveSettingsAssociatedIdentityType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).SecretArchiveSettingsAssociatedIdentityType = (string) content.GetValueForProperty("SecretArchiveSettingsAssociatedIdentityType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).SecretArchiveSettingsAssociatedIdentityType, global::System.Convert.ToString); + } + if (content.Contains("SecretArchiveSettingsAssociatedIdentityUserAssignedIdentityResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).SecretArchiveSettingsAssociatedIdentityUserAssignedIdentityResourceId = (string) content.GetValueForProperty("SecretArchiveSettingsAssociatedIdentityUserAssignedIdentityResourceId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal)this).SecretArchiveSettingsAssociatedIdentityUserAssignedIdentityResourceId, 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.NetworkCloud.Models.ICluster DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new Cluster(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.NetworkCloud.Models.ICluster DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new Cluster(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.NetworkCloud.Models.ICluster FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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(); + } + } + /// Cluster represents the on-premises Network Cloud cluster. + [System.ComponentModel.TypeConverter(typeof(ClusterTypeConverter))] + public partial interface ICluster + + { + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/Cluster.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Cluster.TypeConverter.cs similarity index 98% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/Cluster.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Cluster.TypeConverter.cs index 77c214e9073d..390300e64c59 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/Cluster.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Cluster.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.ICluster ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICluster ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICluster).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICluster).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Cluster.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Cluster.cs new file mode 100644 index 000000000000..2c20552637ae --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Cluster.cs @@ -0,0 +1,1752 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + + /// Cluster represents the on-premises Network Cloud cluster. + public partial class Cluster : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICluster, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResource __trackedResource = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.TrackedResource(); + + /// + /// The zone name used for this rack when created. Availability zones are used for workload placement. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string AggregatorOrSingleRackDefinitionAvailabilityZone { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).AggregatorOrSingleRackDefinitionAvailabilityZone; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).AggregatorOrSingleRackDefinitionAvailabilityZone = value ?? null; } + + /// The unordered list of bare metal machine configuration. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public System.Collections.Generic.List AggregatorOrSingleRackDefinitionBareMetalMachineConfigurationData { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).AggregatorOrSingleRackDefinitionBareMetalMachineConfigurationData; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).AggregatorOrSingleRackDefinitionBareMetalMachineConfigurationData = value ?? null /* arrayOf */; } + + /// The resource ID of the network rack that matches this rack definition. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string AggregatorOrSingleRackDefinitionNetworkRackId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).AggregatorOrSingleRackDefinitionNetworkRackId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).AggregatorOrSingleRackDefinitionNetworkRackId = value ; } + + /// The free-form description of the rack's location. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string AggregatorOrSingleRackDefinitionRackLocation { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).AggregatorOrSingleRackDefinitionRackLocation; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).AggregatorOrSingleRackDefinitionRackLocation = value ?? null; } + + /// + /// The unique identifier for the rack within Network Cloud cluster. An alternate unique alphanumeric value other than a serial + /// number may be provided if desired. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string AggregatorOrSingleRackDefinitionRackSerialNumber { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).AggregatorOrSingleRackDefinitionRackSerialNumber; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).AggregatorOrSingleRackDefinitionRackSerialNumber = value ; } + + /// The resource ID of the sku for the rack being added. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string AggregatorOrSingleRackDefinitionRackSkuId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).AggregatorOrSingleRackDefinitionRackSkuId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).AggregatorOrSingleRackDefinitionRackSkuId = value ; } + + /// The list of storage appliance configuration data for this rack. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public System.Collections.Generic.List AggregatorOrSingleRackDefinitionStorageApplianceConfigurationData { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).AggregatorOrSingleRackDefinitionStorageApplianceConfigurationData; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).AggregatorOrSingleRackDefinitionStorageApplianceConfigurationData = value ?? null /* arrayOf */; } + + /// + /// The resource ID of the analytics workspace that is to be used by the specified identity. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string AnalyticOutputSettingAnalyticsWorkspaceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).AnalyticOutputSettingAnalyticsWorkspaceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).AnalyticOutputSettingAnalyticsWorkspaceId = value ?? null; } + + /// The type of managed identity that is being selected. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string AnalyticsOutputSettingsAssociatedIdentityType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).AnalyticsOutputSettingsAssociatedIdentityType; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).AnalyticsOutputSettingsAssociatedIdentityType = value ?? null; } + + /// + /// The user assigned managed identity resource ID to use. Mutually exclusive with a system assigned identity type. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string AnalyticsOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).AnalyticsOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).AnalyticsOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId = value ?? null; } + + /// + /// Field Deprecated. The resource ID of the Log Analytics Workspace that will be used for storing relevant logs. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string AnalyticsWorkspaceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).AnalyticsWorkspaceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).AnalyticsWorkspaceId = value ?? null; } + + /// The type of managed identity that is being selected. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string AssociatedIdentityType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).CommandOutputSettingsAssociatedIdentityType; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).CommandOutputSettingsAssociatedIdentityType = value ?? null; } + + /// + /// The user assigned managed identity resource ID to use. Mutually exclusive with a system assigned identity type. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string AssociatedIdentityUserAssignedIdentityResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).CommandOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).CommandOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId = value ?? null; } + + /// The list of cluster runtime version upgrades available for this cluster. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public System.Collections.Generic.List AvailableUpgradeVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).AvailableUpgradeVersion; } + + /// + /// The remaining appliance-based storage in GB available for workload use. Measured in gibibytes. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public long? CapacityAvailableApplianceStorageGb { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).ClusterCapacityAvailableApplianceStorageGb; } + + /// + /// The remaining number of cores that are available in this cluster for workload use. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public long? CapacityAvailableCoreCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).ClusterCapacityAvailableCoreCount; } + + /// + /// The remaining machine or host-based storage in GB available for workload use. Measured in gibibytes. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public long? CapacityAvailableHostStorageGb { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).ClusterCapacityAvailableHostStorageGb; } + + /// + /// The remaining memory in GB that are available in this cluster for workload use. Measured in gibibytes. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public long? CapacityAvailableMemoryGb { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).ClusterCapacityAvailableMemoryGb; } + + /// + /// The total appliance-based storage in GB supported by this cluster for workload use. Measured in gibibytes. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public long? CapacityTotalApplianceStorageGb { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).ClusterCapacityTotalApplianceStorageGb; } + + /// The total number of cores that are supported by this cluster for workload use. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public long? CapacityTotalCoreCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).ClusterCapacityTotalCoreCount; } + + /// + /// The total machine or host-based storage in GB supported by this cluster for workload use. Measured in gibibytes. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public long? CapacityTotalHostStorageGb { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).ClusterCapacityTotalHostStorageGb; } + + /// + /// The total memory supported by this cluster for workload use. Measured in gibibytes. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public long? CapacityTotalMemoryGb { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).ClusterCapacityTotalMemoryGb; } + + /// The resource ID of the extended location on which the resource will be created. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string ClusterExtendedLocationName { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).ClusterExtendedLocationName; } + + /// The extended location type, for example, CustomLocation. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string ClusterExtendedLocationType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).ClusterExtendedLocationType; } + + /// + /// The customer-provided location information to identify where the cluster resides. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string ClusterLocation { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).ClusterLocation; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).ClusterLocation = value ?? null; } + + /// The type of rack configuration for the cluster. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string ClusterType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).ClusterType; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).ClusterType = value ?? null; } + + /// + /// The URL of the storage account container that is to be used by the specified identities. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string CommandOutputSettingContainerUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).CommandOutputSettingContainerUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).CommandOutputSettingContainerUrl = value ?? null; } + + /// Selection of how the type evaluation is applied to the cluster calculation. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string ComputeDeploymentThresholdGrouping { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).ComputeDeploymentThresholdGrouping; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).ComputeDeploymentThresholdGrouping = value ?? null; } + + /// Selection of how the threshold should be evaluated. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string ComputeDeploymentThresholdType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).ComputeDeploymentThresholdType; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).ComputeDeploymentThresholdType = value ?? null; } + + /// The numeric threshold value. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public long? ComputeDeploymentThresholdValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).ComputeDeploymentThresholdValue; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).ComputeDeploymentThresholdValue = value ?? default(long); } + + /// + /// The list of rack definitions for the compute racks in a multi-rack cluster, or an empty list in a single-rack cluster. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public System.Collections.Generic.List ComputeRackDefinition { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).ComputeRackDefinition; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).ComputeRackDefinition = value ?? null /* arrayOf */; } + + /// The latest heartbeat status between the cluster manager and the cluster. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string ConnectionStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).ClusterConnectionStatus; } + + /// The current detailed status of the cluster. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string DetailedStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).DetailedStatus; } + + /// The descriptive message about the detailed status. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string DetailedStatusMessage { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).DetailedStatusMessage; } + + /// Backing field for property. + private string _etag; + + /// Resource ETag. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string Etag { get => this._etag; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocation _extendedLocation; + + /// The extended location of the cluster manager associated with the cluster. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocation ExtendedLocation { get => (this._extendedLocation = this._extendedLocation ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ExtendedLocation()); set => this._extendedLocation = value; } + + /// The resource ID of the extended location on which the resource will be created. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string ExtendedLocationName { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocationInternal)ExtendedLocation).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocationInternal)ExtendedLocation).Name = value ?? null; } + + /// The extended location type, for example, CustomLocation. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string ExtendedLocationType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocationInternal)ExtendedLocation).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocationInternal)ExtendedLocation).Type = value ?? null; } + + /// The resource ID of the extended location on which the resource will be created. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string HybridAkExtendedLocationName { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).HybridAkExtendedLocationName; } + + /// The extended location type, for example, CustomLocation. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string HybridAkExtendedLocationType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).HybridAkExtendedLocationType; } + + /// + /// Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).Id; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IManagedServiceIdentity _identity; + + /// The identity for the resource. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IManagedServiceIdentity Identity { get => (this._identity = this._identity ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ManagedServiceIdentity()); 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.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string IdentityPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string IdentityTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IManagedServiceIdentityInternal)Identity).TenantId; } + + /// + /// Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string IdentityType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IManagedServiceIdentityInternal)Identity).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IManagedServiceIdentityInternal)Identity).Type = value ?? null; } + + /// + /// 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.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IUserAssignedIdentities IdentityUserAssignedIdentity { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IManagedServiceIdentityInternal)Identity).UserAssignedIdentity; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IManagedServiceIdentityInternal)Identity).UserAssignedIdentity = value ?? null /* model class */; } + + /// The geo-location where the resource lives + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)__trackedResource).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)__trackedResource).Location = value ?? null; } + + /// + /// The location of the managed resource group. If not specified, the location of the parent resource is chosen. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string ManagedResourceGroupConfigurationLocation { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).ManagedResourceGroupConfigurationLocation; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).ManagedResourceGroupConfigurationLocation = value ?? null; } + + /// + /// The name for the managed resource group. If not specified, the unique name is automatically generated. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string ManagedResourceGroupConfigurationName { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).ManagedResourceGroupConfigurationName; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).ManagedResourceGroupConfigurationName = value ?? null; } + + /// The latest connectivity status between cluster manager and the cluster. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string ManagerConnectionStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).ClusterManagerConnectionStatus; } + + /// + /// The resource ID of the cluster manager that manages this cluster. This is set by the Cluster Manager when the cluster + /// is created. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string ManagerId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).ClusterManagerId; } + + /// The count of Manual Action Taken (MAT) events that have not been validated. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public long? ManualActionCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).ManualActionCount; } + + /// Internal Acessors for AggregatorOrSingleRackDefinition + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackDefinition Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal.AggregatorOrSingleRackDefinition { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).AggregatorOrSingleRackDefinition; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).AggregatorOrSingleRackDefinition = value ?? null /* model class */; } + + /// Internal Acessors for AnalyticOutputSettingAssociatedIdentity + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IIdentitySelector Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal.AnalyticOutputSettingAssociatedIdentity { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).AnalyticOutputSettingAssociatedIdentity; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).AnalyticOutputSettingAssociatedIdentity = value ?? null /* model class */; } + + /// Internal Acessors for AnalyticsOutputSetting + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAnalyticsOutputSettings Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal.AnalyticsOutputSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).AnalyticsOutputSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).AnalyticsOutputSetting = value ?? null /* model class */; } + + /// Internal Acessors for AvailableUpgradeVersion + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal.AvailableUpgradeVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).AvailableUpgradeVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).AvailableUpgradeVersion = value ?? null /* arrayOf */; } + + /// Internal Acessors for Capacity + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterCapacity Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal.Capacity { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).ClusterCapacity; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).ClusterCapacity = value ?? null /* model class */; } + + /// Internal Acessors for CapacityAvailableApplianceStorageGb + long? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal.CapacityAvailableApplianceStorageGb { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).ClusterCapacityAvailableApplianceStorageGb; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).ClusterCapacityAvailableApplianceStorageGb = value ?? default(long); } + + /// Internal Acessors for CapacityAvailableCoreCount + long? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal.CapacityAvailableCoreCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).ClusterCapacityAvailableCoreCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).ClusterCapacityAvailableCoreCount = value ?? default(long); } + + /// Internal Acessors for CapacityAvailableHostStorageGb + long? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal.CapacityAvailableHostStorageGb { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).ClusterCapacityAvailableHostStorageGb; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).ClusterCapacityAvailableHostStorageGb = value ?? default(long); } + + /// Internal Acessors for CapacityAvailableMemoryGb + long? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal.CapacityAvailableMemoryGb { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).ClusterCapacityAvailableMemoryGb; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).ClusterCapacityAvailableMemoryGb = value ?? default(long); } + + /// Internal Acessors for CapacityTotalApplianceStorageGb + long? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal.CapacityTotalApplianceStorageGb { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).ClusterCapacityTotalApplianceStorageGb; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).ClusterCapacityTotalApplianceStorageGb = value ?? default(long); } + + /// Internal Acessors for CapacityTotalCoreCount + long? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal.CapacityTotalCoreCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).ClusterCapacityTotalCoreCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).ClusterCapacityTotalCoreCount = value ?? default(long); } + + /// Internal Acessors for CapacityTotalHostStorageGb + long? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal.CapacityTotalHostStorageGb { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).ClusterCapacityTotalHostStorageGb; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).ClusterCapacityTotalHostStorageGb = value ?? default(long); } + + /// Internal Acessors for CapacityTotalMemoryGb + long? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal.CapacityTotalMemoryGb { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).ClusterCapacityTotalMemoryGb; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).ClusterCapacityTotalMemoryGb = value ?? default(long); } + + /// Internal Acessors for ClusterExtendedLocation + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocation Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal.ClusterExtendedLocation { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).ClusterExtendedLocation; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).ClusterExtendedLocation = value ?? null /* model class */; } + + /// Internal Acessors for ClusterExtendedLocationName + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal.ClusterExtendedLocationName { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).ClusterExtendedLocationName; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).ClusterExtendedLocationName = value ?? null; } + + /// Internal Acessors for ClusterExtendedLocationType + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal.ClusterExtendedLocationType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).ClusterExtendedLocationType; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).ClusterExtendedLocationType = value ?? null; } + + /// Internal Acessors for CommandOutputSetting + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICommandOutputSettings Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal.CommandOutputSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).CommandOutputSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).CommandOutputSetting = value ?? null /* model class */; } + + /// Internal Acessors for CommandOutputSettingAssociatedIdentity + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IIdentitySelector Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal.CommandOutputSettingAssociatedIdentity { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).CommandOutputSettingAssociatedIdentity; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).CommandOutputSettingAssociatedIdentity = value ?? null /* model class */; } + + /// Internal Acessors for ComputeDeploymentThreshold + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IValidationThreshold Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal.ComputeDeploymentThreshold { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).ComputeDeploymentThreshold; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).ComputeDeploymentThreshold = value ?? null /* model class */; } + + /// Internal Acessors for ConnectionStatus + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal.ConnectionStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).ClusterConnectionStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).ClusterConnectionStatus = value ?? null; } + + /// Internal Acessors for DetailedStatus + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal.DetailedStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).DetailedStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).DetailedStatus = value ?? null; } + + /// Internal Acessors for DetailedStatusMessage + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal.DetailedStatusMessage { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).DetailedStatusMessage; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).DetailedStatusMessage = value ?? null; } + + /// Internal Acessors for Etag + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal.Etag { get => this._etag; set { {_etag = value;} } } + + /// Internal Acessors for ExtendedLocation + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocation Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal.ExtendedLocation { get => (this._extendedLocation = this._extendedLocation ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ExtendedLocation()); set { {_extendedLocation = value;} } } + + /// Internal Acessors for HybridAkExtendedLocationName + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal.HybridAkExtendedLocationName { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).HybridAkExtendedLocationName; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).HybridAkExtendedLocationName = value ?? null; } + + /// Internal Acessors for HybridAkExtendedLocationType + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal.HybridAkExtendedLocationType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).HybridAkExtendedLocationType; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).HybridAkExtendedLocationType = value ?? null; } + + /// Internal Acessors for HybridAksExtendedLocation + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocation Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal.HybridAksExtendedLocation { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).HybridAksExtendedLocation; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).HybridAksExtendedLocation = value ?? null /* model class */; } + + /// Internal Acessors for Identity + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IManagedServiceIdentity Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal.Identity { get => (this._identity = this._identity ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ManagedServiceIdentity()); set { {_identity = value;} } } + + /// Internal Acessors for IdentityPrincipalId + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal.IdentityPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IManagedServiceIdentityInternal)Identity).PrincipalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IManagedServiceIdentityInternal)Identity).PrincipalId = value ?? null; } + + /// Internal Acessors for IdentityTenantId + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal.IdentityTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IManagedServiceIdentityInternal)Identity).TenantId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IManagedServiceIdentityInternal)Identity).TenantId = value ?? null; } + + /// Internal Acessors for ManagedResourceGroupConfiguration + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IManagedResourceGroupConfiguration Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal.ManagedResourceGroupConfiguration { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).ManagedResourceGroupConfiguration; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).ManagedResourceGroupConfiguration = value ?? null /* model class */; } + + /// Internal Acessors for ManagerConnectionStatus + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal.ManagerConnectionStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).ClusterManagerConnectionStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).ClusterManagerConnectionStatus = value ?? null; } + + /// Internal Acessors for ManagerId + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal.ManagerId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).ClusterManagerId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).ClusterManagerId = value ?? null; } + + /// Internal Acessors for ManualActionCount + long? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal.ManualActionCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).ManualActionCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).ManualActionCount = value ?? default(long); } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterProperties Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterProperties()); set { {_property = value;} } } + + /// Internal Acessors for ProvisioningState + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).ProvisioningState = value ?? null; } + + /// Internal Acessors for RuntimeProtectionConfiguration + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRuntimeProtectionConfiguration Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal.RuntimeProtectionConfiguration { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).RuntimeProtectionConfiguration; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).RuntimeProtectionConfiguration = value ?? null /* model class */; } + + /// Internal Acessors for SecretArchive + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterSecretArchive Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal.SecretArchive { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).SecretArchive; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).SecretArchive = value ?? null /* model class */; } + + /// Internal Acessors for SecretArchiveSetting + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISecretArchiveSettings Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal.SecretArchiveSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).SecretArchiveSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).SecretArchiveSetting = value ?? null /* model class */; } + + /// Internal Acessors for SecretArchiveSettingAssociatedIdentity + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IIdentitySelector Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal.SecretArchiveSettingAssociatedIdentity { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).SecretArchiveSettingAssociatedIdentity; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).SecretArchiveSettingAssociatedIdentity = value ?? null /* model class */; } + + /// Internal Acessors for ServicePrincipal + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IServicePrincipalInformation Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal.ServicePrincipal { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).ClusterServicePrincipal; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).ClusterServicePrincipal = value ?? null /* model class */; } + + /// Internal Acessors for SupportExpiryDate + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal.SupportExpiryDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).SupportExpiryDate; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).SupportExpiryDate = value ?? null; } + + /// Internal Acessors for UpdateStrategy + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterUpdateStrategy Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal.UpdateStrategy { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).UpdateStrategy; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).UpdateStrategy = value ?? null /* model class */; } + + /// Internal Acessors for VulnerabilityScanningSetting + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVulnerabilityScanningSettings Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal.VulnerabilityScanningSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).VulnerabilityScanningSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).VulnerabilityScanningSetting = value ?? null /* model class */; } + + /// Internal Acessors for WorkloadResourceId + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterInternal.WorkloadResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).WorkloadResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).WorkloadResourceId = value ?? null /* arrayOf */; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).Id = value ?? null; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).Name = value ?? null; } + + /// Internal Acessors for SystemData + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISystemData Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemData; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemData = value ?? null /* model class */; } + + /// Internal Acessors for SystemDataCreatedAt + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataCreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataCreatedAt = value ?? default(global::System.DateTime); } + + /// Internal Acessors for SystemDataCreatedBy + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataCreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataCreatedBy = value ?? null; } + + /// Internal Acessors for SystemDataCreatedByType + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataCreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataCreatedByType = value ?? null; } + + /// Internal Acessors for SystemDataLastModifiedAt + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedAt = value ?? default(global::System.DateTime); } + + /// Internal Acessors for SystemDataLastModifiedBy + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedBy = value ?? null; } + + /// Internal Acessors for SystemDataLastModifiedByType + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedByType = value ?? null; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).Type = value ?? null; } + + /// The name of the resource + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).Name; } + + /// The resource ID of the Network Fabric associated with the cluster. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string NetworkFabricId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).NetworkFabricId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).NetworkFabricId = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterProperties _property; + + /// The list of the resource properties. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterProperties()); set => this._property = value; } + + /// The provisioning state of the cluster. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).ProvisioningState; } + + /// Gets the resource group name + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string ResourceGroupName { get => (new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Success ? new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Groups["resourceGroupName"].Value : null); } + + /// The mode of operation for runtime protection. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string RuntimeProtectionConfigurationEnforcementLevel { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).RuntimeProtectionConfigurationEnforcementLevel; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).RuntimeProtectionConfigurationEnforcementLevel = value ?? null; } + + /// The resource ID of the key vault to archive the secrets of the cluster. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string SecretArchiveKeyVaultId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).SecretArchiveKeyVaultId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).SecretArchiveKeyVaultId = value ?? null; } + + /// The URI for the key vault used as the secret archive. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string SecretArchiveSettingVaultUri { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).SecretArchiveSettingVaultUri; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).SecretArchiveSettingVaultUri = value ?? null; } + + /// The type of managed identity that is being selected. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string SecretArchiveSettingsAssociatedIdentityType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).SecretArchiveSettingsAssociatedIdentityType; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).SecretArchiveSettingsAssociatedIdentityType = value ?? null; } + + /// + /// The user assigned managed identity resource ID to use. Mutually exclusive with a system assigned identity type. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string SecretArchiveSettingsAssociatedIdentityUserAssignedIdentityResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).SecretArchiveSettingsAssociatedIdentityUserAssignedIdentityResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).SecretArchiveSettingsAssociatedIdentityUserAssignedIdentityResourceId = value ?? null; } + + /// + /// The indicator if the specified key vault should be used to archive the secrets of the cluster. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string SecretArchiveUseKeyVault { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).SecretArchiveUseKeyVault; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).SecretArchiveUseKeyVault = value ?? null; } + + /// The application ID, also known as client ID, of the service principal. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string ServicePrincipalApplicationId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).ClusterServicePrincipalApplicationId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).ClusterServicePrincipalApplicationId = value ?? null; } + + /// The principal ID, also known as the object ID, of the service principal. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string ServicePrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).ClusterServicePrincipalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).ClusterServicePrincipalId = value ?? null; } + + /// The password of the service principal. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public System.Security.SecureString ServicePrincipalPassword { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).ClusterServicePrincipalPassword; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).ClusterServicePrincipalPassword = value ?? null; } + + /// + /// The tenant ID, also known as the directory ID, of the tenant in which the service principal is created. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string ServicePrincipalTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).ClusterServicePrincipalTenantId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).ClusterServicePrincipalTenantId = value ?? null; } + + /// The support end date of the runtime version of the cluster. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string SupportExpiryDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).SupportExpiryDate; } + + /// + /// Azure Resource Manager metadata containing createdBy and modifiedBy information. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISystemData SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemData; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemData = value ?? null /* model class */; } + + /// The timestamp of resource creation (UTC). + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataCreatedAt; } + + /// The identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataCreatedBy; } + + /// The type of identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public string SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataCreatedByType; } + + /// The timestamp of resource last modification (UTC) + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedAt; } + + /// The identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedBy; } + + /// The type of identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public string SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedByType; } + + /// Resource tags. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)__trackedResource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).Type; } + + /// + /// The maximum number of worker nodes that can be offline within the increment of update, e.g., rack-by-rack. + /// Limited by the maximum number of machines in the increment. Defaults to the whole increment size. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public long? UpdateStrategyMaxUnavailable { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).UpdateStrategyMaxUnavailable; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).UpdateStrategyMaxUnavailable = value ?? default(long); } + + /// Selection of how the threshold should be evaluated. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string UpdateStrategyThresholdType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).UpdateStrategyThresholdType; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).UpdateStrategyThresholdType = value ?? null; } + + /// The numeric threshold value. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public long? UpdateStrategyThresholdValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).UpdateStrategyThresholdValue; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).UpdateStrategyThresholdValue = value ?? default(long); } + + /// The mode of operation for runtime protection. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string UpdateStrategyType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).UpdateStrategyType; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).UpdateStrategyType = value ?? null; } + + /// The time to wait between the increments of update defined by the strategy. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public long? UpdateStrategyWaitTimeMinute { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).UpdateStrategyWaitTimeMinute; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).UpdateStrategyWaitTimeMinute = value ?? default(long); } + + /// The current runtime version of the cluster. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string Version { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).ClusterVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).ClusterVersion = value ?? null; } + + /// The mode selection for container vulnerability scanning. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string VulnerabilityScanningSettingContainerScan { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).VulnerabilityScanningSettingContainerScan; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).VulnerabilityScanningSettingContainerScan = value ?? null; } + + /// The list of workload resource IDs that are hosted within this cluster. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public System.Collections.Generic.List WorkloadResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)Property).WorkloadResourceId; } + + /// Creates an new instance. + public Cluster() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__trackedResource), __trackedResource); + await eventListener.AssertObjectIsValid(nameof(__trackedResource), __trackedResource); + } + } + /// Cluster represents the on-premises Network Cloud cluster. + public partial interface ICluster : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResource + { + /// + /// The zone name used for this rack when created. Availability zones are used for workload placement. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The zone name used for this rack when created. Availability zones are used for workload placement.", + SerializedName = @"availabilityZone", + PossibleTypes = new [] { typeof(string) })] + string AggregatorOrSingleRackDefinitionAvailabilityZone { get; set; } + /// The unordered list of bare metal machine configuration. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The unordered list of bare metal machine configuration.", + SerializedName = @"bareMetalMachineConfigurationData", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineConfigurationData) })] + System.Collections.Generic.List AggregatorOrSingleRackDefinitionBareMetalMachineConfigurationData { get; set; } + /// The resource ID of the network rack that matches this rack definition. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The resource ID of the network rack that matches this rack definition.", + SerializedName = @"networkRackId", + PossibleTypes = new [] { typeof(string) })] + string AggregatorOrSingleRackDefinitionNetworkRackId { get; set; } + /// The free-form description of the rack's location. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The free-form description of the rack's location.", + SerializedName = @"rackLocation", + PossibleTypes = new [] { typeof(string) })] + string AggregatorOrSingleRackDefinitionRackLocation { get; set; } + /// + /// The unique identifier for the rack within Network Cloud cluster. An alternate unique alphanumeric value other than a serial + /// number may be provided if desired. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The unique identifier for the rack within Network Cloud cluster. An alternate unique alphanumeric value other than a serial number may be provided if desired.", + SerializedName = @"rackSerialNumber", + PossibleTypes = new [] { typeof(string) })] + string AggregatorOrSingleRackDefinitionRackSerialNumber { get; set; } + /// The resource ID of the sku for the rack being added. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The resource ID of the sku for the rack being added.", + SerializedName = @"rackSkuId", + PossibleTypes = new [] { typeof(string) })] + string AggregatorOrSingleRackDefinitionRackSkuId { get; set; } + /// The list of storage appliance configuration data for this rack. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The list of storage appliance configuration data for this rack.", + SerializedName = @"storageApplianceConfigurationData", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceConfigurationData) })] + System.Collections.Generic.List AggregatorOrSingleRackDefinitionStorageApplianceConfigurationData { get; set; } + /// + /// The resource ID of the analytics workspace that is to be used by the specified identity. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The resource ID of the analytics workspace that is to be used by the specified identity.", + SerializedName = @"analyticsWorkspaceId", + PossibleTypes = new [] { typeof(string) })] + string AnalyticOutputSettingAnalyticsWorkspaceId { get; set; } + /// The type of managed identity that is being selected. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The type of managed identity that is being selected.", + SerializedName = @"identityType", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("SystemAssignedIdentity", "UserAssignedIdentity")] + string AnalyticsOutputSettingsAssociatedIdentityType { get; set; } + /// + /// The user assigned managed identity resource ID to use. Mutually exclusive with a system assigned identity type. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The user assigned managed identity resource ID to use. Mutually exclusive with a system assigned identity type.", + SerializedName = @"userAssignedIdentityResourceId", + PossibleTypes = new [] { typeof(string) })] + string AnalyticsOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId { get; set; } + /// + /// Field Deprecated. The resource ID of the Log Analytics Workspace that will be used for storing relevant logs. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"Field Deprecated. The resource ID of the Log Analytics Workspace that will be used for storing relevant logs.", + SerializedName = @"analyticsWorkspaceId", + PossibleTypes = new [] { typeof(string) })] + string AnalyticsWorkspaceId { get; set; } + /// The type of managed identity that is being selected. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The type of managed identity that is being selected.", + SerializedName = @"identityType", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("SystemAssignedIdentity", "UserAssignedIdentity")] + string AssociatedIdentityType { get; set; } + /// + /// The user assigned managed identity resource ID to use. Mutually exclusive with a system assigned identity type. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The user assigned managed identity resource ID to use. Mutually exclusive with a system assigned identity type.", + SerializedName = @"userAssignedIdentityResourceId", + PossibleTypes = new [] { typeof(string) })] + string AssociatedIdentityUserAssignedIdentityResourceId { get; set; } + /// The list of cluster runtime version upgrades available for this cluster. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The list of cluster runtime version upgrades available for this cluster.", + SerializedName = @"availableUpgradeVersions", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterAvailableUpgradeVersion) })] + System.Collections.Generic.List AvailableUpgradeVersion { get; } + /// + /// The remaining appliance-based storage in GB available for workload use. Measured in gibibytes. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The remaining appliance-based storage in GB available for workload use. Measured in gibibytes.", + SerializedName = @"availableApplianceStorageGB", + PossibleTypes = new [] { typeof(long) })] + long? CapacityAvailableApplianceStorageGb { get; } + /// + /// The remaining number of cores that are available in this cluster for workload use. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The remaining number of cores that are available in this cluster for workload use.", + SerializedName = @"availableCoreCount", + PossibleTypes = new [] { typeof(long) })] + long? CapacityAvailableCoreCount { get; } + /// + /// The remaining machine or host-based storage in GB available for workload use. Measured in gibibytes. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The remaining machine or host-based storage in GB available for workload use. Measured in gibibytes.", + SerializedName = @"availableHostStorageGB", + PossibleTypes = new [] { typeof(long) })] + long? CapacityAvailableHostStorageGb { get; } + /// + /// The remaining memory in GB that are available in this cluster for workload use. Measured in gibibytes. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The remaining memory in GB that are available in this cluster for workload use. Measured in gibibytes.", + SerializedName = @"availableMemoryGB", + PossibleTypes = new [] { typeof(long) })] + long? CapacityAvailableMemoryGb { get; } + /// + /// The total appliance-based storage in GB supported by this cluster for workload use. Measured in gibibytes. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The total appliance-based storage in GB supported by this cluster for workload use. Measured in gibibytes.", + SerializedName = @"totalApplianceStorageGB", + PossibleTypes = new [] { typeof(long) })] + long? CapacityTotalApplianceStorageGb { get; } + /// The total number of cores that are supported by this cluster for workload use. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The total number of cores that are supported by this cluster for workload use.", + SerializedName = @"totalCoreCount", + PossibleTypes = new [] { typeof(long) })] + long? CapacityTotalCoreCount { get; } + /// + /// The total machine or host-based storage in GB supported by this cluster for workload use. Measured in gibibytes. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The total machine or host-based storage in GB supported by this cluster for workload use. Measured in gibibytes.", + SerializedName = @"totalHostStorageGB", + PossibleTypes = new [] { typeof(long) })] + long? CapacityTotalHostStorageGb { get; } + /// + /// The total memory supported by this cluster for workload use. Measured in gibibytes. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The total memory supported by this cluster for workload use. Measured in gibibytes.", + SerializedName = @"totalMemoryGB", + PossibleTypes = new [] { typeof(long) })] + long? CapacityTotalMemoryGb { get; } + /// The resource ID of the extended location on which the resource will be created. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The resource ID of the extended location on which the resource will be created.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string ClusterExtendedLocationName { get; } + /// The extended location type, for example, CustomLocation. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The extended location type, for example, CustomLocation.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + string ClusterExtendedLocationType { get; } + /// + /// The customer-provided location information to identify where the cluster resides. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The customer-provided location information to identify where the cluster resides.", + SerializedName = @"clusterLocation", + PossibleTypes = new [] { typeof(string) })] + string ClusterLocation { get; set; } + /// The type of rack configuration for the cluster. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The type of rack configuration for the cluster.", + SerializedName = @"clusterType", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("SingleRack", "MultiRack")] + string ClusterType { get; set; } + /// + /// The URL of the storage account container that is to be used by the specified identities. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The URL of the storage account container that is to be used by the specified identities.", + SerializedName = @"containerUrl", + PossibleTypes = new [] { typeof(string) })] + string CommandOutputSettingContainerUrl { get; set; } + /// Selection of how the type evaluation is applied to the cluster calculation. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"Selection of how the type evaluation is applied to the cluster calculation.", + SerializedName = @"grouping", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("PerCluster", "PerRack")] + string ComputeDeploymentThresholdGrouping { get; set; } + /// Selection of how the threshold should be evaluated. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"Selection of how the threshold should be evaluated.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("CountSuccess", "PercentSuccess")] + string ComputeDeploymentThresholdType { get; set; } + /// The numeric threshold value. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The numeric threshold value.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(long) })] + long? ComputeDeploymentThresholdValue { get; set; } + /// + /// The list of rack definitions for the compute racks in a multi-rack cluster, or an empty list in a single-rack cluster. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The list of rack definitions for the compute racks in a multi-rack cluster, or an empty list in a single-rack cluster.", + SerializedName = @"computeRackDefinitions", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackDefinition) })] + System.Collections.Generic.List ComputeRackDefinition { get; set; } + /// The latest heartbeat status between the cluster manager and the cluster. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The latest heartbeat status between the cluster manager and the cluster.", + SerializedName = @"clusterConnectionStatus", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Connected", "Disconnected", "Timeout", "Undefined")] + string ConnectionStatus { get; } + /// The current detailed status of the cluster. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The current detailed status of the cluster.", + SerializedName = @"detailedStatus", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("PendingDeployment", "Deploying", "Running", "Updating", "UpdatePaused", "Degraded", "Deleting", "Disconnected", "Failed")] + string DetailedStatus { get; } + /// The descriptive message about the detailed status. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The descriptive message about the detailed status.", + SerializedName = @"detailedStatusMessage", + PossibleTypes = new [] { typeof(string) })] + string DetailedStatusMessage { get; } + /// Resource ETag. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"Resource ETag.", + SerializedName = @"etag", + PossibleTypes = new [] { typeof(string) })] + string Etag { get; } + /// The resource ID of the extended location on which the resource will be created. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The resource ID of the extended location on which the resource will be created.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string ExtendedLocationName { get; set; } + /// The extended location type, for example, CustomLocation. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The extended location type, for example, CustomLocation.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + string ExtendedLocationType { get; set; } + /// The resource ID of the extended location on which the resource will be created. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The resource ID of the extended location on which the resource will be created.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string HybridAkExtendedLocationName { get; } + /// The extended location type, for example, CustomLocation. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The extended location type, for example, CustomLocation.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + string HybridAkExtendedLocationType { get; } + /// + /// The service principal ID of the system assigned identity. This property will only be provided for a system assigned identity. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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) })] + string IdentityPrincipalId { get; } + /// + /// The tenant ID of the system assigned identity. This property will only be provided for a system assigned identity. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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) })] + string IdentityTenantId { get; } + /// + /// Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.IUserAssignedIdentities) })] + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IUserAssignedIdentities IdentityUserAssignedIdentity { get; set; } + /// + /// The location of the managed resource group. If not specified, the location of the parent resource is chosen. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The location of the managed resource group. If not specified, the location of the parent resource is chosen.", + SerializedName = @"location", + PossibleTypes = new [] { typeof(string) })] + string ManagedResourceGroupConfigurationLocation { get; set; } + /// + /// The name for the managed resource group. If not specified, the unique name is automatically generated. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The name for the managed resource group. If not specified, the unique name is automatically generated.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string ManagedResourceGroupConfigurationName { get; set; } + /// The latest connectivity status between cluster manager and the cluster. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The latest connectivity status between cluster manager and the cluster.", + SerializedName = @"clusterManagerConnectionStatus", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Connected", "Unreachable")] + string ManagerConnectionStatus { get; } + /// + /// The resource ID of the cluster manager that manages this cluster. This is set by the Cluster Manager when the cluster + /// is created. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The resource ID of the cluster manager that manages this cluster. This is set by the Cluster Manager when the cluster is created.", + SerializedName = @"clusterManagerId", + PossibleTypes = new [] { typeof(string) })] + string ManagerId { get; } + /// The count of Manual Action Taken (MAT) events that have not been validated. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The count of Manual Action Taken (MAT) events that have not been validated.", + SerializedName = @"manualActionCount", + PossibleTypes = new [] { typeof(long) })] + long? ManualActionCount { get; } + /// The resource ID of the Network Fabric associated with the cluster. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The resource ID of the Network Fabric associated with the cluster.", + SerializedName = @"networkFabricId", + PossibleTypes = new [] { typeof(string) })] + string NetworkFabricId { get; set; } + /// The provisioning state of the cluster. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The provisioning state of the cluster.", + SerializedName = @"provisioningState", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Succeeded", "Failed", "Canceled", "Accepted", "Validating", "Updating")] + string ProvisioningState { get; } + /// The mode of operation for runtime protection. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The mode of operation for runtime protection.", + SerializedName = @"enforcementLevel", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Audit", "Disabled", "OnDemand", "Passive", "RealTime")] + string RuntimeProtectionConfigurationEnforcementLevel { get; set; } + /// The resource ID of the key vault to archive the secrets of the cluster. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The resource ID of the key vault to archive the secrets of the cluster.", + SerializedName = @"keyVaultId", + PossibleTypes = new [] { typeof(string) })] + string SecretArchiveKeyVaultId { get; set; } + /// The URI for the key vault used as the secret archive. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The URI for the key vault used as the secret archive.", + SerializedName = @"vaultUri", + PossibleTypes = new [] { typeof(string) })] + string SecretArchiveSettingVaultUri { get; set; } + /// The type of managed identity that is being selected. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The type of managed identity that is being selected.", + SerializedName = @"identityType", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("SystemAssignedIdentity", "UserAssignedIdentity")] + string SecretArchiveSettingsAssociatedIdentityType { get; set; } + /// + /// The user assigned managed identity resource ID to use. Mutually exclusive with a system assigned identity type. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The user assigned managed identity resource ID to use. Mutually exclusive with a system assigned identity type.", + SerializedName = @"userAssignedIdentityResourceId", + PossibleTypes = new [] { typeof(string) })] + string SecretArchiveSettingsAssociatedIdentityUserAssignedIdentityResourceId { get; set; } + /// + /// The indicator if the specified key vault should be used to archive the secrets of the cluster. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The indicator if the specified key vault should be used to archive the secrets of the cluster.", + SerializedName = @"useKeyVault", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("True", "False")] + string SecretArchiveUseKeyVault { get; set; } + /// The application ID, also known as client ID, of the service principal. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The application ID, also known as client ID, of the service principal.", + SerializedName = @"applicationId", + PossibleTypes = new [] { typeof(string) })] + string ServicePrincipalApplicationId { get; set; } + /// The principal ID, also known as the object ID, of the service principal. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The principal ID, also known as the object ID, of the service principal.", + SerializedName = @"principalId", + PossibleTypes = new [] { typeof(string) })] + string ServicePrincipalId { get; set; } + /// The password of the service principal. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The password of the service principal.", + SerializedName = @"password", + PossibleTypes = new [] { typeof(System.Security.SecureString) })] + System.Security.SecureString ServicePrincipalPassword { get; set; } + /// + /// The tenant ID, also known as the directory ID, of the tenant in which the service principal is created. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The tenant ID, also known as the directory ID, of the tenant in which the service principal is created.", + SerializedName = @"tenantId", + PossibleTypes = new [] { typeof(string) })] + string ServicePrincipalTenantId { get; set; } + /// The support end date of the runtime version of the cluster. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The support end date of the runtime version of the cluster.", + SerializedName = @"supportExpiryDate", + PossibleTypes = new [] { typeof(string) })] + string SupportExpiryDate { get; } + /// + /// The maximum number of worker nodes that can be offline within the increment of update, e.g., rack-by-rack. + /// Limited by the maximum number of machines in the increment. Defaults to the whole increment size. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The maximum number of worker nodes that can be offline within the increment of update, e.g., rack-by-rack. + Limited by the maximum number of machines in the increment. Defaults to the whole increment size.", + SerializedName = @"maxUnavailable", + PossibleTypes = new [] { typeof(long) })] + long? UpdateStrategyMaxUnavailable { get; set; } + /// Selection of how the threshold should be evaluated. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"Selection of how the threshold should be evaluated.", + SerializedName = @"thresholdType", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("CountSuccess", "PercentSuccess")] + string UpdateStrategyThresholdType { get; set; } + /// The numeric threshold value. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The numeric threshold value.", + SerializedName = @"thresholdValue", + PossibleTypes = new [] { typeof(long) })] + long? UpdateStrategyThresholdValue { get; set; } + /// The mode of operation for runtime protection. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The mode of operation for runtime protection.", + SerializedName = @"strategyType", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Rack", "PauseAfterRack")] + string UpdateStrategyType { get; set; } + /// The time to wait between the increments of update defined by the strategy. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The time to wait between the increments of update defined by the strategy.", + SerializedName = @"waitTimeMinutes", + PossibleTypes = new [] { typeof(long) })] + long? UpdateStrategyWaitTimeMinute { get; set; } + /// The current runtime version of the cluster. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The current runtime version of the cluster.", + SerializedName = @"clusterVersion", + PossibleTypes = new [] { typeof(string) })] + string Version { get; set; } + /// The mode selection for container vulnerability scanning. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The mode selection for container vulnerability scanning.", + SerializedName = @"containerScan", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Disabled", "Enabled")] + string VulnerabilityScanningSettingContainerScan { get; set; } + /// The list of workload resource IDs that are hosted within this cluster. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The list of workload resource IDs that are hosted within this cluster.", + SerializedName = @"workloadResourceIds", + PossibleTypes = new [] { typeof(string) })] + System.Collections.Generic.List WorkloadResourceId { get; } + + } + /// Cluster represents the on-premises Network Cloud cluster. + internal partial interface IClusterInternal : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal + { + /// + /// The rack definition that is intended to reflect only a single rack in a single rack cluster, or an aggregator rack in + /// a multi-rack cluster. + /// + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackDefinition AggregatorOrSingleRackDefinition { get; set; } + /// + /// The zone name used for this rack when created. Availability zones are used for workload placement. + /// + string AggregatorOrSingleRackDefinitionAvailabilityZone { get; set; } + /// The unordered list of bare metal machine configuration. + System.Collections.Generic.List AggregatorOrSingleRackDefinitionBareMetalMachineConfigurationData { get; set; } + /// The resource ID of the network rack that matches this rack definition. + string AggregatorOrSingleRackDefinitionNetworkRackId { get; set; } + /// The free-form description of the rack's location. + string AggregatorOrSingleRackDefinitionRackLocation { get; set; } + /// + /// The unique identifier for the rack within Network Cloud cluster. An alternate unique alphanumeric value other than a serial + /// number may be provided if desired. + /// + string AggregatorOrSingleRackDefinitionRackSerialNumber { get; set; } + /// The resource ID of the sku for the rack being added. + string AggregatorOrSingleRackDefinitionRackSkuId { get; set; } + /// The list of storage appliance configuration data for this rack. + System.Collections.Generic.List AggregatorOrSingleRackDefinitionStorageApplianceConfigurationData { get; set; } + /// + /// The resource ID of the analytics workspace that is to be used by the specified identity. + /// + string AnalyticOutputSettingAnalyticsWorkspaceId { get; set; } + /// + /// The selection of the managed identity to use with this analytics workspace. The identity type must be either system assigned + /// or user assigned. + /// + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IIdentitySelector AnalyticOutputSettingAssociatedIdentity { get; set; } + /// + /// The settings for the log analytics workspace used for output of logs from this cluster. + /// + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAnalyticsOutputSettings AnalyticsOutputSetting { get; set; } + /// The type of managed identity that is being selected. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("SystemAssignedIdentity", "UserAssignedIdentity")] + string AnalyticsOutputSettingsAssociatedIdentityType { get; set; } + /// + /// The user assigned managed identity resource ID to use. Mutually exclusive with a system assigned identity type. + /// + string AnalyticsOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId { get; set; } + /// + /// Field Deprecated. The resource ID of the Log Analytics Workspace that will be used for storing relevant logs. + /// + string AnalyticsWorkspaceId { get; set; } + /// The type of managed identity that is being selected. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("SystemAssignedIdentity", "UserAssignedIdentity")] + string AssociatedIdentityType { get; set; } + /// + /// The user assigned managed identity resource ID to use. Mutually exclusive with a system assigned identity type. + /// + string AssociatedIdentityUserAssignedIdentityResourceId { get; set; } + /// The list of cluster runtime version upgrades available for this cluster. + System.Collections.Generic.List AvailableUpgradeVersion { get; set; } + /// The capacity supported by this cluster. + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterCapacity Capacity { get; set; } + /// + /// The remaining appliance-based storage in GB available for workload use. Measured in gibibytes. + /// + long? CapacityAvailableApplianceStorageGb { get; set; } + /// + /// The remaining number of cores that are available in this cluster for workload use. + /// + long? CapacityAvailableCoreCount { get; set; } + /// + /// The remaining machine or host-based storage in GB available for workload use. Measured in gibibytes. + /// + long? CapacityAvailableHostStorageGb { get; set; } + /// + /// The remaining memory in GB that are available in this cluster for workload use. Measured in gibibytes. + /// + long? CapacityAvailableMemoryGb { get; set; } + /// + /// The total appliance-based storage in GB supported by this cluster for workload use. Measured in gibibytes. + /// + long? CapacityTotalApplianceStorageGb { get; set; } + /// The total number of cores that are supported by this cluster for workload use. + long? CapacityTotalCoreCount { get; set; } + /// + /// The total machine or host-based storage in GB supported by this cluster for workload use. Measured in gibibytes. + /// + long? CapacityTotalHostStorageGb { get; set; } + /// + /// The total memory supported by this cluster for workload use. Measured in gibibytes. + /// + long? CapacityTotalMemoryGb { get; set; } + /// + /// The extended location (custom location) that represents the cluster's control plane location. This extended location is + /// used to route the requests of child objects of the cluster that are handled by the platform operator. + /// + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocation ClusterExtendedLocation { get; set; } + /// The resource ID of the extended location on which the resource will be created. + string ClusterExtendedLocationName { get; set; } + /// The extended location type, for example, CustomLocation. + string ClusterExtendedLocationType { get; set; } + /// + /// The customer-provided location information to identify where the cluster resides. + /// + string ClusterLocation { get; set; } + /// The type of rack configuration for the cluster. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("SingleRack", "MultiRack")] + string ClusterType { get; set; } + /// + /// The settings for commands run in this cluster, such as bare metal machine run read only commands and data extracts. + /// + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICommandOutputSettings CommandOutputSetting { get; set; } + /// + /// The selection of the managed identity to use with this storage account container. The identity type must be either system + /// assigned or user assigned. + /// + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IIdentitySelector CommandOutputSettingAssociatedIdentity { get; set; } + /// + /// The URL of the storage account container that is to be used by the specified identities. + /// + string CommandOutputSettingContainerUrl { get; set; } + /// + /// The validation threshold indicating the allowable failures of compute machines during environment validation and deployment. + /// + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IValidationThreshold ComputeDeploymentThreshold { get; set; } + /// Selection of how the type evaluation is applied to the cluster calculation. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("PerCluster", "PerRack")] + string ComputeDeploymentThresholdGrouping { get; set; } + /// Selection of how the threshold should be evaluated. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("CountSuccess", "PercentSuccess")] + string ComputeDeploymentThresholdType { get; set; } + /// The numeric threshold value. + long? ComputeDeploymentThresholdValue { get; set; } + /// + /// The list of rack definitions for the compute racks in a multi-rack cluster, or an empty list in a single-rack cluster. + /// + System.Collections.Generic.List ComputeRackDefinition { get; set; } + /// The latest heartbeat status between the cluster manager and the cluster. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Connected", "Disconnected", "Timeout", "Undefined")] + string ConnectionStatus { get; set; } + /// The current detailed status of the cluster. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("PendingDeployment", "Deploying", "Running", "Updating", "UpdatePaused", "Degraded", "Deleting", "Disconnected", "Failed")] + string DetailedStatus { get; set; } + /// The descriptive message about the detailed status. + string DetailedStatusMessage { get; set; } + /// Resource ETag. + string Etag { get; set; } + /// The extended location of the cluster manager associated with the cluster. + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocation ExtendedLocation { get; set; } + /// The resource ID of the extended location on which the resource will be created. + string ExtendedLocationName { get; set; } + /// The extended location type, for example, CustomLocation. + string ExtendedLocationType { get; set; } + /// The resource ID of the extended location on which the resource will be created. + string HybridAkExtendedLocationName { get; set; } + /// The extended location type, for example, CustomLocation. + string HybridAkExtendedLocationType { get; set; } + /// + /// Field Deprecated. This field will not be populated in an upcoming version. The extended location (custom location) that + /// represents the Hybrid AKS control plane location. This extended location is used when creating provisioned clusters (Hybrid + /// AKS clusters). + /// + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocation HybridAksExtendedLocation { get; set; } + /// The identity for the resource. + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IManagedServiceIdentity Identity { get; set; } + /// + /// The service principal ID of the system assigned identity. This property will only be provided for a system assigned identity. + /// + string IdentityPrincipalId { get; set; } + /// + /// The tenant ID of the system assigned identity. This property will only be provided for a system assigned identity. + /// + string IdentityTenantId { get; set; } + /// + /// Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.IUserAssignedIdentities IdentityUserAssignedIdentity { get; set; } + /// The configuration of the managed resource group associated with the resource. + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IManagedResourceGroupConfiguration ManagedResourceGroupConfiguration { get; set; } + /// + /// The location of the managed resource group. If not specified, the location of the parent resource is chosen. + /// + string ManagedResourceGroupConfigurationLocation { get; set; } + /// + /// The name for the managed resource group. If not specified, the unique name is automatically generated. + /// + string ManagedResourceGroupConfigurationName { get; set; } + /// The latest connectivity status between cluster manager and the cluster. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Connected", "Unreachable")] + string ManagerConnectionStatus { get; set; } + /// + /// The resource ID of the cluster manager that manages this cluster. This is set by the Cluster Manager when the cluster + /// is created. + /// + string ManagerId { get; set; } + /// The count of Manual Action Taken (MAT) events that have not been validated. + long? ManualActionCount { get; set; } + /// The resource ID of the Network Fabric associated with the cluster. + string NetworkFabricId { get; set; } + /// The list of the resource properties. + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterProperties Property { get; set; } + /// The provisioning state of the cluster. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Succeeded", "Failed", "Canceled", "Accepted", "Validating", "Updating")] + string ProvisioningState { get; set; } + /// The settings for cluster runtime protection. + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRuntimeProtectionConfiguration RuntimeProtectionConfiguration { get; set; } + /// The mode of operation for runtime protection. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Audit", "Disabled", "OnDemand", "Passive", "RealTime")] + string RuntimeProtectionConfigurationEnforcementLevel { get; set; } + /// + /// The configuration for use of a key vault to store secrets for later retrieval by the operator. + /// + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterSecretArchive SecretArchive { get; set; } + /// The resource ID of the key vault to archive the secrets of the cluster. + string SecretArchiveKeyVaultId { get; set; } + /// The settings for the secret archive used to hold credentials for the cluster. + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISecretArchiveSettings SecretArchiveSetting { get; set; } + /// + /// The selection of the managed identity to use with this vault URI. The identity type must be either system assigned or + /// user assigned. + /// + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IIdentitySelector SecretArchiveSettingAssociatedIdentity { get; set; } + /// The URI for the key vault used as the secret archive. + string SecretArchiveSettingVaultUri { get; set; } + /// The type of managed identity that is being selected. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("SystemAssignedIdentity", "UserAssignedIdentity")] + string SecretArchiveSettingsAssociatedIdentityType { get; set; } + /// + /// The user assigned managed identity resource ID to use. Mutually exclusive with a system assigned identity type. + /// + string SecretArchiveSettingsAssociatedIdentityUserAssignedIdentityResourceId { get; set; } + /// + /// The indicator if the specified key vault should be used to archive the secrets of the cluster. + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("True", "False")] + string SecretArchiveUseKeyVault { get; set; } + /// + /// The service principal to be used by the cluster during Arc Appliance installation. + /// + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IServicePrincipalInformation ServicePrincipal { get; set; } + /// The application ID, also known as client ID, of the service principal. + string ServicePrincipalApplicationId { get; set; } + /// The principal ID, also known as the object ID, of the service principal. + string ServicePrincipalId { get; set; } + /// The password of the service principal. + System.Security.SecureString ServicePrincipalPassword { get; set; } + /// + /// The tenant ID, also known as the directory ID, of the tenant in which the service principal is created. + /// + string ServicePrincipalTenantId { get; set; } + /// The support end date of the runtime version of the cluster. + string SupportExpiryDate { get; set; } + /// The strategy for updating the cluster. + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterUpdateStrategy UpdateStrategy { get; set; } + /// + /// The maximum number of worker nodes that can be offline within the increment of update, e.g., rack-by-rack. + /// Limited by the maximum number of machines in the increment. Defaults to the whole increment size. + /// + long? UpdateStrategyMaxUnavailable { get; set; } + /// Selection of how the threshold should be evaluated. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("CountSuccess", "PercentSuccess")] + string UpdateStrategyThresholdType { get; set; } + /// The numeric threshold value. + long? UpdateStrategyThresholdValue { get; set; } + /// The mode of operation for runtime protection. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Rack", "PauseAfterRack")] + string UpdateStrategyType { get; set; } + /// The time to wait between the increments of update defined by the strategy. + long? UpdateStrategyWaitTimeMinute { get; set; } + /// The current runtime version of the cluster. + string Version { get; set; } + /// The settings for how security vulnerability scanning is applied to the cluster. + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVulnerabilityScanningSettings VulnerabilityScanningSetting { get; set; } + /// The mode selection for container vulnerability scanning. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Disabled", "Enabled")] + string VulnerabilityScanningSettingContainerScan { get; set; } + /// The list of workload resource IDs that are hosted within this cluster. + System.Collections.Generic.List WorkloadResourceId { get; set; } + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/Cluster.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Cluster.json.cs similarity index 90% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/Cluster.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Cluster.json.cs index 90e31c75fbea..73d9807a7836 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/Cluster.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Cluster.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -65,22 +65,20 @@ internal Cluster(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.Js { return; } - __trackedResource = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.TrackedResource(json); - {_extendedLocation = If( json?.PropertyT("extendedLocation"), out var __jsonExtendedLocation) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ExtendedLocation.FromJson(__jsonExtendedLocation) : ExtendedLocation;} - {_identity = If( json?.PropertyT("identity"), out var __jsonIdentity) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ManagedServiceIdentity.FromJson(__jsonIdentity) : Identity;} - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ClusterProperties.FromJson(__jsonProperties) : Property;} - {_etag = If( json?.PropertyT("etag"), out var __jsonEtag) ? (string)__jsonEtag : (string)Etag;} + __trackedResource = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.TrackedResource(json); + {_extendedLocation = If( json?.PropertyT("extendedLocation"), out var __jsonExtendedLocation) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ExtendedLocation.FromJson(__jsonExtendedLocation) : _extendedLocation;} + {_identity = If( json?.PropertyT("identity"), out var __jsonIdentity) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ManagedServiceIdentity.FromJson(__jsonIdentity) : _identity;} + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterProperties.FromJson(__jsonProperties) : _property;} + {_etag = If( json?.PropertyT("etag"), out var __jsonEtag) ? (string)__jsonEtag : (string)_etag;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICluster. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICluster. /// /// a to deserialize from. - /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICluster. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICluster FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICluster. + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICluster FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new Cluster(json) : null; } @@ -108,7 +106,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode ToJ AddIf( null != this._extendedLocation ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) this._extendedLocation.ToJson(null,serializationMode) : null, "extendedLocation" ,container.Add ); AddIf( null != this._identity ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) this._identity.ToJson(null,serializationMode) : null, "identity" ,container.Add ); AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._etag)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._etag.ToString()) : null, "etag" ,container.Add ); } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterAvailableUpgradeVersion.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterAvailableUpgradeVersion.PowerShell.cs new file mode 100644 index 000000000000..cd9b630c29e1 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterAvailableUpgradeVersion.PowerShell.cs @@ -0,0 +1,206 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + + /// + /// ClusterAvailableUpgradeVersion represents the various cluster upgrade parameters. + /// + [System.ComponentModel.TypeConverter(typeof(ClusterAvailableUpgradeVersionTypeConverter))] + public partial class ClusterAvailableUpgradeVersion + { + + /// + /// 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 ClusterAvailableUpgradeVersion(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ControlImpact")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterAvailableUpgradeVersionInternal)this).ControlImpact = (string) content.GetValueForProperty("ControlImpact",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterAvailableUpgradeVersionInternal)this).ControlImpact, global::System.Convert.ToString); + } + if (content.Contains("ExpectedDuration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterAvailableUpgradeVersionInternal)this).ExpectedDuration = (string) content.GetValueForProperty("ExpectedDuration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterAvailableUpgradeVersionInternal)this).ExpectedDuration, global::System.Convert.ToString); + } + if (content.Contains("ImpactDescription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterAvailableUpgradeVersionInternal)this).ImpactDescription = (string) content.GetValueForProperty("ImpactDescription",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterAvailableUpgradeVersionInternal)this).ImpactDescription, global::System.Convert.ToString); + } + if (content.Contains("SupportExpiryDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterAvailableUpgradeVersionInternal)this).SupportExpiryDate = (string) content.GetValueForProperty("SupportExpiryDate",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterAvailableUpgradeVersionInternal)this).SupportExpiryDate, global::System.Convert.ToString); + } + if (content.Contains("TargetClusterVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterAvailableUpgradeVersionInternal)this).TargetClusterVersion = (string) content.GetValueForProperty("TargetClusterVersion",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterAvailableUpgradeVersionInternal)this).TargetClusterVersion, global::System.Convert.ToString); + } + if (content.Contains("WorkloadImpact")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterAvailableUpgradeVersionInternal)this).WorkloadImpact = (string) content.GetValueForProperty("WorkloadImpact",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterAvailableUpgradeVersionInternal)this).WorkloadImpact, 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 ClusterAvailableUpgradeVersion(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ControlImpact")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterAvailableUpgradeVersionInternal)this).ControlImpact = (string) content.GetValueForProperty("ControlImpact",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterAvailableUpgradeVersionInternal)this).ControlImpact, global::System.Convert.ToString); + } + if (content.Contains("ExpectedDuration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterAvailableUpgradeVersionInternal)this).ExpectedDuration = (string) content.GetValueForProperty("ExpectedDuration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterAvailableUpgradeVersionInternal)this).ExpectedDuration, global::System.Convert.ToString); + } + if (content.Contains("ImpactDescription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterAvailableUpgradeVersionInternal)this).ImpactDescription = (string) content.GetValueForProperty("ImpactDescription",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterAvailableUpgradeVersionInternal)this).ImpactDescription, global::System.Convert.ToString); + } + if (content.Contains("SupportExpiryDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterAvailableUpgradeVersionInternal)this).SupportExpiryDate = (string) content.GetValueForProperty("SupportExpiryDate",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterAvailableUpgradeVersionInternal)this).SupportExpiryDate, global::System.Convert.ToString); + } + if (content.Contains("TargetClusterVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterAvailableUpgradeVersionInternal)this).TargetClusterVersion = (string) content.GetValueForProperty("TargetClusterVersion",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterAvailableUpgradeVersionInternal)this).TargetClusterVersion, global::System.Convert.ToString); + } + if (content.Contains("WorkloadImpact")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterAvailableUpgradeVersionInternal)this).WorkloadImpact = (string) content.GetValueForProperty("WorkloadImpact",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterAvailableUpgradeVersionInternal)this).WorkloadImpact, 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.NetworkCloud.Models.IClusterAvailableUpgradeVersion DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ClusterAvailableUpgradeVersion(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.NetworkCloud.Models.IClusterAvailableUpgradeVersion DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ClusterAvailableUpgradeVersion(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.NetworkCloud.Models.IClusterAvailableUpgradeVersion FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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(); + } + } + /// ClusterAvailableUpgradeVersion represents the various cluster upgrade parameters. + [System.ComponentModel.TypeConverter(typeof(ClusterAvailableUpgradeVersionTypeConverter))] + public partial interface IClusterAvailableUpgradeVersion + + { + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterAvailableUpgradeVersion.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterAvailableUpgradeVersion.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterAvailableUpgradeVersion.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterAvailableUpgradeVersion.TypeConverter.cs index 06469601eb4b..60323c253a18 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterAvailableUpgradeVersion.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterAvailableUpgradeVersion.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IClusterAvailableUpgradeVersion ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterAvailableUpgradeVersion ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterAvailableUpgradeVersion).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterAvailableUpgradeVersion).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterAvailableUpgradeVersion.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterAvailableUpgradeVersion.cs similarity index 75% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterAvailableUpgradeVersion.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterAvailableUpgradeVersion.cs index 0a910aeb1e6a..1aa01b5167c7 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterAvailableUpgradeVersion.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterAvailableUpgradeVersion.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -11,16 +11,16 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201 /// ClusterAvailableUpgradeVersion represents the various cluster upgrade parameters. /// public partial class ClusterAvailableUpgradeVersion : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterAvailableUpgradeVersion, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterAvailableUpgradeVersionInternal + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterAvailableUpgradeVersion, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterAvailableUpgradeVersionInternal { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ControlImpact? _controlImpact; + private string _controlImpact; /// The indicator of whether the control plane will be impacted during the upgrade. [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ControlImpact? ControlImpact { get => this._controlImpact; } + public string ControlImpact { get => this._controlImpact; } /// Backing field for property. private string _expectedDuration; @@ -37,22 +37,22 @@ public partial class ClusterAvailableUpgradeVersion : public string ImpactDescription { get => this._impactDescription; } /// Internal Acessors for ControlImpact - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ControlImpact? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterAvailableUpgradeVersionInternal.ControlImpact { get => this._controlImpact; set { {_controlImpact = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterAvailableUpgradeVersionInternal.ControlImpact { get => this._controlImpact; set { {_controlImpact = value;} } } /// Internal Acessors for ExpectedDuration - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterAvailableUpgradeVersionInternal.ExpectedDuration { get => this._expectedDuration; set { {_expectedDuration = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterAvailableUpgradeVersionInternal.ExpectedDuration { get => this._expectedDuration; set { {_expectedDuration = value;} } } /// Internal Acessors for ImpactDescription - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterAvailableUpgradeVersionInternal.ImpactDescription { get => this._impactDescription; set { {_impactDescription = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterAvailableUpgradeVersionInternal.ImpactDescription { get => this._impactDescription; set { {_impactDescription = value;} } } /// Internal Acessors for SupportExpiryDate - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterAvailableUpgradeVersionInternal.SupportExpiryDate { get => this._supportExpiryDate; set { {_supportExpiryDate = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterAvailableUpgradeVersionInternal.SupportExpiryDate { get => this._supportExpiryDate; set { {_supportExpiryDate = value;} } } /// Internal Acessors for TargetClusterVersion - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterAvailableUpgradeVersionInternal.TargetClusterVersion { get => this._targetClusterVersion; set { {_targetClusterVersion = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterAvailableUpgradeVersionInternal.TargetClusterVersion { get => this._targetClusterVersion; set { {_targetClusterVersion = value;} } } /// Internal Acessors for WorkloadImpact - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.WorkloadImpact? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterAvailableUpgradeVersionInternal.WorkloadImpact { get => this._workloadImpact; set { {_workloadImpact = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterAvailableUpgradeVersionInternal.WorkloadImpact { get => this._workloadImpact; set { {_workloadImpact = value;} } } /// Backing field for property. private string _supportExpiryDate; @@ -69,11 +69,11 @@ public partial class ClusterAvailableUpgradeVersion : public string TargetClusterVersion { get => this._targetClusterVersion; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.WorkloadImpact? _workloadImpact; + private string _workloadImpact; /// The indicator of whether the workload will be impacted during the upgrade. [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.WorkloadImpact? WorkloadImpact { get => this._workloadImpact; } + public string WorkloadImpact { get => this._workloadImpact; } /// Creates an new instance. public ClusterAvailableUpgradeVersion() @@ -89,14 +89,21 @@ public partial interface IClusterAvailableUpgradeVersion : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The indicator of whether the control plane will be impacted during the upgrade.", SerializedName = @"controlImpact", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ControlImpact) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ControlImpact? ControlImpact { get; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("True", "False")] + string ControlImpact { get; } /// The expected duration needed for this upgrade. [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The expected duration needed for this upgrade.", SerializedName = @"expectedDuration", PossibleTypes = new [] { typeof(string) })] @@ -105,6 +112,9 @@ public partial interface IClusterAvailableUpgradeVersion : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The impact description including the specific details and release notes.", SerializedName = @"impactDescription", PossibleTypes = new [] { typeof(string) })] @@ -113,6 +123,9 @@ public partial interface IClusterAvailableUpgradeVersion : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The last date the version of the platform is supported.", SerializedName = @"supportExpiryDate", PossibleTypes = new [] { typeof(string) })] @@ -121,6 +134,9 @@ public partial interface IClusterAvailableUpgradeVersion : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The target version this cluster will be upgraded to.", SerializedName = @"targetClusterVersion", PossibleTypes = new [] { typeof(string) })] @@ -129,10 +145,14 @@ public partial interface IClusterAvailableUpgradeVersion : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The indicator of whether the workload will be impacted during the upgrade.", SerializedName = @"workloadImpact", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.WorkloadImpact) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.WorkloadImpact? WorkloadImpact { get; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("True", "False")] + string WorkloadImpact { get; } } /// ClusterAvailableUpgradeVersion represents the various cluster upgrade parameters. @@ -140,7 +160,8 @@ internal partial interface IClusterAvailableUpgradeVersionInternal { /// The indicator of whether the control plane will be impacted during the upgrade. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ControlImpact? ControlImpact { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("True", "False")] + string ControlImpact { get; set; } /// The expected duration needed for this upgrade. string ExpectedDuration { get; set; } /// The impact description including the specific details and release notes. @@ -150,7 +171,8 @@ internal partial interface IClusterAvailableUpgradeVersionInternal /// The target version this cluster will be upgraded to. string TargetClusterVersion { get; set; } /// The indicator of whether the workload will be impacted during the upgrade. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.WorkloadImpact? WorkloadImpact { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("True", "False")] + string WorkloadImpact { get; set; } } } \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterAvailableUpgradeVersion.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterAvailableUpgradeVersion.json.cs similarity index 90% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterAvailableUpgradeVersion.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterAvailableUpgradeVersion.json.cs index 8c0631547215..6cba95ca2283 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterAvailableUpgradeVersion.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterAvailableUpgradeVersion.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -67,23 +67,23 @@ internal ClusterAvailableUpgradeVersion(Microsoft.Azure.PowerShell.Cmdlets.Netwo { return; } - {_controlImpact = If( json?.PropertyT("controlImpact"), out var __jsonControlImpact) ? (string)__jsonControlImpact : (string)ControlImpact;} - {_expectedDuration = If( json?.PropertyT("expectedDuration"), out var __jsonExpectedDuration) ? (string)__jsonExpectedDuration : (string)ExpectedDuration;} - {_impactDescription = If( json?.PropertyT("impactDescription"), out var __jsonImpactDescription) ? (string)__jsonImpactDescription : (string)ImpactDescription;} - {_supportExpiryDate = If( json?.PropertyT("supportExpiryDate"), out var __jsonSupportExpiryDate) ? (string)__jsonSupportExpiryDate : (string)SupportExpiryDate;} - {_targetClusterVersion = If( json?.PropertyT("targetClusterVersion"), out var __jsonTargetClusterVersion) ? (string)__jsonTargetClusterVersion : (string)TargetClusterVersion;} - {_workloadImpact = If( json?.PropertyT("workloadImpact"), out var __jsonWorkloadImpact) ? (string)__jsonWorkloadImpact : (string)WorkloadImpact;} + {_controlImpact = If( json?.PropertyT("controlImpact"), out var __jsonControlImpact) ? (string)__jsonControlImpact : (string)_controlImpact;} + {_expectedDuration = If( json?.PropertyT("expectedDuration"), out var __jsonExpectedDuration) ? (string)__jsonExpectedDuration : (string)_expectedDuration;} + {_impactDescription = If( json?.PropertyT("impactDescription"), out var __jsonImpactDescription) ? (string)__jsonImpactDescription : (string)_impactDescription;} + {_supportExpiryDate = If( json?.PropertyT("supportExpiryDate"), out var __jsonSupportExpiryDate) ? (string)__jsonSupportExpiryDate : (string)_supportExpiryDate;} + {_targetClusterVersion = If( json?.PropertyT("targetClusterVersion"), out var __jsonTargetClusterVersion) ? (string)__jsonTargetClusterVersion : (string)_targetClusterVersion;} + {_workloadImpact = If( json?.PropertyT("workloadImpact"), out var __jsonWorkloadImpact) ? (string)__jsonWorkloadImpact : (string)_workloadImpact;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterAvailableUpgradeVersion. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterAvailableUpgradeVersion. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterAvailableUpgradeVersion. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterAvailableUpgradeVersion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterAvailableUpgradeVersion FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterAvailableUpgradeVersion FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new ClusterAvailableUpgradeVersion(json) : null; } @@ -107,27 +107,27 @@ public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode ToJ { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._controlImpact)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._controlImpact.ToString()) : null, "controlImpact" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._expectedDuration)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._expectedDuration.ToString()) : null, "expectedDuration" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._impactDescription)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._impactDescription.ToString()) : null, "impactDescription" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._supportExpiryDate)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._supportExpiryDate.ToString()) : null, "supportExpiryDate" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._targetClusterVersion)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._targetClusterVersion.ToString()) : null, "targetClusterVersion" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._workloadImpact)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._workloadImpact.ToString()) : null, "workloadImpact" ,container.Add ); } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterAvailableVersion.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterAvailableVersion.PowerShell.cs similarity index 79% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterAvailableVersion.PowerShell.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterAvailableVersion.PowerShell.cs index de6a26d2be6b..b45252913a2e 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterAvailableVersion.PowerShell.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterAvailableVersion.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; @@ -65,7 +65,7 @@ public partial class ClusterAvailableVersion 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,17 +80,17 @@ internal ClusterAvailableVersion(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("SupportExpiryDate")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterAvailableVersionInternal)this).SupportExpiryDate = (string) content.GetValueForProperty("SupportExpiryDate",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterAvailableVersionInternal)this).SupportExpiryDate, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterAvailableVersionInternal)this).SupportExpiryDate = (string) content.GetValueForProperty("SupportExpiryDate",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterAvailableVersionInternal)this).SupportExpiryDate, global::System.Convert.ToString); } if (content.Contains("TargetClusterVersion")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterAvailableVersionInternal)this).TargetClusterVersion = (string) content.GetValueForProperty("TargetClusterVersion",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterAvailableVersionInternal)this).TargetClusterVersion, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterAvailableVersionInternal)this).TargetClusterVersion = (string) content.GetValueForProperty("TargetClusterVersion",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterAvailableVersionInternal)this).TargetClusterVersion, 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. @@ -105,39 +105,37 @@ internal ClusterAvailableVersion(global::System.Management.Automation.PSObject c // actually deserialize if (content.Contains("SupportExpiryDate")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterAvailableVersionInternal)this).SupportExpiryDate = (string) content.GetValueForProperty("SupportExpiryDate",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterAvailableVersionInternal)this).SupportExpiryDate, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterAvailableVersionInternal)this).SupportExpiryDate = (string) content.GetValueForProperty("SupportExpiryDate",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterAvailableVersionInternal)this).SupportExpiryDate, global::System.Convert.ToString); } if (content.Contains("TargetClusterVersion")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterAvailableVersionInternal)this).TargetClusterVersion = (string) content.GetValueForProperty("TargetClusterVersion",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterAvailableVersionInternal)this).TargetClusterVersion, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterAvailableVersionInternal)this).TargetClusterVersion = (string) content.GetValueForProperty("TargetClusterVersion",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterAvailableVersionInternal)this).TargetClusterVersion, 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.NetworkCloud.Models.Api20250201.IClusterAvailableVersion DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterAvailableVersion DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ClusterAvailableVersion(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.NetworkCloud.Models.Api20250201.IClusterAvailableVersion DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterAvailableVersion DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ClusterAvailableVersion(content); } @@ -147,7 +145,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterAvailableVersion FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterAvailableVersion FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterAvailableVersion.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterAvailableVersion.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterAvailableVersion.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterAvailableVersion.TypeConverter.cs index b9edd2c79c5e..56fcfaf1120d 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterAvailableVersion.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterAvailableVersion.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IClusterAvailableVersion ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterAvailableVersion ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterAvailableVersion).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterAvailableVersion).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterAvailableVersion.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterAvailableVersion.cs similarity index 85% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterAvailableVersion.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterAvailableVersion.cs index c6b6bd42a357..f992cc76e2fe 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterAvailableVersion.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterAvailableVersion.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -11,15 +11,15 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201 /// ClusterAvailableVersion represents the cluster version that the cluster manager can be asked to create and manage. /// public partial class ClusterAvailableVersion : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterAvailableVersion, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterAvailableVersionInternal + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterAvailableVersion, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterAvailableVersionInternal { /// Internal Acessors for SupportExpiryDate - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterAvailableVersionInternal.SupportExpiryDate { get => this._supportExpiryDate; set { {_supportExpiryDate = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterAvailableVersionInternal.SupportExpiryDate { get => this._supportExpiryDate; set { {_supportExpiryDate = value;} } } /// Internal Acessors for TargetClusterVersion - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterAvailableVersionInternal.TargetClusterVersion { get => this._targetClusterVersion; set { {_targetClusterVersion = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterAvailableVersionInternal.TargetClusterVersion { get => this._targetClusterVersion; set { {_targetClusterVersion = value;} } } /// Backing field for property. private string _supportExpiryDate; @@ -49,6 +49,9 @@ public partial interface IClusterAvailableVersion : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The last date the version of the platform is supported.", SerializedName = @"supportExpiryDate", PossibleTypes = new [] { typeof(string) })] @@ -57,6 +60,9 @@ public partial interface IClusterAvailableVersion : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The version of the cluster to be deployed.", SerializedName = @"targetClusterVersion", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterAvailableVersion.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterAvailableVersion.json.cs similarity index 93% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterAvailableVersion.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterAvailableVersion.json.cs index 62d1bed09da2..efcca251b86e 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterAvailableVersion.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterAvailableVersion.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -67,19 +67,19 @@ internal ClusterAvailableVersion(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud { return; } - {_supportExpiryDate = If( json?.PropertyT("supportExpiryDate"), out var __jsonSupportExpiryDate) ? (string)__jsonSupportExpiryDate : (string)SupportExpiryDate;} - {_targetClusterVersion = If( json?.PropertyT("targetClusterVersion"), out var __jsonTargetClusterVersion) ? (string)__jsonTargetClusterVersion : (string)TargetClusterVersion;} + {_supportExpiryDate = If( json?.PropertyT("supportExpiryDate"), out var __jsonSupportExpiryDate) ? (string)__jsonSupportExpiryDate : (string)_supportExpiryDate;} + {_targetClusterVersion = If( json?.PropertyT("targetClusterVersion"), out var __jsonTargetClusterVersion) ? (string)__jsonTargetClusterVersion : (string)_targetClusterVersion;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterAvailableVersion. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterAvailableVersion. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterAvailableVersion. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterAvailableVersion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterAvailableVersion FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterAvailableVersion FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new ClusterAvailableVersion(json) : null; } @@ -103,11 +103,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode ToJ { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._supportExpiryDate)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._supportExpiryDate.ToString()) : null, "supportExpiryDate" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._targetClusterVersion)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._targetClusterVersion.ToString()) : null, "targetClusterVersion" ,container.Add ); } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterCapacity.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterCapacity.PowerShell.cs new file mode 100644 index 000000000000..c9a04f73c297 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterCapacity.PowerShell.cs @@ -0,0 +1,220 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + + /// ClusterCapacity represents various details regarding compute capacity. + [System.ComponentModel.TypeConverter(typeof(ClusterCapacityTypeConverter))] + public partial class ClusterCapacity + { + + /// + /// 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 ClusterCapacity(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("AvailableApplianceStorageGb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterCapacityInternal)this).AvailableApplianceStorageGb = (long?) content.GetValueForProperty("AvailableApplianceStorageGb",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterCapacityInternal)this).AvailableApplianceStorageGb, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("AvailableCoreCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterCapacityInternal)this).AvailableCoreCount = (long?) content.GetValueForProperty("AvailableCoreCount",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterCapacityInternal)this).AvailableCoreCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("AvailableHostStorageGb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterCapacityInternal)this).AvailableHostStorageGb = (long?) content.GetValueForProperty("AvailableHostStorageGb",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterCapacityInternal)this).AvailableHostStorageGb, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("AvailableMemoryGb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterCapacityInternal)this).AvailableMemoryGb = (long?) content.GetValueForProperty("AvailableMemoryGb",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterCapacityInternal)this).AvailableMemoryGb, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("TotalApplianceStorageGb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterCapacityInternal)this).TotalApplianceStorageGb = (long?) content.GetValueForProperty("TotalApplianceStorageGb",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterCapacityInternal)this).TotalApplianceStorageGb, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("TotalCoreCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterCapacityInternal)this).TotalCoreCount = (long?) content.GetValueForProperty("TotalCoreCount",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterCapacityInternal)this).TotalCoreCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("TotalHostStorageGb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterCapacityInternal)this).TotalHostStorageGb = (long?) content.GetValueForProperty("TotalHostStorageGb",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterCapacityInternal)this).TotalHostStorageGb, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("TotalMemoryGb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterCapacityInternal)this).TotalMemoryGb = (long?) content.GetValueForProperty("TotalMemoryGb",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterCapacityInternal)this).TotalMemoryGb, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ClusterCapacity(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("AvailableApplianceStorageGb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterCapacityInternal)this).AvailableApplianceStorageGb = (long?) content.GetValueForProperty("AvailableApplianceStorageGb",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterCapacityInternal)this).AvailableApplianceStorageGb, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("AvailableCoreCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterCapacityInternal)this).AvailableCoreCount = (long?) content.GetValueForProperty("AvailableCoreCount",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterCapacityInternal)this).AvailableCoreCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("AvailableHostStorageGb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterCapacityInternal)this).AvailableHostStorageGb = (long?) content.GetValueForProperty("AvailableHostStorageGb",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterCapacityInternal)this).AvailableHostStorageGb, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("AvailableMemoryGb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterCapacityInternal)this).AvailableMemoryGb = (long?) content.GetValueForProperty("AvailableMemoryGb",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterCapacityInternal)this).AvailableMemoryGb, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("TotalApplianceStorageGb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterCapacityInternal)this).TotalApplianceStorageGb = (long?) content.GetValueForProperty("TotalApplianceStorageGb",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterCapacityInternal)this).TotalApplianceStorageGb, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("TotalCoreCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterCapacityInternal)this).TotalCoreCount = (long?) content.GetValueForProperty("TotalCoreCount",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterCapacityInternal)this).TotalCoreCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("TotalHostStorageGb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterCapacityInternal)this).TotalHostStorageGb = (long?) content.GetValueForProperty("TotalHostStorageGb",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterCapacityInternal)this).TotalHostStorageGb, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("TotalMemoryGb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterCapacityInternal)this).TotalMemoryGb = (long?) content.GetValueForProperty("TotalMemoryGb",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterCapacityInternal)this).TotalMemoryGb, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + 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.NetworkCloud.Models.IClusterCapacity DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ClusterCapacity(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.NetworkCloud.Models.IClusterCapacity DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ClusterCapacity(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.NetworkCloud.Models.IClusterCapacity FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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(); + } + } + /// ClusterCapacity represents various details regarding compute capacity. + [System.ComponentModel.TypeConverter(typeof(ClusterCapacityTypeConverter))] + public partial interface IClusterCapacity + + { + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterCapacity.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterCapacity.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterCapacity.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterCapacity.TypeConverter.cs index d9354fd4338d..74171d3916cb 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterCapacity.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterCapacity.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IClusterCapacity ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterCapacity ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterCapacity).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterCapacity).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterCapacity.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterCapacity.cs similarity index 94% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterCapacity.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterCapacity.cs index 718354e7190c..4eccc694c4c7 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterCapacity.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterCapacity.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; /// ClusterCapacity represents various details regarding compute capacity. public partial class ClusterCapacity : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterCapacity, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterCapacityInternal + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterCapacity, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterCapacityInternal { /// Backing field for property. @@ -99,6 +99,9 @@ public partial interface IClusterCapacity : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The remaining appliance-based storage in GB available for workload use. Measured in gibibytes.", SerializedName = @"availableApplianceStorageGB", PossibleTypes = new [] { typeof(long) })] @@ -109,6 +112,9 @@ public partial interface IClusterCapacity : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The remaining number of cores that are available in this cluster for workload use.", SerializedName = @"availableCoreCount", PossibleTypes = new [] { typeof(long) })] @@ -119,6 +125,9 @@ public partial interface IClusterCapacity : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The remaining machine or host-based storage in GB available for workload use. Measured in gibibytes.", SerializedName = @"availableHostStorageGB", PossibleTypes = new [] { typeof(long) })] @@ -129,6 +138,9 @@ public partial interface IClusterCapacity : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The remaining memory in GB that are available in this cluster for workload use. Measured in gibibytes.", SerializedName = @"availableMemoryGB", PossibleTypes = new [] { typeof(long) })] @@ -139,6 +151,9 @@ public partial interface IClusterCapacity : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The total appliance-based storage in GB supported by this cluster for workload use. Measured in gibibytes.", SerializedName = @"totalApplianceStorageGB", PossibleTypes = new [] { typeof(long) })] @@ -147,6 +162,9 @@ public partial interface IClusterCapacity : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The total number of cores that are supported by this cluster for workload use.", SerializedName = @"totalCoreCount", PossibleTypes = new [] { typeof(long) })] @@ -157,6 +175,9 @@ public partial interface IClusterCapacity : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The total machine or host-based storage in GB supported by this cluster for workload use. Measured in gibibytes.", SerializedName = @"totalHostStorageGB", PossibleTypes = new [] { typeof(long) })] @@ -167,6 +188,9 @@ public partial interface IClusterCapacity : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The total memory supported by this cluster for workload use. Measured in gibibytes.", SerializedName = @"totalMemoryGB", PossibleTypes = new [] { typeof(long) })] diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterCapacity.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterCapacity.json.cs similarity index 93% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterCapacity.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterCapacity.json.cs index d1233a9096fc..41884c5630da 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterCapacity.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterCapacity.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -65,25 +65,25 @@ internal ClusterCapacity(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime { return; } - {_availableApplianceStorageGb = If( json?.PropertyT("availableApplianceStorageGB"), out var __jsonAvailableApplianceStorageGb) ? (long?)__jsonAvailableApplianceStorageGb : AvailableApplianceStorageGb;} - {_availableCoreCount = If( json?.PropertyT("availableCoreCount"), out var __jsonAvailableCoreCount) ? (long?)__jsonAvailableCoreCount : AvailableCoreCount;} - {_availableHostStorageGb = If( json?.PropertyT("availableHostStorageGB"), out var __jsonAvailableHostStorageGb) ? (long?)__jsonAvailableHostStorageGb : AvailableHostStorageGb;} - {_availableMemoryGb = If( json?.PropertyT("availableMemoryGB"), out var __jsonAvailableMemoryGb) ? (long?)__jsonAvailableMemoryGb : AvailableMemoryGb;} - {_totalApplianceStorageGb = If( json?.PropertyT("totalApplianceStorageGB"), out var __jsonTotalApplianceStorageGb) ? (long?)__jsonTotalApplianceStorageGb : TotalApplianceStorageGb;} - {_totalCoreCount = If( json?.PropertyT("totalCoreCount"), out var __jsonTotalCoreCount) ? (long?)__jsonTotalCoreCount : TotalCoreCount;} - {_totalHostStorageGb = If( json?.PropertyT("totalHostStorageGB"), out var __jsonTotalHostStorageGb) ? (long?)__jsonTotalHostStorageGb : TotalHostStorageGb;} - {_totalMemoryGb = If( json?.PropertyT("totalMemoryGB"), out var __jsonTotalMemoryGb) ? (long?)__jsonTotalMemoryGb : TotalMemoryGb;} + {_availableApplianceStorageGb = If( json?.PropertyT("availableApplianceStorageGB"), out var __jsonAvailableApplianceStorageGb) ? (long?)__jsonAvailableApplianceStorageGb : _availableApplianceStorageGb;} + {_availableCoreCount = If( json?.PropertyT("availableCoreCount"), out var __jsonAvailableCoreCount) ? (long?)__jsonAvailableCoreCount : _availableCoreCount;} + {_availableHostStorageGb = If( json?.PropertyT("availableHostStorageGB"), out var __jsonAvailableHostStorageGb) ? (long?)__jsonAvailableHostStorageGb : _availableHostStorageGb;} + {_availableMemoryGb = If( json?.PropertyT("availableMemoryGB"), out var __jsonAvailableMemoryGb) ? (long?)__jsonAvailableMemoryGb : _availableMemoryGb;} + {_totalApplianceStorageGb = If( json?.PropertyT("totalApplianceStorageGB"), out var __jsonTotalApplianceStorageGb) ? (long?)__jsonTotalApplianceStorageGb : _totalApplianceStorageGb;} + {_totalCoreCount = If( json?.PropertyT("totalCoreCount"), out var __jsonTotalCoreCount) ? (long?)__jsonTotalCoreCount : _totalCoreCount;} + {_totalHostStorageGb = If( json?.PropertyT("totalHostStorageGB"), out var __jsonTotalHostStorageGb) ? (long?)__jsonTotalHostStorageGb : _totalHostStorageGb;} + {_totalMemoryGb = If( json?.PropertyT("totalMemoryGB"), out var __jsonTotalMemoryGb) ? (long?)__jsonTotalMemoryGb : _totalMemoryGb;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterCapacity. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterCapacity. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterCapacity. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterCapacity. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterCapacity FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterCapacity FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new ClusterCapacity(json) : null; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterContinueUpdateVersionParameters.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterContinueUpdateVersionParameters.PowerShell.cs similarity index 79% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterContinueUpdateVersionParameters.PowerShell.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterContinueUpdateVersionParameters.PowerShell.cs index 1aee4aa3d9b7..84fc3cff7627 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterContinueUpdateVersionParameters.PowerShell.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterContinueUpdateVersionParameters.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; @@ -65,7 +65,7 @@ public partial class ClusterContinueUpdateVersionParameters 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 ClusterContinueUpdateVersionParameters(global::System.Collections.IDict // actually deserialize if (content.Contains("MachineGroupTargetingMode")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterContinueUpdateVersionParametersInternal)this).MachineGroupTargetingMode = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterContinueUpdateVersionMachineGroupTargetingMode?) content.GetValueForProperty("MachineGroupTargetingMode",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterContinueUpdateVersionParametersInternal)this).MachineGroupTargetingMode, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterContinueUpdateVersionMachineGroupTargetingMode.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterContinueUpdateVersionParametersInternal)this).MachineGroupTargetingMode = (string) content.GetValueForProperty("MachineGroupTargetingMode",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterContinueUpdateVersionParametersInternal)this).MachineGroupTargetingMode, 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. @@ -101,35 +101,35 @@ internal ClusterContinueUpdateVersionParameters(global::System.Management.Automa // actually deserialize if (content.Contains("MachineGroupTargetingMode")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterContinueUpdateVersionParametersInternal)this).MachineGroupTargetingMode = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterContinueUpdateVersionMachineGroupTargetingMode?) content.GetValueForProperty("MachineGroupTargetingMode",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterContinueUpdateVersionParametersInternal)this).MachineGroupTargetingMode, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterContinueUpdateVersionMachineGroupTargetingMode.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterContinueUpdateVersionParametersInternal)this).MachineGroupTargetingMode = (string) content.GetValueForProperty("MachineGroupTargetingMode",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterContinueUpdateVersionParametersInternal)this).MachineGroupTargetingMode, 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.NetworkCloud.Models.Api20250201.IClusterContinueUpdateVersionParameters DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterContinueUpdateVersionParameters DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ClusterContinueUpdateVersionParameters(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.NetworkCloud.Models.Api20250201.IClusterContinueUpdateVersionParameters DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterContinueUpdateVersionParameters DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ClusterContinueUpdateVersionParameters(content); } @@ -142,7 +142,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201 /// /// an instance of the model class. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterContinueUpdateVersionParameters FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterContinueUpdateVersionParameters FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterContinueUpdateVersionParameters.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterContinueUpdateVersionParameters.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterContinueUpdateVersionParameters.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterContinueUpdateVersionParameters.TypeConverter.cs index c048874449e7..f417d28b92f5 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterContinueUpdateVersionParameters.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterContinueUpdateVersionParameters.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IClusterContinueUpdateVersionParameters ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterContinueUpdateVersionParameters ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterContinueUpdateVersionParameters).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterContinueUpdateVersionParameters).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterContinueUpdateVersionParameters.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterContinueUpdateVersionParameters.cs new file mode 100644 index 000000000000..7e726b11668d --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterContinueUpdateVersionParameters.cs @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + + /// + /// ClusterContinueUpdateVersionParameters represents the body of the request to continue the update of a cluster version. + /// + public partial class ClusterContinueUpdateVersionParameters : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterContinueUpdateVersionParameters, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterContinueUpdateVersionParametersInternal + { + + /// Backing field for property. + private string _machineGroupTargetingMode; + + /// + /// The mode by which the cluster will target the next grouping of servers to continue the update. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string MachineGroupTargetingMode { get => this._machineGroupTargetingMode; set => this._machineGroupTargetingMode = value; } + + /// Creates an new instance. + public ClusterContinueUpdateVersionParameters() + { + + } + } + /// ClusterContinueUpdateVersionParameters represents the body of the request to continue the update of a cluster version. + public partial interface IClusterContinueUpdateVersionParameters : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable + { + /// + /// The mode by which the cluster will target the next grouping of servers to continue the update. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The mode by which the cluster will target the next grouping of servers to continue the update.", + SerializedName = @"machineGroupTargetingMode", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("AlphaByRack")] + string MachineGroupTargetingMode { get; set; } + + } + /// ClusterContinueUpdateVersionParameters represents the body of the request to continue the update of a cluster version. + internal partial interface IClusterContinueUpdateVersionParametersInternal + + { + /// + /// The mode by which the cluster will target the next grouping of servers to continue the update. + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("AlphaByRack")] + string MachineGroupTargetingMode { get; set; } + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterContinueUpdateVersionParameters.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterContinueUpdateVersionParameters.json.cs similarity index 94% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterContinueUpdateVersionParameters.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterContinueUpdateVersionParameters.json.cs index 1197c47a0e2b..2c383ccee907 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterContinueUpdateVersionParameters.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterContinueUpdateVersionParameters.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -67,18 +67,18 @@ internal ClusterContinueUpdateVersionParameters(Microsoft.Azure.PowerShell.Cmdle { return; } - {_machineGroupTargetingMode = If( json?.PropertyT("machineGroupTargetingMode"), out var __jsonMachineGroupTargetingMode) ? (string)__jsonMachineGroupTargetingMode : (string)MachineGroupTargetingMode;} + {_machineGroupTargetingMode = If( json?.PropertyT("machineGroupTargetingMode"), out var __jsonMachineGroupTargetingMode) ? (string)__jsonMachineGroupTargetingMode : (string)_machineGroupTargetingMode;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterContinueUpdateVersionParameters. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterContinueUpdateVersionParameters. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterContinueUpdateVersionParameters. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterContinueUpdateVersionParameters. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterContinueUpdateVersionParameters FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterContinueUpdateVersionParameters FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new ClusterContinueUpdateVersionParameters(json) : null; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterDeployParameters.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterDeployParameters.PowerShell.cs similarity index 82% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterDeployParameters.PowerShell.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterDeployParameters.PowerShell.cs index 6666c2c5178f..4026c374773a 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterDeployParameters.PowerShell.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterDeployParameters.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; @@ -63,7 +63,7 @@ public partial class ClusterDeployParameters 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 ClusterDeployParameters(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("SkipValidationsForMachine")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterDeployParametersInternal)this).SkipValidationsForMachine = (string[]) content.GetValueForProperty("SkipValidationsForMachine",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterDeployParametersInternal)this).SkipValidationsForMachine, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterDeployParametersInternal)this).SkipValidationsForMachine = (System.Collections.Generic.List) content.GetValueForProperty("SkipValidationsForMachine",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterDeployParametersInternal)this).SkipValidationsForMachine, __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. @@ -99,35 +99,33 @@ internal ClusterDeployParameters(global::System.Management.Automation.PSObject c // actually deserialize if (content.Contains("SkipValidationsForMachine")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterDeployParametersInternal)this).SkipValidationsForMachine = (string[]) content.GetValueForProperty("SkipValidationsForMachine",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterDeployParametersInternal)this).SkipValidationsForMachine, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterDeployParametersInternal)this).SkipValidationsForMachine = (System.Collections.Generic.List) content.GetValueForProperty("SkipValidationsForMachine",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterDeployParametersInternal)this).SkipValidationsForMachine, __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.NetworkCloud.Models.Api20250201.IClusterDeployParameters DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterDeployParameters DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ClusterDeployParameters(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.NetworkCloud.Models.Api20250201.IClusterDeployParameters DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterDeployParameters DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ClusterDeployParameters(content); } @@ -137,7 +135,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterDeployParameters FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterDeployParameters FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterDeployParameters.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterDeployParameters.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterDeployParameters.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterDeployParameters.TypeConverter.cs index f10b235cef18..6821452dbe09 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterDeployParameters.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterDeployParameters.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IClusterDeployParameters ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterDeployParameters ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterDeployParameters).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterDeployParameters).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterDeployParameters.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterDeployParameters.cs similarity index 76% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterDeployParameters.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterDeployParameters.cs index e95f3c0bd445..25b4ed90f094 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterDeployParameters.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterDeployParameters.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; /// ClusterDeployParameters represents the body of the request to deploy cluster. public partial class ClusterDeployParameters : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterDeployParameters, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterDeployParametersInternal + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterDeployParameters, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterDeployParametersInternal { /// Backing field for property. - private string[] _skipValidationsForMachine; + private System.Collections.Generic.List _skipValidationsForMachine; /// /// The names of bare metal machines in the cluster that should be skipped during environment validation. /// [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string[] SkipValidationsForMachine { get => this._skipValidationsForMachine; set => this._skipValidationsForMachine = value; } + public System.Collections.Generic.List SkipValidationsForMachine { get => this._skipValidationsForMachine; set => this._skipValidationsForMachine = value; } /// Creates an new instance. public ClusterDeployParameters() @@ -38,10 +38,13 @@ public partial interface IClusterDeployParameters : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The names of bare metal machines in the cluster that should be skipped during environment validation.", SerializedName = @"skipValidationsForMachines", PossibleTypes = new [] { typeof(string) })] - string[] SkipValidationsForMachine { get; set; } + System.Collections.Generic.List SkipValidationsForMachine { get; set; } } /// ClusterDeployParameters represents the body of the request to deploy cluster. @@ -51,7 +54,7 @@ internal partial interface IClusterDeployParametersInternal /// /// The names of bare metal machines in the cluster that should be skipped during environment validation. /// - string[] SkipValidationsForMachine { get; set; } + System.Collections.Generic.List SkipValidationsForMachine { get; set; } } } \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterDeployParameters.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterDeployParameters.json.cs similarity index 92% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterDeployParameters.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterDeployParameters.json.cs index 60a14a5372aa..ccb687f0b587 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterDeployParameters.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterDeployParameters.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -65,18 +65,18 @@ internal ClusterDeployParameters(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud { return; } - {_skipValidationsForMachine = If( json?.PropertyT("skipValidationsForMachines"), out var __jsonSkipValidationsForMachines) ? If( __jsonSkipValidationsForMachines as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : SkipValidationsForMachine;} + {_skipValidationsForMachine = If( json?.PropertyT("skipValidationsForMachines"), out var __jsonSkipValidationsForMachines) ? If( __jsonSkipValidationsForMachines as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : _skipValidationsForMachine;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterDeployParameters. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterDeployParameters. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterDeployParameters. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterDeployParameters. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterDeployParameters FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterDeployParameters FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new ClusterDeployParameters(json) : null; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterList.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterList.PowerShell.cs similarity index 77% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterList.PowerShell.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterList.PowerShell.cs index 60625fdcba4a..4cd9de646e7f 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterList.PowerShell.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterList.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; @@ -63,7 +63,7 @@ public partial class ClusterList 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 ClusterList(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterListInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterListInternal)this).NextLink, global::System.Convert.ToString); } if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICluster[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ClusterTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterListInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterListInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterTypeConverter.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,37 +103,37 @@ internal ClusterList(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterListInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterListInternal)this).NextLink, global::System.Convert.ToString); } if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICluster[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ClusterTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterListInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterListInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterTypeConverter.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.NetworkCloud.Models.Api20250201.IClusterList DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterList DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ClusterList(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.NetworkCloud.Models.Api20250201.IClusterList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ClusterList(content); } @@ -143,7 +143,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterList.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterList.TypeConverter.cs similarity index 98% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterList.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterList.TypeConverter.cs index 6f0fccb51094..4b091edd31dc 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterList.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterList.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IClusterList ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterList ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterList).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterList).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterList.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterList.cs new file mode 100644 index 000000000000..f0114eb00027 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterList.cs @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + + /// ClusterList represents a list of clusters. + public partial class ClusterList : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterList, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterListInternal + { + + /// Backing field for property. + private string _nextLink; + + /// The link used to get the next page of operations. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; set => this._nextLink = value; } + + /// Backing field for property. + private System.Collections.Generic.List _value; + + /// The list of clusters. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public System.Collections.Generic.List Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public ClusterList() + { + + } + } + /// ClusterList represents a list of clusters. + public partial interface IClusterList : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable + { + /// The link used to get the next page of operations. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The link used to get the next page of operations.", + SerializedName = @"nextLink", + PossibleTypes = new [] { typeof(string) })] + string NextLink { get; set; } + /// The list of clusters. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The list of clusters.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICluster) })] + System.Collections.Generic.List Value { get; set; } + + } + /// ClusterList represents a list of clusters. + internal partial interface IClusterListInternal + + { + /// The link used to get the next page of operations. + string NextLink { get; set; } + /// The list of clusters. + System.Collections.Generic.List Value { get; set; } + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterList.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterList.json.cs similarity index 90% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterList.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterList.json.cs index b06d67b5f176..5e867fa05ba9 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterList.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterList.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -65,19 +65,19 @@ internal ClusterList(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Jso { return; } - {_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.NetworkCloud.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.NetworkCloud.Models.Api20250201.ICluster) (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.Cluster.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.NetworkCloud.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.NetworkCloud.Models.ICluster) (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Cluster.FromJson(__u) )) ))() : null : _value;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterList. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterList. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterList. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterList. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterList FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterList FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new ClusterList(json) : null; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterManager.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterManager.PowerShell.cs new file mode 100644 index 000000000000..0a0359ee490e --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterManager.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.NetworkCloud.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + + /// + /// ClusterManager represents a control-plane to manage one or more on-premises clusters. + /// + [System.ComponentModel.TypeConverter(typeof(ClusterManagerTypeConverter))] + public partial class ClusterManager + { + + /// + /// 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 ClusterManager(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Identity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerInternal)this).Identity = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IManagedServiceIdentity) content.GetValueForProperty("Identity",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerInternal)this).Identity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ManagedServiceIdentityTypeConverter.ConvertFrom); + } + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterManagerPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Etag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerInternal)this).Etag, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)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("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedByType = (string) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedByType = (string) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.TrackedResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("IdentityPrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerInternal)this).IdentityPrincipalId = (string) content.GetValueForProperty("IdentityPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerInternal)this).IdentityPrincipalId, global::System.Convert.ToString); + } + if (content.Contains("IdentityTenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerInternal)this).IdentityTenantId = (string) content.GetValueForProperty("IdentityTenantId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerInternal)this).IdentityTenantId, global::System.Convert.ToString); + } + if (content.Contains("IdentityType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerInternal)this).IdentityType = (string) content.GetValueForProperty("IdentityType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerInternal)this).IdentityType, global::System.Convert.ToString); + } + if (content.Contains("IdentityUserAssignedIdentity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IUserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.UserAssignedIdentitiesTypeConverter.ConvertFrom); + } + if (content.Contains("ManagedResourceGroupConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerInternal)this).ManagedResourceGroupConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IManagedResourceGroupConfiguration) content.GetValueForProperty("ManagedResourceGroupConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerInternal)this).ManagedResourceGroupConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ManagedResourceGroupConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("ManagerExtendedLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerInternal)this).ManagerExtendedLocation = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocation) content.GetValueForProperty("ManagerExtendedLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerInternal)this).ManagerExtendedLocation, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ExtendedLocationTypeConverter.ConvertFrom); + } + if (content.Contains("AnalyticsWorkspaceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerInternal)this).AnalyticsWorkspaceId = (string) content.GetValueForProperty("AnalyticsWorkspaceId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerInternal)this).AnalyticsWorkspaceId, global::System.Convert.ToString); + } + if (content.Contains("AvailabilityZone")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerInternal)this).AvailabilityZone = (System.Collections.Generic.List) content.GetValueForProperty("AvailabilityZone",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerInternal)this).AvailabilityZone, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("ClusterVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerInternal)this).ClusterVersion = (System.Collections.Generic.List) content.GetValueForProperty("ClusterVersion",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerInternal)this).ClusterVersion, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterAvailableVersionTypeConverter.ConvertFrom)); + } + if (content.Contains("DetailedStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerInternal)this).DetailedStatus = (string) content.GetValueForProperty("DetailedStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerInternal)this).DetailedStatus, global::System.Convert.ToString); + } + if (content.Contains("DetailedStatusMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerInternal)this).DetailedStatusMessage = (string) content.GetValueForProperty("DetailedStatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerInternal)this).DetailedStatusMessage, global::System.Convert.ToString); + } + if (content.Contains("FabricControllerId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerInternal)this).FabricControllerId = (string) content.GetValueForProperty("FabricControllerId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerInternal)this).FabricControllerId, global::System.Convert.ToString); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("VMSize")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerInternal)this).VMSize = (string) content.GetValueForProperty("VMSize",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerInternal)this).VMSize, global::System.Convert.ToString); + } + if (content.Contains("ManagedResourceGroupConfigurationLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerInternal)this).ManagedResourceGroupConfigurationLocation = (string) content.GetValueForProperty("ManagedResourceGroupConfigurationLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerInternal)this).ManagedResourceGroupConfigurationLocation, global::System.Convert.ToString); + } + if (content.Contains("ManagedResourceGroupConfigurationName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerInternal)this).ManagedResourceGroupConfigurationName = (string) content.GetValueForProperty("ManagedResourceGroupConfigurationName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerInternal)this).ManagedResourceGroupConfigurationName, global::System.Convert.ToString); + } + if (content.Contains("ManagerExtendedLocationName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerInternal)this).ManagerExtendedLocationName = (string) content.GetValueForProperty("ManagerExtendedLocationName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerInternal)this).ManagerExtendedLocationName, global::System.Convert.ToString); + } + if (content.Contains("ManagerExtendedLocationType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerInternal)this).ManagerExtendedLocationType = (string) content.GetValueForProperty("ManagerExtendedLocationType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerInternal)this).ManagerExtendedLocationType, 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 ClusterManager(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Identity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerInternal)this).Identity = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IManagedServiceIdentity) content.GetValueForProperty("Identity",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerInternal)this).Identity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ManagedServiceIdentityTypeConverter.ConvertFrom); + } + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterManagerPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Etag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerInternal)this).Etag, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)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("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedByType = (string) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedByType = (string) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.TrackedResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("IdentityPrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerInternal)this).IdentityPrincipalId = (string) content.GetValueForProperty("IdentityPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerInternal)this).IdentityPrincipalId, global::System.Convert.ToString); + } + if (content.Contains("IdentityTenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerInternal)this).IdentityTenantId = (string) content.GetValueForProperty("IdentityTenantId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerInternal)this).IdentityTenantId, global::System.Convert.ToString); + } + if (content.Contains("IdentityType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerInternal)this).IdentityType = (string) content.GetValueForProperty("IdentityType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerInternal)this).IdentityType, global::System.Convert.ToString); + } + if (content.Contains("IdentityUserAssignedIdentity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IUserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.UserAssignedIdentitiesTypeConverter.ConvertFrom); + } + if (content.Contains("ManagedResourceGroupConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerInternal)this).ManagedResourceGroupConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IManagedResourceGroupConfiguration) content.GetValueForProperty("ManagedResourceGroupConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerInternal)this).ManagedResourceGroupConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ManagedResourceGroupConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("ManagerExtendedLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerInternal)this).ManagerExtendedLocation = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocation) content.GetValueForProperty("ManagerExtendedLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerInternal)this).ManagerExtendedLocation, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ExtendedLocationTypeConverter.ConvertFrom); + } + if (content.Contains("AnalyticsWorkspaceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerInternal)this).AnalyticsWorkspaceId = (string) content.GetValueForProperty("AnalyticsWorkspaceId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerInternal)this).AnalyticsWorkspaceId, global::System.Convert.ToString); + } + if (content.Contains("AvailabilityZone")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerInternal)this).AvailabilityZone = (System.Collections.Generic.List) content.GetValueForProperty("AvailabilityZone",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerInternal)this).AvailabilityZone, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("ClusterVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerInternal)this).ClusterVersion = (System.Collections.Generic.List) content.GetValueForProperty("ClusterVersion",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerInternal)this).ClusterVersion, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterAvailableVersionTypeConverter.ConvertFrom)); + } + if (content.Contains("DetailedStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerInternal)this).DetailedStatus = (string) content.GetValueForProperty("DetailedStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerInternal)this).DetailedStatus, global::System.Convert.ToString); + } + if (content.Contains("DetailedStatusMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerInternal)this).DetailedStatusMessage = (string) content.GetValueForProperty("DetailedStatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerInternal)this).DetailedStatusMessage, global::System.Convert.ToString); + } + if (content.Contains("FabricControllerId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerInternal)this).FabricControllerId = (string) content.GetValueForProperty("FabricControllerId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerInternal)this).FabricControllerId, global::System.Convert.ToString); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("VMSize")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerInternal)this).VMSize = (string) content.GetValueForProperty("VMSize",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerInternal)this).VMSize, global::System.Convert.ToString); + } + if (content.Contains("ManagedResourceGroupConfigurationLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerInternal)this).ManagedResourceGroupConfigurationLocation = (string) content.GetValueForProperty("ManagedResourceGroupConfigurationLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerInternal)this).ManagedResourceGroupConfigurationLocation, global::System.Convert.ToString); + } + if (content.Contains("ManagedResourceGroupConfigurationName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerInternal)this).ManagedResourceGroupConfigurationName = (string) content.GetValueForProperty("ManagedResourceGroupConfigurationName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerInternal)this).ManagedResourceGroupConfigurationName, global::System.Convert.ToString); + } + if (content.Contains("ManagerExtendedLocationName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerInternal)this).ManagerExtendedLocationName = (string) content.GetValueForProperty("ManagerExtendedLocationName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerInternal)this).ManagerExtendedLocationName, global::System.Convert.ToString); + } + if (content.Contains("ManagerExtendedLocationType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerInternal)this).ManagerExtendedLocationType = (string) content.GetValueForProperty("ManagerExtendedLocationType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerInternal)this).ManagerExtendedLocationType, 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.NetworkCloud.Models.IClusterManager DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ClusterManager(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.NetworkCloud.Models.IClusterManager DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ClusterManager(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.NetworkCloud.Models.IClusterManager FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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(); + } + } + /// ClusterManager represents a control-plane to manage one or more on-premises clusters. + [System.ComponentModel.TypeConverter(typeof(ClusterManagerTypeConverter))] + public partial interface IClusterManager + + { + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterManager.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterManager.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterManager.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterManager.TypeConverter.cs index 3f72e77ef095..00434d28d056 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterManager.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterManager.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IClusterManager ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManager ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManager).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManager).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterManager.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterManager.cs new file mode 100644 index 000000000000..acef16c7034f --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterManager.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.NetworkCloud.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + + /// + /// ClusterManager represents a control-plane to manage one or more on-premises clusters. + /// + public partial class ClusterManager : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManager, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerInternal, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResource __trackedResource = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.TrackedResource(); + + /// + /// The resource ID of the Log Analytics workspace that is used for the logs collection. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string AnalyticsWorkspaceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerPropertiesInternal)Property).AnalyticsWorkspaceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerPropertiesInternal)Property).AnalyticsWorkspaceId = value ?? null; } + + /// + /// Field deprecated, this value will no longer influence the cluster manager allocation process and will be removed in a + /// future version. The Azure availability zones within the region that will be used to support the cluster manager resource. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public System.Collections.Generic.List AvailabilityZone { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerPropertiesInternal)Property).AvailabilityZone; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerPropertiesInternal)Property).AvailabilityZone = value ?? null /* arrayOf */; } + + /// + /// The list of the cluster versions the manager supports. It is used as input in clusterVersion property of a cluster resource. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public System.Collections.Generic.List ClusterVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerPropertiesInternal)Property).ClusterVersion; } + + /// + /// The detailed status that provides additional information about the cluster manager. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string DetailedStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerPropertiesInternal)Property).DetailedStatus; } + + /// The descriptive message about the current detailed status. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string DetailedStatusMessage { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerPropertiesInternal)Property).DetailedStatusMessage; } + + /// Backing field for property. + private string _etag; + + /// Resource ETag. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string Etag { get => this._etag; } + + /// + /// The resource ID of the fabric controller that has one to one mapping with the cluster manager. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string FabricControllerId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerPropertiesInternal)Property).FabricControllerId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerPropertiesInternal)Property).FabricControllerId = value ?? null; } + + /// + /// Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).Id; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IManagedServiceIdentity _identity; + + /// The identity of the cluster manager. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IManagedServiceIdentity Identity { get => (this._identity = this._identity ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ManagedServiceIdentity()); 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.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string IdentityPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string IdentityTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IManagedServiceIdentityInternal)Identity).TenantId; } + + /// + /// Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string IdentityType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IManagedServiceIdentityInternal)Identity).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IManagedServiceIdentityInternal)Identity).Type = value ?? null; } + + /// + /// 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.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IUserAssignedIdentities IdentityUserAssignedIdentity { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IManagedServiceIdentityInternal)Identity).UserAssignedIdentity; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IManagedServiceIdentityInternal)Identity).UserAssignedIdentity = value ?? null /* model class */; } + + /// The geo-location where the resource lives + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)__trackedResource).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)__trackedResource).Location = value ?? null; } + + /// + /// The location of the managed resource group. If not specified, the location of the parent resource is chosen. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string ManagedResourceGroupConfigurationLocation { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerPropertiesInternal)Property).ManagedResourceGroupConfigurationLocation; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerPropertiesInternal)Property).ManagedResourceGroupConfigurationLocation = value ?? null; } + + /// + /// The name for the managed resource group. If not specified, the unique name is automatically generated. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string ManagedResourceGroupConfigurationName { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerPropertiesInternal)Property).ManagedResourceGroupConfigurationName; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerPropertiesInternal)Property).ManagedResourceGroupConfigurationName = value ?? null; } + + /// The resource ID of the extended location on which the resource will be created. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string ManagerExtendedLocationName { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerPropertiesInternal)Property).ManagerExtendedLocationName; } + + /// The extended location type, for example, CustomLocation. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string ManagerExtendedLocationType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerPropertiesInternal)Property).ManagerExtendedLocationType; } + + /// Internal Acessors for ClusterVersion + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerInternal.ClusterVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerPropertiesInternal)Property).ClusterVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerPropertiesInternal)Property).ClusterVersion = value ?? null /* arrayOf */; } + + /// Internal Acessors for DetailedStatus + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerInternal.DetailedStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerPropertiesInternal)Property).DetailedStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerPropertiesInternal)Property).DetailedStatus = value ?? null; } + + /// Internal Acessors for DetailedStatusMessage + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerInternal.DetailedStatusMessage { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerPropertiesInternal)Property).DetailedStatusMessage; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerPropertiesInternal)Property).DetailedStatusMessage = value ?? null; } + + /// Internal Acessors for Etag + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerInternal.Etag { get => this._etag; set { {_etag = value;} } } + + /// Internal Acessors for Identity + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IManagedServiceIdentity Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerInternal.Identity { get => (this._identity = this._identity ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ManagedServiceIdentity()); set { {_identity = value;} } } + + /// Internal Acessors for IdentityPrincipalId + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerInternal.IdentityPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IManagedServiceIdentityInternal)Identity).PrincipalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IManagedServiceIdentityInternal)Identity).PrincipalId = value ?? null; } + + /// Internal Acessors for IdentityTenantId + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerInternal.IdentityTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IManagedServiceIdentityInternal)Identity).TenantId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IManagedServiceIdentityInternal)Identity).TenantId = value ?? null; } + + /// Internal Acessors for ManagedResourceGroupConfiguration + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IManagedResourceGroupConfiguration Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerInternal.ManagedResourceGroupConfiguration { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerPropertiesInternal)Property).ManagedResourceGroupConfiguration; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerPropertiesInternal)Property).ManagedResourceGroupConfiguration = value ?? null /* model class */; } + + /// Internal Acessors for ManagerExtendedLocation + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocation Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerInternal.ManagerExtendedLocation { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerPropertiesInternal)Property).ManagerExtendedLocation; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerPropertiesInternal)Property).ManagerExtendedLocation = value ?? null /* model class */; } + + /// Internal Acessors for ManagerExtendedLocationName + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerInternal.ManagerExtendedLocationName { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerPropertiesInternal)Property).ManagerExtendedLocationName; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerPropertiesInternal)Property).ManagerExtendedLocationName = value ?? null; } + + /// Internal Acessors for ManagerExtendedLocationType + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerInternal.ManagerExtendedLocationType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerPropertiesInternal)Property).ManagerExtendedLocationType; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerPropertiesInternal)Property).ManagerExtendedLocationType = value ?? null; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerProperties Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterManagerProperties()); set { {_property = value;} } } + + /// Internal Acessors for ProvisioningState + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerPropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerPropertiesInternal)Property).ProvisioningState = value ?? null; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).Id = value ?? null; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).Name = value ?? null; } + + /// Internal Acessors for SystemData + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISystemData Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemData; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemData = value ?? null /* model class */; } + + /// Internal Acessors for SystemDataCreatedAt + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataCreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataCreatedAt = value ?? default(global::System.DateTime); } + + /// Internal Acessors for SystemDataCreatedBy + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataCreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataCreatedBy = value ?? null; } + + /// Internal Acessors for SystemDataCreatedByType + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataCreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataCreatedByType = value ?? null; } + + /// Internal Acessors for SystemDataLastModifiedAt + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedAt = value ?? default(global::System.DateTime); } + + /// Internal Acessors for SystemDataLastModifiedBy + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedBy = value ?? null; } + + /// Internal Acessors for SystemDataLastModifiedByType + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedByType = value ?? null; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).Type = value ?? null; } + + /// The name of the resource + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).Name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerProperties _property; + + /// The list of the resource properties. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterManagerProperties()); set => this._property = value; } + + /// The provisioning state of the cluster manager. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerPropertiesInternal)Property).ProvisioningState; } + + /// Gets the resource group name + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string ResourceGroupName { get => (new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Success ? new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Groups["resourceGroupName"].Value : null); } + + /// + /// Azure Resource Manager metadata containing createdBy and modifiedBy information. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISystemData SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemData; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemData = value ?? null /* model class */; } + + /// The timestamp of resource creation (UTC). + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataCreatedAt; } + + /// The identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataCreatedBy; } + + /// The type of identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public string SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataCreatedByType; } + + /// The timestamp of resource last modification (UTC) + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedAt; } + + /// The identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedBy; } + + /// The type of identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public string SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedByType; } + + /// Resource tags. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)__trackedResource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).Type; } + + /// + /// Field deprecated, this value will no longer influence the cluster manager allocation process and will be removed in a + /// future version. The size of the Azure virtual machines to use for hosting the cluster manager resource. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string VMSize { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerPropertiesInternal)Property).VMSize; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerPropertiesInternal)Property).VMSize = value ?? null; } + + /// Creates an new instance. + public ClusterManager() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__trackedResource), __trackedResource); + await eventListener.AssertObjectIsValid(nameof(__trackedResource), __trackedResource); + } + } + /// ClusterManager represents a control-plane to manage one or more on-premises clusters. + public partial interface IClusterManager : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResource + { + /// + /// The resource ID of the Log Analytics workspace that is used for the logs collection. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The resource ID of the Log Analytics workspace that is used for the logs collection.", + SerializedName = @"analyticsWorkspaceId", + PossibleTypes = new [] { typeof(string) })] + string AnalyticsWorkspaceId { get; set; } + /// + /// Field deprecated, this value will no longer influence the cluster manager allocation process and will be removed in a + /// future version. The Azure availability zones within the region that will be used to support the cluster manager resource. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"Field deprecated, this value will no longer influence the cluster manager allocation process and will be removed in a future version. The Azure availability zones within the region that will be used to support the cluster manager resource.", + SerializedName = @"availabilityZones", + PossibleTypes = new [] { typeof(string) })] + System.Collections.Generic.List AvailabilityZone { get; set; } + /// + /// The list of the cluster versions the manager supports. It is used as input in clusterVersion property of a cluster resource. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The list of the cluster versions the manager supports. It is used as input in clusterVersion property of a cluster resource.", + SerializedName = @"clusterVersions", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterAvailableVersion) })] + System.Collections.Generic.List ClusterVersion { get; } + /// + /// The detailed status that provides additional information about the cluster manager. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The detailed status that provides additional information about the cluster manager.", + SerializedName = @"detailedStatus", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Error", "Available", "Provisioning", "ProvisioningFailed", "Updating", "UpdateFailed")] + string DetailedStatus { get; } + /// The descriptive message about the current detailed status. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The descriptive message about the current detailed status.", + SerializedName = @"detailedStatusMessage", + PossibleTypes = new [] { typeof(string) })] + string DetailedStatusMessage { get; } + /// Resource ETag. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"Resource ETag.", + SerializedName = @"etag", + PossibleTypes = new [] { typeof(string) })] + string Etag { get; } + /// + /// The resource ID of the fabric controller that has one to one mapping with the cluster manager. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The resource ID of the fabric controller that has one to one mapping with the cluster manager.", + SerializedName = @"fabricControllerId", + PossibleTypes = new [] { typeof(string) })] + string FabricControllerId { get; set; } + /// + /// The service principal ID of the system assigned identity. This property will only be provided for a system assigned identity. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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) })] + string IdentityPrincipalId { get; } + /// + /// The tenant ID of the system assigned identity. This property will only be provided for a system assigned identity. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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) })] + string IdentityTenantId { get; } + /// + /// Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.IUserAssignedIdentities) })] + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IUserAssignedIdentities IdentityUserAssignedIdentity { get; set; } + /// + /// The location of the managed resource group. If not specified, the location of the parent resource is chosen. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The location of the managed resource group. If not specified, the location of the parent resource is chosen.", + SerializedName = @"location", + PossibleTypes = new [] { typeof(string) })] + string ManagedResourceGroupConfigurationLocation { get; set; } + /// + /// The name for the managed resource group. If not specified, the unique name is automatically generated. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The name for the managed resource group. If not specified, the unique name is automatically generated.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string ManagedResourceGroupConfigurationName { get; set; } + /// The resource ID of the extended location on which the resource will be created. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The resource ID of the extended location on which the resource will be created.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string ManagerExtendedLocationName { get; } + /// The extended location type, for example, CustomLocation. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The extended location type, for example, CustomLocation.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + string ManagerExtendedLocationType { get; } + /// The provisioning state of the cluster manager. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The provisioning state of the cluster manager.", + SerializedName = @"provisioningState", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Succeeded", "Failed", "Canceled", "Provisioning", "Accepted", "Updating")] + string ProvisioningState { get; } + /// + /// Field deprecated, this value will no longer influence the cluster manager allocation process and will be removed in a + /// future version. The size of the Azure virtual machines to use for hosting the cluster manager resource. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"Field deprecated, this value will no longer influence the cluster manager allocation process and will be removed in a future version. The size of the Azure virtual machines to use for hosting the cluster manager resource.", + SerializedName = @"vmSize", + PossibleTypes = new [] { typeof(string) })] + string VMSize { get; set; } + + } + /// ClusterManager represents a control-plane to manage one or more on-premises clusters. + internal partial interface IClusterManagerInternal : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal + { + /// + /// The resource ID of the Log Analytics workspace that is used for the logs collection. + /// + string AnalyticsWorkspaceId { get; set; } + /// + /// Field deprecated, this value will no longer influence the cluster manager allocation process and will be removed in a + /// future version. The Azure availability zones within the region that will be used to support the cluster manager resource. + /// + System.Collections.Generic.List AvailabilityZone { get; set; } + /// + /// The list of the cluster versions the manager supports. It is used as input in clusterVersion property of a cluster resource. + /// + System.Collections.Generic.List ClusterVersion { get; set; } + /// + /// The detailed status that provides additional information about the cluster manager. + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Error", "Available", "Provisioning", "ProvisioningFailed", "Updating", "UpdateFailed")] + string DetailedStatus { get; set; } + /// The descriptive message about the current detailed status. + string DetailedStatusMessage { get; set; } + /// Resource ETag. + string Etag { get; set; } + /// + /// The resource ID of the fabric controller that has one to one mapping with the cluster manager. + /// + string FabricControllerId { get; set; } + /// The identity of the cluster manager. + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IManagedServiceIdentity Identity { get; set; } + /// + /// The service principal ID of the system assigned identity. This property will only be provided for a system assigned identity. + /// + string IdentityPrincipalId { get; set; } + /// + /// The tenant ID of the system assigned identity. This property will only be provided for a system assigned identity. + /// + string IdentityTenantId { get; set; } + /// + /// Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.IUserAssignedIdentities IdentityUserAssignedIdentity { get; set; } + /// The configuration of the managed resource group associated with the resource. + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IManagedResourceGroupConfiguration ManagedResourceGroupConfiguration { get; set; } + /// + /// The location of the managed resource group. If not specified, the location of the parent resource is chosen. + /// + string ManagedResourceGroupConfigurationLocation { get; set; } + /// + /// The name for the managed resource group. If not specified, the unique name is automatically generated. + /// + string ManagedResourceGroupConfigurationName { get; set; } + /// + /// The extended location (custom location) that represents the cluster manager's control plane location. This extended location + /// is used when creating cluster and rack manifest resources. + /// + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocation ManagerExtendedLocation { get; set; } + /// The resource ID of the extended location on which the resource will be created. + string ManagerExtendedLocationName { get; set; } + /// The extended location type, for example, CustomLocation. + string ManagerExtendedLocationType { get; set; } + /// The list of the resource properties. + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerProperties Property { get; set; } + /// The provisioning state of the cluster manager. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Succeeded", "Failed", "Canceled", "Provisioning", "Accepted", "Updating")] + string ProvisioningState { get; set; } + /// + /// Field deprecated, this value will no longer influence the cluster manager allocation process and will be removed in a + /// future version. The size of the Azure virtual machines to use for hosting the cluster manager resource. + /// + string VMSize { get; set; } + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterManager.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterManager.json.cs similarity index 92% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterManager.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterManager.json.cs index 38bc56ba3c62..97f94d46568a 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterManager.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterManager.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -67,21 +67,21 @@ internal ClusterManager(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime. { return; } - __trackedResource = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.TrackedResource(json); - {_identity = If( json?.PropertyT("identity"), out var __jsonIdentity) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ManagedServiceIdentity.FromJson(__jsonIdentity) : Identity;} - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ClusterManagerProperties.FromJson(__jsonProperties) : Property;} - {_etag = If( json?.PropertyT("etag"), out var __jsonEtag) ? (string)__jsonEtag : (string)Etag;} + __trackedResource = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.TrackedResource(json); + {_identity = If( json?.PropertyT("identity"), out var __jsonIdentity) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ManagedServiceIdentity.FromJson(__jsonIdentity) : _identity;} + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterManagerProperties.FromJson(__jsonProperties) : _property;} + {_etag = If( json?.PropertyT("etag"), out var __jsonEtag) ? (string)__jsonEtag : (string)_etag;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManager. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManager. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManager. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManager. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManager FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManager FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new ClusterManager(json) : null; } @@ -108,7 +108,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode ToJ __trackedResource?.ToJson(container, serializationMode); AddIf( null != this._identity ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) this._identity.ToJson(null,serializationMode) : null, "identity" ,container.Add ); AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._etag)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._etag.ToString()) : null, "etag" ,container.Add ); } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterManagerList.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterManagerList.PowerShell.cs similarity index 76% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterManagerList.PowerShell.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterManagerList.PowerShell.cs index 6a1e6fafa5fb..df7e28cbe5a4 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterManagerList.PowerShell.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterManagerList.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; @@ -63,7 +63,7 @@ public partial class ClusterManagerList 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 ClusterManagerList(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerListInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerListInternal)this).NextLink, global::System.Convert.ToString); } if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManager[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ClusterManagerTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerListInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerListInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterManagerTypeConverter.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,37 +103,37 @@ internal ClusterManagerList(global::System.Management.Automation.PSObject conten // actually deserialize if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerListInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerListInternal)this).NextLink, global::System.Convert.ToString); } if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManager[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ClusterManagerTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerListInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerListInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterManagerTypeConverter.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.NetworkCloud.Models.Api20250201.IClusterManagerList DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerList DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ClusterManagerList(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.NetworkCloud.Models.Api20250201.IClusterManagerList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ClusterManagerList(content); } @@ -143,7 +143,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterManagerList.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterManagerList.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterManagerList.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterManagerList.TypeConverter.cs index 938b06ab4e8f..97ce74587e0a 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterManagerList.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterManagerList.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IClusterManagerList ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerList ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerList).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerList).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterManagerList.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterManagerList.cs new file mode 100644 index 000000000000..99d16fa07268 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterManagerList.cs @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + + /// ClusterManagerList represents a list of cluster manager objects. + public partial class ClusterManagerList : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerList, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerListInternal + { + + /// Backing field for property. + private string _nextLink; + + /// The link used to get the next page of operations. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; set => this._nextLink = value; } + + /// Backing field for property. + private System.Collections.Generic.List _value; + + /// The list of cluster managers. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public System.Collections.Generic.List Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public ClusterManagerList() + { + + } + } + /// ClusterManagerList represents a list of cluster manager objects. + public partial interface IClusterManagerList : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable + { + /// The link used to get the next page of operations. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The link used to get the next page of operations.", + SerializedName = @"nextLink", + PossibleTypes = new [] { typeof(string) })] + string NextLink { get; set; } + /// The list of cluster managers. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The list of cluster managers.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManager) })] + System.Collections.Generic.List Value { get; set; } + + } + /// ClusterManagerList represents a list of cluster manager objects. + internal partial interface IClusterManagerListInternal + + { + /// The link used to get the next page of operations. + string NextLink { get; set; } + /// The list of cluster managers. + System.Collections.Generic.List Value { get; set; } + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterManagerList.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterManagerList.json.cs similarity index 90% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterManagerList.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterManagerList.json.cs index eee068fd2b7e..f7855733d280 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterManagerList.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterManagerList.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -65,19 +65,19 @@ internal ClusterManagerList(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runt { return; } - {_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.NetworkCloud.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.NetworkCloud.Models.Api20250201.IClusterManager) (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ClusterManager.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.NetworkCloud.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.NetworkCloud.Models.IClusterManager) (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterManager.FromJson(__u) )) ))() : null : _value;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerList. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerList. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerList. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerList. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerList FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerList FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new ClusterManagerList(json) : null; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterManagerPatchParameters.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterManagerPatchParameters.PowerShell.cs new file mode 100644 index 000000000000..8ab5714238e3 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterManagerPatchParameters.PowerShell.cs @@ -0,0 +1,206 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + + /// + /// ClusterManagerPatchParameters represents the body of the request to patch the cluster properties. + /// + [System.ComponentModel.TypeConverter(typeof(ClusterManagerPatchParametersTypeConverter))] + public partial class ClusterManagerPatchParameters + { + + /// + /// 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 ClusterManagerPatchParameters(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Identity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerPatchParametersInternal)this).Identity = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IManagedServiceIdentity) content.GetValueForProperty("Identity",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerPatchParametersInternal)this).Identity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ManagedServiceIdentityTypeConverter.ConvertFrom); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerPatchParametersInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerPatchParametersTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerPatchParametersInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterManagerPatchParametersTagsTypeConverter.ConvertFrom); + } + if (content.Contains("IdentityPrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerPatchParametersInternal)this).IdentityPrincipalId = (string) content.GetValueForProperty("IdentityPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerPatchParametersInternal)this).IdentityPrincipalId, global::System.Convert.ToString); + } + if (content.Contains("IdentityTenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerPatchParametersInternal)this).IdentityTenantId = (string) content.GetValueForProperty("IdentityTenantId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerPatchParametersInternal)this).IdentityTenantId, global::System.Convert.ToString); + } + if (content.Contains("IdentityType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerPatchParametersInternal)this).IdentityType = (string) content.GetValueForProperty("IdentityType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerPatchParametersInternal)this).IdentityType, global::System.Convert.ToString); + } + if (content.Contains("IdentityUserAssignedIdentity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerPatchParametersInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IUserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerPatchParametersInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.UserAssignedIdentitiesTypeConverter.ConvertFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ClusterManagerPatchParameters(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Identity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerPatchParametersInternal)this).Identity = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IManagedServiceIdentity) content.GetValueForProperty("Identity",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerPatchParametersInternal)this).Identity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ManagedServiceIdentityTypeConverter.ConvertFrom); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerPatchParametersInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerPatchParametersTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerPatchParametersInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterManagerPatchParametersTagsTypeConverter.ConvertFrom); + } + if (content.Contains("IdentityPrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerPatchParametersInternal)this).IdentityPrincipalId = (string) content.GetValueForProperty("IdentityPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerPatchParametersInternal)this).IdentityPrincipalId, global::System.Convert.ToString); + } + if (content.Contains("IdentityTenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerPatchParametersInternal)this).IdentityTenantId = (string) content.GetValueForProperty("IdentityTenantId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerPatchParametersInternal)this).IdentityTenantId, global::System.Convert.ToString); + } + if (content.Contains("IdentityType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerPatchParametersInternal)this).IdentityType = (string) content.GetValueForProperty("IdentityType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerPatchParametersInternal)this).IdentityType, global::System.Convert.ToString); + } + if (content.Contains("IdentityUserAssignedIdentity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerPatchParametersInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IUserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerPatchParametersInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.UserAssignedIdentitiesTypeConverter.ConvertFrom); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerPatchParameters DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ClusterManagerPatchParameters(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.NetworkCloud.Models.IClusterManagerPatchParameters DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ClusterManagerPatchParameters(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.NetworkCloud.Models.IClusterManagerPatchParameters FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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(); + } + } + /// ClusterManagerPatchParameters represents the body of the request to patch the cluster properties. + [System.ComponentModel.TypeConverter(typeof(ClusterManagerPatchParametersTypeConverter))] + public partial interface IClusterManagerPatchParameters + + { + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterManagerPatchParameters.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterManagerPatchParameters.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterManagerPatchParameters.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterManagerPatchParameters.TypeConverter.cs index 67fcee1f7a86..4ce52040fe73 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterManagerPatchParameters.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterManagerPatchParameters.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IClusterManagerPatchParameters ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerPatchParameters ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerPatchParameters).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerPatchParameters).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterManagerPatchParameters.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterManagerPatchParameters.cs new file mode 100644 index 000000000000..d1557b2c1985 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterManagerPatchParameters.cs @@ -0,0 +1,174 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + + /// + /// ClusterManagerPatchParameters represents the body of the request to patch the cluster properties. + /// + public partial class ClusterManagerPatchParameters : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerPatchParameters, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerPatchParametersInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IManagedServiceIdentity _identity; + + /// The identity for the resource. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IManagedServiceIdentity Identity { get => (this._identity = this._identity ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ManagedServiceIdentity()); 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.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string IdentityPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string IdentityTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IManagedServiceIdentityInternal)Identity).TenantId; } + + /// + /// Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string IdentityType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IManagedServiceIdentityInternal)Identity).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IManagedServiceIdentityInternal)Identity).Type = value ?? null; } + + /// + /// 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.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IUserAssignedIdentities IdentityUserAssignedIdentity { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IManagedServiceIdentityInternal)Identity).UserAssignedIdentity; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IManagedServiceIdentityInternal)Identity).UserAssignedIdentity = value ?? null /* model class */; } + + /// Internal Acessors for Identity + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IManagedServiceIdentity Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerPatchParametersInternal.Identity { get => (this._identity = this._identity ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ManagedServiceIdentity()); set { {_identity = value;} } } + + /// Internal Acessors for IdentityPrincipalId + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerPatchParametersInternal.IdentityPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IManagedServiceIdentityInternal)Identity).PrincipalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IManagedServiceIdentityInternal)Identity).PrincipalId = value ?? null; } + + /// Internal Acessors for IdentityTenantId + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerPatchParametersInternal.IdentityTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IManagedServiceIdentityInternal)Identity).TenantId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IManagedServiceIdentityInternal)Identity).TenantId = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerPatchParametersTags _tag; + + /// The Azure resource tags that will replace the existing ones. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerPatchParametersTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterManagerPatchParametersTags()); set => this._tag = value; } + + /// Creates an new instance. + public ClusterManagerPatchParameters() + { + + } + } + /// ClusterManagerPatchParameters represents the body of the request to patch the cluster properties. + public partial interface IClusterManagerPatchParameters : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable + { + /// + /// The service principal ID of the system assigned identity. This property will only be provided for a system assigned identity. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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) })] + string IdentityPrincipalId { get; } + /// + /// The tenant ID of the system assigned identity. This property will only be provided for a system assigned identity. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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) })] + string IdentityTenantId { get; } + /// + /// Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.IUserAssignedIdentities) })] + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IUserAssignedIdentities IdentityUserAssignedIdentity { get; set; } + /// The Azure resource tags that will replace the existing ones. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The Azure resource tags that will replace the existing ones.", + SerializedName = @"tags", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerPatchParametersTags) })] + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerPatchParametersTags Tag { get; set; } + + } + /// ClusterManagerPatchParameters represents the body of the request to patch the cluster properties. + internal partial interface IClusterManagerPatchParametersInternal + + { + /// The identity for the resource. + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IManagedServiceIdentity Identity { get; set; } + /// + /// The service principal ID of the system assigned identity. This property will only be provided for a system assigned identity. + /// + string IdentityPrincipalId { get; set; } + /// + /// The tenant ID of the system assigned identity. This property will only be provided for a system assigned identity. + /// + string IdentityTenantId { get; set; } + /// + /// Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.IUserAssignedIdentities IdentityUserAssignedIdentity { get; set; } + /// The Azure resource tags that will replace the existing ones. + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerPatchParametersTags Tag { get; set; } + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterManagerPatchParameters.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterManagerPatchParameters.json.cs similarity index 93% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterManagerPatchParameters.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterManagerPatchParameters.json.cs index c60969e155b6..14a1aa9c9cbe 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterManagerPatchParameters.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterManagerPatchParameters.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -67,19 +67,19 @@ internal ClusterManagerPatchParameters(Microsoft.Azure.PowerShell.Cmdlets.Networ { return; } - {_identity = If( json?.PropertyT("identity"), out var __jsonIdentity) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ManagedServiceIdentity.FromJson(__jsonIdentity) : Identity;} - {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ClusterManagerPatchParametersTags.FromJson(__jsonTags) : Tag;} + {_identity = If( json?.PropertyT("identity"), out var __jsonIdentity) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ManagedServiceIdentity.FromJson(__jsonIdentity) : _identity;} + {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterManagerPatchParametersTags.FromJson(__jsonTags) : _tag;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerPatchParameters. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerPatchParameters. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerPatchParameters. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerPatchParameters. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerPatchParameters FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerPatchParameters FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new ClusterManagerPatchParameters(json) : null; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterManagerPatchParametersTags.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterManagerPatchParametersTags.PowerShell.cs similarity index 88% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterManagerPatchParametersTags.PowerShell.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterManagerPatchParametersTags.PowerShell.cs index f7ef492f8f39..0d8f537a6dc5 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterManagerPatchParametersTags.PowerShell.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterManagerPatchParametersTags.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; @@ -63,7 +63,7 @@ public partial class ClusterManagerPatchParametersTags 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 ClusterManagerPatchParametersTags(global::System.Collections.IDictionar } /// - /// 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 ClusterManagerPatchParametersTags(global::System.Management.Automation. } /// - /// 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.NetworkCloud.Models.Api20250201.IClusterManagerPatchParametersTags DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerPatchParametersTags DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ClusterManagerPatchParametersTags(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.NetworkCloud.Models.Api20250201.IClusterManagerPatchParametersTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerPatchParametersTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ClusterManagerPatchParametersTags(content); } @@ -135,7 +133,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201 /// /// an instance of the model class. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerPatchParametersTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerPatchParametersTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterManagerPatchParametersTags.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterManagerPatchParametersTags.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterManagerPatchParametersTags.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterManagerPatchParametersTags.TypeConverter.cs index f150a8dd7d6b..25ae362a4683 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterManagerPatchParametersTags.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterManagerPatchParametersTags.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IClusterManagerPatchParametersTags ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerPatchParametersTags ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerPatchParametersTags).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerPatchParametersTags).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterManagerPatchParametersTags.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterManagerPatchParametersTags.cs similarity index 84% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterManagerPatchParametersTags.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterManagerPatchParametersTags.cs index d8ac416fc26f..cd5fdefaf078 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterManagerPatchParametersTags.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterManagerPatchParametersTags.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; /// The Azure resource tags that will replace the existing ones. public partial class ClusterManagerPatchParametersTags : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerPatchParametersTags, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerPatchParametersTagsInternal + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerPatchParametersTags, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerPatchParametersTagsInternal { /// Creates an new instance. diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterManagerPatchParametersTags.dictionary.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterManagerPatchParametersTags.dictionary.cs similarity index 96% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterManagerPatchParametersTags.dictionary.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterManagerPatchParametersTags.dictionary.cs index 2e562fc957be..a87ccb11a2cc 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterManagerPatchParametersTags.dictionary.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterManagerPatchParametersTags.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.ClusterManagerPatchParametersTags source) => source.__additionalProperties; + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterManagerPatchParametersTags source) => source.__additionalProperties; } } \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterManagerPatchParametersTags.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterManagerPatchParametersTags.json.cs similarity index 95% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterManagerPatchParametersTags.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterManagerPatchParametersTags.json.cs index 1f46d7fbabcb..52c0528ea1bf 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterManagerPatchParametersTags.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterManagerPatchParametersTags.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -71,13 +71,13 @@ internal ClusterManagerPatchParametersTags(Microsoft.Azure.PowerShell.Cmdlets.Ne } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerPatchParametersTags. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerPatchParametersTags. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerPatchParametersTags. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerPatchParametersTags. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerPatchParametersTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerPatchParametersTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new ClusterManagerPatchParametersTags(json) : null; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterManagerProperties.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterManagerProperties.PowerShell.cs new file mode 100644 index 000000000000..1d2a752e560e --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterManagerProperties.PowerShell.cs @@ -0,0 +1,268 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + + /// ClusterManagerProperties represents the properties of a cluster manager. + [System.ComponentModel.TypeConverter(typeof(ClusterManagerPropertiesTypeConverter))] + public partial class ClusterManagerProperties + { + + /// + /// 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 ClusterManagerProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ManagedResourceGroupConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerPropertiesInternal)this).ManagedResourceGroupConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IManagedResourceGroupConfiguration) content.GetValueForProperty("ManagedResourceGroupConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerPropertiesInternal)this).ManagedResourceGroupConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ManagedResourceGroupConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("ManagerExtendedLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerPropertiesInternal)this).ManagerExtendedLocation = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocation) content.GetValueForProperty("ManagerExtendedLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerPropertiesInternal)this).ManagerExtendedLocation, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ExtendedLocationTypeConverter.ConvertFrom); + } + if (content.Contains("AnalyticsWorkspaceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerPropertiesInternal)this).AnalyticsWorkspaceId = (string) content.GetValueForProperty("AnalyticsWorkspaceId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerPropertiesInternal)this).AnalyticsWorkspaceId, global::System.Convert.ToString); + } + if (content.Contains("AvailabilityZone")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerPropertiesInternal)this).AvailabilityZone = (System.Collections.Generic.List) content.GetValueForProperty("AvailabilityZone",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerPropertiesInternal)this).AvailabilityZone, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("ClusterVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerPropertiesInternal)this).ClusterVersion = (System.Collections.Generic.List) content.GetValueForProperty("ClusterVersion",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerPropertiesInternal)this).ClusterVersion, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterAvailableVersionTypeConverter.ConvertFrom)); + } + if (content.Contains("DetailedStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerPropertiesInternal)this).DetailedStatus = (string) content.GetValueForProperty("DetailedStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerPropertiesInternal)this).DetailedStatus, global::System.Convert.ToString); + } + if (content.Contains("DetailedStatusMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerPropertiesInternal)this).DetailedStatusMessage = (string) content.GetValueForProperty("DetailedStatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerPropertiesInternal)this).DetailedStatusMessage, global::System.Convert.ToString); + } + if (content.Contains("FabricControllerId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerPropertiesInternal)this).FabricControllerId = (string) content.GetValueForProperty("FabricControllerId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerPropertiesInternal)this).FabricControllerId, global::System.Convert.ToString); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerPropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerPropertiesInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("VMSize")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerPropertiesInternal)this).VMSize = (string) content.GetValueForProperty("VMSize",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerPropertiesInternal)this).VMSize, global::System.Convert.ToString); + } + if (content.Contains("ManagedResourceGroupConfigurationLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerPropertiesInternal)this).ManagedResourceGroupConfigurationLocation = (string) content.GetValueForProperty("ManagedResourceGroupConfigurationLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerPropertiesInternal)this).ManagedResourceGroupConfigurationLocation, global::System.Convert.ToString); + } + if (content.Contains("ManagedResourceGroupConfigurationName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerPropertiesInternal)this).ManagedResourceGroupConfigurationName = (string) content.GetValueForProperty("ManagedResourceGroupConfigurationName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerPropertiesInternal)this).ManagedResourceGroupConfigurationName, global::System.Convert.ToString); + } + if (content.Contains("ManagerExtendedLocationName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerPropertiesInternal)this).ManagerExtendedLocationName = (string) content.GetValueForProperty("ManagerExtendedLocationName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerPropertiesInternal)this).ManagerExtendedLocationName, global::System.Convert.ToString); + } + if (content.Contains("ManagerExtendedLocationType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerPropertiesInternal)this).ManagerExtendedLocationType = (string) content.GetValueForProperty("ManagerExtendedLocationType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerPropertiesInternal)this).ManagerExtendedLocationType, 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 ClusterManagerProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ManagedResourceGroupConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerPropertiesInternal)this).ManagedResourceGroupConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IManagedResourceGroupConfiguration) content.GetValueForProperty("ManagedResourceGroupConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerPropertiesInternal)this).ManagedResourceGroupConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ManagedResourceGroupConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("ManagerExtendedLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerPropertiesInternal)this).ManagerExtendedLocation = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocation) content.GetValueForProperty("ManagerExtendedLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerPropertiesInternal)this).ManagerExtendedLocation, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ExtendedLocationTypeConverter.ConvertFrom); + } + if (content.Contains("AnalyticsWorkspaceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerPropertiesInternal)this).AnalyticsWorkspaceId = (string) content.GetValueForProperty("AnalyticsWorkspaceId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerPropertiesInternal)this).AnalyticsWorkspaceId, global::System.Convert.ToString); + } + if (content.Contains("AvailabilityZone")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerPropertiesInternal)this).AvailabilityZone = (System.Collections.Generic.List) content.GetValueForProperty("AvailabilityZone",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerPropertiesInternal)this).AvailabilityZone, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("ClusterVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerPropertiesInternal)this).ClusterVersion = (System.Collections.Generic.List) content.GetValueForProperty("ClusterVersion",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerPropertiesInternal)this).ClusterVersion, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterAvailableVersionTypeConverter.ConvertFrom)); + } + if (content.Contains("DetailedStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerPropertiesInternal)this).DetailedStatus = (string) content.GetValueForProperty("DetailedStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerPropertiesInternal)this).DetailedStatus, global::System.Convert.ToString); + } + if (content.Contains("DetailedStatusMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerPropertiesInternal)this).DetailedStatusMessage = (string) content.GetValueForProperty("DetailedStatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerPropertiesInternal)this).DetailedStatusMessage, global::System.Convert.ToString); + } + if (content.Contains("FabricControllerId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerPropertiesInternal)this).FabricControllerId = (string) content.GetValueForProperty("FabricControllerId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerPropertiesInternal)this).FabricControllerId, global::System.Convert.ToString); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerPropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerPropertiesInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("VMSize")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerPropertiesInternal)this).VMSize = (string) content.GetValueForProperty("VMSize",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerPropertiesInternal)this).VMSize, global::System.Convert.ToString); + } + if (content.Contains("ManagedResourceGroupConfigurationLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerPropertiesInternal)this).ManagedResourceGroupConfigurationLocation = (string) content.GetValueForProperty("ManagedResourceGroupConfigurationLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerPropertiesInternal)this).ManagedResourceGroupConfigurationLocation, global::System.Convert.ToString); + } + if (content.Contains("ManagedResourceGroupConfigurationName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerPropertiesInternal)this).ManagedResourceGroupConfigurationName = (string) content.GetValueForProperty("ManagedResourceGroupConfigurationName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerPropertiesInternal)this).ManagedResourceGroupConfigurationName, global::System.Convert.ToString); + } + if (content.Contains("ManagerExtendedLocationName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerPropertiesInternal)this).ManagerExtendedLocationName = (string) content.GetValueForProperty("ManagerExtendedLocationName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerPropertiesInternal)this).ManagerExtendedLocationName, global::System.Convert.ToString); + } + if (content.Contains("ManagerExtendedLocationType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerPropertiesInternal)this).ManagerExtendedLocationType = (string) content.GetValueForProperty("ManagerExtendedLocationType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerPropertiesInternal)this).ManagerExtendedLocationType, 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.NetworkCloud.Models.IClusterManagerProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ClusterManagerProperties(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.NetworkCloud.Models.IClusterManagerProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ClusterManagerProperties(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.NetworkCloud.Models.IClusterManagerProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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(); + } + } + /// ClusterManagerProperties represents the properties of a cluster manager. + [System.ComponentModel.TypeConverter(typeof(ClusterManagerPropertiesTypeConverter))] + public partial interface IClusterManagerProperties + + { + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterManagerProperties.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterManagerProperties.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterManagerProperties.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterManagerProperties.TypeConverter.cs index e693eb90bb55..4433d7e81df4 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterManagerProperties.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterManagerProperties.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IClusterManagerProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterManagerProperties.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterManagerProperties.cs new file mode 100644 index 000000000000..444bf21e3620 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterManagerProperties.cs @@ -0,0 +1,368 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + + /// ClusterManagerProperties represents the properties of a cluster manager. + public partial class ClusterManagerProperties : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerProperties, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerPropertiesInternal + { + + /// Backing field for property. + private string _analyticsWorkspaceId; + + /// + /// The resource ID of the Log Analytics workspace that is used for the logs collection. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string AnalyticsWorkspaceId { get => this._analyticsWorkspaceId; set => this._analyticsWorkspaceId = value; } + + /// Backing field for property. + private System.Collections.Generic.List _availabilityZone; + + /// + /// Field deprecated, this value will no longer influence the cluster manager allocation process and will be removed in a + /// future version. The Azure availability zones within the region that will be used to support the cluster manager resource. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public System.Collections.Generic.List AvailabilityZone { get => this._availabilityZone; set => this._availabilityZone = value; } + + /// Backing field for property. + private System.Collections.Generic.List _clusterVersion; + + /// + /// The list of the cluster versions the manager supports. It is used as input in clusterVersion property of a cluster resource. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public System.Collections.Generic.List ClusterVersion { get => this._clusterVersion; } + + /// Backing field for property. + private string _detailedStatus; + + /// + /// The detailed status that provides additional information about the cluster manager. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string DetailedStatus { get => this._detailedStatus; } + + /// Backing field for property. + private string _detailedStatusMessage; + + /// The descriptive message about the current detailed status. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string DetailedStatusMessage { get => this._detailedStatusMessage; } + + /// Backing field for property. + private string _fabricControllerId; + + /// + /// The resource ID of the fabric controller that has one to one mapping with the cluster manager. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string FabricControllerId { get => this._fabricControllerId; set => this._fabricControllerId = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IManagedResourceGroupConfiguration _managedResourceGroupConfiguration; + + /// The configuration of the managed resource group associated with the resource. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IManagedResourceGroupConfiguration ManagedResourceGroupConfiguration { get => (this._managedResourceGroupConfiguration = this._managedResourceGroupConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ManagedResourceGroupConfiguration()); set => this._managedResourceGroupConfiguration = value; } + + /// + /// The location of the managed resource group. If not specified, the location of the parent resource is chosen. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string ManagedResourceGroupConfigurationLocation { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IManagedResourceGroupConfigurationInternal)ManagedResourceGroupConfiguration).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IManagedResourceGroupConfigurationInternal)ManagedResourceGroupConfiguration).Location = value ?? null; } + + /// + /// The name for the managed resource group. If not specified, the unique name is automatically generated. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string ManagedResourceGroupConfigurationName { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IManagedResourceGroupConfigurationInternal)ManagedResourceGroupConfiguration).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IManagedResourceGroupConfigurationInternal)ManagedResourceGroupConfiguration).Name = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocation _managerExtendedLocation; + + /// + /// The extended location (custom location) that represents the cluster manager's control plane location. This extended location + /// is used when creating cluster and rack manifest resources. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocation ManagerExtendedLocation { get => (this._managerExtendedLocation = this._managerExtendedLocation ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ExtendedLocation()); } + + /// The resource ID of the extended location on which the resource will be created. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string ManagerExtendedLocationName { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocationInternal)ManagerExtendedLocation).Name; } + + /// The extended location type, for example, CustomLocation. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string ManagerExtendedLocationType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocationInternal)ManagerExtendedLocation).Type; } + + /// Internal Acessors for ClusterVersion + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerPropertiesInternal.ClusterVersion { get => this._clusterVersion; set { {_clusterVersion = value;} } } + + /// Internal Acessors for DetailedStatus + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerPropertiesInternal.DetailedStatus { get => this._detailedStatus; set { {_detailedStatus = value;} } } + + /// Internal Acessors for DetailedStatusMessage + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerPropertiesInternal.DetailedStatusMessage { get => this._detailedStatusMessage; set { {_detailedStatusMessage = value;} } } + + /// Internal Acessors for ManagedResourceGroupConfiguration + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IManagedResourceGroupConfiguration Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerPropertiesInternal.ManagedResourceGroupConfiguration { get => (this._managedResourceGroupConfiguration = this._managedResourceGroupConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ManagedResourceGroupConfiguration()); set { {_managedResourceGroupConfiguration = value;} } } + + /// Internal Acessors for ManagerExtendedLocation + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocation Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerPropertiesInternal.ManagerExtendedLocation { get => (this._managerExtendedLocation = this._managerExtendedLocation ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ExtendedLocation()); set { {_managerExtendedLocation = value;} } } + + /// Internal Acessors for ManagerExtendedLocationName + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerPropertiesInternal.ManagerExtendedLocationName { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocationInternal)ManagerExtendedLocation).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocationInternal)ManagerExtendedLocation).Name = value ?? null; } + + /// Internal Acessors for ManagerExtendedLocationType + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerPropertiesInternal.ManagerExtendedLocationType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocationInternal)ManagerExtendedLocation).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocationInternal)ManagerExtendedLocation).Type = value ?? null; } + + /// Internal Acessors for ProvisioningState + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerPropertiesInternal.ProvisioningState { get => this._provisioningState; set { {_provisioningState = value;} } } + + /// Backing field for property. + private string _provisioningState; + + /// The provisioning state of the cluster manager. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string ProvisioningState { get => this._provisioningState; } + + /// Backing field for property. + private string _vMSize; + + /// + /// Field deprecated, this value will no longer influence the cluster manager allocation process and will be removed in a + /// future version. The size of the Azure virtual machines to use for hosting the cluster manager resource. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string VMSize { get => this._vMSize; set => this._vMSize = value; } + + /// Creates an new instance. + public ClusterManagerProperties() + { + + } + } + /// ClusterManagerProperties represents the properties of a cluster manager. + public partial interface IClusterManagerProperties : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable + { + /// + /// The resource ID of the Log Analytics workspace that is used for the logs collection. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The resource ID of the Log Analytics workspace that is used for the logs collection.", + SerializedName = @"analyticsWorkspaceId", + PossibleTypes = new [] { typeof(string) })] + string AnalyticsWorkspaceId { get; set; } + /// + /// Field deprecated, this value will no longer influence the cluster manager allocation process and will be removed in a + /// future version. The Azure availability zones within the region that will be used to support the cluster manager resource. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"Field deprecated, this value will no longer influence the cluster manager allocation process and will be removed in a future version. The Azure availability zones within the region that will be used to support the cluster manager resource.", + SerializedName = @"availabilityZones", + PossibleTypes = new [] { typeof(string) })] + System.Collections.Generic.List AvailabilityZone { get; set; } + /// + /// The list of the cluster versions the manager supports. It is used as input in clusterVersion property of a cluster resource. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The list of the cluster versions the manager supports. It is used as input in clusterVersion property of a cluster resource.", + SerializedName = @"clusterVersions", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterAvailableVersion) })] + System.Collections.Generic.List ClusterVersion { get; } + /// + /// The detailed status that provides additional information about the cluster manager. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The detailed status that provides additional information about the cluster manager.", + SerializedName = @"detailedStatus", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Error", "Available", "Provisioning", "ProvisioningFailed", "Updating", "UpdateFailed")] + string DetailedStatus { get; } + /// The descriptive message about the current detailed status. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The descriptive message about the current detailed status.", + SerializedName = @"detailedStatusMessage", + PossibleTypes = new [] { typeof(string) })] + string DetailedStatusMessage { get; } + /// + /// The resource ID of the fabric controller that has one to one mapping with the cluster manager. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The resource ID of the fabric controller that has one to one mapping with the cluster manager.", + SerializedName = @"fabricControllerId", + PossibleTypes = new [] { typeof(string) })] + string FabricControllerId { get; set; } + /// + /// The location of the managed resource group. If not specified, the location of the parent resource is chosen. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The location of the managed resource group. If not specified, the location of the parent resource is chosen.", + SerializedName = @"location", + PossibleTypes = new [] { typeof(string) })] + string ManagedResourceGroupConfigurationLocation { get; set; } + /// + /// The name for the managed resource group. If not specified, the unique name is automatically generated. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The name for the managed resource group. If not specified, the unique name is automatically generated.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string ManagedResourceGroupConfigurationName { get; set; } + /// The resource ID of the extended location on which the resource will be created. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The resource ID of the extended location on which the resource will be created.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string ManagerExtendedLocationName { get; } + /// The extended location type, for example, CustomLocation. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The extended location type, for example, CustomLocation.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + string ManagerExtendedLocationType { get; } + /// The provisioning state of the cluster manager. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The provisioning state of the cluster manager.", + SerializedName = @"provisioningState", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Succeeded", "Failed", "Canceled", "Provisioning", "Accepted", "Updating")] + string ProvisioningState { get; } + /// + /// Field deprecated, this value will no longer influence the cluster manager allocation process and will be removed in a + /// future version. The size of the Azure virtual machines to use for hosting the cluster manager resource. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"Field deprecated, this value will no longer influence the cluster manager allocation process and will be removed in a future version. The size of the Azure virtual machines to use for hosting the cluster manager resource.", + SerializedName = @"vmSize", + PossibleTypes = new [] { typeof(string) })] + string VMSize { get; set; } + + } + /// ClusterManagerProperties represents the properties of a cluster manager. + internal partial interface IClusterManagerPropertiesInternal + + { + /// + /// The resource ID of the Log Analytics workspace that is used for the logs collection. + /// + string AnalyticsWorkspaceId { get; set; } + /// + /// Field deprecated, this value will no longer influence the cluster manager allocation process and will be removed in a + /// future version. The Azure availability zones within the region that will be used to support the cluster manager resource. + /// + System.Collections.Generic.List AvailabilityZone { get; set; } + /// + /// The list of the cluster versions the manager supports. It is used as input in clusterVersion property of a cluster resource. + /// + System.Collections.Generic.List ClusterVersion { get; set; } + /// + /// The detailed status that provides additional information about the cluster manager. + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Error", "Available", "Provisioning", "ProvisioningFailed", "Updating", "UpdateFailed")] + string DetailedStatus { get; set; } + /// The descriptive message about the current detailed status. + string DetailedStatusMessage { get; set; } + /// + /// The resource ID of the fabric controller that has one to one mapping with the cluster manager. + /// + string FabricControllerId { get; set; } + /// The configuration of the managed resource group associated with the resource. + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IManagedResourceGroupConfiguration ManagedResourceGroupConfiguration { get; set; } + /// + /// The location of the managed resource group. If not specified, the location of the parent resource is chosen. + /// + string ManagedResourceGroupConfigurationLocation { get; set; } + /// + /// The name for the managed resource group. If not specified, the unique name is automatically generated. + /// + string ManagedResourceGroupConfigurationName { get; set; } + /// + /// The extended location (custom location) that represents the cluster manager's control plane location. This extended location + /// is used when creating cluster and rack manifest resources. + /// + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocation ManagerExtendedLocation { get; set; } + /// The resource ID of the extended location on which the resource will be created. + string ManagerExtendedLocationName { get; set; } + /// The extended location type, for example, CustomLocation. + string ManagerExtendedLocationType { get; set; } + /// The provisioning state of the cluster manager. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Succeeded", "Failed", "Canceled", "Provisioning", "Accepted", "Updating")] + string ProvisioningState { get; set; } + /// + /// Field deprecated, this value will no longer influence the cluster manager allocation process and will be removed in a + /// future version. The size of the Azure virtual machines to use for hosting the cluster manager resource. + /// + string VMSize { get; set; } + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterManagerProperties.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterManagerProperties.json.cs new file mode 100644 index 000000000000..adf4c8843ab1 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterManagerProperties.json.cs @@ -0,0 +1,169 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + + /// ClusterManagerProperties represents the properties of a cluster manager. + public partial class ClusterManagerProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject instance to deserialize from. + internal ClusterManagerProperties(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_managedResourceGroupConfiguration = If( json?.PropertyT("managedResourceGroupConfiguration"), out var __jsonManagedResourceGroupConfiguration) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ManagedResourceGroupConfiguration.FromJson(__jsonManagedResourceGroupConfiguration) : _managedResourceGroupConfiguration;} + {_managerExtendedLocation = If( json?.PropertyT("managerExtendedLocation"), out var __jsonManagerExtendedLocation) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ExtendedLocation.FromJson(__jsonManagerExtendedLocation) : _managerExtendedLocation;} + {_analyticsWorkspaceId = If( json?.PropertyT("analyticsWorkspaceId"), out var __jsonAnalyticsWorkspaceId) ? (string)__jsonAnalyticsWorkspaceId : (string)_analyticsWorkspaceId;} + {_availabilityZone = If( json?.PropertyT("availabilityZones"), out var __jsonAvailabilityZones) ? If( __jsonAvailabilityZones as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : _availabilityZone;} + {_clusterVersion = If( json?.PropertyT("clusterVersions"), out var __jsonClusterVersions) ? If( __jsonClusterVersions as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.IClusterAvailableVersion) (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterAvailableVersion.FromJson(__p) )) ))() : null : _clusterVersion;} + {_detailedStatus = If( json?.PropertyT("detailedStatus"), out var __jsonDetailedStatus) ? (string)__jsonDetailedStatus : (string)_detailedStatus;} + {_detailedStatusMessage = If( json?.PropertyT("detailedStatusMessage"), out var __jsonDetailedStatusMessage) ? (string)__jsonDetailedStatusMessage : (string)_detailedStatusMessage;} + {_fabricControllerId = If( json?.PropertyT("fabricControllerId"), out var __jsonFabricControllerId) ? (string)__jsonFabricControllerId : (string)_fabricControllerId;} + {_provisioningState = If( json?.PropertyT("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)_provisioningState;} + {_vMSize = If( json?.PropertyT("vmSize"), out var __jsonVMSize) ? (string)__jsonVMSize : (string)_vMSize;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new ClusterManagerProperties(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._managedResourceGroupConfiguration ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) this._managedResourceGroupConfiguration.ToJson(null,serializationMode) : null, "managedResourceGroupConfiguration" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) + { + AddIf( null != this._managerExtendedLocation ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) this._managerExtendedLocation.ToJson(null,serializationMode) : null, "managerExtendedLocation" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)||serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate)) + { + AddIf( null != (((object)this._analyticsWorkspaceId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._analyticsWorkspaceId.ToString()) : null, "analyticsWorkspaceId" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)||serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate)) + { + if (null != this._availabilityZone) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.XNodeArray(); + foreach( var __x in this._availabilityZone ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("availabilityZones",__w); + } + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) + { + if (null != this._clusterVersion) + { + var __r = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.XNodeArray(); + foreach( var __s in this._clusterVersion ) + { + AddIf(__s?.ToJson(null, serializationMode) ,__r.Add); + } + container.Add("clusterVersions",__r); + } + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) + { + AddIf( null != (((object)this._detailedStatus)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._detailedStatus.ToString()) : null, "detailedStatus" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) + { + AddIf( null != (((object)this._detailedStatusMessage)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._detailedStatusMessage.ToString()) : null, "detailedStatusMessage" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)||serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate)) + { + AddIf( null != (((object)this._fabricControllerId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._fabricControllerId.ToString()) : null, "fabricControllerId" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) + { + AddIf( null != (((object)this._provisioningState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._provisioningState.ToString()) : null, "provisioningState" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)||serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate)) + { + AddIf( null != (((object)this._vMSize)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._vMSize.ToString()) : null, "vmSize" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterMetricsConfiguration.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterMetricsConfiguration.PowerShell.cs new file mode 100644 index 000000000000..b2a0769fd2d4 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterMetricsConfiguration.PowerShell.cs @@ -0,0 +1,342 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + + /// + /// ClusterMetricsConfiguration represents the metrics configuration of an on-premises Network Cloud cluster. + /// + [System.ComponentModel.TypeConverter(typeof(ClusterMetricsConfigurationTypeConverter))] + public partial class ClusterMetricsConfiguration + { + + /// + /// 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 ClusterMetricsConfiguration(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ExtendedLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationInternal)this).ExtendedLocation = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocation) content.GetValueForProperty("ExtendedLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationInternal)this).ExtendedLocation, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ExtendedLocationTypeConverter.ConvertFrom); + } + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterMetricsConfigurationPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Etag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationInternal)this).Etag, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)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("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedByType = (string) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedByType = (string) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.TrackedResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("ExtendedLocationName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationInternal)this).ExtendedLocationName = (string) content.GetValueForProperty("ExtendedLocationName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationInternal)this).ExtendedLocationName, global::System.Convert.ToString); + } + if (content.Contains("ExtendedLocationType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationInternal)this).ExtendedLocationType = (string) content.GetValueForProperty("ExtendedLocationType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationInternal)this).ExtendedLocationType, global::System.Convert.ToString); + } + if (content.Contains("CollectionInterval")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationInternal)this).CollectionInterval = (long) content.GetValueForProperty("CollectionInterval",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationInternal)this).CollectionInterval, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("DetailedStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationInternal)this).DetailedStatus = (string) content.GetValueForProperty("DetailedStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationInternal)this).DetailedStatus, global::System.Convert.ToString); + } + if (content.Contains("DetailedStatusMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationInternal)this).DetailedStatusMessage = (string) content.GetValueForProperty("DetailedStatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationInternal)this).DetailedStatusMessage, global::System.Convert.ToString); + } + if (content.Contains("DisabledMetric")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationInternal)this).DisabledMetric = (System.Collections.Generic.List) content.GetValueForProperty("DisabledMetric",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationInternal)this).DisabledMetric, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("EnabledMetric")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationInternal)this).EnabledMetric = (System.Collections.Generic.List) content.GetValueForProperty("EnabledMetric",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationInternal)this).EnabledMetric, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationInternal)this).ProvisioningState, 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 ClusterMetricsConfiguration(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ExtendedLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationInternal)this).ExtendedLocation = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocation) content.GetValueForProperty("ExtendedLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationInternal)this).ExtendedLocation, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ExtendedLocationTypeConverter.ConvertFrom); + } + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterMetricsConfigurationPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Etag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationInternal)this).Etag, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)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("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedByType = (string) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedByType = (string) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.TrackedResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("ExtendedLocationName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationInternal)this).ExtendedLocationName = (string) content.GetValueForProperty("ExtendedLocationName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationInternal)this).ExtendedLocationName, global::System.Convert.ToString); + } + if (content.Contains("ExtendedLocationType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationInternal)this).ExtendedLocationType = (string) content.GetValueForProperty("ExtendedLocationType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationInternal)this).ExtendedLocationType, global::System.Convert.ToString); + } + if (content.Contains("CollectionInterval")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationInternal)this).CollectionInterval = (long) content.GetValueForProperty("CollectionInterval",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationInternal)this).CollectionInterval, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("DetailedStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationInternal)this).DetailedStatus = (string) content.GetValueForProperty("DetailedStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationInternal)this).DetailedStatus, global::System.Convert.ToString); + } + if (content.Contains("DetailedStatusMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationInternal)this).DetailedStatusMessage = (string) content.GetValueForProperty("DetailedStatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationInternal)this).DetailedStatusMessage, global::System.Convert.ToString); + } + if (content.Contains("DisabledMetric")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationInternal)this).DisabledMetric = (System.Collections.Generic.List) content.GetValueForProperty("DisabledMetric",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationInternal)this).DisabledMetric, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("EnabledMetric")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationInternal)this).EnabledMetric = (System.Collections.Generic.List) content.GetValueForProperty("EnabledMetric",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationInternal)this).EnabledMetric, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationInternal)this).ProvisioningState, 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.NetworkCloud.Models.IClusterMetricsConfiguration DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ClusterMetricsConfiguration(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.NetworkCloud.Models.IClusterMetricsConfiguration DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ClusterMetricsConfiguration(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.NetworkCloud.Models.IClusterMetricsConfiguration FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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(); + } + } + /// ClusterMetricsConfiguration represents the metrics configuration of an on-premises Network Cloud cluster. + [System.ComponentModel.TypeConverter(typeof(ClusterMetricsConfigurationTypeConverter))] + public partial interface IClusterMetricsConfiguration + + { + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterMetricsConfiguration.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterMetricsConfiguration.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterMetricsConfiguration.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterMetricsConfiguration.TypeConverter.cs index 9271fc262ff4..c27f21d942a1 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterMetricsConfiguration.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterMetricsConfiguration.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IClusterMetricsConfiguration ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfiguration ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfiguration).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfiguration).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterMetricsConfiguration.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterMetricsConfiguration.cs new file mode 100644 index 000000000000..a7b067fa5fd1 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterMetricsConfiguration.cs @@ -0,0 +1,354 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + + /// + /// ClusterMetricsConfiguration represents the metrics configuration of an on-premises Network Cloud cluster. + /// + public partial class ClusterMetricsConfiguration : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfiguration, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationInternal, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResource __trackedResource = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.TrackedResource(); + + /// The interval in minutes by which metrics will be collected. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public long CollectionInterval { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationPropertiesInternal)Property).CollectionInterval; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationPropertiesInternal)Property).CollectionInterval = value ; } + + /// The more detailed status of the metrics configuration. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string DetailedStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationPropertiesInternal)Property).DetailedStatus; } + + /// The descriptive message about the current detailed status. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string DetailedStatusMessage { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationPropertiesInternal)Property).DetailedStatusMessage; } + + /// + /// The list of metrics that are available for the cluster but disabled at the moment. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public System.Collections.Generic.List DisabledMetric { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationPropertiesInternal)Property).DisabledMetric; } + + /// + /// The list of metric names that have been chosen to be enabled in addition to the core set of enabled metrics. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public System.Collections.Generic.List EnabledMetric { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationPropertiesInternal)Property).EnabledMetric; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationPropertiesInternal)Property).EnabledMetric = value ?? null /* arrayOf */; } + + /// Backing field for property. + private string _etag; + + /// Resource ETag. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string Etag { get => this._etag; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocation _extendedLocation; + + /// The extended location of the cluster associated with the resource. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocation ExtendedLocation { get => (this._extendedLocation = this._extendedLocation ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ExtendedLocation()); set => this._extendedLocation = value; } + + /// The resource ID of the extended location on which the resource will be created. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string ExtendedLocationName { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocationInternal)ExtendedLocation).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocationInternal)ExtendedLocation).Name = value ?? null; } + + /// The extended location type, for example, CustomLocation. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string ExtendedLocationType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocationInternal)ExtendedLocation).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocationInternal)ExtendedLocation).Type = value ?? null; } + + /// + /// Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).Id; } + + /// The geo-location where the resource lives + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)__trackedResource).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)__trackedResource).Location = value ?? null; } + + /// Internal Acessors for DetailedStatus + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationInternal.DetailedStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationPropertiesInternal)Property).DetailedStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationPropertiesInternal)Property).DetailedStatus = value ?? null; } + + /// Internal Acessors for DetailedStatusMessage + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationInternal.DetailedStatusMessage { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationPropertiesInternal)Property).DetailedStatusMessage; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationPropertiesInternal)Property).DetailedStatusMessage = value ?? null; } + + /// Internal Acessors for DisabledMetric + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationInternal.DisabledMetric { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationPropertiesInternal)Property).DisabledMetric; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationPropertiesInternal)Property).DisabledMetric = value ?? null /* arrayOf */; } + + /// Internal Acessors for Etag + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationInternal.Etag { get => this._etag; set { {_etag = value;} } } + + /// Internal Acessors for ExtendedLocation + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocation Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationInternal.ExtendedLocation { get => (this._extendedLocation = this._extendedLocation ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ExtendedLocation()); set { {_extendedLocation = value;} } } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationProperties Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterMetricsConfigurationProperties()); set { {_property = value;} } } + + /// Internal Acessors for ProvisioningState + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationPropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationPropertiesInternal)Property).ProvisioningState = value ?? null; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).Id = value ?? null; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).Name = value ?? null; } + + /// Internal Acessors for SystemData + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISystemData Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemData; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemData = value ?? null /* model class */; } + + /// Internal Acessors for SystemDataCreatedAt + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataCreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataCreatedAt = value ?? default(global::System.DateTime); } + + /// Internal Acessors for SystemDataCreatedBy + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataCreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataCreatedBy = value ?? null; } + + /// Internal Acessors for SystemDataCreatedByType + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataCreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataCreatedByType = value ?? null; } + + /// Internal Acessors for SystemDataLastModifiedAt + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedAt = value ?? default(global::System.DateTime); } + + /// Internal Acessors for SystemDataLastModifiedBy + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedBy = value ?? null; } + + /// Internal Acessors for SystemDataLastModifiedByType + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedByType = value ?? null; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).Type = value ?? null; } + + /// The name of the resource + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).Name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationProperties _property; + + /// The list of the resource properties. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterMetricsConfigurationProperties()); set => this._property = value; } + + /// The provisioning state of the metrics configuration. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationPropertiesInternal)Property).ProvisioningState; } + + /// Gets the resource group name + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string ResourceGroupName { get => (new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Success ? new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Groups["resourceGroupName"].Value : null); } + + /// + /// Azure Resource Manager metadata containing createdBy and modifiedBy information. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISystemData SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemData; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemData = value ?? null /* model class */; } + + /// The timestamp of resource creation (UTC). + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataCreatedAt; } + + /// The identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataCreatedBy; } + + /// The type of identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public string SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataCreatedByType; } + + /// The timestamp of resource last modification (UTC) + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedAt; } + + /// The identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedBy; } + + /// The type of identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public string SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedByType; } + + /// Resource tags. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)__trackedResource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).Type; } + + /// Creates an new instance. + public ClusterMetricsConfiguration() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__trackedResource), __trackedResource); + await eventListener.AssertObjectIsValid(nameof(__trackedResource), __trackedResource); + } + } + /// ClusterMetricsConfiguration represents the metrics configuration of an on-premises Network Cloud cluster. + public partial interface IClusterMetricsConfiguration : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResource + { + /// The interval in minutes by which metrics will be collected. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The interval in minutes by which metrics will be collected.", + SerializedName = @"collectionInterval", + PossibleTypes = new [] { typeof(long) })] + long CollectionInterval { get; set; } + /// The more detailed status of the metrics configuration. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The more detailed status of the metrics configuration.", + SerializedName = @"detailedStatus", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Processing", "Applied", "Error")] + string DetailedStatus { get; } + /// The descriptive message about the current detailed status. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The descriptive message about the current detailed status.", + SerializedName = @"detailedStatusMessage", + PossibleTypes = new [] { typeof(string) })] + string DetailedStatusMessage { get; } + /// + /// The list of metrics that are available for the cluster but disabled at the moment. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The list of metrics that are available for the cluster but disabled at the moment.", + SerializedName = @"disabledMetrics", + PossibleTypes = new [] { typeof(string) })] + System.Collections.Generic.List DisabledMetric { get; } + /// + /// The list of metric names that have been chosen to be enabled in addition to the core set of enabled metrics. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The list of metric names that have been chosen to be enabled in addition to the core set of enabled metrics.", + SerializedName = @"enabledMetrics", + PossibleTypes = new [] { typeof(string) })] + System.Collections.Generic.List EnabledMetric { get; set; } + /// Resource ETag. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"Resource ETag.", + SerializedName = @"etag", + PossibleTypes = new [] { typeof(string) })] + string Etag { get; } + /// The resource ID of the extended location on which the resource will be created. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The resource ID of the extended location on which the resource will be created.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string ExtendedLocationName { get; set; } + /// The extended location type, for example, CustomLocation. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The extended location type, for example, CustomLocation.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + string ExtendedLocationType { get; set; } + /// The provisioning state of the metrics configuration. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The provisioning state of the metrics configuration.", + SerializedName = @"provisioningState", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Succeeded", "Failed", "Canceled", "Accepted", "Provisioning")] + string ProvisioningState { get; } + + } + /// ClusterMetricsConfiguration represents the metrics configuration of an on-premises Network Cloud cluster. + internal partial interface IClusterMetricsConfigurationInternal : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal + { + /// The interval in minutes by which metrics will be collected. + long CollectionInterval { get; set; } + /// The more detailed status of the metrics configuration. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Processing", "Applied", "Error")] + string DetailedStatus { get; set; } + /// The descriptive message about the current detailed status. + string DetailedStatusMessage { get; set; } + /// + /// The list of metrics that are available for the cluster but disabled at the moment. + /// + System.Collections.Generic.List DisabledMetric { get; set; } + /// + /// The list of metric names that have been chosen to be enabled in addition to the core set of enabled metrics. + /// + System.Collections.Generic.List EnabledMetric { get; set; } + /// Resource ETag. + string Etag { get; set; } + /// The extended location of the cluster associated with the resource. + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocation ExtendedLocation { get; set; } + /// The resource ID of the extended location on which the resource will be created. + string ExtendedLocationName { get; set; } + /// The extended location type, for example, CustomLocation. + string ExtendedLocationType { get; set; } + /// The list of the resource properties. + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationProperties Property { get; set; } + /// The provisioning state of the metrics configuration. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Succeeded", "Failed", "Canceled", "Accepted", "Provisioning")] + string ProvisioningState { get; set; } + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterMetricsConfiguration.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterMetricsConfiguration.json.cs similarity index 91% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterMetricsConfiguration.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterMetricsConfiguration.json.cs index 818e39ceb7d2..cefbd51c5536 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterMetricsConfiguration.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterMetricsConfiguration.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -67,21 +67,21 @@ internal ClusterMetricsConfiguration(Microsoft.Azure.PowerShell.Cmdlets.NetworkC { return; } - __trackedResource = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.TrackedResource(json); - {_extendedLocation = If( json?.PropertyT("extendedLocation"), out var __jsonExtendedLocation) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ExtendedLocation.FromJson(__jsonExtendedLocation) : ExtendedLocation;} - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ClusterMetricsConfigurationProperties.FromJson(__jsonProperties) : Property;} - {_etag = If( json?.PropertyT("etag"), out var __jsonEtag) ? (string)__jsonEtag : (string)Etag;} + __trackedResource = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.TrackedResource(json); + {_extendedLocation = If( json?.PropertyT("extendedLocation"), out var __jsonExtendedLocation) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ExtendedLocation.FromJson(__jsonExtendedLocation) : _extendedLocation;} + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterMetricsConfigurationProperties.FromJson(__jsonProperties) : _property;} + {_etag = If( json?.PropertyT("etag"), out var __jsonEtag) ? (string)__jsonEtag : (string)_etag;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfiguration. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfiguration. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfiguration. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfiguration. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfiguration FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfiguration FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new ClusterMetricsConfiguration(json) : null; } @@ -108,7 +108,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode ToJ __trackedResource?.ToJson(container, serializationMode); AddIf( null != this._extendedLocation ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) this._extendedLocation.ToJson(null,serializationMode) : null, "extendedLocation" ,container.Add ); AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._etag)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._etag.ToString()) : null, "etag" ,container.Add ); } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterMetricsConfigurationList.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterMetricsConfigurationList.PowerShell.cs similarity index 75% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterMetricsConfigurationList.PowerShell.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterMetricsConfigurationList.PowerShell.cs index 61c32cbae366..1cf0845f6af9 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterMetricsConfigurationList.PowerShell.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterMetricsConfigurationList.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; @@ -65,7 +65,7 @@ public partial class ClusterMetricsConfigurationList 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,17 +80,17 @@ internal ClusterMetricsConfigurationList(global::System.Collections.IDictionary // actually deserialize if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationListInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationListInternal)this).NextLink, global::System.Convert.ToString); } if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfiguration[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ClusterMetricsConfigurationTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationListInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationListInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterMetricsConfigurationTypeConverter.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. @@ -105,39 +105,37 @@ internal ClusterMetricsConfigurationList(global::System.Management.Automation.PS // actually deserialize if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationListInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationListInternal)this).NextLink, global::System.Convert.ToString); } if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfiguration[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ClusterMetricsConfigurationTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationListInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationListInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterMetricsConfigurationTypeConverter.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.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationList DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationList DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ClusterMetricsConfigurationList(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.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ClusterMetricsConfigurationList(content); } @@ -147,7 +145,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterMetricsConfigurationList.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterMetricsConfigurationList.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterMetricsConfigurationList.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterMetricsConfigurationList.TypeConverter.cs index 4285668252b2..ebdf67ebbccb 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterMetricsConfigurationList.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterMetricsConfigurationList.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationList ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationList ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationList).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationList).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterMetricsConfigurationList.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterMetricsConfigurationList.cs new file mode 100644 index 000000000000..8caf150741b0 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterMetricsConfigurationList.cs @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + + /// + /// ClusterMetricsConfigurationList represents a list of metrics configuration of the cluster. + /// + public partial class ClusterMetricsConfigurationList : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationList, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationListInternal + { + + /// Backing field for property. + private string _nextLink; + + /// The link used to get the next page of operations. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; set => this._nextLink = value; } + + /// Backing field for property. + private System.Collections.Generic.List _value; + + /// The list of metrics configurations. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public System.Collections.Generic.List Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public ClusterMetricsConfigurationList() + { + + } + } + /// ClusterMetricsConfigurationList represents a list of metrics configuration of the cluster. + public partial interface IClusterMetricsConfigurationList : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable + { + /// The link used to get the next page of operations. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The link used to get the next page of operations.", + SerializedName = @"nextLink", + PossibleTypes = new [] { typeof(string) })] + string NextLink { get; set; } + /// The list of metrics configurations. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The list of metrics configurations.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfiguration) })] + System.Collections.Generic.List Value { get; set; } + + } + /// ClusterMetricsConfigurationList represents a list of metrics configuration of the cluster. + internal partial interface IClusterMetricsConfigurationListInternal + + { + /// The link used to get the next page of operations. + string NextLink { get; set; } + /// The list of metrics configurations. + System.Collections.Generic.List Value { get; set; } + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterMetricsConfigurationList.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterMetricsConfigurationList.json.cs similarity index 89% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterMetricsConfigurationList.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterMetricsConfigurationList.json.cs index 9fd470891026..a6d8b29e0993 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterMetricsConfigurationList.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterMetricsConfigurationList.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -67,19 +67,19 @@ internal ClusterMetricsConfigurationList(Microsoft.Azure.PowerShell.Cmdlets.Netw { return; } - {_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.NetworkCloud.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.NetworkCloud.Models.Api20250201.IClusterMetricsConfiguration) (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ClusterMetricsConfiguration.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.NetworkCloud.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.NetworkCloud.Models.IClusterMetricsConfiguration) (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterMetricsConfiguration.FromJson(__u) )) ))() : null : _value;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationList. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationList. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationList. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationList. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationList FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationList FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new ClusterMetricsConfigurationList(json) : null; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterMetricsConfigurationPatchParameters.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterMetricsConfigurationPatchParameters.PowerShell.cs new file mode 100644 index 000000000000..9cde97142e98 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterMetricsConfigurationPatchParameters.PowerShell.cs @@ -0,0 +1,195 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + + /// + /// ClusterMetricsConfigurationPatchParameters represents the body of the request to patch the metrics configuration of cluster. + /// + [System.ComponentModel.TypeConverter(typeof(ClusterMetricsConfigurationPatchParametersTypeConverter))] + public partial class ClusterMetricsConfigurationPatchParameters + { + + /// + /// 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 ClusterMetricsConfigurationPatchParameters(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.NetworkCloud.Models.IClusterMetricsConfigurationPatchParametersInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationPatchProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationPatchParametersInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterMetricsConfigurationPatchPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationPatchParametersInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationPatchParametersTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationPatchParametersInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterMetricsConfigurationPatchParametersTagsTypeConverter.ConvertFrom); + } + if (content.Contains("CollectionInterval")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationPatchParametersInternal)this).CollectionInterval = (long?) content.GetValueForProperty("CollectionInterval",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationPatchParametersInternal)this).CollectionInterval, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("EnabledMetric")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationPatchParametersInternal)this).EnabledMetric = (System.Collections.Generic.List) content.GetValueForProperty("EnabledMetric",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationPatchParametersInternal)this).EnabledMetric, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ClusterMetricsConfigurationPatchParameters(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.NetworkCloud.Models.IClusterMetricsConfigurationPatchParametersInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationPatchProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationPatchParametersInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterMetricsConfigurationPatchPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationPatchParametersInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationPatchParametersTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationPatchParametersInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterMetricsConfigurationPatchParametersTagsTypeConverter.ConvertFrom); + } + if (content.Contains("CollectionInterval")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationPatchParametersInternal)this).CollectionInterval = (long?) content.GetValueForProperty("CollectionInterval",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationPatchParametersInternal)this).CollectionInterval, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("EnabledMetric")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationPatchParametersInternal)this).EnabledMetric = (System.Collections.Generic.List) content.GetValueForProperty("EnabledMetric",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationPatchParametersInternal)this).EnabledMetric, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationPatchParameters DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ClusterMetricsConfigurationPatchParameters(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.NetworkCloud.Models.IClusterMetricsConfigurationPatchParameters DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ClusterMetricsConfigurationPatchParameters(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.NetworkCloud.Models.IClusterMetricsConfigurationPatchParameters FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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(); + } + } + /// ClusterMetricsConfigurationPatchParameters represents the body of the request to patch the metrics configuration of cluster. + [System.ComponentModel.TypeConverter(typeof(ClusterMetricsConfigurationPatchParametersTypeConverter))] + public partial interface IClusterMetricsConfigurationPatchParameters + + { + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterMetricsConfigurationPatchParameters.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterMetricsConfigurationPatchParameters.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterMetricsConfigurationPatchParameters.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterMetricsConfigurationPatchParameters.TypeConverter.cs index e56b4a002f0b..949525ed05a6 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterMetricsConfigurationPatchParameters.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterMetricsConfigurationPatchParameters.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationPatchParameters ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationPatchParameters ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationPatchParameters).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationPatchParameters).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterMetricsConfigurationPatchParameters.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterMetricsConfigurationPatchParameters.cs new file mode 100644 index 000000000000..44ba9c42caf3 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterMetricsConfigurationPatchParameters.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + + /// + /// ClusterMetricsConfigurationPatchParameters represents the body of the request to patch the metrics configuration of cluster. + /// + public partial class ClusterMetricsConfigurationPatchParameters : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationPatchParameters, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationPatchParametersInternal + { + + /// The interval in minutes by which metrics will be collected. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public long? CollectionInterval { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationPatchPropertiesInternal)Property).CollectionInterval; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationPatchPropertiesInternal)Property).CollectionInterval = value ?? default(long); } + + /// + /// The list of metric names that have been chosen to be enabled in addition to the core set of enabled metrics. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public System.Collections.Generic.List EnabledMetric { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationPatchPropertiesInternal)Property).EnabledMetric; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationPatchPropertiesInternal)Property).EnabledMetric = value ?? null /* arrayOf */; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationPatchProperties Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationPatchParametersInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterMetricsConfigurationPatchProperties()); set { {_property = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationPatchProperties _property; + + /// The list of the resource properties. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationPatchProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterMetricsConfigurationPatchProperties()); set => this._property = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationPatchParametersTags _tag; + + /// The Azure resource tags that will replace the existing ones. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationPatchParametersTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterMetricsConfigurationPatchParametersTags()); set => this._tag = value; } + + /// + /// Creates an new instance. + /// + public ClusterMetricsConfigurationPatchParameters() + { + + } + } + /// ClusterMetricsConfigurationPatchParameters represents the body of the request to patch the metrics configuration of cluster. + public partial interface IClusterMetricsConfigurationPatchParameters : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable + { + /// The interval in minutes by which metrics will be collected. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The interval in minutes by which metrics will be collected.", + SerializedName = @"collectionInterval", + PossibleTypes = new [] { typeof(long) })] + long? CollectionInterval { get; set; } + /// + /// The list of metric names that have been chosen to be enabled in addition to the core set of enabled metrics. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The list of metric names that have been chosen to be enabled in addition to the core set of enabled metrics.", + SerializedName = @"enabledMetrics", + PossibleTypes = new [] { typeof(string) })] + System.Collections.Generic.List EnabledMetric { get; set; } + /// The Azure resource tags that will replace the existing ones. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The Azure resource tags that will replace the existing ones.", + SerializedName = @"tags", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationPatchParametersTags) })] + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationPatchParametersTags Tag { get; set; } + + } + /// ClusterMetricsConfigurationPatchParameters represents the body of the request to patch the metrics configuration of cluster. + internal partial interface IClusterMetricsConfigurationPatchParametersInternal + + { + /// The interval in minutes by which metrics will be collected. + long? CollectionInterval { get; set; } + /// + /// The list of metric names that have been chosen to be enabled in addition to the core set of enabled metrics. + /// + System.Collections.Generic.List EnabledMetric { get; set; } + /// The list of the resource properties. + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationPatchProperties Property { get; set; } + /// The Azure resource tags that will replace the existing ones. + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationPatchParametersTags Tag { get; set; } + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterMetricsConfigurationPatchParameters.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterMetricsConfigurationPatchParameters.json.cs similarity index 92% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterMetricsConfigurationPatchParameters.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterMetricsConfigurationPatchParameters.json.cs index f3cb3c68ca04..6ab42de932cf 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterMetricsConfigurationPatchParameters.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterMetricsConfigurationPatchParameters.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -67,19 +67,19 @@ internal ClusterMetricsConfigurationPatchParameters(Microsoft.Azure.PowerShell.C { return; } - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ClusterMetricsConfigurationPatchProperties.FromJson(__jsonProperties) : Property;} - {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ClusterMetricsConfigurationPatchParametersTags.FromJson(__jsonTags) : Tag;} + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterMetricsConfigurationPatchProperties.FromJson(__jsonProperties) : _property;} + {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterMetricsConfigurationPatchParametersTags.FromJson(__jsonTags) : _tag;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationPatchParameters. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationPatchParameters. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationPatchParameters. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationPatchParameters. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationPatchParameters FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationPatchParameters FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new ClusterMetricsConfigurationPatchParameters(json) : null; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterMetricsConfigurationPatchParametersTags.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterMetricsConfigurationPatchParametersTags.PowerShell.cs similarity index 88% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterMetricsConfigurationPatchParametersTags.PowerShell.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterMetricsConfigurationPatchParametersTags.PowerShell.cs index 293f2a689644..20e11da4e57e 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterMetricsConfigurationPatchParametersTags.PowerShell.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterMetricsConfigurationPatchParametersTags.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; @@ -63,7 +63,7 @@ public partial class ClusterMetricsConfigurationPatchParametersTags 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 ClusterMetricsConfigurationPatchParametersTags(global::System.Collectio } /// - /// 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 ClusterMetricsConfigurationPatchParametersTags(global::System.Managemen } /// - /// 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.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationPatchParametersTags DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationPatchParametersTags DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ClusterMetricsConfigurationPatchParametersTags(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.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationPatchParametersTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationPatchParametersTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ClusterMetricsConfigurationPatchParametersTags(content); } @@ -136,7 +136,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201 /// /// an instance of the model class. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationPatchParametersTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationPatchParametersTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterMetricsConfigurationPatchParametersTags.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterMetricsConfigurationPatchParametersTags.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterMetricsConfigurationPatchParametersTags.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterMetricsConfigurationPatchParametersTags.TypeConverter.cs index 11dbcb360a2b..06903c1fd2c6 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterMetricsConfigurationPatchParametersTags.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterMetricsConfigurationPatchParametersTags.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationPatchParametersTags ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationPatchParametersTags ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationPatchParametersTags).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationPatchParametersTags).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterMetricsConfigurationPatchParametersTags.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterMetricsConfigurationPatchParametersTags.cs similarity index 83% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterMetricsConfigurationPatchParametersTags.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterMetricsConfigurationPatchParametersTags.cs index c2a2cce73608..c4b102818b1c 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterMetricsConfigurationPatchParametersTags.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterMetricsConfigurationPatchParametersTags.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; /// The Azure resource tags that will replace the existing ones. public partial class ClusterMetricsConfigurationPatchParametersTags : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationPatchParametersTags, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationPatchParametersTagsInternal + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationPatchParametersTags, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationPatchParametersTagsInternal { /// diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterMetricsConfigurationPatchParametersTags.dictionary.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterMetricsConfigurationPatchParametersTags.dictionary.cs similarity index 96% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterMetricsConfigurationPatchParametersTags.dictionary.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterMetricsConfigurationPatchParametersTags.dictionary.cs index 392698aa1bea..3a49738388a8 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterMetricsConfigurationPatchParametersTags.dictionary.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterMetricsConfigurationPatchParametersTags.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.ClusterMetricsConfigurationPatchParametersTags source) => source.__additionalProperties; + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterMetricsConfigurationPatchParametersTags source) => source.__additionalProperties; } } \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterMetricsConfigurationPatchParametersTags.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterMetricsConfigurationPatchParametersTags.json.cs similarity index 95% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterMetricsConfigurationPatchParametersTags.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterMetricsConfigurationPatchParametersTags.json.cs index 6d81aec527b7..ece99339aee7 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterMetricsConfigurationPatchParametersTags.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterMetricsConfigurationPatchParametersTags.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -72,13 +72,13 @@ internal ClusterMetricsConfigurationPatchParametersTags(Microsoft.Azure.PowerShe } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationPatchParametersTags. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationPatchParametersTags. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationPatchParametersTags. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationPatchParametersTags. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationPatchParametersTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationPatchParametersTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new ClusterMetricsConfigurationPatchParametersTags(json) : null; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterMetricsConfigurationPatchProperties.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterMetricsConfigurationPatchProperties.PowerShell.cs similarity index 77% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterMetricsConfigurationPatchProperties.PowerShell.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterMetricsConfigurationPatchProperties.PowerShell.cs index b816eea273ed..90166b464e36 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterMetricsConfigurationPatchProperties.PowerShell.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterMetricsConfigurationPatchProperties.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; @@ -65,7 +65,7 @@ public partial class ClusterMetricsConfigurationPatchProperties 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,17 +80,17 @@ internal ClusterMetricsConfigurationPatchProperties(global::System.Collections.I // actually deserialize if (content.Contains("CollectionInterval")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationPatchPropertiesInternal)this).CollectionInterval = (long?) content.GetValueForProperty("CollectionInterval",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationPatchPropertiesInternal)this).CollectionInterval, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationPatchPropertiesInternal)this).CollectionInterval = (long?) content.GetValueForProperty("CollectionInterval",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationPatchPropertiesInternal)this).CollectionInterval, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); } if (content.Contains("EnabledMetric")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationPatchPropertiesInternal)this).EnabledMetric = (string[]) content.GetValueForProperty("EnabledMetric",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationPatchPropertiesInternal)this).EnabledMetric, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationPatchPropertiesInternal)this).EnabledMetric = (System.Collections.Generic.List) content.GetValueForProperty("EnabledMetric",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationPatchPropertiesInternal)this).EnabledMetric, __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. @@ -105,39 +105,39 @@ internal ClusterMetricsConfigurationPatchProperties(global::System.Management.Au // actually deserialize if (content.Contains("CollectionInterval")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationPatchPropertiesInternal)this).CollectionInterval = (long?) content.GetValueForProperty("CollectionInterval",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationPatchPropertiesInternal)this).CollectionInterval, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationPatchPropertiesInternal)this).CollectionInterval = (long?) content.GetValueForProperty("CollectionInterval",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationPatchPropertiesInternal)this).CollectionInterval, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); } if (content.Contains("EnabledMetric")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationPatchPropertiesInternal)this).EnabledMetric = (string[]) content.GetValueForProperty("EnabledMetric",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationPatchPropertiesInternal)this).EnabledMetric, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationPatchPropertiesInternal)this).EnabledMetric = (System.Collections.Generic.List) content.GetValueForProperty("EnabledMetric",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationPatchPropertiesInternal)this).EnabledMetric, __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.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationPatchProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationPatchProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ClusterMetricsConfigurationPatchProperties(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.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationPatchProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationPatchProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ClusterMetricsConfigurationPatchProperties(content); } @@ -150,7 +150,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201 /// /// an instance of the model class. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationPatchProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationPatchProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterMetricsConfigurationPatchProperties.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterMetricsConfigurationPatchProperties.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterMetricsConfigurationPatchProperties.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterMetricsConfigurationPatchProperties.TypeConverter.cs index 4e1f733f6efb..7700f187ce92 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterMetricsConfigurationPatchProperties.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterMetricsConfigurationPatchProperties.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationPatchProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationPatchProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationPatchProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationPatchProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterMetricsConfigurationPatchProperties.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterMetricsConfigurationPatchProperties.cs similarity index 83% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterMetricsConfigurationPatchProperties.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterMetricsConfigurationPatchProperties.cs index de4874ab2720..8029e7f828bf 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterMetricsConfigurationPatchProperties.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterMetricsConfigurationPatchProperties.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -11,8 +11,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201 /// ClusterMetricsConfigurationPatchProperties represents the properties of metrics configuration for the cluster for patching. /// public partial class ClusterMetricsConfigurationPatchProperties : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationPatchProperties, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationPatchPropertiesInternal + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationPatchProperties, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationPatchPropertiesInternal { /// Backing field for property. @@ -23,13 +23,13 @@ public partial class ClusterMetricsConfigurationPatchProperties : public long? CollectionInterval { get => this._collectionInterval; set => this._collectionInterval = value; } /// Backing field for property. - private string[] _enabledMetric; + private System.Collections.Generic.List _enabledMetric; /// /// The list of metric names that have been chosen to be enabled in addition to the core set of enabled metrics. /// [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string[] EnabledMetric { get => this._enabledMetric; set => this._enabledMetric = value; } + public System.Collections.Generic.List EnabledMetric { get => this._enabledMetric; set => this._enabledMetric = value; } /// /// Creates an new instance. @@ -47,6 +47,9 @@ public partial interface IClusterMetricsConfigurationPatchProperties : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The interval in minutes by which metrics will be collected.", SerializedName = @"collectionInterval", PossibleTypes = new [] { typeof(long) })] @@ -57,10 +60,13 @@ public partial interface IClusterMetricsConfigurationPatchProperties : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The list of metric names that have been chosen to be enabled in addition to the core set of enabled metrics.", SerializedName = @"enabledMetrics", PossibleTypes = new [] { typeof(string) })] - string[] EnabledMetric { get; set; } + System.Collections.Generic.List EnabledMetric { get; set; } } /// ClusterMetricsConfigurationPatchProperties represents the properties of metrics configuration for the cluster for patching. @@ -72,7 +78,7 @@ internal partial interface IClusterMetricsConfigurationPatchPropertiesInternal /// /// The list of metric names that have been chosen to be enabled in addition to the core set of enabled metrics. /// - string[] EnabledMetric { get; set; } + System.Collections.Generic.List EnabledMetric { get; set; } } } \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterMetricsConfigurationPatchProperties.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterMetricsConfigurationPatchProperties.json.cs similarity index 91% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterMetricsConfigurationPatchProperties.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterMetricsConfigurationPatchProperties.json.cs index 2bf8ec59d958..a4b333cf7486 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterMetricsConfigurationPatchProperties.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterMetricsConfigurationPatchProperties.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -67,19 +67,19 @@ internal ClusterMetricsConfigurationPatchProperties(Microsoft.Azure.PowerShell.C { return; } - {_collectionInterval = If( json?.PropertyT("collectionInterval"), out var __jsonCollectionInterval) ? (long?)__jsonCollectionInterval : CollectionInterval;} - {_enabledMetric = If( json?.PropertyT("enabledMetrics"), out var __jsonEnabledMetrics) ? If( __jsonEnabledMetrics as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : EnabledMetric;} + {_collectionInterval = If( json?.PropertyT("collectionInterval"), out var __jsonCollectionInterval) ? (long?)__jsonCollectionInterval : _collectionInterval;} + {_enabledMetric = If( json?.PropertyT("enabledMetrics"), out var __jsonEnabledMetrics) ? If( __jsonEnabledMetrics as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : _enabledMetric;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationPatchProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationPatchProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationPatchProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationPatchProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationPatchProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationPatchProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new ClusterMetricsConfigurationPatchProperties(json) : null; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterMetricsConfigurationProperties.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterMetricsConfigurationProperties.PowerShell.cs new file mode 100644 index 000000000000..21f6ed172ead --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterMetricsConfigurationProperties.PowerShell.cs @@ -0,0 +1,211 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + + /// + /// ClusterMetricsConfigurationProperties represents the properties of metrics configuration for the cluster. + /// + [System.ComponentModel.TypeConverter(typeof(ClusterMetricsConfigurationPropertiesTypeConverter))] + public partial class ClusterMetricsConfigurationProperties + { + + /// + /// 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 ClusterMetricsConfigurationProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("CollectionInterval")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationPropertiesInternal)this).CollectionInterval = (long) content.GetValueForProperty("CollectionInterval",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationPropertiesInternal)this).CollectionInterval, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("DetailedStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationPropertiesInternal)this).DetailedStatus = (string) content.GetValueForProperty("DetailedStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationPropertiesInternal)this).DetailedStatus, global::System.Convert.ToString); + } + if (content.Contains("DetailedStatusMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationPropertiesInternal)this).DetailedStatusMessage = (string) content.GetValueForProperty("DetailedStatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationPropertiesInternal)this).DetailedStatusMessage, global::System.Convert.ToString); + } + if (content.Contains("DisabledMetric")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationPropertiesInternal)this).DisabledMetric = (System.Collections.Generic.List) content.GetValueForProperty("DisabledMetric",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationPropertiesInternal)this).DisabledMetric, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("EnabledMetric")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationPropertiesInternal)this).EnabledMetric = (System.Collections.Generic.List) content.GetValueForProperty("EnabledMetric",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationPropertiesInternal)this).EnabledMetric, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationPropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationPropertiesInternal)this).ProvisioningState, 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 ClusterMetricsConfigurationProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("CollectionInterval")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationPropertiesInternal)this).CollectionInterval = (long) content.GetValueForProperty("CollectionInterval",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationPropertiesInternal)this).CollectionInterval, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("DetailedStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationPropertiesInternal)this).DetailedStatus = (string) content.GetValueForProperty("DetailedStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationPropertiesInternal)this).DetailedStatus, global::System.Convert.ToString); + } + if (content.Contains("DetailedStatusMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationPropertiesInternal)this).DetailedStatusMessage = (string) content.GetValueForProperty("DetailedStatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationPropertiesInternal)this).DetailedStatusMessage, global::System.Convert.ToString); + } + if (content.Contains("DisabledMetric")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationPropertiesInternal)this).DisabledMetric = (System.Collections.Generic.List) content.GetValueForProperty("DisabledMetric",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationPropertiesInternal)this).DisabledMetric, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("EnabledMetric")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationPropertiesInternal)this).EnabledMetric = (System.Collections.Generic.List) content.GetValueForProperty("EnabledMetric",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationPropertiesInternal)this).EnabledMetric, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationPropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationPropertiesInternal)this).ProvisioningState, 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.NetworkCloud.Models.IClusterMetricsConfigurationProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ClusterMetricsConfigurationProperties(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.NetworkCloud.Models.IClusterMetricsConfigurationProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ClusterMetricsConfigurationProperties(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.NetworkCloud.Models.IClusterMetricsConfigurationProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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(); + } + } + /// ClusterMetricsConfigurationProperties represents the properties of metrics configuration for the cluster. + [System.ComponentModel.TypeConverter(typeof(ClusterMetricsConfigurationPropertiesTypeConverter))] + public partial interface IClusterMetricsConfigurationProperties + + { + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterMetricsConfigurationProperties.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterMetricsConfigurationProperties.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterMetricsConfigurationProperties.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterMetricsConfigurationProperties.TypeConverter.cs index 3492e4658cb5..33d546268a18 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterMetricsConfigurationProperties.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterMetricsConfigurationProperties.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterMetricsConfigurationProperties.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterMetricsConfigurationProperties.cs new file mode 100644 index 000000000000..ca3098edf61a --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterMetricsConfigurationProperties.cs @@ -0,0 +1,184 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + + /// + /// ClusterMetricsConfigurationProperties represents the properties of metrics configuration for the cluster. + /// + public partial class ClusterMetricsConfigurationProperties : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationProperties, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationPropertiesInternal + { + + /// Backing field for property. + private long _collectionInterval; + + /// The interval in minutes by which metrics will be collected. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public long CollectionInterval { get => this._collectionInterval; set => this._collectionInterval = value; } + + /// Backing field for property. + private string _detailedStatus; + + /// The more detailed status of the metrics configuration. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string DetailedStatus { get => this._detailedStatus; } + + /// Backing field for property. + private string _detailedStatusMessage; + + /// The descriptive message about the current detailed status. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string DetailedStatusMessage { get => this._detailedStatusMessage; } + + /// Backing field for property. + private System.Collections.Generic.List _disabledMetric; + + /// + /// The list of metrics that are available for the cluster but disabled at the moment. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public System.Collections.Generic.List DisabledMetric { get => this._disabledMetric; } + + /// Backing field for property. + private System.Collections.Generic.List _enabledMetric; + + /// + /// The list of metric names that have been chosen to be enabled in addition to the core set of enabled metrics. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public System.Collections.Generic.List EnabledMetric { get => this._enabledMetric; set => this._enabledMetric = value; } + + /// Internal Acessors for DetailedStatus + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationPropertiesInternal.DetailedStatus { get => this._detailedStatus; set { {_detailedStatus = value;} } } + + /// Internal Acessors for DetailedStatusMessage + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationPropertiesInternal.DetailedStatusMessage { get => this._detailedStatusMessage; set { {_detailedStatusMessage = value;} } } + + /// Internal Acessors for DisabledMetric + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationPropertiesInternal.DisabledMetric { get => this._disabledMetric; set { {_disabledMetric = value;} } } + + /// Internal Acessors for ProvisioningState + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationPropertiesInternal.ProvisioningState { get => this._provisioningState; set { {_provisioningState = value;} } } + + /// Backing field for property. + private string _provisioningState; + + /// The provisioning state of the metrics configuration. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string ProvisioningState { get => this._provisioningState; } + + /// Creates an new instance. + public ClusterMetricsConfigurationProperties() + { + + } + } + /// ClusterMetricsConfigurationProperties represents the properties of metrics configuration for the cluster. + public partial interface IClusterMetricsConfigurationProperties : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable + { + /// The interval in minutes by which metrics will be collected. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The interval in minutes by which metrics will be collected.", + SerializedName = @"collectionInterval", + PossibleTypes = new [] { typeof(long) })] + long CollectionInterval { get; set; } + /// The more detailed status of the metrics configuration. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The more detailed status of the metrics configuration.", + SerializedName = @"detailedStatus", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Processing", "Applied", "Error")] + string DetailedStatus { get; } + /// The descriptive message about the current detailed status. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The descriptive message about the current detailed status.", + SerializedName = @"detailedStatusMessage", + PossibleTypes = new [] { typeof(string) })] + string DetailedStatusMessage { get; } + /// + /// The list of metrics that are available for the cluster but disabled at the moment. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The list of metrics that are available for the cluster but disabled at the moment.", + SerializedName = @"disabledMetrics", + PossibleTypes = new [] { typeof(string) })] + System.Collections.Generic.List DisabledMetric { get; } + /// + /// The list of metric names that have been chosen to be enabled in addition to the core set of enabled metrics. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The list of metric names that have been chosen to be enabled in addition to the core set of enabled metrics.", + SerializedName = @"enabledMetrics", + PossibleTypes = new [] { typeof(string) })] + System.Collections.Generic.List EnabledMetric { get; set; } + /// The provisioning state of the metrics configuration. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The provisioning state of the metrics configuration.", + SerializedName = @"provisioningState", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Succeeded", "Failed", "Canceled", "Accepted", "Provisioning")] + string ProvisioningState { get; } + + } + /// ClusterMetricsConfigurationProperties represents the properties of metrics configuration for the cluster. + internal partial interface IClusterMetricsConfigurationPropertiesInternal + + { + /// The interval in minutes by which metrics will be collected. + long CollectionInterval { get; set; } + /// The more detailed status of the metrics configuration. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Processing", "Applied", "Error")] + string DetailedStatus { get; set; } + /// The descriptive message about the current detailed status. + string DetailedStatusMessage { get; set; } + /// + /// The list of metrics that are available for the cluster but disabled at the moment. + /// + System.Collections.Generic.List DisabledMetric { get; set; } + /// + /// The list of metric names that have been chosen to be enabled in addition to the core set of enabled metrics. + /// + System.Collections.Generic.List EnabledMetric { get; set; } + /// The provisioning state of the metrics configuration. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Succeeded", "Failed", "Canceled", "Accepted", "Provisioning")] + string ProvisioningState { get; set; } + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterMetricsConfigurationProperties.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterMetricsConfigurationProperties.json.cs similarity index 87% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterMetricsConfigurationProperties.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterMetricsConfigurationProperties.json.cs index 873108fc9c13..ab4ef8db3c95 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterMetricsConfigurationProperties.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterMetricsConfigurationProperties.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -67,23 +67,23 @@ internal ClusterMetricsConfigurationProperties(Microsoft.Azure.PowerShell.Cmdlet { return; } - {_collectionInterval = If( json?.PropertyT("collectionInterval"), out var __jsonCollectionInterval) ? (long)__jsonCollectionInterval : CollectionInterval;} - {_detailedStatus = If( json?.PropertyT("detailedStatus"), out var __jsonDetailedStatus) ? (string)__jsonDetailedStatus : (string)DetailedStatus;} - {_detailedStatusMessage = If( json?.PropertyT("detailedStatusMessage"), out var __jsonDetailedStatusMessage) ? (string)__jsonDetailedStatusMessage : (string)DetailedStatusMessage;} - {_disabledMetric = If( json?.PropertyT("disabledMetrics"), out var __jsonDisabledMetrics) ? If( __jsonDisabledMetrics as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : DisabledMetric;} - {_enabledMetric = If( json?.PropertyT("enabledMetrics"), out var __jsonEnabledMetrics) ? If( __jsonEnabledMetrics as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Json.JsonString __o ? (string)(__o.ToString()) : null)) ))() : null : EnabledMetric;} - {_provisioningState = If( json?.PropertyT("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)ProvisioningState;} + {_collectionInterval = If( json?.PropertyT("collectionInterval"), out var __jsonCollectionInterval) ? (long)__jsonCollectionInterval : _collectionInterval;} + {_detailedStatus = If( json?.PropertyT("detailedStatus"), out var __jsonDetailedStatus) ? (string)__jsonDetailedStatus : (string)_detailedStatus;} + {_detailedStatusMessage = If( json?.PropertyT("detailedStatusMessage"), out var __jsonDetailedStatusMessage) ? (string)__jsonDetailedStatusMessage : (string)_detailedStatusMessage;} + {_disabledMetric = If( json?.PropertyT("disabledMetrics"), out var __jsonDisabledMetrics) ? If( __jsonDisabledMetrics as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : _disabledMetric;} + {_enabledMetric = If( json?.PropertyT("enabledMetrics"), out var __jsonEnabledMetrics) ? If( __jsonEnabledMetrics as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Json.JsonString __o ? (string)(__o.ToString()) : null)) ))() : null : _enabledMetric;} + {_provisioningState = If( json?.PropertyT("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)_provisioningState;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new ClusterMetricsConfigurationProperties(json) : null; } @@ -109,15 +109,15 @@ public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode ToJ return container; } AddIf( (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNumber(this._collectionInterval), "collectionInterval" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._detailedStatus)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._detailedStatus.ToString()) : null, "detailedStatus" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._detailedStatusMessage)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._detailedStatusMessage.ToString()) : null, "detailedStatusMessage" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { if (null != this._disabledMetric) { @@ -138,7 +138,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode ToJ } container.Add("enabledMetrics",__r); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._provisioningState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._provisioningState.ToString()) : null, "provisioningState" ,container.Add ); } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterPatchParameters.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterPatchParameters.PowerShell.cs new file mode 100644 index 000000000000..ff16fc770e97 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterPatchParameters.PowerShell.cs @@ -0,0 +1,590 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + + /// + /// ClusterPatchParameters represents the body of the request to patch the cluster properties. + /// + [System.ComponentModel.TypeConverter(typeof(ClusterPatchParametersTypeConverter))] + public partial class ClusterPatchParameters + { + + /// + /// 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 ClusterPatchParameters(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Identity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).Identity = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IManagedServiceIdentity) content.GetValueForProperty("Identity",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).Identity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ManagedServiceIdentityTypeConverter.ConvertFrom); + } + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterPatchPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterPatchParametersTagsTypeConverter.ConvertFrom); + } + if (content.Contains("IdentityPrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).IdentityPrincipalId = (string) content.GetValueForProperty("IdentityPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).IdentityPrincipalId, global::System.Convert.ToString); + } + if (content.Contains("IdentityTenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).IdentityTenantId = (string) content.GetValueForProperty("IdentityTenantId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).IdentityTenantId, global::System.Convert.ToString); + } + if (content.Contains("IdentityType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).IdentityType = (string) content.GetValueForProperty("IdentityType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).IdentityType, global::System.Convert.ToString); + } + if (content.Contains("IdentityUserAssignedIdentity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IUserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.UserAssignedIdentitiesTypeConverter.ConvertFrom); + } + if (content.Contains("AggregatorOrSingleRackDefinition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).AggregatorOrSingleRackDefinition = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackDefinition) content.GetValueForProperty("AggregatorOrSingleRackDefinition",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).AggregatorOrSingleRackDefinition, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.RackDefinitionTypeConverter.ConvertFrom); + } + if (content.Contains("AnalyticsOutputSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).AnalyticsOutputSetting = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAnalyticsOutputSettings) content.GetValueForProperty("AnalyticsOutputSetting",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).AnalyticsOutputSetting, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AnalyticsOutputSettingsTypeConverter.ConvertFrom); + } + if (content.Contains("ClusterServicePrincipal")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).ClusterServicePrincipal = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IServicePrincipalInformation) content.GetValueForProperty("ClusterServicePrincipal",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).ClusterServicePrincipal, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ServicePrincipalInformationTypeConverter.ConvertFrom); + } + if (content.Contains("CommandOutputSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).CommandOutputSetting = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICommandOutputSettings) content.GetValueForProperty("CommandOutputSetting",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).CommandOutputSetting, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.CommandOutputSettingsTypeConverter.ConvertFrom); + } + if (content.Contains("ComputeDeploymentThreshold")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).ComputeDeploymentThreshold = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IValidationThreshold) content.GetValueForProperty("ComputeDeploymentThreshold",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).ComputeDeploymentThreshold, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ValidationThresholdTypeConverter.ConvertFrom); + } + if (content.Contains("RuntimeProtectionConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).RuntimeProtectionConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRuntimeProtectionConfiguration) content.GetValueForProperty("RuntimeProtectionConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).RuntimeProtectionConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.RuntimeProtectionConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("SecretArchive")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).SecretArchive = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterSecretArchive) content.GetValueForProperty("SecretArchive",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).SecretArchive, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterSecretArchiveTypeConverter.ConvertFrom); + } + if (content.Contains("SecretArchiveSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).SecretArchiveSetting = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISecretArchiveSettings) content.GetValueForProperty("SecretArchiveSetting",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).SecretArchiveSetting, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.SecretArchiveSettingsTypeConverter.ConvertFrom); + } + if (content.Contains("UpdateStrategy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).UpdateStrategy = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterUpdateStrategy) content.GetValueForProperty("UpdateStrategy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).UpdateStrategy, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterUpdateStrategyTypeConverter.ConvertFrom); + } + if (content.Contains("VulnerabilityScanningSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).VulnerabilityScanningSetting = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVulnerabilityScanningSettingsPatch) content.GetValueForProperty("VulnerabilityScanningSetting",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).VulnerabilityScanningSetting, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.VulnerabilityScanningSettingsPatchTypeConverter.ConvertFrom); + } + if (content.Contains("ClusterLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).ClusterLocation = (string) content.GetValueForProperty("ClusterLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).ClusterLocation, global::System.Convert.ToString); + } + if (content.Contains("ComputeRackDefinition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).ComputeRackDefinition = (System.Collections.Generic.List) content.GetValueForProperty("ComputeRackDefinition",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).ComputeRackDefinition, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.RackDefinitionTypeConverter.ConvertFrom)); + } + if (content.Contains("CommandOutputSettingContainerUrl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).CommandOutputSettingContainerUrl = (string) content.GetValueForProperty("CommandOutputSettingContainerUrl",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).CommandOutputSettingContainerUrl, global::System.Convert.ToString); + } + if (content.Contains("SecretArchiveSettingVaultUri")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).SecretArchiveSettingVaultUri = (string) content.GetValueForProperty("SecretArchiveSettingVaultUri",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).SecretArchiveSettingVaultUri, global::System.Convert.ToString); + } + if (content.Contains("VulnerabilityScanningSettingContainerScan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).VulnerabilityScanningSettingContainerScan = (string) content.GetValueForProperty("VulnerabilityScanningSettingContainerScan",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).VulnerabilityScanningSettingContainerScan, global::System.Convert.ToString); + } + if (content.Contains("AggregatorOrSingleRackDefinitionAvailabilityZone")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).AggregatorOrSingleRackDefinitionAvailabilityZone = (string) content.GetValueForProperty("AggregatorOrSingleRackDefinitionAvailabilityZone",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).AggregatorOrSingleRackDefinitionAvailabilityZone, global::System.Convert.ToString); + } + if (content.Contains("AggregatorOrSingleRackDefinitionBareMetalMachineConfigurationData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).AggregatorOrSingleRackDefinitionBareMetalMachineConfigurationData = (System.Collections.Generic.List) content.GetValueForProperty("AggregatorOrSingleRackDefinitionBareMetalMachineConfigurationData",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).AggregatorOrSingleRackDefinitionBareMetalMachineConfigurationData, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BareMetalMachineConfigurationDataTypeConverter.ConvertFrom)); + } + if (content.Contains("AggregatorOrSingleRackDefinitionNetworkRackId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).AggregatorOrSingleRackDefinitionNetworkRackId = (string) content.GetValueForProperty("AggregatorOrSingleRackDefinitionNetworkRackId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).AggregatorOrSingleRackDefinitionNetworkRackId, global::System.Convert.ToString); + } + if (content.Contains("AggregatorOrSingleRackDefinitionRackLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).AggregatorOrSingleRackDefinitionRackLocation = (string) content.GetValueForProperty("AggregatorOrSingleRackDefinitionRackLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).AggregatorOrSingleRackDefinitionRackLocation, global::System.Convert.ToString); + } + if (content.Contains("AggregatorOrSingleRackDefinitionRackSerialNumber")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).AggregatorOrSingleRackDefinitionRackSerialNumber = (string) content.GetValueForProperty("AggregatorOrSingleRackDefinitionRackSerialNumber",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).AggregatorOrSingleRackDefinitionRackSerialNumber, global::System.Convert.ToString); + } + if (content.Contains("AggregatorOrSingleRackDefinitionRackSkuId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).AggregatorOrSingleRackDefinitionRackSkuId = (string) content.GetValueForProperty("AggregatorOrSingleRackDefinitionRackSkuId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).AggregatorOrSingleRackDefinitionRackSkuId, global::System.Convert.ToString); + } + if (content.Contains("AggregatorOrSingleRackDefinitionStorageApplianceConfigurationData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).AggregatorOrSingleRackDefinitionStorageApplianceConfigurationData = (System.Collections.Generic.List) content.GetValueForProperty("AggregatorOrSingleRackDefinitionStorageApplianceConfigurationData",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).AggregatorOrSingleRackDefinitionStorageApplianceConfigurationData, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.StorageApplianceConfigurationDataTypeConverter.ConvertFrom)); + } + if (content.Contains("AnalyticOutputSettingAssociatedIdentity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).AnalyticOutputSettingAssociatedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IIdentitySelector) content.GetValueForProperty("AnalyticOutputSettingAssociatedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).AnalyticOutputSettingAssociatedIdentity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IdentitySelectorTypeConverter.ConvertFrom); + } + if (content.Contains("AnalyticOutputSettingAnalyticsWorkspaceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).AnalyticOutputSettingAnalyticsWorkspaceId = (string) content.GetValueForProperty("AnalyticOutputSettingAnalyticsWorkspaceId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).AnalyticOutputSettingAnalyticsWorkspaceId, global::System.Convert.ToString); + } + if (content.Contains("ClusterServicePrincipalApplicationId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).ClusterServicePrincipalApplicationId = (string) content.GetValueForProperty("ClusterServicePrincipalApplicationId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).ClusterServicePrincipalApplicationId, global::System.Convert.ToString); + } + if (content.Contains("ClusterServicePrincipalPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).ClusterServicePrincipalPassword = (System.Security.SecureString) content.GetValueForProperty("ClusterServicePrincipalPassword",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).ClusterServicePrincipalPassword, (object ss) => (System.Security.SecureString)ss); + } + if (content.Contains("ClusterServicePrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).ClusterServicePrincipalId = (string) content.GetValueForProperty("ClusterServicePrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).ClusterServicePrincipalId, global::System.Convert.ToString); + } + if (content.Contains("ClusterServicePrincipalTenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).ClusterServicePrincipalTenantId = (string) content.GetValueForProperty("ClusterServicePrincipalTenantId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).ClusterServicePrincipalTenantId, global::System.Convert.ToString); + } + if (content.Contains("CommandOutputSettingAssociatedIdentity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).CommandOutputSettingAssociatedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IIdentitySelector) content.GetValueForProperty("CommandOutputSettingAssociatedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).CommandOutputSettingAssociatedIdentity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IdentitySelectorTypeConverter.ConvertFrom); + } + if (content.Contains("ComputeDeploymentThresholdGrouping")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).ComputeDeploymentThresholdGrouping = (string) content.GetValueForProperty("ComputeDeploymentThresholdGrouping",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).ComputeDeploymentThresholdGrouping, global::System.Convert.ToString); + } + if (content.Contains("ComputeDeploymentThresholdType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).ComputeDeploymentThresholdType = (string) content.GetValueForProperty("ComputeDeploymentThresholdType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).ComputeDeploymentThresholdType, global::System.Convert.ToString); + } + if (content.Contains("ComputeDeploymentThresholdValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).ComputeDeploymentThresholdValue = (long?) content.GetValueForProperty("ComputeDeploymentThresholdValue",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).ComputeDeploymentThresholdValue, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("RuntimeProtectionConfigurationEnforcementLevel")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).RuntimeProtectionConfigurationEnforcementLevel = (string) content.GetValueForProperty("RuntimeProtectionConfigurationEnforcementLevel",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).RuntimeProtectionConfigurationEnforcementLevel, global::System.Convert.ToString); + } + if (content.Contains("SecretArchiveKeyVaultId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).SecretArchiveKeyVaultId = (string) content.GetValueForProperty("SecretArchiveKeyVaultId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).SecretArchiveKeyVaultId, global::System.Convert.ToString); + } + if (content.Contains("SecretArchiveUseKeyVault")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).SecretArchiveUseKeyVault = (string) content.GetValueForProperty("SecretArchiveUseKeyVault",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).SecretArchiveUseKeyVault, global::System.Convert.ToString); + } + if (content.Contains("SecretArchiveSettingAssociatedIdentity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).SecretArchiveSettingAssociatedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IIdentitySelector) content.GetValueForProperty("SecretArchiveSettingAssociatedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).SecretArchiveSettingAssociatedIdentity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IdentitySelectorTypeConverter.ConvertFrom); + } + if (content.Contains("UpdateStrategyMaxUnavailable")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).UpdateStrategyMaxUnavailable = (long?) content.GetValueForProperty("UpdateStrategyMaxUnavailable",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).UpdateStrategyMaxUnavailable, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("UpdateStrategyType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).UpdateStrategyType = (string) content.GetValueForProperty("UpdateStrategyType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).UpdateStrategyType, global::System.Convert.ToString); + } + if (content.Contains("UpdateStrategyThresholdType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).UpdateStrategyThresholdType = (string) content.GetValueForProperty("UpdateStrategyThresholdType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).UpdateStrategyThresholdType, global::System.Convert.ToString); + } + if (content.Contains("UpdateStrategyThresholdValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).UpdateStrategyThresholdValue = (long?) content.GetValueForProperty("UpdateStrategyThresholdValue",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).UpdateStrategyThresholdValue, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("UpdateStrategyWaitTimeMinute")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).UpdateStrategyWaitTimeMinute = (long?) content.GetValueForProperty("UpdateStrategyWaitTimeMinute",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).UpdateStrategyWaitTimeMinute, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("AnalyticsOutputSettingsAssociatedIdentityType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).AnalyticsOutputSettingsAssociatedIdentityType = (string) content.GetValueForProperty("AnalyticsOutputSettingsAssociatedIdentityType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).AnalyticsOutputSettingsAssociatedIdentityType, global::System.Convert.ToString); + } + if (content.Contains("AnalyticsOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).AnalyticsOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId = (string) content.GetValueForProperty("AnalyticsOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).AnalyticsOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId, global::System.Convert.ToString); + } + if (content.Contains("CommandOutputSettingsAssociatedIdentityType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).CommandOutputSettingsAssociatedIdentityType = (string) content.GetValueForProperty("CommandOutputSettingsAssociatedIdentityType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).CommandOutputSettingsAssociatedIdentityType, global::System.Convert.ToString); + } + if (content.Contains("CommandOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).CommandOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId = (string) content.GetValueForProperty("CommandOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).CommandOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId, global::System.Convert.ToString); + } + if (content.Contains("SecretArchiveSettingsAssociatedIdentityType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).SecretArchiveSettingsAssociatedIdentityType = (string) content.GetValueForProperty("SecretArchiveSettingsAssociatedIdentityType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).SecretArchiveSettingsAssociatedIdentityType, global::System.Convert.ToString); + } + if (content.Contains("SecretArchiveSettingsAssociatedIdentityUserAssignedIdentityResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).SecretArchiveSettingsAssociatedIdentityUserAssignedIdentityResourceId = (string) content.GetValueForProperty("SecretArchiveSettingsAssociatedIdentityUserAssignedIdentityResourceId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).SecretArchiveSettingsAssociatedIdentityUserAssignedIdentityResourceId, 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 ClusterPatchParameters(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Identity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).Identity = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IManagedServiceIdentity) content.GetValueForProperty("Identity",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).Identity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ManagedServiceIdentityTypeConverter.ConvertFrom); + } + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterPatchPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterPatchParametersTagsTypeConverter.ConvertFrom); + } + if (content.Contains("IdentityPrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).IdentityPrincipalId = (string) content.GetValueForProperty("IdentityPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).IdentityPrincipalId, global::System.Convert.ToString); + } + if (content.Contains("IdentityTenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).IdentityTenantId = (string) content.GetValueForProperty("IdentityTenantId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).IdentityTenantId, global::System.Convert.ToString); + } + if (content.Contains("IdentityType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).IdentityType = (string) content.GetValueForProperty("IdentityType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).IdentityType, global::System.Convert.ToString); + } + if (content.Contains("IdentityUserAssignedIdentity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IUserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.UserAssignedIdentitiesTypeConverter.ConvertFrom); + } + if (content.Contains("AggregatorOrSingleRackDefinition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).AggregatorOrSingleRackDefinition = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackDefinition) content.GetValueForProperty("AggregatorOrSingleRackDefinition",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).AggregatorOrSingleRackDefinition, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.RackDefinitionTypeConverter.ConvertFrom); + } + if (content.Contains("AnalyticsOutputSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).AnalyticsOutputSetting = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAnalyticsOutputSettings) content.GetValueForProperty("AnalyticsOutputSetting",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).AnalyticsOutputSetting, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AnalyticsOutputSettingsTypeConverter.ConvertFrom); + } + if (content.Contains("ClusterServicePrincipal")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).ClusterServicePrincipal = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IServicePrincipalInformation) content.GetValueForProperty("ClusterServicePrincipal",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).ClusterServicePrincipal, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ServicePrincipalInformationTypeConverter.ConvertFrom); + } + if (content.Contains("CommandOutputSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).CommandOutputSetting = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICommandOutputSettings) content.GetValueForProperty("CommandOutputSetting",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).CommandOutputSetting, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.CommandOutputSettingsTypeConverter.ConvertFrom); + } + if (content.Contains("ComputeDeploymentThreshold")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).ComputeDeploymentThreshold = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IValidationThreshold) content.GetValueForProperty("ComputeDeploymentThreshold",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).ComputeDeploymentThreshold, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ValidationThresholdTypeConverter.ConvertFrom); + } + if (content.Contains("RuntimeProtectionConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).RuntimeProtectionConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRuntimeProtectionConfiguration) content.GetValueForProperty("RuntimeProtectionConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).RuntimeProtectionConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.RuntimeProtectionConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("SecretArchive")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).SecretArchive = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterSecretArchive) content.GetValueForProperty("SecretArchive",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).SecretArchive, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterSecretArchiveTypeConverter.ConvertFrom); + } + if (content.Contains("SecretArchiveSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).SecretArchiveSetting = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISecretArchiveSettings) content.GetValueForProperty("SecretArchiveSetting",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).SecretArchiveSetting, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.SecretArchiveSettingsTypeConverter.ConvertFrom); + } + if (content.Contains("UpdateStrategy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).UpdateStrategy = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterUpdateStrategy) content.GetValueForProperty("UpdateStrategy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).UpdateStrategy, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterUpdateStrategyTypeConverter.ConvertFrom); + } + if (content.Contains("VulnerabilityScanningSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).VulnerabilityScanningSetting = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVulnerabilityScanningSettingsPatch) content.GetValueForProperty("VulnerabilityScanningSetting",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).VulnerabilityScanningSetting, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.VulnerabilityScanningSettingsPatchTypeConverter.ConvertFrom); + } + if (content.Contains("ClusterLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).ClusterLocation = (string) content.GetValueForProperty("ClusterLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).ClusterLocation, global::System.Convert.ToString); + } + if (content.Contains("ComputeRackDefinition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).ComputeRackDefinition = (System.Collections.Generic.List) content.GetValueForProperty("ComputeRackDefinition",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).ComputeRackDefinition, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.RackDefinitionTypeConverter.ConvertFrom)); + } + if (content.Contains("CommandOutputSettingContainerUrl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).CommandOutputSettingContainerUrl = (string) content.GetValueForProperty("CommandOutputSettingContainerUrl",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).CommandOutputSettingContainerUrl, global::System.Convert.ToString); + } + if (content.Contains("SecretArchiveSettingVaultUri")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).SecretArchiveSettingVaultUri = (string) content.GetValueForProperty("SecretArchiveSettingVaultUri",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).SecretArchiveSettingVaultUri, global::System.Convert.ToString); + } + if (content.Contains("VulnerabilityScanningSettingContainerScan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).VulnerabilityScanningSettingContainerScan = (string) content.GetValueForProperty("VulnerabilityScanningSettingContainerScan",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).VulnerabilityScanningSettingContainerScan, global::System.Convert.ToString); + } + if (content.Contains("AggregatorOrSingleRackDefinitionAvailabilityZone")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).AggregatorOrSingleRackDefinitionAvailabilityZone = (string) content.GetValueForProperty("AggregatorOrSingleRackDefinitionAvailabilityZone",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).AggregatorOrSingleRackDefinitionAvailabilityZone, global::System.Convert.ToString); + } + if (content.Contains("AggregatorOrSingleRackDefinitionBareMetalMachineConfigurationData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).AggregatorOrSingleRackDefinitionBareMetalMachineConfigurationData = (System.Collections.Generic.List) content.GetValueForProperty("AggregatorOrSingleRackDefinitionBareMetalMachineConfigurationData",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).AggregatorOrSingleRackDefinitionBareMetalMachineConfigurationData, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BareMetalMachineConfigurationDataTypeConverter.ConvertFrom)); + } + if (content.Contains("AggregatorOrSingleRackDefinitionNetworkRackId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).AggregatorOrSingleRackDefinitionNetworkRackId = (string) content.GetValueForProperty("AggregatorOrSingleRackDefinitionNetworkRackId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).AggregatorOrSingleRackDefinitionNetworkRackId, global::System.Convert.ToString); + } + if (content.Contains("AggregatorOrSingleRackDefinitionRackLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).AggregatorOrSingleRackDefinitionRackLocation = (string) content.GetValueForProperty("AggregatorOrSingleRackDefinitionRackLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).AggregatorOrSingleRackDefinitionRackLocation, global::System.Convert.ToString); + } + if (content.Contains("AggregatorOrSingleRackDefinitionRackSerialNumber")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).AggregatorOrSingleRackDefinitionRackSerialNumber = (string) content.GetValueForProperty("AggregatorOrSingleRackDefinitionRackSerialNumber",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).AggregatorOrSingleRackDefinitionRackSerialNumber, global::System.Convert.ToString); + } + if (content.Contains("AggregatorOrSingleRackDefinitionRackSkuId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).AggregatorOrSingleRackDefinitionRackSkuId = (string) content.GetValueForProperty("AggregatorOrSingleRackDefinitionRackSkuId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).AggregatorOrSingleRackDefinitionRackSkuId, global::System.Convert.ToString); + } + if (content.Contains("AggregatorOrSingleRackDefinitionStorageApplianceConfigurationData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).AggregatorOrSingleRackDefinitionStorageApplianceConfigurationData = (System.Collections.Generic.List) content.GetValueForProperty("AggregatorOrSingleRackDefinitionStorageApplianceConfigurationData",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).AggregatorOrSingleRackDefinitionStorageApplianceConfigurationData, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.StorageApplianceConfigurationDataTypeConverter.ConvertFrom)); + } + if (content.Contains("AnalyticOutputSettingAssociatedIdentity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).AnalyticOutputSettingAssociatedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IIdentitySelector) content.GetValueForProperty("AnalyticOutputSettingAssociatedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).AnalyticOutputSettingAssociatedIdentity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IdentitySelectorTypeConverter.ConvertFrom); + } + if (content.Contains("AnalyticOutputSettingAnalyticsWorkspaceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).AnalyticOutputSettingAnalyticsWorkspaceId = (string) content.GetValueForProperty("AnalyticOutputSettingAnalyticsWorkspaceId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).AnalyticOutputSettingAnalyticsWorkspaceId, global::System.Convert.ToString); + } + if (content.Contains("ClusterServicePrincipalApplicationId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).ClusterServicePrincipalApplicationId = (string) content.GetValueForProperty("ClusterServicePrincipalApplicationId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).ClusterServicePrincipalApplicationId, global::System.Convert.ToString); + } + if (content.Contains("ClusterServicePrincipalPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).ClusterServicePrincipalPassword = (System.Security.SecureString) content.GetValueForProperty("ClusterServicePrincipalPassword",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).ClusterServicePrincipalPassword, (object ss) => (System.Security.SecureString)ss); + } + if (content.Contains("ClusterServicePrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).ClusterServicePrincipalId = (string) content.GetValueForProperty("ClusterServicePrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).ClusterServicePrincipalId, global::System.Convert.ToString); + } + if (content.Contains("ClusterServicePrincipalTenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).ClusterServicePrincipalTenantId = (string) content.GetValueForProperty("ClusterServicePrincipalTenantId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).ClusterServicePrincipalTenantId, global::System.Convert.ToString); + } + if (content.Contains("CommandOutputSettingAssociatedIdentity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).CommandOutputSettingAssociatedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IIdentitySelector) content.GetValueForProperty("CommandOutputSettingAssociatedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).CommandOutputSettingAssociatedIdentity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IdentitySelectorTypeConverter.ConvertFrom); + } + if (content.Contains("ComputeDeploymentThresholdGrouping")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).ComputeDeploymentThresholdGrouping = (string) content.GetValueForProperty("ComputeDeploymentThresholdGrouping",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).ComputeDeploymentThresholdGrouping, global::System.Convert.ToString); + } + if (content.Contains("ComputeDeploymentThresholdType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).ComputeDeploymentThresholdType = (string) content.GetValueForProperty("ComputeDeploymentThresholdType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).ComputeDeploymentThresholdType, global::System.Convert.ToString); + } + if (content.Contains("ComputeDeploymentThresholdValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).ComputeDeploymentThresholdValue = (long?) content.GetValueForProperty("ComputeDeploymentThresholdValue",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).ComputeDeploymentThresholdValue, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("RuntimeProtectionConfigurationEnforcementLevel")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).RuntimeProtectionConfigurationEnforcementLevel = (string) content.GetValueForProperty("RuntimeProtectionConfigurationEnforcementLevel",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).RuntimeProtectionConfigurationEnforcementLevel, global::System.Convert.ToString); + } + if (content.Contains("SecretArchiveKeyVaultId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).SecretArchiveKeyVaultId = (string) content.GetValueForProperty("SecretArchiveKeyVaultId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).SecretArchiveKeyVaultId, global::System.Convert.ToString); + } + if (content.Contains("SecretArchiveUseKeyVault")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).SecretArchiveUseKeyVault = (string) content.GetValueForProperty("SecretArchiveUseKeyVault",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).SecretArchiveUseKeyVault, global::System.Convert.ToString); + } + if (content.Contains("SecretArchiveSettingAssociatedIdentity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).SecretArchiveSettingAssociatedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IIdentitySelector) content.GetValueForProperty("SecretArchiveSettingAssociatedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).SecretArchiveSettingAssociatedIdentity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IdentitySelectorTypeConverter.ConvertFrom); + } + if (content.Contains("UpdateStrategyMaxUnavailable")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).UpdateStrategyMaxUnavailable = (long?) content.GetValueForProperty("UpdateStrategyMaxUnavailable",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).UpdateStrategyMaxUnavailable, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("UpdateStrategyType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).UpdateStrategyType = (string) content.GetValueForProperty("UpdateStrategyType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).UpdateStrategyType, global::System.Convert.ToString); + } + if (content.Contains("UpdateStrategyThresholdType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).UpdateStrategyThresholdType = (string) content.GetValueForProperty("UpdateStrategyThresholdType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).UpdateStrategyThresholdType, global::System.Convert.ToString); + } + if (content.Contains("UpdateStrategyThresholdValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).UpdateStrategyThresholdValue = (long?) content.GetValueForProperty("UpdateStrategyThresholdValue",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).UpdateStrategyThresholdValue, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("UpdateStrategyWaitTimeMinute")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).UpdateStrategyWaitTimeMinute = (long?) content.GetValueForProperty("UpdateStrategyWaitTimeMinute",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).UpdateStrategyWaitTimeMinute, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("AnalyticsOutputSettingsAssociatedIdentityType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).AnalyticsOutputSettingsAssociatedIdentityType = (string) content.GetValueForProperty("AnalyticsOutputSettingsAssociatedIdentityType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).AnalyticsOutputSettingsAssociatedIdentityType, global::System.Convert.ToString); + } + if (content.Contains("AnalyticsOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).AnalyticsOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId = (string) content.GetValueForProperty("AnalyticsOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).AnalyticsOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId, global::System.Convert.ToString); + } + if (content.Contains("CommandOutputSettingsAssociatedIdentityType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).CommandOutputSettingsAssociatedIdentityType = (string) content.GetValueForProperty("CommandOutputSettingsAssociatedIdentityType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).CommandOutputSettingsAssociatedIdentityType, global::System.Convert.ToString); + } + if (content.Contains("CommandOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).CommandOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId = (string) content.GetValueForProperty("CommandOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).CommandOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId, global::System.Convert.ToString); + } + if (content.Contains("SecretArchiveSettingsAssociatedIdentityType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).SecretArchiveSettingsAssociatedIdentityType = (string) content.GetValueForProperty("SecretArchiveSettingsAssociatedIdentityType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).SecretArchiveSettingsAssociatedIdentityType, global::System.Convert.ToString); + } + if (content.Contains("SecretArchiveSettingsAssociatedIdentityUserAssignedIdentityResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).SecretArchiveSettingsAssociatedIdentityUserAssignedIdentityResourceId = (string) content.GetValueForProperty("SecretArchiveSettingsAssociatedIdentityUserAssignedIdentityResourceId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal)this).SecretArchiveSettingsAssociatedIdentityUserAssignedIdentityResourceId, 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.NetworkCloud.Models.IClusterPatchParameters DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ClusterPatchParameters(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.NetworkCloud.Models.IClusterPatchParameters DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ClusterPatchParameters(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.NetworkCloud.Models.IClusterPatchParameters FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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(); + } + } + /// ClusterPatchParameters represents the body of the request to patch the cluster properties. + [System.ComponentModel.TypeConverter(typeof(ClusterPatchParametersTypeConverter))] + public partial interface IClusterPatchParameters + + { + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterPatchParameters.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterPatchParameters.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterPatchParameters.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterPatchParameters.TypeConverter.cs index 6a4a202424e4..792dedcb977d 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterPatchParameters.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterPatchParameters.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IClusterPatchParameters ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParameters ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParameters).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParameters).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterPatchParameters.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterPatchParameters.cs new file mode 100644 index 000000000000..d7c030608a10 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterPatchParameters.cs @@ -0,0 +1,954 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + + /// + /// ClusterPatchParameters represents the body of the request to patch the cluster properties. + /// + public partial class ClusterPatchParameters : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParameters, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal + { + + /// + /// The zone name used for this rack when created. Availability zones are used for workload placement. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string AggregatorOrSingleRackDefinitionAvailabilityZone { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)Property).AggregatorOrSingleRackDefinitionAvailabilityZone; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)Property).AggregatorOrSingleRackDefinitionAvailabilityZone = value ?? null; } + + /// The unordered list of bare metal machine configuration. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public System.Collections.Generic.List AggregatorOrSingleRackDefinitionBareMetalMachineConfigurationData { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)Property).AggregatorOrSingleRackDefinitionBareMetalMachineConfigurationData; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)Property).AggregatorOrSingleRackDefinitionBareMetalMachineConfigurationData = value ?? null /* arrayOf */; } + + /// The resource ID of the network rack that matches this rack definition. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string AggregatorOrSingleRackDefinitionNetworkRackId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)Property).AggregatorOrSingleRackDefinitionNetworkRackId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)Property).AggregatorOrSingleRackDefinitionNetworkRackId = value ?? null; } + + /// The free-form description of the rack's location. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string AggregatorOrSingleRackDefinitionRackLocation { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)Property).AggregatorOrSingleRackDefinitionRackLocation; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)Property).AggregatorOrSingleRackDefinitionRackLocation = value ?? null; } + + /// + /// The unique identifier for the rack within Network Cloud cluster. An alternate unique alphanumeric value other than a serial + /// number may be provided if desired. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string AggregatorOrSingleRackDefinitionRackSerialNumber { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)Property).AggregatorOrSingleRackDefinitionRackSerialNumber; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)Property).AggregatorOrSingleRackDefinitionRackSerialNumber = value ?? null; } + + /// The resource ID of the sku for the rack being added. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string AggregatorOrSingleRackDefinitionRackSkuId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)Property).AggregatorOrSingleRackDefinitionRackSkuId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)Property).AggregatorOrSingleRackDefinitionRackSkuId = value ?? null; } + + /// The list of storage appliance configuration data for this rack. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public System.Collections.Generic.List AggregatorOrSingleRackDefinitionStorageApplianceConfigurationData { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)Property).AggregatorOrSingleRackDefinitionStorageApplianceConfigurationData; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)Property).AggregatorOrSingleRackDefinitionStorageApplianceConfigurationData = value ?? null /* arrayOf */; } + + /// + /// The resource ID of the analytics workspace that is to be used by the specified identity. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string AnalyticOutputSettingAnalyticsWorkspaceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)Property).AnalyticOutputSettingAnalyticsWorkspaceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)Property).AnalyticOutputSettingAnalyticsWorkspaceId = value ?? null; } + + /// The type of managed identity that is being selected. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string AnalyticsOutputSettingsAssociatedIdentityType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)Property).AnalyticsOutputSettingsAssociatedIdentityType; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)Property).AnalyticsOutputSettingsAssociatedIdentityType = value ?? null; } + + /// + /// The user assigned managed identity resource ID to use. Mutually exclusive with a system assigned identity type. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string AnalyticsOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)Property).AnalyticsOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)Property).AnalyticsOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId = value ?? null; } + + /// + /// The customer-provided location information to identify where the cluster resides. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string ClusterLocation { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)Property).ClusterLocation; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)Property).ClusterLocation = value ?? null; } + + /// The application ID, also known as client ID, of the service principal. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string ClusterServicePrincipalApplicationId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)Property).ClusterServicePrincipalApplicationId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)Property).ClusterServicePrincipalApplicationId = value ?? null; } + + /// The principal ID, also known as the object ID, of the service principal. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string ClusterServicePrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)Property).ClusterServicePrincipalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)Property).ClusterServicePrincipalId = value ?? null; } + + /// The password of the service principal. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public System.Security.SecureString ClusterServicePrincipalPassword { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)Property).ClusterServicePrincipalPassword; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)Property).ClusterServicePrincipalPassword = value ?? null; } + + /// + /// The tenant ID, also known as the directory ID, of the tenant in which the service principal is created. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string ClusterServicePrincipalTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)Property).ClusterServicePrincipalTenantId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)Property).ClusterServicePrincipalTenantId = value ?? null; } + + /// + /// The URL of the storage account container that is to be used by the specified identities. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string CommandOutputSettingContainerUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)Property).CommandOutputSettingContainerUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)Property).CommandOutputSettingContainerUrl = value ?? null; } + + /// The type of managed identity that is being selected. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string CommandOutputSettingsAssociatedIdentityType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)Property).CommandOutputSettingsAssociatedIdentityType; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)Property).CommandOutputSettingsAssociatedIdentityType = value ?? null; } + + /// + /// The user assigned managed identity resource ID to use. Mutually exclusive with a system assigned identity type. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string CommandOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)Property).CommandOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)Property).CommandOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId = value ?? null; } + + /// Selection of how the type evaluation is applied to the cluster calculation. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string ComputeDeploymentThresholdGrouping { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)Property).ComputeDeploymentThresholdGrouping; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)Property).ComputeDeploymentThresholdGrouping = value ?? null; } + + /// Selection of how the threshold should be evaluated. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string ComputeDeploymentThresholdType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)Property).ComputeDeploymentThresholdType; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)Property).ComputeDeploymentThresholdType = value ?? null; } + + /// The numeric threshold value. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public long? ComputeDeploymentThresholdValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)Property).ComputeDeploymentThresholdValue; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)Property).ComputeDeploymentThresholdValue = value ?? default(long); } + + /// + /// The list of rack definitions for the compute racks in a multi-rack + /// cluster, or an empty list in a single-rack cluster. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public System.Collections.Generic.List ComputeRackDefinition { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)Property).ComputeRackDefinition; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)Property).ComputeRackDefinition = value ?? null /* arrayOf */; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IManagedServiceIdentity _identity; + + /// The identity for the resource. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IManagedServiceIdentity Identity { get => (this._identity = this._identity ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ManagedServiceIdentity()); 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.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string IdentityPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string IdentityTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IManagedServiceIdentityInternal)Identity).TenantId; } + + /// + /// Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string IdentityType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IManagedServiceIdentityInternal)Identity).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IManagedServiceIdentityInternal)Identity).Type = value ?? null; } + + /// + /// 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.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IUserAssignedIdentities IdentityUserAssignedIdentity { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IManagedServiceIdentityInternal)Identity).UserAssignedIdentity; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IManagedServiceIdentityInternal)Identity).UserAssignedIdentity = value ?? null /* model class */; } + + /// Internal Acessors for AggregatorOrSingleRackDefinition + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackDefinition Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal.AggregatorOrSingleRackDefinition { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)Property).AggregatorOrSingleRackDefinition; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)Property).AggregatorOrSingleRackDefinition = value ?? null /* model class */; } + + /// Internal Acessors for AnalyticOutputSettingAssociatedIdentity + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IIdentitySelector Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal.AnalyticOutputSettingAssociatedIdentity { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)Property).AnalyticOutputSettingAssociatedIdentity; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)Property).AnalyticOutputSettingAssociatedIdentity = value ?? null /* model class */; } + + /// Internal Acessors for AnalyticsOutputSetting + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAnalyticsOutputSettings Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal.AnalyticsOutputSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)Property).AnalyticsOutputSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)Property).AnalyticsOutputSetting = value ?? null /* model class */; } + + /// Internal Acessors for ClusterServicePrincipal + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IServicePrincipalInformation Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal.ClusterServicePrincipal { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)Property).ClusterServicePrincipal; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)Property).ClusterServicePrincipal = value ?? null /* model class */; } + + /// Internal Acessors for CommandOutputSetting + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICommandOutputSettings Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal.CommandOutputSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)Property).CommandOutputSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)Property).CommandOutputSetting = value ?? null /* model class */; } + + /// Internal Acessors for CommandOutputSettingAssociatedIdentity + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IIdentitySelector Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal.CommandOutputSettingAssociatedIdentity { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)Property).CommandOutputSettingAssociatedIdentity; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)Property).CommandOutputSettingAssociatedIdentity = value ?? null /* model class */; } + + /// Internal Acessors for ComputeDeploymentThreshold + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IValidationThreshold Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal.ComputeDeploymentThreshold { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)Property).ComputeDeploymentThreshold; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)Property).ComputeDeploymentThreshold = value ?? null /* model class */; } + + /// Internal Acessors for Identity + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IManagedServiceIdentity Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal.Identity { get => (this._identity = this._identity ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ManagedServiceIdentity()); set { {_identity = value;} } } + + /// Internal Acessors for IdentityPrincipalId + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal.IdentityPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IManagedServiceIdentityInternal)Identity).PrincipalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IManagedServiceIdentityInternal)Identity).PrincipalId = value ?? null; } + + /// Internal Acessors for IdentityTenantId + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal.IdentityTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IManagedServiceIdentityInternal)Identity).TenantId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IManagedServiceIdentityInternal)Identity).TenantId = value ?? null; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchProperties Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterPatchProperties()); set { {_property = value;} } } + + /// Internal Acessors for RuntimeProtectionConfiguration + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRuntimeProtectionConfiguration Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal.RuntimeProtectionConfiguration { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)Property).RuntimeProtectionConfiguration; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)Property).RuntimeProtectionConfiguration = value ?? null /* model class */; } + + /// Internal Acessors for SecretArchive + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterSecretArchive Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal.SecretArchive { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)Property).SecretArchive; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)Property).SecretArchive = value ?? null /* model class */; } + + /// Internal Acessors for SecretArchiveSetting + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISecretArchiveSettings Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal.SecretArchiveSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)Property).SecretArchiveSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)Property).SecretArchiveSetting = value ?? null /* model class */; } + + /// Internal Acessors for SecretArchiveSettingAssociatedIdentity + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IIdentitySelector Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal.SecretArchiveSettingAssociatedIdentity { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)Property).SecretArchiveSettingAssociatedIdentity; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)Property).SecretArchiveSettingAssociatedIdentity = value ?? null /* model class */; } + + /// Internal Acessors for UpdateStrategy + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterUpdateStrategy Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal.UpdateStrategy { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)Property).UpdateStrategy; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)Property).UpdateStrategy = value ?? null /* model class */; } + + /// Internal Acessors for VulnerabilityScanningSetting + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVulnerabilityScanningSettingsPatch Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersInternal.VulnerabilityScanningSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)Property).VulnerabilityScanningSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)Property).VulnerabilityScanningSetting = value ?? null /* model class */; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchProperties _property; + + /// The list of the resource properties. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterPatchProperties()); set => this._property = value; } + + /// The mode of operation for runtime protection. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string RuntimeProtectionConfigurationEnforcementLevel { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)Property).RuntimeProtectionConfigurationEnforcementLevel; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)Property).RuntimeProtectionConfigurationEnforcementLevel = value ?? null; } + + /// The resource ID of the key vault to archive the secrets of the cluster. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string SecretArchiveKeyVaultId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)Property).SecretArchiveKeyVaultId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)Property).SecretArchiveKeyVaultId = value ?? null; } + + /// The URI for the key vault used as the secret archive. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string SecretArchiveSettingVaultUri { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)Property).SecretArchiveSettingVaultUri; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)Property).SecretArchiveSettingVaultUri = value ?? null; } + + /// The type of managed identity that is being selected. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string SecretArchiveSettingsAssociatedIdentityType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)Property).SecretArchiveSettingsAssociatedIdentityType; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)Property).SecretArchiveSettingsAssociatedIdentityType = value ?? null; } + + /// + /// The user assigned managed identity resource ID to use. Mutually exclusive with a system assigned identity type. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string SecretArchiveSettingsAssociatedIdentityUserAssignedIdentityResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)Property).SecretArchiveSettingsAssociatedIdentityUserAssignedIdentityResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)Property).SecretArchiveSettingsAssociatedIdentityUserAssignedIdentityResourceId = value ?? null; } + + /// + /// The indicator if the specified key vault should be used to archive the secrets of the cluster. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string SecretArchiveUseKeyVault { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)Property).SecretArchiveUseKeyVault; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)Property).SecretArchiveUseKeyVault = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersTags _tag; + + /// The Azure resource tags that will replace the existing ones. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterPatchParametersTags()); set => this._tag = value; } + + /// + /// The maximum number of worker nodes that can be offline within the increment of update, e.g., rack-by-rack. + /// Limited by the maximum number of machines in the increment. Defaults to the whole increment size. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public long? UpdateStrategyMaxUnavailable { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)Property).UpdateStrategyMaxUnavailable; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)Property).UpdateStrategyMaxUnavailable = value ?? default(long); } + + /// Selection of how the threshold should be evaluated. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string UpdateStrategyThresholdType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)Property).UpdateStrategyThresholdType; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)Property).UpdateStrategyThresholdType = value ?? null; } + + /// The numeric threshold value. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public long? UpdateStrategyThresholdValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)Property).UpdateStrategyThresholdValue; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)Property).UpdateStrategyThresholdValue = value ?? default(long); } + + /// The mode of operation for runtime protection. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string UpdateStrategyType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)Property).UpdateStrategyType; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)Property).UpdateStrategyType = value ?? null; } + + /// The time to wait between the increments of update defined by the strategy. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public long? UpdateStrategyWaitTimeMinute { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)Property).UpdateStrategyWaitTimeMinute; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)Property).UpdateStrategyWaitTimeMinute = value ?? default(long); } + + /// The mode selection for container vulnerability scanning. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string VulnerabilityScanningSettingContainerScan { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)Property).VulnerabilityScanningSettingContainerScan; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)Property).VulnerabilityScanningSettingContainerScan = value ?? null; } + + /// Creates an new instance. + public ClusterPatchParameters() + { + + } + } + /// ClusterPatchParameters represents the body of the request to patch the cluster properties. + public partial interface IClusterPatchParameters : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable + { + /// + /// The zone name used for this rack when created. Availability zones are used for workload placement. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The zone name used for this rack when created. Availability zones are used for workload placement.", + SerializedName = @"availabilityZone", + PossibleTypes = new [] { typeof(string) })] + string AggregatorOrSingleRackDefinitionAvailabilityZone { get; set; } + /// The unordered list of bare metal machine configuration. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The unordered list of bare metal machine configuration.", + SerializedName = @"bareMetalMachineConfigurationData", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineConfigurationData) })] + System.Collections.Generic.List AggregatorOrSingleRackDefinitionBareMetalMachineConfigurationData { get; set; } + /// The resource ID of the network rack that matches this rack definition. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The resource ID of the network rack that matches this rack definition.", + SerializedName = @"networkRackId", + PossibleTypes = new [] { typeof(string) })] + string AggregatorOrSingleRackDefinitionNetworkRackId { get; set; } + /// The free-form description of the rack's location. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The free-form description of the rack's location.", + SerializedName = @"rackLocation", + PossibleTypes = new [] { typeof(string) })] + string AggregatorOrSingleRackDefinitionRackLocation { get; set; } + /// + /// The unique identifier for the rack within Network Cloud cluster. An alternate unique alphanumeric value other than a serial + /// number may be provided if desired. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The unique identifier for the rack within Network Cloud cluster. An alternate unique alphanumeric value other than a serial number may be provided if desired.", + SerializedName = @"rackSerialNumber", + PossibleTypes = new [] { typeof(string) })] + string AggregatorOrSingleRackDefinitionRackSerialNumber { get; set; } + /// The resource ID of the sku for the rack being added. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The resource ID of the sku for the rack being added.", + SerializedName = @"rackSkuId", + PossibleTypes = new [] { typeof(string) })] + string AggregatorOrSingleRackDefinitionRackSkuId { get; set; } + /// The list of storage appliance configuration data for this rack. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The list of storage appliance configuration data for this rack.", + SerializedName = @"storageApplianceConfigurationData", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceConfigurationData) })] + System.Collections.Generic.List AggregatorOrSingleRackDefinitionStorageApplianceConfigurationData { get; set; } + /// + /// The resource ID of the analytics workspace that is to be used by the specified identity. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The resource ID of the analytics workspace that is to be used by the specified identity.", + SerializedName = @"analyticsWorkspaceId", + PossibleTypes = new [] { typeof(string) })] + string AnalyticOutputSettingAnalyticsWorkspaceId { get; set; } + /// The type of managed identity that is being selected. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The type of managed identity that is being selected.", + SerializedName = @"identityType", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("SystemAssignedIdentity", "UserAssignedIdentity")] + string AnalyticsOutputSettingsAssociatedIdentityType { get; set; } + /// + /// The user assigned managed identity resource ID to use. Mutually exclusive with a system assigned identity type. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The user assigned managed identity resource ID to use. Mutually exclusive with a system assigned identity type.", + SerializedName = @"userAssignedIdentityResourceId", + PossibleTypes = new [] { typeof(string) })] + string AnalyticsOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId { get; set; } + /// + /// The customer-provided location information to identify where the cluster resides. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The customer-provided location information to identify where the cluster resides.", + SerializedName = @"clusterLocation", + PossibleTypes = new [] { typeof(string) })] + string ClusterLocation { get; set; } + /// The application ID, also known as client ID, of the service principal. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The application ID, also known as client ID, of the service principal.", + SerializedName = @"applicationId", + PossibleTypes = new [] { typeof(string) })] + string ClusterServicePrincipalApplicationId { get; set; } + /// The principal ID, also known as the object ID, of the service principal. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The principal ID, also known as the object ID, of the service principal.", + SerializedName = @"principalId", + PossibleTypes = new [] { typeof(string) })] + string ClusterServicePrincipalId { get; set; } + /// The password of the service principal. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The password of the service principal.", + SerializedName = @"password", + PossibleTypes = new [] { typeof(System.Security.SecureString) })] + System.Security.SecureString ClusterServicePrincipalPassword { get; set; } + /// + /// The tenant ID, also known as the directory ID, of the tenant in which the service principal is created. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The tenant ID, also known as the directory ID, of the tenant in which the service principal is created.", + SerializedName = @"tenantId", + PossibleTypes = new [] { typeof(string) })] + string ClusterServicePrincipalTenantId { get; set; } + /// + /// The URL of the storage account container that is to be used by the specified identities. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The URL of the storage account container that is to be used by the specified identities.", + SerializedName = @"containerUrl", + PossibleTypes = new [] { typeof(string) })] + string CommandOutputSettingContainerUrl { get; set; } + /// The type of managed identity that is being selected. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The type of managed identity that is being selected.", + SerializedName = @"identityType", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("SystemAssignedIdentity", "UserAssignedIdentity")] + string CommandOutputSettingsAssociatedIdentityType { get; set; } + /// + /// The user assigned managed identity resource ID to use. Mutually exclusive with a system assigned identity type. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The user assigned managed identity resource ID to use. Mutually exclusive with a system assigned identity type.", + SerializedName = @"userAssignedIdentityResourceId", + PossibleTypes = new [] { typeof(string) })] + string CommandOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId { get; set; } + /// Selection of how the type evaluation is applied to the cluster calculation. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"Selection of how the type evaluation is applied to the cluster calculation.", + SerializedName = @"grouping", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("PerCluster", "PerRack")] + string ComputeDeploymentThresholdGrouping { get; set; } + /// Selection of how the threshold should be evaluated. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"Selection of how the threshold should be evaluated.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("CountSuccess", "PercentSuccess")] + string ComputeDeploymentThresholdType { get; set; } + /// The numeric threshold value. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The numeric threshold value.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(long) })] + long? ComputeDeploymentThresholdValue { get; set; } + /// + /// The list of rack definitions for the compute racks in a multi-rack + /// cluster, or an empty list in a single-rack cluster. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The list of rack definitions for the compute racks in a multi-rack + cluster, or an empty list in a single-rack cluster.", + SerializedName = @"computeRackDefinitions", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackDefinition) })] + System.Collections.Generic.List ComputeRackDefinition { get; set; } + /// + /// The service principal ID of the system assigned identity. This property will only be provided for a system assigned identity. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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) })] + string IdentityPrincipalId { get; } + /// + /// The tenant ID of the system assigned identity. This property will only be provided for a system assigned identity. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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) })] + string IdentityTenantId { get; } + /// + /// Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.IUserAssignedIdentities) })] + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IUserAssignedIdentities IdentityUserAssignedIdentity { get; set; } + /// The mode of operation for runtime protection. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The mode of operation for runtime protection.", + SerializedName = @"enforcementLevel", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Audit", "Disabled", "OnDemand", "Passive", "RealTime")] + string RuntimeProtectionConfigurationEnforcementLevel { get; set; } + /// The resource ID of the key vault to archive the secrets of the cluster. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The resource ID of the key vault to archive the secrets of the cluster.", + SerializedName = @"keyVaultId", + PossibleTypes = new [] { typeof(string) })] + string SecretArchiveKeyVaultId { get; set; } + /// The URI for the key vault used as the secret archive. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The URI for the key vault used as the secret archive.", + SerializedName = @"vaultUri", + PossibleTypes = new [] { typeof(string) })] + string SecretArchiveSettingVaultUri { get; set; } + /// The type of managed identity that is being selected. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The type of managed identity that is being selected.", + SerializedName = @"identityType", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("SystemAssignedIdentity", "UserAssignedIdentity")] + string SecretArchiveSettingsAssociatedIdentityType { get; set; } + /// + /// The user assigned managed identity resource ID to use. Mutually exclusive with a system assigned identity type. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The user assigned managed identity resource ID to use. Mutually exclusive with a system assigned identity type.", + SerializedName = @"userAssignedIdentityResourceId", + PossibleTypes = new [] { typeof(string) })] + string SecretArchiveSettingsAssociatedIdentityUserAssignedIdentityResourceId { get; set; } + /// + /// The indicator if the specified key vault should be used to archive the secrets of the cluster. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The indicator if the specified key vault should be used to archive the secrets of the cluster.", + SerializedName = @"useKeyVault", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("True", "False")] + string SecretArchiveUseKeyVault { get; set; } + /// The Azure resource tags that will replace the existing ones. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The Azure resource tags that will replace the existing ones.", + SerializedName = @"tags", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersTags) })] + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersTags Tag { get; set; } + /// + /// The maximum number of worker nodes that can be offline within the increment of update, e.g., rack-by-rack. + /// Limited by the maximum number of machines in the increment. Defaults to the whole increment size. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The maximum number of worker nodes that can be offline within the increment of update, e.g., rack-by-rack. + Limited by the maximum number of machines in the increment. Defaults to the whole increment size.", + SerializedName = @"maxUnavailable", + PossibleTypes = new [] { typeof(long) })] + long? UpdateStrategyMaxUnavailable { get; set; } + /// Selection of how the threshold should be evaluated. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"Selection of how the threshold should be evaluated.", + SerializedName = @"thresholdType", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("CountSuccess", "PercentSuccess")] + string UpdateStrategyThresholdType { get; set; } + /// The numeric threshold value. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The numeric threshold value.", + SerializedName = @"thresholdValue", + PossibleTypes = new [] { typeof(long) })] + long? UpdateStrategyThresholdValue { get; set; } + /// The mode of operation for runtime protection. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The mode of operation for runtime protection.", + SerializedName = @"strategyType", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Rack", "PauseAfterRack")] + string UpdateStrategyType { get; set; } + /// The time to wait between the increments of update defined by the strategy. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The time to wait between the increments of update defined by the strategy.", + SerializedName = @"waitTimeMinutes", + PossibleTypes = new [] { typeof(long) })] + long? UpdateStrategyWaitTimeMinute { get; set; } + /// The mode selection for container vulnerability scanning. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The mode selection for container vulnerability scanning.", + SerializedName = @"containerScan", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Disabled", "Enabled")] + string VulnerabilityScanningSettingContainerScan { get; set; } + + } + /// ClusterPatchParameters represents the body of the request to patch the cluster properties. + internal partial interface IClusterPatchParametersInternal + + { + /// + /// The rack definition that is intended to reflect only a single rack in a single rack cluster, or an aggregator rack in + /// a multi-rack cluster. + /// + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackDefinition AggregatorOrSingleRackDefinition { get; set; } + /// + /// The zone name used for this rack when created. Availability zones are used for workload placement. + /// + string AggregatorOrSingleRackDefinitionAvailabilityZone { get; set; } + /// The unordered list of bare metal machine configuration. + System.Collections.Generic.List AggregatorOrSingleRackDefinitionBareMetalMachineConfigurationData { get; set; } + /// The resource ID of the network rack that matches this rack definition. + string AggregatorOrSingleRackDefinitionNetworkRackId { get; set; } + /// The free-form description of the rack's location. + string AggregatorOrSingleRackDefinitionRackLocation { get; set; } + /// + /// The unique identifier for the rack within Network Cloud cluster. An alternate unique alphanumeric value other than a serial + /// number may be provided if desired. + /// + string AggregatorOrSingleRackDefinitionRackSerialNumber { get; set; } + /// The resource ID of the sku for the rack being added. + string AggregatorOrSingleRackDefinitionRackSkuId { get; set; } + /// The list of storage appliance configuration data for this rack. + System.Collections.Generic.List AggregatorOrSingleRackDefinitionStorageApplianceConfigurationData { get; set; } + /// + /// The resource ID of the analytics workspace that is to be used by the specified identity. + /// + string AnalyticOutputSettingAnalyticsWorkspaceId { get; set; } + /// + /// The selection of the managed identity to use with this analytics workspace. The identity type must be either system assigned + /// or user assigned. + /// + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IIdentitySelector AnalyticOutputSettingAssociatedIdentity { get; set; } + /// + /// The settings for the log analytics workspace used for output of logs from this cluster. + /// + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAnalyticsOutputSettings AnalyticsOutputSetting { get; set; } + /// The type of managed identity that is being selected. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("SystemAssignedIdentity", "UserAssignedIdentity")] + string AnalyticsOutputSettingsAssociatedIdentityType { get; set; } + /// + /// The user assigned managed identity resource ID to use. Mutually exclusive with a system assigned identity type. + /// + string AnalyticsOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId { get; set; } + /// + /// The customer-provided location information to identify where the cluster resides. + /// + string ClusterLocation { get; set; } + /// + /// The service principal to be used by the cluster during Arc Appliance installation. + /// + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IServicePrincipalInformation ClusterServicePrincipal { get; set; } + /// The application ID, also known as client ID, of the service principal. + string ClusterServicePrincipalApplicationId { get; set; } + /// The principal ID, also known as the object ID, of the service principal. + string ClusterServicePrincipalId { get; set; } + /// The password of the service principal. + System.Security.SecureString ClusterServicePrincipalPassword { get; set; } + /// + /// The tenant ID, also known as the directory ID, of the tenant in which the service principal is created. + /// + string ClusterServicePrincipalTenantId { get; set; } + /// + /// The settings for commands run in this cluster, such as bare metal machine run read only commands and data extracts. + /// + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICommandOutputSettings CommandOutputSetting { get; set; } + /// + /// The selection of the managed identity to use with this storage account container. The identity type must be either system + /// assigned or user assigned. + /// + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IIdentitySelector CommandOutputSettingAssociatedIdentity { get; set; } + /// + /// The URL of the storage account container that is to be used by the specified identities. + /// + string CommandOutputSettingContainerUrl { get; set; } + /// The type of managed identity that is being selected. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("SystemAssignedIdentity", "UserAssignedIdentity")] + string CommandOutputSettingsAssociatedIdentityType { get; set; } + /// + /// The user assigned managed identity resource ID to use. Mutually exclusive with a system assigned identity type. + /// + string CommandOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId { get; set; } + /// + /// The validation threshold indicating the allowable failures of compute machines during environment validation and deployment. + /// + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IValidationThreshold ComputeDeploymentThreshold { get; set; } + /// Selection of how the type evaluation is applied to the cluster calculation. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("PerCluster", "PerRack")] + string ComputeDeploymentThresholdGrouping { get; set; } + /// Selection of how the threshold should be evaluated. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("CountSuccess", "PercentSuccess")] + string ComputeDeploymentThresholdType { get; set; } + /// The numeric threshold value. + long? ComputeDeploymentThresholdValue { get; set; } + /// + /// The list of rack definitions for the compute racks in a multi-rack + /// cluster, or an empty list in a single-rack cluster. + /// + System.Collections.Generic.List ComputeRackDefinition { get; set; } + /// The identity for the resource. + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IManagedServiceIdentity Identity { get; set; } + /// + /// The service principal ID of the system assigned identity. This property will only be provided for a system assigned identity. + /// + string IdentityPrincipalId { get; set; } + /// + /// The tenant ID of the system assigned identity. This property will only be provided for a system assigned identity. + /// + string IdentityTenantId { get; set; } + /// + /// Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.IUserAssignedIdentities IdentityUserAssignedIdentity { get; set; } + /// The list of the resource properties. + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchProperties Property { get; set; } + /// The settings for cluster runtime protection. + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRuntimeProtectionConfiguration RuntimeProtectionConfiguration { get; set; } + /// The mode of operation for runtime protection. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Audit", "Disabled", "OnDemand", "Passive", "RealTime")] + string RuntimeProtectionConfigurationEnforcementLevel { get; set; } + /// + /// The configuration for use of a key vault to store secrets for later retrieval by the operator. + /// + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterSecretArchive SecretArchive { get; set; } + /// The resource ID of the key vault to archive the secrets of the cluster. + string SecretArchiveKeyVaultId { get; set; } + /// The settings for the secret archive used to hold credentials for the cluster. + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISecretArchiveSettings SecretArchiveSetting { get; set; } + /// + /// The selection of the managed identity to use with this vault URI. The identity type must be either system assigned or + /// user assigned. + /// + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IIdentitySelector SecretArchiveSettingAssociatedIdentity { get; set; } + /// The URI for the key vault used as the secret archive. + string SecretArchiveSettingVaultUri { get; set; } + /// The type of managed identity that is being selected. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("SystemAssignedIdentity", "UserAssignedIdentity")] + string SecretArchiveSettingsAssociatedIdentityType { get; set; } + /// + /// The user assigned managed identity resource ID to use. Mutually exclusive with a system assigned identity type. + /// + string SecretArchiveSettingsAssociatedIdentityUserAssignedIdentityResourceId { get; set; } + /// + /// The indicator if the specified key vault should be used to archive the secrets of the cluster. + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("True", "False")] + string SecretArchiveUseKeyVault { get; set; } + /// The Azure resource tags that will replace the existing ones. + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersTags Tag { get; set; } + /// The strategy for updating the cluster. + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterUpdateStrategy UpdateStrategy { get; set; } + /// + /// The maximum number of worker nodes that can be offline within the increment of update, e.g., rack-by-rack. + /// Limited by the maximum number of machines in the increment. Defaults to the whole increment size. + /// + long? UpdateStrategyMaxUnavailable { get; set; } + /// Selection of how the threshold should be evaluated. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("CountSuccess", "PercentSuccess")] + string UpdateStrategyThresholdType { get; set; } + /// The numeric threshold value. + long? UpdateStrategyThresholdValue { get; set; } + /// The mode of operation for runtime protection. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Rack", "PauseAfterRack")] + string UpdateStrategyType { get; set; } + /// The time to wait between the increments of update defined by the strategy. + long? UpdateStrategyWaitTimeMinute { get; set; } + /// The settings for how security vulnerability scanning is applied to the cluster. + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVulnerabilityScanningSettingsPatch VulnerabilityScanningSetting { get; set; } + /// The mode selection for container vulnerability scanning. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Disabled", "Enabled")] + string VulnerabilityScanningSettingContainerScan { get; set; } + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterPatchParameters.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterPatchParameters.json.cs similarity index 93% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterPatchParameters.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterPatchParameters.json.cs index fa14bd9e0fd0..1fed860e2f78 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterPatchParameters.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterPatchParameters.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -67,20 +67,20 @@ internal ClusterPatchParameters(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud. { return; } - {_identity = If( json?.PropertyT("identity"), out var __jsonIdentity) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ManagedServiceIdentity.FromJson(__jsonIdentity) : Identity;} - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ClusterPatchProperties.FromJson(__jsonProperties) : Property;} - {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ClusterPatchParametersTags.FromJson(__jsonTags) : Tag;} + {_identity = If( json?.PropertyT("identity"), out var __jsonIdentity) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ManagedServiceIdentity.FromJson(__jsonIdentity) : _identity;} + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterPatchProperties.FromJson(__jsonProperties) : _property;} + {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterPatchParametersTags.FromJson(__jsonTags) : _tag;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParameters. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParameters. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParameters. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParameters. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParameters FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParameters FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new ClusterPatchParameters(json) : null; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterPatchParametersTags.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterPatchParametersTags.PowerShell.cs similarity index 89% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterPatchParametersTags.PowerShell.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterPatchParametersTags.PowerShell.cs index 891d4edc1a98..3c8c19ca7c99 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterPatchParametersTags.PowerShell.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterPatchParametersTags.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; @@ -63,7 +63,7 @@ public partial class ClusterPatchParametersTags 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 ClusterPatchParametersTags(global::System.Collections.IDictionary conte } /// - /// 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 ClusterPatchParametersTags(global::System.Management.Automation.PSObjec } /// - /// 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.NetworkCloud.Models.Api20250201.IClusterPatchParametersTags DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersTags DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ClusterPatchParametersTags(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.NetworkCloud.Models.Api20250201.IClusterPatchParametersTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ClusterPatchParametersTags(content); } @@ -133,7 +131,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterPatchParametersTags.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterPatchParametersTags.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterPatchParametersTags.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterPatchParametersTags.TypeConverter.cs index 47a5aceaaa27..92ba1fe0c38c 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterPatchParametersTags.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterPatchParametersTags.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IClusterPatchParametersTags ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersTags ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersTags).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersTags).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterPatchParametersTags.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterPatchParametersTags.cs similarity index 84% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterPatchParametersTags.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterPatchParametersTags.cs index b6e698273459..a60bfc32f1d5 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterPatchParametersTags.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterPatchParametersTags.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; /// The Azure resource tags that will replace the existing ones. public partial class ClusterPatchParametersTags : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersTags, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersTagsInternal + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersTags, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersTagsInternal { /// Creates an new instance. diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterPatchParametersTags.dictionary.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterPatchParametersTags.dictionary.cs similarity index 96% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterPatchParametersTags.dictionary.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterPatchParametersTags.dictionary.cs index aa3c04e8aa1b..39c769937ee5 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterPatchParametersTags.dictionary.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterPatchParametersTags.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.ClusterPatchParametersTags source) => source.__additionalProperties; + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterPatchParametersTags source) => source.__additionalProperties; } } \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterPatchParametersTags.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterPatchParametersTags.json.cs similarity index 95% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterPatchParametersTags.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterPatchParametersTags.json.cs index da2b3d4abceb..193ea6dcbec2 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterPatchParametersTags.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterPatchParametersTags.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -71,13 +71,13 @@ internal ClusterPatchParametersTags(Microsoft.Azure.PowerShell.Cmdlets.NetworkCl } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersTags. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersTags. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersTags. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersTags. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParametersTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new ClusterPatchParametersTags(json) : null; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterPatchProperties.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterPatchProperties.PowerShell.cs new file mode 100644 index 000000000000..dd70577427d6 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterPatchProperties.PowerShell.cs @@ -0,0 +1,532 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + + /// ClusterPatchProperties represents the properties of the cluster for patching. + [System.ComponentModel.TypeConverter(typeof(ClusterPatchPropertiesTypeConverter))] + public partial class ClusterPatchProperties + { + + /// + /// 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 ClusterPatchProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("AggregatorOrSingleRackDefinition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).AggregatorOrSingleRackDefinition = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackDefinition) content.GetValueForProperty("AggregatorOrSingleRackDefinition",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).AggregatorOrSingleRackDefinition, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.RackDefinitionTypeConverter.ConvertFrom); + } + if (content.Contains("AnalyticsOutputSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).AnalyticsOutputSetting = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAnalyticsOutputSettings) content.GetValueForProperty("AnalyticsOutputSetting",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).AnalyticsOutputSetting, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AnalyticsOutputSettingsTypeConverter.ConvertFrom); + } + if (content.Contains("ClusterServicePrincipal")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).ClusterServicePrincipal = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IServicePrincipalInformation) content.GetValueForProperty("ClusterServicePrincipal",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).ClusterServicePrincipal, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ServicePrincipalInformationTypeConverter.ConvertFrom); + } + if (content.Contains("CommandOutputSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).CommandOutputSetting = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICommandOutputSettings) content.GetValueForProperty("CommandOutputSetting",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).CommandOutputSetting, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.CommandOutputSettingsTypeConverter.ConvertFrom); + } + if (content.Contains("ComputeDeploymentThreshold")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).ComputeDeploymentThreshold = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IValidationThreshold) content.GetValueForProperty("ComputeDeploymentThreshold",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).ComputeDeploymentThreshold, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ValidationThresholdTypeConverter.ConvertFrom); + } + if (content.Contains("RuntimeProtectionConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).RuntimeProtectionConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRuntimeProtectionConfiguration) content.GetValueForProperty("RuntimeProtectionConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).RuntimeProtectionConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.RuntimeProtectionConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("SecretArchive")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).SecretArchive = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterSecretArchive) content.GetValueForProperty("SecretArchive",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).SecretArchive, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterSecretArchiveTypeConverter.ConvertFrom); + } + if (content.Contains("SecretArchiveSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).SecretArchiveSetting = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISecretArchiveSettings) content.GetValueForProperty("SecretArchiveSetting",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).SecretArchiveSetting, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.SecretArchiveSettingsTypeConverter.ConvertFrom); + } + if (content.Contains("UpdateStrategy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).UpdateStrategy = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterUpdateStrategy) content.GetValueForProperty("UpdateStrategy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).UpdateStrategy, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterUpdateStrategyTypeConverter.ConvertFrom); + } + if (content.Contains("VulnerabilityScanningSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).VulnerabilityScanningSetting = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVulnerabilityScanningSettingsPatch) content.GetValueForProperty("VulnerabilityScanningSetting",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).VulnerabilityScanningSetting, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.VulnerabilityScanningSettingsPatchTypeConverter.ConvertFrom); + } + if (content.Contains("ClusterLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).ClusterLocation = (string) content.GetValueForProperty("ClusterLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).ClusterLocation, global::System.Convert.ToString); + } + if (content.Contains("ComputeRackDefinition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).ComputeRackDefinition = (System.Collections.Generic.List) content.GetValueForProperty("ComputeRackDefinition",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).ComputeRackDefinition, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.RackDefinitionTypeConverter.ConvertFrom)); + } + if (content.Contains("CommandOutputSettingContainerUrl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).CommandOutputSettingContainerUrl = (string) content.GetValueForProperty("CommandOutputSettingContainerUrl",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).CommandOutputSettingContainerUrl, global::System.Convert.ToString); + } + if (content.Contains("SecretArchiveSettingVaultUri")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).SecretArchiveSettingVaultUri = (string) content.GetValueForProperty("SecretArchiveSettingVaultUri",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).SecretArchiveSettingVaultUri, global::System.Convert.ToString); + } + if (content.Contains("VulnerabilityScanningSettingContainerScan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).VulnerabilityScanningSettingContainerScan = (string) content.GetValueForProperty("VulnerabilityScanningSettingContainerScan",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).VulnerabilityScanningSettingContainerScan, global::System.Convert.ToString); + } + if (content.Contains("AggregatorOrSingleRackDefinitionAvailabilityZone")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).AggregatorOrSingleRackDefinitionAvailabilityZone = (string) content.GetValueForProperty("AggregatorOrSingleRackDefinitionAvailabilityZone",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).AggregatorOrSingleRackDefinitionAvailabilityZone, global::System.Convert.ToString); + } + if (content.Contains("AggregatorOrSingleRackDefinitionBareMetalMachineConfigurationData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).AggregatorOrSingleRackDefinitionBareMetalMachineConfigurationData = (System.Collections.Generic.List) content.GetValueForProperty("AggregatorOrSingleRackDefinitionBareMetalMachineConfigurationData",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).AggregatorOrSingleRackDefinitionBareMetalMachineConfigurationData, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BareMetalMachineConfigurationDataTypeConverter.ConvertFrom)); + } + if (content.Contains("AggregatorOrSingleRackDefinitionNetworkRackId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).AggregatorOrSingleRackDefinitionNetworkRackId = (string) content.GetValueForProperty("AggregatorOrSingleRackDefinitionNetworkRackId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).AggregatorOrSingleRackDefinitionNetworkRackId, global::System.Convert.ToString); + } + if (content.Contains("AggregatorOrSingleRackDefinitionRackLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).AggregatorOrSingleRackDefinitionRackLocation = (string) content.GetValueForProperty("AggregatorOrSingleRackDefinitionRackLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).AggregatorOrSingleRackDefinitionRackLocation, global::System.Convert.ToString); + } + if (content.Contains("AggregatorOrSingleRackDefinitionRackSerialNumber")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).AggregatorOrSingleRackDefinitionRackSerialNumber = (string) content.GetValueForProperty("AggregatorOrSingleRackDefinitionRackSerialNumber",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).AggregatorOrSingleRackDefinitionRackSerialNumber, global::System.Convert.ToString); + } + if (content.Contains("AggregatorOrSingleRackDefinitionRackSkuId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).AggregatorOrSingleRackDefinitionRackSkuId = (string) content.GetValueForProperty("AggregatorOrSingleRackDefinitionRackSkuId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).AggregatorOrSingleRackDefinitionRackSkuId, global::System.Convert.ToString); + } + if (content.Contains("AggregatorOrSingleRackDefinitionStorageApplianceConfigurationData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).AggregatorOrSingleRackDefinitionStorageApplianceConfigurationData = (System.Collections.Generic.List) content.GetValueForProperty("AggregatorOrSingleRackDefinitionStorageApplianceConfigurationData",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).AggregatorOrSingleRackDefinitionStorageApplianceConfigurationData, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.StorageApplianceConfigurationDataTypeConverter.ConvertFrom)); + } + if (content.Contains("AnalyticOutputSettingAssociatedIdentity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).AnalyticOutputSettingAssociatedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IIdentitySelector) content.GetValueForProperty("AnalyticOutputSettingAssociatedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).AnalyticOutputSettingAssociatedIdentity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IdentitySelectorTypeConverter.ConvertFrom); + } + if (content.Contains("AnalyticOutputSettingAnalyticsWorkspaceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).AnalyticOutputSettingAnalyticsWorkspaceId = (string) content.GetValueForProperty("AnalyticOutputSettingAnalyticsWorkspaceId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).AnalyticOutputSettingAnalyticsWorkspaceId, global::System.Convert.ToString); + } + if (content.Contains("ClusterServicePrincipalApplicationId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).ClusterServicePrincipalApplicationId = (string) content.GetValueForProperty("ClusterServicePrincipalApplicationId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).ClusterServicePrincipalApplicationId, global::System.Convert.ToString); + } + if (content.Contains("ClusterServicePrincipalPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).ClusterServicePrincipalPassword = (System.Security.SecureString) content.GetValueForProperty("ClusterServicePrincipalPassword",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).ClusterServicePrincipalPassword, (object ss) => (System.Security.SecureString)ss); + } + if (content.Contains("ClusterServicePrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).ClusterServicePrincipalId = (string) content.GetValueForProperty("ClusterServicePrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).ClusterServicePrincipalId, global::System.Convert.ToString); + } + if (content.Contains("ClusterServicePrincipalTenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).ClusterServicePrincipalTenantId = (string) content.GetValueForProperty("ClusterServicePrincipalTenantId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).ClusterServicePrincipalTenantId, global::System.Convert.ToString); + } + if (content.Contains("CommandOutputSettingAssociatedIdentity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).CommandOutputSettingAssociatedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IIdentitySelector) content.GetValueForProperty("CommandOutputSettingAssociatedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).CommandOutputSettingAssociatedIdentity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IdentitySelectorTypeConverter.ConvertFrom); + } + if (content.Contains("ComputeDeploymentThresholdGrouping")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).ComputeDeploymentThresholdGrouping = (string) content.GetValueForProperty("ComputeDeploymentThresholdGrouping",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).ComputeDeploymentThresholdGrouping, global::System.Convert.ToString); + } + if (content.Contains("ComputeDeploymentThresholdType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).ComputeDeploymentThresholdType = (string) content.GetValueForProperty("ComputeDeploymentThresholdType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).ComputeDeploymentThresholdType, global::System.Convert.ToString); + } + if (content.Contains("ComputeDeploymentThresholdValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).ComputeDeploymentThresholdValue = (long?) content.GetValueForProperty("ComputeDeploymentThresholdValue",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).ComputeDeploymentThresholdValue, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("RuntimeProtectionConfigurationEnforcementLevel")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).RuntimeProtectionConfigurationEnforcementLevel = (string) content.GetValueForProperty("RuntimeProtectionConfigurationEnforcementLevel",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).RuntimeProtectionConfigurationEnforcementLevel, global::System.Convert.ToString); + } + if (content.Contains("SecretArchiveKeyVaultId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).SecretArchiveKeyVaultId = (string) content.GetValueForProperty("SecretArchiveKeyVaultId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).SecretArchiveKeyVaultId, global::System.Convert.ToString); + } + if (content.Contains("SecretArchiveUseKeyVault")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).SecretArchiveUseKeyVault = (string) content.GetValueForProperty("SecretArchiveUseKeyVault",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).SecretArchiveUseKeyVault, global::System.Convert.ToString); + } + if (content.Contains("SecretArchiveSettingAssociatedIdentity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).SecretArchiveSettingAssociatedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IIdentitySelector) content.GetValueForProperty("SecretArchiveSettingAssociatedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).SecretArchiveSettingAssociatedIdentity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IdentitySelectorTypeConverter.ConvertFrom); + } + if (content.Contains("UpdateStrategyMaxUnavailable")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).UpdateStrategyMaxUnavailable = (long?) content.GetValueForProperty("UpdateStrategyMaxUnavailable",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).UpdateStrategyMaxUnavailable, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("UpdateStrategyType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).UpdateStrategyType = (string) content.GetValueForProperty("UpdateStrategyType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).UpdateStrategyType, global::System.Convert.ToString); + } + if (content.Contains("UpdateStrategyThresholdType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).UpdateStrategyThresholdType = (string) content.GetValueForProperty("UpdateStrategyThresholdType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).UpdateStrategyThresholdType, global::System.Convert.ToString); + } + if (content.Contains("UpdateStrategyThresholdValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).UpdateStrategyThresholdValue = (long?) content.GetValueForProperty("UpdateStrategyThresholdValue",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).UpdateStrategyThresholdValue, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("UpdateStrategyWaitTimeMinute")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).UpdateStrategyWaitTimeMinute = (long?) content.GetValueForProperty("UpdateStrategyWaitTimeMinute",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).UpdateStrategyWaitTimeMinute, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("AnalyticsOutputSettingsAssociatedIdentityType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).AnalyticsOutputSettingsAssociatedIdentityType = (string) content.GetValueForProperty("AnalyticsOutputSettingsAssociatedIdentityType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).AnalyticsOutputSettingsAssociatedIdentityType, global::System.Convert.ToString); + } + if (content.Contains("AnalyticsOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).AnalyticsOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId = (string) content.GetValueForProperty("AnalyticsOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).AnalyticsOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId, global::System.Convert.ToString); + } + if (content.Contains("CommandOutputSettingsAssociatedIdentityType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).CommandOutputSettingsAssociatedIdentityType = (string) content.GetValueForProperty("CommandOutputSettingsAssociatedIdentityType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).CommandOutputSettingsAssociatedIdentityType, global::System.Convert.ToString); + } + if (content.Contains("CommandOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).CommandOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId = (string) content.GetValueForProperty("CommandOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).CommandOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId, global::System.Convert.ToString); + } + if (content.Contains("SecretArchiveSettingsAssociatedIdentityType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).SecretArchiveSettingsAssociatedIdentityType = (string) content.GetValueForProperty("SecretArchiveSettingsAssociatedIdentityType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).SecretArchiveSettingsAssociatedIdentityType, global::System.Convert.ToString); + } + if (content.Contains("SecretArchiveSettingsAssociatedIdentityUserAssignedIdentityResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).SecretArchiveSettingsAssociatedIdentityUserAssignedIdentityResourceId = (string) content.GetValueForProperty("SecretArchiveSettingsAssociatedIdentityUserAssignedIdentityResourceId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).SecretArchiveSettingsAssociatedIdentityUserAssignedIdentityResourceId, 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 ClusterPatchProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("AggregatorOrSingleRackDefinition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).AggregatorOrSingleRackDefinition = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackDefinition) content.GetValueForProperty("AggregatorOrSingleRackDefinition",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).AggregatorOrSingleRackDefinition, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.RackDefinitionTypeConverter.ConvertFrom); + } + if (content.Contains("AnalyticsOutputSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).AnalyticsOutputSetting = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAnalyticsOutputSettings) content.GetValueForProperty("AnalyticsOutputSetting",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).AnalyticsOutputSetting, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AnalyticsOutputSettingsTypeConverter.ConvertFrom); + } + if (content.Contains("ClusterServicePrincipal")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).ClusterServicePrincipal = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IServicePrincipalInformation) content.GetValueForProperty("ClusterServicePrincipal",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).ClusterServicePrincipal, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ServicePrincipalInformationTypeConverter.ConvertFrom); + } + if (content.Contains("CommandOutputSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).CommandOutputSetting = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICommandOutputSettings) content.GetValueForProperty("CommandOutputSetting",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).CommandOutputSetting, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.CommandOutputSettingsTypeConverter.ConvertFrom); + } + if (content.Contains("ComputeDeploymentThreshold")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).ComputeDeploymentThreshold = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IValidationThreshold) content.GetValueForProperty("ComputeDeploymentThreshold",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).ComputeDeploymentThreshold, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ValidationThresholdTypeConverter.ConvertFrom); + } + if (content.Contains("RuntimeProtectionConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).RuntimeProtectionConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRuntimeProtectionConfiguration) content.GetValueForProperty("RuntimeProtectionConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).RuntimeProtectionConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.RuntimeProtectionConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("SecretArchive")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).SecretArchive = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterSecretArchive) content.GetValueForProperty("SecretArchive",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).SecretArchive, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterSecretArchiveTypeConverter.ConvertFrom); + } + if (content.Contains("SecretArchiveSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).SecretArchiveSetting = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISecretArchiveSettings) content.GetValueForProperty("SecretArchiveSetting",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).SecretArchiveSetting, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.SecretArchiveSettingsTypeConverter.ConvertFrom); + } + if (content.Contains("UpdateStrategy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).UpdateStrategy = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterUpdateStrategy) content.GetValueForProperty("UpdateStrategy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).UpdateStrategy, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterUpdateStrategyTypeConverter.ConvertFrom); + } + if (content.Contains("VulnerabilityScanningSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).VulnerabilityScanningSetting = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVulnerabilityScanningSettingsPatch) content.GetValueForProperty("VulnerabilityScanningSetting",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).VulnerabilityScanningSetting, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.VulnerabilityScanningSettingsPatchTypeConverter.ConvertFrom); + } + if (content.Contains("ClusterLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).ClusterLocation = (string) content.GetValueForProperty("ClusterLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).ClusterLocation, global::System.Convert.ToString); + } + if (content.Contains("ComputeRackDefinition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).ComputeRackDefinition = (System.Collections.Generic.List) content.GetValueForProperty("ComputeRackDefinition",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).ComputeRackDefinition, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.RackDefinitionTypeConverter.ConvertFrom)); + } + if (content.Contains("CommandOutputSettingContainerUrl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).CommandOutputSettingContainerUrl = (string) content.GetValueForProperty("CommandOutputSettingContainerUrl",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).CommandOutputSettingContainerUrl, global::System.Convert.ToString); + } + if (content.Contains("SecretArchiveSettingVaultUri")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).SecretArchiveSettingVaultUri = (string) content.GetValueForProperty("SecretArchiveSettingVaultUri",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).SecretArchiveSettingVaultUri, global::System.Convert.ToString); + } + if (content.Contains("VulnerabilityScanningSettingContainerScan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).VulnerabilityScanningSettingContainerScan = (string) content.GetValueForProperty("VulnerabilityScanningSettingContainerScan",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).VulnerabilityScanningSettingContainerScan, global::System.Convert.ToString); + } + if (content.Contains("AggregatorOrSingleRackDefinitionAvailabilityZone")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).AggregatorOrSingleRackDefinitionAvailabilityZone = (string) content.GetValueForProperty("AggregatorOrSingleRackDefinitionAvailabilityZone",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).AggregatorOrSingleRackDefinitionAvailabilityZone, global::System.Convert.ToString); + } + if (content.Contains("AggregatorOrSingleRackDefinitionBareMetalMachineConfigurationData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).AggregatorOrSingleRackDefinitionBareMetalMachineConfigurationData = (System.Collections.Generic.List) content.GetValueForProperty("AggregatorOrSingleRackDefinitionBareMetalMachineConfigurationData",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).AggregatorOrSingleRackDefinitionBareMetalMachineConfigurationData, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BareMetalMachineConfigurationDataTypeConverter.ConvertFrom)); + } + if (content.Contains("AggregatorOrSingleRackDefinitionNetworkRackId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).AggregatorOrSingleRackDefinitionNetworkRackId = (string) content.GetValueForProperty("AggregatorOrSingleRackDefinitionNetworkRackId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).AggregatorOrSingleRackDefinitionNetworkRackId, global::System.Convert.ToString); + } + if (content.Contains("AggregatorOrSingleRackDefinitionRackLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).AggregatorOrSingleRackDefinitionRackLocation = (string) content.GetValueForProperty("AggregatorOrSingleRackDefinitionRackLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).AggregatorOrSingleRackDefinitionRackLocation, global::System.Convert.ToString); + } + if (content.Contains("AggregatorOrSingleRackDefinitionRackSerialNumber")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).AggregatorOrSingleRackDefinitionRackSerialNumber = (string) content.GetValueForProperty("AggregatorOrSingleRackDefinitionRackSerialNumber",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).AggregatorOrSingleRackDefinitionRackSerialNumber, global::System.Convert.ToString); + } + if (content.Contains("AggregatorOrSingleRackDefinitionRackSkuId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).AggregatorOrSingleRackDefinitionRackSkuId = (string) content.GetValueForProperty("AggregatorOrSingleRackDefinitionRackSkuId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).AggregatorOrSingleRackDefinitionRackSkuId, global::System.Convert.ToString); + } + if (content.Contains("AggregatorOrSingleRackDefinitionStorageApplianceConfigurationData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).AggregatorOrSingleRackDefinitionStorageApplianceConfigurationData = (System.Collections.Generic.List) content.GetValueForProperty("AggregatorOrSingleRackDefinitionStorageApplianceConfigurationData",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).AggregatorOrSingleRackDefinitionStorageApplianceConfigurationData, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.StorageApplianceConfigurationDataTypeConverter.ConvertFrom)); + } + if (content.Contains("AnalyticOutputSettingAssociatedIdentity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).AnalyticOutputSettingAssociatedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IIdentitySelector) content.GetValueForProperty("AnalyticOutputSettingAssociatedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).AnalyticOutputSettingAssociatedIdentity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IdentitySelectorTypeConverter.ConvertFrom); + } + if (content.Contains("AnalyticOutputSettingAnalyticsWorkspaceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).AnalyticOutputSettingAnalyticsWorkspaceId = (string) content.GetValueForProperty("AnalyticOutputSettingAnalyticsWorkspaceId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).AnalyticOutputSettingAnalyticsWorkspaceId, global::System.Convert.ToString); + } + if (content.Contains("ClusterServicePrincipalApplicationId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).ClusterServicePrincipalApplicationId = (string) content.GetValueForProperty("ClusterServicePrincipalApplicationId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).ClusterServicePrincipalApplicationId, global::System.Convert.ToString); + } + if (content.Contains("ClusterServicePrincipalPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).ClusterServicePrincipalPassword = (System.Security.SecureString) content.GetValueForProperty("ClusterServicePrincipalPassword",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).ClusterServicePrincipalPassword, (object ss) => (System.Security.SecureString)ss); + } + if (content.Contains("ClusterServicePrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).ClusterServicePrincipalId = (string) content.GetValueForProperty("ClusterServicePrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).ClusterServicePrincipalId, global::System.Convert.ToString); + } + if (content.Contains("ClusterServicePrincipalTenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).ClusterServicePrincipalTenantId = (string) content.GetValueForProperty("ClusterServicePrincipalTenantId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).ClusterServicePrincipalTenantId, global::System.Convert.ToString); + } + if (content.Contains("CommandOutputSettingAssociatedIdentity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).CommandOutputSettingAssociatedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IIdentitySelector) content.GetValueForProperty("CommandOutputSettingAssociatedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).CommandOutputSettingAssociatedIdentity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IdentitySelectorTypeConverter.ConvertFrom); + } + if (content.Contains("ComputeDeploymentThresholdGrouping")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).ComputeDeploymentThresholdGrouping = (string) content.GetValueForProperty("ComputeDeploymentThresholdGrouping",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).ComputeDeploymentThresholdGrouping, global::System.Convert.ToString); + } + if (content.Contains("ComputeDeploymentThresholdType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).ComputeDeploymentThresholdType = (string) content.GetValueForProperty("ComputeDeploymentThresholdType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).ComputeDeploymentThresholdType, global::System.Convert.ToString); + } + if (content.Contains("ComputeDeploymentThresholdValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).ComputeDeploymentThresholdValue = (long?) content.GetValueForProperty("ComputeDeploymentThresholdValue",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).ComputeDeploymentThresholdValue, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("RuntimeProtectionConfigurationEnforcementLevel")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).RuntimeProtectionConfigurationEnforcementLevel = (string) content.GetValueForProperty("RuntimeProtectionConfigurationEnforcementLevel",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).RuntimeProtectionConfigurationEnforcementLevel, global::System.Convert.ToString); + } + if (content.Contains("SecretArchiveKeyVaultId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).SecretArchiveKeyVaultId = (string) content.GetValueForProperty("SecretArchiveKeyVaultId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).SecretArchiveKeyVaultId, global::System.Convert.ToString); + } + if (content.Contains("SecretArchiveUseKeyVault")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).SecretArchiveUseKeyVault = (string) content.GetValueForProperty("SecretArchiveUseKeyVault",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).SecretArchiveUseKeyVault, global::System.Convert.ToString); + } + if (content.Contains("SecretArchiveSettingAssociatedIdentity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).SecretArchiveSettingAssociatedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IIdentitySelector) content.GetValueForProperty("SecretArchiveSettingAssociatedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).SecretArchiveSettingAssociatedIdentity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IdentitySelectorTypeConverter.ConvertFrom); + } + if (content.Contains("UpdateStrategyMaxUnavailable")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).UpdateStrategyMaxUnavailable = (long?) content.GetValueForProperty("UpdateStrategyMaxUnavailable",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).UpdateStrategyMaxUnavailable, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("UpdateStrategyType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).UpdateStrategyType = (string) content.GetValueForProperty("UpdateStrategyType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).UpdateStrategyType, global::System.Convert.ToString); + } + if (content.Contains("UpdateStrategyThresholdType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).UpdateStrategyThresholdType = (string) content.GetValueForProperty("UpdateStrategyThresholdType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).UpdateStrategyThresholdType, global::System.Convert.ToString); + } + if (content.Contains("UpdateStrategyThresholdValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).UpdateStrategyThresholdValue = (long?) content.GetValueForProperty("UpdateStrategyThresholdValue",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).UpdateStrategyThresholdValue, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("UpdateStrategyWaitTimeMinute")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).UpdateStrategyWaitTimeMinute = (long?) content.GetValueForProperty("UpdateStrategyWaitTimeMinute",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).UpdateStrategyWaitTimeMinute, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("AnalyticsOutputSettingsAssociatedIdentityType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).AnalyticsOutputSettingsAssociatedIdentityType = (string) content.GetValueForProperty("AnalyticsOutputSettingsAssociatedIdentityType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).AnalyticsOutputSettingsAssociatedIdentityType, global::System.Convert.ToString); + } + if (content.Contains("AnalyticsOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).AnalyticsOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId = (string) content.GetValueForProperty("AnalyticsOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).AnalyticsOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId, global::System.Convert.ToString); + } + if (content.Contains("CommandOutputSettingsAssociatedIdentityType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).CommandOutputSettingsAssociatedIdentityType = (string) content.GetValueForProperty("CommandOutputSettingsAssociatedIdentityType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).CommandOutputSettingsAssociatedIdentityType, global::System.Convert.ToString); + } + if (content.Contains("CommandOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).CommandOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId = (string) content.GetValueForProperty("CommandOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).CommandOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId, global::System.Convert.ToString); + } + if (content.Contains("SecretArchiveSettingsAssociatedIdentityType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).SecretArchiveSettingsAssociatedIdentityType = (string) content.GetValueForProperty("SecretArchiveSettingsAssociatedIdentityType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).SecretArchiveSettingsAssociatedIdentityType, global::System.Convert.ToString); + } + if (content.Contains("SecretArchiveSettingsAssociatedIdentityUserAssignedIdentityResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).SecretArchiveSettingsAssociatedIdentityUserAssignedIdentityResourceId = (string) content.GetValueForProperty("SecretArchiveSettingsAssociatedIdentityUserAssignedIdentityResourceId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal)this).SecretArchiveSettingsAssociatedIdentityUserAssignedIdentityResourceId, 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.NetworkCloud.Models.IClusterPatchProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ClusterPatchProperties(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.NetworkCloud.Models.IClusterPatchProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ClusterPatchProperties(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.NetworkCloud.Models.IClusterPatchProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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(); + } + } + /// ClusterPatchProperties represents the properties of the cluster for patching. + [System.ComponentModel.TypeConverter(typeof(ClusterPatchPropertiesTypeConverter))] + public partial interface IClusterPatchProperties + + { + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterPatchProperties.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterPatchProperties.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterPatchProperties.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterPatchProperties.TypeConverter.cs index bf5abd1ba672..f5bf178326c0 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterPatchProperties.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterPatchProperties.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IClusterPatchProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterPatchProperties.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterPatchProperties.cs new file mode 100644 index 000000000000..0575ff464ce9 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterPatchProperties.cs @@ -0,0 +1,891 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + + /// ClusterPatchProperties represents the properties of the cluster for patching. + public partial class ClusterPatchProperties : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchProperties, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackDefinition _aggregatorOrSingleRackDefinition; + + /// + /// The rack definition that is intended to reflect only a single rack in a single rack cluster, or an aggregator rack in + /// a multi-rack cluster. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackDefinition AggregatorOrSingleRackDefinition { get => (this._aggregatorOrSingleRackDefinition = this._aggregatorOrSingleRackDefinition ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.RackDefinition()); set => this._aggregatorOrSingleRackDefinition = value; } + + /// + /// The zone name used for this rack when created. Availability zones are used for workload placement. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string AggregatorOrSingleRackDefinitionAvailabilityZone { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackDefinitionInternal)AggregatorOrSingleRackDefinition).AvailabilityZone; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackDefinitionInternal)AggregatorOrSingleRackDefinition).AvailabilityZone = value ?? null; } + + /// The unordered list of bare metal machine configuration. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public System.Collections.Generic.List AggregatorOrSingleRackDefinitionBareMetalMachineConfigurationData { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackDefinitionInternal)AggregatorOrSingleRackDefinition).BareMetalMachineConfigurationData; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackDefinitionInternal)AggregatorOrSingleRackDefinition).BareMetalMachineConfigurationData = value ?? null /* arrayOf */; } + + /// The resource ID of the network rack that matches this rack definition. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string AggregatorOrSingleRackDefinitionNetworkRackId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackDefinitionInternal)AggregatorOrSingleRackDefinition).NetworkRackId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackDefinitionInternal)AggregatorOrSingleRackDefinition).NetworkRackId = value ?? null; } + + /// The free-form description of the rack's location. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string AggregatorOrSingleRackDefinitionRackLocation { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackDefinitionInternal)AggregatorOrSingleRackDefinition).RackLocation; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackDefinitionInternal)AggregatorOrSingleRackDefinition).RackLocation = value ?? null; } + + /// + /// The unique identifier for the rack within Network Cloud cluster. An alternate unique alphanumeric value other than a serial + /// number may be provided if desired. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string AggregatorOrSingleRackDefinitionRackSerialNumber { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackDefinitionInternal)AggregatorOrSingleRackDefinition).RackSerialNumber; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackDefinitionInternal)AggregatorOrSingleRackDefinition).RackSerialNumber = value ?? null; } + + /// The resource ID of the sku for the rack being added. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string AggregatorOrSingleRackDefinitionRackSkuId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackDefinitionInternal)AggregatorOrSingleRackDefinition).RackSkuId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackDefinitionInternal)AggregatorOrSingleRackDefinition).RackSkuId = value ?? null; } + + /// The list of storage appliance configuration data for this rack. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public System.Collections.Generic.List AggregatorOrSingleRackDefinitionStorageApplianceConfigurationData { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackDefinitionInternal)AggregatorOrSingleRackDefinition).StorageApplianceConfigurationData; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackDefinitionInternal)AggregatorOrSingleRackDefinition).StorageApplianceConfigurationData = value ?? null /* arrayOf */; } + + /// + /// The resource ID of the analytics workspace that is to be used by the specified identity. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string AnalyticOutputSettingAnalyticsWorkspaceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAnalyticsOutputSettingsInternal)AnalyticsOutputSetting).AnalyticsWorkspaceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAnalyticsOutputSettingsInternal)AnalyticsOutputSetting).AnalyticsWorkspaceId = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAnalyticsOutputSettings _analyticsOutputSetting; + + /// + /// The settings for the log analytics workspace used for output of logs from this cluster. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAnalyticsOutputSettings AnalyticsOutputSetting { get => (this._analyticsOutputSetting = this._analyticsOutputSetting ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AnalyticsOutputSettings()); set => this._analyticsOutputSetting = value; } + + /// The type of managed identity that is being selected. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string AnalyticsOutputSettingsAssociatedIdentityType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAnalyticsOutputSettingsInternal)AnalyticsOutputSetting).AssociatedIdentityType; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAnalyticsOutputSettingsInternal)AnalyticsOutputSetting).AssociatedIdentityType = value ?? null; } + + /// + /// The user assigned managed identity resource ID to use. Mutually exclusive with a system assigned identity type. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string AnalyticsOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAnalyticsOutputSettingsInternal)AnalyticsOutputSetting).AssociatedIdentityUserAssignedIdentityResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAnalyticsOutputSettingsInternal)AnalyticsOutputSetting).AssociatedIdentityUserAssignedIdentityResourceId = value ?? null; } + + /// Backing field for property. + private string _clusterLocation; + + /// + /// The customer-provided location information to identify where the cluster resides. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string ClusterLocation { get => this._clusterLocation; set => this._clusterLocation = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IServicePrincipalInformation _clusterServicePrincipal; + + /// + /// The service principal to be used by the cluster during Arc Appliance installation. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IServicePrincipalInformation ClusterServicePrincipal { get => (this._clusterServicePrincipal = this._clusterServicePrincipal ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ServicePrincipalInformation()); set => this._clusterServicePrincipal = value; } + + /// The application ID, also known as client ID, of the service principal. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string ClusterServicePrincipalApplicationId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IServicePrincipalInformationInternal)ClusterServicePrincipal).ApplicationId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IServicePrincipalInformationInternal)ClusterServicePrincipal).ApplicationId = value ?? null; } + + /// The principal ID, also known as the object ID, of the service principal. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string ClusterServicePrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IServicePrincipalInformationInternal)ClusterServicePrincipal).PrincipalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IServicePrincipalInformationInternal)ClusterServicePrincipal).PrincipalId = value ?? null; } + + /// The password of the service principal. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public System.Security.SecureString ClusterServicePrincipalPassword { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IServicePrincipalInformationInternal)ClusterServicePrincipal).Password; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IServicePrincipalInformationInternal)ClusterServicePrincipal).Password = value ?? null; } + + /// + /// The tenant ID, also known as the directory ID, of the tenant in which the service principal is created. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string ClusterServicePrincipalTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IServicePrincipalInformationInternal)ClusterServicePrincipal).TenantId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IServicePrincipalInformationInternal)ClusterServicePrincipal).TenantId = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICommandOutputSettings _commandOutputSetting; + + /// + /// The settings for commands run in this cluster, such as bare metal machine run read only commands and data extracts. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICommandOutputSettings CommandOutputSetting { get => (this._commandOutputSetting = this._commandOutputSetting ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.CommandOutputSettings()); set => this._commandOutputSetting = value; } + + /// + /// The URL of the storage account container that is to be used by the specified identities. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string CommandOutputSettingContainerUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICommandOutputSettingsInternal)CommandOutputSetting).ContainerUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICommandOutputSettingsInternal)CommandOutputSetting).ContainerUrl = value ?? null; } + + /// The type of managed identity that is being selected. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string CommandOutputSettingsAssociatedIdentityType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICommandOutputSettingsInternal)CommandOutputSetting).AssociatedIdentityType; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICommandOutputSettingsInternal)CommandOutputSetting).AssociatedIdentityType = value ?? null; } + + /// + /// The user assigned managed identity resource ID to use. Mutually exclusive with a system assigned identity type. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string CommandOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICommandOutputSettingsInternal)CommandOutputSetting).AssociatedIdentityUserAssignedIdentityResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICommandOutputSettingsInternal)CommandOutputSetting).AssociatedIdentityUserAssignedIdentityResourceId = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IValidationThreshold _computeDeploymentThreshold; + + /// + /// The validation threshold indicating the allowable failures of compute machines during environment validation and deployment. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IValidationThreshold ComputeDeploymentThreshold { get => (this._computeDeploymentThreshold = this._computeDeploymentThreshold ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ValidationThreshold()); set => this._computeDeploymentThreshold = value; } + + /// Selection of how the type evaluation is applied to the cluster calculation. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string ComputeDeploymentThresholdGrouping { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IValidationThresholdInternal)ComputeDeploymentThreshold).Grouping; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IValidationThresholdInternal)ComputeDeploymentThreshold).Grouping = value ?? null; } + + /// Selection of how the threshold should be evaluated. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string ComputeDeploymentThresholdType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IValidationThresholdInternal)ComputeDeploymentThreshold).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IValidationThresholdInternal)ComputeDeploymentThreshold).Type = value ?? null; } + + /// The numeric threshold value. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public long? ComputeDeploymentThresholdValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IValidationThresholdInternal)ComputeDeploymentThreshold).Value; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IValidationThresholdInternal)ComputeDeploymentThreshold).Value = value ?? default(long); } + + /// Backing field for property. + private System.Collections.Generic.List _computeRackDefinition; + + /// + /// The list of rack definitions for the compute racks in a multi-rack + /// cluster, or an empty list in a single-rack cluster. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public System.Collections.Generic.List ComputeRackDefinition { get => this._computeRackDefinition; set => this._computeRackDefinition = value; } + + /// Internal Acessors for AggregatorOrSingleRackDefinition + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackDefinition Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal.AggregatorOrSingleRackDefinition { get => (this._aggregatorOrSingleRackDefinition = this._aggregatorOrSingleRackDefinition ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.RackDefinition()); set { {_aggregatorOrSingleRackDefinition = value;} } } + + /// Internal Acessors for AnalyticOutputSettingAssociatedIdentity + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IIdentitySelector Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal.AnalyticOutputSettingAssociatedIdentity { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAnalyticsOutputSettingsInternal)AnalyticsOutputSetting).AssociatedIdentity; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAnalyticsOutputSettingsInternal)AnalyticsOutputSetting).AssociatedIdentity = value ?? null /* model class */; } + + /// Internal Acessors for AnalyticsOutputSetting + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAnalyticsOutputSettings Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal.AnalyticsOutputSetting { get => (this._analyticsOutputSetting = this._analyticsOutputSetting ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AnalyticsOutputSettings()); set { {_analyticsOutputSetting = value;} } } + + /// Internal Acessors for ClusterServicePrincipal + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IServicePrincipalInformation Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal.ClusterServicePrincipal { get => (this._clusterServicePrincipal = this._clusterServicePrincipal ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ServicePrincipalInformation()); set { {_clusterServicePrincipal = value;} } } + + /// Internal Acessors for CommandOutputSetting + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICommandOutputSettings Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal.CommandOutputSetting { get => (this._commandOutputSetting = this._commandOutputSetting ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.CommandOutputSettings()); set { {_commandOutputSetting = value;} } } + + /// Internal Acessors for CommandOutputSettingAssociatedIdentity + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IIdentitySelector Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal.CommandOutputSettingAssociatedIdentity { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICommandOutputSettingsInternal)CommandOutputSetting).AssociatedIdentity; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICommandOutputSettingsInternal)CommandOutputSetting).AssociatedIdentity = value ?? null /* model class */; } + + /// Internal Acessors for ComputeDeploymentThreshold + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IValidationThreshold Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal.ComputeDeploymentThreshold { get => (this._computeDeploymentThreshold = this._computeDeploymentThreshold ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ValidationThreshold()); set { {_computeDeploymentThreshold = value;} } } + + /// Internal Acessors for RuntimeProtectionConfiguration + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRuntimeProtectionConfiguration Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal.RuntimeProtectionConfiguration { get => (this._runtimeProtectionConfiguration = this._runtimeProtectionConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.RuntimeProtectionConfiguration()); set { {_runtimeProtectionConfiguration = value;} } } + + /// Internal Acessors for SecretArchive + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterSecretArchive Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal.SecretArchive { get => (this._secretArchive = this._secretArchive ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterSecretArchive()); set { {_secretArchive = value;} } } + + /// Internal Acessors for SecretArchiveSetting + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISecretArchiveSettings Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal.SecretArchiveSetting { get => (this._secretArchiveSetting = this._secretArchiveSetting ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.SecretArchiveSettings()); set { {_secretArchiveSetting = value;} } } + + /// Internal Acessors for SecretArchiveSettingAssociatedIdentity + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IIdentitySelector Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal.SecretArchiveSettingAssociatedIdentity { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISecretArchiveSettingsInternal)SecretArchiveSetting).AssociatedIdentity; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISecretArchiveSettingsInternal)SecretArchiveSetting).AssociatedIdentity = value ?? null /* model class */; } + + /// Internal Acessors for UpdateStrategy + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterUpdateStrategy Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal.UpdateStrategy { get => (this._updateStrategy = this._updateStrategy ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterUpdateStrategy()); set { {_updateStrategy = value;} } } + + /// Internal Acessors for VulnerabilityScanningSetting + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVulnerabilityScanningSettingsPatch Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchPropertiesInternal.VulnerabilityScanningSetting { get => (this._vulnerabilityScanningSetting = this._vulnerabilityScanningSetting ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.VulnerabilityScanningSettingsPatch()); set { {_vulnerabilityScanningSetting = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRuntimeProtectionConfiguration _runtimeProtectionConfiguration; + + /// The settings for cluster runtime protection. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRuntimeProtectionConfiguration RuntimeProtectionConfiguration { get => (this._runtimeProtectionConfiguration = this._runtimeProtectionConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.RuntimeProtectionConfiguration()); set => this._runtimeProtectionConfiguration = value; } + + /// The mode of operation for runtime protection. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string RuntimeProtectionConfigurationEnforcementLevel { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRuntimeProtectionConfigurationInternal)RuntimeProtectionConfiguration).EnforcementLevel; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRuntimeProtectionConfigurationInternal)RuntimeProtectionConfiguration).EnforcementLevel = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterSecretArchive _secretArchive; + + /// + /// The configuration for use of a key vault to store secrets for later retrieval by the operator. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterSecretArchive SecretArchive { get => (this._secretArchive = this._secretArchive ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterSecretArchive()); set => this._secretArchive = value; } + + /// The resource ID of the key vault to archive the secrets of the cluster. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string SecretArchiveKeyVaultId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterSecretArchiveInternal)SecretArchive).KeyVaultId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterSecretArchiveInternal)SecretArchive).KeyVaultId = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISecretArchiveSettings _secretArchiveSetting; + + /// The settings for the secret archive used to hold credentials for the cluster. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISecretArchiveSettings SecretArchiveSetting { get => (this._secretArchiveSetting = this._secretArchiveSetting ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.SecretArchiveSettings()); set => this._secretArchiveSetting = value; } + + /// The URI for the key vault used as the secret archive. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string SecretArchiveSettingVaultUri { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISecretArchiveSettingsInternal)SecretArchiveSetting).VaultUri; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISecretArchiveSettingsInternal)SecretArchiveSetting).VaultUri = value ?? null; } + + /// The type of managed identity that is being selected. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string SecretArchiveSettingsAssociatedIdentityType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISecretArchiveSettingsInternal)SecretArchiveSetting).AssociatedIdentityType; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISecretArchiveSettingsInternal)SecretArchiveSetting).AssociatedIdentityType = value ?? null; } + + /// + /// The user assigned managed identity resource ID to use. Mutually exclusive with a system assigned identity type. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string SecretArchiveSettingsAssociatedIdentityUserAssignedIdentityResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISecretArchiveSettingsInternal)SecretArchiveSetting).AssociatedIdentityUserAssignedIdentityResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISecretArchiveSettingsInternal)SecretArchiveSetting).AssociatedIdentityUserAssignedIdentityResourceId = value ?? null; } + + /// + /// The indicator if the specified key vault should be used to archive the secrets of the cluster. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string SecretArchiveUseKeyVault { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterSecretArchiveInternal)SecretArchive).UseKeyVault; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterSecretArchiveInternal)SecretArchive).UseKeyVault = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterUpdateStrategy _updateStrategy; + + /// The strategy for updating the cluster. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterUpdateStrategy UpdateStrategy { get => (this._updateStrategy = this._updateStrategy ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterUpdateStrategy()); set => this._updateStrategy = value; } + + /// + /// The maximum number of worker nodes that can be offline within the increment of update, e.g., rack-by-rack. + /// Limited by the maximum number of machines in the increment. Defaults to the whole increment size. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public long? UpdateStrategyMaxUnavailable { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterUpdateStrategyInternal)UpdateStrategy).MaxUnavailable; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterUpdateStrategyInternal)UpdateStrategy).MaxUnavailable = value ?? default(long); } + + /// Selection of how the threshold should be evaluated. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string UpdateStrategyThresholdType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterUpdateStrategyInternal)UpdateStrategy).ThresholdType; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterUpdateStrategyInternal)UpdateStrategy).ThresholdType = value ?? null; } + + /// The numeric threshold value. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public long? UpdateStrategyThresholdValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterUpdateStrategyInternal)UpdateStrategy).ThresholdValue; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterUpdateStrategyInternal)UpdateStrategy).ThresholdValue = value ?? default(long); } + + /// The mode of operation for runtime protection. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string UpdateStrategyType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterUpdateStrategyInternal)UpdateStrategy).StrategyType; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterUpdateStrategyInternal)UpdateStrategy).StrategyType = value ?? null; } + + /// The time to wait between the increments of update defined by the strategy. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public long? UpdateStrategyWaitTimeMinute { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterUpdateStrategyInternal)UpdateStrategy).WaitTimeMinute; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterUpdateStrategyInternal)UpdateStrategy).WaitTimeMinute = value ?? default(long); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVulnerabilityScanningSettingsPatch _vulnerabilityScanningSetting; + + /// The settings for how security vulnerability scanning is applied to the cluster. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVulnerabilityScanningSettingsPatch VulnerabilityScanningSetting { get => (this._vulnerabilityScanningSetting = this._vulnerabilityScanningSetting ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.VulnerabilityScanningSettingsPatch()); set => this._vulnerabilityScanningSetting = value; } + + /// The mode selection for container vulnerability scanning. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string VulnerabilityScanningSettingContainerScan { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVulnerabilityScanningSettingsPatchInternal)VulnerabilityScanningSetting).ContainerScan; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVulnerabilityScanningSettingsPatchInternal)VulnerabilityScanningSetting).ContainerScan = value ?? null; } + + /// Creates an new instance. + public ClusterPatchProperties() + { + + } + } + /// ClusterPatchProperties represents the properties of the cluster for patching. + public partial interface IClusterPatchProperties : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable + { + /// + /// The zone name used for this rack when created. Availability zones are used for workload placement. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The zone name used for this rack when created. Availability zones are used for workload placement.", + SerializedName = @"availabilityZone", + PossibleTypes = new [] { typeof(string) })] + string AggregatorOrSingleRackDefinitionAvailabilityZone { get; set; } + /// The unordered list of bare metal machine configuration. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The unordered list of bare metal machine configuration.", + SerializedName = @"bareMetalMachineConfigurationData", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineConfigurationData) })] + System.Collections.Generic.List AggregatorOrSingleRackDefinitionBareMetalMachineConfigurationData { get; set; } + /// The resource ID of the network rack that matches this rack definition. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The resource ID of the network rack that matches this rack definition.", + SerializedName = @"networkRackId", + PossibleTypes = new [] { typeof(string) })] + string AggregatorOrSingleRackDefinitionNetworkRackId { get; set; } + /// The free-form description of the rack's location. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The free-form description of the rack's location.", + SerializedName = @"rackLocation", + PossibleTypes = new [] { typeof(string) })] + string AggregatorOrSingleRackDefinitionRackLocation { get; set; } + /// + /// The unique identifier for the rack within Network Cloud cluster. An alternate unique alphanumeric value other than a serial + /// number may be provided if desired. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The unique identifier for the rack within Network Cloud cluster. An alternate unique alphanumeric value other than a serial number may be provided if desired.", + SerializedName = @"rackSerialNumber", + PossibleTypes = new [] { typeof(string) })] + string AggregatorOrSingleRackDefinitionRackSerialNumber { get; set; } + /// The resource ID of the sku for the rack being added. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The resource ID of the sku for the rack being added.", + SerializedName = @"rackSkuId", + PossibleTypes = new [] { typeof(string) })] + string AggregatorOrSingleRackDefinitionRackSkuId { get; set; } + /// The list of storage appliance configuration data for this rack. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The list of storage appliance configuration data for this rack.", + SerializedName = @"storageApplianceConfigurationData", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceConfigurationData) })] + System.Collections.Generic.List AggregatorOrSingleRackDefinitionStorageApplianceConfigurationData { get; set; } + /// + /// The resource ID of the analytics workspace that is to be used by the specified identity. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The resource ID of the analytics workspace that is to be used by the specified identity.", + SerializedName = @"analyticsWorkspaceId", + PossibleTypes = new [] { typeof(string) })] + string AnalyticOutputSettingAnalyticsWorkspaceId { get; set; } + /// The type of managed identity that is being selected. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The type of managed identity that is being selected.", + SerializedName = @"identityType", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("SystemAssignedIdentity", "UserAssignedIdentity")] + string AnalyticsOutputSettingsAssociatedIdentityType { get; set; } + /// + /// The user assigned managed identity resource ID to use. Mutually exclusive with a system assigned identity type. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The user assigned managed identity resource ID to use. Mutually exclusive with a system assigned identity type.", + SerializedName = @"userAssignedIdentityResourceId", + PossibleTypes = new [] { typeof(string) })] + string AnalyticsOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId { get; set; } + /// + /// The customer-provided location information to identify where the cluster resides. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The customer-provided location information to identify where the cluster resides.", + SerializedName = @"clusterLocation", + PossibleTypes = new [] { typeof(string) })] + string ClusterLocation { get; set; } + /// The application ID, also known as client ID, of the service principal. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The application ID, also known as client ID, of the service principal.", + SerializedName = @"applicationId", + PossibleTypes = new [] { typeof(string) })] + string ClusterServicePrincipalApplicationId { get; set; } + /// The principal ID, also known as the object ID, of the service principal. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The principal ID, also known as the object ID, of the service principal.", + SerializedName = @"principalId", + PossibleTypes = new [] { typeof(string) })] + string ClusterServicePrincipalId { get; set; } + /// The password of the service principal. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The password of the service principal.", + SerializedName = @"password", + PossibleTypes = new [] { typeof(System.Security.SecureString) })] + System.Security.SecureString ClusterServicePrincipalPassword { get; set; } + /// + /// The tenant ID, also known as the directory ID, of the tenant in which the service principal is created. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The tenant ID, also known as the directory ID, of the tenant in which the service principal is created.", + SerializedName = @"tenantId", + PossibleTypes = new [] { typeof(string) })] + string ClusterServicePrincipalTenantId { get; set; } + /// + /// The URL of the storage account container that is to be used by the specified identities. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The URL of the storage account container that is to be used by the specified identities.", + SerializedName = @"containerUrl", + PossibleTypes = new [] { typeof(string) })] + string CommandOutputSettingContainerUrl { get; set; } + /// The type of managed identity that is being selected. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The type of managed identity that is being selected.", + SerializedName = @"identityType", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("SystemAssignedIdentity", "UserAssignedIdentity")] + string CommandOutputSettingsAssociatedIdentityType { get; set; } + /// + /// The user assigned managed identity resource ID to use. Mutually exclusive with a system assigned identity type. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The user assigned managed identity resource ID to use. Mutually exclusive with a system assigned identity type.", + SerializedName = @"userAssignedIdentityResourceId", + PossibleTypes = new [] { typeof(string) })] + string CommandOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId { get; set; } + /// Selection of how the type evaluation is applied to the cluster calculation. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"Selection of how the type evaluation is applied to the cluster calculation.", + SerializedName = @"grouping", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("PerCluster", "PerRack")] + string ComputeDeploymentThresholdGrouping { get; set; } + /// Selection of how the threshold should be evaluated. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"Selection of how the threshold should be evaluated.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("CountSuccess", "PercentSuccess")] + string ComputeDeploymentThresholdType { get; set; } + /// The numeric threshold value. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The numeric threshold value.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(long) })] + long? ComputeDeploymentThresholdValue { get; set; } + /// + /// The list of rack definitions for the compute racks in a multi-rack + /// cluster, or an empty list in a single-rack cluster. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The list of rack definitions for the compute racks in a multi-rack + cluster, or an empty list in a single-rack cluster.", + SerializedName = @"computeRackDefinitions", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackDefinition) })] + System.Collections.Generic.List ComputeRackDefinition { get; set; } + /// The mode of operation for runtime protection. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The mode of operation for runtime protection.", + SerializedName = @"enforcementLevel", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Audit", "Disabled", "OnDemand", "Passive", "RealTime")] + string RuntimeProtectionConfigurationEnforcementLevel { get; set; } + /// The resource ID of the key vault to archive the secrets of the cluster. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The resource ID of the key vault to archive the secrets of the cluster.", + SerializedName = @"keyVaultId", + PossibleTypes = new [] { typeof(string) })] + string SecretArchiveKeyVaultId { get; set; } + /// The URI for the key vault used as the secret archive. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The URI for the key vault used as the secret archive.", + SerializedName = @"vaultUri", + PossibleTypes = new [] { typeof(string) })] + string SecretArchiveSettingVaultUri { get; set; } + /// The type of managed identity that is being selected. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The type of managed identity that is being selected.", + SerializedName = @"identityType", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("SystemAssignedIdentity", "UserAssignedIdentity")] + string SecretArchiveSettingsAssociatedIdentityType { get; set; } + /// + /// The user assigned managed identity resource ID to use. Mutually exclusive with a system assigned identity type. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The user assigned managed identity resource ID to use. Mutually exclusive with a system assigned identity type.", + SerializedName = @"userAssignedIdentityResourceId", + PossibleTypes = new [] { typeof(string) })] + string SecretArchiveSettingsAssociatedIdentityUserAssignedIdentityResourceId { get; set; } + /// + /// The indicator if the specified key vault should be used to archive the secrets of the cluster. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The indicator if the specified key vault should be used to archive the secrets of the cluster.", + SerializedName = @"useKeyVault", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("True", "False")] + string SecretArchiveUseKeyVault { get; set; } + /// + /// The maximum number of worker nodes that can be offline within the increment of update, e.g., rack-by-rack. + /// Limited by the maximum number of machines in the increment. Defaults to the whole increment size. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The maximum number of worker nodes that can be offline within the increment of update, e.g., rack-by-rack. + Limited by the maximum number of machines in the increment. Defaults to the whole increment size.", + SerializedName = @"maxUnavailable", + PossibleTypes = new [] { typeof(long) })] + long? UpdateStrategyMaxUnavailable { get; set; } + /// Selection of how the threshold should be evaluated. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"Selection of how the threshold should be evaluated.", + SerializedName = @"thresholdType", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("CountSuccess", "PercentSuccess")] + string UpdateStrategyThresholdType { get; set; } + /// The numeric threshold value. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The numeric threshold value.", + SerializedName = @"thresholdValue", + PossibleTypes = new [] { typeof(long) })] + long? UpdateStrategyThresholdValue { get; set; } + /// The mode of operation for runtime protection. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The mode of operation for runtime protection.", + SerializedName = @"strategyType", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Rack", "PauseAfterRack")] + string UpdateStrategyType { get; set; } + /// The time to wait between the increments of update defined by the strategy. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The time to wait between the increments of update defined by the strategy.", + SerializedName = @"waitTimeMinutes", + PossibleTypes = new [] { typeof(long) })] + long? UpdateStrategyWaitTimeMinute { get; set; } + /// The mode selection for container vulnerability scanning. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The mode selection for container vulnerability scanning.", + SerializedName = @"containerScan", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Disabled", "Enabled")] + string VulnerabilityScanningSettingContainerScan { get; set; } + + } + /// ClusterPatchProperties represents the properties of the cluster for patching. + internal partial interface IClusterPatchPropertiesInternal + + { + /// + /// The rack definition that is intended to reflect only a single rack in a single rack cluster, or an aggregator rack in + /// a multi-rack cluster. + /// + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackDefinition AggregatorOrSingleRackDefinition { get; set; } + /// + /// The zone name used for this rack when created. Availability zones are used for workload placement. + /// + string AggregatorOrSingleRackDefinitionAvailabilityZone { get; set; } + /// The unordered list of bare metal machine configuration. + System.Collections.Generic.List AggregatorOrSingleRackDefinitionBareMetalMachineConfigurationData { get; set; } + /// The resource ID of the network rack that matches this rack definition. + string AggregatorOrSingleRackDefinitionNetworkRackId { get; set; } + /// The free-form description of the rack's location. + string AggregatorOrSingleRackDefinitionRackLocation { get; set; } + /// + /// The unique identifier for the rack within Network Cloud cluster. An alternate unique alphanumeric value other than a serial + /// number may be provided if desired. + /// + string AggregatorOrSingleRackDefinitionRackSerialNumber { get; set; } + /// The resource ID of the sku for the rack being added. + string AggregatorOrSingleRackDefinitionRackSkuId { get; set; } + /// The list of storage appliance configuration data for this rack. + System.Collections.Generic.List AggregatorOrSingleRackDefinitionStorageApplianceConfigurationData { get; set; } + /// + /// The resource ID of the analytics workspace that is to be used by the specified identity. + /// + string AnalyticOutputSettingAnalyticsWorkspaceId { get; set; } + /// + /// The selection of the managed identity to use with this analytics workspace. The identity type must be either system assigned + /// or user assigned. + /// + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IIdentitySelector AnalyticOutputSettingAssociatedIdentity { get; set; } + /// + /// The settings for the log analytics workspace used for output of logs from this cluster. + /// + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAnalyticsOutputSettings AnalyticsOutputSetting { get; set; } + /// The type of managed identity that is being selected. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("SystemAssignedIdentity", "UserAssignedIdentity")] + string AnalyticsOutputSettingsAssociatedIdentityType { get; set; } + /// + /// The user assigned managed identity resource ID to use. Mutually exclusive with a system assigned identity type. + /// + string AnalyticsOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId { get; set; } + /// + /// The customer-provided location information to identify where the cluster resides. + /// + string ClusterLocation { get; set; } + /// + /// The service principal to be used by the cluster during Arc Appliance installation. + /// + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IServicePrincipalInformation ClusterServicePrincipal { get; set; } + /// The application ID, also known as client ID, of the service principal. + string ClusterServicePrincipalApplicationId { get; set; } + /// The principal ID, also known as the object ID, of the service principal. + string ClusterServicePrincipalId { get; set; } + /// The password of the service principal. + System.Security.SecureString ClusterServicePrincipalPassword { get; set; } + /// + /// The tenant ID, also known as the directory ID, of the tenant in which the service principal is created. + /// + string ClusterServicePrincipalTenantId { get; set; } + /// + /// The settings for commands run in this cluster, such as bare metal machine run read only commands and data extracts. + /// + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICommandOutputSettings CommandOutputSetting { get; set; } + /// + /// The selection of the managed identity to use with this storage account container. The identity type must be either system + /// assigned or user assigned. + /// + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IIdentitySelector CommandOutputSettingAssociatedIdentity { get; set; } + /// + /// The URL of the storage account container that is to be used by the specified identities. + /// + string CommandOutputSettingContainerUrl { get; set; } + /// The type of managed identity that is being selected. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("SystemAssignedIdentity", "UserAssignedIdentity")] + string CommandOutputSettingsAssociatedIdentityType { get; set; } + /// + /// The user assigned managed identity resource ID to use. Mutually exclusive with a system assigned identity type. + /// + string CommandOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId { get; set; } + /// + /// The validation threshold indicating the allowable failures of compute machines during environment validation and deployment. + /// + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IValidationThreshold ComputeDeploymentThreshold { get; set; } + /// Selection of how the type evaluation is applied to the cluster calculation. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("PerCluster", "PerRack")] + string ComputeDeploymentThresholdGrouping { get; set; } + /// Selection of how the threshold should be evaluated. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("CountSuccess", "PercentSuccess")] + string ComputeDeploymentThresholdType { get; set; } + /// The numeric threshold value. + long? ComputeDeploymentThresholdValue { get; set; } + /// + /// The list of rack definitions for the compute racks in a multi-rack + /// cluster, or an empty list in a single-rack cluster. + /// + System.Collections.Generic.List ComputeRackDefinition { get; set; } + /// The settings for cluster runtime protection. + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRuntimeProtectionConfiguration RuntimeProtectionConfiguration { get; set; } + /// The mode of operation for runtime protection. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Audit", "Disabled", "OnDemand", "Passive", "RealTime")] + string RuntimeProtectionConfigurationEnforcementLevel { get; set; } + /// + /// The configuration for use of a key vault to store secrets for later retrieval by the operator. + /// + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterSecretArchive SecretArchive { get; set; } + /// The resource ID of the key vault to archive the secrets of the cluster. + string SecretArchiveKeyVaultId { get; set; } + /// The settings for the secret archive used to hold credentials for the cluster. + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISecretArchiveSettings SecretArchiveSetting { get; set; } + /// + /// The selection of the managed identity to use with this vault URI. The identity type must be either system assigned or + /// user assigned. + /// + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IIdentitySelector SecretArchiveSettingAssociatedIdentity { get; set; } + /// The URI for the key vault used as the secret archive. + string SecretArchiveSettingVaultUri { get; set; } + /// The type of managed identity that is being selected. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("SystemAssignedIdentity", "UserAssignedIdentity")] + string SecretArchiveSettingsAssociatedIdentityType { get; set; } + /// + /// The user assigned managed identity resource ID to use. Mutually exclusive with a system assigned identity type. + /// + string SecretArchiveSettingsAssociatedIdentityUserAssignedIdentityResourceId { get; set; } + /// + /// The indicator if the specified key vault should be used to archive the secrets of the cluster. + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("True", "False")] + string SecretArchiveUseKeyVault { get; set; } + /// The strategy for updating the cluster. + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterUpdateStrategy UpdateStrategy { get; set; } + /// + /// The maximum number of worker nodes that can be offline within the increment of update, e.g., rack-by-rack. + /// Limited by the maximum number of machines in the increment. Defaults to the whole increment size. + /// + long? UpdateStrategyMaxUnavailable { get; set; } + /// Selection of how the threshold should be evaluated. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("CountSuccess", "PercentSuccess")] + string UpdateStrategyThresholdType { get; set; } + /// The numeric threshold value. + long? UpdateStrategyThresholdValue { get; set; } + /// The mode of operation for runtime protection. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Rack", "PauseAfterRack")] + string UpdateStrategyType { get; set; } + /// The time to wait between the increments of update defined by the strategy. + long? UpdateStrategyWaitTimeMinute { get; set; } + /// The settings for how security vulnerability scanning is applied to the cluster. + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVulnerabilityScanningSettingsPatch VulnerabilityScanningSetting { get; set; } + /// The mode selection for container vulnerability scanning. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Disabled", "Enabled")] + string VulnerabilityScanningSettingContainerScan { get; set; } + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterPatchProperties.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterPatchProperties.json.cs similarity index 85% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterPatchProperties.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterPatchProperties.json.cs index 983a5375407e..089c031414d4 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterPatchProperties.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterPatchProperties.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -65,29 +65,29 @@ internal ClusterPatchProperties(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud. { return; } - {_aggregatorOrSingleRackDefinition = If( json?.PropertyT("aggregatorOrSingleRackDefinition"), out var __jsonAggregatorOrSingleRackDefinition) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.RackDefinition.FromJson(__jsonAggregatorOrSingleRackDefinition) : AggregatorOrSingleRackDefinition;} - {_analyticsOutputSetting = If( json?.PropertyT("analyticsOutputSettings"), out var __jsonAnalyticsOutputSettings) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AnalyticsOutputSettings.FromJson(__jsonAnalyticsOutputSettings) : AnalyticsOutputSetting;} - {_clusterServicePrincipal = If( json?.PropertyT("clusterServicePrincipal"), out var __jsonClusterServicePrincipal) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ServicePrincipalInformation.FromJson(__jsonClusterServicePrincipal) : ClusterServicePrincipal;} - {_commandOutputSetting = If( json?.PropertyT("commandOutputSettings"), out var __jsonCommandOutputSettings) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.CommandOutputSettings.FromJson(__jsonCommandOutputSettings) : CommandOutputSetting;} - {_computeDeploymentThreshold = If( json?.PropertyT("computeDeploymentThreshold"), out var __jsonComputeDeploymentThreshold) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ValidationThreshold.FromJson(__jsonComputeDeploymentThreshold) : ComputeDeploymentThreshold;} - {_runtimeProtectionConfiguration = If( json?.PropertyT("runtimeProtectionConfiguration"), out var __jsonRuntimeProtectionConfiguration) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.RuntimeProtectionConfiguration.FromJson(__jsonRuntimeProtectionConfiguration) : RuntimeProtectionConfiguration;} - {_secretArchive = If( json?.PropertyT("secretArchive"), out var __jsonSecretArchive) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ClusterSecretArchive.FromJson(__jsonSecretArchive) : SecretArchive;} - {_secretArchiveSetting = If( json?.PropertyT("secretArchiveSettings"), out var __jsonSecretArchiveSettings) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.SecretArchiveSettings.FromJson(__jsonSecretArchiveSettings) : SecretArchiveSetting;} - {_updateStrategy = If( json?.PropertyT("updateStrategy"), out var __jsonUpdateStrategy) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ClusterUpdateStrategy.FromJson(__jsonUpdateStrategy) : UpdateStrategy;} - {_vulnerabilityScanningSetting = If( json?.PropertyT("vulnerabilityScanningSettings"), out var __jsonVulnerabilityScanningSettings) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.VulnerabilityScanningSettingsPatch.FromJson(__jsonVulnerabilityScanningSettings) : VulnerabilityScanningSetting;} - {_clusterLocation = If( json?.PropertyT("clusterLocation"), out var __jsonClusterLocation) ? (string)__jsonClusterLocation : (string)ClusterLocation;} - {_computeRackDefinition = If( json?.PropertyT("computeRackDefinitions"), out var __jsonComputeRackDefinitions) ? If( __jsonComputeRackDefinitions as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IRackDefinition) (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.RackDefinition.FromJson(__u) )) ))() : null : ComputeRackDefinition;} + {_aggregatorOrSingleRackDefinition = If( json?.PropertyT("aggregatorOrSingleRackDefinition"), out var __jsonAggregatorOrSingleRackDefinition) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.RackDefinition.FromJson(__jsonAggregatorOrSingleRackDefinition) : _aggregatorOrSingleRackDefinition;} + {_analyticsOutputSetting = If( json?.PropertyT("analyticsOutputSettings"), out var __jsonAnalyticsOutputSettings) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AnalyticsOutputSettings.FromJson(__jsonAnalyticsOutputSettings) : _analyticsOutputSetting;} + {_clusterServicePrincipal = If( json?.PropertyT("clusterServicePrincipal"), out var __jsonClusterServicePrincipal) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ServicePrincipalInformation.FromJson(__jsonClusterServicePrincipal) : _clusterServicePrincipal;} + {_commandOutputSetting = If( json?.PropertyT("commandOutputSettings"), out var __jsonCommandOutputSettings) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.CommandOutputSettings.FromJson(__jsonCommandOutputSettings) : _commandOutputSetting;} + {_computeDeploymentThreshold = If( json?.PropertyT("computeDeploymentThreshold"), out var __jsonComputeDeploymentThreshold) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ValidationThreshold.FromJson(__jsonComputeDeploymentThreshold) : _computeDeploymentThreshold;} + {_runtimeProtectionConfiguration = If( json?.PropertyT("runtimeProtectionConfiguration"), out var __jsonRuntimeProtectionConfiguration) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.RuntimeProtectionConfiguration.FromJson(__jsonRuntimeProtectionConfiguration) : _runtimeProtectionConfiguration;} + {_secretArchive = If( json?.PropertyT("secretArchive"), out var __jsonSecretArchive) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterSecretArchive.FromJson(__jsonSecretArchive) : _secretArchive;} + {_secretArchiveSetting = If( json?.PropertyT("secretArchiveSettings"), out var __jsonSecretArchiveSettings) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.SecretArchiveSettings.FromJson(__jsonSecretArchiveSettings) : _secretArchiveSetting;} + {_updateStrategy = If( json?.PropertyT("updateStrategy"), out var __jsonUpdateStrategy) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterUpdateStrategy.FromJson(__jsonUpdateStrategy) : _updateStrategy;} + {_vulnerabilityScanningSetting = If( json?.PropertyT("vulnerabilityScanningSettings"), out var __jsonVulnerabilityScanningSettings) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.VulnerabilityScanningSettingsPatch.FromJson(__jsonVulnerabilityScanningSettings) : _vulnerabilityScanningSetting;} + {_clusterLocation = If( json?.PropertyT("clusterLocation"), out var __jsonClusterLocation) ? (string)__jsonClusterLocation : (string)_clusterLocation;} + {_computeRackDefinition = If( json?.PropertyT("computeRackDefinitions"), out var __jsonComputeRackDefinitions) ? If( __jsonComputeRackDefinitions as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.IRackDefinition) (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.RackDefinition.FromJson(__u) )) ))() : null : _computeRackDefinition;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new ClusterPatchProperties(json) : null; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterProperties.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterProperties.PowerShell.cs new file mode 100644 index 000000000000..fce95703f572 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterProperties.PowerShell.cs @@ -0,0 +1,788 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + + /// ClusterProperties represents the properties of a cluster. + [System.ComponentModel.TypeConverter(typeof(ClusterPropertiesTypeConverter))] + public partial class ClusterProperties + { + + /// + /// 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 ClusterProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("AggregatorOrSingleRackDefinition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).AggregatorOrSingleRackDefinition = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackDefinition) content.GetValueForProperty("AggregatorOrSingleRackDefinition",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).AggregatorOrSingleRackDefinition, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.RackDefinitionTypeConverter.ConvertFrom); + } + if (content.Contains("AnalyticsOutputSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).AnalyticsOutputSetting = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAnalyticsOutputSettings) content.GetValueForProperty("AnalyticsOutputSetting",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).AnalyticsOutputSetting, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AnalyticsOutputSettingsTypeConverter.ConvertFrom); + } + if (content.Contains("ClusterCapacity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).ClusterCapacity = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterCapacity) content.GetValueForProperty("ClusterCapacity",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).ClusterCapacity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterCapacityTypeConverter.ConvertFrom); + } + if (content.Contains("ClusterExtendedLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).ClusterExtendedLocation = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocation) content.GetValueForProperty("ClusterExtendedLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).ClusterExtendedLocation, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ExtendedLocationTypeConverter.ConvertFrom); + } + if (content.Contains("ClusterServicePrincipal")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).ClusterServicePrincipal = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IServicePrincipalInformation) content.GetValueForProperty("ClusterServicePrincipal",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).ClusterServicePrincipal, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ServicePrincipalInformationTypeConverter.ConvertFrom); + } + if (content.Contains("CommandOutputSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).CommandOutputSetting = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICommandOutputSettings) content.GetValueForProperty("CommandOutputSetting",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).CommandOutputSetting, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.CommandOutputSettingsTypeConverter.ConvertFrom); + } + if (content.Contains("ComputeDeploymentThreshold")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).ComputeDeploymentThreshold = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IValidationThreshold) content.GetValueForProperty("ComputeDeploymentThreshold",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).ComputeDeploymentThreshold, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ValidationThresholdTypeConverter.ConvertFrom); + } + if (content.Contains("HybridAksExtendedLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).HybridAksExtendedLocation = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocation) content.GetValueForProperty("HybridAksExtendedLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).HybridAksExtendedLocation, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ExtendedLocationTypeConverter.ConvertFrom); + } + if (content.Contains("ManagedResourceGroupConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).ManagedResourceGroupConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IManagedResourceGroupConfiguration) content.GetValueForProperty("ManagedResourceGroupConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).ManagedResourceGroupConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ManagedResourceGroupConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("RuntimeProtectionConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).RuntimeProtectionConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRuntimeProtectionConfiguration) content.GetValueForProperty("RuntimeProtectionConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).RuntimeProtectionConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.RuntimeProtectionConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("SecretArchive")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).SecretArchive = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterSecretArchive) content.GetValueForProperty("SecretArchive",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).SecretArchive, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterSecretArchiveTypeConverter.ConvertFrom); + } + if (content.Contains("SecretArchiveSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).SecretArchiveSetting = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISecretArchiveSettings) content.GetValueForProperty("SecretArchiveSetting",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).SecretArchiveSetting, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.SecretArchiveSettingsTypeConverter.ConvertFrom); + } + if (content.Contains("UpdateStrategy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).UpdateStrategy = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterUpdateStrategy) content.GetValueForProperty("UpdateStrategy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).UpdateStrategy, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterUpdateStrategyTypeConverter.ConvertFrom); + } + if (content.Contains("VulnerabilityScanningSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).VulnerabilityScanningSetting = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVulnerabilityScanningSettings) content.GetValueForProperty("VulnerabilityScanningSetting",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).VulnerabilityScanningSetting, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.VulnerabilityScanningSettingsTypeConverter.ConvertFrom); + } + if (content.Contains("AnalyticsWorkspaceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).AnalyticsWorkspaceId = (string) content.GetValueForProperty("AnalyticsWorkspaceId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).AnalyticsWorkspaceId, global::System.Convert.ToString); + } + if (content.Contains("AvailableUpgradeVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).AvailableUpgradeVersion = (System.Collections.Generic.List) content.GetValueForProperty("AvailableUpgradeVersion",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).AvailableUpgradeVersion, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterAvailableUpgradeVersionTypeConverter.ConvertFrom)); + } + if (content.Contains("ClusterConnectionStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).ClusterConnectionStatus = (string) content.GetValueForProperty("ClusterConnectionStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).ClusterConnectionStatus, global::System.Convert.ToString); + } + if (content.Contains("ClusterLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).ClusterLocation = (string) content.GetValueForProperty("ClusterLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).ClusterLocation, global::System.Convert.ToString); + } + if (content.Contains("ClusterManagerConnectionStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).ClusterManagerConnectionStatus = (string) content.GetValueForProperty("ClusterManagerConnectionStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).ClusterManagerConnectionStatus, global::System.Convert.ToString); + } + if (content.Contains("ClusterManagerId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).ClusterManagerId = (string) content.GetValueForProperty("ClusterManagerId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).ClusterManagerId, global::System.Convert.ToString); + } + if (content.Contains("ClusterType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).ClusterType = (string) content.GetValueForProperty("ClusterType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).ClusterType, global::System.Convert.ToString); + } + if (content.Contains("ClusterVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).ClusterVersion = (string) content.GetValueForProperty("ClusterVersion",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).ClusterVersion, global::System.Convert.ToString); + } + if (content.Contains("ComputeRackDefinition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).ComputeRackDefinition = (System.Collections.Generic.List) content.GetValueForProperty("ComputeRackDefinition",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).ComputeRackDefinition, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.RackDefinitionTypeConverter.ConvertFrom)); + } + if (content.Contains("DetailedStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).DetailedStatus = (string) content.GetValueForProperty("DetailedStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).DetailedStatus, global::System.Convert.ToString); + } + if (content.Contains("DetailedStatusMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).DetailedStatusMessage = (string) content.GetValueForProperty("DetailedStatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).DetailedStatusMessage, global::System.Convert.ToString); + } + if (content.Contains("ManualActionCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).ManualActionCount = (long?) content.GetValueForProperty("ManualActionCount",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).ManualActionCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("NetworkFabricId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).NetworkFabricId = (string) content.GetValueForProperty("NetworkFabricId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).NetworkFabricId, global::System.Convert.ToString); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("SupportExpiryDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).SupportExpiryDate = (string) content.GetValueForProperty("SupportExpiryDate",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).SupportExpiryDate, global::System.Convert.ToString); + } + if (content.Contains("WorkloadResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).WorkloadResourceId = (System.Collections.Generic.List) content.GetValueForProperty("WorkloadResourceId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).WorkloadResourceId, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("CommandOutputSettingContainerUrl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).CommandOutputSettingContainerUrl = (string) content.GetValueForProperty("CommandOutputSettingContainerUrl",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).CommandOutputSettingContainerUrl, global::System.Convert.ToString); + } + if (content.Contains("ManagedResourceGroupConfigurationLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).ManagedResourceGroupConfigurationLocation = (string) content.GetValueForProperty("ManagedResourceGroupConfigurationLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).ManagedResourceGroupConfigurationLocation, global::System.Convert.ToString); + } + if (content.Contains("ManagedResourceGroupConfigurationName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).ManagedResourceGroupConfigurationName = (string) content.GetValueForProperty("ManagedResourceGroupConfigurationName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).ManagedResourceGroupConfigurationName, global::System.Convert.ToString); + } + if (content.Contains("SecretArchiveSettingVaultUri")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).SecretArchiveSettingVaultUri = (string) content.GetValueForProperty("SecretArchiveSettingVaultUri",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).SecretArchiveSettingVaultUri, global::System.Convert.ToString); + } + if (content.Contains("VulnerabilityScanningSettingContainerScan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).VulnerabilityScanningSettingContainerScan = (string) content.GetValueForProperty("VulnerabilityScanningSettingContainerScan",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).VulnerabilityScanningSettingContainerScan, global::System.Convert.ToString); + } + if (content.Contains("AggregatorOrSingleRackDefinitionAvailabilityZone")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).AggregatorOrSingleRackDefinitionAvailabilityZone = (string) content.GetValueForProperty("AggregatorOrSingleRackDefinitionAvailabilityZone",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).AggregatorOrSingleRackDefinitionAvailabilityZone, global::System.Convert.ToString); + } + if (content.Contains("AggregatorOrSingleRackDefinitionBareMetalMachineConfigurationData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).AggregatorOrSingleRackDefinitionBareMetalMachineConfigurationData = (System.Collections.Generic.List) content.GetValueForProperty("AggregatorOrSingleRackDefinitionBareMetalMachineConfigurationData",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).AggregatorOrSingleRackDefinitionBareMetalMachineConfigurationData, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BareMetalMachineConfigurationDataTypeConverter.ConvertFrom)); + } + if (content.Contains("AggregatorOrSingleRackDefinitionNetworkRackId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).AggregatorOrSingleRackDefinitionNetworkRackId = (string) content.GetValueForProperty("AggregatorOrSingleRackDefinitionNetworkRackId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).AggregatorOrSingleRackDefinitionNetworkRackId, global::System.Convert.ToString); + } + if (content.Contains("AggregatorOrSingleRackDefinitionRackLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).AggregatorOrSingleRackDefinitionRackLocation = (string) content.GetValueForProperty("AggregatorOrSingleRackDefinitionRackLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).AggregatorOrSingleRackDefinitionRackLocation, global::System.Convert.ToString); + } + if (content.Contains("AggregatorOrSingleRackDefinitionRackSerialNumber")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).AggregatorOrSingleRackDefinitionRackSerialNumber = (string) content.GetValueForProperty("AggregatorOrSingleRackDefinitionRackSerialNumber",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).AggregatorOrSingleRackDefinitionRackSerialNumber, global::System.Convert.ToString); + } + if (content.Contains("AggregatorOrSingleRackDefinitionRackSkuId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).AggregatorOrSingleRackDefinitionRackSkuId = (string) content.GetValueForProperty("AggregatorOrSingleRackDefinitionRackSkuId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).AggregatorOrSingleRackDefinitionRackSkuId, global::System.Convert.ToString); + } + if (content.Contains("AggregatorOrSingleRackDefinitionStorageApplianceConfigurationData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).AggregatorOrSingleRackDefinitionStorageApplianceConfigurationData = (System.Collections.Generic.List) content.GetValueForProperty("AggregatorOrSingleRackDefinitionStorageApplianceConfigurationData",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).AggregatorOrSingleRackDefinitionStorageApplianceConfigurationData, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.StorageApplianceConfigurationDataTypeConverter.ConvertFrom)); + } + if (content.Contains("AnalyticOutputSettingAssociatedIdentity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).AnalyticOutputSettingAssociatedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IIdentitySelector) content.GetValueForProperty("AnalyticOutputSettingAssociatedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).AnalyticOutputSettingAssociatedIdentity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IdentitySelectorTypeConverter.ConvertFrom); + } + if (content.Contains("AnalyticOutputSettingAnalyticsWorkspaceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).AnalyticOutputSettingAnalyticsWorkspaceId = (string) content.GetValueForProperty("AnalyticOutputSettingAnalyticsWorkspaceId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).AnalyticOutputSettingAnalyticsWorkspaceId, global::System.Convert.ToString); + } + if (content.Contains("ClusterCapacityAvailableApplianceStorageGb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).ClusterCapacityAvailableApplianceStorageGb = (long?) content.GetValueForProperty("ClusterCapacityAvailableApplianceStorageGb",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).ClusterCapacityAvailableApplianceStorageGb, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("ClusterCapacityAvailableCoreCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).ClusterCapacityAvailableCoreCount = (long?) content.GetValueForProperty("ClusterCapacityAvailableCoreCount",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).ClusterCapacityAvailableCoreCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("ClusterCapacityAvailableHostStorageGb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).ClusterCapacityAvailableHostStorageGb = (long?) content.GetValueForProperty("ClusterCapacityAvailableHostStorageGb",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).ClusterCapacityAvailableHostStorageGb, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("ClusterCapacityAvailableMemoryGb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).ClusterCapacityAvailableMemoryGb = (long?) content.GetValueForProperty("ClusterCapacityAvailableMemoryGb",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).ClusterCapacityAvailableMemoryGb, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("ClusterCapacityTotalApplianceStorageGb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).ClusterCapacityTotalApplianceStorageGb = (long?) content.GetValueForProperty("ClusterCapacityTotalApplianceStorageGb",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).ClusterCapacityTotalApplianceStorageGb, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("ClusterCapacityTotalCoreCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).ClusterCapacityTotalCoreCount = (long?) content.GetValueForProperty("ClusterCapacityTotalCoreCount",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).ClusterCapacityTotalCoreCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("ClusterCapacityTotalHostStorageGb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).ClusterCapacityTotalHostStorageGb = (long?) content.GetValueForProperty("ClusterCapacityTotalHostStorageGb",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).ClusterCapacityTotalHostStorageGb, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("ClusterCapacityTotalMemoryGb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).ClusterCapacityTotalMemoryGb = (long?) content.GetValueForProperty("ClusterCapacityTotalMemoryGb",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).ClusterCapacityTotalMemoryGb, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("ClusterExtendedLocationName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).ClusterExtendedLocationName = (string) content.GetValueForProperty("ClusterExtendedLocationName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).ClusterExtendedLocationName, global::System.Convert.ToString); + } + if (content.Contains("ClusterExtendedLocationType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).ClusterExtendedLocationType = (string) content.GetValueForProperty("ClusterExtendedLocationType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).ClusterExtendedLocationType, global::System.Convert.ToString); + } + if (content.Contains("ClusterServicePrincipalApplicationId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).ClusterServicePrincipalApplicationId = (string) content.GetValueForProperty("ClusterServicePrincipalApplicationId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).ClusterServicePrincipalApplicationId, global::System.Convert.ToString); + } + if (content.Contains("ClusterServicePrincipalPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).ClusterServicePrincipalPassword = (System.Security.SecureString) content.GetValueForProperty("ClusterServicePrincipalPassword",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).ClusterServicePrincipalPassword, (object ss) => (System.Security.SecureString)ss); + } + if (content.Contains("ClusterServicePrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).ClusterServicePrincipalId = (string) content.GetValueForProperty("ClusterServicePrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).ClusterServicePrincipalId, global::System.Convert.ToString); + } + if (content.Contains("ClusterServicePrincipalTenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).ClusterServicePrincipalTenantId = (string) content.GetValueForProperty("ClusterServicePrincipalTenantId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).ClusterServicePrincipalTenantId, global::System.Convert.ToString); + } + if (content.Contains("CommandOutputSettingAssociatedIdentity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).CommandOutputSettingAssociatedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IIdentitySelector) content.GetValueForProperty("CommandOutputSettingAssociatedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).CommandOutputSettingAssociatedIdentity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IdentitySelectorTypeConverter.ConvertFrom); + } + if (content.Contains("ComputeDeploymentThresholdGrouping")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).ComputeDeploymentThresholdGrouping = (string) content.GetValueForProperty("ComputeDeploymentThresholdGrouping",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).ComputeDeploymentThresholdGrouping, global::System.Convert.ToString); + } + if (content.Contains("ComputeDeploymentThresholdType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).ComputeDeploymentThresholdType = (string) content.GetValueForProperty("ComputeDeploymentThresholdType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).ComputeDeploymentThresholdType, global::System.Convert.ToString); + } + if (content.Contains("ComputeDeploymentThresholdValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).ComputeDeploymentThresholdValue = (long?) content.GetValueForProperty("ComputeDeploymentThresholdValue",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).ComputeDeploymentThresholdValue, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("HybridAkExtendedLocationName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).HybridAkExtendedLocationName = (string) content.GetValueForProperty("HybridAkExtendedLocationName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).HybridAkExtendedLocationName, global::System.Convert.ToString); + } + if (content.Contains("HybridAkExtendedLocationType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).HybridAkExtendedLocationType = (string) content.GetValueForProperty("HybridAkExtendedLocationType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).HybridAkExtendedLocationType, global::System.Convert.ToString); + } + if (content.Contains("RuntimeProtectionConfigurationEnforcementLevel")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).RuntimeProtectionConfigurationEnforcementLevel = (string) content.GetValueForProperty("RuntimeProtectionConfigurationEnforcementLevel",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).RuntimeProtectionConfigurationEnforcementLevel, global::System.Convert.ToString); + } + if (content.Contains("SecretArchiveKeyVaultId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).SecretArchiveKeyVaultId = (string) content.GetValueForProperty("SecretArchiveKeyVaultId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).SecretArchiveKeyVaultId, global::System.Convert.ToString); + } + if (content.Contains("SecretArchiveUseKeyVault")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).SecretArchiveUseKeyVault = (string) content.GetValueForProperty("SecretArchiveUseKeyVault",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).SecretArchiveUseKeyVault, global::System.Convert.ToString); + } + if (content.Contains("SecretArchiveSettingAssociatedIdentity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).SecretArchiveSettingAssociatedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IIdentitySelector) content.GetValueForProperty("SecretArchiveSettingAssociatedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).SecretArchiveSettingAssociatedIdentity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IdentitySelectorTypeConverter.ConvertFrom); + } + if (content.Contains("UpdateStrategyMaxUnavailable")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).UpdateStrategyMaxUnavailable = (long?) content.GetValueForProperty("UpdateStrategyMaxUnavailable",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).UpdateStrategyMaxUnavailable, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("UpdateStrategyType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).UpdateStrategyType = (string) content.GetValueForProperty("UpdateStrategyType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).UpdateStrategyType, global::System.Convert.ToString); + } + if (content.Contains("UpdateStrategyThresholdType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).UpdateStrategyThresholdType = (string) content.GetValueForProperty("UpdateStrategyThresholdType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).UpdateStrategyThresholdType, global::System.Convert.ToString); + } + if (content.Contains("UpdateStrategyThresholdValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).UpdateStrategyThresholdValue = (long?) content.GetValueForProperty("UpdateStrategyThresholdValue",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).UpdateStrategyThresholdValue, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("UpdateStrategyWaitTimeMinute")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).UpdateStrategyWaitTimeMinute = (long?) content.GetValueForProperty("UpdateStrategyWaitTimeMinute",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).UpdateStrategyWaitTimeMinute, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("AnalyticsOutputSettingsAssociatedIdentityType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).AnalyticsOutputSettingsAssociatedIdentityType = (string) content.GetValueForProperty("AnalyticsOutputSettingsAssociatedIdentityType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).AnalyticsOutputSettingsAssociatedIdentityType, global::System.Convert.ToString); + } + if (content.Contains("AnalyticsOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).AnalyticsOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId = (string) content.GetValueForProperty("AnalyticsOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).AnalyticsOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId, global::System.Convert.ToString); + } + if (content.Contains("CommandOutputSettingsAssociatedIdentityType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).CommandOutputSettingsAssociatedIdentityType = (string) content.GetValueForProperty("CommandOutputSettingsAssociatedIdentityType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).CommandOutputSettingsAssociatedIdentityType, global::System.Convert.ToString); + } + if (content.Contains("CommandOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).CommandOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId = (string) content.GetValueForProperty("CommandOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).CommandOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId, global::System.Convert.ToString); + } + if (content.Contains("SecretArchiveSettingsAssociatedIdentityType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).SecretArchiveSettingsAssociatedIdentityType = (string) content.GetValueForProperty("SecretArchiveSettingsAssociatedIdentityType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).SecretArchiveSettingsAssociatedIdentityType, global::System.Convert.ToString); + } + if (content.Contains("SecretArchiveSettingsAssociatedIdentityUserAssignedIdentityResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).SecretArchiveSettingsAssociatedIdentityUserAssignedIdentityResourceId = (string) content.GetValueForProperty("SecretArchiveSettingsAssociatedIdentityUserAssignedIdentityResourceId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).SecretArchiveSettingsAssociatedIdentityUserAssignedIdentityResourceId, 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 ClusterProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("AggregatorOrSingleRackDefinition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).AggregatorOrSingleRackDefinition = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackDefinition) content.GetValueForProperty("AggregatorOrSingleRackDefinition",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).AggregatorOrSingleRackDefinition, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.RackDefinitionTypeConverter.ConvertFrom); + } + if (content.Contains("AnalyticsOutputSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).AnalyticsOutputSetting = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAnalyticsOutputSettings) content.GetValueForProperty("AnalyticsOutputSetting",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).AnalyticsOutputSetting, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AnalyticsOutputSettingsTypeConverter.ConvertFrom); + } + if (content.Contains("ClusterCapacity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).ClusterCapacity = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterCapacity) content.GetValueForProperty("ClusterCapacity",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).ClusterCapacity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterCapacityTypeConverter.ConvertFrom); + } + if (content.Contains("ClusterExtendedLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).ClusterExtendedLocation = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocation) content.GetValueForProperty("ClusterExtendedLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).ClusterExtendedLocation, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ExtendedLocationTypeConverter.ConvertFrom); + } + if (content.Contains("ClusterServicePrincipal")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).ClusterServicePrincipal = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IServicePrincipalInformation) content.GetValueForProperty("ClusterServicePrincipal",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).ClusterServicePrincipal, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ServicePrincipalInformationTypeConverter.ConvertFrom); + } + if (content.Contains("CommandOutputSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).CommandOutputSetting = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICommandOutputSettings) content.GetValueForProperty("CommandOutputSetting",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).CommandOutputSetting, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.CommandOutputSettingsTypeConverter.ConvertFrom); + } + if (content.Contains("ComputeDeploymentThreshold")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).ComputeDeploymentThreshold = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IValidationThreshold) content.GetValueForProperty("ComputeDeploymentThreshold",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).ComputeDeploymentThreshold, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ValidationThresholdTypeConverter.ConvertFrom); + } + if (content.Contains("HybridAksExtendedLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).HybridAksExtendedLocation = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocation) content.GetValueForProperty("HybridAksExtendedLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).HybridAksExtendedLocation, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ExtendedLocationTypeConverter.ConvertFrom); + } + if (content.Contains("ManagedResourceGroupConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).ManagedResourceGroupConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IManagedResourceGroupConfiguration) content.GetValueForProperty("ManagedResourceGroupConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).ManagedResourceGroupConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ManagedResourceGroupConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("RuntimeProtectionConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).RuntimeProtectionConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRuntimeProtectionConfiguration) content.GetValueForProperty("RuntimeProtectionConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).RuntimeProtectionConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.RuntimeProtectionConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("SecretArchive")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).SecretArchive = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterSecretArchive) content.GetValueForProperty("SecretArchive",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).SecretArchive, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterSecretArchiveTypeConverter.ConvertFrom); + } + if (content.Contains("SecretArchiveSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).SecretArchiveSetting = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISecretArchiveSettings) content.GetValueForProperty("SecretArchiveSetting",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).SecretArchiveSetting, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.SecretArchiveSettingsTypeConverter.ConvertFrom); + } + if (content.Contains("UpdateStrategy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).UpdateStrategy = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterUpdateStrategy) content.GetValueForProperty("UpdateStrategy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).UpdateStrategy, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterUpdateStrategyTypeConverter.ConvertFrom); + } + if (content.Contains("VulnerabilityScanningSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).VulnerabilityScanningSetting = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVulnerabilityScanningSettings) content.GetValueForProperty("VulnerabilityScanningSetting",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).VulnerabilityScanningSetting, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.VulnerabilityScanningSettingsTypeConverter.ConvertFrom); + } + if (content.Contains("AnalyticsWorkspaceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).AnalyticsWorkspaceId = (string) content.GetValueForProperty("AnalyticsWorkspaceId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).AnalyticsWorkspaceId, global::System.Convert.ToString); + } + if (content.Contains("AvailableUpgradeVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).AvailableUpgradeVersion = (System.Collections.Generic.List) content.GetValueForProperty("AvailableUpgradeVersion",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).AvailableUpgradeVersion, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterAvailableUpgradeVersionTypeConverter.ConvertFrom)); + } + if (content.Contains("ClusterConnectionStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).ClusterConnectionStatus = (string) content.GetValueForProperty("ClusterConnectionStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).ClusterConnectionStatus, global::System.Convert.ToString); + } + if (content.Contains("ClusterLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).ClusterLocation = (string) content.GetValueForProperty("ClusterLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).ClusterLocation, global::System.Convert.ToString); + } + if (content.Contains("ClusterManagerConnectionStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).ClusterManagerConnectionStatus = (string) content.GetValueForProperty("ClusterManagerConnectionStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).ClusterManagerConnectionStatus, global::System.Convert.ToString); + } + if (content.Contains("ClusterManagerId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).ClusterManagerId = (string) content.GetValueForProperty("ClusterManagerId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).ClusterManagerId, global::System.Convert.ToString); + } + if (content.Contains("ClusterType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).ClusterType = (string) content.GetValueForProperty("ClusterType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).ClusterType, global::System.Convert.ToString); + } + if (content.Contains("ClusterVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).ClusterVersion = (string) content.GetValueForProperty("ClusterVersion",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).ClusterVersion, global::System.Convert.ToString); + } + if (content.Contains("ComputeRackDefinition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).ComputeRackDefinition = (System.Collections.Generic.List) content.GetValueForProperty("ComputeRackDefinition",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).ComputeRackDefinition, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.RackDefinitionTypeConverter.ConvertFrom)); + } + if (content.Contains("DetailedStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).DetailedStatus = (string) content.GetValueForProperty("DetailedStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).DetailedStatus, global::System.Convert.ToString); + } + if (content.Contains("DetailedStatusMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).DetailedStatusMessage = (string) content.GetValueForProperty("DetailedStatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).DetailedStatusMessage, global::System.Convert.ToString); + } + if (content.Contains("ManualActionCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).ManualActionCount = (long?) content.GetValueForProperty("ManualActionCount",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).ManualActionCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("NetworkFabricId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).NetworkFabricId = (string) content.GetValueForProperty("NetworkFabricId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).NetworkFabricId, global::System.Convert.ToString); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("SupportExpiryDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).SupportExpiryDate = (string) content.GetValueForProperty("SupportExpiryDate",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).SupportExpiryDate, global::System.Convert.ToString); + } + if (content.Contains("WorkloadResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).WorkloadResourceId = (System.Collections.Generic.List) content.GetValueForProperty("WorkloadResourceId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).WorkloadResourceId, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("CommandOutputSettingContainerUrl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).CommandOutputSettingContainerUrl = (string) content.GetValueForProperty("CommandOutputSettingContainerUrl",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).CommandOutputSettingContainerUrl, global::System.Convert.ToString); + } + if (content.Contains("ManagedResourceGroupConfigurationLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).ManagedResourceGroupConfigurationLocation = (string) content.GetValueForProperty("ManagedResourceGroupConfigurationLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).ManagedResourceGroupConfigurationLocation, global::System.Convert.ToString); + } + if (content.Contains("ManagedResourceGroupConfigurationName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).ManagedResourceGroupConfigurationName = (string) content.GetValueForProperty("ManagedResourceGroupConfigurationName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).ManagedResourceGroupConfigurationName, global::System.Convert.ToString); + } + if (content.Contains("SecretArchiveSettingVaultUri")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).SecretArchiveSettingVaultUri = (string) content.GetValueForProperty("SecretArchiveSettingVaultUri",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).SecretArchiveSettingVaultUri, global::System.Convert.ToString); + } + if (content.Contains("VulnerabilityScanningSettingContainerScan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).VulnerabilityScanningSettingContainerScan = (string) content.GetValueForProperty("VulnerabilityScanningSettingContainerScan",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).VulnerabilityScanningSettingContainerScan, global::System.Convert.ToString); + } + if (content.Contains("AggregatorOrSingleRackDefinitionAvailabilityZone")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).AggregatorOrSingleRackDefinitionAvailabilityZone = (string) content.GetValueForProperty("AggregatorOrSingleRackDefinitionAvailabilityZone",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).AggregatorOrSingleRackDefinitionAvailabilityZone, global::System.Convert.ToString); + } + if (content.Contains("AggregatorOrSingleRackDefinitionBareMetalMachineConfigurationData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).AggregatorOrSingleRackDefinitionBareMetalMachineConfigurationData = (System.Collections.Generic.List) content.GetValueForProperty("AggregatorOrSingleRackDefinitionBareMetalMachineConfigurationData",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).AggregatorOrSingleRackDefinitionBareMetalMachineConfigurationData, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BareMetalMachineConfigurationDataTypeConverter.ConvertFrom)); + } + if (content.Contains("AggregatorOrSingleRackDefinitionNetworkRackId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).AggregatorOrSingleRackDefinitionNetworkRackId = (string) content.GetValueForProperty("AggregatorOrSingleRackDefinitionNetworkRackId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).AggregatorOrSingleRackDefinitionNetworkRackId, global::System.Convert.ToString); + } + if (content.Contains("AggregatorOrSingleRackDefinitionRackLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).AggregatorOrSingleRackDefinitionRackLocation = (string) content.GetValueForProperty("AggregatorOrSingleRackDefinitionRackLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).AggregatorOrSingleRackDefinitionRackLocation, global::System.Convert.ToString); + } + if (content.Contains("AggregatorOrSingleRackDefinitionRackSerialNumber")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).AggregatorOrSingleRackDefinitionRackSerialNumber = (string) content.GetValueForProperty("AggregatorOrSingleRackDefinitionRackSerialNumber",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).AggregatorOrSingleRackDefinitionRackSerialNumber, global::System.Convert.ToString); + } + if (content.Contains("AggregatorOrSingleRackDefinitionRackSkuId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).AggregatorOrSingleRackDefinitionRackSkuId = (string) content.GetValueForProperty("AggregatorOrSingleRackDefinitionRackSkuId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).AggregatorOrSingleRackDefinitionRackSkuId, global::System.Convert.ToString); + } + if (content.Contains("AggregatorOrSingleRackDefinitionStorageApplianceConfigurationData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).AggregatorOrSingleRackDefinitionStorageApplianceConfigurationData = (System.Collections.Generic.List) content.GetValueForProperty("AggregatorOrSingleRackDefinitionStorageApplianceConfigurationData",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).AggregatorOrSingleRackDefinitionStorageApplianceConfigurationData, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.StorageApplianceConfigurationDataTypeConverter.ConvertFrom)); + } + if (content.Contains("AnalyticOutputSettingAssociatedIdentity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).AnalyticOutputSettingAssociatedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IIdentitySelector) content.GetValueForProperty("AnalyticOutputSettingAssociatedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).AnalyticOutputSettingAssociatedIdentity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IdentitySelectorTypeConverter.ConvertFrom); + } + if (content.Contains("AnalyticOutputSettingAnalyticsWorkspaceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).AnalyticOutputSettingAnalyticsWorkspaceId = (string) content.GetValueForProperty("AnalyticOutputSettingAnalyticsWorkspaceId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).AnalyticOutputSettingAnalyticsWorkspaceId, global::System.Convert.ToString); + } + if (content.Contains("ClusterCapacityAvailableApplianceStorageGb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).ClusterCapacityAvailableApplianceStorageGb = (long?) content.GetValueForProperty("ClusterCapacityAvailableApplianceStorageGb",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).ClusterCapacityAvailableApplianceStorageGb, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("ClusterCapacityAvailableCoreCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).ClusterCapacityAvailableCoreCount = (long?) content.GetValueForProperty("ClusterCapacityAvailableCoreCount",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).ClusterCapacityAvailableCoreCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("ClusterCapacityAvailableHostStorageGb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).ClusterCapacityAvailableHostStorageGb = (long?) content.GetValueForProperty("ClusterCapacityAvailableHostStorageGb",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).ClusterCapacityAvailableHostStorageGb, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("ClusterCapacityAvailableMemoryGb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).ClusterCapacityAvailableMemoryGb = (long?) content.GetValueForProperty("ClusterCapacityAvailableMemoryGb",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).ClusterCapacityAvailableMemoryGb, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("ClusterCapacityTotalApplianceStorageGb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).ClusterCapacityTotalApplianceStorageGb = (long?) content.GetValueForProperty("ClusterCapacityTotalApplianceStorageGb",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).ClusterCapacityTotalApplianceStorageGb, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("ClusterCapacityTotalCoreCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).ClusterCapacityTotalCoreCount = (long?) content.GetValueForProperty("ClusterCapacityTotalCoreCount",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).ClusterCapacityTotalCoreCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("ClusterCapacityTotalHostStorageGb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).ClusterCapacityTotalHostStorageGb = (long?) content.GetValueForProperty("ClusterCapacityTotalHostStorageGb",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).ClusterCapacityTotalHostStorageGb, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("ClusterCapacityTotalMemoryGb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).ClusterCapacityTotalMemoryGb = (long?) content.GetValueForProperty("ClusterCapacityTotalMemoryGb",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).ClusterCapacityTotalMemoryGb, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("ClusterExtendedLocationName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).ClusterExtendedLocationName = (string) content.GetValueForProperty("ClusterExtendedLocationName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).ClusterExtendedLocationName, global::System.Convert.ToString); + } + if (content.Contains("ClusterExtendedLocationType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).ClusterExtendedLocationType = (string) content.GetValueForProperty("ClusterExtendedLocationType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).ClusterExtendedLocationType, global::System.Convert.ToString); + } + if (content.Contains("ClusterServicePrincipalApplicationId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).ClusterServicePrincipalApplicationId = (string) content.GetValueForProperty("ClusterServicePrincipalApplicationId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).ClusterServicePrincipalApplicationId, global::System.Convert.ToString); + } + if (content.Contains("ClusterServicePrincipalPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).ClusterServicePrincipalPassword = (System.Security.SecureString) content.GetValueForProperty("ClusterServicePrincipalPassword",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).ClusterServicePrincipalPassword, (object ss) => (System.Security.SecureString)ss); + } + if (content.Contains("ClusterServicePrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).ClusterServicePrincipalId = (string) content.GetValueForProperty("ClusterServicePrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).ClusterServicePrincipalId, global::System.Convert.ToString); + } + if (content.Contains("ClusterServicePrincipalTenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).ClusterServicePrincipalTenantId = (string) content.GetValueForProperty("ClusterServicePrincipalTenantId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).ClusterServicePrincipalTenantId, global::System.Convert.ToString); + } + if (content.Contains("CommandOutputSettingAssociatedIdentity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).CommandOutputSettingAssociatedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IIdentitySelector) content.GetValueForProperty("CommandOutputSettingAssociatedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).CommandOutputSettingAssociatedIdentity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IdentitySelectorTypeConverter.ConvertFrom); + } + if (content.Contains("ComputeDeploymentThresholdGrouping")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).ComputeDeploymentThresholdGrouping = (string) content.GetValueForProperty("ComputeDeploymentThresholdGrouping",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).ComputeDeploymentThresholdGrouping, global::System.Convert.ToString); + } + if (content.Contains("ComputeDeploymentThresholdType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).ComputeDeploymentThresholdType = (string) content.GetValueForProperty("ComputeDeploymentThresholdType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).ComputeDeploymentThresholdType, global::System.Convert.ToString); + } + if (content.Contains("ComputeDeploymentThresholdValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).ComputeDeploymentThresholdValue = (long?) content.GetValueForProperty("ComputeDeploymentThresholdValue",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).ComputeDeploymentThresholdValue, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("HybridAkExtendedLocationName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).HybridAkExtendedLocationName = (string) content.GetValueForProperty("HybridAkExtendedLocationName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).HybridAkExtendedLocationName, global::System.Convert.ToString); + } + if (content.Contains("HybridAkExtendedLocationType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).HybridAkExtendedLocationType = (string) content.GetValueForProperty("HybridAkExtendedLocationType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).HybridAkExtendedLocationType, global::System.Convert.ToString); + } + if (content.Contains("RuntimeProtectionConfigurationEnforcementLevel")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).RuntimeProtectionConfigurationEnforcementLevel = (string) content.GetValueForProperty("RuntimeProtectionConfigurationEnforcementLevel",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).RuntimeProtectionConfigurationEnforcementLevel, global::System.Convert.ToString); + } + if (content.Contains("SecretArchiveKeyVaultId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).SecretArchiveKeyVaultId = (string) content.GetValueForProperty("SecretArchiveKeyVaultId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).SecretArchiveKeyVaultId, global::System.Convert.ToString); + } + if (content.Contains("SecretArchiveUseKeyVault")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).SecretArchiveUseKeyVault = (string) content.GetValueForProperty("SecretArchiveUseKeyVault",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).SecretArchiveUseKeyVault, global::System.Convert.ToString); + } + if (content.Contains("SecretArchiveSettingAssociatedIdentity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).SecretArchiveSettingAssociatedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IIdentitySelector) content.GetValueForProperty("SecretArchiveSettingAssociatedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).SecretArchiveSettingAssociatedIdentity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IdentitySelectorTypeConverter.ConvertFrom); + } + if (content.Contains("UpdateStrategyMaxUnavailable")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).UpdateStrategyMaxUnavailable = (long?) content.GetValueForProperty("UpdateStrategyMaxUnavailable",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).UpdateStrategyMaxUnavailable, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("UpdateStrategyType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).UpdateStrategyType = (string) content.GetValueForProperty("UpdateStrategyType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).UpdateStrategyType, global::System.Convert.ToString); + } + if (content.Contains("UpdateStrategyThresholdType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).UpdateStrategyThresholdType = (string) content.GetValueForProperty("UpdateStrategyThresholdType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).UpdateStrategyThresholdType, global::System.Convert.ToString); + } + if (content.Contains("UpdateStrategyThresholdValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).UpdateStrategyThresholdValue = (long?) content.GetValueForProperty("UpdateStrategyThresholdValue",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).UpdateStrategyThresholdValue, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("UpdateStrategyWaitTimeMinute")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).UpdateStrategyWaitTimeMinute = (long?) content.GetValueForProperty("UpdateStrategyWaitTimeMinute",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).UpdateStrategyWaitTimeMinute, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("AnalyticsOutputSettingsAssociatedIdentityType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).AnalyticsOutputSettingsAssociatedIdentityType = (string) content.GetValueForProperty("AnalyticsOutputSettingsAssociatedIdentityType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).AnalyticsOutputSettingsAssociatedIdentityType, global::System.Convert.ToString); + } + if (content.Contains("AnalyticsOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).AnalyticsOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId = (string) content.GetValueForProperty("AnalyticsOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).AnalyticsOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId, global::System.Convert.ToString); + } + if (content.Contains("CommandOutputSettingsAssociatedIdentityType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).CommandOutputSettingsAssociatedIdentityType = (string) content.GetValueForProperty("CommandOutputSettingsAssociatedIdentityType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).CommandOutputSettingsAssociatedIdentityType, global::System.Convert.ToString); + } + if (content.Contains("CommandOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).CommandOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId = (string) content.GetValueForProperty("CommandOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).CommandOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId, global::System.Convert.ToString); + } + if (content.Contains("SecretArchiveSettingsAssociatedIdentityType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).SecretArchiveSettingsAssociatedIdentityType = (string) content.GetValueForProperty("SecretArchiveSettingsAssociatedIdentityType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).SecretArchiveSettingsAssociatedIdentityType, global::System.Convert.ToString); + } + if (content.Contains("SecretArchiveSettingsAssociatedIdentityUserAssignedIdentityResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).SecretArchiveSettingsAssociatedIdentityUserAssignedIdentityResourceId = (string) content.GetValueForProperty("SecretArchiveSettingsAssociatedIdentityUserAssignedIdentityResourceId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal)this).SecretArchiveSettingsAssociatedIdentityUserAssignedIdentityResourceId, 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.NetworkCloud.Models.IClusterProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ClusterProperties(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.NetworkCloud.Models.IClusterProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ClusterProperties(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.NetworkCloud.Models.IClusterProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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(); + } + } + /// ClusterProperties represents the properties of a cluster. + [System.ComponentModel.TypeConverter(typeof(ClusterPropertiesTypeConverter))] + public partial interface IClusterProperties + + { + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterProperties.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterProperties.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterProperties.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterProperties.TypeConverter.cs index a6fa2ce023ab..8f7a9eab3acd 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterProperties.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterProperties.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IClusterProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterProperties.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterProperties.cs new file mode 100644 index 000000000000..d3c92d078a94 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterProperties.cs @@ -0,0 +1,1612 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + + /// ClusterProperties represents the properties of a cluster. + public partial class ClusterProperties : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterProperties, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackDefinition _aggregatorOrSingleRackDefinition; + + /// + /// The rack definition that is intended to reflect only a single rack in a single rack cluster, or an aggregator rack in + /// a multi-rack cluster. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackDefinition AggregatorOrSingleRackDefinition { get => (this._aggregatorOrSingleRackDefinition = this._aggregatorOrSingleRackDefinition ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.RackDefinition()); set => this._aggregatorOrSingleRackDefinition = value; } + + /// + /// The zone name used for this rack when created. Availability zones are used for workload placement. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string AggregatorOrSingleRackDefinitionAvailabilityZone { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackDefinitionInternal)AggregatorOrSingleRackDefinition).AvailabilityZone; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackDefinitionInternal)AggregatorOrSingleRackDefinition).AvailabilityZone = value ?? null; } + + /// The unordered list of bare metal machine configuration. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public System.Collections.Generic.List AggregatorOrSingleRackDefinitionBareMetalMachineConfigurationData { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackDefinitionInternal)AggregatorOrSingleRackDefinition).BareMetalMachineConfigurationData; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackDefinitionInternal)AggregatorOrSingleRackDefinition).BareMetalMachineConfigurationData = value ?? null /* arrayOf */; } + + /// The resource ID of the network rack that matches this rack definition. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string AggregatorOrSingleRackDefinitionNetworkRackId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackDefinitionInternal)AggregatorOrSingleRackDefinition).NetworkRackId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackDefinitionInternal)AggregatorOrSingleRackDefinition).NetworkRackId = value ; } + + /// The free-form description of the rack's location. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string AggregatorOrSingleRackDefinitionRackLocation { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackDefinitionInternal)AggregatorOrSingleRackDefinition).RackLocation; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackDefinitionInternal)AggregatorOrSingleRackDefinition).RackLocation = value ?? null; } + + /// + /// The unique identifier for the rack within Network Cloud cluster. An alternate unique alphanumeric value other than a serial + /// number may be provided if desired. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string AggregatorOrSingleRackDefinitionRackSerialNumber { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackDefinitionInternal)AggregatorOrSingleRackDefinition).RackSerialNumber; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackDefinitionInternal)AggregatorOrSingleRackDefinition).RackSerialNumber = value ; } + + /// The resource ID of the sku for the rack being added. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string AggregatorOrSingleRackDefinitionRackSkuId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackDefinitionInternal)AggregatorOrSingleRackDefinition).RackSkuId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackDefinitionInternal)AggregatorOrSingleRackDefinition).RackSkuId = value ; } + + /// The list of storage appliance configuration data for this rack. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public System.Collections.Generic.List AggregatorOrSingleRackDefinitionStorageApplianceConfigurationData { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackDefinitionInternal)AggregatorOrSingleRackDefinition).StorageApplianceConfigurationData; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackDefinitionInternal)AggregatorOrSingleRackDefinition).StorageApplianceConfigurationData = value ?? null /* arrayOf */; } + + /// + /// The resource ID of the analytics workspace that is to be used by the specified identity. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string AnalyticOutputSettingAnalyticsWorkspaceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAnalyticsOutputSettingsInternal)AnalyticsOutputSetting).AnalyticsWorkspaceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAnalyticsOutputSettingsInternal)AnalyticsOutputSetting).AnalyticsWorkspaceId = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAnalyticsOutputSettings _analyticsOutputSetting; + + /// + /// The settings for the log analytics workspace used for output of logs from this cluster. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAnalyticsOutputSettings AnalyticsOutputSetting { get => (this._analyticsOutputSetting = this._analyticsOutputSetting ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AnalyticsOutputSettings()); set => this._analyticsOutputSetting = value; } + + /// The type of managed identity that is being selected. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string AnalyticsOutputSettingsAssociatedIdentityType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAnalyticsOutputSettingsInternal)AnalyticsOutputSetting).AssociatedIdentityType; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAnalyticsOutputSettingsInternal)AnalyticsOutputSetting).AssociatedIdentityType = value ?? null; } + + /// + /// The user assigned managed identity resource ID to use. Mutually exclusive with a system assigned identity type. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string AnalyticsOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAnalyticsOutputSettingsInternal)AnalyticsOutputSetting).AssociatedIdentityUserAssignedIdentityResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAnalyticsOutputSettingsInternal)AnalyticsOutputSetting).AssociatedIdentityUserAssignedIdentityResourceId = value ?? null; } + + /// Backing field for property. + private string _analyticsWorkspaceId; + + /// + /// Field Deprecated. The resource ID of the Log Analytics Workspace that will be used for storing relevant logs. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string AnalyticsWorkspaceId { get => this._analyticsWorkspaceId; set => this._analyticsWorkspaceId = value; } + + /// Backing field for property. + private System.Collections.Generic.List _availableUpgradeVersion; + + /// The list of cluster runtime version upgrades available for this cluster. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public System.Collections.Generic.List AvailableUpgradeVersion { get => this._availableUpgradeVersion; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterCapacity _clusterCapacity; + + /// The capacity supported by this cluster. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterCapacity ClusterCapacity { get => (this._clusterCapacity = this._clusterCapacity ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterCapacity()); } + + /// + /// The remaining appliance-based storage in GB available for workload use. Measured in gibibytes. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public long? ClusterCapacityAvailableApplianceStorageGb { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterCapacityInternal)ClusterCapacity).AvailableApplianceStorageGb; } + + /// + /// The remaining number of cores that are available in this cluster for workload use. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public long? ClusterCapacityAvailableCoreCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterCapacityInternal)ClusterCapacity).AvailableCoreCount; } + + /// + /// The remaining machine or host-based storage in GB available for workload use. Measured in gibibytes. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public long? ClusterCapacityAvailableHostStorageGb { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterCapacityInternal)ClusterCapacity).AvailableHostStorageGb; } + + /// + /// The remaining memory in GB that are available in this cluster for workload use. Measured in gibibytes. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public long? ClusterCapacityAvailableMemoryGb { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterCapacityInternal)ClusterCapacity).AvailableMemoryGb; } + + /// + /// The total appliance-based storage in GB supported by this cluster for workload use. Measured in gibibytes. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public long? ClusterCapacityTotalApplianceStorageGb { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterCapacityInternal)ClusterCapacity).TotalApplianceStorageGb; } + + /// The total number of cores that are supported by this cluster for workload use. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public long? ClusterCapacityTotalCoreCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterCapacityInternal)ClusterCapacity).TotalCoreCount; } + + /// + /// The total machine or host-based storage in GB supported by this cluster for workload use. Measured in gibibytes. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public long? ClusterCapacityTotalHostStorageGb { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterCapacityInternal)ClusterCapacity).TotalHostStorageGb; } + + /// + /// The total memory supported by this cluster for workload use. Measured in gibibytes. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public long? ClusterCapacityTotalMemoryGb { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterCapacityInternal)ClusterCapacity).TotalMemoryGb; } + + /// Backing field for property. + private string _clusterConnectionStatus; + + /// The latest heartbeat status between the cluster manager and the cluster. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string ClusterConnectionStatus { get => this._clusterConnectionStatus; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocation _clusterExtendedLocation; + + /// + /// The extended location (custom location) that represents the cluster's control plane location. This extended location is + /// used to route the requests of child objects of the cluster that are handled by the platform operator. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocation ClusterExtendedLocation { get => (this._clusterExtendedLocation = this._clusterExtendedLocation ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ExtendedLocation()); } + + /// The resource ID of the extended location on which the resource will be created. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string ClusterExtendedLocationName { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocationInternal)ClusterExtendedLocation).Name; } + + /// The extended location type, for example, CustomLocation. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string ClusterExtendedLocationType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocationInternal)ClusterExtendedLocation).Type; } + + /// Backing field for property. + private string _clusterLocation; + + /// + /// The customer-provided location information to identify where the cluster resides. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string ClusterLocation { get => this._clusterLocation; set => this._clusterLocation = value; } + + /// Backing field for property. + private string _clusterManagerConnectionStatus; + + /// The latest connectivity status between cluster manager and the cluster. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string ClusterManagerConnectionStatus { get => this._clusterManagerConnectionStatus; } + + /// Backing field for property. + private string _clusterManagerId; + + /// + /// The resource ID of the cluster manager that manages this cluster. This is set by the Cluster Manager when the cluster + /// is created. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string ClusterManagerId { get => this._clusterManagerId; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IServicePrincipalInformation _clusterServicePrincipal; + + /// + /// The service principal to be used by the cluster during Arc Appliance installation. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IServicePrincipalInformation ClusterServicePrincipal { get => (this._clusterServicePrincipal = this._clusterServicePrincipal ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ServicePrincipalInformation()); set => this._clusterServicePrincipal = value; } + + /// The application ID, also known as client ID, of the service principal. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string ClusterServicePrincipalApplicationId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IServicePrincipalInformationInternal)ClusterServicePrincipal).ApplicationId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IServicePrincipalInformationInternal)ClusterServicePrincipal).ApplicationId = value ?? null; } + + /// The principal ID, also known as the object ID, of the service principal. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string ClusterServicePrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IServicePrincipalInformationInternal)ClusterServicePrincipal).PrincipalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IServicePrincipalInformationInternal)ClusterServicePrincipal).PrincipalId = value ?? null; } + + /// The password of the service principal. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public System.Security.SecureString ClusterServicePrincipalPassword { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IServicePrincipalInformationInternal)ClusterServicePrincipal).Password; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IServicePrincipalInformationInternal)ClusterServicePrincipal).Password = value ?? null; } + + /// + /// The tenant ID, also known as the directory ID, of the tenant in which the service principal is created. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string ClusterServicePrincipalTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IServicePrincipalInformationInternal)ClusterServicePrincipal).TenantId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IServicePrincipalInformationInternal)ClusterServicePrincipal).TenantId = value ?? null; } + + /// Backing field for property. + private string _clusterType; + + /// The type of rack configuration for the cluster. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string ClusterType { get => this._clusterType; set => this._clusterType = value; } + + /// Backing field for property. + private string _clusterVersion; + + /// The current runtime version of the cluster. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string ClusterVersion { get => this._clusterVersion; set => this._clusterVersion = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICommandOutputSettings _commandOutputSetting; + + /// + /// The settings for commands run in this cluster, such as bare metal machine run read only commands and data extracts. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICommandOutputSettings CommandOutputSetting { get => (this._commandOutputSetting = this._commandOutputSetting ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.CommandOutputSettings()); set => this._commandOutputSetting = value; } + + /// + /// The URL of the storage account container that is to be used by the specified identities. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string CommandOutputSettingContainerUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICommandOutputSettingsInternal)CommandOutputSetting).ContainerUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICommandOutputSettingsInternal)CommandOutputSetting).ContainerUrl = value ?? null; } + + /// The type of managed identity that is being selected. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string CommandOutputSettingsAssociatedIdentityType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICommandOutputSettingsInternal)CommandOutputSetting).AssociatedIdentityType; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICommandOutputSettingsInternal)CommandOutputSetting).AssociatedIdentityType = value ?? null; } + + /// + /// The user assigned managed identity resource ID to use. Mutually exclusive with a system assigned identity type. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string CommandOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICommandOutputSettingsInternal)CommandOutputSetting).AssociatedIdentityUserAssignedIdentityResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICommandOutputSettingsInternal)CommandOutputSetting).AssociatedIdentityUserAssignedIdentityResourceId = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IValidationThreshold _computeDeploymentThreshold; + + /// + /// The validation threshold indicating the allowable failures of compute machines during environment validation and deployment. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IValidationThreshold ComputeDeploymentThreshold { get => (this._computeDeploymentThreshold = this._computeDeploymentThreshold ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ValidationThreshold()); set => this._computeDeploymentThreshold = value; } + + /// Selection of how the type evaluation is applied to the cluster calculation. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string ComputeDeploymentThresholdGrouping { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IValidationThresholdInternal)ComputeDeploymentThreshold).Grouping; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IValidationThresholdInternal)ComputeDeploymentThreshold).Grouping = value ?? null; } + + /// Selection of how the threshold should be evaluated. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string ComputeDeploymentThresholdType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IValidationThresholdInternal)ComputeDeploymentThreshold).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IValidationThresholdInternal)ComputeDeploymentThreshold).Type = value ?? null; } + + /// The numeric threshold value. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public long? ComputeDeploymentThresholdValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IValidationThresholdInternal)ComputeDeploymentThreshold).Value; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IValidationThresholdInternal)ComputeDeploymentThreshold).Value = value ?? default(long); } + + /// Backing field for property. + private System.Collections.Generic.List _computeRackDefinition; + + /// + /// The list of rack definitions for the compute racks in a multi-rack cluster, or an empty list in a single-rack cluster. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public System.Collections.Generic.List ComputeRackDefinition { get => this._computeRackDefinition; set => this._computeRackDefinition = value; } + + /// Backing field for property. + private string _detailedStatus; + + /// The current detailed status of the cluster. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string DetailedStatus { get => this._detailedStatus; } + + /// Backing field for property. + private string _detailedStatusMessage; + + /// The descriptive message about the detailed status. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string DetailedStatusMessage { get => this._detailedStatusMessage; } + + /// The resource ID of the extended location on which the resource will be created. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string HybridAkExtendedLocationName { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocationInternal)HybridAksExtendedLocation).Name; } + + /// The extended location type, for example, CustomLocation. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string HybridAkExtendedLocationType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocationInternal)HybridAksExtendedLocation).Type; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocation _hybridAksExtendedLocation; + + /// + /// Field Deprecated. This field will not be populated in an upcoming version. The extended location (custom location) that + /// represents the Hybrid AKS control plane location. This extended location is used when creating provisioned clusters (Hybrid + /// AKS clusters). + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocation HybridAksExtendedLocation { get => (this._hybridAksExtendedLocation = this._hybridAksExtendedLocation ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ExtendedLocation()); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IManagedResourceGroupConfiguration _managedResourceGroupConfiguration; + + /// The configuration of the managed resource group associated with the resource. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IManagedResourceGroupConfiguration ManagedResourceGroupConfiguration { get => (this._managedResourceGroupConfiguration = this._managedResourceGroupConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ManagedResourceGroupConfiguration()); set => this._managedResourceGroupConfiguration = value; } + + /// + /// The location of the managed resource group. If not specified, the location of the parent resource is chosen. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string ManagedResourceGroupConfigurationLocation { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IManagedResourceGroupConfigurationInternal)ManagedResourceGroupConfiguration).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IManagedResourceGroupConfigurationInternal)ManagedResourceGroupConfiguration).Location = value ?? null; } + + /// + /// The name for the managed resource group. If not specified, the unique name is automatically generated. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string ManagedResourceGroupConfigurationName { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IManagedResourceGroupConfigurationInternal)ManagedResourceGroupConfiguration).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IManagedResourceGroupConfigurationInternal)ManagedResourceGroupConfiguration).Name = value ?? null; } + + /// Backing field for property. + private long? _manualActionCount; + + /// The count of Manual Action Taken (MAT) events that have not been validated. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public long? ManualActionCount { get => this._manualActionCount; } + + /// Internal Acessors for AggregatorOrSingleRackDefinition + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackDefinition Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal.AggregatorOrSingleRackDefinition { get => (this._aggregatorOrSingleRackDefinition = this._aggregatorOrSingleRackDefinition ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.RackDefinition()); set { {_aggregatorOrSingleRackDefinition = value;} } } + + /// Internal Acessors for AnalyticOutputSettingAssociatedIdentity + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IIdentitySelector Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal.AnalyticOutputSettingAssociatedIdentity { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAnalyticsOutputSettingsInternal)AnalyticsOutputSetting).AssociatedIdentity; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAnalyticsOutputSettingsInternal)AnalyticsOutputSetting).AssociatedIdentity = value ?? null /* model class */; } + + /// Internal Acessors for AnalyticsOutputSetting + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAnalyticsOutputSettings Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal.AnalyticsOutputSetting { get => (this._analyticsOutputSetting = this._analyticsOutputSetting ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AnalyticsOutputSettings()); set { {_analyticsOutputSetting = value;} } } + + /// Internal Acessors for AvailableUpgradeVersion + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal.AvailableUpgradeVersion { get => this._availableUpgradeVersion; set { {_availableUpgradeVersion = value;} } } + + /// Internal Acessors for ClusterCapacity + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterCapacity Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal.ClusterCapacity { get => (this._clusterCapacity = this._clusterCapacity ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterCapacity()); set { {_clusterCapacity = value;} } } + + /// Internal Acessors for ClusterCapacityAvailableApplianceStorageGb + long? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal.ClusterCapacityAvailableApplianceStorageGb { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterCapacityInternal)ClusterCapacity).AvailableApplianceStorageGb; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterCapacityInternal)ClusterCapacity).AvailableApplianceStorageGb = value ?? default(long); } + + /// Internal Acessors for ClusterCapacityAvailableCoreCount + long? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal.ClusterCapacityAvailableCoreCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterCapacityInternal)ClusterCapacity).AvailableCoreCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterCapacityInternal)ClusterCapacity).AvailableCoreCount = value ?? default(long); } + + /// Internal Acessors for ClusterCapacityAvailableHostStorageGb + long? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal.ClusterCapacityAvailableHostStorageGb { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterCapacityInternal)ClusterCapacity).AvailableHostStorageGb; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterCapacityInternal)ClusterCapacity).AvailableHostStorageGb = value ?? default(long); } + + /// Internal Acessors for ClusterCapacityAvailableMemoryGb + long? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal.ClusterCapacityAvailableMemoryGb { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterCapacityInternal)ClusterCapacity).AvailableMemoryGb; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterCapacityInternal)ClusterCapacity).AvailableMemoryGb = value ?? default(long); } + + /// Internal Acessors for ClusterCapacityTotalApplianceStorageGb + long? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal.ClusterCapacityTotalApplianceStorageGb { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterCapacityInternal)ClusterCapacity).TotalApplianceStorageGb; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterCapacityInternal)ClusterCapacity).TotalApplianceStorageGb = value ?? default(long); } + + /// Internal Acessors for ClusterCapacityTotalCoreCount + long? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal.ClusterCapacityTotalCoreCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterCapacityInternal)ClusterCapacity).TotalCoreCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterCapacityInternal)ClusterCapacity).TotalCoreCount = value ?? default(long); } + + /// Internal Acessors for ClusterCapacityTotalHostStorageGb + long? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal.ClusterCapacityTotalHostStorageGb { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterCapacityInternal)ClusterCapacity).TotalHostStorageGb; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterCapacityInternal)ClusterCapacity).TotalHostStorageGb = value ?? default(long); } + + /// Internal Acessors for ClusterCapacityTotalMemoryGb + long? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal.ClusterCapacityTotalMemoryGb { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterCapacityInternal)ClusterCapacity).TotalMemoryGb; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterCapacityInternal)ClusterCapacity).TotalMemoryGb = value ?? default(long); } + + /// Internal Acessors for ClusterConnectionStatus + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal.ClusterConnectionStatus { get => this._clusterConnectionStatus; set { {_clusterConnectionStatus = value;} } } + + /// Internal Acessors for ClusterExtendedLocation + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocation Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal.ClusterExtendedLocation { get => (this._clusterExtendedLocation = this._clusterExtendedLocation ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ExtendedLocation()); set { {_clusterExtendedLocation = value;} } } + + /// Internal Acessors for ClusterExtendedLocationName + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal.ClusterExtendedLocationName { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocationInternal)ClusterExtendedLocation).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocationInternal)ClusterExtendedLocation).Name = value ?? null; } + + /// Internal Acessors for ClusterExtendedLocationType + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal.ClusterExtendedLocationType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocationInternal)ClusterExtendedLocation).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocationInternal)ClusterExtendedLocation).Type = value ?? null; } + + /// Internal Acessors for ClusterManagerConnectionStatus + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal.ClusterManagerConnectionStatus { get => this._clusterManagerConnectionStatus; set { {_clusterManagerConnectionStatus = value;} } } + + /// Internal Acessors for ClusterManagerId + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal.ClusterManagerId { get => this._clusterManagerId; set { {_clusterManagerId = value;} } } + + /// Internal Acessors for ClusterServicePrincipal + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IServicePrincipalInformation Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal.ClusterServicePrincipal { get => (this._clusterServicePrincipal = this._clusterServicePrincipal ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ServicePrincipalInformation()); set { {_clusterServicePrincipal = value;} } } + + /// Internal Acessors for CommandOutputSetting + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICommandOutputSettings Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal.CommandOutputSetting { get => (this._commandOutputSetting = this._commandOutputSetting ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.CommandOutputSettings()); set { {_commandOutputSetting = value;} } } + + /// Internal Acessors for CommandOutputSettingAssociatedIdentity + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IIdentitySelector Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal.CommandOutputSettingAssociatedIdentity { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICommandOutputSettingsInternal)CommandOutputSetting).AssociatedIdentity; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICommandOutputSettingsInternal)CommandOutputSetting).AssociatedIdentity = value ?? null /* model class */; } + + /// Internal Acessors for ComputeDeploymentThreshold + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IValidationThreshold Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal.ComputeDeploymentThreshold { get => (this._computeDeploymentThreshold = this._computeDeploymentThreshold ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ValidationThreshold()); set { {_computeDeploymentThreshold = value;} } } + + /// Internal Acessors for DetailedStatus + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal.DetailedStatus { get => this._detailedStatus; set { {_detailedStatus = value;} } } + + /// Internal Acessors for DetailedStatusMessage + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal.DetailedStatusMessage { get => this._detailedStatusMessage; set { {_detailedStatusMessage = value;} } } + + /// Internal Acessors for HybridAkExtendedLocationName + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal.HybridAkExtendedLocationName { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocationInternal)HybridAksExtendedLocation).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocationInternal)HybridAksExtendedLocation).Name = value ?? null; } + + /// Internal Acessors for HybridAkExtendedLocationType + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal.HybridAkExtendedLocationType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocationInternal)HybridAksExtendedLocation).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocationInternal)HybridAksExtendedLocation).Type = value ?? null; } + + /// Internal Acessors for HybridAksExtendedLocation + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocation Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal.HybridAksExtendedLocation { get => (this._hybridAksExtendedLocation = this._hybridAksExtendedLocation ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ExtendedLocation()); set { {_hybridAksExtendedLocation = value;} } } + + /// Internal Acessors for ManagedResourceGroupConfiguration + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IManagedResourceGroupConfiguration Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal.ManagedResourceGroupConfiguration { get => (this._managedResourceGroupConfiguration = this._managedResourceGroupConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ManagedResourceGroupConfiguration()); set { {_managedResourceGroupConfiguration = value;} } } + + /// Internal Acessors for ManualActionCount + long? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal.ManualActionCount { get => this._manualActionCount; set { {_manualActionCount = value;} } } + + /// Internal Acessors for ProvisioningState + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal.ProvisioningState { get => this._provisioningState; set { {_provisioningState = value;} } } + + /// Internal Acessors for RuntimeProtectionConfiguration + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRuntimeProtectionConfiguration Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal.RuntimeProtectionConfiguration { get => (this._runtimeProtectionConfiguration = this._runtimeProtectionConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.RuntimeProtectionConfiguration()); set { {_runtimeProtectionConfiguration = value;} } } + + /// Internal Acessors for SecretArchive + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterSecretArchive Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal.SecretArchive { get => (this._secretArchive = this._secretArchive ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterSecretArchive()); set { {_secretArchive = value;} } } + + /// Internal Acessors for SecretArchiveSetting + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISecretArchiveSettings Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal.SecretArchiveSetting { get => (this._secretArchiveSetting = this._secretArchiveSetting ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.SecretArchiveSettings()); set { {_secretArchiveSetting = value;} } } + + /// Internal Acessors for SecretArchiveSettingAssociatedIdentity + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IIdentitySelector Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal.SecretArchiveSettingAssociatedIdentity { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISecretArchiveSettingsInternal)SecretArchiveSetting).AssociatedIdentity; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISecretArchiveSettingsInternal)SecretArchiveSetting).AssociatedIdentity = value ?? null /* model class */; } + + /// Internal Acessors for SupportExpiryDate + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal.SupportExpiryDate { get => this._supportExpiryDate; set { {_supportExpiryDate = value;} } } + + /// Internal Acessors for UpdateStrategy + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterUpdateStrategy Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal.UpdateStrategy { get => (this._updateStrategy = this._updateStrategy ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterUpdateStrategy()); set { {_updateStrategy = value;} } } + + /// Internal Acessors for VulnerabilityScanningSetting + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVulnerabilityScanningSettings Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal.VulnerabilityScanningSetting { get => (this._vulnerabilityScanningSetting = this._vulnerabilityScanningSetting ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.VulnerabilityScanningSettings()); set { {_vulnerabilityScanningSetting = value;} } } + + /// Internal Acessors for WorkloadResourceId + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPropertiesInternal.WorkloadResourceId { get => this._workloadResourceId; set { {_workloadResourceId = value;} } } + + /// Backing field for property. + private string _networkFabricId; + + /// The resource ID of the Network Fabric associated with the cluster. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string NetworkFabricId { get => this._networkFabricId; set => this._networkFabricId = value; } + + /// Backing field for property. + private string _provisioningState; + + /// The provisioning state of the cluster. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string ProvisioningState { get => this._provisioningState; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRuntimeProtectionConfiguration _runtimeProtectionConfiguration; + + /// The settings for cluster runtime protection. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRuntimeProtectionConfiguration RuntimeProtectionConfiguration { get => (this._runtimeProtectionConfiguration = this._runtimeProtectionConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.RuntimeProtectionConfiguration()); set => this._runtimeProtectionConfiguration = value; } + + /// The mode of operation for runtime protection. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string RuntimeProtectionConfigurationEnforcementLevel { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRuntimeProtectionConfigurationInternal)RuntimeProtectionConfiguration).EnforcementLevel; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRuntimeProtectionConfigurationInternal)RuntimeProtectionConfiguration).EnforcementLevel = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterSecretArchive _secretArchive; + + /// + /// The configuration for use of a key vault to store secrets for later retrieval by the operator. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterSecretArchive SecretArchive { get => (this._secretArchive = this._secretArchive ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterSecretArchive()); set => this._secretArchive = value; } + + /// The resource ID of the key vault to archive the secrets of the cluster. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string SecretArchiveKeyVaultId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterSecretArchiveInternal)SecretArchive).KeyVaultId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterSecretArchiveInternal)SecretArchive).KeyVaultId = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISecretArchiveSettings _secretArchiveSetting; + + /// The settings for the secret archive used to hold credentials for the cluster. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISecretArchiveSettings SecretArchiveSetting { get => (this._secretArchiveSetting = this._secretArchiveSetting ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.SecretArchiveSettings()); set => this._secretArchiveSetting = value; } + + /// The URI for the key vault used as the secret archive. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string SecretArchiveSettingVaultUri { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISecretArchiveSettingsInternal)SecretArchiveSetting).VaultUri; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISecretArchiveSettingsInternal)SecretArchiveSetting).VaultUri = value ?? null; } + + /// The type of managed identity that is being selected. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string SecretArchiveSettingsAssociatedIdentityType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISecretArchiveSettingsInternal)SecretArchiveSetting).AssociatedIdentityType; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISecretArchiveSettingsInternal)SecretArchiveSetting).AssociatedIdentityType = value ?? null; } + + /// + /// The user assigned managed identity resource ID to use. Mutually exclusive with a system assigned identity type. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string SecretArchiveSettingsAssociatedIdentityUserAssignedIdentityResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISecretArchiveSettingsInternal)SecretArchiveSetting).AssociatedIdentityUserAssignedIdentityResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISecretArchiveSettingsInternal)SecretArchiveSetting).AssociatedIdentityUserAssignedIdentityResourceId = value ?? null; } + + /// + /// The indicator if the specified key vault should be used to archive the secrets of the cluster. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string SecretArchiveUseKeyVault { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterSecretArchiveInternal)SecretArchive).UseKeyVault; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterSecretArchiveInternal)SecretArchive).UseKeyVault = value ?? null; } + + /// Backing field for property. + private string _supportExpiryDate; + + /// The support end date of the runtime version of the cluster. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string SupportExpiryDate { get => this._supportExpiryDate; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterUpdateStrategy _updateStrategy; + + /// The strategy for updating the cluster. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterUpdateStrategy UpdateStrategy { get => (this._updateStrategy = this._updateStrategy ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterUpdateStrategy()); set => this._updateStrategy = value; } + + /// + /// The maximum number of worker nodes that can be offline within the increment of update, e.g., rack-by-rack. + /// Limited by the maximum number of machines in the increment. Defaults to the whole increment size. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public long? UpdateStrategyMaxUnavailable { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterUpdateStrategyInternal)UpdateStrategy).MaxUnavailable; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterUpdateStrategyInternal)UpdateStrategy).MaxUnavailable = value ?? default(long); } + + /// Selection of how the threshold should be evaluated. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string UpdateStrategyThresholdType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterUpdateStrategyInternal)UpdateStrategy).ThresholdType; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterUpdateStrategyInternal)UpdateStrategy).ThresholdType = value ?? null; } + + /// The numeric threshold value. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public long? UpdateStrategyThresholdValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterUpdateStrategyInternal)UpdateStrategy).ThresholdValue; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterUpdateStrategyInternal)UpdateStrategy).ThresholdValue = value ?? default(long); } + + /// The mode of operation for runtime protection. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string UpdateStrategyType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterUpdateStrategyInternal)UpdateStrategy).StrategyType; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterUpdateStrategyInternal)UpdateStrategy).StrategyType = value ?? null; } + + /// The time to wait between the increments of update defined by the strategy. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public long? UpdateStrategyWaitTimeMinute { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterUpdateStrategyInternal)UpdateStrategy).WaitTimeMinute; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterUpdateStrategyInternal)UpdateStrategy).WaitTimeMinute = value ?? default(long); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVulnerabilityScanningSettings _vulnerabilityScanningSetting; + + /// The settings for how security vulnerability scanning is applied to the cluster. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVulnerabilityScanningSettings VulnerabilityScanningSetting { get => (this._vulnerabilityScanningSetting = this._vulnerabilityScanningSetting ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.VulnerabilityScanningSettings()); set => this._vulnerabilityScanningSetting = value; } + + /// The mode selection for container vulnerability scanning. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string VulnerabilityScanningSettingContainerScan { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVulnerabilityScanningSettingsInternal)VulnerabilityScanningSetting).ContainerScan; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVulnerabilityScanningSettingsInternal)VulnerabilityScanningSetting).ContainerScan = value ?? null; } + + /// Backing field for property. + private System.Collections.Generic.List _workloadResourceId; + + /// The list of workload resource IDs that are hosted within this cluster. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public System.Collections.Generic.List WorkloadResourceId { get => this._workloadResourceId; } + + /// Creates an new instance. + public ClusterProperties() + { + + } + } + /// ClusterProperties represents the properties of a cluster. + public partial interface IClusterProperties : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable + { + /// + /// The zone name used for this rack when created. Availability zones are used for workload placement. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The zone name used for this rack when created. Availability zones are used for workload placement.", + SerializedName = @"availabilityZone", + PossibleTypes = new [] { typeof(string) })] + string AggregatorOrSingleRackDefinitionAvailabilityZone { get; set; } + /// The unordered list of bare metal machine configuration. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The unordered list of bare metal machine configuration.", + SerializedName = @"bareMetalMachineConfigurationData", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineConfigurationData) })] + System.Collections.Generic.List AggregatorOrSingleRackDefinitionBareMetalMachineConfigurationData { get; set; } + /// The resource ID of the network rack that matches this rack definition. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The resource ID of the network rack that matches this rack definition.", + SerializedName = @"networkRackId", + PossibleTypes = new [] { typeof(string) })] + string AggregatorOrSingleRackDefinitionNetworkRackId { get; set; } + /// The free-form description of the rack's location. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The free-form description of the rack's location.", + SerializedName = @"rackLocation", + PossibleTypes = new [] { typeof(string) })] + string AggregatorOrSingleRackDefinitionRackLocation { get; set; } + /// + /// The unique identifier for the rack within Network Cloud cluster. An alternate unique alphanumeric value other than a serial + /// number may be provided if desired. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The unique identifier for the rack within Network Cloud cluster. An alternate unique alphanumeric value other than a serial number may be provided if desired.", + SerializedName = @"rackSerialNumber", + PossibleTypes = new [] { typeof(string) })] + string AggregatorOrSingleRackDefinitionRackSerialNumber { get; set; } + /// The resource ID of the sku for the rack being added. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The resource ID of the sku for the rack being added.", + SerializedName = @"rackSkuId", + PossibleTypes = new [] { typeof(string) })] + string AggregatorOrSingleRackDefinitionRackSkuId { get; set; } + /// The list of storage appliance configuration data for this rack. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The list of storage appliance configuration data for this rack.", + SerializedName = @"storageApplianceConfigurationData", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceConfigurationData) })] + System.Collections.Generic.List AggregatorOrSingleRackDefinitionStorageApplianceConfigurationData { get; set; } + /// + /// The resource ID of the analytics workspace that is to be used by the specified identity. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The resource ID of the analytics workspace that is to be used by the specified identity.", + SerializedName = @"analyticsWorkspaceId", + PossibleTypes = new [] { typeof(string) })] + string AnalyticOutputSettingAnalyticsWorkspaceId { get; set; } + /// The type of managed identity that is being selected. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The type of managed identity that is being selected.", + SerializedName = @"identityType", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("SystemAssignedIdentity", "UserAssignedIdentity")] + string AnalyticsOutputSettingsAssociatedIdentityType { get; set; } + /// + /// The user assigned managed identity resource ID to use. Mutually exclusive with a system assigned identity type. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The user assigned managed identity resource ID to use. Mutually exclusive with a system assigned identity type.", + SerializedName = @"userAssignedIdentityResourceId", + PossibleTypes = new [] { typeof(string) })] + string AnalyticsOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId { get; set; } + /// + /// Field Deprecated. The resource ID of the Log Analytics Workspace that will be used for storing relevant logs. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"Field Deprecated. The resource ID of the Log Analytics Workspace that will be used for storing relevant logs.", + SerializedName = @"analyticsWorkspaceId", + PossibleTypes = new [] { typeof(string) })] + string AnalyticsWorkspaceId { get; set; } + /// The list of cluster runtime version upgrades available for this cluster. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The list of cluster runtime version upgrades available for this cluster.", + SerializedName = @"availableUpgradeVersions", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterAvailableUpgradeVersion) })] + System.Collections.Generic.List AvailableUpgradeVersion { get; } + /// + /// The remaining appliance-based storage in GB available for workload use. Measured in gibibytes. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The remaining appliance-based storage in GB available for workload use. Measured in gibibytes.", + SerializedName = @"availableApplianceStorageGB", + PossibleTypes = new [] { typeof(long) })] + long? ClusterCapacityAvailableApplianceStorageGb { get; } + /// + /// The remaining number of cores that are available in this cluster for workload use. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The remaining number of cores that are available in this cluster for workload use.", + SerializedName = @"availableCoreCount", + PossibleTypes = new [] { typeof(long) })] + long? ClusterCapacityAvailableCoreCount { get; } + /// + /// The remaining machine or host-based storage in GB available for workload use. Measured in gibibytes. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The remaining machine or host-based storage in GB available for workload use. Measured in gibibytes.", + SerializedName = @"availableHostStorageGB", + PossibleTypes = new [] { typeof(long) })] + long? ClusterCapacityAvailableHostStorageGb { get; } + /// + /// The remaining memory in GB that are available in this cluster for workload use. Measured in gibibytes. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The remaining memory in GB that are available in this cluster for workload use. Measured in gibibytes.", + SerializedName = @"availableMemoryGB", + PossibleTypes = new [] { typeof(long) })] + long? ClusterCapacityAvailableMemoryGb { get; } + /// + /// The total appliance-based storage in GB supported by this cluster for workload use. Measured in gibibytes. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The total appliance-based storage in GB supported by this cluster for workload use. Measured in gibibytes.", + SerializedName = @"totalApplianceStorageGB", + PossibleTypes = new [] { typeof(long) })] + long? ClusterCapacityTotalApplianceStorageGb { get; } + /// The total number of cores that are supported by this cluster for workload use. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The total number of cores that are supported by this cluster for workload use.", + SerializedName = @"totalCoreCount", + PossibleTypes = new [] { typeof(long) })] + long? ClusterCapacityTotalCoreCount { get; } + /// + /// The total machine or host-based storage in GB supported by this cluster for workload use. Measured in gibibytes. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The total machine or host-based storage in GB supported by this cluster for workload use. Measured in gibibytes.", + SerializedName = @"totalHostStorageGB", + PossibleTypes = new [] { typeof(long) })] + long? ClusterCapacityTotalHostStorageGb { get; } + /// + /// The total memory supported by this cluster for workload use. Measured in gibibytes. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The total memory supported by this cluster for workload use. Measured in gibibytes.", + SerializedName = @"totalMemoryGB", + PossibleTypes = new [] { typeof(long) })] + long? ClusterCapacityTotalMemoryGb { get; } + /// The latest heartbeat status between the cluster manager and the cluster. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The latest heartbeat status between the cluster manager and the cluster.", + SerializedName = @"clusterConnectionStatus", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Connected", "Disconnected", "Timeout", "Undefined")] + string ClusterConnectionStatus { get; } + /// The resource ID of the extended location on which the resource will be created. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The resource ID of the extended location on which the resource will be created.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string ClusterExtendedLocationName { get; } + /// The extended location type, for example, CustomLocation. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The extended location type, for example, CustomLocation.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + string ClusterExtendedLocationType { get; } + /// + /// The customer-provided location information to identify where the cluster resides. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The customer-provided location information to identify where the cluster resides.", + SerializedName = @"clusterLocation", + PossibleTypes = new [] { typeof(string) })] + string ClusterLocation { get; set; } + /// The latest connectivity status between cluster manager and the cluster. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The latest connectivity status between cluster manager and the cluster.", + SerializedName = @"clusterManagerConnectionStatus", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Connected", "Unreachable")] + string ClusterManagerConnectionStatus { get; } + /// + /// The resource ID of the cluster manager that manages this cluster. This is set by the Cluster Manager when the cluster + /// is created. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The resource ID of the cluster manager that manages this cluster. This is set by the Cluster Manager when the cluster is created.", + SerializedName = @"clusterManagerId", + PossibleTypes = new [] { typeof(string) })] + string ClusterManagerId { get; } + /// The application ID, also known as client ID, of the service principal. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The application ID, also known as client ID, of the service principal.", + SerializedName = @"applicationId", + PossibleTypes = new [] { typeof(string) })] + string ClusterServicePrincipalApplicationId { get; set; } + /// The principal ID, also known as the object ID, of the service principal. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The principal ID, also known as the object ID, of the service principal.", + SerializedName = @"principalId", + PossibleTypes = new [] { typeof(string) })] + string ClusterServicePrincipalId { get; set; } + /// The password of the service principal. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The password of the service principal.", + SerializedName = @"password", + PossibleTypes = new [] { typeof(System.Security.SecureString) })] + System.Security.SecureString ClusterServicePrincipalPassword { get; set; } + /// + /// The tenant ID, also known as the directory ID, of the tenant in which the service principal is created. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The tenant ID, also known as the directory ID, of the tenant in which the service principal is created.", + SerializedName = @"tenantId", + PossibleTypes = new [] { typeof(string) })] + string ClusterServicePrincipalTenantId { get; set; } + /// The type of rack configuration for the cluster. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The type of rack configuration for the cluster.", + SerializedName = @"clusterType", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("SingleRack", "MultiRack")] + string ClusterType { get; set; } + /// The current runtime version of the cluster. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The current runtime version of the cluster.", + SerializedName = @"clusterVersion", + PossibleTypes = new [] { typeof(string) })] + string ClusterVersion { get; set; } + /// + /// The URL of the storage account container that is to be used by the specified identities. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The URL of the storage account container that is to be used by the specified identities.", + SerializedName = @"containerUrl", + PossibleTypes = new [] { typeof(string) })] + string CommandOutputSettingContainerUrl { get; set; } + /// The type of managed identity that is being selected. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The type of managed identity that is being selected.", + SerializedName = @"identityType", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("SystemAssignedIdentity", "UserAssignedIdentity")] + string CommandOutputSettingsAssociatedIdentityType { get; set; } + /// + /// The user assigned managed identity resource ID to use. Mutually exclusive with a system assigned identity type. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The user assigned managed identity resource ID to use. Mutually exclusive with a system assigned identity type.", + SerializedName = @"userAssignedIdentityResourceId", + PossibleTypes = new [] { typeof(string) })] + string CommandOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId { get; set; } + /// Selection of how the type evaluation is applied to the cluster calculation. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"Selection of how the type evaluation is applied to the cluster calculation.", + SerializedName = @"grouping", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("PerCluster", "PerRack")] + string ComputeDeploymentThresholdGrouping { get; set; } + /// Selection of how the threshold should be evaluated. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"Selection of how the threshold should be evaluated.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("CountSuccess", "PercentSuccess")] + string ComputeDeploymentThresholdType { get; set; } + /// The numeric threshold value. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The numeric threshold value.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(long) })] + long? ComputeDeploymentThresholdValue { get; set; } + /// + /// The list of rack definitions for the compute racks in a multi-rack cluster, or an empty list in a single-rack cluster. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The list of rack definitions for the compute racks in a multi-rack cluster, or an empty list in a single-rack cluster.", + SerializedName = @"computeRackDefinitions", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackDefinition) })] + System.Collections.Generic.List ComputeRackDefinition { get; set; } + /// The current detailed status of the cluster. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The current detailed status of the cluster.", + SerializedName = @"detailedStatus", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("PendingDeployment", "Deploying", "Running", "Updating", "UpdatePaused", "Degraded", "Deleting", "Disconnected", "Failed")] + string DetailedStatus { get; } + /// The descriptive message about the detailed status. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The descriptive message about the detailed status.", + SerializedName = @"detailedStatusMessage", + PossibleTypes = new [] { typeof(string) })] + string DetailedStatusMessage { get; } + /// The resource ID of the extended location on which the resource will be created. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The resource ID of the extended location on which the resource will be created.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string HybridAkExtendedLocationName { get; } + /// The extended location type, for example, CustomLocation. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The extended location type, for example, CustomLocation.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + string HybridAkExtendedLocationType { get; } + /// + /// The location of the managed resource group. If not specified, the location of the parent resource is chosen. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The location of the managed resource group. If not specified, the location of the parent resource is chosen.", + SerializedName = @"location", + PossibleTypes = new [] { typeof(string) })] + string ManagedResourceGroupConfigurationLocation { get; set; } + /// + /// The name for the managed resource group. If not specified, the unique name is automatically generated. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The name for the managed resource group. If not specified, the unique name is automatically generated.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string ManagedResourceGroupConfigurationName { get; set; } + /// The count of Manual Action Taken (MAT) events that have not been validated. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The count of Manual Action Taken (MAT) events that have not been validated.", + SerializedName = @"manualActionCount", + PossibleTypes = new [] { typeof(long) })] + long? ManualActionCount { get; } + /// The resource ID of the Network Fabric associated with the cluster. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The resource ID of the Network Fabric associated with the cluster.", + SerializedName = @"networkFabricId", + PossibleTypes = new [] { typeof(string) })] + string NetworkFabricId { get; set; } + /// The provisioning state of the cluster. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The provisioning state of the cluster.", + SerializedName = @"provisioningState", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Succeeded", "Failed", "Canceled", "Accepted", "Validating", "Updating")] + string ProvisioningState { get; } + /// The mode of operation for runtime protection. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The mode of operation for runtime protection.", + SerializedName = @"enforcementLevel", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Audit", "Disabled", "OnDemand", "Passive", "RealTime")] + string RuntimeProtectionConfigurationEnforcementLevel { get; set; } + /// The resource ID of the key vault to archive the secrets of the cluster. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The resource ID of the key vault to archive the secrets of the cluster.", + SerializedName = @"keyVaultId", + PossibleTypes = new [] { typeof(string) })] + string SecretArchiveKeyVaultId { get; set; } + /// The URI for the key vault used as the secret archive. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The URI for the key vault used as the secret archive.", + SerializedName = @"vaultUri", + PossibleTypes = new [] { typeof(string) })] + string SecretArchiveSettingVaultUri { get; set; } + /// The type of managed identity that is being selected. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The type of managed identity that is being selected.", + SerializedName = @"identityType", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("SystemAssignedIdentity", "UserAssignedIdentity")] + string SecretArchiveSettingsAssociatedIdentityType { get; set; } + /// + /// The user assigned managed identity resource ID to use. Mutually exclusive with a system assigned identity type. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The user assigned managed identity resource ID to use. Mutually exclusive with a system assigned identity type.", + SerializedName = @"userAssignedIdentityResourceId", + PossibleTypes = new [] { typeof(string) })] + string SecretArchiveSettingsAssociatedIdentityUserAssignedIdentityResourceId { get; set; } + /// + /// The indicator if the specified key vault should be used to archive the secrets of the cluster. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The indicator if the specified key vault should be used to archive the secrets of the cluster.", + SerializedName = @"useKeyVault", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("True", "False")] + string SecretArchiveUseKeyVault { get; set; } + /// The support end date of the runtime version of the cluster. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The support end date of the runtime version of the cluster.", + SerializedName = @"supportExpiryDate", + PossibleTypes = new [] { typeof(string) })] + string SupportExpiryDate { get; } + /// + /// The maximum number of worker nodes that can be offline within the increment of update, e.g., rack-by-rack. + /// Limited by the maximum number of machines in the increment. Defaults to the whole increment size. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The maximum number of worker nodes that can be offline within the increment of update, e.g., rack-by-rack. + Limited by the maximum number of machines in the increment. Defaults to the whole increment size.", + SerializedName = @"maxUnavailable", + PossibleTypes = new [] { typeof(long) })] + long? UpdateStrategyMaxUnavailable { get; set; } + /// Selection of how the threshold should be evaluated. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"Selection of how the threshold should be evaluated.", + SerializedName = @"thresholdType", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("CountSuccess", "PercentSuccess")] + string UpdateStrategyThresholdType { get; set; } + /// The numeric threshold value. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The numeric threshold value.", + SerializedName = @"thresholdValue", + PossibleTypes = new [] { typeof(long) })] + long? UpdateStrategyThresholdValue { get; set; } + /// The mode of operation for runtime protection. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The mode of operation for runtime protection.", + SerializedName = @"strategyType", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Rack", "PauseAfterRack")] + string UpdateStrategyType { get; set; } + /// The time to wait between the increments of update defined by the strategy. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The time to wait between the increments of update defined by the strategy.", + SerializedName = @"waitTimeMinutes", + PossibleTypes = new [] { typeof(long) })] + long? UpdateStrategyWaitTimeMinute { get; set; } + /// The mode selection for container vulnerability scanning. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The mode selection for container vulnerability scanning.", + SerializedName = @"containerScan", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Disabled", "Enabled")] + string VulnerabilityScanningSettingContainerScan { get; set; } + /// The list of workload resource IDs that are hosted within this cluster. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The list of workload resource IDs that are hosted within this cluster.", + SerializedName = @"workloadResourceIds", + PossibleTypes = new [] { typeof(string) })] + System.Collections.Generic.List WorkloadResourceId { get; } + + } + /// ClusterProperties represents the properties of a cluster. + internal partial interface IClusterPropertiesInternal + + { + /// + /// The rack definition that is intended to reflect only a single rack in a single rack cluster, or an aggregator rack in + /// a multi-rack cluster. + /// + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackDefinition AggregatorOrSingleRackDefinition { get; set; } + /// + /// The zone name used for this rack when created. Availability zones are used for workload placement. + /// + string AggregatorOrSingleRackDefinitionAvailabilityZone { get; set; } + /// The unordered list of bare metal machine configuration. + System.Collections.Generic.List AggregatorOrSingleRackDefinitionBareMetalMachineConfigurationData { get; set; } + /// The resource ID of the network rack that matches this rack definition. + string AggregatorOrSingleRackDefinitionNetworkRackId { get; set; } + /// The free-form description of the rack's location. + string AggregatorOrSingleRackDefinitionRackLocation { get; set; } + /// + /// The unique identifier for the rack within Network Cloud cluster. An alternate unique alphanumeric value other than a serial + /// number may be provided if desired. + /// + string AggregatorOrSingleRackDefinitionRackSerialNumber { get; set; } + /// The resource ID of the sku for the rack being added. + string AggregatorOrSingleRackDefinitionRackSkuId { get; set; } + /// The list of storage appliance configuration data for this rack. + System.Collections.Generic.List AggregatorOrSingleRackDefinitionStorageApplianceConfigurationData { get; set; } + /// + /// The resource ID of the analytics workspace that is to be used by the specified identity. + /// + string AnalyticOutputSettingAnalyticsWorkspaceId { get; set; } + /// + /// The selection of the managed identity to use with this analytics workspace. The identity type must be either system assigned + /// or user assigned. + /// + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IIdentitySelector AnalyticOutputSettingAssociatedIdentity { get; set; } + /// + /// The settings for the log analytics workspace used for output of logs from this cluster. + /// + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAnalyticsOutputSettings AnalyticsOutputSetting { get; set; } + /// The type of managed identity that is being selected. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("SystemAssignedIdentity", "UserAssignedIdentity")] + string AnalyticsOutputSettingsAssociatedIdentityType { get; set; } + /// + /// The user assigned managed identity resource ID to use. Mutually exclusive with a system assigned identity type. + /// + string AnalyticsOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId { get; set; } + /// + /// Field Deprecated. The resource ID of the Log Analytics Workspace that will be used for storing relevant logs. + /// + string AnalyticsWorkspaceId { get; set; } + /// The list of cluster runtime version upgrades available for this cluster. + System.Collections.Generic.List AvailableUpgradeVersion { get; set; } + /// The capacity supported by this cluster. + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterCapacity ClusterCapacity { get; set; } + /// + /// The remaining appliance-based storage in GB available for workload use. Measured in gibibytes. + /// + long? ClusterCapacityAvailableApplianceStorageGb { get; set; } + /// + /// The remaining number of cores that are available in this cluster for workload use. + /// + long? ClusterCapacityAvailableCoreCount { get; set; } + /// + /// The remaining machine or host-based storage in GB available for workload use. Measured in gibibytes. + /// + long? ClusterCapacityAvailableHostStorageGb { get; set; } + /// + /// The remaining memory in GB that are available in this cluster for workload use. Measured in gibibytes. + /// + long? ClusterCapacityAvailableMemoryGb { get; set; } + /// + /// The total appliance-based storage in GB supported by this cluster for workload use. Measured in gibibytes. + /// + long? ClusterCapacityTotalApplianceStorageGb { get; set; } + /// The total number of cores that are supported by this cluster for workload use. + long? ClusterCapacityTotalCoreCount { get; set; } + /// + /// The total machine or host-based storage in GB supported by this cluster for workload use. Measured in gibibytes. + /// + long? ClusterCapacityTotalHostStorageGb { get; set; } + /// + /// The total memory supported by this cluster for workload use. Measured in gibibytes. + /// + long? ClusterCapacityTotalMemoryGb { get; set; } + /// The latest heartbeat status between the cluster manager and the cluster. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Connected", "Disconnected", "Timeout", "Undefined")] + string ClusterConnectionStatus { get; set; } + /// + /// The extended location (custom location) that represents the cluster's control plane location. This extended location is + /// used to route the requests of child objects of the cluster that are handled by the platform operator. + /// + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocation ClusterExtendedLocation { get; set; } + /// The resource ID of the extended location on which the resource will be created. + string ClusterExtendedLocationName { get; set; } + /// The extended location type, for example, CustomLocation. + string ClusterExtendedLocationType { get; set; } + /// + /// The customer-provided location information to identify where the cluster resides. + /// + string ClusterLocation { get; set; } + /// The latest connectivity status between cluster manager and the cluster. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Connected", "Unreachable")] + string ClusterManagerConnectionStatus { get; set; } + /// + /// The resource ID of the cluster manager that manages this cluster. This is set by the Cluster Manager when the cluster + /// is created. + /// + string ClusterManagerId { get; set; } + /// + /// The service principal to be used by the cluster during Arc Appliance installation. + /// + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IServicePrincipalInformation ClusterServicePrincipal { get; set; } + /// The application ID, also known as client ID, of the service principal. + string ClusterServicePrincipalApplicationId { get; set; } + /// The principal ID, also known as the object ID, of the service principal. + string ClusterServicePrincipalId { get; set; } + /// The password of the service principal. + System.Security.SecureString ClusterServicePrincipalPassword { get; set; } + /// + /// The tenant ID, also known as the directory ID, of the tenant in which the service principal is created. + /// + string ClusterServicePrincipalTenantId { get; set; } + /// The type of rack configuration for the cluster. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("SingleRack", "MultiRack")] + string ClusterType { get; set; } + /// The current runtime version of the cluster. + string ClusterVersion { get; set; } + /// + /// The settings for commands run in this cluster, such as bare metal machine run read only commands and data extracts. + /// + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICommandOutputSettings CommandOutputSetting { get; set; } + /// + /// The selection of the managed identity to use with this storage account container. The identity type must be either system + /// assigned or user assigned. + /// + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IIdentitySelector CommandOutputSettingAssociatedIdentity { get; set; } + /// + /// The URL of the storage account container that is to be used by the specified identities. + /// + string CommandOutputSettingContainerUrl { get; set; } + /// The type of managed identity that is being selected. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("SystemAssignedIdentity", "UserAssignedIdentity")] + string CommandOutputSettingsAssociatedIdentityType { get; set; } + /// + /// The user assigned managed identity resource ID to use. Mutually exclusive with a system assigned identity type. + /// + string CommandOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId { get; set; } + /// + /// The validation threshold indicating the allowable failures of compute machines during environment validation and deployment. + /// + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IValidationThreshold ComputeDeploymentThreshold { get; set; } + /// Selection of how the type evaluation is applied to the cluster calculation. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("PerCluster", "PerRack")] + string ComputeDeploymentThresholdGrouping { get; set; } + /// Selection of how the threshold should be evaluated. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("CountSuccess", "PercentSuccess")] + string ComputeDeploymentThresholdType { get; set; } + /// The numeric threshold value. + long? ComputeDeploymentThresholdValue { get; set; } + /// + /// The list of rack definitions for the compute racks in a multi-rack cluster, or an empty list in a single-rack cluster. + /// + System.Collections.Generic.List ComputeRackDefinition { get; set; } + /// The current detailed status of the cluster. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("PendingDeployment", "Deploying", "Running", "Updating", "UpdatePaused", "Degraded", "Deleting", "Disconnected", "Failed")] + string DetailedStatus { get; set; } + /// The descriptive message about the detailed status. + string DetailedStatusMessage { get; set; } + /// The resource ID of the extended location on which the resource will be created. + string HybridAkExtendedLocationName { get; set; } + /// The extended location type, for example, CustomLocation. + string HybridAkExtendedLocationType { get; set; } + /// + /// Field Deprecated. This field will not be populated in an upcoming version. The extended location (custom location) that + /// represents the Hybrid AKS control plane location. This extended location is used when creating provisioned clusters (Hybrid + /// AKS clusters). + /// + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocation HybridAksExtendedLocation { get; set; } + /// The configuration of the managed resource group associated with the resource. + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IManagedResourceGroupConfiguration ManagedResourceGroupConfiguration { get; set; } + /// + /// The location of the managed resource group. If not specified, the location of the parent resource is chosen. + /// + string ManagedResourceGroupConfigurationLocation { get; set; } + /// + /// The name for the managed resource group. If not specified, the unique name is automatically generated. + /// + string ManagedResourceGroupConfigurationName { get; set; } + /// The count of Manual Action Taken (MAT) events that have not been validated. + long? ManualActionCount { get; set; } + /// The resource ID of the Network Fabric associated with the cluster. + string NetworkFabricId { get; set; } + /// The provisioning state of the cluster. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Succeeded", "Failed", "Canceled", "Accepted", "Validating", "Updating")] + string ProvisioningState { get; set; } + /// The settings for cluster runtime protection. + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRuntimeProtectionConfiguration RuntimeProtectionConfiguration { get; set; } + /// The mode of operation for runtime protection. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Audit", "Disabled", "OnDemand", "Passive", "RealTime")] + string RuntimeProtectionConfigurationEnforcementLevel { get; set; } + /// + /// The configuration for use of a key vault to store secrets for later retrieval by the operator. + /// + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterSecretArchive SecretArchive { get; set; } + /// The resource ID of the key vault to archive the secrets of the cluster. + string SecretArchiveKeyVaultId { get; set; } + /// The settings for the secret archive used to hold credentials for the cluster. + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISecretArchiveSettings SecretArchiveSetting { get; set; } + /// + /// The selection of the managed identity to use with this vault URI. The identity type must be either system assigned or + /// user assigned. + /// + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IIdentitySelector SecretArchiveSettingAssociatedIdentity { get; set; } + /// The URI for the key vault used as the secret archive. + string SecretArchiveSettingVaultUri { get; set; } + /// The type of managed identity that is being selected. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("SystemAssignedIdentity", "UserAssignedIdentity")] + string SecretArchiveSettingsAssociatedIdentityType { get; set; } + /// + /// The user assigned managed identity resource ID to use. Mutually exclusive with a system assigned identity type. + /// + string SecretArchiveSettingsAssociatedIdentityUserAssignedIdentityResourceId { get; set; } + /// + /// The indicator if the specified key vault should be used to archive the secrets of the cluster. + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("True", "False")] + string SecretArchiveUseKeyVault { get; set; } + /// The support end date of the runtime version of the cluster. + string SupportExpiryDate { get; set; } + /// The strategy for updating the cluster. + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterUpdateStrategy UpdateStrategy { get; set; } + /// + /// The maximum number of worker nodes that can be offline within the increment of update, e.g., rack-by-rack. + /// Limited by the maximum number of machines in the increment. Defaults to the whole increment size. + /// + long? UpdateStrategyMaxUnavailable { get; set; } + /// Selection of how the threshold should be evaluated. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("CountSuccess", "PercentSuccess")] + string UpdateStrategyThresholdType { get; set; } + /// The numeric threshold value. + long? UpdateStrategyThresholdValue { get; set; } + /// The mode of operation for runtime protection. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Rack", "PauseAfterRack")] + string UpdateStrategyType { get; set; } + /// The time to wait between the increments of update defined by the strategy. + long? UpdateStrategyWaitTimeMinute { get; set; } + /// The settings for how security vulnerability scanning is applied to the cluster. + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVulnerabilityScanningSettings VulnerabilityScanningSetting { get; set; } + /// The mode selection for container vulnerability scanning. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Disabled", "Enabled")] + string VulnerabilityScanningSettingContainerScan { get; set; } + /// The list of workload resource IDs that are hosted within this cluster. + System.Collections.Generic.List WorkloadResourceId { get; set; } + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterProperties.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterProperties.json.cs similarity index 76% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterProperties.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterProperties.json.cs index e44614eced00..8fd0a47cb4f7 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterProperties.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterProperties.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -65,47 +65,47 @@ internal ClusterProperties(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runti { return; } - {_aggregatorOrSingleRackDefinition = If( json?.PropertyT("aggregatorOrSingleRackDefinition"), out var __jsonAggregatorOrSingleRackDefinition) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.RackDefinition.FromJson(__jsonAggregatorOrSingleRackDefinition) : AggregatorOrSingleRackDefinition;} - {_analyticsOutputSetting = If( json?.PropertyT("analyticsOutputSettings"), out var __jsonAnalyticsOutputSettings) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AnalyticsOutputSettings.FromJson(__jsonAnalyticsOutputSettings) : AnalyticsOutputSetting;} - {_clusterCapacity = If( json?.PropertyT("clusterCapacity"), out var __jsonClusterCapacity) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ClusterCapacity.FromJson(__jsonClusterCapacity) : ClusterCapacity;} - {_clusterExtendedLocation = If( json?.PropertyT("clusterExtendedLocation"), out var __jsonClusterExtendedLocation) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ExtendedLocation.FromJson(__jsonClusterExtendedLocation) : ClusterExtendedLocation;} - {_clusterServicePrincipal = If( json?.PropertyT("clusterServicePrincipal"), out var __jsonClusterServicePrincipal) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ServicePrincipalInformation.FromJson(__jsonClusterServicePrincipal) : ClusterServicePrincipal;} - {_commandOutputSetting = If( json?.PropertyT("commandOutputSettings"), out var __jsonCommandOutputSettings) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.CommandOutputSettings.FromJson(__jsonCommandOutputSettings) : CommandOutputSetting;} - {_computeDeploymentThreshold = If( json?.PropertyT("computeDeploymentThreshold"), out var __jsonComputeDeploymentThreshold) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ValidationThreshold.FromJson(__jsonComputeDeploymentThreshold) : ComputeDeploymentThreshold;} - {_hybridAksExtendedLocation = If( json?.PropertyT("hybridAksExtendedLocation"), out var __jsonHybridAksExtendedLocation) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ExtendedLocation.FromJson(__jsonHybridAksExtendedLocation) : HybridAksExtendedLocation;} - {_managedResourceGroupConfiguration = If( json?.PropertyT("managedResourceGroupConfiguration"), out var __jsonManagedResourceGroupConfiguration) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ManagedResourceGroupConfiguration.FromJson(__jsonManagedResourceGroupConfiguration) : ManagedResourceGroupConfiguration;} - {_runtimeProtectionConfiguration = If( json?.PropertyT("runtimeProtectionConfiguration"), out var __jsonRuntimeProtectionConfiguration) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.RuntimeProtectionConfiguration.FromJson(__jsonRuntimeProtectionConfiguration) : RuntimeProtectionConfiguration;} - {_secretArchive = If( json?.PropertyT("secretArchive"), out var __jsonSecretArchive) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ClusterSecretArchive.FromJson(__jsonSecretArchive) : SecretArchive;} - {_secretArchiveSetting = If( json?.PropertyT("secretArchiveSettings"), out var __jsonSecretArchiveSettings) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.SecretArchiveSettings.FromJson(__jsonSecretArchiveSettings) : SecretArchiveSetting;} - {_updateStrategy = If( json?.PropertyT("updateStrategy"), out var __jsonUpdateStrategy) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ClusterUpdateStrategy.FromJson(__jsonUpdateStrategy) : UpdateStrategy;} - {_vulnerabilityScanningSetting = If( json?.PropertyT("vulnerabilityScanningSettings"), out var __jsonVulnerabilityScanningSettings) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.VulnerabilityScanningSettings.FromJson(__jsonVulnerabilityScanningSettings) : VulnerabilityScanningSetting;} - {_analyticsWorkspaceId = If( json?.PropertyT("analyticsWorkspaceId"), out var __jsonAnalyticsWorkspaceId) ? (string)__jsonAnalyticsWorkspaceId : (string)AnalyticsWorkspaceId;} - {_availableUpgradeVersion = If( json?.PropertyT("availableUpgradeVersions"), out var __jsonAvailableUpgradeVersions) ? If( __jsonAvailableUpgradeVersions as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IClusterAvailableUpgradeVersion) (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ClusterAvailableUpgradeVersion.FromJson(__u) )) ))() : null : AvailableUpgradeVersion;} - {_clusterConnectionStatus = If( json?.PropertyT("clusterConnectionStatus"), out var __jsonClusterConnectionStatus) ? (string)__jsonClusterConnectionStatus : (string)ClusterConnectionStatus;} - {_clusterLocation = If( json?.PropertyT("clusterLocation"), out var __jsonClusterLocation) ? (string)__jsonClusterLocation : (string)ClusterLocation;} - {_clusterManagerConnectionStatus = If( json?.PropertyT("clusterManagerConnectionStatus"), out var __jsonClusterManagerConnectionStatus) ? (string)__jsonClusterManagerConnectionStatus : (string)ClusterManagerConnectionStatus;} - {_clusterManagerId = If( json?.PropertyT("clusterManagerId"), out var __jsonClusterManagerId) ? (string)__jsonClusterManagerId : (string)ClusterManagerId;} - {_clusterType = If( json?.PropertyT("clusterType"), out var __jsonClusterType) ? (string)__jsonClusterType : (string)ClusterType;} - {_clusterVersion = If( json?.PropertyT("clusterVersion"), out var __jsonClusterVersion) ? (string)__jsonClusterVersion : (string)ClusterVersion;} - {_computeRackDefinition = If( json?.PropertyT("computeRackDefinitions"), out var __jsonComputeRackDefinitions) ? If( __jsonComputeRackDefinitions as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IRackDefinition) (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.RackDefinition.FromJson(__p) )) ))() : null : ComputeRackDefinition;} - {_detailedStatus = If( json?.PropertyT("detailedStatus"), out var __jsonDetailedStatus) ? (string)__jsonDetailedStatus : (string)DetailedStatus;} - {_detailedStatusMessage = If( json?.PropertyT("detailedStatusMessage"), out var __jsonDetailedStatusMessage) ? (string)__jsonDetailedStatusMessage : (string)DetailedStatusMessage;} - {_manualActionCount = If( json?.PropertyT("manualActionCount"), out var __jsonManualActionCount) ? (long?)__jsonManualActionCount : ManualActionCount;} - {_networkFabricId = If( json?.PropertyT("networkFabricId"), out var __jsonNetworkFabricId) ? (string)__jsonNetworkFabricId : (string)NetworkFabricId;} - {_provisioningState = If( json?.PropertyT("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)ProvisioningState;} - {_supportExpiryDate = If( json?.PropertyT("supportExpiryDate"), out var __jsonSupportExpiryDate) ? (string)__jsonSupportExpiryDate : (string)SupportExpiryDate;} - {_workloadResourceId = If( json?.PropertyT("workloadResourceIds"), out var __jsonWorkloadResourceIds) ? If( __jsonWorkloadResourceIds as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Json.JsonString __j ? (string)(__j.ToString()) : null)) ))() : null : WorkloadResourceId;} + {_aggregatorOrSingleRackDefinition = If( json?.PropertyT("aggregatorOrSingleRackDefinition"), out var __jsonAggregatorOrSingleRackDefinition) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.RackDefinition.FromJson(__jsonAggregatorOrSingleRackDefinition) : _aggregatorOrSingleRackDefinition;} + {_analyticsOutputSetting = If( json?.PropertyT("analyticsOutputSettings"), out var __jsonAnalyticsOutputSettings) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AnalyticsOutputSettings.FromJson(__jsonAnalyticsOutputSettings) : _analyticsOutputSetting;} + {_clusterCapacity = If( json?.PropertyT("clusterCapacity"), out var __jsonClusterCapacity) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterCapacity.FromJson(__jsonClusterCapacity) : _clusterCapacity;} + {_clusterExtendedLocation = If( json?.PropertyT("clusterExtendedLocation"), out var __jsonClusterExtendedLocation) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ExtendedLocation.FromJson(__jsonClusterExtendedLocation) : _clusterExtendedLocation;} + {_clusterServicePrincipal = If( json?.PropertyT("clusterServicePrincipal"), out var __jsonClusterServicePrincipal) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ServicePrincipalInformation.FromJson(__jsonClusterServicePrincipal) : _clusterServicePrincipal;} + {_commandOutputSetting = If( json?.PropertyT("commandOutputSettings"), out var __jsonCommandOutputSettings) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.CommandOutputSettings.FromJson(__jsonCommandOutputSettings) : _commandOutputSetting;} + {_computeDeploymentThreshold = If( json?.PropertyT("computeDeploymentThreshold"), out var __jsonComputeDeploymentThreshold) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ValidationThreshold.FromJson(__jsonComputeDeploymentThreshold) : _computeDeploymentThreshold;} + {_hybridAksExtendedLocation = If( json?.PropertyT("hybridAksExtendedLocation"), out var __jsonHybridAksExtendedLocation) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ExtendedLocation.FromJson(__jsonHybridAksExtendedLocation) : _hybridAksExtendedLocation;} + {_managedResourceGroupConfiguration = If( json?.PropertyT("managedResourceGroupConfiguration"), out var __jsonManagedResourceGroupConfiguration) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ManagedResourceGroupConfiguration.FromJson(__jsonManagedResourceGroupConfiguration) : _managedResourceGroupConfiguration;} + {_runtimeProtectionConfiguration = If( json?.PropertyT("runtimeProtectionConfiguration"), out var __jsonRuntimeProtectionConfiguration) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.RuntimeProtectionConfiguration.FromJson(__jsonRuntimeProtectionConfiguration) : _runtimeProtectionConfiguration;} + {_secretArchive = If( json?.PropertyT("secretArchive"), out var __jsonSecretArchive) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterSecretArchive.FromJson(__jsonSecretArchive) : _secretArchive;} + {_secretArchiveSetting = If( json?.PropertyT("secretArchiveSettings"), out var __jsonSecretArchiveSettings) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.SecretArchiveSettings.FromJson(__jsonSecretArchiveSettings) : _secretArchiveSetting;} + {_updateStrategy = If( json?.PropertyT("updateStrategy"), out var __jsonUpdateStrategy) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterUpdateStrategy.FromJson(__jsonUpdateStrategy) : _updateStrategy;} + {_vulnerabilityScanningSetting = If( json?.PropertyT("vulnerabilityScanningSettings"), out var __jsonVulnerabilityScanningSettings) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.VulnerabilityScanningSettings.FromJson(__jsonVulnerabilityScanningSettings) : _vulnerabilityScanningSetting;} + {_analyticsWorkspaceId = If( json?.PropertyT("analyticsWorkspaceId"), out var __jsonAnalyticsWorkspaceId) ? (string)__jsonAnalyticsWorkspaceId : (string)_analyticsWorkspaceId;} + {_availableUpgradeVersion = If( json?.PropertyT("availableUpgradeVersions"), out var __jsonAvailableUpgradeVersions) ? If( __jsonAvailableUpgradeVersions as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.IClusterAvailableUpgradeVersion) (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterAvailableUpgradeVersion.FromJson(__u) )) ))() : null : _availableUpgradeVersion;} + {_clusterConnectionStatus = If( json?.PropertyT("clusterConnectionStatus"), out var __jsonClusterConnectionStatus) ? (string)__jsonClusterConnectionStatus : (string)_clusterConnectionStatus;} + {_clusterLocation = If( json?.PropertyT("clusterLocation"), out var __jsonClusterLocation) ? (string)__jsonClusterLocation : (string)_clusterLocation;} + {_clusterManagerConnectionStatus = If( json?.PropertyT("clusterManagerConnectionStatus"), out var __jsonClusterManagerConnectionStatus) ? (string)__jsonClusterManagerConnectionStatus : (string)_clusterManagerConnectionStatus;} + {_clusterManagerId = If( json?.PropertyT("clusterManagerId"), out var __jsonClusterManagerId) ? (string)__jsonClusterManagerId : (string)_clusterManagerId;} + {_clusterType = If( json?.PropertyT("clusterType"), out var __jsonClusterType) ? (string)__jsonClusterType : (string)_clusterType;} + {_clusterVersion = If( json?.PropertyT("clusterVersion"), out var __jsonClusterVersion) ? (string)__jsonClusterVersion : (string)_clusterVersion;} + {_computeRackDefinition = If( json?.PropertyT("computeRackDefinitions"), out var __jsonComputeRackDefinitions) ? If( __jsonComputeRackDefinitions as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.IRackDefinition) (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.RackDefinition.FromJson(__p) )) ))() : null : _computeRackDefinition;} + {_detailedStatus = If( json?.PropertyT("detailedStatus"), out var __jsonDetailedStatus) ? (string)__jsonDetailedStatus : (string)_detailedStatus;} + {_detailedStatusMessage = If( json?.PropertyT("detailedStatusMessage"), out var __jsonDetailedStatusMessage) ? (string)__jsonDetailedStatusMessage : (string)_detailedStatusMessage;} + {_manualActionCount = If( json?.PropertyT("manualActionCount"), out var __jsonManualActionCount) ? (long?)__jsonManualActionCount : _manualActionCount;} + {_networkFabricId = If( json?.PropertyT("networkFabricId"), out var __jsonNetworkFabricId) ? (string)__jsonNetworkFabricId : (string)_networkFabricId;} + {_provisioningState = If( json?.PropertyT("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)_provisioningState;} + {_supportExpiryDate = If( json?.PropertyT("supportExpiryDate"), out var __jsonSupportExpiryDate) ? (string)__jsonSupportExpiryDate : (string)_supportExpiryDate;} + {_workloadResourceId = If( json?.PropertyT("workloadResourceIds"), out var __jsonWorkloadResourceIds) ? If( __jsonWorkloadResourceIds as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Json.JsonString __j ? (string)(__j.ToString()) : null)) ))() : null : _workloadResourceId;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new ClusterProperties(json) : null; } @@ -131,18 +131,18 @@ public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode ToJ } AddIf( null != this._aggregatorOrSingleRackDefinition ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) this._aggregatorOrSingleRackDefinition.ToJson(null,serializationMode) : null, "aggregatorOrSingleRackDefinition" ,container.Add ); AddIf( null != this._analyticsOutputSetting ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) this._analyticsOutputSetting.ToJson(null,serializationMode) : null, "analyticsOutputSettings" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != this._clusterCapacity ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) this._clusterCapacity.ToJson(null,serializationMode) : null, "clusterCapacity" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != this._clusterExtendedLocation ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) this._clusterExtendedLocation.ToJson(null,serializationMode) : null, "clusterExtendedLocation" ,container.Add ); } AddIf( null != this._clusterServicePrincipal ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) this._clusterServicePrincipal.ToJson(null,serializationMode) : null, "clusterServicePrincipal" ,container.Add ); AddIf( null != this._commandOutputSetting ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) this._commandOutputSetting.ToJson(null,serializationMode) : null, "commandOutputSettings" ,container.Add ); AddIf( null != this._computeDeploymentThreshold ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) this._computeDeploymentThreshold.ToJson(null,serializationMode) : null, "computeDeploymentThreshold" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != this._hybridAksExtendedLocation ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) this._hybridAksExtendedLocation.ToJson(null,serializationMode) : null, "hybridAksExtendedLocation" ,container.Add ); } @@ -152,8 +152,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode ToJ AddIf( null != this._secretArchiveSetting ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) this._secretArchiveSetting.ToJson(null,serializationMode) : null, "secretArchiveSettings" ,container.Add ); AddIf( null != this._updateStrategy ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) this._updateStrategy.ToJson(null,serializationMode) : null, "updateStrategy" ,container.Add ); AddIf( null != this._vulnerabilityScanningSetting ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) this._vulnerabilityScanningSetting.ToJson(null,serializationMode) : null, "vulnerabilityScanningSettings" ,container.Add ); - AddIf( null != (((object)this._analyticsWorkspaceId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._analyticsWorkspaceId.ToString()) : null, "analyticsWorkspaceId" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)||serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate)) + { + AddIf( null != (((object)this._analyticsWorkspaceId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._analyticsWorkspaceId.ToString()) : null, "analyticsWorkspaceId" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { if (null != this._availableUpgradeVersion) { @@ -165,21 +168,27 @@ public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode ToJ container.Add("availableUpgradeVersions",__w); } } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._clusterConnectionStatus)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._clusterConnectionStatus.ToString()) : null, "clusterConnectionStatus" ,container.Add ); } AddIf( null != (((object)this._clusterLocation)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._clusterLocation.ToString()) : null, "clusterLocation" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._clusterManagerConnectionStatus)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._clusterManagerConnectionStatus.ToString()) : null, "clusterManagerConnectionStatus" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._clusterManagerId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._clusterManagerId.ToString()) : null, "clusterManagerId" ,container.Add ); } - AddIf( null != (((object)this._clusterType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._clusterType.ToString()) : null, "clusterType" ,container.Add ); - AddIf( null != (((object)this._clusterVersion)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._clusterVersion.ToString()) : null, "clusterVersion" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)||serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate)) + { + AddIf( null != (((object)this._clusterType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._clusterType.ToString()) : null, "clusterType" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)||serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate)) + { + AddIf( null != (((object)this._clusterVersion)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._clusterVersion.ToString()) : null, "clusterVersion" ,container.Add ); + } if (null != this._computeRackDefinition) { var __r = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.XNodeArray(); @@ -189,28 +198,31 @@ public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode ToJ } container.Add("computeRackDefinitions",__r); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._detailedStatus)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._detailedStatus.ToString()) : null, "detailedStatus" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._detailedStatusMessage)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._detailedStatusMessage.ToString()) : null, "detailedStatusMessage" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != this._manualActionCount ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNumber((long)this._manualActionCount) : null, "manualActionCount" ,container.Add ); } - AddIf( null != (((object)this._networkFabricId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._networkFabricId.ToString()) : null, "networkFabricId" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)||serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate)) + { + AddIf( null != (((object)this._networkFabricId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._networkFabricId.ToString()) : null, "networkFabricId" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._provisioningState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._provisioningState.ToString()) : null, "provisioningState" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._supportExpiryDate)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._supportExpiryDate.ToString()) : null, "supportExpiryDate" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { if (null != this._workloadResourceId) { diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterScanRuntimeParameters.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterScanRuntimeParameters.PowerShell.cs similarity index 81% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterScanRuntimeParameters.PowerShell.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterScanRuntimeParameters.PowerShell.cs index 23739e50881e..75df6df9efdd 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterScanRuntimeParameters.PowerShell.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterScanRuntimeParameters.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; @@ -65,7 +65,7 @@ public partial class ClusterScanRuntimeParameters 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 ClusterScanRuntimeParameters(global::System.Collections.IDictionary con // actually deserialize if (content.Contains("ScanActivity")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterScanRuntimeParametersInternal)this).ScanActivity = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterScanRuntimeParametersScanActivity?) content.GetValueForProperty("ScanActivity",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterScanRuntimeParametersInternal)this).ScanActivity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterScanRuntimeParametersScanActivity.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterScanRuntimeParametersInternal)this).ScanActivity = (string) content.GetValueForProperty("ScanActivity",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterScanRuntimeParametersInternal)this).ScanActivity, 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. @@ -101,35 +101,33 @@ internal ClusterScanRuntimeParameters(global::System.Management.Automation.PSObj // actually deserialize if (content.Contains("ScanActivity")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterScanRuntimeParametersInternal)this).ScanActivity = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterScanRuntimeParametersScanActivity?) content.GetValueForProperty("ScanActivity",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterScanRuntimeParametersInternal)this).ScanActivity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterScanRuntimeParametersScanActivity.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterScanRuntimeParametersInternal)this).ScanActivity = (string) content.GetValueForProperty("ScanActivity",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterScanRuntimeParametersInternal)this).ScanActivity, 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.NetworkCloud.Models.Api20250201.IClusterScanRuntimeParameters DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterScanRuntimeParameters DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ClusterScanRuntimeParameters(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.NetworkCloud.Models.Api20250201.IClusterScanRuntimeParameters DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterScanRuntimeParameters DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ClusterScanRuntimeParameters(content); } @@ -139,7 +137,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterScanRuntimeParameters FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterScanRuntimeParameters FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterScanRuntimeParameters.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterScanRuntimeParameters.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterScanRuntimeParameters.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterScanRuntimeParameters.TypeConverter.cs index f0c71ea86d90..b8ba92db7673 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterScanRuntimeParameters.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterScanRuntimeParameters.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IClusterScanRuntimeParameters ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterScanRuntimeParameters ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterScanRuntimeParameters).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterScanRuntimeParameters).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterScanRuntimeParameters.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterScanRuntimeParameters.cs new file mode 100644 index 000000000000..468012869982 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterScanRuntimeParameters.cs @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + + /// + /// ClusterScanRuntimeParameters defines the parameters for the cluster scan runtime operation. + /// + public partial class ClusterScanRuntimeParameters : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterScanRuntimeParameters, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterScanRuntimeParametersInternal + { + + /// Backing field for property. + private string _scanActivity; + + /// The choice of if the scan operation should run the scan. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string ScanActivity { get => this._scanActivity; set => this._scanActivity = value; } + + /// Creates an new instance. + public ClusterScanRuntimeParameters() + { + + } + } + /// ClusterScanRuntimeParameters defines the parameters for the cluster scan runtime operation. + public partial interface IClusterScanRuntimeParameters : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable + { + /// The choice of if the scan operation should run the scan. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The choice of if the scan operation should run the scan.", + SerializedName = @"scanActivity", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Scan", "Skip")] + string ScanActivity { get; set; } + + } + /// ClusterScanRuntimeParameters defines the parameters for the cluster scan runtime operation. + internal partial interface IClusterScanRuntimeParametersInternal + + { + /// The choice of if the scan operation should run the scan. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Scan", "Skip")] + string ScanActivity { get; set; } + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterScanRuntimeParameters.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterScanRuntimeParameters.json.cs similarity index 95% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterScanRuntimeParameters.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterScanRuntimeParameters.json.cs index eb1db17afc25..9ccf140aca66 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterScanRuntimeParameters.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterScanRuntimeParameters.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -67,18 +67,18 @@ internal ClusterScanRuntimeParameters(Microsoft.Azure.PowerShell.Cmdlets.Network { return; } - {_scanActivity = If( json?.PropertyT("scanActivity"), out var __jsonScanActivity) ? (string)__jsonScanActivity : (string)ScanActivity;} + {_scanActivity = If( json?.PropertyT("scanActivity"), out var __jsonScanActivity) ? (string)__jsonScanActivity : (string)_scanActivity;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterScanRuntimeParameters. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterScanRuntimeParameters. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterScanRuntimeParameters. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterScanRuntimeParameters. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterScanRuntimeParameters FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterScanRuntimeParameters FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new ClusterScanRuntimeParameters(json) : null; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterSecretArchive.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterSecretArchive.PowerShell.cs similarity index 78% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterSecretArchive.PowerShell.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterSecretArchive.PowerShell.cs index 85ecf083f412..7a87b3a724f6 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterSecretArchive.PowerShell.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterSecretArchive.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; @@ -65,7 +65,7 @@ public partial class ClusterSecretArchive 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,17 +80,17 @@ internal ClusterSecretArchive(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("KeyVaultId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterSecretArchiveInternal)this).KeyVaultId = (string) content.GetValueForProperty("KeyVaultId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterSecretArchiveInternal)this).KeyVaultId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterSecretArchiveInternal)this).KeyVaultId = (string) content.GetValueForProperty("KeyVaultId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterSecretArchiveInternal)this).KeyVaultId, global::System.Convert.ToString); } if (content.Contains("UseKeyVault")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterSecretArchiveInternal)this).UseKeyVault = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterSecretArchiveEnabled?) content.GetValueForProperty("UseKeyVault",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterSecretArchiveInternal)this).UseKeyVault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterSecretArchiveEnabled.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterSecretArchiveInternal)this).UseKeyVault = (string) content.GetValueForProperty("UseKeyVault",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterSecretArchiveInternal)this).UseKeyVault, 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. @@ -105,37 +105,37 @@ internal ClusterSecretArchive(global::System.Management.Automation.PSObject cont // actually deserialize if (content.Contains("KeyVaultId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterSecretArchiveInternal)this).KeyVaultId = (string) content.GetValueForProperty("KeyVaultId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterSecretArchiveInternal)this).KeyVaultId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterSecretArchiveInternal)this).KeyVaultId = (string) content.GetValueForProperty("KeyVaultId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterSecretArchiveInternal)this).KeyVaultId, global::System.Convert.ToString); } if (content.Contains("UseKeyVault")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterSecretArchiveInternal)this).UseKeyVault = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterSecretArchiveEnabled?) content.GetValueForProperty("UseKeyVault",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterSecretArchiveInternal)this).UseKeyVault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterSecretArchiveEnabled.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterSecretArchiveInternal)this).UseKeyVault = (string) content.GetValueForProperty("UseKeyVault",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterSecretArchiveInternal)this).UseKeyVault, 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.NetworkCloud.Models.Api20250201.IClusterSecretArchive DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterSecretArchive DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ClusterSecretArchive(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.NetworkCloud.Models.Api20250201.IClusterSecretArchive DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterSecretArchive DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ClusterSecretArchive(content); } @@ -145,7 +145,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterSecretArchive FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterSecretArchive FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterSecretArchive.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterSecretArchive.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterSecretArchive.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterSecretArchive.TypeConverter.cs index 55b9c4e9ba93..3ab2dcd22b68 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterSecretArchive.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterSecretArchive.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IClusterSecretArchive ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterSecretArchive ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterSecretArchive).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterSecretArchive).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterSecretArchive.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterSecretArchive.cs similarity index 79% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterSecretArchive.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterSecretArchive.cs index c4d82599da15..c8b03208f13b 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterSecretArchive.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterSecretArchive.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -11,8 +11,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201 /// ClusterSecretArchive configures the key vault to archive the secrets of the cluster for later retrieval. /// public partial class ClusterSecretArchive : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterSecretArchive, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterSecretArchiveInternal + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterSecretArchive, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterSecretArchiveInternal { /// Backing field for property. @@ -23,13 +23,13 @@ public partial class ClusterSecretArchive : public string KeyVaultId { get => this._keyVaultId; set => this._keyVaultId = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterSecretArchiveEnabled? _useKeyVault; + private string _useKeyVault; /// /// The indicator if the specified key vault should be used to archive the secrets of the cluster. /// [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterSecretArchiveEnabled? UseKeyVault { get => this._useKeyVault; set => this._useKeyVault = value; } + public string UseKeyVault { get => this._useKeyVault; set => this._useKeyVault = value; } /// Creates an new instance. public ClusterSecretArchive() @@ -45,6 +45,9 @@ public partial interface IClusterSecretArchive : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The resource ID of the key vault to archive the secrets of the cluster.", SerializedName = @"keyVaultId", PossibleTypes = new [] { typeof(string) })] @@ -55,10 +58,14 @@ public partial interface IClusterSecretArchive : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The indicator if the specified key vault should be used to archive the secrets of the cluster.", SerializedName = @"useKeyVault", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterSecretArchiveEnabled) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterSecretArchiveEnabled? UseKeyVault { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("True", "False")] + string UseKeyVault { get; set; } } /// ClusterSecretArchive configures the key vault to archive the secrets of the cluster for later retrieval. @@ -70,7 +77,8 @@ internal partial interface IClusterSecretArchiveInternal /// /// The indicator if the specified key vault should be used to archive the secrets of the cluster. /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterSecretArchiveEnabled? UseKeyVault { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("True", "False")] + string UseKeyVault { get; set; } } } \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterSecretArchive.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterSecretArchive.json.cs similarity index 95% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterSecretArchive.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterSecretArchive.json.cs index c0652600ea06..9df8a810e6df 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterSecretArchive.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterSecretArchive.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -67,19 +67,19 @@ internal ClusterSecretArchive(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Ru { return; } - {_keyVaultId = If( json?.PropertyT("keyVaultId"), out var __jsonKeyVaultId) ? (string)__jsonKeyVaultId : (string)KeyVaultId;} - {_useKeyVault = If( json?.PropertyT("useKeyVault"), out var __jsonUseKeyVault) ? (string)__jsonUseKeyVault : (string)UseKeyVault;} + {_keyVaultId = If( json?.PropertyT("keyVaultId"), out var __jsonKeyVaultId) ? (string)__jsonKeyVaultId : (string)_keyVaultId;} + {_useKeyVault = If( json?.PropertyT("useKeyVault"), out var __jsonUseKeyVault) ? (string)__jsonUseKeyVault : (string)_useKeyVault;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterSecretArchive. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterSecretArchive. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterSecretArchive. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterSecretArchive. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterSecretArchive FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterSecretArchive FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new ClusterSecretArchive(json) : null; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterUpdateStrategy.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterUpdateStrategy.PowerShell.cs new file mode 100644 index 000000000000..879b353a72da --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterUpdateStrategy.PowerShell.cs @@ -0,0 +1,196 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + + /// ClusterUpdateStrategy represents the strategy for updating the cluster. + [System.ComponentModel.TypeConverter(typeof(ClusterUpdateStrategyTypeConverter))] + public partial class ClusterUpdateStrategy + { + + /// + /// 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 ClusterUpdateStrategy(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("MaxUnavailable")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterUpdateStrategyInternal)this).MaxUnavailable = (long?) content.GetValueForProperty("MaxUnavailable",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterUpdateStrategyInternal)this).MaxUnavailable, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("StrategyType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterUpdateStrategyInternal)this).StrategyType = (string) content.GetValueForProperty("StrategyType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterUpdateStrategyInternal)this).StrategyType, global::System.Convert.ToString); + } + if (content.Contains("ThresholdType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterUpdateStrategyInternal)this).ThresholdType = (string) content.GetValueForProperty("ThresholdType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterUpdateStrategyInternal)this).ThresholdType, global::System.Convert.ToString); + } + if (content.Contains("ThresholdValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterUpdateStrategyInternal)this).ThresholdValue = (long) content.GetValueForProperty("ThresholdValue",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterUpdateStrategyInternal)this).ThresholdValue, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("WaitTimeMinute")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterUpdateStrategyInternal)this).WaitTimeMinute = (long?) content.GetValueForProperty("WaitTimeMinute",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterUpdateStrategyInternal)this).WaitTimeMinute, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ClusterUpdateStrategy(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("MaxUnavailable")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterUpdateStrategyInternal)this).MaxUnavailable = (long?) content.GetValueForProperty("MaxUnavailable",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterUpdateStrategyInternal)this).MaxUnavailable, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("StrategyType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterUpdateStrategyInternal)this).StrategyType = (string) content.GetValueForProperty("StrategyType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterUpdateStrategyInternal)this).StrategyType, global::System.Convert.ToString); + } + if (content.Contains("ThresholdType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterUpdateStrategyInternal)this).ThresholdType = (string) content.GetValueForProperty("ThresholdType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterUpdateStrategyInternal)this).ThresholdType, global::System.Convert.ToString); + } + if (content.Contains("ThresholdValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterUpdateStrategyInternal)this).ThresholdValue = (long) content.GetValueForProperty("ThresholdValue",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterUpdateStrategyInternal)this).ThresholdValue, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("WaitTimeMinute")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterUpdateStrategyInternal)this).WaitTimeMinute = (long?) content.GetValueForProperty("WaitTimeMinute",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterUpdateStrategyInternal)this).WaitTimeMinute, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + 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.NetworkCloud.Models.IClusterUpdateStrategy DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ClusterUpdateStrategy(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.NetworkCloud.Models.IClusterUpdateStrategy DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ClusterUpdateStrategy(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.NetworkCloud.Models.IClusterUpdateStrategy FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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(); + } + } + /// ClusterUpdateStrategy represents the strategy for updating the cluster. + [System.ComponentModel.TypeConverter(typeof(ClusterUpdateStrategyTypeConverter))] + public partial interface IClusterUpdateStrategy + + { + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterUpdateStrategy.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterUpdateStrategy.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterUpdateStrategy.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterUpdateStrategy.TypeConverter.cs index b7c6ba570057..eda697a14988 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterUpdateStrategy.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterUpdateStrategy.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IClusterUpdateStrategy ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterUpdateStrategy ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterUpdateStrategy).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterUpdateStrategy).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterUpdateStrategy.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterUpdateStrategy.cs similarity index 80% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterUpdateStrategy.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterUpdateStrategy.cs index a4594e65296a..1e0426f803d8 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterUpdateStrategy.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterUpdateStrategy.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; /// ClusterUpdateStrategy represents the strategy for updating the cluster. public partial class ClusterUpdateStrategy : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterUpdateStrategy, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterUpdateStrategyInternal + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterUpdateStrategy, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterUpdateStrategyInternal { /// Backing field for property. @@ -24,18 +24,18 @@ public partial class ClusterUpdateStrategy : public long? MaxUnavailable { get => this._maxUnavailable; set => this._maxUnavailable = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterUpdateStrategyType _strategyType; + private string _strategyType; /// The mode of operation for runtime protection. [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterUpdateStrategyType StrategyType { get => this._strategyType; set => this._strategyType = value; } + public string StrategyType { get => this._strategyType; set => this._strategyType = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdType _thresholdType; + private string _thresholdType; /// Selection of how the threshold should be evaluated. [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdType ThresholdType { get => this._thresholdType; set => this._thresholdType = value; } + public string ThresholdType { get => this._thresholdType; set => this._thresholdType = value; } /// Backing field for property. private long _thresholdValue; @@ -68,6 +68,9 @@ public partial interface IClusterUpdateStrategy : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The maximum number of worker nodes that can be offline within the increment of update, e.g., rack-by-rack. Limited by the maximum number of machines in the increment. Defaults to the whole increment size.", SerializedName = @"maxUnavailable", @@ -77,22 +80,33 @@ public partial interface IClusterUpdateStrategy : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The mode of operation for runtime protection.", SerializedName = @"strategyType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterUpdateStrategyType) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterUpdateStrategyType StrategyType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Rack", "PauseAfterRack")] + string StrategyType { get; set; } /// Selection of how the threshold should be evaluated. [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Selection of how the threshold should be evaluated.", SerializedName = @"thresholdType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdType) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdType ThresholdType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("CountSuccess", "PercentSuccess")] + string ThresholdType { get; set; } /// The numeric threshold value. [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The numeric threshold value.", SerializedName = @"thresholdValue", PossibleTypes = new [] { typeof(long) })] @@ -101,6 +115,9 @@ public partial interface IClusterUpdateStrategy : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The time to wait between the increments of update defined by the strategy.", SerializedName = @"waitTimeMinutes", PossibleTypes = new [] { typeof(long) })] @@ -117,9 +134,11 @@ internal partial interface IClusterUpdateStrategyInternal /// long? MaxUnavailable { get; set; } /// The mode of operation for runtime protection. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterUpdateStrategyType StrategyType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Rack", "PauseAfterRack")] + string StrategyType { get; set; } /// Selection of how the threshold should be evaluated. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdType ThresholdType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("CountSuccess", "PercentSuccess")] + string ThresholdType { get; set; } /// The numeric threshold value. long ThresholdValue { get; set; } /// The time to wait between the increments of update defined by the strategy. diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterUpdateStrategy.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterUpdateStrategy.json.cs similarity index 95% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterUpdateStrategy.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterUpdateStrategy.json.cs index 1a307d0b0ef0..4ceb380dad2a 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterUpdateStrategy.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterUpdateStrategy.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -65,22 +65,22 @@ internal ClusterUpdateStrategy(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.R { return; } - {_maxUnavailable = If( json?.PropertyT("maxUnavailable"), out var __jsonMaxUnavailable) ? (long?)__jsonMaxUnavailable : MaxUnavailable;} - {_strategyType = If( json?.PropertyT("strategyType"), out var __jsonStrategyType) ? (string)__jsonStrategyType : (string)StrategyType;} - {_thresholdType = If( json?.PropertyT("thresholdType"), out var __jsonThresholdType) ? (string)__jsonThresholdType : (string)ThresholdType;} - {_thresholdValue = If( json?.PropertyT("thresholdValue"), out var __jsonThresholdValue) ? (long)__jsonThresholdValue : ThresholdValue;} - {_waitTimeMinute = If( json?.PropertyT("waitTimeMinutes"), out var __jsonWaitTimeMinutes) ? (long?)__jsonWaitTimeMinutes : WaitTimeMinute;} + {_maxUnavailable = If( json?.PropertyT("maxUnavailable"), out var __jsonMaxUnavailable) ? (long?)__jsonMaxUnavailable : _maxUnavailable;} + {_strategyType = If( json?.PropertyT("strategyType"), out var __jsonStrategyType) ? (string)__jsonStrategyType : (string)_strategyType;} + {_thresholdType = If( json?.PropertyT("thresholdType"), out var __jsonThresholdType) ? (string)__jsonThresholdType : (string)_thresholdType;} + {_thresholdValue = If( json?.PropertyT("thresholdValue"), out var __jsonThresholdValue) ? (long)__jsonThresholdValue : _thresholdValue;} + {_waitTimeMinute = If( json?.PropertyT("waitTimeMinutes"), out var __jsonWaitTimeMinutes) ? (long?)__jsonWaitTimeMinutes : _waitTimeMinute;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterUpdateStrategy. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterUpdateStrategy. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterUpdateStrategy. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterUpdateStrategy. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterUpdateStrategy FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterUpdateStrategy FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new ClusterUpdateStrategy(json) : null; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterUpdateVersionParameters.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterUpdateVersionParameters.PowerShell.cs similarity index 83% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterUpdateVersionParameters.PowerShell.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterUpdateVersionParameters.PowerShell.cs index d8aa04b2aaeb..6463399af407 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterUpdateVersionParameters.PowerShell.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterUpdateVersionParameters.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; @@ -65,7 +65,7 @@ public partial class ClusterUpdateVersionParameters 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 ClusterUpdateVersionParameters(global::System.Collections.IDictionary c // actually deserialize if (content.Contains("TargetClusterVersion")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterUpdateVersionParametersInternal)this).TargetClusterVersion = (string) content.GetValueForProperty("TargetClusterVersion",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterUpdateVersionParametersInternal)this).TargetClusterVersion, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterUpdateVersionParametersInternal)this).TargetClusterVersion = (string) content.GetValueForProperty("TargetClusterVersion",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterUpdateVersionParametersInternal)this).TargetClusterVersion, 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. @@ -101,35 +101,33 @@ internal ClusterUpdateVersionParameters(global::System.Management.Automation.PSO // actually deserialize if (content.Contains("TargetClusterVersion")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterUpdateVersionParametersInternal)this).TargetClusterVersion = (string) content.GetValueForProperty("TargetClusterVersion",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterUpdateVersionParametersInternal)this).TargetClusterVersion, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterUpdateVersionParametersInternal)this).TargetClusterVersion = (string) content.GetValueForProperty("TargetClusterVersion",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterUpdateVersionParametersInternal)this).TargetClusterVersion, 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.NetworkCloud.Models.Api20250201.IClusterUpdateVersionParameters DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterUpdateVersionParameters DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ClusterUpdateVersionParameters(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.NetworkCloud.Models.Api20250201.IClusterUpdateVersionParameters DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterUpdateVersionParameters DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ClusterUpdateVersionParameters(content); } @@ -139,7 +137,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterUpdateVersionParameters FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterUpdateVersionParameters FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterUpdateVersionParameters.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterUpdateVersionParameters.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterUpdateVersionParameters.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterUpdateVersionParameters.TypeConverter.cs index a4b12d3003ee..ce9e3eaa4c17 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterUpdateVersionParameters.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterUpdateVersionParameters.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IClusterUpdateVersionParameters ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterUpdateVersionParameters ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterUpdateVersionParameters).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterUpdateVersionParameters).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterUpdateVersionParameters.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterUpdateVersionParameters.cs similarity index 89% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterUpdateVersionParameters.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterUpdateVersionParameters.cs index 5798683bb287..7ea92dac9a11 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterUpdateVersionParameters.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterUpdateVersionParameters.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -11,8 +11,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201 /// ClusterUpdateVersionParameters represents the body of the request to update cluster version. /// public partial class ClusterUpdateVersionParameters : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterUpdateVersionParameters, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterUpdateVersionParametersInternal + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterUpdateVersionParameters, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterUpdateVersionParametersInternal { /// Backing field for property. @@ -36,6 +36,9 @@ public partial interface IClusterUpdateVersionParameters : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The version to be applied to the cluster during update.", SerializedName = @"targetClusterVersion", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterUpdateVersionParameters.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterUpdateVersionParameters.json.cs similarity index 94% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterUpdateVersionParameters.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterUpdateVersionParameters.json.cs index d3b22acfd4d1..934b919d549b 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ClusterUpdateVersionParameters.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ClusterUpdateVersionParameters.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -67,18 +67,18 @@ internal ClusterUpdateVersionParameters(Microsoft.Azure.PowerShell.Cmdlets.Netwo { return; } - {_targetClusterVersion = If( json?.PropertyT("targetClusterVersion"), out var __jsonTargetClusterVersion) ? (string)__jsonTargetClusterVersion : (string)TargetClusterVersion;} + {_targetClusterVersion = If( json?.PropertyT("targetClusterVersion"), out var __jsonTargetClusterVersion) ? (string)__jsonTargetClusterVersion : (string)_targetClusterVersion;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterUpdateVersionParameters. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterUpdateVersionParameters. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterUpdateVersionParameters. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterUpdateVersionParameters. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterUpdateVersionParameters FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterUpdateVersionParameters FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new ClusterUpdateVersionParameters(json) : null; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/CommandOutputSettings.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/CommandOutputSettings.PowerShell.cs new file mode 100644 index 000000000000..1fd998f9b45c --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/CommandOutputSettings.PowerShell.cs @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + + /// + /// CommandOutputSettings represents the settings for commands run within the cluster such as bare metal machine run read-only + /// commands. + /// + [System.ComponentModel.TypeConverter(typeof(CommandOutputSettingsTypeConverter))] + public partial class CommandOutputSettings + { + + /// + /// 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 CommandOutputSettings(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("AssociatedIdentity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICommandOutputSettingsInternal)this).AssociatedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IIdentitySelector) content.GetValueForProperty("AssociatedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICommandOutputSettingsInternal)this).AssociatedIdentity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IdentitySelectorTypeConverter.ConvertFrom); + } + if (content.Contains("ContainerUrl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICommandOutputSettingsInternal)this).ContainerUrl = (string) content.GetValueForProperty("ContainerUrl",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICommandOutputSettingsInternal)this).ContainerUrl, global::System.Convert.ToString); + } + if (content.Contains("AssociatedIdentityType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICommandOutputSettingsInternal)this).AssociatedIdentityType = (string) content.GetValueForProperty("AssociatedIdentityType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICommandOutputSettingsInternal)this).AssociatedIdentityType, global::System.Convert.ToString); + } + if (content.Contains("AssociatedIdentityUserAssignedIdentityResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICommandOutputSettingsInternal)this).AssociatedIdentityUserAssignedIdentityResourceId = (string) content.GetValueForProperty("AssociatedIdentityUserAssignedIdentityResourceId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICommandOutputSettingsInternal)this).AssociatedIdentityUserAssignedIdentityResourceId, 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 CommandOutputSettings(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("AssociatedIdentity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICommandOutputSettingsInternal)this).AssociatedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IIdentitySelector) content.GetValueForProperty("AssociatedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICommandOutputSettingsInternal)this).AssociatedIdentity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IdentitySelectorTypeConverter.ConvertFrom); + } + if (content.Contains("ContainerUrl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICommandOutputSettingsInternal)this).ContainerUrl = (string) content.GetValueForProperty("ContainerUrl",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICommandOutputSettingsInternal)this).ContainerUrl, global::System.Convert.ToString); + } + if (content.Contains("AssociatedIdentityType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICommandOutputSettingsInternal)this).AssociatedIdentityType = (string) content.GetValueForProperty("AssociatedIdentityType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICommandOutputSettingsInternal)this).AssociatedIdentityType, global::System.Convert.ToString); + } + if (content.Contains("AssociatedIdentityUserAssignedIdentityResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICommandOutputSettingsInternal)this).AssociatedIdentityUserAssignedIdentityResourceId = (string) content.GetValueForProperty("AssociatedIdentityUserAssignedIdentityResourceId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICommandOutputSettingsInternal)this).AssociatedIdentityUserAssignedIdentityResourceId, 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.NetworkCloud.Models.ICommandOutputSettings DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new CommandOutputSettings(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.NetworkCloud.Models.ICommandOutputSettings DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new CommandOutputSettings(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.NetworkCloud.Models.ICommandOutputSettings FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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(); + } + } + /// CommandOutputSettings represents the settings for commands run within the cluster such as bare metal machine run read-only + /// commands. + [System.ComponentModel.TypeConverter(typeof(CommandOutputSettingsTypeConverter))] + public partial interface ICommandOutputSettings + + { + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/CommandOutputSettings.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/CommandOutputSettings.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/CommandOutputSettings.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/CommandOutputSettings.TypeConverter.cs index 9d4b8dc0a03a..77b6960bcd4b 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/CommandOutputSettings.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/CommandOutputSettings.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.ICommandOutputSettings ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICommandOutputSettings ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICommandOutputSettings).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICommandOutputSettings).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/CommandOutputSettings.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/CommandOutputSettings.cs new file mode 100644 index 000000000000..0582f7f9d67b --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/CommandOutputSettings.cs @@ -0,0 +1,125 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + + /// + /// CommandOutputSettings represents the settings for commands run within the cluster such as bare metal machine run read-only + /// commands. + /// + public partial class CommandOutputSettings : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICommandOutputSettings, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICommandOutputSettingsInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IIdentitySelector _associatedIdentity; + + /// + /// The selection of the managed identity to use with this storage account container. The identity type must be either system + /// assigned or user assigned. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IIdentitySelector AssociatedIdentity { get => (this._associatedIdentity = this._associatedIdentity ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IdentitySelector()); set => this._associatedIdentity = value; } + + /// The type of managed identity that is being selected. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string AssociatedIdentityType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IIdentitySelectorInternal)AssociatedIdentity).IdentityType; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IIdentitySelectorInternal)AssociatedIdentity).IdentityType = value ?? null; } + + /// + /// The user assigned managed identity resource ID to use. Mutually exclusive with a system assigned identity type. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string AssociatedIdentityUserAssignedIdentityResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IIdentitySelectorInternal)AssociatedIdentity).UserAssignedIdentityResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IIdentitySelectorInternal)AssociatedIdentity).UserAssignedIdentityResourceId = value ?? null; } + + /// Backing field for property. + private string _containerUrl; + + /// + /// The URL of the storage account container that is to be used by the specified identities. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string ContainerUrl { get => this._containerUrl; set => this._containerUrl = value; } + + /// Internal Acessors for AssociatedIdentity + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IIdentitySelector Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICommandOutputSettingsInternal.AssociatedIdentity { get => (this._associatedIdentity = this._associatedIdentity ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IdentitySelector()); set { {_associatedIdentity = value;} } } + + /// Creates an new instance. + public CommandOutputSettings() + { + + } + } + /// CommandOutputSettings represents the settings for commands run within the cluster such as bare metal machine run read-only + /// commands. + public partial interface ICommandOutputSettings : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable + { + /// The type of managed identity that is being selected. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The type of managed identity that is being selected.", + SerializedName = @"identityType", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("SystemAssignedIdentity", "UserAssignedIdentity")] + string AssociatedIdentityType { get; set; } + /// + /// The user assigned managed identity resource ID to use. Mutually exclusive with a system assigned identity type. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The user assigned managed identity resource ID to use. Mutually exclusive with a system assigned identity type.", + SerializedName = @"userAssignedIdentityResourceId", + PossibleTypes = new [] { typeof(string) })] + string AssociatedIdentityUserAssignedIdentityResourceId { get; set; } + /// + /// The URL of the storage account container that is to be used by the specified identities. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The URL of the storage account container that is to be used by the specified identities.", + SerializedName = @"containerUrl", + PossibleTypes = new [] { typeof(string) })] + string ContainerUrl { get; set; } + + } + /// CommandOutputSettings represents the settings for commands run within the cluster such as bare metal machine run read-only + /// commands. + internal partial interface ICommandOutputSettingsInternal + + { + /// + /// The selection of the managed identity to use with this storage account container. The identity type must be either system + /// assigned or user assigned. + /// + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IIdentitySelector AssociatedIdentity { get; set; } + /// The type of managed identity that is being selected. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("SystemAssignedIdentity", "UserAssignedIdentity")] + string AssociatedIdentityType { get; set; } + /// + /// The user assigned managed identity resource ID to use. Mutually exclusive with a system assigned identity type. + /// + string AssociatedIdentityUserAssignedIdentityResourceId { get; set; } + /// + /// The URL of the storage account container that is to be used by the specified identities. + /// + string ContainerUrl { get; set; } + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/CommandOutputSettings.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/CommandOutputSettings.json.cs similarity index 94% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/CommandOutputSettings.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/CommandOutputSettings.json.cs index aa501f58d1de..4adcd9ed0ea2 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/CommandOutputSettings.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/CommandOutputSettings.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -68,19 +68,19 @@ internal CommandOutputSettings(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.R { return; } - {_associatedIdentity = If( json?.PropertyT("associatedIdentity"), out var __jsonAssociatedIdentity) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IdentitySelector.FromJson(__jsonAssociatedIdentity) : AssociatedIdentity;} - {_containerUrl = If( json?.PropertyT("containerUrl"), out var __jsonContainerUrl) ? (string)__jsonContainerUrl : (string)ContainerUrl;} + {_associatedIdentity = If( json?.PropertyT("associatedIdentity"), out var __jsonAssociatedIdentity) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IdentitySelector.FromJson(__jsonAssociatedIdentity) : _associatedIdentity;} + {_containerUrl = If( json?.PropertyT("containerUrl"), out var __jsonContainerUrl) ? (string)__jsonContainerUrl : (string)_containerUrl;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICommandOutputSettings. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICommandOutputSettings. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICommandOutputSettings. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICommandOutputSettings. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICommandOutputSettings FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICommandOutputSettings FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new CommandOutputSettings(json) : null; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Console.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Console.PowerShell.cs new file mode 100644 index 000000000000..0813e7549413 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Console.PowerShell.cs @@ -0,0 +1,364 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + + /// Console represents the console of an on-premises Network Cloud virtual machine. + [System.ComponentModel.TypeConverter(typeof(ConsoleTypeConverter))] + public partial class Console + { + + /// + /// 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 Console(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ExtendedLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsoleInternal)this).ExtendedLocation = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocation) content.GetValueForProperty("ExtendedLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsoleInternal)this).ExtendedLocation, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ExtendedLocationTypeConverter.ConvertFrom); + } + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsoleInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsoleProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsoleInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ConsolePropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Etag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsoleInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsoleInternal)this).Etag, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)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("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedByType = (string) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedByType = (string) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.TrackedResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("ExtendedLocationName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsoleInternal)this).ExtendedLocationName = (string) content.GetValueForProperty("ExtendedLocationName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsoleInternal)this).ExtendedLocationName, global::System.Convert.ToString); + } + if (content.Contains("ExtendedLocationType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsoleInternal)this).ExtendedLocationType = (string) content.GetValueForProperty("ExtendedLocationType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsoleInternal)this).ExtendedLocationType, global::System.Convert.ToString); + } + if (content.Contains("SshPublicKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsoleInternal)this).SshPublicKey = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISshPublicKey) content.GetValueForProperty("SshPublicKey",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsoleInternal)this).SshPublicKey, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.SshPublicKeyTypeConverter.ConvertFrom); + } + if (content.Contains("DetailedStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsoleInternal)this).DetailedStatus = (string) content.GetValueForProperty("DetailedStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsoleInternal)this).DetailedStatus, global::System.Convert.ToString); + } + if (content.Contains("DetailedStatusMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsoleInternal)this).DetailedStatusMessage = (string) content.GetValueForProperty("DetailedStatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsoleInternal)this).DetailedStatusMessage, global::System.Convert.ToString); + } + if (content.Contains("Enabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsoleInternal)this).Enabled = (string) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsoleInternal)this).Enabled, global::System.Convert.ToString); + } + if (content.Contains("Expiration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsoleInternal)this).Expiration = (global::System.DateTime?) content.GetValueForProperty("Expiration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsoleInternal)this).Expiration, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("PrivateLinkServiceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsoleInternal)this).PrivateLinkServiceId = (string) content.GetValueForProperty("PrivateLinkServiceId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsoleInternal)this).PrivateLinkServiceId, global::System.Convert.ToString); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsoleInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsoleInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("VirtualMachineAccessId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsoleInternal)this).VirtualMachineAccessId = (string) content.GetValueForProperty("VirtualMachineAccessId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsoleInternal)this).VirtualMachineAccessId, global::System.Convert.ToString); + } + if (content.Contains("SshPublicKeyData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsoleInternal)this).SshPublicKeyData = (string) content.GetValueForProperty("SshPublicKeyData",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsoleInternal)this).SshPublicKeyData, 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 Console(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ExtendedLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsoleInternal)this).ExtendedLocation = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocation) content.GetValueForProperty("ExtendedLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsoleInternal)this).ExtendedLocation, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ExtendedLocationTypeConverter.ConvertFrom); + } + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsoleInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsoleProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsoleInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ConsolePropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Etag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsoleInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsoleInternal)this).Etag, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)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("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedByType = (string) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedByType = (string) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.TrackedResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("ExtendedLocationName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsoleInternal)this).ExtendedLocationName = (string) content.GetValueForProperty("ExtendedLocationName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsoleInternal)this).ExtendedLocationName, global::System.Convert.ToString); + } + if (content.Contains("ExtendedLocationType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsoleInternal)this).ExtendedLocationType = (string) content.GetValueForProperty("ExtendedLocationType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsoleInternal)this).ExtendedLocationType, global::System.Convert.ToString); + } + if (content.Contains("SshPublicKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsoleInternal)this).SshPublicKey = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISshPublicKey) content.GetValueForProperty("SshPublicKey",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsoleInternal)this).SshPublicKey, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.SshPublicKeyTypeConverter.ConvertFrom); + } + if (content.Contains("DetailedStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsoleInternal)this).DetailedStatus = (string) content.GetValueForProperty("DetailedStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsoleInternal)this).DetailedStatus, global::System.Convert.ToString); + } + if (content.Contains("DetailedStatusMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsoleInternal)this).DetailedStatusMessage = (string) content.GetValueForProperty("DetailedStatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsoleInternal)this).DetailedStatusMessage, global::System.Convert.ToString); + } + if (content.Contains("Enabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsoleInternal)this).Enabled = (string) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsoleInternal)this).Enabled, global::System.Convert.ToString); + } + if (content.Contains("Expiration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsoleInternal)this).Expiration = (global::System.DateTime?) content.GetValueForProperty("Expiration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsoleInternal)this).Expiration, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("PrivateLinkServiceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsoleInternal)this).PrivateLinkServiceId = (string) content.GetValueForProperty("PrivateLinkServiceId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsoleInternal)this).PrivateLinkServiceId, global::System.Convert.ToString); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsoleInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsoleInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("VirtualMachineAccessId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsoleInternal)this).VirtualMachineAccessId = (string) content.GetValueForProperty("VirtualMachineAccessId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsoleInternal)this).VirtualMachineAccessId, global::System.Convert.ToString); + } + if (content.Contains("SshPublicKeyData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsoleInternal)this).SshPublicKeyData = (string) content.GetValueForProperty("SshPublicKeyData",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsoleInternal)this).SshPublicKeyData, 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.NetworkCloud.Models.IConsole DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new Console(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.NetworkCloud.Models.IConsole DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new Console(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.NetworkCloud.Models.IConsole FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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(); + } + } + /// Console represents the console of an on-premises Network Cloud virtual machine. + [System.ComponentModel.TypeConverter(typeof(ConsoleTypeConverter))] + public partial interface IConsole + + { + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/Console.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Console.TypeConverter.cs similarity index 98% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/Console.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Console.TypeConverter.cs index a41d46931d0a..bab37e0a85af 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/Console.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Console.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IConsole ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsole ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsole).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsole).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Console.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Console.cs new file mode 100644 index 000000000000..e5dbc3d716a3 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Console.cs @@ -0,0 +1,403 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + + /// Console represents the console of an on-premises Network Cloud virtual machine. + public partial class Console : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsole, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsoleInternal, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResource __trackedResource = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.TrackedResource(); + + /// The more detailed status of the console. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string DetailedStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsolePropertiesInternal)Property).DetailedStatus; } + + /// The descriptive message about the current detailed status. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string DetailedStatusMessage { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsolePropertiesInternal)Property).DetailedStatusMessage; } + + /// The indicator of whether the console access is enabled. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string Enabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsolePropertiesInternal)Property).Enabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsolePropertiesInternal)Property).Enabled = value ; } + + /// Backing field for property. + private string _etag; + + /// Resource ETag. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string Etag { get => this._etag; } + + /// The date and time after which the key will be disallowed access. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public global::System.DateTime? Expiration { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsolePropertiesInternal)Property).Expiration; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsolePropertiesInternal)Property).Expiration = value ?? default(global::System.DateTime); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocation _extendedLocation; + + /// + /// The extended location of the cluster manager associated with the cluster this virtual machine is created on. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocation ExtendedLocation { get => (this._extendedLocation = this._extendedLocation ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ExtendedLocation()); set => this._extendedLocation = value; } + + /// The resource ID of the extended location on which the resource will be created. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string ExtendedLocationName { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocationInternal)ExtendedLocation).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocationInternal)ExtendedLocation).Name = value ?? null; } + + /// The extended location type, for example, CustomLocation. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string ExtendedLocationType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocationInternal)ExtendedLocation).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocationInternal)ExtendedLocation).Type = value ?? null; } + + /// + /// Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).Id; } + + /// The geo-location where the resource lives + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)__trackedResource).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)__trackedResource).Location = value ?? null; } + + /// Internal Acessors for DetailedStatus + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsoleInternal.DetailedStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsolePropertiesInternal)Property).DetailedStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsolePropertiesInternal)Property).DetailedStatus = value ?? null; } + + /// Internal Acessors for DetailedStatusMessage + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsoleInternal.DetailedStatusMessage { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsolePropertiesInternal)Property).DetailedStatusMessage; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsolePropertiesInternal)Property).DetailedStatusMessage = value ?? null; } + + /// Internal Acessors for Etag + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsoleInternal.Etag { get => this._etag; set { {_etag = value;} } } + + /// Internal Acessors for ExtendedLocation + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocation Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsoleInternal.ExtendedLocation { get => (this._extendedLocation = this._extendedLocation ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ExtendedLocation()); set { {_extendedLocation = value;} } } + + /// Internal Acessors for PrivateLinkServiceId + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsoleInternal.PrivateLinkServiceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsolePropertiesInternal)Property).PrivateLinkServiceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsolePropertiesInternal)Property).PrivateLinkServiceId = value ?? null; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsoleProperties Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsoleInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ConsoleProperties()); set { {_property = value;} } } + + /// Internal Acessors for ProvisioningState + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsoleInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsolePropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsolePropertiesInternal)Property).ProvisioningState = value ?? null; } + + /// Internal Acessors for SshPublicKey + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISshPublicKey Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsoleInternal.SshPublicKey { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsolePropertiesInternal)Property).SshPublicKey; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsolePropertiesInternal)Property).SshPublicKey = value ?? null /* model class */; } + + /// Internal Acessors for VirtualMachineAccessId + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsoleInternal.VirtualMachineAccessId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsolePropertiesInternal)Property).VirtualMachineAccessId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsolePropertiesInternal)Property).VirtualMachineAccessId = value ?? null; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).Id = value ?? null; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).Name = value ?? null; } + + /// Internal Acessors for SystemData + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISystemData Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemData; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemData = value ?? null /* model class */; } + + /// Internal Acessors for SystemDataCreatedAt + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataCreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataCreatedAt = value ?? default(global::System.DateTime); } + + /// Internal Acessors for SystemDataCreatedBy + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataCreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataCreatedBy = value ?? null; } + + /// Internal Acessors for SystemDataCreatedByType + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataCreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataCreatedByType = value ?? null; } + + /// Internal Acessors for SystemDataLastModifiedAt + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedAt = value ?? default(global::System.DateTime); } + + /// Internal Acessors for SystemDataLastModifiedBy + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedBy = value ?? null; } + + /// Internal Acessors for SystemDataLastModifiedByType + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedByType = value ?? null; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).Type = value ?? null; } + + /// The name of the resource + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).Name; } + + /// + /// The resource ID of the private link service that is used to provide virtual machine console access. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string PrivateLinkServiceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsolePropertiesInternal)Property).PrivateLinkServiceId; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsoleProperties _property; + + /// The list of the resource properties. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsoleProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ConsoleProperties()); set => this._property = value; } + + /// The provisioning state of the virtual machine console. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsolePropertiesInternal)Property).ProvisioningState; } + + /// Gets the resource group name + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string ResourceGroupName { get => (new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Success ? new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Groups["resourceGroupName"].Value : null); } + + /// The SSH public key data. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string SshPublicKeyData { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsolePropertiesInternal)Property).SshPublicKeyData; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsolePropertiesInternal)Property).SshPublicKeyData = value ; } + + /// + /// Azure Resource Manager metadata containing createdBy and modifiedBy information. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISystemData SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemData; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemData = value ?? null /* model class */; } + + /// The timestamp of resource creation (UTC). + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataCreatedAt; } + + /// The identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataCreatedBy; } + + /// The type of identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public string SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataCreatedByType; } + + /// The timestamp of resource last modification (UTC) + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedAt; } + + /// The identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedBy; } + + /// The type of identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public string SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedByType; } + + /// Resource tags. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)__trackedResource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).Type; } + + /// + /// The unique identifier for the virtual machine that is used to access the console. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string VirtualMachineAccessId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsolePropertiesInternal)Property).VirtualMachineAccessId; } + + /// Creates an new instance. + public Console() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__trackedResource), __trackedResource); + await eventListener.AssertObjectIsValid(nameof(__trackedResource), __trackedResource); + } + } + /// Console represents the console of an on-premises Network Cloud virtual machine. + public partial interface IConsole : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResource + { + /// The more detailed status of the console. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The more detailed status of the console.", + SerializedName = @"detailedStatus", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Ready", "Error")] + string DetailedStatus { get; } + /// The descriptive message about the current detailed status. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The descriptive message about the current detailed status.", + SerializedName = @"detailedStatusMessage", + PossibleTypes = new [] { typeof(string) })] + string DetailedStatusMessage { get; } + /// The indicator of whether the console access is enabled. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The indicator of whether the console access is enabled.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("True", "False")] + string Enabled { get; set; } + /// Resource ETag. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"Resource ETag.", + SerializedName = @"etag", + PossibleTypes = new [] { typeof(string) })] + string Etag { get; } + /// The date and time after which the key will be disallowed access. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The date and time after which the key will be disallowed access.", + SerializedName = @"expiration", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? Expiration { get; set; } + /// The resource ID of the extended location on which the resource will be created. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The resource ID of the extended location on which the resource will be created.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string ExtendedLocationName { get; set; } + /// The extended location type, for example, CustomLocation. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The extended location type, for example, CustomLocation.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + string ExtendedLocationType { get; set; } + /// + /// The resource ID of the private link service that is used to provide virtual machine console access. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The resource ID of the private link service that is used to provide virtual machine console access.", + SerializedName = @"privateLinkServiceId", + PossibleTypes = new [] { typeof(string) })] + string PrivateLinkServiceId { get; } + /// The provisioning state of the virtual machine console. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The provisioning state of the virtual machine console.", + SerializedName = @"provisioningState", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Succeeded", "Failed", "Canceled", "Provisioning", "Accepted")] + string ProvisioningState { get; } + /// The SSH public key data. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The SSH public key data.", + SerializedName = @"keyData", + PossibleTypes = new [] { typeof(string) })] + string SshPublicKeyData { get; set; } + /// + /// The unique identifier for the virtual machine that is used to access the console. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The unique identifier for the virtual machine that is used to access the console.", + SerializedName = @"virtualMachineAccessId", + PossibleTypes = new [] { typeof(string) })] + string VirtualMachineAccessId { get; } + + } + /// Console represents the console of an on-premises Network Cloud virtual machine. + internal partial interface IConsoleInternal : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal + { + /// The more detailed status of the console. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Ready", "Error")] + string DetailedStatus { get; set; } + /// The descriptive message about the current detailed status. + string DetailedStatusMessage { get; set; } + /// The indicator of whether the console access is enabled. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("True", "False")] + string Enabled { get; set; } + /// Resource ETag. + string Etag { get; set; } + /// The date and time after which the key will be disallowed access. + global::System.DateTime? Expiration { get; set; } + /// + /// The extended location of the cluster manager associated with the cluster this virtual machine is created on. + /// + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocation ExtendedLocation { get; set; } + /// The resource ID of the extended location on which the resource will be created. + string ExtendedLocationName { get; set; } + /// The extended location type, for example, CustomLocation. + string ExtendedLocationType { get; set; } + /// + /// The resource ID of the private link service that is used to provide virtual machine console access. + /// + string PrivateLinkServiceId { get; set; } + /// The list of the resource properties. + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsoleProperties Property { get; set; } + /// The provisioning state of the virtual machine console. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Succeeded", "Failed", "Canceled", "Provisioning", "Accepted")] + string ProvisioningState { get; set; } + /// + /// The SSH public key that will be provisioned for user access. The user is expected to have the corresponding SSH private + /// key for logging in. + /// + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISshPublicKey SshPublicKey { get; set; } + /// The SSH public key data. + string SshPublicKeyData { get; set; } + /// + /// The unique identifier for the virtual machine that is used to access the console. + /// + string VirtualMachineAccessId { get; set; } + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/Console.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Console.json.cs similarity index 90% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/Console.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Console.json.cs index d3ae987d320d..0da550ba4233 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/Console.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Console.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -65,21 +65,19 @@ internal Console(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.Js { return; } - __trackedResource = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.TrackedResource(json); - {_extendedLocation = If( json?.PropertyT("extendedLocation"), out var __jsonExtendedLocation) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ExtendedLocation.FromJson(__jsonExtendedLocation) : ExtendedLocation;} - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ConsoleProperties.FromJson(__jsonProperties) : Property;} - {_etag = If( json?.PropertyT("etag"), out var __jsonEtag) ? (string)__jsonEtag : (string)Etag;} + __trackedResource = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.TrackedResource(json); + {_extendedLocation = If( json?.PropertyT("extendedLocation"), out var __jsonExtendedLocation) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ExtendedLocation.FromJson(__jsonExtendedLocation) : _extendedLocation;} + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ConsoleProperties.FromJson(__jsonProperties) : _property;} + {_etag = If( json?.PropertyT("etag"), out var __jsonEtag) ? (string)__jsonEtag : (string)_etag;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsole. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsole. /// /// a to deserialize from. - /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsole. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsole FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsole. + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsole FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new Console(json) : null; } @@ -106,7 +104,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode ToJ __trackedResource?.ToJson(container, serializationMode); AddIf( null != this._extendedLocation ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) this._extendedLocation.ToJson(null,serializationMode) : null, "extendedLocation" ,container.Add ); AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._etag)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._etag.ToString()) : null, "etag" ,container.Add ); } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ConsoleList.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ConsoleList.PowerShell.cs similarity index 77% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ConsoleList.PowerShell.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ConsoleList.PowerShell.cs index 991e31d96d6f..a08e5556c164 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ConsoleList.PowerShell.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ConsoleList.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; @@ -63,7 +63,7 @@ public partial class ConsoleList 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 ConsoleList(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsoleListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsoleListInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsoleListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsoleListInternal)this).NextLink, global::System.Convert.ToString); } if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsoleListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsole[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsoleListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ConsoleTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsoleListInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsoleListInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ConsoleTypeConverter.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,37 +103,37 @@ internal ConsoleList(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsoleListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsoleListInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsoleListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsoleListInternal)this).NextLink, global::System.Convert.ToString); } if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsoleListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsole[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsoleListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ConsoleTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsoleListInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsoleListInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ConsoleTypeConverter.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.NetworkCloud.Models.Api20250201.IConsoleList DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsoleList DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ConsoleList(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.NetworkCloud.Models.Api20250201.IConsoleList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsoleList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ConsoleList(content); } @@ -143,7 +143,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsoleList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsoleList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ConsoleList.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ConsoleList.TypeConverter.cs similarity index 98% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ConsoleList.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ConsoleList.TypeConverter.cs index 8253b84603cf..828ebd254465 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ConsoleList.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ConsoleList.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IConsoleList ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsoleList ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsoleList).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsoleList).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ConsoleList.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ConsoleList.cs similarity index 75% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ConsoleList.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ConsoleList.cs index 3d1cd80dcd57..fc36bf3fe011 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ConsoleList.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ConsoleList.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; /// ConsoleList represents a list of virtual machine consoles. public partial class ConsoleList : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsoleList, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsoleListInternal + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsoleList, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsoleListInternal { /// Backing field for property. @@ -21,11 +21,11 @@ public partial class ConsoleList : public string NextLink { get => this._nextLink; set => this._nextLink = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsole[] _value; + private System.Collections.Generic.List _value; /// The list of virtual machine consoles. [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsole[] 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 ConsoleList() @@ -41,6 +41,9 @@ public partial interface IConsoleList : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The link used to get the next page of operations.", SerializedName = @"nextLink", PossibleTypes = new [] { typeof(string) })] @@ -49,10 +52,13 @@ public partial interface IConsoleList : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The list of virtual machine consoles.", SerializedName = @"value", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsole) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsole[] Value { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsole) })] + System.Collections.Generic.List Value { get; set; } } /// ConsoleList represents a list of virtual machine consoles. @@ -62,7 +68,7 @@ internal partial interface IConsoleListInternal /// The link used to get the next page of operations. string NextLink { get; set; } /// The list of virtual machine consoles. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsole[] Value { get; set; } + System.Collections.Generic.List Value { get; set; } } } \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ConsoleList.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ConsoleList.json.cs similarity index 90% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ConsoleList.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ConsoleList.json.cs index 4c22d66d4c60..7ee709d5626d 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ConsoleList.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ConsoleList.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -65,19 +65,19 @@ internal ConsoleList(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Jso { return; } - {_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.NetworkCloud.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.NetworkCloud.Models.Api20250201.IConsole) (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.Console.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.NetworkCloud.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.NetworkCloud.Models.IConsole) (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Console.FromJson(__u) )) ))() : null : _value;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsoleList. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsoleList. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsoleList. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsoleList. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsoleList FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsoleList FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new ConsoleList(json) : null; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ConsolePatchParameters.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ConsolePatchParameters.PowerShell.cs new file mode 100644 index 000000000000..ee160012009d --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ConsolePatchParameters.PowerShell.cs @@ -0,0 +1,206 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + + /// + /// ConsolePatchParameters represents the body of the request to patch the virtual machine console. + /// + [System.ComponentModel.TypeConverter(typeof(ConsolePatchParametersTypeConverter))] + public partial class ConsolePatchParameters + { + + /// + /// 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 ConsolePatchParameters(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.NetworkCloud.Models.IConsolePatchParametersInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsolePatchProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsolePatchParametersInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ConsolePatchPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsolePatchParametersInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsolePatchParametersTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsolePatchParametersInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ConsolePatchParametersTagsTypeConverter.ConvertFrom); + } + if (content.Contains("SshPublicKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsolePatchParametersInternal)this).SshPublicKey = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISshPublicKey) content.GetValueForProperty("SshPublicKey",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsolePatchParametersInternal)this).SshPublicKey, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.SshPublicKeyTypeConverter.ConvertFrom); + } + if (content.Contains("Enabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsolePatchParametersInternal)this).Enabled = (string) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsolePatchParametersInternal)this).Enabled, global::System.Convert.ToString); + } + if (content.Contains("Expiration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsolePatchParametersInternal)this).Expiration = (global::System.DateTime?) content.GetValueForProperty("Expiration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsolePatchParametersInternal)this).Expiration, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SshPublicKeyData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsolePatchParametersInternal)this).SshPublicKeyData = (string) content.GetValueForProperty("SshPublicKeyData",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsolePatchParametersInternal)this).SshPublicKeyData, 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 ConsolePatchParameters(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.NetworkCloud.Models.IConsolePatchParametersInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsolePatchProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsolePatchParametersInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ConsolePatchPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsolePatchParametersInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsolePatchParametersTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsolePatchParametersInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ConsolePatchParametersTagsTypeConverter.ConvertFrom); + } + if (content.Contains("SshPublicKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsolePatchParametersInternal)this).SshPublicKey = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISshPublicKey) content.GetValueForProperty("SshPublicKey",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsolePatchParametersInternal)this).SshPublicKey, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.SshPublicKeyTypeConverter.ConvertFrom); + } + if (content.Contains("Enabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsolePatchParametersInternal)this).Enabled = (string) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsolePatchParametersInternal)this).Enabled, global::System.Convert.ToString); + } + if (content.Contains("Expiration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsolePatchParametersInternal)this).Expiration = (global::System.DateTime?) content.GetValueForProperty("Expiration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsolePatchParametersInternal)this).Expiration, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SshPublicKeyData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsolePatchParametersInternal)this).SshPublicKeyData = (string) content.GetValueForProperty("SshPublicKeyData",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsolePatchParametersInternal)this).SshPublicKeyData, 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.NetworkCloud.Models.IConsolePatchParameters DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ConsolePatchParameters(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.NetworkCloud.Models.IConsolePatchParameters DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ConsolePatchParameters(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.NetworkCloud.Models.IConsolePatchParameters FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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(); + } + } + /// ConsolePatchParameters represents the body of the request to patch the virtual machine console. + [System.ComponentModel.TypeConverter(typeof(ConsolePatchParametersTypeConverter))] + public partial interface IConsolePatchParameters + + { + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ConsolePatchParameters.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ConsolePatchParameters.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ConsolePatchParameters.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ConsolePatchParameters.TypeConverter.cs index 80406b2e4a50..95dd76650246 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ConsolePatchParameters.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ConsolePatchParameters.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IConsolePatchParameters ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsolePatchParameters ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsolePatchParameters).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsolePatchParameters).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ConsolePatchParameters.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ConsolePatchParameters.cs new file mode 100644 index 000000000000..ffc49d6bf0a2 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ConsolePatchParameters.cs @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + + /// + /// ConsolePatchParameters represents the body of the request to patch the virtual machine console. + /// + public partial class ConsolePatchParameters : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsolePatchParameters, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsolePatchParametersInternal + { + + /// The indicator of whether the console access is enabled. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string Enabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsolePatchPropertiesInternal)Property).Enabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsolePatchPropertiesInternal)Property).Enabled = value ?? null; } + + /// The date and time after which the key will be disallowed access. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public global::System.DateTime? Expiration { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsolePatchPropertiesInternal)Property).Expiration; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsolePatchPropertiesInternal)Property).Expiration = value ?? default(global::System.DateTime); } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsolePatchProperties Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsolePatchParametersInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ConsolePatchProperties()); set { {_property = value;} } } + + /// Internal Acessors for SshPublicKey + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISshPublicKey Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsolePatchParametersInternal.SshPublicKey { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsolePatchPropertiesInternal)Property).SshPublicKey; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsolePatchPropertiesInternal)Property).SshPublicKey = value ?? null /* model class */; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsolePatchProperties _property; + + /// The list of the resource properties. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsolePatchProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ConsolePatchProperties()); set => this._property = value; } + + /// The SSH public key data. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string SshPublicKeyData { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsolePatchPropertiesInternal)Property).SshPublicKeyData; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsolePatchPropertiesInternal)Property).SshPublicKeyData = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsolePatchParametersTags _tag; + + /// The Azure resource tags that will replace the existing ones. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsolePatchParametersTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ConsolePatchParametersTags()); set => this._tag = value; } + + /// Creates an new instance. + public ConsolePatchParameters() + { + + } + } + /// ConsolePatchParameters represents the body of the request to patch the virtual machine console. + public partial interface IConsolePatchParameters : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable + { + /// The indicator of whether the console access is enabled. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The indicator of whether the console access is enabled.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("True", "False")] + string Enabled { get; set; } + /// The date and time after which the key will be disallowed access. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The date and time after which the key will be disallowed access.", + SerializedName = @"expiration", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? Expiration { get; set; } + /// The SSH public key data. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The SSH public key data.", + SerializedName = @"keyData", + PossibleTypes = new [] { typeof(string) })] + string SshPublicKeyData { get; set; } + /// The Azure resource tags that will replace the existing ones. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The Azure resource tags that will replace the existing ones.", + SerializedName = @"tags", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsolePatchParametersTags) })] + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsolePatchParametersTags Tag { get; set; } + + } + /// ConsolePatchParameters represents the body of the request to patch the virtual machine console. + internal partial interface IConsolePatchParametersInternal + + { + /// The indicator of whether the console access is enabled. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("True", "False")] + string Enabled { get; set; } + /// The date and time after which the key will be disallowed access. + global::System.DateTime? Expiration { get; set; } + /// The list of the resource properties. + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsolePatchProperties Property { get; set; } + /// + /// The SSH public key that will be provisioned for user access. The user is expected to have the corresponding SSH private + /// key for logging in. + /// + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISshPublicKey SshPublicKey { get; set; } + /// The SSH public key data. + string SshPublicKeyData { get; set; } + /// The Azure resource tags that will replace the existing ones. + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsolePatchParametersTags Tag { get; set; } + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ConsolePatchParameters.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ConsolePatchParameters.json.cs similarity index 93% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ConsolePatchParameters.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ConsolePatchParameters.json.cs index f8887268b2c7..8e5133656eaf 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ConsolePatchParameters.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ConsolePatchParameters.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -67,19 +67,19 @@ internal ConsolePatchParameters(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud. { return; } - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ConsolePatchProperties.FromJson(__jsonProperties) : Property;} - {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ConsolePatchParametersTags.FromJson(__jsonTags) : Tag;} + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ConsolePatchProperties.FromJson(__jsonProperties) : _property;} + {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ConsolePatchParametersTags.FromJson(__jsonTags) : _tag;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsolePatchParameters. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsolePatchParameters. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsolePatchParameters. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsolePatchParameters. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsolePatchParameters FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsolePatchParameters FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new ConsolePatchParameters(json) : null; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ConsolePatchParametersTags.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ConsolePatchParametersTags.PowerShell.cs similarity index 89% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ConsolePatchParametersTags.PowerShell.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ConsolePatchParametersTags.PowerShell.cs index 86d55339efad..983b50bebaf5 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ConsolePatchParametersTags.PowerShell.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ConsolePatchParametersTags.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; @@ -63,7 +63,7 @@ public partial class ConsolePatchParametersTags 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 ConsolePatchParametersTags(global::System.Collections.IDictionary conte } /// - /// 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 ConsolePatchParametersTags(global::System.Management.Automation.PSObjec } /// - /// 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.NetworkCloud.Models.Api20250201.IConsolePatchParametersTags DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsolePatchParametersTags DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ConsolePatchParametersTags(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.NetworkCloud.Models.Api20250201.IConsolePatchParametersTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsolePatchParametersTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ConsolePatchParametersTags(content); } @@ -133,7 +131,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsolePatchParametersTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsolePatchParametersTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ConsolePatchParametersTags.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ConsolePatchParametersTags.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ConsolePatchParametersTags.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ConsolePatchParametersTags.TypeConverter.cs index 5a84e7427756..de4107a53221 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ConsolePatchParametersTags.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ConsolePatchParametersTags.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IConsolePatchParametersTags ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsolePatchParametersTags ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsolePatchParametersTags).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsolePatchParametersTags).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ConsolePatchParametersTags.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ConsolePatchParametersTags.cs similarity index 84% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ConsolePatchParametersTags.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ConsolePatchParametersTags.cs index ecf288e0a5e8..46be9ce48076 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ConsolePatchParametersTags.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ConsolePatchParametersTags.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; /// The Azure resource tags that will replace the existing ones. public partial class ConsolePatchParametersTags : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsolePatchParametersTags, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsolePatchParametersTagsInternal + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsolePatchParametersTags, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsolePatchParametersTagsInternal { /// Creates an new instance. diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ConsolePatchParametersTags.dictionary.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ConsolePatchParametersTags.dictionary.cs similarity index 96% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ConsolePatchParametersTags.dictionary.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ConsolePatchParametersTags.dictionary.cs index 0ff63fe25986..b64fadec2a8c 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ConsolePatchParametersTags.dictionary.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ConsolePatchParametersTags.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.ConsolePatchParametersTags source) => source.__additionalProperties; + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ConsolePatchParametersTags source) => source.__additionalProperties; } } \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ConsolePatchParametersTags.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ConsolePatchParametersTags.json.cs similarity index 95% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ConsolePatchParametersTags.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ConsolePatchParametersTags.json.cs index c3e34bef6e6d..d47ea8b72c5c 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ConsolePatchParametersTags.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ConsolePatchParametersTags.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -71,13 +71,13 @@ internal ConsolePatchParametersTags(Microsoft.Azure.PowerShell.Cmdlets.NetworkCl } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsolePatchParametersTags. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsolePatchParametersTags. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsolePatchParametersTags. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsolePatchParametersTags. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsolePatchParametersTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsolePatchParametersTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new ConsolePatchParametersTags(json) : null; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ConsolePatchProperties.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ConsolePatchProperties.PowerShell.cs new file mode 100644 index 000000000000..e991d32cd83f --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ConsolePatchProperties.PowerShell.cs @@ -0,0 +1,190 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + + /// + /// ConsolePatchProperties represents the properties of the virtual machine console that can be patched. + /// + [System.ComponentModel.TypeConverter(typeof(ConsolePatchPropertiesTypeConverter))] + public partial class ConsolePatchProperties + { + + /// + /// 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 ConsolePatchProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("SshPublicKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsolePatchPropertiesInternal)this).SshPublicKey = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISshPublicKey) content.GetValueForProperty("SshPublicKey",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsolePatchPropertiesInternal)this).SshPublicKey, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.SshPublicKeyTypeConverter.ConvertFrom); + } + if (content.Contains("Enabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsolePatchPropertiesInternal)this).Enabled = (string) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsolePatchPropertiesInternal)this).Enabled, global::System.Convert.ToString); + } + if (content.Contains("Expiration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsolePatchPropertiesInternal)this).Expiration = (global::System.DateTime?) content.GetValueForProperty("Expiration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsolePatchPropertiesInternal)this).Expiration, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SshPublicKeyData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsolePatchPropertiesInternal)this).SshPublicKeyData = (string) content.GetValueForProperty("SshPublicKeyData",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsolePatchPropertiesInternal)this).SshPublicKeyData, 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 ConsolePatchProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("SshPublicKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsolePatchPropertiesInternal)this).SshPublicKey = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISshPublicKey) content.GetValueForProperty("SshPublicKey",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsolePatchPropertiesInternal)this).SshPublicKey, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.SshPublicKeyTypeConverter.ConvertFrom); + } + if (content.Contains("Enabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsolePatchPropertiesInternal)this).Enabled = (string) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsolePatchPropertiesInternal)this).Enabled, global::System.Convert.ToString); + } + if (content.Contains("Expiration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsolePatchPropertiesInternal)this).Expiration = (global::System.DateTime?) content.GetValueForProperty("Expiration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsolePatchPropertiesInternal)this).Expiration, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SshPublicKeyData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsolePatchPropertiesInternal)this).SshPublicKeyData = (string) content.GetValueForProperty("SshPublicKeyData",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsolePatchPropertiesInternal)this).SshPublicKeyData, 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.NetworkCloud.Models.IConsolePatchProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ConsolePatchProperties(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.NetworkCloud.Models.IConsolePatchProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ConsolePatchProperties(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.NetworkCloud.Models.IConsolePatchProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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(); + } + } + /// ConsolePatchProperties represents the properties of the virtual machine console that can be patched. + [System.ComponentModel.TypeConverter(typeof(ConsolePatchPropertiesTypeConverter))] + public partial interface IConsolePatchProperties + + { + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ConsolePatchProperties.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ConsolePatchProperties.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ConsolePatchProperties.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ConsolePatchProperties.TypeConverter.cs index f7855191d748..04b94a11e510 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ConsolePatchProperties.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ConsolePatchProperties.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IConsolePatchProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsolePatchProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsolePatchProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsolePatchProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ConsolePatchProperties.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ConsolePatchProperties.cs new file mode 100644 index 000000000000..f6755f92d980 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ConsolePatchProperties.cs @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + + /// + /// ConsolePatchProperties represents the properties of the virtual machine console that can be patched. + /// + public partial class ConsolePatchProperties : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsolePatchProperties, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsolePatchPropertiesInternal + { + + /// Backing field for property. + private string _enabled; + + /// The indicator of whether the console access is enabled. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string Enabled { get => this._enabled; set => this._enabled = value; } + + /// Backing field for property. + private global::System.DateTime? _expiration; + + /// The date and time after which the key will be disallowed access. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public global::System.DateTime? Expiration { get => this._expiration; set => this._expiration = value; } + + /// Internal Acessors for SshPublicKey + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISshPublicKey Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsolePatchPropertiesInternal.SshPublicKey { get => (this._sshPublicKey = this._sshPublicKey ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.SshPublicKey()); set { {_sshPublicKey = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISshPublicKey _sshPublicKey; + + /// + /// The SSH public key that will be provisioned for user access. The user is expected to have the corresponding SSH private + /// key for logging in. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISshPublicKey SshPublicKey { get => (this._sshPublicKey = this._sshPublicKey ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.SshPublicKey()); set => this._sshPublicKey = value; } + + /// The SSH public key data. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string SshPublicKeyData { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISshPublicKeyInternal)SshPublicKey).KeyData; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISshPublicKeyInternal)SshPublicKey).KeyData = value ?? null; } + + /// Creates an new instance. + public ConsolePatchProperties() + { + + } + } + /// ConsolePatchProperties represents the properties of the virtual machine console that can be patched. + public partial interface IConsolePatchProperties : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable + { + /// The indicator of whether the console access is enabled. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The indicator of whether the console access is enabled.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("True", "False")] + string Enabled { get; set; } + /// The date and time after which the key will be disallowed access. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The date and time after which the key will be disallowed access.", + SerializedName = @"expiration", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? Expiration { get; set; } + /// The SSH public key data. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The SSH public key data.", + SerializedName = @"keyData", + PossibleTypes = new [] { typeof(string) })] + string SshPublicKeyData { get; set; } + + } + /// ConsolePatchProperties represents the properties of the virtual machine console that can be patched. + internal partial interface IConsolePatchPropertiesInternal + + { + /// The indicator of whether the console access is enabled. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("True", "False")] + string Enabled { get; set; } + /// The date and time after which the key will be disallowed access. + global::System.DateTime? Expiration { get; set; } + /// + /// The SSH public key that will be provisioned for user access. The user is expected to have the corresponding SSH private + /// key for logging in. + /// + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISshPublicKey SshPublicKey { get; set; } + /// The SSH public key data. + string SshPublicKeyData { get; set; } + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ConsolePatchProperties.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ConsolePatchProperties.json.cs similarity index 93% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ConsolePatchProperties.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ConsolePatchProperties.json.cs index d8d04f7c4897..bd576aa8f110 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ConsolePatchProperties.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ConsolePatchProperties.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -67,20 +67,20 @@ internal ConsolePatchProperties(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud. { return; } - {_sshPublicKey = If( json?.PropertyT("sshPublicKey"), out var __jsonSshPublicKey) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.SshPublicKey.FromJson(__jsonSshPublicKey) : SshPublicKey;} - {_enabled = If( json?.PropertyT("enabled"), out var __jsonEnabled) ? (string)__jsonEnabled : (string)Enabled;} - {_expiration = If( json?.PropertyT("expiration"), out var __jsonExpiration) ? global::System.DateTime.TryParse((string)__jsonExpiration, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonExpirationValue) ? __jsonExpirationValue : Expiration : Expiration;} + {_sshPublicKey = If( json?.PropertyT("sshPublicKey"), out var __jsonSshPublicKey) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.SshPublicKey.FromJson(__jsonSshPublicKey) : _sshPublicKey;} + {_enabled = If( json?.PropertyT("enabled"), out var __jsonEnabled) ? (string)__jsonEnabled : (string)_enabled;} + {_expiration = If( json?.PropertyT("expiration"), out var __jsonExpiration) ? global::System.DateTime.TryParse((string)__jsonExpiration, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonExpirationValue) ? __jsonExpirationValue : _expiration : _expiration;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsolePatchProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsolePatchProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsolePatchProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsolePatchProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsolePatchProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsolePatchProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new ConsolePatchProperties(json) : null; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ConsoleProperties.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ConsoleProperties.PowerShell.cs new file mode 100644 index 000000000000..65ea018e64e8 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ConsoleProperties.PowerShell.cs @@ -0,0 +1,228 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + + /// ConsoleProperties represents the properties of the virtual machine console. + [System.ComponentModel.TypeConverter(typeof(ConsolePropertiesTypeConverter))] + public partial class ConsoleProperties + { + + /// + /// 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 ConsoleProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("SshPublicKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsolePropertiesInternal)this).SshPublicKey = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISshPublicKey) content.GetValueForProperty("SshPublicKey",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsolePropertiesInternal)this).SshPublicKey, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.SshPublicKeyTypeConverter.ConvertFrom); + } + if (content.Contains("DetailedStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsolePropertiesInternal)this).DetailedStatus = (string) content.GetValueForProperty("DetailedStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsolePropertiesInternal)this).DetailedStatus, global::System.Convert.ToString); + } + if (content.Contains("DetailedStatusMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsolePropertiesInternal)this).DetailedStatusMessage = (string) content.GetValueForProperty("DetailedStatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsolePropertiesInternal)this).DetailedStatusMessage, global::System.Convert.ToString); + } + if (content.Contains("Enabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsolePropertiesInternal)this).Enabled = (string) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsolePropertiesInternal)this).Enabled, global::System.Convert.ToString); + } + if (content.Contains("Expiration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsolePropertiesInternal)this).Expiration = (global::System.DateTime?) content.GetValueForProperty("Expiration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsolePropertiesInternal)this).Expiration, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("PrivateLinkServiceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsolePropertiesInternal)this).PrivateLinkServiceId = (string) content.GetValueForProperty("PrivateLinkServiceId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsolePropertiesInternal)this).PrivateLinkServiceId, global::System.Convert.ToString); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsolePropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsolePropertiesInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("VirtualMachineAccessId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsolePropertiesInternal)this).VirtualMachineAccessId = (string) content.GetValueForProperty("VirtualMachineAccessId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsolePropertiesInternal)this).VirtualMachineAccessId, global::System.Convert.ToString); + } + if (content.Contains("SshPublicKeyData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsolePropertiesInternal)this).SshPublicKeyData = (string) content.GetValueForProperty("SshPublicKeyData",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsolePropertiesInternal)this).SshPublicKeyData, 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 ConsoleProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("SshPublicKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsolePropertiesInternal)this).SshPublicKey = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISshPublicKey) content.GetValueForProperty("SshPublicKey",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsolePropertiesInternal)this).SshPublicKey, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.SshPublicKeyTypeConverter.ConvertFrom); + } + if (content.Contains("DetailedStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsolePropertiesInternal)this).DetailedStatus = (string) content.GetValueForProperty("DetailedStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsolePropertiesInternal)this).DetailedStatus, global::System.Convert.ToString); + } + if (content.Contains("DetailedStatusMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsolePropertiesInternal)this).DetailedStatusMessage = (string) content.GetValueForProperty("DetailedStatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsolePropertiesInternal)this).DetailedStatusMessage, global::System.Convert.ToString); + } + if (content.Contains("Enabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsolePropertiesInternal)this).Enabled = (string) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsolePropertiesInternal)this).Enabled, global::System.Convert.ToString); + } + if (content.Contains("Expiration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsolePropertiesInternal)this).Expiration = (global::System.DateTime?) content.GetValueForProperty("Expiration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsolePropertiesInternal)this).Expiration, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("PrivateLinkServiceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsolePropertiesInternal)this).PrivateLinkServiceId = (string) content.GetValueForProperty("PrivateLinkServiceId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsolePropertiesInternal)this).PrivateLinkServiceId, global::System.Convert.ToString); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsolePropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsolePropertiesInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("VirtualMachineAccessId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsolePropertiesInternal)this).VirtualMachineAccessId = (string) content.GetValueForProperty("VirtualMachineAccessId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsolePropertiesInternal)this).VirtualMachineAccessId, global::System.Convert.ToString); + } + if (content.Contains("SshPublicKeyData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsolePropertiesInternal)this).SshPublicKeyData = (string) content.GetValueForProperty("SshPublicKeyData",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsolePropertiesInternal)this).SshPublicKeyData, 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.NetworkCloud.Models.IConsoleProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ConsoleProperties(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.NetworkCloud.Models.IConsoleProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ConsoleProperties(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.NetworkCloud.Models.IConsoleProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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(); + } + } + /// ConsoleProperties represents the properties of the virtual machine console. + [System.ComponentModel.TypeConverter(typeof(ConsolePropertiesTypeConverter))] + public partial interface IConsoleProperties + + { + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ConsoleProperties.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ConsoleProperties.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ConsoleProperties.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ConsoleProperties.TypeConverter.cs index 5d30b09e0365..10291581cd50 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ConsoleProperties.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ConsoleProperties.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IConsoleProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsoleProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsoleProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsoleProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ConsoleProperties.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ConsoleProperties.cs new file mode 100644 index 000000000000..a96b25c02d81 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ConsoleProperties.cs @@ -0,0 +1,242 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + + /// ConsoleProperties represents the properties of the virtual machine console. + public partial class ConsoleProperties : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsoleProperties, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsolePropertiesInternal + { + + /// Backing field for property. + private string _detailedStatus; + + /// The more detailed status of the console. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string DetailedStatus { get => this._detailedStatus; } + + /// Backing field for property. + private string _detailedStatusMessage; + + /// The descriptive message about the current detailed status. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string DetailedStatusMessage { get => this._detailedStatusMessage; } + + /// Backing field for property. + private string _enabled; + + /// The indicator of whether the console access is enabled. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string Enabled { get => this._enabled; set => this._enabled = value; } + + /// Backing field for property. + private global::System.DateTime? _expiration; + + /// The date and time after which the key will be disallowed access. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public global::System.DateTime? Expiration { get => this._expiration; set => this._expiration = value; } + + /// Internal Acessors for DetailedStatus + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsolePropertiesInternal.DetailedStatus { get => this._detailedStatus; set { {_detailedStatus = value;} } } + + /// Internal Acessors for DetailedStatusMessage + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsolePropertiesInternal.DetailedStatusMessage { get => this._detailedStatusMessage; set { {_detailedStatusMessage = value;} } } + + /// Internal Acessors for PrivateLinkServiceId + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsolePropertiesInternal.PrivateLinkServiceId { get => this._privateLinkServiceId; set { {_privateLinkServiceId = value;} } } + + /// Internal Acessors for ProvisioningState + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsolePropertiesInternal.ProvisioningState { get => this._provisioningState; set { {_provisioningState = value;} } } + + /// Internal Acessors for SshPublicKey + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISshPublicKey Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsolePropertiesInternal.SshPublicKey { get => (this._sshPublicKey = this._sshPublicKey ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.SshPublicKey()); set { {_sshPublicKey = value;} } } + + /// Internal Acessors for VirtualMachineAccessId + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsolePropertiesInternal.VirtualMachineAccessId { get => this._virtualMachineAccessId; set { {_virtualMachineAccessId = value;} } } + + /// Backing field for property. + private string _privateLinkServiceId; + + /// + /// The resource ID of the private link service that is used to provide virtual machine console access. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string PrivateLinkServiceId { get => this._privateLinkServiceId; } + + /// Backing field for property. + private string _provisioningState; + + /// The provisioning state of the virtual machine console. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string ProvisioningState { get => this._provisioningState; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISshPublicKey _sshPublicKey; + + /// + /// The SSH public key that will be provisioned for user access. The user is expected to have the corresponding SSH private + /// key for logging in. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISshPublicKey SshPublicKey { get => (this._sshPublicKey = this._sshPublicKey ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.SshPublicKey()); set => this._sshPublicKey = value; } + + /// The SSH public key data. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string SshPublicKeyData { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISshPublicKeyInternal)SshPublicKey).KeyData; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISshPublicKeyInternal)SshPublicKey).KeyData = value ; } + + /// Backing field for property. + private string _virtualMachineAccessId; + + /// + /// The unique identifier for the virtual machine that is used to access the console. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string VirtualMachineAccessId { get => this._virtualMachineAccessId; } + + /// Creates an new instance. + public ConsoleProperties() + { + + } + } + /// ConsoleProperties represents the properties of the virtual machine console. + public partial interface IConsoleProperties : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable + { + /// The more detailed status of the console. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The more detailed status of the console.", + SerializedName = @"detailedStatus", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Ready", "Error")] + string DetailedStatus { get; } + /// The descriptive message about the current detailed status. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The descriptive message about the current detailed status.", + SerializedName = @"detailedStatusMessage", + PossibleTypes = new [] { typeof(string) })] + string DetailedStatusMessage { get; } + /// The indicator of whether the console access is enabled. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The indicator of whether the console access is enabled.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("True", "False")] + string Enabled { get; set; } + /// The date and time after which the key will be disallowed access. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The date and time after which the key will be disallowed access.", + SerializedName = @"expiration", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? Expiration { get; set; } + /// + /// The resource ID of the private link service that is used to provide virtual machine console access. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The resource ID of the private link service that is used to provide virtual machine console access.", + SerializedName = @"privateLinkServiceId", + PossibleTypes = new [] { typeof(string) })] + string PrivateLinkServiceId { get; } + /// The provisioning state of the virtual machine console. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The provisioning state of the virtual machine console.", + SerializedName = @"provisioningState", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Succeeded", "Failed", "Canceled", "Provisioning", "Accepted")] + string ProvisioningState { get; } + /// The SSH public key data. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The SSH public key data.", + SerializedName = @"keyData", + PossibleTypes = new [] { typeof(string) })] + string SshPublicKeyData { get; set; } + /// + /// The unique identifier for the virtual machine that is used to access the console. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The unique identifier for the virtual machine that is used to access the console.", + SerializedName = @"virtualMachineAccessId", + PossibleTypes = new [] { typeof(string) })] + string VirtualMachineAccessId { get; } + + } + /// ConsoleProperties represents the properties of the virtual machine console. + internal partial interface IConsolePropertiesInternal + + { + /// The more detailed status of the console. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Ready", "Error")] + string DetailedStatus { get; set; } + /// The descriptive message about the current detailed status. + string DetailedStatusMessage { get; set; } + /// The indicator of whether the console access is enabled. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("True", "False")] + string Enabled { get; set; } + /// The date and time after which the key will be disallowed access. + global::System.DateTime? Expiration { get; set; } + /// + /// The resource ID of the private link service that is used to provide virtual machine console access. + /// + string PrivateLinkServiceId { get; set; } + /// The provisioning state of the virtual machine console. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Succeeded", "Failed", "Canceled", "Provisioning", "Accepted")] + string ProvisioningState { get; set; } + /// + /// The SSH public key that will be provisioned for user access. The user is expected to have the corresponding SSH private + /// key for logging in. + /// + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISshPublicKey SshPublicKey { get; set; } + /// The SSH public key data. + string SshPublicKeyData { get; set; } + /// + /// The unique identifier for the virtual machine that is used to access the console. + /// + string VirtualMachineAccessId { get; set; } + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ConsoleProperties.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ConsoleProperties.json.cs similarity index 90% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ConsoleProperties.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ConsoleProperties.json.cs index 3abf6b3b8df9..d45e0bf3189d 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ConsoleProperties.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ConsoleProperties.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -65,25 +65,25 @@ internal ConsoleProperties(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runti { return; } - {_sshPublicKey = If( json?.PropertyT("sshPublicKey"), out var __jsonSshPublicKey) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.SshPublicKey.FromJson(__jsonSshPublicKey) : SshPublicKey;} - {_detailedStatus = If( json?.PropertyT("detailedStatus"), out var __jsonDetailedStatus) ? (string)__jsonDetailedStatus : (string)DetailedStatus;} - {_detailedStatusMessage = If( json?.PropertyT("detailedStatusMessage"), out var __jsonDetailedStatusMessage) ? (string)__jsonDetailedStatusMessage : (string)DetailedStatusMessage;} - {_enabled = If( json?.PropertyT("enabled"), out var __jsonEnabled) ? (string)__jsonEnabled : (string)Enabled;} - {_expiration = If( json?.PropertyT("expiration"), out var __jsonExpiration) ? global::System.DateTime.TryParse((string)__jsonExpiration, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonExpirationValue) ? __jsonExpirationValue : Expiration : Expiration;} - {_privateLinkServiceId = If( json?.PropertyT("privateLinkServiceId"), out var __jsonPrivateLinkServiceId) ? (string)__jsonPrivateLinkServiceId : (string)PrivateLinkServiceId;} - {_provisioningState = If( json?.PropertyT("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)ProvisioningState;} - {_virtualMachineAccessId = If( json?.PropertyT("virtualMachineAccessId"), out var __jsonVirtualMachineAccessId) ? (string)__jsonVirtualMachineAccessId : (string)VirtualMachineAccessId;} + {_sshPublicKey = If( json?.PropertyT("sshPublicKey"), out var __jsonSshPublicKey) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.SshPublicKey.FromJson(__jsonSshPublicKey) : _sshPublicKey;} + {_detailedStatus = If( json?.PropertyT("detailedStatus"), out var __jsonDetailedStatus) ? (string)__jsonDetailedStatus : (string)_detailedStatus;} + {_detailedStatusMessage = If( json?.PropertyT("detailedStatusMessage"), out var __jsonDetailedStatusMessage) ? (string)__jsonDetailedStatusMessage : (string)_detailedStatusMessage;} + {_enabled = If( json?.PropertyT("enabled"), out var __jsonEnabled) ? (string)__jsonEnabled : (string)_enabled;} + {_expiration = If( json?.PropertyT("expiration"), out var __jsonExpiration) ? global::System.DateTime.TryParse((string)__jsonExpiration, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonExpirationValue) ? __jsonExpirationValue : _expiration : _expiration;} + {_privateLinkServiceId = If( json?.PropertyT("privateLinkServiceId"), out var __jsonPrivateLinkServiceId) ? (string)__jsonPrivateLinkServiceId : (string)_privateLinkServiceId;} + {_provisioningState = If( json?.PropertyT("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)_provisioningState;} + {_virtualMachineAccessId = If( json?.PropertyT("virtualMachineAccessId"), out var __jsonVirtualMachineAccessId) ? (string)__jsonVirtualMachineAccessId : (string)_virtualMachineAccessId;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsoleProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsoleProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsoleProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsoleProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsoleProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsoleProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new ConsoleProperties(json) : null; } @@ -108,25 +108,25 @@ public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode ToJ return container; } AddIf( null != this._sshPublicKey ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) this._sshPublicKey.ToJson(null,serializationMode) : null, "sshPublicKey" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._detailedStatus)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._detailedStatus.ToString()) : null, "detailedStatus" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._detailedStatusMessage)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._detailedStatusMessage.ToString()) : null, "detailedStatusMessage" ,container.Add ); } AddIf( null != (((object)this._enabled)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._enabled.ToString()) : null, "enabled" ,container.Add ); AddIf( null != this._expiration ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._expiration?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "expiration" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._privateLinkServiceId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._privateLinkServiceId.ToString()) : null, "privateLinkServiceId" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._provisioningState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._provisioningState.ToString()) : null, "provisioningState" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._virtualMachineAccessId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._virtualMachineAccessId.ToString()) : null, "virtualMachineAccessId" ,container.Add ); } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ControlPlaneNodeConfiguration.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ControlPlaneNodeConfiguration.PowerShell.cs new file mode 100644 index 000000000000..7ff161d195f7 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ControlPlaneNodeConfiguration.PowerShell.cs @@ -0,0 +1,208 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + + /// + /// ControlPlaneNodeConfiguration represents the selection of virtual machines and size of the control plane for a Kubernetes + /// cluster. + /// + [System.ComponentModel.TypeConverter(typeof(ControlPlaneNodeConfigurationTypeConverter))] + public partial class ControlPlaneNodeConfiguration + { + + /// + /// 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 ControlPlaneNodeConfiguration(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("AdministratorConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IControlPlaneNodeConfigurationInternal)this).AdministratorConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministratorConfiguration) content.GetValueForProperty("AdministratorConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IControlPlaneNodeConfigurationInternal)this).AdministratorConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AdministratorConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("AvailabilityZone")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IControlPlaneNodeConfigurationInternal)this).AvailabilityZone = (System.Collections.Generic.List) content.GetValueForProperty("AvailabilityZone",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IControlPlaneNodeConfigurationInternal)this).AvailabilityZone, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("Count")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IControlPlaneNodeConfigurationInternal)this).Count = (long) content.GetValueForProperty("Count",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IControlPlaneNodeConfigurationInternal)this).Count, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("VMSkuName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IControlPlaneNodeConfigurationInternal)this).VMSkuName = (string) content.GetValueForProperty("VMSkuName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IControlPlaneNodeConfigurationInternal)this).VMSkuName, global::System.Convert.ToString); + } + if (content.Contains("AdministratorConfigurationAdminUsername")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IControlPlaneNodeConfigurationInternal)this).AdministratorConfigurationAdminUsername = (string) content.GetValueForProperty("AdministratorConfigurationAdminUsername",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IControlPlaneNodeConfigurationInternal)this).AdministratorConfigurationAdminUsername, global::System.Convert.ToString); + } + if (content.Contains("AdministratorConfigurationSshPublicKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IControlPlaneNodeConfigurationInternal)this).AdministratorConfigurationSshPublicKey = (System.Collections.Generic.List) content.GetValueForProperty("AdministratorConfigurationSshPublicKey",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IControlPlaneNodeConfigurationInternal)this).AdministratorConfigurationSshPublicKey, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.SshPublicKeyTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ControlPlaneNodeConfiguration(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("AdministratorConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IControlPlaneNodeConfigurationInternal)this).AdministratorConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministratorConfiguration) content.GetValueForProperty("AdministratorConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IControlPlaneNodeConfigurationInternal)this).AdministratorConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AdministratorConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("AvailabilityZone")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IControlPlaneNodeConfigurationInternal)this).AvailabilityZone = (System.Collections.Generic.List) content.GetValueForProperty("AvailabilityZone",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IControlPlaneNodeConfigurationInternal)this).AvailabilityZone, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("Count")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IControlPlaneNodeConfigurationInternal)this).Count = (long) content.GetValueForProperty("Count",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IControlPlaneNodeConfigurationInternal)this).Count, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("VMSkuName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IControlPlaneNodeConfigurationInternal)this).VMSkuName = (string) content.GetValueForProperty("VMSkuName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IControlPlaneNodeConfigurationInternal)this).VMSkuName, global::System.Convert.ToString); + } + if (content.Contains("AdministratorConfigurationAdminUsername")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IControlPlaneNodeConfigurationInternal)this).AdministratorConfigurationAdminUsername = (string) content.GetValueForProperty("AdministratorConfigurationAdminUsername",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IControlPlaneNodeConfigurationInternal)this).AdministratorConfigurationAdminUsername, global::System.Convert.ToString); + } + if (content.Contains("AdministratorConfigurationSshPublicKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IControlPlaneNodeConfigurationInternal)this).AdministratorConfigurationSshPublicKey = (System.Collections.Generic.List) content.GetValueForProperty("AdministratorConfigurationSshPublicKey",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IControlPlaneNodeConfigurationInternal)this).AdministratorConfigurationSshPublicKey, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.SshPublicKeyTypeConverter.ConvertFrom)); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IControlPlaneNodeConfiguration DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ControlPlaneNodeConfiguration(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.NetworkCloud.Models.IControlPlaneNodeConfiguration DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ControlPlaneNodeConfiguration(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.NetworkCloud.Models.IControlPlaneNodeConfiguration FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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(); + } + } + /// ControlPlaneNodeConfiguration represents the selection of virtual machines and size of the control plane for a Kubernetes + /// cluster. + [System.ComponentModel.TypeConverter(typeof(ControlPlaneNodeConfigurationTypeConverter))] + public partial interface IControlPlaneNodeConfiguration + + { + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ControlPlaneNodeConfiguration.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ControlPlaneNodeConfiguration.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ControlPlaneNodeConfiguration.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ControlPlaneNodeConfiguration.TypeConverter.cs index 930f1edf2ff1..25064b61f7c3 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ControlPlaneNodeConfiguration.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ControlPlaneNodeConfiguration.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IControlPlaneNodeConfiguration ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IControlPlaneNodeConfiguration ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IControlPlaneNodeConfiguration).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IControlPlaneNodeConfiguration).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ControlPlaneNodeConfiguration.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ControlPlaneNodeConfiguration.cs new file mode 100644 index 000000000000..33bd630b18b6 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ControlPlaneNodeConfiguration.cs @@ -0,0 +1,172 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + + /// + /// ControlPlaneNodeConfiguration represents the selection of virtual machines and size of the control plane for a Kubernetes + /// cluster. + /// + public partial class ControlPlaneNodeConfiguration : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IControlPlaneNodeConfiguration, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IControlPlaneNodeConfigurationInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministratorConfiguration _administratorConfiguration; + + /// The administrator credentials to be used for the nodes in the control plane. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministratorConfiguration AdministratorConfiguration { get => (this._administratorConfiguration = this._administratorConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AdministratorConfiguration()); set => this._administratorConfiguration = value; } + + /// + /// The user name for the administrator that will be applied to the operating systems that run Kubernetes nodes. If not supplied, + /// a user name will be chosen by the service. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string AdministratorConfigurationAdminUsername { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministratorConfigurationInternal)AdministratorConfiguration).AdminUsername; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministratorConfigurationInternal)AdministratorConfiguration).AdminUsername = value ?? null; } + + /// + /// The SSH configuration for the operating systems that run the nodes in the Kubernetes cluster. In some cases, specification + /// of public keys may be required to produce a working environment. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public System.Collections.Generic.List AdministratorConfigurationSshPublicKey { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministratorConfigurationInternal)AdministratorConfiguration).SshPublicKey; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministratorConfigurationInternal)AdministratorConfiguration).SshPublicKey = value ?? null /* arrayOf */; } + + /// Backing field for property. + private System.Collections.Generic.List _availabilityZone; + + /// + /// The list of availability zones of the Network Cloud cluster to be used for the provisioning of nodes in the control plane. + /// If not specified, all availability zones will be used. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public System.Collections.Generic.List AvailabilityZone { get => this._availabilityZone; set => this._availabilityZone = value; } + + /// Backing field for property. + private long _count; + + /// The number of virtual machines that use this configuration. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public long Count { get => this._count; set => this._count = value; } + + /// Internal Acessors for AdministratorConfiguration + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministratorConfiguration Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IControlPlaneNodeConfigurationInternal.AdministratorConfiguration { get => (this._administratorConfiguration = this._administratorConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AdministratorConfiguration()); set { {_administratorConfiguration = value;} } } + + /// Backing field for property. + private string _vMSkuName; + + /// The name of the VM SKU supplied during creation. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string VMSkuName { get => this._vMSkuName; set => this._vMSkuName = value; } + + /// Creates an new instance. + public ControlPlaneNodeConfiguration() + { + + } + } + /// ControlPlaneNodeConfiguration represents the selection of virtual machines and size of the control plane for a Kubernetes + /// cluster. + public partial interface IControlPlaneNodeConfiguration : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable + { + /// + /// The user name for the administrator that will be applied to the operating systems that run Kubernetes nodes. If not supplied, + /// a user name will be chosen by the service. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The user name for the administrator that will be applied to the operating systems that run Kubernetes nodes. If not supplied, a user name will be chosen by the service.", + SerializedName = @"adminUsername", + PossibleTypes = new [] { typeof(string) })] + string AdministratorConfigurationAdminUsername { get; set; } + /// + /// The SSH configuration for the operating systems that run the nodes in the Kubernetes cluster. In some cases, specification + /// of public keys may be required to produce a working environment. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The SSH configuration for the operating systems that run the nodes in the Kubernetes cluster. In some cases, specification of public keys may be required to produce a working environment.", + SerializedName = @"sshPublicKeys", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISshPublicKey) })] + System.Collections.Generic.List AdministratorConfigurationSshPublicKey { get; set; } + /// + /// The list of availability zones of the Network Cloud cluster to be used for the provisioning of nodes in the control plane. + /// If not specified, all availability zones will be used. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The list of availability zones of the Network Cloud cluster to be used for the provisioning of nodes in the control plane. If not specified, all availability zones will be used.", + SerializedName = @"availabilityZones", + PossibleTypes = new [] { typeof(string) })] + System.Collections.Generic.List AvailabilityZone { get; set; } + /// The number of virtual machines that use this configuration. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The number of virtual machines that use this configuration.", + SerializedName = @"count", + PossibleTypes = new [] { typeof(long) })] + long Count { get; set; } + /// The name of the VM SKU supplied during creation. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The name of the VM SKU supplied during creation.", + SerializedName = @"vmSkuName", + PossibleTypes = new [] { typeof(string) })] + string VMSkuName { get; set; } + + } + /// ControlPlaneNodeConfiguration represents the selection of virtual machines and size of the control plane for a Kubernetes + /// cluster. + internal partial interface IControlPlaneNodeConfigurationInternal + + { + /// The administrator credentials to be used for the nodes in the control plane. + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministratorConfiguration AdministratorConfiguration { get; set; } + /// + /// The user name for the administrator that will be applied to the operating systems that run Kubernetes nodes. If not supplied, + /// a user name will be chosen by the service. + /// + string AdministratorConfigurationAdminUsername { get; set; } + /// + /// The SSH configuration for the operating systems that run the nodes in the Kubernetes cluster. In some cases, specification + /// of public keys may be required to produce a working environment. + /// + System.Collections.Generic.List AdministratorConfigurationSshPublicKey { get; set; } + /// + /// The list of availability zones of the Network Cloud cluster to be used for the provisioning of nodes in the control plane. + /// If not specified, all availability zones will be used. + /// + System.Collections.Generic.List AvailabilityZone { get; set; } + /// The number of virtual machines that use this configuration. + long Count { get; set; } + /// The name of the VM SKU supplied during creation. + string VMSkuName { get; set; } + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ControlPlaneNodeConfiguration.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ControlPlaneNodeConfiguration.json.cs similarity index 79% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ControlPlaneNodeConfiguration.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ControlPlaneNodeConfiguration.json.cs index 6fb0a921379d..4a0a99ddb5b9 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ControlPlaneNodeConfiguration.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ControlPlaneNodeConfiguration.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -68,21 +68,21 @@ internal ControlPlaneNodeConfiguration(Microsoft.Azure.PowerShell.Cmdlets.Networ { return; } - {_administratorConfiguration = If( json?.PropertyT("administratorConfiguration"), out var __jsonAdministratorConfiguration) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AdministratorConfiguration.FromJson(__jsonAdministratorConfiguration) : AdministratorConfiguration;} - {_availabilityZone = If( json?.PropertyT("availabilityZones"), out var __jsonAvailabilityZones) ? If( __jsonAvailabilityZones as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : AvailabilityZone;} - {_count = If( json?.PropertyT("count"), out var __jsonCount) ? (long)__jsonCount : Count;} - {_vMSkuName = If( json?.PropertyT("vmSkuName"), out var __jsonVMSkuName) ? (string)__jsonVMSkuName : (string)VMSkuName;} + {_administratorConfiguration = If( json?.PropertyT("administratorConfiguration"), out var __jsonAdministratorConfiguration) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AdministratorConfiguration.FromJson(__jsonAdministratorConfiguration) : _administratorConfiguration;} + {_availabilityZone = If( json?.PropertyT("availabilityZones"), out var __jsonAvailabilityZones) ? If( __jsonAvailabilityZones as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : _availabilityZone;} + {_count = If( json?.PropertyT("count"), out var __jsonCount) ? (long)__jsonCount : _count;} + {_vMSkuName = If( json?.PropertyT("vmSkuName"), out var __jsonVMSkuName) ? (string)__jsonVMSkuName : (string)_vMSkuName;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IControlPlaneNodeConfiguration. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IControlPlaneNodeConfiguration. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IControlPlaneNodeConfiguration. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IControlPlaneNodeConfiguration. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IControlPlaneNodeConfiguration FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IControlPlaneNodeConfiguration FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new ControlPlaneNodeConfiguration(json) : null; } @@ -106,15 +106,21 @@ public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode ToJ { return container; } - AddIf( null != this._administratorConfiguration ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) this._administratorConfiguration.ToJson(null,serializationMode) : null, "administratorConfiguration" ,container.Add ); - if (null != this._availabilityZone) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)||serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate)) { - var __w = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.XNodeArray(); - foreach( var __x in this._availabilityZone ) + AddIf( null != this._administratorConfiguration ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) this._administratorConfiguration.ToJson(null,serializationMode) : null, "administratorConfiguration" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)||serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate)) + { + if (null != this._availabilityZone) { - AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + var __w = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.XNodeArray(); + foreach( var __x in this._availabilityZone ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("availabilityZones",__w); } - container.Add("availabilityZones",__w); } AddIf( (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNumber(this._count), "count" ,container.Add ); AddIf( null != (((object)this._vMSkuName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._vMSkuName.ToString()) : null, "vmSkuName" ,container.Add ); diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ControlPlaneNodePatchConfiguration.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ControlPlaneNodePatchConfiguration.PowerShell.cs new file mode 100644 index 000000000000..0767d58ff648 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ControlPlaneNodePatchConfiguration.PowerShell.cs @@ -0,0 +1,188 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + + /// + /// ControlPlaneNodePatchConfiguration represents the properties of the control plane that can be patched for this Kubernetes + /// cluster. + /// + [System.ComponentModel.TypeConverter(typeof(ControlPlaneNodePatchConfigurationTypeConverter))] + public partial class ControlPlaneNodePatchConfiguration + { + + /// + /// 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 ControlPlaneNodePatchConfiguration(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("AdministratorConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IControlPlaneNodePatchConfigurationInternal)this).AdministratorConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministratorConfigurationPatch) content.GetValueForProperty("AdministratorConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IControlPlaneNodePatchConfigurationInternal)this).AdministratorConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AdministratorConfigurationPatchTypeConverter.ConvertFrom); + } + if (content.Contains("Count")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IControlPlaneNodePatchConfigurationInternal)this).Count = (long?) content.GetValueForProperty("Count",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IControlPlaneNodePatchConfigurationInternal)this).Count, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("AdministratorConfigurationSshPublicKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IControlPlaneNodePatchConfigurationInternal)this).AdministratorConfigurationSshPublicKey = (System.Collections.Generic.List) content.GetValueForProperty("AdministratorConfigurationSshPublicKey",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IControlPlaneNodePatchConfigurationInternal)this).AdministratorConfigurationSshPublicKey, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.SshPublicKeyTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ControlPlaneNodePatchConfiguration(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("AdministratorConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IControlPlaneNodePatchConfigurationInternal)this).AdministratorConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministratorConfigurationPatch) content.GetValueForProperty("AdministratorConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IControlPlaneNodePatchConfigurationInternal)this).AdministratorConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AdministratorConfigurationPatchTypeConverter.ConvertFrom); + } + if (content.Contains("Count")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IControlPlaneNodePatchConfigurationInternal)this).Count = (long?) content.GetValueForProperty("Count",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IControlPlaneNodePatchConfigurationInternal)this).Count, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("AdministratorConfigurationSshPublicKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IControlPlaneNodePatchConfigurationInternal)this).AdministratorConfigurationSshPublicKey = (System.Collections.Generic.List) content.GetValueForProperty("AdministratorConfigurationSshPublicKey",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IControlPlaneNodePatchConfigurationInternal)this).AdministratorConfigurationSshPublicKey, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.SshPublicKeyTypeConverter.ConvertFrom)); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IControlPlaneNodePatchConfiguration DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ControlPlaneNodePatchConfiguration(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.NetworkCloud.Models.IControlPlaneNodePatchConfiguration DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ControlPlaneNodePatchConfiguration(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.NetworkCloud.Models.IControlPlaneNodePatchConfiguration FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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(); + } + } + /// ControlPlaneNodePatchConfiguration represents the properties of the control plane that can be patched for this Kubernetes + /// cluster. + [System.ComponentModel.TypeConverter(typeof(ControlPlaneNodePatchConfigurationTypeConverter))] + public partial interface IControlPlaneNodePatchConfiguration + + { + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ControlPlaneNodePatchConfiguration.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ControlPlaneNodePatchConfiguration.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ControlPlaneNodePatchConfiguration.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ControlPlaneNodePatchConfiguration.TypeConverter.cs index 7a73483b7cab..590583f5c066 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ControlPlaneNodePatchConfiguration.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ControlPlaneNodePatchConfiguration.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IControlPlaneNodePatchConfiguration ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IControlPlaneNodePatchConfiguration ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IControlPlaneNodePatchConfiguration).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IControlPlaneNodePatchConfiguration).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ControlPlaneNodePatchConfiguration.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ControlPlaneNodePatchConfiguration.cs new file mode 100644 index 000000000000..56c1a0425534 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ControlPlaneNodePatchConfiguration.cs @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + + /// + /// ControlPlaneNodePatchConfiguration represents the properties of the control plane that can be patched for this Kubernetes + /// cluster. + /// + public partial class ControlPlaneNodePatchConfiguration : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IControlPlaneNodePatchConfiguration, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IControlPlaneNodePatchConfigurationInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministratorConfigurationPatch _administratorConfiguration; + + /// The configuration of administrator credentials for the control plane nodes. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministratorConfigurationPatch AdministratorConfiguration { get => (this._administratorConfiguration = this._administratorConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AdministratorConfigurationPatch()); set => this._administratorConfiguration = value; } + + /// + /// SshPublicKey represents the public key used to authenticate with a resource through SSH. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public System.Collections.Generic.List AdministratorConfigurationSshPublicKey { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministratorConfigurationPatchInternal)AdministratorConfiguration).SshPublicKey; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministratorConfigurationPatchInternal)AdministratorConfiguration).SshPublicKey = value ?? null /* arrayOf */; } + + /// Backing field for property. + private long? _count; + + /// The number of virtual machines that use this configuration. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public long? Count { get => this._count; set => this._count = value; } + + /// Internal Acessors for AdministratorConfiguration + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministratorConfigurationPatch Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IControlPlaneNodePatchConfigurationInternal.AdministratorConfiguration { get => (this._administratorConfiguration = this._administratorConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AdministratorConfigurationPatch()); set { {_administratorConfiguration = value;} } } + + /// Creates an new instance. + public ControlPlaneNodePatchConfiguration() + { + + } + } + /// ControlPlaneNodePatchConfiguration represents the properties of the control plane that can be patched for this Kubernetes + /// cluster. + public partial interface IControlPlaneNodePatchConfiguration : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable + { + /// + /// SshPublicKey represents the public key used to authenticate with a resource through SSH. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"SshPublicKey represents the public key used to authenticate with a resource through SSH.", + SerializedName = @"sshPublicKeys", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISshPublicKey) })] + System.Collections.Generic.List AdministratorConfigurationSshPublicKey { get; set; } + /// The number of virtual machines that use this configuration. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The number of virtual machines that use this configuration.", + SerializedName = @"count", + PossibleTypes = new [] { typeof(long) })] + long? Count { get; set; } + + } + /// ControlPlaneNodePatchConfiguration represents the properties of the control plane that can be patched for this Kubernetes + /// cluster. + internal partial interface IControlPlaneNodePatchConfigurationInternal + + { + /// The configuration of administrator credentials for the control plane nodes. + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministratorConfigurationPatch AdministratorConfiguration { get; set; } + /// + /// SshPublicKey represents the public key used to authenticate with a resource through SSH. + /// + System.Collections.Generic.List AdministratorConfigurationSshPublicKey { get; set; } + /// The number of virtual machines that use this configuration. + long? Count { get; set; } + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ControlPlaneNodePatchConfiguration.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ControlPlaneNodePatchConfiguration.json.cs similarity index 93% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ControlPlaneNodePatchConfiguration.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ControlPlaneNodePatchConfiguration.json.cs index f8616beaed45..b3b3b5260c04 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ControlPlaneNodePatchConfiguration.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ControlPlaneNodePatchConfiguration.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -68,19 +68,19 @@ internal ControlPlaneNodePatchConfiguration(Microsoft.Azure.PowerShell.Cmdlets.N { return; } - {_administratorConfiguration = If( json?.PropertyT("administratorConfiguration"), out var __jsonAdministratorConfiguration) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AdministratorConfigurationPatch.FromJson(__jsonAdministratorConfiguration) : AdministratorConfiguration;} - {_count = If( json?.PropertyT("count"), out var __jsonCount) ? (long?)__jsonCount : Count;} + {_administratorConfiguration = If( json?.PropertyT("administratorConfiguration"), out var __jsonAdministratorConfiguration) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AdministratorConfigurationPatch.FromJson(__jsonAdministratorConfiguration) : _administratorConfiguration;} + {_count = If( json?.PropertyT("count"), out var __jsonCount) ? (long?)__jsonCount : _count;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IControlPlaneNodePatchConfiguration. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IControlPlaneNodePatchConfiguration. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IControlPlaneNodePatchConfiguration. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IControlPlaneNodePatchConfiguration. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IControlPlaneNodePatchConfiguration FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IControlPlaneNodePatchConfiguration FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new ControlPlaneNodePatchConfiguration(json) : null; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/EgressEndpoint.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/EgressEndpoint.PowerShell.cs similarity index 77% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/EgressEndpoint.PowerShell.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/EgressEndpoint.PowerShell.cs index 982803a5b2a7..a197cc662fd5 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/EgressEndpoint.PowerShell.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/EgressEndpoint.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; @@ -65,33 +65,33 @@ public partial class EgressEndpoint 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.NetworkCloud.Models.Api20250201.IEgressEndpoint DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IEgressEndpoint DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new EgressEndpoint(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.NetworkCloud.Models.Api20250201.IEgressEndpoint DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IEgressEndpoint DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new EgressEndpoint(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 +106,17 @@ internal EgressEndpoint(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Category")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IEgressEndpointInternal)this).Category = (string) content.GetValueForProperty("Category",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IEgressEndpointInternal)this).Category, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IEgressEndpointInternal)this).Category = (string) content.GetValueForProperty("Category",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IEgressEndpointInternal)this).Category, global::System.Convert.ToString); } if (content.Contains("Endpoint")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IEgressEndpointInternal)this).Endpoint = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IEndpointDependency[]) content.GetValueForProperty("Endpoint",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IEgressEndpointInternal)this).Endpoint, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.EndpointDependencyTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IEgressEndpointInternal)this).Endpoint = (System.Collections.Generic.List) content.GetValueForProperty("Endpoint",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IEgressEndpointInternal)this).Endpoint, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.EndpointDependencyTypeConverter.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. @@ -131,11 +131,11 @@ internal EgressEndpoint(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Category")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IEgressEndpointInternal)this).Category = (string) content.GetValueForProperty("Category",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IEgressEndpointInternal)this).Category, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IEgressEndpointInternal)this).Category = (string) content.GetValueForProperty("Category",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IEgressEndpointInternal)this).Category, global::System.Convert.ToString); } if (content.Contains("Endpoint")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IEgressEndpointInternal)this).Endpoint = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IEndpointDependency[]) content.GetValueForProperty("Endpoint",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IEgressEndpointInternal)this).Endpoint, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.EndpointDependencyTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IEgressEndpointInternal)this).Endpoint = (System.Collections.Generic.List) content.GetValueForProperty("Endpoint",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IEgressEndpointInternal)this).Endpoint, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.EndpointDependencyTypeConverter.ConvertFrom)); } AfterDeserializePSObject(content); } @@ -145,7 +145,7 @@ internal EgressEndpoint(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.NetworkCloud.Models.Api20250201.IEgressEndpoint FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IEgressEndpoint FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/EgressEndpoint.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/EgressEndpoint.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/EgressEndpoint.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/EgressEndpoint.TypeConverter.cs index c6d61f58d154..5ddb1f4cf999 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/EgressEndpoint.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/EgressEndpoint.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IEgressEndpoint ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IEgressEndpoint ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IEgressEndpoint).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IEgressEndpoint).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/EgressEndpoint.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/EgressEndpoint.cs similarity index 79% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/EgressEndpoint.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/EgressEndpoint.cs index 304cae204bb1..a022961ed0c7 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/EgressEndpoint.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/EgressEndpoint.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -11,8 +11,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201 /// EgressEndpoint represents the connection from a cloud services network to the specified endpoint for a common purpose. /// public partial class EgressEndpoint : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IEgressEndpoint, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IEgressEndpointInternal + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IEgressEndpoint, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IEgressEndpointInternal { /// Backing field for property. @@ -26,11 +26,11 @@ public partial class EgressEndpoint : public string Category { get => this._category; set => this._category = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IEndpointDependency[] _endpoint; + private System.Collections.Generic.List _endpoint; /// The list of endpoint dependencies. [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IEndpointDependency[] Endpoint { get => this._endpoint; set => this._endpoint = value; } + public System.Collections.Generic.List Endpoint { get => this._endpoint; set => this._endpoint = value; } /// Creates an new instance. public EgressEndpoint() @@ -49,6 +49,9 @@ public partial interface IEgressEndpoint : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The descriptive category name of endpoints accessible by the AKS agent node. For example, azure-resource-management, API server, etc. The platform egress endpoints provided by default will use the category 'default'.", SerializedName = @"category", PossibleTypes = new [] { typeof(string) })] @@ -57,10 +60,13 @@ public partial interface IEgressEndpoint : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The list of endpoint dependencies.", SerializedName = @"endpoints", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IEndpointDependency) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IEndpointDependency[] Endpoint { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IEndpointDependency) })] + System.Collections.Generic.List Endpoint { get; set; } } /// EgressEndpoint represents the connection from a cloud services network to the specified endpoint for a common purpose. @@ -73,7 +79,7 @@ internal partial interface IEgressEndpointInternal /// string Category { get; set; } /// The list of endpoint dependencies. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IEndpointDependency[] Endpoint { get; set; } + System.Collections.Generic.List Endpoint { get; set; } } } \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/EgressEndpoint.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/EgressEndpoint.json.cs similarity index 90% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/EgressEndpoint.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/EgressEndpoint.json.cs index 2dc755299eef..77347569f6e6 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/EgressEndpoint.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/EgressEndpoint.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -67,19 +67,19 @@ internal EgressEndpoint(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime. { return; } - {_category = If( json?.PropertyT("category"), out var __jsonCategory) ? (string)__jsonCategory : (string)Category;} - {_endpoint = If( json?.PropertyT("endpoints"), out var __jsonEndpoints) ? If( __jsonEndpoints as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IEndpointDependency) (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.EndpointDependency.FromJson(__u) )) ))() : null : Endpoint;} + {_category = If( json?.PropertyT("category"), out var __jsonCategory) ? (string)__jsonCategory : (string)_category;} + {_endpoint = If( json?.PropertyT("endpoints"), out var __jsonEndpoints) ? If( __jsonEndpoints as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.IEndpointDependency) (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.EndpointDependency.FromJson(__u) )) ))() : null : _endpoint;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IEgressEndpoint. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IEgressEndpoint. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IEgressEndpoint. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IEgressEndpoint. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IEgressEndpoint FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IEgressEndpoint FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new EgressEndpoint(json) : null; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/EndpointDependency.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/EndpointDependency.PowerShell.cs similarity index 80% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/EndpointDependency.PowerShell.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/EndpointDependency.PowerShell.cs index c1e7dc37d70e..a2c6fb0270a2 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/EndpointDependency.PowerShell.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/EndpointDependency.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; @@ -65,33 +65,33 @@ public partial class EndpointDependency 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.NetworkCloud.Models.Api20250201.IEndpointDependency DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IEndpointDependency DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new EndpointDependency(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.NetworkCloud.Models.Api20250201.IEndpointDependency DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IEndpointDependency DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new EndpointDependency(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 +106,17 @@ internal EndpointDependency(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("DomainName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IEndpointDependencyInternal)this).DomainName = (string) content.GetValueForProperty("DomainName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IEndpointDependencyInternal)this).DomainName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IEndpointDependencyInternal)this).DomainName = (string) content.GetValueForProperty("DomainName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IEndpointDependencyInternal)this).DomainName, global::System.Convert.ToString); } if (content.Contains("Port")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IEndpointDependencyInternal)this).Port = (long?) content.GetValueForProperty("Port",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IEndpointDependencyInternal)this).Port, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IEndpointDependencyInternal)this).Port = (long?) content.GetValueForProperty("Port",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IEndpointDependencyInternal)this).Port, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); } 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 +131,11 @@ internal EndpointDependency(global::System.Management.Automation.PSObject conten // actually deserialize if (content.Contains("DomainName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IEndpointDependencyInternal)this).DomainName = (string) content.GetValueForProperty("DomainName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IEndpointDependencyInternal)this).DomainName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IEndpointDependencyInternal)this).DomainName = (string) content.GetValueForProperty("DomainName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IEndpointDependencyInternal)this).DomainName, global::System.Convert.ToString); } if (content.Contains("Port")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IEndpointDependencyInternal)this).Port = (long?) content.GetValueForProperty("Port",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IEndpointDependencyInternal)this).Port, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IEndpointDependencyInternal)this).Port = (long?) content.GetValueForProperty("Port",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IEndpointDependencyInternal)this).Port, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); } AfterDeserializePSObject(content); } @@ -145,7 +145,7 @@ internal EndpointDependency(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.NetworkCloud.Models.Api20250201.IEndpointDependency FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IEndpointDependency FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/EndpointDependency.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/EndpointDependency.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/EndpointDependency.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/EndpointDependency.TypeConverter.cs index 7948664b47b0..feb2d303cca6 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/EndpointDependency.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/EndpointDependency.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IEndpointDependency ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IEndpointDependency ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IEndpointDependency).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IEndpointDependency).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/EndpointDependency.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/EndpointDependency.cs similarity index 90% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/EndpointDependency.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/EndpointDependency.cs index 825863567d20..33bc829cd906 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/EndpointDependency.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/EndpointDependency.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -11,8 +11,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201 /// EndpointDependency represents the definition of an endpoint, including the domain and details. /// public partial class EndpointDependency : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IEndpointDependency, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IEndpointDependencyInternal + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IEndpointDependency, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IEndpointDependencyInternal { /// Backing field for property. @@ -43,6 +43,9 @@ public partial interface IEndpointDependency : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The domain name of the dependency.", SerializedName = @"domainName", PossibleTypes = new [] { typeof(string) })] @@ -51,6 +54,9 @@ public partial interface IEndpointDependency : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The port of this endpoint.", SerializedName = @"port", PossibleTypes = new [] { typeof(long) })] diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/EndpointDependency.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/EndpointDependency.json.cs similarity index 95% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/EndpointDependency.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/EndpointDependency.json.cs index b44ec1ad7727..be5d18bd6bdb 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/EndpointDependency.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/EndpointDependency.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -67,19 +67,19 @@ internal EndpointDependency(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runt { return; } - {_domainName = If( json?.PropertyT("domainName"), out var __jsonDomainName) ? (string)__jsonDomainName : (string)DomainName;} - {_port = If( json?.PropertyT("port"), out var __jsonPort) ? (long?)__jsonPort : Port;} + {_domainName = If( json?.PropertyT("domainName"), out var __jsonDomainName) ? (string)__jsonDomainName : (string)_domainName;} + {_port = If( json?.PropertyT("port"), out var __jsonPort) ? (long?)__jsonPort : _port;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IEndpointDependency. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IEndpointDependency. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IEndpointDependency. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IEndpointDependency. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IEndpointDependency FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IEndpointDependency FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new EndpointDependency(json) : null; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api50/ErrorAdditionalInfo.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ErrorAdditionalInfo.PowerShell.cs similarity index 80% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api50/ErrorAdditionalInfo.PowerShell.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ErrorAdditionalInfo.PowerShell.cs index 0c3155f60873..ba1c192ac333 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api50/ErrorAdditionalInfo.PowerShell.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ErrorAdditionalInfo.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.NetworkCloud.Models.Api50 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; @@ -63,33 +63,33 @@ public partial class ErrorAdditionalInfo 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.NetworkCloud.Models.Api50.IErrorAdditionalInfo DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IErrorAdditionalInfo DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ErrorAdditionalInfo(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.NetworkCloud.Models.Api50.IErrorAdditionalInfo DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IErrorAdditionalInfo DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ErrorAdditionalInfo(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -104,17 +104,17 @@ internal ErrorAdditionalInfo(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorAdditionalInfoInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorAdditionalInfoInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IErrorAdditionalInfoInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IErrorAdditionalInfoInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("Info")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorAdditionalInfoInternal)this).Info = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAny) content.GetValueForProperty("Info",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorAdditionalInfoInternal)this).Info, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AnyTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IErrorAdditionalInfoInternal)this).Info = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAny) content.GetValueForProperty("Info",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IErrorAdditionalInfoInternal)this).Info, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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. @@ -129,11 +129,11 @@ internal ErrorAdditionalInfo(global::System.Management.Automation.PSObject conte // actually deserialize if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorAdditionalInfoInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorAdditionalInfoInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IErrorAdditionalInfoInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IErrorAdditionalInfoInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("Info")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorAdditionalInfoInternal)this).Info = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAny) content.GetValueForProperty("Info",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorAdditionalInfoInternal)this).Info, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AnyTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IErrorAdditionalInfoInternal)this).Info = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAny) content.GetValueForProperty("Info",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IErrorAdditionalInfoInternal)this).Info, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AnyTypeConverter.ConvertFrom); } AfterDeserializePSObject(content); } @@ -143,7 +143,7 @@ internal ErrorAdditionalInfo(global::System.Management.Automation.PSObject conte /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorAdditionalInfo FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IErrorAdditionalInfo FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api50/ErrorAdditionalInfo.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ErrorAdditionalInfo.TypeConverter.cs similarity index 98% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api50/ErrorAdditionalInfo.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ErrorAdditionalInfo.TypeConverter.cs index ff581664106d..d7ca3f2e17b4 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api50/ErrorAdditionalInfo.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ErrorAdditionalInfo.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.NetworkCloud.Models.Api50 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api50.IErrorAdditionalInfo ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IErrorAdditionalInfo ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorAdditionalInfo).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IErrorAdditionalInfo).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api50/ErrorAdditionalInfo.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ErrorAdditionalInfo.cs similarity index 83% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api50/ErrorAdditionalInfo.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ErrorAdditionalInfo.cs index 4ee4d8f8dc26..f41a007be505 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api50/ErrorAdditionalInfo.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ErrorAdditionalInfo.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.NetworkCloud.Models.Api50 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; /// The resource management error additional info. public partial class ErrorAdditionalInfo : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorAdditionalInfo, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorAdditionalInfoInternal + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IErrorAdditionalInfo, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IErrorAdditionalInfoInternal { /// Backing field for property. @@ -21,10 +21,10 @@ public partial class ErrorAdditionalInfo : public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAny Info { get => (this._info = this._info ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Any()); } /// Internal Acessors for Info - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAny Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorAdditionalInfoInternal.Info { get => (this._info = this._info ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Any()); set { {_info = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAny Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IErrorAdditionalInfoInternal.Info { get => (this._info = this._info ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Any()); set { {_info = value;} } } /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorAdditionalInfoInternal.Type { get => this._type; set { {_type = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IErrorAdditionalInfoInternal.Type { get => this._type; set { {_type = value;} } } /// Backing field for property. private string _type; @@ -47,6 +47,9 @@ public partial interface IErrorAdditionalInfo : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The additional info.", SerializedName = @"info", PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAny) })] @@ -55,6 +58,9 @@ public partial interface IErrorAdditionalInfo : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The additional info type.", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api50/ErrorAdditionalInfo.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ErrorAdditionalInfo.json.cs similarity index 93% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api50/ErrorAdditionalInfo.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ErrorAdditionalInfo.json.cs index 9f0768400cc5..66b90155d251 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api50/ErrorAdditionalInfo.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ErrorAdditionalInfo.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.NetworkCloud.Models.Api50 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -65,19 +65,19 @@ internal ErrorAdditionalInfo(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Run { return; } - {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)Type;} - {_info = If( json?.PropertyT("info"), out var __jsonInfo) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Any.FromJson(__jsonInfo) : Info;} + {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)_type;} + {_info = If( json?.PropertyT("info"), out var __jsonInfo) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Any.FromJson(__jsonInfo) : _info;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorAdditionalInfo. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IErrorAdditionalInfo. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorAdditionalInfo. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IErrorAdditionalInfo. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorAdditionalInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IErrorAdditionalInfo FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new ErrorAdditionalInfo(json) : null; } @@ -101,11 +101,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode ToJ { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._type.ToString()) : null, "type" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != this._info ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) this._info.ToJson(null,serializationMode) : null, "info" ,container.Add ); } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ErrorDetail.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ErrorDetail.PowerShell.cs new file mode 100644 index 000000000000..d47f819c09c8 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ErrorDetail.PowerShell.cs @@ -0,0 +1,196 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + + /// The error detail. + [System.ComponentModel.TypeConverter(typeof(ErrorDetailTypeConverter))] + public partial class ErrorDetail + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IErrorDetail DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ErrorDetail(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IErrorDetail DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ErrorDetail(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ErrorDetail(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Code")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IErrorDetailInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IErrorDetailInternal)this).Code, global::System.Convert.ToString); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IErrorDetailInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IErrorDetailInternal)this).Message, global::System.Convert.ToString); + } + if (content.Contains("Target")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IErrorDetailInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IErrorDetailInternal)this).Target, global::System.Convert.ToString); + } + if (content.Contains("Detail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IErrorDetailInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IErrorDetailInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorDetailTypeConverter.ConvertFrom)); + } + if (content.Contains("AdditionalInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IErrorDetailInternal)this).AdditionalInfo = (System.Collections.Generic.List) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IErrorDetailInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorAdditionalInfoTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ErrorDetail(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Code")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IErrorDetailInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IErrorDetailInternal)this).Code, global::System.Convert.ToString); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IErrorDetailInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IErrorDetailInternal)this).Message, global::System.Convert.ToString); + } + if (content.Contains("Target")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IErrorDetailInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IErrorDetailInternal)this).Target, global::System.Convert.ToString); + } + if (content.Contains("Detail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IErrorDetailInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IErrorDetailInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorDetailTypeConverter.ConvertFrom)); + } + if (content.Contains("AdditionalInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IErrorDetailInternal)this).AdditionalInfo = (System.Collections.Generic.List) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IErrorDetailInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorAdditionalInfoTypeConverter.ConvertFrom)); + } + AfterDeserializePSObject(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IErrorDetail FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } + } + /// The error detail. + [System.ComponentModel.TypeConverter(typeof(ErrorDetailTypeConverter))] + public partial interface IErrorDetail + + { + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api50/ErrorDetail.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ErrorDetail.TypeConverter.cs similarity index 98% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api50/ErrorDetail.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ErrorDetail.TypeConverter.cs index 652dd9212574..95fd3d924398 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api50/ErrorDetail.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ErrorDetail.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.NetworkCloud.Models.Api50 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api50.IErrorDetail ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IErrorDetail ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorDetail).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IErrorDetail).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ErrorDetail.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ErrorDetail.cs new file mode 100644 index 000000000000..34081cf6a094 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ErrorDetail.cs @@ -0,0 +1,149 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + + /// The error detail. + public partial class ErrorDetail : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IErrorDetail, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IErrorDetailInternal + { + + /// Backing field for property. + private System.Collections.Generic.List _additionalInfo; + + /// The error additional info. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public System.Collections.Generic.List AdditionalInfo { get => this._additionalInfo; } + + /// Backing field for property. + private string _code; + + /// The error code. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string Code { get => this._code; } + + /// Backing field for property. + private System.Collections.Generic.List _detail; + + /// The error details. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public System.Collections.Generic.List Detail { get => this._detail; } + + /// Backing field for property. + private string _message; + + /// The error message. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string Message { get => this._message; } + + /// Internal Acessors for AdditionalInfo + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IErrorDetailInternal.AdditionalInfo { get => this._additionalInfo; set { {_additionalInfo = value;} } } + + /// Internal Acessors for Code + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IErrorDetailInternal.Code { get => this._code; set { {_code = value;} } } + + /// Internal Acessors for Detail + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IErrorDetailInternal.Detail { get => this._detail; set { {_detail = value;} } } + + /// Internal Acessors for Message + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IErrorDetailInternal.Message { get => this._message; set { {_message = value;} } } + + /// Internal Acessors for Target + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IErrorDetailInternal.Target { get => this._target; set { {_target = value;} } } + + /// Backing field for property. + private string _target; + + /// The error target. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string Target { get => this._target; } + + /// Creates an new instance. + public ErrorDetail() + { + + } + } + /// The error detail. + public partial interface IErrorDetail : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable + { + /// The error additional info. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The error additional info.", + SerializedName = @"additionalInfo", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IErrorAdditionalInfo) })] + System.Collections.Generic.List AdditionalInfo { get; } + /// The error code. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The error code.", + SerializedName = @"code", + PossibleTypes = new [] { typeof(string) })] + string Code { get; } + /// The error details. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The error details.", + SerializedName = @"details", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IErrorDetail) })] + System.Collections.Generic.List Detail { get; } + /// The error message. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The error message.", + SerializedName = @"message", + PossibleTypes = new [] { typeof(string) })] + string Message { get; } + /// The error target. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The error target.", + SerializedName = @"target", + PossibleTypes = new [] { typeof(string) })] + string Target { get; } + + } + /// The error detail. + internal partial interface IErrorDetailInternal + + { + /// The error additional info. + System.Collections.Generic.List AdditionalInfo { get; set; } + /// The error code. + string Code { get; set; } + /// The error details. + System.Collections.Generic.List Detail { get; set; } + /// The error message. + string Message { get; set; } + /// The error target. + string Target { get; set; } + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api50/ErrorDetail.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ErrorDetail.json.cs similarity index 85% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api50/ErrorDetail.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ErrorDetail.json.cs index 379e0d7b1e41..bf12e170454a 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api50/ErrorDetail.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ErrorDetail.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.NetworkCloud.Models.Api50 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -65,22 +65,22 @@ internal ErrorDetail(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Jso { return; } - {_code = If( json?.PropertyT("code"), out var __jsonCode) ? (string)__jsonCode : (string)Code;} - {_message = If( json?.PropertyT("message"), out var __jsonMessage) ? (string)__jsonMessage : (string)Message;} - {_target = If( json?.PropertyT("target"), out var __jsonTarget) ? (string)__jsonTarget : (string)Target;} - {_detail = If( json?.PropertyT("details"), out var __jsonDetails) ? If( __jsonDetails as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api50.IErrorDetail) (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ErrorDetail.FromJson(__u) )) ))() : null : Detail;} - {_additionalInfo = If( json?.PropertyT("additionalInfo"), out var __jsonAdditionalInfo) ? If( __jsonAdditionalInfo as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api50.IErrorAdditionalInfo) (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ErrorAdditionalInfo.FromJson(__p) )) ))() : null : AdditionalInfo;} + {_code = If( json?.PropertyT("code"), out var __jsonCode) ? (string)__jsonCode : (string)_code;} + {_message = If( json?.PropertyT("message"), out var __jsonMessage) ? (string)__jsonMessage : (string)_message;} + {_target = If( json?.PropertyT("target"), out var __jsonTarget) ? (string)__jsonTarget : (string)_target;} + {_detail = If( json?.PropertyT("details"), out var __jsonDetails) ? If( __jsonDetails as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.IErrorDetail) (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorDetail.FromJson(__u) )) ))() : null : _detail;} + {_additionalInfo = If( json?.PropertyT("additionalInfo"), out var __jsonAdditionalInfo) ? If( __jsonAdditionalInfo as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.IErrorAdditionalInfo) (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorAdditionalInfo.FromJson(__p) )) ))() : null : _additionalInfo;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorDetail. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IErrorDetail. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorDetail. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IErrorDetail. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorDetail FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IErrorDetail FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new ErrorDetail(json) : null; } @@ -104,19 +104,19 @@ public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode ToJ { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._code)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._code.ToString()) : null, "code" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._message)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._message.ToString()) : null, "message" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._target)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._target.ToString()) : null, "target" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { if (null != this._detail) { @@ -128,7 +128,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode ToJ container.Add("details",__w); } } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { if (null != this._additionalInfo) { diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ErrorResponse.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ErrorResponse.PowerShell.cs new file mode 100644 index 000000000000..21cf5e3e8ab4 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ErrorResponse.PowerShell.cs @@ -0,0 +1,208 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + + /// + /// Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows + /// the OData error response format.). + /// + [System.ComponentModel.TypeConverter(typeof(ErrorResponseTypeConverter))] + public partial class ErrorResponse + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IErrorResponse DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ErrorResponse(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IErrorResponse DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ErrorResponse(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ErrorResponse(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IErrorResponseInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IErrorDetail) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IErrorResponseInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorDetailTypeConverter.ConvertFrom); + } + if (content.Contains("Code")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IErrorResponseInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IErrorResponseInternal)this).Code, global::System.Convert.ToString); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IErrorResponseInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IErrorResponseInternal)this).Message, global::System.Convert.ToString); + } + if (content.Contains("Target")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IErrorResponseInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IErrorResponseInternal)this).Target, global::System.Convert.ToString); + } + if (content.Contains("Detail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IErrorResponseInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IErrorResponseInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorDetailTypeConverter.ConvertFrom)); + } + if (content.Contains("AdditionalInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IErrorResponseInternal)this).AdditionalInfo = (System.Collections.Generic.List) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IErrorResponseInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorAdditionalInfoTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ErrorResponse(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IErrorResponseInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IErrorDetail) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IErrorResponseInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorDetailTypeConverter.ConvertFrom); + } + if (content.Contains("Code")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IErrorResponseInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IErrorResponseInternal)this).Code, global::System.Convert.ToString); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IErrorResponseInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IErrorResponseInternal)this).Message, global::System.Convert.ToString); + } + if (content.Contains("Target")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IErrorResponseInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IErrorResponseInternal)this).Target, global::System.Convert.ToString); + } + if (content.Contains("Detail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IErrorResponseInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IErrorResponseInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorDetailTypeConverter.ConvertFrom)); + } + if (content.Contains("AdditionalInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IErrorResponseInternal)this).AdditionalInfo = (System.Collections.Generic.List) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IErrorResponseInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorAdditionalInfoTypeConverter.ConvertFrom)); + } + AfterDeserializePSObject(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IErrorResponse FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } + } + /// Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows + /// the OData error response format.). + [System.ComponentModel.TypeConverter(typeof(ErrorResponseTypeConverter))] + public partial interface IErrorResponse + + { + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ErrorResponse.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ErrorResponse.TypeConverter.cs new file mode 100644 index 000000000000..c063febd4ab3 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ErrorResponse.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ErrorResponseTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IErrorResponse ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IErrorResponse).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ErrorResponse.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ErrorResponse.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ErrorResponse.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ErrorResponse.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ErrorResponse.cs new file mode 100644 index 000000000000..94eabdaaa57c --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ErrorResponse.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + + /// + /// Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows + /// the OData error response format.). + /// + public partial class ErrorResponse : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IErrorResponse, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IErrorResponseInternal + { + + /// The error additional info. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public System.Collections.Generic.List AdditionalInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IErrorDetailInternal)Error).AdditionalInfo; } + + /// The error code. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IErrorDetailInternal)Error).Code; } + + /// The error details. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public System.Collections.Generic.List Detail { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IErrorDetailInternal)Error).Detail; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IErrorDetail _error; + + /// The error object. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IErrorDetail Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorDetail()); set => this._error = value; } + + /// The error message. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IErrorDetailInternal)Error).Message; } + + /// Internal Acessors for AdditionalInfo + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IErrorResponseInternal.AdditionalInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IErrorDetailInternal)Error).AdditionalInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IErrorDetailInternal)Error).AdditionalInfo = value ?? null /* arrayOf */; } + + /// Internal Acessors for Code + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IErrorResponseInternal.Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IErrorDetailInternal)Error).Code; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IErrorDetailInternal)Error).Code = value ?? null; } + + /// Internal Acessors for Detail + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IErrorResponseInternal.Detail { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IErrorDetailInternal)Error).Detail; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IErrorDetailInternal)Error).Detail = value ?? null /* arrayOf */; } + + /// Internal Acessors for Error + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IErrorDetail Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IErrorResponseInternal.Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorDetail()); set { {_error = value;} } } + + /// Internal Acessors for Message + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IErrorResponseInternal.Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IErrorDetailInternal)Error).Message; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IErrorDetailInternal)Error).Message = value ?? null; } + + /// Internal Acessors for Target + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IErrorResponseInternal.Target { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IErrorDetailInternal)Error).Target; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IErrorDetailInternal)Error).Target = value ?? null; } + + /// The error target. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string Target { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IErrorDetailInternal)Error).Target; } + + /// Creates an new instance. + public ErrorResponse() + { + + } + } + /// Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows + /// the OData error response format.). + public partial interface IErrorResponse : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable + { + /// The error additional info. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The error additional info.", + SerializedName = @"additionalInfo", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IErrorAdditionalInfo) })] + System.Collections.Generic.List AdditionalInfo { get; } + /// The error code. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The error code.", + SerializedName = @"code", + PossibleTypes = new [] { typeof(string) })] + string Code { get; } + /// The error details. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The error details.", + SerializedName = @"details", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IErrorDetail) })] + System.Collections.Generic.List Detail { get; } + /// The error message. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The error message.", + SerializedName = @"message", + PossibleTypes = new [] { typeof(string) })] + string Message { get; } + /// The error target. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The error target.", + SerializedName = @"target", + PossibleTypes = new [] { typeof(string) })] + string Target { get; } + + } + /// Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows + /// the OData error response format.). + internal partial interface IErrorResponseInternal + + { + /// The error additional info. + System.Collections.Generic.List AdditionalInfo { get; set; } + /// The error code. + string Code { get; set; } + /// The error details. + System.Collections.Generic.List Detail { get; set; } + /// The error object. + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IErrorDetail Error { get; set; } + /// The error message. + string Message { get; set; } + /// The error target. + string Target { get; set; } + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ErrorResponse.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ErrorResponse.json.cs new file mode 100644 index 000000000000..f248a86420b9 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ErrorResponse.json.cs @@ -0,0 +1,111 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + + /// + /// Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows + /// the OData error response format.). + /// + public partial class ErrorResponse + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject instance to deserialize from. + internal ErrorResponse(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_error = If( json?.PropertyT("error"), out var __jsonError) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorDetail.FromJson(__jsonError) : _error;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IErrorResponse. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IErrorResponse. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IErrorResponse FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new ErrorResponse(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._error ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) this._error.ToJson(null,serializationMode) : null, "error" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ExtendedLocation.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ExtendedLocation.PowerShell.cs similarity index 81% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ExtendedLocation.PowerShell.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ExtendedLocation.PowerShell.cs index 6c891902b012..da65f0d5255a 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ExtendedLocation.PowerShell.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ExtendedLocation.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; @@ -65,33 +65,33 @@ public partial class ExtendedLocation 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.NetworkCloud.Models.Api20250201.IExtendedLocation DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocation DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ExtendedLocation(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.NetworkCloud.Models.Api20250201.IExtendedLocation DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocation DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ExtendedLocation(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 +106,17 @@ internal ExtendedLocation(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocationInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocationInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocationInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocationInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocationInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocationInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocationInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocationInternal)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,11 +131,11 @@ internal ExtendedLocation(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocationInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocationInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocationInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocationInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocationInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocationInternal)this).Type, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocationInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocationInternal)this).Type, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -145,7 +145,7 @@ internal ExtendedLocation(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.NetworkCloud.Models.Api20250201.IExtendedLocation FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocation FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ExtendedLocation.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ExtendedLocation.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ExtendedLocation.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ExtendedLocation.TypeConverter.cs index edd039fdf2ef..23032a16f380 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ExtendedLocation.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ExtendedLocation.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IExtendedLocation ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocation ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocation).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocation).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ExtendedLocation.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ExtendedLocation.cs similarity index 89% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ExtendedLocation.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ExtendedLocation.cs index 1c6ee97993de..341a2a92d51a 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ExtendedLocation.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ExtendedLocation.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -11,8 +11,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201 /// ExtendedLocation represents the Azure custom location where the resource will be created. /// public partial class ExtendedLocation : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocation, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocationInternal + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocation, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocationInternal { /// Backing field for property. @@ -41,16 +41,22 @@ public partial interface IExtendedLocation : { /// The resource ID of the extended location on which the resource will be created. [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, + Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = false, Description = @"The resource ID of the extended location on which the resource will be created.", SerializedName = @"name", PossibleTypes = new [] { typeof(string) })] string Name { get; set; } /// The extended location type, for example, CustomLocation. [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, + Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = false, Description = @"The extended location type, for example, CustomLocation.", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ExtendedLocation.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ExtendedLocation.json.cs similarity index 82% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ExtendedLocation.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ExtendedLocation.json.cs index f6ce64154c1a..2d8e6a5ecd95 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ExtendedLocation.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ExtendedLocation.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -67,19 +67,19 @@ internal ExtendedLocation(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtim { return; } - {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} - {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)Type;} + {_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.NetworkCloud.Models.Api20250201.IExtendedLocation. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocation. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocation. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocation. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IExtendedLocation FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocation FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new ExtendedLocation(json) : null; } @@ -103,8 +103,14 @@ public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode ToJ { return container; } - AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); - AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._type.ToString()) : null, "type" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)||serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate)) + { + AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)||serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate)) + { + AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._type.ToString()) : null, "type" ,container.Add ); + } AfterToJson(ref container); return container; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/FeatureStatus.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/FeatureStatus.PowerShell.cs new file mode 100644 index 000000000000..c60481d576cd --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/FeatureStatus.PowerShell.cs @@ -0,0 +1,188 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + + /// FeatureStatus contains information regarding a Kubernetes cluster feature. + [System.ComponentModel.TypeConverter(typeof(FeatureStatusTypeConverter))] + public partial class FeatureStatus + { + + /// + /// 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.NetworkCloud.Models.IFeatureStatus DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new FeatureStatus(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.NetworkCloud.Models.IFeatureStatus DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new FeatureStatus(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal FeatureStatus(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("DetailedStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IFeatureStatusInternal)this).DetailedStatus = (string) content.GetValueForProperty("DetailedStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IFeatureStatusInternal)this).DetailedStatus, global::System.Convert.ToString); + } + if (content.Contains("DetailedStatusMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IFeatureStatusInternal)this).DetailedStatusMessage = (string) content.GetValueForProperty("DetailedStatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IFeatureStatusInternal)this).DetailedStatusMessage, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IFeatureStatusInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IFeatureStatusInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Version")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IFeatureStatusInternal)this).Version = (string) content.GetValueForProperty("Version",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IFeatureStatusInternal)this).Version, 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 FeatureStatus(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("DetailedStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IFeatureStatusInternal)this).DetailedStatus = (string) content.GetValueForProperty("DetailedStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IFeatureStatusInternal)this).DetailedStatus, global::System.Convert.ToString); + } + if (content.Contains("DetailedStatusMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IFeatureStatusInternal)this).DetailedStatusMessage = (string) content.GetValueForProperty("DetailedStatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IFeatureStatusInternal)this).DetailedStatusMessage, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IFeatureStatusInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IFeatureStatusInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Version")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IFeatureStatusInternal)this).Version = (string) content.GetValueForProperty("Version",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IFeatureStatusInternal)this).Version, 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.NetworkCloud.Models.IFeatureStatus FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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(); + } + } + /// FeatureStatus contains information regarding a Kubernetes cluster feature. + [System.ComponentModel.TypeConverter(typeof(FeatureStatusTypeConverter))] + public partial interface IFeatureStatus + + { + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/FeatureStatus.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/FeatureStatus.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/FeatureStatus.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/FeatureStatus.TypeConverter.cs index a9b0022656bb..67ac31a21892 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/FeatureStatus.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/FeatureStatus.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IFeatureStatus ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IFeatureStatus ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IFeatureStatus).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IFeatureStatus).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/FeatureStatus.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/FeatureStatus.cs similarity index 77% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/FeatureStatus.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/FeatureStatus.cs index e2ed10bc5182..f197c8f13fae 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/FeatureStatus.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/FeatureStatus.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; /// FeatureStatus contains information regarding a Kubernetes cluster feature. public partial class FeatureStatus : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IFeatureStatus, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IFeatureStatusInternal + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IFeatureStatus, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IFeatureStatusInternal { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.FeatureDetailedStatus? _detailedStatus; + private string _detailedStatus; /// The status representing the state of this feature. [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.FeatureDetailedStatus? DetailedStatus { get => this._detailedStatus; } + public string DetailedStatus { get => this._detailedStatus; } /// Backing field for property. private string _detailedStatusMessage; @@ -28,16 +28,16 @@ public partial class FeatureStatus : public string DetailedStatusMessage { get => this._detailedStatusMessage; } /// Internal Acessors for DetailedStatus - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.FeatureDetailedStatus? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IFeatureStatusInternal.DetailedStatus { get => this._detailedStatus; set { {_detailedStatus = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IFeatureStatusInternal.DetailedStatus { get => this._detailedStatus; set { {_detailedStatus = value;} } } /// Internal Acessors for DetailedStatusMessage - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IFeatureStatusInternal.DetailedStatusMessage { get => this._detailedStatusMessage; set { {_detailedStatusMessage = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IFeatureStatusInternal.DetailedStatusMessage { get => this._detailedStatusMessage; set { {_detailedStatusMessage = value;} } } /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IFeatureStatusInternal.Name { get => this._name; set { {_name = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IFeatureStatusInternal.Name { get => this._name; set { {_name = value;} } } /// Internal Acessors for Version - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IFeatureStatusInternal.Version { get => this._version; set { {_version = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IFeatureStatusInternal.Version { get => this._version; set { {_version = value;} } } /// Backing field for property. private string _name; @@ -67,14 +67,21 @@ public partial interface IFeatureStatus : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The status representing the state of this feature.", SerializedName = @"detailedStatus", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.FeatureDetailedStatus) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.FeatureDetailedStatus? DetailedStatus { get; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Running", "Failed", "Unknown")] + string DetailedStatus { get; } /// The descriptive message about the current detailed status. [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The descriptive message about the current detailed status.", SerializedName = @"detailedStatusMessage", PossibleTypes = new [] { typeof(string) })] @@ -83,6 +90,9 @@ public partial interface IFeatureStatus : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The name of the feature.", SerializedName = @"name", PossibleTypes = new [] { typeof(string) })] @@ -91,6 +101,9 @@ public partial interface IFeatureStatus : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The version of the feature.", SerializedName = @"version", PossibleTypes = new [] { typeof(string) })] @@ -102,7 +115,8 @@ internal partial interface IFeatureStatusInternal { /// The status representing the state of this feature. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.FeatureDetailedStatus? DetailedStatus { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Running", "Failed", "Unknown")] + string DetailedStatus { get; set; } /// The descriptive message about the current detailed status. string DetailedStatusMessage { get; set; } /// The name of the feature. diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/FeatureStatus.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/FeatureStatus.json.cs similarity index 91% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/FeatureStatus.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/FeatureStatus.json.cs index b09966f66008..72ad635a480f 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/FeatureStatus.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/FeatureStatus.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -65,21 +65,21 @@ internal FeatureStatus(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.J { return; } - {_detailedStatus = If( json?.PropertyT("detailedStatus"), out var __jsonDetailedStatus) ? (string)__jsonDetailedStatus : (string)DetailedStatus;} - {_detailedStatusMessage = If( json?.PropertyT("detailedStatusMessage"), out var __jsonDetailedStatusMessage) ? (string)__jsonDetailedStatusMessage : (string)DetailedStatusMessage;} - {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} - {_version = If( json?.PropertyT("version"), out var __jsonVersion) ? (string)__jsonVersion : (string)Version;} + {_detailedStatus = If( json?.PropertyT("detailedStatus"), out var __jsonDetailedStatus) ? (string)__jsonDetailedStatus : (string)_detailedStatus;} + {_detailedStatusMessage = If( json?.PropertyT("detailedStatusMessage"), out var __jsonDetailedStatusMessage) ? (string)__jsonDetailedStatusMessage : (string)_detailedStatusMessage;} + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)_name;} + {_version = If( json?.PropertyT("version"), out var __jsonVersion) ? (string)__jsonVersion : (string)_version;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IFeatureStatus. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IFeatureStatus. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IFeatureStatus. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IFeatureStatus. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IFeatureStatus FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IFeatureStatus FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new FeatureStatus(json) : null; } @@ -103,19 +103,19 @@ public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode ToJ { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._detailedStatus)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._detailedStatus.ToString()) : null, "detailedStatus" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._detailedStatusMessage)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._detailedStatusMessage.ToString()) : null, "detailedStatusMessage" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._version)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._version.ToString()) : null, "version" ,container.Add ); } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/HardwareInventory.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/HardwareInventory.PowerShell.cs new file mode 100644 index 000000000000..f8c67b140ab1 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/HardwareInventory.PowerShell.cs @@ -0,0 +1,184 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + + /// + /// HardwareInventory represents the hardware configuration of this machine as exposed to the customer, including information + /// acquired from the model/sku information and from the ironic inspector. + /// + [System.ComponentModel.TypeConverter(typeof(HardwareInventoryTypeConverter))] + public partial class HardwareInventory + { + + /// + /// 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.NetworkCloud.Models.IHardwareInventory DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new HardwareInventory(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.NetworkCloud.Models.IHardwareInventory DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new HardwareInventory(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.NetworkCloud.Models.IHardwareInventory FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal HardwareInventory(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("AdditionalHostInformation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IHardwareInventoryInternal)this).AdditionalHostInformation = (string) content.GetValueForProperty("AdditionalHostInformation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IHardwareInventoryInternal)this).AdditionalHostInformation, global::System.Convert.ToString); + } + if (content.Contains("Interface")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IHardwareInventoryInternal)this).Interface = (System.Collections.Generic.List) content.GetValueForProperty("Interface",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IHardwareInventoryInternal)this).Interface, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.HardwareInventoryNetworkInterfaceTypeConverter.ConvertFrom)); + } + if (content.Contains("Nic")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IHardwareInventoryInternal)this).Nic = (System.Collections.Generic.List) content.GetValueForProperty("Nic",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IHardwareInventoryInternal)this).Nic, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.NicTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal HardwareInventory(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("AdditionalHostInformation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IHardwareInventoryInternal)this).AdditionalHostInformation = (string) content.GetValueForProperty("AdditionalHostInformation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IHardwareInventoryInternal)this).AdditionalHostInformation, global::System.Convert.ToString); + } + if (content.Contains("Interface")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IHardwareInventoryInternal)this).Interface = (System.Collections.Generic.List) content.GetValueForProperty("Interface",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IHardwareInventoryInternal)this).Interface, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.HardwareInventoryNetworkInterfaceTypeConverter.ConvertFrom)); + } + if (content.Contains("Nic")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IHardwareInventoryInternal)this).Nic = (System.Collections.Generic.List) content.GetValueForProperty("Nic",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IHardwareInventoryInternal)this).Nic, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.NicTypeConverter.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.NetworkCloud.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(); + } + } + /// HardwareInventory represents the hardware configuration of this machine as exposed to the customer, including information + /// acquired from the model/sku information and from the ironic inspector. + [System.ComponentModel.TypeConverter(typeof(HardwareInventoryTypeConverter))] + public partial interface IHardwareInventory + + { + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/HardwareInventory.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/HardwareInventory.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/HardwareInventory.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/HardwareInventory.TypeConverter.cs index 85f41fb38cee..67ac38e4e43d 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/HardwareInventory.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/HardwareInventory.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IHardwareInventory ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IHardwareInventory ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IHardwareInventory).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IHardwareInventory).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/HardwareInventory.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/HardwareInventory.cs new file mode 100644 index 000000000000..acd4bdf27fe4 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/HardwareInventory.cs @@ -0,0 +1,132 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + + /// + /// HardwareInventory represents the hardware configuration of this machine as exposed to the customer, including information + /// acquired from the model/sku information and from the ironic inspector. + /// + public partial class HardwareInventory : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IHardwareInventory, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IHardwareInventoryInternal + { + + /// Backing field for property. + private string _additionalHostInformation; + + /// + /// Freeform data extracted from the environment about this machine. This information varies depending on the specific hardware + /// and configuration. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string AdditionalHostInformation { get => this._additionalHostInformation; } + + /// Backing field for property. + private System.Collections.Generic.List _interface; + + /// + /// The list of network interfaces and associated details for the bare metal machine. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public System.Collections.Generic.List Interface { get => this._interface; } + + /// Internal Acessors for AdditionalHostInformation + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IHardwareInventoryInternal.AdditionalHostInformation { get => this._additionalHostInformation; set { {_additionalHostInformation = value;} } } + + /// Internal Acessors for Interface + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IHardwareInventoryInternal.Interface { get => this._interface; set { {_interface = value;} } } + + /// Internal Acessors for Nic + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IHardwareInventoryInternal.Nic { get => this._nic; set { {_nic = value;} } } + + /// Backing field for property. + private System.Collections.Generic.List _nic; + + /// + /// Field Deprecated. Will be removed in an upcoming version. The list of network interface cards and associated details for + /// the bare metal machine. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public System.Collections.Generic.List Nic { get => this._nic; } + + /// Creates an new instance. + public HardwareInventory() + { + + } + } + /// HardwareInventory represents the hardware configuration of this machine as exposed to the customer, including information + /// acquired from the model/sku information and from the ironic inspector. + public partial interface IHardwareInventory : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable + { + /// + /// Freeform data extracted from the environment about this machine. This information varies depending on the specific hardware + /// and configuration. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"Freeform data extracted from the environment about this machine. This information varies depending on the specific hardware and configuration.", + SerializedName = @"additionalHostInformation", + PossibleTypes = new [] { typeof(string) })] + string AdditionalHostInformation { get; } + /// + /// The list of network interfaces and associated details for the bare metal machine. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The list of network interfaces and associated details for the bare metal machine.", + SerializedName = @"interfaces", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IHardwareInventoryNetworkInterface) })] + System.Collections.Generic.List Interface { get; } + /// + /// Field Deprecated. Will be removed in an upcoming version. The list of network interface cards and associated details for + /// the bare metal machine. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"Field Deprecated. Will be removed in an upcoming version. The list of network interface cards and associated details for the bare metal machine.", + SerializedName = @"nics", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INic) })] + System.Collections.Generic.List Nic { get; } + + } + /// HardwareInventory represents the hardware configuration of this machine as exposed to the customer, including information + /// acquired from the model/sku information and from the ironic inspector. + internal partial interface IHardwareInventoryInternal + + { + /// + /// Freeform data extracted from the environment about this machine. This information varies depending on the specific hardware + /// and configuration. + /// + string AdditionalHostInformation { get; set; } + /// + /// The list of network interfaces and associated details for the bare metal machine. + /// + System.Collections.Generic.List Interface { get; set; } + /// + /// Field Deprecated. Will be removed in an upcoming version. The list of network interface cards and associated details for + /// the bare metal machine. + /// + System.Collections.Generic.List Nic { get; set; } + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/HardwareInventory.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/HardwareInventory.json.cs similarity index 86% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/HardwareInventory.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/HardwareInventory.json.cs index 7f066f43c32e..4e34f3e561ae 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/HardwareInventory.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/HardwareInventory.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -57,13 +57,13 @@ public partial class HardwareInventory partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IHardwareInventory. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IHardwareInventory. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IHardwareInventory. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IHardwareInventory. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IHardwareInventory FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IHardwareInventory FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new HardwareInventory(json) : null; } @@ -80,9 +80,9 @@ internal HardwareInventory(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runti { return; } - {_additionalHostInformation = If( json?.PropertyT("additionalHostInformation"), out var __jsonAdditionalHostInformation) ? (string)__jsonAdditionalHostInformation : (string)AdditionalHostInformation;} - {_interface = If( json?.PropertyT("interfaces"), out var __jsonInterfaces) ? If( __jsonInterfaces as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IHardwareInventoryNetworkInterface) (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.HardwareInventoryNetworkInterface.FromJson(__u) )) ))() : null : Interface;} - {_nic = If( json?.PropertyT("nics"), out var __jsonNics) ? If( __jsonNics as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.INic) (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.Nic.FromJson(__p) )) ))() : null : Nic;} + {_additionalHostInformation = If( json?.PropertyT("additionalHostInformation"), out var __jsonAdditionalHostInformation) ? (string)__jsonAdditionalHostInformation : (string)_additionalHostInformation;} + {_interface = If( json?.PropertyT("interfaces"), out var __jsonInterfaces) ? If( __jsonInterfaces as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.IHardwareInventoryNetworkInterface) (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.HardwareInventoryNetworkInterface.FromJson(__u) )) ))() : null : _interface;} + {_nic = If( json?.PropertyT("nics"), out var __jsonNics) ? If( __jsonNics as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.INic) (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Nic.FromJson(__p) )) ))() : null : _nic;} AfterFromJson(json); } @@ -105,11 +105,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode ToJ { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._additionalHostInformation)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._additionalHostInformation.ToString()) : null, "additionalHostInformation" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { if (null != this._interface) { @@ -121,7 +121,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode ToJ container.Add("interfaces",__w); } } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { if (null != this._nic) { diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/HardwareInventoryNetworkInterface.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/HardwareInventoryNetworkInterface.PowerShell.cs new file mode 100644 index 000000000000..04f156dbe869 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/HardwareInventoryNetworkInterface.PowerShell.cs @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + + /// + /// HardwareInventoryNetworkInterface represents the network interface details as part of a hardware inventory. + /// + [System.ComponentModel.TypeConverter(typeof(HardwareInventoryNetworkInterfaceTypeConverter))] + public partial class HardwareInventoryNetworkInterface + { + + /// + /// 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.NetworkCloud.Models.IHardwareInventoryNetworkInterface DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new HardwareInventoryNetworkInterface(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.NetworkCloud.Models.IHardwareInventoryNetworkInterface DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new HardwareInventoryNetworkInterface(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.NetworkCloud.Models.IHardwareInventoryNetworkInterface FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal HardwareInventoryNetworkInterface(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("LinkStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IHardwareInventoryNetworkInterfaceInternal)this).LinkStatus = (string) content.GetValueForProperty("LinkStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IHardwareInventoryNetworkInterfaceInternal)this).LinkStatus, global::System.Convert.ToString); + } + if (content.Contains("MacAddress")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IHardwareInventoryNetworkInterfaceInternal)this).MacAddress = (string) content.GetValueForProperty("MacAddress",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IHardwareInventoryNetworkInterfaceInternal)this).MacAddress, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IHardwareInventoryNetworkInterfaceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IHardwareInventoryNetworkInterfaceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("NetworkInterfaceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IHardwareInventoryNetworkInterfaceInternal)this).NetworkInterfaceId = (string) content.GetValueForProperty("NetworkInterfaceId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IHardwareInventoryNetworkInterfaceInternal)this).NetworkInterfaceId, 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 HardwareInventoryNetworkInterface(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("LinkStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IHardwareInventoryNetworkInterfaceInternal)this).LinkStatus = (string) content.GetValueForProperty("LinkStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IHardwareInventoryNetworkInterfaceInternal)this).LinkStatus, global::System.Convert.ToString); + } + if (content.Contains("MacAddress")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IHardwareInventoryNetworkInterfaceInternal)this).MacAddress = (string) content.GetValueForProperty("MacAddress",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IHardwareInventoryNetworkInterfaceInternal)this).MacAddress, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IHardwareInventoryNetworkInterfaceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IHardwareInventoryNetworkInterfaceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("NetworkInterfaceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IHardwareInventoryNetworkInterfaceInternal)this).NetworkInterfaceId = (string) content.GetValueForProperty("NetworkInterfaceId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IHardwareInventoryNetworkInterfaceInternal)this).NetworkInterfaceId, 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.NetworkCloud.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(); + } + } + /// HardwareInventoryNetworkInterface represents the network interface details as part of a hardware inventory. + [System.ComponentModel.TypeConverter(typeof(HardwareInventoryNetworkInterfaceTypeConverter))] + public partial interface IHardwareInventoryNetworkInterface + + { + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/HardwareInventoryNetworkInterface.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/HardwareInventoryNetworkInterface.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/HardwareInventoryNetworkInterface.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/HardwareInventoryNetworkInterface.TypeConverter.cs index b7a2b28c80c7..f2b416ff5c8a 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/HardwareInventoryNetworkInterface.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/HardwareInventoryNetworkInterface.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IHardwareInventoryNetworkInterface ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IHardwareInventoryNetworkInterface ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IHardwareInventoryNetworkInterface).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IHardwareInventoryNetworkInterface).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/HardwareInventoryNetworkInterface.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/HardwareInventoryNetworkInterface.cs similarity index 85% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/HardwareInventoryNetworkInterface.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/HardwareInventoryNetworkInterface.cs index 69a18542f090..272cd19a91af 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/HardwareInventoryNetworkInterface.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/HardwareInventoryNetworkInterface.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -11,8 +11,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201 /// HardwareInventoryNetworkInterface represents the network interface details as part of a hardware inventory. /// public partial class HardwareInventoryNetworkInterface : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IHardwareInventoryNetworkInterface, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IHardwareInventoryNetworkInterfaceInternal + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IHardwareInventoryNetworkInterface, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IHardwareInventoryNetworkInterfaceInternal { /// Backing field for property. @@ -30,16 +30,16 @@ public partial class HardwareInventoryNetworkInterface : public string MacAddress { get => this._macAddress; } /// Internal Acessors for LinkStatus - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IHardwareInventoryNetworkInterfaceInternal.LinkStatus { get => this._linkStatus; set { {_linkStatus = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IHardwareInventoryNetworkInterfaceInternal.LinkStatus { get => this._linkStatus; set { {_linkStatus = value;} } } /// Internal Acessors for MacAddress - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IHardwareInventoryNetworkInterfaceInternal.MacAddress { get => this._macAddress; set { {_macAddress = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IHardwareInventoryNetworkInterfaceInternal.MacAddress { get => this._macAddress; set { {_macAddress = value;} } } /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IHardwareInventoryNetworkInterfaceInternal.Name { get => this._name; set { {_name = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IHardwareInventoryNetworkInterfaceInternal.Name { get => this._name; set { {_name = value;} } } /// Internal Acessors for NetworkInterfaceId - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IHardwareInventoryNetworkInterfaceInternal.NetworkInterfaceId { get => this._networkInterfaceId; set { {_networkInterfaceId = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IHardwareInventoryNetworkInterfaceInternal.NetworkInterfaceId { get => this._networkInterfaceId; set { {_networkInterfaceId = value;} } } /// Backing field for property. private string _name; @@ -71,6 +71,9 @@ public partial interface IHardwareInventoryNetworkInterface : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The current status of the link.", SerializedName = @"linkStatus", PossibleTypes = new [] { typeof(string) })] @@ -79,6 +82,9 @@ public partial interface IHardwareInventoryNetworkInterface : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The MAC address associated with this interface.", SerializedName = @"macAddress", PossibleTypes = new [] { typeof(string) })] @@ -87,6 +93,9 @@ public partial interface IHardwareInventoryNetworkInterface : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The name of the interface.", SerializedName = @"name", PossibleTypes = new [] { typeof(string) })] @@ -97,6 +106,9 @@ public partial interface IHardwareInventoryNetworkInterface : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The resource ID of the network interface for the port on the switch that this machine's interface is connected to.", SerializedName = @"networkInterfaceId", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/HardwareInventoryNetworkInterface.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/HardwareInventoryNetworkInterface.json.cs similarity index 91% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/HardwareInventoryNetworkInterface.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/HardwareInventoryNetworkInterface.json.cs index 692c7068eb92..af9306c00c31 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/HardwareInventoryNetworkInterface.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/HardwareInventoryNetworkInterface.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -56,13 +56,13 @@ public partial class HardwareInventoryNetworkInterface partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IHardwareInventoryNetworkInterface. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IHardwareInventoryNetworkInterface. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IHardwareInventoryNetworkInterface. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IHardwareInventoryNetworkInterface. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IHardwareInventoryNetworkInterface FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IHardwareInventoryNetworkInterface FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new HardwareInventoryNetworkInterface(json) : null; } @@ -79,10 +79,10 @@ internal HardwareInventoryNetworkInterface(Microsoft.Azure.PowerShell.Cmdlets.Ne { return; } - {_linkStatus = If( json?.PropertyT("linkStatus"), out var __jsonLinkStatus) ? (string)__jsonLinkStatus : (string)LinkStatus;} - {_macAddress = If( json?.PropertyT("macAddress"), out var __jsonMacAddress) ? (string)__jsonMacAddress : (string)MacAddress;} - {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} - {_networkInterfaceId = If( json?.PropertyT("networkInterfaceId"), out var __jsonNetworkInterfaceId) ? (string)__jsonNetworkInterfaceId : (string)NetworkInterfaceId;} + {_linkStatus = If( json?.PropertyT("linkStatus"), out var __jsonLinkStatus) ? (string)__jsonLinkStatus : (string)_linkStatus;} + {_macAddress = If( json?.PropertyT("macAddress"), out var __jsonMacAddress) ? (string)__jsonMacAddress : (string)_macAddress;} + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)_name;} + {_networkInterfaceId = If( json?.PropertyT("networkInterfaceId"), out var __jsonNetworkInterfaceId) ? (string)__jsonNetworkInterfaceId : (string)_networkInterfaceId;} AfterFromJson(json); } @@ -105,19 +105,19 @@ public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode ToJ { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._linkStatus)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._linkStatus.ToString()) : null, "linkStatus" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._macAddress)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._macAddress.ToString()) : null, "macAddress" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._networkInterfaceId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._networkInterfaceId.ToString()) : null, "networkInterfaceId" ,container.Add ); } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/HardwareValidationStatus.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/HardwareValidationStatus.PowerShell.cs similarity index 75% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/HardwareValidationStatus.PowerShell.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/HardwareValidationStatus.PowerShell.cs index da023f9475aa..35dc59f1b51a 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/HardwareValidationStatus.PowerShell.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/HardwareValidationStatus.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; @@ -65,29 +65,27 @@ public partial class HardwareValidationStatus 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.NetworkCloud.Models.Api20250201.IHardwareValidationStatus DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IHardwareValidationStatus DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new HardwareValidationStatus(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.NetworkCloud.Models.Api20250201.IHardwareValidationStatus DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IHardwareValidationStatus DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new HardwareValidationStatus(content); } @@ -97,10 +95,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IHardwareValidationStatus FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IHardwareValidationStatus FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,17 +113,17 @@ internal HardwareValidationStatus(global::System.Collections.IDictionary content // actually deserialize if (content.Contains("LastValidationTime")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IHardwareValidationStatusInternal)this).LastValidationTime = (global::System.DateTime?) content.GetValueForProperty("LastValidationTime",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IHardwareValidationStatusInternal)this).LastValidationTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IHardwareValidationStatusInternal)this).LastValidationTime = (global::System.DateTime?) content.GetValueForProperty("LastValidationTime",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IHardwareValidationStatusInternal)this).LastValidationTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); } if (content.Contains("Result")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IHardwareValidationStatusInternal)this).Result = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineHardwareValidationResult?) content.GetValueForProperty("Result",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IHardwareValidationStatusInternal)this).Result, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineHardwareValidationResult.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IHardwareValidationStatusInternal)this).Result = (string) content.GetValueForProperty("Result",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IHardwareValidationStatusInternal)this).Result, 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,11 +138,11 @@ internal HardwareValidationStatus(global::System.Management.Automation.PSObject // actually deserialize if (content.Contains("LastValidationTime")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IHardwareValidationStatusInternal)this).LastValidationTime = (global::System.DateTime?) content.GetValueForProperty("LastValidationTime",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IHardwareValidationStatusInternal)this).LastValidationTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IHardwareValidationStatusInternal)this).LastValidationTime = (global::System.DateTime?) content.GetValueForProperty("LastValidationTime",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IHardwareValidationStatusInternal)this).LastValidationTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); } if (content.Contains("Result")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IHardwareValidationStatusInternal)this).Result = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineHardwareValidationResult?) content.GetValueForProperty("Result",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IHardwareValidationStatusInternal)this).Result, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineHardwareValidationResult.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IHardwareValidationStatusInternal)this).Result = (string) content.GetValueForProperty("Result",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IHardwareValidationStatusInternal)this).Result, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/HardwareValidationStatus.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/HardwareValidationStatus.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/HardwareValidationStatus.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/HardwareValidationStatus.TypeConverter.cs index ea4ca521dff8..da173a2248c8 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/HardwareValidationStatus.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/HardwareValidationStatus.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IHardwareValidationStatus ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IHardwareValidationStatus ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IHardwareValidationStatus).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IHardwareValidationStatus).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/HardwareValidationStatus.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/HardwareValidationStatus.cs new file mode 100644 index 000000000000..29394b17544c --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/HardwareValidationStatus.cs @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + + /// + /// HardwareValidationStatus represents the latest hardware validation details performed for this bare metal machine. + /// + public partial class HardwareValidationStatus : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IHardwareValidationStatus, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IHardwareValidationStatusInternal + { + + /// Backing field for property. + private global::System.DateTime? _lastValidationTime; + + /// The timestamp of the hardware validation execution. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public global::System.DateTime? LastValidationTime { get => this._lastValidationTime; } + + /// Internal Acessors for LastValidationTime + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IHardwareValidationStatusInternal.LastValidationTime { get => this._lastValidationTime; set { {_lastValidationTime = value;} } } + + /// Internal Acessors for Result + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IHardwareValidationStatusInternal.Result { get => this._result; set { {_result = value;} } } + + /// Backing field for property. + private string _result; + + /// The outcome of the hardware validation. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string Result { get => this._result; } + + /// Creates an new instance. + public HardwareValidationStatus() + { + + } + } + /// HardwareValidationStatus represents the latest hardware validation details performed for this bare metal machine. + public partial interface IHardwareValidationStatus : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable + { + /// The timestamp of the hardware validation execution. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The timestamp of the hardware validation execution.", + SerializedName = @"lastValidationTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? LastValidationTime { get; } + /// The outcome of the hardware validation. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The outcome of the hardware validation.", + SerializedName = @"result", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Pass", "Fail")] + string Result { get; } + + } + /// HardwareValidationStatus represents the latest hardware validation details performed for this bare metal machine. + internal partial interface IHardwareValidationStatusInternal + + { + /// The timestamp of the hardware validation execution. + global::System.DateTime? LastValidationTime { get; set; } + /// The outcome of the hardware validation. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Pass", "Fail")] + string Result { get; set; } + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/HardwareValidationStatus.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/HardwareValidationStatus.json.cs similarity index 93% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/HardwareValidationStatus.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/HardwareValidationStatus.json.cs index f785ef188e65..ee58aa319032 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/HardwareValidationStatus.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/HardwareValidationStatus.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -56,13 +56,13 @@ public partial class HardwareValidationStatus partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IHardwareValidationStatus. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IHardwareValidationStatus. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IHardwareValidationStatus. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IHardwareValidationStatus. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IHardwareValidationStatus FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IHardwareValidationStatus FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new HardwareValidationStatus(json) : null; } @@ -79,8 +79,8 @@ internal HardwareValidationStatus(Microsoft.Azure.PowerShell.Cmdlets.NetworkClou { return; } - {_lastValidationTime = If( json?.PropertyT("lastValidationTime"), out var __jsonLastValidationTime) ? global::System.DateTime.TryParse((string)__jsonLastValidationTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonLastValidationTimeValue) ? __jsonLastValidationTimeValue : LastValidationTime : LastValidationTime;} - {_result = If( json?.PropertyT("result"), out var __jsonResult) ? (string)__jsonResult : (string)Result;} + {_lastValidationTime = If( json?.PropertyT("lastValidationTime"), out var __jsonLastValidationTime) ? global::System.DateTime.TryParse((string)__jsonLastValidationTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonLastValidationTimeValue) ? __jsonLastValidationTimeValue : _lastValidationTime : _lastValidationTime;} + {_result = If( json?.PropertyT("result"), out var __jsonResult) ? (string)__jsonResult : (string)_result;} AfterFromJson(json); } @@ -103,11 +103,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode ToJ { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != this._lastValidationTime ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._lastValidationTime?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "lastValidationTime" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._result)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._result.ToString()) : null, "result" ,container.Add ); } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/IPAddressPool.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/IPAddressPool.PowerShell.cs new file mode 100644 index 000000000000..5941f34a53fc --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/IPAddressPool.PowerShell.cs @@ -0,0 +1,190 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + + /// + /// IpAddressPool represents a pool of IP addresses that can be allocated to a service. + /// + [System.ComponentModel.TypeConverter(typeof(IPAddressPoolTypeConverter))] + public partial class IPAddressPool + { + + /// + /// 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.NetworkCloud.Models.IIPAddressPool DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new IPAddressPool(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.NetworkCloud.Models.IIPAddressPool DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new IPAddressPool(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.NetworkCloud.Models.IIPAddressPool FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal IPAddressPool(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Address")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IIPAddressPoolInternal)this).Address = (System.Collections.Generic.List) content.GetValueForProperty("Address",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IIPAddressPoolInternal)this).Address, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("AutoAssign")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IIPAddressPoolInternal)this).AutoAssign = (string) content.GetValueForProperty("AutoAssign",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IIPAddressPoolInternal)this).AutoAssign, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IIPAddressPoolInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IIPAddressPoolInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("OnlyUseHostIP")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IIPAddressPoolInternal)this).OnlyUseHostIP = (string) content.GetValueForProperty("OnlyUseHostIP",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IIPAddressPoolInternal)this).OnlyUseHostIP, 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 IPAddressPool(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Address")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IIPAddressPoolInternal)this).Address = (System.Collections.Generic.List) content.GetValueForProperty("Address",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IIPAddressPoolInternal)this).Address, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("AutoAssign")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IIPAddressPoolInternal)this).AutoAssign = (string) content.GetValueForProperty("AutoAssign",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IIPAddressPoolInternal)this).AutoAssign, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IIPAddressPoolInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IIPAddressPoolInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("OnlyUseHostIP")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IIPAddressPoolInternal)this).OnlyUseHostIP = (string) content.GetValueForProperty("OnlyUseHostIP",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IIPAddressPoolInternal)this).OnlyUseHostIP, 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.NetworkCloud.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(); + } + } + /// IpAddressPool represents a pool of IP addresses that can be allocated to a service. + [System.ComponentModel.TypeConverter(typeof(IPAddressPoolTypeConverter))] + public partial interface IIPAddressPool + + { + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/IPAddressPool.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/IPAddressPool.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/IPAddressPool.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/IPAddressPool.TypeConverter.cs index 6a8e4c725ce4..2f45ae7532f5 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/IPAddressPool.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/IPAddressPool.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IIPAddressPool ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IIPAddressPool ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIPAddressPool).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IIPAddressPool).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/IPAddressPool.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/IPAddressPool.cs similarity index 77% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/IPAddressPool.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/IPAddressPool.cs index ba1b60150292..11b84a23a677 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/IPAddressPool.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/IPAddressPool.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -11,12 +11,12 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201 /// IpAddressPool represents a pool of IP addresses that can be allocated to a service. /// public partial class IPAddressPool : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIPAddressPool, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIPAddressPoolInternal + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IIPAddressPool, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IIPAddressPoolInternal { /// Backing field for property. - private string[] _address; + private System.Collections.Generic.List _address; /// /// The list of IP address ranges. Each range can be a either a subnet in CIDR format or an explicit start-end range of IP @@ -24,14 +24,14 @@ public partial class IPAddressPool : /// (IPv6) prefixes. /// [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string[] Address { get => this._address; set => this._address = value; } + public System.Collections.Generic.List Address { get => this._address; set => this._address = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BfdEnabled? _autoAssign; + private string _autoAssign; /// The indicator to determine if automatic allocation from the pool should occur. [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BfdEnabled? AutoAssign { get => this._autoAssign; set => this._autoAssign = value; } + public string AutoAssign { get => this._autoAssign; set => this._autoAssign = value; } /// Backing field for property. private string _name; @@ -43,14 +43,14 @@ public partial class IPAddressPool : public string Name { get => this._name; set => this._name = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BfdEnabled? _onlyUseHostIP; + private string _onlyUseHostIP; /// /// The indicator to prevent the use of IP addresses ending with .0 and .255 for this pool. Enabling this option will only /// use IP addresses between .1 and .254 inclusive. /// [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BfdEnabled? OnlyUseHostIP { get => this._onlyUseHostIP; set => this._onlyUseHostIP = value; } + public string OnlyUseHostIP { get => this._onlyUseHostIP; set => this._onlyUseHostIP = value; } /// Creates an new instance. public IPAddressPool() @@ -68,26 +68,36 @@ public partial interface IIPAddressPool : /// (IPv6) prefixes. /// [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, + Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = false, Description = @"The list of IP address ranges. Each range can be a either a subnet in CIDR format or an explicit start-end range of IP addresses. For a BGP service load balancer configuration, only CIDR format is supported and excludes /32 (IPv4) and /128 (IPv6) prefixes.", SerializedName = @"addresses", PossibleTypes = new [] { typeof(string) })] - string[] Address { get; set; } + System.Collections.Generic.List Address { get; set; } /// The indicator to determine if automatic allocation from the pool should occur. [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = false, Description = @"The indicator to determine if automatic allocation from the pool should occur.", SerializedName = @"autoAssign", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BfdEnabled) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BfdEnabled? AutoAssign { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("True", "False")] + string AutoAssign { get; set; } /// /// The name used to identify this IP address pool for association with a BGP advertisement. /// [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The name used to identify this IP address pool for association with a BGP advertisement.", SerializedName = @"name", PossibleTypes = new [] { typeof(string) })] @@ -99,10 +109,14 @@ public partial interface IIPAddressPool : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = false, Description = @"The indicator to prevent the use of IP addresses ending with .0 and .255 for this pool. Enabling this option will only use IP addresses between .1 and .254 inclusive.", SerializedName = @"onlyUseHostIps", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BfdEnabled) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BfdEnabled? OnlyUseHostIP { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("True", "False")] + string OnlyUseHostIP { get; set; } } /// IpAddressPool represents a pool of IP addresses that can be allocated to a service. @@ -114,9 +128,10 @@ internal partial interface IIPAddressPoolInternal /// addresses. For a BGP service load balancer configuration, only CIDR format is supported and excludes /32 (IPv4) and /128 /// (IPv6) prefixes. /// - string[] Address { get; set; } + System.Collections.Generic.List Address { get; set; } /// The indicator to determine if automatic allocation from the pool should occur. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BfdEnabled? AutoAssign { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("True", "False")] + string AutoAssign { get; set; } /// /// The name used to identify this IP address pool for association with a BGP advertisement. /// @@ -125,7 +140,8 @@ internal partial interface IIPAddressPoolInternal /// The indicator to prevent the use of IP addresses ending with .0 and .255 for this pool. Enabling this option will only /// use IP addresses between .1 and .254 inclusive. /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BfdEnabled? OnlyUseHostIP { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("True", "False")] + string OnlyUseHostIP { get; set; } } } \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/IPAddressPool.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/IPAddressPool.json.cs new file mode 100644 index 000000000000..ded4cb076a60 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/IPAddressPool.json.cs @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + + /// + /// IpAddressPool represents a pool of IP addresses that can be allocated to a service. + /// + public partial class IPAddressPool + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IIPAddressPool. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IIPAddressPool. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IIPAddressPool FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new IPAddressPool(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject instance to deserialize from. + internal IPAddressPool(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_address = If( json?.PropertyT("addresses"), out var __jsonAddresses) ? If( __jsonAddresses as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : _address;} + {_autoAssign = If( json?.PropertyT("autoAssign"), out var __jsonAutoAssign) ? (string)__jsonAutoAssign : (string)_autoAssign;} + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)_name;} + {_onlyUseHostIP = If( json?.PropertyT("onlyUseHostIps"), out var __jsonOnlyUseHostIps) ? (string)__jsonOnlyUseHostIps : (string)_onlyUseHostIP;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)||serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate)) + { + if (null != this._address) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.XNodeArray(); + foreach( var __x in this._address ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("addresses",__w); + } + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)||serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate)) + { + AddIf( null != (((object)this._autoAssign)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._autoAssign.ToString()) : null, "autoAssign" ,container.Add ); + } + AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)||serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate)) + { + AddIf( null != (((object)this._onlyUseHostIP)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._onlyUseHostIP.ToString()) : null, "onlyUseHostIps" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/IdentitySelector.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/IdentitySelector.PowerShell.cs similarity index 77% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/IdentitySelector.PowerShell.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/IdentitySelector.PowerShell.cs index d7598274a1fd..71eadeb04eb8 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/IdentitySelector.PowerShell.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/IdentitySelector.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; @@ -63,27 +63,27 @@ public partial class IdentitySelector 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.NetworkCloud.Models.Api20250201.IIdentitySelector DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IIdentitySelector DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new IdentitySelector(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.NetworkCloud.Models.Api20250201.IIdentitySelector DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IIdentitySelector DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new IdentitySelector(content); } @@ -93,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIdentitySelector FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IIdentitySelector FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 IdentitySelector(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("IdentityType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIdentitySelectorInternal)this).IdentityType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType?) content.GetValueForProperty("IdentityType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIdentitySelectorInternal)this).IdentityType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IIdentitySelectorInternal)this).IdentityType = (string) content.GetValueForProperty("IdentityType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IIdentitySelectorInternal)this).IdentityType, global::System.Convert.ToString); } if (content.Contains("UserAssignedIdentityResourceId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIdentitySelectorInternal)this).UserAssignedIdentityResourceId = (string) content.GetValueForProperty("UserAssignedIdentityResourceId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIdentitySelectorInternal)this).UserAssignedIdentityResourceId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IIdentitySelectorInternal)this).UserAssignedIdentityResourceId = (string) content.GetValueForProperty("UserAssignedIdentityResourceId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IIdentitySelectorInternal)this).UserAssignedIdentityResourceId, 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 IdentitySelector(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("IdentityType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIdentitySelectorInternal)this).IdentityType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType?) content.GetValueForProperty("IdentityType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIdentitySelectorInternal)this).IdentityType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IIdentitySelectorInternal)this).IdentityType = (string) content.GetValueForProperty("IdentityType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IIdentitySelectorInternal)this).IdentityType, global::System.Convert.ToString); } if (content.Contains("UserAssignedIdentityResourceId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIdentitySelectorInternal)this).UserAssignedIdentityResourceId = (string) content.GetValueForProperty("UserAssignedIdentityResourceId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIdentitySelectorInternal)this).UserAssignedIdentityResourceId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IIdentitySelectorInternal)this).UserAssignedIdentityResourceId = (string) content.GetValueForProperty("UserAssignedIdentityResourceId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IIdentitySelectorInternal)this).UserAssignedIdentityResourceId, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/IdentitySelector.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/IdentitySelector.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/IdentitySelector.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/IdentitySelector.TypeConverter.cs index fdcb61e3261f..5c252ae486fd 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/IdentitySelector.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/IdentitySelector.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IIdentitySelector ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IIdentitySelector ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIdentitySelector).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IIdentitySelector).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/IdentitySelector.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/IdentitySelector.cs similarity index 78% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/IdentitySelector.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/IdentitySelector.cs index a7b1ca9f7587..12a924c236c9 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/IdentitySelector.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/IdentitySelector.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; /// IdentitySelector represents the selection of a managed identity for use. public partial class IdentitySelector : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIdentitySelector, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIdentitySelectorInternal + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IIdentitySelector, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IIdentitySelectorInternal { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType? _identityType; + private string _identityType; /// The type of managed identity that is being selected. [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType? IdentityType { get => this._identityType; set => this._identityType = value; } + public string IdentityType { get => this._identityType; set => this._identityType = value; } /// Backing field for property. private string _userAssignedIdentityResourceId; @@ -43,16 +43,23 @@ public partial interface IIdentitySelector : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The type of managed identity that is being selected.", SerializedName = @"identityType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType? IdentityType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("SystemAssignedIdentity", "UserAssignedIdentity")] + string IdentityType { get; set; } /// /// The user assigned managed identity resource ID to use. Mutually exclusive with a system assigned identity type. /// [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The user assigned managed identity resource ID to use. Mutually exclusive with a system assigned identity type.", SerializedName = @"userAssignedIdentityResourceId", PossibleTypes = new [] { typeof(string) })] @@ -64,7 +71,8 @@ internal partial interface IIdentitySelectorInternal { /// The type of managed identity that is being selected. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType? IdentityType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("SystemAssignedIdentity", "UserAssignedIdentity")] + string IdentityType { get; set; } /// /// The user assigned managed identity resource ID to use. Mutually exclusive with a system assigned identity type. /// diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/IdentitySelector.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/IdentitySelector.json.cs similarity index 95% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/IdentitySelector.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/IdentitySelector.json.cs index 480e3a52048b..d1f9d2e9f2e7 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/IdentitySelector.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/IdentitySelector.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class IdentitySelector partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIdentitySelector. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IIdentitySelector. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIdentitySelector. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IIdentitySelector. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIdentitySelector FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IIdentitySelector FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new IdentitySelector(json) : null; } @@ -77,8 +77,8 @@ internal IdentitySelector(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtim { return; } - {_identityType = If( json?.PropertyT("identityType"), out var __jsonIdentityType) ? (string)__jsonIdentityType : (string)IdentityType;} - {_userAssignedIdentityResourceId = If( json?.PropertyT("userAssignedIdentityResourceId"), out var __jsonUserAssignedIdentityResourceId) ? (string)__jsonUserAssignedIdentityResourceId : (string)UserAssignedIdentityResourceId;} + {_identityType = If( json?.PropertyT("identityType"), out var __jsonIdentityType) ? (string)__jsonIdentityType : (string)_identityType;} + {_userAssignedIdentityResourceId = If( json?.PropertyT("userAssignedIdentityResourceId"), out var __jsonUserAssignedIdentityResourceId) ? (string)__jsonUserAssignedIdentityResourceId : (string)_userAssignedIdentityResourceId;} AfterFromJson(json); } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ImageRepositoryCredentials.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ImageRepositoryCredentials.PowerShell.cs similarity index 76% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ImageRepositoryCredentials.PowerShell.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ImageRepositoryCredentials.PowerShell.cs index 9cfd956c195d..75e181c72d43 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ImageRepositoryCredentials.PowerShell.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ImageRepositoryCredentials.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; @@ -65,29 +65,27 @@ public partial class ImageRepositoryCredentials 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.NetworkCloud.Models.Api20250201.IImageRepositoryCredentials DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IImageRepositoryCredentials DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ImageRepositoryCredentials(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.NetworkCloud.Models.Api20250201.IImageRepositoryCredentials DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IImageRepositoryCredentials DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ImageRepositoryCredentials(content); } @@ -97,10 +95,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IImageRepositoryCredentials FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IImageRepositoryCredentials FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,21 +113,21 @@ internal ImageRepositoryCredentials(global::System.Collections.IDictionary conte // actually deserialize if (content.Contains("Password")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IImageRepositoryCredentialsInternal)this).Password = (System.Security.SecureString) content.GetValueForProperty("Password",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IImageRepositoryCredentialsInternal)this).Password, (object ss) => (System.Security.SecureString)ss); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IImageRepositoryCredentialsInternal)this).Password = (System.Security.SecureString) content.GetValueForProperty("Password",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IImageRepositoryCredentialsInternal)this).Password, (object ss) => (System.Security.SecureString)ss); } if (content.Contains("RegistryUrl")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IImageRepositoryCredentialsInternal)this).RegistryUrl = (string) content.GetValueForProperty("RegistryUrl",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IImageRepositoryCredentialsInternal)this).RegistryUrl, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IImageRepositoryCredentialsInternal)this).RegistryUrl = (string) content.GetValueForProperty("RegistryUrl",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IImageRepositoryCredentialsInternal)this).RegistryUrl, global::System.Convert.ToString); } if (content.Contains("Username")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IImageRepositoryCredentialsInternal)this).Username = (string) content.GetValueForProperty("Username",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IImageRepositoryCredentialsInternal)this).Username, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IImageRepositoryCredentialsInternal)this).Username = (string) content.GetValueForProperty("Username",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IImageRepositoryCredentialsInternal)this).Username, 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. @@ -144,15 +142,15 @@ internal ImageRepositoryCredentials(global::System.Management.Automation.PSObjec // actually deserialize if (content.Contains("Password")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IImageRepositoryCredentialsInternal)this).Password = (System.Security.SecureString) content.GetValueForProperty("Password",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IImageRepositoryCredentialsInternal)this).Password, (object ss) => (System.Security.SecureString)ss); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IImageRepositoryCredentialsInternal)this).Password = (System.Security.SecureString) content.GetValueForProperty("Password",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IImageRepositoryCredentialsInternal)this).Password, (object ss) => (System.Security.SecureString)ss); } if (content.Contains("RegistryUrl")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IImageRepositoryCredentialsInternal)this).RegistryUrl = (string) content.GetValueForProperty("RegistryUrl",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IImageRepositoryCredentialsInternal)this).RegistryUrl, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IImageRepositoryCredentialsInternal)this).RegistryUrl = (string) content.GetValueForProperty("RegistryUrl",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IImageRepositoryCredentialsInternal)this).RegistryUrl, global::System.Convert.ToString); } if (content.Contains("Username")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IImageRepositoryCredentialsInternal)this).Username = (string) content.GetValueForProperty("Username",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IImageRepositoryCredentialsInternal)this).Username, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IImageRepositoryCredentialsInternal)this).Username = (string) content.GetValueForProperty("Username",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IImageRepositoryCredentialsInternal)this).Username, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ImageRepositoryCredentials.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ImageRepositoryCredentials.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ImageRepositoryCredentials.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ImageRepositoryCredentials.TypeConverter.cs index 0a2c76f6b4be..bab8a64aaec8 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ImageRepositoryCredentials.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ImageRepositoryCredentials.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IImageRepositoryCredentials ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IImageRepositoryCredentials ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IImageRepositoryCredentials).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IImageRepositoryCredentials).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ImageRepositoryCredentials.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ImageRepositoryCredentials.cs similarity index 92% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ImageRepositoryCredentials.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ImageRepositoryCredentials.cs index a317cc6ccb46..bf576308fa10 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ImageRepositoryCredentials.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ImageRepositoryCredentials.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -11,8 +11,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201 /// ImageRepositoryCredentials represents the credentials used to login to the image repository. /// public partial class ImageRepositoryCredentials : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IImageRepositoryCredentials, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IImageRepositoryCredentialsInternal + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IImageRepositoryCredentials, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IImageRepositoryCredentialsInternal { /// Backing field for property. @@ -52,6 +52,9 @@ public partial interface IImageRepositoryCredentials : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The password or token used to access an image in the target repository.", SerializedName = @"password", PossibleTypes = new [] { typeof(System.Security.SecureString) })] @@ -62,6 +65,9 @@ public partial interface IImageRepositoryCredentials : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The URL of the authentication server used to validate the repository credentials.", SerializedName = @"registryUrl", PossibleTypes = new [] { typeof(string) })] @@ -70,6 +76,9 @@ public partial interface IImageRepositoryCredentials : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The username used to access an image in the target repository.", SerializedName = @"username", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ImageRepositoryCredentials.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ImageRepositoryCredentials.json.cs similarity index 94% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ImageRepositoryCredentials.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ImageRepositoryCredentials.json.cs index d557ba66c9d3..3778fa8cb43d 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ImageRepositoryCredentials.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ImageRepositoryCredentials.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -56,13 +56,13 @@ public partial class ImageRepositoryCredentials partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IImageRepositoryCredentials. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IImageRepositoryCredentials. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IImageRepositoryCredentials. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IImageRepositoryCredentials. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IImageRepositoryCredentials FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IImageRepositoryCredentials FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new ImageRepositoryCredentials(json) : null; } @@ -79,9 +79,9 @@ internal ImageRepositoryCredentials(Microsoft.Azure.PowerShell.Cmdlets.NetworkCl { return; } - {_password = If( json?.PropertyT("password"), out var __jsonPassword) ? new System.Net.NetworkCredential("",(string)__jsonPassword).SecurePassword : Password;} - {_registryUrl = If( json?.PropertyT("registryUrl"), out var __jsonRegistryUrl) ? (string)__jsonRegistryUrl : (string)RegistryUrl;} - {_username = If( json?.PropertyT("username"), out var __jsonUsername) ? (string)__jsonUsername : (string)Username;} + {_password = If( json?.PropertyT("password"), out var __jsonPassword) ? new System.Net.NetworkCredential("",(string)__jsonPassword).SecurePassword : _password;} + {_registryUrl = If( json?.PropertyT("registryUrl"), out var __jsonRegistryUrl) ? (string)__jsonRegistryUrl : (string)_registryUrl;} + {_username = If( json?.PropertyT("username"), out var __jsonUsername) ? (string)__jsonUsername : (string)_username;} AfterFromJson(json); } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/InitialAgentPoolConfiguration.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/InitialAgentPoolConfiguration.PowerShell.cs new file mode 100644 index 000000000000..8e18ab92afb0 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/InitialAgentPoolConfiguration.PowerShell.cs @@ -0,0 +1,328 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + + /// + /// InitialAgentPoolConfiguration specifies the configuration of a pool of virtual machines that are initially defined with + /// a Kubernetes cluster. + /// + [System.ComponentModel.TypeConverter(typeof(InitialAgentPoolConfigurationTypeConverter))] + public partial class InitialAgentPoolConfiguration + { + + /// + /// 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.NetworkCloud.Models.IInitialAgentPoolConfiguration DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new InitialAgentPoolConfiguration(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.NetworkCloud.Models.IInitialAgentPoolConfiguration DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new InitialAgentPoolConfiguration(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.NetworkCloud.Models.IInitialAgentPoolConfiguration FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal InitialAgentPoolConfiguration(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("AdministratorConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IInitialAgentPoolConfigurationInternal)this).AdministratorConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministratorConfiguration) content.GetValueForProperty("AdministratorConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IInitialAgentPoolConfigurationInternal)this).AdministratorConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AdministratorConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("AgentOption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IInitialAgentPoolConfigurationInternal)this).AgentOption = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentOptions) content.GetValueForProperty("AgentOption",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IInitialAgentPoolConfigurationInternal)this).AgentOption, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AgentOptionsTypeConverter.ConvertFrom); + } + if (content.Contains("AttachedNetworkConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IInitialAgentPoolConfigurationInternal)this).AttachedNetworkConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAttachedNetworkConfiguration) content.GetValueForProperty("AttachedNetworkConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IInitialAgentPoolConfigurationInternal)this).AttachedNetworkConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AttachedNetworkConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("UpgradeSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IInitialAgentPoolConfigurationInternal)this).UpgradeSetting = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolUpgradeSettings) content.GetValueForProperty("UpgradeSetting",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IInitialAgentPoolConfigurationInternal)this).UpgradeSetting, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AgentPoolUpgradeSettingsTypeConverter.ConvertFrom); + } + if (content.Contains("AvailabilityZone")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IInitialAgentPoolConfigurationInternal)this).AvailabilityZone = (System.Collections.Generic.List) content.GetValueForProperty("AvailabilityZone",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IInitialAgentPoolConfigurationInternal)this).AvailabilityZone, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("Count")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IInitialAgentPoolConfigurationInternal)this).Count = (long) content.GetValueForProperty("Count",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IInitialAgentPoolConfigurationInternal)this).Count, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("Label")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IInitialAgentPoolConfigurationInternal)this).Label = (System.Collections.Generic.List) content.GetValueForProperty("Label",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IInitialAgentPoolConfigurationInternal)this).Label, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.KubernetesLabelTypeConverter.ConvertFrom)); + } + if (content.Contains("Mode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IInitialAgentPoolConfigurationInternal)this).Mode = (string) content.GetValueForProperty("Mode",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IInitialAgentPoolConfigurationInternal)this).Mode, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IInitialAgentPoolConfigurationInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IInitialAgentPoolConfigurationInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Taint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IInitialAgentPoolConfigurationInternal)this).Taint = (System.Collections.Generic.List) content.GetValueForProperty("Taint",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IInitialAgentPoolConfigurationInternal)this).Taint, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.KubernetesLabelTypeConverter.ConvertFrom)); + } + if (content.Contains("VMSkuName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IInitialAgentPoolConfigurationInternal)this).VMSkuName = (string) content.GetValueForProperty("VMSkuName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IInitialAgentPoolConfigurationInternal)this).VMSkuName, global::System.Convert.ToString); + } + if (content.Contains("AdministratorConfigurationAdminUsername")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IInitialAgentPoolConfigurationInternal)this).AdministratorConfigurationAdminUsername = (string) content.GetValueForProperty("AdministratorConfigurationAdminUsername",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IInitialAgentPoolConfigurationInternal)this).AdministratorConfigurationAdminUsername, global::System.Convert.ToString); + } + if (content.Contains("AgentOptionHugepagesCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IInitialAgentPoolConfigurationInternal)this).AgentOptionHugepagesCount = (long?) content.GetValueForProperty("AgentOptionHugepagesCount",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IInitialAgentPoolConfigurationInternal)this).AgentOptionHugepagesCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("AgentOptionHugepagesSize")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IInitialAgentPoolConfigurationInternal)this).AgentOptionHugepagesSize = (string) content.GetValueForProperty("AgentOptionHugepagesSize",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IInitialAgentPoolConfigurationInternal)this).AgentOptionHugepagesSize, global::System.Convert.ToString); + } + if (content.Contains("AttachedNetworkConfigurationL2Network")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IInitialAgentPoolConfigurationInternal)this).AttachedNetworkConfigurationL2Network = (System.Collections.Generic.List) content.GetValueForProperty("AttachedNetworkConfigurationL2Network",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IInitialAgentPoolConfigurationInternal)this).AttachedNetworkConfigurationL2Network, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.L2NetworkAttachmentConfigurationTypeConverter.ConvertFrom)); + } + if (content.Contains("AttachedNetworkConfigurationL3Network")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IInitialAgentPoolConfigurationInternal)this).AttachedNetworkConfigurationL3Network = (System.Collections.Generic.List) content.GetValueForProperty("AttachedNetworkConfigurationL3Network",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IInitialAgentPoolConfigurationInternal)this).AttachedNetworkConfigurationL3Network, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.L3NetworkAttachmentConfigurationTypeConverter.ConvertFrom)); + } + if (content.Contains("AttachedNetworkConfigurationTrunkedNetwork")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IInitialAgentPoolConfigurationInternal)this).AttachedNetworkConfigurationTrunkedNetwork = (System.Collections.Generic.List) content.GetValueForProperty("AttachedNetworkConfigurationTrunkedNetwork",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IInitialAgentPoolConfigurationInternal)this).AttachedNetworkConfigurationTrunkedNetwork, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.TrunkedNetworkAttachmentConfigurationTypeConverter.ConvertFrom)); + } + if (content.Contains("AdministratorConfigurationSshPublicKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IInitialAgentPoolConfigurationInternal)this).AdministratorConfigurationSshPublicKey = (System.Collections.Generic.List) content.GetValueForProperty("AdministratorConfigurationSshPublicKey",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IInitialAgentPoolConfigurationInternal)this).AdministratorConfigurationSshPublicKey, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.SshPublicKeyTypeConverter.ConvertFrom)); + } + if (content.Contains("UpgradeSettingDrainTimeout")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IInitialAgentPoolConfigurationInternal)this).UpgradeSettingDrainTimeout = (long?) content.GetValueForProperty("UpgradeSettingDrainTimeout",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IInitialAgentPoolConfigurationInternal)this).UpgradeSettingDrainTimeout, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("UpgradeSettingMaxSurge")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IInitialAgentPoolConfigurationInternal)this).UpgradeSettingMaxSurge = (string) content.GetValueForProperty("UpgradeSettingMaxSurge",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IInitialAgentPoolConfigurationInternal)this).UpgradeSettingMaxSurge, global::System.Convert.ToString); + } + if (content.Contains("UpgradeSettingMaxUnavailable")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IInitialAgentPoolConfigurationInternal)this).UpgradeSettingMaxUnavailable = (string) content.GetValueForProperty("UpgradeSettingMaxUnavailable",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IInitialAgentPoolConfigurationInternal)this).UpgradeSettingMaxUnavailable, 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 InitialAgentPoolConfiguration(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("AdministratorConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IInitialAgentPoolConfigurationInternal)this).AdministratorConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministratorConfiguration) content.GetValueForProperty("AdministratorConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IInitialAgentPoolConfigurationInternal)this).AdministratorConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AdministratorConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("AgentOption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IInitialAgentPoolConfigurationInternal)this).AgentOption = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentOptions) content.GetValueForProperty("AgentOption",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IInitialAgentPoolConfigurationInternal)this).AgentOption, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AgentOptionsTypeConverter.ConvertFrom); + } + if (content.Contains("AttachedNetworkConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IInitialAgentPoolConfigurationInternal)this).AttachedNetworkConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAttachedNetworkConfiguration) content.GetValueForProperty("AttachedNetworkConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IInitialAgentPoolConfigurationInternal)this).AttachedNetworkConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AttachedNetworkConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("UpgradeSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IInitialAgentPoolConfigurationInternal)this).UpgradeSetting = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolUpgradeSettings) content.GetValueForProperty("UpgradeSetting",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IInitialAgentPoolConfigurationInternal)this).UpgradeSetting, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AgentPoolUpgradeSettingsTypeConverter.ConvertFrom); + } + if (content.Contains("AvailabilityZone")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IInitialAgentPoolConfigurationInternal)this).AvailabilityZone = (System.Collections.Generic.List) content.GetValueForProperty("AvailabilityZone",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IInitialAgentPoolConfigurationInternal)this).AvailabilityZone, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("Count")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IInitialAgentPoolConfigurationInternal)this).Count = (long) content.GetValueForProperty("Count",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IInitialAgentPoolConfigurationInternal)this).Count, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("Label")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IInitialAgentPoolConfigurationInternal)this).Label = (System.Collections.Generic.List) content.GetValueForProperty("Label",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IInitialAgentPoolConfigurationInternal)this).Label, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.KubernetesLabelTypeConverter.ConvertFrom)); + } + if (content.Contains("Mode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IInitialAgentPoolConfigurationInternal)this).Mode = (string) content.GetValueForProperty("Mode",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IInitialAgentPoolConfigurationInternal)this).Mode, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IInitialAgentPoolConfigurationInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IInitialAgentPoolConfigurationInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Taint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IInitialAgentPoolConfigurationInternal)this).Taint = (System.Collections.Generic.List) content.GetValueForProperty("Taint",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IInitialAgentPoolConfigurationInternal)this).Taint, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.KubernetesLabelTypeConverter.ConvertFrom)); + } + if (content.Contains("VMSkuName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IInitialAgentPoolConfigurationInternal)this).VMSkuName = (string) content.GetValueForProperty("VMSkuName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IInitialAgentPoolConfigurationInternal)this).VMSkuName, global::System.Convert.ToString); + } + if (content.Contains("AdministratorConfigurationAdminUsername")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IInitialAgentPoolConfigurationInternal)this).AdministratorConfigurationAdminUsername = (string) content.GetValueForProperty("AdministratorConfigurationAdminUsername",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IInitialAgentPoolConfigurationInternal)this).AdministratorConfigurationAdminUsername, global::System.Convert.ToString); + } + if (content.Contains("AgentOptionHugepagesCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IInitialAgentPoolConfigurationInternal)this).AgentOptionHugepagesCount = (long?) content.GetValueForProperty("AgentOptionHugepagesCount",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IInitialAgentPoolConfigurationInternal)this).AgentOptionHugepagesCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("AgentOptionHugepagesSize")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IInitialAgentPoolConfigurationInternal)this).AgentOptionHugepagesSize = (string) content.GetValueForProperty("AgentOptionHugepagesSize",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IInitialAgentPoolConfigurationInternal)this).AgentOptionHugepagesSize, global::System.Convert.ToString); + } + if (content.Contains("AttachedNetworkConfigurationL2Network")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IInitialAgentPoolConfigurationInternal)this).AttachedNetworkConfigurationL2Network = (System.Collections.Generic.List) content.GetValueForProperty("AttachedNetworkConfigurationL2Network",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IInitialAgentPoolConfigurationInternal)this).AttachedNetworkConfigurationL2Network, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.L2NetworkAttachmentConfigurationTypeConverter.ConvertFrom)); + } + if (content.Contains("AttachedNetworkConfigurationL3Network")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IInitialAgentPoolConfigurationInternal)this).AttachedNetworkConfigurationL3Network = (System.Collections.Generic.List) content.GetValueForProperty("AttachedNetworkConfigurationL3Network",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IInitialAgentPoolConfigurationInternal)this).AttachedNetworkConfigurationL3Network, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.L3NetworkAttachmentConfigurationTypeConverter.ConvertFrom)); + } + if (content.Contains("AttachedNetworkConfigurationTrunkedNetwork")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IInitialAgentPoolConfigurationInternal)this).AttachedNetworkConfigurationTrunkedNetwork = (System.Collections.Generic.List) content.GetValueForProperty("AttachedNetworkConfigurationTrunkedNetwork",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IInitialAgentPoolConfigurationInternal)this).AttachedNetworkConfigurationTrunkedNetwork, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.TrunkedNetworkAttachmentConfigurationTypeConverter.ConvertFrom)); + } + if (content.Contains("AdministratorConfigurationSshPublicKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IInitialAgentPoolConfigurationInternal)this).AdministratorConfigurationSshPublicKey = (System.Collections.Generic.List) content.GetValueForProperty("AdministratorConfigurationSshPublicKey",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IInitialAgentPoolConfigurationInternal)this).AdministratorConfigurationSshPublicKey, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.SshPublicKeyTypeConverter.ConvertFrom)); + } + if (content.Contains("UpgradeSettingDrainTimeout")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IInitialAgentPoolConfigurationInternal)this).UpgradeSettingDrainTimeout = (long?) content.GetValueForProperty("UpgradeSettingDrainTimeout",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IInitialAgentPoolConfigurationInternal)this).UpgradeSettingDrainTimeout, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("UpgradeSettingMaxSurge")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IInitialAgentPoolConfigurationInternal)this).UpgradeSettingMaxSurge = (string) content.GetValueForProperty("UpgradeSettingMaxSurge",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IInitialAgentPoolConfigurationInternal)this).UpgradeSettingMaxSurge, global::System.Convert.ToString); + } + if (content.Contains("UpgradeSettingMaxUnavailable")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IInitialAgentPoolConfigurationInternal)this).UpgradeSettingMaxUnavailable = (string) content.GetValueForProperty("UpgradeSettingMaxUnavailable",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IInitialAgentPoolConfigurationInternal)this).UpgradeSettingMaxUnavailable, 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.NetworkCloud.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(); + } + } + /// InitialAgentPoolConfiguration specifies the configuration of a pool of virtual machines that are initially defined with + /// a Kubernetes cluster. + [System.ComponentModel.TypeConverter(typeof(InitialAgentPoolConfigurationTypeConverter))] + public partial interface IInitialAgentPoolConfiguration + + { + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/InitialAgentPoolConfiguration.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/InitialAgentPoolConfiguration.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/InitialAgentPoolConfiguration.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/InitialAgentPoolConfiguration.TypeConverter.cs index 94c498a3a5f3..d13dcbde774b 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/InitialAgentPoolConfiguration.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/InitialAgentPoolConfiguration.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IInitialAgentPoolConfiguration ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IInitialAgentPoolConfiguration ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IInitialAgentPoolConfiguration).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IInitialAgentPoolConfiguration).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/InitialAgentPoolConfiguration.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/InitialAgentPoolConfiguration.cs new file mode 100644 index 000000000000..edd2cc56815f --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/InitialAgentPoolConfiguration.cs @@ -0,0 +1,495 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + + /// + /// InitialAgentPoolConfiguration specifies the configuration of a pool of virtual machines that are initially defined with + /// a Kubernetes cluster. + /// + public partial class InitialAgentPoolConfiguration : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IInitialAgentPoolConfiguration, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IInitialAgentPoolConfigurationInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministratorConfiguration _administratorConfiguration; + + /// The administrator credentials to be used for the nodes in this agent pool. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministratorConfiguration AdministratorConfiguration { get => (this._administratorConfiguration = this._administratorConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AdministratorConfiguration()); set => this._administratorConfiguration = value; } + + /// + /// The user name for the administrator that will be applied to the operating systems that run Kubernetes nodes. If not supplied, + /// a user name will be chosen by the service. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string AdministratorConfigurationAdminUsername { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministratorConfigurationInternal)AdministratorConfiguration).AdminUsername; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministratorConfigurationInternal)AdministratorConfiguration).AdminUsername = value ?? null; } + + /// + /// The SSH configuration for the operating systems that run the nodes in the Kubernetes cluster. In some cases, specification + /// of public keys may be required to produce a working environment. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public System.Collections.Generic.List AdministratorConfigurationSshPublicKey { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministratorConfigurationInternal)AdministratorConfiguration).SshPublicKey; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministratorConfigurationInternal)AdministratorConfiguration).SshPublicKey = value ?? null /* arrayOf */; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentOptions _agentOption; + + /// The configurations that will be applied to each agent in this agent pool. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentOptions AgentOption { get => (this._agentOption = this._agentOption ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AgentOptions()); set => this._agentOption = value; } + + /// The number of hugepages to allocate. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public long? AgentOptionHugepagesCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentOptionsInternal)AgentOption).HugepagesCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentOptionsInternal)AgentOption).HugepagesCount = value ?? default(long); } + + /// The size of the hugepages to allocate. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string AgentOptionHugepagesSize { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentOptionsInternal)AgentOption).HugepagesSize; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentOptionsInternal)AgentOption).HugepagesSize = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAttachedNetworkConfiguration _attachedNetworkConfiguration; + + /// + /// The configuration of networks being attached to the agent pool for use by the workloads that run on this Kubernetes cluster. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAttachedNetworkConfiguration AttachedNetworkConfiguration { get => (this._attachedNetworkConfiguration = this._attachedNetworkConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AttachedNetworkConfiguration()); set => this._attachedNetworkConfiguration = value; } + + /// The list of Layer 2 Networks and related configuration for attachment. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public System.Collections.Generic.List AttachedNetworkConfigurationL2Network { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAttachedNetworkConfigurationInternal)AttachedNetworkConfiguration).L2Network; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAttachedNetworkConfigurationInternal)AttachedNetworkConfiguration).L2Network = value ?? null /* arrayOf */; } + + /// The list of Layer 3 Networks and related configuration for attachment. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public System.Collections.Generic.List AttachedNetworkConfigurationL3Network { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAttachedNetworkConfigurationInternal)AttachedNetworkConfiguration).L3Network; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAttachedNetworkConfigurationInternal)AttachedNetworkConfiguration).L3Network = value ?? null /* arrayOf */; } + + /// The list of Trunked Networks and related configuration for attachment. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public System.Collections.Generic.List AttachedNetworkConfigurationTrunkedNetwork { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAttachedNetworkConfigurationInternal)AttachedNetworkConfiguration).TrunkedNetwork; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAttachedNetworkConfigurationInternal)AttachedNetworkConfiguration).TrunkedNetwork = value ?? null /* arrayOf */; } + + /// Backing field for property. + private System.Collections.Generic.List _availabilityZone; + + /// + /// The list of availability zones of the Network Cloud cluster used for the provisioning of nodes in this agent pool. If + /// not specified, all availability zones will be used. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public System.Collections.Generic.List AvailabilityZone { get => this._availabilityZone; set => this._availabilityZone = value; } + + /// Backing field for property. + private long _count; + + /// The number of virtual machines that use this configuration. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public long Count { get => this._count; set => this._count = value; } + + /// Backing field for property. + private System.Collections.Generic.List _label; + + /// The labels applied to the nodes in this agent pool. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public System.Collections.Generic.List Label { get => this._label; set => this._label = value; } + + /// Internal Acessors for AdministratorConfiguration + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministratorConfiguration Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IInitialAgentPoolConfigurationInternal.AdministratorConfiguration { get => (this._administratorConfiguration = this._administratorConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AdministratorConfiguration()); set { {_administratorConfiguration = value;} } } + + /// Internal Acessors for AgentOption + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentOptions Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IInitialAgentPoolConfigurationInternal.AgentOption { get => (this._agentOption = this._agentOption ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AgentOptions()); set { {_agentOption = value;} } } + + /// Internal Acessors for AttachedNetworkConfiguration + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAttachedNetworkConfiguration Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IInitialAgentPoolConfigurationInternal.AttachedNetworkConfiguration { get => (this._attachedNetworkConfiguration = this._attachedNetworkConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AttachedNetworkConfiguration()); set { {_attachedNetworkConfiguration = value;} } } + + /// Internal Acessors for UpgradeSetting + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolUpgradeSettings Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IInitialAgentPoolConfigurationInternal.UpgradeSetting { get => (this._upgradeSetting = this._upgradeSetting ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AgentPoolUpgradeSettings()); set { {_upgradeSetting = value;} } } + + /// Backing field for property. + private string _mode; + + /// + /// The selection of how this agent pool is utilized, either as a system pool or a user pool. System pools run the features + /// and critical services for the Kubernetes Cluster, while user pools are dedicated to user workloads. Every Kubernetes cluster + /// must contain at least one system node pool with at least one node. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string Mode { get => this._mode; set => this._mode = value; } + + /// Backing field for property. + private string _name; + + /// + /// The name that will be used for the agent pool resource representing this agent pool. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string Name { get => this._name; set => this._name = value; } + + /// Backing field for property. + private System.Collections.Generic.List _taint; + + /// The taints applied to the nodes in this agent pool. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public System.Collections.Generic.List Taint { get => this._taint; set => this._taint = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolUpgradeSettings _upgradeSetting; + + /// The configuration of the agent pool. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolUpgradeSettings UpgradeSetting { get => (this._upgradeSetting = this._upgradeSetting ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AgentPoolUpgradeSettings()); set => this._upgradeSetting = value; } + + /// + /// The maximum time in seconds that is allowed for a node drain to complete before proceeding with the upgrade of the agent + /// pool. If not specified during creation, a value of 1800 seconds is used. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public long? UpgradeSettingDrainTimeout { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolUpgradeSettingsInternal)UpgradeSetting).DrainTimeout; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolUpgradeSettingsInternal)UpgradeSetting).DrainTimeout = value ?? default(long); } + + /// + /// The maximum number or percentage of nodes that are surged during upgrade. This can either be set to an integer (e.g. '5') + /// or a percentage (e.g. '50%'). If a percentage is specified, it is the percentage of the total agent pool size at the time + /// of the upgrade. For percentages, fractional nodes are rounded up. If not specified during creation, a value of 1 is used. + /// One of MaxSurge and MaxUnavailable must be greater than 0. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string UpgradeSettingMaxSurge { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolUpgradeSettingsInternal)UpgradeSetting).MaxSurge; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolUpgradeSettingsInternal)UpgradeSetting).MaxSurge = value ?? null; } + + /// + /// The maximum number or percentage of nodes that can be unavailable during upgrade. This can either be set to an integer + /// (e.g. '5') or a percentage (e.g. '50%'). If a percentage is specified, it is the percentage of the total agent pool size + /// at the time of the upgrade. For percentages, fractional nodes are rounded up. If not specified during creation, a value + /// of 0 is used. One of MaxSurge and MaxUnavailable must be greater than 0. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string UpgradeSettingMaxUnavailable { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolUpgradeSettingsInternal)UpgradeSetting).MaxUnavailable; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolUpgradeSettingsInternal)UpgradeSetting).MaxUnavailable = value ?? null; } + + /// Backing field for property. + private string _vMSkuName; + + /// + /// The name of the VM SKU that determines the size of resources allocated for node VMs. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string VMSkuName { get => this._vMSkuName; set => this._vMSkuName = value; } + + /// Creates an new instance. + public InitialAgentPoolConfiguration() + { + + } + } + /// InitialAgentPoolConfiguration specifies the configuration of a pool of virtual machines that are initially defined with + /// a Kubernetes cluster. + public partial interface IInitialAgentPoolConfiguration : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable + { + /// + /// The user name for the administrator that will be applied to the operating systems that run Kubernetes nodes. If not supplied, + /// a user name will be chosen by the service. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The user name for the administrator that will be applied to the operating systems that run Kubernetes nodes. If not supplied, a user name will be chosen by the service.", + SerializedName = @"adminUsername", + PossibleTypes = new [] { typeof(string) })] + string AdministratorConfigurationAdminUsername { get; set; } + /// + /// The SSH configuration for the operating systems that run the nodes in the Kubernetes cluster. In some cases, specification + /// of public keys may be required to produce a working environment. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The SSH configuration for the operating systems that run the nodes in the Kubernetes cluster. In some cases, specification of public keys may be required to produce a working environment.", + SerializedName = @"sshPublicKeys", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISshPublicKey) })] + System.Collections.Generic.List AdministratorConfigurationSshPublicKey { get; set; } + /// The number of hugepages to allocate. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The number of hugepages to allocate.", + SerializedName = @"hugepagesCount", + PossibleTypes = new [] { typeof(long) })] + long? AgentOptionHugepagesCount { get; set; } + /// The size of the hugepages to allocate. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The size of the hugepages to allocate.", + SerializedName = @"hugepagesSize", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("2M", "1G")] + string AgentOptionHugepagesSize { get; set; } + /// The list of Layer 2 Networks and related configuration for attachment. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The list of Layer 2 Networks and related configuration for attachment.", + SerializedName = @"l2Networks", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkAttachmentConfiguration) })] + System.Collections.Generic.List AttachedNetworkConfigurationL2Network { get; set; } + /// The list of Layer 3 Networks and related configuration for attachment. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The list of Layer 3 Networks and related configuration for attachment.", + SerializedName = @"l3Networks", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkAttachmentConfiguration) })] + System.Collections.Generic.List AttachedNetworkConfigurationL3Network { get; set; } + /// The list of Trunked Networks and related configuration for attachment. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The list of Trunked Networks and related configuration for attachment.", + SerializedName = @"trunkedNetworks", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkAttachmentConfiguration) })] + System.Collections.Generic.List AttachedNetworkConfigurationTrunkedNetwork { get; set; } + /// + /// The list of availability zones of the Network Cloud cluster used for the provisioning of nodes in this agent pool. If + /// not specified, all availability zones will be used. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The list of availability zones of the Network Cloud cluster used for the provisioning of nodes in this agent pool. If not specified, all availability zones will be used.", + SerializedName = @"availabilityZones", + PossibleTypes = new [] { typeof(string) })] + System.Collections.Generic.List AvailabilityZone { get; set; } + /// The number of virtual machines that use this configuration. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The number of virtual machines that use this configuration.", + SerializedName = @"count", + PossibleTypes = new [] { typeof(long) })] + long Count { get; set; } + /// The labels applied to the nodes in this agent pool. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The labels applied to the nodes in this agent pool.", + SerializedName = @"labels", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesLabel) })] + System.Collections.Generic.List Label { get; set; } + /// + /// The selection of how this agent pool is utilized, either as a system pool or a user pool. System pools run the features + /// and critical services for the Kubernetes Cluster, while user pools are dedicated to user workloads. Every Kubernetes cluster + /// must contain at least one system node pool with at least one node. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The selection of how this agent pool is utilized, either as a system pool or a user pool. System pools run the features and critical services for the Kubernetes Cluster, while user pools are dedicated to user workloads. Every Kubernetes cluster must contain at least one system node pool with at least one node.", + SerializedName = @"mode", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("System", "User", "NotApplicable")] + string Mode { get; set; } + /// + /// The name that will be used for the agent pool resource representing this agent pool. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The name that will be used for the agent pool resource representing this agent pool.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string Name { get; set; } + /// The taints applied to the nodes in this agent pool. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The taints applied to the nodes in this agent pool.", + SerializedName = @"taints", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesLabel) })] + System.Collections.Generic.List Taint { get; set; } + /// + /// The maximum time in seconds that is allowed for a node drain to complete before proceeding with the upgrade of the agent + /// pool. If not specified during creation, a value of 1800 seconds is used. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The maximum time in seconds that is allowed for a node drain to complete before proceeding with the upgrade of the agent pool. If not specified during creation, a value of 1800 seconds is used.", + SerializedName = @"drainTimeout", + PossibleTypes = new [] { typeof(long) })] + long? UpgradeSettingDrainTimeout { get; set; } + /// + /// The maximum number or percentage of nodes that are surged during upgrade. This can either be set to an integer (e.g. '5') + /// or a percentage (e.g. '50%'). If a percentage is specified, it is the percentage of the total agent pool size at the time + /// of the upgrade. For percentages, fractional nodes are rounded up. If not specified during creation, a value of 1 is used. + /// One of MaxSurge and MaxUnavailable must be greater than 0. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The maximum number or percentage of nodes that are surged during upgrade. This can either be set to an integer (e.g. '5') or a percentage (e.g. '50%'). If a percentage is specified, it is the percentage of the total agent pool size at the time of the upgrade. For percentages, fractional nodes are rounded up. If not specified during creation, a value of 1 is used. One of MaxSurge and MaxUnavailable must be greater than 0.", + SerializedName = @"maxSurge", + PossibleTypes = new [] { typeof(string) })] + string UpgradeSettingMaxSurge { get; set; } + /// + /// The maximum number or percentage of nodes that can be unavailable during upgrade. This can either be set to an integer + /// (e.g. '5') or a percentage (e.g. '50%'). If a percentage is specified, it is the percentage of the total agent pool size + /// at the time of the upgrade. For percentages, fractional nodes are rounded up. If not specified during creation, a value + /// of 0 is used. One of MaxSurge and MaxUnavailable must be greater than 0. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The maximum number or percentage of nodes that can be unavailable during upgrade. This can either be set to an integer (e.g. '5') or a percentage (e.g. '50%'). If a percentage is specified, it is the percentage of the total agent pool size at the time of the upgrade. For percentages, fractional nodes are rounded up. If not specified during creation, a value of 0 is used. One of MaxSurge and MaxUnavailable must be greater than 0.", + SerializedName = @"maxUnavailable", + PossibleTypes = new [] { typeof(string) })] + string UpgradeSettingMaxUnavailable { get; set; } + /// + /// The name of the VM SKU that determines the size of resources allocated for node VMs. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The name of the VM SKU that determines the size of resources allocated for node VMs.", + SerializedName = @"vmSkuName", + PossibleTypes = new [] { typeof(string) })] + string VMSkuName { get; set; } + + } + /// InitialAgentPoolConfiguration specifies the configuration of a pool of virtual machines that are initially defined with + /// a Kubernetes cluster. + internal partial interface IInitialAgentPoolConfigurationInternal + + { + /// The administrator credentials to be used for the nodes in this agent pool. + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministratorConfiguration AdministratorConfiguration { get; set; } + /// + /// The user name for the administrator that will be applied to the operating systems that run Kubernetes nodes. If not supplied, + /// a user name will be chosen by the service. + /// + string AdministratorConfigurationAdminUsername { get; set; } + /// + /// The SSH configuration for the operating systems that run the nodes in the Kubernetes cluster. In some cases, specification + /// of public keys may be required to produce a working environment. + /// + System.Collections.Generic.List AdministratorConfigurationSshPublicKey { get; set; } + /// The configurations that will be applied to each agent in this agent pool. + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentOptions AgentOption { get; set; } + /// The number of hugepages to allocate. + long? AgentOptionHugepagesCount { get; set; } + /// The size of the hugepages to allocate. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("2M", "1G")] + string AgentOptionHugepagesSize { get; set; } + /// + /// The configuration of networks being attached to the agent pool for use by the workloads that run on this Kubernetes cluster. + /// + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAttachedNetworkConfiguration AttachedNetworkConfiguration { get; set; } + /// The list of Layer 2 Networks and related configuration for attachment. + System.Collections.Generic.List AttachedNetworkConfigurationL2Network { get; set; } + /// The list of Layer 3 Networks and related configuration for attachment. + System.Collections.Generic.List AttachedNetworkConfigurationL3Network { get; set; } + /// The list of Trunked Networks and related configuration for attachment. + System.Collections.Generic.List AttachedNetworkConfigurationTrunkedNetwork { get; set; } + /// + /// The list of availability zones of the Network Cloud cluster used for the provisioning of nodes in this agent pool. If + /// not specified, all availability zones will be used. + /// + System.Collections.Generic.List AvailabilityZone { get; set; } + /// The number of virtual machines that use this configuration. + long Count { get; set; } + /// The labels applied to the nodes in this agent pool. + System.Collections.Generic.List Label { get; set; } + /// + /// The selection of how this agent pool is utilized, either as a system pool or a user pool. System pools run the features + /// and critical services for the Kubernetes Cluster, while user pools are dedicated to user workloads. Every Kubernetes cluster + /// must contain at least one system node pool with at least one node. + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("System", "User", "NotApplicable")] + string Mode { get; set; } + /// + /// The name that will be used for the agent pool resource representing this agent pool. + /// + string Name { get; set; } + /// The taints applied to the nodes in this agent pool. + System.Collections.Generic.List Taint { get; set; } + /// The configuration of the agent pool. + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolUpgradeSettings UpgradeSetting { get; set; } + /// + /// The maximum time in seconds that is allowed for a node drain to complete before proceeding with the upgrade of the agent + /// pool. If not specified during creation, a value of 1800 seconds is used. + /// + long? UpgradeSettingDrainTimeout { get; set; } + /// + /// The maximum number or percentage of nodes that are surged during upgrade. This can either be set to an integer (e.g. '5') + /// or a percentage (e.g. '50%'). If a percentage is specified, it is the percentage of the total agent pool size at the time + /// of the upgrade. For percentages, fractional nodes are rounded up. If not specified during creation, a value of 1 is used. + /// One of MaxSurge and MaxUnavailable must be greater than 0. + /// + string UpgradeSettingMaxSurge { get; set; } + /// + /// The maximum number or percentage of nodes that can be unavailable during upgrade. This can either be set to an integer + /// (e.g. '5') or a percentage (e.g. '50%'). If a percentage is specified, it is the percentage of the total agent pool size + /// at the time of the upgrade. For percentages, fractional nodes are rounded up. If not specified during creation, a value + /// of 0 is used. One of MaxSurge and MaxUnavailable must be greater than 0. + /// + string UpgradeSettingMaxUnavailable { get; set; } + /// + /// The name of the VM SKU that determines the size of resources allocated for node VMs. + /// + string VMSkuName { get; set; } + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/InitialAgentPoolConfiguration.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/InitialAgentPoolConfiguration.json.cs new file mode 100644 index 000000000000..1fabda07d03a --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/InitialAgentPoolConfiguration.json.cs @@ -0,0 +1,173 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + + /// + /// InitialAgentPoolConfiguration specifies the configuration of a pool of virtual machines that are initially defined with + /// a Kubernetes cluster. + /// + public partial class InitialAgentPoolConfiguration + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IInitialAgentPoolConfiguration. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IInitialAgentPoolConfiguration. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IInitialAgentPoolConfiguration FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new InitialAgentPoolConfiguration(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject instance to deserialize from. + internal InitialAgentPoolConfiguration(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_administratorConfiguration = If( json?.PropertyT("administratorConfiguration"), out var __jsonAdministratorConfiguration) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AdministratorConfiguration.FromJson(__jsonAdministratorConfiguration) : _administratorConfiguration;} + {_agentOption = If( json?.PropertyT("agentOptions"), out var __jsonAgentOptions) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AgentOptions.FromJson(__jsonAgentOptions) : _agentOption;} + {_attachedNetworkConfiguration = If( json?.PropertyT("attachedNetworkConfiguration"), out var __jsonAttachedNetworkConfiguration) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AttachedNetworkConfiguration.FromJson(__jsonAttachedNetworkConfiguration) : _attachedNetworkConfiguration;} + {_upgradeSetting = If( json?.PropertyT("upgradeSettings"), out var __jsonUpgradeSettings) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AgentPoolUpgradeSettings.FromJson(__jsonUpgradeSettings) : _upgradeSetting;} + {_availabilityZone = If( json?.PropertyT("availabilityZones"), out var __jsonAvailabilityZones) ? If( __jsonAvailabilityZones as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : _availabilityZone;} + {_count = If( json?.PropertyT("count"), out var __jsonCount) ? (long)__jsonCount : _count;} + {_label = If( json?.PropertyT("labels"), out var __jsonLabels) ? If( __jsonLabels as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.IKubernetesLabel) (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.KubernetesLabel.FromJson(__p) )) ))() : null : _label;} + {_mode = If( json?.PropertyT("mode"), out var __jsonMode) ? (string)__jsonMode : (string)_mode;} + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)_name;} + {_taint = If( json?.PropertyT("taints"), out var __jsonTaints) ? If( __jsonTaints as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonArray, out var __l) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__l, (__k)=>(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesLabel) (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.KubernetesLabel.FromJson(__k) )) ))() : null : _taint;} + {_vMSkuName = If( json?.PropertyT("vmSkuName"), out var __jsonVMSkuName) ? (string)__jsonVMSkuName : (string)_vMSkuName;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)||serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate)) + { + AddIf( null != this._administratorConfiguration ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) this._administratorConfiguration.ToJson(null,serializationMode) : null, "administratorConfiguration" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)||serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate)) + { + AddIf( null != this._agentOption ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) this._agentOption.ToJson(null,serializationMode) : null, "agentOptions" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)||serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate)) + { + AddIf( null != this._attachedNetworkConfiguration ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) this._attachedNetworkConfiguration.ToJson(null,serializationMode) : null, "attachedNetworkConfiguration" ,container.Add ); + } + AddIf( null != this._upgradeSetting ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) this._upgradeSetting.ToJson(null,serializationMode) : null, "upgradeSettings" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)||serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate)) + { + if (null != this._availabilityZone) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.XNodeArray(); + foreach( var __x in this._availabilityZone ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("availabilityZones",__w); + } + } + AddIf( (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNumber(this._count), "count" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)||serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate)) + { + if (null != this._label) + { + var __r = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.XNodeArray(); + foreach( var __s in this._label ) + { + AddIf(__s?.ToJson(null, serializationMode) ,__r.Add); + } + container.Add("labels",__r); + } + } + AddIf( null != (((object)this._mode)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._mode.ToString()) : null, "mode" ,container.Add ); + AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)||serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate)) + { + if (null != this._taint) + { + var __m = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.XNodeArray(); + foreach( var __n in this._taint ) + { + AddIf(__n?.ToJson(null, serializationMode) ,__m.Add); + } + container.Add("taints",__m); + } + } + AddIf( null != (((object)this._vMSkuName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._vMSkuName.ToString()) : null, "vmSkuName" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KeySetUser.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KeySetUser.PowerShell.cs new file mode 100644 index 000000000000..59325d4d7755 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KeySetUser.PowerShell.cs @@ -0,0 +1,196 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + + /// KeySetUser represents the properties of the user in the key set. + [System.ComponentModel.TypeConverter(typeof(KeySetUserTypeConverter))] + public partial class KeySetUser + { + + /// + /// 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.NetworkCloud.Models.IKeySetUser DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new KeySetUser(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.NetworkCloud.Models.IKeySetUser DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new KeySetUser(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.NetworkCloud.Models.IKeySetUser FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal KeySetUser(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("SshPublicKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKeySetUserInternal)this).SshPublicKey = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISshPublicKey) content.GetValueForProperty("SshPublicKey",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKeySetUserInternal)this).SshPublicKey, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.SshPublicKeyTypeConverter.ConvertFrom); + } + if (content.Contains("AzureUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKeySetUserInternal)this).AzureUserName = (string) content.GetValueForProperty("AzureUserName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKeySetUserInternal)this).AzureUserName, global::System.Convert.ToString); + } + if (content.Contains("Description")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKeySetUserInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKeySetUserInternal)this).Description, global::System.Convert.ToString); + } + if (content.Contains("UserPrincipalName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKeySetUserInternal)this).UserPrincipalName = (string) content.GetValueForProperty("UserPrincipalName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKeySetUserInternal)this).UserPrincipalName, global::System.Convert.ToString); + } + if (content.Contains("SshPublicKeyData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKeySetUserInternal)this).SshPublicKeyData = (string) content.GetValueForProperty("SshPublicKeyData",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKeySetUserInternal)this).SshPublicKeyData, 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 KeySetUser(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("SshPublicKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKeySetUserInternal)this).SshPublicKey = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISshPublicKey) content.GetValueForProperty("SshPublicKey",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKeySetUserInternal)this).SshPublicKey, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.SshPublicKeyTypeConverter.ConvertFrom); + } + if (content.Contains("AzureUserName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKeySetUserInternal)this).AzureUserName = (string) content.GetValueForProperty("AzureUserName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKeySetUserInternal)this).AzureUserName, global::System.Convert.ToString); + } + if (content.Contains("Description")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKeySetUserInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKeySetUserInternal)this).Description, global::System.Convert.ToString); + } + if (content.Contains("UserPrincipalName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKeySetUserInternal)this).UserPrincipalName = (string) content.GetValueForProperty("UserPrincipalName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKeySetUserInternal)this).UserPrincipalName, global::System.Convert.ToString); + } + if (content.Contains("SshPublicKeyData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKeySetUserInternal)this).SshPublicKeyData = (string) content.GetValueForProperty("SshPublicKeyData",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKeySetUserInternal)this).SshPublicKeyData, 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.NetworkCloud.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(); + } + } + /// KeySetUser represents the properties of the user in the key set. + [System.ComponentModel.TypeConverter(typeof(KeySetUserTypeConverter))] + public partial interface IKeySetUser + + { + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KeySetUser.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KeySetUser.TypeConverter.cs similarity index 98% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KeySetUser.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KeySetUser.TypeConverter.cs index 5fd97bb39a53..ea267a19562b 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KeySetUser.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KeySetUser.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IKeySetUser ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKeySetUser ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKeySetUser).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKeySetUser).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KeySetUser.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KeySetUser.cs similarity index 81% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KeySetUser.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KeySetUser.cs index 69559a6c2d84..8defd2893e43 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KeySetUser.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KeySetUser.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; /// KeySetUser represents the properties of the user in the key set. public partial class KeySetUser : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKeySetUser, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKeySetUserInternal + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKeySetUser, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKeySetUserInternal { /// Backing field for property. @@ -28,21 +28,21 @@ public partial class KeySetUser : public string Description { get => this._description; set => this._description = value; } /// Internal Acessors for SshPublicKey - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKeySetUserInternal.SshPublicKey { get => (this._sshPublicKey = this._sshPublicKey ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.SshPublicKey()); set { {_sshPublicKey = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISshPublicKey Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKeySetUserInternal.SshPublicKey { get => (this._sshPublicKey = this._sshPublicKey ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.SshPublicKey()); set { {_sshPublicKey = value;} } } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey _sshPublicKey; + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISshPublicKey _sshPublicKey; /// /// The SSH public key that will be provisioned for user access. The user is expected to have the corresponding SSH private /// key for logging in. /// [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey SshPublicKey { get => (this._sshPublicKey = this._sshPublicKey ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.SshPublicKey()); set => this._sshPublicKey = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISshPublicKey SshPublicKey { get => (this._sshPublicKey = this._sshPublicKey ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.SshPublicKey()); set => this._sshPublicKey = value; } /// The SSH public key data. [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string SshPublicKeyData { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKeyInternal)SshPublicKey).KeyData; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKeyInternal)SshPublicKey).KeyData = value ; } + public string SshPublicKeyData { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISshPublicKeyInternal)SshPublicKey).KeyData; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISshPublicKeyInternal)SshPublicKey).KeyData = value ; } /// Backing field for property. private string _userPrincipalName; @@ -67,6 +67,9 @@ public partial interface IKeySetUser : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The user name that will be used for access.", SerializedName = @"azureUserName", PossibleTypes = new [] { typeof(string) })] @@ -75,6 +78,9 @@ public partial interface IKeySetUser : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The free-form description for this user.", SerializedName = @"description", PossibleTypes = new [] { typeof(string) })] @@ -83,6 +89,9 @@ public partial interface IKeySetUser : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The SSH public key data.", SerializedName = @"keyData", PossibleTypes = new [] { typeof(string) })] @@ -93,6 +102,9 @@ public partial interface IKeySetUser : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The user principal name (email format) used to validate this user's group membership.", SerializedName = @"userPrincipalName", PossibleTypes = new [] { typeof(string) })] @@ -111,7 +123,7 @@ internal partial interface IKeySetUserInternal /// The SSH public key that will be provisioned for user access. The user is expected to have the corresponding SSH private /// key for logging in. /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey SshPublicKey { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISshPublicKey SshPublicKey { get; set; } /// The SSH public key data. string SshPublicKeyData { get; set; } /// diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KeySetUser.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KeySetUser.json.cs similarity index 94% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KeySetUser.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KeySetUser.json.cs index d83f9baa0c11..6da6917d537d 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KeySetUser.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KeySetUser.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class KeySetUser partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKeySetUser. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKeySetUser. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKeySetUser. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKeySetUser. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKeySetUser FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKeySetUser FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new KeySetUser(json) : null; } @@ -77,10 +77,10 @@ internal KeySetUser(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json { return; } - {_sshPublicKey = If( json?.PropertyT("sshPublicKey"), out var __jsonSshPublicKey) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.SshPublicKey.FromJson(__jsonSshPublicKey) : SshPublicKey;} - {_azureUserName = If( json?.PropertyT("azureUserName"), out var __jsonAzureUserName) ? (string)__jsonAzureUserName : (string)AzureUserName;} - {_description = If( json?.PropertyT("description"), out var __jsonDescription) ? (string)__jsonDescription : (string)Description;} - {_userPrincipalName = If( json?.PropertyT("userPrincipalName"), out var __jsonUserPrincipalName) ? (string)__jsonUserPrincipalName : (string)UserPrincipalName;} + {_sshPublicKey = If( json?.PropertyT("sshPublicKey"), out var __jsonSshPublicKey) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.SshPublicKey.FromJson(__jsonSshPublicKey) : _sshPublicKey;} + {_azureUserName = If( json?.PropertyT("azureUserName"), out var __jsonAzureUserName) ? (string)__jsonAzureUserName : (string)_azureUserName;} + {_description = If( json?.PropertyT("description"), out var __jsonDescription) ? (string)__jsonDescription : (string)_description;} + {_userPrincipalName = If( json?.PropertyT("userPrincipalName"), out var __jsonUserPrincipalName) ? (string)__jsonUserPrincipalName : (string)_userPrincipalName;} AfterFromJson(json); } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KeySetUserStatus.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KeySetUserStatus.PowerShell.cs similarity index 75% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KeySetUserStatus.PowerShell.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KeySetUserStatus.PowerShell.cs index bec0e8b34963..600b3c76dac5 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KeySetUserStatus.PowerShell.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KeySetUserStatus.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; @@ -63,27 +63,27 @@ public partial class KeySetUserStatus 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.NetworkCloud.Models.Api20250201.IKeySetUserStatus DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKeySetUserStatus DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new KeySetUserStatus(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.NetworkCloud.Models.Api20250201.IKeySetUserStatus DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKeySetUserStatus DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new KeySetUserStatus(content); } @@ -93,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKeySetUserStatus FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKeySetUserStatus FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,21 +111,21 @@ internal KeySetUserStatus(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("AzureUserName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKeySetUserStatusInternal)this).AzureUserName = (string) content.GetValueForProperty("AzureUserName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKeySetUserStatusInternal)this).AzureUserName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKeySetUserStatusInternal)this).AzureUserName = (string) content.GetValueForProperty("AzureUserName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKeySetUserStatusInternal)this).AzureUserName, global::System.Convert.ToString); } if (content.Contains("Status")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKeySetUserStatusInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineKeySetUserSetupStatus?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKeySetUserStatusInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineKeySetUserSetupStatus.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKeySetUserStatusInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKeySetUserStatusInternal)this).Status, global::System.Convert.ToString); } if (content.Contains("StatusMessage")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKeySetUserStatusInternal)this).StatusMessage = (string) content.GetValueForProperty("StatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKeySetUserStatusInternal)this).StatusMessage, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKeySetUserStatusInternal)this).StatusMessage = (string) content.GetValueForProperty("StatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKeySetUserStatusInternal)this).StatusMessage, 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,15 +140,15 @@ internal KeySetUserStatus(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("AzureUserName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKeySetUserStatusInternal)this).AzureUserName = (string) content.GetValueForProperty("AzureUserName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKeySetUserStatusInternal)this).AzureUserName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKeySetUserStatusInternal)this).AzureUserName = (string) content.GetValueForProperty("AzureUserName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKeySetUserStatusInternal)this).AzureUserName, global::System.Convert.ToString); } if (content.Contains("Status")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKeySetUserStatusInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineKeySetUserSetupStatus?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKeySetUserStatusInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineKeySetUserSetupStatus.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKeySetUserStatusInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKeySetUserStatusInternal)this).Status, global::System.Convert.ToString); } if (content.Contains("StatusMessage")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKeySetUserStatusInternal)this).StatusMessage = (string) content.GetValueForProperty("StatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKeySetUserStatusInternal)this).StatusMessage, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKeySetUserStatusInternal)this).StatusMessage = (string) content.GetValueForProperty("StatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKeySetUserStatusInternal)this).StatusMessage, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KeySetUserStatus.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KeySetUserStatus.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KeySetUserStatus.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KeySetUserStatus.TypeConverter.cs index 0c7610e5fb5a..831794ec0ffd 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KeySetUserStatus.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KeySetUserStatus.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IKeySetUserStatus ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKeySetUserStatus ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKeySetUserStatus).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKeySetUserStatus).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KeySetUserStatus.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KeySetUserStatus.cs similarity index 76% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KeySetUserStatus.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KeySetUserStatus.cs index ac842cca75d9..dfe53d2f28dd 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KeySetUserStatus.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KeySetUserStatus.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; /// KeySetUserStatus represents the status of the key set user. public partial class KeySetUserStatus : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKeySetUserStatus, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKeySetUserStatusInternal + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKeySetUserStatus, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKeySetUserStatusInternal { /// Backing field for property. @@ -21,20 +21,20 @@ public partial class KeySetUserStatus : public string AzureUserName { get => this._azureUserName; } /// Internal Acessors for AzureUserName - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKeySetUserStatusInternal.AzureUserName { get => this._azureUserName; set { {_azureUserName = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKeySetUserStatusInternal.AzureUserName { get => this._azureUserName; set { {_azureUserName = value;} } } /// Internal Acessors for Status - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineKeySetUserSetupStatus? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKeySetUserStatusInternal.Status { get => this._status; set { {_status = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKeySetUserStatusInternal.Status { get => this._status; set { {_status = value;} } } /// Internal Acessors for StatusMessage - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKeySetUserStatusInternal.StatusMessage { get => this._statusMessage; set { {_statusMessage = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKeySetUserStatusInternal.StatusMessage { get => this._statusMessage; set { {_statusMessage = value;} } } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineKeySetUserSetupStatus? _status; + private string _status; /// The indicator of whether the user is currently deployed for access. [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineKeySetUserSetupStatus? Status { get => this._status; } + public string Status { get => this._status; } /// Backing field for property. private string _statusMessage; @@ -59,6 +59,9 @@ public partial interface IKeySetUserStatus : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The user name that will be used for access.", SerializedName = @"azureUserName", PossibleTypes = new [] { typeof(string) })] @@ -67,16 +70,23 @@ public partial interface IKeySetUserStatus : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The indicator of whether the user is currently deployed for access.", SerializedName = @"status", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineKeySetUserSetupStatus) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineKeySetUserSetupStatus? Status { get; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Active", "Invalid")] + string Status { get; } /// /// The additional information describing the current status of this user, if any available. /// [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The additional information describing the current status of this user, if any available.", SerializedName = @"statusMessage", PossibleTypes = new [] { typeof(string) })] @@ -90,7 +100,8 @@ internal partial interface IKeySetUserStatusInternal /// The user name that will be used for access. string AzureUserName { get; set; } /// The indicator of whether the user is currently deployed for access. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineKeySetUserSetupStatus? Status { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Active", "Invalid")] + string Status { get; set; } /// /// The additional information describing the current status of this user, if any available. /// diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KeySetUserStatus.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KeySetUserStatus.json.cs similarity index 92% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KeySetUserStatus.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KeySetUserStatus.json.cs index 9e9e4e59511f..a3bbaaf9c57b 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KeySetUserStatus.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KeySetUserStatus.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class KeySetUserStatus partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKeySetUserStatus. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKeySetUserStatus. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKeySetUserStatus. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKeySetUserStatus. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKeySetUserStatus FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKeySetUserStatus FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new KeySetUserStatus(json) : null; } @@ -77,9 +77,9 @@ internal KeySetUserStatus(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtim { return; } - {_azureUserName = If( json?.PropertyT("azureUserName"), out var __jsonAzureUserName) ? (string)__jsonAzureUserName : (string)AzureUserName;} - {_status = If( json?.PropertyT("status"), out var __jsonStatus) ? (string)__jsonStatus : (string)Status;} - {_statusMessage = If( json?.PropertyT("statusMessage"), out var __jsonStatusMessage) ? (string)__jsonStatusMessage : (string)StatusMessage;} + {_azureUserName = If( json?.PropertyT("azureUserName"), out var __jsonAzureUserName) ? (string)__jsonAzureUserName : (string)_azureUserName;} + {_status = If( json?.PropertyT("status"), out var __jsonStatus) ? (string)__jsonStatus : (string)_status;} + {_statusMessage = If( json?.PropertyT("statusMessage"), out var __jsonStatusMessage) ? (string)__jsonStatusMessage : (string)_statusMessage;} AfterFromJson(json); } @@ -102,15 +102,15 @@ public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode ToJ { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._azureUserName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._azureUserName.ToString()) : null, "azureUserName" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._status)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._status.ToString()) : null, "status" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._statusMessage)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._statusMessage.ToString()) : null, "statusMessage" ,container.Add ); } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesCluster.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesCluster.PowerShell.cs new file mode 100644 index 000000000000..93f727c77ff5 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesCluster.PowerShell.cs @@ -0,0 +1,644 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + + /// KubernetesCluster represents the Kubernetes cluster hosted on Network Cloud. + [System.ComponentModel.TypeConverter(typeof(KubernetesClusterTypeConverter))] + public partial class KubernetesCluster + { + + /// + /// 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.NetworkCloud.Models.IKubernetesCluster DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new KubernetesCluster(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.NetworkCloud.Models.IKubernetesCluster DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new KubernetesCluster(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.NetworkCloud.Models.IKubernetesCluster FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal KubernetesCluster(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ExtendedLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).ExtendedLocation = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocation) content.GetValueForProperty("ExtendedLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).ExtendedLocation, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ExtendedLocationTypeConverter.ConvertFrom); + } + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.KubernetesClusterPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Etag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).Etag, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)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("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedByType = (string) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedByType = (string) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.TrackedResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("ExtendedLocationName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).ExtendedLocationName = (string) content.GetValueForProperty("ExtendedLocationName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).ExtendedLocationName, global::System.Convert.ToString); + } + if (content.Contains("ExtendedLocationType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).ExtendedLocationType = (string) content.GetValueForProperty("ExtendedLocationType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).ExtendedLocationType, global::System.Convert.ToString); + } + if (content.Contains("AadConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).AadConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAadConfiguration) content.GetValueForProperty("AadConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).AadConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AadConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("AdministratorConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).AdministratorConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministratorConfiguration) content.GetValueForProperty("AdministratorConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).AdministratorConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AdministratorConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("NetworkConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).NetworkConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkConfiguration) content.GetValueForProperty("NetworkConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).NetworkConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.NetworkConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("ControlPlaneNodeConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).ControlPlaneNodeConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IControlPlaneNodeConfiguration) content.GetValueForProperty("ControlPlaneNodeConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).ControlPlaneNodeConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ControlPlaneNodeConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("ManagedResourceGroupConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).ManagedResourceGroupConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IManagedResourceGroupConfiguration) content.GetValueForProperty("ManagedResourceGroupConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).ManagedResourceGroupConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ManagedResourceGroupConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("AttachedNetworkId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).AttachedNetworkId = (System.Collections.Generic.List) content.GetValueForProperty("AttachedNetworkId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).AttachedNetworkId, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("AvailableUpgrade")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).AvailableUpgrade = (System.Collections.Generic.List) content.GetValueForProperty("AvailableUpgrade",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).AvailableUpgrade, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AvailableUpgradeTypeConverter.ConvertFrom)); + } + if (content.Contains("ClusterId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).ClusterId = (string) content.GetValueForProperty("ClusterId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).ClusterId, global::System.Convert.ToString); + } + if (content.Contains("ConnectedClusterId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).ConnectedClusterId = (string) content.GetValueForProperty("ConnectedClusterId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).ConnectedClusterId, global::System.Convert.ToString); + } + if (content.Contains("ControlPlaneKubernetesVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).ControlPlaneKubernetesVersion = (string) content.GetValueForProperty("ControlPlaneKubernetesVersion",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).ControlPlaneKubernetesVersion, global::System.Convert.ToString); + } + if (content.Contains("DetailedStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).DetailedStatus = (string) content.GetValueForProperty("DetailedStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).DetailedStatus, global::System.Convert.ToString); + } + if (content.Contains("DetailedStatusMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).DetailedStatusMessage = (string) content.GetValueForProperty("DetailedStatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).DetailedStatusMessage, global::System.Convert.ToString); + } + if (content.Contains("FeatureStatuses")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).FeatureStatuses = (System.Collections.Generic.List) content.GetValueForProperty("FeatureStatuses",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).FeatureStatuses, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.FeatureStatusTypeConverter.ConvertFrom)); + } + if (content.Contains("InitialAgentPoolConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).InitialAgentPoolConfiguration = (System.Collections.Generic.List) content.GetValueForProperty("InitialAgentPoolConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).InitialAgentPoolConfiguration, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.InitialAgentPoolConfigurationTypeConverter.ConvertFrom)); + } + if (content.Contains("KubernetesVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).KubernetesVersion = (string) content.GetValueForProperty("KubernetesVersion",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).KubernetesVersion, global::System.Convert.ToString); + } + if (content.Contains("Node")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).Node = (System.Collections.Generic.List) content.GetValueForProperty("Node",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).Node, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.KubernetesClusterNodeTypeConverter.ConvertFrom)); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("AdminUsername")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).AdminUsername = (string) content.GetValueForProperty("AdminUsername",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).AdminUsername, global::System.Convert.ToString); + } + if (content.Contains("ControlPlaneNodeConfigurationAdministratorConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).ControlPlaneNodeConfigurationAdministratorConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministratorConfiguration) content.GetValueForProperty("ControlPlaneNodeConfigurationAdministratorConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).ControlPlaneNodeConfigurationAdministratorConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AdministratorConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("ControlPlaneNodeConfigurationAvailabilityZone")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).ControlPlaneNodeConfigurationAvailabilityZone = (System.Collections.Generic.List) content.GetValueForProperty("ControlPlaneNodeConfigurationAvailabilityZone",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).ControlPlaneNodeConfigurationAvailabilityZone, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("ControlPlaneNodeConfigurationCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).ControlPlaneNodeConfigurationCount = (long) content.GetValueForProperty("ControlPlaneNodeConfigurationCount",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).ControlPlaneNodeConfigurationCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("ManagedResourceGroupConfigurationLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).ManagedResourceGroupConfigurationLocation = (string) content.GetValueForProperty("ManagedResourceGroupConfigurationLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).ManagedResourceGroupConfigurationLocation, global::System.Convert.ToString); + } + if (content.Contains("ManagedResourceGroupConfigurationName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).ManagedResourceGroupConfigurationName = (string) content.GetValueForProperty("ManagedResourceGroupConfigurationName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).ManagedResourceGroupConfigurationName, global::System.Convert.ToString); + } + if (content.Contains("NetworkConfigurationPodCidr")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).NetworkConfigurationPodCidr = (System.Collections.Generic.List) content.GetValueForProperty("NetworkConfigurationPodCidr",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).NetworkConfigurationPodCidr, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("NetworkConfigurationServiceCidr")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).NetworkConfigurationServiceCidr = (System.Collections.Generic.List) content.GetValueForProperty("NetworkConfigurationServiceCidr",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).NetworkConfigurationServiceCidr, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("AadConfigurationAdminGroupObjectId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).AadConfigurationAdminGroupObjectId = (System.Collections.Generic.List) content.GetValueForProperty("AadConfigurationAdminGroupObjectId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).AadConfigurationAdminGroupObjectId, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("SshPublicKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).SshPublicKey = (System.Collections.Generic.List) content.GetValueForProperty("SshPublicKey",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).SshPublicKey, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.SshPublicKeyTypeConverter.ConvertFrom)); + } + if (content.Contains("ControlPlaneNodeConfigurationVMSkuName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).ControlPlaneNodeConfigurationVMSkuName = (string) content.GetValueForProperty("ControlPlaneNodeConfigurationVMSkuName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).ControlPlaneNodeConfigurationVMSkuName, global::System.Convert.ToString); + } + if (content.Contains("ControlPlaneNodeConfigurationAdministratorConfigurationAdminUsername")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).ControlPlaneNodeConfigurationAdministratorConfigurationAdminUsername = (string) content.GetValueForProperty("ControlPlaneNodeConfigurationAdministratorConfigurationAdminUsername",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).ControlPlaneNodeConfigurationAdministratorConfigurationAdminUsername, global::System.Convert.ToString); + } + if (content.Contains("NetworkConfigurationAttachedNetworkConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).NetworkConfigurationAttachedNetworkConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAttachedNetworkConfiguration) content.GetValueForProperty("NetworkConfigurationAttachedNetworkConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).NetworkConfigurationAttachedNetworkConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AttachedNetworkConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("NetworkConfigurationBgpServiceLoadBalancerConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).NetworkConfigurationBgpServiceLoadBalancerConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBgpServiceLoadBalancerConfiguration) content.GetValueForProperty("NetworkConfigurationBgpServiceLoadBalancerConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).NetworkConfigurationBgpServiceLoadBalancerConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BgpServiceLoadBalancerConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("NetworkConfigurationL2ServiceLoadBalancerConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).NetworkConfigurationL2ServiceLoadBalancerConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2ServiceLoadBalancerConfiguration) content.GetValueForProperty("NetworkConfigurationL2ServiceLoadBalancerConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).NetworkConfigurationL2ServiceLoadBalancerConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.L2ServiceLoadBalancerConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("NetworkConfigurationCloudServicesNetworkId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).NetworkConfigurationCloudServicesNetworkId = (string) content.GetValueForProperty("NetworkConfigurationCloudServicesNetworkId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).NetworkConfigurationCloudServicesNetworkId, global::System.Convert.ToString); + } + if (content.Contains("NetworkConfigurationCniNetworkId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).NetworkConfigurationCniNetworkId = (string) content.GetValueForProperty("NetworkConfigurationCniNetworkId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).NetworkConfigurationCniNetworkId, global::System.Convert.ToString); + } + if (content.Contains("NetworkConfigurationDnsServiceIP")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).NetworkConfigurationDnsServiceIP = (string) content.GetValueForProperty("NetworkConfigurationDnsServiceIP",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).NetworkConfigurationDnsServiceIP, global::System.Convert.ToString); + } + if (content.Contains("AttachedNetworkConfigurationL2Network")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).AttachedNetworkConfigurationL2Network = (System.Collections.Generic.List) content.GetValueForProperty("AttachedNetworkConfigurationL2Network",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).AttachedNetworkConfigurationL2Network, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.L2NetworkAttachmentConfigurationTypeConverter.ConvertFrom)); + } + if (content.Contains("AttachedNetworkConfigurationL3Network")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).AttachedNetworkConfigurationL3Network = (System.Collections.Generic.List) content.GetValueForProperty("AttachedNetworkConfigurationL3Network",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).AttachedNetworkConfigurationL3Network, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.L3NetworkAttachmentConfigurationTypeConverter.ConvertFrom)); + } + if (content.Contains("AttachedNetworkConfigurationTrunkedNetwork")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).AttachedNetworkConfigurationTrunkedNetwork = (System.Collections.Generic.List) content.GetValueForProperty("AttachedNetworkConfigurationTrunkedNetwork",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).AttachedNetworkConfigurationTrunkedNetwork, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.TrunkedNetworkAttachmentConfigurationTypeConverter.ConvertFrom)); + } + if (content.Contains("BgpServiceLoadBalancerConfigurationBgpAdvertisement")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).BgpServiceLoadBalancerConfigurationBgpAdvertisement = (System.Collections.Generic.List) content.GetValueForProperty("BgpServiceLoadBalancerConfigurationBgpAdvertisement",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).BgpServiceLoadBalancerConfigurationBgpAdvertisement, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BgpAdvertisementTypeConverter.ConvertFrom)); + } + if (content.Contains("BgpServiceLoadBalancerConfigurationBgpPeer")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).BgpServiceLoadBalancerConfigurationBgpPeer = (System.Collections.Generic.List) content.GetValueForProperty("BgpServiceLoadBalancerConfigurationBgpPeer",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).BgpServiceLoadBalancerConfigurationBgpPeer, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ServiceLoadBalancerBgpPeerTypeConverter.ConvertFrom)); + } + if (content.Contains("ControlPlaneNodeConfigurationAdministratorConfigurationSshPublicKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).ControlPlaneNodeConfigurationAdministratorConfigurationSshPublicKey = (System.Collections.Generic.List) content.GetValueForProperty("ControlPlaneNodeConfigurationAdministratorConfigurationSshPublicKey",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).ControlPlaneNodeConfigurationAdministratorConfigurationSshPublicKey, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.SshPublicKeyTypeConverter.ConvertFrom)); + } + if (content.Contains("BgpServiceLoadBalancerConfigurationFabricPeeringEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).BgpServiceLoadBalancerConfigurationFabricPeeringEnabled = (string) content.GetValueForProperty("BgpServiceLoadBalancerConfigurationFabricPeeringEnabled",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).BgpServiceLoadBalancerConfigurationFabricPeeringEnabled, global::System.Convert.ToString); + } + if (content.Contains("BgpServiceLoadBalancerConfigurationIPAddressPool")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).BgpServiceLoadBalancerConfigurationIPAddressPool = (System.Collections.Generic.List) content.GetValueForProperty("BgpServiceLoadBalancerConfigurationIPAddressPool",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).BgpServiceLoadBalancerConfigurationIPAddressPool, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IPAddressPoolTypeConverter.ConvertFrom)); + } + if (content.Contains("L2ServiceLoadBalancerConfigurationIPAddressPool")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).L2ServiceLoadBalancerConfigurationIPAddressPool = (System.Collections.Generic.List) content.GetValueForProperty("L2ServiceLoadBalancerConfigurationIPAddressPool",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).L2ServiceLoadBalancerConfigurationIPAddressPool, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IPAddressPoolTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal KubernetesCluster(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ExtendedLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).ExtendedLocation = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocation) content.GetValueForProperty("ExtendedLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).ExtendedLocation, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ExtendedLocationTypeConverter.ConvertFrom); + } + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.KubernetesClusterPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Etag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).Etag, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)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("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedByType = (string) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedByType = (string) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.TrackedResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("ExtendedLocationName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).ExtendedLocationName = (string) content.GetValueForProperty("ExtendedLocationName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).ExtendedLocationName, global::System.Convert.ToString); + } + if (content.Contains("ExtendedLocationType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).ExtendedLocationType = (string) content.GetValueForProperty("ExtendedLocationType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).ExtendedLocationType, global::System.Convert.ToString); + } + if (content.Contains("AadConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).AadConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAadConfiguration) content.GetValueForProperty("AadConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).AadConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AadConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("AdministratorConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).AdministratorConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministratorConfiguration) content.GetValueForProperty("AdministratorConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).AdministratorConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AdministratorConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("NetworkConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).NetworkConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkConfiguration) content.GetValueForProperty("NetworkConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).NetworkConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.NetworkConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("ControlPlaneNodeConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).ControlPlaneNodeConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IControlPlaneNodeConfiguration) content.GetValueForProperty("ControlPlaneNodeConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).ControlPlaneNodeConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ControlPlaneNodeConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("ManagedResourceGroupConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).ManagedResourceGroupConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IManagedResourceGroupConfiguration) content.GetValueForProperty("ManagedResourceGroupConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).ManagedResourceGroupConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ManagedResourceGroupConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("AttachedNetworkId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).AttachedNetworkId = (System.Collections.Generic.List) content.GetValueForProperty("AttachedNetworkId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).AttachedNetworkId, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("AvailableUpgrade")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).AvailableUpgrade = (System.Collections.Generic.List) content.GetValueForProperty("AvailableUpgrade",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).AvailableUpgrade, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AvailableUpgradeTypeConverter.ConvertFrom)); + } + if (content.Contains("ClusterId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).ClusterId = (string) content.GetValueForProperty("ClusterId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).ClusterId, global::System.Convert.ToString); + } + if (content.Contains("ConnectedClusterId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).ConnectedClusterId = (string) content.GetValueForProperty("ConnectedClusterId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).ConnectedClusterId, global::System.Convert.ToString); + } + if (content.Contains("ControlPlaneKubernetesVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).ControlPlaneKubernetesVersion = (string) content.GetValueForProperty("ControlPlaneKubernetesVersion",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).ControlPlaneKubernetesVersion, global::System.Convert.ToString); + } + if (content.Contains("DetailedStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).DetailedStatus = (string) content.GetValueForProperty("DetailedStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).DetailedStatus, global::System.Convert.ToString); + } + if (content.Contains("DetailedStatusMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).DetailedStatusMessage = (string) content.GetValueForProperty("DetailedStatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).DetailedStatusMessage, global::System.Convert.ToString); + } + if (content.Contains("FeatureStatuses")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).FeatureStatuses = (System.Collections.Generic.List) content.GetValueForProperty("FeatureStatuses",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).FeatureStatuses, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.FeatureStatusTypeConverter.ConvertFrom)); + } + if (content.Contains("InitialAgentPoolConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).InitialAgentPoolConfiguration = (System.Collections.Generic.List) content.GetValueForProperty("InitialAgentPoolConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).InitialAgentPoolConfiguration, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.InitialAgentPoolConfigurationTypeConverter.ConvertFrom)); + } + if (content.Contains("KubernetesVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).KubernetesVersion = (string) content.GetValueForProperty("KubernetesVersion",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).KubernetesVersion, global::System.Convert.ToString); + } + if (content.Contains("Node")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).Node = (System.Collections.Generic.List) content.GetValueForProperty("Node",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).Node, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.KubernetesClusterNodeTypeConverter.ConvertFrom)); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("AdminUsername")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).AdminUsername = (string) content.GetValueForProperty("AdminUsername",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).AdminUsername, global::System.Convert.ToString); + } + if (content.Contains("ControlPlaneNodeConfigurationAdministratorConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).ControlPlaneNodeConfigurationAdministratorConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministratorConfiguration) content.GetValueForProperty("ControlPlaneNodeConfigurationAdministratorConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).ControlPlaneNodeConfigurationAdministratorConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AdministratorConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("ControlPlaneNodeConfigurationAvailabilityZone")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).ControlPlaneNodeConfigurationAvailabilityZone = (System.Collections.Generic.List) content.GetValueForProperty("ControlPlaneNodeConfigurationAvailabilityZone",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).ControlPlaneNodeConfigurationAvailabilityZone, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("ControlPlaneNodeConfigurationCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).ControlPlaneNodeConfigurationCount = (long) content.GetValueForProperty("ControlPlaneNodeConfigurationCount",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).ControlPlaneNodeConfigurationCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("ManagedResourceGroupConfigurationLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).ManagedResourceGroupConfigurationLocation = (string) content.GetValueForProperty("ManagedResourceGroupConfigurationLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).ManagedResourceGroupConfigurationLocation, global::System.Convert.ToString); + } + if (content.Contains("ManagedResourceGroupConfigurationName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).ManagedResourceGroupConfigurationName = (string) content.GetValueForProperty("ManagedResourceGroupConfigurationName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).ManagedResourceGroupConfigurationName, global::System.Convert.ToString); + } + if (content.Contains("NetworkConfigurationPodCidr")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).NetworkConfigurationPodCidr = (System.Collections.Generic.List) content.GetValueForProperty("NetworkConfigurationPodCidr",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).NetworkConfigurationPodCidr, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("NetworkConfigurationServiceCidr")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).NetworkConfigurationServiceCidr = (System.Collections.Generic.List) content.GetValueForProperty("NetworkConfigurationServiceCidr",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).NetworkConfigurationServiceCidr, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("AadConfigurationAdminGroupObjectId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).AadConfigurationAdminGroupObjectId = (System.Collections.Generic.List) content.GetValueForProperty("AadConfigurationAdminGroupObjectId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).AadConfigurationAdminGroupObjectId, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("SshPublicKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).SshPublicKey = (System.Collections.Generic.List) content.GetValueForProperty("SshPublicKey",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).SshPublicKey, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.SshPublicKeyTypeConverter.ConvertFrom)); + } + if (content.Contains("ControlPlaneNodeConfigurationVMSkuName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).ControlPlaneNodeConfigurationVMSkuName = (string) content.GetValueForProperty("ControlPlaneNodeConfigurationVMSkuName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).ControlPlaneNodeConfigurationVMSkuName, global::System.Convert.ToString); + } + if (content.Contains("ControlPlaneNodeConfigurationAdministratorConfigurationAdminUsername")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).ControlPlaneNodeConfigurationAdministratorConfigurationAdminUsername = (string) content.GetValueForProperty("ControlPlaneNodeConfigurationAdministratorConfigurationAdminUsername",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).ControlPlaneNodeConfigurationAdministratorConfigurationAdminUsername, global::System.Convert.ToString); + } + if (content.Contains("NetworkConfigurationAttachedNetworkConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).NetworkConfigurationAttachedNetworkConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAttachedNetworkConfiguration) content.GetValueForProperty("NetworkConfigurationAttachedNetworkConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).NetworkConfigurationAttachedNetworkConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AttachedNetworkConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("NetworkConfigurationBgpServiceLoadBalancerConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).NetworkConfigurationBgpServiceLoadBalancerConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBgpServiceLoadBalancerConfiguration) content.GetValueForProperty("NetworkConfigurationBgpServiceLoadBalancerConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).NetworkConfigurationBgpServiceLoadBalancerConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BgpServiceLoadBalancerConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("NetworkConfigurationL2ServiceLoadBalancerConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).NetworkConfigurationL2ServiceLoadBalancerConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2ServiceLoadBalancerConfiguration) content.GetValueForProperty("NetworkConfigurationL2ServiceLoadBalancerConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).NetworkConfigurationL2ServiceLoadBalancerConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.L2ServiceLoadBalancerConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("NetworkConfigurationCloudServicesNetworkId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).NetworkConfigurationCloudServicesNetworkId = (string) content.GetValueForProperty("NetworkConfigurationCloudServicesNetworkId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).NetworkConfigurationCloudServicesNetworkId, global::System.Convert.ToString); + } + if (content.Contains("NetworkConfigurationCniNetworkId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).NetworkConfigurationCniNetworkId = (string) content.GetValueForProperty("NetworkConfigurationCniNetworkId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).NetworkConfigurationCniNetworkId, global::System.Convert.ToString); + } + if (content.Contains("NetworkConfigurationDnsServiceIP")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).NetworkConfigurationDnsServiceIP = (string) content.GetValueForProperty("NetworkConfigurationDnsServiceIP",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).NetworkConfigurationDnsServiceIP, global::System.Convert.ToString); + } + if (content.Contains("AttachedNetworkConfigurationL2Network")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).AttachedNetworkConfigurationL2Network = (System.Collections.Generic.List) content.GetValueForProperty("AttachedNetworkConfigurationL2Network",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).AttachedNetworkConfigurationL2Network, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.L2NetworkAttachmentConfigurationTypeConverter.ConvertFrom)); + } + if (content.Contains("AttachedNetworkConfigurationL3Network")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).AttachedNetworkConfigurationL3Network = (System.Collections.Generic.List) content.GetValueForProperty("AttachedNetworkConfigurationL3Network",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).AttachedNetworkConfigurationL3Network, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.L3NetworkAttachmentConfigurationTypeConverter.ConvertFrom)); + } + if (content.Contains("AttachedNetworkConfigurationTrunkedNetwork")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).AttachedNetworkConfigurationTrunkedNetwork = (System.Collections.Generic.List) content.GetValueForProperty("AttachedNetworkConfigurationTrunkedNetwork",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).AttachedNetworkConfigurationTrunkedNetwork, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.TrunkedNetworkAttachmentConfigurationTypeConverter.ConvertFrom)); + } + if (content.Contains("BgpServiceLoadBalancerConfigurationBgpAdvertisement")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).BgpServiceLoadBalancerConfigurationBgpAdvertisement = (System.Collections.Generic.List) content.GetValueForProperty("BgpServiceLoadBalancerConfigurationBgpAdvertisement",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).BgpServiceLoadBalancerConfigurationBgpAdvertisement, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BgpAdvertisementTypeConverter.ConvertFrom)); + } + if (content.Contains("BgpServiceLoadBalancerConfigurationBgpPeer")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).BgpServiceLoadBalancerConfigurationBgpPeer = (System.Collections.Generic.List) content.GetValueForProperty("BgpServiceLoadBalancerConfigurationBgpPeer",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).BgpServiceLoadBalancerConfigurationBgpPeer, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ServiceLoadBalancerBgpPeerTypeConverter.ConvertFrom)); + } + if (content.Contains("ControlPlaneNodeConfigurationAdministratorConfigurationSshPublicKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).ControlPlaneNodeConfigurationAdministratorConfigurationSshPublicKey = (System.Collections.Generic.List) content.GetValueForProperty("ControlPlaneNodeConfigurationAdministratorConfigurationSshPublicKey",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).ControlPlaneNodeConfigurationAdministratorConfigurationSshPublicKey, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.SshPublicKeyTypeConverter.ConvertFrom)); + } + if (content.Contains("BgpServiceLoadBalancerConfigurationFabricPeeringEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).BgpServiceLoadBalancerConfigurationFabricPeeringEnabled = (string) content.GetValueForProperty("BgpServiceLoadBalancerConfigurationFabricPeeringEnabled",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).BgpServiceLoadBalancerConfigurationFabricPeeringEnabled, global::System.Convert.ToString); + } + if (content.Contains("BgpServiceLoadBalancerConfigurationIPAddressPool")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).BgpServiceLoadBalancerConfigurationIPAddressPool = (System.Collections.Generic.List) content.GetValueForProperty("BgpServiceLoadBalancerConfigurationIPAddressPool",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).BgpServiceLoadBalancerConfigurationIPAddressPool, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IPAddressPoolTypeConverter.ConvertFrom)); + } + if (content.Contains("L2ServiceLoadBalancerConfigurationIPAddressPool")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).L2ServiceLoadBalancerConfigurationIPAddressPool = (System.Collections.Generic.List) content.GetValueForProperty("L2ServiceLoadBalancerConfigurationIPAddressPool",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal)this).L2ServiceLoadBalancerConfigurationIPAddressPool, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IPAddressPoolTypeConverter.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.NetworkCloud.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(); + } + } + /// KubernetesCluster represents the Kubernetes cluster hosted on Network Cloud. + [System.ComponentModel.TypeConverter(typeof(KubernetesClusterTypeConverter))] + public partial interface IKubernetesCluster + + { + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesCluster.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesCluster.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesCluster.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesCluster.TypeConverter.cs index 9405cf78f101..c91735656957 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesCluster.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesCluster.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IKubernetesCluster ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesCluster ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesCluster).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesCluster).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesCluster.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesCluster.cs new file mode 100644 index 000000000000..c8de1692c8a0 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesCluster.cs @@ -0,0 +1,1058 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + + /// KubernetesCluster represents the Kubernetes cluster hosted on Network Cloud. + public partial class KubernetesCluster : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesCluster, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResource __trackedResource = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.TrackedResource(); + + /// + /// The list of Azure Active Directory group object IDs that will have an administrative role on the Kubernetes cluster. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public System.Collections.Generic.List AadConfigurationAdminGroupObjectId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)Property).AadConfigurationAdminGroupObjectId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)Property).AadConfigurationAdminGroupObjectId = value ?? null /* arrayOf */; } + + /// + /// The user name for the administrator that will be applied to the operating systems that run Kubernetes nodes. If not supplied, + /// a user name will be chosen by the service. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string AdminUsername { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)Property).AdminUsername; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)Property).AdminUsername = value ?? null; } + + /// The list of Layer 2 Networks and related configuration for attachment. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public System.Collections.Generic.List AttachedNetworkConfigurationL2Network { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)Property).AttachedNetworkConfigurationL2Network; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)Property).AttachedNetworkConfigurationL2Network = value ?? null /* arrayOf */; } + + /// The list of Layer 3 Networks and related configuration for attachment. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public System.Collections.Generic.List AttachedNetworkConfigurationL3Network { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)Property).AttachedNetworkConfigurationL3Network; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)Property).AttachedNetworkConfigurationL3Network = value ?? null /* arrayOf */; } + + /// The list of Trunked Networks and related configuration for attachment. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public System.Collections.Generic.List AttachedNetworkConfigurationTrunkedNetwork { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)Property).AttachedNetworkConfigurationTrunkedNetwork; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)Property).AttachedNetworkConfigurationTrunkedNetwork = value ?? null /* arrayOf */; } + + /// + /// The full list of network resource IDs that are attached to this cluster, including those attached only to specific agent + /// pools. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public System.Collections.Generic.List AttachedNetworkId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)Property).AttachedNetworkId; } + + /// The list of versions that this Kubernetes cluster can be upgraded to. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public System.Collections.Generic.List AvailableUpgrade { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)Property).AvailableUpgrade; } + + /// + /// The association of IP address pools to the communities and peers, allowing for announcement of IPs. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public System.Collections.Generic.List BgpServiceLoadBalancerConfigurationBgpAdvertisement { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)Property).BgpServiceLoadBalancerConfigurationBgpAdvertisement; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)Property).BgpServiceLoadBalancerConfigurationBgpAdvertisement = value ?? null /* arrayOf */; } + + /// + /// The list of additional BgpPeer entities that the Kubernetes cluster will peer with. All peering must be explicitly defined. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public System.Collections.Generic.List BgpServiceLoadBalancerConfigurationBgpPeer { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)Property).BgpServiceLoadBalancerConfigurationBgpPeer; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)Property).BgpServiceLoadBalancerConfigurationBgpPeer = value ?? null /* arrayOf */; } + + /// The indicator to specify if the load balancer peers with the network fabric. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string BgpServiceLoadBalancerConfigurationFabricPeeringEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)Property).BgpServiceLoadBalancerConfigurationFabricPeeringEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)Property).BgpServiceLoadBalancerConfigurationFabricPeeringEnabled = value ?? null; } + + /// + /// The list of pools of IP addresses that can be allocated to load balancer services. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public System.Collections.Generic.List BgpServiceLoadBalancerConfigurationIPAddressPool { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)Property).BgpServiceLoadBalancerConfigurationIPAddressPool; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)Property).BgpServiceLoadBalancerConfigurationIPAddressPool = value ?? null /* arrayOf */; } + + /// The resource ID of the Network Cloud cluster. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string ClusterId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)Property).ClusterId; } + + /// + /// The resource ID of the connected cluster set up when this Kubernetes cluster is created. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string ConnectedClusterId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)Property).ConnectedClusterId; } + + /// The current running version of Kubernetes on the control plane. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string ControlPlaneKubernetesVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)Property).ControlPlaneKubernetesVersion; } + + /// + /// The user name for the administrator that will be applied to the operating systems that run Kubernetes nodes. If not supplied, + /// a user name will be chosen by the service. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string ControlPlaneNodeConfigurationAdministratorConfigurationAdminUsername { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)Property).ControlPlaneNodeConfigurationAdministratorConfigurationAdminUsername; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)Property).ControlPlaneNodeConfigurationAdministratorConfigurationAdminUsername = value ?? null; } + + /// + /// The SSH configuration for the operating systems that run the nodes in the Kubernetes cluster. In some cases, specification + /// of public keys may be required to produce a working environment. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public System.Collections.Generic.List ControlPlaneNodeConfigurationAdministratorConfigurationSshPublicKey { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)Property).ControlPlaneNodeConfigurationAdministratorConfigurationSshPublicKey; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)Property).ControlPlaneNodeConfigurationAdministratorConfigurationSshPublicKey = value ?? null /* arrayOf */; } + + /// + /// The list of availability zones of the Network Cloud cluster to be used for the provisioning of nodes in the control plane. + /// If not specified, all availability zones will be used. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public System.Collections.Generic.List ControlPlaneNodeConfigurationAvailabilityZone { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)Property).ControlPlaneNodeConfigurationAvailabilityZone; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)Property).ControlPlaneNodeConfigurationAvailabilityZone = value ?? null /* arrayOf */; } + + /// The number of virtual machines that use this configuration. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public long ControlPlaneNodeConfigurationCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)Property).ControlPlaneNodeConfigurationCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)Property).ControlPlaneNodeConfigurationCount = value ; } + + /// The name of the VM SKU supplied during creation. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string ControlPlaneNodeConfigurationVMSkuName { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)Property).ControlPlaneNodeConfigurationVMSkuName; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)Property).ControlPlaneNodeConfigurationVMSkuName = value ; } + + /// The current status of the Kubernetes cluster. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string DetailedStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)Property).DetailedStatus; } + + /// The descriptive message about the current detailed status. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string DetailedStatusMessage { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)Property).DetailedStatusMessage; } + + /// Backing field for property. + private string _etag; + + /// Resource ETag. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string Etag { get => this._etag; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocation _extendedLocation; + + /// The extended location of the cluster associated with the resource. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocation ExtendedLocation { get => (this._extendedLocation = this._extendedLocation ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ExtendedLocation()); set => this._extendedLocation = value; } + + /// The resource ID of the extended location on which the resource will be created. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string ExtendedLocationName { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocationInternal)ExtendedLocation).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocationInternal)ExtendedLocation).Name = value ?? null; } + + /// The extended location type, for example, CustomLocation. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string ExtendedLocationType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocationInternal)ExtendedLocation).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocationInternal)ExtendedLocation).Type = value ?? null; } + + /// The current feature settings. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public System.Collections.Generic.List FeatureStatuses { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)Property).FeatureStatuses; } + + /// + /// Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).Id; } + + /// + /// The agent pools that are created with this Kubernetes cluster for running critical system services and workloads. This + /// data in this field is only used during creation, and the field will be empty following the creation of the Kubernetes + /// Cluster. After creation, the management of agent pools is done using the agentPools sub-resource. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public System.Collections.Generic.List InitialAgentPoolConfiguration { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)Property).InitialAgentPoolConfiguration; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)Property).InitialAgentPoolConfiguration = value ?? null /* arrayOf */; } + + /// The Kubernetes version for this cluster. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string KubernetesVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)Property).KubernetesVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)Property).KubernetesVersion = value ; } + + /// + /// The list of pools of IP addresses that can be allocated to load balancer services. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public System.Collections.Generic.List L2ServiceLoadBalancerConfigurationIPAddressPool { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)Property).L2ServiceLoadBalancerConfigurationIPAddressPool; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)Property).L2ServiceLoadBalancerConfigurationIPAddressPool = value ?? null /* arrayOf */; } + + /// The geo-location where the resource lives + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)__trackedResource).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)__trackedResource).Location = value ?? null; } + + /// + /// The location of the managed resource group. If not specified, the location of the parent resource is chosen. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string ManagedResourceGroupConfigurationLocation { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)Property).ManagedResourceGroupConfigurationLocation; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)Property).ManagedResourceGroupConfigurationLocation = value ?? null; } + + /// + /// The name for the managed resource group. If not specified, the unique name is automatically generated. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string ManagedResourceGroupConfigurationName { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)Property).ManagedResourceGroupConfigurationName; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)Property).ManagedResourceGroupConfigurationName = value ?? null; } + + /// Internal Acessors for AadConfiguration + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAadConfiguration Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal.AadConfiguration { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)Property).AadConfiguration; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)Property).AadConfiguration = value ?? null /* model class */; } + + /// Internal Acessors for AdministratorConfiguration + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministratorConfiguration Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal.AdministratorConfiguration { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)Property).AdministratorConfiguration; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)Property).AdministratorConfiguration = value ?? null /* model class */; } + + /// Internal Acessors for AttachedNetworkId + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal.AttachedNetworkId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)Property).AttachedNetworkId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)Property).AttachedNetworkId = value ?? null /* arrayOf */; } + + /// Internal Acessors for AvailableUpgrade + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal.AvailableUpgrade { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)Property).AvailableUpgrade; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)Property).AvailableUpgrade = value ?? null /* arrayOf */; } + + /// Internal Acessors for ClusterId + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal.ClusterId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)Property).ClusterId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)Property).ClusterId = value ?? null; } + + /// Internal Acessors for ConnectedClusterId + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal.ConnectedClusterId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)Property).ConnectedClusterId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)Property).ConnectedClusterId = value ?? null; } + + /// Internal Acessors for ControlPlaneKubernetesVersion + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal.ControlPlaneKubernetesVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)Property).ControlPlaneKubernetesVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)Property).ControlPlaneKubernetesVersion = value ?? null; } + + /// Internal Acessors for ControlPlaneNodeConfiguration + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IControlPlaneNodeConfiguration Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal.ControlPlaneNodeConfiguration { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)Property).ControlPlaneNodeConfiguration; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)Property).ControlPlaneNodeConfiguration = value ?? null /* model class */; } + + /// Internal Acessors for ControlPlaneNodeConfigurationAdministratorConfiguration + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministratorConfiguration Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal.ControlPlaneNodeConfigurationAdministratorConfiguration { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)Property).ControlPlaneNodeConfigurationAdministratorConfiguration; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)Property).ControlPlaneNodeConfigurationAdministratorConfiguration = value ?? null /* model class */; } + + /// Internal Acessors for DetailedStatus + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal.DetailedStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)Property).DetailedStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)Property).DetailedStatus = value ?? null; } + + /// Internal Acessors for DetailedStatusMessage + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal.DetailedStatusMessage { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)Property).DetailedStatusMessage; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)Property).DetailedStatusMessage = value ?? null; } + + /// Internal Acessors for Etag + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal.Etag { get => this._etag; set { {_etag = value;} } } + + /// Internal Acessors for ExtendedLocation + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocation Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal.ExtendedLocation { get => (this._extendedLocation = this._extendedLocation ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ExtendedLocation()); set { {_extendedLocation = value;} } } + + /// Internal Acessors for FeatureStatuses + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal.FeatureStatuses { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)Property).FeatureStatuses; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)Property).FeatureStatuses = value ?? null /* arrayOf */; } + + /// Internal Acessors for ManagedResourceGroupConfiguration + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IManagedResourceGroupConfiguration Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal.ManagedResourceGroupConfiguration { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)Property).ManagedResourceGroupConfiguration; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)Property).ManagedResourceGroupConfiguration = value ?? null /* model class */; } + + /// Internal Acessors for NetworkConfiguration + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkConfiguration Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal.NetworkConfiguration { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)Property).NetworkConfiguration; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)Property).NetworkConfiguration = value ?? null /* model class */; } + + /// Internal Acessors for NetworkConfigurationAttachedNetworkConfiguration + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAttachedNetworkConfiguration Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal.NetworkConfigurationAttachedNetworkConfiguration { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)Property).NetworkConfigurationAttachedNetworkConfiguration; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)Property).NetworkConfigurationAttachedNetworkConfiguration = value ?? null /* model class */; } + + /// Internal Acessors for NetworkConfigurationBgpServiceLoadBalancerConfiguration + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBgpServiceLoadBalancerConfiguration Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal.NetworkConfigurationBgpServiceLoadBalancerConfiguration { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)Property).NetworkConfigurationBgpServiceLoadBalancerConfiguration; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)Property).NetworkConfigurationBgpServiceLoadBalancerConfiguration = value ?? null /* model class */; } + + /// Internal Acessors for NetworkConfigurationL2ServiceLoadBalancerConfiguration + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2ServiceLoadBalancerConfiguration Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal.NetworkConfigurationL2ServiceLoadBalancerConfiguration { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)Property).NetworkConfigurationL2ServiceLoadBalancerConfiguration; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)Property).NetworkConfigurationL2ServiceLoadBalancerConfiguration = value ?? null /* model class */; } + + /// Internal Acessors for Node + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal.Node { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)Property).Node; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)Property).Node = value ?? null /* arrayOf */; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterProperties Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.KubernetesClusterProperties()); set { {_property = value;} } } + + /// Internal Acessors for ProvisioningState + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)Property).ProvisioningState = value ?? null; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).Id = value ?? null; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).Name = value ?? null; } + + /// Internal Acessors for SystemData + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISystemData Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemData; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemData = value ?? null /* model class */; } + + /// Internal Acessors for SystemDataCreatedAt + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataCreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataCreatedAt = value ?? default(global::System.DateTime); } + + /// Internal Acessors for SystemDataCreatedBy + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataCreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataCreatedBy = value ?? null; } + + /// Internal Acessors for SystemDataCreatedByType + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataCreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataCreatedByType = value ?? null; } + + /// Internal Acessors for SystemDataLastModifiedAt + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedAt = value ?? default(global::System.DateTime); } + + /// Internal Acessors for SystemDataLastModifiedBy + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedBy = value ?? null; } + + /// Internal Acessors for SystemDataLastModifiedByType + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedByType = value ?? null; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).Type = value ?? null; } + + /// The name of the resource + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).Name; } + + /// The resource ID of the associated Cloud Services network. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string NetworkConfigurationCloudServicesNetworkId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)Property).NetworkConfigurationCloudServicesNetworkId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)Property).NetworkConfigurationCloudServicesNetworkId = value ?? null; } + + /// + /// The resource ID of the Layer 3 network that is used for creation of the Container Networking Interface network. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string NetworkConfigurationCniNetworkId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)Property).NetworkConfigurationCniNetworkId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)Property).NetworkConfigurationCniNetworkId = value ?? null; } + + /// + /// The IP address assigned to the Kubernetes DNS service. It must be within the Kubernetes service address range specified + /// in service CIDR. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string NetworkConfigurationDnsServiceIP { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)Property).NetworkConfigurationDnsServiceIP; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)Property).NetworkConfigurationDnsServiceIP = value ?? null; } + + /// + /// The CIDR notation IP ranges from which to assign pod IPs. One IPv4 CIDR is expected for single-stack networking. Two CIDRs, + /// one for each IP family (IPv4/IPv6), is expected for dual-stack networking. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public System.Collections.Generic.List NetworkConfigurationPodCidr { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)Property).NetworkConfigurationPodCidr; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)Property).NetworkConfigurationPodCidr = value ?? null /* arrayOf */; } + + /// + /// The CIDR notation IP ranges from which to assign service IPs. One IPv4 CIDR is expected for single-stack networking. Two + /// CIDRs, one for each IP family (IPv4/IPv6), is expected for dual-stack networking. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public System.Collections.Generic.List NetworkConfigurationServiceCidr { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)Property).NetworkConfigurationServiceCidr; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)Property).NetworkConfigurationServiceCidr = value ?? null /* arrayOf */; } + + /// The details of the nodes in this cluster. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public System.Collections.Generic.List Node { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)Property).Node; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterProperties _property; + + /// The list of the resource properties. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.KubernetesClusterProperties()); set => this._property = value; } + + /// The provisioning state of the Kubernetes cluster resource. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)Property).ProvisioningState; } + + /// Gets the resource group name + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string ResourceGroupName { get => (new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Success ? new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Groups["resourceGroupName"].Value : null); } + + /// + /// The SSH configuration for the operating systems that run the nodes in the Kubernetes cluster. In some cases, specification + /// of public keys may be required to produce a working environment. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public System.Collections.Generic.List SshPublicKey { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)Property).SshPublicKey; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)Property).SshPublicKey = value ?? null /* arrayOf */; } + + /// + /// Azure Resource Manager metadata containing createdBy and modifiedBy information. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISystemData SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemData; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemData = value ?? null /* model class */; } + + /// The timestamp of resource creation (UTC). + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataCreatedAt; } + + /// The identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataCreatedBy; } + + /// The type of identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public string SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataCreatedByType; } + + /// The timestamp of resource last modification (UTC) + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedAt; } + + /// The identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedBy; } + + /// The type of identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public string SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedByType; } + + /// Resource tags. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)__trackedResource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).Type; } + + /// Creates an new instance. + public KubernetesCluster() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__trackedResource), __trackedResource); + await eventListener.AssertObjectIsValid(nameof(__trackedResource), __trackedResource); + } + } + /// KubernetesCluster represents the Kubernetes cluster hosted on Network Cloud. + public partial interface IKubernetesCluster : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResource + { + /// + /// The list of Azure Active Directory group object IDs that will have an administrative role on the Kubernetes cluster. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The list of Azure Active Directory group object IDs that will have an administrative role on the Kubernetes cluster.", + SerializedName = @"adminGroupObjectIds", + PossibleTypes = new [] { typeof(string) })] + System.Collections.Generic.List AadConfigurationAdminGroupObjectId { get; set; } + /// + /// The user name for the administrator that will be applied to the operating systems that run Kubernetes nodes. If not supplied, + /// a user name will be chosen by the service. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The user name for the administrator that will be applied to the operating systems that run Kubernetes nodes. If not supplied, a user name will be chosen by the service.", + SerializedName = @"adminUsername", + PossibleTypes = new [] { typeof(string) })] + string AdminUsername { get; set; } + /// The list of Layer 2 Networks and related configuration for attachment. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The list of Layer 2 Networks and related configuration for attachment.", + SerializedName = @"l2Networks", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkAttachmentConfiguration) })] + System.Collections.Generic.List AttachedNetworkConfigurationL2Network { get; set; } + /// The list of Layer 3 Networks and related configuration for attachment. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The list of Layer 3 Networks and related configuration for attachment.", + SerializedName = @"l3Networks", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkAttachmentConfiguration) })] + System.Collections.Generic.List AttachedNetworkConfigurationL3Network { get; set; } + /// The list of Trunked Networks and related configuration for attachment. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The list of Trunked Networks and related configuration for attachment.", + SerializedName = @"trunkedNetworks", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkAttachmentConfiguration) })] + System.Collections.Generic.List AttachedNetworkConfigurationTrunkedNetwork { get; set; } + /// + /// The full list of network resource IDs that are attached to this cluster, including those attached only to specific agent + /// pools. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The full list of network resource IDs that are attached to this cluster, including those attached only to specific agent pools.", + SerializedName = @"attachedNetworkIds", + PossibleTypes = new [] { typeof(string) })] + System.Collections.Generic.List AttachedNetworkId { get; } + /// The list of versions that this Kubernetes cluster can be upgraded to. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The list of versions that this Kubernetes cluster can be upgraded to.", + SerializedName = @"availableUpgrades", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAvailableUpgrade) })] + System.Collections.Generic.List AvailableUpgrade { get; } + /// + /// The association of IP address pools to the communities and peers, allowing for announcement of IPs. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The association of IP address pools to the communities and peers, allowing for announcement of IPs.", + SerializedName = @"bgpAdvertisements", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBgpAdvertisement) })] + System.Collections.Generic.List BgpServiceLoadBalancerConfigurationBgpAdvertisement { get; set; } + /// + /// The list of additional BgpPeer entities that the Kubernetes cluster will peer with. All peering must be explicitly defined. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The list of additional BgpPeer entities that the Kubernetes cluster will peer with. All peering must be explicitly defined.", + SerializedName = @"bgpPeers", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IServiceLoadBalancerBgpPeer) })] + System.Collections.Generic.List BgpServiceLoadBalancerConfigurationBgpPeer { get; set; } + /// The indicator to specify if the load balancer peers with the network fabric. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The indicator to specify if the load balancer peers with the network fabric.", + SerializedName = @"fabricPeeringEnabled", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("True", "False")] + string BgpServiceLoadBalancerConfigurationFabricPeeringEnabled { get; set; } + /// + /// The list of pools of IP addresses that can be allocated to load balancer services. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The list of pools of IP addresses that can be allocated to load balancer services.", + SerializedName = @"ipAddressPools", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IIPAddressPool) })] + System.Collections.Generic.List BgpServiceLoadBalancerConfigurationIPAddressPool { get; set; } + /// The resource ID of the Network Cloud cluster. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The resource ID of the Network Cloud cluster.", + SerializedName = @"clusterId", + PossibleTypes = new [] { typeof(string) })] + string ClusterId { get; } + /// + /// The resource ID of the connected cluster set up when this Kubernetes cluster is created. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The resource ID of the connected cluster set up when this Kubernetes cluster is created.", + SerializedName = @"connectedClusterId", + PossibleTypes = new [] { typeof(string) })] + string ConnectedClusterId { get; } + /// The current running version of Kubernetes on the control plane. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The current running version of Kubernetes on the control plane.", + SerializedName = @"controlPlaneKubernetesVersion", + PossibleTypes = new [] { typeof(string) })] + string ControlPlaneKubernetesVersion { get; } + /// + /// The user name for the administrator that will be applied to the operating systems that run Kubernetes nodes. If not supplied, + /// a user name will be chosen by the service. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The user name for the administrator that will be applied to the operating systems that run Kubernetes nodes. If not supplied, a user name will be chosen by the service.", + SerializedName = @"adminUsername", + PossibleTypes = new [] { typeof(string) })] + string ControlPlaneNodeConfigurationAdministratorConfigurationAdminUsername { get; set; } + /// + /// The SSH configuration for the operating systems that run the nodes in the Kubernetes cluster. In some cases, specification + /// of public keys may be required to produce a working environment. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The SSH configuration for the operating systems that run the nodes in the Kubernetes cluster. In some cases, specification of public keys may be required to produce a working environment.", + SerializedName = @"sshPublicKeys", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISshPublicKey) })] + System.Collections.Generic.List ControlPlaneNodeConfigurationAdministratorConfigurationSshPublicKey { get; set; } + /// + /// The list of availability zones of the Network Cloud cluster to be used for the provisioning of nodes in the control plane. + /// If not specified, all availability zones will be used. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The list of availability zones of the Network Cloud cluster to be used for the provisioning of nodes in the control plane. If not specified, all availability zones will be used.", + SerializedName = @"availabilityZones", + PossibleTypes = new [] { typeof(string) })] + System.Collections.Generic.List ControlPlaneNodeConfigurationAvailabilityZone { get; set; } + /// The number of virtual machines that use this configuration. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The number of virtual machines that use this configuration.", + SerializedName = @"count", + PossibleTypes = new [] { typeof(long) })] + long ControlPlaneNodeConfigurationCount { get; set; } + /// The name of the VM SKU supplied during creation. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The name of the VM SKU supplied during creation.", + SerializedName = @"vmSkuName", + PossibleTypes = new [] { typeof(string) })] + string ControlPlaneNodeConfigurationVMSkuName { get; set; } + /// The current status of the Kubernetes cluster. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The current status of the Kubernetes cluster.", + SerializedName = @"detailedStatus", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Available", "Error", "Provisioning")] + string DetailedStatus { get; } + /// The descriptive message about the current detailed status. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The descriptive message about the current detailed status.", + SerializedName = @"detailedStatusMessage", + PossibleTypes = new [] { typeof(string) })] + string DetailedStatusMessage { get; } + /// Resource ETag. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"Resource ETag.", + SerializedName = @"etag", + PossibleTypes = new [] { typeof(string) })] + string Etag { get; } + /// The resource ID of the extended location on which the resource will be created. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The resource ID of the extended location on which the resource will be created.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string ExtendedLocationName { get; set; } + /// The extended location type, for example, CustomLocation. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The extended location type, for example, CustomLocation.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + string ExtendedLocationType { get; set; } + /// The current feature settings. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The current feature settings.", + SerializedName = @"featureStatuses", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IFeatureStatus) })] + System.Collections.Generic.List FeatureStatuses { get; } + /// + /// The agent pools that are created with this Kubernetes cluster for running critical system services and workloads. This + /// data in this field is only used during creation, and the field will be empty following the creation of the Kubernetes + /// Cluster. After creation, the management of agent pools is done using the agentPools sub-resource. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The agent pools that are created with this Kubernetes cluster for running critical system services and workloads. This data in this field is only used during creation, and the field will be empty following the creation of the Kubernetes Cluster. After creation, the management of agent pools is done using the agentPools sub-resource.", + SerializedName = @"initialAgentPoolConfigurations", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IInitialAgentPoolConfiguration) })] + System.Collections.Generic.List InitialAgentPoolConfiguration { get; set; } + /// The Kubernetes version for this cluster. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The Kubernetes version for this cluster.", + SerializedName = @"kubernetesVersion", + PossibleTypes = new [] { typeof(string) })] + string KubernetesVersion { get; set; } + /// + /// The list of pools of IP addresses that can be allocated to load balancer services. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The list of pools of IP addresses that can be allocated to load balancer services.", + SerializedName = @"ipAddressPools", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IIPAddressPool) })] + System.Collections.Generic.List L2ServiceLoadBalancerConfigurationIPAddressPool { get; set; } + /// + /// The location of the managed resource group. If not specified, the location of the parent resource is chosen. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The location of the managed resource group. If not specified, the location of the parent resource is chosen.", + SerializedName = @"location", + PossibleTypes = new [] { typeof(string) })] + string ManagedResourceGroupConfigurationLocation { get; set; } + /// + /// The name for the managed resource group. If not specified, the unique name is automatically generated. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The name for the managed resource group. If not specified, the unique name is automatically generated.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string ManagedResourceGroupConfigurationName { get; set; } + /// The resource ID of the associated Cloud Services network. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The resource ID of the associated Cloud Services network.", + SerializedName = @"cloudServicesNetworkId", + PossibleTypes = new [] { typeof(string) })] + string NetworkConfigurationCloudServicesNetworkId { get; set; } + /// + /// The resource ID of the Layer 3 network that is used for creation of the Container Networking Interface network. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The resource ID of the Layer 3 network that is used for creation of the Container Networking Interface network.", + SerializedName = @"cniNetworkId", + PossibleTypes = new [] { typeof(string) })] + string NetworkConfigurationCniNetworkId { get; set; } + /// + /// The IP address assigned to the Kubernetes DNS service. It must be within the Kubernetes service address range specified + /// in service CIDR. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The IP address assigned to the Kubernetes DNS service. It must be within the Kubernetes service address range specified in service CIDR.", + SerializedName = @"dnsServiceIp", + PossibleTypes = new [] { typeof(string) })] + string NetworkConfigurationDnsServiceIP { get; set; } + /// + /// The CIDR notation IP ranges from which to assign pod IPs. One IPv4 CIDR is expected for single-stack networking. Two CIDRs, + /// one for each IP family (IPv4/IPv6), is expected for dual-stack networking. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The CIDR notation IP ranges from which to assign pod IPs. One IPv4 CIDR is expected for single-stack networking. Two CIDRs, one for each IP family (IPv4/IPv6), is expected for dual-stack networking.", + SerializedName = @"podCidrs", + PossibleTypes = new [] { typeof(string) })] + System.Collections.Generic.List NetworkConfigurationPodCidr { get; set; } + /// + /// The CIDR notation IP ranges from which to assign service IPs. One IPv4 CIDR is expected for single-stack networking. Two + /// CIDRs, one for each IP family (IPv4/IPv6), is expected for dual-stack networking. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The CIDR notation IP ranges from which to assign service IPs. One IPv4 CIDR is expected for single-stack networking. Two CIDRs, one for each IP family (IPv4/IPv6), is expected for dual-stack networking.", + SerializedName = @"serviceCidrs", + PossibleTypes = new [] { typeof(string) })] + System.Collections.Generic.List NetworkConfigurationServiceCidr { get; set; } + /// The details of the nodes in this cluster. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The details of the nodes in this cluster.", + SerializedName = @"nodes", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterNode) })] + System.Collections.Generic.List Node { get; } + /// The provisioning state of the Kubernetes cluster resource. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The provisioning state of the Kubernetes cluster resource.", + SerializedName = @"provisioningState", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Succeeded", "Failed", "Canceled", "Accepted", "InProgress", "Created", "Updating", "Deleting")] + string ProvisioningState { get; } + /// + /// The SSH configuration for the operating systems that run the nodes in the Kubernetes cluster. In some cases, specification + /// of public keys may be required to produce a working environment. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The SSH configuration for the operating systems that run the nodes in the Kubernetes cluster. In some cases, specification of public keys may be required to produce a working environment.", + SerializedName = @"sshPublicKeys", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISshPublicKey) })] + System.Collections.Generic.List SshPublicKey { get; set; } + + } + /// KubernetesCluster represents the Kubernetes cluster hosted on Network Cloud. + internal partial interface IKubernetesClusterInternal : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal + { + /// The Azure Active Directory Integration properties. + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAadConfiguration AadConfiguration { get; set; } + /// + /// The list of Azure Active Directory group object IDs that will have an administrative role on the Kubernetes cluster. + /// + System.Collections.Generic.List AadConfigurationAdminGroupObjectId { get; set; } + /// + /// The user name for the administrator that will be applied to the operating systems that run Kubernetes nodes. If not supplied, + /// a user name will be chosen by the service. + /// + string AdminUsername { get; set; } + /// + /// The administrative credentials that will be applied to the control plane and agent pool nodes that do not specify their + /// own values. + /// + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministratorConfiguration AdministratorConfiguration { get; set; } + /// The list of Layer 2 Networks and related configuration for attachment. + System.Collections.Generic.List AttachedNetworkConfigurationL2Network { get; set; } + /// The list of Layer 3 Networks and related configuration for attachment. + System.Collections.Generic.List AttachedNetworkConfigurationL3Network { get; set; } + /// The list of Trunked Networks and related configuration for attachment. + System.Collections.Generic.List AttachedNetworkConfigurationTrunkedNetwork { get; set; } + /// + /// The full list of network resource IDs that are attached to this cluster, including those attached only to specific agent + /// pools. + /// + System.Collections.Generic.List AttachedNetworkId { get; set; } + /// The list of versions that this Kubernetes cluster can be upgraded to. + System.Collections.Generic.List AvailableUpgrade { get; set; } + /// + /// The association of IP address pools to the communities and peers, allowing for announcement of IPs. + /// + System.Collections.Generic.List BgpServiceLoadBalancerConfigurationBgpAdvertisement { get; set; } + /// + /// The list of additional BgpPeer entities that the Kubernetes cluster will peer with. All peering must be explicitly defined. + /// + System.Collections.Generic.List BgpServiceLoadBalancerConfigurationBgpPeer { get; set; } + /// The indicator to specify if the load balancer peers with the network fabric. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("True", "False")] + string BgpServiceLoadBalancerConfigurationFabricPeeringEnabled { get; set; } + /// + /// The list of pools of IP addresses that can be allocated to load balancer services. + /// + System.Collections.Generic.List BgpServiceLoadBalancerConfigurationIPAddressPool { get; set; } + /// The resource ID of the Network Cloud cluster. + string ClusterId { get; set; } + /// + /// The resource ID of the connected cluster set up when this Kubernetes cluster is created. + /// + string ConnectedClusterId { get; set; } + /// The current running version of Kubernetes on the control plane. + string ControlPlaneKubernetesVersion { get; set; } + /// The defining characteristics of the control plane for this Kubernetes Cluster. + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IControlPlaneNodeConfiguration ControlPlaneNodeConfiguration { get; set; } + /// The administrator credentials to be used for the nodes in the control plane. + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministratorConfiguration ControlPlaneNodeConfigurationAdministratorConfiguration { get; set; } + /// + /// The user name for the administrator that will be applied to the operating systems that run Kubernetes nodes. If not supplied, + /// a user name will be chosen by the service. + /// + string ControlPlaneNodeConfigurationAdministratorConfigurationAdminUsername { get; set; } + /// + /// The SSH configuration for the operating systems that run the nodes in the Kubernetes cluster. In some cases, specification + /// of public keys may be required to produce a working environment. + /// + System.Collections.Generic.List ControlPlaneNodeConfigurationAdministratorConfigurationSshPublicKey { get; set; } + /// + /// The list of availability zones of the Network Cloud cluster to be used for the provisioning of nodes in the control plane. + /// If not specified, all availability zones will be used. + /// + System.Collections.Generic.List ControlPlaneNodeConfigurationAvailabilityZone { get; set; } + /// The number of virtual machines that use this configuration. + long ControlPlaneNodeConfigurationCount { get; set; } + /// The name of the VM SKU supplied during creation. + string ControlPlaneNodeConfigurationVMSkuName { get; set; } + /// The current status of the Kubernetes cluster. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Available", "Error", "Provisioning")] + string DetailedStatus { get; set; } + /// The descriptive message about the current detailed status. + string DetailedStatusMessage { get; set; } + /// Resource ETag. + string Etag { get; set; } + /// The extended location of the cluster associated with the resource. + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocation ExtendedLocation { get; set; } + /// The resource ID of the extended location on which the resource will be created. + string ExtendedLocationName { get; set; } + /// The extended location type, for example, CustomLocation. + string ExtendedLocationType { get; set; } + /// The current feature settings. + System.Collections.Generic.List FeatureStatuses { get; set; } + /// + /// The agent pools that are created with this Kubernetes cluster for running critical system services and workloads. This + /// data in this field is only used during creation, and the field will be empty following the creation of the Kubernetes + /// Cluster. After creation, the management of agent pools is done using the agentPools sub-resource. + /// + System.Collections.Generic.List InitialAgentPoolConfiguration { get; set; } + /// The Kubernetes version for this cluster. + string KubernetesVersion { get; set; } + /// + /// The list of pools of IP addresses that can be allocated to load balancer services. + /// + System.Collections.Generic.List L2ServiceLoadBalancerConfigurationIPAddressPool { get; set; } + /// The configuration of the managed resource group associated with the resource. + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IManagedResourceGroupConfiguration ManagedResourceGroupConfiguration { get; set; } + /// + /// The location of the managed resource group. If not specified, the location of the parent resource is chosen. + /// + string ManagedResourceGroupConfigurationLocation { get; set; } + /// + /// The name for the managed resource group. If not specified, the unique name is automatically generated. + /// + string ManagedResourceGroupConfigurationName { get; set; } + /// + /// The configuration of the Kubernetes cluster networking, including the attachment of networks that span the cluster. + /// + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkConfiguration NetworkConfiguration { get; set; } + /// + /// The configuration of networks being attached to the cluster for use by the workloads that run on this Kubernetes cluster. + /// + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAttachedNetworkConfiguration NetworkConfigurationAttachedNetworkConfiguration { get; set; } + /// + /// The configuration of the BGP service load balancer for this Kubernetes cluster. A maximum of one service load balancer + /// may be specified, either Layer 2 or BGP. + /// + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBgpServiceLoadBalancerConfiguration NetworkConfigurationBgpServiceLoadBalancerConfiguration { get; set; } + /// The resource ID of the associated Cloud Services network. + string NetworkConfigurationCloudServicesNetworkId { get; set; } + /// + /// The resource ID of the Layer 3 network that is used for creation of the Container Networking Interface network. + /// + string NetworkConfigurationCniNetworkId { get; set; } + /// + /// The IP address assigned to the Kubernetes DNS service. It must be within the Kubernetes service address range specified + /// in service CIDR. + /// + string NetworkConfigurationDnsServiceIP { get; set; } + /// + /// The configuration of the Layer 2 service load balancer for this Kubernetes cluster. A maximum of one service load balancer + /// may be specified, either Layer 2 or BGP. + /// + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2ServiceLoadBalancerConfiguration NetworkConfigurationL2ServiceLoadBalancerConfiguration { get; set; } + /// + /// The CIDR notation IP ranges from which to assign pod IPs. One IPv4 CIDR is expected for single-stack networking. Two CIDRs, + /// one for each IP family (IPv4/IPv6), is expected for dual-stack networking. + /// + System.Collections.Generic.List NetworkConfigurationPodCidr { get; set; } + /// + /// The CIDR notation IP ranges from which to assign service IPs. One IPv4 CIDR is expected for single-stack networking. Two + /// CIDRs, one for each IP family (IPv4/IPv6), is expected for dual-stack networking. + /// + System.Collections.Generic.List NetworkConfigurationServiceCidr { get; set; } + /// The details of the nodes in this cluster. + System.Collections.Generic.List Node { get; set; } + /// The list of the resource properties. + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterProperties Property { get; set; } + /// The provisioning state of the Kubernetes cluster resource. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Succeeded", "Failed", "Canceled", "Accepted", "InProgress", "Created", "Updating", "Deleting")] + string ProvisioningState { get; set; } + /// + /// The SSH configuration for the operating systems that run the nodes in the Kubernetes cluster. In some cases, specification + /// of public keys may be required to produce a working environment. + /// + System.Collections.Generic.List SshPublicKey { get; set; } + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesCluster.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesCluster.json.cs similarity index 91% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesCluster.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesCluster.json.cs index 1e45bbfc61ec..9773a1168d2d 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesCluster.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesCluster.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class KubernetesCluster partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesCluster. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesCluster. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesCluster. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesCluster. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesCluster FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesCluster FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new KubernetesCluster(json) : null; } @@ -77,10 +77,10 @@ internal KubernetesCluster(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runti { return; } - __trackedResource = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.TrackedResource(json); - {_extendedLocation = If( json?.PropertyT("extendedLocation"), out var __jsonExtendedLocation) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ExtendedLocation.FromJson(__jsonExtendedLocation) : ExtendedLocation;} - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.KubernetesClusterProperties.FromJson(__jsonProperties) : Property;} - {_etag = If( json?.PropertyT("etag"), out var __jsonEtag) ? (string)__jsonEtag : (string)Etag;} + __trackedResource = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.TrackedResource(json); + {_extendedLocation = If( json?.PropertyT("extendedLocation"), out var __jsonExtendedLocation) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ExtendedLocation.FromJson(__jsonExtendedLocation) : _extendedLocation;} + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.KubernetesClusterProperties.FromJson(__jsonProperties) : _property;} + {_etag = If( json?.PropertyT("etag"), out var __jsonEtag) ? (string)__jsonEtag : (string)_etag;} AfterFromJson(json); } @@ -106,7 +106,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode ToJ __trackedResource?.ToJson(container, serializationMode); AddIf( null != this._extendedLocation ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) this._extendedLocation.ToJson(null,serializationMode) : null, "extendedLocation" ,container.Add ); AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._etag)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._etag.ToString()) : null, "etag" ,container.Add ); } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesClusterFeature.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesClusterFeature.PowerShell.cs new file mode 100644 index 000000000000..9afca043356b --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesClusterFeature.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.NetworkCloud.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + + /// KubernetesClusterFeature represents the feature of a Kubernetes cluster. + [System.ComponentModel.TypeConverter(typeof(KubernetesClusterFeatureTypeConverter))] + public partial class KubernetesClusterFeature + { + + /// + /// 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.NetworkCloud.Models.IKubernetesClusterFeature DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new KubernetesClusterFeature(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.NetworkCloud.Models.IKubernetesClusterFeature DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new KubernetesClusterFeature(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.NetworkCloud.Models.IKubernetesClusterFeature FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal KubernetesClusterFeature(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.NetworkCloud.Models.IKubernetesClusterFeatureInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeatureProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeatureInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.KubernetesClusterFeaturePropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Etag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeatureInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeatureInternal)this).Etag, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)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("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedByType = (string) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedByType = (string) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.TrackedResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("AvailabilityLifecycle")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeatureInternal)this).AvailabilityLifecycle = (string) content.GetValueForProperty("AvailabilityLifecycle",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeatureInternal)this).AvailabilityLifecycle, global::System.Convert.ToString); + } + if (content.Contains("DetailedStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeatureInternal)this).DetailedStatus = (string) content.GetValueForProperty("DetailedStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeatureInternal)this).DetailedStatus, global::System.Convert.ToString); + } + if (content.Contains("DetailedStatusMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeatureInternal)this).DetailedStatusMessage = (string) content.GetValueForProperty("DetailedStatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeatureInternal)this).DetailedStatusMessage, global::System.Convert.ToString); + } + if (content.Contains("Option")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeatureInternal)this).Option = (System.Collections.Generic.List) content.GetValueForProperty("Option",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeatureInternal)this).Option, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.StringKeyValuePairTypeConverter.ConvertFrom)); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeatureInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeatureInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("Required")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeatureInternal)this).Required = (string) content.GetValueForProperty("Required",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeatureInternal)this).Required, global::System.Convert.ToString); + } + if (content.Contains("Version")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeatureInternal)this).Version = (string) content.GetValueForProperty("Version",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeatureInternal)this).Version, 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 KubernetesClusterFeature(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.NetworkCloud.Models.IKubernetesClusterFeatureInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeatureProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeatureInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.KubernetesClusterFeaturePropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Etag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeatureInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeatureInternal)this).Etag, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)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("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedByType = (string) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedByType = (string) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.TrackedResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("AvailabilityLifecycle")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeatureInternal)this).AvailabilityLifecycle = (string) content.GetValueForProperty("AvailabilityLifecycle",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeatureInternal)this).AvailabilityLifecycle, global::System.Convert.ToString); + } + if (content.Contains("DetailedStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeatureInternal)this).DetailedStatus = (string) content.GetValueForProperty("DetailedStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeatureInternal)this).DetailedStatus, global::System.Convert.ToString); + } + if (content.Contains("DetailedStatusMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeatureInternal)this).DetailedStatusMessage = (string) content.GetValueForProperty("DetailedStatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeatureInternal)this).DetailedStatusMessage, global::System.Convert.ToString); + } + if (content.Contains("Option")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeatureInternal)this).Option = (System.Collections.Generic.List) content.GetValueForProperty("Option",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeatureInternal)this).Option, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.StringKeyValuePairTypeConverter.ConvertFrom)); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeatureInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeatureInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("Required")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeatureInternal)this).Required = (string) content.GetValueForProperty("Required",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeatureInternal)this).Required, global::System.Convert.ToString); + } + if (content.Contains("Version")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeatureInternal)this).Version = (string) content.GetValueForProperty("Version",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeatureInternal)this).Version, 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.NetworkCloud.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(); + } + } + /// KubernetesClusterFeature represents the feature of a Kubernetes cluster. + [System.ComponentModel.TypeConverter(typeof(KubernetesClusterFeatureTypeConverter))] + public partial interface IKubernetesClusterFeature + + { + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesClusterFeature.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesClusterFeature.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesClusterFeature.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesClusterFeature.TypeConverter.cs index eca7f70b006b..311be4d3912c 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesClusterFeature.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesClusterFeature.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IKubernetesClusterFeature ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeature ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeature).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeature).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesClusterFeature.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesClusterFeature.cs new file mode 100644 index 000000000000..167221f3a926 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesClusterFeature.cs @@ -0,0 +1,330 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + + /// KubernetesClusterFeature represents the feature of a Kubernetes cluster. + public partial class KubernetesClusterFeature : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeature, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeatureInternal, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResource __trackedResource = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.TrackedResource(); + + /// The lifecycle indicator of the feature. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string AvailabilityLifecycle { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeaturePropertiesInternal)Property).AvailabilityLifecycle; } + + /// The detailed status of the feature. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string DetailedStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeaturePropertiesInternal)Property).DetailedStatus; } + + /// The descriptive message for the detailed status of the feature. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string DetailedStatusMessage { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeaturePropertiesInternal)Property).DetailedStatusMessage; } + + /// Backing field for property. + private string _etag; + + /// Resource ETag. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string Etag { get => this._etag; } + + /// + /// Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).Id; } + + /// The geo-location where the resource lives + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)__trackedResource).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)__trackedResource).Location = value ?? null; } + + /// Internal Acessors for AvailabilityLifecycle + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeatureInternal.AvailabilityLifecycle { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeaturePropertiesInternal)Property).AvailabilityLifecycle; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeaturePropertiesInternal)Property).AvailabilityLifecycle = value ?? null; } + + /// Internal Acessors for DetailedStatus + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeatureInternal.DetailedStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeaturePropertiesInternal)Property).DetailedStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeaturePropertiesInternal)Property).DetailedStatus = value ?? null; } + + /// Internal Acessors for DetailedStatusMessage + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeatureInternal.DetailedStatusMessage { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeaturePropertiesInternal)Property).DetailedStatusMessage; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeaturePropertiesInternal)Property).DetailedStatusMessage = value ?? null; } + + /// Internal Acessors for Etag + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeatureInternal.Etag { get => this._etag; set { {_etag = value;} } } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeatureProperties Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeatureInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.KubernetesClusterFeatureProperties()); set { {_property = value;} } } + + /// Internal Acessors for ProvisioningState + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeatureInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeaturePropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeaturePropertiesInternal)Property).ProvisioningState = value ?? null; } + + /// Internal Acessors for Required + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeatureInternal.Required { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeaturePropertiesInternal)Property).Required; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeaturePropertiesInternal)Property).Required = value ?? null; } + + /// Internal Acessors for Version + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeatureInternal.Version { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeaturePropertiesInternal)Property).Version; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeaturePropertiesInternal)Property).Version = value ?? null; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).Id = value ?? null; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).Name = value ?? null; } + + /// Internal Acessors for SystemData + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISystemData Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemData; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemData = value ?? null /* model class */; } + + /// Internal Acessors for SystemDataCreatedAt + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataCreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataCreatedAt = value ?? default(global::System.DateTime); } + + /// Internal Acessors for SystemDataCreatedBy + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataCreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataCreatedBy = value ?? null; } + + /// Internal Acessors for SystemDataCreatedByType + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataCreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataCreatedByType = value ?? null; } + + /// Internal Acessors for SystemDataLastModifiedAt + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedAt = value ?? default(global::System.DateTime); } + + /// Internal Acessors for SystemDataLastModifiedBy + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedBy = value ?? null; } + + /// Internal Acessors for SystemDataLastModifiedByType + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedByType = value ?? null; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).Type = value ?? null; } + + /// The name of the resource + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).Name; } + + /// The configured options for the feature. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public System.Collections.Generic.List Option { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeaturePropertiesInternal)Property).Option; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeaturePropertiesInternal)Property).Option = value ?? null /* arrayOf */; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeatureProperties _property; + + /// The list of the resource properties. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeatureProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.KubernetesClusterFeatureProperties()); set => this._property = value; } + + /// The provisioning state of the Kubernetes cluster feature. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeaturePropertiesInternal)Property).ProvisioningState; } + + /// + /// The indicator of if the feature is required or optional. Optional features may be deleted by the user, while required + /// features are managed with the kubernetes cluster lifecycle. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string Required { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeaturePropertiesInternal)Property).Required; } + + /// Gets the resource group name + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string ResourceGroupName { get => (new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Success ? new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Groups["resourceGroupName"].Value : null); } + + /// + /// Azure Resource Manager metadata containing createdBy and modifiedBy information. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISystemData SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemData; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemData = value ?? null /* model class */; } + + /// The timestamp of resource creation (UTC). + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataCreatedAt; } + + /// The identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataCreatedBy; } + + /// The type of identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public string SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataCreatedByType; } + + /// The timestamp of resource last modification (UTC) + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedAt; } + + /// The identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedBy; } + + /// The type of identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public string SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedByType; } + + /// Resource tags. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)__trackedResource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).Type; } + + /// The version of the feature. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string Version { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeaturePropertiesInternal)Property).Version; } + + /// Creates an new instance. + public KubernetesClusterFeature() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__trackedResource), __trackedResource); + await eventListener.AssertObjectIsValid(nameof(__trackedResource), __trackedResource); + } + } + /// KubernetesClusterFeature represents the feature of a Kubernetes cluster. + public partial interface IKubernetesClusterFeature : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResource + { + /// The lifecycle indicator of the feature. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The lifecycle indicator of the feature.", + SerializedName = @"availabilityLifecycle", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Preview", "GenerallyAvailable")] + string AvailabilityLifecycle { get; } + /// The detailed status of the feature. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The detailed status of the feature.", + SerializedName = @"detailedStatus", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Error", "Provisioning", "Installed")] + string DetailedStatus { get; } + /// The descriptive message for the detailed status of the feature. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The descriptive message for the detailed status of the feature.", + SerializedName = @"detailedStatusMessage", + PossibleTypes = new [] { typeof(string) })] + string DetailedStatusMessage { get; } + /// Resource ETag. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"Resource ETag.", + SerializedName = @"etag", + PossibleTypes = new [] { typeof(string) })] + string Etag { get; } + /// The configured options for the feature. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The configured options for the feature.", + SerializedName = @"options", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStringKeyValuePair) })] + System.Collections.Generic.List Option { get; set; } + /// The provisioning state of the Kubernetes cluster feature. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The provisioning state of the Kubernetes cluster feature.", + SerializedName = @"provisioningState", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Accepted", "Canceled", "Deleting", "Failed", "Succeeded", "Updating")] + string ProvisioningState { get; } + /// + /// The indicator of if the feature is required or optional. Optional features may be deleted by the user, while required + /// features are managed with the kubernetes cluster lifecycle. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The indicator of if the feature is required or optional. Optional features may be deleted by the user, while required features are managed with the kubernetes cluster lifecycle.", + SerializedName = @"required", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("True", "False")] + string Required { get; } + /// The version of the feature. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The version of the feature.", + SerializedName = @"version", + PossibleTypes = new [] { typeof(string) })] + string Version { get; } + + } + /// KubernetesClusterFeature represents the feature of a Kubernetes cluster. + internal partial interface IKubernetesClusterFeatureInternal : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal + { + /// The lifecycle indicator of the feature. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Preview", "GenerallyAvailable")] + string AvailabilityLifecycle { get; set; } + /// The detailed status of the feature. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Error", "Provisioning", "Installed")] + string DetailedStatus { get; set; } + /// The descriptive message for the detailed status of the feature. + string DetailedStatusMessage { get; set; } + /// Resource ETag. + string Etag { get; set; } + /// The configured options for the feature. + System.Collections.Generic.List Option { get; set; } + /// The list of the resource properties. + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeatureProperties Property { get; set; } + /// The provisioning state of the Kubernetes cluster feature. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Accepted", "Canceled", "Deleting", "Failed", "Succeeded", "Updating")] + string ProvisioningState { get; set; } + /// + /// The indicator of if the feature is required or optional. Optional features may be deleted by the user, while required + /// features are managed with the kubernetes cluster lifecycle. + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("True", "False")] + string Required { get; set; } + /// The version of the feature. + string Version { get; set; } + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesClusterFeature.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesClusterFeature.json.cs similarity index 92% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesClusterFeature.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesClusterFeature.json.cs index 301caa37df3c..0a7832058341 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesClusterFeature.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesClusterFeature.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class KubernetesClusterFeature partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeature. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeature. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeature. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeature. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeature FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeature FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new KubernetesClusterFeature(json) : null; } @@ -77,9 +77,9 @@ internal KubernetesClusterFeature(Microsoft.Azure.PowerShell.Cmdlets.NetworkClou { return; } - __trackedResource = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.TrackedResource(json); - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.KubernetesClusterFeatureProperties.FromJson(__jsonProperties) : Property;} - {_etag = If( json?.PropertyT("etag"), out var __jsonEtag) ? (string)__jsonEtag : (string)Etag;} + __trackedResource = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.TrackedResource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.KubernetesClusterFeatureProperties.FromJson(__jsonProperties) : _property;} + {_etag = If( json?.PropertyT("etag"), out var __jsonEtag) ? (string)__jsonEtag : (string)_etag;} AfterFromJson(json); } @@ -104,7 +104,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode ToJ } __trackedResource?.ToJson(container, serializationMode); AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._etag)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._etag.ToString()) : null, "etag" ,container.Add ); } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesClusterFeatureList.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesClusterFeatureList.PowerShell.cs similarity index 75% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesClusterFeatureList.PowerShell.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesClusterFeatureList.PowerShell.cs index 9c5824062e1a..d0afe446e0d5 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesClusterFeatureList.PowerShell.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesClusterFeatureList.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; @@ -65,29 +65,27 @@ public partial class KubernetesClusterFeatureList 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.NetworkCloud.Models.Api20250201.IKubernetesClusterFeatureList DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeatureList DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new KubernetesClusterFeatureList(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.NetworkCloud.Models.Api20250201.IKubernetesClusterFeatureList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeatureList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new KubernetesClusterFeatureList(content); } @@ -97,10 +95,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeatureList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeatureList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,17 +113,17 @@ internal KubernetesClusterFeatureList(global::System.Collections.IDictionary con // actually deserialize if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeatureListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeatureListInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeatureListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeatureListInternal)this).NextLink, global::System.Convert.ToString); } if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeatureListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeature[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeatureListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.KubernetesClusterFeatureTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeatureListInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeatureListInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.KubernetesClusterFeatureTypeConverter.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. @@ -140,11 +138,11 @@ internal KubernetesClusterFeatureList(global::System.Management.Automation.PSObj // actually deserialize if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeatureListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeatureListInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeatureListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeatureListInternal)this).NextLink, global::System.Convert.ToString); } if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeatureListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeature[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeatureListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.KubernetesClusterFeatureTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeatureListInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeatureListInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.KubernetesClusterFeatureTypeConverter.ConvertFrom)); } AfterDeserializePSObject(content); } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesClusterFeatureList.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesClusterFeatureList.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesClusterFeatureList.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesClusterFeatureList.TypeConverter.cs index 44e5efa2c454..b361c40a28ce 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesClusterFeatureList.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesClusterFeatureList.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IKubernetesClusterFeatureList ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeatureList ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeatureList).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeatureList).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesClusterFeatureList.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesClusterFeatureList.cs new file mode 100644 index 000000000000..b8c3b0d501c6 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesClusterFeatureList.cs @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + + /// + /// KubernetesClusterFeatureList represents the list of Kubernetes cluster feature resources. + /// + public partial class KubernetesClusterFeatureList : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeatureList, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeatureListInternal + { + + /// Backing field for property. + private string _nextLink; + + /// The link used to get the next page of operations. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; set => this._nextLink = value; } + + /// Backing field for property. + private System.Collections.Generic.List _value; + + /// The list of Kubernetes cluster features. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public System.Collections.Generic.List Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public KubernetesClusterFeatureList() + { + + } + } + /// KubernetesClusterFeatureList represents the list of Kubernetes cluster feature resources. + public partial interface IKubernetesClusterFeatureList : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable + { + /// The link used to get the next page of operations. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The link used to get the next page of operations.", + SerializedName = @"nextLink", + PossibleTypes = new [] { typeof(string) })] + string NextLink { get; set; } + /// The list of Kubernetes cluster features. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The list of Kubernetes cluster features.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeature) })] + System.Collections.Generic.List Value { get; set; } + + } + /// KubernetesClusterFeatureList represents the list of Kubernetes cluster feature resources. + internal partial interface IKubernetesClusterFeatureListInternal + + { + /// The link used to get the next page of operations. + string NextLink { get; set; } + /// The list of Kubernetes cluster features. + System.Collections.Generic.List Value { get; set; } + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesClusterFeatureList.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesClusterFeatureList.json.cs similarity index 90% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesClusterFeatureList.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesClusterFeatureList.json.cs index 8105b0adffd6..1e2d65bde24a 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesClusterFeatureList.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesClusterFeatureList.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -56,13 +56,13 @@ public partial class KubernetesClusterFeatureList partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeatureList. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeatureList. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeatureList. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeatureList. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeatureList FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeatureList FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new KubernetesClusterFeatureList(json) : null; } @@ -79,8 +79,8 @@ internal KubernetesClusterFeatureList(Microsoft.Azure.PowerShell.Cmdlets.Network { return; } - {_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.NetworkCloud.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.NetworkCloud.Models.Api20250201.IKubernetesClusterFeature) (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.KubernetesClusterFeature.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.NetworkCloud.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.NetworkCloud.Models.IKubernetesClusterFeature) (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.KubernetesClusterFeature.FromJson(__u) )) ))() : null : _value;} AfterFromJson(json); } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesClusterFeaturePatchParameters.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesClusterFeaturePatchParameters.PowerShell.cs new file mode 100644 index 000000000000..4a35a69024d3 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesClusterFeaturePatchParameters.PowerShell.cs @@ -0,0 +1,187 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + + /// + /// KubernetesClusterFeaturePatchParameters represents the body of the request to patch the Kubernetes cluster feature. + /// + [System.ComponentModel.TypeConverter(typeof(KubernetesClusterFeaturePatchParametersTypeConverter))] + public partial class KubernetesClusterFeaturePatchParameters + { + + /// + /// 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.NetworkCloud.Models.IKubernetesClusterFeaturePatchParameters DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new KubernetesClusterFeaturePatchParameters(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.NetworkCloud.Models.IKubernetesClusterFeaturePatchParameters DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new KubernetesClusterFeaturePatchParameters(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.NetworkCloud.Models.IKubernetesClusterFeaturePatchParameters FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal KubernetesClusterFeaturePatchParameters(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.NetworkCloud.Models.IKubernetesClusterFeaturePatchParametersInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeaturePatchProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeaturePatchParametersInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.KubernetesClusterFeaturePatchPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeaturePatchParametersInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeaturePatchParametersTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeaturePatchParametersInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.KubernetesClusterFeaturePatchParametersTagsTypeConverter.ConvertFrom); + } + if (content.Contains("Option")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeaturePatchParametersInternal)this).Option = (System.Collections.Generic.List) content.GetValueForProperty("Option",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeaturePatchParametersInternal)this).Option, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.StringKeyValuePairTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal KubernetesClusterFeaturePatchParameters(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.NetworkCloud.Models.IKubernetesClusterFeaturePatchParametersInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeaturePatchProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeaturePatchParametersInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.KubernetesClusterFeaturePatchPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeaturePatchParametersInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeaturePatchParametersTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeaturePatchParametersInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.KubernetesClusterFeaturePatchParametersTagsTypeConverter.ConvertFrom); + } + if (content.Contains("Option")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeaturePatchParametersInternal)this).Option = (System.Collections.Generic.List) content.GetValueForProperty("Option",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeaturePatchParametersInternal)this).Option, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.StringKeyValuePairTypeConverter.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.NetworkCloud.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(); + } + } + /// KubernetesClusterFeaturePatchParameters represents the body of the request to patch the Kubernetes cluster feature. + [System.ComponentModel.TypeConverter(typeof(KubernetesClusterFeaturePatchParametersTypeConverter))] + public partial interface IKubernetesClusterFeaturePatchParameters + + { + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesClusterFeaturePatchParameters.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesClusterFeaturePatchParameters.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesClusterFeaturePatchParameters.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesClusterFeaturePatchParameters.TypeConverter.cs index e5ed23b79590..be6f58e3fef0 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesClusterFeaturePatchParameters.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesClusterFeaturePatchParameters.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IKubernetesClusterFeaturePatchParameters ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeaturePatchParameters ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeaturePatchParameters).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeaturePatchParameters).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesClusterFeaturePatchParameters.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesClusterFeaturePatchParameters.cs new file mode 100644 index 000000000000..0fd6ab31574f --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesClusterFeaturePatchParameters.cs @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + + /// + /// KubernetesClusterFeaturePatchParameters represents the body of the request to patch the Kubernetes cluster feature. + /// + public partial class KubernetesClusterFeaturePatchParameters : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeaturePatchParameters, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeaturePatchParametersInternal + { + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeaturePatchProperties Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeaturePatchParametersInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.KubernetesClusterFeaturePatchProperties()); set { {_property = value;} } } + + /// The configured options for the feature. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public System.Collections.Generic.List Option { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeaturePatchPropertiesInternal)Property).Option; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeaturePatchPropertiesInternal)Property).Option = value ?? null /* arrayOf */; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeaturePatchProperties _property; + + /// The list of the resource properties. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeaturePatchProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.KubernetesClusterFeaturePatchProperties()); set => this._property = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeaturePatchParametersTags _tag; + + /// The Azure resource tags that will replace the existing ones. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeaturePatchParametersTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.KubernetesClusterFeaturePatchParametersTags()); set => this._tag = value; } + + /// Creates an new instance. + public KubernetesClusterFeaturePatchParameters() + { + + } + } + /// KubernetesClusterFeaturePatchParameters represents the body of the request to patch the Kubernetes cluster feature. + public partial interface IKubernetesClusterFeaturePatchParameters : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable + { + /// The configured options for the feature. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The configured options for the feature.", + SerializedName = @"options", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStringKeyValuePair) })] + System.Collections.Generic.List Option { get; set; } + /// The Azure resource tags that will replace the existing ones. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The Azure resource tags that will replace the existing ones.", + SerializedName = @"tags", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeaturePatchParametersTags) })] + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeaturePatchParametersTags Tag { get; set; } + + } + /// KubernetesClusterFeaturePatchParameters represents the body of the request to patch the Kubernetes cluster feature. + internal partial interface IKubernetesClusterFeaturePatchParametersInternal + + { + /// The configured options for the feature. + System.Collections.Generic.List Option { get; set; } + /// The list of the resource properties. + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeaturePatchProperties Property { get; set; } + /// The Azure resource tags that will replace the existing ones. + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeaturePatchParametersTags Tag { get; set; } + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesClusterFeaturePatchParameters.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesClusterFeaturePatchParameters.json.cs similarity index 92% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesClusterFeaturePatchParameters.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesClusterFeaturePatchParameters.json.cs index 4260898ae6f6..03e8d50dbad9 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesClusterFeaturePatchParameters.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesClusterFeaturePatchParameters.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -56,13 +56,13 @@ public partial class KubernetesClusterFeaturePatchParameters partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeaturePatchParameters. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeaturePatchParameters. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeaturePatchParameters. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeaturePatchParameters. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeaturePatchParameters FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeaturePatchParameters FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new KubernetesClusterFeaturePatchParameters(json) : null; } @@ -79,8 +79,8 @@ internal KubernetesClusterFeaturePatchParameters(Microsoft.Azure.PowerShell.Cmdl { return; } - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.KubernetesClusterFeaturePatchProperties.FromJson(__jsonProperties) : Property;} - {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.KubernetesClusterFeaturePatchParametersTags.FromJson(__jsonTags) : Tag;} + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.KubernetesClusterFeaturePatchProperties.FromJson(__jsonProperties) : _property;} + {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.KubernetesClusterFeaturePatchParametersTags.FromJson(__jsonTags) : _tag;} AfterFromJson(json); } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesClusterFeaturePatchParametersTags.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesClusterFeaturePatchParametersTags.PowerShell.cs similarity index 88% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesClusterFeaturePatchParametersTags.PowerShell.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesClusterFeaturePatchParametersTags.PowerShell.cs index 4134387df0ef..047addbbd936 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesClusterFeaturePatchParametersTags.PowerShell.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesClusterFeaturePatchParametersTags.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; @@ -63,29 +63,29 @@ public partial class KubernetesClusterFeaturePatchParametersTags 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.NetworkCloud.Models.Api20250201.IKubernetesClusterFeaturePatchParametersTags DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeaturePatchParametersTags DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new KubernetesClusterFeaturePatchParametersTags(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.NetworkCloud.Models.Api20250201.IKubernetesClusterFeaturePatchParametersTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeaturePatchParametersTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new KubernetesClusterFeaturePatchParametersTags(content); } @@ -98,10 +98,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201 /// /// an instance of the model class. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeaturePatchParametersTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeaturePatchParametersTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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. @@ -120,7 +120,7 @@ internal KubernetesClusterFeaturePatchParametersTags(global::System.Collections. } /// - /// 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/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesClusterFeaturePatchParametersTags.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesClusterFeaturePatchParametersTags.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesClusterFeaturePatchParametersTags.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesClusterFeaturePatchParametersTags.TypeConverter.cs index 035d89c5a451..8d1ba7d6e8d6 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesClusterFeaturePatchParametersTags.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesClusterFeaturePatchParametersTags.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IKubernetesClusterFeaturePatchParametersTags ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeaturePatchParametersTags ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeaturePatchParametersTags).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeaturePatchParametersTags).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesClusterFeaturePatchParametersTags.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesClusterFeaturePatchParametersTags.cs similarity index 83% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesClusterFeaturePatchParametersTags.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesClusterFeaturePatchParametersTags.cs index cbbf5c2265af..e9f59734fa02 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesClusterFeaturePatchParametersTags.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesClusterFeaturePatchParametersTags.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; /// The Azure resource tags that will replace the existing ones. public partial class KubernetesClusterFeaturePatchParametersTags : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeaturePatchParametersTags, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeaturePatchParametersTagsInternal + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeaturePatchParametersTags, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeaturePatchParametersTagsInternal { /// diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesClusterFeaturePatchParametersTags.dictionary.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesClusterFeaturePatchParametersTags.dictionary.cs similarity index 96% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesClusterFeaturePatchParametersTags.dictionary.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesClusterFeaturePatchParametersTags.dictionary.cs index 1d7029451e3a..b78fa3ee0cf1 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesClusterFeaturePatchParametersTags.dictionary.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesClusterFeaturePatchParametersTags.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.KubernetesClusterFeaturePatchParametersTags source) => source.__additionalProperties; + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.KubernetesClusterFeaturePatchParametersTags source) => source.__additionalProperties; } } \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesClusterFeaturePatchParametersTags.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesClusterFeaturePatchParametersTags.json.cs similarity index 95% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesClusterFeaturePatchParametersTags.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesClusterFeaturePatchParametersTags.json.cs index 57abb1176f87..3d31f13bb413 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesClusterFeaturePatchParametersTags.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesClusterFeaturePatchParametersTags.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class KubernetesClusterFeaturePatchParametersTags partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeaturePatchParametersTags. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeaturePatchParametersTags. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeaturePatchParametersTags. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeaturePatchParametersTags. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeaturePatchParametersTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeaturePatchParametersTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new KubernetesClusterFeaturePatchParametersTags(json) : null; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesClusterFeaturePatchProperties.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesClusterFeaturePatchProperties.PowerShell.cs similarity index 79% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesClusterFeaturePatchProperties.PowerShell.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesClusterFeaturePatchProperties.PowerShell.cs index 5b6ce78c4bc9..42fd66df81cb 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesClusterFeaturePatchProperties.PowerShell.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesClusterFeaturePatchProperties.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; @@ -65,29 +65,29 @@ public partial class KubernetesClusterFeaturePatchProperties 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.NetworkCloud.Models.Api20250201.IKubernetesClusterFeaturePatchProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeaturePatchProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new KubernetesClusterFeaturePatchProperties(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.NetworkCloud.Models.Api20250201.IKubernetesClusterFeaturePatchProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeaturePatchProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new KubernetesClusterFeaturePatchProperties(content); } @@ -100,10 +100,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201 /// /// an instance of the model class. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeaturePatchProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeaturePatchProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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. @@ -118,13 +118,13 @@ internal KubernetesClusterFeaturePatchProperties(global::System.Collections.IDic // actually deserialize if (content.Contains("Option")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeaturePatchPropertiesInternal)this).Option = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStringKeyValuePair[]) content.GetValueForProperty("Option",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeaturePatchPropertiesInternal)this).Option, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.StringKeyValuePairTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeaturePatchPropertiesInternal)this).Option = (System.Collections.Generic.List) content.GetValueForProperty("Option",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeaturePatchPropertiesInternal)this).Option, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.StringKeyValuePairTypeConverter.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. @@ -139,7 +139,7 @@ internal KubernetesClusterFeaturePatchProperties(global::System.Management.Autom // actually deserialize if (content.Contains("Option")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeaturePatchPropertiesInternal)this).Option = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStringKeyValuePair[]) content.GetValueForProperty("Option",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeaturePatchPropertiesInternal)this).Option, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.StringKeyValuePairTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeaturePatchPropertiesInternal)this).Option = (System.Collections.Generic.List) content.GetValueForProperty("Option",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeaturePatchPropertiesInternal)this).Option, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.StringKeyValuePairTypeConverter.ConvertFrom)); } AfterDeserializePSObject(content); } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesClusterFeaturePatchProperties.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesClusterFeaturePatchProperties.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesClusterFeaturePatchProperties.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesClusterFeaturePatchProperties.TypeConverter.cs index 9c6c5f540ba3..c24f761362cc 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesClusterFeaturePatchProperties.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesClusterFeaturePatchProperties.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IKubernetesClusterFeaturePatchProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeaturePatchProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeaturePatchProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeaturePatchProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesClusterFeaturePatchProperties.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesClusterFeaturePatchProperties.cs new file mode 100644 index 000000000000..061210d10d80 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesClusterFeaturePatchProperties.cs @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + + /// + /// KubernetesClusterFeaturePatchProperties represents the Kubernetes cluster feature properties for patching. + /// + public partial class KubernetesClusterFeaturePatchProperties : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeaturePatchProperties, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeaturePatchPropertiesInternal + { + + /// Backing field for property. + private System.Collections.Generic.List _option; + + /// The configured options for the feature. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public System.Collections.Generic.List Option { get => this._option; set => this._option = value; } + + /// Creates an new instance. + public KubernetesClusterFeaturePatchProperties() + { + + } + } + /// KubernetesClusterFeaturePatchProperties represents the Kubernetes cluster feature properties for patching. + public partial interface IKubernetesClusterFeaturePatchProperties : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable + { + /// The configured options for the feature. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The configured options for the feature.", + SerializedName = @"options", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStringKeyValuePair) })] + System.Collections.Generic.List Option { get; set; } + + } + /// KubernetesClusterFeaturePatchProperties represents the Kubernetes cluster feature properties for patching. + internal partial interface IKubernetesClusterFeaturePatchPropertiesInternal + + { + /// The configured options for the feature. + System.Collections.Generic.List Option { get; set; } + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesClusterFeaturePatchProperties.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesClusterFeaturePatchProperties.json.cs similarity index 90% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesClusterFeaturePatchProperties.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesClusterFeaturePatchProperties.json.cs index 3abcf99ac698..fc2eb993efbe 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesClusterFeaturePatchProperties.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesClusterFeaturePatchProperties.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -56,13 +56,13 @@ public partial class KubernetesClusterFeaturePatchProperties partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeaturePatchProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeaturePatchProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeaturePatchProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeaturePatchProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeaturePatchProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeaturePatchProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new KubernetesClusterFeaturePatchProperties(json) : null; } @@ -79,7 +79,7 @@ internal KubernetesClusterFeaturePatchProperties(Microsoft.Azure.PowerShell.Cmdl { return; } - {_option = If( json?.PropertyT("options"), out var __jsonOptions) ? If( __jsonOptions as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IStringKeyValuePair) (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.StringKeyValuePair.FromJson(__u) )) ))() : null : Option;} + {_option = If( json?.PropertyT("options"), out var __jsonOptions) ? If( __jsonOptions as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.IStringKeyValuePair) (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.StringKeyValuePair.FromJson(__u) )) ))() : null : _option;} AfterFromJson(json); } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesClusterFeatureProperties.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesClusterFeatureProperties.PowerShell.cs new file mode 100644 index 000000000000..ac98b7133792 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesClusterFeatureProperties.PowerShell.cs @@ -0,0 +1,218 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + + /// + /// KubernetesClusterFeatureProperties represents the properties of a Kubernetes cluster feature. + /// + [System.ComponentModel.TypeConverter(typeof(KubernetesClusterFeaturePropertiesTypeConverter))] + public partial class KubernetesClusterFeatureProperties + { + + /// + /// 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.NetworkCloud.Models.IKubernetesClusterFeatureProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new KubernetesClusterFeatureProperties(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.NetworkCloud.Models.IKubernetesClusterFeatureProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new KubernetesClusterFeatureProperties(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.NetworkCloud.Models.IKubernetesClusterFeatureProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal KubernetesClusterFeatureProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("AvailabilityLifecycle")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeaturePropertiesInternal)this).AvailabilityLifecycle = (string) content.GetValueForProperty("AvailabilityLifecycle",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeaturePropertiesInternal)this).AvailabilityLifecycle, global::System.Convert.ToString); + } + if (content.Contains("DetailedStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeaturePropertiesInternal)this).DetailedStatus = (string) content.GetValueForProperty("DetailedStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeaturePropertiesInternal)this).DetailedStatus, global::System.Convert.ToString); + } + if (content.Contains("DetailedStatusMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeaturePropertiesInternal)this).DetailedStatusMessage = (string) content.GetValueForProperty("DetailedStatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeaturePropertiesInternal)this).DetailedStatusMessage, global::System.Convert.ToString); + } + if (content.Contains("Option")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeaturePropertiesInternal)this).Option = (System.Collections.Generic.List) content.GetValueForProperty("Option",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeaturePropertiesInternal)this).Option, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.StringKeyValuePairTypeConverter.ConvertFrom)); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeaturePropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeaturePropertiesInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("Required")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeaturePropertiesInternal)this).Required = (string) content.GetValueForProperty("Required",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeaturePropertiesInternal)this).Required, global::System.Convert.ToString); + } + if (content.Contains("Version")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeaturePropertiesInternal)this).Version = (string) content.GetValueForProperty("Version",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeaturePropertiesInternal)this).Version, 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 KubernetesClusterFeatureProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("AvailabilityLifecycle")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeaturePropertiesInternal)this).AvailabilityLifecycle = (string) content.GetValueForProperty("AvailabilityLifecycle",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeaturePropertiesInternal)this).AvailabilityLifecycle, global::System.Convert.ToString); + } + if (content.Contains("DetailedStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeaturePropertiesInternal)this).DetailedStatus = (string) content.GetValueForProperty("DetailedStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeaturePropertiesInternal)this).DetailedStatus, global::System.Convert.ToString); + } + if (content.Contains("DetailedStatusMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeaturePropertiesInternal)this).DetailedStatusMessage = (string) content.GetValueForProperty("DetailedStatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeaturePropertiesInternal)this).DetailedStatusMessage, global::System.Convert.ToString); + } + if (content.Contains("Option")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeaturePropertiesInternal)this).Option = (System.Collections.Generic.List) content.GetValueForProperty("Option",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeaturePropertiesInternal)this).Option, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.StringKeyValuePairTypeConverter.ConvertFrom)); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeaturePropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeaturePropertiesInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("Required")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeaturePropertiesInternal)this).Required = (string) content.GetValueForProperty("Required",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeaturePropertiesInternal)this).Required, global::System.Convert.ToString); + } + if (content.Contains("Version")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeaturePropertiesInternal)this).Version = (string) content.GetValueForProperty("Version",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeaturePropertiesInternal)this).Version, 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.NetworkCloud.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(); + } + } + /// KubernetesClusterFeatureProperties represents the properties of a Kubernetes cluster feature. + [System.ComponentModel.TypeConverter(typeof(KubernetesClusterFeaturePropertiesTypeConverter))] + public partial interface IKubernetesClusterFeatureProperties + + { + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesClusterFeatureProperties.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesClusterFeatureProperties.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesClusterFeatureProperties.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesClusterFeatureProperties.TypeConverter.cs index 67a5a1e267d3..bfa6abf285a8 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesClusterFeatureProperties.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesClusterFeatureProperties.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IKubernetesClusterFeatureProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeatureProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeatureProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeatureProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesClusterFeatureProperties.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesClusterFeatureProperties.cs new file mode 100644 index 000000000000..87b257f3c143 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesClusterFeatureProperties.cs @@ -0,0 +1,211 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + + /// + /// KubernetesClusterFeatureProperties represents the properties of a Kubernetes cluster feature. + /// + public partial class KubernetesClusterFeatureProperties : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeatureProperties, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeaturePropertiesInternal + { + + /// Backing field for property. + private string _availabilityLifecycle; + + /// The lifecycle indicator of the feature. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string AvailabilityLifecycle { get => this._availabilityLifecycle; } + + /// Backing field for property. + private string _detailedStatus; + + /// The detailed status of the feature. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string DetailedStatus { get => this._detailedStatus; } + + /// Backing field for property. + private string _detailedStatusMessage; + + /// The descriptive message for the detailed status of the feature. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string DetailedStatusMessage { get => this._detailedStatusMessage; } + + /// Internal Acessors for AvailabilityLifecycle + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeaturePropertiesInternal.AvailabilityLifecycle { get => this._availabilityLifecycle; set { {_availabilityLifecycle = value;} } } + + /// Internal Acessors for DetailedStatus + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeaturePropertiesInternal.DetailedStatus { get => this._detailedStatus; set { {_detailedStatus = value;} } } + + /// Internal Acessors for DetailedStatusMessage + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeaturePropertiesInternal.DetailedStatusMessage { get => this._detailedStatusMessage; set { {_detailedStatusMessage = value;} } } + + /// Internal Acessors for ProvisioningState + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeaturePropertiesInternal.ProvisioningState { get => this._provisioningState; set { {_provisioningState = value;} } } + + /// Internal Acessors for Required + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeaturePropertiesInternal.Required { get => this._required; set { {_required = value;} } } + + /// Internal Acessors for Version + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeaturePropertiesInternal.Version { get => this._version; set { {_version = value;} } } + + /// Backing field for property. + private System.Collections.Generic.List _option; + + /// The configured options for the feature. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public System.Collections.Generic.List Option { get => this._option; set => this._option = value; } + + /// Backing field for property. + private string _provisioningState; + + /// The provisioning state of the Kubernetes cluster feature. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string ProvisioningState { get => this._provisioningState; } + + /// Backing field for property. + private string _required; + + /// + /// The indicator of if the feature is required or optional. Optional features may be deleted by the user, while required + /// features are managed with the kubernetes cluster lifecycle. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string Required { get => this._required; } + + /// Backing field for property. + private string _version; + + /// The version of the feature. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string Version { get => this._version; } + + /// Creates an new instance. + public KubernetesClusterFeatureProperties() + { + + } + } + /// KubernetesClusterFeatureProperties represents the properties of a Kubernetes cluster feature. + public partial interface IKubernetesClusterFeatureProperties : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable + { + /// The lifecycle indicator of the feature. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The lifecycle indicator of the feature.", + SerializedName = @"availabilityLifecycle", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Preview", "GenerallyAvailable")] + string AvailabilityLifecycle { get; } + /// The detailed status of the feature. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The detailed status of the feature.", + SerializedName = @"detailedStatus", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Error", "Provisioning", "Installed")] + string DetailedStatus { get; } + /// The descriptive message for the detailed status of the feature. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The descriptive message for the detailed status of the feature.", + SerializedName = @"detailedStatusMessage", + PossibleTypes = new [] { typeof(string) })] + string DetailedStatusMessage { get; } + /// The configured options for the feature. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The configured options for the feature.", + SerializedName = @"options", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStringKeyValuePair) })] + System.Collections.Generic.List Option { get; set; } + /// The provisioning state of the Kubernetes cluster feature. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The provisioning state of the Kubernetes cluster feature.", + SerializedName = @"provisioningState", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Accepted", "Canceled", "Deleting", "Failed", "Succeeded", "Updating")] + string ProvisioningState { get; } + /// + /// The indicator of if the feature is required or optional. Optional features may be deleted by the user, while required + /// features are managed with the kubernetes cluster lifecycle. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The indicator of if the feature is required or optional. Optional features may be deleted by the user, while required features are managed with the kubernetes cluster lifecycle.", + SerializedName = @"required", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("True", "False")] + string Required { get; } + /// The version of the feature. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The version of the feature.", + SerializedName = @"version", + PossibleTypes = new [] { typeof(string) })] + string Version { get; } + + } + /// KubernetesClusterFeatureProperties represents the properties of a Kubernetes cluster feature. + internal partial interface IKubernetesClusterFeaturePropertiesInternal + + { + /// The lifecycle indicator of the feature. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Preview", "GenerallyAvailable")] + string AvailabilityLifecycle { get; set; } + /// The detailed status of the feature. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Error", "Provisioning", "Installed")] + string DetailedStatus { get; set; } + /// The descriptive message for the detailed status of the feature. + string DetailedStatusMessage { get; set; } + /// The configured options for the feature. + System.Collections.Generic.List Option { get; set; } + /// The provisioning state of the Kubernetes cluster feature. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Accepted", "Canceled", "Deleting", "Failed", "Succeeded", "Updating")] + string ProvisioningState { get; set; } + /// + /// The indicator of if the feature is required or optional. Optional features may be deleted by the user, while required + /// features are managed with the kubernetes cluster lifecycle. + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("True", "False")] + string Required { get; set; } + /// The version of the feature. + string Version { get; set; } + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesClusterFeatureProperties.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesClusterFeatureProperties.json.cs similarity index 87% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesClusterFeatureProperties.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesClusterFeatureProperties.json.cs index a9a2a1255499..49c8eeade474 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesClusterFeatureProperties.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesClusterFeatureProperties.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -56,13 +56,13 @@ public partial class KubernetesClusterFeatureProperties partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeatureProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeatureProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeatureProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeatureProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeatureProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeatureProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new KubernetesClusterFeatureProperties(json) : null; } @@ -79,13 +79,13 @@ internal KubernetesClusterFeatureProperties(Microsoft.Azure.PowerShell.Cmdlets.N { return; } - {_availabilityLifecycle = If( json?.PropertyT("availabilityLifecycle"), out var __jsonAvailabilityLifecycle) ? (string)__jsonAvailabilityLifecycle : (string)AvailabilityLifecycle;} - {_detailedStatus = If( json?.PropertyT("detailedStatus"), out var __jsonDetailedStatus) ? (string)__jsonDetailedStatus : (string)DetailedStatus;} - {_detailedStatusMessage = If( json?.PropertyT("detailedStatusMessage"), out var __jsonDetailedStatusMessage) ? (string)__jsonDetailedStatusMessage : (string)DetailedStatusMessage;} - {_option = If( json?.PropertyT("options"), out var __jsonOptions) ? If( __jsonOptions as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IStringKeyValuePair) (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.StringKeyValuePair.FromJson(__u) )) ))() : null : Option;} - {_provisioningState = If( json?.PropertyT("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)ProvisioningState;} - {_required = If( json?.PropertyT("required"), out var __jsonRequired) ? (string)__jsonRequired : (string)Required;} - {_version = If( json?.PropertyT("version"), out var __jsonVersion) ? (string)__jsonVersion : (string)Version;} + {_availabilityLifecycle = If( json?.PropertyT("availabilityLifecycle"), out var __jsonAvailabilityLifecycle) ? (string)__jsonAvailabilityLifecycle : (string)_availabilityLifecycle;} + {_detailedStatus = If( json?.PropertyT("detailedStatus"), out var __jsonDetailedStatus) ? (string)__jsonDetailedStatus : (string)_detailedStatus;} + {_detailedStatusMessage = If( json?.PropertyT("detailedStatusMessage"), out var __jsonDetailedStatusMessage) ? (string)__jsonDetailedStatusMessage : (string)_detailedStatusMessage;} + {_option = If( json?.PropertyT("options"), out var __jsonOptions) ? If( __jsonOptions as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.IStringKeyValuePair) (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.StringKeyValuePair.FromJson(__u) )) ))() : null : _option;} + {_provisioningState = If( json?.PropertyT("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)_provisioningState;} + {_required = If( json?.PropertyT("required"), out var __jsonRequired) ? (string)__jsonRequired : (string)_required;} + {_version = If( json?.PropertyT("version"), out var __jsonVersion) ? (string)__jsonVersion : (string)_version;} AfterFromJson(json); } @@ -109,15 +109,15 @@ public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode ToJ { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._availabilityLifecycle)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._availabilityLifecycle.ToString()) : null, "availabilityLifecycle" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._detailedStatus)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._detailedStatus.ToString()) : null, "detailedStatus" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._detailedStatusMessage)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._detailedStatusMessage.ToString()) : null, "detailedStatusMessage" ,container.Add ); } @@ -130,15 +130,15 @@ public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode ToJ } container.Add("options",__w); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._provisioningState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._provisioningState.ToString()) : null, "provisioningState" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._required)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._required.ToString()) : null, "required" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._version)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._version.ToString()) : null, "version" ,container.Add ); } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesClusterList.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesClusterList.PowerShell.cs similarity index 76% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesClusterList.PowerShell.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesClusterList.PowerShell.cs index 53a483ca3058..69c9a8ef50bf 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesClusterList.PowerShell.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesClusterList.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; @@ -63,27 +63,27 @@ public partial class KubernetesClusterList 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.NetworkCloud.Models.Api20250201.IKubernetesClusterList DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterList DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new KubernetesClusterList(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.NetworkCloud.Models.Api20250201.IKubernetesClusterList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new KubernetesClusterList(content); } @@ -93,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 KubernetesClusterList(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterListInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterListInternal)this).NextLink, global::System.Convert.ToString); } if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesCluster[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.KubernetesClusterTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterListInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterListInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.KubernetesClusterTypeConverter.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,11 +136,11 @@ internal KubernetesClusterList(global::System.Management.Automation.PSObject con // actually deserialize if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterListInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterListInternal)this).NextLink, global::System.Convert.ToString); } if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesCluster[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.KubernetesClusterTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterListInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterListInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.KubernetesClusterTypeConverter.ConvertFrom)); } AfterDeserializePSObject(content); } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesClusterList.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesClusterList.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesClusterList.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesClusterList.TypeConverter.cs index b2172f219316..bc34a1c3a5f6 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesClusterList.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesClusterList.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IKubernetesClusterList ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterList ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterList).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterList).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesClusterList.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesClusterList.cs similarity index 75% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesClusterList.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesClusterList.cs index c00cad8779c9..878309a2f9da 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesClusterList.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesClusterList.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; /// KubernetesClusterList represents a list of Kubernetes clusters. public partial class KubernetesClusterList : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterList, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterListInternal + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterList, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterListInternal { /// Backing field for property. @@ -21,11 +21,11 @@ public partial class KubernetesClusterList : public string NextLink { get => this._nextLink; set => this._nextLink = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesCluster[] _value; + private System.Collections.Generic.List _value; /// The list of additional details related to Kubernetes clusters. [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesCluster[] 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 KubernetesClusterList() @@ -41,6 +41,9 @@ public partial interface IKubernetesClusterList : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The link used to get the next page of operations.", SerializedName = @"nextLink", PossibleTypes = new [] { typeof(string) })] @@ -49,10 +52,13 @@ public partial interface IKubernetesClusterList : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The list of additional details related to Kubernetes clusters.", SerializedName = @"value", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesCluster) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesCluster[] Value { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesCluster) })] + System.Collections.Generic.List Value { get; set; } } /// KubernetesClusterList represents a list of Kubernetes clusters. @@ -62,7 +68,7 @@ internal partial interface IKubernetesClusterListInternal /// The link used to get the next page of operations. string NextLink { get; set; } /// The list of additional details related to Kubernetes clusters. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesCluster[] Value { get; set; } + System.Collections.Generic.List Value { get; set; } } } \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesClusterList.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesClusterList.json.cs similarity index 90% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesClusterList.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesClusterList.json.cs index c431651f1e0b..9c8aa7e76d1c 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesClusterList.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesClusterList.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class KubernetesClusterList partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterList. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterList. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterList. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterList. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterList FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterList FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new KubernetesClusterList(json) : null; } @@ -77,8 +77,8 @@ internal KubernetesClusterList(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.R { return; } - {_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.NetworkCloud.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.NetworkCloud.Models.Api20250201.IKubernetesCluster) (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.KubernetesCluster.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.NetworkCloud.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.NetworkCloud.Models.IKubernetesCluster) (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.KubernetesCluster.FromJson(__u) )) ))() : null : _value;} AfterFromJson(json); } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesClusterNode.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesClusterNode.PowerShell.cs new file mode 100644 index 000000000000..d4a17d3158d7 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesClusterNode.PowerShell.cs @@ -0,0 +1,300 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + + /// KubernetesClusterNode represents the details of a node in a Kubernetes cluster. + [System.ComponentModel.TypeConverter(typeof(KubernetesClusterNodeTypeConverter))] + public partial class KubernetesClusterNode + { + + /// + /// 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.NetworkCloud.Models.IKubernetesClusterNode DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new KubernetesClusterNode(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.NetworkCloud.Models.IKubernetesClusterNode DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new KubernetesClusterNode(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.NetworkCloud.Models.IKubernetesClusterNode FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal KubernetesClusterNode(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("AgentPoolId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterNodeInternal)this).AgentPoolId = (string) content.GetValueForProperty("AgentPoolId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterNodeInternal)this).AgentPoolId, global::System.Convert.ToString); + } + if (content.Contains("AvailabilityZone")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterNodeInternal)this).AvailabilityZone = (string) content.GetValueForProperty("AvailabilityZone",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterNodeInternal)this).AvailabilityZone, global::System.Convert.ToString); + } + if (content.Contains("BareMetalMachineId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterNodeInternal)this).BareMetalMachineId = (string) content.GetValueForProperty("BareMetalMachineId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterNodeInternal)this).BareMetalMachineId, global::System.Convert.ToString); + } + if (content.Contains("CpuCore")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterNodeInternal)this).CpuCore = (long?) content.GetValueForProperty("CpuCore",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterNodeInternal)this).CpuCore, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("DetailedStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterNodeInternal)this).DetailedStatus = (string) content.GetValueForProperty("DetailedStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterNodeInternal)this).DetailedStatus, global::System.Convert.ToString); + } + if (content.Contains("DetailedStatusMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterNodeInternal)this).DetailedStatusMessage = (string) content.GetValueForProperty("DetailedStatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterNodeInternal)this).DetailedStatusMessage, global::System.Convert.ToString); + } + if (content.Contains("DiskSizeGb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterNodeInternal)this).DiskSizeGb = (long?) content.GetValueForProperty("DiskSizeGb",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterNodeInternal)this).DiskSizeGb, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("Image")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterNodeInternal)this).Image = (string) content.GetValueForProperty("Image",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterNodeInternal)this).Image, global::System.Convert.ToString); + } + if (content.Contains("KubernetesVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterNodeInternal)this).KubernetesVersion = (string) content.GetValueForProperty("KubernetesVersion",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterNodeInternal)this).KubernetesVersion, global::System.Convert.ToString); + } + if (content.Contains("Label")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterNodeInternal)this).Label = (System.Collections.Generic.List) content.GetValueForProperty("Label",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterNodeInternal)this).Label, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.KubernetesLabelTypeConverter.ConvertFrom)); + } + if (content.Contains("MemorySizeGb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterNodeInternal)this).MemorySizeGb = (long?) content.GetValueForProperty("MemorySizeGb",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterNodeInternal)this).MemorySizeGb, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("Mode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterNodeInternal)this).Mode = (string) content.GetValueForProperty("Mode",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterNodeInternal)this).Mode, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterNodeInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterNodeInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("NetworkAttachment")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterNodeInternal)this).NetworkAttachment = (System.Collections.Generic.List) content.GetValueForProperty("NetworkAttachment",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterNodeInternal)this).NetworkAttachment, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.NetworkAttachmentTypeConverter.ConvertFrom)); + } + if (content.Contains("PowerState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterNodeInternal)this).PowerState = (string) content.GetValueForProperty("PowerState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterNodeInternal)this).PowerState, global::System.Convert.ToString); + } + if (content.Contains("Role")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterNodeInternal)this).Role = (string) content.GetValueForProperty("Role",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterNodeInternal)this).Role, global::System.Convert.ToString); + } + if (content.Contains("Taint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterNodeInternal)this).Taint = (System.Collections.Generic.List) content.GetValueForProperty("Taint",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterNodeInternal)this).Taint, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.KubernetesLabelTypeConverter.ConvertFrom)); + } + if (content.Contains("VMSkuName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterNodeInternal)this).VMSkuName = (string) content.GetValueForProperty("VMSkuName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterNodeInternal)this).VMSkuName, 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 KubernetesClusterNode(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("AgentPoolId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterNodeInternal)this).AgentPoolId = (string) content.GetValueForProperty("AgentPoolId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterNodeInternal)this).AgentPoolId, global::System.Convert.ToString); + } + if (content.Contains("AvailabilityZone")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterNodeInternal)this).AvailabilityZone = (string) content.GetValueForProperty("AvailabilityZone",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterNodeInternal)this).AvailabilityZone, global::System.Convert.ToString); + } + if (content.Contains("BareMetalMachineId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterNodeInternal)this).BareMetalMachineId = (string) content.GetValueForProperty("BareMetalMachineId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterNodeInternal)this).BareMetalMachineId, global::System.Convert.ToString); + } + if (content.Contains("CpuCore")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterNodeInternal)this).CpuCore = (long?) content.GetValueForProperty("CpuCore",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterNodeInternal)this).CpuCore, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("DetailedStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterNodeInternal)this).DetailedStatus = (string) content.GetValueForProperty("DetailedStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterNodeInternal)this).DetailedStatus, global::System.Convert.ToString); + } + if (content.Contains("DetailedStatusMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterNodeInternal)this).DetailedStatusMessage = (string) content.GetValueForProperty("DetailedStatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterNodeInternal)this).DetailedStatusMessage, global::System.Convert.ToString); + } + if (content.Contains("DiskSizeGb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterNodeInternal)this).DiskSizeGb = (long?) content.GetValueForProperty("DiskSizeGb",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterNodeInternal)this).DiskSizeGb, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("Image")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterNodeInternal)this).Image = (string) content.GetValueForProperty("Image",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterNodeInternal)this).Image, global::System.Convert.ToString); + } + if (content.Contains("KubernetesVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterNodeInternal)this).KubernetesVersion = (string) content.GetValueForProperty("KubernetesVersion",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterNodeInternal)this).KubernetesVersion, global::System.Convert.ToString); + } + if (content.Contains("Label")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterNodeInternal)this).Label = (System.Collections.Generic.List) content.GetValueForProperty("Label",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterNodeInternal)this).Label, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.KubernetesLabelTypeConverter.ConvertFrom)); + } + if (content.Contains("MemorySizeGb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterNodeInternal)this).MemorySizeGb = (long?) content.GetValueForProperty("MemorySizeGb",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterNodeInternal)this).MemorySizeGb, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("Mode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterNodeInternal)this).Mode = (string) content.GetValueForProperty("Mode",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterNodeInternal)this).Mode, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterNodeInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterNodeInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("NetworkAttachment")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterNodeInternal)this).NetworkAttachment = (System.Collections.Generic.List) content.GetValueForProperty("NetworkAttachment",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterNodeInternal)this).NetworkAttachment, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.NetworkAttachmentTypeConverter.ConvertFrom)); + } + if (content.Contains("PowerState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterNodeInternal)this).PowerState = (string) content.GetValueForProperty("PowerState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterNodeInternal)this).PowerState, global::System.Convert.ToString); + } + if (content.Contains("Role")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterNodeInternal)this).Role = (string) content.GetValueForProperty("Role",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterNodeInternal)this).Role, global::System.Convert.ToString); + } + if (content.Contains("Taint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterNodeInternal)this).Taint = (System.Collections.Generic.List) content.GetValueForProperty("Taint",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterNodeInternal)this).Taint, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.KubernetesLabelTypeConverter.ConvertFrom)); + } + if (content.Contains("VMSkuName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterNodeInternal)this).VMSkuName = (string) content.GetValueForProperty("VMSkuName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterNodeInternal)this).VMSkuName, 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.NetworkCloud.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(); + } + } + /// KubernetesClusterNode represents the details of a node in a Kubernetes cluster. + [System.ComponentModel.TypeConverter(typeof(KubernetesClusterNodeTypeConverter))] + public partial interface IKubernetesClusterNode + + { + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesClusterNode.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesClusterNode.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesClusterNode.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesClusterNode.TypeConverter.cs index 0402cee1fea7..f28dc53c3188 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesClusterNode.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesClusterNode.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IKubernetesClusterNode ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterNode ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterNode).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterNode).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesClusterNode.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesClusterNode.cs new file mode 100644 index 000000000000..345c6bd31f49 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesClusterNode.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.NetworkCloud.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + + /// KubernetesClusterNode represents the details of a node in a Kubernetes cluster. + public partial class KubernetesClusterNode : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterNode, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterNodeInternal + { + + /// Backing field for property. + private string _agentPoolId; + + /// + /// The resource ID of the agent pool that this node belongs to. This value is not represented on control plane nodes. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string AgentPoolId { get => this._agentPoolId; } + + /// Backing field for property. + private string _availabilityZone; + + /// The availability zone this node is running within. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string AvailabilityZone { get => this._availabilityZone; } + + /// Backing field for property. + private string _bareMetalMachineId; + + /// The resource ID of the bare metal machine that hosts this node. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string BareMetalMachineId { get => this._bareMetalMachineId; } + + /// Backing field for property. + private long? _cpuCore; + + /// + /// The number of CPU cores configured for this node, derived from the VM SKU specified. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public long? CpuCore { get => this._cpuCore; } + + /// Backing field for property. + private string _detailedStatus; + + /// The detailed state of this node. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string DetailedStatus { get => this._detailedStatus; } + + /// Backing field for property. + private string _detailedStatusMessage; + + /// The descriptive message about the current detailed status. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string DetailedStatusMessage { get => this._detailedStatusMessage; } + + /// Backing field for property. + private long? _diskSizeGb; + + /// + /// The size of the disk configured for this node. Allocations are measured in gibibytes. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public long? DiskSizeGb { get => this._diskSizeGb; } + + /// Backing field for property. + private string _image; + + /// The machine image used to deploy this node. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string Image { get => this._image; } + + /// Backing field for property. + private string _kubernetesVersion; + + /// + /// The currently running version of Kubernetes and bundled features running on this node. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string KubernetesVersion { get => this._kubernetesVersion; } + + /// Backing field for property. + private System.Collections.Generic.List _label; + + /// + /// The list of labels on this node that have been assigned to the agent pool containing this node. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public System.Collections.Generic.List Label { get => this._label; } + + /// Backing field for property. + private long? _memorySizeGb; + + /// + /// The amount of memory configured for this node, derived from the vm SKU specified. Allocations are measured in gibibytes. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public long? MemorySizeGb { get => this._memorySizeGb; } + + /// Internal Acessors for AgentPoolId + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterNodeInternal.AgentPoolId { get => this._agentPoolId; set { {_agentPoolId = value;} } } + + /// Internal Acessors for AvailabilityZone + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterNodeInternal.AvailabilityZone { get => this._availabilityZone; set { {_availabilityZone = value;} } } + + /// Internal Acessors for BareMetalMachineId + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterNodeInternal.BareMetalMachineId { get => this._bareMetalMachineId; set { {_bareMetalMachineId = value;} } } + + /// Internal Acessors for CpuCore + long? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterNodeInternal.CpuCore { get => this._cpuCore; set { {_cpuCore = value;} } } + + /// Internal Acessors for DetailedStatus + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterNodeInternal.DetailedStatus { get => this._detailedStatus; set { {_detailedStatus = value;} } } + + /// Internal Acessors for DetailedStatusMessage + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterNodeInternal.DetailedStatusMessage { get => this._detailedStatusMessage; set { {_detailedStatusMessage = value;} } } + + /// Internal Acessors for DiskSizeGb + long? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterNodeInternal.DiskSizeGb { get => this._diskSizeGb; set { {_diskSizeGb = value;} } } + + /// Internal Acessors for Image + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterNodeInternal.Image { get => this._image; set { {_image = value;} } } + + /// Internal Acessors for KubernetesVersion + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterNodeInternal.KubernetesVersion { get => this._kubernetesVersion; set { {_kubernetesVersion = value;} } } + + /// Internal Acessors for Label + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterNodeInternal.Label { get => this._label; set { {_label = value;} } } + + /// Internal Acessors for MemorySizeGb + long? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterNodeInternal.MemorySizeGb { get => this._memorySizeGb; set { {_memorySizeGb = value;} } } + + /// Internal Acessors for Mode + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterNodeInternal.Mode { get => this._mode; set { {_mode = value;} } } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterNodeInternal.Name { get => this._name; set { {_name = value;} } } + + /// Internal Acessors for NetworkAttachment + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterNodeInternal.NetworkAttachment { get => this._networkAttachment; set { {_networkAttachment = value;} } } + + /// Internal Acessors for PowerState + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterNodeInternal.PowerState { get => this._powerState; set { {_powerState = value;} } } + + /// Internal Acessors for Role + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterNodeInternal.Role { get => this._role; set { {_role = value;} } } + + /// Internal Acessors for Taint + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterNodeInternal.Taint { get => this._taint; set { {_taint = value;} } } + + /// Internal Acessors for VMSkuName + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterNodeInternal.VMSkuName { get => this._vMSkuName; set { {_vMSkuName = value;} } } + + /// Backing field for property. + private string _mode; + + /// + /// The mode of the agent pool containing this node. Not applicable for control plane nodes. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string Mode { get => this._mode; } + + /// Backing field for property. + private string _name; + + /// The name of this node, as realized in the Kubernetes cluster. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string Name { get => this._name; } + + /// Backing field for property. + private System.Collections.Generic.List _networkAttachment; + + /// The NetworkAttachments made to this node. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public System.Collections.Generic.List NetworkAttachment { get => this._networkAttachment; } + + /// Backing field for property. + private string _powerState; + + /// The power state of this node. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string PowerState { get => this._powerState; } + + /// Backing field for property. + private string _role; + + /// The role of this node in the cluster. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string Role { get => this._role; } + + /// Backing field for property. + private System.Collections.Generic.List _taint; + + /// + /// The list of taints that have been assigned to the agent pool containing this node. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public System.Collections.Generic.List Taint { get => this._taint; } + + /// Backing field for property. + private string _vMSkuName; + + /// The VM SKU name that was used to create this cluster node. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string VMSkuName { get => this._vMSkuName; } + + /// Creates an new instance. + public KubernetesClusterNode() + { + + } + } + /// KubernetesClusterNode represents the details of a node in a Kubernetes cluster. + public partial interface IKubernetesClusterNode : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable + { + /// + /// The resource ID of the agent pool that this node belongs to. This value is not represented on control plane nodes. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The resource ID of the agent pool that this node belongs to. This value is not represented on control plane nodes.", + SerializedName = @"agentPoolId", + PossibleTypes = new [] { typeof(string) })] + string AgentPoolId { get; } + /// The availability zone this node is running within. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The availability zone this node is running within.", + SerializedName = @"availabilityZone", + PossibleTypes = new [] { typeof(string) })] + string AvailabilityZone { get; } + /// The resource ID of the bare metal machine that hosts this node. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The resource ID of the bare metal machine that hosts this node.", + SerializedName = @"bareMetalMachineId", + PossibleTypes = new [] { typeof(string) })] + string BareMetalMachineId { get; } + /// + /// The number of CPU cores configured for this node, derived from the VM SKU specified. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The number of CPU cores configured for this node, derived from the VM SKU specified.", + SerializedName = @"cpuCores", + PossibleTypes = new [] { typeof(long) })] + long? CpuCore { get; } + /// The detailed state of this node. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The detailed state of this node.", + SerializedName = @"detailedStatus", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Available", "Error", "Provisioning", "Running", "Scheduling", "Stopped", "Terminating", "Unknown")] + string DetailedStatus { get; } + /// The descriptive message about the current detailed status. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The descriptive message about the current detailed status.", + SerializedName = @"detailedStatusMessage", + PossibleTypes = new [] { typeof(string) })] + string DetailedStatusMessage { get; } + /// + /// The size of the disk configured for this node. Allocations are measured in gibibytes. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The size of the disk configured for this node. Allocations are measured in gibibytes.", + SerializedName = @"diskSizeGB", + PossibleTypes = new [] { typeof(long) })] + long? DiskSizeGb { get; } + /// The machine image used to deploy this node. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The machine image used to deploy this node.", + SerializedName = @"image", + PossibleTypes = new [] { typeof(string) })] + string Image { get; } + /// + /// The currently running version of Kubernetes and bundled features running on this node. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The currently running version of Kubernetes and bundled features running on this node.", + SerializedName = @"kubernetesVersion", + PossibleTypes = new [] { typeof(string) })] + string KubernetesVersion { get; } + /// + /// The list of labels on this node that have been assigned to the agent pool containing this node. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The list of labels on this node that have been assigned to the agent pool containing this node.", + SerializedName = @"labels", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesLabel) })] + System.Collections.Generic.List Label { get; } + /// + /// The amount of memory configured for this node, derived from the vm SKU specified. Allocations are measured in gibibytes. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The amount of memory configured for this node, derived from the vm SKU specified. Allocations are measured in gibibytes.", + SerializedName = @"memorySizeGB", + PossibleTypes = new [] { typeof(long) })] + long? MemorySizeGb { get; } + /// + /// The mode of the agent pool containing this node. Not applicable for control plane nodes. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The mode of the agent pool containing this node. Not applicable for control plane nodes.", + SerializedName = @"mode", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("System", "User", "NotApplicable")] + string Mode { get; } + /// The name of this node, as realized in the Kubernetes cluster. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The name of this node, as realized in the Kubernetes cluster.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string Name { get; } + /// The NetworkAttachments made to this node. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The NetworkAttachments made to this node.", + SerializedName = @"networkAttachments", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkAttachment) })] + System.Collections.Generic.List NetworkAttachment { get; } + /// The power state of this node. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The power state of this node.", + SerializedName = @"powerState", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("On", "Off", "Unknown")] + string PowerState { get; } + /// The role of this node in the cluster. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The role of this node in the cluster.", + SerializedName = @"role", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("ControlPlane", "Worker")] + string Role { get; } + /// + /// The list of taints that have been assigned to the agent pool containing this node. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The list of taints that have been assigned to the agent pool containing this node.", + SerializedName = @"taints", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesLabel) })] + System.Collections.Generic.List Taint { get; } + /// The VM SKU name that was used to create this cluster node. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The VM SKU name that was used to create this cluster node.", + SerializedName = @"vmSkuName", + PossibleTypes = new [] { typeof(string) })] + string VMSkuName { get; } + + } + /// KubernetesClusterNode represents the details of a node in a Kubernetes cluster. + internal partial interface IKubernetesClusterNodeInternal + + { + /// + /// The resource ID of the agent pool that this node belongs to. This value is not represented on control plane nodes. + /// + string AgentPoolId { get; set; } + /// The availability zone this node is running within. + string AvailabilityZone { get; set; } + /// The resource ID of the bare metal machine that hosts this node. + string BareMetalMachineId { get; set; } + /// + /// The number of CPU cores configured for this node, derived from the VM SKU specified. + /// + long? CpuCore { get; set; } + /// The detailed state of this node. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Available", "Error", "Provisioning", "Running", "Scheduling", "Stopped", "Terminating", "Unknown")] + string DetailedStatus { get; set; } + /// The descriptive message about the current detailed status. + string DetailedStatusMessage { get; set; } + /// + /// The size of the disk configured for this node. Allocations are measured in gibibytes. + /// + long? DiskSizeGb { get; set; } + /// The machine image used to deploy this node. + string Image { get; set; } + /// + /// The currently running version of Kubernetes and bundled features running on this node. + /// + string KubernetesVersion { get; set; } + /// + /// The list of labels on this node that have been assigned to the agent pool containing this node. + /// + System.Collections.Generic.List Label { get; set; } + /// + /// The amount of memory configured for this node, derived from the vm SKU specified. Allocations are measured in gibibytes. + /// + long? MemorySizeGb { get; set; } + /// + /// The mode of the agent pool containing this node. Not applicable for control plane nodes. + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("System", "User", "NotApplicable")] + string Mode { get; set; } + /// The name of this node, as realized in the Kubernetes cluster. + string Name { get; set; } + /// The NetworkAttachments made to this node. + System.Collections.Generic.List NetworkAttachment { get; set; } + /// The power state of this node. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("On", "Off", "Unknown")] + string PowerState { get; set; } + /// The role of this node in the cluster. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("ControlPlane", "Worker")] + string Role { get; set; } + /// + /// The list of taints that have been assigned to the agent pool containing this node. + /// + System.Collections.Generic.List Taint { get; set; } + /// The VM SKU name that was used to create this cluster node. + string VMSkuName { get; set; } + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesClusterNode.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesClusterNode.json.cs similarity index 82% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesClusterNode.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesClusterNode.json.cs index 9f125fb3a116..075fed2b8a43 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesClusterNode.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesClusterNode.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class KubernetesClusterNode partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterNode. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterNode. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterNode. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterNode. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterNode FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterNode FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new KubernetesClusterNode(json) : null; } @@ -77,24 +77,24 @@ internal KubernetesClusterNode(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.R { return; } - {_agentPoolId = If( json?.PropertyT("agentPoolId"), out var __jsonAgentPoolId) ? (string)__jsonAgentPoolId : (string)AgentPoolId;} - {_availabilityZone = If( json?.PropertyT("availabilityZone"), out var __jsonAvailabilityZone) ? (string)__jsonAvailabilityZone : (string)AvailabilityZone;} - {_bareMetalMachineId = If( json?.PropertyT("bareMetalMachineId"), out var __jsonBareMetalMachineId) ? (string)__jsonBareMetalMachineId : (string)BareMetalMachineId;} - {_cpuCore = If( json?.PropertyT("cpuCores"), out var __jsonCpuCores) ? (long?)__jsonCpuCores : CpuCore;} - {_detailedStatus = If( json?.PropertyT("detailedStatus"), out var __jsonDetailedStatus) ? (string)__jsonDetailedStatus : (string)DetailedStatus;} - {_detailedStatusMessage = If( json?.PropertyT("detailedStatusMessage"), out var __jsonDetailedStatusMessage) ? (string)__jsonDetailedStatusMessage : (string)DetailedStatusMessage;} - {_diskSizeGb = If( json?.PropertyT("diskSizeGB"), out var __jsonDiskSizeGb) ? (long?)__jsonDiskSizeGb : DiskSizeGb;} - {_image = If( json?.PropertyT("image"), out var __jsonImage) ? (string)__jsonImage : (string)Image;} - {_kubernetesVersion = If( json?.PropertyT("kubernetesVersion"), out var __jsonKubernetesVersion) ? (string)__jsonKubernetesVersion : (string)KubernetesVersion;} - {_label = If( json?.PropertyT("labels"), out var __jsonLabels) ? If( __jsonLabels as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IKubernetesLabel) (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.KubernetesLabel.FromJson(__u) )) ))() : null : Label;} - {_memorySizeGb = If( json?.PropertyT("memorySizeGB"), out var __jsonMemorySizeGb) ? (long?)__jsonMemorySizeGb : MemorySizeGb;} - {_mode = If( json?.PropertyT("mode"), out var __jsonMode) ? (string)__jsonMode : (string)Mode;} - {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} - {_networkAttachment = If( json?.PropertyT("networkAttachments"), out var __jsonNetworkAttachments) ? If( __jsonNetworkAttachments as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.INetworkAttachment) (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.NetworkAttachment.FromJson(__p) )) ))() : null : NetworkAttachment;} - {_powerState = If( json?.PropertyT("powerState"), out var __jsonPowerState) ? (string)__jsonPowerState : (string)PowerState;} - {_role = If( json?.PropertyT("role"), out var __jsonRole) ? (string)__jsonRole : (string)Role;} - {_taint = If( json?.PropertyT("taints"), out var __jsonTaints) ? If( __jsonTaints as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonArray, out var __l) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__l, (__k)=>(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesLabel) (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.KubernetesLabel.FromJson(__k) )) ))() : null : Taint;} - {_vMSkuName = If( json?.PropertyT("vmSkuName"), out var __jsonVMSkuName) ? (string)__jsonVMSkuName : (string)VMSkuName;} + {_agentPoolId = If( json?.PropertyT("agentPoolId"), out var __jsonAgentPoolId) ? (string)__jsonAgentPoolId : (string)_agentPoolId;} + {_availabilityZone = If( json?.PropertyT("availabilityZone"), out var __jsonAvailabilityZone) ? (string)__jsonAvailabilityZone : (string)_availabilityZone;} + {_bareMetalMachineId = If( json?.PropertyT("bareMetalMachineId"), out var __jsonBareMetalMachineId) ? (string)__jsonBareMetalMachineId : (string)_bareMetalMachineId;} + {_cpuCore = If( json?.PropertyT("cpuCores"), out var __jsonCpuCores) ? (long?)__jsonCpuCores : _cpuCore;} + {_detailedStatus = If( json?.PropertyT("detailedStatus"), out var __jsonDetailedStatus) ? (string)__jsonDetailedStatus : (string)_detailedStatus;} + {_detailedStatusMessage = If( json?.PropertyT("detailedStatusMessage"), out var __jsonDetailedStatusMessage) ? (string)__jsonDetailedStatusMessage : (string)_detailedStatusMessage;} + {_diskSizeGb = If( json?.PropertyT("diskSizeGB"), out var __jsonDiskSizeGb) ? (long?)__jsonDiskSizeGb : _diskSizeGb;} + {_image = If( json?.PropertyT("image"), out var __jsonImage) ? (string)__jsonImage : (string)_image;} + {_kubernetesVersion = If( json?.PropertyT("kubernetesVersion"), out var __jsonKubernetesVersion) ? (string)__jsonKubernetesVersion : (string)_kubernetesVersion;} + {_label = If( json?.PropertyT("labels"), out var __jsonLabels) ? If( __jsonLabels as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.IKubernetesLabel) (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.KubernetesLabel.FromJson(__u) )) ))() : null : _label;} + {_memorySizeGb = If( json?.PropertyT("memorySizeGB"), out var __jsonMemorySizeGb) ? (long?)__jsonMemorySizeGb : _memorySizeGb;} + {_mode = If( json?.PropertyT("mode"), out var __jsonMode) ? (string)__jsonMode : (string)_mode;} + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)_name;} + {_networkAttachment = If( json?.PropertyT("networkAttachments"), out var __jsonNetworkAttachments) ? If( __jsonNetworkAttachments as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.INetworkAttachment) (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.NetworkAttachment.FromJson(__p) )) ))() : null : _networkAttachment;} + {_powerState = If( json?.PropertyT("powerState"), out var __jsonPowerState) ? (string)__jsonPowerState : (string)_powerState;} + {_role = If( json?.PropertyT("role"), out var __jsonRole) ? (string)__jsonRole : (string)_role;} + {_taint = If( json?.PropertyT("taints"), out var __jsonTaints) ? If( __jsonTaints as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonArray, out var __l) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__l, (__k)=>(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesLabel) (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.KubernetesLabel.FromJson(__k) )) ))() : null : _taint;} + {_vMSkuName = If( json?.PropertyT("vmSkuName"), out var __jsonVMSkuName) ? (string)__jsonVMSkuName : (string)_vMSkuName;} AfterFromJson(json); } @@ -117,43 +117,43 @@ public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode ToJ { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._agentPoolId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._agentPoolId.ToString()) : null, "agentPoolId" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._availabilityZone)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._availabilityZone.ToString()) : null, "availabilityZone" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._bareMetalMachineId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._bareMetalMachineId.ToString()) : null, "bareMetalMachineId" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != this._cpuCore ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNumber((long)this._cpuCore) : null, "cpuCores" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._detailedStatus)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._detailedStatus.ToString()) : null, "detailedStatus" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._detailedStatusMessage)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._detailedStatusMessage.ToString()) : null, "detailedStatusMessage" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != this._diskSizeGb ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNumber((long)this._diskSizeGb) : null, "diskSizeGB" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._image)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._image.ToString()) : null, "image" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._kubernetesVersion)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._kubernetesVersion.ToString()) : null, "kubernetesVersion" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { if (null != this._label) { @@ -165,19 +165,19 @@ public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode ToJ container.Add("labels",__w); } } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != this._memorySizeGb ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNumber((long)this._memorySizeGb) : null, "memorySizeGB" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._mode)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._mode.ToString()) : null, "mode" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { if (null != this._networkAttachment) { @@ -189,15 +189,15 @@ public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode ToJ container.Add("networkAttachments",__r); } } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._powerState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._powerState.ToString()) : null, "powerState" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._role)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._role.ToString()) : null, "role" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { if (null != this._taint) { @@ -209,7 +209,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode ToJ container.Add("taints",__m); } } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._vMSkuName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._vMSkuName.ToString()) : null, "vmSkuName" ,container.Add ); } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesClusterPatchParameters.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesClusterPatchParameters.PowerShell.cs new file mode 100644 index 000000000000..42f6a7905e90 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesClusterPatchParameters.PowerShell.cs @@ -0,0 +1,230 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + + /// + /// KubernetesClusterPatchParameters represents the body of the request to patch the Hybrid AKS cluster. + /// + [System.ComponentModel.TypeConverter(typeof(KubernetesClusterPatchParametersTypeConverter))] + public partial class KubernetesClusterPatchParameters + { + + /// + /// 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.NetworkCloud.Models.IKubernetesClusterPatchParameters DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new KubernetesClusterPatchParameters(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.NetworkCloud.Models.IKubernetesClusterPatchParameters DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new KubernetesClusterPatchParameters(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.NetworkCloud.Models.IKubernetesClusterPatchParameters FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal KubernetesClusterPatchParameters(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.NetworkCloud.Models.IKubernetesClusterPatchParametersInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPatchProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPatchParametersInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.KubernetesClusterPatchPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPatchParametersInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPatchParametersTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPatchParametersInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.KubernetesClusterPatchParametersTagsTypeConverter.ConvertFrom); + } + if (content.Contains("AdministratorConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPatchParametersInternal)this).AdministratorConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministratorConfigurationPatch) content.GetValueForProperty("AdministratorConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPatchParametersInternal)this).AdministratorConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AdministratorConfigurationPatchTypeConverter.ConvertFrom); + } + if (content.Contains("ControlPlaneNodeConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPatchParametersInternal)this).ControlPlaneNodeConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IControlPlaneNodePatchConfiguration) content.GetValueForProperty("ControlPlaneNodeConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPatchParametersInternal)this).ControlPlaneNodeConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ControlPlaneNodePatchConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("KubernetesVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPatchParametersInternal)this).KubernetesVersion = (string) content.GetValueForProperty("KubernetesVersion",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPatchParametersInternal)this).KubernetesVersion, global::System.Convert.ToString); + } + if (content.Contains("SshPublicKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPatchParametersInternal)this).SshPublicKey = (System.Collections.Generic.List) content.GetValueForProperty("SshPublicKey",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPatchParametersInternal)this).SshPublicKey, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.SshPublicKeyTypeConverter.ConvertFrom)); + } + if (content.Contains("ControlPlaneNodeConfigurationAdministratorConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPatchParametersInternal)this).ControlPlaneNodeConfigurationAdministratorConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministratorConfigurationPatch) content.GetValueForProperty("ControlPlaneNodeConfigurationAdministratorConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPatchParametersInternal)this).ControlPlaneNodeConfigurationAdministratorConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AdministratorConfigurationPatchTypeConverter.ConvertFrom); + } + if (content.Contains("ControlPlaneNodeConfigurationCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPatchParametersInternal)this).ControlPlaneNodeConfigurationCount = (long?) content.GetValueForProperty("ControlPlaneNodeConfigurationCount",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPatchParametersInternal)this).ControlPlaneNodeConfigurationCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("ControlPlaneNodeConfigurationAdministratorConfigurationSshPublicKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPatchParametersInternal)this).ControlPlaneNodeConfigurationAdministratorConfigurationSshPublicKey = (System.Collections.Generic.List) content.GetValueForProperty("ControlPlaneNodeConfigurationAdministratorConfigurationSshPublicKey",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPatchParametersInternal)this).ControlPlaneNodeConfigurationAdministratorConfigurationSshPublicKey, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.SshPublicKeyTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal KubernetesClusterPatchParameters(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.NetworkCloud.Models.IKubernetesClusterPatchParametersInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPatchProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPatchParametersInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.KubernetesClusterPatchPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPatchParametersInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPatchParametersTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPatchParametersInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.KubernetesClusterPatchParametersTagsTypeConverter.ConvertFrom); + } + if (content.Contains("AdministratorConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPatchParametersInternal)this).AdministratorConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministratorConfigurationPatch) content.GetValueForProperty("AdministratorConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPatchParametersInternal)this).AdministratorConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AdministratorConfigurationPatchTypeConverter.ConvertFrom); + } + if (content.Contains("ControlPlaneNodeConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPatchParametersInternal)this).ControlPlaneNodeConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IControlPlaneNodePatchConfiguration) content.GetValueForProperty("ControlPlaneNodeConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPatchParametersInternal)this).ControlPlaneNodeConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ControlPlaneNodePatchConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("KubernetesVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPatchParametersInternal)this).KubernetesVersion = (string) content.GetValueForProperty("KubernetesVersion",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPatchParametersInternal)this).KubernetesVersion, global::System.Convert.ToString); + } + if (content.Contains("SshPublicKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPatchParametersInternal)this).SshPublicKey = (System.Collections.Generic.List) content.GetValueForProperty("SshPublicKey",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPatchParametersInternal)this).SshPublicKey, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.SshPublicKeyTypeConverter.ConvertFrom)); + } + if (content.Contains("ControlPlaneNodeConfigurationAdministratorConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPatchParametersInternal)this).ControlPlaneNodeConfigurationAdministratorConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministratorConfigurationPatch) content.GetValueForProperty("ControlPlaneNodeConfigurationAdministratorConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPatchParametersInternal)this).ControlPlaneNodeConfigurationAdministratorConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AdministratorConfigurationPatchTypeConverter.ConvertFrom); + } + if (content.Contains("ControlPlaneNodeConfigurationCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPatchParametersInternal)this).ControlPlaneNodeConfigurationCount = (long?) content.GetValueForProperty("ControlPlaneNodeConfigurationCount",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPatchParametersInternal)this).ControlPlaneNodeConfigurationCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("ControlPlaneNodeConfigurationAdministratorConfigurationSshPublicKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPatchParametersInternal)this).ControlPlaneNodeConfigurationAdministratorConfigurationSshPublicKey = (System.Collections.Generic.List) content.GetValueForProperty("ControlPlaneNodeConfigurationAdministratorConfigurationSshPublicKey",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPatchParametersInternal)this).ControlPlaneNodeConfigurationAdministratorConfigurationSshPublicKey, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.SshPublicKeyTypeConverter.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.NetworkCloud.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(); + } + } + /// KubernetesClusterPatchParameters represents the body of the request to patch the Hybrid AKS cluster. + [System.ComponentModel.TypeConverter(typeof(KubernetesClusterPatchParametersTypeConverter))] + public partial interface IKubernetesClusterPatchParameters + + { + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesClusterPatchParameters.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesClusterPatchParameters.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesClusterPatchParameters.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesClusterPatchParameters.TypeConverter.cs index 26eeecea7e6f..eec297cbb28b 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesClusterPatchParameters.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesClusterPatchParameters.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IKubernetesClusterPatchParameters ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPatchParameters ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPatchParameters).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPatchParameters).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesClusterPatchParameters.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesClusterPatchParameters.cs new file mode 100644 index 000000000000..dc8aa7cb8acc --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesClusterPatchParameters.cs @@ -0,0 +1,165 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + + /// + /// KubernetesClusterPatchParameters represents the body of the request to patch the Hybrid AKS cluster. + /// + public partial class KubernetesClusterPatchParameters : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPatchParameters, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPatchParametersInternal + { + + /// + /// SshPublicKey represents the public key used to authenticate with a resource through SSH. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public System.Collections.Generic.List ControlPlaneNodeConfigurationAdministratorConfigurationSshPublicKey { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPatchPropertiesInternal)Property).ControlPlaneNodeConfigurationAdministratorConfigurationSshPublicKey; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPatchPropertiesInternal)Property).ControlPlaneNodeConfigurationAdministratorConfigurationSshPublicKey = value ?? null /* arrayOf */; } + + /// The number of virtual machines that use this configuration. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public long? ControlPlaneNodeConfigurationCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPatchPropertiesInternal)Property).ControlPlaneNodeConfigurationCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPatchPropertiesInternal)Property).ControlPlaneNodeConfigurationCount = value ?? default(long); } + + /// The Kubernetes version for this cluster. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string KubernetesVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPatchPropertiesInternal)Property).KubernetesVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPatchPropertiesInternal)Property).KubernetesVersion = value ?? null; } + + /// Internal Acessors for AdministratorConfiguration + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministratorConfigurationPatch Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPatchParametersInternal.AdministratorConfiguration { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPatchPropertiesInternal)Property).AdministratorConfiguration; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPatchPropertiesInternal)Property).AdministratorConfiguration = value ?? null /* model class */; } + + /// Internal Acessors for ControlPlaneNodeConfiguration + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IControlPlaneNodePatchConfiguration Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPatchParametersInternal.ControlPlaneNodeConfiguration { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPatchPropertiesInternal)Property).ControlPlaneNodeConfiguration; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPatchPropertiesInternal)Property).ControlPlaneNodeConfiguration = value ?? null /* model class */; } + + /// Internal Acessors for ControlPlaneNodeConfigurationAdministratorConfiguration + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministratorConfigurationPatch Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPatchParametersInternal.ControlPlaneNodeConfigurationAdministratorConfiguration { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPatchPropertiesInternal)Property).ControlPlaneNodeConfigurationAdministratorConfiguration; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPatchPropertiesInternal)Property).ControlPlaneNodeConfigurationAdministratorConfiguration = value ?? null /* model class */; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPatchProperties Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPatchParametersInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.KubernetesClusterPatchProperties()); set { {_property = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPatchProperties _property; + + /// The list of the resource properties. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPatchProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.KubernetesClusterPatchProperties()); set => this._property = value; } + + /// + /// SshPublicKey represents the public key used to authenticate with a resource through SSH. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public System.Collections.Generic.List SshPublicKey { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPatchPropertiesInternal)Property).SshPublicKey; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPatchPropertiesInternal)Property).SshPublicKey = value ?? null /* arrayOf */; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPatchParametersTags _tag; + + /// The Azure resource tags that will replace the existing ones. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPatchParametersTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.KubernetesClusterPatchParametersTags()); set => this._tag = value; } + + /// Creates an new instance. + public KubernetesClusterPatchParameters() + { + + } + } + /// KubernetesClusterPatchParameters represents the body of the request to patch the Hybrid AKS cluster. + public partial interface IKubernetesClusterPatchParameters : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable + { + /// + /// SshPublicKey represents the public key used to authenticate with a resource through SSH. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"SshPublicKey represents the public key used to authenticate with a resource through SSH.", + SerializedName = @"sshPublicKeys", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISshPublicKey) })] + System.Collections.Generic.List ControlPlaneNodeConfigurationAdministratorConfigurationSshPublicKey { get; set; } + /// The number of virtual machines that use this configuration. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The number of virtual machines that use this configuration.", + SerializedName = @"count", + PossibleTypes = new [] { typeof(long) })] + long? ControlPlaneNodeConfigurationCount { get; set; } + /// The Kubernetes version for this cluster. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The Kubernetes version for this cluster.", + SerializedName = @"kubernetesVersion", + PossibleTypes = new [] { typeof(string) })] + string KubernetesVersion { get; set; } + /// + /// SshPublicKey represents the public key used to authenticate with a resource through SSH. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"SshPublicKey represents the public key used to authenticate with a resource through SSH.", + SerializedName = @"sshPublicKeys", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISshPublicKey) })] + System.Collections.Generic.List SshPublicKey { get; set; } + /// The Azure resource tags that will replace the existing ones. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The Azure resource tags that will replace the existing ones.", + SerializedName = @"tags", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPatchParametersTags) })] + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPatchParametersTags Tag { get; set; } + + } + /// KubernetesClusterPatchParameters represents the body of the request to patch the Hybrid AKS cluster. + internal partial interface IKubernetesClusterPatchParametersInternal + + { + /// The configuration of the default administrator credentials. + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministratorConfigurationPatch AdministratorConfiguration { get; set; } + /// + /// The defining characteristics of the control plane that can be patched for this Kubernetes cluster. + /// + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IControlPlaneNodePatchConfiguration ControlPlaneNodeConfiguration { get; set; } + /// The configuration of administrator credentials for the control plane nodes. + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministratorConfigurationPatch ControlPlaneNodeConfigurationAdministratorConfiguration { get; set; } + /// + /// SshPublicKey represents the public key used to authenticate with a resource through SSH. + /// + System.Collections.Generic.List ControlPlaneNodeConfigurationAdministratorConfigurationSshPublicKey { get; set; } + /// The number of virtual machines that use this configuration. + long? ControlPlaneNodeConfigurationCount { get; set; } + /// The Kubernetes version for this cluster. + string KubernetesVersion { get; set; } + /// The list of the resource properties. + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPatchProperties Property { get; set; } + /// + /// SshPublicKey represents the public key used to authenticate with a resource through SSH. + /// + System.Collections.Generic.List SshPublicKey { get; set; } + /// The Azure resource tags that will replace the existing ones. + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPatchParametersTags Tag { get; set; } + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesClusterPatchParameters.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesClusterPatchParameters.json.cs similarity index 93% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesClusterPatchParameters.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesClusterPatchParameters.json.cs index eed80327dce2..8a4e0f053f38 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesClusterPatchParameters.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesClusterPatchParameters.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -56,13 +56,13 @@ public partial class KubernetesClusterPatchParameters partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPatchParameters. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPatchParameters. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPatchParameters. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPatchParameters. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPatchParameters FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPatchParameters FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new KubernetesClusterPatchParameters(json) : null; } @@ -79,8 +79,8 @@ internal KubernetesClusterPatchParameters(Microsoft.Azure.PowerShell.Cmdlets.Net { return; } - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.KubernetesClusterPatchProperties.FromJson(__jsonProperties) : Property;} - {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.KubernetesClusterPatchParametersTags.FromJson(__jsonTags) : Tag;} + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.KubernetesClusterPatchProperties.FromJson(__jsonProperties) : _property;} + {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.KubernetesClusterPatchParametersTags.FromJson(__jsonTags) : _tag;} AfterFromJson(json); } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesClusterPatchParametersTags.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesClusterPatchParametersTags.PowerShell.cs similarity index 89% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesClusterPatchParametersTags.PowerShell.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesClusterPatchParametersTags.PowerShell.cs index 013a3a4b66e3..514a7a320581 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesClusterPatchParametersTags.PowerShell.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesClusterPatchParametersTags.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; @@ -63,29 +63,29 @@ public partial class KubernetesClusterPatchParametersTags 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.NetworkCloud.Models.Api20250201.IKubernetesClusterPatchParametersTags DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPatchParametersTags DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new KubernetesClusterPatchParametersTags(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.NetworkCloud.Models.Api20250201.IKubernetesClusterPatchParametersTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPatchParametersTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new KubernetesClusterPatchParametersTags(content); } @@ -97,10 +97,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201 /// /// an instance of the model class. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPatchParametersTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPatchParametersTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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. @@ -119,7 +119,7 @@ internal KubernetesClusterPatchParametersTags(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/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesClusterPatchParametersTags.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesClusterPatchParametersTags.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesClusterPatchParametersTags.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesClusterPatchParametersTags.TypeConverter.cs index abf2ec6cb033..e5f25d6ca7b3 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesClusterPatchParametersTags.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesClusterPatchParametersTags.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IKubernetesClusterPatchParametersTags ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPatchParametersTags ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPatchParametersTags).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPatchParametersTags).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesClusterPatchParametersTags.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesClusterPatchParametersTags.cs similarity index 83% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesClusterPatchParametersTags.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesClusterPatchParametersTags.cs index 58e55e7a38ed..a0429ff63a3f 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesClusterPatchParametersTags.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesClusterPatchParametersTags.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; /// The Azure resource tags that will replace the existing ones. public partial class KubernetesClusterPatchParametersTags : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPatchParametersTags, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPatchParametersTagsInternal + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPatchParametersTags, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPatchParametersTagsInternal { /// Creates an new instance. diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesClusterPatchParametersTags.dictionary.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesClusterPatchParametersTags.dictionary.cs similarity index 96% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesClusterPatchParametersTags.dictionary.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesClusterPatchParametersTags.dictionary.cs index a1eaae304729..c266394aa5c6 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesClusterPatchParametersTags.dictionary.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesClusterPatchParametersTags.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.KubernetesClusterPatchParametersTags source) => source.__additionalProperties; + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.KubernetesClusterPatchParametersTags source) => source.__additionalProperties; } } \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesClusterPatchParametersTags.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesClusterPatchParametersTags.json.cs similarity index 95% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesClusterPatchParametersTags.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesClusterPatchParametersTags.json.cs index 2351c2e9abcb..39345f9233e2 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesClusterPatchParametersTags.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesClusterPatchParametersTags.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class KubernetesClusterPatchParametersTags partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPatchParametersTags. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPatchParametersTags. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPatchParametersTags. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPatchParametersTags. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPatchParametersTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPatchParametersTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new KubernetesClusterPatchParametersTags(json) : null; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesClusterPatchProperties.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesClusterPatchProperties.PowerShell.cs new file mode 100644 index 000000000000..32958e9ba68d --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesClusterPatchProperties.PowerShell.cs @@ -0,0 +1,214 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + + /// + /// KubernetesClusterPatchProperties represents the properties of the Kubernetes cluster that can be patched. + /// + [System.ComponentModel.TypeConverter(typeof(KubernetesClusterPatchPropertiesTypeConverter))] + public partial class KubernetesClusterPatchProperties + { + + /// + /// 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.NetworkCloud.Models.IKubernetesClusterPatchProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new KubernetesClusterPatchProperties(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.NetworkCloud.Models.IKubernetesClusterPatchProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new KubernetesClusterPatchProperties(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.NetworkCloud.Models.IKubernetesClusterPatchProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal KubernetesClusterPatchProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("AdministratorConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPatchPropertiesInternal)this).AdministratorConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministratorConfigurationPatch) content.GetValueForProperty("AdministratorConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPatchPropertiesInternal)this).AdministratorConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AdministratorConfigurationPatchTypeConverter.ConvertFrom); + } + if (content.Contains("ControlPlaneNodeConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPatchPropertiesInternal)this).ControlPlaneNodeConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IControlPlaneNodePatchConfiguration) content.GetValueForProperty("ControlPlaneNodeConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPatchPropertiesInternal)this).ControlPlaneNodeConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ControlPlaneNodePatchConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("KubernetesVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPatchPropertiesInternal)this).KubernetesVersion = (string) content.GetValueForProperty("KubernetesVersion",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPatchPropertiesInternal)this).KubernetesVersion, global::System.Convert.ToString); + } + if (content.Contains("SshPublicKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPatchPropertiesInternal)this).SshPublicKey = (System.Collections.Generic.List) content.GetValueForProperty("SshPublicKey",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPatchPropertiesInternal)this).SshPublicKey, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.SshPublicKeyTypeConverter.ConvertFrom)); + } + if (content.Contains("ControlPlaneNodeConfigurationAdministratorConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPatchPropertiesInternal)this).ControlPlaneNodeConfigurationAdministratorConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministratorConfigurationPatch) content.GetValueForProperty("ControlPlaneNodeConfigurationAdministratorConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPatchPropertiesInternal)this).ControlPlaneNodeConfigurationAdministratorConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AdministratorConfigurationPatchTypeConverter.ConvertFrom); + } + if (content.Contains("ControlPlaneNodeConfigurationCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPatchPropertiesInternal)this).ControlPlaneNodeConfigurationCount = (long?) content.GetValueForProperty("ControlPlaneNodeConfigurationCount",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPatchPropertiesInternal)this).ControlPlaneNodeConfigurationCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("ControlPlaneNodeConfigurationAdministratorConfigurationSshPublicKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPatchPropertiesInternal)this).ControlPlaneNodeConfigurationAdministratorConfigurationSshPublicKey = (System.Collections.Generic.List) content.GetValueForProperty("ControlPlaneNodeConfigurationAdministratorConfigurationSshPublicKey",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPatchPropertiesInternal)this).ControlPlaneNodeConfigurationAdministratorConfigurationSshPublicKey, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.SshPublicKeyTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal KubernetesClusterPatchProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("AdministratorConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPatchPropertiesInternal)this).AdministratorConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministratorConfigurationPatch) content.GetValueForProperty("AdministratorConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPatchPropertiesInternal)this).AdministratorConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AdministratorConfigurationPatchTypeConverter.ConvertFrom); + } + if (content.Contains("ControlPlaneNodeConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPatchPropertiesInternal)this).ControlPlaneNodeConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IControlPlaneNodePatchConfiguration) content.GetValueForProperty("ControlPlaneNodeConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPatchPropertiesInternal)this).ControlPlaneNodeConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ControlPlaneNodePatchConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("KubernetesVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPatchPropertiesInternal)this).KubernetesVersion = (string) content.GetValueForProperty("KubernetesVersion",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPatchPropertiesInternal)this).KubernetesVersion, global::System.Convert.ToString); + } + if (content.Contains("SshPublicKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPatchPropertiesInternal)this).SshPublicKey = (System.Collections.Generic.List) content.GetValueForProperty("SshPublicKey",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPatchPropertiesInternal)this).SshPublicKey, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.SshPublicKeyTypeConverter.ConvertFrom)); + } + if (content.Contains("ControlPlaneNodeConfigurationAdministratorConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPatchPropertiesInternal)this).ControlPlaneNodeConfigurationAdministratorConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministratorConfigurationPatch) content.GetValueForProperty("ControlPlaneNodeConfigurationAdministratorConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPatchPropertiesInternal)this).ControlPlaneNodeConfigurationAdministratorConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AdministratorConfigurationPatchTypeConverter.ConvertFrom); + } + if (content.Contains("ControlPlaneNodeConfigurationCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPatchPropertiesInternal)this).ControlPlaneNodeConfigurationCount = (long?) content.GetValueForProperty("ControlPlaneNodeConfigurationCount",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPatchPropertiesInternal)this).ControlPlaneNodeConfigurationCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("ControlPlaneNodeConfigurationAdministratorConfigurationSshPublicKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPatchPropertiesInternal)this).ControlPlaneNodeConfigurationAdministratorConfigurationSshPublicKey = (System.Collections.Generic.List) content.GetValueForProperty("ControlPlaneNodeConfigurationAdministratorConfigurationSshPublicKey",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPatchPropertiesInternal)this).ControlPlaneNodeConfigurationAdministratorConfigurationSshPublicKey, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.SshPublicKeyTypeConverter.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.NetworkCloud.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(); + } + } + /// KubernetesClusterPatchProperties represents the properties of the Kubernetes cluster that can be patched. + [System.ComponentModel.TypeConverter(typeof(KubernetesClusterPatchPropertiesTypeConverter))] + public partial interface IKubernetesClusterPatchProperties + + { + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesClusterPatchProperties.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesClusterPatchProperties.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesClusterPatchProperties.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesClusterPatchProperties.TypeConverter.cs index 047dbf0c28a3..7e9ed4024c65 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesClusterPatchProperties.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesClusterPatchProperties.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IKubernetesClusterPatchProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPatchProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPatchProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPatchProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesClusterPatchProperties.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesClusterPatchProperties.cs new file mode 100644 index 000000000000..63c6572b4b5f --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesClusterPatchProperties.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + + /// + /// KubernetesClusterPatchProperties represents the properties of the Kubernetes cluster that can be patched. + /// + public partial class KubernetesClusterPatchProperties : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPatchProperties, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPatchPropertiesInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministratorConfigurationPatch _administratorConfiguration; + + /// The configuration of the default administrator credentials. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministratorConfigurationPatch AdministratorConfiguration { get => (this._administratorConfiguration = this._administratorConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AdministratorConfigurationPatch()); set => this._administratorConfiguration = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IControlPlaneNodePatchConfiguration _controlPlaneNodeConfiguration; + + /// + /// The defining characteristics of the control plane that can be patched for this Kubernetes cluster. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IControlPlaneNodePatchConfiguration ControlPlaneNodeConfiguration { get => (this._controlPlaneNodeConfiguration = this._controlPlaneNodeConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ControlPlaneNodePatchConfiguration()); set => this._controlPlaneNodeConfiguration = value; } + + /// + /// SshPublicKey represents the public key used to authenticate with a resource through SSH. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public System.Collections.Generic.List ControlPlaneNodeConfigurationAdministratorConfigurationSshPublicKey { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IControlPlaneNodePatchConfigurationInternal)ControlPlaneNodeConfiguration).AdministratorConfigurationSshPublicKey; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IControlPlaneNodePatchConfigurationInternal)ControlPlaneNodeConfiguration).AdministratorConfigurationSshPublicKey = value ?? null /* arrayOf */; } + + /// The number of virtual machines that use this configuration. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public long? ControlPlaneNodeConfigurationCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IControlPlaneNodePatchConfigurationInternal)ControlPlaneNodeConfiguration).Count; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IControlPlaneNodePatchConfigurationInternal)ControlPlaneNodeConfiguration).Count = value ?? default(long); } + + /// Backing field for property. + private string _kubernetesVersion; + + /// The Kubernetes version for this cluster. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string KubernetesVersion { get => this._kubernetesVersion; set => this._kubernetesVersion = value; } + + /// Internal Acessors for AdministratorConfiguration + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministratorConfigurationPatch Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPatchPropertiesInternal.AdministratorConfiguration { get => (this._administratorConfiguration = this._administratorConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AdministratorConfigurationPatch()); set { {_administratorConfiguration = value;} } } + + /// Internal Acessors for ControlPlaneNodeConfiguration + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IControlPlaneNodePatchConfiguration Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPatchPropertiesInternal.ControlPlaneNodeConfiguration { get => (this._controlPlaneNodeConfiguration = this._controlPlaneNodeConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ControlPlaneNodePatchConfiguration()); set { {_controlPlaneNodeConfiguration = value;} } } + + /// Internal Acessors for ControlPlaneNodeConfigurationAdministratorConfiguration + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministratorConfigurationPatch Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPatchPropertiesInternal.ControlPlaneNodeConfigurationAdministratorConfiguration { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IControlPlaneNodePatchConfigurationInternal)ControlPlaneNodeConfiguration).AdministratorConfiguration; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IControlPlaneNodePatchConfigurationInternal)ControlPlaneNodeConfiguration).AdministratorConfiguration = value ?? null /* model class */; } + + /// + /// SshPublicKey represents the public key used to authenticate with a resource through SSH. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public System.Collections.Generic.List SshPublicKey { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministratorConfigurationPatchInternal)AdministratorConfiguration).SshPublicKey; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministratorConfigurationPatchInternal)AdministratorConfiguration).SshPublicKey = value ?? null /* arrayOf */; } + + /// Creates an new instance. + public KubernetesClusterPatchProperties() + { + + } + } + /// KubernetesClusterPatchProperties represents the properties of the Kubernetes cluster that can be patched. + public partial interface IKubernetesClusterPatchProperties : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable + { + /// + /// SshPublicKey represents the public key used to authenticate with a resource through SSH. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"SshPublicKey represents the public key used to authenticate with a resource through SSH.", + SerializedName = @"sshPublicKeys", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISshPublicKey) })] + System.Collections.Generic.List ControlPlaneNodeConfigurationAdministratorConfigurationSshPublicKey { get; set; } + /// The number of virtual machines that use this configuration. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The number of virtual machines that use this configuration.", + SerializedName = @"count", + PossibleTypes = new [] { typeof(long) })] + long? ControlPlaneNodeConfigurationCount { get; set; } + /// The Kubernetes version for this cluster. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The Kubernetes version for this cluster.", + SerializedName = @"kubernetesVersion", + PossibleTypes = new [] { typeof(string) })] + string KubernetesVersion { get; set; } + /// + /// SshPublicKey represents the public key used to authenticate with a resource through SSH. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"SshPublicKey represents the public key used to authenticate with a resource through SSH.", + SerializedName = @"sshPublicKeys", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISshPublicKey) })] + System.Collections.Generic.List SshPublicKey { get; set; } + + } + /// KubernetesClusterPatchProperties represents the properties of the Kubernetes cluster that can be patched. + internal partial interface IKubernetesClusterPatchPropertiesInternal + + { + /// The configuration of the default administrator credentials. + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministratorConfigurationPatch AdministratorConfiguration { get; set; } + /// + /// The defining characteristics of the control plane that can be patched for this Kubernetes cluster. + /// + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IControlPlaneNodePatchConfiguration ControlPlaneNodeConfiguration { get; set; } + /// The configuration of administrator credentials for the control plane nodes. + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministratorConfigurationPatch ControlPlaneNodeConfigurationAdministratorConfiguration { get; set; } + /// + /// SshPublicKey represents the public key used to authenticate with a resource through SSH. + /// + System.Collections.Generic.List ControlPlaneNodeConfigurationAdministratorConfigurationSshPublicKey { get; set; } + /// The number of virtual machines that use this configuration. + long? ControlPlaneNodeConfigurationCount { get; set; } + /// The Kubernetes version for this cluster. + string KubernetesVersion { get; set; } + /// + /// SshPublicKey represents the public key used to authenticate with a resource through SSH. + /// + System.Collections.Generic.List SshPublicKey { get; set; } + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesClusterPatchProperties.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesClusterPatchProperties.json.cs similarity index 92% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesClusterPatchProperties.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesClusterPatchProperties.json.cs index 882b5029884c..79cdbafc1999 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesClusterPatchProperties.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesClusterPatchProperties.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -56,13 +56,13 @@ public partial class KubernetesClusterPatchProperties partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPatchProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPatchProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPatchProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPatchProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPatchProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPatchProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new KubernetesClusterPatchProperties(json) : null; } @@ -79,9 +79,9 @@ internal KubernetesClusterPatchProperties(Microsoft.Azure.PowerShell.Cmdlets.Net { return; } - {_administratorConfiguration = If( json?.PropertyT("administratorConfiguration"), out var __jsonAdministratorConfiguration) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AdministratorConfigurationPatch.FromJson(__jsonAdministratorConfiguration) : AdministratorConfiguration;} - {_controlPlaneNodeConfiguration = If( json?.PropertyT("controlPlaneNodeConfiguration"), out var __jsonControlPlaneNodeConfiguration) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ControlPlaneNodePatchConfiguration.FromJson(__jsonControlPlaneNodeConfiguration) : ControlPlaneNodeConfiguration;} - {_kubernetesVersion = If( json?.PropertyT("kubernetesVersion"), out var __jsonKubernetesVersion) ? (string)__jsonKubernetesVersion : (string)KubernetesVersion;} + {_administratorConfiguration = If( json?.PropertyT("administratorConfiguration"), out var __jsonAdministratorConfiguration) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AdministratorConfigurationPatch.FromJson(__jsonAdministratorConfiguration) : _administratorConfiguration;} + {_controlPlaneNodeConfiguration = If( json?.PropertyT("controlPlaneNodeConfiguration"), out var __jsonControlPlaneNodeConfiguration) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ControlPlaneNodePatchConfiguration.FromJson(__jsonControlPlaneNodeConfiguration) : _controlPlaneNodeConfiguration;} + {_kubernetesVersion = If( json?.PropertyT("kubernetesVersion"), out var __jsonKubernetesVersion) ? (string)__jsonKubernetesVersion : (string)_kubernetesVersion;} AfterFromJson(json); } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesClusterProperties.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesClusterProperties.PowerShell.cs new file mode 100644 index 000000000000..777eef3629a1 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesClusterProperties.PowerShell.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.NetworkCloud.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + + /// + /// KubernetesClusterProperties represents the properties of Kubernetes cluster resource. + /// + [System.ComponentModel.TypeConverter(typeof(KubernetesClusterPropertiesTypeConverter))] + public partial class KubernetesClusterProperties + { + + /// + /// 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.NetworkCloud.Models.IKubernetesClusterProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new KubernetesClusterProperties(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.NetworkCloud.Models.IKubernetesClusterProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new KubernetesClusterProperties(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.NetworkCloud.Models.IKubernetesClusterProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal KubernetesClusterProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("AadConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).AadConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAadConfiguration) content.GetValueForProperty("AadConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).AadConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AadConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("AdministratorConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).AdministratorConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministratorConfiguration) content.GetValueForProperty("AdministratorConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).AdministratorConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AdministratorConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("ControlPlaneNodeConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).ControlPlaneNodeConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IControlPlaneNodeConfiguration) content.GetValueForProperty("ControlPlaneNodeConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).ControlPlaneNodeConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ControlPlaneNodeConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("ManagedResourceGroupConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).ManagedResourceGroupConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IManagedResourceGroupConfiguration) content.GetValueForProperty("ManagedResourceGroupConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).ManagedResourceGroupConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ManagedResourceGroupConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("NetworkConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).NetworkConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkConfiguration) content.GetValueForProperty("NetworkConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).NetworkConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.NetworkConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("AttachedNetworkId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).AttachedNetworkId = (System.Collections.Generic.List) content.GetValueForProperty("AttachedNetworkId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).AttachedNetworkId, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("AvailableUpgrade")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).AvailableUpgrade = (System.Collections.Generic.List) content.GetValueForProperty("AvailableUpgrade",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).AvailableUpgrade, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AvailableUpgradeTypeConverter.ConvertFrom)); + } + if (content.Contains("ClusterId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).ClusterId = (string) content.GetValueForProperty("ClusterId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).ClusterId, global::System.Convert.ToString); + } + if (content.Contains("ConnectedClusterId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).ConnectedClusterId = (string) content.GetValueForProperty("ConnectedClusterId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).ConnectedClusterId, global::System.Convert.ToString); + } + if (content.Contains("ControlPlaneKubernetesVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).ControlPlaneKubernetesVersion = (string) content.GetValueForProperty("ControlPlaneKubernetesVersion",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).ControlPlaneKubernetesVersion, global::System.Convert.ToString); + } + if (content.Contains("DetailedStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).DetailedStatus = (string) content.GetValueForProperty("DetailedStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).DetailedStatus, global::System.Convert.ToString); + } + if (content.Contains("DetailedStatusMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).DetailedStatusMessage = (string) content.GetValueForProperty("DetailedStatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).DetailedStatusMessage, global::System.Convert.ToString); + } + if (content.Contains("FeatureStatuses")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).FeatureStatuses = (System.Collections.Generic.List) content.GetValueForProperty("FeatureStatuses",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).FeatureStatuses, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.FeatureStatusTypeConverter.ConvertFrom)); + } + if (content.Contains("InitialAgentPoolConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).InitialAgentPoolConfiguration = (System.Collections.Generic.List) content.GetValueForProperty("InitialAgentPoolConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).InitialAgentPoolConfiguration, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.InitialAgentPoolConfigurationTypeConverter.ConvertFrom)); + } + if (content.Contains("KubernetesVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).KubernetesVersion = (string) content.GetValueForProperty("KubernetesVersion",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).KubernetesVersion, global::System.Convert.ToString); + } + if (content.Contains("Node")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).Node = (System.Collections.Generic.List) content.GetValueForProperty("Node",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).Node, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.KubernetesClusterNodeTypeConverter.ConvertFrom)); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("AdminUsername")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).AdminUsername = (string) content.GetValueForProperty("AdminUsername",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).AdminUsername, global::System.Convert.ToString); + } + if (content.Contains("ControlPlaneNodeConfigurationAdministratorConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).ControlPlaneNodeConfigurationAdministratorConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministratorConfiguration) content.GetValueForProperty("ControlPlaneNodeConfigurationAdministratorConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).ControlPlaneNodeConfigurationAdministratorConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AdministratorConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("ControlPlaneNodeConfigurationAvailabilityZone")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).ControlPlaneNodeConfigurationAvailabilityZone = (System.Collections.Generic.List) content.GetValueForProperty("ControlPlaneNodeConfigurationAvailabilityZone",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).ControlPlaneNodeConfigurationAvailabilityZone, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("ControlPlaneNodeConfigurationCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).ControlPlaneNodeConfigurationCount = (long) content.GetValueForProperty("ControlPlaneNodeConfigurationCount",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).ControlPlaneNodeConfigurationCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("ManagedResourceGroupConfigurationLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).ManagedResourceGroupConfigurationLocation = (string) content.GetValueForProperty("ManagedResourceGroupConfigurationLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).ManagedResourceGroupConfigurationLocation, global::System.Convert.ToString); + } + if (content.Contains("ManagedResourceGroupConfigurationName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).ManagedResourceGroupConfigurationName = (string) content.GetValueForProperty("ManagedResourceGroupConfigurationName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).ManagedResourceGroupConfigurationName, global::System.Convert.ToString); + } + if (content.Contains("NetworkConfigurationPodCidr")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).NetworkConfigurationPodCidr = (System.Collections.Generic.List) content.GetValueForProperty("NetworkConfigurationPodCidr",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).NetworkConfigurationPodCidr, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("NetworkConfigurationServiceCidr")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).NetworkConfigurationServiceCidr = (System.Collections.Generic.List) content.GetValueForProperty("NetworkConfigurationServiceCidr",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).NetworkConfigurationServiceCidr, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("AadConfigurationAdminGroupObjectId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).AadConfigurationAdminGroupObjectId = (System.Collections.Generic.List) content.GetValueForProperty("AadConfigurationAdminGroupObjectId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).AadConfigurationAdminGroupObjectId, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("SshPublicKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).SshPublicKey = (System.Collections.Generic.List) content.GetValueForProperty("SshPublicKey",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).SshPublicKey, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.SshPublicKeyTypeConverter.ConvertFrom)); + } + if (content.Contains("ControlPlaneNodeConfigurationVMSkuName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).ControlPlaneNodeConfigurationVMSkuName = (string) content.GetValueForProperty("ControlPlaneNodeConfigurationVMSkuName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).ControlPlaneNodeConfigurationVMSkuName, global::System.Convert.ToString); + } + if (content.Contains("ControlPlaneNodeConfigurationAdministratorConfigurationAdminUsername")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).ControlPlaneNodeConfigurationAdministratorConfigurationAdminUsername = (string) content.GetValueForProperty("ControlPlaneNodeConfigurationAdministratorConfigurationAdminUsername",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).ControlPlaneNodeConfigurationAdministratorConfigurationAdminUsername, global::System.Convert.ToString); + } + if (content.Contains("NetworkConfigurationAttachedNetworkConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).NetworkConfigurationAttachedNetworkConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAttachedNetworkConfiguration) content.GetValueForProperty("NetworkConfigurationAttachedNetworkConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).NetworkConfigurationAttachedNetworkConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AttachedNetworkConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("NetworkConfigurationBgpServiceLoadBalancerConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).NetworkConfigurationBgpServiceLoadBalancerConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBgpServiceLoadBalancerConfiguration) content.GetValueForProperty("NetworkConfigurationBgpServiceLoadBalancerConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).NetworkConfigurationBgpServiceLoadBalancerConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BgpServiceLoadBalancerConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("NetworkConfigurationL2ServiceLoadBalancerConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).NetworkConfigurationL2ServiceLoadBalancerConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2ServiceLoadBalancerConfiguration) content.GetValueForProperty("NetworkConfigurationL2ServiceLoadBalancerConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).NetworkConfigurationL2ServiceLoadBalancerConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.L2ServiceLoadBalancerConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("NetworkConfigurationCloudServicesNetworkId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).NetworkConfigurationCloudServicesNetworkId = (string) content.GetValueForProperty("NetworkConfigurationCloudServicesNetworkId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).NetworkConfigurationCloudServicesNetworkId, global::System.Convert.ToString); + } + if (content.Contains("NetworkConfigurationCniNetworkId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).NetworkConfigurationCniNetworkId = (string) content.GetValueForProperty("NetworkConfigurationCniNetworkId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).NetworkConfigurationCniNetworkId, global::System.Convert.ToString); + } + if (content.Contains("NetworkConfigurationDnsServiceIP")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).NetworkConfigurationDnsServiceIP = (string) content.GetValueForProperty("NetworkConfigurationDnsServiceIP",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).NetworkConfigurationDnsServiceIP, global::System.Convert.ToString); + } + if (content.Contains("AttachedNetworkConfigurationL2Network")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).AttachedNetworkConfigurationL2Network = (System.Collections.Generic.List) content.GetValueForProperty("AttachedNetworkConfigurationL2Network",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).AttachedNetworkConfigurationL2Network, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.L2NetworkAttachmentConfigurationTypeConverter.ConvertFrom)); + } + if (content.Contains("AttachedNetworkConfigurationL3Network")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).AttachedNetworkConfigurationL3Network = (System.Collections.Generic.List) content.GetValueForProperty("AttachedNetworkConfigurationL3Network",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).AttachedNetworkConfigurationL3Network, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.L3NetworkAttachmentConfigurationTypeConverter.ConvertFrom)); + } + if (content.Contains("AttachedNetworkConfigurationTrunkedNetwork")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).AttachedNetworkConfigurationTrunkedNetwork = (System.Collections.Generic.List) content.GetValueForProperty("AttachedNetworkConfigurationTrunkedNetwork",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).AttachedNetworkConfigurationTrunkedNetwork, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.TrunkedNetworkAttachmentConfigurationTypeConverter.ConvertFrom)); + } + if (content.Contains("BgpServiceLoadBalancerConfigurationBgpAdvertisement")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).BgpServiceLoadBalancerConfigurationBgpAdvertisement = (System.Collections.Generic.List) content.GetValueForProperty("BgpServiceLoadBalancerConfigurationBgpAdvertisement",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).BgpServiceLoadBalancerConfigurationBgpAdvertisement, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BgpAdvertisementTypeConverter.ConvertFrom)); + } + if (content.Contains("BgpServiceLoadBalancerConfigurationBgpPeer")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).BgpServiceLoadBalancerConfigurationBgpPeer = (System.Collections.Generic.List) content.GetValueForProperty("BgpServiceLoadBalancerConfigurationBgpPeer",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).BgpServiceLoadBalancerConfigurationBgpPeer, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ServiceLoadBalancerBgpPeerTypeConverter.ConvertFrom)); + } + if (content.Contains("ControlPlaneNodeConfigurationAdministratorConfigurationSshPublicKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).ControlPlaneNodeConfigurationAdministratorConfigurationSshPublicKey = (System.Collections.Generic.List) content.GetValueForProperty("ControlPlaneNodeConfigurationAdministratorConfigurationSshPublicKey",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).ControlPlaneNodeConfigurationAdministratorConfigurationSshPublicKey, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.SshPublicKeyTypeConverter.ConvertFrom)); + } + if (content.Contains("BgpServiceLoadBalancerConfigurationFabricPeeringEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).BgpServiceLoadBalancerConfigurationFabricPeeringEnabled = (string) content.GetValueForProperty("BgpServiceLoadBalancerConfigurationFabricPeeringEnabled",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).BgpServiceLoadBalancerConfigurationFabricPeeringEnabled, global::System.Convert.ToString); + } + if (content.Contains("BgpServiceLoadBalancerConfigurationIPAddressPool")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).BgpServiceLoadBalancerConfigurationIPAddressPool = (System.Collections.Generic.List) content.GetValueForProperty("BgpServiceLoadBalancerConfigurationIPAddressPool",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).BgpServiceLoadBalancerConfigurationIPAddressPool, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IPAddressPoolTypeConverter.ConvertFrom)); + } + if (content.Contains("L2ServiceLoadBalancerConfigurationIPAddressPool")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).L2ServiceLoadBalancerConfigurationIPAddressPool = (System.Collections.Generic.List) content.GetValueForProperty("L2ServiceLoadBalancerConfigurationIPAddressPool",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).L2ServiceLoadBalancerConfigurationIPAddressPool, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IPAddressPoolTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal KubernetesClusterProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("AadConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).AadConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAadConfiguration) content.GetValueForProperty("AadConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).AadConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AadConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("AdministratorConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).AdministratorConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministratorConfiguration) content.GetValueForProperty("AdministratorConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).AdministratorConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AdministratorConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("ControlPlaneNodeConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).ControlPlaneNodeConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IControlPlaneNodeConfiguration) content.GetValueForProperty("ControlPlaneNodeConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).ControlPlaneNodeConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ControlPlaneNodeConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("ManagedResourceGroupConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).ManagedResourceGroupConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IManagedResourceGroupConfiguration) content.GetValueForProperty("ManagedResourceGroupConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).ManagedResourceGroupConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ManagedResourceGroupConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("NetworkConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).NetworkConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkConfiguration) content.GetValueForProperty("NetworkConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).NetworkConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.NetworkConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("AttachedNetworkId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).AttachedNetworkId = (System.Collections.Generic.List) content.GetValueForProperty("AttachedNetworkId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).AttachedNetworkId, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("AvailableUpgrade")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).AvailableUpgrade = (System.Collections.Generic.List) content.GetValueForProperty("AvailableUpgrade",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).AvailableUpgrade, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AvailableUpgradeTypeConverter.ConvertFrom)); + } + if (content.Contains("ClusterId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).ClusterId = (string) content.GetValueForProperty("ClusterId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).ClusterId, global::System.Convert.ToString); + } + if (content.Contains("ConnectedClusterId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).ConnectedClusterId = (string) content.GetValueForProperty("ConnectedClusterId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).ConnectedClusterId, global::System.Convert.ToString); + } + if (content.Contains("ControlPlaneKubernetesVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).ControlPlaneKubernetesVersion = (string) content.GetValueForProperty("ControlPlaneKubernetesVersion",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).ControlPlaneKubernetesVersion, global::System.Convert.ToString); + } + if (content.Contains("DetailedStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).DetailedStatus = (string) content.GetValueForProperty("DetailedStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).DetailedStatus, global::System.Convert.ToString); + } + if (content.Contains("DetailedStatusMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).DetailedStatusMessage = (string) content.GetValueForProperty("DetailedStatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).DetailedStatusMessage, global::System.Convert.ToString); + } + if (content.Contains("FeatureStatuses")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).FeatureStatuses = (System.Collections.Generic.List) content.GetValueForProperty("FeatureStatuses",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).FeatureStatuses, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.FeatureStatusTypeConverter.ConvertFrom)); + } + if (content.Contains("InitialAgentPoolConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).InitialAgentPoolConfiguration = (System.Collections.Generic.List) content.GetValueForProperty("InitialAgentPoolConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).InitialAgentPoolConfiguration, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.InitialAgentPoolConfigurationTypeConverter.ConvertFrom)); + } + if (content.Contains("KubernetesVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).KubernetesVersion = (string) content.GetValueForProperty("KubernetesVersion",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).KubernetesVersion, global::System.Convert.ToString); + } + if (content.Contains("Node")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).Node = (System.Collections.Generic.List) content.GetValueForProperty("Node",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).Node, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.KubernetesClusterNodeTypeConverter.ConvertFrom)); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("AdminUsername")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).AdminUsername = (string) content.GetValueForProperty("AdminUsername",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).AdminUsername, global::System.Convert.ToString); + } + if (content.Contains("ControlPlaneNodeConfigurationAdministratorConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).ControlPlaneNodeConfigurationAdministratorConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministratorConfiguration) content.GetValueForProperty("ControlPlaneNodeConfigurationAdministratorConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).ControlPlaneNodeConfigurationAdministratorConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AdministratorConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("ControlPlaneNodeConfigurationAvailabilityZone")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).ControlPlaneNodeConfigurationAvailabilityZone = (System.Collections.Generic.List) content.GetValueForProperty("ControlPlaneNodeConfigurationAvailabilityZone",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).ControlPlaneNodeConfigurationAvailabilityZone, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("ControlPlaneNodeConfigurationCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).ControlPlaneNodeConfigurationCount = (long) content.GetValueForProperty("ControlPlaneNodeConfigurationCount",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).ControlPlaneNodeConfigurationCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("ManagedResourceGroupConfigurationLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).ManagedResourceGroupConfigurationLocation = (string) content.GetValueForProperty("ManagedResourceGroupConfigurationLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).ManagedResourceGroupConfigurationLocation, global::System.Convert.ToString); + } + if (content.Contains("ManagedResourceGroupConfigurationName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).ManagedResourceGroupConfigurationName = (string) content.GetValueForProperty("ManagedResourceGroupConfigurationName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).ManagedResourceGroupConfigurationName, global::System.Convert.ToString); + } + if (content.Contains("NetworkConfigurationPodCidr")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).NetworkConfigurationPodCidr = (System.Collections.Generic.List) content.GetValueForProperty("NetworkConfigurationPodCidr",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).NetworkConfigurationPodCidr, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("NetworkConfigurationServiceCidr")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).NetworkConfigurationServiceCidr = (System.Collections.Generic.List) content.GetValueForProperty("NetworkConfigurationServiceCidr",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).NetworkConfigurationServiceCidr, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("AadConfigurationAdminGroupObjectId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).AadConfigurationAdminGroupObjectId = (System.Collections.Generic.List) content.GetValueForProperty("AadConfigurationAdminGroupObjectId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).AadConfigurationAdminGroupObjectId, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("SshPublicKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).SshPublicKey = (System.Collections.Generic.List) content.GetValueForProperty("SshPublicKey",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).SshPublicKey, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.SshPublicKeyTypeConverter.ConvertFrom)); + } + if (content.Contains("ControlPlaneNodeConfigurationVMSkuName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).ControlPlaneNodeConfigurationVMSkuName = (string) content.GetValueForProperty("ControlPlaneNodeConfigurationVMSkuName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).ControlPlaneNodeConfigurationVMSkuName, global::System.Convert.ToString); + } + if (content.Contains("ControlPlaneNodeConfigurationAdministratorConfigurationAdminUsername")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).ControlPlaneNodeConfigurationAdministratorConfigurationAdminUsername = (string) content.GetValueForProperty("ControlPlaneNodeConfigurationAdministratorConfigurationAdminUsername",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).ControlPlaneNodeConfigurationAdministratorConfigurationAdminUsername, global::System.Convert.ToString); + } + if (content.Contains("NetworkConfigurationAttachedNetworkConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).NetworkConfigurationAttachedNetworkConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAttachedNetworkConfiguration) content.GetValueForProperty("NetworkConfigurationAttachedNetworkConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).NetworkConfigurationAttachedNetworkConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AttachedNetworkConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("NetworkConfigurationBgpServiceLoadBalancerConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).NetworkConfigurationBgpServiceLoadBalancerConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBgpServiceLoadBalancerConfiguration) content.GetValueForProperty("NetworkConfigurationBgpServiceLoadBalancerConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).NetworkConfigurationBgpServiceLoadBalancerConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BgpServiceLoadBalancerConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("NetworkConfigurationL2ServiceLoadBalancerConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).NetworkConfigurationL2ServiceLoadBalancerConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2ServiceLoadBalancerConfiguration) content.GetValueForProperty("NetworkConfigurationL2ServiceLoadBalancerConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).NetworkConfigurationL2ServiceLoadBalancerConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.L2ServiceLoadBalancerConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("NetworkConfigurationCloudServicesNetworkId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).NetworkConfigurationCloudServicesNetworkId = (string) content.GetValueForProperty("NetworkConfigurationCloudServicesNetworkId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).NetworkConfigurationCloudServicesNetworkId, global::System.Convert.ToString); + } + if (content.Contains("NetworkConfigurationCniNetworkId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).NetworkConfigurationCniNetworkId = (string) content.GetValueForProperty("NetworkConfigurationCniNetworkId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).NetworkConfigurationCniNetworkId, global::System.Convert.ToString); + } + if (content.Contains("NetworkConfigurationDnsServiceIP")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).NetworkConfigurationDnsServiceIP = (string) content.GetValueForProperty("NetworkConfigurationDnsServiceIP",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).NetworkConfigurationDnsServiceIP, global::System.Convert.ToString); + } + if (content.Contains("AttachedNetworkConfigurationL2Network")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).AttachedNetworkConfigurationL2Network = (System.Collections.Generic.List) content.GetValueForProperty("AttachedNetworkConfigurationL2Network",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).AttachedNetworkConfigurationL2Network, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.L2NetworkAttachmentConfigurationTypeConverter.ConvertFrom)); + } + if (content.Contains("AttachedNetworkConfigurationL3Network")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).AttachedNetworkConfigurationL3Network = (System.Collections.Generic.List) content.GetValueForProperty("AttachedNetworkConfigurationL3Network",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).AttachedNetworkConfigurationL3Network, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.L3NetworkAttachmentConfigurationTypeConverter.ConvertFrom)); + } + if (content.Contains("AttachedNetworkConfigurationTrunkedNetwork")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).AttachedNetworkConfigurationTrunkedNetwork = (System.Collections.Generic.List) content.GetValueForProperty("AttachedNetworkConfigurationTrunkedNetwork",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).AttachedNetworkConfigurationTrunkedNetwork, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.TrunkedNetworkAttachmentConfigurationTypeConverter.ConvertFrom)); + } + if (content.Contains("BgpServiceLoadBalancerConfigurationBgpAdvertisement")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).BgpServiceLoadBalancerConfigurationBgpAdvertisement = (System.Collections.Generic.List) content.GetValueForProperty("BgpServiceLoadBalancerConfigurationBgpAdvertisement",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).BgpServiceLoadBalancerConfigurationBgpAdvertisement, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BgpAdvertisementTypeConverter.ConvertFrom)); + } + if (content.Contains("BgpServiceLoadBalancerConfigurationBgpPeer")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).BgpServiceLoadBalancerConfigurationBgpPeer = (System.Collections.Generic.List) content.GetValueForProperty("BgpServiceLoadBalancerConfigurationBgpPeer",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).BgpServiceLoadBalancerConfigurationBgpPeer, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ServiceLoadBalancerBgpPeerTypeConverter.ConvertFrom)); + } + if (content.Contains("ControlPlaneNodeConfigurationAdministratorConfigurationSshPublicKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).ControlPlaneNodeConfigurationAdministratorConfigurationSshPublicKey = (System.Collections.Generic.List) content.GetValueForProperty("ControlPlaneNodeConfigurationAdministratorConfigurationSshPublicKey",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).ControlPlaneNodeConfigurationAdministratorConfigurationSshPublicKey, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.SshPublicKeyTypeConverter.ConvertFrom)); + } + if (content.Contains("BgpServiceLoadBalancerConfigurationFabricPeeringEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).BgpServiceLoadBalancerConfigurationFabricPeeringEnabled = (string) content.GetValueForProperty("BgpServiceLoadBalancerConfigurationFabricPeeringEnabled",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).BgpServiceLoadBalancerConfigurationFabricPeeringEnabled, global::System.Convert.ToString); + } + if (content.Contains("BgpServiceLoadBalancerConfigurationIPAddressPool")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).BgpServiceLoadBalancerConfigurationIPAddressPool = (System.Collections.Generic.List) content.GetValueForProperty("BgpServiceLoadBalancerConfigurationIPAddressPool",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).BgpServiceLoadBalancerConfigurationIPAddressPool, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IPAddressPoolTypeConverter.ConvertFrom)); + } + if (content.Contains("L2ServiceLoadBalancerConfigurationIPAddressPool")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).L2ServiceLoadBalancerConfigurationIPAddressPool = (System.Collections.Generic.List) content.GetValueForProperty("L2ServiceLoadBalancerConfigurationIPAddressPool",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal)this).L2ServiceLoadBalancerConfigurationIPAddressPool, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IPAddressPoolTypeConverter.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.NetworkCloud.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(); + } + } + /// KubernetesClusterProperties represents the properties of Kubernetes cluster resource. + [System.ComponentModel.TypeConverter(typeof(KubernetesClusterPropertiesTypeConverter))] + public partial interface IKubernetesClusterProperties + + { + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesClusterProperties.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesClusterProperties.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesClusterProperties.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesClusterProperties.TypeConverter.cs index 63585871ec28..aa1ee1a00f30 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesClusterProperties.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesClusterProperties.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IKubernetesClusterProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesClusterProperties.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesClusterProperties.cs new file mode 100644 index 000000000000..29bc12358014 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesClusterProperties.cs @@ -0,0 +1,948 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + + /// + /// KubernetesClusterProperties represents the properties of Kubernetes cluster resource. + /// + public partial class KubernetesClusterProperties : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterProperties, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAadConfiguration _aadConfiguration; + + /// The Azure Active Directory Integration properties. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAadConfiguration AadConfiguration { get => (this._aadConfiguration = this._aadConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AadConfiguration()); set => this._aadConfiguration = value; } + + /// + /// The list of Azure Active Directory group object IDs that will have an administrative role on the Kubernetes cluster. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public System.Collections.Generic.List AadConfigurationAdminGroupObjectId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAadConfigurationInternal)AadConfiguration).AdminGroupObjectId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAadConfigurationInternal)AadConfiguration).AdminGroupObjectId = value ?? null /* arrayOf */; } + + /// + /// The user name for the administrator that will be applied to the operating systems that run Kubernetes nodes. If not supplied, + /// a user name will be chosen by the service. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string AdminUsername { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministratorConfigurationInternal)AdministratorConfiguration).AdminUsername; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministratorConfigurationInternal)AdministratorConfiguration).AdminUsername = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministratorConfiguration _administratorConfiguration; + + /// + /// The administrative credentials that will be applied to the control plane and agent pool nodes that do not specify their + /// own values. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministratorConfiguration AdministratorConfiguration { get => (this._administratorConfiguration = this._administratorConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AdministratorConfiguration()); set => this._administratorConfiguration = value; } + + /// The list of Layer 2 Networks and related configuration for attachment. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public System.Collections.Generic.List AttachedNetworkConfigurationL2Network { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkConfigurationInternal)NetworkConfiguration).AttachedNetworkConfigurationL2Network; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkConfigurationInternal)NetworkConfiguration).AttachedNetworkConfigurationL2Network = value ?? null /* arrayOf */; } + + /// The list of Layer 3 Networks and related configuration for attachment. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public System.Collections.Generic.List AttachedNetworkConfigurationL3Network { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkConfigurationInternal)NetworkConfiguration).AttachedNetworkConfigurationL3Network; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkConfigurationInternal)NetworkConfiguration).AttachedNetworkConfigurationL3Network = value ?? null /* arrayOf */; } + + /// The list of Trunked Networks and related configuration for attachment. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public System.Collections.Generic.List AttachedNetworkConfigurationTrunkedNetwork { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkConfigurationInternal)NetworkConfiguration).AttachedNetworkConfigurationTrunkedNetwork; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkConfigurationInternal)NetworkConfiguration).AttachedNetworkConfigurationTrunkedNetwork = value ?? null /* arrayOf */; } + + /// Backing field for property. + private System.Collections.Generic.List _attachedNetworkId; + + /// + /// The full list of network resource IDs that are attached to this cluster, including those attached only to specific agent + /// pools. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public System.Collections.Generic.List AttachedNetworkId { get => this._attachedNetworkId; } + + /// Backing field for property. + private System.Collections.Generic.List _availableUpgrade; + + /// The list of versions that this Kubernetes cluster can be upgraded to. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public System.Collections.Generic.List AvailableUpgrade { get => this._availableUpgrade; } + + /// + /// The association of IP address pools to the communities and peers, allowing for announcement of IPs. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public System.Collections.Generic.List BgpServiceLoadBalancerConfigurationBgpAdvertisement { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkConfigurationInternal)NetworkConfiguration).BgpServiceLoadBalancerConfigurationBgpAdvertisement; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkConfigurationInternal)NetworkConfiguration).BgpServiceLoadBalancerConfigurationBgpAdvertisement = value ?? null /* arrayOf */; } + + /// + /// The list of additional BgpPeer entities that the Kubernetes cluster will peer with. All peering must be explicitly defined. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public System.Collections.Generic.List BgpServiceLoadBalancerConfigurationBgpPeer { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkConfigurationInternal)NetworkConfiguration).BgpServiceLoadBalancerConfigurationBgpPeer; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkConfigurationInternal)NetworkConfiguration).BgpServiceLoadBalancerConfigurationBgpPeer = value ?? null /* arrayOf */; } + + /// The indicator to specify if the load balancer peers with the network fabric. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string BgpServiceLoadBalancerConfigurationFabricPeeringEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkConfigurationInternal)NetworkConfiguration).BgpServiceLoadBalancerConfigurationFabricPeeringEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkConfigurationInternal)NetworkConfiguration).BgpServiceLoadBalancerConfigurationFabricPeeringEnabled = value ?? null; } + + /// + /// The list of pools of IP addresses that can be allocated to load balancer services. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public System.Collections.Generic.List BgpServiceLoadBalancerConfigurationIPAddressPool { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkConfigurationInternal)NetworkConfiguration).BgpServiceLoadBalancerConfigurationIPAddressPool; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkConfigurationInternal)NetworkConfiguration).BgpServiceLoadBalancerConfigurationIPAddressPool = value ?? null /* arrayOf */; } + + /// Backing field for property. + private string _clusterId; + + /// The resource ID of the Network Cloud cluster. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string ClusterId { get => this._clusterId; } + + /// Backing field for property. + private string _connectedClusterId; + + /// + /// The resource ID of the connected cluster set up when this Kubernetes cluster is created. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string ConnectedClusterId { get => this._connectedClusterId; } + + /// Backing field for property. + private string _controlPlaneKubernetesVersion; + + /// The current running version of Kubernetes on the control plane. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string ControlPlaneKubernetesVersion { get => this._controlPlaneKubernetesVersion; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IControlPlaneNodeConfiguration _controlPlaneNodeConfiguration; + + /// The defining characteristics of the control plane for this Kubernetes Cluster. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IControlPlaneNodeConfiguration ControlPlaneNodeConfiguration { get => (this._controlPlaneNodeConfiguration = this._controlPlaneNodeConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ControlPlaneNodeConfiguration()); set => this._controlPlaneNodeConfiguration = value; } + + /// + /// The user name for the administrator that will be applied to the operating systems that run Kubernetes nodes. If not supplied, + /// a user name will be chosen by the service. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string ControlPlaneNodeConfigurationAdministratorConfigurationAdminUsername { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IControlPlaneNodeConfigurationInternal)ControlPlaneNodeConfiguration).AdministratorConfigurationAdminUsername; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IControlPlaneNodeConfigurationInternal)ControlPlaneNodeConfiguration).AdministratorConfigurationAdminUsername = value ?? null; } + + /// + /// The SSH configuration for the operating systems that run the nodes in the Kubernetes cluster. In some cases, specification + /// of public keys may be required to produce a working environment. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public System.Collections.Generic.List ControlPlaneNodeConfigurationAdministratorConfigurationSshPublicKey { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IControlPlaneNodeConfigurationInternal)ControlPlaneNodeConfiguration).AdministratorConfigurationSshPublicKey; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IControlPlaneNodeConfigurationInternal)ControlPlaneNodeConfiguration).AdministratorConfigurationSshPublicKey = value ?? null /* arrayOf */; } + + /// + /// The list of availability zones of the Network Cloud cluster to be used for the provisioning of nodes in the control plane. + /// If not specified, all availability zones will be used. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public System.Collections.Generic.List ControlPlaneNodeConfigurationAvailabilityZone { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IControlPlaneNodeConfigurationInternal)ControlPlaneNodeConfiguration).AvailabilityZone; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IControlPlaneNodeConfigurationInternal)ControlPlaneNodeConfiguration).AvailabilityZone = value ?? null /* arrayOf */; } + + /// The number of virtual machines that use this configuration. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public long ControlPlaneNodeConfigurationCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IControlPlaneNodeConfigurationInternal)ControlPlaneNodeConfiguration).Count; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IControlPlaneNodeConfigurationInternal)ControlPlaneNodeConfiguration).Count = value ; } + + /// The name of the VM SKU supplied during creation. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string ControlPlaneNodeConfigurationVMSkuName { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IControlPlaneNodeConfigurationInternal)ControlPlaneNodeConfiguration).VMSkuName; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IControlPlaneNodeConfigurationInternal)ControlPlaneNodeConfiguration).VMSkuName = value ; } + + /// Backing field for property. + private string _detailedStatus; + + /// The current status of the Kubernetes cluster. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string DetailedStatus { get => this._detailedStatus; } + + /// Backing field for property. + private string _detailedStatusMessage; + + /// The descriptive message about the current detailed status. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string DetailedStatusMessage { get => this._detailedStatusMessage; } + + /// Backing field for property. + private System.Collections.Generic.List _featureStatuses; + + /// The current feature settings. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public System.Collections.Generic.List FeatureStatuses { get => this._featureStatuses; } + + /// Backing field for property. + private System.Collections.Generic.List _initialAgentPoolConfiguration; + + /// + /// The agent pools that are created with this Kubernetes cluster for running critical system services and workloads. This + /// data in this field is only used during creation, and the field will be empty following the creation of the Kubernetes + /// Cluster. After creation, the management of agent pools is done using the agentPools sub-resource. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public System.Collections.Generic.List InitialAgentPoolConfiguration { get => this._initialAgentPoolConfiguration; set => this._initialAgentPoolConfiguration = value; } + + /// Backing field for property. + private string _kubernetesVersion; + + /// The Kubernetes version for this cluster. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string KubernetesVersion { get => this._kubernetesVersion; set => this._kubernetesVersion = value; } + + /// + /// The list of pools of IP addresses that can be allocated to load balancer services. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public System.Collections.Generic.List L2ServiceLoadBalancerConfigurationIPAddressPool { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkConfigurationInternal)NetworkConfiguration).L2ServiceLoadBalancerConfigurationIPAddressPool; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkConfigurationInternal)NetworkConfiguration).L2ServiceLoadBalancerConfigurationIPAddressPool = value ?? null /* arrayOf */; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IManagedResourceGroupConfiguration _managedResourceGroupConfiguration; + + /// The configuration of the managed resource group associated with the resource. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IManagedResourceGroupConfiguration ManagedResourceGroupConfiguration { get => (this._managedResourceGroupConfiguration = this._managedResourceGroupConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ManagedResourceGroupConfiguration()); set => this._managedResourceGroupConfiguration = value; } + + /// + /// The location of the managed resource group. If not specified, the location of the parent resource is chosen. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string ManagedResourceGroupConfigurationLocation { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IManagedResourceGroupConfigurationInternal)ManagedResourceGroupConfiguration).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IManagedResourceGroupConfigurationInternal)ManagedResourceGroupConfiguration).Location = value ?? null; } + + /// + /// The name for the managed resource group. If not specified, the unique name is automatically generated. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string ManagedResourceGroupConfigurationName { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IManagedResourceGroupConfigurationInternal)ManagedResourceGroupConfiguration).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IManagedResourceGroupConfigurationInternal)ManagedResourceGroupConfiguration).Name = value ?? null; } + + /// Internal Acessors for AadConfiguration + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAadConfiguration Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal.AadConfiguration { get => (this._aadConfiguration = this._aadConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AadConfiguration()); set { {_aadConfiguration = value;} } } + + /// Internal Acessors for AdministratorConfiguration + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministratorConfiguration Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal.AdministratorConfiguration { get => (this._administratorConfiguration = this._administratorConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AdministratorConfiguration()); set { {_administratorConfiguration = value;} } } + + /// Internal Acessors for AttachedNetworkId + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal.AttachedNetworkId { get => this._attachedNetworkId; set { {_attachedNetworkId = value;} } } + + /// Internal Acessors for AvailableUpgrade + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal.AvailableUpgrade { get => this._availableUpgrade; set { {_availableUpgrade = value;} } } + + /// Internal Acessors for ClusterId + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal.ClusterId { get => this._clusterId; set { {_clusterId = value;} } } + + /// Internal Acessors for ConnectedClusterId + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal.ConnectedClusterId { get => this._connectedClusterId; set { {_connectedClusterId = value;} } } + + /// Internal Acessors for ControlPlaneKubernetesVersion + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal.ControlPlaneKubernetesVersion { get => this._controlPlaneKubernetesVersion; set { {_controlPlaneKubernetesVersion = value;} } } + + /// Internal Acessors for ControlPlaneNodeConfiguration + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IControlPlaneNodeConfiguration Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal.ControlPlaneNodeConfiguration { get => (this._controlPlaneNodeConfiguration = this._controlPlaneNodeConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ControlPlaneNodeConfiguration()); set { {_controlPlaneNodeConfiguration = value;} } } + + /// Internal Acessors for ControlPlaneNodeConfigurationAdministratorConfiguration + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministratorConfiguration Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal.ControlPlaneNodeConfigurationAdministratorConfiguration { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IControlPlaneNodeConfigurationInternal)ControlPlaneNodeConfiguration).AdministratorConfiguration; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IControlPlaneNodeConfigurationInternal)ControlPlaneNodeConfiguration).AdministratorConfiguration = value ?? null /* model class */; } + + /// Internal Acessors for DetailedStatus + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal.DetailedStatus { get => this._detailedStatus; set { {_detailedStatus = value;} } } + + /// Internal Acessors for DetailedStatusMessage + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal.DetailedStatusMessage { get => this._detailedStatusMessage; set { {_detailedStatusMessage = value;} } } + + /// Internal Acessors for FeatureStatuses + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal.FeatureStatuses { get => this._featureStatuses; set { {_featureStatuses = value;} } } + + /// Internal Acessors for ManagedResourceGroupConfiguration + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IManagedResourceGroupConfiguration Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal.ManagedResourceGroupConfiguration { get => (this._managedResourceGroupConfiguration = this._managedResourceGroupConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ManagedResourceGroupConfiguration()); set { {_managedResourceGroupConfiguration = value;} } } + + /// Internal Acessors for NetworkConfiguration + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkConfiguration Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal.NetworkConfiguration { get => (this._networkConfiguration = this._networkConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.NetworkConfiguration()); set { {_networkConfiguration = value;} } } + + /// Internal Acessors for NetworkConfigurationAttachedNetworkConfiguration + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAttachedNetworkConfiguration Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal.NetworkConfigurationAttachedNetworkConfiguration { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkConfigurationInternal)NetworkConfiguration).AttachedNetworkConfiguration; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkConfigurationInternal)NetworkConfiguration).AttachedNetworkConfiguration = value ?? null /* model class */; } + + /// Internal Acessors for NetworkConfigurationBgpServiceLoadBalancerConfiguration + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBgpServiceLoadBalancerConfiguration Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal.NetworkConfigurationBgpServiceLoadBalancerConfiguration { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkConfigurationInternal)NetworkConfiguration).BgpServiceLoadBalancerConfiguration; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkConfigurationInternal)NetworkConfiguration).BgpServiceLoadBalancerConfiguration = value ?? null /* model class */; } + + /// Internal Acessors for NetworkConfigurationL2ServiceLoadBalancerConfiguration + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2ServiceLoadBalancerConfiguration Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal.NetworkConfigurationL2ServiceLoadBalancerConfiguration { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkConfigurationInternal)NetworkConfiguration).L2ServiceLoadBalancerConfiguration; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkConfigurationInternal)NetworkConfiguration).L2ServiceLoadBalancerConfiguration = value ?? null /* model class */; } + + /// Internal Acessors for Node + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal.Node { get => this._node; set { {_node = value;} } } + + /// Internal Acessors for ProvisioningState + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPropertiesInternal.ProvisioningState { get => this._provisioningState; set { {_provisioningState = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkConfiguration _networkConfiguration; + + /// + /// The configuration of the Kubernetes cluster networking, including the attachment of networks that span the cluster. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkConfiguration NetworkConfiguration { get => (this._networkConfiguration = this._networkConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.NetworkConfiguration()); set => this._networkConfiguration = value; } + + /// The resource ID of the associated Cloud Services network. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string NetworkConfigurationCloudServicesNetworkId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkConfigurationInternal)NetworkConfiguration).CloudServicesNetworkId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkConfigurationInternal)NetworkConfiguration).CloudServicesNetworkId = value ?? null; } + + /// + /// The resource ID of the Layer 3 network that is used for creation of the Container Networking Interface network. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string NetworkConfigurationCniNetworkId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkConfigurationInternal)NetworkConfiguration).CniNetworkId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkConfigurationInternal)NetworkConfiguration).CniNetworkId = value ?? null; } + + /// + /// The IP address assigned to the Kubernetes DNS service. It must be within the Kubernetes service address range specified + /// in service CIDR. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string NetworkConfigurationDnsServiceIP { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkConfigurationInternal)NetworkConfiguration).DnsServiceIP; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkConfigurationInternal)NetworkConfiguration).DnsServiceIP = value ?? null; } + + /// + /// The CIDR notation IP ranges from which to assign pod IPs. One IPv4 CIDR is expected for single-stack networking. Two CIDRs, + /// one for each IP family (IPv4/IPv6), is expected for dual-stack networking. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public System.Collections.Generic.List NetworkConfigurationPodCidr { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkConfigurationInternal)NetworkConfiguration).PodCidr; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkConfigurationInternal)NetworkConfiguration).PodCidr = value ?? null /* arrayOf */; } + + /// + /// The CIDR notation IP ranges from which to assign service IPs. One IPv4 CIDR is expected for single-stack networking. Two + /// CIDRs, one for each IP family (IPv4/IPv6), is expected for dual-stack networking. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public System.Collections.Generic.List NetworkConfigurationServiceCidr { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkConfigurationInternal)NetworkConfiguration).ServiceCidr; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkConfigurationInternal)NetworkConfiguration).ServiceCidr = value ?? null /* arrayOf */; } + + /// Backing field for property. + private System.Collections.Generic.List _node; + + /// The details of the nodes in this cluster. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public System.Collections.Generic.List Node { get => this._node; } + + /// Backing field for property. + private string _provisioningState; + + /// The provisioning state of the Kubernetes cluster resource. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string ProvisioningState { get => this._provisioningState; } + + /// + /// The SSH configuration for the operating systems that run the nodes in the Kubernetes cluster. In some cases, specification + /// of public keys may be required to produce a working environment. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public System.Collections.Generic.List SshPublicKey { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministratorConfigurationInternal)AdministratorConfiguration).SshPublicKey; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministratorConfigurationInternal)AdministratorConfiguration).SshPublicKey = value ?? null /* arrayOf */; } + + /// Creates an new instance. + public KubernetesClusterProperties() + { + + } + } + /// KubernetesClusterProperties represents the properties of Kubernetes cluster resource. + public partial interface IKubernetesClusterProperties : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable + { + /// + /// The list of Azure Active Directory group object IDs that will have an administrative role on the Kubernetes cluster. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The list of Azure Active Directory group object IDs that will have an administrative role on the Kubernetes cluster.", + SerializedName = @"adminGroupObjectIds", + PossibleTypes = new [] { typeof(string) })] + System.Collections.Generic.List AadConfigurationAdminGroupObjectId { get; set; } + /// + /// The user name for the administrator that will be applied to the operating systems that run Kubernetes nodes. If not supplied, + /// a user name will be chosen by the service. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The user name for the administrator that will be applied to the operating systems that run Kubernetes nodes. If not supplied, a user name will be chosen by the service.", + SerializedName = @"adminUsername", + PossibleTypes = new [] { typeof(string) })] + string AdminUsername { get; set; } + /// The list of Layer 2 Networks and related configuration for attachment. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The list of Layer 2 Networks and related configuration for attachment.", + SerializedName = @"l2Networks", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkAttachmentConfiguration) })] + System.Collections.Generic.List AttachedNetworkConfigurationL2Network { get; set; } + /// The list of Layer 3 Networks and related configuration for attachment. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The list of Layer 3 Networks and related configuration for attachment.", + SerializedName = @"l3Networks", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkAttachmentConfiguration) })] + System.Collections.Generic.List AttachedNetworkConfigurationL3Network { get; set; } + /// The list of Trunked Networks and related configuration for attachment. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The list of Trunked Networks and related configuration for attachment.", + SerializedName = @"trunkedNetworks", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkAttachmentConfiguration) })] + System.Collections.Generic.List AttachedNetworkConfigurationTrunkedNetwork { get; set; } + /// + /// The full list of network resource IDs that are attached to this cluster, including those attached only to specific agent + /// pools. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The full list of network resource IDs that are attached to this cluster, including those attached only to specific agent pools.", + SerializedName = @"attachedNetworkIds", + PossibleTypes = new [] { typeof(string) })] + System.Collections.Generic.List AttachedNetworkId { get; } + /// The list of versions that this Kubernetes cluster can be upgraded to. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The list of versions that this Kubernetes cluster can be upgraded to.", + SerializedName = @"availableUpgrades", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAvailableUpgrade) })] + System.Collections.Generic.List AvailableUpgrade { get; } + /// + /// The association of IP address pools to the communities and peers, allowing for announcement of IPs. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The association of IP address pools to the communities and peers, allowing for announcement of IPs.", + SerializedName = @"bgpAdvertisements", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBgpAdvertisement) })] + System.Collections.Generic.List BgpServiceLoadBalancerConfigurationBgpAdvertisement { get; set; } + /// + /// The list of additional BgpPeer entities that the Kubernetes cluster will peer with. All peering must be explicitly defined. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The list of additional BgpPeer entities that the Kubernetes cluster will peer with. All peering must be explicitly defined.", + SerializedName = @"bgpPeers", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IServiceLoadBalancerBgpPeer) })] + System.Collections.Generic.List BgpServiceLoadBalancerConfigurationBgpPeer { get; set; } + /// The indicator to specify if the load balancer peers with the network fabric. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The indicator to specify if the load balancer peers with the network fabric.", + SerializedName = @"fabricPeeringEnabled", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("True", "False")] + string BgpServiceLoadBalancerConfigurationFabricPeeringEnabled { get; set; } + /// + /// The list of pools of IP addresses that can be allocated to load balancer services. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The list of pools of IP addresses that can be allocated to load balancer services.", + SerializedName = @"ipAddressPools", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IIPAddressPool) })] + System.Collections.Generic.List BgpServiceLoadBalancerConfigurationIPAddressPool { get; set; } + /// The resource ID of the Network Cloud cluster. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The resource ID of the Network Cloud cluster.", + SerializedName = @"clusterId", + PossibleTypes = new [] { typeof(string) })] + string ClusterId { get; } + /// + /// The resource ID of the connected cluster set up when this Kubernetes cluster is created. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The resource ID of the connected cluster set up when this Kubernetes cluster is created.", + SerializedName = @"connectedClusterId", + PossibleTypes = new [] { typeof(string) })] + string ConnectedClusterId { get; } + /// The current running version of Kubernetes on the control plane. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The current running version of Kubernetes on the control plane.", + SerializedName = @"controlPlaneKubernetesVersion", + PossibleTypes = new [] { typeof(string) })] + string ControlPlaneKubernetesVersion { get; } + /// + /// The user name for the administrator that will be applied to the operating systems that run Kubernetes nodes. If not supplied, + /// a user name will be chosen by the service. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The user name for the administrator that will be applied to the operating systems that run Kubernetes nodes. If not supplied, a user name will be chosen by the service.", + SerializedName = @"adminUsername", + PossibleTypes = new [] { typeof(string) })] + string ControlPlaneNodeConfigurationAdministratorConfigurationAdminUsername { get; set; } + /// + /// The SSH configuration for the operating systems that run the nodes in the Kubernetes cluster. In some cases, specification + /// of public keys may be required to produce a working environment. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The SSH configuration for the operating systems that run the nodes in the Kubernetes cluster. In some cases, specification of public keys may be required to produce a working environment.", + SerializedName = @"sshPublicKeys", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISshPublicKey) })] + System.Collections.Generic.List ControlPlaneNodeConfigurationAdministratorConfigurationSshPublicKey { get; set; } + /// + /// The list of availability zones of the Network Cloud cluster to be used for the provisioning of nodes in the control plane. + /// If not specified, all availability zones will be used. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The list of availability zones of the Network Cloud cluster to be used for the provisioning of nodes in the control plane. If not specified, all availability zones will be used.", + SerializedName = @"availabilityZones", + PossibleTypes = new [] { typeof(string) })] + System.Collections.Generic.List ControlPlaneNodeConfigurationAvailabilityZone { get; set; } + /// The number of virtual machines that use this configuration. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The number of virtual machines that use this configuration.", + SerializedName = @"count", + PossibleTypes = new [] { typeof(long) })] + long ControlPlaneNodeConfigurationCount { get; set; } + /// The name of the VM SKU supplied during creation. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The name of the VM SKU supplied during creation.", + SerializedName = @"vmSkuName", + PossibleTypes = new [] { typeof(string) })] + string ControlPlaneNodeConfigurationVMSkuName { get; set; } + /// The current status of the Kubernetes cluster. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The current status of the Kubernetes cluster.", + SerializedName = @"detailedStatus", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Available", "Error", "Provisioning")] + string DetailedStatus { get; } + /// The descriptive message about the current detailed status. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The descriptive message about the current detailed status.", + SerializedName = @"detailedStatusMessage", + PossibleTypes = new [] { typeof(string) })] + string DetailedStatusMessage { get; } + /// The current feature settings. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The current feature settings.", + SerializedName = @"featureStatuses", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IFeatureStatus) })] + System.Collections.Generic.List FeatureStatuses { get; } + /// + /// The agent pools that are created with this Kubernetes cluster for running critical system services and workloads. This + /// data in this field is only used during creation, and the field will be empty following the creation of the Kubernetes + /// Cluster. After creation, the management of agent pools is done using the agentPools sub-resource. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The agent pools that are created with this Kubernetes cluster for running critical system services and workloads. This data in this field is only used during creation, and the field will be empty following the creation of the Kubernetes Cluster. After creation, the management of agent pools is done using the agentPools sub-resource.", + SerializedName = @"initialAgentPoolConfigurations", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IInitialAgentPoolConfiguration) })] + System.Collections.Generic.List InitialAgentPoolConfiguration { get; set; } + /// The Kubernetes version for this cluster. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The Kubernetes version for this cluster.", + SerializedName = @"kubernetesVersion", + PossibleTypes = new [] { typeof(string) })] + string KubernetesVersion { get; set; } + /// + /// The list of pools of IP addresses that can be allocated to load balancer services. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The list of pools of IP addresses that can be allocated to load balancer services.", + SerializedName = @"ipAddressPools", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IIPAddressPool) })] + System.Collections.Generic.List L2ServiceLoadBalancerConfigurationIPAddressPool { get; set; } + /// + /// The location of the managed resource group. If not specified, the location of the parent resource is chosen. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The location of the managed resource group. If not specified, the location of the parent resource is chosen.", + SerializedName = @"location", + PossibleTypes = new [] { typeof(string) })] + string ManagedResourceGroupConfigurationLocation { get; set; } + /// + /// The name for the managed resource group. If not specified, the unique name is automatically generated. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The name for the managed resource group. If not specified, the unique name is automatically generated.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string ManagedResourceGroupConfigurationName { get; set; } + /// The resource ID of the associated Cloud Services network. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The resource ID of the associated Cloud Services network.", + SerializedName = @"cloudServicesNetworkId", + PossibleTypes = new [] { typeof(string) })] + string NetworkConfigurationCloudServicesNetworkId { get; set; } + /// + /// The resource ID of the Layer 3 network that is used for creation of the Container Networking Interface network. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The resource ID of the Layer 3 network that is used for creation of the Container Networking Interface network.", + SerializedName = @"cniNetworkId", + PossibleTypes = new [] { typeof(string) })] + string NetworkConfigurationCniNetworkId { get; set; } + /// + /// The IP address assigned to the Kubernetes DNS service. It must be within the Kubernetes service address range specified + /// in service CIDR. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The IP address assigned to the Kubernetes DNS service. It must be within the Kubernetes service address range specified in service CIDR.", + SerializedName = @"dnsServiceIp", + PossibleTypes = new [] { typeof(string) })] + string NetworkConfigurationDnsServiceIP { get; set; } + /// + /// The CIDR notation IP ranges from which to assign pod IPs. One IPv4 CIDR is expected for single-stack networking. Two CIDRs, + /// one for each IP family (IPv4/IPv6), is expected for dual-stack networking. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The CIDR notation IP ranges from which to assign pod IPs. One IPv4 CIDR is expected for single-stack networking. Two CIDRs, one for each IP family (IPv4/IPv6), is expected for dual-stack networking.", + SerializedName = @"podCidrs", + PossibleTypes = new [] { typeof(string) })] + System.Collections.Generic.List NetworkConfigurationPodCidr { get; set; } + /// + /// The CIDR notation IP ranges from which to assign service IPs. One IPv4 CIDR is expected for single-stack networking. Two + /// CIDRs, one for each IP family (IPv4/IPv6), is expected for dual-stack networking. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The CIDR notation IP ranges from which to assign service IPs. One IPv4 CIDR is expected for single-stack networking. Two CIDRs, one for each IP family (IPv4/IPv6), is expected for dual-stack networking.", + SerializedName = @"serviceCidrs", + PossibleTypes = new [] { typeof(string) })] + System.Collections.Generic.List NetworkConfigurationServiceCidr { get; set; } + /// The details of the nodes in this cluster. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The details of the nodes in this cluster.", + SerializedName = @"nodes", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterNode) })] + System.Collections.Generic.List Node { get; } + /// The provisioning state of the Kubernetes cluster resource. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The provisioning state of the Kubernetes cluster resource.", + SerializedName = @"provisioningState", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Succeeded", "Failed", "Canceled", "Accepted", "InProgress", "Created", "Updating", "Deleting")] + string ProvisioningState { get; } + /// + /// The SSH configuration for the operating systems that run the nodes in the Kubernetes cluster. In some cases, specification + /// of public keys may be required to produce a working environment. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The SSH configuration for the operating systems that run the nodes in the Kubernetes cluster. In some cases, specification of public keys may be required to produce a working environment.", + SerializedName = @"sshPublicKeys", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISshPublicKey) })] + System.Collections.Generic.List SshPublicKey { get; set; } + + } + /// KubernetesClusterProperties represents the properties of Kubernetes cluster resource. + internal partial interface IKubernetesClusterPropertiesInternal + + { + /// The Azure Active Directory Integration properties. + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAadConfiguration AadConfiguration { get; set; } + /// + /// The list of Azure Active Directory group object IDs that will have an administrative role on the Kubernetes cluster. + /// + System.Collections.Generic.List AadConfigurationAdminGroupObjectId { get; set; } + /// + /// The user name for the administrator that will be applied to the operating systems that run Kubernetes nodes. If not supplied, + /// a user name will be chosen by the service. + /// + string AdminUsername { get; set; } + /// + /// The administrative credentials that will be applied to the control plane and agent pool nodes that do not specify their + /// own values. + /// + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministratorConfiguration AdministratorConfiguration { get; set; } + /// The list of Layer 2 Networks and related configuration for attachment. + System.Collections.Generic.List AttachedNetworkConfigurationL2Network { get; set; } + /// The list of Layer 3 Networks and related configuration for attachment. + System.Collections.Generic.List AttachedNetworkConfigurationL3Network { get; set; } + /// The list of Trunked Networks and related configuration for attachment. + System.Collections.Generic.List AttachedNetworkConfigurationTrunkedNetwork { get; set; } + /// + /// The full list of network resource IDs that are attached to this cluster, including those attached only to specific agent + /// pools. + /// + System.Collections.Generic.List AttachedNetworkId { get; set; } + /// The list of versions that this Kubernetes cluster can be upgraded to. + System.Collections.Generic.List AvailableUpgrade { get; set; } + /// + /// The association of IP address pools to the communities and peers, allowing for announcement of IPs. + /// + System.Collections.Generic.List BgpServiceLoadBalancerConfigurationBgpAdvertisement { get; set; } + /// + /// The list of additional BgpPeer entities that the Kubernetes cluster will peer with. All peering must be explicitly defined. + /// + System.Collections.Generic.List BgpServiceLoadBalancerConfigurationBgpPeer { get; set; } + /// The indicator to specify if the load balancer peers with the network fabric. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("True", "False")] + string BgpServiceLoadBalancerConfigurationFabricPeeringEnabled { get; set; } + /// + /// The list of pools of IP addresses that can be allocated to load balancer services. + /// + System.Collections.Generic.List BgpServiceLoadBalancerConfigurationIPAddressPool { get; set; } + /// The resource ID of the Network Cloud cluster. + string ClusterId { get; set; } + /// + /// The resource ID of the connected cluster set up when this Kubernetes cluster is created. + /// + string ConnectedClusterId { get; set; } + /// The current running version of Kubernetes on the control plane. + string ControlPlaneKubernetesVersion { get; set; } + /// The defining characteristics of the control plane for this Kubernetes Cluster. + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IControlPlaneNodeConfiguration ControlPlaneNodeConfiguration { get; set; } + /// The administrator credentials to be used for the nodes in the control plane. + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministratorConfiguration ControlPlaneNodeConfigurationAdministratorConfiguration { get; set; } + /// + /// The user name for the administrator that will be applied to the operating systems that run Kubernetes nodes. If not supplied, + /// a user name will be chosen by the service. + /// + string ControlPlaneNodeConfigurationAdministratorConfigurationAdminUsername { get; set; } + /// + /// The SSH configuration for the operating systems that run the nodes in the Kubernetes cluster. In some cases, specification + /// of public keys may be required to produce a working environment. + /// + System.Collections.Generic.List ControlPlaneNodeConfigurationAdministratorConfigurationSshPublicKey { get; set; } + /// + /// The list of availability zones of the Network Cloud cluster to be used for the provisioning of nodes in the control plane. + /// If not specified, all availability zones will be used. + /// + System.Collections.Generic.List ControlPlaneNodeConfigurationAvailabilityZone { get; set; } + /// The number of virtual machines that use this configuration. + long ControlPlaneNodeConfigurationCount { get; set; } + /// The name of the VM SKU supplied during creation. + string ControlPlaneNodeConfigurationVMSkuName { get; set; } + /// The current status of the Kubernetes cluster. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Available", "Error", "Provisioning")] + string DetailedStatus { get; set; } + /// The descriptive message about the current detailed status. + string DetailedStatusMessage { get; set; } + /// The current feature settings. + System.Collections.Generic.List FeatureStatuses { get; set; } + /// + /// The agent pools that are created with this Kubernetes cluster for running critical system services and workloads. This + /// data in this field is only used during creation, and the field will be empty following the creation of the Kubernetes + /// Cluster. After creation, the management of agent pools is done using the agentPools sub-resource. + /// + System.Collections.Generic.List InitialAgentPoolConfiguration { get; set; } + /// The Kubernetes version for this cluster. + string KubernetesVersion { get; set; } + /// + /// The list of pools of IP addresses that can be allocated to load balancer services. + /// + System.Collections.Generic.List L2ServiceLoadBalancerConfigurationIPAddressPool { get; set; } + /// The configuration of the managed resource group associated with the resource. + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IManagedResourceGroupConfiguration ManagedResourceGroupConfiguration { get; set; } + /// + /// The location of the managed resource group. If not specified, the location of the parent resource is chosen. + /// + string ManagedResourceGroupConfigurationLocation { get; set; } + /// + /// The name for the managed resource group. If not specified, the unique name is automatically generated. + /// + string ManagedResourceGroupConfigurationName { get; set; } + /// + /// The configuration of the Kubernetes cluster networking, including the attachment of networks that span the cluster. + /// + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkConfiguration NetworkConfiguration { get; set; } + /// + /// The configuration of networks being attached to the cluster for use by the workloads that run on this Kubernetes cluster. + /// + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAttachedNetworkConfiguration NetworkConfigurationAttachedNetworkConfiguration { get; set; } + /// + /// The configuration of the BGP service load balancer for this Kubernetes cluster. A maximum of one service load balancer + /// may be specified, either Layer 2 or BGP. + /// + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBgpServiceLoadBalancerConfiguration NetworkConfigurationBgpServiceLoadBalancerConfiguration { get; set; } + /// The resource ID of the associated Cloud Services network. + string NetworkConfigurationCloudServicesNetworkId { get; set; } + /// + /// The resource ID of the Layer 3 network that is used for creation of the Container Networking Interface network. + /// + string NetworkConfigurationCniNetworkId { get; set; } + /// + /// The IP address assigned to the Kubernetes DNS service. It must be within the Kubernetes service address range specified + /// in service CIDR. + /// + string NetworkConfigurationDnsServiceIP { get; set; } + /// + /// The configuration of the Layer 2 service load balancer for this Kubernetes cluster. A maximum of one service load balancer + /// may be specified, either Layer 2 or BGP. + /// + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2ServiceLoadBalancerConfiguration NetworkConfigurationL2ServiceLoadBalancerConfiguration { get; set; } + /// + /// The CIDR notation IP ranges from which to assign pod IPs. One IPv4 CIDR is expected for single-stack networking. Two CIDRs, + /// one for each IP family (IPv4/IPv6), is expected for dual-stack networking. + /// + System.Collections.Generic.List NetworkConfigurationPodCidr { get; set; } + /// + /// The CIDR notation IP ranges from which to assign service IPs. One IPv4 CIDR is expected for single-stack networking. Two + /// CIDRs, one for each IP family (IPv4/IPv6), is expected for dual-stack networking. + /// + System.Collections.Generic.List NetworkConfigurationServiceCidr { get; set; } + /// The details of the nodes in this cluster. + System.Collections.Generic.List Node { get; set; } + /// The provisioning state of the Kubernetes cluster resource. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Succeeded", "Failed", "Canceled", "Accepted", "InProgress", "Created", "Updating", "Deleting")] + string ProvisioningState { get; set; } + /// + /// The SSH configuration for the operating systems that run the nodes in the Kubernetes cluster. In some cases, specification + /// of public keys may be required to produce a working environment. + /// + System.Collections.Generic.List SshPublicKey { get; set; } + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesClusterProperties.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesClusterProperties.json.cs new file mode 100644 index 000000000000..6111bdbf69a7 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesClusterProperties.json.cs @@ -0,0 +1,221 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + + /// + /// KubernetesClusterProperties represents the properties of Kubernetes cluster resource. + /// + public partial class KubernetesClusterProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new KubernetesClusterProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject instance to deserialize from. + internal KubernetesClusterProperties(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_aadConfiguration = If( json?.PropertyT("aadConfiguration"), out var __jsonAadConfiguration) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AadConfiguration.FromJson(__jsonAadConfiguration) : _aadConfiguration;} + {_administratorConfiguration = If( json?.PropertyT("administratorConfiguration"), out var __jsonAdministratorConfiguration) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AdministratorConfiguration.FromJson(__jsonAdministratorConfiguration) : _administratorConfiguration;} + {_controlPlaneNodeConfiguration = If( json?.PropertyT("controlPlaneNodeConfiguration"), out var __jsonControlPlaneNodeConfiguration) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ControlPlaneNodeConfiguration.FromJson(__jsonControlPlaneNodeConfiguration) : _controlPlaneNodeConfiguration;} + {_managedResourceGroupConfiguration = If( json?.PropertyT("managedResourceGroupConfiguration"), out var __jsonManagedResourceGroupConfiguration) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ManagedResourceGroupConfiguration.FromJson(__jsonManagedResourceGroupConfiguration) : _managedResourceGroupConfiguration;} + {_networkConfiguration = If( json?.PropertyT("networkConfiguration"), out var __jsonNetworkConfiguration) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.NetworkConfiguration.FromJson(__jsonNetworkConfiguration) : _networkConfiguration;} + {_attachedNetworkId = If( json?.PropertyT("attachedNetworkIds"), out var __jsonAttachedNetworkIds) ? If( __jsonAttachedNetworkIds as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : _attachedNetworkId;} + {_availableUpgrade = If( json?.PropertyT("availableUpgrades"), out var __jsonAvailableUpgrades) ? If( __jsonAvailableUpgrades as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.IAvailableUpgrade) (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AvailableUpgrade.FromJson(__p) )) ))() : null : _availableUpgrade;} + {_clusterId = If( json?.PropertyT("clusterId"), out var __jsonClusterId) ? (string)__jsonClusterId : (string)_clusterId;} + {_connectedClusterId = If( json?.PropertyT("connectedClusterId"), out var __jsonConnectedClusterId) ? (string)__jsonConnectedClusterId : (string)_connectedClusterId;} + {_controlPlaneKubernetesVersion = If( json?.PropertyT("controlPlaneKubernetesVersion"), out var __jsonControlPlaneKubernetesVersion) ? (string)__jsonControlPlaneKubernetesVersion : (string)_controlPlaneKubernetesVersion;} + {_detailedStatus = If( json?.PropertyT("detailedStatus"), out var __jsonDetailedStatus) ? (string)__jsonDetailedStatus : (string)_detailedStatus;} + {_detailedStatusMessage = If( json?.PropertyT("detailedStatusMessage"), out var __jsonDetailedStatusMessage) ? (string)__jsonDetailedStatusMessage : (string)_detailedStatusMessage;} + {_featureStatuses = If( json?.PropertyT("featureStatuses"), out var __jsonFeatureStatuses) ? If( __jsonFeatureStatuses as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonArray, out var __l) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__l, (__k)=>(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IFeatureStatus) (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.FeatureStatus.FromJson(__k) )) ))() : null : _featureStatuses;} + {_initialAgentPoolConfiguration = If( json?.PropertyT("initialAgentPoolConfigurations"), out var __jsonInitialAgentPoolConfigurations) ? If( __jsonInitialAgentPoolConfigurations as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonArray, out var __g) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__g, (__f)=>(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IInitialAgentPoolConfiguration) (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.InitialAgentPoolConfiguration.FromJson(__f) )) ))() : null : _initialAgentPoolConfiguration;} + {_kubernetesVersion = If( json?.PropertyT("kubernetesVersion"), out var __jsonKubernetesVersion) ? (string)__jsonKubernetesVersion : (string)_kubernetesVersion;} + {_node = If( json?.PropertyT("nodes"), out var __jsonNodes) ? If( __jsonNodes as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonArray, out var __b) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__b, (__a)=>(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterNode) (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.KubernetesClusterNode.FromJson(__a) )) ))() : null : _node;} + {_provisioningState = If( json?.PropertyT("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)_provisioningState;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)||serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate)) + { + AddIf( null != this._aadConfiguration ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) this._aadConfiguration.ToJson(null,serializationMode) : null, "aadConfiguration" ,container.Add ); + } + AddIf( null != this._administratorConfiguration ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) this._administratorConfiguration.ToJson(null,serializationMode) : null, "administratorConfiguration" ,container.Add ); + AddIf( null != this._controlPlaneNodeConfiguration ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) this._controlPlaneNodeConfiguration.ToJson(null,serializationMode) : null, "controlPlaneNodeConfiguration" ,container.Add ); + AddIf( null != this._managedResourceGroupConfiguration ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) this._managedResourceGroupConfiguration.ToJson(null,serializationMode) : null, "managedResourceGroupConfiguration" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)||serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate)) + { + AddIf( null != this._networkConfiguration ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) this._networkConfiguration.ToJson(null,serializationMode) : null, "networkConfiguration" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) + { + if (null != this._attachedNetworkId) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.XNodeArray(); + foreach( var __x in this._attachedNetworkId ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("attachedNetworkIds",__w); + } + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) + { + if (null != this._availableUpgrade) + { + var __r = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.XNodeArray(); + foreach( var __s in this._availableUpgrade ) + { + AddIf(__s?.ToJson(null, serializationMode) ,__r.Add); + } + container.Add("availableUpgrades",__r); + } + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) + { + AddIf( null != (((object)this._clusterId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._clusterId.ToString()) : null, "clusterId" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) + { + AddIf( null != (((object)this._connectedClusterId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._connectedClusterId.ToString()) : null, "connectedClusterId" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) + { + AddIf( null != (((object)this._controlPlaneKubernetesVersion)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._controlPlaneKubernetesVersion.ToString()) : null, "controlPlaneKubernetesVersion" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) + { + AddIf( null != (((object)this._detailedStatus)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._detailedStatus.ToString()) : null, "detailedStatus" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) + { + AddIf( null != (((object)this._detailedStatusMessage)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._detailedStatusMessage.ToString()) : null, "detailedStatusMessage" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) + { + if (null != this._featureStatuses) + { + var __m = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.XNodeArray(); + foreach( var __n in this._featureStatuses ) + { + AddIf(__n?.ToJson(null, serializationMode) ,__m.Add); + } + container.Add("featureStatuses",__m); + } + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)||serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate)) + { + if (null != this._initialAgentPoolConfiguration) + { + var __h = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.XNodeArray(); + foreach( var __i in this._initialAgentPoolConfiguration ) + { + AddIf(__i?.ToJson(null, serializationMode) ,__h.Add); + } + container.Add("initialAgentPoolConfigurations",__h); + } + } + AddIf( null != (((object)this._kubernetesVersion)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._kubernetesVersion.ToString()) : null, "kubernetesVersion" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) + { + if (null != this._node) + { + var __c = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.XNodeArray(); + foreach( var __d in this._node ) + { + AddIf(__d?.ToJson(null, serializationMode) ,__c.Add); + } + container.Add("nodes",__c); + } + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) + { + AddIf( null != (((object)this._provisioningState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._provisioningState.ToString()) : null, "provisioningState" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesClusterRestartNodeParameters.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesClusterRestartNodeParameters.PowerShell.cs similarity index 83% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesClusterRestartNodeParameters.PowerShell.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesClusterRestartNodeParameters.PowerShell.cs index 6998e47bd902..669b3e1686d4 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesClusterRestartNodeParameters.PowerShell.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesClusterRestartNodeParameters.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; @@ -65,29 +65,29 @@ public partial class KubernetesClusterRestartNodeParameters 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.NetworkCloud.Models.Api20250201.IKubernetesClusterRestartNodeParameters DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterRestartNodeParameters DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new KubernetesClusterRestartNodeParameters(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.NetworkCloud.Models.Api20250201.IKubernetesClusterRestartNodeParameters DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterRestartNodeParameters DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new KubernetesClusterRestartNodeParameters(content); } @@ -100,10 +100,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201 /// /// an instance of the model class. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterRestartNodeParameters FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterRestartNodeParameters FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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. @@ -118,13 +118,13 @@ internal KubernetesClusterRestartNodeParameters(global::System.Collections.IDict // actually deserialize if (content.Contains("NodeName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterRestartNodeParametersInternal)this).NodeName = (string) content.GetValueForProperty("NodeName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterRestartNodeParametersInternal)this).NodeName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterRestartNodeParametersInternal)this).NodeName = (string) content.GetValueForProperty("NodeName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterRestartNodeParametersInternal)this).NodeName, 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. @@ -139,7 +139,7 @@ internal KubernetesClusterRestartNodeParameters(global::System.Management.Automa // actually deserialize if (content.Contains("NodeName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterRestartNodeParametersInternal)this).NodeName = (string) content.GetValueForProperty("NodeName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterRestartNodeParametersInternal)this).NodeName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterRestartNodeParametersInternal)this).NodeName = (string) content.GetValueForProperty("NodeName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterRestartNodeParametersInternal)this).NodeName, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesClusterRestartNodeParameters.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesClusterRestartNodeParameters.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesClusterRestartNodeParameters.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesClusterRestartNodeParameters.TypeConverter.cs index ef9b9e2a2bcf..1441a4fde4d5 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesClusterRestartNodeParameters.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesClusterRestartNodeParameters.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IKubernetesClusterRestartNodeParameters ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterRestartNodeParameters ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterRestartNodeParameters).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterRestartNodeParameters).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesClusterRestartNodeParameters.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesClusterRestartNodeParameters.cs similarity index 88% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesClusterRestartNodeParameters.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesClusterRestartNodeParameters.cs index 62635d746b2e..8bb309b4c1f3 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesClusterRestartNodeParameters.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesClusterRestartNodeParameters.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -11,8 +11,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201 /// KubernetesClusterRestartNodeParameters represents the body of the request to restart the node of a Kubernetes cluster. /// public partial class KubernetesClusterRestartNodeParameters : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterRestartNodeParameters, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterRestartNodeParametersInternal + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterRestartNodeParameters, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterRestartNodeParametersInternal { /// Backing field for property. @@ -36,6 +36,9 @@ public partial interface IKubernetesClusterRestartNodeParameters : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The name of the node to restart.", SerializedName = @"nodeName", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesClusterRestartNodeParameters.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesClusterRestartNodeParameters.json.cs similarity index 94% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesClusterRestartNodeParameters.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesClusterRestartNodeParameters.json.cs index fce29996639f..62d4cff529f2 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesClusterRestartNodeParameters.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesClusterRestartNodeParameters.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -56,13 +56,13 @@ public partial class KubernetesClusterRestartNodeParameters partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterRestartNodeParameters. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterRestartNodeParameters. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterRestartNodeParameters. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterRestartNodeParameters. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterRestartNodeParameters FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterRestartNodeParameters FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new KubernetesClusterRestartNodeParameters(json) : null; } @@ -79,7 +79,7 @@ internal KubernetesClusterRestartNodeParameters(Microsoft.Azure.PowerShell.Cmdle { return; } - {_nodeName = If( json?.PropertyT("nodeName"), out var __jsonNodeName) ? (string)__jsonNodeName : (string)NodeName;} + {_nodeName = If( json?.PropertyT("nodeName"), out var __jsonNodeName) ? (string)__jsonNodeName : (string)_nodeName;} AfterFromJson(json); } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesLabel.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesLabel.PowerShell.cs similarity index 82% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesLabel.PowerShell.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesLabel.PowerShell.cs index ef0ad9d8f5f9..ce24847dc18b 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesLabel.PowerShell.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesLabel.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; @@ -65,27 +65,27 @@ public partial class KubernetesLabel 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.NetworkCloud.Models.Api20250201.IKubernetesLabel DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesLabel DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new KubernetesLabel(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.NetworkCloud.Models.Api20250201.IKubernetesLabel DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesLabel DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new KubernetesLabel(content); } @@ -95,10 +95,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesLabel FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesLabel FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 KubernetesLabel(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Key")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesLabelInternal)this).Key = (string) content.GetValueForProperty("Key",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesLabelInternal)this).Key, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesLabelInternal)this).Key = (string) content.GetValueForProperty("Key",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesLabelInternal)this).Key, global::System.Convert.ToString); } if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesLabelInternal)this).Value = (string) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesLabelInternal)this).Value, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesLabelInternal)this).Value = (string) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesLabelInternal)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. @@ -138,11 +138,11 @@ internal KubernetesLabel(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Key")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesLabelInternal)this).Key = (string) content.GetValueForProperty("Key",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesLabelInternal)this).Key, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesLabelInternal)this).Key = (string) content.GetValueForProperty("Key",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesLabelInternal)this).Key, global::System.Convert.ToString); } if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesLabelInternal)this).Value = (string) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesLabelInternal)this).Value, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesLabelInternal)this).Value = (string) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesLabelInternal)this).Value, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesLabel.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesLabel.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesLabel.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesLabel.TypeConverter.cs index 6bcc9e3d1bfa..acaa58f701e2 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesLabel.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesLabel.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IKubernetesLabel ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesLabel ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesLabel).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesLabel).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesLabel.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesLabel.cs similarity index 89% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesLabel.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesLabel.cs index ad5f798cd242..1def3cd17854 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesLabel.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesLabel.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -11,8 +11,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201 /// KubernetesLabel represents a single entry for a Kubernetes label or taint such as those used on a node or pod. /// public partial class KubernetesLabel : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesLabel, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesLabelInternal + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesLabel, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesLabelInternal { /// Backing field for property. @@ -41,16 +41,22 @@ public partial interface IKubernetesLabel : { /// The name of the label or taint. [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, + Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = false, Description = @"The name of the label or taint.", SerializedName = @"key", PossibleTypes = new [] { typeof(string) })] string Key { get; set; } /// The value of the label or taint. [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, + Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = false, Description = @"The value of the label or taint.", SerializedName = @"value", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesLabel.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesLabel.json.cs similarity index 82% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesLabel.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesLabel.json.cs index 7e848503d78c..0291c88f7d08 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/KubernetesLabel.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/KubernetesLabel.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -56,13 +56,13 @@ public partial class KubernetesLabel partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesLabel. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesLabel. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesLabel. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesLabel. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesLabel FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesLabel FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new KubernetesLabel(json) : null; } @@ -79,8 +79,8 @@ internal KubernetesLabel(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime { return; } - {_key = If( json?.PropertyT("key"), out var __jsonKey) ? (string)__jsonKey : (string)Key;} - {_value = If( json?.PropertyT("value"), out var __jsonValue) ? (string)__jsonValue : (string)Value;} + {_key = If( json?.PropertyT("key"), out var __jsonKey) ? (string)__jsonKey : (string)_key;} + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? (string)__jsonValue : (string)_value;} AfterFromJson(json); } @@ -103,8 +103,14 @@ public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode ToJ { return container; } - AddIf( null != (((object)this._key)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._key.ToString()) : null, "key" ,container.Add ); - AddIf( null != (((object)this._value)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._value.ToString()) : null, "value" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)||serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate)) + { + AddIf( null != (((object)this._key)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._key.ToString()) : null, "key" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)||serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate)) + { + AddIf( null != (((object)this._value)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._value.ToString()) : null, "value" ,container.Add ); + } AfterToJson(ref container); return container; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/L2Network.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/L2Network.PowerShell.cs new file mode 100644 index 000000000000..6fba031b7cef --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/L2Network.PowerShell.cs @@ -0,0 +1,374 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + + /// + /// L2Network represents a network that utilizes a single isolation domain set up for layer-2 resources. + /// + [System.ComponentModel.TypeConverter(typeof(L2NetworkTypeConverter))] + public partial class L2Network + { + + /// + /// 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.NetworkCloud.Models.IL2Network DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new L2Network(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.NetworkCloud.Models.IL2Network DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new L2Network(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.NetworkCloud.Models.IL2Network FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal L2Network(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ExtendedLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkInternal)this).ExtendedLocation = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocation) content.GetValueForProperty("ExtendedLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkInternal)this).ExtendedLocation, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ExtendedLocationTypeConverter.ConvertFrom); + } + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.L2NetworkPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Etag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkInternal)this).Etag, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)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("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedByType = (string) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedByType = (string) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.TrackedResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("ExtendedLocationName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkInternal)this).ExtendedLocationName = (string) content.GetValueForProperty("ExtendedLocationName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkInternal)this).ExtendedLocationName, global::System.Convert.ToString); + } + if (content.Contains("ExtendedLocationType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkInternal)this).ExtendedLocationType = (string) content.GetValueForProperty("ExtendedLocationType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkInternal)this).ExtendedLocationType, global::System.Convert.ToString); + } + if (content.Contains("AssociatedResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkInternal)this).AssociatedResourceId = (System.Collections.Generic.List) content.GetValueForProperty("AssociatedResourceId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkInternal)this).AssociatedResourceId, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("ClusterId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkInternal)this).ClusterId = (string) content.GetValueForProperty("ClusterId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkInternal)this).ClusterId, global::System.Convert.ToString); + } + if (content.Contains("DetailedStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkInternal)this).DetailedStatus = (string) content.GetValueForProperty("DetailedStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkInternal)this).DetailedStatus, global::System.Convert.ToString); + } + if (content.Contains("DetailedStatusMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkInternal)this).DetailedStatusMessage = (string) content.GetValueForProperty("DetailedStatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkInternal)this).DetailedStatusMessage, global::System.Convert.ToString); + } + if (content.Contains("HybridAksClustersAssociatedId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkInternal)this).HybridAksClustersAssociatedId = (System.Collections.Generic.List) content.GetValueForProperty("HybridAksClustersAssociatedId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkInternal)this).HybridAksClustersAssociatedId, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("HybridAksPluginType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkInternal)this).HybridAksPluginType = (string) content.GetValueForProperty("HybridAksPluginType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkInternal)this).HybridAksPluginType, global::System.Convert.ToString); + } + if (content.Contains("InterfaceName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkInternal)this).InterfaceName = (string) content.GetValueForProperty("InterfaceName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkInternal)this).InterfaceName, global::System.Convert.ToString); + } + if (content.Contains("L2IsolationDomainId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkInternal)this).L2IsolationDomainId = (string) content.GetValueForProperty("L2IsolationDomainId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkInternal)this).L2IsolationDomainId, global::System.Convert.ToString); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("VirtualMachinesAssociatedId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkInternal)this).VirtualMachinesAssociatedId = (System.Collections.Generic.List) content.GetValueForProperty("VirtualMachinesAssociatedId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkInternal)this).VirtualMachinesAssociatedId, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal L2Network(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ExtendedLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkInternal)this).ExtendedLocation = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocation) content.GetValueForProperty("ExtendedLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkInternal)this).ExtendedLocation, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ExtendedLocationTypeConverter.ConvertFrom); + } + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.L2NetworkPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Etag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkInternal)this).Etag, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)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("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedByType = (string) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedByType = (string) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.TrackedResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("ExtendedLocationName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkInternal)this).ExtendedLocationName = (string) content.GetValueForProperty("ExtendedLocationName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkInternal)this).ExtendedLocationName, global::System.Convert.ToString); + } + if (content.Contains("ExtendedLocationType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkInternal)this).ExtendedLocationType = (string) content.GetValueForProperty("ExtendedLocationType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkInternal)this).ExtendedLocationType, global::System.Convert.ToString); + } + if (content.Contains("AssociatedResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkInternal)this).AssociatedResourceId = (System.Collections.Generic.List) content.GetValueForProperty("AssociatedResourceId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkInternal)this).AssociatedResourceId, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("ClusterId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkInternal)this).ClusterId = (string) content.GetValueForProperty("ClusterId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkInternal)this).ClusterId, global::System.Convert.ToString); + } + if (content.Contains("DetailedStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkInternal)this).DetailedStatus = (string) content.GetValueForProperty("DetailedStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkInternal)this).DetailedStatus, global::System.Convert.ToString); + } + if (content.Contains("DetailedStatusMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkInternal)this).DetailedStatusMessage = (string) content.GetValueForProperty("DetailedStatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkInternal)this).DetailedStatusMessage, global::System.Convert.ToString); + } + if (content.Contains("HybridAksClustersAssociatedId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkInternal)this).HybridAksClustersAssociatedId = (System.Collections.Generic.List) content.GetValueForProperty("HybridAksClustersAssociatedId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkInternal)this).HybridAksClustersAssociatedId, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("HybridAksPluginType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkInternal)this).HybridAksPluginType = (string) content.GetValueForProperty("HybridAksPluginType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkInternal)this).HybridAksPluginType, global::System.Convert.ToString); + } + if (content.Contains("InterfaceName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkInternal)this).InterfaceName = (string) content.GetValueForProperty("InterfaceName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkInternal)this).InterfaceName, global::System.Convert.ToString); + } + if (content.Contains("L2IsolationDomainId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkInternal)this).L2IsolationDomainId = (string) content.GetValueForProperty("L2IsolationDomainId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkInternal)this).L2IsolationDomainId, global::System.Convert.ToString); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("VirtualMachinesAssociatedId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkInternal)this).VirtualMachinesAssociatedId = (System.Collections.Generic.List) content.GetValueForProperty("VirtualMachinesAssociatedId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkInternal)this).VirtualMachinesAssociatedId, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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(); + } + } + /// L2Network represents a network that utilizes a single isolation domain set up for layer-2 resources. + [System.ComponentModel.TypeConverter(typeof(L2NetworkTypeConverter))] + public partial interface IL2Network + + { + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/L2Network.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/L2Network.TypeConverter.cs similarity index 98% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/L2Network.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/L2Network.TypeConverter.cs index 4ce19719cc2e..343fb9e29a13 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/L2Network.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/L2Network.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IL2Network ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2Network ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2Network).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2Network).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/L2Network.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/L2Network.cs new file mode 100644 index 000000000000..83a93782beab --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/L2Network.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.NetworkCloud.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + + /// + /// L2Network represents a network that utilizes a single isolation domain set up for layer-2 resources. + /// + public partial class L2Network : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2Network, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkInternal, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResource __trackedResource = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.TrackedResource(); + + /// + /// The list of resource IDs for the other Microsoft.NetworkCloud resources that have attached this network. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public System.Collections.Generic.List AssociatedResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkPropertiesInternal)Property).AssociatedResourceId; } + + /// + /// The resource ID of the Network Cloud cluster this L2 network is associated with. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string ClusterId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkPropertiesInternal)Property).ClusterId; } + + /// The more detailed status of the L2 network. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string DetailedStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkPropertiesInternal)Property).DetailedStatus; } + + /// The descriptive message about the current detailed status. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string DetailedStatusMessage { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkPropertiesInternal)Property).DetailedStatusMessage; } + + /// Backing field for property. + private string _etag; + + /// Resource ETag. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string Etag { get => this._etag; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocation _extendedLocation; + + /// The extended location of the cluster associated with the resource. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocation ExtendedLocation { get => (this._extendedLocation = this._extendedLocation ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ExtendedLocation()); set => this._extendedLocation = value; } + + /// The resource ID of the extended location on which the resource will be created. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string ExtendedLocationName { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocationInternal)ExtendedLocation).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocationInternal)ExtendedLocation).Name = value ?? null; } + + /// The extended location type, for example, CustomLocation. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string ExtendedLocationType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocationInternal)ExtendedLocation).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocationInternal)ExtendedLocation).Type = value ?? null; } + + /// + /// Field Deprecated. These fields will be empty/omitted. The list of Hybrid AKS cluster resource ID(s) that are associated + /// with this L2 network. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public System.Collections.Generic.List HybridAksClustersAssociatedId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkPropertiesInternal)Property).HybridAksClustersAssociatedId; } + + /// + /// Field Deprecated. The field was previously optional, now it will have no defined behavior and will be ignored. The network + /// plugin type for Hybrid AKS. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string HybridAksPluginType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkPropertiesInternal)Property).HybridAksPluginType; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkPropertiesInternal)Property).HybridAksPluginType = value ?? null; } + + /// + /// Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).Id; } + + /// + /// The default interface name for this L2 network in the virtual machine. This name can be overridden by the name supplied + /// in the network attachment configuration of that virtual machine. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string InterfaceName { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkPropertiesInternal)Property).InterfaceName; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkPropertiesInternal)Property).InterfaceName = value ?? null; } + + /// The resource ID of the Network Fabric l2IsolationDomain. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string L2IsolationDomainId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkPropertiesInternal)Property).L2IsolationDomainId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkPropertiesInternal)Property).L2IsolationDomainId = value ?? null; } + + /// The geo-location where the resource lives + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)__trackedResource).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)__trackedResource).Location = value ?? null; } + + /// Internal Acessors for AssociatedResourceId + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkInternal.AssociatedResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkPropertiesInternal)Property).AssociatedResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkPropertiesInternal)Property).AssociatedResourceId = value ?? null /* arrayOf */; } + + /// Internal Acessors for ClusterId + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkInternal.ClusterId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkPropertiesInternal)Property).ClusterId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkPropertiesInternal)Property).ClusterId = value ?? null; } + + /// Internal Acessors for DetailedStatus + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkInternal.DetailedStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkPropertiesInternal)Property).DetailedStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkPropertiesInternal)Property).DetailedStatus = value ?? null; } + + /// Internal Acessors for DetailedStatusMessage + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkInternal.DetailedStatusMessage { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkPropertiesInternal)Property).DetailedStatusMessage; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkPropertiesInternal)Property).DetailedStatusMessage = value ?? null; } + + /// Internal Acessors for Etag + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkInternal.Etag { get => this._etag; set { {_etag = value;} } } + + /// Internal Acessors for ExtendedLocation + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocation Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkInternal.ExtendedLocation { get => (this._extendedLocation = this._extendedLocation ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ExtendedLocation()); set { {_extendedLocation = value;} } } + + /// Internal Acessors for HybridAksClustersAssociatedId + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkInternal.HybridAksClustersAssociatedId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkPropertiesInternal)Property).HybridAksClustersAssociatedId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkPropertiesInternal)Property).HybridAksClustersAssociatedId = value ?? null /* arrayOf */; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkProperties Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.L2NetworkProperties()); set { {_property = value;} } } + + /// Internal Acessors for ProvisioningState + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkPropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkPropertiesInternal)Property).ProvisioningState = value ?? null; } + + /// Internal Acessors for VirtualMachinesAssociatedId + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkInternal.VirtualMachinesAssociatedId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkPropertiesInternal)Property).VirtualMachinesAssociatedId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkPropertiesInternal)Property).VirtualMachinesAssociatedId = value ?? null /* arrayOf */; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).Id = value ?? null; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).Name = value ?? null; } + + /// Internal Acessors for SystemData + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISystemData Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemData; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemData = value ?? null /* model class */; } + + /// Internal Acessors for SystemDataCreatedAt + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataCreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataCreatedAt = value ?? default(global::System.DateTime); } + + /// Internal Acessors for SystemDataCreatedBy + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataCreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataCreatedBy = value ?? null; } + + /// Internal Acessors for SystemDataCreatedByType + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataCreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataCreatedByType = value ?? null; } + + /// Internal Acessors for SystemDataLastModifiedAt + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedAt = value ?? default(global::System.DateTime); } + + /// Internal Acessors for SystemDataLastModifiedBy + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedBy = value ?? null; } + + /// Internal Acessors for SystemDataLastModifiedByType + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedByType = value ?? null; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).Type = value ?? null; } + + /// The name of the resource + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).Name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkProperties _property; + + /// The list of the resource properties. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.L2NetworkProperties()); set => this._property = value; } + + /// The provisioning state of the L2 network. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkPropertiesInternal)Property).ProvisioningState; } + + /// Gets the resource group name + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string ResourceGroupName { get => (new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Success ? new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Groups["resourceGroupName"].Value : null); } + + /// + /// Azure Resource Manager metadata containing createdBy and modifiedBy information. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISystemData SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemData; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemData = value ?? null /* model class */; } + + /// The timestamp of resource creation (UTC). + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataCreatedAt; } + + /// The identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataCreatedBy; } + + /// The type of identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public string SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataCreatedByType; } + + /// The timestamp of resource last modification (UTC) + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedAt; } + + /// The identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedBy; } + + /// The type of identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public string SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedByType; } + + /// Resource tags. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)__trackedResource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).Type; } + + /// + /// Field Deprecated. These fields will be empty/omitted. The list of virtual machine resource ID(s), excluding any Hybrid + /// AKS virtual machines, that are currently using this L2 network. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public System.Collections.Generic.List VirtualMachinesAssociatedId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkPropertiesInternal)Property).VirtualMachinesAssociatedId; } + + /// Creates an new instance. + public L2Network() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__trackedResource), __trackedResource); + await eventListener.AssertObjectIsValid(nameof(__trackedResource), __trackedResource); + } + } + /// L2Network represents a network that utilizes a single isolation domain set up for layer-2 resources. + public partial interface IL2Network : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResource + { + /// + /// The list of resource IDs for the other Microsoft.NetworkCloud resources that have attached this network. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The list of resource IDs for the other Microsoft.NetworkCloud resources that have attached this network.", + SerializedName = @"associatedResourceIds", + PossibleTypes = new [] { typeof(string) })] + System.Collections.Generic.List AssociatedResourceId { get; } + /// + /// The resource ID of the Network Cloud cluster this L2 network is associated with. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The resource ID of the Network Cloud cluster this L2 network is associated with.", + SerializedName = @"clusterId", + PossibleTypes = new [] { typeof(string) })] + string ClusterId { get; } + /// The more detailed status of the L2 network. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The more detailed status of the L2 network.", + SerializedName = @"detailedStatus", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Error", "Available", "Provisioning")] + string DetailedStatus { get; } + /// The descriptive message about the current detailed status. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The descriptive message about the current detailed status.", + SerializedName = @"detailedStatusMessage", + PossibleTypes = new [] { typeof(string) })] + string DetailedStatusMessage { get; } + /// Resource ETag. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"Resource ETag.", + SerializedName = @"etag", + PossibleTypes = new [] { typeof(string) })] + string Etag { get; } + /// The resource ID of the extended location on which the resource will be created. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The resource ID of the extended location on which the resource will be created.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string ExtendedLocationName { get; set; } + /// The extended location type, for example, CustomLocation. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The extended location type, for example, CustomLocation.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + string ExtendedLocationType { get; set; } + /// + /// Field Deprecated. These fields will be empty/omitted. The list of Hybrid AKS cluster resource ID(s) that are associated + /// with this L2 network. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"Field Deprecated. These fields will be empty/omitted. The list of Hybrid AKS cluster resource ID(s) that are associated with this L2 network.", + SerializedName = @"hybridAksClustersAssociatedIds", + PossibleTypes = new [] { typeof(string) })] + System.Collections.Generic.List HybridAksClustersAssociatedId { get; } + /// + /// Field Deprecated. The field was previously optional, now it will have no defined behavior and will be ignored. The network + /// plugin type for Hybrid AKS. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"Field Deprecated. The field was previously optional, now it will have no defined behavior and will be ignored. The network plugin type for Hybrid AKS.", + SerializedName = @"hybridAksPluginType", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("DPDK", "SRIOV", "OSDevice")] + string HybridAksPluginType { get; set; } + /// + /// The default interface name for this L2 network in the virtual machine. This name can be overridden by the name supplied + /// in the network attachment configuration of that virtual machine. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The default interface name for this L2 network in the virtual machine. This name can be overridden by the name supplied in the network attachment configuration of that virtual machine.", + SerializedName = @"interfaceName", + PossibleTypes = new [] { typeof(string) })] + string InterfaceName { get; set; } + /// The resource ID of the Network Fabric l2IsolationDomain. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The resource ID of the Network Fabric l2IsolationDomain.", + SerializedName = @"l2IsolationDomainId", + PossibleTypes = new [] { typeof(string) })] + string L2IsolationDomainId { get; set; } + /// The provisioning state of the L2 network. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The provisioning state of the L2 network.", + SerializedName = @"provisioningState", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Succeeded", "Failed", "Canceled", "Provisioning", "Accepted")] + string ProvisioningState { get; } + /// + /// Field Deprecated. These fields will be empty/omitted. The list of virtual machine resource ID(s), excluding any Hybrid + /// AKS virtual machines, that are currently using this L2 network. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"Field Deprecated. These fields will be empty/omitted. The list of virtual machine resource ID(s), excluding any Hybrid AKS virtual machines, that are currently using this L2 network.", + SerializedName = @"virtualMachinesAssociatedIds", + PossibleTypes = new [] { typeof(string) })] + System.Collections.Generic.List VirtualMachinesAssociatedId { get; } + + } + /// L2Network represents a network that utilizes a single isolation domain set up for layer-2 resources. + internal partial interface IL2NetworkInternal : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal + { + /// + /// The list of resource IDs for the other Microsoft.NetworkCloud resources that have attached this network. + /// + System.Collections.Generic.List AssociatedResourceId { get; set; } + /// + /// The resource ID of the Network Cloud cluster this L2 network is associated with. + /// + string ClusterId { get; set; } + /// The more detailed status of the L2 network. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Error", "Available", "Provisioning")] + string DetailedStatus { get; set; } + /// The descriptive message about the current detailed status. + string DetailedStatusMessage { get; set; } + /// Resource ETag. + string Etag { get; set; } + /// The extended location of the cluster associated with the resource. + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocation ExtendedLocation { get; set; } + /// The resource ID of the extended location on which the resource will be created. + string ExtendedLocationName { get; set; } + /// The extended location type, for example, CustomLocation. + string ExtendedLocationType { get; set; } + /// + /// Field Deprecated. These fields will be empty/omitted. The list of Hybrid AKS cluster resource ID(s) that are associated + /// with this L2 network. + /// + System.Collections.Generic.List HybridAksClustersAssociatedId { get; set; } + /// + /// Field Deprecated. The field was previously optional, now it will have no defined behavior and will be ignored. The network + /// plugin type for Hybrid AKS. + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("DPDK", "SRIOV", "OSDevice")] + string HybridAksPluginType { get; set; } + /// + /// The default interface name for this L2 network in the virtual machine. This name can be overridden by the name supplied + /// in the network attachment configuration of that virtual machine. + /// + string InterfaceName { get; set; } + /// The resource ID of the Network Fabric l2IsolationDomain. + string L2IsolationDomainId { get; set; } + /// The list of the resource properties. + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkProperties Property { get; set; } + /// The provisioning state of the L2 network. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Succeeded", "Failed", "Canceled", "Provisioning", "Accepted")] + string ProvisioningState { get; set; } + /// + /// Field Deprecated. These fields will be empty/omitted. The list of virtual machine resource ID(s), excluding any Hybrid + /// AKS virtual machines, that are currently using this L2 network. + /// + System.Collections.Generic.List VirtualMachinesAssociatedId { get; set; } + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/L2Network.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/L2Network.json.cs similarity index 92% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/L2Network.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/L2Network.json.cs index d83f9b0411b5..2f7a73a32e4a 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/L2Network.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/L2Network.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -56,13 +56,13 @@ public partial class L2Network partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2Network. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2Network. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2Network. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2Network. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2Network FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2Network FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new L2Network(json) : null; } @@ -79,10 +79,10 @@ internal L2Network(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json. { return; } - __trackedResource = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.TrackedResource(json); - {_extendedLocation = If( json?.PropertyT("extendedLocation"), out var __jsonExtendedLocation) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ExtendedLocation.FromJson(__jsonExtendedLocation) : ExtendedLocation;} - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.L2NetworkProperties.FromJson(__jsonProperties) : Property;} - {_etag = If( json?.PropertyT("etag"), out var __jsonEtag) ? (string)__jsonEtag : (string)Etag;} + __trackedResource = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.TrackedResource(json); + {_extendedLocation = If( json?.PropertyT("extendedLocation"), out var __jsonExtendedLocation) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ExtendedLocation.FromJson(__jsonExtendedLocation) : _extendedLocation;} + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.L2NetworkProperties.FromJson(__jsonProperties) : _property;} + {_etag = If( json?.PropertyT("etag"), out var __jsonEtag) ? (string)__jsonEtag : (string)_etag;} AfterFromJson(json); } @@ -108,7 +108,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode ToJ __trackedResource?.ToJson(container, serializationMode); AddIf( null != this._extendedLocation ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) this._extendedLocation.ToJson(null,serializationMode) : null, "extendedLocation" ,container.Add ); AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._etag)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._etag.ToString()) : null, "etag" ,container.Add ); } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/L2NetworkAttachmentConfiguration.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/L2NetworkAttachmentConfiguration.PowerShell.cs similarity index 77% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/L2NetworkAttachmentConfiguration.PowerShell.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/L2NetworkAttachmentConfiguration.PowerShell.cs index a871fd08954b..0b88ef1fd9fc 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/L2NetworkAttachmentConfiguration.PowerShell.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/L2NetworkAttachmentConfiguration.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; @@ -65,29 +65,27 @@ public partial class L2NetworkAttachmentConfiguration 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.NetworkCloud.Models.Api20250201.IL2NetworkAttachmentConfiguration DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkAttachmentConfiguration DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new L2NetworkAttachmentConfiguration(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.NetworkCloud.Models.Api20250201.IL2NetworkAttachmentConfiguration DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkAttachmentConfiguration DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new L2NetworkAttachmentConfiguration(content); } @@ -97,10 +95,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkAttachmentConfiguration FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkAttachmentConfiguration FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,17 +113,17 @@ internal L2NetworkAttachmentConfiguration(global::System.Collections.IDictionary // actually deserialize if (content.Contains("NetworkId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkAttachmentConfigurationInternal)this).NetworkId = (string) content.GetValueForProperty("NetworkId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkAttachmentConfigurationInternal)this).NetworkId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkAttachmentConfigurationInternal)this).NetworkId = (string) content.GetValueForProperty("NetworkId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkAttachmentConfigurationInternal)this).NetworkId, global::System.Convert.ToString); } if (content.Contains("PluginType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkAttachmentConfigurationInternal)this).PluginType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesPluginType?) content.GetValueForProperty("PluginType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkAttachmentConfigurationInternal)this).PluginType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesPluginType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkAttachmentConfigurationInternal)this).PluginType = (string) content.GetValueForProperty("PluginType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkAttachmentConfigurationInternal)this).PluginType, 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,11 +138,11 @@ internal L2NetworkAttachmentConfiguration(global::System.Management.Automation.P // actually deserialize if (content.Contains("NetworkId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkAttachmentConfigurationInternal)this).NetworkId = (string) content.GetValueForProperty("NetworkId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkAttachmentConfigurationInternal)this).NetworkId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkAttachmentConfigurationInternal)this).NetworkId = (string) content.GetValueForProperty("NetworkId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkAttachmentConfigurationInternal)this).NetworkId, global::System.Convert.ToString); } if (content.Contains("PluginType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkAttachmentConfigurationInternal)this).PluginType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesPluginType?) content.GetValueForProperty("PluginType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkAttachmentConfigurationInternal)this).PluginType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesPluginType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkAttachmentConfigurationInternal)this).PluginType = (string) content.GetValueForProperty("PluginType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkAttachmentConfigurationInternal)this).PluginType, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/L2NetworkAttachmentConfiguration.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/L2NetworkAttachmentConfiguration.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/L2NetworkAttachmentConfiguration.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/L2NetworkAttachmentConfiguration.TypeConverter.cs index de38f3266c90..cecb42ebc231 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/L2NetworkAttachmentConfiguration.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/L2NetworkAttachmentConfiguration.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IL2NetworkAttachmentConfiguration ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkAttachmentConfiguration ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkAttachmentConfiguration).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkAttachmentConfiguration).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/L2NetworkAttachmentConfiguration.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/L2NetworkAttachmentConfiguration.cs similarity index 77% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/L2NetworkAttachmentConfiguration.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/L2NetworkAttachmentConfiguration.cs index 78a17d2f08d5..3d708da1f8f2 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/L2NetworkAttachmentConfiguration.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/L2NetworkAttachmentConfiguration.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -11,8 +11,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201 /// L2NetworkAttachmentConfiguration represents the configuration of the attachment of a Layer 2 network. /// public partial class L2NetworkAttachmentConfiguration : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkAttachmentConfiguration, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkAttachmentConfigurationInternal + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkAttachmentConfiguration, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkAttachmentConfigurationInternal { /// Backing field for property. @@ -23,11 +23,11 @@ public partial class L2NetworkAttachmentConfiguration : public string NetworkId { get => this._networkId; set => this._networkId = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesPluginType? _pluginType; + private string _pluginType; /// The indicator of how this network will be utilized by the Kubernetes cluster. [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesPluginType? PluginType { get => this._pluginType; set => this._pluginType = value; } + public string PluginType { get => this._pluginType; set => this._pluginType = value; } /// Creates an new instance. public L2NetworkAttachmentConfiguration() @@ -41,8 +41,11 @@ public partial interface IL2NetworkAttachmentConfiguration : { /// The resource ID of the network that is being configured for attachment. [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, + Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = false, Description = @"The resource ID of the network that is being configured for attachment.", SerializedName = @"networkId", PossibleTypes = new [] { typeof(string) })] @@ -51,10 +54,14 @@ public partial interface IL2NetworkAttachmentConfiguration : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = false, Description = @"The indicator of how this network will be utilized by the Kubernetes cluster.", SerializedName = @"pluginType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesPluginType) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesPluginType? PluginType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("DPDK", "SRIOV", "OSDevice", "MACVLAN", "IPVLAN")] + string PluginType { get; set; } } /// L2NetworkAttachmentConfiguration represents the configuration of the attachment of a Layer 2 network. @@ -64,7 +71,8 @@ internal partial interface IL2NetworkAttachmentConfigurationInternal /// The resource ID of the network that is being configured for attachment. string NetworkId { get; set; } /// The indicator of how this network will be utilized by the Kubernetes cluster. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesPluginType? PluginType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("DPDK", "SRIOV", "OSDevice", "MACVLAN", "IPVLAN")] + string PluginType { get; set; } } } \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/L2NetworkAttachmentConfiguration.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/L2NetworkAttachmentConfiguration.json.cs similarity index 82% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/L2NetworkAttachmentConfiguration.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/L2NetworkAttachmentConfiguration.json.cs index a97ab682df30..8a7d9c0772df 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/L2NetworkAttachmentConfiguration.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/L2NetworkAttachmentConfiguration.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -56,13 +56,13 @@ public partial class L2NetworkAttachmentConfiguration partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkAttachmentConfiguration. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkAttachmentConfiguration. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkAttachmentConfiguration. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkAttachmentConfiguration. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkAttachmentConfiguration FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkAttachmentConfiguration FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new L2NetworkAttachmentConfiguration(json) : null; } @@ -79,8 +79,8 @@ internal L2NetworkAttachmentConfiguration(Microsoft.Azure.PowerShell.Cmdlets.Net { return; } - {_networkId = If( json?.PropertyT("networkId"), out var __jsonNetworkId) ? (string)__jsonNetworkId : (string)NetworkId;} - {_pluginType = If( json?.PropertyT("pluginType"), out var __jsonPluginType) ? (string)__jsonPluginType : (string)PluginType;} + {_networkId = If( json?.PropertyT("networkId"), out var __jsonNetworkId) ? (string)__jsonNetworkId : (string)_networkId;} + {_pluginType = If( json?.PropertyT("pluginType"), out var __jsonPluginType) ? (string)__jsonPluginType : (string)_pluginType;} AfterFromJson(json); } @@ -103,8 +103,14 @@ public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode ToJ { return container; } - AddIf( null != (((object)this._networkId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._networkId.ToString()) : null, "networkId" ,container.Add ); - AddIf( null != (((object)this._pluginType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._pluginType.ToString()) : null, "pluginType" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)||serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate)) + { + AddIf( null != (((object)this._networkId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._networkId.ToString()) : null, "networkId" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)||serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate)) + { + AddIf( null != (((object)this._pluginType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._pluginType.ToString()) : null, "pluginType" ,container.Add ); + } AfterToJson(ref container); return container; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/L2NetworkList.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/L2NetworkList.PowerShell.cs similarity index 77% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/L2NetworkList.PowerShell.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/L2NetworkList.PowerShell.cs index 37e0a1b6553b..be2238775b87 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/L2NetworkList.PowerShell.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/L2NetworkList.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; @@ -63,27 +63,27 @@ public partial class L2NetworkList 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.NetworkCloud.Models.Api20250201.IL2NetworkList DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkList DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new L2NetworkList(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.NetworkCloud.Models.Api20250201.IL2NetworkList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new L2NetworkList(content); } @@ -93,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 L2NetworkList(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkListInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkListInternal)this).NextLink, global::System.Convert.ToString); } if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2Network[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.L2NetworkTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkListInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkListInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.L2NetworkTypeConverter.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,11 +136,11 @@ internal L2NetworkList(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkListInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkListInternal)this).NextLink, global::System.Convert.ToString); } if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2Network[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.L2NetworkTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkListInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkListInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.L2NetworkTypeConverter.ConvertFrom)); } AfterDeserializePSObject(content); } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/L2NetworkList.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/L2NetworkList.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/L2NetworkList.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/L2NetworkList.TypeConverter.cs index a966c08f7aa9..2295b6a362fe 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/L2NetworkList.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/L2NetworkList.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IL2NetworkList ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkList ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkList).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkList).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/L2NetworkList.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/L2NetworkList.cs new file mode 100644 index 000000000000..80190208add2 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/L2NetworkList.cs @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + + /// L2NetworkList represents a list of L2 networks. + public partial class L2NetworkList : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkList, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkListInternal + { + + /// Backing field for property. + private string _nextLink; + + /// The link used to get the next page of operations. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; set => this._nextLink = value; } + + /// Backing field for property. + private System.Collections.Generic.List _value; + + /// The list of L2 networks. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public System.Collections.Generic.List Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public L2NetworkList() + { + + } + } + /// L2NetworkList represents a list of L2 networks. + public partial interface IL2NetworkList : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable + { + /// The link used to get the next page of operations. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The link used to get the next page of operations.", + SerializedName = @"nextLink", + PossibleTypes = new [] { typeof(string) })] + string NextLink { get; set; } + /// The list of L2 networks. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The list of L2 networks.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2Network) })] + System.Collections.Generic.List Value { get; set; } + + } + /// L2NetworkList represents a list of L2 networks. + internal partial interface IL2NetworkListInternal + + { + /// The link used to get the next page of operations. + string NextLink { get; set; } + /// The list of L2 networks. + System.Collections.Generic.List Value { get; set; } + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/L2NetworkList.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/L2NetworkList.json.cs similarity index 90% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/L2NetworkList.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/L2NetworkList.json.cs index f9964dc27f1c..3a7ac9885f06 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/L2NetworkList.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/L2NetworkList.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class L2NetworkList partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkList. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkList. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkList. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkList. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkList FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkList FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new L2NetworkList(json) : null; } @@ -77,8 +77,8 @@ internal L2NetworkList(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.J { return; } - {_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.NetworkCloud.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.NetworkCloud.Models.Api20250201.IL2Network) (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.L2Network.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.NetworkCloud.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.NetworkCloud.Models.IL2Network) (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.L2Network.FromJson(__u) )) ))() : null : _value;} AfterFromJson(json); } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/L2NetworkPatchParameters.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/L2NetworkPatchParameters.PowerShell.cs similarity index 81% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/L2NetworkPatchParameters.PowerShell.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/L2NetworkPatchParameters.PowerShell.cs index 63e7005c2230..b656bef41db9 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/L2NetworkPatchParameters.PowerShell.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/L2NetworkPatchParameters.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; @@ -65,29 +65,27 @@ public partial class L2NetworkPatchParameters 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.NetworkCloud.Models.Api20250201.IL2NetworkPatchParameters DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkPatchParameters DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new L2NetworkPatchParameters(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.NetworkCloud.Models.Api20250201.IL2NetworkPatchParameters DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkPatchParameters DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new L2NetworkPatchParameters(content); } @@ -97,10 +95,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkPatchParameters FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkPatchParameters FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,13 +113,13 @@ internal L2NetworkPatchParameters(global::System.Collections.IDictionary content // actually deserialize if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkPatchParametersInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkPatchParametersTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkPatchParametersInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.L2NetworkPatchParametersTagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkPatchParametersInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkPatchParametersTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkPatchParametersInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.L2NetworkPatchParametersTagsTypeConverter.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,7 +134,7 @@ internal L2NetworkPatchParameters(global::System.Management.Automation.PSObject // actually deserialize if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkPatchParametersInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkPatchParametersTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkPatchParametersInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.L2NetworkPatchParametersTagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkPatchParametersInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkPatchParametersTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkPatchParametersInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.L2NetworkPatchParametersTagsTypeConverter.ConvertFrom); } AfterDeserializePSObject(content); } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/L2NetworkPatchParameters.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/L2NetworkPatchParameters.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/L2NetworkPatchParameters.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/L2NetworkPatchParameters.TypeConverter.cs index bc6cc45c133c..85031033ce3d 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/L2NetworkPatchParameters.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/L2NetworkPatchParameters.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IL2NetworkPatchParameters ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkPatchParameters ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkPatchParameters).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkPatchParameters).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/L2NetworkPatchParameters.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/L2NetworkPatchParameters.cs new file mode 100644 index 000000000000..3424d64e317b --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/L2NetworkPatchParameters.cs @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + + /// + /// L2NetworkPatchParameters represents the body of the request to patch the L2 network. + /// + public partial class L2NetworkPatchParameters : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkPatchParameters, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkPatchParametersInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkPatchParametersTags _tag; + + /// The Azure resource tags that will replace the existing ones. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkPatchParametersTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.L2NetworkPatchParametersTags()); set => this._tag = value; } + + /// Creates an new instance. + public L2NetworkPatchParameters() + { + + } + } + /// L2NetworkPatchParameters represents the body of the request to patch the L2 network. + public partial interface IL2NetworkPatchParameters : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable + { + /// The Azure resource tags that will replace the existing ones. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The Azure resource tags that will replace the existing ones.", + SerializedName = @"tags", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkPatchParametersTags) })] + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkPatchParametersTags Tag { get; set; } + + } + /// L2NetworkPatchParameters represents the body of the request to patch the L2 network. + internal partial interface IL2NetworkPatchParametersInternal + + { + /// The Azure resource tags that will replace the existing ones. + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkPatchParametersTags Tag { get; set; } + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/L2NetworkPatchParameters.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/L2NetworkPatchParameters.json.cs similarity index 94% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/L2NetworkPatchParameters.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/L2NetworkPatchParameters.json.cs index 57182d49d972..287f7c641b14 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/L2NetworkPatchParameters.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/L2NetworkPatchParameters.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -56,13 +56,13 @@ public partial class L2NetworkPatchParameters partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkPatchParameters. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkPatchParameters. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkPatchParameters. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkPatchParameters. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkPatchParameters FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkPatchParameters FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new L2NetworkPatchParameters(json) : null; } @@ -79,7 +79,7 @@ internal L2NetworkPatchParameters(Microsoft.Azure.PowerShell.Cmdlets.NetworkClou { return; } - {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.L2NetworkPatchParametersTags.FromJson(__jsonTags) : Tag;} + {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.L2NetworkPatchParametersTags.FromJson(__jsonTags) : _tag;} AfterFromJson(json); } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/L2NetworkPatchParametersTags.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/L2NetworkPatchParametersTags.PowerShell.cs similarity index 89% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/L2NetworkPatchParametersTags.PowerShell.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/L2NetworkPatchParametersTags.PowerShell.cs index a08050427e4e..0d076977d954 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/L2NetworkPatchParametersTags.PowerShell.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/L2NetworkPatchParametersTags.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; @@ -63,29 +63,27 @@ public partial class L2NetworkPatchParametersTags 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.NetworkCloud.Models.Api20250201.IL2NetworkPatchParametersTags DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkPatchParametersTags DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new L2NetworkPatchParametersTags(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.NetworkCloud.Models.Api20250201.IL2NetworkPatchParametersTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkPatchParametersTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new L2NetworkPatchParametersTags(content); } @@ -95,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkPatchParametersTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkPatchParametersTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 L2NetworkPatchParametersTags(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/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/L2NetworkPatchParametersTags.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/L2NetworkPatchParametersTags.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/L2NetworkPatchParametersTags.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/L2NetworkPatchParametersTags.TypeConverter.cs index c55db75ee3c8..f1acf8de1c2f 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/L2NetworkPatchParametersTags.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/L2NetworkPatchParametersTags.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IL2NetworkPatchParametersTags ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkPatchParametersTags ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkPatchParametersTags).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkPatchParametersTags).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/L2NetworkPatchParametersTags.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/L2NetworkPatchParametersTags.cs similarity index 84% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/L2NetworkPatchParametersTags.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/L2NetworkPatchParametersTags.cs index e6c2c93742a3..5dabe0210501 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/L2NetworkPatchParametersTags.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/L2NetworkPatchParametersTags.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; /// The Azure resource tags that will replace the existing ones. public partial class L2NetworkPatchParametersTags : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkPatchParametersTags, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkPatchParametersTagsInternal + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkPatchParametersTags, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkPatchParametersTagsInternal { /// Creates an new instance. diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/L2NetworkPatchParametersTags.dictionary.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/L2NetworkPatchParametersTags.dictionary.cs similarity index 96% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/L2NetworkPatchParametersTags.dictionary.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/L2NetworkPatchParametersTags.dictionary.cs index c644ba589609..cd914aa022c6 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/L2NetworkPatchParametersTags.dictionary.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/L2NetworkPatchParametersTags.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.L2NetworkPatchParametersTags source) => source.__additionalProperties; + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.L2NetworkPatchParametersTags source) => source.__additionalProperties; } } \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/L2NetworkPatchParametersTags.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/L2NetworkPatchParametersTags.json.cs similarity index 95% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/L2NetworkPatchParametersTags.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/L2NetworkPatchParametersTags.json.cs index 385bb5014288..ad1be1fd420a 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/L2NetworkPatchParametersTags.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/L2NetworkPatchParametersTags.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class L2NetworkPatchParametersTags partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkPatchParametersTags. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkPatchParametersTags. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkPatchParametersTags. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkPatchParametersTags. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkPatchParametersTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkPatchParametersTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new L2NetworkPatchParametersTags(json) : null; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/L2NetworkProperties.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/L2NetworkProperties.PowerShell.cs new file mode 100644 index 000000000000..fb9e2c5b950d --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/L2NetworkProperties.PowerShell.cs @@ -0,0 +1,236 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + + /// L2NetworkProperties represents properties of the L2 network. + [System.ComponentModel.TypeConverter(typeof(L2NetworkPropertiesTypeConverter))] + public partial class L2NetworkProperties + { + + /// + /// 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.NetworkCloud.Models.IL2NetworkProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new L2NetworkProperties(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.NetworkCloud.Models.IL2NetworkProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new L2NetworkProperties(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.NetworkCloud.Models.IL2NetworkProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal L2NetworkProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("AssociatedResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkPropertiesInternal)this).AssociatedResourceId = (System.Collections.Generic.List) content.GetValueForProperty("AssociatedResourceId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkPropertiesInternal)this).AssociatedResourceId, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("ClusterId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkPropertiesInternal)this).ClusterId = (string) content.GetValueForProperty("ClusterId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkPropertiesInternal)this).ClusterId, global::System.Convert.ToString); + } + if (content.Contains("DetailedStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkPropertiesInternal)this).DetailedStatus = (string) content.GetValueForProperty("DetailedStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkPropertiesInternal)this).DetailedStatus, global::System.Convert.ToString); + } + if (content.Contains("DetailedStatusMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkPropertiesInternal)this).DetailedStatusMessage = (string) content.GetValueForProperty("DetailedStatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkPropertiesInternal)this).DetailedStatusMessage, global::System.Convert.ToString); + } + if (content.Contains("HybridAksClustersAssociatedId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkPropertiesInternal)this).HybridAksClustersAssociatedId = (System.Collections.Generic.List) content.GetValueForProperty("HybridAksClustersAssociatedId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkPropertiesInternal)this).HybridAksClustersAssociatedId, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("HybridAksPluginType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkPropertiesInternal)this).HybridAksPluginType = (string) content.GetValueForProperty("HybridAksPluginType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkPropertiesInternal)this).HybridAksPluginType, global::System.Convert.ToString); + } + if (content.Contains("InterfaceName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkPropertiesInternal)this).InterfaceName = (string) content.GetValueForProperty("InterfaceName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkPropertiesInternal)this).InterfaceName, global::System.Convert.ToString); + } + if (content.Contains("L2IsolationDomainId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkPropertiesInternal)this).L2IsolationDomainId = (string) content.GetValueForProperty("L2IsolationDomainId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkPropertiesInternal)this).L2IsolationDomainId, global::System.Convert.ToString); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkPropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkPropertiesInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("VirtualMachinesAssociatedId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkPropertiesInternal)this).VirtualMachinesAssociatedId = (System.Collections.Generic.List) content.GetValueForProperty("VirtualMachinesAssociatedId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkPropertiesInternal)this).VirtualMachinesAssociatedId, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal L2NetworkProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("AssociatedResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkPropertiesInternal)this).AssociatedResourceId = (System.Collections.Generic.List) content.GetValueForProperty("AssociatedResourceId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkPropertiesInternal)this).AssociatedResourceId, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("ClusterId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkPropertiesInternal)this).ClusterId = (string) content.GetValueForProperty("ClusterId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkPropertiesInternal)this).ClusterId, global::System.Convert.ToString); + } + if (content.Contains("DetailedStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkPropertiesInternal)this).DetailedStatus = (string) content.GetValueForProperty("DetailedStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkPropertiesInternal)this).DetailedStatus, global::System.Convert.ToString); + } + if (content.Contains("DetailedStatusMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkPropertiesInternal)this).DetailedStatusMessage = (string) content.GetValueForProperty("DetailedStatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkPropertiesInternal)this).DetailedStatusMessage, global::System.Convert.ToString); + } + if (content.Contains("HybridAksClustersAssociatedId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkPropertiesInternal)this).HybridAksClustersAssociatedId = (System.Collections.Generic.List) content.GetValueForProperty("HybridAksClustersAssociatedId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkPropertiesInternal)this).HybridAksClustersAssociatedId, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("HybridAksPluginType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkPropertiesInternal)this).HybridAksPluginType = (string) content.GetValueForProperty("HybridAksPluginType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkPropertiesInternal)this).HybridAksPluginType, global::System.Convert.ToString); + } + if (content.Contains("InterfaceName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkPropertiesInternal)this).InterfaceName = (string) content.GetValueForProperty("InterfaceName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkPropertiesInternal)this).InterfaceName, global::System.Convert.ToString); + } + if (content.Contains("L2IsolationDomainId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkPropertiesInternal)this).L2IsolationDomainId = (string) content.GetValueForProperty("L2IsolationDomainId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkPropertiesInternal)this).L2IsolationDomainId, global::System.Convert.ToString); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkPropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkPropertiesInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("VirtualMachinesAssociatedId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkPropertiesInternal)this).VirtualMachinesAssociatedId = (System.Collections.Generic.List) content.GetValueForProperty("VirtualMachinesAssociatedId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkPropertiesInternal)this).VirtualMachinesAssociatedId, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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(); + } + } + /// L2NetworkProperties represents properties of the L2 network. + [System.ComponentModel.TypeConverter(typeof(L2NetworkPropertiesTypeConverter))] + public partial interface IL2NetworkProperties + + { + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/L2NetworkProperties.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/L2NetworkProperties.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/L2NetworkProperties.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/L2NetworkProperties.TypeConverter.cs index d734128276e1..7bd411337311 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/L2NetworkProperties.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/L2NetworkProperties.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IL2NetworkProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/L2NetworkProperties.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/L2NetworkProperties.cs new file mode 100644 index 000000000000..6cbb86476fd7 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/L2NetworkProperties.cs @@ -0,0 +1,309 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + + /// L2NetworkProperties represents properties of the L2 network. + public partial class L2NetworkProperties : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkProperties, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkPropertiesInternal + { + + /// Backing field for property. + private System.Collections.Generic.List _associatedResourceId; + + /// + /// The list of resource IDs for the other Microsoft.NetworkCloud resources that have attached this network. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public System.Collections.Generic.List AssociatedResourceId { get => this._associatedResourceId; } + + /// Backing field for property. + private string _clusterId; + + /// + /// The resource ID of the Network Cloud cluster this L2 network is associated with. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string ClusterId { get => this._clusterId; } + + /// Backing field for property. + private string _detailedStatus; + + /// The more detailed status of the L2 network. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string DetailedStatus { get => this._detailedStatus; } + + /// Backing field for property. + private string _detailedStatusMessage; + + /// The descriptive message about the current detailed status. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string DetailedStatusMessage { get => this._detailedStatusMessage; } + + /// Backing field for property. + private System.Collections.Generic.List _hybridAksClustersAssociatedId; + + /// + /// Field Deprecated. These fields will be empty/omitted. The list of Hybrid AKS cluster resource ID(s) that are associated + /// with this L2 network. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public System.Collections.Generic.List HybridAksClustersAssociatedId { get => this._hybridAksClustersAssociatedId; } + + /// Backing field for property. + private string _hybridAksPluginType; + + /// + /// Field Deprecated. The field was previously optional, now it will have no defined behavior and will be ignored. The network + /// plugin type for Hybrid AKS. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string HybridAksPluginType { get => this._hybridAksPluginType; set => this._hybridAksPluginType = value; } + + /// Backing field for property. + private string _interfaceName; + + /// + /// The default interface name for this L2 network in the virtual machine. This name can be overridden by the name supplied + /// in the network attachment configuration of that virtual machine. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string InterfaceName { get => this._interfaceName; set => this._interfaceName = value; } + + /// Backing field for property. + private string _l2IsolationDomainId; + + /// The resource ID of the Network Fabric l2IsolationDomain. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string L2IsolationDomainId { get => this._l2IsolationDomainId; set => this._l2IsolationDomainId = value; } + + /// Internal Acessors for AssociatedResourceId + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkPropertiesInternal.AssociatedResourceId { get => this._associatedResourceId; set { {_associatedResourceId = value;} } } + + /// Internal Acessors for ClusterId + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkPropertiesInternal.ClusterId { get => this._clusterId; set { {_clusterId = value;} } } + + /// Internal Acessors for DetailedStatus + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkPropertiesInternal.DetailedStatus { get => this._detailedStatus; set { {_detailedStatus = value;} } } + + /// Internal Acessors for DetailedStatusMessage + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkPropertiesInternal.DetailedStatusMessage { get => this._detailedStatusMessage; set { {_detailedStatusMessage = value;} } } + + /// Internal Acessors for HybridAksClustersAssociatedId + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkPropertiesInternal.HybridAksClustersAssociatedId { get => this._hybridAksClustersAssociatedId; set { {_hybridAksClustersAssociatedId = value;} } } + + /// Internal Acessors for ProvisioningState + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkPropertiesInternal.ProvisioningState { get => this._provisioningState; set { {_provisioningState = value;} } } + + /// Internal Acessors for VirtualMachinesAssociatedId + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkPropertiesInternal.VirtualMachinesAssociatedId { get => this._virtualMachinesAssociatedId; set { {_virtualMachinesAssociatedId = value;} } } + + /// Backing field for property. + private string _provisioningState; + + /// The provisioning state of the L2 network. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string ProvisioningState { get => this._provisioningState; } + + /// Backing field for property. + private System.Collections.Generic.List _virtualMachinesAssociatedId; + + /// + /// Field Deprecated. These fields will be empty/omitted. The list of virtual machine resource ID(s), excluding any Hybrid + /// AKS virtual machines, that are currently using this L2 network. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public System.Collections.Generic.List VirtualMachinesAssociatedId { get => this._virtualMachinesAssociatedId; } + + /// Creates an new instance. + public L2NetworkProperties() + { + + } + } + /// L2NetworkProperties represents properties of the L2 network. + public partial interface IL2NetworkProperties : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable + { + /// + /// The list of resource IDs for the other Microsoft.NetworkCloud resources that have attached this network. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The list of resource IDs for the other Microsoft.NetworkCloud resources that have attached this network.", + SerializedName = @"associatedResourceIds", + PossibleTypes = new [] { typeof(string) })] + System.Collections.Generic.List AssociatedResourceId { get; } + /// + /// The resource ID of the Network Cloud cluster this L2 network is associated with. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The resource ID of the Network Cloud cluster this L2 network is associated with.", + SerializedName = @"clusterId", + PossibleTypes = new [] { typeof(string) })] + string ClusterId { get; } + /// The more detailed status of the L2 network. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The more detailed status of the L2 network.", + SerializedName = @"detailedStatus", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Error", "Available", "Provisioning")] + string DetailedStatus { get; } + /// The descriptive message about the current detailed status. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The descriptive message about the current detailed status.", + SerializedName = @"detailedStatusMessage", + PossibleTypes = new [] { typeof(string) })] + string DetailedStatusMessage { get; } + /// + /// Field Deprecated. These fields will be empty/omitted. The list of Hybrid AKS cluster resource ID(s) that are associated + /// with this L2 network. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"Field Deprecated. These fields will be empty/omitted. The list of Hybrid AKS cluster resource ID(s) that are associated with this L2 network.", + SerializedName = @"hybridAksClustersAssociatedIds", + PossibleTypes = new [] { typeof(string) })] + System.Collections.Generic.List HybridAksClustersAssociatedId { get; } + /// + /// Field Deprecated. The field was previously optional, now it will have no defined behavior and will be ignored. The network + /// plugin type for Hybrid AKS. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"Field Deprecated. The field was previously optional, now it will have no defined behavior and will be ignored. The network plugin type for Hybrid AKS.", + SerializedName = @"hybridAksPluginType", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("DPDK", "SRIOV", "OSDevice")] + string HybridAksPluginType { get; set; } + /// + /// The default interface name for this L2 network in the virtual machine. This name can be overridden by the name supplied + /// in the network attachment configuration of that virtual machine. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The default interface name for this L2 network in the virtual machine. This name can be overridden by the name supplied in the network attachment configuration of that virtual machine.", + SerializedName = @"interfaceName", + PossibleTypes = new [] { typeof(string) })] + string InterfaceName { get; set; } + /// The resource ID of the Network Fabric l2IsolationDomain. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The resource ID of the Network Fabric l2IsolationDomain.", + SerializedName = @"l2IsolationDomainId", + PossibleTypes = new [] { typeof(string) })] + string L2IsolationDomainId { get; set; } + /// The provisioning state of the L2 network. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The provisioning state of the L2 network.", + SerializedName = @"provisioningState", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Succeeded", "Failed", "Canceled", "Provisioning", "Accepted")] + string ProvisioningState { get; } + /// + /// Field Deprecated. These fields will be empty/omitted. The list of virtual machine resource ID(s), excluding any Hybrid + /// AKS virtual machines, that are currently using this L2 network. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"Field Deprecated. These fields will be empty/omitted. The list of virtual machine resource ID(s), excluding any Hybrid AKS virtual machines, that are currently using this L2 network.", + SerializedName = @"virtualMachinesAssociatedIds", + PossibleTypes = new [] { typeof(string) })] + System.Collections.Generic.List VirtualMachinesAssociatedId { get; } + + } + /// L2NetworkProperties represents properties of the L2 network. + internal partial interface IL2NetworkPropertiesInternal + + { + /// + /// The list of resource IDs for the other Microsoft.NetworkCloud resources that have attached this network. + /// + System.Collections.Generic.List AssociatedResourceId { get; set; } + /// + /// The resource ID of the Network Cloud cluster this L2 network is associated with. + /// + string ClusterId { get; set; } + /// The more detailed status of the L2 network. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Error", "Available", "Provisioning")] + string DetailedStatus { get; set; } + /// The descriptive message about the current detailed status. + string DetailedStatusMessage { get; set; } + /// + /// Field Deprecated. These fields will be empty/omitted. The list of Hybrid AKS cluster resource ID(s) that are associated + /// with this L2 network. + /// + System.Collections.Generic.List HybridAksClustersAssociatedId { get; set; } + /// + /// Field Deprecated. The field was previously optional, now it will have no defined behavior and will be ignored. The network + /// plugin type for Hybrid AKS. + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("DPDK", "SRIOV", "OSDevice")] + string HybridAksPluginType { get; set; } + /// + /// The default interface name for this L2 network in the virtual machine. This name can be overridden by the name supplied + /// in the network attachment configuration of that virtual machine. + /// + string InterfaceName { get; set; } + /// The resource ID of the Network Fabric l2IsolationDomain. + string L2IsolationDomainId { get; set; } + /// The provisioning state of the L2 network. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Succeeded", "Failed", "Canceled", "Provisioning", "Accepted")] + string ProvisioningState { get; set; } + /// + /// Field Deprecated. These fields will be empty/omitted. The list of virtual machine resource ID(s), excluding any Hybrid + /// AKS virtual machines, that are currently using this L2 network. + /// + System.Collections.Generic.List VirtualMachinesAssociatedId { get; set; } + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/L2NetworkProperties.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/L2NetworkProperties.json.cs similarity index 76% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/L2NetworkProperties.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/L2NetworkProperties.json.cs index cda81086397a..397b7ad6cebd 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/L2NetworkProperties.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/L2NetworkProperties.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class L2NetworkProperties partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new L2NetworkProperties(json) : null; } @@ -77,16 +77,16 @@ internal L2NetworkProperties(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Run { return; } - {_associatedResourceId = If( json?.PropertyT("associatedResourceIds"), out var __jsonAssociatedResourceIds) ? If( __jsonAssociatedResourceIds as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : AssociatedResourceId;} - {_clusterId = If( json?.PropertyT("clusterId"), out var __jsonClusterId) ? (string)__jsonClusterId : (string)ClusterId;} - {_detailedStatus = If( json?.PropertyT("detailedStatus"), out var __jsonDetailedStatus) ? (string)__jsonDetailedStatus : (string)DetailedStatus;} - {_detailedStatusMessage = If( json?.PropertyT("detailedStatusMessage"), out var __jsonDetailedStatusMessage) ? (string)__jsonDetailedStatusMessage : (string)DetailedStatusMessage;} - {_hybridAksClustersAssociatedId = If( json?.PropertyT("hybridAksClustersAssociatedIds"), out var __jsonHybridAksClustersAssociatedIds) ? If( __jsonHybridAksClustersAssociatedIds as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Json.JsonString __o ? (string)(__o.ToString()) : null)) ))() : null : HybridAksClustersAssociatedId;} - {_hybridAksPluginType = If( json?.PropertyT("hybridAksPluginType"), out var __jsonHybridAksPluginType) ? (string)__jsonHybridAksPluginType : (string)HybridAksPluginType;} - {_interfaceName = If( json?.PropertyT("interfaceName"), out var __jsonInterfaceName) ? (string)__jsonInterfaceName : (string)InterfaceName;} - {_l2IsolationDomainId = If( json?.PropertyT("l2IsolationDomainId"), out var __jsonL2IsolationDomainId) ? (string)__jsonL2IsolationDomainId : (string)L2IsolationDomainId;} - {_provisioningState = If( json?.PropertyT("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)ProvisioningState;} - {_virtualMachinesAssociatedId = If( json?.PropertyT("virtualMachinesAssociatedIds"), out var __jsonVirtualMachinesAssociatedIds) ? If( __jsonVirtualMachinesAssociatedIds as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Json.JsonString __j ? (string)(__j.ToString()) : null)) ))() : null : VirtualMachinesAssociatedId;} + {_associatedResourceId = If( json?.PropertyT("associatedResourceIds"), out var __jsonAssociatedResourceIds) ? If( __jsonAssociatedResourceIds as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : _associatedResourceId;} + {_clusterId = If( json?.PropertyT("clusterId"), out var __jsonClusterId) ? (string)__jsonClusterId : (string)_clusterId;} + {_detailedStatus = If( json?.PropertyT("detailedStatus"), out var __jsonDetailedStatus) ? (string)__jsonDetailedStatus : (string)_detailedStatus;} + {_detailedStatusMessage = If( json?.PropertyT("detailedStatusMessage"), out var __jsonDetailedStatusMessage) ? (string)__jsonDetailedStatusMessage : (string)_detailedStatusMessage;} + {_hybridAksClustersAssociatedId = If( json?.PropertyT("hybridAksClustersAssociatedIds"), out var __jsonHybridAksClustersAssociatedIds) ? If( __jsonHybridAksClustersAssociatedIds as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Json.JsonString __o ? (string)(__o.ToString()) : null)) ))() : null : _hybridAksClustersAssociatedId;} + {_hybridAksPluginType = If( json?.PropertyT("hybridAksPluginType"), out var __jsonHybridAksPluginType) ? (string)__jsonHybridAksPluginType : (string)_hybridAksPluginType;} + {_interfaceName = If( json?.PropertyT("interfaceName"), out var __jsonInterfaceName) ? (string)__jsonInterfaceName : (string)_interfaceName;} + {_l2IsolationDomainId = If( json?.PropertyT("l2IsolationDomainId"), out var __jsonL2IsolationDomainId) ? (string)__jsonL2IsolationDomainId : (string)_l2IsolationDomainId;} + {_provisioningState = If( json?.PropertyT("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)_provisioningState;} + {_virtualMachinesAssociatedId = If( json?.PropertyT("virtualMachinesAssociatedIds"), out var __jsonVirtualMachinesAssociatedIds) ? If( __jsonVirtualMachinesAssociatedIds as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Json.JsonString __j ? (string)(__j.ToString()) : null)) ))() : null : _virtualMachinesAssociatedId;} AfterFromJson(json); } @@ -109,7 +109,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode ToJ { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { if (null != this._associatedResourceId) { @@ -121,19 +121,19 @@ public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode ToJ container.Add("associatedResourceIds",__w); } } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._clusterId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._clusterId.ToString()) : null, "clusterId" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._detailedStatus)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._detailedStatus.ToString()) : null, "detailedStatus" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._detailedStatusMessage)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._detailedStatusMessage.ToString()) : null, "detailedStatusMessage" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { if (null != this._hybridAksClustersAssociatedId) { @@ -145,14 +145,23 @@ public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode ToJ container.Add("hybridAksClustersAssociatedIds",__r); } } - AddIf( null != (((object)this._hybridAksPluginType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._hybridAksPluginType.ToString()) : null, "hybridAksPluginType" ,container.Add ); - AddIf( null != (((object)this._interfaceName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._interfaceName.ToString()) : null, "interfaceName" ,container.Add ); - AddIf( null != (((object)this._l2IsolationDomainId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._l2IsolationDomainId.ToString()) : null, "l2IsolationDomainId" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)||serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate)) + { + AddIf( null != (((object)this._hybridAksPluginType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._hybridAksPluginType.ToString()) : null, "hybridAksPluginType" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)||serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate)) + { + AddIf( null != (((object)this._interfaceName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._interfaceName.ToString()) : null, "interfaceName" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)||serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate)) + { + AddIf( null != (((object)this._l2IsolationDomainId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._l2IsolationDomainId.ToString()) : null, "l2IsolationDomainId" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._provisioningState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._provisioningState.ToString()) : null, "provisioningState" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { if (null != this._virtualMachinesAssociatedId) { diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/L2ServiceLoadBalancerConfiguration.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/L2ServiceLoadBalancerConfiguration.PowerShell.cs similarity index 79% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/L2ServiceLoadBalancerConfiguration.PowerShell.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/L2ServiceLoadBalancerConfiguration.PowerShell.cs index 906bcad3a906..4abe3e7f9202 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/L2ServiceLoadBalancerConfiguration.PowerShell.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/L2ServiceLoadBalancerConfiguration.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; @@ -65,29 +65,29 @@ public partial class L2ServiceLoadBalancerConfiguration 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.NetworkCloud.Models.Api20250201.IL2ServiceLoadBalancerConfiguration DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2ServiceLoadBalancerConfiguration DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new L2ServiceLoadBalancerConfiguration(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.NetworkCloud.Models.Api20250201.IL2ServiceLoadBalancerConfiguration DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2ServiceLoadBalancerConfiguration DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new L2ServiceLoadBalancerConfiguration(content); } @@ -99,10 +99,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201 /// /// an instance of the model class. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2ServiceLoadBalancerConfiguration FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2ServiceLoadBalancerConfiguration FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,13 +117,13 @@ internal L2ServiceLoadBalancerConfiguration(global::System.Collections.IDictiona // actually deserialize if (content.Contains("IPAddressPool")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2ServiceLoadBalancerConfigurationInternal)this).IPAddressPool = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIPAddressPool[]) content.GetValueForProperty("IPAddressPool",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2ServiceLoadBalancerConfigurationInternal)this).IPAddressPool, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IPAddressPoolTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2ServiceLoadBalancerConfigurationInternal)this).IPAddressPool = (System.Collections.Generic.List) content.GetValueForProperty("IPAddressPool",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2ServiceLoadBalancerConfigurationInternal)this).IPAddressPool, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IPAddressPoolTypeConverter.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. @@ -138,7 +138,7 @@ internal L2ServiceLoadBalancerConfiguration(global::System.Management.Automation // actually deserialize if (content.Contains("IPAddressPool")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2ServiceLoadBalancerConfigurationInternal)this).IPAddressPool = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIPAddressPool[]) content.GetValueForProperty("IPAddressPool",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2ServiceLoadBalancerConfigurationInternal)this).IPAddressPool, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IPAddressPoolTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2ServiceLoadBalancerConfigurationInternal)this).IPAddressPool = (System.Collections.Generic.List) content.GetValueForProperty("IPAddressPool",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2ServiceLoadBalancerConfigurationInternal)this).IPAddressPool, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IPAddressPoolTypeConverter.ConvertFrom)); } AfterDeserializePSObject(content); } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/L2ServiceLoadBalancerConfiguration.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/L2ServiceLoadBalancerConfiguration.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/L2ServiceLoadBalancerConfiguration.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/L2ServiceLoadBalancerConfiguration.TypeConverter.cs index d9479a124958..92f0c0acfee6 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/L2ServiceLoadBalancerConfiguration.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/L2ServiceLoadBalancerConfiguration.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IL2ServiceLoadBalancerConfiguration ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2ServiceLoadBalancerConfiguration ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2ServiceLoadBalancerConfiguration).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2ServiceLoadBalancerConfiguration).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/L2ServiceLoadBalancerConfiguration.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/L2ServiceLoadBalancerConfiguration.cs new file mode 100644 index 000000000000..bc5dcf136c5d --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/L2ServiceLoadBalancerConfiguration.cs @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + + /// + /// L2ServiceLoadBalancerConfiguration represents the configuration of a layer 2 service load balancer. + /// + public partial class L2ServiceLoadBalancerConfiguration : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2ServiceLoadBalancerConfiguration, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2ServiceLoadBalancerConfigurationInternal + { + + /// Backing field for property. + private System.Collections.Generic.List _iPAddressPool; + + /// + /// The list of pools of IP addresses that can be allocated to load balancer services. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public System.Collections.Generic.List IPAddressPool { get => this._iPAddressPool; set => this._iPAddressPool = value; } + + /// Creates an new instance. + public L2ServiceLoadBalancerConfiguration() + { + + } + } + /// L2ServiceLoadBalancerConfiguration represents the configuration of a layer 2 service load balancer. + public partial interface IL2ServiceLoadBalancerConfiguration : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable + { + /// + /// The list of pools of IP addresses that can be allocated to load balancer services. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The list of pools of IP addresses that can be allocated to load balancer services.", + SerializedName = @"ipAddressPools", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IIPAddressPool) })] + System.Collections.Generic.List IPAddressPool { get; set; } + + } + /// L2ServiceLoadBalancerConfiguration represents the configuration of a layer 2 service load balancer. + internal partial interface IL2ServiceLoadBalancerConfigurationInternal + + { + /// + /// The list of pools of IP addresses that can be allocated to load balancer services. + /// + System.Collections.Generic.List IPAddressPool { get; set; } + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/L2ServiceLoadBalancerConfiguration.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/L2ServiceLoadBalancerConfiguration.json.cs similarity index 83% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/L2ServiceLoadBalancerConfiguration.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/L2ServiceLoadBalancerConfiguration.json.cs index 8420f80c04a3..66c03fedd66c 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/L2ServiceLoadBalancerConfiguration.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/L2ServiceLoadBalancerConfiguration.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -56,13 +56,13 @@ public partial class L2ServiceLoadBalancerConfiguration partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2ServiceLoadBalancerConfiguration. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2ServiceLoadBalancerConfiguration. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2ServiceLoadBalancerConfiguration. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2ServiceLoadBalancerConfiguration. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2ServiceLoadBalancerConfiguration FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2ServiceLoadBalancerConfiguration FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new L2ServiceLoadBalancerConfiguration(json) : null; } @@ -79,7 +79,7 @@ internal L2ServiceLoadBalancerConfiguration(Microsoft.Azure.PowerShell.Cmdlets.N { return; } - {_iPAddressPool = If( json?.PropertyT("ipAddressPools"), out var __jsonIPAddressPools) ? If( __jsonIPAddressPools as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IIPAddressPool) (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IPAddressPool.FromJson(__u) )) ))() : null : IPAddressPool;} + {_iPAddressPool = If( json?.PropertyT("ipAddressPools"), out var __jsonIPAddressPools) ? If( __jsonIPAddressPools as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.IIPAddressPool) (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IPAddressPool.FromJson(__u) )) ))() : null : _iPAddressPool;} AfterFromJson(json); } @@ -103,14 +103,17 @@ public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode ToJ { return container; } - if (null != this._iPAddressPool) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)||serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate)) { - var __w = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.XNodeArray(); - foreach( var __x in this._iPAddressPool ) + if (null != this._iPAddressPool) { - AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + var __w = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.XNodeArray(); + foreach( var __x in this._iPAddressPool ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("ipAddressPools",__w); } - container.Add("ipAddressPools",__w); } AfterToJson(ref container); return container; diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/L3Network.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/L3Network.PowerShell.cs new file mode 100644 index 000000000000..879d5317fb21 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/L3Network.PowerShell.cs @@ -0,0 +1,414 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + + /// + /// L3Network represents a network that utilizes a single isolation domain set up for layer-3 resources. + /// + [System.ComponentModel.TypeConverter(typeof(L3NetworkTypeConverter))] + public partial class L3Network + { + + /// + /// 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.NetworkCloud.Models.IL3Network DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new L3Network(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.NetworkCloud.Models.IL3Network DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new L3Network(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.NetworkCloud.Models.IL3Network FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal L3Network(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ExtendedLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkInternal)this).ExtendedLocation = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocation) content.GetValueForProperty("ExtendedLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkInternal)this).ExtendedLocation, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ExtendedLocationTypeConverter.ConvertFrom); + } + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.L3NetworkPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Etag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkInternal)this).Etag, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)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("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedByType = (string) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedByType = (string) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.TrackedResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("ExtendedLocationName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkInternal)this).ExtendedLocationName = (string) content.GetValueForProperty("ExtendedLocationName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkInternal)this).ExtendedLocationName, global::System.Convert.ToString); + } + if (content.Contains("ExtendedLocationType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkInternal)this).ExtendedLocationType = (string) content.GetValueForProperty("ExtendedLocationType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkInternal)this).ExtendedLocationType, global::System.Convert.ToString); + } + if (content.Contains("AssociatedResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkInternal)this).AssociatedResourceId = (System.Collections.Generic.List) content.GetValueForProperty("AssociatedResourceId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkInternal)this).AssociatedResourceId, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("ClusterId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkInternal)this).ClusterId = (string) content.GetValueForProperty("ClusterId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkInternal)this).ClusterId, global::System.Convert.ToString); + } + if (content.Contains("DetailedStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkInternal)this).DetailedStatus = (string) content.GetValueForProperty("DetailedStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkInternal)this).DetailedStatus, global::System.Convert.ToString); + } + if (content.Contains("DetailedStatusMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkInternal)this).DetailedStatusMessage = (string) content.GetValueForProperty("DetailedStatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkInternal)this).DetailedStatusMessage, global::System.Convert.ToString); + } + if (content.Contains("HybridAksClustersAssociatedId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkInternal)this).HybridAksClustersAssociatedId = (System.Collections.Generic.List) content.GetValueForProperty("HybridAksClustersAssociatedId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkInternal)this).HybridAksClustersAssociatedId, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("HybridAksIpamEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkInternal)this).HybridAksIpamEnabled = (string) content.GetValueForProperty("HybridAksIpamEnabled",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkInternal)this).HybridAksIpamEnabled, global::System.Convert.ToString); + } + if (content.Contains("HybridAksPluginType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkInternal)this).HybridAksPluginType = (string) content.GetValueForProperty("HybridAksPluginType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkInternal)this).HybridAksPluginType, global::System.Convert.ToString); + } + if (content.Contains("InterfaceName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkInternal)this).InterfaceName = (string) content.GetValueForProperty("InterfaceName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkInternal)this).InterfaceName, global::System.Convert.ToString); + } + if (content.Contains("IPAllocationType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkInternal)this).IPAllocationType = (string) content.GetValueForProperty("IPAllocationType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkInternal)this).IPAllocationType, global::System.Convert.ToString); + } + if (content.Contains("Ipv4ConnectedPrefix")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkInternal)this).Ipv4ConnectedPrefix = (string) content.GetValueForProperty("Ipv4ConnectedPrefix",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkInternal)this).Ipv4ConnectedPrefix, global::System.Convert.ToString); + } + if (content.Contains("Ipv6ConnectedPrefix")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkInternal)this).Ipv6ConnectedPrefix = (string) content.GetValueForProperty("Ipv6ConnectedPrefix",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkInternal)this).Ipv6ConnectedPrefix, global::System.Convert.ToString); + } + if (content.Contains("L3IsolationDomainId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkInternal)this).L3IsolationDomainId = (string) content.GetValueForProperty("L3IsolationDomainId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkInternal)this).L3IsolationDomainId, global::System.Convert.ToString); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("VirtualMachinesAssociatedId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkInternal)this).VirtualMachinesAssociatedId = (System.Collections.Generic.List) content.GetValueForProperty("VirtualMachinesAssociatedId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkInternal)this).VirtualMachinesAssociatedId, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("Vlan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkInternal)this).Vlan = (long?) content.GetValueForProperty("Vlan",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkInternal)this).Vlan, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal L3Network(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ExtendedLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkInternal)this).ExtendedLocation = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocation) content.GetValueForProperty("ExtendedLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkInternal)this).ExtendedLocation, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ExtendedLocationTypeConverter.ConvertFrom); + } + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.L3NetworkPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Etag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkInternal)this).Etag, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)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("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedByType = (string) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedByType = (string) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.TrackedResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("ExtendedLocationName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkInternal)this).ExtendedLocationName = (string) content.GetValueForProperty("ExtendedLocationName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkInternal)this).ExtendedLocationName, global::System.Convert.ToString); + } + if (content.Contains("ExtendedLocationType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkInternal)this).ExtendedLocationType = (string) content.GetValueForProperty("ExtendedLocationType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkInternal)this).ExtendedLocationType, global::System.Convert.ToString); + } + if (content.Contains("AssociatedResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkInternal)this).AssociatedResourceId = (System.Collections.Generic.List) content.GetValueForProperty("AssociatedResourceId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkInternal)this).AssociatedResourceId, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("ClusterId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkInternal)this).ClusterId = (string) content.GetValueForProperty("ClusterId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkInternal)this).ClusterId, global::System.Convert.ToString); + } + if (content.Contains("DetailedStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkInternal)this).DetailedStatus = (string) content.GetValueForProperty("DetailedStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkInternal)this).DetailedStatus, global::System.Convert.ToString); + } + if (content.Contains("DetailedStatusMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkInternal)this).DetailedStatusMessage = (string) content.GetValueForProperty("DetailedStatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkInternal)this).DetailedStatusMessage, global::System.Convert.ToString); + } + if (content.Contains("HybridAksClustersAssociatedId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkInternal)this).HybridAksClustersAssociatedId = (System.Collections.Generic.List) content.GetValueForProperty("HybridAksClustersAssociatedId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkInternal)this).HybridAksClustersAssociatedId, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("HybridAksIpamEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkInternal)this).HybridAksIpamEnabled = (string) content.GetValueForProperty("HybridAksIpamEnabled",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkInternal)this).HybridAksIpamEnabled, global::System.Convert.ToString); + } + if (content.Contains("HybridAksPluginType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkInternal)this).HybridAksPluginType = (string) content.GetValueForProperty("HybridAksPluginType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkInternal)this).HybridAksPluginType, global::System.Convert.ToString); + } + if (content.Contains("InterfaceName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkInternal)this).InterfaceName = (string) content.GetValueForProperty("InterfaceName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkInternal)this).InterfaceName, global::System.Convert.ToString); + } + if (content.Contains("IPAllocationType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkInternal)this).IPAllocationType = (string) content.GetValueForProperty("IPAllocationType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkInternal)this).IPAllocationType, global::System.Convert.ToString); + } + if (content.Contains("Ipv4ConnectedPrefix")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkInternal)this).Ipv4ConnectedPrefix = (string) content.GetValueForProperty("Ipv4ConnectedPrefix",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkInternal)this).Ipv4ConnectedPrefix, global::System.Convert.ToString); + } + if (content.Contains("Ipv6ConnectedPrefix")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkInternal)this).Ipv6ConnectedPrefix = (string) content.GetValueForProperty("Ipv6ConnectedPrefix",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkInternal)this).Ipv6ConnectedPrefix, global::System.Convert.ToString); + } + if (content.Contains("L3IsolationDomainId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkInternal)this).L3IsolationDomainId = (string) content.GetValueForProperty("L3IsolationDomainId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkInternal)this).L3IsolationDomainId, global::System.Convert.ToString); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("VirtualMachinesAssociatedId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkInternal)this).VirtualMachinesAssociatedId = (System.Collections.Generic.List) content.GetValueForProperty("VirtualMachinesAssociatedId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkInternal)this).VirtualMachinesAssociatedId, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("Vlan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkInternal)this).Vlan = (long?) content.GetValueForProperty("Vlan",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkInternal)this).Vlan, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + 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.NetworkCloud.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(); + } + } + /// L3Network represents a network that utilizes a single isolation domain set up for layer-3 resources. + [System.ComponentModel.TypeConverter(typeof(L3NetworkTypeConverter))] + public partial interface IL3Network + + { + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/L3Network.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/L3Network.TypeConverter.cs similarity index 98% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/L3Network.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/L3Network.TypeConverter.cs index 114cd7022f38..1a0c29f2d67c 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/L3Network.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/L3Network.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IL3Network ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3Network ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3Network).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3Network).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/L3Network.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/L3Network.cs new file mode 100644 index 000000000000..f9d35d818b49 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/L3Network.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.NetworkCloud.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + + /// + /// L3Network represents a network that utilizes a single isolation domain set up for layer-3 resources. + /// + public partial class L3Network : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3Network, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkInternal, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResource __trackedResource = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.TrackedResource(); + + /// + /// The list of resource IDs for the other Microsoft.NetworkCloud resources that have attached this network. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public System.Collections.Generic.List AssociatedResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkPropertiesInternal)Property).AssociatedResourceId; } + + /// + /// The resource ID of the Network Cloud cluster this L3 network is associated with. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string ClusterId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkPropertiesInternal)Property).ClusterId; } + + /// The more detailed status of the L3 network. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string DetailedStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkPropertiesInternal)Property).DetailedStatus; } + + /// The descriptive message about the current detailed status. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string DetailedStatusMessage { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkPropertiesInternal)Property).DetailedStatusMessage; } + + /// Backing field for property. + private string _etag; + + /// Resource ETag. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string Etag { get => this._etag; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocation _extendedLocation; + + /// The extended location of the cluster associated with the resource. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocation ExtendedLocation { get => (this._extendedLocation = this._extendedLocation ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ExtendedLocation()); set => this._extendedLocation = value; } + + /// The resource ID of the extended location on which the resource will be created. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string ExtendedLocationName { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocationInternal)ExtendedLocation).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocationInternal)ExtendedLocation).Name = value ?? null; } + + /// The extended location type, for example, CustomLocation. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string ExtendedLocationType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocationInternal)ExtendedLocation).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocationInternal)ExtendedLocation).Type = value ?? null; } + + /// + /// Field Deprecated. These fields will be empty/omitted. The list of Hybrid AKS cluster resource IDs that are associated + /// with this L3 network. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public System.Collections.Generic.List HybridAksClustersAssociatedId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkPropertiesInternal)Property).HybridAksClustersAssociatedId; } + + /// + /// Field Deprecated. The field was previously optional, now it will have no defined behavior and will be ignored. The indicator + /// of whether or not to disable IPAM allocation on the network attachment definition injected into the Hybrid AKS Cluster. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string HybridAksIpamEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkPropertiesInternal)Property).HybridAksIpamEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkPropertiesInternal)Property).HybridAksIpamEnabled = value ?? null; } + + /// + /// Field Deprecated. The field was previously optional, now it will have no defined behavior and will be ignored. The network + /// plugin type for Hybrid AKS. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string HybridAksPluginType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkPropertiesInternal)Property).HybridAksPluginType; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkPropertiesInternal)Property).HybridAksPluginType = value ?? null; } + + /// The type of the IP address allocation, defaulted to "DualStack". + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string IPAllocationType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkPropertiesInternal)Property).IPAllocationType; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkPropertiesInternal)Property).IPAllocationType = value ?? null; } + + /// + /// Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).Id; } + + /// + /// The default interface name for this L3 network in the virtual machine. This name can be overridden by the name supplied + /// in the network attachment configuration of that virtual machine. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string InterfaceName { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkPropertiesInternal)Property).InterfaceName; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkPropertiesInternal)Property).InterfaceName = value ?? null; } + + /// + /// The IPV4 prefix (CIDR) assigned to this L3 network. Required when the IP allocation type is IPV4 or DualStack. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string Ipv4ConnectedPrefix { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkPropertiesInternal)Property).Ipv4ConnectedPrefix; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkPropertiesInternal)Property).Ipv4ConnectedPrefix = value ?? null; } + + /// + /// The IPV6 prefix (CIDR) assigned to this L3 network. Required when the IP allocation type is IPV6 or DualStack. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string Ipv6ConnectedPrefix { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkPropertiesInternal)Property).Ipv6ConnectedPrefix; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkPropertiesInternal)Property).Ipv6ConnectedPrefix = value ?? null; } + + /// The resource ID of the Network Fabric l3IsolationDomain. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string L3IsolationDomainId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkPropertiesInternal)Property).L3IsolationDomainId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkPropertiesInternal)Property).L3IsolationDomainId = value ?? null; } + + /// The geo-location where the resource lives + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)__trackedResource).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)__trackedResource).Location = value ?? null; } + + /// Internal Acessors for AssociatedResourceId + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkInternal.AssociatedResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkPropertiesInternal)Property).AssociatedResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkPropertiesInternal)Property).AssociatedResourceId = value ?? null /* arrayOf */; } + + /// Internal Acessors for ClusterId + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkInternal.ClusterId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkPropertiesInternal)Property).ClusterId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkPropertiesInternal)Property).ClusterId = value ?? null; } + + /// Internal Acessors for DetailedStatus + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkInternal.DetailedStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkPropertiesInternal)Property).DetailedStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkPropertiesInternal)Property).DetailedStatus = value ?? null; } + + /// Internal Acessors for DetailedStatusMessage + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkInternal.DetailedStatusMessage { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkPropertiesInternal)Property).DetailedStatusMessage; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkPropertiesInternal)Property).DetailedStatusMessage = value ?? null; } + + /// Internal Acessors for Etag + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkInternal.Etag { get => this._etag; set { {_etag = value;} } } + + /// Internal Acessors for ExtendedLocation + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocation Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkInternal.ExtendedLocation { get => (this._extendedLocation = this._extendedLocation ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ExtendedLocation()); set { {_extendedLocation = value;} } } + + /// Internal Acessors for HybridAksClustersAssociatedId + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkInternal.HybridAksClustersAssociatedId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkPropertiesInternal)Property).HybridAksClustersAssociatedId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkPropertiesInternal)Property).HybridAksClustersAssociatedId = value ?? null /* arrayOf */; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkProperties Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.L3NetworkProperties()); set { {_property = value;} } } + + /// Internal Acessors for ProvisioningState + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkPropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkPropertiesInternal)Property).ProvisioningState = value ?? null; } + + /// Internal Acessors for VirtualMachinesAssociatedId + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkInternal.VirtualMachinesAssociatedId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkPropertiesInternal)Property).VirtualMachinesAssociatedId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkPropertiesInternal)Property).VirtualMachinesAssociatedId = value ?? null /* arrayOf */; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).Id = value ?? null; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).Name = value ?? null; } + + /// Internal Acessors for SystemData + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISystemData Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemData; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemData = value ?? null /* model class */; } + + /// Internal Acessors for SystemDataCreatedAt + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataCreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataCreatedAt = value ?? default(global::System.DateTime); } + + /// Internal Acessors for SystemDataCreatedBy + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataCreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataCreatedBy = value ?? null; } + + /// Internal Acessors for SystemDataCreatedByType + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataCreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataCreatedByType = value ?? null; } + + /// Internal Acessors for SystemDataLastModifiedAt + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedAt = value ?? default(global::System.DateTime); } + + /// Internal Acessors for SystemDataLastModifiedBy + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedBy = value ?? null; } + + /// Internal Acessors for SystemDataLastModifiedByType + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedByType = value ?? null; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).Type = value ?? null; } + + /// The name of the resource + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).Name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkProperties _property; + + /// The list of the resource properties. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.L3NetworkProperties()); set => this._property = value; } + + /// The provisioning state of the L3 network. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkPropertiesInternal)Property).ProvisioningState; } + + /// Gets the resource group name + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string ResourceGroupName { get => (new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Success ? new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Groups["resourceGroupName"].Value : null); } + + /// + /// Azure Resource Manager metadata containing createdBy and modifiedBy information. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISystemData SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemData; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemData = value ?? null /* model class */; } + + /// The timestamp of resource creation (UTC). + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataCreatedAt; } + + /// The identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataCreatedBy; } + + /// The type of identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public string SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataCreatedByType; } + + /// The timestamp of resource last modification (UTC) + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedAt; } + + /// The identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedBy; } + + /// The type of identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public string SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedByType; } + + /// Resource tags. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)__trackedResource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).Type; } + + /// + /// Field Deprecated. These fields will be empty/omitted. The list of virtual machine resource IDs, excluding any Hybrid AKS + /// virtual machines, that are currently using this L3 network. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public System.Collections.Generic.List VirtualMachinesAssociatedId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkPropertiesInternal)Property).VirtualMachinesAssociatedId; } + + /// The VLAN from the l3IsolationDomain that is used for this network. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public long? Vlan { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkPropertiesInternal)Property).Vlan; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkPropertiesInternal)Property).Vlan = value ?? default(long); } + + /// Creates an new instance. + public L3Network() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__trackedResource), __trackedResource); + await eventListener.AssertObjectIsValid(nameof(__trackedResource), __trackedResource); + } + } + /// L3Network represents a network that utilizes a single isolation domain set up for layer-3 resources. + public partial interface IL3Network : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResource + { + /// + /// The list of resource IDs for the other Microsoft.NetworkCloud resources that have attached this network. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The list of resource IDs for the other Microsoft.NetworkCloud resources that have attached this network.", + SerializedName = @"associatedResourceIds", + PossibleTypes = new [] { typeof(string) })] + System.Collections.Generic.List AssociatedResourceId { get; } + /// + /// The resource ID of the Network Cloud cluster this L3 network is associated with. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The resource ID of the Network Cloud cluster this L3 network is associated with.", + SerializedName = @"clusterId", + PossibleTypes = new [] { typeof(string) })] + string ClusterId { get; } + /// The more detailed status of the L3 network. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The more detailed status of the L3 network.", + SerializedName = @"detailedStatus", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Error", "Available", "Provisioning")] + string DetailedStatus { get; } + /// The descriptive message about the current detailed status. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The descriptive message about the current detailed status.", + SerializedName = @"detailedStatusMessage", + PossibleTypes = new [] { typeof(string) })] + string DetailedStatusMessage { get; } + /// Resource ETag. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"Resource ETag.", + SerializedName = @"etag", + PossibleTypes = new [] { typeof(string) })] + string Etag { get; } + /// The resource ID of the extended location on which the resource will be created. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The resource ID of the extended location on which the resource will be created.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string ExtendedLocationName { get; set; } + /// The extended location type, for example, CustomLocation. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The extended location type, for example, CustomLocation.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + string ExtendedLocationType { get; set; } + /// + /// Field Deprecated. These fields will be empty/omitted. The list of Hybrid AKS cluster resource IDs that are associated + /// with this L3 network. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"Field Deprecated. These fields will be empty/omitted. The list of Hybrid AKS cluster resource IDs that are associated with this L3 network.", + SerializedName = @"hybridAksClustersAssociatedIds", + PossibleTypes = new [] { typeof(string) })] + System.Collections.Generic.List HybridAksClustersAssociatedId { get; } + /// + /// Field Deprecated. The field was previously optional, now it will have no defined behavior and will be ignored. The indicator + /// of whether or not to disable IPAM allocation on the network attachment definition injected into the Hybrid AKS Cluster. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"Field Deprecated. The field was previously optional, now it will have no defined behavior and will be ignored. The indicator of whether or not to disable IPAM allocation on the network attachment definition injected into the Hybrid AKS Cluster.", + SerializedName = @"hybridAksIpamEnabled", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("True", "False")] + string HybridAksIpamEnabled { get; set; } + /// + /// Field Deprecated. The field was previously optional, now it will have no defined behavior and will be ignored. The network + /// plugin type for Hybrid AKS. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"Field Deprecated. The field was previously optional, now it will have no defined behavior and will be ignored. The network plugin type for Hybrid AKS.", + SerializedName = @"hybridAksPluginType", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("DPDK", "SRIOV", "OSDevice")] + string HybridAksPluginType { get; set; } + /// The type of the IP address allocation, defaulted to "DualStack". + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The type of the IP address allocation, defaulted to ""DualStack"".", + SerializedName = @"ipAllocationType", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("IPV4", "IPV6", "DualStack")] + string IPAllocationType { get; set; } + /// + /// The default interface name for this L3 network in the virtual machine. This name can be overridden by the name supplied + /// in the network attachment configuration of that virtual machine. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The default interface name for this L3 network in the virtual machine. This name can be overridden by the name supplied in the network attachment configuration of that virtual machine.", + SerializedName = @"interfaceName", + PossibleTypes = new [] { typeof(string) })] + string InterfaceName { get; set; } + /// + /// The IPV4 prefix (CIDR) assigned to this L3 network. Required when the IP allocation type is IPV4 or DualStack. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The IPV4 prefix (CIDR) assigned to this L3 network. Required when the IP allocation type is IPV4 or DualStack.", + SerializedName = @"ipv4ConnectedPrefix", + PossibleTypes = new [] { typeof(string) })] + string Ipv4ConnectedPrefix { get; set; } + /// + /// The IPV6 prefix (CIDR) assigned to this L3 network. Required when the IP allocation type is IPV6 or DualStack. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The IPV6 prefix (CIDR) assigned to this L3 network. Required when the IP allocation type is IPV6 or DualStack.", + SerializedName = @"ipv6ConnectedPrefix", + PossibleTypes = new [] { typeof(string) })] + string Ipv6ConnectedPrefix { get; set; } + /// The resource ID of the Network Fabric l3IsolationDomain. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The resource ID of the Network Fabric l3IsolationDomain.", + SerializedName = @"l3IsolationDomainId", + PossibleTypes = new [] { typeof(string) })] + string L3IsolationDomainId { get; set; } + /// The provisioning state of the L3 network. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The provisioning state of the L3 network.", + SerializedName = @"provisioningState", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Succeeded", "Failed", "Canceled", "Provisioning", "Accepted")] + string ProvisioningState { get; } + /// + /// Field Deprecated. These fields will be empty/omitted. The list of virtual machine resource IDs, excluding any Hybrid AKS + /// virtual machines, that are currently using this L3 network. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"Field Deprecated. These fields will be empty/omitted. The list of virtual machine resource IDs, excluding any Hybrid AKS virtual machines, that are currently using this L3 network.", + SerializedName = @"virtualMachinesAssociatedIds", + PossibleTypes = new [] { typeof(string) })] + System.Collections.Generic.List VirtualMachinesAssociatedId { get; } + /// The VLAN from the l3IsolationDomain that is used for this network. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The VLAN from the l3IsolationDomain that is used for this network.", + SerializedName = @"vlan", + PossibleTypes = new [] { typeof(long) })] + long? Vlan { get; set; } + + } + /// L3Network represents a network that utilizes a single isolation domain set up for layer-3 resources. + internal partial interface IL3NetworkInternal : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal + { + /// + /// The list of resource IDs for the other Microsoft.NetworkCloud resources that have attached this network. + /// + System.Collections.Generic.List AssociatedResourceId { get; set; } + /// + /// The resource ID of the Network Cloud cluster this L3 network is associated with. + /// + string ClusterId { get; set; } + /// The more detailed status of the L3 network. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Error", "Available", "Provisioning")] + string DetailedStatus { get; set; } + /// The descriptive message about the current detailed status. + string DetailedStatusMessage { get; set; } + /// Resource ETag. + string Etag { get; set; } + /// The extended location of the cluster associated with the resource. + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocation ExtendedLocation { get; set; } + /// The resource ID of the extended location on which the resource will be created. + string ExtendedLocationName { get; set; } + /// The extended location type, for example, CustomLocation. + string ExtendedLocationType { get; set; } + /// + /// Field Deprecated. These fields will be empty/omitted. The list of Hybrid AKS cluster resource IDs that are associated + /// with this L3 network. + /// + System.Collections.Generic.List HybridAksClustersAssociatedId { get; set; } + /// + /// Field Deprecated. The field was previously optional, now it will have no defined behavior and will be ignored. The indicator + /// of whether or not to disable IPAM allocation on the network attachment definition injected into the Hybrid AKS Cluster. + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("True", "False")] + string HybridAksIpamEnabled { get; set; } + /// + /// Field Deprecated. The field was previously optional, now it will have no defined behavior and will be ignored. The network + /// plugin type for Hybrid AKS. + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("DPDK", "SRIOV", "OSDevice")] + string HybridAksPluginType { get; set; } + /// The type of the IP address allocation, defaulted to "DualStack". + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("IPV4", "IPV6", "DualStack")] + string IPAllocationType { get; set; } + /// + /// The default interface name for this L3 network in the virtual machine. This name can be overridden by the name supplied + /// in the network attachment configuration of that virtual machine. + /// + string InterfaceName { get; set; } + /// + /// The IPV4 prefix (CIDR) assigned to this L3 network. Required when the IP allocation type is IPV4 or DualStack. + /// + string Ipv4ConnectedPrefix { get; set; } + /// + /// The IPV6 prefix (CIDR) assigned to this L3 network. Required when the IP allocation type is IPV6 or DualStack. + /// + string Ipv6ConnectedPrefix { get; set; } + /// The resource ID of the Network Fabric l3IsolationDomain. + string L3IsolationDomainId { get; set; } + /// The list of the resource properties. + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkProperties Property { get; set; } + /// The provisioning state of the L3 network. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Succeeded", "Failed", "Canceled", "Provisioning", "Accepted")] + string ProvisioningState { get; set; } + /// + /// Field Deprecated. These fields will be empty/omitted. The list of virtual machine resource IDs, excluding any Hybrid AKS + /// virtual machines, that are currently using this L3 network. + /// + System.Collections.Generic.List VirtualMachinesAssociatedId { get; set; } + /// The VLAN from the l3IsolationDomain that is used for this network. + long? Vlan { get; set; } + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/L3Network.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/L3Network.json.cs similarity index 92% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/L3Network.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/L3Network.json.cs index 9355065d3532..018d836dee5c 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/L3Network.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/L3Network.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -56,13 +56,13 @@ public partial class L3Network partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3Network. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3Network. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3Network. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3Network. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3Network FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3Network FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new L3Network(json) : null; } @@ -79,10 +79,10 @@ internal L3Network(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json. { return; } - __trackedResource = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.TrackedResource(json); - {_extendedLocation = If( json?.PropertyT("extendedLocation"), out var __jsonExtendedLocation) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ExtendedLocation.FromJson(__jsonExtendedLocation) : ExtendedLocation;} - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.L3NetworkProperties.FromJson(__jsonProperties) : Property;} - {_etag = If( json?.PropertyT("etag"), out var __jsonEtag) ? (string)__jsonEtag : (string)Etag;} + __trackedResource = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.TrackedResource(json); + {_extendedLocation = If( json?.PropertyT("extendedLocation"), out var __jsonExtendedLocation) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ExtendedLocation.FromJson(__jsonExtendedLocation) : _extendedLocation;} + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.L3NetworkProperties.FromJson(__jsonProperties) : _property;} + {_etag = If( json?.PropertyT("etag"), out var __jsonEtag) ? (string)__jsonEtag : (string)_etag;} AfterFromJson(json); } @@ -108,7 +108,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode ToJ __trackedResource?.ToJson(container, serializationMode); AddIf( null != this._extendedLocation ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) this._extendedLocation.ToJson(null,serializationMode) : null, "extendedLocation" ,container.Add ); AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._etag)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._etag.ToString()) : null, "etag" ,container.Add ); } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/L3NetworkAttachmentConfiguration.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/L3NetworkAttachmentConfiguration.PowerShell.cs new file mode 100644 index 000000000000..8cb6fe9a59e0 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/L3NetworkAttachmentConfiguration.PowerShell.cs @@ -0,0 +1,182 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + + /// + /// L3NetworkAttachmentConfiguration represents the configuration of the attachment of a Layer 3 network. + /// + [System.ComponentModel.TypeConverter(typeof(L3NetworkAttachmentConfigurationTypeConverter))] + public partial class L3NetworkAttachmentConfiguration + { + + /// + /// 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.NetworkCloud.Models.IL3NetworkAttachmentConfiguration DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new L3NetworkAttachmentConfiguration(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.NetworkCloud.Models.IL3NetworkAttachmentConfiguration DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new L3NetworkAttachmentConfiguration(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.NetworkCloud.Models.IL3NetworkAttachmentConfiguration FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal L3NetworkAttachmentConfiguration(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("IpamEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkAttachmentConfigurationInternal)this).IpamEnabled = (string) content.GetValueForProperty("IpamEnabled",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkAttachmentConfigurationInternal)this).IpamEnabled, global::System.Convert.ToString); + } + if (content.Contains("NetworkId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkAttachmentConfigurationInternal)this).NetworkId = (string) content.GetValueForProperty("NetworkId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkAttachmentConfigurationInternal)this).NetworkId, global::System.Convert.ToString); + } + if (content.Contains("PluginType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkAttachmentConfigurationInternal)this).PluginType = (string) content.GetValueForProperty("PluginType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkAttachmentConfigurationInternal)this).PluginType, 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 L3NetworkAttachmentConfiguration(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("IpamEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkAttachmentConfigurationInternal)this).IpamEnabled = (string) content.GetValueForProperty("IpamEnabled",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkAttachmentConfigurationInternal)this).IpamEnabled, global::System.Convert.ToString); + } + if (content.Contains("NetworkId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkAttachmentConfigurationInternal)this).NetworkId = (string) content.GetValueForProperty("NetworkId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkAttachmentConfigurationInternal)this).NetworkId, global::System.Convert.ToString); + } + if (content.Contains("PluginType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkAttachmentConfigurationInternal)this).PluginType = (string) content.GetValueForProperty("PluginType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkAttachmentConfigurationInternal)this).PluginType, 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.NetworkCloud.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(); + } + } + /// L3NetworkAttachmentConfiguration represents the configuration of the attachment of a Layer 3 network. + [System.ComponentModel.TypeConverter(typeof(L3NetworkAttachmentConfigurationTypeConverter))] + public partial interface IL3NetworkAttachmentConfiguration + + { + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/L3NetworkAttachmentConfiguration.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/L3NetworkAttachmentConfiguration.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/L3NetworkAttachmentConfiguration.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/L3NetworkAttachmentConfiguration.TypeConverter.cs index 2f558be109e1..d6d6dc59bdf6 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/L3NetworkAttachmentConfiguration.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/L3NetworkAttachmentConfiguration.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IL3NetworkAttachmentConfiguration ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkAttachmentConfiguration ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkAttachmentConfiguration).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkAttachmentConfiguration).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/L3NetworkAttachmentConfiguration.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/L3NetworkAttachmentConfiguration.cs new file mode 100644 index 000000000000..f30613a0da2b --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/L3NetworkAttachmentConfiguration.cs @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + + /// + /// L3NetworkAttachmentConfiguration represents the configuration of the attachment of a Layer 3 network. + /// + public partial class L3NetworkAttachmentConfiguration : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkAttachmentConfiguration, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkAttachmentConfigurationInternal + { + + /// Backing field for property. + private string _ipamEnabled; + + /// + /// The indication of whether this network will or will not perform IP address management and allocate IP addresses when attached. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string IpamEnabled { get => this._ipamEnabled; set => this._ipamEnabled = value; } + + /// Backing field for property. + private string _networkId; + + /// The resource ID of the network that is being configured for attachment. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string NetworkId { get => this._networkId; set => this._networkId = value; } + + /// Backing field for property. + private string _pluginType; + + /// The indicator of how this network will be utilized by the Kubernetes cluster. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string PluginType { get => this._pluginType; set => this._pluginType = value; } + + /// Creates an new instance. + public L3NetworkAttachmentConfiguration() + { + + } + } + /// L3NetworkAttachmentConfiguration represents the configuration of the attachment of a Layer 3 network. + public partial interface IL3NetworkAttachmentConfiguration : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable + { + /// + /// The indication of whether this network will or will not perform IP address management and allocate IP addresses when attached. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The indication of whether this network will or will not perform IP address management and allocate IP addresses when attached.", + SerializedName = @"ipamEnabled", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("True", "False")] + string IpamEnabled { get; set; } + /// The resource ID of the network that is being configured for attachment. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The resource ID of the network that is being configured for attachment.", + SerializedName = @"networkId", + PossibleTypes = new [] { typeof(string) })] + string NetworkId { get; set; } + /// The indicator of how this network will be utilized by the Kubernetes cluster. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The indicator of how this network will be utilized by the Kubernetes cluster.", + SerializedName = @"pluginType", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("DPDK", "SRIOV", "OSDevice", "MACVLAN", "IPVLAN")] + string PluginType { get; set; } + + } + /// L3NetworkAttachmentConfiguration represents the configuration of the attachment of a Layer 3 network. + internal partial interface IL3NetworkAttachmentConfigurationInternal + + { + /// + /// The indication of whether this network will or will not perform IP address management and allocate IP addresses when attached. + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("True", "False")] + string IpamEnabled { get; set; } + /// The resource ID of the network that is being configured for attachment. + string NetworkId { get; set; } + /// The indicator of how this network will be utilized by the Kubernetes cluster. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("DPDK", "SRIOV", "OSDevice", "MACVLAN", "IPVLAN")] + string PluginType { get; set; } + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/L3NetworkAttachmentConfiguration.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/L3NetworkAttachmentConfiguration.json.cs similarity index 83% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/L3NetworkAttachmentConfiguration.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/L3NetworkAttachmentConfiguration.json.cs index 13cb564b8529..ce31d6d4c660 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/L3NetworkAttachmentConfiguration.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/L3NetworkAttachmentConfiguration.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -56,13 +56,13 @@ public partial class L3NetworkAttachmentConfiguration partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkAttachmentConfiguration. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkAttachmentConfiguration. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkAttachmentConfiguration. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkAttachmentConfiguration. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkAttachmentConfiguration FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkAttachmentConfiguration FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new L3NetworkAttachmentConfiguration(json) : null; } @@ -79,9 +79,9 @@ internal L3NetworkAttachmentConfiguration(Microsoft.Azure.PowerShell.Cmdlets.Net { return; } - {_ipamEnabled = If( json?.PropertyT("ipamEnabled"), out var __jsonIpamEnabled) ? (string)__jsonIpamEnabled : (string)IpamEnabled;} - {_networkId = If( json?.PropertyT("networkId"), out var __jsonNetworkId) ? (string)__jsonNetworkId : (string)NetworkId;} - {_pluginType = If( json?.PropertyT("pluginType"), out var __jsonPluginType) ? (string)__jsonPluginType : (string)PluginType;} + {_ipamEnabled = If( json?.PropertyT("ipamEnabled"), out var __jsonIpamEnabled) ? (string)__jsonIpamEnabled : (string)_ipamEnabled;} + {_networkId = If( json?.PropertyT("networkId"), out var __jsonNetworkId) ? (string)__jsonNetworkId : (string)_networkId;} + {_pluginType = If( json?.PropertyT("pluginType"), out var __jsonPluginType) ? (string)__jsonPluginType : (string)_pluginType;} AfterFromJson(json); } @@ -104,9 +104,15 @@ public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode ToJ { return container; } - AddIf( null != (((object)this._ipamEnabled)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._ipamEnabled.ToString()) : null, "ipamEnabled" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)||serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate)) + { + AddIf( null != (((object)this._ipamEnabled)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._ipamEnabled.ToString()) : null, "ipamEnabled" ,container.Add ); + } AddIf( null != (((object)this._networkId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._networkId.ToString()) : null, "networkId" ,container.Add ); - AddIf( null != (((object)this._pluginType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._pluginType.ToString()) : null, "pluginType" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)||serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate)) + { + AddIf( null != (((object)this._pluginType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._pluginType.ToString()) : null, "pluginType" ,container.Add ); + } AfterToJson(ref container); return container; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/L3NetworkList.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/L3NetworkList.PowerShell.cs similarity index 77% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/L3NetworkList.PowerShell.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/L3NetworkList.PowerShell.cs index 8f5e56c9565e..ec8b3337866c 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/L3NetworkList.PowerShell.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/L3NetworkList.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; @@ -63,27 +63,27 @@ public partial class L3NetworkList 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.NetworkCloud.Models.Api20250201.IL3NetworkList DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkList DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new L3NetworkList(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.NetworkCloud.Models.Api20250201.IL3NetworkList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new L3NetworkList(content); } @@ -93,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 L3NetworkList(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkListInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkListInternal)this).NextLink, global::System.Convert.ToString); } if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3Network[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.L3NetworkTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkListInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkListInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.L3NetworkTypeConverter.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,11 +136,11 @@ internal L3NetworkList(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkListInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkListInternal)this).NextLink, global::System.Convert.ToString); } if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3Network[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.L3NetworkTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkListInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkListInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.L3NetworkTypeConverter.ConvertFrom)); } AfterDeserializePSObject(content); } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/L3NetworkList.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/L3NetworkList.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/L3NetworkList.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/L3NetworkList.TypeConverter.cs index 0b7f0a631461..a1632c3f8807 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/L3NetworkList.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/L3NetworkList.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IL3NetworkList ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkList ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkList).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkList).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/L3NetworkList.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/L3NetworkList.cs new file mode 100644 index 000000000000..8ecb3ff8518f --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/L3NetworkList.cs @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + + /// L3NetworkList represents a list of L3 networks. + public partial class L3NetworkList : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkList, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkListInternal + { + + /// Backing field for property. + private string _nextLink; + + /// The link used to get the next page of operations. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; set => this._nextLink = value; } + + /// Backing field for property. + private System.Collections.Generic.List _value; + + /// The list of L3 networks. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public System.Collections.Generic.List Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public L3NetworkList() + { + + } + } + /// L3NetworkList represents a list of L3 networks. + public partial interface IL3NetworkList : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable + { + /// The link used to get the next page of operations. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The link used to get the next page of operations.", + SerializedName = @"nextLink", + PossibleTypes = new [] { typeof(string) })] + string NextLink { get; set; } + /// The list of L3 networks. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The list of L3 networks.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3Network) })] + System.Collections.Generic.List Value { get; set; } + + } + /// L3NetworkList represents a list of L3 networks. + internal partial interface IL3NetworkListInternal + + { + /// The link used to get the next page of operations. + string NextLink { get; set; } + /// The list of L3 networks. + System.Collections.Generic.List Value { get; set; } + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/L3NetworkList.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/L3NetworkList.json.cs similarity index 90% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/L3NetworkList.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/L3NetworkList.json.cs index 5d7f3a9974c5..3c118e8dab5a 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/L3NetworkList.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/L3NetworkList.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class L3NetworkList partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkList. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkList. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkList. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkList. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkList FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkList FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new L3NetworkList(json) : null; } @@ -77,8 +77,8 @@ internal L3NetworkList(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.J { return; } - {_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.NetworkCloud.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.NetworkCloud.Models.Api20250201.IL3Network) (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.L3Network.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.NetworkCloud.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.NetworkCloud.Models.IL3Network) (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.L3Network.FromJson(__u) )) ))() : null : _value;} AfterFromJson(json); } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/L3NetworkPatchParameters.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/L3NetworkPatchParameters.PowerShell.cs similarity index 81% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/L3NetworkPatchParameters.PowerShell.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/L3NetworkPatchParameters.PowerShell.cs index d2f2d3d8e1e0..5ae3fbc8bf9a 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/L3NetworkPatchParameters.PowerShell.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/L3NetworkPatchParameters.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; @@ -65,29 +65,27 @@ public partial class L3NetworkPatchParameters 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.NetworkCloud.Models.Api20250201.IL3NetworkPatchParameters DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkPatchParameters DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new L3NetworkPatchParameters(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.NetworkCloud.Models.Api20250201.IL3NetworkPatchParameters DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkPatchParameters DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new L3NetworkPatchParameters(content); } @@ -97,10 +95,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkPatchParameters FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkPatchParameters FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,13 +113,13 @@ internal L3NetworkPatchParameters(global::System.Collections.IDictionary content // actually deserialize if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkPatchParametersInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkPatchParametersTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkPatchParametersInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.L3NetworkPatchParametersTagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkPatchParametersInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkPatchParametersTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkPatchParametersInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.L3NetworkPatchParametersTagsTypeConverter.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,7 +134,7 @@ internal L3NetworkPatchParameters(global::System.Management.Automation.PSObject // actually deserialize if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkPatchParametersInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkPatchParametersTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkPatchParametersInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.L3NetworkPatchParametersTagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkPatchParametersInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkPatchParametersTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkPatchParametersInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.L3NetworkPatchParametersTagsTypeConverter.ConvertFrom); } AfterDeserializePSObject(content); } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/L3NetworkPatchParameters.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/L3NetworkPatchParameters.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/L3NetworkPatchParameters.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/L3NetworkPatchParameters.TypeConverter.cs index 3e1424aafa57..87f903ba33aa 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/L3NetworkPatchParameters.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/L3NetworkPatchParameters.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IL3NetworkPatchParameters ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkPatchParameters ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkPatchParameters).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkPatchParameters).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/L3NetworkPatchParameters.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/L3NetworkPatchParameters.cs new file mode 100644 index 000000000000..ccfab54ed496 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/L3NetworkPatchParameters.cs @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + + /// + /// L3NetworkPatchParameters represents the body of the request to patch the cloud services network. + /// + public partial class L3NetworkPatchParameters : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkPatchParameters, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkPatchParametersInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkPatchParametersTags _tag; + + /// The Azure resource tags that will replace the existing ones. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkPatchParametersTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.L3NetworkPatchParametersTags()); set => this._tag = value; } + + /// Creates an new instance. + public L3NetworkPatchParameters() + { + + } + } + /// L3NetworkPatchParameters represents the body of the request to patch the cloud services network. + public partial interface IL3NetworkPatchParameters : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable + { + /// The Azure resource tags that will replace the existing ones. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The Azure resource tags that will replace the existing ones.", + SerializedName = @"tags", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkPatchParametersTags) })] + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkPatchParametersTags Tag { get; set; } + + } + /// L3NetworkPatchParameters represents the body of the request to patch the cloud services network. + internal partial interface IL3NetworkPatchParametersInternal + + { + /// The Azure resource tags that will replace the existing ones. + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkPatchParametersTags Tag { get; set; } + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/L3NetworkPatchParameters.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/L3NetworkPatchParameters.json.cs similarity index 94% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/L3NetworkPatchParameters.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/L3NetworkPatchParameters.json.cs index 8ecd09eb1a39..0332bd70d068 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/L3NetworkPatchParameters.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/L3NetworkPatchParameters.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -56,13 +56,13 @@ public partial class L3NetworkPatchParameters partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkPatchParameters. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkPatchParameters. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkPatchParameters. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkPatchParameters. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkPatchParameters FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkPatchParameters FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new L3NetworkPatchParameters(json) : null; } @@ -79,7 +79,7 @@ internal L3NetworkPatchParameters(Microsoft.Azure.PowerShell.Cmdlets.NetworkClou { return; } - {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.L3NetworkPatchParametersTags.FromJson(__jsonTags) : Tag;} + {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.L3NetworkPatchParametersTags.FromJson(__jsonTags) : _tag;} AfterFromJson(json); } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/L3NetworkPatchParametersTags.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/L3NetworkPatchParametersTags.PowerShell.cs similarity index 89% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/L3NetworkPatchParametersTags.PowerShell.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/L3NetworkPatchParametersTags.PowerShell.cs index 602af7539f25..b4df6c84c4c4 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/L3NetworkPatchParametersTags.PowerShell.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/L3NetworkPatchParametersTags.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; @@ -63,29 +63,27 @@ public partial class L3NetworkPatchParametersTags 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.NetworkCloud.Models.Api20250201.IL3NetworkPatchParametersTags DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkPatchParametersTags DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new L3NetworkPatchParametersTags(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.NetworkCloud.Models.Api20250201.IL3NetworkPatchParametersTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkPatchParametersTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new L3NetworkPatchParametersTags(content); } @@ -95,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkPatchParametersTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkPatchParametersTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 L3NetworkPatchParametersTags(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/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/L3NetworkPatchParametersTags.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/L3NetworkPatchParametersTags.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/L3NetworkPatchParametersTags.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/L3NetworkPatchParametersTags.TypeConverter.cs index be7703ccc0c3..f500eb036b89 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/L3NetworkPatchParametersTags.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/L3NetworkPatchParametersTags.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IL3NetworkPatchParametersTags ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkPatchParametersTags ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkPatchParametersTags).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkPatchParametersTags).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/L3NetworkPatchParametersTags.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/L3NetworkPatchParametersTags.cs similarity index 84% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/L3NetworkPatchParametersTags.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/L3NetworkPatchParametersTags.cs index fcbbca504f5d..a79da2e3f4c0 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/L3NetworkPatchParametersTags.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/L3NetworkPatchParametersTags.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; /// The Azure resource tags that will replace the existing ones. public partial class L3NetworkPatchParametersTags : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkPatchParametersTags, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkPatchParametersTagsInternal + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkPatchParametersTags, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkPatchParametersTagsInternal { /// Creates an new instance. diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/L3NetworkPatchParametersTags.dictionary.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/L3NetworkPatchParametersTags.dictionary.cs similarity index 96% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/L3NetworkPatchParametersTags.dictionary.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/L3NetworkPatchParametersTags.dictionary.cs index 7a2cdda0b5c4..4b471daa6a37 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/L3NetworkPatchParametersTags.dictionary.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/L3NetworkPatchParametersTags.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.L3NetworkPatchParametersTags source) => source.__additionalProperties; + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.L3NetworkPatchParametersTags source) => source.__additionalProperties; } } \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/L3NetworkPatchParametersTags.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/L3NetworkPatchParametersTags.json.cs similarity index 95% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/L3NetworkPatchParametersTags.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/L3NetworkPatchParametersTags.json.cs index a3520cdfb734..84b1d3286f12 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/L3NetworkPatchParametersTags.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/L3NetworkPatchParametersTags.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class L3NetworkPatchParametersTags partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkPatchParametersTags. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkPatchParametersTags. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkPatchParametersTags. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkPatchParametersTags. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkPatchParametersTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkPatchParametersTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new L3NetworkPatchParametersTags(json) : null; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/L3NetworkProperties.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/L3NetworkProperties.PowerShell.cs new file mode 100644 index 000000000000..c949e84fe4a0 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/L3NetworkProperties.PowerShell.cs @@ -0,0 +1,276 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + + /// L3NetworkProperties represents properties of the L3 network. + [System.ComponentModel.TypeConverter(typeof(L3NetworkPropertiesTypeConverter))] + public partial class L3NetworkProperties + { + + /// + /// 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.NetworkCloud.Models.IL3NetworkProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new L3NetworkProperties(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.NetworkCloud.Models.IL3NetworkProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new L3NetworkProperties(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.NetworkCloud.Models.IL3NetworkProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal L3NetworkProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("AssociatedResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkPropertiesInternal)this).AssociatedResourceId = (System.Collections.Generic.List) content.GetValueForProperty("AssociatedResourceId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkPropertiesInternal)this).AssociatedResourceId, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("ClusterId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkPropertiesInternal)this).ClusterId = (string) content.GetValueForProperty("ClusterId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkPropertiesInternal)this).ClusterId, global::System.Convert.ToString); + } + if (content.Contains("DetailedStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkPropertiesInternal)this).DetailedStatus = (string) content.GetValueForProperty("DetailedStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkPropertiesInternal)this).DetailedStatus, global::System.Convert.ToString); + } + if (content.Contains("DetailedStatusMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkPropertiesInternal)this).DetailedStatusMessage = (string) content.GetValueForProperty("DetailedStatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkPropertiesInternal)this).DetailedStatusMessage, global::System.Convert.ToString); + } + if (content.Contains("HybridAksClustersAssociatedId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkPropertiesInternal)this).HybridAksClustersAssociatedId = (System.Collections.Generic.List) content.GetValueForProperty("HybridAksClustersAssociatedId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkPropertiesInternal)this).HybridAksClustersAssociatedId, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("HybridAksIpamEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkPropertiesInternal)this).HybridAksIpamEnabled = (string) content.GetValueForProperty("HybridAksIpamEnabled",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkPropertiesInternal)this).HybridAksIpamEnabled, global::System.Convert.ToString); + } + if (content.Contains("HybridAksPluginType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkPropertiesInternal)this).HybridAksPluginType = (string) content.GetValueForProperty("HybridAksPluginType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkPropertiesInternal)this).HybridAksPluginType, global::System.Convert.ToString); + } + if (content.Contains("InterfaceName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkPropertiesInternal)this).InterfaceName = (string) content.GetValueForProperty("InterfaceName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkPropertiesInternal)this).InterfaceName, global::System.Convert.ToString); + } + if (content.Contains("IPAllocationType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkPropertiesInternal)this).IPAllocationType = (string) content.GetValueForProperty("IPAllocationType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkPropertiesInternal)this).IPAllocationType, global::System.Convert.ToString); + } + if (content.Contains("Ipv4ConnectedPrefix")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkPropertiesInternal)this).Ipv4ConnectedPrefix = (string) content.GetValueForProperty("Ipv4ConnectedPrefix",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkPropertiesInternal)this).Ipv4ConnectedPrefix, global::System.Convert.ToString); + } + if (content.Contains("Ipv6ConnectedPrefix")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkPropertiesInternal)this).Ipv6ConnectedPrefix = (string) content.GetValueForProperty("Ipv6ConnectedPrefix",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkPropertiesInternal)this).Ipv6ConnectedPrefix, global::System.Convert.ToString); + } + if (content.Contains("L3IsolationDomainId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkPropertiesInternal)this).L3IsolationDomainId = (string) content.GetValueForProperty("L3IsolationDomainId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkPropertiesInternal)this).L3IsolationDomainId, global::System.Convert.ToString); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkPropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkPropertiesInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("VirtualMachinesAssociatedId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkPropertiesInternal)this).VirtualMachinesAssociatedId = (System.Collections.Generic.List) content.GetValueForProperty("VirtualMachinesAssociatedId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkPropertiesInternal)this).VirtualMachinesAssociatedId, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("Vlan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkPropertiesInternal)this).Vlan = (long?) content.GetValueForProperty("Vlan",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkPropertiesInternal)this).Vlan, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal L3NetworkProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("AssociatedResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkPropertiesInternal)this).AssociatedResourceId = (System.Collections.Generic.List) content.GetValueForProperty("AssociatedResourceId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkPropertiesInternal)this).AssociatedResourceId, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("ClusterId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkPropertiesInternal)this).ClusterId = (string) content.GetValueForProperty("ClusterId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkPropertiesInternal)this).ClusterId, global::System.Convert.ToString); + } + if (content.Contains("DetailedStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkPropertiesInternal)this).DetailedStatus = (string) content.GetValueForProperty("DetailedStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkPropertiesInternal)this).DetailedStatus, global::System.Convert.ToString); + } + if (content.Contains("DetailedStatusMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkPropertiesInternal)this).DetailedStatusMessage = (string) content.GetValueForProperty("DetailedStatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkPropertiesInternal)this).DetailedStatusMessage, global::System.Convert.ToString); + } + if (content.Contains("HybridAksClustersAssociatedId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkPropertiesInternal)this).HybridAksClustersAssociatedId = (System.Collections.Generic.List) content.GetValueForProperty("HybridAksClustersAssociatedId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkPropertiesInternal)this).HybridAksClustersAssociatedId, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("HybridAksIpamEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkPropertiesInternal)this).HybridAksIpamEnabled = (string) content.GetValueForProperty("HybridAksIpamEnabled",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkPropertiesInternal)this).HybridAksIpamEnabled, global::System.Convert.ToString); + } + if (content.Contains("HybridAksPluginType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkPropertiesInternal)this).HybridAksPluginType = (string) content.GetValueForProperty("HybridAksPluginType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkPropertiesInternal)this).HybridAksPluginType, global::System.Convert.ToString); + } + if (content.Contains("InterfaceName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkPropertiesInternal)this).InterfaceName = (string) content.GetValueForProperty("InterfaceName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkPropertiesInternal)this).InterfaceName, global::System.Convert.ToString); + } + if (content.Contains("IPAllocationType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkPropertiesInternal)this).IPAllocationType = (string) content.GetValueForProperty("IPAllocationType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkPropertiesInternal)this).IPAllocationType, global::System.Convert.ToString); + } + if (content.Contains("Ipv4ConnectedPrefix")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkPropertiesInternal)this).Ipv4ConnectedPrefix = (string) content.GetValueForProperty("Ipv4ConnectedPrefix",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkPropertiesInternal)this).Ipv4ConnectedPrefix, global::System.Convert.ToString); + } + if (content.Contains("Ipv6ConnectedPrefix")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkPropertiesInternal)this).Ipv6ConnectedPrefix = (string) content.GetValueForProperty("Ipv6ConnectedPrefix",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkPropertiesInternal)this).Ipv6ConnectedPrefix, global::System.Convert.ToString); + } + if (content.Contains("L3IsolationDomainId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkPropertiesInternal)this).L3IsolationDomainId = (string) content.GetValueForProperty("L3IsolationDomainId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkPropertiesInternal)this).L3IsolationDomainId, global::System.Convert.ToString); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkPropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkPropertiesInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("VirtualMachinesAssociatedId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkPropertiesInternal)this).VirtualMachinesAssociatedId = (System.Collections.Generic.List) content.GetValueForProperty("VirtualMachinesAssociatedId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkPropertiesInternal)this).VirtualMachinesAssociatedId, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("Vlan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkPropertiesInternal)this).Vlan = (long?) content.GetValueForProperty("Vlan",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkPropertiesInternal)this).Vlan, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + 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.NetworkCloud.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(); + } + } + /// L3NetworkProperties represents properties of the L3 network. + [System.ComponentModel.TypeConverter(typeof(L3NetworkPropertiesTypeConverter))] + public partial interface IL3NetworkProperties + + { + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/L3NetworkProperties.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/L3NetworkProperties.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/L3NetworkProperties.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/L3NetworkProperties.TypeConverter.cs index 1a33031ace3d..059204a0f1f4 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/L3NetworkProperties.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/L3NetworkProperties.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IL3NetworkProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/L3NetworkProperties.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/L3NetworkProperties.cs new file mode 100644 index 000000000000..a5a2a06b36ea --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/L3NetworkProperties.cs @@ -0,0 +1,434 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + + /// L3NetworkProperties represents properties of the L3 network. + public partial class L3NetworkProperties : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkProperties, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkPropertiesInternal + { + + /// Backing field for property. + private System.Collections.Generic.List _associatedResourceId; + + /// + /// The list of resource IDs for the other Microsoft.NetworkCloud resources that have attached this network. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public System.Collections.Generic.List AssociatedResourceId { get => this._associatedResourceId; } + + /// Backing field for property. + private string _clusterId; + + /// + /// The resource ID of the Network Cloud cluster this L3 network is associated with. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string ClusterId { get => this._clusterId; } + + /// Backing field for property. + private string _detailedStatus; + + /// The more detailed status of the L3 network. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string DetailedStatus { get => this._detailedStatus; } + + /// Backing field for property. + private string _detailedStatusMessage; + + /// The descriptive message about the current detailed status. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string DetailedStatusMessage { get => this._detailedStatusMessage; } + + /// Backing field for property. + private System.Collections.Generic.List _hybridAksClustersAssociatedId; + + /// + /// Field Deprecated. These fields will be empty/omitted. The list of Hybrid AKS cluster resource IDs that are associated + /// with this L3 network. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public System.Collections.Generic.List HybridAksClustersAssociatedId { get => this._hybridAksClustersAssociatedId; } + + /// Backing field for property. + private string _hybridAksIpamEnabled; + + /// + /// Field Deprecated. The field was previously optional, now it will have no defined behavior and will be ignored. The indicator + /// of whether or not to disable IPAM allocation on the network attachment definition injected into the Hybrid AKS Cluster. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string HybridAksIpamEnabled { get => this._hybridAksIpamEnabled; set => this._hybridAksIpamEnabled = value; } + + /// Backing field for property. + private string _hybridAksPluginType; + + /// + /// Field Deprecated. The field was previously optional, now it will have no defined behavior and will be ignored. The network + /// plugin type for Hybrid AKS. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string HybridAksPluginType { get => this._hybridAksPluginType; set => this._hybridAksPluginType = value; } + + /// Backing field for property. + private string _iPAllocationType; + + /// The type of the IP address allocation, defaulted to "DualStack". + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string IPAllocationType { get => this._iPAllocationType; set => this._iPAllocationType = value; } + + /// Backing field for property. + private string _interfaceName; + + /// + /// The default interface name for this L3 network in the virtual machine. This name can be overridden by the name supplied + /// in the network attachment configuration of that virtual machine. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string InterfaceName { get => this._interfaceName; set => this._interfaceName = value; } + + /// Backing field for property. + private string _ipv4ConnectedPrefix; + + /// + /// The IPV4 prefix (CIDR) assigned to this L3 network. Required when the IP allocation type is IPV4 or DualStack. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string Ipv4ConnectedPrefix { get => this._ipv4ConnectedPrefix; set => this._ipv4ConnectedPrefix = value; } + + /// Backing field for property. + private string _ipv6ConnectedPrefix; + + /// + /// The IPV6 prefix (CIDR) assigned to this L3 network. Required when the IP allocation type is IPV6 or DualStack. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string Ipv6ConnectedPrefix { get => this._ipv6ConnectedPrefix; set => this._ipv6ConnectedPrefix = value; } + + /// Backing field for property. + private string _l3IsolationDomainId; + + /// The resource ID of the Network Fabric l3IsolationDomain. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string L3IsolationDomainId { get => this._l3IsolationDomainId; set => this._l3IsolationDomainId = value; } + + /// Internal Acessors for AssociatedResourceId + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkPropertiesInternal.AssociatedResourceId { get => this._associatedResourceId; set { {_associatedResourceId = value;} } } + + /// Internal Acessors for ClusterId + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkPropertiesInternal.ClusterId { get => this._clusterId; set { {_clusterId = value;} } } + + /// Internal Acessors for DetailedStatus + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkPropertiesInternal.DetailedStatus { get => this._detailedStatus; set { {_detailedStatus = value;} } } + + /// Internal Acessors for DetailedStatusMessage + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkPropertiesInternal.DetailedStatusMessage { get => this._detailedStatusMessage; set { {_detailedStatusMessage = value;} } } + + /// Internal Acessors for HybridAksClustersAssociatedId + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkPropertiesInternal.HybridAksClustersAssociatedId { get => this._hybridAksClustersAssociatedId; set { {_hybridAksClustersAssociatedId = value;} } } + + /// Internal Acessors for ProvisioningState + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkPropertiesInternal.ProvisioningState { get => this._provisioningState; set { {_provisioningState = value;} } } + + /// Internal Acessors for VirtualMachinesAssociatedId + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkPropertiesInternal.VirtualMachinesAssociatedId { get => this._virtualMachinesAssociatedId; set { {_virtualMachinesAssociatedId = value;} } } + + /// Backing field for property. + private string _provisioningState; + + /// The provisioning state of the L3 network. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string ProvisioningState { get => this._provisioningState; } + + /// Backing field for property. + private System.Collections.Generic.List _virtualMachinesAssociatedId; + + /// + /// Field Deprecated. These fields will be empty/omitted. The list of virtual machine resource IDs, excluding any Hybrid AKS + /// virtual machines, that are currently using this L3 network. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public System.Collections.Generic.List VirtualMachinesAssociatedId { get => this._virtualMachinesAssociatedId; } + + /// Backing field for property. + private long? _vlan; + + /// The VLAN from the l3IsolationDomain that is used for this network. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public long? Vlan { get => this._vlan; set => this._vlan = value; } + + /// Creates an new instance. + public L3NetworkProperties() + { + + } + } + /// L3NetworkProperties represents properties of the L3 network. + public partial interface IL3NetworkProperties : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable + { + /// + /// The list of resource IDs for the other Microsoft.NetworkCloud resources that have attached this network. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The list of resource IDs for the other Microsoft.NetworkCloud resources that have attached this network.", + SerializedName = @"associatedResourceIds", + PossibleTypes = new [] { typeof(string) })] + System.Collections.Generic.List AssociatedResourceId { get; } + /// + /// The resource ID of the Network Cloud cluster this L3 network is associated with. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The resource ID of the Network Cloud cluster this L3 network is associated with.", + SerializedName = @"clusterId", + PossibleTypes = new [] { typeof(string) })] + string ClusterId { get; } + /// The more detailed status of the L3 network. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The more detailed status of the L3 network.", + SerializedName = @"detailedStatus", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Error", "Available", "Provisioning")] + string DetailedStatus { get; } + /// The descriptive message about the current detailed status. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The descriptive message about the current detailed status.", + SerializedName = @"detailedStatusMessage", + PossibleTypes = new [] { typeof(string) })] + string DetailedStatusMessage { get; } + /// + /// Field Deprecated. These fields will be empty/omitted. The list of Hybrid AKS cluster resource IDs that are associated + /// with this L3 network. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"Field Deprecated. These fields will be empty/omitted. The list of Hybrid AKS cluster resource IDs that are associated with this L3 network.", + SerializedName = @"hybridAksClustersAssociatedIds", + PossibleTypes = new [] { typeof(string) })] + System.Collections.Generic.List HybridAksClustersAssociatedId { get; } + /// + /// Field Deprecated. The field was previously optional, now it will have no defined behavior and will be ignored. The indicator + /// of whether or not to disable IPAM allocation on the network attachment definition injected into the Hybrid AKS Cluster. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"Field Deprecated. The field was previously optional, now it will have no defined behavior and will be ignored. The indicator of whether or not to disable IPAM allocation on the network attachment definition injected into the Hybrid AKS Cluster.", + SerializedName = @"hybridAksIpamEnabled", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("True", "False")] + string HybridAksIpamEnabled { get; set; } + /// + /// Field Deprecated. The field was previously optional, now it will have no defined behavior and will be ignored. The network + /// plugin type for Hybrid AKS. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"Field Deprecated. The field was previously optional, now it will have no defined behavior and will be ignored. The network plugin type for Hybrid AKS.", + SerializedName = @"hybridAksPluginType", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("DPDK", "SRIOV", "OSDevice")] + string HybridAksPluginType { get; set; } + /// The type of the IP address allocation, defaulted to "DualStack". + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The type of the IP address allocation, defaulted to ""DualStack"".", + SerializedName = @"ipAllocationType", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("IPV4", "IPV6", "DualStack")] + string IPAllocationType { get; set; } + /// + /// The default interface name for this L3 network in the virtual machine. This name can be overridden by the name supplied + /// in the network attachment configuration of that virtual machine. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The default interface name for this L3 network in the virtual machine. This name can be overridden by the name supplied in the network attachment configuration of that virtual machine.", + SerializedName = @"interfaceName", + PossibleTypes = new [] { typeof(string) })] + string InterfaceName { get; set; } + /// + /// The IPV4 prefix (CIDR) assigned to this L3 network. Required when the IP allocation type is IPV4 or DualStack. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The IPV4 prefix (CIDR) assigned to this L3 network. Required when the IP allocation type is IPV4 or DualStack.", + SerializedName = @"ipv4ConnectedPrefix", + PossibleTypes = new [] { typeof(string) })] + string Ipv4ConnectedPrefix { get; set; } + /// + /// The IPV6 prefix (CIDR) assigned to this L3 network. Required when the IP allocation type is IPV6 or DualStack. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The IPV6 prefix (CIDR) assigned to this L3 network. Required when the IP allocation type is IPV6 or DualStack.", + SerializedName = @"ipv6ConnectedPrefix", + PossibleTypes = new [] { typeof(string) })] + string Ipv6ConnectedPrefix { get; set; } + /// The resource ID of the Network Fabric l3IsolationDomain. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The resource ID of the Network Fabric l3IsolationDomain.", + SerializedName = @"l3IsolationDomainId", + PossibleTypes = new [] { typeof(string) })] + string L3IsolationDomainId { get; set; } + /// The provisioning state of the L3 network. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The provisioning state of the L3 network.", + SerializedName = @"provisioningState", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Succeeded", "Failed", "Canceled", "Provisioning", "Accepted")] + string ProvisioningState { get; } + /// + /// Field Deprecated. These fields will be empty/omitted. The list of virtual machine resource IDs, excluding any Hybrid AKS + /// virtual machines, that are currently using this L3 network. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"Field Deprecated. These fields will be empty/omitted. The list of virtual machine resource IDs, excluding any Hybrid AKS virtual machines, that are currently using this L3 network.", + SerializedName = @"virtualMachinesAssociatedIds", + PossibleTypes = new [] { typeof(string) })] + System.Collections.Generic.List VirtualMachinesAssociatedId { get; } + /// The VLAN from the l3IsolationDomain that is used for this network. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The VLAN from the l3IsolationDomain that is used for this network.", + SerializedName = @"vlan", + PossibleTypes = new [] { typeof(long) })] + long? Vlan { get; set; } + + } + /// L3NetworkProperties represents properties of the L3 network. + internal partial interface IL3NetworkPropertiesInternal + + { + /// + /// The list of resource IDs for the other Microsoft.NetworkCloud resources that have attached this network. + /// + System.Collections.Generic.List AssociatedResourceId { get; set; } + /// + /// The resource ID of the Network Cloud cluster this L3 network is associated with. + /// + string ClusterId { get; set; } + /// The more detailed status of the L3 network. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Error", "Available", "Provisioning")] + string DetailedStatus { get; set; } + /// The descriptive message about the current detailed status. + string DetailedStatusMessage { get; set; } + /// + /// Field Deprecated. These fields will be empty/omitted. The list of Hybrid AKS cluster resource IDs that are associated + /// with this L3 network. + /// + System.Collections.Generic.List HybridAksClustersAssociatedId { get; set; } + /// + /// Field Deprecated. The field was previously optional, now it will have no defined behavior and will be ignored. The indicator + /// of whether or not to disable IPAM allocation on the network attachment definition injected into the Hybrid AKS Cluster. + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("True", "False")] + string HybridAksIpamEnabled { get; set; } + /// + /// Field Deprecated. The field was previously optional, now it will have no defined behavior and will be ignored. The network + /// plugin type for Hybrid AKS. + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("DPDK", "SRIOV", "OSDevice")] + string HybridAksPluginType { get; set; } + /// The type of the IP address allocation, defaulted to "DualStack". + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("IPV4", "IPV6", "DualStack")] + string IPAllocationType { get; set; } + /// + /// The default interface name for this L3 network in the virtual machine. This name can be overridden by the name supplied + /// in the network attachment configuration of that virtual machine. + /// + string InterfaceName { get; set; } + /// + /// The IPV4 prefix (CIDR) assigned to this L3 network. Required when the IP allocation type is IPV4 or DualStack. + /// + string Ipv4ConnectedPrefix { get; set; } + /// + /// The IPV6 prefix (CIDR) assigned to this L3 network. Required when the IP allocation type is IPV6 or DualStack. + /// + string Ipv6ConnectedPrefix { get; set; } + /// The resource ID of the Network Fabric l3IsolationDomain. + string L3IsolationDomainId { get; set; } + /// The provisioning state of the L3 network. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Succeeded", "Failed", "Canceled", "Provisioning", "Accepted")] + string ProvisioningState { get; set; } + /// + /// Field Deprecated. These fields will be empty/omitted. The list of virtual machine resource IDs, excluding any Hybrid AKS + /// virtual machines, that are currently using this L3 network. + /// + System.Collections.Generic.List VirtualMachinesAssociatedId { get; set; } + /// The VLAN from the l3IsolationDomain that is used for this network. + long? Vlan { get; set; } + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/L3NetworkProperties.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/L3NetworkProperties.json.cs new file mode 100644 index 000000000000..36cd7aa4c754 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/L3NetworkProperties.json.cs @@ -0,0 +1,202 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + + /// L3NetworkProperties represents properties of the L3 network. + public partial class L3NetworkProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new L3NetworkProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject instance to deserialize from. + internal L3NetworkProperties(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_associatedResourceId = If( json?.PropertyT("associatedResourceIds"), out var __jsonAssociatedResourceIds) ? If( __jsonAssociatedResourceIds as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : _associatedResourceId;} + {_clusterId = If( json?.PropertyT("clusterId"), out var __jsonClusterId) ? (string)__jsonClusterId : (string)_clusterId;} + {_detailedStatus = If( json?.PropertyT("detailedStatus"), out var __jsonDetailedStatus) ? (string)__jsonDetailedStatus : (string)_detailedStatus;} + {_detailedStatusMessage = If( json?.PropertyT("detailedStatusMessage"), out var __jsonDetailedStatusMessage) ? (string)__jsonDetailedStatusMessage : (string)_detailedStatusMessage;} + {_hybridAksClustersAssociatedId = If( json?.PropertyT("hybridAksClustersAssociatedIds"), out var __jsonHybridAksClustersAssociatedIds) ? If( __jsonHybridAksClustersAssociatedIds as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Json.JsonString __o ? (string)(__o.ToString()) : null)) ))() : null : _hybridAksClustersAssociatedId;} + {_hybridAksIpamEnabled = If( json?.PropertyT("hybridAksIpamEnabled"), out var __jsonHybridAksIpamEnabled) ? (string)__jsonHybridAksIpamEnabled : (string)_hybridAksIpamEnabled;} + {_hybridAksPluginType = If( json?.PropertyT("hybridAksPluginType"), out var __jsonHybridAksPluginType) ? (string)__jsonHybridAksPluginType : (string)_hybridAksPluginType;} + {_interfaceName = If( json?.PropertyT("interfaceName"), out var __jsonInterfaceName) ? (string)__jsonInterfaceName : (string)_interfaceName;} + {_iPAllocationType = If( json?.PropertyT("ipAllocationType"), out var __jsonIPAllocationType) ? (string)__jsonIPAllocationType : (string)_iPAllocationType;} + {_ipv4ConnectedPrefix = If( json?.PropertyT("ipv4ConnectedPrefix"), out var __jsonIpv4ConnectedPrefix) ? (string)__jsonIpv4ConnectedPrefix : (string)_ipv4ConnectedPrefix;} + {_ipv6ConnectedPrefix = If( json?.PropertyT("ipv6ConnectedPrefix"), out var __jsonIpv6ConnectedPrefix) ? (string)__jsonIpv6ConnectedPrefix : (string)_ipv6ConnectedPrefix;} + {_l3IsolationDomainId = If( json?.PropertyT("l3IsolationDomainId"), out var __jsonL3IsolationDomainId) ? (string)__jsonL3IsolationDomainId : (string)_l3IsolationDomainId;} + {_provisioningState = If( json?.PropertyT("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)_provisioningState;} + {_virtualMachinesAssociatedId = If( json?.PropertyT("virtualMachinesAssociatedIds"), out var __jsonVirtualMachinesAssociatedIds) ? If( __jsonVirtualMachinesAssociatedIds as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Json.JsonString __j ? (string)(__j.ToString()) : null)) ))() : null : _virtualMachinesAssociatedId;} + {_vlan = If( json?.PropertyT("vlan"), out var __jsonVlan) ? (long?)__jsonVlan : _vlan;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) + { + if (null != this._associatedResourceId) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.XNodeArray(); + foreach( var __x in this._associatedResourceId ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("associatedResourceIds",__w); + } + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) + { + AddIf( null != (((object)this._clusterId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._clusterId.ToString()) : null, "clusterId" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) + { + AddIf( null != (((object)this._detailedStatus)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._detailedStatus.ToString()) : null, "detailedStatus" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) + { + AddIf( null != (((object)this._detailedStatusMessage)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._detailedStatusMessage.ToString()) : null, "detailedStatusMessage" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) + { + if (null != this._hybridAksClustersAssociatedId) + { + var __r = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.XNodeArray(); + foreach( var __s in this._hybridAksClustersAssociatedId ) + { + AddIf(null != (((object)__s)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(__s.ToString()) : null ,__r.Add); + } + container.Add("hybridAksClustersAssociatedIds",__r); + } + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)||serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate)) + { + AddIf( null != (((object)this._hybridAksIpamEnabled)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._hybridAksIpamEnabled.ToString()) : null, "hybridAksIpamEnabled" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)||serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate)) + { + AddIf( null != (((object)this._hybridAksPluginType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._hybridAksPluginType.ToString()) : null, "hybridAksPluginType" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)||serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate)) + { + AddIf( null != (((object)this._interfaceName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._interfaceName.ToString()) : null, "interfaceName" ,container.Add ); + } + AddIf( null != (((object)this._iPAllocationType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._iPAllocationType.ToString()) : null, "ipAllocationType" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)||serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate)) + { + AddIf( null != (((object)this._ipv4ConnectedPrefix)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._ipv4ConnectedPrefix.ToString()) : null, "ipv4ConnectedPrefix" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)||serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate)) + { + AddIf( null != (((object)this._ipv6ConnectedPrefix)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._ipv6ConnectedPrefix.ToString()) : null, "ipv6ConnectedPrefix" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)||serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate)) + { + AddIf( null != (((object)this._l3IsolationDomainId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._l3IsolationDomainId.ToString()) : null, "l3IsolationDomainId" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) + { + AddIf( null != (((object)this._provisioningState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._provisioningState.ToString()) : null, "provisioningState" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) + { + if (null != this._virtualMachinesAssociatedId) + { + var __m = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.XNodeArray(); + foreach( var __n in this._virtualMachinesAssociatedId ) + { + AddIf(null != (((object)__n)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(__n.ToString()) : null ,__m.Add); + } + container.Add("virtualMachinesAssociatedIds",__m); + } + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)||serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate)) + { + AddIf( null != this._vlan ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNumber((long)this._vlan) : null, "vlan" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/LldpNeighbor.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/LldpNeighbor.PowerShell.cs similarity index 75% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/LldpNeighbor.PowerShell.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/LldpNeighbor.PowerShell.cs index eca53f797eef..ae74c152f246 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/LldpNeighbor.PowerShell.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/LldpNeighbor.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; @@ -66,27 +66,27 @@ public partial class LldpNeighbor 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.NetworkCloud.Models.Api20250201.ILldpNeighbor DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ILldpNeighbor DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new LldpNeighbor(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.NetworkCloud.Models.Api20250201.ILldpNeighbor DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ILldpNeighbor DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new LldpNeighbor(content); } @@ -96,10 +96,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ILldpNeighbor FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ILldpNeighbor FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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. @@ -114,25 +114,25 @@ internal LldpNeighbor(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("PortDescription")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ILldpNeighborInternal)this).PortDescription = (string) content.GetValueForProperty("PortDescription",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ILldpNeighborInternal)this).PortDescription, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ILldpNeighborInternal)this).PortDescription = (string) content.GetValueForProperty("PortDescription",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ILldpNeighborInternal)this).PortDescription, global::System.Convert.ToString); } if (content.Contains("PortName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ILldpNeighborInternal)this).PortName = (string) content.GetValueForProperty("PortName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ILldpNeighborInternal)this).PortName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ILldpNeighborInternal)this).PortName = (string) content.GetValueForProperty("PortName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ILldpNeighborInternal)this).PortName, global::System.Convert.ToString); } if (content.Contains("SystemDescription")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ILldpNeighborInternal)this).SystemDescription = (string) content.GetValueForProperty("SystemDescription",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ILldpNeighborInternal)this).SystemDescription, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ILldpNeighborInternal)this).SystemDescription = (string) content.GetValueForProperty("SystemDescription",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ILldpNeighborInternal)this).SystemDescription, global::System.Convert.ToString); } if (content.Contains("SystemName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ILldpNeighborInternal)this).SystemName = (string) content.GetValueForProperty("SystemName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ILldpNeighborInternal)this).SystemName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ILldpNeighborInternal)this).SystemName = (string) content.GetValueForProperty("SystemName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ILldpNeighborInternal)this).SystemName, 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. @@ -147,19 +147,19 @@ internal LldpNeighbor(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("PortDescription")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ILldpNeighborInternal)this).PortDescription = (string) content.GetValueForProperty("PortDescription",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ILldpNeighborInternal)this).PortDescription, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ILldpNeighborInternal)this).PortDescription = (string) content.GetValueForProperty("PortDescription",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ILldpNeighborInternal)this).PortDescription, global::System.Convert.ToString); } if (content.Contains("PortName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ILldpNeighborInternal)this).PortName = (string) content.GetValueForProperty("PortName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ILldpNeighborInternal)this).PortName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ILldpNeighborInternal)this).PortName = (string) content.GetValueForProperty("PortName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ILldpNeighborInternal)this).PortName, global::System.Convert.ToString); } if (content.Contains("SystemDescription")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ILldpNeighborInternal)this).SystemDescription = (string) content.GetValueForProperty("SystemDescription",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ILldpNeighborInternal)this).SystemDescription, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ILldpNeighborInternal)this).SystemDescription = (string) content.GetValueForProperty("SystemDescription",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ILldpNeighborInternal)this).SystemDescription, global::System.Convert.ToString); } if (content.Contains("SystemName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ILldpNeighborInternal)this).SystemName = (string) content.GetValueForProperty("SystemName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ILldpNeighborInternal)this).SystemName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ILldpNeighborInternal)this).SystemName = (string) content.GetValueForProperty("SystemName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ILldpNeighborInternal)this).SystemName, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/LldpNeighbor.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/LldpNeighbor.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/LldpNeighbor.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/LldpNeighbor.TypeConverter.cs index a33ccd7c9ee6..fdd866075a51 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/LldpNeighbor.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/LldpNeighbor.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.ILldpNeighbor ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ILldpNeighbor ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ILldpNeighbor).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ILldpNeighbor).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/LldpNeighbor.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/LldpNeighbor.cs similarity index 86% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/LldpNeighbor.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/LldpNeighbor.cs index 1dae96dae867..b0eed65641f8 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/LldpNeighbor.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/LldpNeighbor.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -12,21 +12,21 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201 /// to the NIC. /// public partial class LldpNeighbor : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ILldpNeighbor, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ILldpNeighborInternal + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ILldpNeighbor, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ILldpNeighborInternal { /// Internal Acessors for PortDescription - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ILldpNeighborInternal.PortDescription { get => this._portDescription; set { {_portDescription = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ILldpNeighborInternal.PortDescription { get => this._portDescription; set { {_portDescription = value;} } } /// Internal Acessors for PortName - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ILldpNeighborInternal.PortName { get => this._portName; set { {_portName = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ILldpNeighborInternal.PortName { get => this._portName; set { {_portName = value;} } } /// Internal Acessors for SystemDescription - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ILldpNeighborInternal.SystemDescription { get => this._systemDescription; set { {_systemDescription = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ILldpNeighborInternal.SystemDescription { get => this._systemDescription; set { {_systemDescription = value;} } } /// Internal Acessors for SystemName - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ILldpNeighborInternal.SystemName { get => this._systemName; set { {_systemName = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ILldpNeighborInternal.SystemName { get => this._systemName; set { {_systemName = value;} } } /// Backing field for property. private string _portDescription; @@ -71,6 +71,9 @@ public partial interface ILldpNeighbor : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The descriptive information about the port on the connected device.", SerializedName = @"portDescription", PossibleTypes = new [] { typeof(string) })] @@ -79,6 +82,9 @@ public partial interface ILldpNeighbor : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The system-assigned name of the port on the connected device.", SerializedName = @"portName", PossibleTypes = new [] { typeof(string) })] @@ -87,6 +93,9 @@ public partial interface ILldpNeighbor : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The descriptive information about the connected device.", SerializedName = @"systemDescription", PossibleTypes = new [] { typeof(string) })] @@ -95,6 +104,9 @@ public partial interface ILldpNeighbor : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The system-assigned name of the connected device.", SerializedName = @"systemName", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/LldpNeighbor.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/LldpNeighbor.json.cs similarity index 92% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/LldpNeighbor.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/LldpNeighbor.json.cs index 30e78b14a0a3..5141d4ac8e5e 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/LldpNeighbor.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/LldpNeighbor.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -57,13 +57,13 @@ public partial class LldpNeighbor partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ILldpNeighbor. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ILldpNeighbor. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ILldpNeighbor. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ILldpNeighbor. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ILldpNeighbor FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ILldpNeighbor FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new LldpNeighbor(json) : null; } @@ -80,10 +80,10 @@ internal LldpNeighbor(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Js { return; } - {_portDescription = If( json?.PropertyT("portDescription"), out var __jsonPortDescription) ? (string)__jsonPortDescription : (string)PortDescription;} - {_portName = If( json?.PropertyT("portName"), out var __jsonPortName) ? (string)__jsonPortName : (string)PortName;} - {_systemDescription = If( json?.PropertyT("systemDescription"), out var __jsonSystemDescription) ? (string)__jsonSystemDescription : (string)SystemDescription;} - {_systemName = If( json?.PropertyT("systemName"), out var __jsonSystemName) ? (string)__jsonSystemName : (string)SystemName;} + {_portDescription = If( json?.PropertyT("portDescription"), out var __jsonPortDescription) ? (string)__jsonPortDescription : (string)_portDescription;} + {_portName = If( json?.PropertyT("portName"), out var __jsonPortName) ? (string)__jsonPortName : (string)_portName;} + {_systemDescription = If( json?.PropertyT("systemDescription"), out var __jsonSystemDescription) ? (string)__jsonSystemDescription : (string)_systemDescription;} + {_systemName = If( json?.PropertyT("systemName"), out var __jsonSystemName) ? (string)__jsonSystemName : (string)_systemName;} AfterFromJson(json); } @@ -106,19 +106,19 @@ public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode ToJ { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._portDescription)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._portDescription.ToString()) : null, "portDescription" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._portName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._portName.ToString()) : null, "portName" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._systemDescription)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._systemDescription.ToString()) : null, "systemDescription" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._systemName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._systemName.ToString()) : null, "systemName" ,container.Add ); } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/MachineDisk.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/MachineDisk.PowerShell.cs new file mode 100644 index 000000000000..3d7d031616b4 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/MachineDisk.PowerShell.cs @@ -0,0 +1,180 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + + /// Disk represents the properties of the disk. + [System.ComponentModel.TypeConverter(typeof(MachineDiskTypeConverter))] + public partial class MachineDisk + { + + /// + /// 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.NetworkCloud.Models.IMachineDisk DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MachineDisk(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.NetworkCloud.Models.IMachineDisk DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MachineDisk(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.NetworkCloud.Models.IMachineDisk FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MachineDisk(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("CapacityGb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineDiskInternal)this).CapacityGb = (long?) content.GetValueForProperty("CapacityGb",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineDiskInternal)this).CapacityGb, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("Connection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineDiskInternal)this).Connection = (string) content.GetValueForProperty("Connection",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineDiskInternal)this).Connection, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineDiskInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineDiskInternal)this).Type, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MachineDisk(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("CapacityGb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineDiskInternal)this).CapacityGb = (long?) content.GetValueForProperty("CapacityGb",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineDiskInternal)this).CapacityGb, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("Connection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineDiskInternal)this).Connection = (string) content.GetValueForProperty("Connection",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineDiskInternal)this).Connection, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineDiskInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineDiskInternal)this).Type, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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(); + } + } + /// Disk represents the properties of the disk. + [System.ComponentModel.TypeConverter(typeof(MachineDiskTypeConverter))] + public partial interface IMachineDisk + + { + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/MachineDisk.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/MachineDisk.TypeConverter.cs similarity index 98% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/MachineDisk.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/MachineDisk.TypeConverter.cs index 08f29fd974f7..081db495ce51 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/MachineDisk.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/MachineDisk.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IMachineDisk ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineDisk ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineDisk).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineDisk).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/MachineDisk.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/MachineDisk.cs new file mode 100644 index 000000000000..870b6fe61420 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/MachineDisk.cs @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + + /// Disk represents the properties of the disk. + public partial class MachineDisk : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineDisk, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineDiskInternal + { + + /// Backing field for property. + private long? _capacityGb; + + /// The maximum amount of storage. Measured in gibibytes. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public long? CapacityGb { get => this._capacityGb; } + + /// Backing field for property. + private string _connection; + + /// The connection type of the rack SKU resource. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string Connection { get => this._connection; } + + /// Internal Acessors for CapacityGb + long? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineDiskInternal.CapacityGb { get => this._capacityGb; set { {_capacityGb = value;} } } + + /// Internal Acessors for Connection + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineDiskInternal.Connection { get => this._connection; set { {_connection = value;} } } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineDiskInternal.Type { get => this._type; set { {_type = value;} } } + + /// Backing field for property. + private string _type; + + /// The disk type of rack SKU resource. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string Type { get => this._type; } + + /// Creates an new instance. + public MachineDisk() + { + + } + } + /// Disk represents the properties of the disk. + public partial interface IMachineDisk : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable + { + /// The maximum amount of storage. Measured in gibibytes. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The maximum amount of storage. Measured in gibibytes.", + SerializedName = @"capacityGB", + PossibleTypes = new [] { typeof(long) })] + long? CapacityGb { get; } + /// The connection type of the rack SKU resource. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The connection type of the rack SKU resource.", + SerializedName = @"connection", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("PCIE", "SATA", "RAID", "SAS")] + string Connection { get; } + /// The disk type of rack SKU resource. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The disk type of rack SKU resource.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("HDD", "SSD")] + string Type { get; } + + } + /// Disk represents the properties of the disk. + internal partial interface IMachineDiskInternal + + { + /// The maximum amount of storage. Measured in gibibytes. + long? CapacityGb { get; set; } + /// The connection type of the rack SKU resource. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("PCIE", "SATA", "RAID", "SAS")] + string Connection { get; set; } + /// The disk type of rack SKU resource. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("HDD", "SSD")] + string Type { get; set; } + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/MachineDisk.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/MachineDisk.json.cs similarity index 92% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/MachineDisk.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/MachineDisk.json.cs index 175c72fdee45..3be1866f379d 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/MachineDisk.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/MachineDisk.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class MachineDisk partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineDisk. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineDisk. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineDisk. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineDisk. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineDisk FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineDisk FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new MachineDisk(json) : null; } @@ -77,9 +77,9 @@ internal MachineDisk(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Jso { return; } - {_capacityGb = If( json?.PropertyT("capacityGB"), out var __jsonCapacityGb) ? (long?)__jsonCapacityGb : CapacityGb;} - {_connection = If( json?.PropertyT("connection"), out var __jsonConnection) ? (string)__jsonConnection : (string)Connection;} - {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)Type;} + {_capacityGb = If( json?.PropertyT("capacityGB"), out var __jsonCapacityGb) ? (long?)__jsonCapacityGb : _capacityGb;} + {_connection = If( json?.PropertyT("connection"), out var __jsonConnection) ? (string)__jsonConnection : (string)_connection;} + {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)_type;} AfterFromJson(json); } @@ -102,15 +102,15 @@ public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode ToJ { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != this._capacityGb ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNumber((long)this._capacityGb) : null, "capacityGB" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._connection)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._connection.ToString()) : null, "connection" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._type.ToString()) : null, "type" ,container.Add ); } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/MachineSkuProperties.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/MachineSkuProperties.PowerShell.cs new file mode 100644 index 000000000000..147f7a0ddd8a --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/MachineSkuProperties.PowerShell.cs @@ -0,0 +1,244 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + + /// MachineSkuProperties represents the properties of the machine SKU. + [System.ComponentModel.TypeConverter(typeof(MachineSkuPropertiesTypeConverter))] + public partial class MachineSkuProperties + { + + /// + /// 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.NetworkCloud.Models.IMachineSkuProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MachineSkuProperties(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.NetworkCloud.Models.IMachineSkuProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MachineSkuProperties(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.NetworkCloud.Models.IMachineSkuProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MachineSkuProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("BootstrapProtocol")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuPropertiesInternal)this).BootstrapProtocol = (string) content.GetValueForProperty("BootstrapProtocol",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuPropertiesInternal)this).BootstrapProtocol, global::System.Convert.ToString); + } + if (content.Contains("CpuCore")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuPropertiesInternal)this).CpuCore = (long?) content.GetValueForProperty("CpuCore",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuPropertiesInternal)this).CpuCore, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("CpuSocket")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuPropertiesInternal)this).CpuSocket = (long?) content.GetValueForProperty("CpuSocket",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuPropertiesInternal)this).CpuSocket, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("Disk")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuPropertiesInternal)this).Disk = (System.Collections.Generic.List) content.GetValueForProperty("Disk",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuPropertiesInternal)this).Disk, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.MachineDiskTypeConverter.ConvertFrom)); + } + if (content.Contains("Generation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuPropertiesInternal)this).Generation = (string) content.GetValueForProperty("Generation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuPropertiesInternal)this).Generation, global::System.Convert.ToString); + } + if (content.Contains("HardwareVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuPropertiesInternal)this).HardwareVersion = (string) content.GetValueForProperty("HardwareVersion",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuPropertiesInternal)this).HardwareVersion, global::System.Convert.ToString); + } + if (content.Contains("MemoryCapacityGb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuPropertiesInternal)this).MemoryCapacityGb = (long?) content.GetValueForProperty("MemoryCapacityGb",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuPropertiesInternal)this).MemoryCapacityGb, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("Model")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuPropertiesInternal)this).Model = (string) content.GetValueForProperty("Model",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuPropertiesInternal)this).Model, global::System.Convert.ToString); + } + if (content.Contains("NetworkInterface")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuPropertiesInternal)this).NetworkInterface = (System.Collections.Generic.List) content.GetValueForProperty("NetworkInterface",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuPropertiesInternal)this).NetworkInterface, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.NetworkInterfaceTypeConverter.ConvertFrom)); + } + if (content.Contains("TotalThread")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuPropertiesInternal)this).TotalThread = (long?) content.GetValueForProperty("TotalThread",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuPropertiesInternal)this).TotalThread, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("Vendor")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuPropertiesInternal)this).Vendor = (string) content.GetValueForProperty("Vendor",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuPropertiesInternal)this).Vendor, 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 MachineSkuProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("BootstrapProtocol")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuPropertiesInternal)this).BootstrapProtocol = (string) content.GetValueForProperty("BootstrapProtocol",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuPropertiesInternal)this).BootstrapProtocol, global::System.Convert.ToString); + } + if (content.Contains("CpuCore")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuPropertiesInternal)this).CpuCore = (long?) content.GetValueForProperty("CpuCore",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuPropertiesInternal)this).CpuCore, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("CpuSocket")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuPropertiesInternal)this).CpuSocket = (long?) content.GetValueForProperty("CpuSocket",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuPropertiesInternal)this).CpuSocket, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("Disk")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuPropertiesInternal)this).Disk = (System.Collections.Generic.List) content.GetValueForProperty("Disk",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuPropertiesInternal)this).Disk, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.MachineDiskTypeConverter.ConvertFrom)); + } + if (content.Contains("Generation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuPropertiesInternal)this).Generation = (string) content.GetValueForProperty("Generation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuPropertiesInternal)this).Generation, global::System.Convert.ToString); + } + if (content.Contains("HardwareVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuPropertiesInternal)this).HardwareVersion = (string) content.GetValueForProperty("HardwareVersion",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuPropertiesInternal)this).HardwareVersion, global::System.Convert.ToString); + } + if (content.Contains("MemoryCapacityGb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuPropertiesInternal)this).MemoryCapacityGb = (long?) content.GetValueForProperty("MemoryCapacityGb",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuPropertiesInternal)this).MemoryCapacityGb, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("Model")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuPropertiesInternal)this).Model = (string) content.GetValueForProperty("Model",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuPropertiesInternal)this).Model, global::System.Convert.ToString); + } + if (content.Contains("NetworkInterface")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuPropertiesInternal)this).NetworkInterface = (System.Collections.Generic.List) content.GetValueForProperty("NetworkInterface",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuPropertiesInternal)this).NetworkInterface, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.NetworkInterfaceTypeConverter.ConvertFrom)); + } + if (content.Contains("TotalThread")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuPropertiesInternal)this).TotalThread = (long?) content.GetValueForProperty("TotalThread",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuPropertiesInternal)this).TotalThread, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("Vendor")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuPropertiesInternal)this).Vendor = (string) content.GetValueForProperty("Vendor",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuPropertiesInternal)this).Vendor, 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.NetworkCloud.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(); + } + } + /// MachineSkuProperties represents the properties of the machine SKU. + [System.ComponentModel.TypeConverter(typeof(MachineSkuPropertiesTypeConverter))] + public partial interface IMachineSkuProperties + + { + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/MachineSkuProperties.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/MachineSkuProperties.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/MachineSkuProperties.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/MachineSkuProperties.TypeConverter.cs index afcb6eeebda4..a2683e77492b 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/MachineSkuProperties.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/MachineSkuProperties.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IMachineSkuProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/MachineSkuProperties.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/MachineSkuProperties.cs new file mode 100644 index 000000000000..182101a343a0 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/MachineSkuProperties.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.NetworkCloud.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + + /// MachineSkuProperties represents the properties of the machine SKU. + public partial class MachineSkuProperties : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuProperties, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuPropertiesInternal + { + + /// Backing field for property. + private string _bootstrapProtocol; + + /// The type of bootstrap protocol used. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string BootstrapProtocol { get => this._bootstrapProtocol; } + + /// Backing field for property. + private long? _cpuCore; + + /// The count of CPU cores for this machine. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public long? CpuCore { get => this._cpuCore; } + + /// Backing field for property. + private long? _cpuSocket; + + /// The count of CPU sockets for this machine. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public long? CpuSocket { get => this._cpuSocket; } + + /// Backing field for property. + private System.Collections.Generic.List _disk; + + /// The list of disks. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public System.Collections.Generic.List Disk { get => this._disk; } + + /// Backing field for property. + private string _generation; + + /// The generation of the architecture. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string Generation { get => this._generation; } + + /// Backing field for property. + private string _hardwareVersion; + + /// The hardware version of the machine. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string HardwareVersion { get => this._hardwareVersion; } + + /// Backing field for property. + private long? _memoryCapacityGb; + + /// The maximum amount of memory. Measured in gibibytes. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public long? MemoryCapacityGb { get => this._memoryCapacityGb; } + + /// Internal Acessors for BootstrapProtocol + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuPropertiesInternal.BootstrapProtocol { get => this._bootstrapProtocol; set { {_bootstrapProtocol = value;} } } + + /// Internal Acessors for CpuCore + long? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuPropertiesInternal.CpuCore { get => this._cpuCore; set { {_cpuCore = value;} } } + + /// Internal Acessors for CpuSocket + long? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuPropertiesInternal.CpuSocket { get => this._cpuSocket; set { {_cpuSocket = value;} } } + + /// Internal Acessors for Disk + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuPropertiesInternal.Disk { get => this._disk; set { {_disk = value;} } } + + /// Internal Acessors for Generation + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuPropertiesInternal.Generation { get => this._generation; set { {_generation = value;} } } + + /// Internal Acessors for HardwareVersion + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuPropertiesInternal.HardwareVersion { get => this._hardwareVersion; set { {_hardwareVersion = value;} } } + + /// Internal Acessors for MemoryCapacityGb + long? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuPropertiesInternal.MemoryCapacityGb { get => this._memoryCapacityGb; set { {_memoryCapacityGb = value;} } } + + /// Internal Acessors for Model + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuPropertiesInternal.Model { get => this._model; set { {_model = value;} } } + + /// Internal Acessors for NetworkInterface + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuPropertiesInternal.NetworkInterface { get => this._networkInterface; set { {_networkInterface = value;} } } + + /// Internal Acessors for TotalThread + long? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuPropertiesInternal.TotalThread { get => this._totalThread; set { {_totalThread = value;} } } + + /// Internal Acessors for Vendor + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuPropertiesInternal.Vendor { get => this._vendor; set { {_vendor = value;} } } + + /// Backing field for property. + private string _model; + + /// The model of the machine. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string Model { get => this._model; } + + /// Backing field for property. + private System.Collections.Generic.List _networkInterface; + + /// The list of network interfaces. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public System.Collections.Generic.List NetworkInterface { get => this._networkInterface; } + + /// Backing field for property. + private long? _totalThread; + + /// The count of SMT and physical core threads for this machine. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public long? TotalThread { get => this._totalThread; } + + /// Backing field for property. + private string _vendor; + + /// The make of the machine. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string Vendor { get => this._vendor; } + + /// Creates an new instance. + public MachineSkuProperties() + { + + } + } + /// MachineSkuProperties represents the properties of the machine SKU. + public partial interface IMachineSkuProperties : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable + { + /// The type of bootstrap protocol used. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The type of bootstrap protocol used.", + SerializedName = @"bootstrapProtocol", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("PXE")] + string BootstrapProtocol { get; } + /// The count of CPU cores for this machine. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The count of CPU cores for this machine.", + SerializedName = @"cpuCores", + PossibleTypes = new [] { typeof(long) })] + long? CpuCore { get; } + /// The count of CPU sockets for this machine. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The count of CPU sockets for this machine.", + SerializedName = @"cpuSockets", + PossibleTypes = new [] { typeof(long) })] + long? CpuSocket { get; } + /// The list of disks. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The list of disks.", + SerializedName = @"disks", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineDisk) })] + System.Collections.Generic.List Disk { get; } + /// The generation of the architecture. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The generation of the architecture.", + SerializedName = @"generation", + PossibleTypes = new [] { typeof(string) })] + string Generation { get; } + /// The hardware version of the machine. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The hardware version of the machine.", + SerializedName = @"hardwareVersion", + PossibleTypes = new [] { typeof(string) })] + string HardwareVersion { get; } + /// The maximum amount of memory. Measured in gibibytes. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The maximum amount of memory. Measured in gibibytes.", + SerializedName = @"memoryCapacityGB", + PossibleTypes = new [] { typeof(long) })] + long? MemoryCapacityGb { get; } + /// The model of the machine. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The model of the machine.", + SerializedName = @"model", + PossibleTypes = new [] { typeof(string) })] + string Model { get; } + /// The list of network interfaces. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The list of network interfaces.", + SerializedName = @"networkInterfaces", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkInterface) })] + System.Collections.Generic.List NetworkInterface { get; } + /// The count of SMT and physical core threads for this machine. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The count of SMT and physical core threads for this machine.", + SerializedName = @"totalThreads", + PossibleTypes = new [] { typeof(long) })] + long? TotalThread { get; } + /// The make of the machine. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The make of the machine.", + SerializedName = @"vendor", + PossibleTypes = new [] { typeof(string) })] + string Vendor { get; } + + } + /// MachineSkuProperties represents the properties of the machine SKU. + internal partial interface IMachineSkuPropertiesInternal + + { + /// The type of bootstrap protocol used. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("PXE")] + string BootstrapProtocol { get; set; } + /// The count of CPU cores for this machine. + long? CpuCore { get; set; } + /// The count of CPU sockets for this machine. + long? CpuSocket { get; set; } + /// The list of disks. + System.Collections.Generic.List Disk { get; set; } + /// The generation of the architecture. + string Generation { get; set; } + /// The hardware version of the machine. + string HardwareVersion { get; set; } + /// The maximum amount of memory. Measured in gibibytes. + long? MemoryCapacityGb { get; set; } + /// The model of the machine. + string Model { get; set; } + /// The list of network interfaces. + System.Collections.Generic.List NetworkInterface { get; set; } + /// The count of SMT and physical core threads for this machine. + long? TotalThread { get; set; } + /// The make of the machine. + string Vendor { get; set; } + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/MachineSkuProperties.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/MachineSkuProperties.json.cs similarity index 84% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/MachineSkuProperties.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/MachineSkuProperties.json.cs index 2e7d562b14ce..340fdafd812a 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/MachineSkuProperties.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/MachineSkuProperties.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class MachineSkuProperties partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new MachineSkuProperties(json) : null; } @@ -77,17 +77,17 @@ internal MachineSkuProperties(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Ru { return; } - {_bootstrapProtocol = If( json?.PropertyT("bootstrapProtocol"), out var __jsonBootstrapProtocol) ? (string)__jsonBootstrapProtocol : (string)BootstrapProtocol;} - {_cpuCore = If( json?.PropertyT("cpuCores"), out var __jsonCpuCores) ? (long?)__jsonCpuCores : CpuCore;} - {_cpuSocket = If( json?.PropertyT("cpuSockets"), out var __jsonCpuSockets) ? (long?)__jsonCpuSockets : CpuSocket;} - {_disk = If( json?.PropertyT("disks"), out var __jsonDisks) ? If( __jsonDisks as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IMachineDisk) (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.MachineDisk.FromJson(__u) )) ))() : null : Disk;} - {_generation = If( json?.PropertyT("generation"), out var __jsonGeneration) ? (string)__jsonGeneration : (string)Generation;} - {_hardwareVersion = If( json?.PropertyT("hardwareVersion"), out var __jsonHardwareVersion) ? (string)__jsonHardwareVersion : (string)HardwareVersion;} - {_memoryCapacityGb = If( json?.PropertyT("memoryCapacityGB"), out var __jsonMemoryCapacityGb) ? (long?)__jsonMemoryCapacityGb : MemoryCapacityGb;} - {_model = If( json?.PropertyT("model"), out var __jsonModel) ? (string)__jsonModel : (string)Model;} - {_networkInterface = If( json?.PropertyT("networkInterfaces"), out var __jsonNetworkInterfaces) ? If( __jsonNetworkInterfaces as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.INetworkInterface) (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.NetworkInterface.FromJson(__p) )) ))() : null : NetworkInterface;} - {_totalThread = If( json?.PropertyT("totalThreads"), out var __jsonTotalThreads) ? (long?)__jsonTotalThreads : TotalThread;} - {_vendor = If( json?.PropertyT("vendor"), out var __jsonVendor) ? (string)__jsonVendor : (string)Vendor;} + {_bootstrapProtocol = If( json?.PropertyT("bootstrapProtocol"), out var __jsonBootstrapProtocol) ? (string)__jsonBootstrapProtocol : (string)_bootstrapProtocol;} + {_cpuCore = If( json?.PropertyT("cpuCores"), out var __jsonCpuCores) ? (long?)__jsonCpuCores : _cpuCore;} + {_cpuSocket = If( json?.PropertyT("cpuSockets"), out var __jsonCpuSockets) ? (long?)__jsonCpuSockets : _cpuSocket;} + {_disk = If( json?.PropertyT("disks"), out var __jsonDisks) ? If( __jsonDisks as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.IMachineDisk) (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.MachineDisk.FromJson(__u) )) ))() : null : _disk;} + {_generation = If( json?.PropertyT("generation"), out var __jsonGeneration) ? (string)__jsonGeneration : (string)_generation;} + {_hardwareVersion = If( json?.PropertyT("hardwareVersion"), out var __jsonHardwareVersion) ? (string)__jsonHardwareVersion : (string)_hardwareVersion;} + {_memoryCapacityGb = If( json?.PropertyT("memoryCapacityGB"), out var __jsonMemoryCapacityGb) ? (long?)__jsonMemoryCapacityGb : _memoryCapacityGb;} + {_model = If( json?.PropertyT("model"), out var __jsonModel) ? (string)__jsonModel : (string)_model;} + {_networkInterface = If( json?.PropertyT("networkInterfaces"), out var __jsonNetworkInterfaces) ? If( __jsonNetworkInterfaces as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.INetworkInterface) (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.NetworkInterface.FromJson(__p) )) ))() : null : _networkInterface;} + {_totalThread = If( json?.PropertyT("totalThreads"), out var __jsonTotalThreads) ? (long?)__jsonTotalThreads : _totalThread;} + {_vendor = If( json?.PropertyT("vendor"), out var __jsonVendor) ? (string)__jsonVendor : (string)_vendor;} AfterFromJson(json); } @@ -110,19 +110,19 @@ public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode ToJ { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._bootstrapProtocol)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._bootstrapProtocol.ToString()) : null, "bootstrapProtocol" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != this._cpuCore ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNumber((long)this._cpuCore) : null, "cpuCores" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != this._cpuSocket ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNumber((long)this._cpuSocket) : null, "cpuSockets" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { if (null != this._disk) { @@ -134,23 +134,23 @@ public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode ToJ container.Add("disks",__w); } } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._generation)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._generation.ToString()) : null, "generation" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._hardwareVersion)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._hardwareVersion.ToString()) : null, "hardwareVersion" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != this._memoryCapacityGb ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNumber((long)this._memoryCapacityGb) : null, "memoryCapacityGB" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._model)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._model.ToString()) : null, "model" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { if (null != this._networkInterface) { @@ -162,11 +162,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode ToJ container.Add("networkInterfaces",__r); } } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != this._totalThread ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNumber((long)this._totalThread) : null, "totalThreads" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._vendor)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._vendor.ToString()) : null, "vendor" ,container.Add ); } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/MachineSkuSlot.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/MachineSkuSlot.PowerShell.cs new file mode 100644 index 000000000000..b72a296ed23a --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/MachineSkuSlot.PowerShell.cs @@ -0,0 +1,262 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + + /// + /// MachineSkuSlot represents a single SKU and rack slot associated with the machine. + /// + [System.ComponentModel.TypeConverter(typeof(MachineSkuSlotTypeConverter))] + public partial class MachineSkuSlot + { + + /// + /// 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.NetworkCloud.Models.IMachineSkuSlot DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MachineSkuSlot(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.NetworkCloud.Models.IMachineSkuSlot DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MachineSkuSlot(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.NetworkCloud.Models.IMachineSkuSlot FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MachineSkuSlot(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.NetworkCloud.Models.IMachineSkuSlotInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuSlotInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.MachineSkuPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("RackSlot")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuSlotInternal)this).RackSlot = (long?) content.GetValueForProperty("RackSlot",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuSlotInternal)this).RackSlot, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("BootstrapProtocol")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuSlotInternal)this).BootstrapProtocol = (string) content.GetValueForProperty("BootstrapProtocol",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuSlotInternal)this).BootstrapProtocol, global::System.Convert.ToString); + } + if (content.Contains("CpuCore")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuSlotInternal)this).CpuCore = (long?) content.GetValueForProperty("CpuCore",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuSlotInternal)this).CpuCore, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("CpuSocket")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuSlotInternal)this).CpuSocket = (long?) content.GetValueForProperty("CpuSocket",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuSlotInternal)this).CpuSocket, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("Disk")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuSlotInternal)this).Disk = (System.Collections.Generic.List) content.GetValueForProperty("Disk",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuSlotInternal)this).Disk, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.MachineDiskTypeConverter.ConvertFrom)); + } + if (content.Contains("Generation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuSlotInternal)this).Generation = (string) content.GetValueForProperty("Generation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuSlotInternal)this).Generation, global::System.Convert.ToString); + } + if (content.Contains("HardwareVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuSlotInternal)this).HardwareVersion = (string) content.GetValueForProperty("HardwareVersion",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuSlotInternal)this).HardwareVersion, global::System.Convert.ToString); + } + if (content.Contains("MemoryCapacityGb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuSlotInternal)this).MemoryCapacityGb = (long?) content.GetValueForProperty("MemoryCapacityGb",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuSlotInternal)this).MemoryCapacityGb, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("Model")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuSlotInternal)this).Model = (string) content.GetValueForProperty("Model",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuSlotInternal)this).Model, global::System.Convert.ToString); + } + if (content.Contains("NetworkInterface")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuSlotInternal)this).NetworkInterface = (System.Collections.Generic.List) content.GetValueForProperty("NetworkInterface",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuSlotInternal)this).NetworkInterface, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.NetworkInterfaceTypeConverter.ConvertFrom)); + } + if (content.Contains("TotalThread")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuSlotInternal)this).TotalThread = (long?) content.GetValueForProperty("TotalThread",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuSlotInternal)this).TotalThread, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("Vendor")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuSlotInternal)this).Vendor = (string) content.GetValueForProperty("Vendor",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuSlotInternal)this).Vendor, 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 MachineSkuSlot(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.NetworkCloud.Models.IMachineSkuSlotInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuSlotInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.MachineSkuPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("RackSlot")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuSlotInternal)this).RackSlot = (long?) content.GetValueForProperty("RackSlot",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuSlotInternal)this).RackSlot, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("BootstrapProtocol")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuSlotInternal)this).BootstrapProtocol = (string) content.GetValueForProperty("BootstrapProtocol",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuSlotInternal)this).BootstrapProtocol, global::System.Convert.ToString); + } + if (content.Contains("CpuCore")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuSlotInternal)this).CpuCore = (long?) content.GetValueForProperty("CpuCore",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuSlotInternal)this).CpuCore, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("CpuSocket")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuSlotInternal)this).CpuSocket = (long?) content.GetValueForProperty("CpuSocket",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuSlotInternal)this).CpuSocket, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("Disk")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuSlotInternal)this).Disk = (System.Collections.Generic.List) content.GetValueForProperty("Disk",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuSlotInternal)this).Disk, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.MachineDiskTypeConverter.ConvertFrom)); + } + if (content.Contains("Generation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuSlotInternal)this).Generation = (string) content.GetValueForProperty("Generation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuSlotInternal)this).Generation, global::System.Convert.ToString); + } + if (content.Contains("HardwareVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuSlotInternal)this).HardwareVersion = (string) content.GetValueForProperty("HardwareVersion",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuSlotInternal)this).HardwareVersion, global::System.Convert.ToString); + } + if (content.Contains("MemoryCapacityGb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuSlotInternal)this).MemoryCapacityGb = (long?) content.GetValueForProperty("MemoryCapacityGb",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuSlotInternal)this).MemoryCapacityGb, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("Model")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuSlotInternal)this).Model = (string) content.GetValueForProperty("Model",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuSlotInternal)this).Model, global::System.Convert.ToString); + } + if (content.Contains("NetworkInterface")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuSlotInternal)this).NetworkInterface = (System.Collections.Generic.List) content.GetValueForProperty("NetworkInterface",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuSlotInternal)this).NetworkInterface, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.NetworkInterfaceTypeConverter.ConvertFrom)); + } + if (content.Contains("TotalThread")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuSlotInternal)this).TotalThread = (long?) content.GetValueForProperty("TotalThread",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuSlotInternal)this).TotalThread, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("Vendor")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuSlotInternal)this).Vendor = (string) content.GetValueForProperty("Vendor",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuSlotInternal)this).Vendor, 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.NetworkCloud.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(); + } + } + /// MachineSkuSlot represents a single SKU and rack slot associated with the machine. + [System.ComponentModel.TypeConverter(typeof(MachineSkuSlotTypeConverter))] + public partial interface IMachineSkuSlot + + { + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/MachineSkuSlot.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/MachineSkuSlot.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/MachineSkuSlot.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/MachineSkuSlot.TypeConverter.cs index 51023f794fbe..cf89fb1e0d4c 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/MachineSkuSlot.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/MachineSkuSlot.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IMachineSkuSlot ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuSlot ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuSlot).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuSlot).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/MachineSkuSlot.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/MachineSkuSlot.cs new file mode 100644 index 000000000000..02f8df812f2e --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/MachineSkuSlot.cs @@ -0,0 +1,293 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + + /// + /// MachineSkuSlot represents a single SKU and rack slot associated with the machine. + /// + public partial class MachineSkuSlot : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuSlot, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuSlotInternal + { + + /// The type of bootstrap protocol used. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string BootstrapProtocol { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuPropertiesInternal)Property).BootstrapProtocol; } + + /// The count of CPU cores for this machine. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public long? CpuCore { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuPropertiesInternal)Property).CpuCore; } + + /// The count of CPU sockets for this machine. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public long? CpuSocket { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuPropertiesInternal)Property).CpuSocket; } + + /// The list of disks. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public System.Collections.Generic.List Disk { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuPropertiesInternal)Property).Disk; } + + /// The generation of the architecture. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string Generation { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuPropertiesInternal)Property).Generation; } + + /// The hardware version of the machine. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string HardwareVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuPropertiesInternal)Property).HardwareVersion; } + + /// The maximum amount of memory. Measured in gibibytes. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public long? MemoryCapacityGb { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuPropertiesInternal)Property).MemoryCapacityGb; } + + /// Internal Acessors for BootstrapProtocol + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuSlotInternal.BootstrapProtocol { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuPropertiesInternal)Property).BootstrapProtocol; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuPropertiesInternal)Property).BootstrapProtocol = value ?? null; } + + /// Internal Acessors for CpuCore + long? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuSlotInternal.CpuCore { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuPropertiesInternal)Property).CpuCore; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuPropertiesInternal)Property).CpuCore = value ?? default(long); } + + /// Internal Acessors for CpuSocket + long? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuSlotInternal.CpuSocket { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuPropertiesInternal)Property).CpuSocket; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuPropertiesInternal)Property).CpuSocket = value ?? default(long); } + + /// Internal Acessors for Disk + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuSlotInternal.Disk { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuPropertiesInternal)Property).Disk; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuPropertiesInternal)Property).Disk = value ?? null /* arrayOf */; } + + /// Internal Acessors for Generation + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuSlotInternal.Generation { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuPropertiesInternal)Property).Generation; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuPropertiesInternal)Property).Generation = value ?? null; } + + /// Internal Acessors for HardwareVersion + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuSlotInternal.HardwareVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuPropertiesInternal)Property).HardwareVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuPropertiesInternal)Property).HardwareVersion = value ?? null; } + + /// Internal Acessors for MemoryCapacityGb + long? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuSlotInternal.MemoryCapacityGb { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuPropertiesInternal)Property).MemoryCapacityGb; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuPropertiesInternal)Property).MemoryCapacityGb = value ?? default(long); } + + /// Internal Acessors for Model + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuSlotInternal.Model { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuPropertiesInternal)Property).Model; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuPropertiesInternal)Property).Model = value ?? null; } + + /// Internal Acessors for NetworkInterface + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuSlotInternal.NetworkInterface { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuPropertiesInternal)Property).NetworkInterface; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuPropertiesInternal)Property).NetworkInterface = value ?? null /* arrayOf */; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuProperties Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuSlotInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.MachineSkuProperties()); set { {_property = value;} } } + + /// Internal Acessors for RackSlot + long? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuSlotInternal.RackSlot { get => this._rackSlot; set { {_rackSlot = value;} } } + + /// Internal Acessors for TotalThread + long? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuSlotInternal.TotalThread { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuPropertiesInternal)Property).TotalThread; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuPropertiesInternal)Property).TotalThread = value ?? default(long); } + + /// Internal Acessors for Vendor + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuSlotInternal.Vendor { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuPropertiesInternal)Property).Vendor; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuPropertiesInternal)Property).Vendor = value ?? null; } + + /// The model of the machine. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string Model { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuPropertiesInternal)Property).Model; } + + /// The list of network interfaces. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public System.Collections.Generic.List NetworkInterface { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuPropertiesInternal)Property).NetworkInterface; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuProperties _property; + + /// The list of the resource properties. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.MachineSkuProperties()); set => this._property = value; } + + /// Backing field for property. + private long? _rackSlot; + + /// The position in the rack for the machine. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public long? RackSlot { get => this._rackSlot; } + + /// The count of SMT and physical core threads for this machine. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public long? TotalThread { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuPropertiesInternal)Property).TotalThread; } + + /// The make of the machine. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string Vendor { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuPropertiesInternal)Property).Vendor; } + + /// Creates an new instance. + public MachineSkuSlot() + { + + } + } + /// MachineSkuSlot represents a single SKU and rack slot associated with the machine. + public partial interface IMachineSkuSlot : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable + { + /// The type of bootstrap protocol used. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The type of bootstrap protocol used.", + SerializedName = @"bootstrapProtocol", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("PXE")] + string BootstrapProtocol { get; } + /// The count of CPU cores for this machine. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The count of CPU cores for this machine.", + SerializedName = @"cpuCores", + PossibleTypes = new [] { typeof(long) })] + long? CpuCore { get; } + /// The count of CPU sockets for this machine. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The count of CPU sockets for this machine.", + SerializedName = @"cpuSockets", + PossibleTypes = new [] { typeof(long) })] + long? CpuSocket { get; } + /// The list of disks. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The list of disks.", + SerializedName = @"disks", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineDisk) })] + System.Collections.Generic.List Disk { get; } + /// The generation of the architecture. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The generation of the architecture.", + SerializedName = @"generation", + PossibleTypes = new [] { typeof(string) })] + string Generation { get; } + /// The hardware version of the machine. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The hardware version of the machine.", + SerializedName = @"hardwareVersion", + PossibleTypes = new [] { typeof(string) })] + string HardwareVersion { get; } + /// The maximum amount of memory. Measured in gibibytes. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The maximum amount of memory. Measured in gibibytes.", + SerializedName = @"memoryCapacityGB", + PossibleTypes = new [] { typeof(long) })] + long? MemoryCapacityGb { get; } + /// The model of the machine. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The model of the machine.", + SerializedName = @"model", + PossibleTypes = new [] { typeof(string) })] + string Model { get; } + /// The list of network interfaces. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The list of network interfaces.", + SerializedName = @"networkInterfaces", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkInterface) })] + System.Collections.Generic.List NetworkInterface { get; } + /// The position in the rack for the machine. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The position in the rack for the machine.", + SerializedName = @"rackSlot", + PossibleTypes = new [] { typeof(long) })] + long? RackSlot { get; } + /// The count of SMT and physical core threads for this machine. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The count of SMT and physical core threads for this machine.", + SerializedName = @"totalThreads", + PossibleTypes = new [] { typeof(long) })] + long? TotalThread { get; } + /// The make of the machine. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The make of the machine.", + SerializedName = @"vendor", + PossibleTypes = new [] { typeof(string) })] + string Vendor { get; } + + } + /// MachineSkuSlot represents a single SKU and rack slot associated with the machine. + internal partial interface IMachineSkuSlotInternal + + { + /// The type of bootstrap protocol used. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("PXE")] + string BootstrapProtocol { get; set; } + /// The count of CPU cores for this machine. + long? CpuCore { get; set; } + /// The count of CPU sockets for this machine. + long? CpuSocket { get; set; } + /// The list of disks. + System.Collections.Generic.List Disk { get; set; } + /// The generation of the architecture. + string Generation { get; set; } + /// The hardware version of the machine. + string HardwareVersion { get; set; } + /// The maximum amount of memory. Measured in gibibytes. + long? MemoryCapacityGb { get; set; } + /// The model of the machine. + string Model { get; set; } + /// The list of network interfaces. + System.Collections.Generic.List NetworkInterface { get; set; } + /// The list of the resource properties. + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuProperties Property { get; set; } + /// The position in the rack for the machine. + long? RackSlot { get; set; } + /// The count of SMT and physical core threads for this machine. + long? TotalThread { get; set; } + /// The make of the machine. + string Vendor { get; set; } + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/MachineSkuSlot.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/MachineSkuSlot.json.cs similarity index 93% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/MachineSkuSlot.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/MachineSkuSlot.json.cs index 66c1d9eec025..9889c0a50282 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/MachineSkuSlot.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/MachineSkuSlot.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -56,13 +56,13 @@ public partial class MachineSkuSlot partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuSlot. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuSlot. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuSlot. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuSlot. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IMachineSkuSlot FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuSlot FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new MachineSkuSlot(json) : null; } @@ -79,8 +79,8 @@ internal MachineSkuSlot(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime. { return; } - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.MachineSkuProperties.FromJson(__jsonProperties) : Property;} - {_rackSlot = If( json?.PropertyT("rackSlot"), out var __jsonRackSlot) ? (long?)__jsonRackSlot : RackSlot;} + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.MachineSkuProperties.FromJson(__jsonProperties) : _property;} + {_rackSlot = If( json?.PropertyT("rackSlot"), out var __jsonRackSlot) ? (long?)__jsonRackSlot : _rackSlot;} AfterFromJson(json); } @@ -104,7 +104,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode ToJ return container; } AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != this._rackSlot ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNumber((long)this._rackSlot) : null, "rackSlot" ,container.Add ); } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ManagedResourceGroupConfiguration.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ManagedResourceGroupConfiguration.PowerShell.cs similarity index 79% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ManagedResourceGroupConfiguration.PowerShell.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ManagedResourceGroupConfiguration.PowerShell.cs index 7e6fe4e6be70..2bf680566eef 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ManagedResourceGroupConfiguration.PowerShell.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ManagedResourceGroupConfiguration.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; @@ -65,29 +65,27 @@ public partial class ManagedResourceGroupConfiguration 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.NetworkCloud.Models.Api20250201.IManagedResourceGroupConfiguration DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IManagedResourceGroupConfiguration DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ManagedResourceGroupConfiguration(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.NetworkCloud.Models.Api20250201.IManagedResourceGroupConfiguration DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IManagedResourceGroupConfiguration DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ManagedResourceGroupConfiguration(content); } @@ -99,10 +97,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201 /// /// an instance of the model class. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IManagedResourceGroupConfiguration FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IManagedResourceGroupConfiguration FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,17 +115,17 @@ internal ManagedResourceGroupConfiguration(global::System.Collections.IDictionar // actually deserialize if (content.Contains("Location")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IManagedResourceGroupConfigurationInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IManagedResourceGroupConfigurationInternal)this).Location, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IManagedResourceGroupConfigurationInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IManagedResourceGroupConfigurationInternal)this).Location, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IManagedResourceGroupConfigurationInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IManagedResourceGroupConfigurationInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IManagedResourceGroupConfigurationInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IManagedResourceGroupConfigurationInternal)this).Name, 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,11 +140,11 @@ internal ManagedResourceGroupConfiguration(global::System.Management.Automation. // actually deserialize if (content.Contains("Location")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IManagedResourceGroupConfigurationInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IManagedResourceGroupConfigurationInternal)this).Location, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IManagedResourceGroupConfigurationInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IManagedResourceGroupConfigurationInternal)this).Location, global::System.Convert.ToString); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IManagedResourceGroupConfigurationInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IManagedResourceGroupConfigurationInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IManagedResourceGroupConfigurationInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IManagedResourceGroupConfigurationInternal)this).Name, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ManagedResourceGroupConfiguration.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ManagedResourceGroupConfiguration.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ManagedResourceGroupConfiguration.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ManagedResourceGroupConfiguration.TypeConverter.cs index 553080fed443..6c17e41297eb 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ManagedResourceGroupConfiguration.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ManagedResourceGroupConfiguration.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IManagedResourceGroupConfiguration ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IManagedResourceGroupConfiguration ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IManagedResourceGroupConfiguration).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IManagedResourceGroupConfiguration).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ManagedResourceGroupConfiguration.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ManagedResourceGroupConfiguration.cs similarity index 91% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ManagedResourceGroupConfiguration.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ManagedResourceGroupConfiguration.cs index 957d0f3bce86..11337867bd13 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ManagedResourceGroupConfiguration.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ManagedResourceGroupConfiguration.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -11,8 +11,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201 /// ManagedResourceGroupConfiguration represents the configuration of the resource group managed by Azure. /// public partial class ManagedResourceGroupConfiguration : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IManagedResourceGroupConfiguration, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IManagedResourceGroupConfigurationInternal + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IManagedResourceGroupConfiguration, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IManagedResourceGroupConfigurationInternal { /// Backing field for property. @@ -49,6 +49,9 @@ public partial interface IManagedResourceGroupConfiguration : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = false, Description = @"The location of the managed resource group. If not specified, the location of the parent resource is chosen.", SerializedName = @"location", PossibleTypes = new [] { typeof(string) })] @@ -59,6 +62,9 @@ public partial interface IManagedResourceGroupConfiguration : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = false, Description = @"The name for the managed resource group. If not specified, the unique name is automatically generated.", SerializedName = @"name", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ManagedResourceGroupConfiguration.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ManagedResourceGroupConfiguration.json.cs similarity index 83% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ManagedResourceGroupConfiguration.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ManagedResourceGroupConfiguration.json.cs index 332bcc33b441..a80e1c9ca74e 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ManagedResourceGroupConfiguration.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ManagedResourceGroupConfiguration.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -56,13 +56,13 @@ public partial class ManagedResourceGroupConfiguration partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IManagedResourceGroupConfiguration. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IManagedResourceGroupConfiguration. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IManagedResourceGroupConfiguration. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IManagedResourceGroupConfiguration. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IManagedResourceGroupConfiguration FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IManagedResourceGroupConfiguration FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new ManagedResourceGroupConfiguration(json) : null; } @@ -79,8 +79,8 @@ internal ManagedResourceGroupConfiguration(Microsoft.Azure.PowerShell.Cmdlets.Ne { return; } - {_location = If( json?.PropertyT("location"), out var __jsonLocation) ? (string)__jsonLocation : (string)Location;} - {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} + {_location = If( json?.PropertyT("location"), out var __jsonLocation) ? (string)__jsonLocation : (string)_location;} + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)_name;} AfterFromJson(json); } @@ -103,8 +103,14 @@ public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode ToJ { return container; } - AddIf( null != (((object)this._location)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._location.ToString()) : null, "location" ,container.Add ); - AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)||serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate)) + { + AddIf( null != (((object)this._location)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._location.ToString()) : null, "location" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)||serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate)) + { + AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); + } AfterToJson(ref container); return container; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ManagedServiceIdentity.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ManagedServiceIdentity.PowerShell.cs new file mode 100644 index 000000000000..daf563a985ca --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ManagedServiceIdentity.PowerShell.cs @@ -0,0 +1,188 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + + /// Managed service identity (system assigned and/or user assigned identities) + [System.ComponentModel.TypeConverter(typeof(ManagedServiceIdentityTypeConverter))] + public partial class ManagedServiceIdentity + { + + /// + /// 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.NetworkCloud.Models.IManagedServiceIdentity DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ManagedServiceIdentity(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.NetworkCloud.Models.IManagedServiceIdentity DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ManagedServiceIdentity(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.NetworkCloud.Models.IManagedServiceIdentity FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ManagedServiceIdentity(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("PrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IManagedServiceIdentityInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IManagedServiceIdentityInternal)this).PrincipalId, global::System.Convert.ToString); + } + if (content.Contains("TenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IManagedServiceIdentityInternal)this).TenantId = (string) content.GetValueForProperty("TenantId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IManagedServiceIdentityInternal)this).TenantId, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IManagedServiceIdentityInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IManagedServiceIdentityInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("UserAssignedIdentity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IManagedServiceIdentityInternal)this).UserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IUserAssignedIdentities) content.GetValueForProperty("UserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IManagedServiceIdentityInternal)this).UserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.UserAssignedIdentitiesTypeConverter.ConvertFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ManagedServiceIdentity(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("PrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IManagedServiceIdentityInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IManagedServiceIdentityInternal)this).PrincipalId, global::System.Convert.ToString); + } + if (content.Contains("TenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IManagedServiceIdentityInternal)this).TenantId = (string) content.GetValueForProperty("TenantId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IManagedServiceIdentityInternal)this).TenantId, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IManagedServiceIdentityInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IManagedServiceIdentityInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("UserAssignedIdentity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IManagedServiceIdentityInternal)this).UserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IUserAssignedIdentities) content.GetValueForProperty("UserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IManagedServiceIdentityInternal)this).UserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.UserAssignedIdentitiesTypeConverter.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.NetworkCloud.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(); + } + } + /// Managed service identity (system assigned and/or user assigned identities) + [System.ComponentModel.TypeConverter(typeof(ManagedServiceIdentityTypeConverter))] + public partial interface IManagedServiceIdentity + + { + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ManagedServiceIdentity.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ManagedServiceIdentity.TypeConverter.cs new file mode 100644 index 000000000000..2f6f81c1ef6a --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ManagedServiceIdentity.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ManagedServiceIdentityTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IManagedServiceIdentity ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IManagedServiceIdentity).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ManagedServiceIdentity.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ManagedServiceIdentity.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ManagedServiceIdentity.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ManagedServiceIdentity.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ManagedServiceIdentity.cs new file mode 100644 index 000000000000..20c1fe1a162b --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ManagedServiceIdentity.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + + /// Managed service identity (system assigned and/or user assigned identities) + public partial class ManagedServiceIdentity : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IManagedServiceIdentity, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IManagedServiceIdentityInternal + { + + /// Internal Acessors for PrincipalId + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IManagedServiceIdentityInternal.PrincipalId { get => this._principalId; set { {_principalId = value;} } } + + /// Internal Acessors for TenantId + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IManagedServiceIdentityInternal.TenantId { get => this._tenantId; set { {_tenantId = value;} } } + + /// Backing field for property. + private string _principalId; + + /// + /// The service principal ID of the system assigned identity. This property will only be provided for a system assigned identity. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string PrincipalId { get => this._principalId; } + + /// Backing field for property. + private string _tenantId; + + /// + /// The tenant ID of the system assigned identity. This property will only be provided for a system assigned identity. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string TenantId { get => this._tenantId; } + + /// Backing field for property. + private string _type; + + /// + /// Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string Type { get => this._type; set => this._type = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IUserAssignedIdentities _userAssignedIdentity; + + /// + /// 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.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IUserAssignedIdentities UserAssignedIdentity { get => (this._userAssignedIdentity = this._userAssignedIdentity ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.UserAssignedIdentities()); set => this._userAssignedIdentity = value; } + + /// Creates an new instance. + public ManagedServiceIdentity() + { + + } + } + /// Managed service identity (system assigned and/or user assigned identities) + public partial interface IManagedServiceIdentity : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable + { + /// + /// The service principal ID of the system assigned identity. This property will only be provided for a system assigned identity. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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) })] + string PrincipalId { get; } + /// + /// The tenant ID of the system assigned identity. This property will only be provided for a system assigned identity. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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) })] + string TenantId { get; } + /// + /// Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.IUserAssignedIdentities) })] + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IUserAssignedIdentities UserAssignedIdentity { get; set; } + + } + /// Managed service identity (system assigned and/or user assigned identities) + internal partial interface IManagedServiceIdentityInternal + + { + /// + /// The service principal ID of the system assigned identity. This property will only be provided for a system assigned identity. + /// + string PrincipalId { get; set; } + /// + /// The tenant ID of the system assigned identity. This property will only be provided for a system assigned identity. + /// + string TenantId { get; set; } + /// + /// Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.IUserAssignedIdentities UserAssignedIdentity { get; set; } + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ManagedServiceIdentity.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ManagedServiceIdentity.json.cs new file mode 100644 index 000000000000..e279daa6f070 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ManagedServiceIdentity.json.cs @@ -0,0 +1,120 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + + /// Managed service identity (system assigned and/or user assigned identities) + public partial class ManagedServiceIdentity + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IManagedServiceIdentity. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IManagedServiceIdentity. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IManagedServiceIdentity FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new ManagedServiceIdentity(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject instance to deserialize from. + internal ManagedServiceIdentity(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_principalId = If( json?.PropertyT("principalId"), out var __jsonPrincipalId) ? (string)__jsonPrincipalId : (string)_principalId;} + {_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.NetworkCloud.Models.UserAssignedIdentities.FromJson(__jsonUserAssignedIdentities) : _userAssignedIdentity;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) + { + AddIf( null != (((object)this._principalId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._principalId.ToString()) : null, "principalId" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) + { + AddIf( null != (((object)this._tenantId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._tenantId.ToString()) : null, "tenantId" ,container.Add ); + } + AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._type.ToString()) : null, "type" ,container.Add ); + AddIf( null != this._userAssignedIdentity ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) this._userAssignedIdentity.ToJson(null,serializationMode) : null, "userAssignedIdentities" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/NetworkAttachment.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/NetworkAttachment.PowerShell.cs new file mode 100644 index 000000000000..42d32028242f --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/NetworkAttachment.PowerShell.cs @@ -0,0 +1,212 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + + /// NetworkAttachment represents the single network attachment. + [System.ComponentModel.TypeConverter(typeof(NetworkAttachmentTypeConverter))] + public partial class NetworkAttachment + { + + /// + /// 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.NetworkCloud.Models.INetworkAttachment DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new NetworkAttachment(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.NetworkCloud.Models.INetworkAttachment DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new NetworkAttachment(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.NetworkCloud.Models.INetworkAttachment FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal NetworkAttachment(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("AttachedNetworkId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkAttachmentInternal)this).AttachedNetworkId = (string) content.GetValueForProperty("AttachedNetworkId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkAttachmentInternal)this).AttachedNetworkId, global::System.Convert.ToString); + } + if (content.Contains("DefaultGateway")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkAttachmentInternal)this).DefaultGateway = (string) content.GetValueForProperty("DefaultGateway",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkAttachmentInternal)this).DefaultGateway, global::System.Convert.ToString); + } + if (content.Contains("IPAllocationMethod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkAttachmentInternal)this).IPAllocationMethod = (string) content.GetValueForProperty("IPAllocationMethod",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkAttachmentInternal)this).IPAllocationMethod, global::System.Convert.ToString); + } + if (content.Contains("Ipv4Address")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkAttachmentInternal)this).Ipv4Address = (string) content.GetValueForProperty("Ipv4Address",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkAttachmentInternal)this).Ipv4Address, global::System.Convert.ToString); + } + if (content.Contains("Ipv6Address")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkAttachmentInternal)this).Ipv6Address = (string) content.GetValueForProperty("Ipv6Address",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkAttachmentInternal)this).Ipv6Address, global::System.Convert.ToString); + } + if (content.Contains("MacAddress")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkAttachmentInternal)this).MacAddress = (string) content.GetValueForProperty("MacAddress",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkAttachmentInternal)this).MacAddress, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkAttachmentInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkAttachmentInternal)this).Name, 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 NetworkAttachment(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("AttachedNetworkId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkAttachmentInternal)this).AttachedNetworkId = (string) content.GetValueForProperty("AttachedNetworkId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkAttachmentInternal)this).AttachedNetworkId, global::System.Convert.ToString); + } + if (content.Contains("DefaultGateway")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkAttachmentInternal)this).DefaultGateway = (string) content.GetValueForProperty("DefaultGateway",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkAttachmentInternal)this).DefaultGateway, global::System.Convert.ToString); + } + if (content.Contains("IPAllocationMethod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkAttachmentInternal)this).IPAllocationMethod = (string) content.GetValueForProperty("IPAllocationMethod",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkAttachmentInternal)this).IPAllocationMethod, global::System.Convert.ToString); + } + if (content.Contains("Ipv4Address")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkAttachmentInternal)this).Ipv4Address = (string) content.GetValueForProperty("Ipv4Address",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkAttachmentInternal)this).Ipv4Address, global::System.Convert.ToString); + } + if (content.Contains("Ipv6Address")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkAttachmentInternal)this).Ipv6Address = (string) content.GetValueForProperty("Ipv6Address",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkAttachmentInternal)this).Ipv6Address, global::System.Convert.ToString); + } + if (content.Contains("MacAddress")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkAttachmentInternal)this).MacAddress = (string) content.GetValueForProperty("MacAddress",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkAttachmentInternal)this).MacAddress, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkAttachmentInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkAttachmentInternal)this).Name, 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.NetworkCloud.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(); + } + } + /// NetworkAttachment represents the single network attachment. + [System.ComponentModel.TypeConverter(typeof(NetworkAttachmentTypeConverter))] + public partial interface INetworkAttachment + + { + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/NetworkAttachment.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/NetworkAttachment.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/NetworkAttachment.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/NetworkAttachment.TypeConverter.cs index 7d98a8853d58..134e4950147f 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/NetworkAttachment.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/NetworkAttachment.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.INetworkAttachment ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkAttachment ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkAttachment).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkAttachment).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/NetworkAttachment.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/NetworkAttachment.cs similarity index 89% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/NetworkAttachment.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/NetworkAttachment.cs index 58d1bd40800c..1f7dc4e9a8b5 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/NetworkAttachment.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/NetworkAttachment.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; /// NetworkAttachment represents the single network attachment. public partial class NetworkAttachment : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkAttachment, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkAttachmentInternal + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkAttachment, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkAttachmentInternal { /// Backing field for property. @@ -24,7 +24,7 @@ public partial class NetworkAttachment : public string AttachedNetworkId { get => this._attachedNetworkId; set => this._attachedNetworkId = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.DefaultGateway? _defaultGateway; + private string _defaultGateway; /// /// The indicator of whether this is the default gateway. @@ -32,10 +32,10 @@ public partial class NetworkAttachment : /// as True. /// [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.DefaultGateway? DefaultGateway { get => this._defaultGateway; set => this._defaultGateway = value; } + public string DefaultGateway { get => this._defaultGateway; set => this._defaultGateway = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineIPAllocationMethod _iPAllocationMethod; + private string _iPAllocationMethod; /// /// The IP allocation mechanism for the virtual machine. @@ -43,7 +43,7 @@ public partial class NetworkAttachment : /// Otherwise, Disabled is the only permitted value. /// [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineIPAllocationMethod IPAllocationMethod { get => this._iPAllocationMethod; set => this._iPAllocationMethod = value; } + public string IPAllocationMethod { get => this._iPAllocationMethod; set => this._iPAllocationMethod = value; } /// Backing field for property. private string _ipv4Address; @@ -85,7 +85,7 @@ public partial class NetworkAttachment : public string MacAddress { get => this._macAddress; } /// Internal Acessors for MacAddress - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkAttachmentInternal.MacAddress { get => this._macAddress; set { {_macAddress = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkAttachmentInternal.MacAddress { get => this._macAddress; set { {_macAddress = value;} } } /// Backing field for property. private string _name; @@ -116,6 +116,9 @@ public partial interface INetworkAttachment : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The resource ID of the associated network attached to the virtual machine. It can be one of cloudServicesNetwork, l3Network, l2Network or trunkedNetwork resources.", SerializedName = @"attachedNetworkId", @@ -129,11 +132,15 @@ public partial interface INetworkAttachment : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The indicator of whether this is the default gateway. Only one of the attached networks (including the CloudServicesNetwork attachment) for a single machine may be specified as True.", SerializedName = @"defaultGateway", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.DefaultGateway) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.DefaultGateway? DefaultGateway { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("True", "False")] + string DefaultGateway { get; set; } /// /// The IP allocation mechanism for the virtual machine. /// Dynamic and Static are only valid for l3Network which may also specify Disabled. @@ -142,12 +149,16 @@ public partial interface INetworkAttachment : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The IP allocation mechanism for the virtual machine. Dynamic and Static are only valid for l3Network which may also specify Disabled. Otherwise, Disabled is the only permitted value.", SerializedName = @"ipAllocationMethod", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineIPAllocationMethod) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineIPAllocationMethod IPAllocationMethod { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Dynamic", "Static", "Disabled")] + string IPAllocationMethod { get; set; } /// /// The IPv4 address of the virtual machine. /// This field is used only if the attached network has IPAllocationType of IPV4 or DualStack. @@ -160,6 +171,9 @@ public partial interface INetworkAttachment : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = false, Description = @"The IPv4 address of the virtual machine. This field is used only if the attached network has IPAllocationType of IPV4 or DualStack. @@ -183,6 +197,9 @@ public partial interface INetworkAttachment : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = false, Description = @"The IPv6 address of the virtual machine. This field is used only if the attached network has IPAllocationType of IPV6 or DualStack. @@ -200,6 +217,9 @@ public partial interface INetworkAttachment : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The MAC address of the interface for the virtual machine that corresponds to this network attachment.", SerializedName = @"macAddress", PossibleTypes = new [] { typeof(string) })] @@ -213,6 +233,9 @@ public partial interface INetworkAttachment : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = false, Description = @"The associated network's interface name. If specified, the network attachment name has a maximum length of 15 characters and must be unique to this virtual machine. If the user doesn’t specify this value, the default interface name of the network resource will be used. @@ -236,13 +259,15 @@ internal partial interface INetworkAttachmentInternal /// Only one of the attached networks (including the CloudServicesNetwork attachment) for a single machine may be specified /// as True. /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.DefaultGateway? DefaultGateway { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("True", "False")] + string DefaultGateway { get; set; } /// /// The IP allocation mechanism for the virtual machine. /// Dynamic and Static are only valid for l3Network which may also specify Disabled. /// Otherwise, Disabled is the only permitted value. /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineIPAllocationMethod IPAllocationMethod { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Dynamic", "Static", "Disabled")] + string IPAllocationMethod { get; set; } /// /// The IPv4 address of the virtual machine. /// This field is used only if the attached network has IPAllocationType of IPV4 or DualStack. diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/NetworkAttachment.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/NetworkAttachment.json.cs similarity index 79% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/NetworkAttachment.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/NetworkAttachment.json.cs index 2547e95fb048..b7cc99662d55 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/NetworkAttachment.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/NetworkAttachment.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class NetworkAttachment partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkAttachment. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkAttachment. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkAttachment. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkAttachment. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkAttachment FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkAttachment FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new NetworkAttachment(json) : null; } @@ -77,13 +77,13 @@ internal NetworkAttachment(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runti { return; } - {_attachedNetworkId = If( json?.PropertyT("attachedNetworkId"), out var __jsonAttachedNetworkId) ? (string)__jsonAttachedNetworkId : (string)AttachedNetworkId;} - {_defaultGateway = If( json?.PropertyT("defaultGateway"), out var __jsonDefaultGateway) ? (string)__jsonDefaultGateway : (string)DefaultGateway;} - {_iPAllocationMethod = If( json?.PropertyT("ipAllocationMethod"), out var __jsonIPAllocationMethod) ? (string)__jsonIPAllocationMethod : (string)IPAllocationMethod;} - {_ipv4Address = If( json?.PropertyT("ipv4Address"), out var __jsonIpv4Address) ? (string)__jsonIpv4Address : (string)Ipv4Address;} - {_ipv6Address = If( json?.PropertyT("ipv6Address"), out var __jsonIpv6Address) ? (string)__jsonIpv6Address : (string)Ipv6Address;} - {_macAddress = If( json?.PropertyT("macAddress"), out var __jsonMacAddress) ? (string)__jsonMacAddress : (string)MacAddress;} - {_name = If( json?.PropertyT("networkAttachmentName"), out var __jsonNetworkAttachmentName) ? (string)__jsonNetworkAttachmentName : (string)Name;} + {_attachedNetworkId = If( json?.PropertyT("attachedNetworkId"), out var __jsonAttachedNetworkId) ? (string)__jsonAttachedNetworkId : (string)_attachedNetworkId;} + {_defaultGateway = If( json?.PropertyT("defaultGateway"), out var __jsonDefaultGateway) ? (string)__jsonDefaultGateway : (string)_defaultGateway;} + {_iPAllocationMethod = If( json?.PropertyT("ipAllocationMethod"), out var __jsonIPAllocationMethod) ? (string)__jsonIPAllocationMethod : (string)_iPAllocationMethod;} + {_ipv4Address = If( json?.PropertyT("ipv4Address"), out var __jsonIpv4Address) ? (string)__jsonIpv4Address : (string)_ipv4Address;} + {_ipv6Address = If( json?.PropertyT("ipv6Address"), out var __jsonIpv6Address) ? (string)__jsonIpv6Address : (string)_ipv6Address;} + {_macAddress = If( json?.PropertyT("macAddress"), out var __jsonMacAddress) ? (string)__jsonMacAddress : (string)_macAddress;} + {_name = If( json?.PropertyT("networkAttachmentName"), out var __jsonNetworkAttachmentName) ? (string)__jsonNetworkAttachmentName : (string)_name;} AfterFromJson(json); } @@ -109,13 +109,22 @@ public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode ToJ AddIf( null != (((object)this._attachedNetworkId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._attachedNetworkId.ToString()) : null, "attachedNetworkId" ,container.Add ); AddIf( null != (((object)this._defaultGateway)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._defaultGateway.ToString()) : null, "defaultGateway" ,container.Add ); AddIf( null != (((object)this._iPAllocationMethod)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._iPAllocationMethod.ToString()) : null, "ipAllocationMethod" ,container.Add ); - AddIf( null != (((object)this._ipv4Address)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._ipv4Address.ToString()) : null, "ipv4Address" ,container.Add ); - AddIf( null != (((object)this._ipv6Address)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._ipv6Address.ToString()) : null, "ipv6Address" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)||serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate)) + { + AddIf( null != (((object)this._ipv4Address)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._ipv4Address.ToString()) : null, "ipv4Address" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)||serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate)) + { + AddIf( null != (((object)this._ipv6Address)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._ipv6Address.ToString()) : null, "ipv6Address" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._macAddress)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._macAddress.ToString()) : null, "macAddress" ,container.Add ); } - AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._name.ToString()) : null, "networkAttachmentName" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)||serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate)) + { + AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._name.ToString()) : null, "networkAttachmentName" ,container.Add ); + } AfterToJson(ref container); return container; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/NetworkCloudIdentity.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/NetworkCloudIdentity.cs index 500584c5968c..e4f5a750aa3e 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/NetworkCloudIdentity.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/NetworkCloudIdentity.cs @@ -179,6 +179,9 @@ public partial interface INetworkCloudIdentity : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The name of the Kubernetes cluster agent pool.", SerializedName = @"agentPoolName", PossibleTypes = new [] { typeof(string) })] @@ -187,6 +190,9 @@ public partial interface INetworkCloudIdentity : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The name of the bare metal machine key set.", SerializedName = @"bareMetalMachineKeySetName", PossibleTypes = new [] { typeof(string) })] @@ -195,6 +201,9 @@ public partial interface INetworkCloudIdentity : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The name of the bare metal machine.", SerializedName = @"bareMetalMachineName", PossibleTypes = new [] { typeof(string) })] @@ -203,6 +212,9 @@ public partial interface INetworkCloudIdentity : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The name of the baseboard management controller key set.", SerializedName = @"bmcKeySetName", PossibleTypes = new [] { typeof(string) })] @@ -211,6 +223,9 @@ public partial interface INetworkCloudIdentity : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The name of the cloud services network.", SerializedName = @"cloudServicesNetworkName", PossibleTypes = new [] { typeof(string) })] @@ -219,6 +234,9 @@ public partial interface INetworkCloudIdentity : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The name of the cluster manager.", SerializedName = @"clusterManagerName", PossibleTypes = new [] { typeof(string) })] @@ -227,6 +245,9 @@ public partial interface INetworkCloudIdentity : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The name of the cluster.", SerializedName = @"clusterName", PossibleTypes = new [] { typeof(string) })] @@ -235,6 +256,9 @@ public partial interface INetworkCloudIdentity : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The name of the virtual machine console.", SerializedName = @"consoleName", PossibleTypes = new [] { typeof(string) })] @@ -243,6 +267,9 @@ public partial interface INetworkCloudIdentity : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The name of the feature.", SerializedName = @"featureName", PossibleTypes = new [] { typeof(string) })] @@ -251,6 +278,9 @@ public partial interface INetworkCloudIdentity : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Resource identity path", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -259,6 +289,9 @@ public partial interface INetworkCloudIdentity : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The name of the Kubernetes cluster.", SerializedName = @"kubernetesClusterName", PossibleTypes = new [] { typeof(string) })] @@ -267,6 +300,9 @@ public partial interface INetworkCloudIdentity : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The name of the L2 network.", SerializedName = @"l2NetworkName", PossibleTypes = new [] { typeof(string) })] @@ -275,6 +311,9 @@ public partial interface INetworkCloudIdentity : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The name of the L3 network.", SerializedName = @"l3NetworkName", PossibleTypes = new [] { typeof(string) })] @@ -283,6 +322,9 @@ public partial interface INetworkCloudIdentity : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The name of the metrics configuration for the cluster.", SerializedName = @"metricsConfigurationName", PossibleTypes = new [] { typeof(string) })] @@ -291,6 +333,9 @@ public partial interface INetworkCloudIdentity : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The name of the rack.", SerializedName = @"rackName", PossibleTypes = new [] { typeof(string) })] @@ -299,6 +344,9 @@ public partial interface INetworkCloudIdentity : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The name of the rack SKU.", SerializedName = @"rackSkuName", PossibleTypes = new [] { typeof(string) })] @@ -307,6 +355,9 @@ public partial interface INetworkCloudIdentity : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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) })] @@ -315,6 +366,9 @@ public partial interface INetworkCloudIdentity : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The name of the storage appliance.", SerializedName = @"storageApplianceName", PossibleTypes = new [] { typeof(string) })] @@ -323,6 +377,9 @@ public partial interface INetworkCloudIdentity : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The ID of the target subscription. The value must be an UUID.", SerializedName = @"subscriptionId", PossibleTypes = new [] { typeof(string) })] @@ -331,6 +388,9 @@ public partial interface INetworkCloudIdentity : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The name of the trunked network.", SerializedName = @"trunkedNetworkName", PossibleTypes = new [] { typeof(string) })] @@ -339,6 +399,9 @@ public partial interface INetworkCloudIdentity : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The name of the virtual machine.", SerializedName = @"virtualMachineName", PossibleTypes = new [] { typeof(string) })] @@ -347,6 +410,9 @@ public partial interface INetworkCloudIdentity : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The name of the volume.", SerializedName = @"volumeName", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/NetworkCloudIdentity.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/NetworkCloudIdentity.json.cs index d0ee90d32848..e6ec8ec33720 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/NetworkCloudIdentity.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/NetworkCloudIdentity.json.cs @@ -76,28 +76,28 @@ internal NetworkCloudIdentity(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Ru { 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;} - {_bareMetalMachineName = If( json?.PropertyT("bareMetalMachineName"), out var __jsonBareMetalMachineName) ? (string)__jsonBareMetalMachineName : (string)BareMetalMachineName;} - {_cloudServicesNetworkName = If( json?.PropertyT("cloudServicesNetworkName"), out var __jsonCloudServicesNetworkName) ? (string)__jsonCloudServicesNetworkName : (string)CloudServicesNetworkName;} - {_clusterManagerName = If( json?.PropertyT("clusterManagerName"), out var __jsonClusterManagerName) ? (string)__jsonClusterManagerName : (string)ClusterManagerName;} - {_clusterName = If( json?.PropertyT("clusterName"), out var __jsonClusterName) ? (string)__jsonClusterName : (string)ClusterName;} - {_kubernetesClusterName = If( json?.PropertyT("kubernetesClusterName"), out var __jsonKubernetesClusterName) ? (string)__jsonKubernetesClusterName : (string)KubernetesClusterName;} - {_l2NetworkName = If( json?.PropertyT("l2NetworkName"), out var __jsonL2NetworkName) ? (string)__jsonL2NetworkName : (string)L2NetworkName;} - {_l3NetworkName = If( json?.PropertyT("l3NetworkName"), out var __jsonL3NetworkName) ? (string)__jsonL3NetworkName : (string)L3NetworkName;} - {_rackSkuName = If( json?.PropertyT("rackSkuName"), out var __jsonRackSkuName) ? (string)__jsonRackSkuName : (string)RackSkuName;} - {_rackName = If( json?.PropertyT("rackName"), out var __jsonRackName) ? (string)__jsonRackName : (string)RackName;} - {_storageApplianceName = If( json?.PropertyT("storageApplianceName"), out var __jsonStorageApplianceName) ? (string)__jsonStorageApplianceName : (string)StorageApplianceName;} - {_trunkedNetworkName = If( json?.PropertyT("trunkedNetworkName"), out var __jsonTrunkedNetworkName) ? (string)__jsonTrunkedNetworkName : (string)TrunkedNetworkName;} - {_virtualMachineName = If( json?.PropertyT("virtualMachineName"), out var __jsonVirtualMachineName) ? (string)__jsonVirtualMachineName : (string)VirtualMachineName;} - {_volumeName = If( json?.PropertyT("volumeName"), out var __jsonVolumeName) ? (string)__jsonVolumeName : (string)VolumeName;} - {_bareMetalMachineKeySetName = If( json?.PropertyT("bareMetalMachineKeySetName"), out var __jsonBareMetalMachineKeySetName) ? (string)__jsonBareMetalMachineKeySetName : (string)BareMetalMachineKeySetName;} - {_bmcKeySetName = If( json?.PropertyT("bmcKeySetName"), out var __jsonBmcKeySetName) ? (string)__jsonBmcKeySetName : (string)BmcKeySetName;} - {_metricsConfigurationName = If( json?.PropertyT("metricsConfigurationName"), out var __jsonMetricsConfigurationName) ? (string)__jsonMetricsConfigurationName : (string)MetricsConfigurationName;} - {_agentPoolName = If( json?.PropertyT("agentPoolName"), out var __jsonAgentPoolName) ? (string)__jsonAgentPoolName : (string)AgentPoolName;} - {_featureName = If( json?.PropertyT("featureName"), out var __jsonFeatureName) ? (string)__jsonFeatureName : (string)FeatureName;} - {_consoleName = If( json?.PropertyT("consoleName"), out var __jsonConsoleName) ? (string)__jsonConsoleName : (string)ConsoleName;} - {_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;} + {_bareMetalMachineName = If( json?.PropertyT("bareMetalMachineName"), out var __jsonBareMetalMachineName) ? (string)__jsonBareMetalMachineName : (string)_bareMetalMachineName;} + {_cloudServicesNetworkName = If( json?.PropertyT("cloudServicesNetworkName"), out var __jsonCloudServicesNetworkName) ? (string)__jsonCloudServicesNetworkName : (string)_cloudServicesNetworkName;} + {_clusterManagerName = If( json?.PropertyT("clusterManagerName"), out var __jsonClusterManagerName) ? (string)__jsonClusterManagerName : (string)_clusterManagerName;} + {_clusterName = If( json?.PropertyT("clusterName"), out var __jsonClusterName) ? (string)__jsonClusterName : (string)_clusterName;} + {_kubernetesClusterName = If( json?.PropertyT("kubernetesClusterName"), out var __jsonKubernetesClusterName) ? (string)__jsonKubernetesClusterName : (string)_kubernetesClusterName;} + {_l2NetworkName = If( json?.PropertyT("l2NetworkName"), out var __jsonL2NetworkName) ? (string)__jsonL2NetworkName : (string)_l2NetworkName;} + {_l3NetworkName = If( json?.PropertyT("l3NetworkName"), out var __jsonL3NetworkName) ? (string)__jsonL3NetworkName : (string)_l3NetworkName;} + {_rackSkuName = If( json?.PropertyT("rackSkuName"), out var __jsonRackSkuName) ? (string)__jsonRackSkuName : (string)_rackSkuName;} + {_rackName = If( json?.PropertyT("rackName"), out var __jsonRackName) ? (string)__jsonRackName : (string)_rackName;} + {_storageApplianceName = If( json?.PropertyT("storageApplianceName"), out var __jsonStorageApplianceName) ? (string)__jsonStorageApplianceName : (string)_storageApplianceName;} + {_trunkedNetworkName = If( json?.PropertyT("trunkedNetworkName"), out var __jsonTrunkedNetworkName) ? (string)__jsonTrunkedNetworkName : (string)_trunkedNetworkName;} + {_virtualMachineName = If( json?.PropertyT("virtualMachineName"), out var __jsonVirtualMachineName) ? (string)__jsonVirtualMachineName : (string)_virtualMachineName;} + {_volumeName = If( json?.PropertyT("volumeName"), out var __jsonVolumeName) ? (string)__jsonVolumeName : (string)_volumeName;} + {_bareMetalMachineKeySetName = If( json?.PropertyT("bareMetalMachineKeySetName"), out var __jsonBareMetalMachineKeySetName) ? (string)__jsonBareMetalMachineKeySetName : (string)_bareMetalMachineKeySetName;} + {_bmcKeySetName = If( json?.PropertyT("bmcKeySetName"), out var __jsonBmcKeySetName) ? (string)__jsonBmcKeySetName : (string)_bmcKeySetName;} + {_metricsConfigurationName = If( json?.PropertyT("metricsConfigurationName"), out var __jsonMetricsConfigurationName) ? (string)__jsonMetricsConfigurationName : (string)_metricsConfigurationName;} + {_agentPoolName = If( json?.PropertyT("agentPoolName"), out var __jsonAgentPoolName) ? (string)__jsonAgentPoolName : (string)_agentPoolName;} + {_featureName = If( json?.PropertyT("featureName"), out var __jsonFeatureName) ? (string)__jsonFeatureName : (string)_featureName;} + {_consoleName = If( json?.PropertyT("consoleName"), out var __jsonConsoleName) ? (string)__jsonConsoleName : (string)_consoleName;} + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)_id;} AfterFromJson(json); } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/NetworkConfiguration.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/NetworkConfiguration.PowerShell.cs new file mode 100644 index 000000000000..2ac12cd062ae --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/NetworkConfiguration.PowerShell.cs @@ -0,0 +1,286 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + + /// + /// NetworkConfiguration specifies the Kubernetes cluster network related configuration. + /// + [System.ComponentModel.TypeConverter(typeof(NetworkConfigurationTypeConverter))] + public partial class NetworkConfiguration + { + + /// + /// 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.NetworkCloud.Models.INetworkConfiguration DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new NetworkConfiguration(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.NetworkCloud.Models.INetworkConfiguration DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new NetworkConfiguration(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.NetworkCloud.Models.INetworkConfiguration FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal NetworkConfiguration(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("AttachedNetworkConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkConfigurationInternal)this).AttachedNetworkConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAttachedNetworkConfiguration) content.GetValueForProperty("AttachedNetworkConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkConfigurationInternal)this).AttachedNetworkConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AttachedNetworkConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("BgpServiceLoadBalancerConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkConfigurationInternal)this).BgpServiceLoadBalancerConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBgpServiceLoadBalancerConfiguration) content.GetValueForProperty("BgpServiceLoadBalancerConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkConfigurationInternal)this).BgpServiceLoadBalancerConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BgpServiceLoadBalancerConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("L2ServiceLoadBalancerConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkConfigurationInternal)this).L2ServiceLoadBalancerConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2ServiceLoadBalancerConfiguration) content.GetValueForProperty("L2ServiceLoadBalancerConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkConfigurationInternal)this).L2ServiceLoadBalancerConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.L2ServiceLoadBalancerConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("CloudServicesNetworkId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkConfigurationInternal)this).CloudServicesNetworkId = (string) content.GetValueForProperty("CloudServicesNetworkId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkConfigurationInternal)this).CloudServicesNetworkId, global::System.Convert.ToString); + } + if (content.Contains("CniNetworkId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkConfigurationInternal)this).CniNetworkId = (string) content.GetValueForProperty("CniNetworkId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkConfigurationInternal)this).CniNetworkId, global::System.Convert.ToString); + } + if (content.Contains("DnsServiceIP")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkConfigurationInternal)this).DnsServiceIP = (string) content.GetValueForProperty("DnsServiceIP",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkConfigurationInternal)this).DnsServiceIP, global::System.Convert.ToString); + } + if (content.Contains("PodCidr")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkConfigurationInternal)this).PodCidr = (System.Collections.Generic.List) content.GetValueForProperty("PodCidr",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkConfigurationInternal)this).PodCidr, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("ServiceCidr")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkConfigurationInternal)this).ServiceCidr = (System.Collections.Generic.List) content.GetValueForProperty("ServiceCidr",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkConfigurationInternal)this).ServiceCidr, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("AttachedNetworkConfigurationL2Network")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkConfigurationInternal)this).AttachedNetworkConfigurationL2Network = (System.Collections.Generic.List) content.GetValueForProperty("AttachedNetworkConfigurationL2Network",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkConfigurationInternal)this).AttachedNetworkConfigurationL2Network, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.L2NetworkAttachmentConfigurationTypeConverter.ConvertFrom)); + } + if (content.Contains("AttachedNetworkConfigurationL3Network")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkConfigurationInternal)this).AttachedNetworkConfigurationL3Network = (System.Collections.Generic.List) content.GetValueForProperty("AttachedNetworkConfigurationL3Network",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkConfigurationInternal)this).AttachedNetworkConfigurationL3Network, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.L3NetworkAttachmentConfigurationTypeConverter.ConvertFrom)); + } + if (content.Contains("AttachedNetworkConfigurationTrunkedNetwork")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkConfigurationInternal)this).AttachedNetworkConfigurationTrunkedNetwork = (System.Collections.Generic.List) content.GetValueForProperty("AttachedNetworkConfigurationTrunkedNetwork",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkConfigurationInternal)this).AttachedNetworkConfigurationTrunkedNetwork, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.TrunkedNetworkAttachmentConfigurationTypeConverter.ConvertFrom)); + } + if (content.Contains("BgpServiceLoadBalancerConfigurationBgpAdvertisement")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkConfigurationInternal)this).BgpServiceLoadBalancerConfigurationBgpAdvertisement = (System.Collections.Generic.List) content.GetValueForProperty("BgpServiceLoadBalancerConfigurationBgpAdvertisement",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkConfigurationInternal)this).BgpServiceLoadBalancerConfigurationBgpAdvertisement, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BgpAdvertisementTypeConverter.ConvertFrom)); + } + if (content.Contains("BgpServiceLoadBalancerConfigurationBgpPeer")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkConfigurationInternal)this).BgpServiceLoadBalancerConfigurationBgpPeer = (System.Collections.Generic.List) content.GetValueForProperty("BgpServiceLoadBalancerConfigurationBgpPeer",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkConfigurationInternal)this).BgpServiceLoadBalancerConfigurationBgpPeer, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ServiceLoadBalancerBgpPeerTypeConverter.ConvertFrom)); + } + if (content.Contains("BgpServiceLoadBalancerConfigurationFabricPeeringEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkConfigurationInternal)this).BgpServiceLoadBalancerConfigurationFabricPeeringEnabled = (string) content.GetValueForProperty("BgpServiceLoadBalancerConfigurationFabricPeeringEnabled",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkConfigurationInternal)this).BgpServiceLoadBalancerConfigurationFabricPeeringEnabled, global::System.Convert.ToString); + } + if (content.Contains("BgpServiceLoadBalancerConfigurationIPAddressPool")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkConfigurationInternal)this).BgpServiceLoadBalancerConfigurationIPAddressPool = (System.Collections.Generic.List) content.GetValueForProperty("BgpServiceLoadBalancerConfigurationIPAddressPool",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkConfigurationInternal)this).BgpServiceLoadBalancerConfigurationIPAddressPool, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IPAddressPoolTypeConverter.ConvertFrom)); + } + if (content.Contains("L2ServiceLoadBalancerConfigurationIPAddressPool")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkConfigurationInternal)this).L2ServiceLoadBalancerConfigurationIPAddressPool = (System.Collections.Generic.List) content.GetValueForProperty("L2ServiceLoadBalancerConfigurationIPAddressPool",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkConfigurationInternal)this).L2ServiceLoadBalancerConfigurationIPAddressPool, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IPAddressPoolTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal NetworkConfiguration(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("AttachedNetworkConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkConfigurationInternal)this).AttachedNetworkConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAttachedNetworkConfiguration) content.GetValueForProperty("AttachedNetworkConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkConfigurationInternal)this).AttachedNetworkConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AttachedNetworkConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("BgpServiceLoadBalancerConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkConfigurationInternal)this).BgpServiceLoadBalancerConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBgpServiceLoadBalancerConfiguration) content.GetValueForProperty("BgpServiceLoadBalancerConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkConfigurationInternal)this).BgpServiceLoadBalancerConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BgpServiceLoadBalancerConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("L2ServiceLoadBalancerConfiguration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkConfigurationInternal)this).L2ServiceLoadBalancerConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2ServiceLoadBalancerConfiguration) content.GetValueForProperty("L2ServiceLoadBalancerConfiguration",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkConfigurationInternal)this).L2ServiceLoadBalancerConfiguration, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.L2ServiceLoadBalancerConfigurationTypeConverter.ConvertFrom); + } + if (content.Contains("CloudServicesNetworkId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkConfigurationInternal)this).CloudServicesNetworkId = (string) content.GetValueForProperty("CloudServicesNetworkId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkConfigurationInternal)this).CloudServicesNetworkId, global::System.Convert.ToString); + } + if (content.Contains("CniNetworkId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkConfigurationInternal)this).CniNetworkId = (string) content.GetValueForProperty("CniNetworkId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkConfigurationInternal)this).CniNetworkId, global::System.Convert.ToString); + } + if (content.Contains("DnsServiceIP")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkConfigurationInternal)this).DnsServiceIP = (string) content.GetValueForProperty("DnsServiceIP",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkConfigurationInternal)this).DnsServiceIP, global::System.Convert.ToString); + } + if (content.Contains("PodCidr")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkConfigurationInternal)this).PodCidr = (System.Collections.Generic.List) content.GetValueForProperty("PodCidr",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkConfigurationInternal)this).PodCidr, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("ServiceCidr")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkConfigurationInternal)this).ServiceCidr = (System.Collections.Generic.List) content.GetValueForProperty("ServiceCidr",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkConfigurationInternal)this).ServiceCidr, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("AttachedNetworkConfigurationL2Network")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkConfigurationInternal)this).AttachedNetworkConfigurationL2Network = (System.Collections.Generic.List) content.GetValueForProperty("AttachedNetworkConfigurationL2Network",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkConfigurationInternal)this).AttachedNetworkConfigurationL2Network, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.L2NetworkAttachmentConfigurationTypeConverter.ConvertFrom)); + } + if (content.Contains("AttachedNetworkConfigurationL3Network")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkConfigurationInternal)this).AttachedNetworkConfigurationL3Network = (System.Collections.Generic.List) content.GetValueForProperty("AttachedNetworkConfigurationL3Network",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkConfigurationInternal)this).AttachedNetworkConfigurationL3Network, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.L3NetworkAttachmentConfigurationTypeConverter.ConvertFrom)); + } + if (content.Contains("AttachedNetworkConfigurationTrunkedNetwork")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkConfigurationInternal)this).AttachedNetworkConfigurationTrunkedNetwork = (System.Collections.Generic.List) content.GetValueForProperty("AttachedNetworkConfigurationTrunkedNetwork",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkConfigurationInternal)this).AttachedNetworkConfigurationTrunkedNetwork, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.TrunkedNetworkAttachmentConfigurationTypeConverter.ConvertFrom)); + } + if (content.Contains("BgpServiceLoadBalancerConfigurationBgpAdvertisement")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkConfigurationInternal)this).BgpServiceLoadBalancerConfigurationBgpAdvertisement = (System.Collections.Generic.List) content.GetValueForProperty("BgpServiceLoadBalancerConfigurationBgpAdvertisement",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkConfigurationInternal)this).BgpServiceLoadBalancerConfigurationBgpAdvertisement, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BgpAdvertisementTypeConverter.ConvertFrom)); + } + if (content.Contains("BgpServiceLoadBalancerConfigurationBgpPeer")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkConfigurationInternal)this).BgpServiceLoadBalancerConfigurationBgpPeer = (System.Collections.Generic.List) content.GetValueForProperty("BgpServiceLoadBalancerConfigurationBgpPeer",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkConfigurationInternal)this).BgpServiceLoadBalancerConfigurationBgpPeer, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ServiceLoadBalancerBgpPeerTypeConverter.ConvertFrom)); + } + if (content.Contains("BgpServiceLoadBalancerConfigurationFabricPeeringEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkConfigurationInternal)this).BgpServiceLoadBalancerConfigurationFabricPeeringEnabled = (string) content.GetValueForProperty("BgpServiceLoadBalancerConfigurationFabricPeeringEnabled",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkConfigurationInternal)this).BgpServiceLoadBalancerConfigurationFabricPeeringEnabled, global::System.Convert.ToString); + } + if (content.Contains("BgpServiceLoadBalancerConfigurationIPAddressPool")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkConfigurationInternal)this).BgpServiceLoadBalancerConfigurationIPAddressPool = (System.Collections.Generic.List) content.GetValueForProperty("BgpServiceLoadBalancerConfigurationIPAddressPool",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkConfigurationInternal)this).BgpServiceLoadBalancerConfigurationIPAddressPool, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IPAddressPoolTypeConverter.ConvertFrom)); + } + if (content.Contains("L2ServiceLoadBalancerConfigurationIPAddressPool")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkConfigurationInternal)this).L2ServiceLoadBalancerConfigurationIPAddressPool = (System.Collections.Generic.List) content.GetValueForProperty("L2ServiceLoadBalancerConfigurationIPAddressPool",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkConfigurationInternal)this).L2ServiceLoadBalancerConfigurationIPAddressPool, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IPAddressPoolTypeConverter.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.NetworkCloud.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(); + } + } + /// NetworkConfiguration specifies the Kubernetes cluster network related configuration. + [System.ComponentModel.TypeConverter(typeof(NetworkConfigurationTypeConverter))] + public partial interface INetworkConfiguration + + { + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/NetworkConfiguration.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/NetworkConfiguration.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/NetworkConfiguration.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/NetworkConfiguration.TypeConverter.cs index cf974c912084..2e79db79ec7d 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/NetworkConfiguration.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/NetworkConfiguration.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.INetworkConfiguration ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkConfiguration ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkConfiguration).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkConfiguration).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/NetworkConfiguration.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/NetworkConfiguration.cs new file mode 100644 index 000000000000..8a2074d01d89 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/NetworkConfiguration.cs @@ -0,0 +1,383 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + + /// + /// NetworkConfiguration specifies the Kubernetes cluster network related configuration. + /// + public partial class NetworkConfiguration : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkConfiguration, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkConfigurationInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAttachedNetworkConfiguration _attachedNetworkConfiguration; + + /// + /// The configuration of networks being attached to the cluster for use by the workloads that run on this Kubernetes cluster. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAttachedNetworkConfiguration AttachedNetworkConfiguration { get => (this._attachedNetworkConfiguration = this._attachedNetworkConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AttachedNetworkConfiguration()); set => this._attachedNetworkConfiguration = value; } + + /// The list of Layer 2 Networks and related configuration for attachment. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public System.Collections.Generic.List AttachedNetworkConfigurationL2Network { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAttachedNetworkConfigurationInternal)AttachedNetworkConfiguration).L2Network; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAttachedNetworkConfigurationInternal)AttachedNetworkConfiguration).L2Network = value ?? null /* arrayOf */; } + + /// The list of Layer 3 Networks and related configuration for attachment. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public System.Collections.Generic.List AttachedNetworkConfigurationL3Network { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAttachedNetworkConfigurationInternal)AttachedNetworkConfiguration).L3Network; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAttachedNetworkConfigurationInternal)AttachedNetworkConfiguration).L3Network = value ?? null /* arrayOf */; } + + /// The list of Trunked Networks and related configuration for attachment. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public System.Collections.Generic.List AttachedNetworkConfigurationTrunkedNetwork { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAttachedNetworkConfigurationInternal)AttachedNetworkConfiguration).TrunkedNetwork; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAttachedNetworkConfigurationInternal)AttachedNetworkConfiguration).TrunkedNetwork = value ?? null /* arrayOf */; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBgpServiceLoadBalancerConfiguration _bgpServiceLoadBalancerConfiguration; + + /// + /// The configuration of the BGP service load balancer for this Kubernetes cluster. A maximum of one service load balancer + /// may be specified, either Layer 2 or BGP. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBgpServiceLoadBalancerConfiguration BgpServiceLoadBalancerConfiguration { get => (this._bgpServiceLoadBalancerConfiguration = this._bgpServiceLoadBalancerConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BgpServiceLoadBalancerConfiguration()); set => this._bgpServiceLoadBalancerConfiguration = value; } + + /// + /// The association of IP address pools to the communities and peers, allowing for announcement of IPs. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public System.Collections.Generic.List BgpServiceLoadBalancerConfigurationBgpAdvertisement { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBgpServiceLoadBalancerConfigurationInternal)BgpServiceLoadBalancerConfiguration).BgpAdvertisement; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBgpServiceLoadBalancerConfigurationInternal)BgpServiceLoadBalancerConfiguration).BgpAdvertisement = value ?? null /* arrayOf */; } + + /// + /// The list of additional BgpPeer entities that the Kubernetes cluster will peer with. All peering must be explicitly defined. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public System.Collections.Generic.List BgpServiceLoadBalancerConfigurationBgpPeer { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBgpServiceLoadBalancerConfigurationInternal)BgpServiceLoadBalancerConfiguration).BgpPeer; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBgpServiceLoadBalancerConfigurationInternal)BgpServiceLoadBalancerConfiguration).BgpPeer = value ?? null /* arrayOf */; } + + /// The indicator to specify if the load balancer peers with the network fabric. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string BgpServiceLoadBalancerConfigurationFabricPeeringEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBgpServiceLoadBalancerConfigurationInternal)BgpServiceLoadBalancerConfiguration).FabricPeeringEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBgpServiceLoadBalancerConfigurationInternal)BgpServiceLoadBalancerConfiguration).FabricPeeringEnabled = value ?? null; } + + /// + /// The list of pools of IP addresses that can be allocated to load balancer services. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public System.Collections.Generic.List BgpServiceLoadBalancerConfigurationIPAddressPool { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBgpServiceLoadBalancerConfigurationInternal)BgpServiceLoadBalancerConfiguration).IPAddressPool; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBgpServiceLoadBalancerConfigurationInternal)BgpServiceLoadBalancerConfiguration).IPAddressPool = value ?? null /* arrayOf */; } + + /// Backing field for property. + private string _cloudServicesNetworkId; + + /// The resource ID of the associated Cloud Services network. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string CloudServicesNetworkId { get => this._cloudServicesNetworkId; set => this._cloudServicesNetworkId = value; } + + /// Backing field for property. + private string _cniNetworkId; + + /// + /// The resource ID of the Layer 3 network that is used for creation of the Container Networking Interface network. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string CniNetworkId { get => this._cniNetworkId; set => this._cniNetworkId = value; } + + /// Backing field for property. + private string _dnsServiceIP; + + /// + /// The IP address assigned to the Kubernetes DNS service. It must be within the Kubernetes service address range specified + /// in service CIDR. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string DnsServiceIP { get => this._dnsServiceIP; set => this._dnsServiceIP = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2ServiceLoadBalancerConfiguration _l2ServiceLoadBalancerConfiguration; + + /// + /// The configuration of the Layer 2 service load balancer for this Kubernetes cluster. A maximum of one service load balancer + /// may be specified, either Layer 2 or BGP. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2ServiceLoadBalancerConfiguration L2ServiceLoadBalancerConfiguration { get => (this._l2ServiceLoadBalancerConfiguration = this._l2ServiceLoadBalancerConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.L2ServiceLoadBalancerConfiguration()); set => this._l2ServiceLoadBalancerConfiguration = value; } + + /// + /// The list of pools of IP addresses that can be allocated to load balancer services. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public System.Collections.Generic.List L2ServiceLoadBalancerConfigurationIPAddressPool { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2ServiceLoadBalancerConfigurationInternal)L2ServiceLoadBalancerConfiguration).IPAddressPool; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2ServiceLoadBalancerConfigurationInternal)L2ServiceLoadBalancerConfiguration).IPAddressPool = value ?? null /* arrayOf */; } + + /// Internal Acessors for AttachedNetworkConfiguration + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAttachedNetworkConfiguration Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkConfigurationInternal.AttachedNetworkConfiguration { get => (this._attachedNetworkConfiguration = this._attachedNetworkConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AttachedNetworkConfiguration()); set { {_attachedNetworkConfiguration = value;} } } + + /// Internal Acessors for BgpServiceLoadBalancerConfiguration + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBgpServiceLoadBalancerConfiguration Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkConfigurationInternal.BgpServiceLoadBalancerConfiguration { get => (this._bgpServiceLoadBalancerConfiguration = this._bgpServiceLoadBalancerConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BgpServiceLoadBalancerConfiguration()); set { {_bgpServiceLoadBalancerConfiguration = value;} } } + + /// Internal Acessors for L2ServiceLoadBalancerConfiguration + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2ServiceLoadBalancerConfiguration Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkConfigurationInternal.L2ServiceLoadBalancerConfiguration { get => (this._l2ServiceLoadBalancerConfiguration = this._l2ServiceLoadBalancerConfiguration ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.L2ServiceLoadBalancerConfiguration()); set { {_l2ServiceLoadBalancerConfiguration = value;} } } + + /// Backing field for property. + private System.Collections.Generic.List _podCidr; + + /// + /// The CIDR notation IP ranges from which to assign pod IPs. One IPv4 CIDR is expected for single-stack networking. Two CIDRs, + /// one for each IP family (IPv4/IPv6), is expected for dual-stack networking. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public System.Collections.Generic.List PodCidr { get => this._podCidr; set => this._podCidr = value; } + + /// Backing field for property. + private System.Collections.Generic.List _serviceCidr; + + /// + /// The CIDR notation IP ranges from which to assign service IPs. One IPv4 CIDR is expected for single-stack networking. Two + /// CIDRs, one for each IP family (IPv4/IPv6), is expected for dual-stack networking. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public System.Collections.Generic.List ServiceCidr { get => this._serviceCidr; set => this._serviceCidr = value; } + + /// Creates an new instance. + public NetworkConfiguration() + { + + } + } + /// NetworkConfiguration specifies the Kubernetes cluster network related configuration. + public partial interface INetworkConfiguration : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable + { + /// The list of Layer 2 Networks and related configuration for attachment. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The list of Layer 2 Networks and related configuration for attachment.", + SerializedName = @"l2Networks", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkAttachmentConfiguration) })] + System.Collections.Generic.List AttachedNetworkConfigurationL2Network { get; set; } + /// The list of Layer 3 Networks and related configuration for attachment. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The list of Layer 3 Networks and related configuration for attachment.", + SerializedName = @"l3Networks", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkAttachmentConfiguration) })] + System.Collections.Generic.List AttachedNetworkConfigurationL3Network { get; set; } + /// The list of Trunked Networks and related configuration for attachment. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The list of Trunked Networks and related configuration for attachment.", + SerializedName = @"trunkedNetworks", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkAttachmentConfiguration) })] + System.Collections.Generic.List AttachedNetworkConfigurationTrunkedNetwork { get; set; } + /// + /// The association of IP address pools to the communities and peers, allowing for announcement of IPs. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The association of IP address pools to the communities and peers, allowing for announcement of IPs.", + SerializedName = @"bgpAdvertisements", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBgpAdvertisement) })] + System.Collections.Generic.List BgpServiceLoadBalancerConfigurationBgpAdvertisement { get; set; } + /// + /// The list of additional BgpPeer entities that the Kubernetes cluster will peer with. All peering must be explicitly defined. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The list of additional BgpPeer entities that the Kubernetes cluster will peer with. All peering must be explicitly defined.", + SerializedName = @"bgpPeers", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IServiceLoadBalancerBgpPeer) })] + System.Collections.Generic.List BgpServiceLoadBalancerConfigurationBgpPeer { get; set; } + /// The indicator to specify if the load balancer peers with the network fabric. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The indicator to specify if the load balancer peers with the network fabric.", + SerializedName = @"fabricPeeringEnabled", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("True", "False")] + string BgpServiceLoadBalancerConfigurationFabricPeeringEnabled { get; set; } + /// + /// The list of pools of IP addresses that can be allocated to load balancer services. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The list of pools of IP addresses that can be allocated to load balancer services.", + SerializedName = @"ipAddressPools", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IIPAddressPool) })] + System.Collections.Generic.List BgpServiceLoadBalancerConfigurationIPAddressPool { get; set; } + /// The resource ID of the associated Cloud Services network. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The resource ID of the associated Cloud Services network.", + SerializedName = @"cloudServicesNetworkId", + PossibleTypes = new [] { typeof(string) })] + string CloudServicesNetworkId { get; set; } + /// + /// The resource ID of the Layer 3 network that is used for creation of the Container Networking Interface network. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The resource ID of the Layer 3 network that is used for creation of the Container Networking Interface network.", + SerializedName = @"cniNetworkId", + PossibleTypes = new [] { typeof(string) })] + string CniNetworkId { get; set; } + /// + /// The IP address assigned to the Kubernetes DNS service. It must be within the Kubernetes service address range specified + /// in service CIDR. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The IP address assigned to the Kubernetes DNS service. It must be within the Kubernetes service address range specified in service CIDR.", + SerializedName = @"dnsServiceIp", + PossibleTypes = new [] { typeof(string) })] + string DnsServiceIP { get; set; } + /// + /// The list of pools of IP addresses that can be allocated to load balancer services. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The list of pools of IP addresses that can be allocated to load balancer services.", + SerializedName = @"ipAddressPools", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IIPAddressPool) })] + System.Collections.Generic.List L2ServiceLoadBalancerConfigurationIPAddressPool { get; set; } + /// + /// The CIDR notation IP ranges from which to assign pod IPs. One IPv4 CIDR is expected for single-stack networking. Two CIDRs, + /// one for each IP family (IPv4/IPv6), is expected for dual-stack networking. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The CIDR notation IP ranges from which to assign pod IPs. One IPv4 CIDR is expected for single-stack networking. Two CIDRs, one for each IP family (IPv4/IPv6), is expected for dual-stack networking.", + SerializedName = @"podCidrs", + PossibleTypes = new [] { typeof(string) })] + System.Collections.Generic.List PodCidr { get; set; } + /// + /// The CIDR notation IP ranges from which to assign service IPs. One IPv4 CIDR is expected for single-stack networking. Two + /// CIDRs, one for each IP family (IPv4/IPv6), is expected for dual-stack networking. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The CIDR notation IP ranges from which to assign service IPs. One IPv4 CIDR is expected for single-stack networking. Two CIDRs, one for each IP family (IPv4/IPv6), is expected for dual-stack networking.", + SerializedName = @"serviceCidrs", + PossibleTypes = new [] { typeof(string) })] + System.Collections.Generic.List ServiceCidr { get; set; } + + } + /// NetworkConfiguration specifies the Kubernetes cluster network related configuration. + internal partial interface INetworkConfigurationInternal + + { + /// + /// The configuration of networks being attached to the cluster for use by the workloads that run on this Kubernetes cluster. + /// + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAttachedNetworkConfiguration AttachedNetworkConfiguration { get; set; } + /// The list of Layer 2 Networks and related configuration for attachment. + System.Collections.Generic.List AttachedNetworkConfigurationL2Network { get; set; } + /// The list of Layer 3 Networks and related configuration for attachment. + System.Collections.Generic.List AttachedNetworkConfigurationL3Network { get; set; } + /// The list of Trunked Networks and related configuration for attachment. + System.Collections.Generic.List AttachedNetworkConfigurationTrunkedNetwork { get; set; } + /// + /// The configuration of the BGP service load balancer for this Kubernetes cluster. A maximum of one service load balancer + /// may be specified, either Layer 2 or BGP. + /// + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBgpServiceLoadBalancerConfiguration BgpServiceLoadBalancerConfiguration { get; set; } + /// + /// The association of IP address pools to the communities and peers, allowing for announcement of IPs. + /// + System.Collections.Generic.List BgpServiceLoadBalancerConfigurationBgpAdvertisement { get; set; } + /// + /// The list of additional BgpPeer entities that the Kubernetes cluster will peer with. All peering must be explicitly defined. + /// + System.Collections.Generic.List BgpServiceLoadBalancerConfigurationBgpPeer { get; set; } + /// The indicator to specify if the load balancer peers with the network fabric. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("True", "False")] + string BgpServiceLoadBalancerConfigurationFabricPeeringEnabled { get; set; } + /// + /// The list of pools of IP addresses that can be allocated to load balancer services. + /// + System.Collections.Generic.List BgpServiceLoadBalancerConfigurationIPAddressPool { get; set; } + /// The resource ID of the associated Cloud Services network. + string CloudServicesNetworkId { get; set; } + /// + /// The resource ID of the Layer 3 network that is used for creation of the Container Networking Interface network. + /// + string CniNetworkId { get; set; } + /// + /// The IP address assigned to the Kubernetes DNS service. It must be within the Kubernetes service address range specified + /// in service CIDR. + /// + string DnsServiceIP { get; set; } + /// + /// The configuration of the Layer 2 service load balancer for this Kubernetes cluster. A maximum of one service load balancer + /// may be specified, either Layer 2 or BGP. + /// + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2ServiceLoadBalancerConfiguration L2ServiceLoadBalancerConfiguration { get; set; } + /// + /// The list of pools of IP addresses that can be allocated to load balancer services. + /// + System.Collections.Generic.List L2ServiceLoadBalancerConfigurationIPAddressPool { get; set; } + /// + /// The CIDR notation IP ranges from which to assign pod IPs. One IPv4 CIDR is expected for single-stack networking. Two CIDRs, + /// one for each IP family (IPv4/IPv6), is expected for dual-stack networking. + /// + System.Collections.Generic.List PodCidr { get; set; } + /// + /// The CIDR notation IP ranges from which to assign service IPs. One IPv4 CIDR is expected for single-stack networking. Two + /// CIDRs, one for each IP family (IPv4/IPv6), is expected for dual-stack networking. + /// + System.Collections.Generic.List ServiceCidr { get; set; } + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/NetworkConfiguration.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/NetworkConfiguration.json.cs new file mode 100644 index 000000000000..209a7be8262e --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/NetworkConfiguration.json.cs @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + + /// + /// NetworkConfiguration specifies the Kubernetes cluster network related configuration. + /// + public partial class NetworkConfiguration + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkConfiguration. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkConfiguration. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkConfiguration FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new NetworkConfiguration(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject instance to deserialize from. + internal NetworkConfiguration(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_attachedNetworkConfiguration = If( json?.PropertyT("attachedNetworkConfiguration"), out var __jsonAttachedNetworkConfiguration) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AttachedNetworkConfiguration.FromJson(__jsonAttachedNetworkConfiguration) : _attachedNetworkConfiguration;} + {_bgpServiceLoadBalancerConfiguration = If( json?.PropertyT("bgpServiceLoadBalancerConfiguration"), out var __jsonBgpServiceLoadBalancerConfiguration) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BgpServiceLoadBalancerConfiguration.FromJson(__jsonBgpServiceLoadBalancerConfiguration) : _bgpServiceLoadBalancerConfiguration;} + {_l2ServiceLoadBalancerConfiguration = If( json?.PropertyT("l2ServiceLoadBalancerConfiguration"), out var __jsonL2ServiceLoadBalancerConfiguration) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.L2ServiceLoadBalancerConfiguration.FromJson(__jsonL2ServiceLoadBalancerConfiguration) : _l2ServiceLoadBalancerConfiguration;} + {_cloudServicesNetworkId = If( json?.PropertyT("cloudServicesNetworkId"), out var __jsonCloudServicesNetworkId) ? (string)__jsonCloudServicesNetworkId : (string)_cloudServicesNetworkId;} + {_cniNetworkId = If( json?.PropertyT("cniNetworkId"), out var __jsonCniNetworkId) ? (string)__jsonCniNetworkId : (string)_cniNetworkId;} + {_dnsServiceIP = If( json?.PropertyT("dnsServiceIp"), out var __jsonDnsServiceIP) ? (string)__jsonDnsServiceIP : (string)_dnsServiceIP;} + {_podCidr = If( json?.PropertyT("podCidrs"), out var __jsonPodCidrs) ? If( __jsonPodCidrs as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : _podCidr;} + {_serviceCidr = If( json?.PropertyT("serviceCidrs"), out var __jsonServiceCidrs) ? If( __jsonServiceCidrs as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Json.JsonString __o ? (string)(__o.ToString()) : null)) ))() : null : _serviceCidr;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)||serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate)) + { + AddIf( null != this._attachedNetworkConfiguration ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) this._attachedNetworkConfiguration.ToJson(null,serializationMode) : null, "attachedNetworkConfiguration" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)||serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate)) + { + AddIf( null != this._bgpServiceLoadBalancerConfiguration ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) this._bgpServiceLoadBalancerConfiguration.ToJson(null,serializationMode) : null, "bgpServiceLoadBalancerConfiguration" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)||serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate)) + { + AddIf( null != this._l2ServiceLoadBalancerConfiguration ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) this._l2ServiceLoadBalancerConfiguration.ToJson(null,serializationMode) : null, "l2ServiceLoadBalancerConfiguration" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)||serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate)) + { + AddIf( null != (((object)this._cloudServicesNetworkId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._cloudServicesNetworkId.ToString()) : null, "cloudServicesNetworkId" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)||serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate)) + { + AddIf( null != (((object)this._cniNetworkId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._cniNetworkId.ToString()) : null, "cniNetworkId" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)||serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate)) + { + AddIf( null != (((object)this._dnsServiceIP)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._dnsServiceIP.ToString()) : null, "dnsServiceIp" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)||serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate)) + { + if (null != this._podCidr) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.XNodeArray(); + foreach( var __x in this._podCidr ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("podCidrs",__w); + } + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)||serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate)) + { + if (null != this._serviceCidr) + { + var __r = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.XNodeArray(); + foreach( var __s in this._serviceCidr ) + { + AddIf(null != (((object)__s)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(__s.ToString()) : null ,__r.Add); + } + container.Add("serviceCidrs",__r); + } + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/NetworkInterface.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/NetworkInterface.PowerShell.cs new file mode 100644 index 000000000000..85d8a12c1e5b --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/NetworkInterface.PowerShell.cs @@ -0,0 +1,212 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + + /// NetworkInterface represents properties of the network interface. + [System.ComponentModel.TypeConverter(typeof(NetworkInterfaceTypeConverter))] + public partial class NetworkInterface + { + + /// + /// 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.NetworkCloud.Models.INetworkInterface DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new NetworkInterface(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.NetworkCloud.Models.INetworkInterface DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new NetworkInterface(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.NetworkCloud.Models.INetworkInterface FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal NetworkInterface(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Address")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkInterfaceInternal)this).Address = (string) content.GetValueForProperty("Address",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkInterfaceInternal)this).Address, global::System.Convert.ToString); + } + if (content.Contains("DeviceConnectionType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkInterfaceInternal)this).DeviceConnectionType = (string) content.GetValueForProperty("DeviceConnectionType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkInterfaceInternal)this).DeviceConnectionType, global::System.Convert.ToString); + } + if (content.Contains("Model")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkInterfaceInternal)this).Model = (string) content.GetValueForProperty("Model",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkInterfaceInternal)this).Model, global::System.Convert.ToString); + } + if (content.Contains("PhysicalSlot")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkInterfaceInternal)this).PhysicalSlot = (long?) content.GetValueForProperty("PhysicalSlot",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkInterfaceInternal)this).PhysicalSlot, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("PortCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkInterfaceInternal)this).PortCount = (long?) content.GetValueForProperty("PortCount",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkInterfaceInternal)this).PortCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("PortSpeed")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkInterfaceInternal)this).PortSpeed = (long?) content.GetValueForProperty("PortSpeed",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkInterfaceInternal)this).PortSpeed, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("Vendor")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkInterfaceInternal)this).Vendor = (string) content.GetValueForProperty("Vendor",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkInterfaceInternal)this).Vendor, 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 NetworkInterface(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Address")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkInterfaceInternal)this).Address = (string) content.GetValueForProperty("Address",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkInterfaceInternal)this).Address, global::System.Convert.ToString); + } + if (content.Contains("DeviceConnectionType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkInterfaceInternal)this).DeviceConnectionType = (string) content.GetValueForProperty("DeviceConnectionType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkInterfaceInternal)this).DeviceConnectionType, global::System.Convert.ToString); + } + if (content.Contains("Model")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkInterfaceInternal)this).Model = (string) content.GetValueForProperty("Model",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkInterfaceInternal)this).Model, global::System.Convert.ToString); + } + if (content.Contains("PhysicalSlot")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkInterfaceInternal)this).PhysicalSlot = (long?) content.GetValueForProperty("PhysicalSlot",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkInterfaceInternal)this).PhysicalSlot, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("PortCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkInterfaceInternal)this).PortCount = (long?) content.GetValueForProperty("PortCount",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkInterfaceInternal)this).PortCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("PortSpeed")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkInterfaceInternal)this).PortSpeed = (long?) content.GetValueForProperty("PortSpeed",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkInterfaceInternal)this).PortSpeed, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("Vendor")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkInterfaceInternal)this).Vendor = (string) content.GetValueForProperty("Vendor",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkInterfaceInternal)this).Vendor, 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.NetworkCloud.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(); + } + } + /// NetworkInterface represents properties of the network interface. + [System.ComponentModel.TypeConverter(typeof(NetworkInterfaceTypeConverter))] + public partial interface INetworkInterface + + { + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/NetworkInterface.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/NetworkInterface.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/NetworkInterface.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/NetworkInterface.TypeConverter.cs index 02774f78e136..d15c8b3e184c 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/NetworkInterface.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/NetworkInterface.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.INetworkInterface ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkInterface ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkInterface).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkInterface).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/NetworkInterface.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/NetworkInterface.cs similarity index 81% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/NetworkInterface.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/NetworkInterface.cs index 4fadb8d35cde..7613531de797 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/NetworkInterface.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/NetworkInterface.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; /// NetworkInterface represents properties of the network interface. public partial class NetworkInterface : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkInterface, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkInterfaceInternal + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkInterface, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkInterfaceInternal { /// Backing field for property. @@ -21,32 +21,32 @@ public partial class NetworkInterface : public string Address { get => this._address; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.DeviceConnectionType? _deviceConnectionType; + private string _deviceConnectionType; /// The connection type of the device. [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.DeviceConnectionType? DeviceConnectionType { get => this._deviceConnectionType; } + public string DeviceConnectionType { get => this._deviceConnectionType; } /// Internal Acessors for Address - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkInterfaceInternal.Address { get => this._address; set { {_address = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkInterfaceInternal.Address { get => this._address; set { {_address = value;} } } /// Internal Acessors for DeviceConnectionType - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.DeviceConnectionType? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkInterfaceInternal.DeviceConnectionType { get => this._deviceConnectionType; set { {_deviceConnectionType = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkInterfaceInternal.DeviceConnectionType { get => this._deviceConnectionType; set { {_deviceConnectionType = value;} } } /// Internal Acessors for Model - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkInterfaceInternal.Model { get => this._model; set { {_model = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkInterfaceInternal.Model { get => this._model; set { {_model = value;} } } /// Internal Acessors for PhysicalSlot - long? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkInterfaceInternal.PhysicalSlot { get => this._physicalSlot; set { {_physicalSlot = value;} } } + long? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkInterfaceInternal.PhysicalSlot { get => this._physicalSlot; set { {_physicalSlot = value;} } } /// Internal Acessors for PortCount - long? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkInterfaceInternal.PortCount { get => this._portCount; set { {_portCount = value;} } } + long? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkInterfaceInternal.PortCount { get => this._portCount; set { {_portCount = value;} } } /// Internal Acessors for PortSpeed - long? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkInterfaceInternal.PortSpeed { get => this._portSpeed; set { {_portSpeed = value;} } } + long? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkInterfaceInternal.PortSpeed { get => this._portSpeed; set { {_portSpeed = value;} } } /// Internal Acessors for Vendor - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkInterfaceInternal.Vendor { get => this._vendor; set { {_vendor = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkInterfaceInternal.Vendor { get => this._vendor; set { {_vendor = value;} } } /// Backing field for property. private string _model; @@ -99,6 +99,9 @@ public partial interface INetworkInterface : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The partial address of Peripheral Component Interconnect (PCI).", SerializedName = @"address", PossibleTypes = new [] { typeof(string) })] @@ -107,14 +110,21 @@ public partial interface INetworkInterface : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The connection type of the device.", SerializedName = @"deviceConnectionType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.DeviceConnectionType) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.DeviceConnectionType? DeviceConnectionType { get; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("PCI")] + string DeviceConnectionType { get; } /// The model name of the device. [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The model name of the device.", SerializedName = @"model", PossibleTypes = new [] { typeof(string) })] @@ -123,6 +133,9 @@ public partial interface INetworkInterface : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The physical slot for this device.", SerializedName = @"physicalSlot", PossibleTypes = new [] { typeof(long) })] @@ -131,6 +144,9 @@ public partial interface INetworkInterface : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The number of ports on the device.", SerializedName = @"portCount", PossibleTypes = new [] { typeof(long) })] @@ -141,6 +157,9 @@ public partial interface INetworkInterface : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The maximum amount of data in gigabits that the line card transmits through a port at any given second.", SerializedName = @"portSpeed", PossibleTypes = new [] { typeof(long) })] @@ -149,6 +168,9 @@ public partial interface INetworkInterface : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The vendor name of the device.", SerializedName = @"vendor", PossibleTypes = new [] { typeof(string) })] @@ -162,7 +184,8 @@ internal partial interface INetworkInterfaceInternal /// The partial address of Peripheral Component Interconnect (PCI). string Address { get; set; } /// The connection type of the device. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.DeviceConnectionType? DeviceConnectionType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("PCI")] + string DeviceConnectionType { get; set; } /// The model name of the device. string Model { get; set; } /// The physical slot for this device. diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/NetworkInterface.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/NetworkInterface.json.cs similarity index 89% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/NetworkInterface.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/NetworkInterface.json.cs index a15dfc7f1f29..81d454f70d82 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/NetworkInterface.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/NetworkInterface.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class NetworkInterface partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkInterface. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkInterface. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkInterface. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkInterface. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkInterface FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkInterface FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new NetworkInterface(json) : null; } @@ -77,13 +77,13 @@ internal NetworkInterface(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtim { return; } - {_address = If( json?.PropertyT("address"), out var __jsonAddress) ? (string)__jsonAddress : (string)Address;} - {_deviceConnectionType = If( json?.PropertyT("deviceConnectionType"), out var __jsonDeviceConnectionType) ? (string)__jsonDeviceConnectionType : (string)DeviceConnectionType;} - {_model = If( json?.PropertyT("model"), out var __jsonModel) ? (string)__jsonModel : (string)Model;} - {_physicalSlot = If( json?.PropertyT("physicalSlot"), out var __jsonPhysicalSlot) ? (long?)__jsonPhysicalSlot : PhysicalSlot;} - {_portCount = If( json?.PropertyT("portCount"), out var __jsonPortCount) ? (long?)__jsonPortCount : PortCount;} - {_portSpeed = If( json?.PropertyT("portSpeed"), out var __jsonPortSpeed) ? (long?)__jsonPortSpeed : PortSpeed;} - {_vendor = If( json?.PropertyT("vendor"), out var __jsonVendor) ? (string)__jsonVendor : (string)Vendor;} + {_address = If( json?.PropertyT("address"), out var __jsonAddress) ? (string)__jsonAddress : (string)_address;} + {_deviceConnectionType = If( json?.PropertyT("deviceConnectionType"), out var __jsonDeviceConnectionType) ? (string)__jsonDeviceConnectionType : (string)_deviceConnectionType;} + {_model = If( json?.PropertyT("model"), out var __jsonModel) ? (string)__jsonModel : (string)_model;} + {_physicalSlot = If( json?.PropertyT("physicalSlot"), out var __jsonPhysicalSlot) ? (long?)__jsonPhysicalSlot : _physicalSlot;} + {_portCount = If( json?.PropertyT("portCount"), out var __jsonPortCount) ? (long?)__jsonPortCount : _portCount;} + {_portSpeed = If( json?.PropertyT("portSpeed"), out var __jsonPortSpeed) ? (long?)__jsonPortSpeed : _portSpeed;} + {_vendor = If( json?.PropertyT("vendor"), out var __jsonVendor) ? (string)__jsonVendor : (string)_vendor;} AfterFromJson(json); } @@ -106,31 +106,31 @@ public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode ToJ { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._address)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._address.ToString()) : null, "address" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._deviceConnectionType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._deviceConnectionType.ToString()) : null, "deviceConnectionType" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._model)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._model.ToString()) : null, "model" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != this._physicalSlot ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNumber((long)this._physicalSlot) : null, "physicalSlot" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != this._portCount ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNumber((long)this._portCount) : null, "portCount" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != this._portSpeed ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNumber((long)this._portSpeed) : null, "portSpeed" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._vendor)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._vendor.ToString()) : null, "vendor" ,container.Add ); } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Nic.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Nic.PowerShell.cs new file mode 100644 index 000000000000..570ec1a7025e --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Nic.PowerShell.cs @@ -0,0 +1,214 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + + /// + /// Type Deprecated. Will be removed in an upcoming version. Nic represents the network interface card details. + /// + [System.ComponentModel.TypeConverter(typeof(NicTypeConverter))] + public partial class Nic + { + + /// + /// 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.NetworkCloud.Models.INic DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new Nic(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.NetworkCloud.Models.INic DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new Nic(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.NetworkCloud.Models.INic FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal Nic(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("LldpNeighbor")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INicInternal)this).LldpNeighbor = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ILldpNeighbor) content.GetValueForProperty("LldpNeighbor",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INicInternal)this).LldpNeighbor, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.LldpNeighborTypeConverter.ConvertFrom); + } + if (content.Contains("MacAddress")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INicInternal)this).MacAddress = (string) content.GetValueForProperty("MacAddress",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INicInternal)this).MacAddress, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INicInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INicInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("LldpNeighborPortDescription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INicInternal)this).LldpNeighborPortDescription = (string) content.GetValueForProperty("LldpNeighborPortDescription",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INicInternal)this).LldpNeighborPortDescription, global::System.Convert.ToString); + } + if (content.Contains("LldpNeighborPortName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INicInternal)this).LldpNeighborPortName = (string) content.GetValueForProperty("LldpNeighborPortName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INicInternal)this).LldpNeighborPortName, global::System.Convert.ToString); + } + if (content.Contains("LldpNeighborSystemDescription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INicInternal)this).LldpNeighborSystemDescription = (string) content.GetValueForProperty("LldpNeighborSystemDescription",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INicInternal)this).LldpNeighborSystemDescription, global::System.Convert.ToString); + } + if (content.Contains("LldpNeighborSystemName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INicInternal)this).LldpNeighborSystemName = (string) content.GetValueForProperty("LldpNeighborSystemName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INicInternal)this).LldpNeighborSystemName, 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 Nic(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("LldpNeighbor")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INicInternal)this).LldpNeighbor = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ILldpNeighbor) content.GetValueForProperty("LldpNeighbor",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INicInternal)this).LldpNeighbor, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.LldpNeighborTypeConverter.ConvertFrom); + } + if (content.Contains("MacAddress")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INicInternal)this).MacAddress = (string) content.GetValueForProperty("MacAddress",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INicInternal)this).MacAddress, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INicInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INicInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("LldpNeighborPortDescription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INicInternal)this).LldpNeighborPortDescription = (string) content.GetValueForProperty("LldpNeighborPortDescription",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INicInternal)this).LldpNeighborPortDescription, global::System.Convert.ToString); + } + if (content.Contains("LldpNeighborPortName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INicInternal)this).LldpNeighborPortName = (string) content.GetValueForProperty("LldpNeighborPortName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INicInternal)this).LldpNeighborPortName, global::System.Convert.ToString); + } + if (content.Contains("LldpNeighborSystemDescription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INicInternal)this).LldpNeighborSystemDescription = (string) content.GetValueForProperty("LldpNeighborSystemDescription",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INicInternal)this).LldpNeighborSystemDescription, global::System.Convert.ToString); + } + if (content.Contains("LldpNeighborSystemName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INicInternal)this).LldpNeighborSystemName = (string) content.GetValueForProperty("LldpNeighborSystemName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INicInternal)this).LldpNeighborSystemName, 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.NetworkCloud.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(); + } + } + /// Type Deprecated. Will be removed in an upcoming version. Nic represents the network interface card details. + [System.ComponentModel.TypeConverter(typeof(NicTypeConverter))] + public partial interface INic + + { + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/Nic.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Nic.TypeConverter.cs similarity index 98% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/Nic.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Nic.TypeConverter.cs index d06e3033d5ee..79e9e079b9ee 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/Nic.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Nic.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.INic ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INic ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INic).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INic).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Nic.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Nic.cs new file mode 100644 index 000000000000..39ecacc9aff8 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Nic.cs @@ -0,0 +1,174 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + + /// + /// Type Deprecated. Will be removed in an upcoming version. Nic represents the network interface card details. + /// + public partial class Nic : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INic, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INicInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ILldpNeighbor _lldpNeighbor; + + /// The information about the device connected to this NIC. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ILldpNeighbor LldpNeighbor { get => (this._lldpNeighbor = this._lldpNeighbor ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.LldpNeighbor()); } + + /// The descriptive information about the port on the connected device. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string LldpNeighborPortDescription { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ILldpNeighborInternal)LldpNeighbor).PortDescription; } + + /// The system-assigned name of the port on the connected device. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string LldpNeighborPortName { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ILldpNeighborInternal)LldpNeighbor).PortName; } + + /// The descriptive information about the connected device. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string LldpNeighborSystemDescription { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ILldpNeighborInternal)LldpNeighbor).SystemDescription; } + + /// The system-assigned name of the connected device. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string LldpNeighborSystemName { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ILldpNeighborInternal)LldpNeighbor).SystemName; } + + /// Backing field for property. + private string _macAddress; + + /// The MAC address associated with this NIC. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string MacAddress { get => this._macAddress; } + + /// Internal Acessors for LldpNeighbor + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ILldpNeighbor Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INicInternal.LldpNeighbor { get => (this._lldpNeighbor = this._lldpNeighbor ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.LldpNeighbor()); set { {_lldpNeighbor = value;} } } + + /// Internal Acessors for LldpNeighborPortDescription + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INicInternal.LldpNeighborPortDescription { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ILldpNeighborInternal)LldpNeighbor).PortDescription; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ILldpNeighborInternal)LldpNeighbor).PortDescription = value ?? null; } + + /// Internal Acessors for LldpNeighborPortName + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INicInternal.LldpNeighborPortName { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ILldpNeighborInternal)LldpNeighbor).PortName; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ILldpNeighborInternal)LldpNeighbor).PortName = value ?? null; } + + /// Internal Acessors for LldpNeighborSystemDescription + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INicInternal.LldpNeighborSystemDescription { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ILldpNeighborInternal)LldpNeighbor).SystemDescription; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ILldpNeighborInternal)LldpNeighbor).SystemDescription = value ?? null; } + + /// Internal Acessors for LldpNeighborSystemName + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INicInternal.LldpNeighborSystemName { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ILldpNeighborInternal)LldpNeighbor).SystemName; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ILldpNeighborInternal)LldpNeighbor).SystemName = value ?? null; } + + /// Internal Acessors for MacAddress + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INicInternal.MacAddress { get => this._macAddress; set { {_macAddress = value;} } } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INicInternal.Name { get => this._name; set { {_name = value;} } } + + /// Backing field for property. + private string _name; + + /// The name of the NIC/interface. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string Name { get => this._name; } + + /// Creates an new instance. + public Nic() + { + + } + } + /// Type Deprecated. Will be removed in an upcoming version. Nic represents the network interface card details. + public partial interface INic : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable + { + /// The descriptive information about the port on the connected device. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The descriptive information about the port on the connected device.", + SerializedName = @"portDescription", + PossibleTypes = new [] { typeof(string) })] + string LldpNeighborPortDescription { get; } + /// The system-assigned name of the port on the connected device. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The system-assigned name of the port on the connected device.", + SerializedName = @"portName", + PossibleTypes = new [] { typeof(string) })] + string LldpNeighborPortName { get; } + /// The descriptive information about the connected device. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The descriptive information about the connected device.", + SerializedName = @"systemDescription", + PossibleTypes = new [] { typeof(string) })] + string LldpNeighborSystemDescription { get; } + /// The system-assigned name of the connected device. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The system-assigned name of the connected device.", + SerializedName = @"systemName", + PossibleTypes = new [] { typeof(string) })] + string LldpNeighborSystemName { get; } + /// The MAC address associated with this NIC. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The MAC address associated with this NIC.", + SerializedName = @"macAddress", + PossibleTypes = new [] { typeof(string) })] + string MacAddress { get; } + /// The name of the NIC/interface. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The name of the NIC/interface.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string Name { get; } + + } + /// Type Deprecated. Will be removed in an upcoming version. Nic represents the network interface card details. + internal partial interface INicInternal + + { + /// The information about the device connected to this NIC. + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ILldpNeighbor LldpNeighbor { get; set; } + /// The descriptive information about the port on the connected device. + string LldpNeighborPortDescription { get; set; } + /// The system-assigned name of the port on the connected device. + string LldpNeighborPortName { get; set; } + /// The descriptive information about the connected device. + string LldpNeighborSystemDescription { get; set; } + /// The system-assigned name of the connected device. + string LldpNeighborSystemName { get; set; } + /// The MAC address associated with this NIC. + string MacAddress { get; set; } + /// The name of the NIC/interface. + string Name { get; set; } + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/Nic.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Nic.json.cs similarity index 91% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/Nic.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Nic.json.cs index d633e5e68ee2..d8a12cfe58d0 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/Nic.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Nic.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -56,13 +56,11 @@ public partial class Nic partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INic. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INic. /// /// a to deserialize from. - /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INic. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INic FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INic. + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INic FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new Nic(json) : null; } @@ -79,9 +77,9 @@ internal Nic(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonOb { return; } - {_lldpNeighbor = If( json?.PropertyT("lldpNeighbor"), out var __jsonLldpNeighbor) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.LldpNeighbor.FromJson(__jsonLldpNeighbor) : LldpNeighbor;} - {_macAddress = If( json?.PropertyT("macAddress"), out var __jsonMacAddress) ? (string)__jsonMacAddress : (string)MacAddress;} - {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} + {_lldpNeighbor = If( json?.PropertyT("lldpNeighbor"), out var __jsonLldpNeighbor) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.LldpNeighbor.FromJson(__jsonLldpNeighbor) : _lldpNeighbor;} + {_macAddress = If( json?.PropertyT("macAddress"), out var __jsonMacAddress) ? (string)__jsonMacAddress : (string)_macAddress;} + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)_name;} AfterFromJson(json); } @@ -104,15 +102,15 @@ public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode ToJ { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != this._lldpNeighbor ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) this._lldpNeighbor.ToJson(null,serializationMode) : null, "lldpNeighbor" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._macAddress)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._macAddress.ToString()) : null, "macAddress" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/NodePoolAdministratorConfigurationPatch.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/NodePoolAdministratorConfigurationPatch.PowerShell.cs similarity index 79% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/NodePoolAdministratorConfigurationPatch.PowerShell.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/NodePoolAdministratorConfigurationPatch.PowerShell.cs index 326b0fcaee01..6f25ec9c4088 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/NodePoolAdministratorConfigurationPatch.PowerShell.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/NodePoolAdministratorConfigurationPatch.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; @@ -65,29 +65,29 @@ public partial class NodePoolAdministratorConfigurationPatch 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.NetworkCloud.Models.Api20250201.INodePoolAdministratorConfigurationPatch DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INodePoolAdministratorConfigurationPatch DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new NodePoolAdministratorConfigurationPatch(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.NetworkCloud.Models.Api20250201.INodePoolAdministratorConfigurationPatch DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INodePoolAdministratorConfigurationPatch DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new NodePoolAdministratorConfigurationPatch(content); } @@ -100,10 +100,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201 /// /// an instance of the model class. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INodePoolAdministratorConfigurationPatch FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INodePoolAdministratorConfigurationPatch FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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. @@ -118,13 +118,13 @@ internal NodePoolAdministratorConfigurationPatch(global::System.Collections.IDic // actually deserialize if (content.Contains("SshPublicKey")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INodePoolAdministratorConfigurationPatchInternal)this).SshPublicKey = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey[]) content.GetValueForProperty("SshPublicKey",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INodePoolAdministratorConfigurationPatchInternal)this).SshPublicKey, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.SshPublicKeyTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INodePoolAdministratorConfigurationPatchInternal)this).SshPublicKey = (System.Collections.Generic.List) content.GetValueForProperty("SshPublicKey",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INodePoolAdministratorConfigurationPatchInternal)this).SshPublicKey, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.SshPublicKeyTypeConverter.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. @@ -139,7 +139,7 @@ internal NodePoolAdministratorConfigurationPatch(global::System.Management.Autom // actually deserialize if (content.Contains("SshPublicKey")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INodePoolAdministratorConfigurationPatchInternal)this).SshPublicKey = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey[]) content.GetValueForProperty("SshPublicKey",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INodePoolAdministratorConfigurationPatchInternal)this).SshPublicKey, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.SshPublicKeyTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INodePoolAdministratorConfigurationPatchInternal)this).SshPublicKey = (System.Collections.Generic.List) content.GetValueForProperty("SshPublicKey",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INodePoolAdministratorConfigurationPatchInternal)this).SshPublicKey, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.SshPublicKeyTypeConverter.ConvertFrom)); } AfterDeserializePSObject(content); } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/NodePoolAdministratorConfigurationPatch.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/NodePoolAdministratorConfigurationPatch.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/NodePoolAdministratorConfigurationPatch.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/NodePoolAdministratorConfigurationPatch.TypeConverter.cs index 8642a597f542..7762627f9d16 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/NodePoolAdministratorConfigurationPatch.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/NodePoolAdministratorConfigurationPatch.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.INodePoolAdministratorConfigurationPatch ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INodePoolAdministratorConfigurationPatch ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INodePoolAdministratorConfigurationPatch).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INodePoolAdministratorConfigurationPatch).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/NodePoolAdministratorConfigurationPatch.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/NodePoolAdministratorConfigurationPatch.cs new file mode 100644 index 000000000000..458a3497b43b --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/NodePoolAdministratorConfigurationPatch.cs @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + + /// + /// NodePoolAdministratorConfigurationPatch represents the patching capabilities for the administrator configuration. + /// + public partial class NodePoolAdministratorConfigurationPatch : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INodePoolAdministratorConfigurationPatch, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INodePoolAdministratorConfigurationPatchInternal + { + + /// Backing field for property. + private System.Collections.Generic.List _sshPublicKey; + + /// + /// SshPublicKey represents the public key used to authenticate with a resource through SSH. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public System.Collections.Generic.List SshPublicKey { get => this._sshPublicKey; set => this._sshPublicKey = value; } + + /// Creates an new instance. + public NodePoolAdministratorConfigurationPatch() + { + + } + } + /// NodePoolAdministratorConfigurationPatch represents the patching capabilities for the administrator configuration. + public partial interface INodePoolAdministratorConfigurationPatch : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable + { + /// + /// SshPublicKey represents the public key used to authenticate with a resource through SSH. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"SshPublicKey represents the public key used to authenticate with a resource through SSH.", + SerializedName = @"sshPublicKeys", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISshPublicKey) })] + System.Collections.Generic.List SshPublicKey { get; set; } + + } + /// NodePoolAdministratorConfigurationPatch represents the patching capabilities for the administrator configuration. + internal partial interface INodePoolAdministratorConfigurationPatchInternal + + { + /// + /// SshPublicKey represents the public key used to authenticate with a resource through SSH. + /// + System.Collections.Generic.List SshPublicKey { get; set; } + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/NodePoolAdministratorConfigurationPatch.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/NodePoolAdministratorConfigurationPatch.json.cs similarity index 90% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/NodePoolAdministratorConfigurationPatch.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/NodePoolAdministratorConfigurationPatch.json.cs index 1c797781d741..b3efd8239997 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/NodePoolAdministratorConfigurationPatch.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/NodePoolAdministratorConfigurationPatch.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -56,13 +56,13 @@ public partial class NodePoolAdministratorConfigurationPatch partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INodePoolAdministratorConfigurationPatch. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INodePoolAdministratorConfigurationPatch. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INodePoolAdministratorConfigurationPatch. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INodePoolAdministratorConfigurationPatch. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INodePoolAdministratorConfigurationPatch FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INodePoolAdministratorConfigurationPatch FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new NodePoolAdministratorConfigurationPatch(json) : null; } @@ -79,7 +79,7 @@ internal NodePoolAdministratorConfigurationPatch(Microsoft.Azure.PowerShell.Cmdl { return; } - {_sshPublicKey = If( json?.PropertyT("sshPublicKeys"), out var __jsonSshPublicKeys) ? If( __jsonSshPublicKeys as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.ISshPublicKey) (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.SshPublicKey.FromJson(__u) )) ))() : null : SshPublicKey;} + {_sshPublicKey = If( json?.PropertyT("sshPublicKeys"), out var __jsonSshPublicKeys) ? If( __jsonSshPublicKeys as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.ISshPublicKey) (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.SshPublicKey.FromJson(__u) )) ))() : null : _sshPublicKey;} AfterFromJson(json); } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/OSDisk.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/OSDisk.PowerShell.cs new file mode 100644 index 000000000000..8a84942d037c --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/OSDisk.PowerShell.cs @@ -0,0 +1,180 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + + /// OsDisk represents configuration of the boot disk. + [System.ComponentModel.TypeConverter(typeof(OSDiskTypeConverter))] + public partial class OSDisk + { + + /// + /// 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.NetworkCloud.Models.IOSDisk DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new OSDisk(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.NetworkCloud.Models.IOSDisk DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new OSDisk(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.NetworkCloud.Models.IOSDisk FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal OSDisk(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("CreateOption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOSDiskInternal)this).CreateOption = (string) content.GetValueForProperty("CreateOption",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOSDiskInternal)this).CreateOption, global::System.Convert.ToString); + } + if (content.Contains("DeleteOption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOSDiskInternal)this).DeleteOption = (string) content.GetValueForProperty("DeleteOption",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOSDiskInternal)this).DeleteOption, global::System.Convert.ToString); + } + if (content.Contains("DiskSizeGb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOSDiskInternal)this).DiskSizeGb = (long) content.GetValueForProperty("DiskSizeGb",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOSDiskInternal)this).DiskSizeGb, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal OSDisk(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("CreateOption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOSDiskInternal)this).CreateOption = (string) content.GetValueForProperty("CreateOption",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOSDiskInternal)this).CreateOption, global::System.Convert.ToString); + } + if (content.Contains("DeleteOption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOSDiskInternal)this).DeleteOption = (string) content.GetValueForProperty("DeleteOption",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOSDiskInternal)this).DeleteOption, global::System.Convert.ToString); + } + if (content.Contains("DiskSizeGb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOSDiskInternal)this).DiskSizeGb = (long) content.GetValueForProperty("DiskSizeGb",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOSDiskInternal)this).DiskSizeGb, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + 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.NetworkCloud.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(); + } + } + /// OsDisk represents configuration of the boot disk. + [System.ComponentModel.TypeConverter(typeof(OSDiskTypeConverter))] + public partial interface IOSDisk + + { + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/OSDisk.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/OSDisk.TypeConverter.cs similarity index 98% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/OSDisk.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/OSDisk.TypeConverter.cs index c40e53cf7a1c..a6e61ed37df2 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/OSDisk.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/OSDisk.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IOSDisk ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOSDisk ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOSDisk).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOSDisk).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/OSDisk.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/OSDisk.cs new file mode 100644 index 000000000000..7d1128db953a --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/OSDisk.cs @@ -0,0 +1,104 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + + /// OsDisk represents configuration of the boot disk. + public partial class OSDisk : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOSDisk, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOSDiskInternal + { + + /// Backing field for property. + private string _createOption; + + /// The strategy for creating the OS disk. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string CreateOption { get => this._createOption; set => this._createOption = value; } + + /// Backing field for property. + private string _deleteOption; + + /// The strategy for deleting the OS disk. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string DeleteOption { get => this._deleteOption; set => this._deleteOption = value; } + + /// Backing field for property. + private long _diskSizeGb; + + /// + /// The size of the disk. Required if the createOption is Ephemeral. Allocations are measured in gibibytes. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public long DiskSizeGb { get => this._diskSizeGb; set => this._diskSizeGb = value; } + + /// Creates an new instance. + public OSDisk() + { + + } + } + /// OsDisk represents configuration of the boot disk. + public partial interface IOSDisk : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable + { + /// The strategy for creating the OS disk. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The strategy for creating the OS disk.", + SerializedName = @"createOption", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Ephemeral", "Persistent")] + string CreateOption { get; set; } + /// The strategy for deleting the OS disk. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The strategy for deleting the OS disk.", + SerializedName = @"deleteOption", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Delete")] + string DeleteOption { get; set; } + /// + /// The size of the disk. Required if the createOption is Ephemeral. Allocations are measured in gibibytes. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The size of the disk. Required if the createOption is Ephemeral. Allocations are measured in gibibytes.", + SerializedName = @"diskSizeGB", + PossibleTypes = new [] { typeof(long) })] + long DiskSizeGb { get; set; } + + } + /// OsDisk represents configuration of the boot disk. + internal partial interface IOSDiskInternal + + { + /// The strategy for creating the OS disk. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Ephemeral", "Persistent")] + string CreateOption { get; set; } + /// The strategy for deleting the OS disk. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Delete")] + string DeleteOption { get; set; } + /// + /// The size of the disk. Required if the createOption is Ephemeral. Allocations are measured in gibibytes. + /// + long DiskSizeGb { get; set; } + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/OSDisk.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/OSDisk.json.cs similarity index 93% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/OSDisk.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/OSDisk.json.cs index c64adf5ffb3a..883da300fa53 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/OSDisk.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/OSDisk.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -54,13 +54,11 @@ public partial class OSDisk partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOSDisk. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOSDisk. /// /// a to deserialize from. - /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOSDisk. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOSDisk FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOSDisk. + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOSDisk FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new OSDisk(json) : null; } @@ -77,9 +75,9 @@ internal OSDisk(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.Jso { return; } - {_createOption = If( json?.PropertyT("createOption"), out var __jsonCreateOption) ? (string)__jsonCreateOption : (string)CreateOption;} - {_deleteOption = If( json?.PropertyT("deleteOption"), out var __jsonDeleteOption) ? (string)__jsonDeleteOption : (string)DeleteOption;} - {_diskSizeGb = If( json?.PropertyT("diskSizeGB"), out var __jsonDiskSizeGb) ? (long)__jsonDiskSizeGb : DiskSizeGb;} + {_createOption = If( json?.PropertyT("createOption"), out var __jsonCreateOption) ? (string)__jsonCreateOption : (string)_createOption;} + {_deleteOption = If( json?.PropertyT("deleteOption"), out var __jsonDeleteOption) ? (string)__jsonDeleteOption : (string)_deleteOption;} + {_diskSizeGb = If( json?.PropertyT("diskSizeGB"), out var __jsonDiskSizeGb) ? (long)__jsonDiskSizeGb : _diskSizeGb;} AfterFromJson(json); } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Operation.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Operation.PowerShell.cs new file mode 100644 index 000000000000..ed1fdde0891a --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Operation.PowerShell.cs @@ -0,0 +1,230 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + + /// + /// Details of a REST API operation, returned from the Resource Provider Operations API + /// + [System.ComponentModel.TypeConverter(typeof(OperationTypeConverter))] + public partial class Operation + { + + /// + /// 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.NetworkCloud.Models.IOperation DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new Operation(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.NetworkCloud.Models.IOperation DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new Operation(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.NetworkCloud.Models.IOperation FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal Operation(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Display")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationInternal)this).Display = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationDisplay) content.GetValueForProperty("Display",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationInternal)this).Display, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.OperationDisplayTypeConverter.ConvertFrom); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("IsDataAction")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationInternal)this).IsDataAction = (bool?) content.GetValueForProperty("IsDataAction",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationInternal)this).IsDataAction, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("Origin")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationInternal)this).Origin = (string) content.GetValueForProperty("Origin",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationInternal)this).Origin, global::System.Convert.ToString); + } + if (content.Contains("ActionType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationInternal)this).ActionType = (string) content.GetValueForProperty("ActionType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationInternal)this).ActionType, global::System.Convert.ToString); + } + if (content.Contains("DisplayProvider")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationInternal)this).DisplayProvider = (string) content.GetValueForProperty("DisplayProvider",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationInternal)this).DisplayProvider, global::System.Convert.ToString); + } + if (content.Contains("DisplayResource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationInternal)this).DisplayResource = (string) content.GetValueForProperty("DisplayResource",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationInternal)this).DisplayResource, global::System.Convert.ToString); + } + if (content.Contains("DisplayOperation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationInternal)this).DisplayOperation = (string) content.GetValueForProperty("DisplayOperation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationInternal)this).DisplayOperation, global::System.Convert.ToString); + } + if (content.Contains("DisplayDescription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationInternal)this).DisplayDescription = (string) content.GetValueForProperty("DisplayDescription",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationInternal)this).DisplayDescription, 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 Operation(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Display")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationInternal)this).Display = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationDisplay) content.GetValueForProperty("Display",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationInternal)this).Display, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.OperationDisplayTypeConverter.ConvertFrom); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("IsDataAction")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationInternal)this).IsDataAction = (bool?) content.GetValueForProperty("IsDataAction",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationInternal)this).IsDataAction, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("Origin")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationInternal)this).Origin = (string) content.GetValueForProperty("Origin",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationInternal)this).Origin, global::System.Convert.ToString); + } + if (content.Contains("ActionType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationInternal)this).ActionType = (string) content.GetValueForProperty("ActionType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationInternal)this).ActionType, global::System.Convert.ToString); + } + if (content.Contains("DisplayProvider")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationInternal)this).DisplayProvider = (string) content.GetValueForProperty("DisplayProvider",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationInternal)this).DisplayProvider, global::System.Convert.ToString); + } + if (content.Contains("DisplayResource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationInternal)this).DisplayResource = (string) content.GetValueForProperty("DisplayResource",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationInternal)this).DisplayResource, global::System.Convert.ToString); + } + if (content.Contains("DisplayOperation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationInternal)this).DisplayOperation = (string) content.GetValueForProperty("DisplayOperation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationInternal)this).DisplayOperation, global::System.Convert.ToString); + } + if (content.Contains("DisplayDescription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationInternal)this).DisplayDescription = (string) content.GetValueForProperty("DisplayDescription",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationInternal)this).DisplayDescription, 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.NetworkCloud.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 a REST API operation, returned from the Resource Provider Operations API + [System.ComponentModel.TypeConverter(typeof(OperationTypeConverter))] + public partial interface IOperation + + { + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Operation.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Operation.TypeConverter.cs new file mode 100644 index 000000000000..e8a794031d42 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Operation.TypeConverter.cs @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class OperationTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperation ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperation).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return Operation.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return Operation.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return Operation.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Operation.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Operation.cs new file mode 100644 index 000000000000..5c8791570cf8 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Operation.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.NetworkCloud.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + + /// + /// Details of a REST API operation, returned from the Resource Provider Operations API + /// + public partial class Operation : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperation, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationInternal + { + + /// Backing field for property. + private string _actionType; + + /// + /// Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string ActionType { get => this._actionType; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationDisplay _display; + + /// Localized display information for this particular operation. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationDisplay Display { get => (this._display = this._display ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.OperationDisplay()); set => this._display = value; } + + /// + /// The short, localized friendly description of the operation; suitable for tool tips and detailed views. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string DisplayDescription { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationDisplayInternal)Display).Description; } + + /// + /// The concise, localized friendly name for the operation; suitable for dropdowns. E.g. "Create or Update Virtual Machine", + /// "Restart Virtual Machine". + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string DisplayOperation { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationDisplayInternal)Display).Operation; } + + /// + /// The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or "Microsoft Compute". + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string DisplayProvider { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationDisplayInternal)Display).Provider; } + + /// + /// The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or "Job Schedule Collections". + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string DisplayResource { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationDisplayInternal)Display).Resource; } + + /// Backing field for property. + private bool? _isDataAction; + + /// + /// Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for ARM/control-plane + /// operations. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public bool? IsDataAction { get => this._isDataAction; } + + /// Internal Acessors for ActionType + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationInternal.ActionType { get => this._actionType; set { {_actionType = value;} } } + + /// Internal Acessors for Display + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationDisplay Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationInternal.Display { get => (this._display = this._display ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.OperationDisplay()); set { {_display = value;} } } + + /// Internal Acessors for DisplayDescription + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationInternal.DisplayDescription { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationDisplayInternal)Display).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationDisplayInternal)Display).Description = value ?? null; } + + /// Internal Acessors for DisplayOperation + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationInternal.DisplayOperation { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationDisplayInternal)Display).Operation; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationDisplayInternal)Display).Operation = value ?? null; } + + /// Internal Acessors for DisplayProvider + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationInternal.DisplayProvider { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationDisplayInternal)Display).Provider; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationDisplayInternal)Display).Provider = value ?? null; } + + /// Internal Acessors for DisplayResource + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationInternal.DisplayResource { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationDisplayInternal)Display).Resource; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationDisplayInternal)Display).Resource = value ?? null; } + + /// Internal Acessors for IsDataAction + bool? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationInternal.IsDataAction { get => this._isDataAction; set { {_isDataAction = value;} } } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationInternal.Name { get => this._name; set { {_name = value;} } } + + /// Internal Acessors for Origin + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationInternal.Origin { get => this._origin; set { {_origin = value;} } } + + /// Backing field for property. + private string _name; + + /// + /// The name of the operation, as per Resource-Based Access Control (RBAC). Examples: "Microsoft.Compute/virtualMachines/write", + /// "Microsoft.Compute/virtualMachines/capture/action" + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string Name { get => this._name; } + + /// Backing field for property. + private string _origin; + + /// + /// The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is + /// "user,system" + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string Origin { get => this._origin; } + + /// Creates an new instance. + public Operation() + { + + } + } + /// Details of a REST API operation, returned from the Resource Provider Operations API + public partial interface IOperation : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable + { + /// + /// Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"Enum. Indicates the action type. ""Internal"" refers to actions that are for internal only APIs.", + SerializedName = @"actionType", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Internal")] + string ActionType { get; } + /// + /// The short, localized friendly description of the operation; suitable for tool tips and detailed views. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The short, localized friendly description of the operation; suitable for tool tips and detailed views.", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string DisplayDescription { get; } + /// + /// The concise, localized friendly name for the operation; suitable for dropdowns. E.g. "Create or Update Virtual Machine", + /// "Restart Virtual Machine". + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The concise, localized friendly name for the operation; suitable for dropdowns. E.g. ""Create or Update Virtual Machine"", ""Restart Virtual Machine"".", + SerializedName = @"operation", + PossibleTypes = new [] { typeof(string) })] + string DisplayOperation { get; } + /// + /// The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or "Microsoft Compute". + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The localized friendly form of the resource provider name, e.g. ""Microsoft Monitoring Insights"" or ""Microsoft Compute"".", + SerializedName = @"provider", + PossibleTypes = new [] { typeof(string) })] + string DisplayProvider { get; } + /// + /// The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or "Job Schedule Collections". + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The localized friendly name of the resource type related to this operation. E.g. ""Virtual Machines"" or ""Job Schedule Collections"".", + SerializedName = @"resource", + PossibleTypes = new [] { typeof(string) })] + string DisplayResource { get; } + /// + /// Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for ARM/control-plane + /// operations. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"Whether the operation applies to data-plane. This is ""true"" for data-plane operations and ""false"" for ARM/control-plane operations.", + SerializedName = @"isDataAction", + PossibleTypes = new [] { typeof(bool) })] + bool? IsDataAction { get; } + /// + /// The name of the operation, as per Resource-Based Access Control (RBAC). Examples: "Microsoft.Compute/virtualMachines/write", + /// "Microsoft.Compute/virtualMachines/capture/action" + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The name of the operation, as per Resource-Based Access Control (RBAC). Examples: ""Microsoft.Compute/virtualMachines/write"", ""Microsoft.Compute/virtualMachines/capture/action""", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string Name { get; } + /// + /// The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is + /// "user,system" + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is ""user,system""", + SerializedName = @"origin", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("user", "system", "user,system")] + string Origin { get; } + + } + /// Details of a REST API operation, returned from the Resource Provider Operations API + internal partial interface IOperationInternal + + { + /// + /// Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Internal")] + string ActionType { get; set; } + /// Localized display information for this particular operation. + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationDisplay Display { get; set; } + /// + /// The short, localized friendly description of the operation; suitable for tool tips and detailed views. + /// + string DisplayDescription { get; set; } + /// + /// The concise, localized friendly name for the operation; suitable for dropdowns. E.g. "Create or Update Virtual Machine", + /// "Restart Virtual Machine". + /// + string DisplayOperation { get; set; } + /// + /// The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or "Microsoft Compute". + /// + string DisplayProvider { get; set; } + /// + /// The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or "Job Schedule Collections". + /// + string DisplayResource { get; set; } + /// + /// Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for ARM/control-plane + /// operations. + /// + bool? IsDataAction { get; set; } + /// + /// The name of the operation, as per Resource-Based Access Control (RBAC). Examples: "Microsoft.Compute/virtualMachines/write", + /// "Microsoft.Compute/virtualMachines/capture/action" + /// + string Name { get; set; } + /// + /// The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is + /// "user,system" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("user", "system", "user,system")] + string Origin { get; set; } + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Operation.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Operation.json.cs new file mode 100644 index 000000000000..58a9626d07d2 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Operation.json.cs @@ -0,0 +1,130 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + + /// + /// Details of a REST API operation, returned from the Resource Provider Operations API + /// + public partial class Operation + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperation. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperation. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperation FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new Operation(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject instance to deserialize from. + internal Operation(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_display = If( json?.PropertyT("display"), out var __jsonDisplay) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.OperationDisplay.FromJson(__jsonDisplay) : _display;} + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)_name;} + {_isDataAction = If( json?.PropertyT("isDataAction"), out var __jsonIsDataAction) ? (bool?)__jsonIsDataAction : _isDataAction;} + {_origin = If( json?.PropertyT("origin"), out var __jsonOrigin) ? (string)__jsonOrigin : (string)_origin;} + {_actionType = If( json?.PropertyT("actionType"), out var __jsonActionType) ? (string)__jsonActionType : (string)_actionType;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._display ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) this._display.ToJson(null,serializationMode) : null, "display" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) + { + AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) + { + AddIf( null != this._isDataAction ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonBoolean((bool)this._isDataAction) : null, "isDataAction" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) + { + AddIf( null != (((object)this._origin)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._origin.ToString()) : null, "origin" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) + { + AddIf( null != (((object)this._actionType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._actionType.ToString()) : null, "actionType" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/OperationDisplay.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/OperationDisplay.PowerShell.cs new file mode 100644 index 000000000000..3677fc98e402 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/OperationDisplay.PowerShell.cs @@ -0,0 +1,188 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + + /// Localized display information for this particular operation. + [System.ComponentModel.TypeConverter(typeof(OperationDisplayTypeConverter))] + public partial class OperationDisplay + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationDisplay DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new OperationDisplay(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationDisplay DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new OperationDisplay(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationDisplay FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal OperationDisplay(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Provider")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationDisplayInternal)this).Provider = (string) content.GetValueForProperty("Provider",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationDisplayInternal)this).Provider, global::System.Convert.ToString); + } + if (content.Contains("Resource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationDisplayInternal)this).Resource = (string) content.GetValueForProperty("Resource",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationDisplayInternal)this).Resource, global::System.Convert.ToString); + } + if (content.Contains("Operation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationDisplayInternal)this).Operation = (string) content.GetValueForProperty("Operation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationDisplayInternal)this).Operation, global::System.Convert.ToString); + } + if (content.Contains("Description")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationDisplayInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationDisplayInternal)this).Description, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal OperationDisplay(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Provider")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationDisplayInternal)this).Provider = (string) content.GetValueForProperty("Provider",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationDisplayInternal)this).Provider, global::System.Convert.ToString); + } + if (content.Contains("Resource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationDisplayInternal)this).Resource = (string) content.GetValueForProperty("Resource",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationDisplayInternal)this).Resource, global::System.Convert.ToString); + } + if (content.Contains("Operation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationDisplayInternal)this).Operation = (string) content.GetValueForProperty("Operation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationDisplayInternal)this).Operation, global::System.Convert.ToString); + } + if (content.Contains("Description")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationDisplayInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationDisplayInternal)this).Description, 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.NetworkCloud.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(); + } + } + /// Localized display information for this particular operation. + [System.ComponentModel.TypeConverter(typeof(OperationDisplayTypeConverter))] + public partial interface IOperationDisplay + + { + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/OperationDisplay.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/OperationDisplay.TypeConverter.cs new file mode 100644 index 000000000000..62718247bec4 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/OperationDisplay.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class OperationDisplayTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationDisplay ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationDisplay).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return OperationDisplay.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return OperationDisplay.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return OperationDisplay.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/OperationDisplay.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/OperationDisplay.cs new file mode 100644 index 000000000000..72b9607cb9a0 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/OperationDisplay.cs @@ -0,0 +1,153 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + + /// Localized display information for this particular operation. + public partial class OperationDisplay : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationDisplay, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationDisplayInternal + { + + /// Backing field for property. + private string _description; + + /// + /// The short, localized friendly description of the operation; suitable for tool tips and detailed views. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string Description { get => this._description; } + + /// Internal Acessors for Description + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationDisplayInternal.Description { get => this._description; set { {_description = value;} } } + + /// Internal Acessors for Operation + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationDisplayInternal.Operation { get => this._operation; set { {_operation = value;} } } + + /// Internal Acessors for Provider + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationDisplayInternal.Provider { get => this._provider; set { {_provider = value;} } } + + /// Internal Acessors for Resource + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationDisplayInternal.Resource { get => this._resource; set { {_resource = value;} } } + + /// Backing field for property. + private string _operation; + + /// + /// The concise, localized friendly name for the operation; suitable for dropdowns. E.g. "Create or Update Virtual Machine", + /// "Restart Virtual Machine". + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string Operation { get => this._operation; } + + /// Backing field for property. + private string _provider; + + /// + /// The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or "Microsoft Compute". + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string Provider { get => this._provider; } + + /// Backing field for property. + private string _resource; + + /// + /// The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or "Job Schedule Collections". + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string Resource { get => this._resource; } + + /// Creates an new instance. + public OperationDisplay() + { + + } + } + /// Localized display information for this particular operation. + public partial interface IOperationDisplay : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable + { + /// + /// The short, localized friendly description of the operation; suitable for tool tips and detailed views. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The short, localized friendly description of the operation; suitable for tool tips and detailed views.", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string Description { get; } + /// + /// The concise, localized friendly name for the operation; suitable for dropdowns. E.g. "Create or Update Virtual Machine", + /// "Restart Virtual Machine". + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The concise, localized friendly name for the operation; suitable for dropdowns. E.g. ""Create or Update Virtual Machine"", ""Restart Virtual Machine"".", + SerializedName = @"operation", + PossibleTypes = new [] { typeof(string) })] + string Operation { get; } + /// + /// The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or "Microsoft Compute". + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The localized friendly form of the resource provider name, e.g. ""Microsoft Monitoring Insights"" or ""Microsoft Compute"".", + SerializedName = @"provider", + PossibleTypes = new [] { typeof(string) })] + string Provider { get; } + /// + /// The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or "Job Schedule Collections". + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The localized friendly name of the resource type related to this operation. E.g. ""Virtual Machines"" or ""Job Schedule Collections"".", + SerializedName = @"resource", + PossibleTypes = new [] { typeof(string) })] + string Resource { get; } + + } + /// Localized display information for this particular operation. + internal partial interface IOperationDisplayInternal + + { + /// + /// The short, localized friendly description of the operation; suitable for tool tips and detailed views. + /// + string Description { get; set; } + /// + /// The concise, localized friendly name for the operation; suitable for dropdowns. E.g. "Create or Update Virtual Machine", + /// "Restart Virtual Machine". + /// + string Operation { get; set; } + /// + /// The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or "Microsoft Compute". + /// + string Provider { get; set; } + /// + /// The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or "Job Schedule Collections". + /// + string Resource { get; set; } + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/OperationDisplay.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/OperationDisplay.json.cs new file mode 100644 index 000000000000..85896e467992 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/OperationDisplay.json.cs @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + + /// Localized display information for this particular operation. + public partial class OperationDisplay + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationDisplay. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationDisplay. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationDisplay FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new OperationDisplay(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject instance to deserialize from. + internal OperationDisplay(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_provider = If( json?.PropertyT("provider"), out var __jsonProvider) ? (string)__jsonProvider : (string)_provider;} + {_resource = If( json?.PropertyT("resource"), out var __jsonResource) ? (string)__jsonResource : (string)_resource;} + {_operation = If( json?.PropertyT("operation"), out var __jsonOperation) ? (string)__jsonOperation : (string)_operation;} + {_description = If( json?.PropertyT("description"), out var __jsonDescription) ? (string)__jsonDescription : (string)_description;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) + { + AddIf( null != (((object)this._provider)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._provider.ToString()) : null, "provider" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) + { + AddIf( null != (((object)this._resource)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._resource.ToString()) : null, "resource" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) + { + AddIf( null != (((object)this._operation)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._operation.ToString()) : null, "operation" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) + { + AddIf( null != (((object)this._description)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._description.ToString()) : null, "description" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/OperationListResult.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/OperationListResult.PowerShell.cs new file mode 100644 index 000000000000..0bb9245b80c0 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/OperationListResult.PowerShell.cs @@ -0,0 +1,176 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + + /// + /// A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of + /// results. + /// + [System.ComponentModel.TypeConverter(typeof(OperationListResultTypeConverter))] + public partial class OperationListResult + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationListResult DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new OperationListResult(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationListResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new OperationListResult(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationListResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal OperationListResult(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationListResultInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.OperationTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationListResultInternal)this).NextLink, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal OperationListResult(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationListResultInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.OperationTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationListResultInternal)this).NextLink, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } + } + /// A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of + /// results. + [System.ComponentModel.TypeConverter(typeof(OperationListResultTypeConverter))] + public partial interface IOperationListResult + + { + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/OperationListResult.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/OperationListResult.TypeConverter.cs new file mode 100644 index 000000000000..9caf1fab7eee --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/OperationListResult.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class OperationListResultTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationListResult ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationListResult).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return OperationListResult.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return OperationListResult.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return OperationListResult.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/OperationListResult.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/OperationListResult.cs new file mode 100644 index 000000000000..aaf974b78a54 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/OperationListResult.cs @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + + /// + /// A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of + /// results. + /// + public partial class OperationListResult : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationListResult, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationListResultInternal + { + + /// Internal Acessors for NextLink + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationListResultInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } + + /// Internal Acessors for Value + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationListResultInternal.Value { get => this._value; set { {_value = value;} } } + + /// Backing field for property. + private string _nextLink; + + /// URL to get the next set of operation list results (if there are any). + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; } + + /// Backing field for property. + private System.Collections.Generic.List _value; + + /// List of operations supported by the resource provider + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public System.Collections.Generic.List Value { get => this._value; } + + /// Creates an new instance. + public OperationListResult() + { + + } + } + /// A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of + /// results. + public partial interface IOperationListResult : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable + { + /// URL to get the next set of operation list results (if there are any). + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"URL to get the next set of operation list results (if there are any).", + SerializedName = @"nextLink", + PossibleTypes = new [] { typeof(string) })] + string NextLink { get; } + /// List of operations supported by the resource provider + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"List of operations supported by the resource provider", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperation) })] + System.Collections.Generic.List Value { get; } + + } + /// A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of + /// results. + internal partial interface IOperationListResultInternal + + { + /// URL to get the next set of operation list results (if there are any). + string NextLink { get; set; } + /// List of operations supported by the resource provider + System.Collections.Generic.List Value { get; set; } + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/OperationListResult.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/OperationListResult.json.cs new file mode 100644 index 000000000000..e73424312574 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/OperationListResult.json.cs @@ -0,0 +1,127 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + + /// + /// A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of + /// results. + /// + public partial class OperationListResult + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationListResult. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationListResult. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationListResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new OperationListResult(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject instance to deserialize from. + internal OperationListResult(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.IOperation) (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Operation.FromJson(__u) )) ))() : null : _value;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)_nextLink;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) + { + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) + { + AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/OperationStatusResult.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/OperationStatusResult.PowerShell.cs new file mode 100644 index 000000000000..3aef1826f995 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/OperationStatusResult.PowerShell.cs @@ -0,0 +1,308 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + + /// The current status of an async operation. + [System.ComponentModel.TypeConverter(typeof(OperationStatusResultTypeConverter))] + public partial class OperationStatusResult + { + + /// + /// 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.NetworkCloud.Models.IOperationStatusResult DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new OperationStatusResult(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.NetworkCloud.Models.IOperationStatusResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new OperationStatusResult(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.NetworkCloud.Models.IOperationStatusResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal OperationStatusResult(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationStatusResultInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IErrorDetail) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationStatusResultInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorDetailTypeConverter.ConvertFrom); + } + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationStatusResultInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationStatusResultProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationStatusResultInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.OperationStatusResultPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("EndTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationStatusResultInternal)this).EndTime = (global::System.DateTime?) content.GetValueForProperty("EndTime",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationStatusResultInternal)this).EndTime, (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.NetworkCloud.Models.IOperationStatusResultInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationStatusResultInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationStatusResultInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationStatusResultInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Operation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationStatusResultInternal)this).Operation = (System.Collections.Generic.List) content.GetValueForProperty("Operation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationStatusResultInternal)this).Operation, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.OperationStatusResultTypeConverter.ConvertFrom)); + } + if (content.Contains("PercentComplete")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationStatusResultInternal)this).PercentComplete = (float?) content.GetValueForProperty("PercentComplete",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationStatusResultInternal)this).PercentComplete, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("ResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationStatusResultInternal)this).ResourceId = (string) content.GetValueForProperty("ResourceId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationStatusResultInternal)this).ResourceId, global::System.Convert.ToString); + } + if (content.Contains("StartTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationStatusResultInternal)this).StartTime = (global::System.DateTime?) content.GetValueForProperty("StartTime",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationStatusResultInternal)this).StartTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationStatusResultInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationStatusResultInternal)this).Status, global::System.Convert.ToString); + } + if (content.Contains("Code")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationStatusResultInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationStatusResultInternal)this).Code, global::System.Convert.ToString); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationStatusResultInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationStatusResultInternal)this).Message, global::System.Convert.ToString); + } + if (content.Contains("Target")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationStatusResultInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationStatusResultInternal)this).Target, global::System.Convert.ToString); + } + if (content.Contains("Detail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationStatusResultInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationStatusResultInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorDetailTypeConverter.ConvertFrom)); + } + if (content.Contains("AdditionalInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationStatusResultInternal)this).AdditionalInfo = (System.Collections.Generic.List) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationStatusResultInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorAdditionalInfoTypeConverter.ConvertFrom)); + } + if (content.Contains("ExitCode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationStatusResultInternal)this).ExitCode = (string) content.GetValueForProperty("ExitCode",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationStatusResultInternal)this).ExitCode, global::System.Convert.ToString); + } + if (content.Contains("OutputHead")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationStatusResultInternal)this).OutputHead = (string) content.GetValueForProperty("OutputHead",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationStatusResultInternal)this).OutputHead, global::System.Convert.ToString); + } + if (content.Contains("ResultRef")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationStatusResultInternal)this).ResultRef = (string) content.GetValueForProperty("ResultRef",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationStatusResultInternal)this).ResultRef, global::System.Convert.ToString); + } + if (content.Contains("ResultUrl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationStatusResultInternal)this).ResultUrl = (string) content.GetValueForProperty("ResultUrl",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationStatusResultInternal)this).ResultUrl, 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 OperationStatusResult(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationStatusResultInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IErrorDetail) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationStatusResultInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorDetailTypeConverter.ConvertFrom); + } + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationStatusResultInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationStatusResultProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationStatusResultInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.OperationStatusResultPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("EndTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationStatusResultInternal)this).EndTime = (global::System.DateTime?) content.GetValueForProperty("EndTime",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationStatusResultInternal)this).EndTime, (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.NetworkCloud.Models.IOperationStatusResultInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationStatusResultInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationStatusResultInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationStatusResultInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Operation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationStatusResultInternal)this).Operation = (System.Collections.Generic.List) content.GetValueForProperty("Operation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationStatusResultInternal)this).Operation, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.OperationStatusResultTypeConverter.ConvertFrom)); + } + if (content.Contains("PercentComplete")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationStatusResultInternal)this).PercentComplete = (float?) content.GetValueForProperty("PercentComplete",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationStatusResultInternal)this).PercentComplete, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("ResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationStatusResultInternal)this).ResourceId = (string) content.GetValueForProperty("ResourceId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationStatusResultInternal)this).ResourceId, global::System.Convert.ToString); + } + if (content.Contains("StartTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationStatusResultInternal)this).StartTime = (global::System.DateTime?) content.GetValueForProperty("StartTime",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationStatusResultInternal)this).StartTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationStatusResultInternal)this).Status = (string) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationStatusResultInternal)this).Status, global::System.Convert.ToString); + } + if (content.Contains("Code")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationStatusResultInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationStatusResultInternal)this).Code, global::System.Convert.ToString); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationStatusResultInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationStatusResultInternal)this).Message, global::System.Convert.ToString); + } + if (content.Contains("Target")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationStatusResultInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationStatusResultInternal)this).Target, global::System.Convert.ToString); + } + if (content.Contains("Detail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationStatusResultInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationStatusResultInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorDetailTypeConverter.ConvertFrom)); + } + if (content.Contains("AdditionalInfo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationStatusResultInternal)this).AdditionalInfo = (System.Collections.Generic.List) content.GetValueForProperty("AdditionalInfo",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationStatusResultInternal)this).AdditionalInfo, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorAdditionalInfoTypeConverter.ConvertFrom)); + } + if (content.Contains("ExitCode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationStatusResultInternal)this).ExitCode = (string) content.GetValueForProperty("ExitCode",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationStatusResultInternal)this).ExitCode, global::System.Convert.ToString); + } + if (content.Contains("OutputHead")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationStatusResultInternal)this).OutputHead = (string) content.GetValueForProperty("OutputHead",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationStatusResultInternal)this).OutputHead, global::System.Convert.ToString); + } + if (content.Contains("ResultRef")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationStatusResultInternal)this).ResultRef = (string) content.GetValueForProperty("ResultRef",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationStatusResultInternal)this).ResultRef, global::System.Convert.ToString); + } + if (content.Contains("ResultUrl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationStatusResultInternal)this).ResultUrl = (string) content.GetValueForProperty("ResultUrl",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationStatusResultInternal)this).ResultUrl, 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.NetworkCloud.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 current status of an async operation. + [System.ComponentModel.TypeConverter(typeof(OperationStatusResultTypeConverter))] + public partial interface IOperationStatusResult + + { + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/OperationStatusResult.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/OperationStatusResult.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/OperationStatusResult.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/OperationStatusResult.TypeConverter.cs index 2742c897a496..a8e13595c27f 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/OperationStatusResult.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/OperationStatusResult.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IOperationStatusResult ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationStatusResult ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOperationStatusResult).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationStatusResult).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/OperationStatusResult.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/OperationStatusResult.cs new file mode 100644 index 000000000000..e2aebc432ed3 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/OperationStatusResult.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.NetworkCloud.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + + /// The current status of an async operation. + public partial class OperationStatusResult : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationStatusResult, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationStatusResultInternal + { + + /// The error additional info. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public System.Collections.Generic.List AdditionalInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IErrorDetailInternal)Error).AdditionalInfo; } + + /// The error code. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IErrorDetailInternal)Error).Code; } + + /// The error details. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public System.Collections.Generic.List Detail { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IErrorDetailInternal)Error).Detail; } + + /// Backing field for property. + private global::System.DateTime? _endTime; + + /// The end time of the operation. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public global::System.DateTime? EndTime { get => this._endTime; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IErrorDetail _error; + + /// If present, details of the operation error. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IErrorDetail Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorDetail()); } + + /// + /// For actions that run commands or scripts, the exit code of the script execution. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string ExitCode { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationStatusResultPropertiesInternal)Property).ExitCode; } + + /// Backing field for property. + private string _id; + + /// Fully qualified ID for the async operation. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string Id { get => this._id; } + + /// The error message. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IErrorDetailInternal)Error).Message; } + + /// Internal Acessors for AdditionalInfo + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationStatusResultInternal.AdditionalInfo { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IErrorDetailInternal)Error).AdditionalInfo; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IErrorDetailInternal)Error).AdditionalInfo = value ?? null /* arrayOf */; } + + /// Internal Acessors for Code + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationStatusResultInternal.Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IErrorDetailInternal)Error).Code; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IErrorDetailInternal)Error).Code = value ?? null; } + + /// Internal Acessors for Detail + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationStatusResultInternal.Detail { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IErrorDetailInternal)Error).Detail; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IErrorDetailInternal)Error).Detail = value ?? null /* arrayOf */; } + + /// Internal Acessors for EndTime + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationStatusResultInternal.EndTime { get => this._endTime; set { {_endTime = value;} } } + + /// Internal Acessors for Error + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IErrorDetail Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationStatusResultInternal.Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorDetail()); set { {_error = value;} } } + + /// Internal Acessors for ExitCode + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationStatusResultInternal.ExitCode { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationStatusResultPropertiesInternal)Property).ExitCode; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationStatusResultPropertiesInternal)Property).ExitCode = value ?? null; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationStatusResultInternal.Id { get => this._id; set { {_id = value;} } } + + /// Internal Acessors for Message + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationStatusResultInternal.Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IErrorDetailInternal)Error).Message; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IErrorDetailInternal)Error).Message = value ?? null; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationStatusResultInternal.Name { get => this._name; set { {_name = value;} } } + + /// Internal Acessors for Operation + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationStatusResultInternal.Operation { get => this._operation; set { {_operation = value;} } } + + /// Internal Acessors for OutputHead + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationStatusResultInternal.OutputHead { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationStatusResultPropertiesInternal)Property).OutputHead; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationStatusResultPropertiesInternal)Property).OutputHead = value ?? null; } + + /// Internal Acessors for PercentComplete + float? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationStatusResultInternal.PercentComplete { get => this._percentComplete; set { {_percentComplete = value;} } } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationStatusResultProperties Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationStatusResultInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.OperationStatusResultProperties()); set { {_property = value;} } } + + /// Internal Acessors for ResourceId + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationStatusResultInternal.ResourceId { get => this._resourceId; set { {_resourceId = value;} } } + + /// Internal Acessors for ResultRef + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationStatusResultInternal.ResultRef { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationStatusResultPropertiesInternal)Property).ResultRef; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationStatusResultPropertiesInternal)Property).ResultRef = value ?? null; } + + /// Internal Acessors for ResultUrl + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationStatusResultInternal.ResultUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationStatusResultPropertiesInternal)Property).ResultUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationStatusResultPropertiesInternal)Property).ResultUrl = value ?? null; } + + /// Internal Acessors for StartTime + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationStatusResultInternal.StartTime { get => this._startTime; set { {_startTime = value;} } } + + /// Internal Acessors for Target + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationStatusResultInternal.Target { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IErrorDetailInternal)Error).Target; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IErrorDetailInternal)Error).Target = value ?? null; } + + /// Backing field for property. + private string _name; + + /// Name of the async operation. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string Name { get => this._name; } + + /// Backing field for property. + private System.Collections.Generic.List _operation; + + /// The operations list. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public System.Collections.Generic.List Operation { get => this._operation; } + + /// + /// For actions that run commands or scripts, the leading bytes of the output of the script execution. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string OutputHead { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationStatusResultPropertiesInternal)Property).OutputHead; } + + /// Backing field for property. + private float? _percentComplete; + + /// Percent of the operation that is complete. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public float? PercentComplete { get => this._percentComplete; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationStatusResultProperties _property; + + /// The additional properties of the operation status result. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationStatusResultProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.OperationStatusResultProperties()); set => this._property = value; } + + /// Backing field for property. + private string _resourceId; + + /// + /// Fully qualified ID of the resource against which the original async operation was started. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string ResourceId { get => this._resourceId; } + + /// + /// For actions that run commands or scripts, a reference to the location of the result. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string ResultRef { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationStatusResultPropertiesInternal)Property).ResultRef; } + + /// + /// For actions that run commands or scripts, the URL where the full output of the script output can be retrieved. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string ResultUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationStatusResultPropertiesInternal)Property).ResultUrl; } + + /// Backing field for property. + private global::System.DateTime? _startTime; + + /// The start time of the operation. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public global::System.DateTime? StartTime { get => this._startTime; } + + /// Backing field for property. + private string _status; + + /// Operation status. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string Status { get => this._status; set => this._status = value; } + + /// The error target. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string Target { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IErrorDetailInternal)Error).Target; } + + /// Creates an new instance. + public OperationStatusResult() + { + + } + } + /// The current status of an async operation. + public partial interface IOperationStatusResult : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable + { + /// The error additional info. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The error additional info.", + SerializedName = @"additionalInfo", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IErrorAdditionalInfo) })] + System.Collections.Generic.List AdditionalInfo { get; } + /// The error code. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The error code.", + SerializedName = @"code", + PossibleTypes = new [] { typeof(string) })] + string Code { get; } + /// The error details. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The error details.", + SerializedName = @"details", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IErrorDetail) })] + System.Collections.Generic.List Detail { get; } + /// The end time of the operation. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The end time of the operation.", + SerializedName = @"endTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? EndTime { get; } + /// + /// For actions that run commands or scripts, the exit code of the script execution. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"For actions that run commands or scripts, the exit code of the script execution.", + SerializedName = @"exitCode", + PossibleTypes = new [] { typeof(string) })] + string ExitCode { get; } + /// Fully qualified ID for the async operation. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"Fully qualified ID for the async operation.", + SerializedName = @"id", + PossibleTypes = new [] { typeof(string) })] + string Id { get; } + /// The error message. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The error message.", + SerializedName = @"message", + PossibleTypes = new [] { typeof(string) })] + string Message { get; } + /// Name of the async operation. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"Name of the async operation.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string Name { get; } + /// The operations list. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The operations list.", + SerializedName = @"operations", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationStatusResult) })] + System.Collections.Generic.List Operation { get; } + /// + /// For actions that run commands or scripts, the leading bytes of the output of the script execution. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"For actions that run commands or scripts, the leading bytes of the output of the script execution.", + SerializedName = @"outputHead", + PossibleTypes = new [] { typeof(string) })] + string OutputHead { get; } + /// Percent of the operation that is complete. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"Percent of the operation that is complete.", + SerializedName = @"percentComplete", + PossibleTypes = new [] { typeof(float) })] + float? PercentComplete { get; } + /// + /// Fully qualified ID of the resource against which the original async operation was started. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"Fully qualified ID of the resource against which the original async operation was started.", + SerializedName = @"resourceId", + PossibleTypes = new [] { typeof(string) })] + string ResourceId { get; } + /// + /// For actions that run commands or scripts, a reference to the location of the result. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"For actions that run commands or scripts, a reference to the location of the result.", + SerializedName = @"resultRef", + PossibleTypes = new [] { typeof(string) })] + string ResultRef { get; } + /// + /// For actions that run commands or scripts, the URL where the full output of the script output can be retrieved. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"For actions that run commands or scripts, the URL where the full output of the script output can be retrieved.", + SerializedName = @"resultUrl", + PossibleTypes = new [] { typeof(string) })] + string ResultUrl { get; } + /// The start time of the operation. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The start time of the operation.", + SerializedName = @"startTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? StartTime { get; } + /// Operation status. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"Operation status.", + SerializedName = @"status", + PossibleTypes = new [] { typeof(string) })] + string Status { get; set; } + /// The error target. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The error target.", + SerializedName = @"target", + PossibleTypes = new [] { typeof(string) })] + string Target { get; } + + } + /// The current status of an async operation. + internal partial interface IOperationStatusResultInternal + + { + /// The error additional info. + System.Collections.Generic.List AdditionalInfo { get; set; } + /// The error code. + string Code { get; set; } + /// The error details. + System.Collections.Generic.List Detail { get; set; } + /// The end time of the operation. + global::System.DateTime? EndTime { get; set; } + /// If present, details of the operation error. + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IErrorDetail Error { get; set; } + /// + /// For actions that run commands or scripts, the exit code of the script execution. + /// + string ExitCode { get; set; } + /// Fully qualified ID for the async operation. + string Id { get; set; } + /// The error message. + string Message { get; set; } + /// Name of the async operation. + string Name { get; set; } + /// The operations list. + System.Collections.Generic.List Operation { get; set; } + /// + /// For actions that run commands or scripts, the leading bytes of the output of the script execution. + /// + string OutputHead { get; set; } + /// Percent of the operation that is complete. + float? PercentComplete { get; set; } + /// The additional properties of the operation status result. + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationStatusResultProperties Property { get; set; } + /// + /// Fully qualified ID of the resource against which the original async operation was started. + /// + string ResourceId { get; set; } + /// + /// For actions that run commands or scripts, a reference to the location of the result. + /// + string ResultRef { get; set; } + /// + /// For actions that run commands or scripts, the URL where the full output of the script output can be retrieved. + /// + string ResultUrl { get; set; } + /// The start time of the operation. + global::System.DateTime? StartTime { get; set; } + /// Operation status. + string Status { get; set; } + /// The error target. + string Target { get; set; } + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/OperationStatusResult.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/OperationStatusResult.json.cs similarity index 86% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/OperationStatusResult.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/OperationStatusResult.json.cs index 0444837148fc..4c5e71893268 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/OperationStatusResult.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/OperationStatusResult.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class OperationStatusResult partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOperationStatusResult. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationStatusResult. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOperationStatusResult. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationStatusResult. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOperationStatusResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationStatusResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new OperationStatusResult(json) : null; } @@ -77,16 +77,16 @@ internal OperationStatusResult(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.R { return; } - {_error = If( json?.PropertyT("error"), out var __jsonError) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ErrorDetail.FromJson(__jsonError) : Error;} - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.OperationStatusResultProperties.FromJson(__jsonProperties) : Property;} - {_endTime = If( json?.PropertyT("endTime"), out var __jsonEndTime) ? global::System.DateTime.TryParse((string)__jsonEndTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonEndTimeValue) ? __jsonEndTimeValue : EndTime : EndTime;} - {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} - {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} - {_operation = If( json?.PropertyT("operations"), out var __jsonOperations) ? If( __jsonOperations as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IOperationStatusResult) (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.OperationStatusResult.FromJson(__u) )) ))() : null : Operation;} - {_percentComplete = If( json?.PropertyT("percentComplete"), out var __jsonPercentComplete) ? (float?)__jsonPercentComplete : PercentComplete;} - {_resourceId = If( json?.PropertyT("resourceId"), out var __jsonResourceId) ? (string)__jsonResourceId : (string)ResourceId;} - {_startTime = If( json?.PropertyT("startTime"), out var __jsonStartTime) ? global::System.DateTime.TryParse((string)__jsonStartTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonStartTimeValue) ? __jsonStartTimeValue : StartTime : StartTime;} - {_status = If( json?.PropertyT("status"), out var __jsonStatus) ? (string)__jsonStatus : (string)Status;} + {_error = If( json?.PropertyT("error"), out var __jsonError) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorDetail.FromJson(__jsonError) : _error;} + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.OperationStatusResultProperties.FromJson(__jsonProperties) : _property;} + {_endTime = If( json?.PropertyT("endTime"), out var __jsonEndTime) ? global::System.DateTime.TryParse((string)__jsonEndTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonEndTimeValue) ? __jsonEndTimeValue : _endTime : _endTime;} + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)_id;} + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)_name;} + {_operation = If( json?.PropertyT("operations"), out var __jsonOperations) ? If( __jsonOperations as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.IOperationStatusResult) (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.OperationStatusResult.FromJson(__u) )) ))() : null : _operation;} + {_percentComplete = If( json?.PropertyT("percentComplete"), out var __jsonPercentComplete) ? (float?)__jsonPercentComplete : _percentComplete;} + {_resourceId = If( json?.PropertyT("resourceId"), out var __jsonResourceId) ? (string)__jsonResourceId : (string)_resourceId;} + {_startTime = If( json?.PropertyT("startTime"), out var __jsonStartTime) ? global::System.DateTime.TryParse((string)__jsonStartTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonStartTimeValue) ? __jsonStartTimeValue : _startTime : _startTime;} + {_status = If( json?.PropertyT("status"), out var __jsonStatus) ? (string)__jsonStatus : (string)_status;} AfterFromJson(json); } @@ -109,24 +109,24 @@ public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode ToJ { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != this._error ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) this._error.ToJson(null,serializationMode) : null, "error" ,container.Add ); } AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != this._endTime ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._endTime?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "endTime" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { if (null != this._operation) { @@ -138,15 +138,15 @@ public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode ToJ container.Add("operations",__w); } } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != this._percentComplete ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNumber((float)this._percentComplete) : null, "percentComplete" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._resourceId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._resourceId.ToString()) : null, "resourceId" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != this._startTime ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._startTime?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "startTime" ,container.Add ); } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/OperationStatusResultProperties.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/OperationStatusResultProperties.PowerShell.cs new file mode 100644 index 000000000000..2ff0b338f56a --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/OperationStatusResultProperties.PowerShell.cs @@ -0,0 +1,190 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + + /// + /// OperationStatusResultProperties represents additional properties of the operation status result. + /// + [System.ComponentModel.TypeConverter(typeof(OperationStatusResultPropertiesTypeConverter))] + public partial class OperationStatusResultProperties + { + + /// + /// 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.NetworkCloud.Models.IOperationStatusResultProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new OperationStatusResultProperties(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.NetworkCloud.Models.IOperationStatusResultProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new OperationStatusResultProperties(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.NetworkCloud.Models.IOperationStatusResultProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal OperationStatusResultProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ExitCode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationStatusResultPropertiesInternal)this).ExitCode = (string) content.GetValueForProperty("ExitCode",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationStatusResultPropertiesInternal)this).ExitCode, global::System.Convert.ToString); + } + if (content.Contains("OutputHead")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationStatusResultPropertiesInternal)this).OutputHead = (string) content.GetValueForProperty("OutputHead",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationStatusResultPropertiesInternal)this).OutputHead, global::System.Convert.ToString); + } + if (content.Contains("ResultRef")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationStatusResultPropertiesInternal)this).ResultRef = (string) content.GetValueForProperty("ResultRef",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationStatusResultPropertiesInternal)this).ResultRef, global::System.Convert.ToString); + } + if (content.Contains("ResultUrl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationStatusResultPropertiesInternal)this).ResultUrl = (string) content.GetValueForProperty("ResultUrl",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationStatusResultPropertiesInternal)this).ResultUrl, 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 OperationStatusResultProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ExitCode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationStatusResultPropertiesInternal)this).ExitCode = (string) content.GetValueForProperty("ExitCode",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationStatusResultPropertiesInternal)this).ExitCode, global::System.Convert.ToString); + } + if (content.Contains("OutputHead")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationStatusResultPropertiesInternal)this).OutputHead = (string) content.GetValueForProperty("OutputHead",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationStatusResultPropertiesInternal)this).OutputHead, global::System.Convert.ToString); + } + if (content.Contains("ResultRef")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationStatusResultPropertiesInternal)this).ResultRef = (string) content.GetValueForProperty("ResultRef",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationStatusResultPropertiesInternal)this).ResultRef, global::System.Convert.ToString); + } + if (content.Contains("ResultUrl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationStatusResultPropertiesInternal)this).ResultUrl = (string) content.GetValueForProperty("ResultUrl",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationStatusResultPropertiesInternal)this).ResultUrl, 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.NetworkCloud.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(); + } + } + /// OperationStatusResultProperties represents additional properties of the operation status result. + [System.ComponentModel.TypeConverter(typeof(OperationStatusResultPropertiesTypeConverter))] + public partial interface IOperationStatusResultProperties + + { + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/OperationStatusResultProperties.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/OperationStatusResultProperties.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/OperationStatusResultProperties.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/OperationStatusResultProperties.TypeConverter.cs index 7bfb6206821b..f86ea595a577 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/OperationStatusResultProperties.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/OperationStatusResultProperties.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IOperationStatusResultProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationStatusResultProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOperationStatusResultProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationStatusResultProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/OperationStatusResultProperties.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/OperationStatusResultProperties.cs similarity index 87% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/OperationStatusResultProperties.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/OperationStatusResultProperties.cs index f3fa1a438844..eae951519e30 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/OperationStatusResultProperties.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/OperationStatusResultProperties.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -11,8 +11,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201 /// OperationStatusResultProperties represents additional properties of the operation status result. /// public partial class OperationStatusResultProperties : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOperationStatusResultProperties, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOperationStatusResultPropertiesInternal + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationStatusResultProperties, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationStatusResultPropertiesInternal { /// Backing field for property. @@ -25,16 +25,16 @@ public partial class OperationStatusResultProperties : public string ExitCode { get => this._exitCode; } /// Internal Acessors for ExitCode - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOperationStatusResultPropertiesInternal.ExitCode { get => this._exitCode; set { {_exitCode = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationStatusResultPropertiesInternal.ExitCode { get => this._exitCode; set { {_exitCode = value;} } } /// Internal Acessors for OutputHead - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOperationStatusResultPropertiesInternal.OutputHead { get => this._outputHead; set { {_outputHead = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationStatusResultPropertiesInternal.OutputHead { get => this._outputHead; set { {_outputHead = value;} } } /// Internal Acessors for ResultRef - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOperationStatusResultPropertiesInternal.ResultRef { get => this._resultRef; set { {_resultRef = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationStatusResultPropertiesInternal.ResultRef { get => this._resultRef; set { {_resultRef = value;} } } /// Internal Acessors for ResultUrl - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOperationStatusResultPropertiesInternal.ResultUrl { get => this._resultUrl; set { {_resultUrl = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationStatusResultPropertiesInternal.ResultUrl { get => this._resultUrl; set { {_resultUrl = value;} } } /// Backing field for property. private string _outputHead; @@ -79,6 +79,9 @@ public partial interface IOperationStatusResultProperties : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"For actions that run commands or scripts, the exit code of the script execution.", SerializedName = @"exitCode", PossibleTypes = new [] { typeof(string) })] @@ -89,6 +92,9 @@ public partial interface IOperationStatusResultProperties : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"For actions that run commands or scripts, the leading bytes of the output of the script execution.", SerializedName = @"outputHead", PossibleTypes = new [] { typeof(string) })] @@ -99,6 +105,9 @@ public partial interface IOperationStatusResultProperties : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"For actions that run commands or scripts, a reference to the location of the result.", SerializedName = @"resultRef", PossibleTypes = new [] { typeof(string) })] @@ -109,6 +118,9 @@ public partial interface IOperationStatusResultProperties : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"For actions that run commands or scripts, the URL where the full output of the script output can be retrieved.", SerializedName = @"resultUrl", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/OperationStatusResultProperties.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/OperationStatusResultProperties.json.cs similarity index 92% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/OperationStatusResultProperties.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/OperationStatusResultProperties.json.cs index 98847387fc46..7c79f4e5bcd5 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/OperationStatusResultProperties.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/OperationStatusResultProperties.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -56,13 +56,13 @@ public partial class OperationStatusResultProperties partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOperationStatusResultProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationStatusResultProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOperationStatusResultProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationStatusResultProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IOperationStatusResultProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperationStatusResultProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new OperationStatusResultProperties(json) : null; } @@ -79,10 +79,10 @@ internal OperationStatusResultProperties(Microsoft.Azure.PowerShell.Cmdlets.Netw { return; } - {_exitCode = If( json?.PropertyT("exitCode"), out var __jsonExitCode) ? (string)__jsonExitCode : (string)ExitCode;} - {_outputHead = If( json?.PropertyT("outputHead"), out var __jsonOutputHead) ? (string)__jsonOutputHead : (string)OutputHead;} - {_resultRef = If( json?.PropertyT("resultRef"), out var __jsonResultRef) ? (string)__jsonResultRef : (string)ResultRef;} - {_resultUrl = If( json?.PropertyT("resultUrl"), out var __jsonResultUrl) ? (string)__jsonResultUrl : (string)ResultUrl;} + {_exitCode = If( json?.PropertyT("exitCode"), out var __jsonExitCode) ? (string)__jsonExitCode : (string)_exitCode;} + {_outputHead = If( json?.PropertyT("outputHead"), out var __jsonOutputHead) ? (string)__jsonOutputHead : (string)_outputHead;} + {_resultRef = If( json?.PropertyT("resultRef"), out var __jsonResultRef) ? (string)__jsonResultRef : (string)_resultRef;} + {_resultUrl = If( json?.PropertyT("resultUrl"), out var __jsonResultUrl) ? (string)__jsonResultUrl : (string)_resultUrl;} AfterFromJson(json); } @@ -105,19 +105,19 @@ public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode ToJ { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._exitCode)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._exitCode.ToString()) : null, "exitCode" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._outputHead)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._outputHead.ToString()) : null, "outputHead" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._resultRef)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._resultRef.ToString()) : null, "resultRef" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._resultUrl)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._resultUrl.ToString()) : null, "resultUrl" ,container.Add ); } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Rack.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Rack.PowerShell.cs new file mode 100644 index 000000000000..d5d60f53764f --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Rack.PowerShell.cs @@ -0,0 +1,358 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + + /// + /// Rack represents the hardware of the rack and is dependent upon the cluster for lifecycle. + /// + [System.ComponentModel.TypeConverter(typeof(RackTypeConverter))] + public partial class Rack + { + + /// + /// 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.NetworkCloud.Models.IRack DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new Rack(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.NetworkCloud.Models.IRack DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new Rack(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.NetworkCloud.Models.IRack FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal Rack(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ExtendedLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackInternal)this).ExtendedLocation = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocation) content.GetValueForProperty("ExtendedLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackInternal)this).ExtendedLocation, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ExtendedLocationTypeConverter.ConvertFrom); + } + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.RackPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Etag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackInternal)this).Etag, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)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("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedByType = (string) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedByType = (string) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.TrackedResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("ExtendedLocationName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackInternal)this).ExtendedLocationName = (string) content.GetValueForProperty("ExtendedLocationName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackInternal)this).ExtendedLocationName, global::System.Convert.ToString); + } + if (content.Contains("ExtendedLocationType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackInternal)this).ExtendedLocationType = (string) content.GetValueForProperty("ExtendedLocationType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackInternal)this).ExtendedLocationType, global::System.Convert.ToString); + } + if (content.Contains("AvailabilityZone")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackInternal)this).AvailabilityZone = (string) content.GetValueForProperty("AvailabilityZone",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackInternal)this).AvailabilityZone, global::System.Convert.ToString); + } + if (content.Contains("ClusterId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackInternal)this).ClusterId = (string) content.GetValueForProperty("ClusterId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackInternal)this).ClusterId, global::System.Convert.ToString); + } + if (content.Contains("DetailedStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackInternal)this).DetailedStatus = (string) content.GetValueForProperty("DetailedStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackInternal)this).DetailedStatus, global::System.Convert.ToString); + } + if (content.Contains("DetailedStatusMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackInternal)this).DetailedStatusMessage = (string) content.GetValueForProperty("DetailedStatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackInternal)this).DetailedStatusMessage, global::System.Convert.ToString); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("RackLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackInternal)this).RackLocation = (string) content.GetValueForProperty("RackLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackInternal)this).RackLocation, global::System.Convert.ToString); + } + if (content.Contains("SerialNumber")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackInternal)this).SerialNumber = (string) content.GetValueForProperty("SerialNumber",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackInternal)this).SerialNumber, global::System.Convert.ToString); + } + if (content.Contains("SkuId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackInternal)this).SkuId = (string) content.GetValueForProperty("SkuId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackInternal)this).SkuId, 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 Rack(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ExtendedLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackInternal)this).ExtendedLocation = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocation) content.GetValueForProperty("ExtendedLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackInternal)this).ExtendedLocation, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ExtendedLocationTypeConverter.ConvertFrom); + } + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.RackPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Etag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackInternal)this).Etag, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)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("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedByType = (string) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedByType = (string) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.TrackedResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("ExtendedLocationName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackInternal)this).ExtendedLocationName = (string) content.GetValueForProperty("ExtendedLocationName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackInternal)this).ExtendedLocationName, global::System.Convert.ToString); + } + if (content.Contains("ExtendedLocationType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackInternal)this).ExtendedLocationType = (string) content.GetValueForProperty("ExtendedLocationType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackInternal)this).ExtendedLocationType, global::System.Convert.ToString); + } + if (content.Contains("AvailabilityZone")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackInternal)this).AvailabilityZone = (string) content.GetValueForProperty("AvailabilityZone",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackInternal)this).AvailabilityZone, global::System.Convert.ToString); + } + if (content.Contains("ClusterId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackInternal)this).ClusterId = (string) content.GetValueForProperty("ClusterId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackInternal)this).ClusterId, global::System.Convert.ToString); + } + if (content.Contains("DetailedStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackInternal)this).DetailedStatus = (string) content.GetValueForProperty("DetailedStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackInternal)this).DetailedStatus, global::System.Convert.ToString); + } + if (content.Contains("DetailedStatusMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackInternal)this).DetailedStatusMessage = (string) content.GetValueForProperty("DetailedStatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackInternal)this).DetailedStatusMessage, global::System.Convert.ToString); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("RackLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackInternal)this).RackLocation = (string) content.GetValueForProperty("RackLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackInternal)this).RackLocation, global::System.Convert.ToString); + } + if (content.Contains("SerialNumber")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackInternal)this).SerialNumber = (string) content.GetValueForProperty("SerialNumber",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackInternal)this).SerialNumber, global::System.Convert.ToString); + } + if (content.Contains("SkuId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackInternal)this).SkuId = (string) content.GetValueForProperty("SkuId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackInternal)this).SkuId, 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.NetworkCloud.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(); + } + } + /// Rack represents the hardware of the rack and is dependent upon the cluster for lifecycle. + [System.ComponentModel.TypeConverter(typeof(RackTypeConverter))] + public partial interface IRack + + { + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/Rack.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Rack.TypeConverter.cs similarity index 98% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/Rack.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Rack.TypeConverter.cs index 63187b20f3c8..940f253eb04b 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/Rack.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Rack.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IRack ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRack ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRack).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRack).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Rack.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Rack.cs new file mode 100644 index 000000000000..321592a0a4cd --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Rack.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.NetworkCloud.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + + /// + /// Rack represents the hardware of the rack and is dependent upon the cluster for lifecycle. + /// + public partial class Rack : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRack, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackInternal, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResource __trackedResource = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.TrackedResource(); + + /// + /// The value that will be used for machines in this rack to represent the availability zones that can be referenced by Hybrid + /// AKS Clusters for node arrangement. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string AvailabilityZone { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackPropertiesInternal)Property).AvailabilityZone; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackPropertiesInternal)Property).AvailabilityZone = value ; } + + /// + /// The resource ID of the cluster the rack is created for. This value is set when the rack is created by the cluster. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string ClusterId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackPropertiesInternal)Property).ClusterId; } + + /// The more detailed status of the rack. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string DetailedStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackPropertiesInternal)Property).DetailedStatus; } + + /// The descriptive message about the current detailed status. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string DetailedStatusMessage { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackPropertiesInternal)Property).DetailedStatusMessage; } + + /// Backing field for property. + private string _etag; + + /// Resource ETag. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string Etag { get => this._etag; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocation _extendedLocation; + + /// The extended location of the cluster associated with the resource. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocation ExtendedLocation { get => (this._extendedLocation = this._extendedLocation ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ExtendedLocation()); set => this._extendedLocation = value; } + + /// The resource ID of the extended location on which the resource will be created. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string ExtendedLocationName { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocationInternal)ExtendedLocation).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocationInternal)ExtendedLocation).Name = value ?? null; } + + /// The extended location type, for example, CustomLocation. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string ExtendedLocationType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocationInternal)ExtendedLocation).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocationInternal)ExtendedLocation).Type = value ?? null; } + + /// + /// Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).Id; } + + /// The geo-location where the resource lives + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)__trackedResource).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)__trackedResource).Location = value ?? null; } + + /// Internal Acessors for ClusterId + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackInternal.ClusterId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackPropertiesInternal)Property).ClusterId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackPropertiesInternal)Property).ClusterId = value ?? null; } + + /// Internal Acessors for DetailedStatus + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackInternal.DetailedStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackPropertiesInternal)Property).DetailedStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackPropertiesInternal)Property).DetailedStatus = value ?? null; } + + /// Internal Acessors for DetailedStatusMessage + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackInternal.DetailedStatusMessage { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackPropertiesInternal)Property).DetailedStatusMessage; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackPropertiesInternal)Property).DetailedStatusMessage = value ?? null; } + + /// Internal Acessors for Etag + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackInternal.Etag { get => this._etag; set { {_etag = value;} } } + + /// Internal Acessors for ExtendedLocation + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocation Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackInternal.ExtendedLocation { get => (this._extendedLocation = this._extendedLocation ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ExtendedLocation()); set { {_extendedLocation = value;} } } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackProperties Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.RackProperties()); set { {_property = value;} } } + + /// Internal Acessors for ProvisioningState + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackPropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackPropertiesInternal)Property).ProvisioningState = value ?? null; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).Id = value ?? null; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).Name = value ?? null; } + + /// Internal Acessors for SystemData + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISystemData Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemData; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemData = value ?? null /* model class */; } + + /// Internal Acessors for SystemDataCreatedAt + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataCreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataCreatedAt = value ?? default(global::System.DateTime); } + + /// Internal Acessors for SystemDataCreatedBy + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataCreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataCreatedBy = value ?? null; } + + /// Internal Acessors for SystemDataCreatedByType + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataCreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataCreatedByType = value ?? null; } + + /// Internal Acessors for SystemDataLastModifiedAt + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedAt = value ?? default(global::System.DateTime); } + + /// Internal Acessors for SystemDataLastModifiedBy + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedBy = value ?? null; } + + /// Internal Acessors for SystemDataLastModifiedByType + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedByType = value ?? null; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).Type = value ?? null; } + + /// The name of the resource + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).Name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackProperties _property; + + /// The list of the resource properties. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.RackProperties()); set => this._property = value; } + + /// The provisioning state of the rack resource. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackPropertiesInternal)Property).ProvisioningState; } + + /// + /// The free-form description of the rack location. (e.g. “DTN Datacenter, Floor 3, Isle 9, Rack 2B”) + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string RackLocation { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackPropertiesInternal)Property).RackLocation; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackPropertiesInternal)Property).RackLocation = value ; } + + /// Gets the resource group name + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string ResourceGroupName { get => (new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Success ? new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Groups["resourceGroupName"].Value : null); } + + /// + /// The unique identifier for the rack within Network Cloud cluster. An alternate unique alphanumeric value other than a serial + /// number may be provided if desired. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string SerialNumber { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackPropertiesInternal)Property).RackSerialNumber; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackPropertiesInternal)Property).RackSerialNumber = value ; } + + /// The SKU for the rack. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string SkuId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackPropertiesInternal)Property).RackSkuId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackPropertiesInternal)Property).RackSkuId = value ; } + + /// + /// Azure Resource Manager metadata containing createdBy and modifiedBy information. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISystemData SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemData; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemData = value ?? null /* model class */; } + + /// The timestamp of resource creation (UTC). + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataCreatedAt; } + + /// The identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataCreatedBy; } + + /// The type of identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public string SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataCreatedByType; } + + /// The timestamp of resource last modification (UTC) + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedAt; } + + /// The identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedBy; } + + /// The type of identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public string SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedByType; } + + /// Resource tags. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)__trackedResource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).Type; } + + /// Creates an new instance. + public Rack() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__trackedResource), __trackedResource); + await eventListener.AssertObjectIsValid(nameof(__trackedResource), __trackedResource); + } + } + /// Rack represents the hardware of the rack and is dependent upon the cluster for lifecycle. + public partial interface IRack : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResource + { + /// + /// The value that will be used for machines in this rack to represent the availability zones that can be referenced by Hybrid + /// AKS Clusters for node arrangement. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The value that will be used for machines in this rack to represent the availability zones that can be referenced by Hybrid AKS Clusters for node arrangement.", + SerializedName = @"availabilityZone", + PossibleTypes = new [] { typeof(string) })] + string AvailabilityZone { get; set; } + /// + /// The resource ID of the cluster the rack is created for. This value is set when the rack is created by the cluster. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The resource ID of the cluster the rack is created for. This value is set when the rack is created by the cluster.", + SerializedName = @"clusterId", + PossibleTypes = new [] { typeof(string) })] + string ClusterId { get; } + /// The more detailed status of the rack. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The more detailed status of the rack.", + SerializedName = @"detailedStatus", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Error", "Available", "Provisioning")] + string DetailedStatus { get; } + /// The descriptive message about the current detailed status. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The descriptive message about the current detailed status.", + SerializedName = @"detailedStatusMessage", + PossibleTypes = new [] { typeof(string) })] + string DetailedStatusMessage { get; } + /// Resource ETag. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"Resource ETag.", + SerializedName = @"etag", + PossibleTypes = new [] { typeof(string) })] + string Etag { get; } + /// The resource ID of the extended location on which the resource will be created. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The resource ID of the extended location on which the resource will be created.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string ExtendedLocationName { get; set; } + /// The extended location type, for example, CustomLocation. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The extended location type, for example, CustomLocation.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + string ExtendedLocationType { get; set; } + /// The provisioning state of the rack resource. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The provisioning state of the rack resource.", + SerializedName = @"provisioningState", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Succeeded", "Failed", "Canceled", "Provisioning", "Accepted")] + string ProvisioningState { get; } + /// + /// The free-form description of the rack location. (e.g. “DTN Datacenter, Floor 3, Isle 9, Rack 2B”) + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The free-form description of the rack location. (e.g. “DTN Datacenter, Floor 3, Isle 9, Rack 2B”)", + SerializedName = @"rackLocation", + PossibleTypes = new [] { typeof(string) })] + string RackLocation { get; set; } + /// + /// The unique identifier for the rack within Network Cloud cluster. An alternate unique alphanumeric value other than a serial + /// number may be provided if desired. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The unique identifier for the rack within Network Cloud cluster. An alternate unique alphanumeric value other than a serial number may be provided if desired.", + SerializedName = @"rackSerialNumber", + PossibleTypes = new [] { typeof(string) })] + string SerialNumber { get; set; } + /// The SKU for the rack. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The SKU for the rack.", + SerializedName = @"rackSkuId", + PossibleTypes = new [] { typeof(string) })] + string SkuId { get; set; } + + } + /// Rack represents the hardware of the rack and is dependent upon the cluster for lifecycle. + internal partial interface IRackInternal : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal + { + /// + /// The value that will be used for machines in this rack to represent the availability zones that can be referenced by Hybrid + /// AKS Clusters for node arrangement. + /// + string AvailabilityZone { get; set; } + /// + /// The resource ID of the cluster the rack is created for. This value is set when the rack is created by the cluster. + /// + string ClusterId { get; set; } + /// The more detailed status of the rack. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Error", "Available", "Provisioning")] + string DetailedStatus { get; set; } + /// The descriptive message about the current detailed status. + string DetailedStatusMessage { get; set; } + /// Resource ETag. + string Etag { get; set; } + /// The extended location of the cluster associated with the resource. + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocation ExtendedLocation { get; set; } + /// The resource ID of the extended location on which the resource will be created. + string ExtendedLocationName { get; set; } + /// The extended location type, for example, CustomLocation. + string ExtendedLocationType { get; set; } + /// The list of the resource properties. + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackProperties Property { get; set; } + /// The provisioning state of the rack resource. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Succeeded", "Failed", "Canceled", "Provisioning", "Accepted")] + string ProvisioningState { get; set; } + /// + /// The free-form description of the rack location. (e.g. “DTN Datacenter, Floor 3, Isle 9, Rack 2B”) + /// + string RackLocation { get; set; } + /// + /// The unique identifier for the rack within Network Cloud cluster. An alternate unique alphanumeric value other than a serial + /// number may be provided if desired. + /// + string SerialNumber { get; set; } + /// The SKU for the rack. + string SkuId { get; set; } + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/Rack.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Rack.json.cs similarity index 91% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/Rack.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Rack.json.cs index 11fac7561724..cb6291b8ca3e 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/Rack.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Rack.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -56,13 +56,11 @@ public partial class Rack partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRack. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRack. /// /// a to deserialize from. - /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRack. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRack FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRack. + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRack FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new Rack(json) : null; } @@ -79,10 +77,10 @@ internal Rack(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonO { return; } - __trackedResource = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.TrackedResource(json); - {_extendedLocation = If( json?.PropertyT("extendedLocation"), out var __jsonExtendedLocation) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ExtendedLocation.FromJson(__jsonExtendedLocation) : ExtendedLocation;} - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.RackProperties.FromJson(__jsonProperties) : Property;} - {_etag = If( json?.PropertyT("etag"), out var __jsonEtag) ? (string)__jsonEtag : (string)Etag;} + __trackedResource = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.TrackedResource(json); + {_extendedLocation = If( json?.PropertyT("extendedLocation"), out var __jsonExtendedLocation) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ExtendedLocation.FromJson(__jsonExtendedLocation) : _extendedLocation;} + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.RackProperties.FromJson(__jsonProperties) : _property;} + {_etag = If( json?.PropertyT("etag"), out var __jsonEtag) ? (string)__jsonEtag : (string)_etag;} AfterFromJson(json); } @@ -108,7 +106,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode ToJ __trackedResource?.ToJson(container, serializationMode); AddIf( null != this._extendedLocation ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) this._extendedLocation.ToJson(null,serializationMode) : null, "extendedLocation" ,container.Add ); AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._etag)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._etag.ToString()) : null, "etag" ,container.Add ); } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/RackDefinition.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/RackDefinition.PowerShell.cs new file mode 100644 index 000000000000..aac93f8936c3 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/RackDefinition.PowerShell.cs @@ -0,0 +1,212 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + + /// RackDefinition represents details regarding the rack. + [System.ComponentModel.TypeConverter(typeof(RackDefinitionTypeConverter))] + public partial class RackDefinition + { + + /// + /// 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.NetworkCloud.Models.IRackDefinition DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new RackDefinition(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.NetworkCloud.Models.IRackDefinition DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new RackDefinition(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.NetworkCloud.Models.IRackDefinition FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal RackDefinition(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("AvailabilityZone")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackDefinitionInternal)this).AvailabilityZone = (string) content.GetValueForProperty("AvailabilityZone",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackDefinitionInternal)this).AvailabilityZone, global::System.Convert.ToString); + } + if (content.Contains("BareMetalMachineConfigurationData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackDefinitionInternal)this).BareMetalMachineConfigurationData = (System.Collections.Generic.List) content.GetValueForProperty("BareMetalMachineConfigurationData",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackDefinitionInternal)this).BareMetalMachineConfigurationData, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BareMetalMachineConfigurationDataTypeConverter.ConvertFrom)); + } + if (content.Contains("NetworkRackId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackDefinitionInternal)this).NetworkRackId = (string) content.GetValueForProperty("NetworkRackId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackDefinitionInternal)this).NetworkRackId, global::System.Convert.ToString); + } + if (content.Contains("RackLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackDefinitionInternal)this).RackLocation = (string) content.GetValueForProperty("RackLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackDefinitionInternal)this).RackLocation, global::System.Convert.ToString); + } + if (content.Contains("RackSerialNumber")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackDefinitionInternal)this).RackSerialNumber = (string) content.GetValueForProperty("RackSerialNumber",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackDefinitionInternal)this).RackSerialNumber, global::System.Convert.ToString); + } + if (content.Contains("RackSkuId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackDefinitionInternal)this).RackSkuId = (string) content.GetValueForProperty("RackSkuId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackDefinitionInternal)this).RackSkuId, global::System.Convert.ToString); + } + if (content.Contains("StorageApplianceConfigurationData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackDefinitionInternal)this).StorageApplianceConfigurationData = (System.Collections.Generic.List) content.GetValueForProperty("StorageApplianceConfigurationData",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackDefinitionInternal)this).StorageApplianceConfigurationData, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.StorageApplianceConfigurationDataTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal RackDefinition(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("AvailabilityZone")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackDefinitionInternal)this).AvailabilityZone = (string) content.GetValueForProperty("AvailabilityZone",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackDefinitionInternal)this).AvailabilityZone, global::System.Convert.ToString); + } + if (content.Contains("BareMetalMachineConfigurationData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackDefinitionInternal)this).BareMetalMachineConfigurationData = (System.Collections.Generic.List) content.GetValueForProperty("BareMetalMachineConfigurationData",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackDefinitionInternal)this).BareMetalMachineConfigurationData, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BareMetalMachineConfigurationDataTypeConverter.ConvertFrom)); + } + if (content.Contains("NetworkRackId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackDefinitionInternal)this).NetworkRackId = (string) content.GetValueForProperty("NetworkRackId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackDefinitionInternal)this).NetworkRackId, global::System.Convert.ToString); + } + if (content.Contains("RackLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackDefinitionInternal)this).RackLocation = (string) content.GetValueForProperty("RackLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackDefinitionInternal)this).RackLocation, global::System.Convert.ToString); + } + if (content.Contains("RackSerialNumber")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackDefinitionInternal)this).RackSerialNumber = (string) content.GetValueForProperty("RackSerialNumber",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackDefinitionInternal)this).RackSerialNumber, global::System.Convert.ToString); + } + if (content.Contains("RackSkuId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackDefinitionInternal)this).RackSkuId = (string) content.GetValueForProperty("RackSkuId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackDefinitionInternal)this).RackSkuId, global::System.Convert.ToString); + } + if (content.Contains("StorageApplianceConfigurationData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackDefinitionInternal)this).StorageApplianceConfigurationData = (System.Collections.Generic.List) content.GetValueForProperty("StorageApplianceConfigurationData",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackDefinitionInternal)this).StorageApplianceConfigurationData, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.StorageApplianceConfigurationDataTypeConverter.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.NetworkCloud.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(); + } + } + /// RackDefinition represents details regarding the rack. + [System.ComponentModel.TypeConverter(typeof(RackDefinitionTypeConverter))] + public partial interface IRackDefinition + + { + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/RackDefinition.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/RackDefinition.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/RackDefinition.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/RackDefinition.TypeConverter.cs index 606271bf5cf1..f222bece0c9a 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/RackDefinition.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/RackDefinition.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IRackDefinition ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackDefinition ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackDefinition).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackDefinition).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/RackDefinition.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/RackDefinition.cs similarity index 78% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/RackDefinition.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/RackDefinition.cs index 6dcc1f3a8273..940d528b7684 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/RackDefinition.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/RackDefinition.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; /// RackDefinition represents details regarding the rack. public partial class RackDefinition : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackDefinition, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackDefinitionInternal + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackDefinition, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackDefinitionInternal { /// Backing field for property. @@ -23,11 +23,11 @@ public partial class RackDefinition : public string AvailabilityZone { get => this._availabilityZone; set => this._availabilityZone = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineConfigurationData[] _bareMetalMachineConfigurationData; + private System.Collections.Generic.List _bareMetalMachineConfigurationData; /// The unordered list of bare metal machine configuration. [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineConfigurationData[] BareMetalMachineConfigurationData { get => this._bareMetalMachineConfigurationData; set => this._bareMetalMachineConfigurationData = value; } + public System.Collections.Generic.List BareMetalMachineConfigurationData { get => this._bareMetalMachineConfigurationData; set => this._bareMetalMachineConfigurationData = value; } /// Backing field for property. private string _networkRackId; @@ -61,11 +61,11 @@ public partial class RackDefinition : public string RackSkuId { get => this._rackSkuId; set => this._rackSkuId = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceConfigurationData[] _storageApplianceConfigurationData; + private System.Collections.Generic.List _storageApplianceConfigurationData; /// The list of storage appliance configuration data for this rack. [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceConfigurationData[] StorageApplianceConfigurationData { get => this._storageApplianceConfigurationData; set => this._storageApplianceConfigurationData = value; } + public System.Collections.Generic.List StorageApplianceConfigurationData { get => this._storageApplianceConfigurationData; set => this._storageApplianceConfigurationData = value; } /// Creates an new instance. public RackDefinition() @@ -83,6 +83,9 @@ public partial interface IRackDefinition : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The zone name used for this rack when created. Availability zones are used for workload placement.", SerializedName = @"availabilityZone", PossibleTypes = new [] { typeof(string) })] @@ -91,14 +94,20 @@ public partial interface IRackDefinition : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The unordered list of bare metal machine configuration.", SerializedName = @"bareMetalMachineConfigurationData", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineConfigurationData) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineConfigurationData[] BareMetalMachineConfigurationData { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineConfigurationData) })] + System.Collections.Generic.List BareMetalMachineConfigurationData { get; set; } /// The resource ID of the network rack that matches this rack definition. [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The resource ID of the network rack that matches this rack definition.", SerializedName = @"networkRackId", PossibleTypes = new [] { typeof(string) })] @@ -107,6 +116,9 @@ public partial interface IRackDefinition : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The free-form description of the rack's location.", SerializedName = @"rackLocation", PossibleTypes = new [] { typeof(string) })] @@ -118,6 +130,9 @@ public partial interface IRackDefinition : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The unique identifier for the rack within Network Cloud cluster. An alternate unique alphanumeric value other than a serial number may be provided if desired.", SerializedName = @"rackSerialNumber", PossibleTypes = new [] { typeof(string) })] @@ -126,6 +141,9 @@ public partial interface IRackDefinition : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The resource ID of the sku for the rack being added.", SerializedName = @"rackSkuId", PossibleTypes = new [] { typeof(string) })] @@ -134,10 +152,13 @@ public partial interface IRackDefinition : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The list of storage appliance configuration data for this rack.", SerializedName = @"storageApplianceConfigurationData", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceConfigurationData) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceConfigurationData[] StorageApplianceConfigurationData { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceConfigurationData) })] + System.Collections.Generic.List StorageApplianceConfigurationData { get; set; } } /// RackDefinition represents details regarding the rack. @@ -149,7 +170,7 @@ internal partial interface IRackDefinitionInternal /// string AvailabilityZone { get; set; } /// The unordered list of bare metal machine configuration. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineConfigurationData[] BareMetalMachineConfigurationData { get; set; } + System.Collections.Generic.List BareMetalMachineConfigurationData { get; set; } /// The resource ID of the network rack that matches this rack definition. string NetworkRackId { get; set; } /// The free-form description of the rack's location. @@ -162,7 +183,7 @@ internal partial interface IRackDefinitionInternal /// The resource ID of the sku for the rack being added. string RackSkuId { get; set; } /// The list of storage appliance configuration data for this rack. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceConfigurationData[] StorageApplianceConfigurationData { get; set; } + System.Collections.Generic.List StorageApplianceConfigurationData { get; set; } } } \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/RackDefinition.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/RackDefinition.json.cs similarity index 88% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/RackDefinition.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/RackDefinition.json.cs index ede737dde879..74b5feaa4f7a 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/RackDefinition.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/RackDefinition.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class RackDefinition partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackDefinition. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackDefinition. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackDefinition. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackDefinition. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackDefinition FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackDefinition FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new RackDefinition(json) : null; } @@ -77,13 +77,13 @@ internal RackDefinition(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime. { return; } - {_availabilityZone = If( json?.PropertyT("availabilityZone"), out var __jsonAvailabilityZone) ? (string)__jsonAvailabilityZone : (string)AvailabilityZone;} - {_bareMetalMachineConfigurationData = If( json?.PropertyT("bareMetalMachineConfigurationData"), out var __jsonBareMetalMachineConfigurationData) ? If( __jsonBareMetalMachineConfigurationData as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IBareMetalMachineConfigurationData) (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BareMetalMachineConfigurationData.FromJson(__u) )) ))() : null : BareMetalMachineConfigurationData;} - {_networkRackId = If( json?.PropertyT("networkRackId"), out var __jsonNetworkRackId) ? (string)__jsonNetworkRackId : (string)NetworkRackId;} - {_rackLocation = If( json?.PropertyT("rackLocation"), out var __jsonRackLocation) ? (string)__jsonRackLocation : (string)RackLocation;} - {_rackSerialNumber = If( json?.PropertyT("rackSerialNumber"), out var __jsonRackSerialNumber) ? (string)__jsonRackSerialNumber : (string)RackSerialNumber;} - {_rackSkuId = If( json?.PropertyT("rackSkuId"), out var __jsonRackSkuId) ? (string)__jsonRackSkuId : (string)RackSkuId;} - {_storageApplianceConfigurationData = If( json?.PropertyT("storageApplianceConfigurationData"), out var __jsonStorageApplianceConfigurationData) ? If( __jsonStorageApplianceConfigurationData as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IStorageApplianceConfigurationData) (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.StorageApplianceConfigurationData.FromJson(__p) )) ))() : null : StorageApplianceConfigurationData;} + {_availabilityZone = If( json?.PropertyT("availabilityZone"), out var __jsonAvailabilityZone) ? (string)__jsonAvailabilityZone : (string)_availabilityZone;} + {_bareMetalMachineConfigurationData = If( json?.PropertyT("bareMetalMachineConfigurationData"), out var __jsonBareMetalMachineConfigurationData) ? If( __jsonBareMetalMachineConfigurationData as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.IBareMetalMachineConfigurationData) (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BareMetalMachineConfigurationData.FromJson(__u) )) ))() : null : _bareMetalMachineConfigurationData;} + {_networkRackId = If( json?.PropertyT("networkRackId"), out var __jsonNetworkRackId) ? (string)__jsonNetworkRackId : (string)_networkRackId;} + {_rackLocation = If( json?.PropertyT("rackLocation"), out var __jsonRackLocation) ? (string)__jsonRackLocation : (string)_rackLocation;} + {_rackSerialNumber = If( json?.PropertyT("rackSerialNumber"), out var __jsonRackSerialNumber) ? (string)__jsonRackSerialNumber : (string)_rackSerialNumber;} + {_rackSkuId = If( json?.PropertyT("rackSkuId"), out var __jsonRackSkuId) ? (string)__jsonRackSkuId : (string)_rackSkuId;} + {_storageApplianceConfigurationData = If( json?.PropertyT("storageApplianceConfigurationData"), out var __jsonStorageApplianceConfigurationData) ? If( __jsonStorageApplianceConfigurationData as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.IStorageApplianceConfigurationData) (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.StorageApplianceConfigurationData.FromJson(__p) )) ))() : null : _storageApplianceConfigurationData;} AfterFromJson(json); } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/RackList.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/RackList.PowerShell.cs similarity index 78% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/RackList.PowerShell.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/RackList.PowerShell.cs index 2fa3b3e1e0c8..0ada67a55b30 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/RackList.PowerShell.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/RackList.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; @@ -63,27 +63,27 @@ public partial class RackList 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.NetworkCloud.Models.Api20250201.IRackList DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackList DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new RackList(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.NetworkCloud.Models.Api20250201.IRackList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new RackList(content); } @@ -93,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 RackList(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackListInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackListInternal)this).NextLink, global::System.Convert.ToString); } if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRack[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.RackTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackListInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackListInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.RackTypeConverter.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,11 +136,11 @@ internal RackList(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackListInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackListInternal)this).NextLink, global::System.Convert.ToString); } if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRack[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.RackTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackListInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackListInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.RackTypeConverter.ConvertFrom)); } AfterDeserializePSObject(content); } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/RackList.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/RackList.TypeConverter.cs similarity index 98% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/RackList.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/RackList.TypeConverter.cs index 91866770aa6a..6e01e06abfad 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/RackList.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/RackList.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IRackList ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackList ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackList).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackList).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/RackList.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/RackList.cs new file mode 100644 index 000000000000..431d1176a89e --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/RackList.cs @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + + /// RackList represents a list of racks. + public partial class RackList : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackList, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackListInternal + { + + /// Backing field for property. + private string _nextLink; + + /// The link used to get the next page of operations. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; set => this._nextLink = value; } + + /// Backing field for property. + private System.Collections.Generic.List _value; + + /// The list of racks. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public System.Collections.Generic.List Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public RackList() + { + + } + } + /// RackList represents a list of racks. + public partial interface IRackList : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable + { + /// The link used to get the next page of operations. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The link used to get the next page of operations.", + SerializedName = @"nextLink", + PossibleTypes = new [] { typeof(string) })] + string NextLink { get; set; } + /// The list of racks. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The list of racks.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRack) })] + System.Collections.Generic.List Value { get; set; } + + } + /// RackList represents a list of racks. + internal partial interface IRackListInternal + + { + /// The link used to get the next page of operations. + string NextLink { get; set; } + /// The list of racks. + System.Collections.Generic.List Value { get; set; } + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/RackList.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/RackList.json.cs similarity index 91% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/RackList.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/RackList.json.cs index a46c70789b1c..d68e85cf833d 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/RackList.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/RackList.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class RackList partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackList. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackList. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackList. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackList. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackList FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackList FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new RackList(json) : null; } @@ -77,8 +77,8 @@ internal RackList(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.J { return; } - {_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.NetworkCloud.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.NetworkCloud.Models.Api20250201.IRack) (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.Rack.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.NetworkCloud.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.NetworkCloud.Models.IRack) (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Rack.FromJson(__u) )) ))() : null : _value;} AfterFromJson(json); } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/RackPatchParameters.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/RackPatchParameters.PowerShell.cs new file mode 100644 index 000000000000..0ce71685ae51 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/RackPatchParameters.PowerShell.cs @@ -0,0 +1,190 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + + /// + /// RackPatchParameters represents the body of the request to patch the rack properties. + /// + [System.ComponentModel.TypeConverter(typeof(RackPatchParametersTypeConverter))] + public partial class RackPatchParameters + { + + /// + /// 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.NetworkCloud.Models.IRackPatchParameters DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new RackPatchParameters(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.NetworkCloud.Models.IRackPatchParameters DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new RackPatchParameters(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.NetworkCloud.Models.IRackPatchParameters FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal RackPatchParameters(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.NetworkCloud.Models.IRackPatchParametersInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRacksPatchProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackPatchParametersInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.RacksPatchPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackPatchParametersInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackPatchParametersTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackPatchParametersInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.RackPatchParametersTagsTypeConverter.ConvertFrom); + } + if (content.Contains("RackLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackPatchParametersInternal)this).RackLocation = (string) content.GetValueForProperty("RackLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackPatchParametersInternal)this).RackLocation, global::System.Convert.ToString); + } + if (content.Contains("RackSerialNumber")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackPatchParametersInternal)this).RackSerialNumber = (string) content.GetValueForProperty("RackSerialNumber",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackPatchParametersInternal)this).RackSerialNumber, 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 RackPatchParameters(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.NetworkCloud.Models.IRackPatchParametersInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRacksPatchProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackPatchParametersInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.RacksPatchPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackPatchParametersInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackPatchParametersTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackPatchParametersInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.RackPatchParametersTagsTypeConverter.ConvertFrom); + } + if (content.Contains("RackLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackPatchParametersInternal)this).RackLocation = (string) content.GetValueForProperty("RackLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackPatchParametersInternal)this).RackLocation, global::System.Convert.ToString); + } + if (content.Contains("RackSerialNumber")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackPatchParametersInternal)this).RackSerialNumber = (string) content.GetValueForProperty("RackSerialNumber",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackPatchParametersInternal)this).RackSerialNumber, 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.NetworkCloud.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(); + } + } + /// RackPatchParameters represents the body of the request to patch the rack properties. + [System.ComponentModel.TypeConverter(typeof(RackPatchParametersTypeConverter))] + public partial interface IRackPatchParameters + + { + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/RackPatchParameters.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/RackPatchParameters.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/RackPatchParameters.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/RackPatchParameters.TypeConverter.cs index e160c7427664..b64bb002c76c 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/RackPatchParameters.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/RackPatchParameters.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IRackPatchParameters ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackPatchParameters ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackPatchParameters).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackPatchParameters).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/RackPatchParameters.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/RackPatchParameters.cs new file mode 100644 index 000000000000..396143b530e0 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/RackPatchParameters.cs @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + + /// + /// RackPatchParameters represents the body of the request to patch the rack properties. + /// + public partial class RackPatchParameters : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackPatchParameters, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackPatchParametersInternal + { + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRacksPatchProperties Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackPatchParametersInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.RacksPatchProperties()); set { {_property = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRacksPatchProperties _property; + + /// The list of the resource properties. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRacksPatchProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.RacksPatchProperties()); set => this._property = value; } + + /// + /// The free-form description of the rack location. (e.g. “DTN Datacenter, Floor 3, Isle 9, Rack 2B”) + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string RackLocation { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRacksPatchPropertiesInternal)Property).RackLocation; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRacksPatchPropertiesInternal)Property).RackLocation = value ?? null; } + + /// The globally unique identifier for the rack. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string RackSerialNumber { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRacksPatchPropertiesInternal)Property).RackSerialNumber; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRacksPatchPropertiesInternal)Property).RackSerialNumber = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackPatchParametersTags _tag; + + /// The Azure resource tags that will replace the existing ones. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackPatchParametersTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.RackPatchParametersTags()); set => this._tag = value; } + + /// Creates an new instance. + public RackPatchParameters() + { + + } + } + /// RackPatchParameters represents the body of the request to patch the rack properties. + public partial interface IRackPatchParameters : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable + { + /// + /// The free-form description of the rack location. (e.g. “DTN Datacenter, Floor 3, Isle 9, Rack 2B”) + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The free-form description of the rack location. (e.g. “DTN Datacenter, Floor 3, Isle 9, Rack 2B”)", + SerializedName = @"rackLocation", + PossibleTypes = new [] { typeof(string) })] + string RackLocation { get; set; } + /// The globally unique identifier for the rack. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The globally unique identifier for the rack.", + SerializedName = @"rackSerialNumber", + PossibleTypes = new [] { typeof(string) })] + string RackSerialNumber { get; set; } + /// The Azure resource tags that will replace the existing ones. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The Azure resource tags that will replace the existing ones.", + SerializedName = @"tags", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackPatchParametersTags) })] + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackPatchParametersTags Tag { get; set; } + + } + /// RackPatchParameters represents the body of the request to patch the rack properties. + internal partial interface IRackPatchParametersInternal + + { + /// The list of the resource properties. + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRacksPatchProperties Property { get; set; } + /// + /// The free-form description of the rack location. (e.g. “DTN Datacenter, Floor 3, Isle 9, Rack 2B”) + /// + string RackLocation { get; set; } + /// The globally unique identifier for the rack. + string RackSerialNumber { get; set; } + /// The Azure resource tags that will replace the existing ones. + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackPatchParametersTags Tag { get; set; } + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/RackPatchParameters.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/RackPatchParameters.json.cs similarity index 93% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/RackPatchParameters.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/RackPatchParameters.json.cs index fd19985ff83a..a7b2ec8c2244 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/RackPatchParameters.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/RackPatchParameters.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -56,13 +56,13 @@ public partial class RackPatchParameters partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackPatchParameters. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackPatchParameters. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackPatchParameters. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackPatchParameters. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackPatchParameters FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackPatchParameters FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new RackPatchParameters(json) : null; } @@ -79,8 +79,8 @@ internal RackPatchParameters(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Run { return; } - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.RacksPatchProperties.FromJson(__jsonProperties) : Property;} - {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.RackPatchParametersTags.FromJson(__jsonTags) : Tag;} + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.RacksPatchProperties.FromJson(__jsonProperties) : _property;} + {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.RackPatchParametersTags.FromJson(__jsonTags) : _tag;} AfterFromJson(json); } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/RackPatchParametersTags.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/RackPatchParametersTags.PowerShell.cs similarity index 89% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/RackPatchParametersTags.PowerShell.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/RackPatchParametersTags.PowerShell.cs index 13de50a9d88c..2bcfc3ab6d41 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/RackPatchParametersTags.PowerShell.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/RackPatchParametersTags.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; @@ -63,29 +63,27 @@ public partial class RackPatchParametersTags 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.NetworkCloud.Models.Api20250201.IRackPatchParametersTags DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackPatchParametersTags DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new RackPatchParametersTags(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.NetworkCloud.Models.Api20250201.IRackPatchParametersTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackPatchParametersTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new RackPatchParametersTags(content); } @@ -95,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackPatchParametersTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackPatchParametersTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 RackPatchParametersTags(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/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/RackPatchParametersTags.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/RackPatchParametersTags.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/RackPatchParametersTags.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/RackPatchParametersTags.TypeConverter.cs index 333cfdf4e163..c9b11da0c204 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/RackPatchParametersTags.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/RackPatchParametersTags.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IRackPatchParametersTags ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackPatchParametersTags ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackPatchParametersTags).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackPatchParametersTags).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/RackPatchParametersTags.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/RackPatchParametersTags.cs similarity index 84% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/RackPatchParametersTags.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/RackPatchParametersTags.cs index 16939ee0bff7..d88249a34b9d 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/RackPatchParametersTags.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/RackPatchParametersTags.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; /// The Azure resource tags that will replace the existing ones. public partial class RackPatchParametersTags : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackPatchParametersTags, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackPatchParametersTagsInternal + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackPatchParametersTags, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackPatchParametersTagsInternal { /// Creates an new instance. diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/RackPatchParametersTags.dictionary.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/RackPatchParametersTags.dictionary.cs similarity index 96% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/RackPatchParametersTags.dictionary.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/RackPatchParametersTags.dictionary.cs index 87cfad58e9dd..5d9b662b6e70 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/RackPatchParametersTags.dictionary.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/RackPatchParametersTags.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.RackPatchParametersTags source) => source.__additionalProperties; + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.RackPatchParametersTags source) => source.__additionalProperties; } } \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/RackPatchParametersTags.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/RackPatchParametersTags.json.cs similarity index 95% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/RackPatchParametersTags.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/RackPatchParametersTags.json.cs index f8f0c22944b3..e6fd3bef48a6 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/RackPatchParametersTags.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/RackPatchParametersTags.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class RackPatchParametersTags partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackPatchParametersTags. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackPatchParametersTags. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackPatchParametersTags. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackPatchParametersTags. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackPatchParametersTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackPatchParametersTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new RackPatchParametersTags(json) : null; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/RackProperties.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/RackProperties.PowerShell.cs new file mode 100644 index 000000000000..1e9e19d417e3 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/RackProperties.PowerShell.cs @@ -0,0 +1,220 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + + /// RackProperties represents the properties of the rack. + [System.ComponentModel.TypeConverter(typeof(RackPropertiesTypeConverter))] + public partial class RackProperties + { + + /// + /// 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.NetworkCloud.Models.IRackProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new RackProperties(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.NetworkCloud.Models.IRackProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new RackProperties(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.NetworkCloud.Models.IRackProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal RackProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("AvailabilityZone")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackPropertiesInternal)this).AvailabilityZone = (string) content.GetValueForProperty("AvailabilityZone",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackPropertiesInternal)this).AvailabilityZone, global::System.Convert.ToString); + } + if (content.Contains("ClusterId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackPropertiesInternal)this).ClusterId = (string) content.GetValueForProperty("ClusterId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackPropertiesInternal)this).ClusterId, global::System.Convert.ToString); + } + if (content.Contains("DetailedStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackPropertiesInternal)this).DetailedStatus = (string) content.GetValueForProperty("DetailedStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackPropertiesInternal)this).DetailedStatus, global::System.Convert.ToString); + } + if (content.Contains("DetailedStatusMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackPropertiesInternal)this).DetailedStatusMessage = (string) content.GetValueForProperty("DetailedStatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackPropertiesInternal)this).DetailedStatusMessage, global::System.Convert.ToString); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackPropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackPropertiesInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("RackLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackPropertiesInternal)this).RackLocation = (string) content.GetValueForProperty("RackLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackPropertiesInternal)this).RackLocation, global::System.Convert.ToString); + } + if (content.Contains("RackSerialNumber")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackPropertiesInternal)this).RackSerialNumber = (string) content.GetValueForProperty("RackSerialNumber",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackPropertiesInternal)this).RackSerialNumber, global::System.Convert.ToString); + } + if (content.Contains("RackSkuId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackPropertiesInternal)this).RackSkuId = (string) content.GetValueForProperty("RackSkuId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackPropertiesInternal)this).RackSkuId, 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 RackProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("AvailabilityZone")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackPropertiesInternal)this).AvailabilityZone = (string) content.GetValueForProperty("AvailabilityZone",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackPropertiesInternal)this).AvailabilityZone, global::System.Convert.ToString); + } + if (content.Contains("ClusterId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackPropertiesInternal)this).ClusterId = (string) content.GetValueForProperty("ClusterId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackPropertiesInternal)this).ClusterId, global::System.Convert.ToString); + } + if (content.Contains("DetailedStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackPropertiesInternal)this).DetailedStatus = (string) content.GetValueForProperty("DetailedStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackPropertiesInternal)this).DetailedStatus, global::System.Convert.ToString); + } + if (content.Contains("DetailedStatusMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackPropertiesInternal)this).DetailedStatusMessage = (string) content.GetValueForProperty("DetailedStatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackPropertiesInternal)this).DetailedStatusMessage, global::System.Convert.ToString); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackPropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackPropertiesInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("RackLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackPropertiesInternal)this).RackLocation = (string) content.GetValueForProperty("RackLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackPropertiesInternal)this).RackLocation, global::System.Convert.ToString); + } + if (content.Contains("RackSerialNumber")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackPropertiesInternal)this).RackSerialNumber = (string) content.GetValueForProperty("RackSerialNumber",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackPropertiesInternal)this).RackSerialNumber, global::System.Convert.ToString); + } + if (content.Contains("RackSkuId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackPropertiesInternal)this).RackSkuId = (string) content.GetValueForProperty("RackSkuId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackPropertiesInternal)this).RackSkuId, 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.NetworkCloud.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(); + } + } + /// RackProperties represents the properties of the rack. + [System.ComponentModel.TypeConverter(typeof(RackPropertiesTypeConverter))] + public partial interface IRackProperties + + { + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/RackProperties.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/RackProperties.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/RackProperties.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/RackProperties.TypeConverter.cs index f9e5cb447b0d..e858c2b0f3d3 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/RackProperties.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/RackProperties.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IRackProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/RackProperties.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/RackProperties.cs similarity index 81% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/RackProperties.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/RackProperties.cs index 4ba26624488f..2a8b95334881 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/RackProperties.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/RackProperties.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; /// RackProperties represents the properties of the rack. public partial class RackProperties : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackProperties, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackPropertiesInternal + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackProperties, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackPropertiesInternal { /// Backing field for property. @@ -33,11 +33,11 @@ public partial class RackProperties : public string ClusterId { get => this._clusterId; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RackDetailedStatus? _detailedStatus; + private string _detailedStatus; /// The more detailed status of the rack. [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RackDetailedStatus? DetailedStatus { get => this._detailedStatus; } + public string DetailedStatus { get => this._detailedStatus; } /// Backing field for property. private string _detailedStatusMessage; @@ -47,23 +47,23 @@ public partial class RackProperties : public string DetailedStatusMessage { get => this._detailedStatusMessage; } /// Internal Acessors for ClusterId - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackPropertiesInternal.ClusterId { get => this._clusterId; set { {_clusterId = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackPropertiesInternal.ClusterId { get => this._clusterId; set { {_clusterId = value;} } } /// Internal Acessors for DetailedStatus - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RackDetailedStatus? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackPropertiesInternal.DetailedStatus { get => this._detailedStatus; set { {_detailedStatus = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackPropertiesInternal.DetailedStatus { get => this._detailedStatus; set { {_detailedStatus = value;} } } /// Internal Acessors for DetailedStatusMessage - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackPropertiesInternal.DetailedStatusMessage { get => this._detailedStatusMessage; set { {_detailedStatusMessage = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackPropertiesInternal.DetailedStatusMessage { get => this._detailedStatusMessage; set { {_detailedStatusMessage = value;} } } /// Internal Acessors for ProvisioningState - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RackProvisioningState? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackPropertiesInternal.ProvisioningState { get => this._provisioningState; set { {_provisioningState = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackPropertiesInternal.ProvisioningState { get => this._provisioningState; set { {_provisioningState = value;} } } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RackProvisioningState? _provisioningState; + private string _provisioningState; /// The provisioning state of the rack resource. [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RackProvisioningState? ProvisioningState { get => this._provisioningState; } + public string ProvisioningState { get => this._provisioningState; } /// Backing field for property. private string _rackLocation; @@ -108,6 +108,9 @@ public partial interface IRackProperties : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The value that will be used for machines in this rack to represent the availability zones that can be referenced by Hybrid AKS Clusters for node arrangement.", SerializedName = @"availabilityZone", PossibleTypes = new [] { typeof(string) })] @@ -118,6 +121,9 @@ public partial interface IRackProperties : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The resource ID of the cluster the rack is created for. This value is set when the rack is created by the cluster.", SerializedName = @"clusterId", PossibleTypes = new [] { typeof(string) })] @@ -126,14 +132,21 @@ public partial interface IRackProperties : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The more detailed status of the rack.", SerializedName = @"detailedStatus", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RackDetailedStatus) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RackDetailedStatus? DetailedStatus { get; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Error", "Available", "Provisioning")] + string DetailedStatus { get; } /// The descriptive message about the current detailed status. [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The descriptive message about the current detailed status.", SerializedName = @"detailedStatusMessage", PossibleTypes = new [] { typeof(string) })] @@ -142,16 +155,23 @@ public partial interface IRackProperties : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The provisioning state of the rack resource.", SerializedName = @"provisioningState", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RackProvisioningState) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RackProvisioningState? ProvisioningState { get; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Succeeded", "Failed", "Canceled", "Provisioning", "Accepted")] + string ProvisioningState { get; } /// /// The free-form description of the rack location. (e.g. “DTN Datacenter, Floor 3, Isle 9, Rack 2B”) /// [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The free-form description of the rack location. (e.g. “DTN Datacenter, Floor 3, Isle 9, Rack 2B”)", SerializedName = @"rackLocation", PossibleTypes = new [] { typeof(string) })] @@ -163,6 +183,9 @@ public partial interface IRackProperties : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The unique identifier for the rack within Network Cloud cluster. An alternate unique alphanumeric value other than a serial number may be provided if desired.", SerializedName = @"rackSerialNumber", PossibleTypes = new [] { typeof(string) })] @@ -171,6 +194,9 @@ public partial interface IRackProperties : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The SKU for the rack.", SerializedName = @"rackSkuId", PossibleTypes = new [] { typeof(string) })] @@ -191,11 +217,13 @@ internal partial interface IRackPropertiesInternal /// string ClusterId { get; set; } /// The more detailed status of the rack. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RackDetailedStatus? DetailedStatus { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Error", "Available", "Provisioning")] + string DetailedStatus { get; set; } /// The descriptive message about the current detailed status. string DetailedStatusMessage { get; set; } /// The provisioning state of the rack resource. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RackProvisioningState? ProvisioningState { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Succeeded", "Failed", "Canceled", "Provisioning", "Accepted")] + string ProvisioningState { get; set; } /// /// The free-form description of the rack location. (e.g. “DTN Datacenter, Floor 3, Isle 9, Rack 2B”) /// diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/RackProperties.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/RackProperties.json.cs similarity index 92% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/RackProperties.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/RackProperties.json.cs index 45c549471a62..dd8d9f855dca 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/RackProperties.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/RackProperties.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class RackProperties partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new RackProperties(json) : null; } @@ -77,14 +77,14 @@ internal RackProperties(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime. { return; } - {_availabilityZone = If( json?.PropertyT("availabilityZone"), out var __jsonAvailabilityZone) ? (string)__jsonAvailabilityZone : (string)AvailabilityZone;} - {_clusterId = If( json?.PropertyT("clusterId"), out var __jsonClusterId) ? (string)__jsonClusterId : (string)ClusterId;} - {_detailedStatus = If( json?.PropertyT("detailedStatus"), out var __jsonDetailedStatus) ? (string)__jsonDetailedStatus : (string)DetailedStatus;} - {_detailedStatusMessage = If( json?.PropertyT("detailedStatusMessage"), out var __jsonDetailedStatusMessage) ? (string)__jsonDetailedStatusMessage : (string)DetailedStatusMessage;} - {_provisioningState = If( json?.PropertyT("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)ProvisioningState;} - {_rackLocation = If( json?.PropertyT("rackLocation"), out var __jsonRackLocation) ? (string)__jsonRackLocation : (string)RackLocation;} - {_rackSerialNumber = If( json?.PropertyT("rackSerialNumber"), out var __jsonRackSerialNumber) ? (string)__jsonRackSerialNumber : (string)RackSerialNumber;} - {_rackSkuId = If( json?.PropertyT("rackSkuId"), out var __jsonRackSkuId) ? (string)__jsonRackSkuId : (string)RackSkuId;} + {_availabilityZone = If( json?.PropertyT("availabilityZone"), out var __jsonAvailabilityZone) ? (string)__jsonAvailabilityZone : (string)_availabilityZone;} + {_clusterId = If( json?.PropertyT("clusterId"), out var __jsonClusterId) ? (string)__jsonClusterId : (string)_clusterId;} + {_detailedStatus = If( json?.PropertyT("detailedStatus"), out var __jsonDetailedStatus) ? (string)__jsonDetailedStatus : (string)_detailedStatus;} + {_detailedStatusMessage = If( json?.PropertyT("detailedStatusMessage"), out var __jsonDetailedStatusMessage) ? (string)__jsonDetailedStatusMessage : (string)_detailedStatusMessage;} + {_provisioningState = If( json?.PropertyT("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)_provisioningState;} + {_rackLocation = If( json?.PropertyT("rackLocation"), out var __jsonRackLocation) ? (string)__jsonRackLocation : (string)_rackLocation;} + {_rackSerialNumber = If( json?.PropertyT("rackSerialNumber"), out var __jsonRackSerialNumber) ? (string)__jsonRackSerialNumber : (string)_rackSerialNumber;} + {_rackSkuId = If( json?.PropertyT("rackSkuId"), out var __jsonRackSkuId) ? (string)__jsonRackSkuId : (string)_rackSkuId;} AfterFromJson(json); } @@ -108,19 +108,19 @@ public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode ToJ return container; } AddIf( null != (((object)this._availabilityZone)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._availabilityZone.ToString()) : null, "availabilityZone" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._clusterId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._clusterId.ToString()) : null, "clusterId" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._detailedStatus)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._detailedStatus.ToString()) : null, "detailedStatus" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._detailedStatusMessage)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._detailedStatusMessage.ToString()) : null, "detailedStatusMessage" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._provisioningState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._provisioningState.ToString()) : null, "provisioningState" ,container.Add ); } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/RackSku.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/RackSku.PowerShell.cs new file mode 100644 index 000000000000..085f15bd5aff --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/RackSku.PowerShell.cs @@ -0,0 +1,308 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + + /// RackSku represents the SKU information of the rack. + [System.ComponentModel.TypeConverter(typeof(RackSkuTypeConverter))] + public partial class RackSku + { + + /// + /// 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.NetworkCloud.Models.IRackSku DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new RackSku(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.NetworkCloud.Models.IRackSku DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new RackSku(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.NetworkCloud.Models.IRackSku FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal RackSku(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.NetworkCloud.Models.IRackSkuInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackSkuProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackSkuInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.RackSkuPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)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("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedByType = (string) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedByType = (string) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("ComputeMachine")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackSkuInternal)this).ComputeMachine = (System.Collections.Generic.List) content.GetValueForProperty("ComputeMachine",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackSkuInternal)this).ComputeMachine, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.MachineSkuSlotTypeConverter.ConvertFrom)); + } + if (content.Contains("ControllerMachine")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackSkuInternal)this).ControllerMachine = (System.Collections.Generic.List) content.GetValueForProperty("ControllerMachine",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackSkuInternal)this).ControllerMachine, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.MachineSkuSlotTypeConverter.ConvertFrom)); + } + if (content.Contains("Description")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackSkuInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackSkuInternal)this).Description, global::System.Convert.ToString); + } + if (content.Contains("MaxClusterSlot")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackSkuInternal)this).MaxClusterSlot = (long?) content.GetValueForProperty("MaxClusterSlot",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackSkuInternal)this).MaxClusterSlot, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackSkuInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackSkuInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("RackType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackSkuInternal)this).RackType = (string) content.GetValueForProperty("RackType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackSkuInternal)this).RackType, global::System.Convert.ToString); + } + if (content.Contains("StorageAppliance")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackSkuInternal)this).StorageAppliance = (System.Collections.Generic.List) content.GetValueForProperty("StorageAppliance",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackSkuInternal)this).StorageAppliance, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.StorageApplianceSkuSlotTypeConverter.ConvertFrom)); + } + if (content.Contains("SupportedRackSkuId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackSkuInternal)this).SupportedRackSkuId = (System.Collections.Generic.List) content.GetValueForProperty("SupportedRackSkuId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackSkuInternal)this).SupportedRackSkuId, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal RackSku(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.NetworkCloud.Models.IRackSkuInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackSkuProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackSkuInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.RackSkuPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)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("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedByType = (string) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedByType = (string) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("ComputeMachine")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackSkuInternal)this).ComputeMachine = (System.Collections.Generic.List) content.GetValueForProperty("ComputeMachine",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackSkuInternal)this).ComputeMachine, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.MachineSkuSlotTypeConverter.ConvertFrom)); + } + if (content.Contains("ControllerMachine")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackSkuInternal)this).ControllerMachine = (System.Collections.Generic.List) content.GetValueForProperty("ControllerMachine",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackSkuInternal)this).ControllerMachine, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.MachineSkuSlotTypeConverter.ConvertFrom)); + } + if (content.Contains("Description")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackSkuInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackSkuInternal)this).Description, global::System.Convert.ToString); + } + if (content.Contains("MaxClusterSlot")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackSkuInternal)this).MaxClusterSlot = (long?) content.GetValueForProperty("MaxClusterSlot",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackSkuInternal)this).MaxClusterSlot, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackSkuInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackSkuInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("RackType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackSkuInternal)this).RackType = (string) content.GetValueForProperty("RackType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackSkuInternal)this).RackType, global::System.Convert.ToString); + } + if (content.Contains("StorageAppliance")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackSkuInternal)this).StorageAppliance = (System.Collections.Generic.List) content.GetValueForProperty("StorageAppliance",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackSkuInternal)this).StorageAppliance, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.StorageApplianceSkuSlotTypeConverter.ConvertFrom)); + } + if (content.Contains("SupportedRackSkuId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackSkuInternal)this).SupportedRackSkuId = (System.Collections.Generic.List) content.GetValueForProperty("SupportedRackSkuId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackSkuInternal)this).SupportedRackSkuId, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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(); + } + } + /// RackSku represents the SKU information of the rack. + [System.ComponentModel.TypeConverter(typeof(RackSkuTypeConverter))] + public partial interface IRackSku + + { + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/RackSku.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/RackSku.TypeConverter.cs similarity index 98% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/RackSku.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/RackSku.TypeConverter.cs index 754cb2207f1b..4480f451bf31 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/RackSku.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/RackSku.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IRackSku ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackSku ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackSku).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackSku).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/RackSku.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/RackSku.cs new file mode 100644 index 000000000000..8e2b6a6c8237 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/RackSku.cs @@ -0,0 +1,335 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + + /// RackSku represents the SKU information of the rack. + public partial class RackSku : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackSku, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackSkuInternal, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Resource(); + + /// + /// The list of machine SKUs and associated rack slot for the compute-dedicated machines in this rack model. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public System.Collections.Generic.List ComputeMachine { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackSkuPropertiesInternal)Property).ComputeMachine; } + + /// + /// The list of machine SKUs and associated rack slot for the control-plane dedicated machines in this rack model. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public System.Collections.Generic.List ControllerMachine { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackSkuPropertiesInternal)Property).ControllerMachine; } + + /// The free-form text describing the rack. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string Description { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackSkuPropertiesInternal)Property).Description; } + + /// + /// Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__resource).Id; } + + /// + /// The maximum number of compute racks supported by an aggregator rack. 0 if this is a compute rack or a rack for a single + /// rack cluster(rackType="Single"). + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public long? MaxClusterSlot { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackSkuPropertiesInternal)Property).MaxClusterSlot; } + + /// Internal Acessors for ComputeMachine + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackSkuInternal.ComputeMachine { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackSkuPropertiesInternal)Property).ComputeMachine; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackSkuPropertiesInternal)Property).ComputeMachine = value ?? null /* arrayOf */; } + + /// Internal Acessors for ControllerMachine + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackSkuInternal.ControllerMachine { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackSkuPropertiesInternal)Property).ControllerMachine; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackSkuPropertiesInternal)Property).ControllerMachine = value ?? null /* arrayOf */; } + + /// Internal Acessors for Description + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackSkuInternal.Description { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackSkuPropertiesInternal)Property).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackSkuPropertiesInternal)Property).Description = value ?? null; } + + /// Internal Acessors for MaxClusterSlot + long? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackSkuInternal.MaxClusterSlot { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackSkuPropertiesInternal)Property).MaxClusterSlot; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackSkuPropertiesInternal)Property).MaxClusterSlot = value ?? default(long); } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackSkuProperties Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackSkuInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.RackSkuProperties()); set { {_property = value;} } } + + /// Internal Acessors for ProvisioningState + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackSkuInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackSkuPropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackSkuPropertiesInternal)Property).ProvisioningState = value ?? null; } + + /// Internal Acessors for RackType + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackSkuInternal.RackType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackSkuPropertiesInternal)Property).RackType; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackSkuPropertiesInternal)Property).RackType = value ?? null; } + + /// Internal Acessors for StorageAppliance + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackSkuInternal.StorageAppliance { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackSkuPropertiesInternal)Property).StorageAppliance; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackSkuPropertiesInternal)Property).StorageAppliance = value ?? null /* arrayOf */; } + + /// Internal Acessors for SupportedRackSkuId + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackSkuInternal.SupportedRackSkuId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackSkuPropertiesInternal)Property).SupportedRackSkuId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackSkuPropertiesInternal)Property).SupportedRackSkuId = value ?? null /* arrayOf */; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__resource).Id = value ?? null; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__resource).Name = value ?? null; } + + /// Internal Acessors for SystemData + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISystemData Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__resource).SystemData; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__resource).SystemData = value ?? null /* model class */; } + + /// Internal Acessors for SystemDataCreatedAt + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__resource).SystemDataCreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__resource).SystemDataCreatedAt = value ?? default(global::System.DateTime); } + + /// Internal Acessors for SystemDataCreatedBy + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__resource).SystemDataCreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__resource).SystemDataCreatedBy = value ?? null; } + + /// Internal Acessors for SystemDataCreatedByType + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__resource).SystemDataCreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__resource).SystemDataCreatedByType = value ?? null; } + + /// Internal Acessors for SystemDataLastModifiedAt + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__resource).SystemDataLastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__resource).SystemDataLastModifiedAt = value ?? default(global::System.DateTime); } + + /// Internal Acessors for SystemDataLastModifiedBy + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__resource).SystemDataLastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__resource).SystemDataLastModifiedBy = value ?? null; } + + /// Internal Acessors for SystemDataLastModifiedByType + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__resource).SystemDataLastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__resource).SystemDataLastModifiedByType = value ?? null; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__resource).Type = value ?? null; } + + /// The name of the resource + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__resource).Name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackSkuProperties _property; + + /// The list of the resource properties. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackSkuProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.RackSkuProperties()); set => this._property = value; } + + /// The provisioning state of the rack SKU resource. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackSkuPropertiesInternal)Property).ProvisioningState; } + + /// The type of the rack. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string RackType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackSkuPropertiesInternal)Property).RackType; } + + /// Gets the resource group name + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string ResourceGroupName { get => (new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Success ? new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Groups["resourceGroupName"].Value : null); } + + /// + /// The list of appliance SKUs and associated rack slot for the storage appliance(s) in this rack model. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public System.Collections.Generic.List StorageAppliance { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackSkuPropertiesInternal)Property).StorageAppliance; } + + /// The list of supported SKUs if the rack is an aggregator. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public System.Collections.Generic.List SupportedRackSkuId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackSkuPropertiesInternal)Property).SupportedRackSkuId; } + + /// + /// Azure Resource Manager metadata containing createdBy and modifiedBy information. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISystemData SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__resource).SystemData; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__resource).SystemData = value ?? null /* model class */; } + + /// The timestamp of resource creation (UTC). + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__resource).SystemDataCreatedAt; } + + /// The identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__resource).SystemDataCreatedBy; } + + /// The type of identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public string SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__resource).SystemDataCreatedByType; } + + /// The timestamp of resource last modification (UTC) + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__resource).SystemDataLastModifiedAt; } + + /// The identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__resource).SystemDataLastModifiedBy; } + + /// The type of identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public string SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__resource).SystemDataLastModifiedByType; } + + /// + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__resource).Type; } + + /// Creates an new instance. + public RackSku() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__resource), __resource); + await eventListener.AssertObjectIsValid(nameof(__resource), __resource); + } + } + /// RackSku represents the SKU information of the rack. + public partial interface IRackSku : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResource + { + /// + /// The list of machine SKUs and associated rack slot for the compute-dedicated machines in this rack model. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The list of machine SKUs and associated rack slot for the compute-dedicated machines in this rack model.", + SerializedName = @"computeMachines", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuSlot) })] + System.Collections.Generic.List ComputeMachine { get; } + /// + /// The list of machine SKUs and associated rack slot for the control-plane dedicated machines in this rack model. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The list of machine SKUs and associated rack slot for the control-plane dedicated machines in this rack model.", + SerializedName = @"controllerMachines", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuSlot) })] + System.Collections.Generic.List ControllerMachine { get; } + /// The free-form text describing the rack. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The free-form text describing the rack.", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string Description { get; } + /// + /// The maximum number of compute racks supported by an aggregator rack. 0 if this is a compute rack or a rack for a single + /// rack cluster(rackType="Single"). + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The maximum number of compute racks supported by an aggregator rack. 0 if this is a compute rack or a rack for a single rack cluster(rackType=""Single"").", + SerializedName = @"maxClusterSlots", + PossibleTypes = new [] { typeof(long) })] + long? MaxClusterSlot { get; } + /// The provisioning state of the rack SKU resource. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The provisioning state of the rack SKU resource.", + SerializedName = @"provisioningState", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Canceled", "Failed", "Succeeded")] + string ProvisioningState { get; } + /// The type of the rack. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The type of the rack.", + SerializedName = @"rackType", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Aggregator", "Compute", "Single")] + string RackType { get; } + /// + /// The list of appliance SKUs and associated rack slot for the storage appliance(s) in this rack model. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The list of appliance SKUs and associated rack slot for the storage appliance(s) in this rack model.", + SerializedName = @"storageAppliances", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceSkuSlot) })] + System.Collections.Generic.List StorageAppliance { get; } + /// The list of supported SKUs if the rack is an aggregator. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The list of supported SKUs if the rack is an aggregator.", + SerializedName = @"supportedRackSkuIds", + PossibleTypes = new [] { typeof(string) })] + System.Collections.Generic.List SupportedRackSkuId { get; } + + } + /// RackSku represents the SKU information of the rack. + internal partial interface IRackSkuInternal : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal + { + /// + /// The list of machine SKUs and associated rack slot for the compute-dedicated machines in this rack model. + /// + System.Collections.Generic.List ComputeMachine { get; set; } + /// + /// The list of machine SKUs and associated rack slot for the control-plane dedicated machines in this rack model. + /// + System.Collections.Generic.List ControllerMachine { get; set; } + /// The free-form text describing the rack. + string Description { get; set; } + /// + /// The maximum number of compute racks supported by an aggregator rack. 0 if this is a compute rack or a rack for a single + /// rack cluster(rackType="Single"). + /// + long? MaxClusterSlot { get; set; } + /// The list of the resource properties. + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackSkuProperties Property { get; set; } + /// The provisioning state of the rack SKU resource. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Canceled", "Failed", "Succeeded")] + string ProvisioningState { get; set; } + /// The type of the rack. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Aggregator", "Compute", "Single")] + string RackType { get; set; } + /// + /// The list of appliance SKUs and associated rack slot for the storage appliance(s) in this rack model. + /// + System.Collections.Generic.List StorageAppliance { get; set; } + /// The list of supported SKUs if the rack is an aggregator. + System.Collections.Generic.List SupportedRackSkuId { get; set; } + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/RackSku.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/RackSku.json.cs similarity index 93% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/RackSku.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/RackSku.json.cs index 66c853215d37..ab04744e45ed 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/RackSku.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/RackSku.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -54,13 +54,11 @@ public partial class RackSku partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackSku. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackSku. /// /// a to deserialize from. - /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackSku. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackSku FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackSku. + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackSku FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new RackSku(json) : null; } @@ -77,8 +75,8 @@ internal RackSku(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.Js { return; } - __resource = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.Resource(json); - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.RackSkuProperties.FromJson(__jsonProperties) : Property;} + __resource = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Resource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.RackSkuProperties.FromJson(__jsonProperties) : _property;} AfterFromJson(json); } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/RackSkuList.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/RackSkuList.PowerShell.cs similarity index 77% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/RackSkuList.PowerShell.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/RackSkuList.PowerShell.cs index a64dfe7e5126..32100dfeb1cf 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/RackSkuList.PowerShell.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/RackSkuList.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; @@ -63,27 +63,27 @@ public partial class RackSkuList 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.NetworkCloud.Models.Api20250201.IRackSkuList DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackSkuList DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new RackSkuList(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.NetworkCloud.Models.Api20250201.IRackSkuList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackSkuList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new RackSkuList(content); } @@ -93,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackSkuList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackSkuList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 RackSkuList(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackSkuListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackSkuListInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackSkuListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackSkuListInternal)this).NextLink, global::System.Convert.ToString); } if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackSkuListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackSku[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackSkuListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.RackSkuTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackSkuListInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackSkuListInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.RackSkuTypeConverter.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,11 +136,11 @@ internal RackSkuList(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackSkuListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackSkuListInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackSkuListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackSkuListInternal)this).NextLink, global::System.Convert.ToString); } if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackSkuListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackSku[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackSkuListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.RackSkuTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackSkuListInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackSkuListInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.RackSkuTypeConverter.ConvertFrom)); } AfterDeserializePSObject(content); } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/RackSkuList.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/RackSkuList.TypeConverter.cs similarity index 98% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/RackSkuList.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/RackSkuList.TypeConverter.cs index 7cfbf5855c05..7e93e9347ac4 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/RackSkuList.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/RackSkuList.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IRackSkuList ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackSkuList ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackSkuList).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackSkuList).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/RackSkuList.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/RackSkuList.cs new file mode 100644 index 000000000000..7f43a5992df4 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/RackSkuList.cs @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + + /// RackSkuList represents a list of rack SKUs. + public partial class RackSkuList : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackSkuList, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackSkuListInternal + { + + /// Backing field for property. + private string _nextLink; + + /// The link used to get the next page of operations. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; set => this._nextLink = value; } + + /// Backing field for property. + private System.Collections.Generic.List _value; + + /// The list of Rack SKUs. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public System.Collections.Generic.List Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public RackSkuList() + { + + } + } + /// RackSkuList represents a list of rack SKUs. + public partial interface IRackSkuList : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable + { + /// The link used to get the next page of operations. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The link used to get the next page of operations.", + SerializedName = @"nextLink", + PossibleTypes = new [] { typeof(string) })] + string NextLink { get; set; } + /// The list of Rack SKUs. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The list of Rack SKUs.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackSku) })] + System.Collections.Generic.List Value { get; set; } + + } + /// RackSkuList represents a list of rack SKUs. + internal partial interface IRackSkuListInternal + + { + /// The link used to get the next page of operations. + string NextLink { get; set; } + /// The list of Rack SKUs. + System.Collections.Generic.List Value { get; set; } + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/RackSkuList.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/RackSkuList.json.cs similarity index 90% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/RackSkuList.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/RackSkuList.json.cs index 30bb8641d956..1fc342d7aff4 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/RackSkuList.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/RackSkuList.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class RackSkuList partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackSkuList. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackSkuList. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackSkuList. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackSkuList. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackSkuList FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackSkuList FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new RackSkuList(json) : null; } @@ -77,8 +77,8 @@ internal RackSkuList(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Jso { return; } - {_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.NetworkCloud.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.NetworkCloud.Models.Api20250201.IRackSku) (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.RackSku.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.NetworkCloud.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.NetworkCloud.Models.IRackSku) (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.RackSku.FromJson(__u) )) ))() : null : _value;} AfterFromJson(json); } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/RackSkuProperties.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/RackSkuProperties.PowerShell.cs new file mode 100644 index 000000000000..2bace47a8d90 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/RackSkuProperties.PowerShell.cs @@ -0,0 +1,224 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + + /// + /// RackSkuProperties represents the properties of compute-related hardware for a rack. This supports both aggregator and + /// compute racks. + /// + [System.ComponentModel.TypeConverter(typeof(RackSkuPropertiesTypeConverter))] + public partial class RackSkuProperties + { + + /// + /// 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.NetworkCloud.Models.IRackSkuProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new RackSkuProperties(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.NetworkCloud.Models.IRackSkuProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new RackSkuProperties(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.NetworkCloud.Models.IRackSkuProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal RackSkuProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ComputeMachine")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackSkuPropertiesInternal)this).ComputeMachine = (System.Collections.Generic.List) content.GetValueForProperty("ComputeMachine",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackSkuPropertiesInternal)this).ComputeMachine, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.MachineSkuSlotTypeConverter.ConvertFrom)); + } + if (content.Contains("ControllerMachine")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackSkuPropertiesInternal)this).ControllerMachine = (System.Collections.Generic.List) content.GetValueForProperty("ControllerMachine",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackSkuPropertiesInternal)this).ControllerMachine, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.MachineSkuSlotTypeConverter.ConvertFrom)); + } + if (content.Contains("Description")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackSkuPropertiesInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackSkuPropertiesInternal)this).Description, global::System.Convert.ToString); + } + if (content.Contains("MaxClusterSlot")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackSkuPropertiesInternal)this).MaxClusterSlot = (long?) content.GetValueForProperty("MaxClusterSlot",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackSkuPropertiesInternal)this).MaxClusterSlot, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackSkuPropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackSkuPropertiesInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("RackType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackSkuPropertiesInternal)this).RackType = (string) content.GetValueForProperty("RackType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackSkuPropertiesInternal)this).RackType, global::System.Convert.ToString); + } + if (content.Contains("StorageAppliance")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackSkuPropertiesInternal)this).StorageAppliance = (System.Collections.Generic.List) content.GetValueForProperty("StorageAppliance",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackSkuPropertiesInternal)this).StorageAppliance, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.StorageApplianceSkuSlotTypeConverter.ConvertFrom)); + } + if (content.Contains("SupportedRackSkuId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackSkuPropertiesInternal)this).SupportedRackSkuId = (System.Collections.Generic.List) content.GetValueForProperty("SupportedRackSkuId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackSkuPropertiesInternal)this).SupportedRackSkuId, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal RackSkuProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ComputeMachine")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackSkuPropertiesInternal)this).ComputeMachine = (System.Collections.Generic.List) content.GetValueForProperty("ComputeMachine",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackSkuPropertiesInternal)this).ComputeMachine, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.MachineSkuSlotTypeConverter.ConvertFrom)); + } + if (content.Contains("ControllerMachine")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackSkuPropertiesInternal)this).ControllerMachine = (System.Collections.Generic.List) content.GetValueForProperty("ControllerMachine",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackSkuPropertiesInternal)this).ControllerMachine, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.MachineSkuSlotTypeConverter.ConvertFrom)); + } + if (content.Contains("Description")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackSkuPropertiesInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackSkuPropertiesInternal)this).Description, global::System.Convert.ToString); + } + if (content.Contains("MaxClusterSlot")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackSkuPropertiesInternal)this).MaxClusterSlot = (long?) content.GetValueForProperty("MaxClusterSlot",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackSkuPropertiesInternal)this).MaxClusterSlot, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackSkuPropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackSkuPropertiesInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("RackType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackSkuPropertiesInternal)this).RackType = (string) content.GetValueForProperty("RackType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackSkuPropertiesInternal)this).RackType, global::System.Convert.ToString); + } + if (content.Contains("StorageAppliance")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackSkuPropertiesInternal)this).StorageAppliance = (System.Collections.Generic.List) content.GetValueForProperty("StorageAppliance",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackSkuPropertiesInternal)this).StorageAppliance, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.StorageApplianceSkuSlotTypeConverter.ConvertFrom)); + } + if (content.Contains("SupportedRackSkuId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackSkuPropertiesInternal)this).SupportedRackSkuId = (System.Collections.Generic.List) content.GetValueForProperty("SupportedRackSkuId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackSkuPropertiesInternal)this).SupportedRackSkuId, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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(); + } + } + /// RackSkuProperties represents the properties of compute-related hardware for a rack. This supports both aggregator and + /// compute racks. + [System.ComponentModel.TypeConverter(typeof(RackSkuPropertiesTypeConverter))] + public partial interface IRackSkuProperties + + { + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/RackSkuProperties.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/RackSkuProperties.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/RackSkuProperties.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/RackSkuProperties.TypeConverter.cs index eb23eba4ad09..c16e33ebe38d 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/RackSkuProperties.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/RackSkuProperties.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IRackSkuProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackSkuProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackSkuProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackSkuProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/RackSkuProperties.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/RackSkuProperties.cs new file mode 100644 index 000000000000..a29efe6ef7ac --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/RackSkuProperties.cs @@ -0,0 +1,254 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + + /// + /// RackSkuProperties represents the properties of compute-related hardware for a rack. This supports both aggregator and + /// compute racks. + /// + public partial class RackSkuProperties : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackSkuProperties, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackSkuPropertiesInternal + { + + /// Backing field for property. + private System.Collections.Generic.List _computeMachine; + + /// + /// The list of machine SKUs and associated rack slot for the compute-dedicated machines in this rack model. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public System.Collections.Generic.List ComputeMachine { get => this._computeMachine; } + + /// Backing field for property. + private System.Collections.Generic.List _controllerMachine; + + /// + /// The list of machine SKUs and associated rack slot for the control-plane dedicated machines in this rack model. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public System.Collections.Generic.List ControllerMachine { get => this._controllerMachine; } + + /// Backing field for property. + private string _description; + + /// The free-form text describing the rack. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string Description { get => this._description; } + + /// Backing field for property. + private long? _maxClusterSlot; + + /// + /// The maximum number of compute racks supported by an aggregator rack. 0 if this is a compute rack or a rack for a single + /// rack cluster(rackType="Single"). + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public long? MaxClusterSlot { get => this._maxClusterSlot; } + + /// Internal Acessors for ComputeMachine + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackSkuPropertiesInternal.ComputeMachine { get => this._computeMachine; set { {_computeMachine = value;} } } + + /// Internal Acessors for ControllerMachine + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackSkuPropertiesInternal.ControllerMachine { get => this._controllerMachine; set { {_controllerMachine = value;} } } + + /// Internal Acessors for Description + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackSkuPropertiesInternal.Description { get => this._description; set { {_description = value;} } } + + /// Internal Acessors for MaxClusterSlot + long? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackSkuPropertiesInternal.MaxClusterSlot { get => this._maxClusterSlot; set { {_maxClusterSlot = value;} } } + + /// Internal Acessors for ProvisioningState + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackSkuPropertiesInternal.ProvisioningState { get => this._provisioningState; set { {_provisioningState = value;} } } + + /// Internal Acessors for RackType + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackSkuPropertiesInternal.RackType { get => this._rackType; set { {_rackType = value;} } } + + /// Internal Acessors for StorageAppliance + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackSkuPropertiesInternal.StorageAppliance { get => this._storageAppliance; set { {_storageAppliance = value;} } } + + /// Internal Acessors for SupportedRackSkuId + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackSkuPropertiesInternal.SupportedRackSkuId { get => this._supportedRackSkuId; set { {_supportedRackSkuId = value;} } } + + /// Backing field for property. + private string _provisioningState; + + /// The provisioning state of the rack SKU resource. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string ProvisioningState { get => this._provisioningState; } + + /// Backing field for property. + private string _rackType; + + /// The type of the rack. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string RackType { get => this._rackType; } + + /// Backing field for property. + private System.Collections.Generic.List _storageAppliance; + + /// + /// The list of appliance SKUs and associated rack slot for the storage appliance(s) in this rack model. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public System.Collections.Generic.List StorageAppliance { get => this._storageAppliance; } + + /// Backing field for property. + private System.Collections.Generic.List _supportedRackSkuId; + + /// The list of supported SKUs if the rack is an aggregator. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public System.Collections.Generic.List SupportedRackSkuId { get => this._supportedRackSkuId; } + + /// Creates an new instance. + public RackSkuProperties() + { + + } + } + /// RackSkuProperties represents the properties of compute-related hardware for a rack. This supports both aggregator and + /// compute racks. + public partial interface IRackSkuProperties : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable + { + /// + /// The list of machine SKUs and associated rack slot for the compute-dedicated machines in this rack model. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The list of machine SKUs and associated rack slot for the compute-dedicated machines in this rack model.", + SerializedName = @"computeMachines", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuSlot) })] + System.Collections.Generic.List ComputeMachine { get; } + /// + /// The list of machine SKUs and associated rack slot for the control-plane dedicated machines in this rack model. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The list of machine SKUs and associated rack slot for the control-plane dedicated machines in this rack model.", + SerializedName = @"controllerMachines", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IMachineSkuSlot) })] + System.Collections.Generic.List ControllerMachine { get; } + /// The free-form text describing the rack. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The free-form text describing the rack.", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string Description { get; } + /// + /// The maximum number of compute racks supported by an aggregator rack. 0 if this is a compute rack or a rack for a single + /// rack cluster(rackType="Single"). + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The maximum number of compute racks supported by an aggregator rack. 0 if this is a compute rack or a rack for a single rack cluster(rackType=""Single"").", + SerializedName = @"maxClusterSlots", + PossibleTypes = new [] { typeof(long) })] + long? MaxClusterSlot { get; } + /// The provisioning state of the rack SKU resource. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The provisioning state of the rack SKU resource.", + SerializedName = @"provisioningState", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Canceled", "Failed", "Succeeded")] + string ProvisioningState { get; } + /// The type of the rack. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The type of the rack.", + SerializedName = @"rackType", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Aggregator", "Compute", "Single")] + string RackType { get; } + /// + /// The list of appliance SKUs and associated rack slot for the storage appliance(s) in this rack model. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The list of appliance SKUs and associated rack slot for the storage appliance(s) in this rack model.", + SerializedName = @"storageAppliances", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceSkuSlot) })] + System.Collections.Generic.List StorageAppliance { get; } + /// The list of supported SKUs if the rack is an aggregator. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The list of supported SKUs if the rack is an aggregator.", + SerializedName = @"supportedRackSkuIds", + PossibleTypes = new [] { typeof(string) })] + System.Collections.Generic.List SupportedRackSkuId { get; } + + } + /// RackSkuProperties represents the properties of compute-related hardware for a rack. This supports both aggregator and + /// compute racks. + internal partial interface IRackSkuPropertiesInternal + + { + /// + /// The list of machine SKUs and associated rack slot for the compute-dedicated machines in this rack model. + /// + System.Collections.Generic.List ComputeMachine { get; set; } + /// + /// The list of machine SKUs and associated rack slot for the control-plane dedicated machines in this rack model. + /// + System.Collections.Generic.List ControllerMachine { get; set; } + /// The free-form text describing the rack. + string Description { get; set; } + /// + /// The maximum number of compute racks supported by an aggregator rack. 0 if this is a compute rack or a rack for a single + /// rack cluster(rackType="Single"). + /// + long? MaxClusterSlot { get; set; } + /// The provisioning state of the rack SKU resource. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Canceled", "Failed", "Succeeded")] + string ProvisioningState { get; set; } + /// The type of the rack. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Aggregator", "Compute", "Single")] + string RackType { get; set; } + /// + /// The list of appliance SKUs and associated rack slot for the storage appliance(s) in this rack model. + /// + System.Collections.Generic.List StorageAppliance { get; set; } + /// The list of supported SKUs if the rack is an aggregator. + System.Collections.Generic.List SupportedRackSkuId { get; set; } + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/RackSkuProperties.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/RackSkuProperties.json.cs similarity index 82% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/RackSkuProperties.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/RackSkuProperties.json.cs index a1a57a1ea22d..767b32aed26b 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/RackSkuProperties.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/RackSkuProperties.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -57,13 +57,13 @@ public partial class RackSkuProperties partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackSkuProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackSkuProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackSkuProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackSkuProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackSkuProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackSkuProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new RackSkuProperties(json) : null; } @@ -80,14 +80,14 @@ internal RackSkuProperties(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runti { return; } - {_computeMachine = If( json?.PropertyT("computeMachines"), out var __jsonComputeMachines) ? If( __jsonComputeMachines as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IMachineSkuSlot) (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.MachineSkuSlot.FromJson(__u) )) ))() : null : ComputeMachine;} - {_controllerMachine = If( json?.PropertyT("controllerMachines"), out var __jsonControllerMachines) ? If( __jsonControllerMachines as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IMachineSkuSlot) (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.MachineSkuSlot.FromJson(__p) )) ))() : null : ControllerMachine;} - {_description = If( json?.PropertyT("description"), out var __jsonDescription) ? (string)__jsonDescription : (string)Description;} - {_maxClusterSlot = If( json?.PropertyT("maxClusterSlots"), out var __jsonMaxClusterSlots) ? (long?)__jsonMaxClusterSlots : MaxClusterSlot;} - {_provisioningState = If( json?.PropertyT("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)ProvisioningState;} - {_rackType = If( json?.PropertyT("rackType"), out var __jsonRackType) ? (string)__jsonRackType : (string)RackType;} - {_storageAppliance = If( json?.PropertyT("storageAppliances"), out var __jsonStorageAppliances) ? If( __jsonStorageAppliances as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonArray, out var __l) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__l, (__k)=>(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceSkuSlot) (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.StorageApplianceSkuSlot.FromJson(__k) )) ))() : null : StorageAppliance;} - {_supportedRackSkuId = If( json?.PropertyT("supportedRackSkuIds"), out var __jsonSupportedRackSkuIds) ? If( __jsonSupportedRackSkuIds as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Json.JsonString __e ? (string)(__e.ToString()) : null)) ))() : null : SupportedRackSkuId;} + {_computeMachine = If( json?.PropertyT("computeMachines"), out var __jsonComputeMachines) ? If( __jsonComputeMachines as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.IMachineSkuSlot) (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.MachineSkuSlot.FromJson(__u) )) ))() : null : _computeMachine;} + {_controllerMachine = If( json?.PropertyT("controllerMachines"), out var __jsonControllerMachines) ? If( __jsonControllerMachines as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.IMachineSkuSlot) (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.MachineSkuSlot.FromJson(__p) )) ))() : null : _controllerMachine;} + {_description = If( json?.PropertyT("description"), out var __jsonDescription) ? (string)__jsonDescription : (string)_description;} + {_maxClusterSlot = If( json?.PropertyT("maxClusterSlots"), out var __jsonMaxClusterSlots) ? (long?)__jsonMaxClusterSlots : _maxClusterSlot;} + {_provisioningState = If( json?.PropertyT("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)_provisioningState;} + {_rackType = If( json?.PropertyT("rackType"), out var __jsonRackType) ? (string)__jsonRackType : (string)_rackType;} + {_storageAppliance = If( json?.PropertyT("storageAppliances"), out var __jsonStorageAppliances) ? If( __jsonStorageAppliances as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonArray, out var __l) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__l, (__k)=>(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceSkuSlot) (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.StorageApplianceSkuSlot.FromJson(__k) )) ))() : null : _storageAppliance;} + {_supportedRackSkuId = If( json?.PropertyT("supportedRackSkuIds"), out var __jsonSupportedRackSkuIds) ? If( __jsonSupportedRackSkuIds as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Json.JsonString __e ? (string)(__e.ToString()) : null)) ))() : null : _supportedRackSkuId;} AfterFromJson(json); } @@ -110,7 +110,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode ToJ { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { if (null != this._computeMachine) { @@ -122,7 +122,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode ToJ container.Add("computeMachines",__w); } } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { if (null != this._controllerMachine) { @@ -134,23 +134,23 @@ public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode ToJ container.Add("controllerMachines",__r); } } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._description)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._description.ToString()) : null, "description" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != this._maxClusterSlot ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNumber((long)this._maxClusterSlot) : null, "maxClusterSlots" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._provisioningState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._provisioningState.ToString()) : null, "provisioningState" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._rackType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._rackType.ToString()) : null, "rackType" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { if (null != this._storageAppliance) { @@ -162,7 +162,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode ToJ container.Add("storageAppliances",__m); } } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { if (null != this._supportedRackSkuId) { diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/RacksPatchProperties.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/RacksPatchProperties.PowerShell.cs similarity index 80% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/RacksPatchProperties.PowerShell.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/RacksPatchProperties.PowerShell.cs index 0ee06d598198..efd452b17013 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/RacksPatchProperties.PowerShell.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/RacksPatchProperties.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; @@ -63,27 +63,27 @@ public partial class RacksPatchProperties 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.NetworkCloud.Models.Api20250201.IRacksPatchProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRacksPatchProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new RacksPatchProperties(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.NetworkCloud.Models.Api20250201.IRacksPatchProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRacksPatchProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new RacksPatchProperties(content); } @@ -93,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRacksPatchProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRacksPatchProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 RacksPatchProperties(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("RackLocation")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRacksPatchPropertiesInternal)this).RackLocation = (string) content.GetValueForProperty("RackLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRacksPatchPropertiesInternal)this).RackLocation, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRacksPatchPropertiesInternal)this).RackLocation = (string) content.GetValueForProperty("RackLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRacksPatchPropertiesInternal)this).RackLocation, global::System.Convert.ToString); } if (content.Contains("RackSerialNumber")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRacksPatchPropertiesInternal)this).RackSerialNumber = (string) content.GetValueForProperty("RackSerialNumber",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRacksPatchPropertiesInternal)this).RackSerialNumber, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRacksPatchPropertiesInternal)this).RackSerialNumber = (string) content.GetValueForProperty("RackSerialNumber",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRacksPatchPropertiesInternal)this).RackSerialNumber, 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 RacksPatchProperties(global::System.Management.Automation.PSObject cont // actually deserialize if (content.Contains("RackLocation")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRacksPatchPropertiesInternal)this).RackLocation = (string) content.GetValueForProperty("RackLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRacksPatchPropertiesInternal)this).RackLocation, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRacksPatchPropertiesInternal)this).RackLocation = (string) content.GetValueForProperty("RackLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRacksPatchPropertiesInternal)this).RackLocation, global::System.Convert.ToString); } if (content.Contains("RackSerialNumber")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRacksPatchPropertiesInternal)this).RackSerialNumber = (string) content.GetValueForProperty("RackSerialNumber",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRacksPatchPropertiesInternal)this).RackSerialNumber, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRacksPatchPropertiesInternal)this).RackSerialNumber = (string) content.GetValueForProperty("RackSerialNumber",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRacksPatchPropertiesInternal)this).RackSerialNumber, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/RacksPatchProperties.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/RacksPatchProperties.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/RacksPatchProperties.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/RacksPatchProperties.TypeConverter.cs index ff99f71d6d97..95cf530626d4 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/RacksPatchProperties.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/RacksPatchProperties.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IRacksPatchProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRacksPatchProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRacksPatchProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRacksPatchProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/RacksPatchProperties.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/RacksPatchProperties.cs similarity index 91% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/RacksPatchProperties.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/RacksPatchProperties.cs index 8dc141c01ed3..7fea3bce934a 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/RacksPatchProperties.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/RacksPatchProperties.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; /// RacksPatchProperties represents the properties of the rack during patching. public partial class RacksPatchProperties : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRacksPatchProperties, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRacksPatchPropertiesInternal + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRacksPatchProperties, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRacksPatchPropertiesInternal { /// Backing field for property. @@ -45,6 +45,9 @@ public partial interface IRacksPatchProperties : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The free-form description of the rack location. (e.g. “DTN Datacenter, Floor 3, Isle 9, Rack 2B”)", SerializedName = @"rackLocation", PossibleTypes = new [] { typeof(string) })] @@ -53,6 +56,9 @@ public partial interface IRacksPatchProperties : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The globally unique identifier for the rack.", SerializedName = @"rackSerialNumber", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/RacksPatchProperties.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/RacksPatchProperties.json.cs similarity index 95% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/RacksPatchProperties.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/RacksPatchProperties.json.cs index c7400dc23506..9df61a517fc0 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/RacksPatchProperties.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/RacksPatchProperties.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class RacksPatchProperties partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRacksPatchProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRacksPatchProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRacksPatchProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRacksPatchProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRacksPatchProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRacksPatchProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new RacksPatchProperties(json) : null; } @@ -77,8 +77,8 @@ internal RacksPatchProperties(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Ru { return; } - {_rackLocation = If( json?.PropertyT("rackLocation"), out var __jsonRackLocation) ? (string)__jsonRackLocation : (string)RackLocation;} - {_rackSerialNumber = If( json?.PropertyT("rackSerialNumber"), out var __jsonRackSerialNumber) ? (string)__jsonRackSerialNumber : (string)RackSerialNumber;} + {_rackLocation = If( json?.PropertyT("rackLocation"), out var __jsonRackLocation) ? (string)__jsonRackLocation : (string)_rackLocation;} + {_rackSerialNumber = If( json?.PropertyT("rackSerialNumber"), out var __jsonRackSerialNumber) ? (string)__jsonRackSerialNumber : (string)_rackSerialNumber;} AfterFromJson(json); } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Resource.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Resource.PowerShell.cs new file mode 100644 index 000000000000..e5b9db0b4655 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Resource.PowerShell.cs @@ -0,0 +1,238 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + + /// + /// Common fields that are returned in the response for all Azure Resource Manager resources + /// + [System.ComponentModel.TypeConverter(typeof(ResourceTypeConverter))] + public partial class Resource + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResource DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new Resource(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new Resource(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal Resource(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)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("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedByType = (string) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedByType = (string) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)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 Resource(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)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("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedByType = (string) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedByType = (string) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)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.NetworkCloud.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } + } + /// Common fields that are returned in the response for all Azure Resource Manager resources + [System.ComponentModel.TypeConverter(typeof(ResourceTypeConverter))] + public partial interface IResource + + { + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Resource.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Resource.TypeConverter.cs new file mode 100644 index 000000000000..83fe64e49bcc --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Resource.TypeConverter.cs @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ResourceTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResource ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResource).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return Resource.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return Resource.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return Resource.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Resource.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Resource.cs new file mode 100644 index 000000000000..ef8cd3bad22d --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Resource.cs @@ -0,0 +1,257 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + + /// + /// Common fields that are returned in the response for all Azure Resource Manager resources + /// + public partial class Resource : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResource, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal + { + + /// Backing field for property. + private string _id; + + /// + /// Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string Id { get => this._id; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.Id { get => this._id; set { {_id = value;} } } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.Name { get => this._name; set { {_name = value;} } } + + /// Internal Acessors for SystemData + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISystemData Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.SystemData()); set { {_systemData = value;} } } + + /// Internal Acessors for SystemDataCreatedAt + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISystemDataInternal)SystemData).CreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISystemDataInternal)SystemData).CreatedAt = value ?? default(global::System.DateTime); } + + /// Internal Acessors for SystemDataCreatedBy + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISystemDataInternal)SystemData).CreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISystemDataInternal)SystemData).CreatedBy = value ?? null; } + + /// Internal Acessors for SystemDataCreatedByType + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISystemDataInternal)SystemData).CreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISystemDataInternal)SystemData).CreatedByType = value ?? null; } + + /// Internal Acessors for SystemDataLastModifiedAt + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISystemDataInternal)SystemData).LastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISystemDataInternal)SystemData).LastModifiedAt = value ?? default(global::System.DateTime); } + + /// Internal Acessors for SystemDataLastModifiedBy + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISystemDataInternal)SystemData).LastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISystemDataInternal)SystemData).LastModifiedBy = value ?? null; } + + /// Internal Acessors for SystemDataLastModifiedByType + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISystemDataInternal)SystemData).LastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISystemDataInternal)SystemData).LastModifiedByType = value ?? null; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.Type { get => this._type; set { {_type = value;} } } + + /// Backing field for property. + private string _name; + + /// The name of the resource + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string Name { get => this._name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISystemData _systemData; + + /// + /// Azure Resource Manager metadata containing createdBy and modifiedBy information. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISystemData SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.SystemData()); } + + /// The timestamp of resource creation (UTC). + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISystemDataInternal)SystemData).CreatedAt; } + + /// The identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISystemDataInternal)SystemData).CreatedBy; } + + /// The type of identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISystemDataInternal)SystemData).CreatedByType; } + + /// The timestamp of resource last modification (UTC) + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISystemDataInternal)SystemData).LastModifiedAt; } + + /// The identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISystemDataInternal)SystemData).LastModifiedBy; } + + /// The type of identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISystemDataInternal)SystemData).LastModifiedByType; } + + /// Backing field for property. + private string _type; + + /// + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string Type { get => this._type; } + + /// Creates an new instance. + public Resource() + { + + } + } + /// Common fields that are returned in the response for all Azure Resource Manager resources + public partial interface IResource : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable + { + /// + /// Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"Fully qualified resource ID for the resource. E.g. ""/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}""", + SerializedName = @"id", + PossibleTypes = new [] { typeof(string) })] + string Id { get; } + /// The name of the resource + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The name of the resource", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string Name { get; } + /// The timestamp of resource creation (UTC). + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = 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; } + /// The identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = 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; } + /// The type of identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The type of identity that created the resource.", + SerializedName = @"createdByType", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("User", "Application", "ManagedIdentity", "Key")] + string SystemDataCreatedByType { get; } + /// The timestamp of resource last modification (UTC) + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = 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; } + /// The identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = 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; } + /// The type of identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The type of identity that last modified the resource.", + SerializedName = @"lastModifiedByType", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("User", "Application", "ManagedIdentity", "Key")] + string SystemDataLastModifiedByType { get; } + /// + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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) })] + string Type { get; } + + } + /// Common fields that are returned in the response for all Azure Resource Manager resources + internal partial interface IResourceInternal + + { + /// + /// Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + /// + string Id { get; set; } + /// The name of the resource + string Name { get; set; } + /// + /// Azure Resource Manager metadata containing createdBy and modifiedBy information. + /// + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("User", "Application", "ManagedIdentity", "Key")] + string SystemDataLastModifiedByType { get; set; } + /// + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + /// + string Type { get; set; } + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Resource.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Resource.json.cs new file mode 100644 index 000000000000..8a5a835722ea --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Resource.json.cs @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + + /// + /// Common fields that are returned in the response for all Azure Resource Manager resources + /// + public partial class Resource + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResource. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResource. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new Resource(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject instance to deserialize from. + internal Resource(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_systemData = If( json?.PropertyT("systemData"), out var __jsonSystemData) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.SystemData.FromJson(__jsonSystemData) : _systemData;} + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)_id;} + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)_name;} + {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)_type;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) + { + AddIf( null != this._systemData ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) this._systemData.ToJson(null,serializationMode) : null, "systemData" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) + { + AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) + { + AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) + { + AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._type.ToString()) : null, "type" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/RuntimeProtectionConfiguration.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/RuntimeProtectionConfiguration.PowerShell.cs similarity index 81% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/RuntimeProtectionConfiguration.PowerShell.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/RuntimeProtectionConfiguration.PowerShell.cs index 451af05c7ab6..36c634113f12 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/RuntimeProtectionConfiguration.PowerShell.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/RuntimeProtectionConfiguration.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; @@ -65,29 +65,27 @@ public partial class RuntimeProtectionConfiguration 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.NetworkCloud.Models.Api20250201.IRuntimeProtectionConfiguration DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRuntimeProtectionConfiguration DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new RuntimeProtectionConfiguration(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.NetworkCloud.Models.Api20250201.IRuntimeProtectionConfiguration DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRuntimeProtectionConfiguration DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new RuntimeProtectionConfiguration(content); } @@ -97,10 +95,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRuntimeProtectionConfiguration FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRuntimeProtectionConfiguration FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,13 +113,13 @@ internal RuntimeProtectionConfiguration(global::System.Collections.IDictionary c // actually deserialize if (content.Contains("EnforcementLevel")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRuntimeProtectionConfigurationInternal)this).EnforcementLevel = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RuntimeProtectionEnforcementLevel?) content.GetValueForProperty("EnforcementLevel",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRuntimeProtectionConfigurationInternal)this).EnforcementLevel, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RuntimeProtectionEnforcementLevel.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRuntimeProtectionConfigurationInternal)this).EnforcementLevel = (string) content.GetValueForProperty("EnforcementLevel",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRuntimeProtectionConfigurationInternal)this).EnforcementLevel, 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,7 +134,7 @@ internal RuntimeProtectionConfiguration(global::System.Management.Automation.PSO // actually deserialize if (content.Contains("EnforcementLevel")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRuntimeProtectionConfigurationInternal)this).EnforcementLevel = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RuntimeProtectionEnforcementLevel?) content.GetValueForProperty("EnforcementLevel",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRuntimeProtectionConfigurationInternal)this).EnforcementLevel, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RuntimeProtectionEnforcementLevel.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRuntimeProtectionConfigurationInternal)this).EnforcementLevel = (string) content.GetValueForProperty("EnforcementLevel",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRuntimeProtectionConfigurationInternal)this).EnforcementLevel, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/RuntimeProtectionConfiguration.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/RuntimeProtectionConfiguration.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/RuntimeProtectionConfiguration.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/RuntimeProtectionConfiguration.TypeConverter.cs index 182d79522ebd..02a3923187a3 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/RuntimeProtectionConfiguration.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/RuntimeProtectionConfiguration.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IRuntimeProtectionConfiguration ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRuntimeProtectionConfiguration ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRuntimeProtectionConfiguration).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRuntimeProtectionConfiguration).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/RuntimeProtectionConfiguration.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/RuntimeProtectionConfiguration.cs new file mode 100644 index 000000000000..489d99656645 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/RuntimeProtectionConfiguration.cs @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + + /// + /// RuntimeProtectionConfiguration represents the runtime protection configuration for the cluster. + /// + public partial class RuntimeProtectionConfiguration : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRuntimeProtectionConfiguration, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRuntimeProtectionConfigurationInternal + { + + /// Backing field for property. + private string _enforcementLevel; + + /// The mode of operation for runtime protection. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string EnforcementLevel { get => this._enforcementLevel; set => this._enforcementLevel = value; } + + /// Creates an new instance. + public RuntimeProtectionConfiguration() + { + + } + } + /// RuntimeProtectionConfiguration represents the runtime protection configuration for the cluster. + public partial interface IRuntimeProtectionConfiguration : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable + { + /// The mode of operation for runtime protection. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The mode of operation for runtime protection.", + SerializedName = @"enforcementLevel", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Audit", "Disabled", "OnDemand", "Passive", "RealTime")] + string EnforcementLevel { get; set; } + + } + /// RuntimeProtectionConfiguration represents the runtime protection configuration for the cluster. + internal partial interface IRuntimeProtectionConfigurationInternal + + { + /// The mode of operation for runtime protection. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Audit", "Disabled", "OnDemand", "Passive", "RealTime")] + string EnforcementLevel { get; set; } + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/RuntimeProtectionConfiguration.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/RuntimeProtectionConfiguration.json.cs similarity index 94% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/RuntimeProtectionConfiguration.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/RuntimeProtectionConfiguration.json.cs index 92e16e9f7172..74f299cf8e5e 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/RuntimeProtectionConfiguration.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/RuntimeProtectionConfiguration.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -56,13 +56,13 @@ public partial class RuntimeProtectionConfiguration partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRuntimeProtectionConfiguration. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRuntimeProtectionConfiguration. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRuntimeProtectionConfiguration. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRuntimeProtectionConfiguration. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRuntimeProtectionConfiguration FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRuntimeProtectionConfiguration FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new RuntimeProtectionConfiguration(json) : null; } @@ -79,7 +79,7 @@ internal RuntimeProtectionConfiguration(Microsoft.Azure.PowerShell.Cmdlets.Netwo { return; } - {_enforcementLevel = If( json?.PropertyT("enforcementLevel"), out var __jsonEnforcementLevel) ? (string)__jsonEnforcementLevel : (string)EnforcementLevel;} + {_enforcementLevel = If( json?.PropertyT("enforcementLevel"), out var __jsonEnforcementLevel) ? (string)__jsonEnforcementLevel : (string)_enforcementLevel;} AfterFromJson(json); } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/RuntimeProtectionStatus.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/RuntimeProtectionStatus.PowerShell.cs new file mode 100644 index 000000000000..3d3192ce12d9 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/RuntimeProtectionStatus.PowerShell.cs @@ -0,0 +1,198 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + + /// + /// RuntimeProtectionStatus represents the runtime protection status of the bare metal machine. + /// + [System.ComponentModel.TypeConverter(typeof(RuntimeProtectionStatusTypeConverter))] + public partial class RuntimeProtectionStatus + { + + /// + /// 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.NetworkCloud.Models.IRuntimeProtectionStatus DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new RuntimeProtectionStatus(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.NetworkCloud.Models.IRuntimeProtectionStatus DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new RuntimeProtectionStatus(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.NetworkCloud.Models.IRuntimeProtectionStatus FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal RuntimeProtectionStatus(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("DefinitionsLastUpdated")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRuntimeProtectionStatusInternal)this).DefinitionsLastUpdated = (global::System.DateTime?) content.GetValueForProperty("DefinitionsLastUpdated",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRuntimeProtectionStatusInternal)this).DefinitionsLastUpdated, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("DefinitionsVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRuntimeProtectionStatusInternal)this).DefinitionsVersion = (string) content.GetValueForProperty("DefinitionsVersion",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRuntimeProtectionStatusInternal)this).DefinitionsVersion, global::System.Convert.ToString); + } + if (content.Contains("ScanCompletedTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRuntimeProtectionStatusInternal)this).ScanCompletedTime = (global::System.DateTime?) content.GetValueForProperty("ScanCompletedTime",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRuntimeProtectionStatusInternal)this).ScanCompletedTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ScanScheduledTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRuntimeProtectionStatusInternal)this).ScanScheduledTime = (global::System.DateTime?) content.GetValueForProperty("ScanScheduledTime",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRuntimeProtectionStatusInternal)this).ScanScheduledTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ScanStartedTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRuntimeProtectionStatusInternal)this).ScanStartedTime = (global::System.DateTime?) content.GetValueForProperty("ScanStartedTime",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRuntimeProtectionStatusInternal)this).ScanStartedTime, (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 RuntimeProtectionStatus(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("DefinitionsLastUpdated")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRuntimeProtectionStatusInternal)this).DefinitionsLastUpdated = (global::System.DateTime?) content.GetValueForProperty("DefinitionsLastUpdated",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRuntimeProtectionStatusInternal)this).DefinitionsLastUpdated, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("DefinitionsVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRuntimeProtectionStatusInternal)this).DefinitionsVersion = (string) content.GetValueForProperty("DefinitionsVersion",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRuntimeProtectionStatusInternal)this).DefinitionsVersion, global::System.Convert.ToString); + } + if (content.Contains("ScanCompletedTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRuntimeProtectionStatusInternal)this).ScanCompletedTime = (global::System.DateTime?) content.GetValueForProperty("ScanCompletedTime",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRuntimeProtectionStatusInternal)this).ScanCompletedTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ScanScheduledTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRuntimeProtectionStatusInternal)this).ScanScheduledTime = (global::System.DateTime?) content.GetValueForProperty("ScanScheduledTime",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRuntimeProtectionStatusInternal)this).ScanScheduledTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ScanStartedTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRuntimeProtectionStatusInternal)this).ScanStartedTime = (global::System.DateTime?) content.GetValueForProperty("ScanStartedTime",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRuntimeProtectionStatusInternal)this).ScanStartedTime, (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.NetworkCloud.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(); + } + } + /// RuntimeProtectionStatus represents the runtime protection status of the bare metal machine. + [System.ComponentModel.TypeConverter(typeof(RuntimeProtectionStatusTypeConverter))] + public partial interface IRuntimeProtectionStatus + + { + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/RuntimeProtectionStatus.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/RuntimeProtectionStatus.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/RuntimeProtectionStatus.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/RuntimeProtectionStatus.TypeConverter.cs index 2a58f5142d34..fbebecc80f3e 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/RuntimeProtectionStatus.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/RuntimeProtectionStatus.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IRuntimeProtectionStatus ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRuntimeProtectionStatus ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRuntimeProtectionStatus).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRuntimeProtectionStatus).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/RuntimeProtectionStatus.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/RuntimeProtectionStatus.cs similarity index 86% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/RuntimeProtectionStatus.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/RuntimeProtectionStatus.cs index f39cb26904e8..c151442539a6 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/RuntimeProtectionStatus.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/RuntimeProtectionStatus.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -11,8 +11,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201 /// RuntimeProtectionStatus represents the runtime protection status of the bare metal machine. /// public partial class RuntimeProtectionStatus : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRuntimeProtectionStatus, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRuntimeProtectionStatusInternal + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRuntimeProtectionStatus, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRuntimeProtectionStatusInternal { /// Backing field for property. @@ -30,19 +30,19 @@ public partial class RuntimeProtectionStatus : public string DefinitionsVersion { get => this._definitionsVersion; } /// Internal Acessors for DefinitionsLastUpdated - global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRuntimeProtectionStatusInternal.DefinitionsLastUpdated { get => this._definitionsLastUpdated; set { {_definitionsLastUpdated = value;} } } + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRuntimeProtectionStatusInternal.DefinitionsLastUpdated { get => this._definitionsLastUpdated; set { {_definitionsLastUpdated = value;} } } /// Internal Acessors for DefinitionsVersion - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRuntimeProtectionStatusInternal.DefinitionsVersion { get => this._definitionsVersion; set { {_definitionsVersion = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRuntimeProtectionStatusInternal.DefinitionsVersion { get => this._definitionsVersion; set { {_definitionsVersion = value;} } } /// Internal Acessors for ScanCompletedTime - global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRuntimeProtectionStatusInternal.ScanCompletedTime { get => this._scanCompletedTime; set { {_scanCompletedTime = value;} } } + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRuntimeProtectionStatusInternal.ScanCompletedTime { get => this._scanCompletedTime; set { {_scanCompletedTime = value;} } } /// Internal Acessors for ScanScheduledTime - global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRuntimeProtectionStatusInternal.ScanScheduledTime { get => this._scanScheduledTime; set { {_scanScheduledTime = value;} } } + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRuntimeProtectionStatusInternal.ScanScheduledTime { get => this._scanScheduledTime; set { {_scanScheduledTime = value;} } } /// Internal Acessors for ScanStartedTime - global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRuntimeProtectionStatusInternal.ScanStartedTime { get => this._scanStartedTime; set { {_scanStartedTime = value;} } } + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRuntimeProtectionStatusInternal.ScanStartedTime { get => this._scanStartedTime; set { {_scanStartedTime = value;} } } /// Backing field for property. private global::System.DateTime? _scanCompletedTime; @@ -85,6 +85,9 @@ public partial interface IRuntimeProtectionStatus : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The timestamp when the malware definitions were last updated.", SerializedName = @"definitionsLastUpdated", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -93,6 +96,9 @@ public partial interface IRuntimeProtectionStatus : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The version of the malware definitions.", SerializedName = @"definitionsVersion", PossibleTypes = new [] { typeof(string) })] @@ -103,6 +109,9 @@ public partial interface IRuntimeProtectionStatus : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The timestamp of the most recently completed scan, or empty if there has never been a scan.", SerializedName = @"scanCompletedTime", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -113,6 +122,9 @@ public partial interface IRuntimeProtectionStatus : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The timestamp of the most recently scheduled scan, or empty if no scan has been scheduled.", SerializedName = @"scanScheduledTime", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -123,6 +135,9 @@ public partial interface IRuntimeProtectionStatus : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The timestamp of the most recently started scan, or empty if there has never been a scan.", SerializedName = @"scanStartedTime", PossibleTypes = new [] { typeof(global::System.DateTime) })] diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/RuntimeProtectionStatus.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/RuntimeProtectionStatus.json.cs similarity index 90% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/RuntimeProtectionStatus.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/RuntimeProtectionStatus.json.cs index 8d34b02976bd..30bd58fc16e3 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/RuntimeProtectionStatus.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/RuntimeProtectionStatus.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -56,13 +56,13 @@ public partial class RuntimeProtectionStatus partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRuntimeProtectionStatus. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRuntimeProtectionStatus. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRuntimeProtectionStatus. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRuntimeProtectionStatus. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRuntimeProtectionStatus FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRuntimeProtectionStatus FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new RuntimeProtectionStatus(json) : null; } @@ -79,11 +79,11 @@ internal RuntimeProtectionStatus(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud { return; } - {_definitionsLastUpdated = If( json?.PropertyT("definitionsLastUpdated"), out var __jsonDefinitionsLastUpdated) ? global::System.DateTime.TryParse((string)__jsonDefinitionsLastUpdated, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonDefinitionsLastUpdatedValue) ? __jsonDefinitionsLastUpdatedValue : DefinitionsLastUpdated : DefinitionsLastUpdated;} - {_definitionsVersion = If( json?.PropertyT("definitionsVersion"), out var __jsonDefinitionsVersion) ? (string)__jsonDefinitionsVersion : (string)DefinitionsVersion;} - {_scanCompletedTime = If( json?.PropertyT("scanCompletedTime"), out var __jsonScanCompletedTime) ? global::System.DateTime.TryParse((string)__jsonScanCompletedTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonScanCompletedTimeValue) ? __jsonScanCompletedTimeValue : ScanCompletedTime : ScanCompletedTime;} - {_scanScheduledTime = If( json?.PropertyT("scanScheduledTime"), out var __jsonScanScheduledTime) ? global::System.DateTime.TryParse((string)__jsonScanScheduledTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonScanScheduledTimeValue) ? __jsonScanScheduledTimeValue : ScanScheduledTime : ScanScheduledTime;} - {_scanStartedTime = If( json?.PropertyT("scanStartedTime"), out var __jsonScanStartedTime) ? global::System.DateTime.TryParse((string)__jsonScanStartedTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonScanStartedTimeValue) ? __jsonScanStartedTimeValue : ScanStartedTime : ScanStartedTime;} + {_definitionsLastUpdated = If( json?.PropertyT("definitionsLastUpdated"), out var __jsonDefinitionsLastUpdated) ? global::System.DateTime.TryParse((string)__jsonDefinitionsLastUpdated, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonDefinitionsLastUpdatedValue) ? __jsonDefinitionsLastUpdatedValue : _definitionsLastUpdated : _definitionsLastUpdated;} + {_definitionsVersion = If( json?.PropertyT("definitionsVersion"), out var __jsonDefinitionsVersion) ? (string)__jsonDefinitionsVersion : (string)_definitionsVersion;} + {_scanCompletedTime = If( json?.PropertyT("scanCompletedTime"), out var __jsonScanCompletedTime) ? global::System.DateTime.TryParse((string)__jsonScanCompletedTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonScanCompletedTimeValue) ? __jsonScanCompletedTimeValue : _scanCompletedTime : _scanCompletedTime;} + {_scanScheduledTime = If( json?.PropertyT("scanScheduledTime"), out var __jsonScanScheduledTime) ? global::System.DateTime.TryParse((string)__jsonScanScheduledTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonScanScheduledTimeValue) ? __jsonScanScheduledTimeValue : _scanScheduledTime : _scanScheduledTime;} + {_scanStartedTime = If( json?.PropertyT("scanStartedTime"), out var __jsonScanStartedTime) ? global::System.DateTime.TryParse((string)__jsonScanStartedTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonScanStartedTimeValue) ? __jsonScanStartedTimeValue : _scanStartedTime : _scanStartedTime;} AfterFromJson(json); } @@ -106,23 +106,23 @@ public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode ToJ { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != this._definitionsLastUpdated ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._definitionsLastUpdated?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "definitionsLastUpdated" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._definitionsVersion)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._definitionsVersion.ToString()) : null, "definitionsVersion" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != this._scanCompletedTime ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._scanCompletedTime?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "scanCompletedTime" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != this._scanScheduledTime ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._scanScheduledTime?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "scanScheduledTime" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != this._scanStartedTime ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._scanStartedTime?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "scanStartedTime" ,container.Add ); } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/SecretArchiveReference.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/SecretArchiveReference.PowerShell.cs similarity index 76% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/SecretArchiveReference.PowerShell.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/SecretArchiveReference.PowerShell.cs index d03454da49c9..8b98d5e24eae 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/SecretArchiveReference.PowerShell.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/SecretArchiveReference.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; @@ -63,29 +63,27 @@ public partial class SecretArchiveReference 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.NetworkCloud.Models.Api20250201.ISecretArchiveReference DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISecretArchiveReference DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new SecretArchiveReference(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.NetworkCloud.Models.Api20250201.ISecretArchiveReference DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISecretArchiveReference DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new SecretArchiveReference(content); } @@ -95,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretArchiveReference FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISecretArchiveReference FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 SecretArchiveReference(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("KeyVaultId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretArchiveReferenceInternal)this).KeyVaultId = (string) content.GetValueForProperty("KeyVaultId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretArchiveReferenceInternal)this).KeyVaultId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISecretArchiveReferenceInternal)this).KeyVaultId = (string) content.GetValueForProperty("KeyVaultId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISecretArchiveReferenceInternal)this).KeyVaultId, global::System.Convert.ToString); } if (content.Contains("SecretName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretArchiveReferenceInternal)this).SecretName = (string) content.GetValueForProperty("SecretName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretArchiveReferenceInternal)this).SecretName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISecretArchiveReferenceInternal)this).SecretName = (string) content.GetValueForProperty("SecretName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISecretArchiveReferenceInternal)this).SecretName, global::System.Convert.ToString); } if (content.Contains("SecretVersion")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretArchiveReferenceInternal)this).SecretVersion = (string) content.GetValueForProperty("SecretVersion",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretArchiveReferenceInternal)this).SecretVersion, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISecretArchiveReferenceInternal)this).SecretVersion = (string) content.GetValueForProperty("SecretVersion",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISecretArchiveReferenceInternal)this).SecretVersion, 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 SecretArchiveReference(global::System.Management.Automation.PSObject co // actually deserialize if (content.Contains("KeyVaultId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretArchiveReferenceInternal)this).KeyVaultId = (string) content.GetValueForProperty("KeyVaultId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretArchiveReferenceInternal)this).KeyVaultId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISecretArchiveReferenceInternal)this).KeyVaultId = (string) content.GetValueForProperty("KeyVaultId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISecretArchiveReferenceInternal)this).KeyVaultId, global::System.Convert.ToString); } if (content.Contains("SecretName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretArchiveReferenceInternal)this).SecretName = (string) content.GetValueForProperty("SecretName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretArchiveReferenceInternal)this).SecretName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISecretArchiveReferenceInternal)this).SecretName = (string) content.GetValueForProperty("SecretName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISecretArchiveReferenceInternal)this).SecretName, global::System.Convert.ToString); } if (content.Contains("SecretVersion")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretArchiveReferenceInternal)this).SecretVersion = (string) content.GetValueForProperty("SecretVersion",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretArchiveReferenceInternal)this).SecretVersion, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISecretArchiveReferenceInternal)this).SecretVersion = (string) content.GetValueForProperty("SecretVersion",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISecretArchiveReferenceInternal)this).SecretVersion, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/SecretArchiveReference.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/SecretArchiveReference.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/SecretArchiveReference.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/SecretArchiveReference.TypeConverter.cs index 3c0148211668..1f3806377f55 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/SecretArchiveReference.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/SecretArchiveReference.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.ISecretArchiveReference ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISecretArchiveReference ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretArchiveReference).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISecretArchiveReference).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/SecretArchiveReference.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/SecretArchiveReference.cs similarity index 85% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/SecretArchiveReference.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/SecretArchiveReference.cs index b54b10b994fb..ee65cbd2db88 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/SecretArchiveReference.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/SecretArchiveReference.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; /// SecretArchiveReference represents the reference to a secret in a key vault. public partial class SecretArchiveReference : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretArchiveReference, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretArchiveReferenceInternal + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISecretArchiveReference, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISecretArchiveReferenceInternal { /// Backing field for property. @@ -21,13 +21,13 @@ public partial class SecretArchiveReference : public string KeyVaultId { get => this._keyVaultId; } /// Internal Acessors for KeyVaultId - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretArchiveReferenceInternal.KeyVaultId { get => this._keyVaultId; set { {_keyVaultId = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISecretArchiveReferenceInternal.KeyVaultId { get => this._keyVaultId; set { {_keyVaultId = value;} } } /// Internal Acessors for SecretName - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretArchiveReferenceInternal.SecretName { get => this._secretName; set { {_secretName = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISecretArchiveReferenceInternal.SecretName { get => this._secretName; set { {_secretName = value;} } } /// Internal Acessors for SecretVersion - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretArchiveReferenceInternal.SecretVersion { get => this._secretVersion; set { {_secretVersion = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISecretArchiveReferenceInternal.SecretVersion { get => this._secretVersion; set { {_secretVersion = value;} } } /// Backing field for property. private string _secretName; @@ -57,6 +57,9 @@ public partial interface ISecretArchiveReference : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The resource ID of the key vault containing the secret.", SerializedName = @"keyVaultId", PossibleTypes = new [] { typeof(string) })] @@ -65,6 +68,9 @@ public partial interface ISecretArchiveReference : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The name of the secret in the key vault.", SerializedName = @"secretName", PossibleTypes = new [] { typeof(string) })] @@ -73,6 +79,9 @@ public partial interface ISecretArchiveReference : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The version of the secret in the key vault.", SerializedName = @"secretVersion", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/SecretArchiveReference.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/SecretArchiveReference.json.cs similarity index 93% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/SecretArchiveReference.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/SecretArchiveReference.json.cs index 41425f063ee0..84e6b63ec798 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/SecretArchiveReference.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/SecretArchiveReference.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class SecretArchiveReference partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretArchiveReference. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISecretArchiveReference. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretArchiveReference. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISecretArchiveReference. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretArchiveReference FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISecretArchiveReference FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new SecretArchiveReference(json) : null; } @@ -77,9 +77,9 @@ internal SecretArchiveReference(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud. { return; } - {_keyVaultId = If( json?.PropertyT("keyVaultId"), out var __jsonKeyVaultId) ? (string)__jsonKeyVaultId : (string)KeyVaultId;} - {_secretName = If( json?.PropertyT("secretName"), out var __jsonSecretName) ? (string)__jsonSecretName : (string)SecretName;} - {_secretVersion = If( json?.PropertyT("secretVersion"), out var __jsonSecretVersion) ? (string)__jsonSecretVersion : (string)SecretVersion;} + {_keyVaultId = If( json?.PropertyT("keyVaultId"), out var __jsonKeyVaultId) ? (string)__jsonKeyVaultId : (string)_keyVaultId;} + {_secretName = If( json?.PropertyT("secretName"), out var __jsonSecretName) ? (string)__jsonSecretName : (string)_secretName;} + {_secretVersion = If( json?.PropertyT("secretVersion"), out var __jsonSecretVersion) ? (string)__jsonSecretVersion : (string)_secretVersion;} AfterFromJson(json); } @@ -102,15 +102,15 @@ public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode ToJ { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._keyVaultId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._keyVaultId.ToString()) : null, "keyVaultId" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._secretName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._secretName.ToString()) : null, "secretName" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._secretVersion)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._secretVersion.ToString()) : null, "secretVersion" ,container.Add ); } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/SecretArchiveSettings.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/SecretArchiveSettings.PowerShell.cs new file mode 100644 index 000000000000..4133d3ec4f25 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/SecretArchiveSettings.PowerShell.cs @@ -0,0 +1,190 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + + /// + /// SecretArchiveSettings represents the settings for the secret archive used to hold credentials for the cluster. + /// + [System.ComponentModel.TypeConverter(typeof(SecretArchiveSettingsTypeConverter))] + public partial class SecretArchiveSettings + { + + /// + /// 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.NetworkCloud.Models.ISecretArchiveSettings DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new SecretArchiveSettings(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.NetworkCloud.Models.ISecretArchiveSettings DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new SecretArchiveSettings(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.NetworkCloud.Models.ISecretArchiveSettings FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal SecretArchiveSettings(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("AssociatedIdentity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISecretArchiveSettingsInternal)this).AssociatedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IIdentitySelector) content.GetValueForProperty("AssociatedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISecretArchiveSettingsInternal)this).AssociatedIdentity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IdentitySelectorTypeConverter.ConvertFrom); + } + if (content.Contains("VaultUri")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISecretArchiveSettingsInternal)this).VaultUri = (string) content.GetValueForProperty("VaultUri",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISecretArchiveSettingsInternal)this).VaultUri, global::System.Convert.ToString); + } + if (content.Contains("AssociatedIdentityType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISecretArchiveSettingsInternal)this).AssociatedIdentityType = (string) content.GetValueForProperty("AssociatedIdentityType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISecretArchiveSettingsInternal)this).AssociatedIdentityType, global::System.Convert.ToString); + } + if (content.Contains("AssociatedIdentityUserAssignedIdentityResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISecretArchiveSettingsInternal)this).AssociatedIdentityUserAssignedIdentityResourceId = (string) content.GetValueForProperty("AssociatedIdentityUserAssignedIdentityResourceId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISecretArchiveSettingsInternal)this).AssociatedIdentityUserAssignedIdentityResourceId, 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 SecretArchiveSettings(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("AssociatedIdentity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISecretArchiveSettingsInternal)this).AssociatedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IIdentitySelector) content.GetValueForProperty("AssociatedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISecretArchiveSettingsInternal)this).AssociatedIdentity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IdentitySelectorTypeConverter.ConvertFrom); + } + if (content.Contains("VaultUri")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISecretArchiveSettingsInternal)this).VaultUri = (string) content.GetValueForProperty("VaultUri",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISecretArchiveSettingsInternal)this).VaultUri, global::System.Convert.ToString); + } + if (content.Contains("AssociatedIdentityType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISecretArchiveSettingsInternal)this).AssociatedIdentityType = (string) content.GetValueForProperty("AssociatedIdentityType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISecretArchiveSettingsInternal)this).AssociatedIdentityType, global::System.Convert.ToString); + } + if (content.Contains("AssociatedIdentityUserAssignedIdentityResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISecretArchiveSettingsInternal)this).AssociatedIdentityUserAssignedIdentityResourceId = (string) content.GetValueForProperty("AssociatedIdentityUserAssignedIdentityResourceId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISecretArchiveSettingsInternal)this).AssociatedIdentityUserAssignedIdentityResourceId, 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.NetworkCloud.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(); + } + } + /// SecretArchiveSettings represents the settings for the secret archive used to hold credentials for the cluster. + [System.ComponentModel.TypeConverter(typeof(SecretArchiveSettingsTypeConverter))] + public partial interface ISecretArchiveSettings + + { + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/SecretArchiveSettings.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/SecretArchiveSettings.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/SecretArchiveSettings.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/SecretArchiveSettings.TypeConverter.cs index c4771dfd3358..4532b1e08b06 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/SecretArchiveSettings.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/SecretArchiveSettings.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.ISecretArchiveSettings ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISecretArchiveSettings ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretArchiveSettings).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISecretArchiveSettings).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/SecretArchiveSettings.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/SecretArchiveSettings.cs new file mode 100644 index 000000000000..f0ae691f4422 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/SecretArchiveSettings.cs @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + + /// + /// SecretArchiveSettings represents the settings for the secret archive used to hold credentials for the cluster. + /// + public partial class SecretArchiveSettings : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISecretArchiveSettings, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISecretArchiveSettingsInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IIdentitySelector _associatedIdentity; + + /// + /// The selection of the managed identity to use with this vault URI. The identity type must be either system assigned or + /// user assigned. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IIdentitySelector AssociatedIdentity { get => (this._associatedIdentity = this._associatedIdentity ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IdentitySelector()); set => this._associatedIdentity = value; } + + /// The type of managed identity that is being selected. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string AssociatedIdentityType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IIdentitySelectorInternal)AssociatedIdentity).IdentityType; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IIdentitySelectorInternal)AssociatedIdentity).IdentityType = value ?? null; } + + /// + /// The user assigned managed identity resource ID to use. Mutually exclusive with a system assigned identity type. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string AssociatedIdentityUserAssignedIdentityResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IIdentitySelectorInternal)AssociatedIdentity).UserAssignedIdentityResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IIdentitySelectorInternal)AssociatedIdentity).UserAssignedIdentityResourceId = value ?? null; } + + /// Internal Acessors for AssociatedIdentity + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IIdentitySelector Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISecretArchiveSettingsInternal.AssociatedIdentity { get => (this._associatedIdentity = this._associatedIdentity ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IdentitySelector()); set { {_associatedIdentity = value;} } } + + /// Backing field for property. + private string _vaultUri; + + /// The URI for the key vault used as the secret archive. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string VaultUri { get => this._vaultUri; set => this._vaultUri = value; } + + /// Creates an new instance. + public SecretArchiveSettings() + { + + } + } + /// SecretArchiveSettings represents the settings for the secret archive used to hold credentials for the cluster. + public partial interface ISecretArchiveSettings : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable + { + /// The type of managed identity that is being selected. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The type of managed identity that is being selected.", + SerializedName = @"identityType", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("SystemAssignedIdentity", "UserAssignedIdentity")] + string AssociatedIdentityType { get; set; } + /// + /// The user assigned managed identity resource ID to use. Mutually exclusive with a system assigned identity type. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The user assigned managed identity resource ID to use. Mutually exclusive with a system assigned identity type.", + SerializedName = @"userAssignedIdentityResourceId", + PossibleTypes = new [] { typeof(string) })] + string AssociatedIdentityUserAssignedIdentityResourceId { get; set; } + /// The URI for the key vault used as the secret archive. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The URI for the key vault used as the secret archive.", + SerializedName = @"vaultUri", + PossibleTypes = new [] { typeof(string) })] + string VaultUri { get; set; } + + } + /// SecretArchiveSettings represents the settings for the secret archive used to hold credentials for the cluster. + internal partial interface ISecretArchiveSettingsInternal + + { + /// + /// The selection of the managed identity to use with this vault URI. The identity type must be either system assigned or + /// user assigned. + /// + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IIdentitySelector AssociatedIdentity { get; set; } + /// The type of managed identity that is being selected. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("SystemAssignedIdentity", "UserAssignedIdentity")] + string AssociatedIdentityType { get; set; } + /// + /// The user assigned managed identity resource ID to use. Mutually exclusive with a system assigned identity type. + /// + string AssociatedIdentityUserAssignedIdentityResourceId { get; set; } + /// The URI for the key vault used as the secret archive. + string VaultUri { get; set; } + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/SecretArchiveSettings.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/SecretArchiveSettings.json.cs similarity index 93% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/SecretArchiveSettings.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/SecretArchiveSettings.json.cs index 0ecd48a73f74..6ad84a22b45d 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/SecretArchiveSettings.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/SecretArchiveSettings.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -56,13 +56,13 @@ public partial class SecretArchiveSettings partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretArchiveSettings. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISecretArchiveSettings. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretArchiveSettings. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISecretArchiveSettings. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretArchiveSettings FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISecretArchiveSettings FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new SecretArchiveSettings(json) : null; } @@ -79,8 +79,8 @@ internal SecretArchiveSettings(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.R { return; } - {_associatedIdentity = If( json?.PropertyT("associatedIdentity"), out var __jsonAssociatedIdentity) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IdentitySelector.FromJson(__jsonAssociatedIdentity) : AssociatedIdentity;} - {_vaultUri = If( json?.PropertyT("vaultUri"), out var __jsonVaultUri) ? (string)__jsonVaultUri : (string)VaultUri;} + {_associatedIdentity = If( json?.PropertyT("associatedIdentity"), out var __jsonAssociatedIdentity) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IdentitySelector.FromJson(__jsonAssociatedIdentity) : _associatedIdentity;} + {_vaultUri = If( json?.PropertyT("vaultUri"), out var __jsonVaultUri) ? (string)__jsonVaultUri : (string)_vaultUri;} AfterFromJson(json); } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/SecretRotationStatus.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/SecretRotationStatus.PowerShell.cs new file mode 100644 index 000000000000..a20d75b7c08e --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/SecretRotationStatus.PowerShell.cs @@ -0,0 +1,220 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + + /// SecretRotationStatus represents the status of a secret rotation. + [System.ComponentModel.TypeConverter(typeof(SecretRotationStatusTypeConverter))] + public partial class SecretRotationStatus + { + + /// + /// 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.NetworkCloud.Models.ISecretRotationStatus DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new SecretRotationStatus(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.NetworkCloud.Models.ISecretRotationStatus DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new SecretRotationStatus(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.NetworkCloud.Models.ISecretRotationStatus FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal SecretRotationStatus(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("SecretArchiveReference")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISecretRotationStatusInternal)this).SecretArchiveReference = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISecretArchiveReference) content.GetValueForProperty("SecretArchiveReference",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISecretRotationStatusInternal)this).SecretArchiveReference, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.SecretArchiveReferenceTypeConverter.ConvertFrom); + } + if (content.Contains("ExpirePeriodDay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISecretRotationStatusInternal)this).ExpirePeriodDay = (long?) content.GetValueForProperty("ExpirePeriodDay",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISecretRotationStatusInternal)this).ExpirePeriodDay, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("LastRotationTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISecretRotationStatusInternal)this).LastRotationTime = (global::System.DateTime?) content.GetValueForProperty("LastRotationTime",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISecretRotationStatusInternal)this).LastRotationTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("RotationPeriodDay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISecretRotationStatusInternal)this).RotationPeriodDay = (long?) content.GetValueForProperty("RotationPeriodDay",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISecretRotationStatusInternal)this).RotationPeriodDay, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("SecretType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISecretRotationStatusInternal)this).SecretType = (string) content.GetValueForProperty("SecretType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISecretRotationStatusInternal)this).SecretType, global::System.Convert.ToString); + } + if (content.Contains("SecretArchiveReferenceSecretName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISecretRotationStatusInternal)this).SecretArchiveReferenceSecretName = (string) content.GetValueForProperty("SecretArchiveReferenceSecretName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISecretRotationStatusInternal)this).SecretArchiveReferenceSecretName, global::System.Convert.ToString); + } + if (content.Contains("SecretArchiveReferenceSecretVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISecretRotationStatusInternal)this).SecretArchiveReferenceSecretVersion = (string) content.GetValueForProperty("SecretArchiveReferenceSecretVersion",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISecretRotationStatusInternal)this).SecretArchiveReferenceSecretVersion, global::System.Convert.ToString); + } + if (content.Contains("SecretArchiveReferenceKeyVaultId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISecretRotationStatusInternal)this).SecretArchiveReferenceKeyVaultId = (string) content.GetValueForProperty("SecretArchiveReferenceKeyVaultId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISecretRotationStatusInternal)this).SecretArchiveReferenceKeyVaultId, 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 SecretRotationStatus(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("SecretArchiveReference")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISecretRotationStatusInternal)this).SecretArchiveReference = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISecretArchiveReference) content.GetValueForProperty("SecretArchiveReference",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISecretRotationStatusInternal)this).SecretArchiveReference, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.SecretArchiveReferenceTypeConverter.ConvertFrom); + } + if (content.Contains("ExpirePeriodDay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISecretRotationStatusInternal)this).ExpirePeriodDay = (long?) content.GetValueForProperty("ExpirePeriodDay",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISecretRotationStatusInternal)this).ExpirePeriodDay, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("LastRotationTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISecretRotationStatusInternal)this).LastRotationTime = (global::System.DateTime?) content.GetValueForProperty("LastRotationTime",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISecretRotationStatusInternal)this).LastRotationTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("RotationPeriodDay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISecretRotationStatusInternal)this).RotationPeriodDay = (long?) content.GetValueForProperty("RotationPeriodDay",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISecretRotationStatusInternal)this).RotationPeriodDay, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("SecretType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISecretRotationStatusInternal)this).SecretType = (string) content.GetValueForProperty("SecretType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISecretRotationStatusInternal)this).SecretType, global::System.Convert.ToString); + } + if (content.Contains("SecretArchiveReferenceSecretName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISecretRotationStatusInternal)this).SecretArchiveReferenceSecretName = (string) content.GetValueForProperty("SecretArchiveReferenceSecretName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISecretRotationStatusInternal)this).SecretArchiveReferenceSecretName, global::System.Convert.ToString); + } + if (content.Contains("SecretArchiveReferenceSecretVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISecretRotationStatusInternal)this).SecretArchiveReferenceSecretVersion = (string) content.GetValueForProperty("SecretArchiveReferenceSecretVersion",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISecretRotationStatusInternal)this).SecretArchiveReferenceSecretVersion, global::System.Convert.ToString); + } + if (content.Contains("SecretArchiveReferenceKeyVaultId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISecretRotationStatusInternal)this).SecretArchiveReferenceKeyVaultId = (string) content.GetValueForProperty("SecretArchiveReferenceKeyVaultId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISecretRotationStatusInternal)this).SecretArchiveReferenceKeyVaultId, 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.NetworkCloud.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(); + } + } + /// SecretRotationStatus represents the status of a secret rotation. + [System.ComponentModel.TypeConverter(typeof(SecretRotationStatusTypeConverter))] + public partial interface ISecretRotationStatus + + { + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/SecretRotationStatus.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/SecretRotationStatus.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/SecretRotationStatus.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/SecretRotationStatus.TypeConverter.cs index c3c4ee5f6dbc..e061ea8a242b 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/SecretRotationStatus.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/SecretRotationStatus.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.ISecretRotationStatus ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISecretRotationStatus ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretRotationStatus).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISecretRotationStatus).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/SecretRotationStatus.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/SecretRotationStatus.cs new file mode 100644 index 000000000000..7ab43026bd66 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/SecretRotationStatus.cs @@ -0,0 +1,198 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + + /// SecretRotationStatus represents the status of a secret rotation. + public partial class SecretRotationStatus : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISecretRotationStatus, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISecretRotationStatusInternal + { + + /// Backing field for property. + private long? _expirePeriodDay; + + /// The maximum number of days the secret may be used before it must be changed. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public long? ExpirePeriodDay { get => this._expirePeriodDay; } + + /// Backing field for property. + private global::System.DateTime? _lastRotationTime; + + /// The date and time when the secret was last changed. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public global::System.DateTime? LastRotationTime { get => this._lastRotationTime; } + + /// Internal Acessors for ExpirePeriodDay + long? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISecretRotationStatusInternal.ExpirePeriodDay { get => this._expirePeriodDay; set { {_expirePeriodDay = value;} } } + + /// Internal Acessors for LastRotationTime + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISecretRotationStatusInternal.LastRotationTime { get => this._lastRotationTime; set { {_lastRotationTime = value;} } } + + /// Internal Acessors for RotationPeriodDay + long? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISecretRotationStatusInternal.RotationPeriodDay { get => this._rotationPeriodDay; set { {_rotationPeriodDay = value;} } } + + /// Internal Acessors for SecretArchiveReference + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISecretArchiveReference Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISecretRotationStatusInternal.SecretArchiveReference { get => (this._secretArchiveReference = this._secretArchiveReference ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.SecretArchiveReference()); set { {_secretArchiveReference = value;} } } + + /// Internal Acessors for SecretArchiveReferenceKeyVaultId + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISecretRotationStatusInternal.SecretArchiveReferenceKeyVaultId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISecretArchiveReferenceInternal)SecretArchiveReference).KeyVaultId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISecretArchiveReferenceInternal)SecretArchiveReference).KeyVaultId = value ?? null; } + + /// Internal Acessors for SecretArchiveReferenceSecretName + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISecretRotationStatusInternal.SecretArchiveReferenceSecretName { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISecretArchiveReferenceInternal)SecretArchiveReference).SecretName; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISecretArchiveReferenceInternal)SecretArchiveReference).SecretName = value ?? null; } + + /// Internal Acessors for SecretArchiveReferenceSecretVersion + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISecretRotationStatusInternal.SecretArchiveReferenceSecretVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISecretArchiveReferenceInternal)SecretArchiveReference).SecretVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISecretArchiveReferenceInternal)SecretArchiveReference).SecretVersion = value ?? null; } + + /// Internal Acessors for SecretType + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISecretRotationStatusInternal.SecretType { get => this._secretType; set { {_secretType = value;} } } + + /// Backing field for property. + private long? _rotationPeriodDay; + + /// The number of days a secret exists before rotations will be attempted. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public long? RotationPeriodDay { get => this._rotationPeriodDay; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISecretArchiveReference _secretArchiveReference; + + /// The reference to the secret in a key vault. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISecretArchiveReference SecretArchiveReference { get => (this._secretArchiveReference = this._secretArchiveReference ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.SecretArchiveReference()); } + + /// The resource ID of the key vault containing the secret. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string SecretArchiveReferenceKeyVaultId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISecretArchiveReferenceInternal)SecretArchiveReference).KeyVaultId; } + + /// The name of the secret in the key vault. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string SecretArchiveReferenceSecretName { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISecretArchiveReferenceInternal)SecretArchiveReference).SecretName; } + + /// The version of the secret in the key vault. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string SecretArchiveReferenceSecretVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISecretArchiveReferenceInternal)SecretArchiveReference).SecretVersion; } + + /// Backing field for property. + private string _secretType; + + /// The type name used to identify the purpose of the secret. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string SecretType { get => this._secretType; } + + /// Creates an new instance. + public SecretRotationStatus() + { + + } + } + /// SecretRotationStatus represents the status of a secret rotation. + public partial interface ISecretRotationStatus : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable + { + /// The maximum number of days the secret may be used before it must be changed. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The maximum number of days the secret may be used before it must be changed.", + SerializedName = @"expirePeriodDays", + PossibleTypes = new [] { typeof(long) })] + long? ExpirePeriodDay { get; } + /// The date and time when the secret was last changed. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The date and time when the secret was last changed.", + SerializedName = @"lastRotationTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? LastRotationTime { get; } + /// The number of days a secret exists before rotations will be attempted. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The number of days a secret exists before rotations will be attempted.", + SerializedName = @"rotationPeriodDays", + PossibleTypes = new [] { typeof(long) })] + long? RotationPeriodDay { get; } + /// The resource ID of the key vault containing the secret. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The resource ID of the key vault containing the secret.", + SerializedName = @"keyVaultId", + PossibleTypes = new [] { typeof(string) })] + string SecretArchiveReferenceKeyVaultId { get; } + /// The name of the secret in the key vault. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The name of the secret in the key vault.", + SerializedName = @"secretName", + PossibleTypes = new [] { typeof(string) })] + string SecretArchiveReferenceSecretName { get; } + /// The version of the secret in the key vault. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The version of the secret in the key vault.", + SerializedName = @"secretVersion", + PossibleTypes = new [] { typeof(string) })] + string SecretArchiveReferenceSecretVersion { get; } + /// The type name used to identify the purpose of the secret. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The type name used to identify the purpose of the secret.", + SerializedName = @"secretType", + PossibleTypes = new [] { typeof(string) })] + string SecretType { get; } + + } + /// SecretRotationStatus represents the status of a secret rotation. + internal partial interface ISecretRotationStatusInternal + + { + /// The maximum number of days the secret may be used before it must be changed. + long? ExpirePeriodDay { get; set; } + /// The date and time when the secret was last changed. + global::System.DateTime? LastRotationTime { get; set; } + /// The number of days a secret exists before rotations will be attempted. + long? RotationPeriodDay { get; set; } + /// The reference to the secret in a key vault. + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISecretArchiveReference SecretArchiveReference { get; set; } + /// The resource ID of the key vault containing the secret. + string SecretArchiveReferenceKeyVaultId { get; set; } + /// The name of the secret in the key vault. + string SecretArchiveReferenceSecretName { get; set; } + /// The version of the secret in the key vault. + string SecretArchiveReferenceSecretVersion { get; set; } + /// The type name used to identify the purpose of the secret. + string SecretType { get; set; } + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/SecretRotationStatus.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/SecretRotationStatus.json.cs similarity index 90% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/SecretRotationStatus.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/SecretRotationStatus.json.cs index 521e0a8f239f..2e39d99331a0 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/SecretRotationStatus.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/SecretRotationStatus.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class SecretRotationStatus partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretRotationStatus. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISecretRotationStatus. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretRotationStatus. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISecretRotationStatus. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISecretRotationStatus FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISecretRotationStatus FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new SecretRotationStatus(json) : null; } @@ -77,11 +77,11 @@ internal SecretRotationStatus(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Ru { return; } - {_secretArchiveReference = If( json?.PropertyT("secretArchiveReference"), out var __jsonSecretArchiveReference) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.SecretArchiveReference.FromJson(__jsonSecretArchiveReference) : SecretArchiveReference;} - {_expirePeriodDay = If( json?.PropertyT("expirePeriodDays"), out var __jsonExpirePeriodDays) ? (long?)__jsonExpirePeriodDays : ExpirePeriodDay;} - {_lastRotationTime = If( json?.PropertyT("lastRotationTime"), out var __jsonLastRotationTime) ? global::System.DateTime.TryParse((string)__jsonLastRotationTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonLastRotationTimeValue) ? __jsonLastRotationTimeValue : LastRotationTime : LastRotationTime;} - {_rotationPeriodDay = If( json?.PropertyT("rotationPeriodDays"), out var __jsonRotationPeriodDays) ? (long?)__jsonRotationPeriodDays : RotationPeriodDay;} - {_secretType = If( json?.PropertyT("secretType"), out var __jsonSecretType) ? (string)__jsonSecretType : (string)SecretType;} + {_secretArchiveReference = If( json?.PropertyT("secretArchiveReference"), out var __jsonSecretArchiveReference) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.SecretArchiveReference.FromJson(__jsonSecretArchiveReference) : _secretArchiveReference;} + {_expirePeriodDay = If( json?.PropertyT("expirePeriodDays"), out var __jsonExpirePeriodDays) ? (long?)__jsonExpirePeriodDays : _expirePeriodDay;} + {_lastRotationTime = If( json?.PropertyT("lastRotationTime"), out var __jsonLastRotationTime) ? global::System.DateTime.TryParse((string)__jsonLastRotationTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonLastRotationTimeValue) ? __jsonLastRotationTimeValue : _lastRotationTime : _lastRotationTime;} + {_rotationPeriodDay = If( json?.PropertyT("rotationPeriodDays"), out var __jsonRotationPeriodDays) ? (long?)__jsonRotationPeriodDays : _rotationPeriodDay;} + {_secretType = If( json?.PropertyT("secretType"), out var __jsonSecretType) ? (string)__jsonSecretType : (string)_secretType;} AfterFromJson(json); } @@ -104,23 +104,23 @@ public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode ToJ { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != this._secretArchiveReference ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) this._secretArchiveReference.ToJson(null,serializationMode) : null, "secretArchiveReference" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != this._expirePeriodDay ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNumber((long)this._expirePeriodDay) : null, "expirePeriodDays" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != this._lastRotationTime ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._lastRotationTime?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "lastRotationTime" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != this._rotationPeriodDay ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNumber((long)this._rotationPeriodDay) : null, "rotationPeriodDays" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._secretType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._secretType.ToString()) : null, "secretType" ,container.Add ); } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ServiceLoadBalancerBgpPeer.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ServiceLoadBalancerBgpPeer.PowerShell.cs new file mode 100644 index 000000000000..c6a70048bc7a --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ServiceLoadBalancerBgpPeer.PowerShell.cs @@ -0,0 +1,238 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + + /// + /// ServiceLoadBalancerBgpPeer represents the configuration of the BGP service load balancer for the Kubernetes cluster. + /// + [System.ComponentModel.TypeConverter(typeof(ServiceLoadBalancerBgpPeerTypeConverter))] + public partial class ServiceLoadBalancerBgpPeer + { + + /// + /// 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.NetworkCloud.Models.IServiceLoadBalancerBgpPeer DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ServiceLoadBalancerBgpPeer(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.NetworkCloud.Models.IServiceLoadBalancerBgpPeer DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ServiceLoadBalancerBgpPeer(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.NetworkCloud.Models.IServiceLoadBalancerBgpPeer FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ServiceLoadBalancerBgpPeer(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("BfdEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IServiceLoadBalancerBgpPeerInternal)this).BfdEnabled = (string) content.GetValueForProperty("BfdEnabled",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IServiceLoadBalancerBgpPeerInternal)this).BfdEnabled, global::System.Convert.ToString); + } + if (content.Contains("BgpMultiHop")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IServiceLoadBalancerBgpPeerInternal)this).BgpMultiHop = (string) content.GetValueForProperty("BgpMultiHop",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IServiceLoadBalancerBgpPeerInternal)this).BgpMultiHop, global::System.Convert.ToString); + } + if (content.Contains("HoldTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IServiceLoadBalancerBgpPeerInternal)this).HoldTime = (string) content.GetValueForProperty("HoldTime",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IServiceLoadBalancerBgpPeerInternal)this).HoldTime, global::System.Convert.ToString); + } + if (content.Contains("KeepAliveTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IServiceLoadBalancerBgpPeerInternal)this).KeepAliveTime = (string) content.GetValueForProperty("KeepAliveTime",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IServiceLoadBalancerBgpPeerInternal)this).KeepAliveTime, global::System.Convert.ToString); + } + if (content.Contains("MyAsn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IServiceLoadBalancerBgpPeerInternal)this).MyAsn = (long?) content.GetValueForProperty("MyAsn",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IServiceLoadBalancerBgpPeerInternal)this).MyAsn, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IServiceLoadBalancerBgpPeerInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IServiceLoadBalancerBgpPeerInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Password")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IServiceLoadBalancerBgpPeerInternal)this).Password = (string) content.GetValueForProperty("Password",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IServiceLoadBalancerBgpPeerInternal)this).Password, global::System.Convert.ToString); + } + if (content.Contains("PeerAddress")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IServiceLoadBalancerBgpPeerInternal)this).PeerAddress = (string) content.GetValueForProperty("PeerAddress",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IServiceLoadBalancerBgpPeerInternal)this).PeerAddress, global::System.Convert.ToString); + } + if (content.Contains("PeerAsn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IServiceLoadBalancerBgpPeerInternal)this).PeerAsn = (long) content.GetValueForProperty("PeerAsn",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IServiceLoadBalancerBgpPeerInternal)this).PeerAsn, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("PeerPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IServiceLoadBalancerBgpPeerInternal)this).PeerPort = (long?) content.GetValueForProperty("PeerPort",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IServiceLoadBalancerBgpPeerInternal)this).PeerPort, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ServiceLoadBalancerBgpPeer(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("BfdEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IServiceLoadBalancerBgpPeerInternal)this).BfdEnabled = (string) content.GetValueForProperty("BfdEnabled",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IServiceLoadBalancerBgpPeerInternal)this).BfdEnabled, global::System.Convert.ToString); + } + if (content.Contains("BgpMultiHop")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IServiceLoadBalancerBgpPeerInternal)this).BgpMultiHop = (string) content.GetValueForProperty("BgpMultiHop",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IServiceLoadBalancerBgpPeerInternal)this).BgpMultiHop, global::System.Convert.ToString); + } + if (content.Contains("HoldTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IServiceLoadBalancerBgpPeerInternal)this).HoldTime = (string) content.GetValueForProperty("HoldTime",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IServiceLoadBalancerBgpPeerInternal)this).HoldTime, global::System.Convert.ToString); + } + if (content.Contains("KeepAliveTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IServiceLoadBalancerBgpPeerInternal)this).KeepAliveTime = (string) content.GetValueForProperty("KeepAliveTime",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IServiceLoadBalancerBgpPeerInternal)this).KeepAliveTime, global::System.Convert.ToString); + } + if (content.Contains("MyAsn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IServiceLoadBalancerBgpPeerInternal)this).MyAsn = (long?) content.GetValueForProperty("MyAsn",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IServiceLoadBalancerBgpPeerInternal)this).MyAsn, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IServiceLoadBalancerBgpPeerInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IServiceLoadBalancerBgpPeerInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Password")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IServiceLoadBalancerBgpPeerInternal)this).Password = (string) content.GetValueForProperty("Password",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IServiceLoadBalancerBgpPeerInternal)this).Password, global::System.Convert.ToString); + } + if (content.Contains("PeerAddress")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IServiceLoadBalancerBgpPeerInternal)this).PeerAddress = (string) content.GetValueForProperty("PeerAddress",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IServiceLoadBalancerBgpPeerInternal)this).PeerAddress, global::System.Convert.ToString); + } + if (content.Contains("PeerAsn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IServiceLoadBalancerBgpPeerInternal)this).PeerAsn = (long) content.GetValueForProperty("PeerAsn",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IServiceLoadBalancerBgpPeerInternal)this).PeerAsn, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("PeerPort")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IServiceLoadBalancerBgpPeerInternal)this).PeerPort = (long?) content.GetValueForProperty("PeerPort",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IServiceLoadBalancerBgpPeerInternal)this).PeerPort, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + 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.NetworkCloud.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(); + } + } + /// ServiceLoadBalancerBgpPeer represents the configuration of the BGP service load balancer for the Kubernetes cluster. + [System.ComponentModel.TypeConverter(typeof(ServiceLoadBalancerBgpPeerTypeConverter))] + public partial interface IServiceLoadBalancerBgpPeer + + { + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ServiceLoadBalancerBgpPeer.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ServiceLoadBalancerBgpPeer.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ServiceLoadBalancerBgpPeer.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ServiceLoadBalancerBgpPeer.TypeConverter.cs index 2e0ef16d8667..29cb4e9c709c 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ServiceLoadBalancerBgpPeer.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ServiceLoadBalancerBgpPeer.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IServiceLoadBalancerBgpPeer ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IServiceLoadBalancerBgpPeer ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IServiceLoadBalancerBgpPeer).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IServiceLoadBalancerBgpPeer).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ServiceLoadBalancerBgpPeer.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ServiceLoadBalancerBgpPeer.cs similarity index 87% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ServiceLoadBalancerBgpPeer.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ServiceLoadBalancerBgpPeer.cs index aa111d134a39..697a6aa7e61c 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ServiceLoadBalancerBgpPeer.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ServiceLoadBalancerBgpPeer.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -11,23 +11,23 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201 /// ServiceLoadBalancerBgpPeer represents the configuration of the BGP service load balancer for the Kubernetes cluster. /// public partial class ServiceLoadBalancerBgpPeer : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IServiceLoadBalancerBgpPeer, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IServiceLoadBalancerBgpPeerInternal + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IServiceLoadBalancerBgpPeer, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IServiceLoadBalancerBgpPeerInternal { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BfdEnabled? _bfdEnabled; + private string _bfdEnabled; /// The indicator of BFD enablement for this BgpPeer. [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BfdEnabled? BfdEnabled { get => this._bfdEnabled; set => this._bfdEnabled = value; } + public string BfdEnabled { get => this._bfdEnabled; set => this._bfdEnabled = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BgpMultiHop? _bgpMultiHop; + private string _bgpMultiHop; /// The indicator to enable multi-hop peering support. [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BgpMultiHop? BgpMultiHop { get => this._bgpMultiHop; set => this._bgpMultiHop = value; } + public string BgpMultiHop { get => this._bgpMultiHop; set => this._bgpMultiHop = value; } /// Backing field for property. private string _holdTime; @@ -109,18 +109,26 @@ public partial interface IServiceLoadBalancerBgpPeer : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = false, Description = @"The indicator of BFD enablement for this BgpPeer.", SerializedName = @"bfdEnabled", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BfdEnabled) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BfdEnabled? BfdEnabled { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("True", "False")] + string BfdEnabled { get; set; } /// The indicator to enable multi-hop peering support. [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = false, Description = @"The indicator to enable multi-hop peering support.", SerializedName = @"bgpMultiHop", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BgpMultiHop) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BgpMultiHop? BgpMultiHop { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("True", "False")] + string BgpMultiHop { get; set; } /// /// Field Deprecated. The field was previously optional, now it will have no defined behavior and will be ignored. The requested /// BGP hold time value. This field uses ISO 8601 duration format, for example P1H. @@ -128,6 +136,9 @@ public partial interface IServiceLoadBalancerBgpPeer : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = false, Description = @"Field Deprecated. The field was previously optional, now it will have no defined behavior and will be ignored. The requested BGP hold time value. This field uses ISO 8601 duration format, for example P1H.", SerializedName = @"holdTime", PossibleTypes = new [] { typeof(string) })] @@ -139,6 +150,9 @@ public partial interface IServiceLoadBalancerBgpPeer : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = false, Description = @"Field Deprecated. The field was previously optional, now it will have no defined behavior and will be ignored. The requested BGP keepalive time value. This field uses ISO 8601 duration format, for example P1H.", SerializedName = @"keepAliveTime", PossibleTypes = new [] { typeof(string) })] @@ -147,6 +161,9 @@ public partial interface IServiceLoadBalancerBgpPeer : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = false, Description = @"The autonomous system number used for the local end of the BGP session.", SerializedName = @"myAsn", PossibleTypes = new [] { typeof(long) })] @@ -157,6 +174,9 @@ public partial interface IServiceLoadBalancerBgpPeer : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The name used to identify this BGP peer for association with a BGP advertisement.", SerializedName = @"name", PossibleTypes = new [] { typeof(string) })] @@ -167,6 +187,9 @@ public partial interface IServiceLoadBalancerBgpPeer : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = false, ReadOnly = false, + Read = false, + Create = true, + Update = false, Description = @"The authentication password for routers enforcing TCP MD5 authenticated sessions.", SerializedName = @"password", PossibleTypes = new [] { typeof(string) })] @@ -175,6 +198,9 @@ public partial interface IServiceLoadBalancerBgpPeer : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The IPv4 or IPv6 address used to connect this BGP session.", SerializedName = @"peerAddress", PossibleTypes = new [] { typeof(string) })] @@ -183,6 +209,9 @@ public partial interface IServiceLoadBalancerBgpPeer : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The autonomous system number expected from the remote end of the BGP session.", SerializedName = @"peerAsn", PossibleTypes = new [] { typeof(long) })] @@ -191,6 +220,9 @@ public partial interface IServiceLoadBalancerBgpPeer : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = false, Description = @"The port used to connect this BGP session.", SerializedName = @"peerPort", PossibleTypes = new [] { typeof(long) })] @@ -202,9 +234,11 @@ internal partial interface IServiceLoadBalancerBgpPeerInternal { /// The indicator of BFD enablement for this BgpPeer. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BfdEnabled? BfdEnabled { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("True", "False")] + string BfdEnabled { get; set; } /// The indicator to enable multi-hop peering support. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BgpMultiHop? BgpMultiHop { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("True", "False")] + string BgpMultiHop { get; set; } /// /// Field Deprecated. The field was previously optional, now it will have no defined behavior and will be ignored. The requested /// BGP hold time value. This field uses ISO 8601 duration format, for example P1H. diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ServiceLoadBalancerBgpPeer.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ServiceLoadBalancerBgpPeer.json.cs new file mode 100644 index 000000000000..f26f63b58683 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ServiceLoadBalancerBgpPeer.json.cs @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + + /// + /// ServiceLoadBalancerBgpPeer represents the configuration of the BGP service load balancer for the Kubernetes cluster. + /// + public partial class ServiceLoadBalancerBgpPeer + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IServiceLoadBalancerBgpPeer. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IServiceLoadBalancerBgpPeer. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IServiceLoadBalancerBgpPeer FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new ServiceLoadBalancerBgpPeer(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject instance to deserialize from. + internal ServiceLoadBalancerBgpPeer(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_bfdEnabled = If( json?.PropertyT("bfdEnabled"), out var __jsonBfdEnabled) ? (string)__jsonBfdEnabled : (string)_bfdEnabled;} + {_bgpMultiHop = If( json?.PropertyT("bgpMultiHop"), out var __jsonBgpMultiHop) ? (string)__jsonBgpMultiHop : (string)_bgpMultiHop;} + {_holdTime = If( json?.PropertyT("holdTime"), out var __jsonHoldTime) ? (string)__jsonHoldTime : (string)_holdTime;} + {_keepAliveTime = If( json?.PropertyT("keepAliveTime"), out var __jsonKeepAliveTime) ? (string)__jsonKeepAliveTime : (string)_keepAliveTime;} + {_myAsn = If( json?.PropertyT("myAsn"), out var __jsonMyAsn) ? (long?)__jsonMyAsn : _myAsn;} + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)_name;} + {_peerAddress = If( json?.PropertyT("peerAddress"), out var __jsonPeerAddress) ? (string)__jsonPeerAddress : (string)_peerAddress;} + {_peerAsn = If( json?.PropertyT("peerAsn"), out var __jsonPeerAsn) ? (long)__jsonPeerAsn : _peerAsn;} + {_peerPort = If( json?.PropertyT("peerPort"), out var __jsonPeerPort) ? (long?)__jsonPeerPort : _peerPort;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)||serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate)) + { + AddIf( null != (((object)this._bfdEnabled)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._bfdEnabled.ToString()) : null, "bfdEnabled" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)||serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate)) + { + AddIf( null != (((object)this._bgpMultiHop)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._bgpMultiHop.ToString()) : null, "bgpMultiHop" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)||serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate)) + { + AddIf( null != (((object)this._holdTime)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._holdTime.ToString()) : null, "holdTime" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)||serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate)) + { + AddIf( null != (((object)this._keepAliveTime)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._keepAliveTime.ToString()) : null, "keepAliveTime" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)||serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate)) + { + AddIf( null != this._myAsn ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNumber((long)this._myAsn) : null, "myAsn" ,container.Add ); + } + AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate)) + { + AddIf( null != (((object)this._password)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._password.ToString()) : null, "password" ,container.Add ); + } + AddIf( null != (((object)this._peerAddress)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._peerAddress.ToString()) : null, "peerAddress" ,container.Add ); + AddIf( (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNumber(this._peerAsn), "peerAsn" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)||serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate)) + { + AddIf( null != this._peerPort ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNumber((long)this._peerPort) : null, "peerPort" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ServicePrincipalInformation.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ServicePrincipalInformation.PowerShell.cs new file mode 100644 index 000000000000..c121dd29b19e --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ServicePrincipalInformation.PowerShell.cs @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + + /// + /// ServicePrincipalInformation represents the details of the service principal to be used by the cluster during Arc Appliance + /// installation. + /// + [System.ComponentModel.TypeConverter(typeof(ServicePrincipalInformationTypeConverter))] + public partial class ServicePrincipalInformation + { + + /// + /// 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.NetworkCloud.Models.IServicePrincipalInformation DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ServicePrincipalInformation(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.NetworkCloud.Models.IServicePrincipalInformation DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ServicePrincipalInformation(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.NetworkCloud.Models.IServicePrincipalInformation FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ServicePrincipalInformation(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.NetworkCloud.Models.IServicePrincipalInformationInternal)this).ApplicationId = (string) content.GetValueForProperty("ApplicationId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IServicePrincipalInformationInternal)this).ApplicationId, global::System.Convert.ToString); + } + if (content.Contains("Password")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IServicePrincipalInformationInternal)this).Password = (System.Security.SecureString) content.GetValueForProperty("Password",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IServicePrincipalInformationInternal)this).Password, (object ss) => (System.Security.SecureString)ss); + } + if (content.Contains("PrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IServicePrincipalInformationInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IServicePrincipalInformationInternal)this).PrincipalId, global::System.Convert.ToString); + } + if (content.Contains("TenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IServicePrincipalInformationInternal)this).TenantId = (string) content.GetValueForProperty("TenantId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IServicePrincipalInformationInternal)this).TenantId, 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 ServicePrincipalInformation(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.NetworkCloud.Models.IServicePrincipalInformationInternal)this).ApplicationId = (string) content.GetValueForProperty("ApplicationId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IServicePrincipalInformationInternal)this).ApplicationId, global::System.Convert.ToString); + } + if (content.Contains("Password")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IServicePrincipalInformationInternal)this).Password = (System.Security.SecureString) content.GetValueForProperty("Password",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IServicePrincipalInformationInternal)this).Password, (object ss) => (System.Security.SecureString)ss); + } + if (content.Contains("PrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IServicePrincipalInformationInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IServicePrincipalInformationInternal)this).PrincipalId, global::System.Convert.ToString); + } + if (content.Contains("TenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IServicePrincipalInformationInternal)this).TenantId = (string) content.GetValueForProperty("TenantId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IServicePrincipalInformationInternal)this).TenantId, 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.NetworkCloud.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(); + } + } + /// ServicePrincipalInformation represents the details of the service principal to be used by the cluster during Arc Appliance + /// installation. + [System.ComponentModel.TypeConverter(typeof(ServicePrincipalInformationTypeConverter))] + public partial interface IServicePrincipalInformation + + { + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ServicePrincipalInformation.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ServicePrincipalInformation.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ServicePrincipalInformation.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ServicePrincipalInformation.TypeConverter.cs index bc9fc9d5ea8f..d50fa0f15120 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ServicePrincipalInformation.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ServicePrincipalInformation.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IServicePrincipalInformation ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IServicePrincipalInformation ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IServicePrincipalInformation).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IServicePrincipalInformation).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ServicePrincipalInformation.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ServicePrincipalInformation.cs similarity index 92% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ServicePrincipalInformation.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ServicePrincipalInformation.cs index 18eb4ce332fa..8d23fc9ffe68 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ServicePrincipalInformation.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ServicePrincipalInformation.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -12,8 +12,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201 /// installation. /// public partial class ServicePrincipalInformation : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IServicePrincipalInformation, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IServicePrincipalInformationInternal + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IServicePrincipalInformation, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IServicePrincipalInformationInternal { /// Backing field for property. @@ -61,6 +61,9 @@ public partial interface IServicePrincipalInformation : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The application ID, also known as client ID, of the service principal.", SerializedName = @"applicationId", PossibleTypes = new [] { typeof(string) })] @@ -69,6 +72,9 @@ public partial interface IServicePrincipalInformation : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The password of the service principal.", SerializedName = @"password", PossibleTypes = new [] { typeof(System.Security.SecureString) })] @@ -77,6 +83,9 @@ public partial interface IServicePrincipalInformation : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The principal ID, also known as the object ID, of the service principal.", SerializedName = @"principalId", PossibleTypes = new [] { typeof(string) })] @@ -87,6 +96,9 @@ public partial interface IServicePrincipalInformation : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The tenant ID, also known as the directory ID, of the tenant in which the service principal is created.", SerializedName = @"tenantId", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ServicePrincipalInformation.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ServicePrincipalInformation.json.cs similarity index 94% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ServicePrincipalInformation.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ServicePrincipalInformation.json.cs index a44c828bb64f..0256ceaf94d8 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ServicePrincipalInformation.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ServicePrincipalInformation.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -57,13 +57,13 @@ public partial class ServicePrincipalInformation partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IServicePrincipalInformation. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IServicePrincipalInformation. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IServicePrincipalInformation. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IServicePrincipalInformation. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IServicePrincipalInformation FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IServicePrincipalInformation FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new ServicePrincipalInformation(json) : null; } @@ -80,10 +80,10 @@ internal ServicePrincipalInformation(Microsoft.Azure.PowerShell.Cmdlets.NetworkC { return; } - {_applicationId = If( json?.PropertyT("applicationId"), out var __jsonApplicationId) ? (string)__jsonApplicationId : (string)ApplicationId;} - {_password = If( json?.PropertyT("password"), out var __jsonPassword) ? new System.Net.NetworkCredential("",(string)__jsonPassword).SecurePassword : Password;} - {_principalId = If( json?.PropertyT("principalId"), out var __jsonPrincipalId) ? (string)__jsonPrincipalId : (string)PrincipalId;} - {_tenantId = If( json?.PropertyT("tenantId"), out var __jsonTenantId) ? (string)__jsonTenantId : (string)TenantId;} + {_applicationId = If( json?.PropertyT("applicationId"), out var __jsonApplicationId) ? (string)__jsonApplicationId : (string)_applicationId;} + {_password = If( json?.PropertyT("password"), out var __jsonPassword) ? new System.Net.NetworkCredential("",(string)__jsonPassword).SecurePassword : _password;} + {_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); } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/SshPublicKey.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/SshPublicKey.PowerShell.cs similarity index 85% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/SshPublicKey.PowerShell.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/SshPublicKey.PowerShell.cs index ca30c64a8671..7f65d12e0bd7 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/SshPublicKey.PowerShell.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/SshPublicKey.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; @@ -65,27 +65,27 @@ public partial class SshPublicKey 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.NetworkCloud.Models.Api20250201.ISshPublicKey DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISshPublicKey DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new SshPublicKey(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.NetworkCloud.Models.Api20250201.ISshPublicKey DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISshPublicKey DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new SshPublicKey(content); } @@ -95,10 +95,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISshPublicKey FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 SshPublicKey(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("KeyData")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKeyInternal)this).KeyData = (string) content.GetValueForProperty("KeyData",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKeyInternal)this).KeyData, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISshPublicKeyInternal)this).KeyData = (string) content.GetValueForProperty("KeyData",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISshPublicKeyInternal)this).KeyData, 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 SshPublicKey(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("KeyData")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKeyInternal)this).KeyData = (string) content.GetValueForProperty("KeyData",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKeyInternal)this).KeyData, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISshPublicKeyInternal)this).KeyData = (string) content.GetValueForProperty("KeyData",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISshPublicKeyInternal)this).KeyData, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/SshPublicKey.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/SshPublicKey.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/SshPublicKey.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/SshPublicKey.TypeConverter.cs index 548292ecbf06..af684cbecf71 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/SshPublicKey.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/SshPublicKey.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.ISshPublicKey ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISshPublicKey ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISshPublicKey).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/SshPublicKey.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/SshPublicKey.cs similarity index 89% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/SshPublicKey.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/SshPublicKey.cs index 5f0aea9e875e..8b0113c76b27 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/SshPublicKey.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/SshPublicKey.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -11,8 +11,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201 /// SshPublicKey represents the public key used to authenticate with a resource through SSH. /// public partial class SshPublicKey : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKeyInternal + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISshPublicKey, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISshPublicKeyInternal { /// Backing field for property. @@ -36,6 +36,9 @@ public partial interface ISshPublicKey : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The SSH public key data.", SerializedName = @"keyData", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/SshPublicKey.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/SshPublicKey.json.cs similarity index 95% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/SshPublicKey.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/SshPublicKey.json.cs index 63390b2fb665..513e560a7309 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/SshPublicKey.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/SshPublicKey.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -56,13 +56,13 @@ public partial class SshPublicKey partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISshPublicKey. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISshPublicKey. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISshPublicKey FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new SshPublicKey(json) : null; } @@ -79,7 +79,7 @@ internal SshPublicKey(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Js { return; } - {_keyData = If( json?.PropertyT("keyData"), out var __jsonKeyData) ? (string)__jsonKeyData : (string)KeyData;} + {_keyData = If( json?.PropertyT("keyData"), out var __jsonKeyData) ? (string)__jsonKeyData : (string)_keyData;} AfterFromJson(json); } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/StorageAppliance.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/StorageAppliance.PowerShell.cs new file mode 100644 index 000000000000..7f70bd96d96c --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/StorageAppliance.PowerShell.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.NetworkCloud.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + + /// StorageAppliance represents on-premises Network Cloud storage appliance. + [System.ComponentModel.TypeConverter(typeof(StorageApplianceTypeConverter))] + public partial class StorageAppliance + { + + /// + /// 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.NetworkCloud.Models.IStorageAppliance DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new StorageAppliance(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.NetworkCloud.Models.IStorageAppliance DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new StorageAppliance(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.NetworkCloud.Models.IStorageAppliance FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal StorageAppliance(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ExtendedLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceInternal)this).ExtendedLocation = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocation) content.GetValueForProperty("ExtendedLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceInternal)this).ExtendedLocation, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ExtendedLocationTypeConverter.ConvertFrom); + } + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.StorageAppliancePropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Etag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceInternal)this).Etag, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)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("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedByType = (string) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedByType = (string) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.TrackedResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("ExtendedLocationName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceInternal)this).ExtendedLocationName = (string) content.GetValueForProperty("ExtendedLocationName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceInternal)this).ExtendedLocationName, global::System.Convert.ToString); + } + if (content.Contains("ExtendedLocationType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceInternal)this).ExtendedLocationType = (string) content.GetValueForProperty("ExtendedLocationType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceInternal)this).ExtendedLocationType, global::System.Convert.ToString); + } + if (content.Contains("AdministratorCredentials")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceInternal)this).AdministratorCredentials = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministrativeCredentials) content.GetValueForProperty("AdministratorCredentials",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceInternal)this).AdministratorCredentials, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AdministrativeCredentialsTypeConverter.ConvertFrom); + } + if (content.Contains("Capacity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceInternal)this).Capacity = (long?) content.GetValueForProperty("Capacity",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceInternal)this).Capacity, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("CapacityUsed")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceInternal)this).CapacityUsed = (long?) content.GetValueForProperty("CapacityUsed",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceInternal)this).CapacityUsed, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("ClusterId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceInternal)this).ClusterId = (string) content.GetValueForProperty("ClusterId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceInternal)this).ClusterId, global::System.Convert.ToString); + } + if (content.Contains("DetailedStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceInternal)this).DetailedStatus = (string) content.GetValueForProperty("DetailedStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceInternal)this).DetailedStatus, global::System.Convert.ToString); + } + if (content.Contains("DetailedStatusMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceInternal)this).DetailedStatusMessage = (string) content.GetValueForProperty("DetailedStatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceInternal)this).DetailedStatusMessage, global::System.Convert.ToString); + } + if (content.Contains("ManagementIpv4Address")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceInternal)this).ManagementIpv4Address = (string) content.GetValueForProperty("ManagementIpv4Address",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceInternal)this).ManagementIpv4Address, global::System.Convert.ToString); + } + if (content.Contains("Manufacturer")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceInternal)this).Manufacturer = (string) content.GetValueForProperty("Manufacturer",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceInternal)this).Manufacturer, global::System.Convert.ToString); + } + if (content.Contains("Model")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceInternal)this).Model = (string) content.GetValueForProperty("Model",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceInternal)this).Model, global::System.Convert.ToString); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("RackId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceInternal)this).RackId = (string) content.GetValueForProperty("RackId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceInternal)this).RackId, global::System.Convert.ToString); + } + if (content.Contains("RackSlot")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceInternal)this).RackSlot = (long?) content.GetValueForProperty("RackSlot",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceInternal)this).RackSlot, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("RemoteVendorManagementFeature")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceInternal)this).RemoteVendorManagementFeature = (string) content.GetValueForProperty("RemoteVendorManagementFeature",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceInternal)this).RemoteVendorManagementFeature, global::System.Convert.ToString); + } + if (content.Contains("RemoteVendorManagementStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceInternal)this).RemoteVendorManagementStatus = (string) content.GetValueForProperty("RemoteVendorManagementStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceInternal)this).RemoteVendorManagementStatus, global::System.Convert.ToString); + } + if (content.Contains("SecretRotationStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceInternal)this).SecretRotationStatus = (System.Collections.Generic.List) content.GetValueForProperty("SecretRotationStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceInternal)this).SecretRotationStatus, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.SecretRotationStatusTypeConverter.ConvertFrom)); + } + if (content.Contains("SerialNumber")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceInternal)this).SerialNumber = (string) content.GetValueForProperty("SerialNumber",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceInternal)this).SerialNumber, global::System.Convert.ToString); + } + if (content.Contains("SkuId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceInternal)this).SkuId = (string) content.GetValueForProperty("SkuId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceInternal)this).SkuId, global::System.Convert.ToString); + } + if (content.Contains("Version")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceInternal)this).Version = (string) content.GetValueForProperty("Version",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceInternal)this).Version, global::System.Convert.ToString); + } + if (content.Contains("AdministratorCredentialsPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceInternal)this).AdministratorCredentialsPassword = (System.Security.SecureString) content.GetValueForProperty("AdministratorCredentialsPassword",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceInternal)this).AdministratorCredentialsPassword, (object ss) => (System.Security.SecureString)ss); + } + if (content.Contains("AdministratorCredentialsUsername")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceInternal)this).AdministratorCredentialsUsername = (string) content.GetValueForProperty("AdministratorCredentialsUsername",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceInternal)this).AdministratorCredentialsUsername, 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 StorageAppliance(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ExtendedLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceInternal)this).ExtendedLocation = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocation) content.GetValueForProperty("ExtendedLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceInternal)this).ExtendedLocation, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ExtendedLocationTypeConverter.ConvertFrom); + } + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.StorageAppliancePropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Etag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceInternal)this).Etag, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)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("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedByType = (string) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedByType = (string) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.TrackedResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("ExtendedLocationName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceInternal)this).ExtendedLocationName = (string) content.GetValueForProperty("ExtendedLocationName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceInternal)this).ExtendedLocationName, global::System.Convert.ToString); + } + if (content.Contains("ExtendedLocationType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceInternal)this).ExtendedLocationType = (string) content.GetValueForProperty("ExtendedLocationType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceInternal)this).ExtendedLocationType, global::System.Convert.ToString); + } + if (content.Contains("AdministratorCredentials")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceInternal)this).AdministratorCredentials = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministrativeCredentials) content.GetValueForProperty("AdministratorCredentials",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceInternal)this).AdministratorCredentials, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AdministrativeCredentialsTypeConverter.ConvertFrom); + } + if (content.Contains("Capacity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceInternal)this).Capacity = (long?) content.GetValueForProperty("Capacity",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceInternal)this).Capacity, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("CapacityUsed")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceInternal)this).CapacityUsed = (long?) content.GetValueForProperty("CapacityUsed",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceInternal)this).CapacityUsed, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("ClusterId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceInternal)this).ClusterId = (string) content.GetValueForProperty("ClusterId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceInternal)this).ClusterId, global::System.Convert.ToString); + } + if (content.Contains("DetailedStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceInternal)this).DetailedStatus = (string) content.GetValueForProperty("DetailedStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceInternal)this).DetailedStatus, global::System.Convert.ToString); + } + if (content.Contains("DetailedStatusMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceInternal)this).DetailedStatusMessage = (string) content.GetValueForProperty("DetailedStatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceInternal)this).DetailedStatusMessage, global::System.Convert.ToString); + } + if (content.Contains("ManagementIpv4Address")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceInternal)this).ManagementIpv4Address = (string) content.GetValueForProperty("ManagementIpv4Address",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceInternal)this).ManagementIpv4Address, global::System.Convert.ToString); + } + if (content.Contains("Manufacturer")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceInternal)this).Manufacturer = (string) content.GetValueForProperty("Manufacturer",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceInternal)this).Manufacturer, global::System.Convert.ToString); + } + if (content.Contains("Model")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceInternal)this).Model = (string) content.GetValueForProperty("Model",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceInternal)this).Model, global::System.Convert.ToString); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("RackId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceInternal)this).RackId = (string) content.GetValueForProperty("RackId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceInternal)this).RackId, global::System.Convert.ToString); + } + if (content.Contains("RackSlot")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceInternal)this).RackSlot = (long?) content.GetValueForProperty("RackSlot",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceInternal)this).RackSlot, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("RemoteVendorManagementFeature")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceInternal)this).RemoteVendorManagementFeature = (string) content.GetValueForProperty("RemoteVendorManagementFeature",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceInternal)this).RemoteVendorManagementFeature, global::System.Convert.ToString); + } + if (content.Contains("RemoteVendorManagementStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceInternal)this).RemoteVendorManagementStatus = (string) content.GetValueForProperty("RemoteVendorManagementStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceInternal)this).RemoteVendorManagementStatus, global::System.Convert.ToString); + } + if (content.Contains("SecretRotationStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceInternal)this).SecretRotationStatus = (System.Collections.Generic.List) content.GetValueForProperty("SecretRotationStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceInternal)this).SecretRotationStatus, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.SecretRotationStatusTypeConverter.ConvertFrom)); + } + if (content.Contains("SerialNumber")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceInternal)this).SerialNumber = (string) content.GetValueForProperty("SerialNumber",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceInternal)this).SerialNumber, global::System.Convert.ToString); + } + if (content.Contains("SkuId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceInternal)this).SkuId = (string) content.GetValueForProperty("SkuId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceInternal)this).SkuId, global::System.Convert.ToString); + } + if (content.Contains("Version")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceInternal)this).Version = (string) content.GetValueForProperty("Version",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceInternal)this).Version, global::System.Convert.ToString); + } + if (content.Contains("AdministratorCredentialsPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceInternal)this).AdministratorCredentialsPassword = (System.Security.SecureString) content.GetValueForProperty("AdministratorCredentialsPassword",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceInternal)this).AdministratorCredentialsPassword, (object ss) => (System.Security.SecureString)ss); + } + if (content.Contains("AdministratorCredentialsUsername")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceInternal)this).AdministratorCredentialsUsername = (string) content.GetValueForProperty("AdministratorCredentialsUsername",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceInternal)this).AdministratorCredentialsUsername, 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.NetworkCloud.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(); + } + } + /// StorageAppliance represents on-premises Network Cloud storage appliance. + [System.ComponentModel.TypeConverter(typeof(StorageApplianceTypeConverter))] + public partial interface IStorageAppliance + + { + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/StorageAppliance.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/StorageAppliance.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/StorageAppliance.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/StorageAppliance.TypeConverter.cs index eab837e8e137..c5ed4e209c96 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/StorageAppliance.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/StorageAppliance.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IStorageAppliance ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliance ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliance).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliance).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/StorageAppliance.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/StorageAppliance.cs new file mode 100644 index 000000000000..152c563fa855 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/StorageAppliance.cs @@ -0,0 +1,618 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + + /// StorageAppliance represents on-premises Network Cloud storage appliance. + public partial class StorageAppliance : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliance, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceInternal, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResource __trackedResource = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.TrackedResource(); + + /// The password of the administrator of the device used during initialization. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public System.Security.SecureString AdministratorCredentialsPassword { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePropertiesInternal)Property).AdministratorCredentialsPassword; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePropertiesInternal)Property).AdministratorCredentialsPassword = value ?? null; } + + /// The username of the administrator of the device used during initialization. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string AdministratorCredentialsUsername { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePropertiesInternal)Property).AdministratorCredentialsUsername; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePropertiesInternal)Property).AdministratorCredentialsUsername = value ?? null; } + + /// The total capacity of the storage appliance. Measured in GiB. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public long? Capacity { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePropertiesInternal)Property).Capacity; } + + /// The amount of storage consumed. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public long? CapacityUsed { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePropertiesInternal)Property).CapacityUsed; } + + /// + /// The resource ID of the cluster this storage appliance is associated with. Measured in GiB. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string ClusterId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePropertiesInternal)Property).ClusterId; } + + /// The detailed status of the storage appliance. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string DetailedStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePropertiesInternal)Property).DetailedStatus; } + + /// The descriptive message about the current detailed status. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string DetailedStatusMessage { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePropertiesInternal)Property).DetailedStatusMessage; } + + /// Backing field for property. + private string _etag; + + /// Resource ETag. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string Etag { get => this._etag; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocation _extendedLocation; + + /// The extended location of the cluster associated with the resource. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocation ExtendedLocation { get => (this._extendedLocation = this._extendedLocation ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ExtendedLocation()); set => this._extendedLocation = value; } + + /// The resource ID of the extended location on which the resource will be created. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string ExtendedLocationName { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocationInternal)ExtendedLocation).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocationInternal)ExtendedLocation).Name = value ?? null; } + + /// The extended location type, for example, CustomLocation. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string ExtendedLocationType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocationInternal)ExtendedLocation).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocationInternal)ExtendedLocation).Type = value ?? null; } + + /// + /// Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).Id; } + + /// The geo-location where the resource lives + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)__trackedResource).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)__trackedResource).Location = value ?? null; } + + /// The endpoint for the management interface of the storage appliance. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string ManagementIpv4Address { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePropertiesInternal)Property).ManagementIpv4Address; } + + /// The manufacturer of the storage appliance. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string Manufacturer { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePropertiesInternal)Property).Manufacturer; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).Id = value ?? null; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).Name = value ?? null; } + + /// Internal Acessors for SystemData + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISystemData Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemData; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemData = value ?? null /* model class */; } + + /// Internal Acessors for SystemDataCreatedAt + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataCreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataCreatedAt = value ?? default(global::System.DateTime); } + + /// Internal Acessors for SystemDataCreatedBy + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataCreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataCreatedBy = value ?? null; } + + /// Internal Acessors for SystemDataCreatedByType + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataCreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataCreatedByType = value ?? null; } + + /// Internal Acessors for SystemDataLastModifiedAt + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedAt = value ?? default(global::System.DateTime); } + + /// Internal Acessors for SystemDataLastModifiedBy + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedBy = value ?? null; } + + /// Internal Acessors for SystemDataLastModifiedByType + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedByType = value ?? null; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).Type = value ?? null; } + + /// Internal Acessors for AdministratorCredentials + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministrativeCredentials Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceInternal.AdministratorCredentials { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePropertiesInternal)Property).AdministratorCredentials; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePropertiesInternal)Property).AdministratorCredentials = value ?? null /* model class */; } + + /// Internal Acessors for Capacity + long? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceInternal.Capacity { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePropertiesInternal)Property).Capacity; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePropertiesInternal)Property).Capacity = value ?? default(long); } + + /// Internal Acessors for CapacityUsed + long? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceInternal.CapacityUsed { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePropertiesInternal)Property).CapacityUsed; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePropertiesInternal)Property).CapacityUsed = value ?? default(long); } + + /// Internal Acessors for ClusterId + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceInternal.ClusterId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePropertiesInternal)Property).ClusterId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePropertiesInternal)Property).ClusterId = value ?? null; } + + /// Internal Acessors for DetailedStatus + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceInternal.DetailedStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePropertiesInternal)Property).DetailedStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePropertiesInternal)Property).DetailedStatus = value ?? null; } + + /// Internal Acessors for DetailedStatusMessage + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceInternal.DetailedStatusMessage { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePropertiesInternal)Property).DetailedStatusMessage; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePropertiesInternal)Property).DetailedStatusMessage = value ?? null; } + + /// Internal Acessors for Etag + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceInternal.Etag { get => this._etag; set { {_etag = value;} } } + + /// Internal Acessors for ExtendedLocation + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocation Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceInternal.ExtendedLocation { get => (this._extendedLocation = this._extendedLocation ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ExtendedLocation()); set { {_extendedLocation = value;} } } + + /// Internal Acessors for ManagementIpv4Address + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceInternal.ManagementIpv4Address { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePropertiesInternal)Property).ManagementIpv4Address; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePropertiesInternal)Property).ManagementIpv4Address = value ?? null; } + + /// Internal Acessors for Manufacturer + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceInternal.Manufacturer { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePropertiesInternal)Property).Manufacturer; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePropertiesInternal)Property).Manufacturer = value ?? null; } + + /// Internal Acessors for Model + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceInternal.Model { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePropertiesInternal)Property).Model; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePropertiesInternal)Property).Model = value ?? null; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceProperties Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.StorageApplianceProperties()); set { {_property = value;} } } + + /// Internal Acessors for ProvisioningState + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePropertiesInternal)Property).ProvisioningState = value ?? null; } + + /// Internal Acessors for RemoteVendorManagementFeature + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceInternal.RemoteVendorManagementFeature { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePropertiesInternal)Property).RemoteVendorManagementFeature; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePropertiesInternal)Property).RemoteVendorManagementFeature = value ?? null; } + + /// Internal Acessors for RemoteVendorManagementStatus + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceInternal.RemoteVendorManagementStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePropertiesInternal)Property).RemoteVendorManagementStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePropertiesInternal)Property).RemoteVendorManagementStatus = value ?? null; } + + /// Internal Acessors for SecretRotationStatus + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceInternal.SecretRotationStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePropertiesInternal)Property).SecretRotationStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePropertiesInternal)Property).SecretRotationStatus = value ?? null /* arrayOf */; } + + /// Internal Acessors for Version + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceInternal.Version { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePropertiesInternal)Property).Version; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePropertiesInternal)Property).Version = value ?? null; } + + /// The model of the storage appliance. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string Model { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePropertiesInternal)Property).Model; } + + /// The name of the resource + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).Name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceProperties _property; + + /// The list of the resource properties. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.StorageApplianceProperties()); set => this._property = value; } + + /// The provisioning state of the storage appliance. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePropertiesInternal)Property).ProvisioningState; } + + /// The resource ID of the rack where this storage appliance resides. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string RackId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePropertiesInternal)Property).RackId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePropertiesInternal)Property).RackId = value ?? null; } + + /// The slot the storage appliance is in the rack based on the BOM configuration. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public long? RackSlot { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePropertiesInternal)Property).RackSlot; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePropertiesInternal)Property).RackSlot = value ?? default(long); } + + /// + /// The indicator of whether the storage appliance supports remote vendor management. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string RemoteVendorManagementFeature { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePropertiesInternal)Property).RemoteVendorManagementFeature; } + + /// + /// The indicator of whether the remote vendor management feature is enabled or disabled, or unsupported if it is an unsupported + /// feature. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string RemoteVendorManagementStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePropertiesInternal)Property).RemoteVendorManagementStatus; } + + /// Gets the resource group name + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string ResourceGroupName { get => (new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Success ? new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Groups["resourceGroupName"].Value : null); } + + /// The list of statuses that represent secret rotation activity. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public System.Collections.Generic.List SecretRotationStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePropertiesInternal)Property).SecretRotationStatus; } + + /// The serial number for the storage appliance. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string SerialNumber { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePropertiesInternal)Property).SerialNumber; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePropertiesInternal)Property).SerialNumber = value ; } + + /// The SKU for the storage appliance. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string SkuId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePropertiesInternal)Property).StorageApplianceSkuId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePropertiesInternal)Property).StorageApplianceSkuId = value ?? null; } + + /// + /// Azure Resource Manager metadata containing createdBy and modifiedBy information. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISystemData SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemData; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemData = value ?? null /* model class */; } + + /// The timestamp of resource creation (UTC). + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataCreatedAt; } + + /// The identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataCreatedBy; } + + /// The type of identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public string SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataCreatedByType; } + + /// The timestamp of resource last modification (UTC) + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedAt; } + + /// The identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedBy; } + + /// The type of identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public string SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedByType; } + + /// Resource tags. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)__trackedResource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).Type; } + + /// The version of the storage appliance. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string Version { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePropertiesInternal)Property).Version; } + + /// Creates an new instance. + public StorageAppliance() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__trackedResource), __trackedResource); + await eventListener.AssertObjectIsValid(nameof(__trackedResource), __trackedResource); + } + } + /// StorageAppliance represents on-premises Network Cloud storage appliance. + public partial interface IStorageAppliance : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResource + { + /// The password of the administrator of the device used during initialization. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The password of the administrator of the device used during initialization.", + SerializedName = @"password", + PossibleTypes = new [] { typeof(System.Security.SecureString) })] + System.Security.SecureString AdministratorCredentialsPassword { get; set; } + /// The username of the administrator of the device used during initialization. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The username of the administrator of the device used during initialization.", + SerializedName = @"username", + PossibleTypes = new [] { typeof(string) })] + string AdministratorCredentialsUsername { get; set; } + /// The total capacity of the storage appliance. Measured in GiB. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The total capacity of the storage appliance. Measured in GiB.", + SerializedName = @"capacity", + PossibleTypes = new [] { typeof(long) })] + long? Capacity { get; } + /// The amount of storage consumed. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The amount of storage consumed.", + SerializedName = @"capacityUsed", + PossibleTypes = new [] { typeof(long) })] + long? CapacityUsed { get; } + /// + /// The resource ID of the cluster this storage appliance is associated with. Measured in GiB. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The resource ID of the cluster this storage appliance is associated with. Measured in GiB.", + SerializedName = @"clusterId", + PossibleTypes = new [] { typeof(string) })] + string ClusterId { get; } + /// The detailed status of the storage appliance. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The detailed status of the storage appliance.", + SerializedName = @"detailedStatus", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Available", "Degraded", "Error", "Provisioning")] + string DetailedStatus { get; } + /// The descriptive message about the current detailed status. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The descriptive message about the current detailed status.", + SerializedName = @"detailedStatusMessage", + PossibleTypes = new [] { typeof(string) })] + string DetailedStatusMessage { get; } + /// Resource ETag. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"Resource ETag.", + SerializedName = @"etag", + PossibleTypes = new [] { typeof(string) })] + string Etag { get; } + /// The resource ID of the extended location on which the resource will be created. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The resource ID of the extended location on which the resource will be created.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string ExtendedLocationName { get; set; } + /// The extended location type, for example, CustomLocation. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The extended location type, for example, CustomLocation.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + string ExtendedLocationType { get; set; } + /// The endpoint for the management interface of the storage appliance. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The endpoint for the management interface of the storage appliance.", + SerializedName = @"managementIpv4Address", + PossibleTypes = new [] { typeof(string) })] + string ManagementIpv4Address { get; } + /// The manufacturer of the storage appliance. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The manufacturer of the storage appliance.", + SerializedName = @"manufacturer", + PossibleTypes = new [] { typeof(string) })] + string Manufacturer { get; } + /// The model of the storage appliance. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The model of the storage appliance.", + SerializedName = @"model", + PossibleTypes = new [] { typeof(string) })] + string Model { get; } + /// The provisioning state of the storage appliance. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The provisioning state of the storage appliance.", + SerializedName = @"provisioningState", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Succeeded", "Failed", "Canceled", "Provisioning", "Accepted")] + string ProvisioningState { get; } + /// The resource ID of the rack where this storage appliance resides. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The resource ID of the rack where this storage appliance resides.", + SerializedName = @"rackId", + PossibleTypes = new [] { typeof(string) })] + string RackId { get; set; } + /// The slot the storage appliance is in the rack based on the BOM configuration. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The slot the storage appliance is in the rack based on the BOM configuration.", + SerializedName = @"rackSlot", + PossibleTypes = new [] { typeof(long) })] + long? RackSlot { get; set; } + /// + /// The indicator of whether the storage appliance supports remote vendor management. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The indicator of whether the storage appliance supports remote vendor management.", + SerializedName = @"remoteVendorManagementFeature", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Supported", "Unsupported")] + string RemoteVendorManagementFeature { get; } + /// + /// The indicator of whether the remote vendor management feature is enabled or disabled, or unsupported if it is an unsupported + /// feature. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The indicator of whether the remote vendor management feature is enabled or disabled, or unsupported if it is an unsupported feature.", + SerializedName = @"remoteVendorManagementStatus", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Enabled", "Disabled", "Unsupported")] + string RemoteVendorManagementStatus { get; } + /// The list of statuses that represent secret rotation activity. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The list of statuses that represent secret rotation activity.", + SerializedName = @"secretRotationStatus", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISecretRotationStatus) })] + System.Collections.Generic.List SecretRotationStatus { get; } + /// The serial number for the storage appliance. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The serial number for the storage appliance.", + SerializedName = @"serialNumber", + PossibleTypes = new [] { typeof(string) })] + string SerialNumber { get; set; } + /// The SKU for the storage appliance. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The SKU for the storage appliance.", + SerializedName = @"storageApplianceSkuId", + PossibleTypes = new [] { typeof(string) })] + string SkuId { get; set; } + /// The version of the storage appliance. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The version of the storage appliance.", + SerializedName = @"version", + PossibleTypes = new [] { typeof(string) })] + string Version { get; } + + } + /// StorageAppliance represents on-premises Network Cloud storage appliance. + internal partial interface IStorageApplianceInternal : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal + { + /// The credentials of the administrative interface on this storage appliance. + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministrativeCredentials AdministratorCredentials { get; set; } + /// The password of the administrator of the device used during initialization. + System.Security.SecureString AdministratorCredentialsPassword { get; set; } + /// The username of the administrator of the device used during initialization. + string AdministratorCredentialsUsername { get; set; } + /// The total capacity of the storage appliance. Measured in GiB. + long? Capacity { get; set; } + /// The amount of storage consumed. + long? CapacityUsed { get; set; } + /// + /// The resource ID of the cluster this storage appliance is associated with. Measured in GiB. + /// + string ClusterId { get; set; } + /// The detailed status of the storage appliance. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Available", "Degraded", "Error", "Provisioning")] + string DetailedStatus { get; set; } + /// The descriptive message about the current detailed status. + string DetailedStatusMessage { get; set; } + /// Resource ETag. + string Etag { get; set; } + /// The extended location of the cluster associated with the resource. + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocation ExtendedLocation { get; set; } + /// The resource ID of the extended location on which the resource will be created. + string ExtendedLocationName { get; set; } + /// The extended location type, for example, CustomLocation. + string ExtendedLocationType { get; set; } + /// The endpoint for the management interface of the storage appliance. + string ManagementIpv4Address { get; set; } + /// The manufacturer of the storage appliance. + string Manufacturer { get; set; } + /// The model of the storage appliance. + string Model { get; set; } + /// The list of the resource properties. + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceProperties Property { get; set; } + /// The provisioning state of the storage appliance. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Succeeded", "Failed", "Canceled", "Provisioning", "Accepted")] + string ProvisioningState { get; set; } + /// The resource ID of the rack where this storage appliance resides. + string RackId { get; set; } + /// The slot the storage appliance is in the rack based on the BOM configuration. + long? RackSlot { get; set; } + /// + /// The indicator of whether the storage appliance supports remote vendor management. + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Supported", "Unsupported")] + string RemoteVendorManagementFeature { get; set; } + /// + /// The indicator of whether the remote vendor management feature is enabled or disabled, or unsupported if it is an unsupported + /// feature. + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Enabled", "Disabled", "Unsupported")] + string RemoteVendorManagementStatus { get; set; } + /// The list of statuses that represent secret rotation activity. + System.Collections.Generic.List SecretRotationStatus { get; set; } + /// The serial number for the storage appliance. + string SerialNumber { get; set; } + /// The SKU for the storage appliance. + string SkuId { get; set; } + /// The version of the storage appliance. + string Version { get; set; } + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/StorageAppliance.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/StorageAppliance.json.cs similarity index 91% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/StorageAppliance.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/StorageAppliance.json.cs index ca8adecd33e4..1d93997e8fec 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/StorageAppliance.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/StorageAppliance.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class StorageAppliance partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliance. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliance. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliance. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliance. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliance FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliance FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new StorageAppliance(json) : null; } @@ -77,10 +77,10 @@ internal StorageAppliance(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtim { return; } - __trackedResource = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.TrackedResource(json); - {_extendedLocation = If( json?.PropertyT("extendedLocation"), out var __jsonExtendedLocation) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ExtendedLocation.FromJson(__jsonExtendedLocation) : ExtendedLocation;} - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.StorageApplianceProperties.FromJson(__jsonProperties) : Property;} - {_etag = If( json?.PropertyT("etag"), out var __jsonEtag) ? (string)__jsonEtag : (string)Etag;} + __trackedResource = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.TrackedResource(json); + {_extendedLocation = If( json?.PropertyT("extendedLocation"), out var __jsonExtendedLocation) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ExtendedLocation.FromJson(__jsonExtendedLocation) : _extendedLocation;} + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.StorageApplianceProperties.FromJson(__jsonProperties) : _property;} + {_etag = If( json?.PropertyT("etag"), out var __jsonEtag) ? (string)__jsonEtag : (string)_etag;} AfterFromJson(json); } @@ -106,7 +106,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode ToJ __trackedResource?.ToJson(container, serializationMode); AddIf( null != this._extendedLocation ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) this._extendedLocation.ToJson(null,serializationMode) : null, "extendedLocation" ,container.Add ); AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._etag)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._etag.ToString()) : null, "etag" ,container.Add ); } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/StorageApplianceConfigurationData.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/StorageApplianceConfigurationData.PowerShell.cs new file mode 100644 index 000000000000..5357bdb5a41d --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/StorageApplianceConfigurationData.PowerShell.cs @@ -0,0 +1,208 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + + /// + /// StorageApplianceConfigurationData represents configuration for the storage application. + /// + [System.ComponentModel.TypeConverter(typeof(StorageApplianceConfigurationDataTypeConverter))] + public partial class StorageApplianceConfigurationData + { + + /// + /// 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.NetworkCloud.Models.IStorageApplianceConfigurationData DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new StorageApplianceConfigurationData(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.NetworkCloud.Models.IStorageApplianceConfigurationData DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new StorageApplianceConfigurationData(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.NetworkCloud.Models.IStorageApplianceConfigurationData FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal StorageApplianceConfigurationData(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("AdminCredentials")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceConfigurationDataInternal)this).AdminCredentials = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministrativeCredentials) content.GetValueForProperty("AdminCredentials",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceConfigurationDataInternal)this).AdminCredentials, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AdministrativeCredentialsTypeConverter.ConvertFrom); + } + if (content.Contains("RackSlot")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceConfigurationDataInternal)this).RackSlot = (long) content.GetValueForProperty("RackSlot",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceConfigurationDataInternal)this).RackSlot, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("SerialNumber")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceConfigurationDataInternal)this).SerialNumber = (string) content.GetValueForProperty("SerialNumber",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceConfigurationDataInternal)this).SerialNumber, global::System.Convert.ToString); + } + if (content.Contains("StorageApplianceName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceConfigurationDataInternal)this).StorageApplianceName = (string) content.GetValueForProperty("StorageApplianceName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceConfigurationDataInternal)this).StorageApplianceName, global::System.Convert.ToString); + } + if (content.Contains("AdminCredentialsPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceConfigurationDataInternal)this).AdminCredentialsPassword = (System.Security.SecureString) content.GetValueForProperty("AdminCredentialsPassword",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceConfigurationDataInternal)this).AdminCredentialsPassword, (object ss) => (System.Security.SecureString)ss); + } + if (content.Contains("AdminCredentialsUsername")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceConfigurationDataInternal)this).AdminCredentialsUsername = (string) content.GetValueForProperty("AdminCredentialsUsername",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceConfigurationDataInternal)this).AdminCredentialsUsername, 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 StorageApplianceConfigurationData(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("AdminCredentials")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceConfigurationDataInternal)this).AdminCredentials = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministrativeCredentials) content.GetValueForProperty("AdminCredentials",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceConfigurationDataInternal)this).AdminCredentials, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AdministrativeCredentialsTypeConverter.ConvertFrom); + } + if (content.Contains("RackSlot")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceConfigurationDataInternal)this).RackSlot = (long) content.GetValueForProperty("RackSlot",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceConfigurationDataInternal)this).RackSlot, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("SerialNumber")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceConfigurationDataInternal)this).SerialNumber = (string) content.GetValueForProperty("SerialNumber",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceConfigurationDataInternal)this).SerialNumber, global::System.Convert.ToString); + } + if (content.Contains("StorageApplianceName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceConfigurationDataInternal)this).StorageApplianceName = (string) content.GetValueForProperty("StorageApplianceName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceConfigurationDataInternal)this).StorageApplianceName, global::System.Convert.ToString); + } + if (content.Contains("AdminCredentialsPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceConfigurationDataInternal)this).AdminCredentialsPassword = (System.Security.SecureString) content.GetValueForProperty("AdminCredentialsPassword",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceConfigurationDataInternal)this).AdminCredentialsPassword, (object ss) => (System.Security.SecureString)ss); + } + if (content.Contains("AdminCredentialsUsername")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceConfigurationDataInternal)this).AdminCredentialsUsername = (string) content.GetValueForProperty("AdminCredentialsUsername",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceConfigurationDataInternal)this).AdminCredentialsUsername, 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.NetworkCloud.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(); + } + } + /// StorageApplianceConfigurationData represents configuration for the storage application. + [System.ComponentModel.TypeConverter(typeof(StorageApplianceConfigurationDataTypeConverter))] + public partial interface IStorageApplianceConfigurationData + + { + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/StorageApplianceConfigurationData.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/StorageApplianceConfigurationData.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/StorageApplianceConfigurationData.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/StorageApplianceConfigurationData.TypeConverter.cs index 8091c5114692..99fd480e8c50 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/StorageApplianceConfigurationData.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/StorageApplianceConfigurationData.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IStorageApplianceConfigurationData ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceConfigurationData ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceConfigurationData).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceConfigurationData).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/StorageApplianceConfigurationData.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/StorageApplianceConfigurationData.cs similarity index 81% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/StorageApplianceConfigurationData.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/StorageApplianceConfigurationData.cs index 0268e3fa3804..891e18d70979 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/StorageApplianceConfigurationData.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/StorageApplianceConfigurationData.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -11,12 +11,12 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201 /// StorageApplianceConfigurationData represents configuration for the storage application. /// public partial class StorageApplianceConfigurationData : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceConfigurationData, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceConfigurationDataInternal + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceConfigurationData, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceConfigurationDataInternal { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministrativeCredentials _adminCredentials; + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministrativeCredentials _adminCredentials; /// /// The credentials of the administrative interface on this storage appliance. The password field is expected to be an Azure @@ -24,18 +24,18 @@ public partial class StorageApplianceConfigurationData : /// the actual password value should be provided instead. /// [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministrativeCredentials AdminCredentials { get => (this._adminCredentials = this._adminCredentials ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AdministrativeCredentials()); set => this._adminCredentials = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministrativeCredentials AdminCredentials { get => (this._adminCredentials = this._adminCredentials ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AdministrativeCredentials()); set => this._adminCredentials = value; } /// The password of the administrator of the device used during initialization. [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public System.Security.SecureString AdminCredentialsPassword { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministrativeCredentialsInternal)AdminCredentials).Password; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministrativeCredentialsInternal)AdminCredentials).Password = value ; } + public System.Security.SecureString AdminCredentialsPassword { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministrativeCredentialsInternal)AdminCredentials).Password; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministrativeCredentialsInternal)AdminCredentials).Password = value ; } /// The username of the administrator of the device used during initialization. [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] - public string AdminCredentialsUsername { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministrativeCredentialsInternal)AdminCredentials).Username; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministrativeCredentialsInternal)AdminCredentials).Username = value ; } + public string AdminCredentialsUsername { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministrativeCredentialsInternal)AdminCredentials).Username; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministrativeCredentialsInternal)AdminCredentials).Username = value ; } /// Internal Acessors for AdminCredentials - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministrativeCredentials Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceConfigurationDataInternal.AdminCredentials { get => (this._adminCredentials = this._adminCredentials ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AdministrativeCredentials()); set { {_adminCredentials = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministrativeCredentials Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceConfigurationDataInternal.AdminCredentials { get => (this._adminCredentials = this._adminCredentials ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AdministrativeCredentials()); set { {_adminCredentials = value;} } } /// Backing field for property. private long _rackSlot; @@ -74,6 +74,9 @@ public partial interface IStorageApplianceConfigurationData : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The password of the administrator of the device used during initialization.", SerializedName = @"password", PossibleTypes = new [] { typeof(System.Security.SecureString) })] @@ -82,6 +85,9 @@ public partial interface IStorageApplianceConfigurationData : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The username of the administrator of the device used during initialization.", SerializedName = @"username", PossibleTypes = new [] { typeof(string) })] @@ -90,6 +96,9 @@ public partial interface IStorageApplianceConfigurationData : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The slot that storage appliance is in the rack based on the BOM configuration.", SerializedName = @"rackSlot", PossibleTypes = new [] { typeof(long) })] @@ -98,6 +107,9 @@ public partial interface IStorageApplianceConfigurationData : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The serial number of the appliance.", SerializedName = @"serialNumber", PossibleTypes = new [] { typeof(string) })] @@ -108,6 +120,9 @@ public partial interface IStorageApplianceConfigurationData : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The user-provided name for the storage appliance that will be created from this specification.", SerializedName = @"storageApplianceName", PossibleTypes = new [] { typeof(string) })] @@ -123,7 +138,7 @@ internal partial interface IStorageApplianceConfigurationDataInternal /// Key Vault key URL. Until the cluster is converted to utilize managed identity by setting the secret archive settings, /// the actual password value should be provided instead. /// - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAdministrativeCredentials AdminCredentials { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministrativeCredentials AdminCredentials { get; set; } /// The password of the administrator of the device used during initialization. System.Security.SecureString AdminCredentialsPassword { get; set; } /// The username of the administrator of the device used during initialization. diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/StorageApplianceConfigurationData.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/StorageApplianceConfigurationData.json.cs similarity index 92% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/StorageApplianceConfigurationData.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/StorageApplianceConfigurationData.json.cs index 9d8b82a4d169..42a6c1f78899 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/StorageApplianceConfigurationData.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/StorageApplianceConfigurationData.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -56,13 +56,13 @@ public partial class StorageApplianceConfigurationData partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceConfigurationData. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceConfigurationData. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceConfigurationData. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceConfigurationData. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceConfigurationData FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceConfigurationData FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new StorageApplianceConfigurationData(json) : null; } @@ -79,10 +79,10 @@ internal StorageApplianceConfigurationData(Microsoft.Azure.PowerShell.Cmdlets.Ne { return; } - {_adminCredentials = If( json?.PropertyT("adminCredentials"), out var __jsonAdminCredentials) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AdministrativeCredentials.FromJson(__jsonAdminCredentials) : AdminCredentials;} - {_rackSlot = If( json?.PropertyT("rackSlot"), out var __jsonRackSlot) ? (long)__jsonRackSlot : RackSlot;} - {_serialNumber = If( json?.PropertyT("serialNumber"), out var __jsonSerialNumber) ? (string)__jsonSerialNumber : (string)SerialNumber;} - {_storageApplianceName = If( json?.PropertyT("storageApplianceName"), out var __jsonStorageApplianceName) ? (string)__jsonStorageApplianceName : (string)StorageApplianceName;} + {_adminCredentials = If( json?.PropertyT("adminCredentials"), out var __jsonAdminCredentials) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AdministrativeCredentials.FromJson(__jsonAdminCredentials) : _adminCredentials;} + {_rackSlot = If( json?.PropertyT("rackSlot"), out var __jsonRackSlot) ? (long)__jsonRackSlot : _rackSlot;} + {_serialNumber = If( json?.PropertyT("serialNumber"), out var __jsonSerialNumber) ? (string)__jsonSerialNumber : (string)_serialNumber;} + {_storageApplianceName = If( json?.PropertyT("storageApplianceName"), out var __jsonStorageApplianceName) ? (string)__jsonStorageApplianceName : (string)_storageApplianceName;} AfterFromJson(json); } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/StorageApplianceEnableRemoteVendorManagementParameters.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/StorageApplianceEnableRemoteVendorManagementParameters.PowerShell.cs similarity index 81% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/StorageApplianceEnableRemoteVendorManagementParameters.PowerShell.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/StorageApplianceEnableRemoteVendorManagementParameters.PowerShell.cs index d7ca8de9d216..bd34fc5dc3be 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/StorageApplianceEnableRemoteVendorManagementParameters.PowerShell.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/StorageApplianceEnableRemoteVendorManagementParameters.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; @@ -66,29 +66,29 @@ public partial class StorageApplianceEnableRemoteVendorManagementParameters 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.NetworkCloud.Models.Api20250201.IStorageApplianceEnableRemoteVendorManagementParameters DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceEnableRemoteVendorManagementParameters DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new StorageApplianceEnableRemoteVendorManagementParameters(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.NetworkCloud.Models.Api20250201.IStorageApplianceEnableRemoteVendorManagementParameters DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceEnableRemoteVendorManagementParameters DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new StorageApplianceEnableRemoteVendorManagementParameters(content); } @@ -101,10 +101,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201 /// /// an instance of the model class. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceEnableRemoteVendorManagementParameters FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceEnableRemoteVendorManagementParameters FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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. @@ -119,13 +119,13 @@ internal StorageApplianceEnableRemoteVendorManagementParameters(global::System.C // actually deserialize if (content.Contains("SupportEndpoint")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceEnableRemoteVendorManagementParametersInternal)this).SupportEndpoint = (string[]) content.GetValueForProperty("SupportEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceEnableRemoteVendorManagementParametersInternal)this).SupportEndpoint, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceEnableRemoteVendorManagementParametersInternal)this).SupportEndpoint = (System.Collections.Generic.List) content.GetValueForProperty("SupportEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceEnableRemoteVendorManagementParametersInternal)this).SupportEndpoint, __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. @@ -140,7 +140,7 @@ internal StorageApplianceEnableRemoteVendorManagementParameters(global::System.M // actually deserialize if (content.Contains("SupportEndpoint")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceEnableRemoteVendorManagementParametersInternal)this).SupportEndpoint = (string[]) content.GetValueForProperty("SupportEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceEnableRemoteVendorManagementParametersInternal)this).SupportEndpoint, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceEnableRemoteVendorManagementParametersInternal)this).SupportEndpoint = (System.Collections.Generic.List) content.GetValueForProperty("SupportEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceEnableRemoteVendorManagementParametersInternal)this).SupportEndpoint, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } AfterDeserializePSObject(content); } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/StorageApplianceEnableRemoteVendorManagementParameters.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/StorageApplianceEnableRemoteVendorManagementParameters.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/StorageApplianceEnableRemoteVendorManagementParameters.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/StorageApplianceEnableRemoteVendorManagementParameters.TypeConverter.cs index d1676a8b6619..5a618511ba31 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/StorageApplianceEnableRemoteVendorManagementParameters.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/StorageApplianceEnableRemoteVendorManagementParameters.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IStorageApplianceEnableRemoteVendorManagementParameters ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceEnableRemoteVendorManagementParameters ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceEnableRemoteVendorManagementParameters).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceEnableRemoteVendorManagementParameters).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/StorageApplianceEnableRemoteVendorManagementParameters.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/StorageApplianceEnableRemoteVendorManagementParameters.cs similarity index 83% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/StorageApplianceEnableRemoteVendorManagementParameters.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/StorageApplianceEnableRemoteVendorManagementParameters.cs index 44abc2c0b72f..ba79dff408ad 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/StorageApplianceEnableRemoteVendorManagementParameters.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/StorageApplianceEnableRemoteVendorManagementParameters.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -12,12 +12,12 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201 /// of a storage appliance. /// public partial class StorageApplianceEnableRemoteVendorManagementParameters : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceEnableRemoteVendorManagementParameters, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceEnableRemoteVendorManagementParametersInternal + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceEnableRemoteVendorManagementParameters, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceEnableRemoteVendorManagementParametersInternal { /// Backing field for property. - private string[] _supportEndpoint; + private System.Collections.Generic.List _supportEndpoint; /// /// Field Deprecated. This field is not used and will be rejected if provided. The list of IPv4 subnets (in CIDR format), @@ -25,7 +25,7 @@ public partial class StorageApplianceEnableRemoteVendorManagementParameters : /// vendor management. /// [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public string[] SupportEndpoint { get => this._supportEndpoint; set => this._supportEndpoint = value; } + public System.Collections.Generic.List SupportEndpoint { get => this._supportEndpoint; set => this._supportEndpoint = value; } /// /// Creates an new instance. @@ -48,10 +48,13 @@ public partial interface IStorageApplianceEnableRemoteVendorManagementParameters [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Field Deprecated. This field is not used and will be rejected if provided. The list of IPv4 subnets (in CIDR format), IPv6 subnets (in CIDR format), or hostnames that the storage appliance needs accessible in order to turn on the remote vendor management.", SerializedName = @"supportEndpoints", PossibleTypes = new [] { typeof(string) })] - string[] SupportEndpoint { get; set; } + System.Collections.Generic.List SupportEndpoint { get; set; } } /// StorageApplianceEnableRemoteVendorManagementParameters represents the body of the request to enable remote vendor management @@ -64,7 +67,7 @@ internal partial interface IStorageApplianceEnableRemoteVendorManagementParamete /// IPv6 subnets (in CIDR format), or hostnames that the storage appliance needs accessible in order to turn on the remote /// vendor management. /// - string[] SupportEndpoint { get; set; } + System.Collections.Generic.List SupportEndpoint { get; set; } } } \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/StorageApplianceEnableRemoteVendorManagementParameters.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/StorageApplianceEnableRemoteVendorManagementParameters.json.cs similarity index 92% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/StorageApplianceEnableRemoteVendorManagementParameters.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/StorageApplianceEnableRemoteVendorManagementParameters.json.cs index 95476b7ecd5f..7904fbc18833 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/StorageApplianceEnableRemoteVendorManagementParameters.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/StorageApplianceEnableRemoteVendorManagementParameters.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -57,13 +57,13 @@ public partial class StorageApplianceEnableRemoteVendorManagementParameters partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceEnableRemoteVendorManagementParameters. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceEnableRemoteVendorManagementParameters. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceEnableRemoteVendorManagementParameters. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceEnableRemoteVendorManagementParameters. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceEnableRemoteVendorManagementParameters FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceEnableRemoteVendorManagementParameters FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new StorageApplianceEnableRemoteVendorManagementParameters(json) : null; } @@ -81,7 +81,7 @@ internal StorageApplianceEnableRemoteVendorManagementParameters(Microsoft.Azure. { return; } - {_supportEndpoint = If( json?.PropertyT("supportEndpoints"), out var __jsonSupportEndpoints) ? If( __jsonSupportEndpoints as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : SupportEndpoint;} + {_supportEndpoint = If( json?.PropertyT("supportEndpoints"), out var __jsonSupportEndpoints) ? If( __jsonSupportEndpoints as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : _supportEndpoint;} AfterFromJson(json); } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/StorageApplianceList.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/StorageApplianceList.PowerShell.cs similarity index 76% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/StorageApplianceList.PowerShell.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/StorageApplianceList.PowerShell.cs index 77753909fa3a..189fb26ed8ba 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/StorageApplianceList.PowerShell.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/StorageApplianceList.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; @@ -63,27 +63,27 @@ public partial class StorageApplianceList 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.NetworkCloud.Models.Api20250201.IStorageApplianceList DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceList DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new StorageApplianceList(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.NetworkCloud.Models.Api20250201.IStorageApplianceList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new StorageApplianceList(content); } @@ -93,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 StorageApplianceList(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceListInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceListInternal)this).NextLink, global::System.Convert.ToString); } if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliance[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.StorageApplianceTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceListInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceListInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.StorageApplianceTypeConverter.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,11 +136,11 @@ internal StorageApplianceList(global::System.Management.Automation.PSObject cont // actually deserialize if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceListInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceListInternal)this).NextLink, global::System.Convert.ToString); } if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliance[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.StorageApplianceTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceListInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceListInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.StorageApplianceTypeConverter.ConvertFrom)); } AfterDeserializePSObject(content); } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/StorageApplianceList.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/StorageApplianceList.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/StorageApplianceList.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/StorageApplianceList.TypeConverter.cs index 7490c64a5cc8..ae674eed6ef2 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/StorageApplianceList.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/StorageApplianceList.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IStorageApplianceList ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceList ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceList).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceList).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/StorageApplianceList.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/StorageApplianceList.cs new file mode 100644 index 000000000000..290976d75bf2 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/StorageApplianceList.cs @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + + /// StorageApplianceList represents a list of storage appliances. + public partial class StorageApplianceList : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceList, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceListInternal + { + + /// Backing field for property. + private string _nextLink; + + /// The link used to get the next page of operations. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; set => this._nextLink = value; } + + /// Backing field for property. + private System.Collections.Generic.List _value; + + /// The list of storage appliances. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public System.Collections.Generic.List Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public StorageApplianceList() + { + + } + } + /// StorageApplianceList represents a list of storage appliances. + public partial interface IStorageApplianceList : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable + { + /// The link used to get the next page of operations. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The link used to get the next page of operations.", + SerializedName = @"nextLink", + PossibleTypes = new [] { typeof(string) })] + string NextLink { get; set; } + /// The list of storage appliances. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The list of storage appliances.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliance) })] + System.Collections.Generic.List Value { get; set; } + + } + /// StorageApplianceList represents a list of storage appliances. + internal partial interface IStorageApplianceListInternal + + { + /// The link used to get the next page of operations. + string NextLink { get; set; } + /// The list of storage appliances. + System.Collections.Generic.List Value { get; set; } + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/StorageApplianceList.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/StorageApplianceList.json.cs similarity index 90% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/StorageApplianceList.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/StorageApplianceList.json.cs index 0894cd1eb036..e17e23141d0a 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/StorageApplianceList.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/StorageApplianceList.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class StorageApplianceList partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceList. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceList. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceList. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceList. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceList FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceList FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new StorageApplianceList(json) : null; } @@ -77,8 +77,8 @@ internal StorageApplianceList(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Ru { return; } - {_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.NetworkCloud.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.NetworkCloud.Models.Api20250201.IStorageAppliance) (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.StorageAppliance.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.NetworkCloud.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.NetworkCloud.Models.IStorageAppliance) (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.StorageAppliance.FromJson(__u) )) ))() : null : _value;} AfterFromJson(json); } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/StorageAppliancePatchParameters.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/StorageAppliancePatchParameters.PowerShell.cs new file mode 100644 index 000000000000..d75b7c24e71a --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/StorageAppliancePatchParameters.PowerShell.cs @@ -0,0 +1,182 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + + /// + /// StorageAppliancePatchParameters represents the body of the request to patch storage appliance properties. + /// + [System.ComponentModel.TypeConverter(typeof(StorageAppliancePatchParametersTypeConverter))] + public partial class StorageAppliancePatchParameters + { + + /// + /// 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.NetworkCloud.Models.IStorageAppliancePatchParameters DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new StorageAppliancePatchParameters(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.NetworkCloud.Models.IStorageAppliancePatchParameters DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new StorageAppliancePatchParameters(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.NetworkCloud.Models.IStorageAppliancePatchParameters FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal StorageAppliancePatchParameters(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.NetworkCloud.Models.IStorageAppliancePatchParametersInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePatchProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePatchParametersInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.StorageAppliancePatchPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePatchParametersInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePatchParametersTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePatchParametersInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.StorageAppliancePatchParametersTagsTypeConverter.ConvertFrom); + } + if (content.Contains("SerialNumber")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePatchParametersInternal)this).SerialNumber = (string) content.GetValueForProperty("SerialNumber",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePatchParametersInternal)this).SerialNumber, 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 StorageAppliancePatchParameters(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.NetworkCloud.Models.IStorageAppliancePatchParametersInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePatchProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePatchParametersInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.StorageAppliancePatchPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePatchParametersInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePatchParametersTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePatchParametersInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.StorageAppliancePatchParametersTagsTypeConverter.ConvertFrom); + } + if (content.Contains("SerialNumber")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePatchParametersInternal)this).SerialNumber = (string) content.GetValueForProperty("SerialNumber",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePatchParametersInternal)this).SerialNumber, 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.NetworkCloud.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(); + } + } + /// StorageAppliancePatchParameters represents the body of the request to patch storage appliance properties. + [System.ComponentModel.TypeConverter(typeof(StorageAppliancePatchParametersTypeConverter))] + public partial interface IStorageAppliancePatchParameters + + { + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/StorageAppliancePatchParameters.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/StorageAppliancePatchParameters.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/StorageAppliancePatchParameters.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/StorageAppliancePatchParameters.TypeConverter.cs index 71089e3b85c1..ec23c9b171b5 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/StorageAppliancePatchParameters.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/StorageAppliancePatchParameters.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IStorageAppliancePatchParameters ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePatchParameters ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePatchParameters).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePatchParameters).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/StorageAppliancePatchParameters.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/StorageAppliancePatchParameters.cs new file mode 100644 index 000000000000..37ac93bdffa9 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/StorageAppliancePatchParameters.cs @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + + /// + /// StorageAppliancePatchParameters represents the body of the request to patch storage appliance properties. + /// + public partial class StorageAppliancePatchParameters : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePatchParameters, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePatchParametersInternal + { + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePatchProperties Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePatchParametersInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.StorageAppliancePatchProperties()); set { {_property = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePatchProperties _property; + + /// The list of the resource properties. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePatchProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.StorageAppliancePatchProperties()); set => this._property = value; } + + /// The serial number for the storage appliance. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string SerialNumber { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePatchPropertiesInternal)Property).SerialNumber; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePatchPropertiesInternal)Property).SerialNumber = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePatchParametersTags _tag; + + /// The Azure resource tags that will replace the existing ones. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePatchParametersTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.StorageAppliancePatchParametersTags()); set => this._tag = value; } + + /// Creates an new instance. + public StorageAppliancePatchParameters() + { + + } + } + /// StorageAppliancePatchParameters represents the body of the request to patch storage appliance properties. + public partial interface IStorageAppliancePatchParameters : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable + { + /// The serial number for the storage appliance. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The serial number for the storage appliance.", + SerializedName = @"serialNumber", + PossibleTypes = new [] { typeof(string) })] + string SerialNumber { get; set; } + /// The Azure resource tags that will replace the existing ones. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The Azure resource tags that will replace the existing ones.", + SerializedName = @"tags", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePatchParametersTags) })] + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePatchParametersTags Tag { get; set; } + + } + /// StorageAppliancePatchParameters represents the body of the request to patch storage appliance properties. + internal partial interface IStorageAppliancePatchParametersInternal + + { + /// The list of the resource properties. + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePatchProperties Property { get; set; } + /// The serial number for the storage appliance. + string SerialNumber { get; set; } + /// The Azure resource tags that will replace the existing ones. + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePatchParametersTags Tag { get; set; } + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/StorageAppliancePatchParameters.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/StorageAppliancePatchParameters.json.cs similarity index 93% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/StorageAppliancePatchParameters.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/StorageAppliancePatchParameters.json.cs index 232564b4e49f..2e5458cca2cc 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/StorageAppliancePatchParameters.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/StorageAppliancePatchParameters.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -56,13 +56,13 @@ public partial class StorageAppliancePatchParameters partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePatchParameters. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePatchParameters. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePatchParameters. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePatchParameters. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePatchParameters FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePatchParameters FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new StorageAppliancePatchParameters(json) : null; } @@ -79,8 +79,8 @@ internal StorageAppliancePatchParameters(Microsoft.Azure.PowerShell.Cmdlets.Netw { return; } - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.StorageAppliancePatchProperties.FromJson(__jsonProperties) : Property;} - {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.StorageAppliancePatchParametersTags.FromJson(__jsonTags) : Tag;} + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.StorageAppliancePatchProperties.FromJson(__jsonProperties) : _property;} + {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.StorageAppliancePatchParametersTags.FromJson(__jsonTags) : _tag;} AfterFromJson(json); } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/StorageAppliancePatchParametersTags.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/StorageAppliancePatchParametersTags.PowerShell.cs similarity index 89% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/StorageAppliancePatchParametersTags.PowerShell.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/StorageAppliancePatchParametersTags.PowerShell.cs index 16ffd705ce00..93e3c1e985a4 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/StorageAppliancePatchParametersTags.PowerShell.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/StorageAppliancePatchParametersTags.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; @@ -63,29 +63,29 @@ public partial class StorageAppliancePatchParametersTags 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.NetworkCloud.Models.Api20250201.IStorageAppliancePatchParametersTags DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePatchParametersTags DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new StorageAppliancePatchParametersTags(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.NetworkCloud.Models.Api20250201.IStorageAppliancePatchParametersTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePatchParametersTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new StorageAppliancePatchParametersTags(content); } @@ -97,10 +97,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201 /// /// an instance of the model class. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePatchParametersTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePatchParametersTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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. @@ -119,7 +119,7 @@ internal StorageAppliancePatchParametersTags(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/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/StorageAppliancePatchParametersTags.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/StorageAppliancePatchParametersTags.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/StorageAppliancePatchParametersTags.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/StorageAppliancePatchParametersTags.TypeConverter.cs index 17fbf1c7cc29..a26dfac9cced 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/StorageAppliancePatchParametersTags.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/StorageAppliancePatchParametersTags.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IStorageAppliancePatchParametersTags ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePatchParametersTags ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePatchParametersTags).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePatchParametersTags).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/StorageAppliancePatchParametersTags.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/StorageAppliancePatchParametersTags.cs similarity index 83% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/StorageAppliancePatchParametersTags.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/StorageAppliancePatchParametersTags.cs index 8e0bddbb55b3..d1ad824bae91 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/StorageAppliancePatchParametersTags.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/StorageAppliancePatchParametersTags.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; /// The Azure resource tags that will replace the existing ones. public partial class StorageAppliancePatchParametersTags : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePatchParametersTags, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePatchParametersTagsInternal + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePatchParametersTags, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePatchParametersTagsInternal { /// Creates an new instance. diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/StorageAppliancePatchParametersTags.dictionary.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/StorageAppliancePatchParametersTags.dictionary.cs similarity index 96% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/StorageAppliancePatchParametersTags.dictionary.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/StorageAppliancePatchParametersTags.dictionary.cs index a53d46fcc9dc..7fcee1e314cd 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/StorageAppliancePatchParametersTags.dictionary.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/StorageAppliancePatchParametersTags.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.StorageAppliancePatchParametersTags source) => source.__additionalProperties; + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.StorageAppliancePatchParametersTags source) => source.__additionalProperties; } } \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/StorageAppliancePatchParametersTags.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/StorageAppliancePatchParametersTags.json.cs similarity index 95% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/StorageAppliancePatchParametersTags.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/StorageAppliancePatchParametersTags.json.cs index 4219fb404419..79bcb9a92de7 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/StorageAppliancePatchParametersTags.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/StorageAppliancePatchParametersTags.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class StorageAppliancePatchParametersTags partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePatchParametersTags. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePatchParametersTags. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePatchParametersTags. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePatchParametersTags. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePatchParametersTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePatchParametersTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new StorageAppliancePatchParametersTags(json) : null; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/StorageAppliancePatchProperties.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/StorageAppliancePatchProperties.PowerShell.cs similarity index 83% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/StorageAppliancePatchProperties.PowerShell.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/StorageAppliancePatchProperties.PowerShell.cs index 79618c340914..6cd0e4a1ea92 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/StorageAppliancePatchProperties.PowerShell.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/StorageAppliancePatchProperties.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; @@ -65,29 +65,27 @@ public partial class StorageAppliancePatchProperties 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.NetworkCloud.Models.Api20250201.IStorageAppliancePatchProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePatchProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new StorageAppliancePatchProperties(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.NetworkCloud.Models.Api20250201.IStorageAppliancePatchProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePatchProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new StorageAppliancePatchProperties(content); } @@ -97,10 +95,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePatchProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePatchProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,13 +113,13 @@ internal StorageAppliancePatchProperties(global::System.Collections.IDictionary // actually deserialize if (content.Contains("SerialNumber")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePatchPropertiesInternal)this).SerialNumber = (string) content.GetValueForProperty("SerialNumber",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePatchPropertiesInternal)this).SerialNumber, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePatchPropertiesInternal)this).SerialNumber = (string) content.GetValueForProperty("SerialNumber",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePatchPropertiesInternal)this).SerialNumber, 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,7 +134,7 @@ internal StorageAppliancePatchProperties(global::System.Management.Automation.PS // actually deserialize if (content.Contains("SerialNumber")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePatchPropertiesInternal)this).SerialNumber = (string) content.GetValueForProperty("SerialNumber",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePatchPropertiesInternal)this).SerialNumber, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePatchPropertiesInternal)this).SerialNumber = (string) content.GetValueForProperty("SerialNumber",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePatchPropertiesInternal)this).SerialNumber, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/StorageAppliancePatchProperties.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/StorageAppliancePatchProperties.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/StorageAppliancePatchProperties.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/StorageAppliancePatchProperties.TypeConverter.cs index faf796803539..6b81bb385544 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/StorageAppliancePatchProperties.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/StorageAppliancePatchProperties.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IStorageAppliancePatchProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePatchProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePatchProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePatchProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/StorageAppliancePatchProperties.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/StorageAppliancePatchProperties.cs similarity index 89% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/StorageAppliancePatchProperties.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/StorageAppliancePatchProperties.cs index a7e19ed23bb4..3e8b2ec47783 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/StorageAppliancePatchProperties.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/StorageAppliancePatchProperties.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -11,8 +11,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201 /// StorageAppliancePatchProperties represents the properties of the storage appliance that can be patched. /// public partial class StorageAppliancePatchProperties : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePatchProperties, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePatchPropertiesInternal + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePatchProperties, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePatchPropertiesInternal { /// Backing field for property. @@ -36,6 +36,9 @@ public partial interface IStorageAppliancePatchProperties : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The serial number for the storage appliance.", SerializedName = @"serialNumber", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/StorageAppliancePatchProperties.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/StorageAppliancePatchProperties.json.cs similarity index 95% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/StorageAppliancePatchProperties.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/StorageAppliancePatchProperties.json.cs index 3e37447666dd..119e15c8e067 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/StorageAppliancePatchProperties.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/StorageAppliancePatchProperties.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -56,13 +56,13 @@ public partial class StorageAppliancePatchProperties partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePatchProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePatchProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePatchProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePatchProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePatchProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePatchProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new StorageAppliancePatchProperties(json) : null; } @@ -79,7 +79,7 @@ internal StorageAppliancePatchProperties(Microsoft.Azure.PowerShell.Cmdlets.Netw { return; } - {_serialNumber = If( json?.PropertyT("serialNumber"), out var __jsonSerialNumber) ? (string)__jsonSerialNumber : (string)SerialNumber;} + {_serialNumber = If( json?.PropertyT("serialNumber"), out var __jsonSerialNumber) ? (string)__jsonSerialNumber : (string)_serialNumber;} AfterFromJson(json); } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/StorageApplianceProperties.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/StorageApplianceProperties.PowerShell.cs new file mode 100644 index 000000000000..70c9d3545373 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/StorageApplianceProperties.PowerShell.cs @@ -0,0 +1,316 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + + /// StorageApplianceProperties represents the properties of the storage appliance. + [System.ComponentModel.TypeConverter(typeof(StorageAppliancePropertiesTypeConverter))] + public partial class StorageApplianceProperties + { + + /// + /// 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.NetworkCloud.Models.IStorageApplianceProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new StorageApplianceProperties(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.NetworkCloud.Models.IStorageApplianceProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new StorageApplianceProperties(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.NetworkCloud.Models.IStorageApplianceProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal StorageApplianceProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("AdministratorCredentials")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePropertiesInternal)this).AdministratorCredentials = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministrativeCredentials) content.GetValueForProperty("AdministratorCredentials",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePropertiesInternal)this).AdministratorCredentials, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AdministrativeCredentialsTypeConverter.ConvertFrom); + } + if (content.Contains("Capacity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePropertiesInternal)this).Capacity = (long?) content.GetValueForProperty("Capacity",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePropertiesInternal)this).Capacity, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("CapacityUsed")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePropertiesInternal)this).CapacityUsed = (long?) content.GetValueForProperty("CapacityUsed",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePropertiesInternal)this).CapacityUsed, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("ClusterId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePropertiesInternal)this).ClusterId = (string) content.GetValueForProperty("ClusterId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePropertiesInternal)this).ClusterId, global::System.Convert.ToString); + } + if (content.Contains("DetailedStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePropertiesInternal)this).DetailedStatus = (string) content.GetValueForProperty("DetailedStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePropertiesInternal)this).DetailedStatus, global::System.Convert.ToString); + } + if (content.Contains("DetailedStatusMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePropertiesInternal)this).DetailedStatusMessage = (string) content.GetValueForProperty("DetailedStatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePropertiesInternal)this).DetailedStatusMessage, global::System.Convert.ToString); + } + if (content.Contains("ManagementIpv4Address")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePropertiesInternal)this).ManagementIpv4Address = (string) content.GetValueForProperty("ManagementIpv4Address",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePropertiesInternal)this).ManagementIpv4Address, global::System.Convert.ToString); + } + if (content.Contains("Manufacturer")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePropertiesInternal)this).Manufacturer = (string) content.GetValueForProperty("Manufacturer",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePropertiesInternal)this).Manufacturer, global::System.Convert.ToString); + } + if (content.Contains("Model")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePropertiesInternal)this).Model = (string) content.GetValueForProperty("Model",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePropertiesInternal)this).Model, global::System.Convert.ToString); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePropertiesInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("RackId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePropertiesInternal)this).RackId = (string) content.GetValueForProperty("RackId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePropertiesInternal)this).RackId, global::System.Convert.ToString); + } + if (content.Contains("RackSlot")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePropertiesInternal)this).RackSlot = (long?) content.GetValueForProperty("RackSlot",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePropertiesInternal)this).RackSlot, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("RemoteVendorManagementFeature")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePropertiesInternal)this).RemoteVendorManagementFeature = (string) content.GetValueForProperty("RemoteVendorManagementFeature",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePropertiesInternal)this).RemoteVendorManagementFeature, global::System.Convert.ToString); + } + if (content.Contains("RemoteVendorManagementStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePropertiesInternal)this).RemoteVendorManagementStatus = (string) content.GetValueForProperty("RemoteVendorManagementStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePropertiesInternal)this).RemoteVendorManagementStatus, global::System.Convert.ToString); + } + if (content.Contains("SecretRotationStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePropertiesInternal)this).SecretRotationStatus = (System.Collections.Generic.List) content.GetValueForProperty("SecretRotationStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePropertiesInternal)this).SecretRotationStatus, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.SecretRotationStatusTypeConverter.ConvertFrom)); + } + if (content.Contains("SerialNumber")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePropertiesInternal)this).SerialNumber = (string) content.GetValueForProperty("SerialNumber",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePropertiesInternal)this).SerialNumber, global::System.Convert.ToString); + } + if (content.Contains("StorageApplianceSkuId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePropertiesInternal)this).StorageApplianceSkuId = (string) content.GetValueForProperty("StorageApplianceSkuId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePropertiesInternal)this).StorageApplianceSkuId, global::System.Convert.ToString); + } + if (content.Contains("Version")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePropertiesInternal)this).Version = (string) content.GetValueForProperty("Version",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePropertiesInternal)this).Version, global::System.Convert.ToString); + } + if (content.Contains("AdministratorCredentialsPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePropertiesInternal)this).AdministratorCredentialsPassword = (System.Security.SecureString) content.GetValueForProperty("AdministratorCredentialsPassword",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePropertiesInternal)this).AdministratorCredentialsPassword, (object ss) => (System.Security.SecureString)ss); + } + if (content.Contains("AdministratorCredentialsUsername")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePropertiesInternal)this).AdministratorCredentialsUsername = (string) content.GetValueForProperty("AdministratorCredentialsUsername",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePropertiesInternal)this).AdministratorCredentialsUsername, 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 StorageApplianceProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("AdministratorCredentials")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePropertiesInternal)this).AdministratorCredentials = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministrativeCredentials) content.GetValueForProperty("AdministratorCredentials",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePropertiesInternal)this).AdministratorCredentials, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AdministrativeCredentialsTypeConverter.ConvertFrom); + } + if (content.Contains("Capacity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePropertiesInternal)this).Capacity = (long?) content.GetValueForProperty("Capacity",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePropertiesInternal)this).Capacity, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("CapacityUsed")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePropertiesInternal)this).CapacityUsed = (long?) content.GetValueForProperty("CapacityUsed",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePropertiesInternal)this).CapacityUsed, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("ClusterId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePropertiesInternal)this).ClusterId = (string) content.GetValueForProperty("ClusterId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePropertiesInternal)this).ClusterId, global::System.Convert.ToString); + } + if (content.Contains("DetailedStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePropertiesInternal)this).DetailedStatus = (string) content.GetValueForProperty("DetailedStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePropertiesInternal)this).DetailedStatus, global::System.Convert.ToString); + } + if (content.Contains("DetailedStatusMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePropertiesInternal)this).DetailedStatusMessage = (string) content.GetValueForProperty("DetailedStatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePropertiesInternal)this).DetailedStatusMessage, global::System.Convert.ToString); + } + if (content.Contains("ManagementIpv4Address")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePropertiesInternal)this).ManagementIpv4Address = (string) content.GetValueForProperty("ManagementIpv4Address",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePropertiesInternal)this).ManagementIpv4Address, global::System.Convert.ToString); + } + if (content.Contains("Manufacturer")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePropertiesInternal)this).Manufacturer = (string) content.GetValueForProperty("Manufacturer",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePropertiesInternal)this).Manufacturer, global::System.Convert.ToString); + } + if (content.Contains("Model")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePropertiesInternal)this).Model = (string) content.GetValueForProperty("Model",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePropertiesInternal)this).Model, global::System.Convert.ToString); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePropertiesInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("RackId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePropertiesInternal)this).RackId = (string) content.GetValueForProperty("RackId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePropertiesInternal)this).RackId, global::System.Convert.ToString); + } + if (content.Contains("RackSlot")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePropertiesInternal)this).RackSlot = (long?) content.GetValueForProperty("RackSlot",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePropertiesInternal)this).RackSlot, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("RemoteVendorManagementFeature")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePropertiesInternal)this).RemoteVendorManagementFeature = (string) content.GetValueForProperty("RemoteVendorManagementFeature",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePropertiesInternal)this).RemoteVendorManagementFeature, global::System.Convert.ToString); + } + if (content.Contains("RemoteVendorManagementStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePropertiesInternal)this).RemoteVendorManagementStatus = (string) content.GetValueForProperty("RemoteVendorManagementStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePropertiesInternal)this).RemoteVendorManagementStatus, global::System.Convert.ToString); + } + if (content.Contains("SecretRotationStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePropertiesInternal)this).SecretRotationStatus = (System.Collections.Generic.List) content.GetValueForProperty("SecretRotationStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePropertiesInternal)this).SecretRotationStatus, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.SecretRotationStatusTypeConverter.ConvertFrom)); + } + if (content.Contains("SerialNumber")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePropertiesInternal)this).SerialNumber = (string) content.GetValueForProperty("SerialNumber",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePropertiesInternal)this).SerialNumber, global::System.Convert.ToString); + } + if (content.Contains("StorageApplianceSkuId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePropertiesInternal)this).StorageApplianceSkuId = (string) content.GetValueForProperty("StorageApplianceSkuId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePropertiesInternal)this).StorageApplianceSkuId, global::System.Convert.ToString); + } + if (content.Contains("Version")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePropertiesInternal)this).Version = (string) content.GetValueForProperty("Version",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePropertiesInternal)this).Version, global::System.Convert.ToString); + } + if (content.Contains("AdministratorCredentialsPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePropertiesInternal)this).AdministratorCredentialsPassword = (System.Security.SecureString) content.GetValueForProperty("AdministratorCredentialsPassword",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePropertiesInternal)this).AdministratorCredentialsPassword, (object ss) => (System.Security.SecureString)ss); + } + if (content.Contains("AdministratorCredentialsUsername")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePropertiesInternal)this).AdministratorCredentialsUsername = (string) content.GetValueForProperty("AdministratorCredentialsUsername",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePropertiesInternal)this).AdministratorCredentialsUsername, 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.NetworkCloud.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(); + } + } + /// StorageApplianceProperties represents the properties of the storage appliance. + [System.ComponentModel.TypeConverter(typeof(StorageAppliancePropertiesTypeConverter))] + public partial interface IStorageApplianceProperties + + { + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/StorageApplianceProperties.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/StorageApplianceProperties.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/StorageApplianceProperties.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/StorageApplianceProperties.TypeConverter.cs index df056739a72a..76b85f23d42d 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/StorageApplianceProperties.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/StorageApplianceProperties.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IStorageApplianceProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/StorageApplianceProperties.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/StorageApplianceProperties.cs new file mode 100644 index 000000000000..0adfa4d14cf0 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/StorageApplianceProperties.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.NetworkCloud.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + + /// StorageApplianceProperties represents the properties of the storage appliance. + public partial class StorageApplianceProperties : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceProperties, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePropertiesInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministrativeCredentials _administratorCredentials; + + /// The credentials of the administrative interface on this storage appliance. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministrativeCredentials AdministratorCredentials { get => (this._administratorCredentials = this._administratorCredentials ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AdministrativeCredentials()); set => this._administratorCredentials = value; } + + /// The password of the administrator of the device used during initialization. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public System.Security.SecureString AdministratorCredentialsPassword { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministrativeCredentialsInternal)AdministratorCredentials).Password; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministrativeCredentialsInternal)AdministratorCredentials).Password = value ?? null; } + + /// The username of the administrator of the device used during initialization. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string AdministratorCredentialsUsername { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministrativeCredentialsInternal)AdministratorCredentials).Username; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministrativeCredentialsInternal)AdministratorCredentials).Username = value ?? null; } + + /// Backing field for property. + private long? _capacity; + + /// The total capacity of the storage appliance. Measured in GiB. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public long? Capacity { get => this._capacity; } + + /// Backing field for property. + private long? _capacityUsed; + + /// The amount of storage consumed. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public long? CapacityUsed { get => this._capacityUsed; } + + /// Backing field for property. + private string _clusterId; + + /// + /// The resource ID of the cluster this storage appliance is associated with. Measured in GiB. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string ClusterId { get => this._clusterId; } + + /// Backing field for property. + private string _detailedStatus; + + /// The detailed status of the storage appliance. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string DetailedStatus { get => this._detailedStatus; } + + /// Backing field for property. + private string _detailedStatusMessage; + + /// The descriptive message about the current detailed status. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string DetailedStatusMessage { get => this._detailedStatusMessage; } + + /// Backing field for property. + private string _managementIpv4Address; + + /// The endpoint for the management interface of the storage appliance. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string ManagementIpv4Address { get => this._managementIpv4Address; } + + /// Backing field for property. + private string _manufacturer; + + /// The manufacturer of the storage appliance. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string Manufacturer { get => this._manufacturer; } + + /// Internal Acessors for AdministratorCredentials + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministrativeCredentials Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePropertiesInternal.AdministratorCredentials { get => (this._administratorCredentials = this._administratorCredentials ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AdministrativeCredentials()); set { {_administratorCredentials = value;} } } + + /// Internal Acessors for Capacity + long? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePropertiesInternal.Capacity { get => this._capacity; set { {_capacity = value;} } } + + /// Internal Acessors for CapacityUsed + long? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePropertiesInternal.CapacityUsed { get => this._capacityUsed; set { {_capacityUsed = value;} } } + + /// Internal Acessors for ClusterId + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePropertiesInternal.ClusterId { get => this._clusterId; set { {_clusterId = value;} } } + + /// Internal Acessors for DetailedStatus + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePropertiesInternal.DetailedStatus { get => this._detailedStatus; set { {_detailedStatus = value;} } } + + /// Internal Acessors for DetailedStatusMessage + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePropertiesInternal.DetailedStatusMessage { get => this._detailedStatusMessage; set { {_detailedStatusMessage = value;} } } + + /// Internal Acessors for ManagementIpv4Address + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePropertiesInternal.ManagementIpv4Address { get => this._managementIpv4Address; set { {_managementIpv4Address = value;} } } + + /// Internal Acessors for Manufacturer + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePropertiesInternal.Manufacturer { get => this._manufacturer; set { {_manufacturer = value;} } } + + /// Internal Acessors for Model + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePropertiesInternal.Model { get => this._model; set { {_model = value;} } } + + /// Internal Acessors for ProvisioningState + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePropertiesInternal.ProvisioningState { get => this._provisioningState; set { {_provisioningState = value;} } } + + /// Internal Acessors for RemoteVendorManagementFeature + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePropertiesInternal.RemoteVendorManagementFeature { get => this._remoteVendorManagementFeature; set { {_remoteVendorManagementFeature = value;} } } + + /// Internal Acessors for RemoteVendorManagementStatus + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePropertiesInternal.RemoteVendorManagementStatus { get => this._remoteVendorManagementStatus; set { {_remoteVendorManagementStatus = value;} } } + + /// Internal Acessors for SecretRotationStatus + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePropertiesInternal.SecretRotationStatus { get => this._secretRotationStatus; set { {_secretRotationStatus = value;} } } + + /// Internal Acessors for Version + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePropertiesInternal.Version { get => this._version; set { {_version = value;} } } + + /// Backing field for property. + private string _model; + + /// The model of the storage appliance. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string Model { get => this._model; } + + /// Backing field for property. + private string _provisioningState; + + /// The provisioning state of the storage appliance. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string ProvisioningState { get => this._provisioningState; } + + /// Backing field for property. + private string _rackId; + + /// The resource ID of the rack where this storage appliance resides. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string RackId { get => this._rackId; set => this._rackId = value; } + + /// Backing field for property. + private long? _rackSlot; + + /// The slot the storage appliance is in the rack based on the BOM configuration. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public long? RackSlot { get => this._rackSlot; set => this._rackSlot = value; } + + /// Backing field for property. + private string _remoteVendorManagementFeature; + + /// + /// The indicator of whether the storage appliance supports remote vendor management. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string RemoteVendorManagementFeature { get => this._remoteVendorManagementFeature; } + + /// Backing field for property. + private string _remoteVendorManagementStatus; + + /// + /// The indicator of whether the remote vendor management feature is enabled or disabled, or unsupported if it is an unsupported + /// feature. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string RemoteVendorManagementStatus { get => this._remoteVendorManagementStatus; } + + /// Backing field for property. + private System.Collections.Generic.List _secretRotationStatus; + + /// The list of statuses that represent secret rotation activity. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public System.Collections.Generic.List SecretRotationStatus { get => this._secretRotationStatus; } + + /// Backing field for property. + private string _serialNumber; + + /// The serial number for the storage appliance. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string SerialNumber { get => this._serialNumber; set => this._serialNumber = value; } + + /// Backing field for property. + private string _storageApplianceSkuId; + + /// The SKU for the storage appliance. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string StorageApplianceSkuId { get => this._storageApplianceSkuId; set => this._storageApplianceSkuId = value; } + + /// Backing field for property. + private string _version; + + /// The version of the storage appliance. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string Version { get => this._version; } + + /// Creates an new instance. + public StorageApplianceProperties() + { + + } + } + /// StorageApplianceProperties represents the properties of the storage appliance. + public partial interface IStorageApplianceProperties : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable + { + /// The password of the administrator of the device used during initialization. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The password of the administrator of the device used during initialization.", + SerializedName = @"password", + PossibleTypes = new [] { typeof(System.Security.SecureString) })] + System.Security.SecureString AdministratorCredentialsPassword { get; set; } + /// The username of the administrator of the device used during initialization. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The username of the administrator of the device used during initialization.", + SerializedName = @"username", + PossibleTypes = new [] { typeof(string) })] + string AdministratorCredentialsUsername { get; set; } + /// The total capacity of the storage appliance. Measured in GiB. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The total capacity of the storage appliance. Measured in GiB.", + SerializedName = @"capacity", + PossibleTypes = new [] { typeof(long) })] + long? Capacity { get; } + /// The amount of storage consumed. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The amount of storage consumed.", + SerializedName = @"capacityUsed", + PossibleTypes = new [] { typeof(long) })] + long? CapacityUsed { get; } + /// + /// The resource ID of the cluster this storage appliance is associated with. Measured in GiB. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The resource ID of the cluster this storage appliance is associated with. Measured in GiB.", + SerializedName = @"clusterId", + PossibleTypes = new [] { typeof(string) })] + string ClusterId { get; } + /// The detailed status of the storage appliance. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The detailed status of the storage appliance.", + SerializedName = @"detailedStatus", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Available", "Degraded", "Error", "Provisioning")] + string DetailedStatus { get; } + /// The descriptive message about the current detailed status. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The descriptive message about the current detailed status.", + SerializedName = @"detailedStatusMessage", + PossibleTypes = new [] { typeof(string) })] + string DetailedStatusMessage { get; } + /// The endpoint for the management interface of the storage appliance. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The endpoint for the management interface of the storage appliance.", + SerializedName = @"managementIpv4Address", + PossibleTypes = new [] { typeof(string) })] + string ManagementIpv4Address { get; } + /// The manufacturer of the storage appliance. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The manufacturer of the storage appliance.", + SerializedName = @"manufacturer", + PossibleTypes = new [] { typeof(string) })] + string Manufacturer { get; } + /// The model of the storage appliance. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The model of the storage appliance.", + SerializedName = @"model", + PossibleTypes = new [] { typeof(string) })] + string Model { get; } + /// The provisioning state of the storage appliance. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The provisioning state of the storage appliance.", + SerializedName = @"provisioningState", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Succeeded", "Failed", "Canceled", "Provisioning", "Accepted")] + string ProvisioningState { get; } + /// The resource ID of the rack where this storage appliance resides. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The resource ID of the rack where this storage appliance resides.", + SerializedName = @"rackId", + PossibleTypes = new [] { typeof(string) })] + string RackId { get; set; } + /// The slot the storage appliance is in the rack based on the BOM configuration. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The slot the storage appliance is in the rack based on the BOM configuration.", + SerializedName = @"rackSlot", + PossibleTypes = new [] { typeof(long) })] + long? RackSlot { get; set; } + /// + /// The indicator of whether the storage appliance supports remote vendor management. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The indicator of whether the storage appliance supports remote vendor management.", + SerializedName = @"remoteVendorManagementFeature", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Supported", "Unsupported")] + string RemoteVendorManagementFeature { get; } + /// + /// The indicator of whether the remote vendor management feature is enabled or disabled, or unsupported if it is an unsupported + /// feature. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The indicator of whether the remote vendor management feature is enabled or disabled, or unsupported if it is an unsupported feature.", + SerializedName = @"remoteVendorManagementStatus", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Enabled", "Disabled", "Unsupported")] + string RemoteVendorManagementStatus { get; } + /// The list of statuses that represent secret rotation activity. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The list of statuses that represent secret rotation activity.", + SerializedName = @"secretRotationStatus", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISecretRotationStatus) })] + System.Collections.Generic.List SecretRotationStatus { get; } + /// The serial number for the storage appliance. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The serial number for the storage appliance.", + SerializedName = @"serialNumber", + PossibleTypes = new [] { typeof(string) })] + string SerialNumber { get; set; } + /// The SKU for the storage appliance. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The SKU for the storage appliance.", + SerializedName = @"storageApplianceSkuId", + PossibleTypes = new [] { typeof(string) })] + string StorageApplianceSkuId { get; set; } + /// The version of the storage appliance. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The version of the storage appliance.", + SerializedName = @"version", + PossibleTypes = new [] { typeof(string) })] + string Version { get; } + + } + /// StorageApplianceProperties represents the properties of the storage appliance. + internal partial interface IStorageAppliancePropertiesInternal + + { + /// The credentials of the administrative interface on this storage appliance. + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAdministrativeCredentials AdministratorCredentials { get; set; } + /// The password of the administrator of the device used during initialization. + System.Security.SecureString AdministratorCredentialsPassword { get; set; } + /// The username of the administrator of the device used during initialization. + string AdministratorCredentialsUsername { get; set; } + /// The total capacity of the storage appliance. Measured in GiB. + long? Capacity { get; set; } + /// The amount of storage consumed. + long? CapacityUsed { get; set; } + /// + /// The resource ID of the cluster this storage appliance is associated with. Measured in GiB. + /// + string ClusterId { get; set; } + /// The detailed status of the storage appliance. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Available", "Degraded", "Error", "Provisioning")] + string DetailedStatus { get; set; } + /// The descriptive message about the current detailed status. + string DetailedStatusMessage { get; set; } + /// The endpoint for the management interface of the storage appliance. + string ManagementIpv4Address { get; set; } + /// The manufacturer of the storage appliance. + string Manufacturer { get; set; } + /// The model of the storage appliance. + string Model { get; set; } + /// The provisioning state of the storage appliance. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Succeeded", "Failed", "Canceled", "Provisioning", "Accepted")] + string ProvisioningState { get; set; } + /// The resource ID of the rack where this storage appliance resides. + string RackId { get; set; } + /// The slot the storage appliance is in the rack based on the BOM configuration. + long? RackSlot { get; set; } + /// + /// The indicator of whether the storage appliance supports remote vendor management. + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Supported", "Unsupported")] + string RemoteVendorManagementFeature { get; set; } + /// + /// The indicator of whether the remote vendor management feature is enabled or disabled, or unsupported if it is an unsupported + /// feature. + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Enabled", "Disabled", "Unsupported")] + string RemoteVendorManagementStatus { get; set; } + /// The list of statuses that represent secret rotation activity. + System.Collections.Generic.List SecretRotationStatus { get; set; } + /// The serial number for the storage appliance. + string SerialNumber { get; set; } + /// The SKU for the storage appliance. + string StorageApplianceSkuId { get; set; } + /// The version of the storage appliance. + string Version { get; set; } + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/StorageApplianceProperties.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/StorageApplianceProperties.json.cs similarity index 76% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/StorageApplianceProperties.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/StorageApplianceProperties.json.cs index 76df245f9aa1..d3d2fd896c97 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/StorageApplianceProperties.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/StorageApplianceProperties.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class StorageApplianceProperties partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new StorageApplianceProperties(json) : null; } @@ -77,24 +77,24 @@ internal StorageApplianceProperties(Microsoft.Azure.PowerShell.Cmdlets.NetworkCl { return; } - {_administratorCredentials = If( json?.PropertyT("administratorCredentials"), out var __jsonAdministratorCredentials) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AdministrativeCredentials.FromJson(__jsonAdministratorCredentials) : AdministratorCredentials;} - {_capacity = If( json?.PropertyT("capacity"), out var __jsonCapacity) ? (long?)__jsonCapacity : Capacity;} - {_capacityUsed = If( json?.PropertyT("capacityUsed"), out var __jsonCapacityUsed) ? (long?)__jsonCapacityUsed : CapacityUsed;} - {_clusterId = If( json?.PropertyT("clusterId"), out var __jsonClusterId) ? (string)__jsonClusterId : (string)ClusterId;} - {_detailedStatus = If( json?.PropertyT("detailedStatus"), out var __jsonDetailedStatus) ? (string)__jsonDetailedStatus : (string)DetailedStatus;} - {_detailedStatusMessage = If( json?.PropertyT("detailedStatusMessage"), out var __jsonDetailedStatusMessage) ? (string)__jsonDetailedStatusMessage : (string)DetailedStatusMessage;} - {_managementIpv4Address = If( json?.PropertyT("managementIpv4Address"), out var __jsonManagementIpv4Address) ? (string)__jsonManagementIpv4Address : (string)ManagementIpv4Address;} - {_manufacturer = If( json?.PropertyT("manufacturer"), out var __jsonManufacturer) ? (string)__jsonManufacturer : (string)Manufacturer;} - {_model = If( json?.PropertyT("model"), out var __jsonModel) ? (string)__jsonModel : (string)Model;} - {_provisioningState = If( json?.PropertyT("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)ProvisioningState;} - {_rackId = If( json?.PropertyT("rackId"), out var __jsonRackId) ? (string)__jsonRackId : (string)RackId;} - {_rackSlot = If( json?.PropertyT("rackSlot"), out var __jsonRackSlot) ? (long)__jsonRackSlot : RackSlot;} - {_remoteVendorManagementFeature = If( json?.PropertyT("remoteVendorManagementFeature"), out var __jsonRemoteVendorManagementFeature) ? (string)__jsonRemoteVendorManagementFeature : (string)RemoteVendorManagementFeature;} - {_remoteVendorManagementStatus = If( json?.PropertyT("remoteVendorManagementStatus"), out var __jsonRemoteVendorManagementStatus) ? (string)__jsonRemoteVendorManagementStatus : (string)RemoteVendorManagementStatus;} - {_secretRotationStatus = If( json?.PropertyT("secretRotationStatus"), out var __jsonSecretRotationStatus) ? If( __jsonSecretRotationStatus as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.ISecretRotationStatus) (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.SecretRotationStatus.FromJson(__u) )) ))() : null : SecretRotationStatus;} - {_serialNumber = If( json?.PropertyT("serialNumber"), out var __jsonSerialNumber) ? (string)__jsonSerialNumber : (string)SerialNumber;} - {_storageApplianceSkuId = If( json?.PropertyT("storageApplianceSkuId"), out var __jsonStorageApplianceSkuId) ? (string)__jsonStorageApplianceSkuId : (string)StorageApplianceSkuId;} - {_version = If( json?.PropertyT("version"), out var __jsonVersion) ? (string)__jsonVersion : (string)Version;} + {_administratorCredentials = If( json?.PropertyT("administratorCredentials"), out var __jsonAdministratorCredentials) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AdministrativeCredentials.FromJson(__jsonAdministratorCredentials) : _administratorCredentials;} + {_capacity = If( json?.PropertyT("capacity"), out var __jsonCapacity) ? (long?)__jsonCapacity : _capacity;} + {_capacityUsed = If( json?.PropertyT("capacityUsed"), out var __jsonCapacityUsed) ? (long?)__jsonCapacityUsed : _capacityUsed;} + {_clusterId = If( json?.PropertyT("clusterId"), out var __jsonClusterId) ? (string)__jsonClusterId : (string)_clusterId;} + {_detailedStatus = If( json?.PropertyT("detailedStatus"), out var __jsonDetailedStatus) ? (string)__jsonDetailedStatus : (string)_detailedStatus;} + {_detailedStatusMessage = If( json?.PropertyT("detailedStatusMessage"), out var __jsonDetailedStatusMessage) ? (string)__jsonDetailedStatusMessage : (string)_detailedStatusMessage;} + {_managementIpv4Address = If( json?.PropertyT("managementIpv4Address"), out var __jsonManagementIpv4Address) ? (string)__jsonManagementIpv4Address : (string)_managementIpv4Address;} + {_manufacturer = If( json?.PropertyT("manufacturer"), out var __jsonManufacturer) ? (string)__jsonManufacturer : (string)_manufacturer;} + {_model = If( json?.PropertyT("model"), out var __jsonModel) ? (string)__jsonModel : (string)_model;} + {_provisioningState = If( json?.PropertyT("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)_provisioningState;} + {_rackId = If( json?.PropertyT("rackId"), out var __jsonRackId) ? (string)__jsonRackId : (string)_rackId;} + {_rackSlot = If( json?.PropertyT("rackSlot"), out var __jsonRackSlot) ? (long?)__jsonRackSlot : _rackSlot;} + {_remoteVendorManagementFeature = If( json?.PropertyT("remoteVendorManagementFeature"), out var __jsonRemoteVendorManagementFeature) ? (string)__jsonRemoteVendorManagementFeature : (string)_remoteVendorManagementFeature;} + {_remoteVendorManagementStatus = If( json?.PropertyT("remoteVendorManagementStatus"), out var __jsonRemoteVendorManagementStatus) ? (string)__jsonRemoteVendorManagementStatus : (string)_remoteVendorManagementStatus;} + {_secretRotationStatus = If( json?.PropertyT("secretRotationStatus"), out var __jsonSecretRotationStatus) ? If( __jsonSecretRotationStatus as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.ISecretRotationStatus) (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.SecretRotationStatus.FromJson(__u) )) ))() : null : _secretRotationStatus;} + {_serialNumber = If( json?.PropertyT("serialNumber"), out var __jsonSerialNumber) ? (string)__jsonSerialNumber : (string)_serialNumber;} + {_storageApplianceSkuId = If( json?.PropertyT("storageApplianceSkuId"), out var __jsonStorageApplianceSkuId) ? (string)__jsonStorageApplianceSkuId : (string)_storageApplianceSkuId;} + {_version = If( json?.PropertyT("version"), out var __jsonVersion) ? (string)__jsonVersion : (string)_version;} AfterFromJson(json); } @@ -117,54 +117,63 @@ public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode ToJ { return container; } - AddIf( null != this._administratorCredentials ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) this._administratorCredentials.ToJson(null,serializationMode) : null, "administratorCredentials" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)||serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate)) + { + AddIf( null != this._administratorCredentials ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) this._administratorCredentials.ToJson(null,serializationMode) : null, "administratorCredentials" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != this._capacity ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNumber((long)this._capacity) : null, "capacity" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != this._capacityUsed ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNumber((long)this._capacityUsed) : null, "capacityUsed" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._clusterId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._clusterId.ToString()) : null, "clusterId" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._detailedStatus)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._detailedStatus.ToString()) : null, "detailedStatus" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._detailedStatusMessage)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._detailedStatusMessage.ToString()) : null, "detailedStatusMessage" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._managementIpv4Address)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._managementIpv4Address.ToString()) : null, "managementIpv4Address" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._manufacturer)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._manufacturer.ToString()) : null, "manufacturer" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._model)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._model.ToString()) : null, "model" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._provisioningState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._provisioningState.ToString()) : null, "provisioningState" ,container.Add ); } - AddIf( null != (((object)this._rackId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._rackId.ToString()) : null, "rackId" ,container.Add ); - AddIf( (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNumber(this._rackSlot), "rackSlot" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)||serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate)) + { + AddIf( null != (((object)this._rackId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._rackId.ToString()) : null, "rackId" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)||serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate)) + { + AddIf( null != this._rackSlot ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNumber((long)this._rackSlot) : null, "rackSlot" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._remoteVendorManagementFeature)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._remoteVendorManagementFeature.ToString()) : null, "remoteVendorManagementFeature" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._remoteVendorManagementStatus)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._remoteVendorManagementStatus.ToString()) : null, "remoteVendorManagementStatus" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { if (null != this._secretRotationStatus) { @@ -177,8 +186,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode ToJ } } AddIf( null != (((object)this._serialNumber)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._serialNumber.ToString()) : null, "serialNumber" ,container.Add ); - AddIf( null != (((object)this._storageApplianceSkuId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._storageApplianceSkuId.ToString()) : null, "storageApplianceSkuId" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)||serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate)) + { + AddIf( null != (((object)this._storageApplianceSkuId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._storageApplianceSkuId.ToString()) : null, "storageApplianceSkuId" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._version)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._version.ToString()) : null, "version" ,container.Add ); } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/StorageApplianceSkuProperties.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/StorageApplianceSkuProperties.PowerShell.cs similarity index 79% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/StorageApplianceSkuProperties.PowerShell.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/StorageApplianceSkuProperties.PowerShell.cs index 2294b2cf7a59..d3e50d363eba 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/StorageApplianceSkuProperties.PowerShell.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/StorageApplianceSkuProperties.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; @@ -65,29 +65,27 @@ public partial class StorageApplianceSkuProperties 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.NetworkCloud.Models.Api20250201.IStorageApplianceSkuProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceSkuProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new StorageApplianceSkuProperties(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.NetworkCloud.Models.Api20250201.IStorageApplianceSkuProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceSkuProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new StorageApplianceSkuProperties(content); } @@ -97,10 +95,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceSkuProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceSkuProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,17 +113,17 @@ internal StorageApplianceSkuProperties(global::System.Collections.IDictionary co // actually deserialize if (content.Contains("CapacityGb")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceSkuPropertiesInternal)this).CapacityGb = (long?) content.GetValueForProperty("CapacityGb",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceSkuPropertiesInternal)this).CapacityGb, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceSkuPropertiesInternal)this).CapacityGb = (long?) content.GetValueForProperty("CapacityGb",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceSkuPropertiesInternal)this).CapacityGb, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); } if (content.Contains("Model")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceSkuPropertiesInternal)this).Model = (string) content.GetValueForProperty("Model",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceSkuPropertiesInternal)this).Model, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceSkuPropertiesInternal)this).Model = (string) content.GetValueForProperty("Model",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceSkuPropertiesInternal)this).Model, 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,11 +138,11 @@ internal StorageApplianceSkuProperties(global::System.Management.Automation.PSOb // actually deserialize if (content.Contains("CapacityGb")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceSkuPropertiesInternal)this).CapacityGb = (long?) content.GetValueForProperty("CapacityGb",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceSkuPropertiesInternal)this).CapacityGb, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceSkuPropertiesInternal)this).CapacityGb = (long?) content.GetValueForProperty("CapacityGb",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceSkuPropertiesInternal)this).CapacityGb, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); } if (content.Contains("Model")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceSkuPropertiesInternal)this).Model = (string) content.GetValueForProperty("Model",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceSkuPropertiesInternal)this).Model, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceSkuPropertiesInternal)this).Model = (string) content.GetValueForProperty("Model",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceSkuPropertiesInternal)this).Model, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/StorageApplianceSkuProperties.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/StorageApplianceSkuProperties.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/StorageApplianceSkuProperties.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/StorageApplianceSkuProperties.TypeConverter.cs index f8c7080a957a..3c83aedee704 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/StorageApplianceSkuProperties.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/StorageApplianceSkuProperties.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IStorageApplianceSkuProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceSkuProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceSkuProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceSkuProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/StorageApplianceSkuProperties.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/StorageApplianceSkuProperties.cs similarity index 85% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/StorageApplianceSkuProperties.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/StorageApplianceSkuProperties.cs index ab7038ac226b..03966379533c 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/StorageApplianceSkuProperties.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/StorageApplianceSkuProperties.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -11,8 +11,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201 /// StorageApplianceSkuProperties represents the properties of the storage appliance SKU. /// public partial class StorageApplianceSkuProperties : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceSkuProperties, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceSkuPropertiesInternal + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceSkuProperties, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceSkuPropertiesInternal { /// Backing field for property. @@ -23,10 +23,10 @@ public partial class StorageApplianceSkuProperties : public long? CapacityGb { get => this._capacityGb; } /// Internal Acessors for CapacityGb - long? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceSkuPropertiesInternal.CapacityGb { get => this._capacityGb; set { {_capacityGb = value;} } } + long? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceSkuPropertiesInternal.CapacityGb { get => this._capacityGb; set { {_capacityGb = value;} } } /// Internal Acessors for Model - string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceSkuPropertiesInternal.Model { get => this._model; set { {_model = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceSkuPropertiesInternal.Model { get => this._model; set { {_model = value;} } } /// Backing field for property. private string _model; @@ -49,6 +49,9 @@ public partial interface IStorageApplianceSkuProperties : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The maximum capacity of the storage appliance. Measured in gibibytes.", SerializedName = @"capacityGB", PossibleTypes = new [] { typeof(long) })] @@ -57,6 +60,9 @@ public partial interface IStorageApplianceSkuProperties : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The model of the storage appliance.", SerializedName = @"model", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/StorageApplianceSkuProperties.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/StorageApplianceSkuProperties.json.cs similarity index 92% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/StorageApplianceSkuProperties.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/StorageApplianceSkuProperties.json.cs index b4ac2129a2e7..89197e572552 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/StorageApplianceSkuProperties.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/StorageApplianceSkuProperties.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -56,13 +56,13 @@ public partial class StorageApplianceSkuProperties partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceSkuProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceSkuProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceSkuProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceSkuProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceSkuProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceSkuProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new StorageApplianceSkuProperties(json) : null; } @@ -79,8 +79,8 @@ internal StorageApplianceSkuProperties(Microsoft.Azure.PowerShell.Cmdlets.Networ { return; } - {_capacityGb = If( json?.PropertyT("capacityGB"), out var __jsonCapacityGb) ? (long?)__jsonCapacityGb : CapacityGb;} - {_model = If( json?.PropertyT("model"), out var __jsonModel) ? (string)__jsonModel : (string)Model;} + {_capacityGb = If( json?.PropertyT("capacityGB"), out var __jsonCapacityGb) ? (long?)__jsonCapacityGb : _capacityGb;} + {_model = If( json?.PropertyT("model"), out var __jsonModel) ? (string)__jsonModel : (string)_model;} AfterFromJson(json); } @@ -103,11 +103,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode ToJ { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != this._capacityGb ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNumber((long)this._capacityGb) : null, "capacityGB" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._model)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._model.ToString()) : null, "model" ,container.Add ); } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/StorageApplianceSkuSlot.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/StorageApplianceSkuSlot.PowerShell.cs new file mode 100644 index 000000000000..acdea63af239 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/StorageApplianceSkuSlot.PowerShell.cs @@ -0,0 +1,190 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + + /// + /// StorageApplianceSkuSlot represents the single SKU and rack slot associated with the storage appliance. + /// + [System.ComponentModel.TypeConverter(typeof(StorageApplianceSkuSlotTypeConverter))] + public partial class StorageApplianceSkuSlot + { + + /// + /// 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.NetworkCloud.Models.IStorageApplianceSkuSlot DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new StorageApplianceSkuSlot(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.NetworkCloud.Models.IStorageApplianceSkuSlot DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new StorageApplianceSkuSlot(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.NetworkCloud.Models.IStorageApplianceSkuSlot FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal StorageApplianceSkuSlot(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.NetworkCloud.Models.IStorageApplianceSkuSlotInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceSkuProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceSkuSlotInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.StorageApplianceSkuPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("RackSlot")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceSkuSlotInternal)this).RackSlot = (long?) content.GetValueForProperty("RackSlot",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceSkuSlotInternal)this).RackSlot, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("CapacityGb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceSkuSlotInternal)this).CapacityGb = (long?) content.GetValueForProperty("CapacityGb",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceSkuSlotInternal)this).CapacityGb, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("Model")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceSkuSlotInternal)this).Model = (string) content.GetValueForProperty("Model",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceSkuSlotInternal)this).Model, 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 StorageApplianceSkuSlot(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.NetworkCloud.Models.IStorageApplianceSkuSlotInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceSkuProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceSkuSlotInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.StorageApplianceSkuPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("RackSlot")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceSkuSlotInternal)this).RackSlot = (long?) content.GetValueForProperty("RackSlot",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceSkuSlotInternal)this).RackSlot, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("CapacityGb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceSkuSlotInternal)this).CapacityGb = (long?) content.GetValueForProperty("CapacityGb",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceSkuSlotInternal)this).CapacityGb, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("Model")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceSkuSlotInternal)this).Model = (string) content.GetValueForProperty("Model",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceSkuSlotInternal)this).Model, 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.NetworkCloud.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(); + } + } + /// StorageApplianceSkuSlot represents the single SKU and rack slot associated with the storage appliance. + [System.ComponentModel.TypeConverter(typeof(StorageApplianceSkuSlotTypeConverter))] + public partial interface IStorageApplianceSkuSlot + + { + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/StorageApplianceSkuSlot.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/StorageApplianceSkuSlot.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/StorageApplianceSkuSlot.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/StorageApplianceSkuSlot.TypeConverter.cs index c410af82593d..477c7c5ff990 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/StorageApplianceSkuSlot.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/StorageApplianceSkuSlot.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IStorageApplianceSkuSlot ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceSkuSlot ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceSkuSlot).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceSkuSlot).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/StorageApplianceSkuSlot.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/StorageApplianceSkuSlot.cs new file mode 100644 index 000000000000..59b3abcfcc90 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/StorageApplianceSkuSlot.cs @@ -0,0 +1,111 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + + /// + /// StorageApplianceSkuSlot represents the single SKU and rack slot associated with the storage appliance. + /// + public partial class StorageApplianceSkuSlot : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceSkuSlot, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceSkuSlotInternal + { + + /// The maximum capacity of the storage appliance. Measured in gibibytes. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public long? CapacityGb { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceSkuPropertiesInternal)Property).CapacityGb; } + + /// Internal Acessors for CapacityGb + long? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceSkuSlotInternal.CapacityGb { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceSkuPropertiesInternal)Property).CapacityGb; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceSkuPropertiesInternal)Property).CapacityGb = value ?? default(long); } + + /// Internal Acessors for Model + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceSkuSlotInternal.Model { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceSkuPropertiesInternal)Property).Model; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceSkuPropertiesInternal)Property).Model = value ?? null; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceSkuProperties Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceSkuSlotInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.StorageApplianceSkuProperties()); set { {_property = value;} } } + + /// Internal Acessors for RackSlot + long? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceSkuSlotInternal.RackSlot { get => this._rackSlot; set { {_rackSlot = value;} } } + + /// The model of the storage appliance. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string Model { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceSkuPropertiesInternal)Property).Model; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceSkuProperties _property; + + /// The list of the resource properties. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceSkuProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.StorageApplianceSkuProperties()); set => this._property = value; } + + /// Backing field for property. + private long? _rackSlot; + + /// The position in the rack for the storage appliance. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public long? RackSlot { get => this._rackSlot; } + + /// Creates an new instance. + public StorageApplianceSkuSlot() + { + + } + } + /// StorageApplianceSkuSlot represents the single SKU and rack slot associated with the storage appliance. + public partial interface IStorageApplianceSkuSlot : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable + { + /// The maximum capacity of the storage appliance. Measured in gibibytes. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The maximum capacity of the storage appliance. Measured in gibibytes.", + SerializedName = @"capacityGB", + PossibleTypes = new [] { typeof(long) })] + long? CapacityGb { get; } + /// The model of the storage appliance. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The model of the storage appliance.", + SerializedName = @"model", + PossibleTypes = new [] { typeof(string) })] + string Model { get; } + /// The position in the rack for the storage appliance. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The position in the rack for the storage appliance.", + SerializedName = @"rackSlot", + PossibleTypes = new [] { typeof(long) })] + long? RackSlot { get; } + + } + /// StorageApplianceSkuSlot represents the single SKU and rack slot associated with the storage appliance. + internal partial interface IStorageApplianceSkuSlotInternal + + { + /// The maximum capacity of the storage appliance. Measured in gibibytes. + long? CapacityGb { get; set; } + /// The model of the storage appliance. + string Model { get; set; } + /// The list of the resource properties. + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceSkuProperties Property { get; set; } + /// The position in the rack for the storage appliance. + long? RackSlot { get; set; } + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/StorageApplianceSkuSlot.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/StorageApplianceSkuSlot.json.cs similarity index 93% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/StorageApplianceSkuSlot.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/StorageApplianceSkuSlot.json.cs index 43daaf142045..a672025ef132 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/StorageApplianceSkuSlot.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/StorageApplianceSkuSlot.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -56,13 +56,13 @@ public partial class StorageApplianceSkuSlot partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceSkuSlot. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceSkuSlot. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceSkuSlot. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceSkuSlot. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceSkuSlot FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceSkuSlot FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new StorageApplianceSkuSlot(json) : null; } @@ -79,8 +79,8 @@ internal StorageApplianceSkuSlot(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud { return; } - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.StorageApplianceSkuProperties.FromJson(__jsonProperties) : Property;} - {_rackSlot = If( json?.PropertyT("rackSlot"), out var __jsonRackSlot) ? (long?)__jsonRackSlot : RackSlot;} + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.StorageApplianceSkuProperties.FromJson(__jsonProperties) : _property;} + {_rackSlot = If( json?.PropertyT("rackSlot"), out var __jsonRackSlot) ? (long?)__jsonRackSlot : _rackSlot;} AfterFromJson(json); } @@ -104,7 +104,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode ToJ return container; } AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != this._rackSlot ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNumber((long)this._rackSlot) : null, "rackSlot" ,container.Add ); } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/StorageProfile.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/StorageProfile.PowerShell.cs new file mode 100644 index 000000000000..c8811b3eedd4 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/StorageProfile.PowerShell.cs @@ -0,0 +1,196 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + + /// StorageProfile represents information about a disk. + [System.ComponentModel.TypeConverter(typeof(StorageProfileTypeConverter))] + public partial class StorageProfile + { + + /// + /// 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.NetworkCloud.Models.IStorageProfile DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new StorageProfile(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.NetworkCloud.Models.IStorageProfile DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new StorageProfile(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.NetworkCloud.Models.IStorageProfile FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal StorageProfile(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("OSDisk")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageProfileInternal)this).OSDisk = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOSDisk) content.GetValueForProperty("OSDisk",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageProfileInternal)this).OSDisk, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.OSDiskTypeConverter.ConvertFrom); + } + if (content.Contains("VolumeAttachment")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageProfileInternal)this).VolumeAttachment = (System.Collections.Generic.List) content.GetValueForProperty("VolumeAttachment",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageProfileInternal)this).VolumeAttachment, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("OSDiskCreateOption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageProfileInternal)this).OSDiskCreateOption = (string) content.GetValueForProperty("OSDiskCreateOption",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageProfileInternal)this).OSDiskCreateOption, global::System.Convert.ToString); + } + if (content.Contains("OSDiskDeleteOption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageProfileInternal)this).OSDiskDeleteOption = (string) content.GetValueForProperty("OSDiskDeleteOption",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageProfileInternal)this).OSDiskDeleteOption, global::System.Convert.ToString); + } + if (content.Contains("OSDiskSizeGb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageProfileInternal)this).OSDiskSizeGb = (long) content.GetValueForProperty("OSDiskSizeGb",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageProfileInternal)this).OSDiskSizeGb, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal StorageProfile(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("OSDisk")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageProfileInternal)this).OSDisk = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOSDisk) content.GetValueForProperty("OSDisk",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageProfileInternal)this).OSDisk, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.OSDiskTypeConverter.ConvertFrom); + } + if (content.Contains("VolumeAttachment")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageProfileInternal)this).VolumeAttachment = (System.Collections.Generic.List) content.GetValueForProperty("VolumeAttachment",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageProfileInternal)this).VolumeAttachment, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("OSDiskCreateOption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageProfileInternal)this).OSDiskCreateOption = (string) content.GetValueForProperty("OSDiskCreateOption",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageProfileInternal)this).OSDiskCreateOption, global::System.Convert.ToString); + } + if (content.Contains("OSDiskDeleteOption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageProfileInternal)this).OSDiskDeleteOption = (string) content.GetValueForProperty("OSDiskDeleteOption",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageProfileInternal)this).OSDiskDeleteOption, global::System.Convert.ToString); + } + if (content.Contains("OSDiskSizeGb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageProfileInternal)this).OSDiskSizeGb = (long) content.GetValueForProperty("OSDiskSizeGb",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageProfileInternal)this).OSDiskSizeGb, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + 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.NetworkCloud.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(); + } + } + /// StorageProfile represents information about a disk. + [System.ComponentModel.TypeConverter(typeof(StorageProfileTypeConverter))] + public partial interface IStorageProfile + + { + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/StorageProfile.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/StorageProfile.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/StorageProfile.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/StorageProfile.TypeConverter.cs index 354eca41501a..aad3289c6710 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/StorageProfile.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/StorageProfile.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IStorageProfile ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageProfile ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageProfile).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageProfile).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/StorageProfile.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/StorageProfile.cs new file mode 100644 index 000000000000..d53cc442adbd --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/StorageProfile.cs @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + + /// StorageProfile represents information about a disk. + public partial class StorageProfile : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageProfile, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageProfileInternal + { + + /// Internal Acessors for OSDisk + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOSDisk Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageProfileInternal.OSDisk { get => (this._oSDisk = this._oSDisk ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.OSDisk()); set { {_oSDisk = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOSDisk _oSDisk; + + /// The disk to use with this virtual machine. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOSDisk OSDisk { get => (this._oSDisk = this._oSDisk ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.OSDisk()); set => this._oSDisk = value; } + + /// The strategy for creating the OS disk. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string OSDiskCreateOption { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOSDiskInternal)OSDisk).CreateOption; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOSDiskInternal)OSDisk).CreateOption = value ?? null; } + + /// The strategy for deleting the OS disk. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string OSDiskDeleteOption { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOSDiskInternal)OSDisk).DeleteOption; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOSDiskInternal)OSDisk).DeleteOption = value ?? null; } + + /// + /// The size of the disk. Required if the createOption is Ephemeral. Allocations are measured in gibibytes. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public long OSDiskSizeGb { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOSDiskInternal)OSDisk).DiskSizeGb; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOSDiskInternal)OSDisk).DiskSizeGb = value ; } + + /// Backing field for property. + private System.Collections.Generic.List _volumeAttachment; + + /// + /// The resource IDs of volumes that are requested to be attached to the virtual machine. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public System.Collections.Generic.List VolumeAttachment { get => this._volumeAttachment; set => this._volumeAttachment = value; } + + /// Creates an new instance. + public StorageProfile() + { + + } + } + /// StorageProfile represents information about a disk. + public partial interface IStorageProfile : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable + { + /// The strategy for creating the OS disk. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The strategy for creating the OS disk.", + SerializedName = @"createOption", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Ephemeral", "Persistent")] + string OSDiskCreateOption { get; set; } + /// The strategy for deleting the OS disk. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The strategy for deleting the OS disk.", + SerializedName = @"deleteOption", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Delete")] + string OSDiskDeleteOption { get; set; } + /// + /// The size of the disk. Required if the createOption is Ephemeral. Allocations are measured in gibibytes. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The size of the disk. Required if the createOption is Ephemeral. Allocations are measured in gibibytes.", + SerializedName = @"diskSizeGB", + PossibleTypes = new [] { typeof(long) })] + long OSDiskSizeGb { get; set; } + /// + /// The resource IDs of volumes that are requested to be attached to the virtual machine. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The resource IDs of volumes that are requested to be attached to the virtual machine.", + SerializedName = @"volumeAttachments", + PossibleTypes = new [] { typeof(string) })] + System.Collections.Generic.List VolumeAttachment { get; set; } + + } + /// StorageProfile represents information about a disk. + internal partial interface IStorageProfileInternal + + { + /// The disk to use with this virtual machine. + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOSDisk OSDisk { get; set; } + /// The strategy for creating the OS disk. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Ephemeral", "Persistent")] + string OSDiskCreateOption { get; set; } + /// The strategy for deleting the OS disk. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Delete")] + string OSDiskDeleteOption { get; set; } + /// + /// The size of the disk. Required if the createOption is Ephemeral. Allocations are measured in gibibytes. + /// + long OSDiskSizeGb { get; set; } + /// + /// The resource IDs of volumes that are requested to be attached to the virtual machine. + /// + System.Collections.Generic.List VolumeAttachment { get; set; } + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/StorageProfile.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/StorageProfile.json.cs similarity index 92% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/StorageProfile.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/StorageProfile.json.cs index df840abdb2fd..cdd4fbfb65d8 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/StorageProfile.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/StorageProfile.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class StorageProfile partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageProfile. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageProfile. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageProfile. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageProfile. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageProfile FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageProfile FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new StorageProfile(json) : null; } @@ -77,8 +77,8 @@ internal StorageProfile(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime. { return; } - {_oSDisk = If( json?.PropertyT("osDisk"), out var __jsonOSDisk) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.OSDisk.FromJson(__jsonOSDisk) : OSDisk;} - {_volumeAttachment = If( json?.PropertyT("volumeAttachments"), out var __jsonVolumeAttachments) ? If( __jsonVolumeAttachments as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : VolumeAttachment;} + {_oSDisk = If( json?.PropertyT("osDisk"), out var __jsonOSDisk) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.OSDisk.FromJson(__jsonOSDisk) : _oSDisk;} + {_volumeAttachment = If( json?.PropertyT("volumeAttachments"), out var __jsonVolumeAttachments) ? If( __jsonVolumeAttachments as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : _volumeAttachment;} AfterFromJson(json); } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/StringKeyValuePair.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/StringKeyValuePair.PowerShell.cs similarity index 81% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/StringKeyValuePair.PowerShell.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/StringKeyValuePair.PowerShell.cs index 53bd31150bf5..aaa7b2ba1502 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/StringKeyValuePair.PowerShell.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/StringKeyValuePair.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; @@ -63,27 +63,27 @@ public partial class StringKeyValuePair 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.NetworkCloud.Models.Api20250201.IStringKeyValuePair DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStringKeyValuePair DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new StringKeyValuePair(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.NetworkCloud.Models.Api20250201.IStringKeyValuePair DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStringKeyValuePair DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new StringKeyValuePair(content); } @@ -93,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStringKeyValuePair FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStringKeyValuePair FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 StringKeyValuePair(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Key")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStringKeyValuePairInternal)this).Key = (string) content.GetValueForProperty("Key",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStringKeyValuePairInternal)this).Key, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStringKeyValuePairInternal)this).Key = (string) content.GetValueForProperty("Key",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStringKeyValuePairInternal)this).Key, global::System.Convert.ToString); } if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStringKeyValuePairInternal)this).Value = (string) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStringKeyValuePairInternal)this).Value, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStringKeyValuePairInternal)this).Value = (string) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStringKeyValuePairInternal)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 StringKeyValuePair(global::System.Management.Automation.PSObject conten // actually deserialize if (content.Contains("Key")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStringKeyValuePairInternal)this).Key = (string) content.GetValueForProperty("Key",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStringKeyValuePairInternal)this).Key, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStringKeyValuePairInternal)this).Key = (string) content.GetValueForProperty("Key",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStringKeyValuePairInternal)this).Key, global::System.Convert.ToString); } if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStringKeyValuePairInternal)this).Value = (string) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStringKeyValuePairInternal)this).Value, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStringKeyValuePairInternal)this).Value = (string) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStringKeyValuePairInternal)this).Value, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/StringKeyValuePair.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/StringKeyValuePair.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/StringKeyValuePair.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/StringKeyValuePair.TypeConverter.cs index b6e7d4118a58..7f1ddda963a1 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/StringKeyValuePair.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/StringKeyValuePair.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IStringKeyValuePair ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStringKeyValuePair ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStringKeyValuePair).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStringKeyValuePair).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/StringKeyValuePair.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/StringKeyValuePair.cs similarity index 88% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/StringKeyValuePair.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/StringKeyValuePair.cs index 0a3d29a44ca6..2aec63e3032d 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/StringKeyValuePair.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/StringKeyValuePair.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; /// StringKeyValuePair represents a single entry in a mapping of keys to values. public partial class StringKeyValuePair : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStringKeyValuePair, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStringKeyValuePairInternal + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStringKeyValuePair, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStringKeyValuePairInternal { /// Backing field for property. @@ -39,16 +39,22 @@ public partial interface IStringKeyValuePair : { /// The key to the mapped value. [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, + Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = false, Description = @"The key to the mapped value.", SerializedName = @"key", PossibleTypes = new [] { typeof(string) })] string Key { get; set; } /// The value of the mapping key. [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, + Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = false, Description = @"The value of the mapping key.", SerializedName = @"value", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/StringKeyValuePair.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/StringKeyValuePair.json.cs similarity index 82% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/StringKeyValuePair.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/StringKeyValuePair.json.cs index 4012ff9dab97..0bba682d0d74 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/StringKeyValuePair.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/StringKeyValuePair.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class StringKeyValuePair partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStringKeyValuePair. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStringKeyValuePair. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStringKeyValuePair. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStringKeyValuePair. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStringKeyValuePair FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStringKeyValuePair FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new StringKeyValuePair(json) : null; } @@ -77,8 +77,8 @@ internal StringKeyValuePair(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runt { return; } - {_key = If( json?.PropertyT("key"), out var __jsonKey) ? (string)__jsonKey : (string)Key;} - {_value = If( json?.PropertyT("value"), out var __jsonValue) ? (string)__jsonValue : (string)Value;} + {_key = If( json?.PropertyT("key"), out var __jsonKey) ? (string)__jsonKey : (string)_key;} + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? (string)__jsonValue : (string)_value;} AfterFromJson(json); } @@ -101,8 +101,14 @@ public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode ToJ { return container; } - AddIf( null != (((object)this._key)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._key.ToString()) : null, "key" ,container.Add ); - AddIf( null != (((object)this._value)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._value.ToString()) : null, "value" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)||serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate)) + { + AddIf( null != (((object)this._key)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._key.ToString()) : null, "key" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)||serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate)) + { + AddIf( null != (((object)this._value)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._value.ToString()) : null, "value" ,container.Add ); + } AfterToJson(ref container); return container; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/SystemData.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/SystemData.PowerShell.cs new file mode 100644 index 000000000000..bf3c7c650619 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/SystemData.PowerShell.cs @@ -0,0 +1,204 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + + /// Metadata pertaining to creation and last modification of the resource. + [System.ComponentModel.TypeConverter(typeof(SystemDataTypeConverter))] + public partial class SystemData + { + + /// + /// 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.NetworkCloud.Models.ISystemData DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new SystemData(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.NetworkCloud.Models.ISystemData DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new SystemData(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.NetworkCloud.Models.ISystemData FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal SystemData(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("CreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISystemDataInternal)this).CreatedBy = (string) content.GetValueForProperty("CreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISystemDataInternal)this).CreatedBy, global::System.Convert.ToString); + } + if (content.Contains("CreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISystemDataInternal)this).CreatedByType = (string) content.GetValueForProperty("CreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISystemDataInternal)this).CreatedByType, global::System.Convert.ToString); + } + if (content.Contains("CreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISystemDataInternal)this).CreatedAt = (global::System.DateTime?) content.GetValueForProperty("CreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.ISystemDataInternal)this).LastModifiedBy = (string) content.GetValueForProperty("LastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISystemDataInternal)this).LastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("LastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISystemDataInternal)this).LastModifiedByType = (string) content.GetValueForProperty("LastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISystemDataInternal)this).LastModifiedByType, global::System.Convert.ToString); + } + if (content.Contains("LastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISystemDataInternal)this).LastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("LastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal SystemData(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("CreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISystemDataInternal)this).CreatedBy = (string) content.GetValueForProperty("CreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISystemDataInternal)this).CreatedBy, global::System.Convert.ToString); + } + if (content.Contains("CreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISystemDataInternal)this).CreatedByType = (string) content.GetValueForProperty("CreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISystemDataInternal)this).CreatedByType, global::System.Convert.ToString); + } + if (content.Contains("CreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISystemDataInternal)this).CreatedAt = (global::System.DateTime?) content.GetValueForProperty("CreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.ISystemDataInternal)this).LastModifiedBy = (string) content.GetValueForProperty("LastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISystemDataInternal)this).LastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("LastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISystemDataInternal)this).LastModifiedByType = (string) content.GetValueForProperty("LastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISystemDataInternal)this).LastModifiedByType, global::System.Convert.ToString); + } + if (content.Contains("LastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISystemDataInternal)this).LastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("LastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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(); + } + } + /// Metadata pertaining to creation and last modification of the resource. + [System.ComponentModel.TypeConverter(typeof(SystemDataTypeConverter))] + public partial interface ISystemData + + { + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/SystemData.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/SystemData.TypeConverter.cs new file mode 100644 index 000000000000..90829b83ab24 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/SystemData.TypeConverter.cs @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class SystemDataTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISystemData ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISystemData).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return SystemData.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return SystemData.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return SystemData.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/SystemData.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/SystemData.cs new file mode 100644 index 000000000000..bd59b3e05d61 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/SystemData.cs @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + + /// Metadata pertaining to creation and last modification of the resource. + public partial class SystemData : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISystemData, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISystemDataInternal + { + + /// Backing field for property. + private global::System.DateTime? _createdAt; + + /// The timestamp of resource creation (UTC). + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public global::System.DateTime? CreatedAt { get => this._createdAt; set => this._createdAt = value; } + + /// Backing field for property. + private string _createdBy; + + /// The identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string CreatedBy { get => this._createdBy; set => this._createdBy = value; } + + /// Backing field for property. + private string _createdByType; + + /// The type of identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string CreatedByType { get => this._createdByType; set => this._createdByType = value; } + + /// Backing field for property. + private global::System.DateTime? _lastModifiedAt; + + /// The timestamp of resource last modification (UTC) + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public global::System.DateTime? LastModifiedAt { get => this._lastModifiedAt; set => this._lastModifiedAt = value; } + + /// Backing field for property. + private string _lastModifiedBy; + + /// The identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string LastModifiedBy { get => this._lastModifiedBy; set => this._lastModifiedBy = value; } + + /// Backing field for property. + private string _lastModifiedByType; + + /// The type of identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string LastModifiedByType { get => this._lastModifiedByType; set => this._lastModifiedByType = value; } + + /// Creates an new instance. + public SystemData() + { + + } + } + /// Metadata pertaining to creation and last modification of the resource. + public partial interface ISystemData : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable + { + /// The timestamp of resource creation (UTC). + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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) })] + global::System.DateTime? CreatedAt { get; set; } + /// The identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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) })] + string CreatedBy { get; set; } + /// The type of identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("User", "Application", "ManagedIdentity", "Key")] + string CreatedByType { get; set; } + /// The timestamp of resource last modification (UTC) + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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) })] + global::System.DateTime? LastModifiedAt { get; set; } + /// The identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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) })] + string LastModifiedBy { get; set; } + /// The type of identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("User", "Application", "ManagedIdentity", "Key")] + string LastModifiedByType { get; set; } + + } + /// Metadata pertaining to creation and last modification of the resource. + internal partial interface ISystemDataInternal + + { + /// The timestamp of resource creation (UTC). + global::System.DateTime? CreatedAt { get; set; } + /// The identity that created the resource. + string CreatedBy { get; set; } + /// The type of identity that created the resource. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("User", "Application", "ManagedIdentity", "Key")] + string LastModifiedByType { get; set; } + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/SystemData.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/SystemData.json.cs new file mode 100644 index 000000000000..1710ba3903aa --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/SystemData.json.cs @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + + /// Metadata pertaining to creation and last modification of the resource. + public partial class SystemData + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISystemData. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISystemData. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISystemData FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new SystemData(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject instance to deserialize from. + internal SystemData(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_createdBy = If( json?.PropertyT("createdBy"), out var __jsonCreatedBy) ? (string)__jsonCreatedBy : (string)_createdBy;} + {_createdByType = If( json?.PropertyT("createdByType"), out var __jsonCreatedByType) ? (string)__jsonCreatedByType : (string)_createdByType;} + {_createdAt = If( json?.PropertyT("createdAt"), out var __jsonCreatedAt) ? global::System.DateTime.TryParse((string)__jsonCreatedAt, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonCreatedAtValue) ? __jsonCreatedAtValue : _createdAt : _createdAt;} + {_lastModifiedBy = If( json?.PropertyT("lastModifiedBy"), out var __jsonLastModifiedBy) ? (string)__jsonLastModifiedBy : (string)_lastModifiedBy;} + {_lastModifiedByType = If( json?.PropertyT("lastModifiedByType"), out var __jsonLastModifiedByType) ? (string)__jsonLastModifiedByType : (string)_lastModifiedByType;} + {_lastModifiedAt = If( json?.PropertyT("lastModifiedAt"), out var __jsonLastModifiedAt) ? global::System.DateTime.TryParse((string)__jsonLastModifiedAt, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonLastModifiedAtValue) ? __jsonLastModifiedAtValue : _lastModifiedAt : _lastModifiedAt;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._createdBy)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._createdBy.ToString()) : null, "createdBy" ,container.Add ); + AddIf( null != (((object)this._createdByType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._createdByType.ToString()) : null, "createdByType" ,container.Add ); + AddIf( null != this._createdAt ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._createdAt?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "createdAt" ,container.Add ); + AddIf( null != (((object)this._lastModifiedBy)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._lastModifiedBy.ToString()) : null, "lastModifiedBy" ,container.Add ); + AddIf( null != (((object)this._lastModifiedByType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._lastModifiedByType.ToString()) : null, "lastModifiedByType" ,container.Add ); + AddIf( null != this._lastModifiedAt ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._lastModifiedAt?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "lastModifiedAt" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/TagsParameter.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/TagsParameter.PowerShell.cs similarity index 83% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/TagsParameter.PowerShell.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/TagsParameter.PowerShell.cs index cbe90ce1d08c..cc14f9a2d172 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/TagsParameter.PowerShell.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/TagsParameter.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; @@ -63,27 +63,27 @@ public partial class TagsParameter 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.NetworkCloud.Models.Api20250201.ITagsParameter DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITagsParameter DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new TagsParameter(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.NetworkCloud.Models.Api20250201.ITagsParameter DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITagsParameter DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new TagsParameter(content); } @@ -93,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITagsParameter FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITagsParameter FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,13 +111,13 @@ internal TagsParameter(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITagsParameterInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITagsParameterTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITagsParameterInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.TagsParameterTagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITagsParameterInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITagsParameterTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITagsParameterInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.TagsParameterTagsTypeConverter.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. @@ -132,7 +132,7 @@ internal TagsParameter(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITagsParameterInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITagsParameterTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITagsParameterInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.TagsParameterTagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITagsParameterInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITagsParameterTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITagsParameterInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.TagsParameterTagsTypeConverter.ConvertFrom); } AfterDeserializePSObject(content); } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/TagsParameter.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/TagsParameter.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/TagsParameter.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/TagsParameter.TypeConverter.cs index 418aed36d2f5..ee739c339c12 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/TagsParameter.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/TagsParameter.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.ITagsParameter ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITagsParameter ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITagsParameter).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITagsParameter).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/TagsParameter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/TagsParameter.cs new file mode 100644 index 000000000000..670a4fd147f9 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/TagsParameter.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + + /// TagsParameter represents the resource tags. + public partial class TagsParameter : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITagsParameter, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITagsParameterInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITagsParameterTags _tag; + + /// The Azure resource tags that will replace the existing ones. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITagsParameterTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.TagsParameterTags()); set => this._tag = value; } + + /// Creates an new instance. + public TagsParameter() + { + + } + } + /// TagsParameter represents the resource tags. + public partial interface ITagsParameter : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable + { + /// The Azure resource tags that will replace the existing ones. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The Azure resource tags that will replace the existing ones.", + SerializedName = @"tags", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITagsParameterTags) })] + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITagsParameterTags Tag { get; set; } + + } + /// TagsParameter represents the resource tags. + internal partial interface ITagsParameterInternal + + { + /// The Azure resource tags that will replace the existing ones. + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITagsParameterTags Tag { get; set; } + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/TagsParameter.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/TagsParameter.json.cs similarity index 95% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/TagsParameter.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/TagsParameter.json.cs index 26e37602e454..1b6d738dc09a 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/TagsParameter.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/TagsParameter.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class TagsParameter partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITagsParameter. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITagsParameter. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITagsParameter. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITagsParameter. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITagsParameter FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITagsParameter FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new TagsParameter(json) : null; } @@ -77,7 +77,7 @@ internal TagsParameter(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.J { return; } - {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.TagsParameterTags.FromJson(__jsonTags) : Tag;} + {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.TagsParameterTags.FromJson(__jsonTags) : _tag;} AfterFromJson(json); } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/TagsParameterTags.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/TagsParameterTags.PowerShell.cs similarity index 90% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/TagsParameterTags.PowerShell.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/TagsParameterTags.PowerShell.cs index ec3359245f8c..2e0063a34b17 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/TagsParameterTags.PowerShell.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/TagsParameterTags.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; @@ -63,27 +63,27 @@ public partial class TagsParameterTags 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.NetworkCloud.Models.Api20250201.ITagsParameterTags DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITagsParameterTags DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new TagsParameterTags(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.NetworkCloud.Models.Api20250201.ITagsParameterTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITagsParameterTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new TagsParameterTags(content); } @@ -93,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITagsParameterTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITagsParameterTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 TagsParameterTags(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/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/TagsParameterTags.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/TagsParameterTags.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/TagsParameterTags.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/TagsParameterTags.TypeConverter.cs index 2ed2ac12e016..b5629c97c240 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/TagsParameterTags.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/TagsParameterTags.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.ITagsParameterTags ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITagsParameterTags ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITagsParameterTags).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITagsParameterTags).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/TagsParameterTags.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/TagsParameterTags.cs similarity index 85% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/TagsParameterTags.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/TagsParameterTags.cs index cd181630993e..6d7b09e8a558 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/TagsParameterTags.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/TagsParameterTags.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; /// The Azure resource tags that will replace the existing ones. public partial class TagsParameterTags : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITagsParameterTags, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITagsParameterTagsInternal + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITagsParameterTags, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITagsParameterTagsInternal { /// Creates an new instance. diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/TagsParameterTags.dictionary.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/TagsParameterTags.dictionary.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/TagsParameterTags.dictionary.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/TagsParameterTags.dictionary.cs index ca401f96c7d5..1d271fe6ca6a 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/TagsParameterTags.dictionary.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/TagsParameterTags.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.TagsParameterTags source) => source.__additionalProperties; + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.TagsParameterTags source) => source.__additionalProperties; } } \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/TagsParameterTags.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/TagsParameterTags.json.cs similarity index 96% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/TagsParameterTags.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/TagsParameterTags.json.cs index 2e7fa5e62000..6274d2dfc192 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/TagsParameterTags.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/TagsParameterTags.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class TagsParameterTags partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITagsParameterTags. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITagsParameterTags. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITagsParameterTags. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITagsParameterTags. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITagsParameterTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITagsParameterTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new TagsParameterTags(json) : null; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/TrackedResource.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/TrackedResource.PowerShell.cs new file mode 100644 index 000000000000..8e3e273219b8 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/TrackedResource.PowerShell.cs @@ -0,0 +1,254 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + + /// + /// The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location' + /// + [System.ComponentModel.TypeConverter(typeof(TrackedResourceTypeConverter))] + public partial class TrackedResource + { + + /// + /// 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.NetworkCloud.Models.ITrackedResource DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new TrackedResource(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.NetworkCloud.Models.ITrackedResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new TrackedResource(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.NetworkCloud.Models.ITrackedResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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 TrackedResource(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.TrackedResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)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("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedByType = (string) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedByType = (string) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Type, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal TrackedResource(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.TrackedResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)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("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedByType = (string) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedByType = (string) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Type, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + } + /// The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location' + [System.ComponentModel.TypeConverter(typeof(TrackedResourceTypeConverter))] + public partial interface ITrackedResource + + { + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/TrackedResource.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/TrackedResource.TypeConverter.cs new file mode 100644 index 000000000000..b3990ed2f71b --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/TrackedResource.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class TrackedResourceTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResource ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResource).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return TrackedResource.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return TrackedResource.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return TrackedResource.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/TrackedResource.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/TrackedResource.cs new file mode 100644 index 000000000000..5be19bce85ff --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/TrackedResource.cs @@ -0,0 +1,170 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + + /// + /// 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.NetworkCloud.Models.ITrackedResource, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Resource(); + + /// + /// Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__resource).Id; } + + /// Backing field for property. + private string _location; + + /// The geo-location where the resource lives + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string Location { get => this._location; set => this._location = value; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__resource).Id = value ?? null; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__resource).Name = value ?? null; } + + /// Internal Acessors for SystemData + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISystemData Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__resource).SystemData; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__resource).SystemData = value ?? null /* model class */; } + + /// Internal Acessors for SystemDataCreatedAt + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__resource).SystemDataCreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__resource).SystemDataCreatedAt = value ?? default(global::System.DateTime); } + + /// Internal Acessors for SystemDataCreatedBy + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__resource).SystemDataCreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__resource).SystemDataCreatedBy = value ?? null; } + + /// Internal Acessors for SystemDataCreatedByType + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__resource).SystemDataCreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__resource).SystemDataCreatedByType = value ?? null; } + + /// Internal Acessors for SystemDataLastModifiedAt + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__resource).SystemDataLastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__resource).SystemDataLastModifiedAt = value ?? default(global::System.DateTime); } + + /// Internal Acessors for SystemDataLastModifiedBy + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__resource).SystemDataLastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__resource).SystemDataLastModifiedBy = value ?? null; } + + /// Internal Acessors for SystemDataLastModifiedByType + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__resource).SystemDataLastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__resource).SystemDataLastModifiedByType = value ?? null; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__resource).Type = value ?? null; } + + /// The name of the resource + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__resource).Name; } + + /// + /// Azure Resource Manager metadata containing createdBy and modifiedBy information. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISystemData SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__resource).SystemData; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__resource).SystemData = value ?? null /* model class */; } + + /// The timestamp of resource creation (UTC). + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__resource).SystemDataCreatedAt; } + + /// The identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__resource).SystemDataCreatedBy; } + + /// The type of identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public string SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__resource).SystemDataCreatedByType; } + + /// The timestamp of resource last modification (UTC) + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__resource).SystemDataLastModifiedAt; } + + /// The identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__resource).SystemDataLastModifiedBy; } + + /// The type of identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public string SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__resource).SystemDataLastModifiedByType; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceTags _tag; + + /// Resource tags. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.TrackedResourceTags()); set => this._tag = value; } + + /// + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__resource).Type; } + + /// Creates an new instance. + public TrackedResource() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__resource), __resource); + await eventListener.AssertObjectIsValid(nameof(__resource), __resource); + } + } + /// 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.NetworkCloud.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResource + { + /// The geo-location where the resource lives + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The geo-location where the resource lives", + SerializedName = @"location", + PossibleTypes = new [] { typeof(string) })] + string Location { get; set; } + /// Resource tags. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"Resource tags.", + SerializedName = @"tags", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceTags) })] + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.IResourceInternal + { + /// The geo-location where the resource lives + string Location { get; set; } + /// Resource tags. + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceTags Tag { get; set; } + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/TrackedResource.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/TrackedResource.json.cs new file mode 100644 index 000000000000..ea51e4d2592d --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/TrackedResource.json.cs @@ -0,0 +1,117 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + + /// + /// The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location' + /// + public partial class TrackedResource + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResource. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResource. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new TrackedResource(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __resource?.ToJson(container, serializationMode); + AddIf( null != this._tag ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) this._tag.ToJson(null,serializationMode) : null, "tags" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)||serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate)) + { + AddIf( null != (((object)this._location)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._location.ToString()) : null, "location" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject instance to deserialize from. + internal TrackedResource(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __resource = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Resource(json); + {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.TrackedResourceTags.FromJson(__jsonTags) : _tag;} + {_location = If( json?.PropertyT("location"), out var __jsonLocation) ? (string)__jsonLocation : (string)_location;} + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/TrackedResourceTags.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/TrackedResourceTags.PowerShell.cs new file mode 100644 index 000000000000..219677543556 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/TrackedResourceTags.PowerShell.cs @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + + /// Resource tags. + [System.ComponentModel.TypeConverter(typeof(TrackedResourceTagsTypeConverter))] + public partial class TrackedResourceTags + { + + /// + /// 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.NetworkCloud.Models.ITrackedResourceTags DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new TrackedResourceTags(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.NetworkCloud.Models.ITrackedResourceTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new TrackedResourceTags(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.NetworkCloud.Models.ITrackedResourceTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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 TrackedResourceTags(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal TrackedResourceTags(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializePSObject(content); + } + } + /// Resource tags. + [System.ComponentModel.TypeConverter(typeof(TrackedResourceTagsTypeConverter))] + public partial interface ITrackedResourceTags + + { + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/TrackedResourceTags.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/TrackedResourceTags.TypeConverter.cs new file mode 100644 index 000000000000..856ea7cf9105 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/TrackedResourceTags.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class TrackedResourceTagsTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceTags ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceTags).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return TrackedResourceTags.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return TrackedResourceTags.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return TrackedResourceTags.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/TrackedResourceTags.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/TrackedResourceTags.cs new file mode 100644 index 000000000000..91d60a1abfbc --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/TrackedResourceTags.cs @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + + /// Resource tags. + public partial class TrackedResourceTags : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceTags, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceTagsInternal + { + + /// Creates an new instance. + public TrackedResourceTags() + { + + } + } + /// Resource tags. + public partial interface ITrackedResourceTags : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IAssociativeArray + { + + } + /// Resource tags. + internal partial interface ITrackedResourceTagsInternal + + { + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/TrackedResourceTags.dictionary.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/TrackedResourceTags.dictionary.cs new file mode 100644 index 000000000000..78f912f877e8 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/TrackedResourceTags.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.NetworkCloud.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + + public partial class TrackedResourceTags : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IAssociativeArray + { + protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); + + global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; } + + int Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IAssociativeArray.Values { get => __additionalProperties.Values; } + + public string this[global::System.String index] { get => __additionalProperties[index]; set => __additionalProperties[index] = value; } + + /// + /// + public void Add(global::System.String key, string value) => __additionalProperties.Add( key, value); + + public void Clear() => __additionalProperties.Clear(); + + /// + public bool ContainsKey(global::System.String key) => __additionalProperties.ContainsKey( key); + + /// + public void CopyFrom(global::System.Collections.IDictionary source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public bool Remove(global::System.String key) => __additionalProperties.Remove( key); + + /// + /// + public bool TryGetValue(global::System.String key, out string value) => __additionalProperties.TryGetValue( key, out value); + + /// + + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.TrackedResourceTags source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/TrackedResourceTags.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/TrackedResourceTags.json.cs new file mode 100644 index 000000000000..f430cba36aae --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/TrackedResourceTags.json.cs @@ -0,0 +1,109 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + + /// Resource tags. + public partial class TrackedResourceTags + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceTags. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceTags. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new TrackedResourceTags(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IAssociativeArray)this).AdditionalProperties, container); + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject instance to deserialize from. + /// + internal TrackedResourceTags(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IAssociativeArray)this).AdditionalProperties, null ,exclusions ); + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/TrunkedNetwork.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/TrunkedNetwork.PowerShell.cs new file mode 100644 index 000000000000..a7fd89a6e666 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/TrunkedNetwork.PowerShell.cs @@ -0,0 +1,382 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + + /// + /// TrunkedNetwork represents a network that utilizes multiple isolation domains and specified VLANs to create a trunked network. + /// + [System.ComponentModel.TypeConverter(typeof(TrunkedNetworkTypeConverter))] + public partial class TrunkedNetwork + { + + /// + /// 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.NetworkCloud.Models.ITrunkedNetwork DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new TrunkedNetwork(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.NetworkCloud.Models.ITrunkedNetwork DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new TrunkedNetwork(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.NetworkCloud.Models.ITrunkedNetwork FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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 TrunkedNetwork(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ExtendedLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkInternal)this).ExtendedLocation = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocation) content.GetValueForProperty("ExtendedLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkInternal)this).ExtendedLocation, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ExtendedLocationTypeConverter.ConvertFrom); + } + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.TrunkedNetworkPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Etag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkInternal)this).Etag, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)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("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedByType = (string) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedByType = (string) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.TrackedResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("ExtendedLocationName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkInternal)this).ExtendedLocationName = (string) content.GetValueForProperty("ExtendedLocationName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkInternal)this).ExtendedLocationName, global::System.Convert.ToString); + } + if (content.Contains("ExtendedLocationType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkInternal)this).ExtendedLocationType = (string) content.GetValueForProperty("ExtendedLocationType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkInternal)this).ExtendedLocationType, global::System.Convert.ToString); + } + if (content.Contains("AssociatedResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkInternal)this).AssociatedResourceId = (System.Collections.Generic.List) content.GetValueForProperty("AssociatedResourceId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkInternal)this).AssociatedResourceId, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("ClusterId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkInternal)this).ClusterId = (string) content.GetValueForProperty("ClusterId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkInternal)this).ClusterId, global::System.Convert.ToString); + } + if (content.Contains("DetailedStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkInternal)this).DetailedStatus = (string) content.GetValueForProperty("DetailedStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkInternal)this).DetailedStatus, global::System.Convert.ToString); + } + if (content.Contains("DetailedStatusMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkInternal)this).DetailedStatusMessage = (string) content.GetValueForProperty("DetailedStatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkInternal)this).DetailedStatusMessage, global::System.Convert.ToString); + } + if (content.Contains("HybridAksClustersAssociatedId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkInternal)this).HybridAksClustersAssociatedId = (System.Collections.Generic.List) content.GetValueForProperty("HybridAksClustersAssociatedId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkInternal)this).HybridAksClustersAssociatedId, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("HybridAksPluginType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkInternal)this).HybridAksPluginType = (string) content.GetValueForProperty("HybridAksPluginType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkInternal)this).HybridAksPluginType, global::System.Convert.ToString); + } + if (content.Contains("InterfaceName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkInternal)this).InterfaceName = (string) content.GetValueForProperty("InterfaceName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkInternal)this).InterfaceName, global::System.Convert.ToString); + } + if (content.Contains("IsolationDomainId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkInternal)this).IsolationDomainId = (System.Collections.Generic.List) content.GetValueForProperty("IsolationDomainId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkInternal)this).IsolationDomainId, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("VirtualMachinesAssociatedId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkInternal)this).VirtualMachinesAssociatedId = (System.Collections.Generic.List) content.GetValueForProperty("VirtualMachinesAssociatedId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkInternal)this).VirtualMachinesAssociatedId, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("Vlan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkInternal)this).Vlan = (System.Collections.Generic.List) content.GetValueForProperty("Vlan",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkInternal)this).Vlan, __y => TypeConverterExtensions.SelectToList(__y, (__w)=> (long) global::System.Convert.ChangeType(__w, typeof(long)))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal TrunkedNetwork(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ExtendedLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkInternal)this).ExtendedLocation = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocation) content.GetValueForProperty("ExtendedLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkInternal)this).ExtendedLocation, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ExtendedLocationTypeConverter.ConvertFrom); + } + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.TrunkedNetworkPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Etag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkInternal)this).Etag, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)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("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedByType = (string) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedByType = (string) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.TrackedResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("ExtendedLocationName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkInternal)this).ExtendedLocationName = (string) content.GetValueForProperty("ExtendedLocationName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkInternal)this).ExtendedLocationName, global::System.Convert.ToString); + } + if (content.Contains("ExtendedLocationType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkInternal)this).ExtendedLocationType = (string) content.GetValueForProperty("ExtendedLocationType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkInternal)this).ExtendedLocationType, global::System.Convert.ToString); + } + if (content.Contains("AssociatedResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkInternal)this).AssociatedResourceId = (System.Collections.Generic.List) content.GetValueForProperty("AssociatedResourceId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkInternal)this).AssociatedResourceId, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("ClusterId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkInternal)this).ClusterId = (string) content.GetValueForProperty("ClusterId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkInternal)this).ClusterId, global::System.Convert.ToString); + } + if (content.Contains("DetailedStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkInternal)this).DetailedStatus = (string) content.GetValueForProperty("DetailedStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkInternal)this).DetailedStatus, global::System.Convert.ToString); + } + if (content.Contains("DetailedStatusMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkInternal)this).DetailedStatusMessage = (string) content.GetValueForProperty("DetailedStatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkInternal)this).DetailedStatusMessage, global::System.Convert.ToString); + } + if (content.Contains("HybridAksClustersAssociatedId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkInternal)this).HybridAksClustersAssociatedId = (System.Collections.Generic.List) content.GetValueForProperty("HybridAksClustersAssociatedId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkInternal)this).HybridAksClustersAssociatedId, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("HybridAksPluginType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkInternal)this).HybridAksPluginType = (string) content.GetValueForProperty("HybridAksPluginType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkInternal)this).HybridAksPluginType, global::System.Convert.ToString); + } + if (content.Contains("InterfaceName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkInternal)this).InterfaceName = (string) content.GetValueForProperty("InterfaceName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkInternal)this).InterfaceName, global::System.Convert.ToString); + } + if (content.Contains("IsolationDomainId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkInternal)this).IsolationDomainId = (System.Collections.Generic.List) content.GetValueForProperty("IsolationDomainId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkInternal)this).IsolationDomainId, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("VirtualMachinesAssociatedId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkInternal)this).VirtualMachinesAssociatedId = (System.Collections.Generic.List) content.GetValueForProperty("VirtualMachinesAssociatedId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkInternal)this).VirtualMachinesAssociatedId, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("Vlan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkInternal)this).Vlan = (System.Collections.Generic.List) content.GetValueForProperty("Vlan",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkInternal)this).Vlan, __y => TypeConverterExtensions.SelectToList(__y, (__w)=> (long) global::System.Convert.ChangeType(__w, typeof(long)))); + } + AfterDeserializePSObject(content); + } + } + /// TrunkedNetwork represents a network that utilizes multiple isolation domains and specified VLANs to create a trunked network. + [System.ComponentModel.TypeConverter(typeof(TrunkedNetworkTypeConverter))] + public partial interface ITrunkedNetwork + + { + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/TrunkedNetwork.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/TrunkedNetwork.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/TrunkedNetwork.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/TrunkedNetwork.TypeConverter.cs index 2a0c7ca4ccbd..e8c5a75988a9 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/TrunkedNetwork.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/TrunkedNetwork.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.ITrunkedNetwork ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetwork ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetwork).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetwork).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/TrunkedNetwork.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/TrunkedNetwork.cs new file mode 100644 index 000000000000..cedc4da2cd85 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/TrunkedNetwork.cs @@ -0,0 +1,495 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + + /// + /// TrunkedNetwork represents a network that utilizes multiple isolation domains and specified VLANs to create a trunked network. + /// + public partial class TrunkedNetwork : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetwork, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkInternal, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResource __trackedResource = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.TrackedResource(); + + /// + /// The list of resource IDs for the other Microsoft.NetworkCloud resources that have attached this network. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public System.Collections.Generic.List AssociatedResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkPropertiesInternal)Property).AssociatedResourceId; } + + /// + /// The resource ID of the Network Cloud cluster this trunked network is associated with. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string ClusterId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkPropertiesInternal)Property).ClusterId; } + + /// The more detailed status of the trunked network. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string DetailedStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkPropertiesInternal)Property).DetailedStatus; } + + /// The descriptive message about the current detailed status. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string DetailedStatusMessage { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkPropertiesInternal)Property).DetailedStatusMessage; } + + /// Backing field for property. + private string _etag; + + /// Resource ETag. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string Etag { get => this._etag; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocation _extendedLocation; + + /// The extended location of the cluster associated with the resource. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocation ExtendedLocation { get => (this._extendedLocation = this._extendedLocation ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ExtendedLocation()); set => this._extendedLocation = value; } + + /// The resource ID of the extended location on which the resource will be created. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string ExtendedLocationName { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocationInternal)ExtendedLocation).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocationInternal)ExtendedLocation).Name = value ?? null; } + + /// The extended location type, for example, CustomLocation. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string ExtendedLocationType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocationInternal)ExtendedLocation).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocationInternal)ExtendedLocation).Type = value ?? null; } + + /// + /// Field Deprecated. These fields will be empty/omitted. The list of Hybrid AKS cluster resource IDs that are associated + /// with this trunked network. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public System.Collections.Generic.List HybridAksClustersAssociatedId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkPropertiesInternal)Property).HybridAksClustersAssociatedId; } + + /// + /// Field Deprecated. The field was previously optional, now it will have no defined behavior and will be ignored. The network + /// plugin type for Hybrid AKS. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string HybridAksPluginType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkPropertiesInternal)Property).HybridAksPluginType; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkPropertiesInternal)Property).HybridAksPluginType = value ?? null; } + + /// + /// Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).Id; } + + /// + /// The default interface name for this trunked network in the virtual machine. This name can be overridden by the name supplied + /// in the network attachment configuration of that virtual machine. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string InterfaceName { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkPropertiesInternal)Property).InterfaceName; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkPropertiesInternal)Property).InterfaceName = value ?? null; } + + /// + /// The list of resource IDs representing the Network Fabric isolation domains. It can be any combination of l2IsolationDomain + /// and l3IsolationDomain resources. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public System.Collections.Generic.List IsolationDomainId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkPropertiesInternal)Property).IsolationDomainId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkPropertiesInternal)Property).IsolationDomainId = value ?? null /* arrayOf */; } + + /// The geo-location where the resource lives + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)__trackedResource).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)__trackedResource).Location = value ?? null; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).Id = value ?? null; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).Name = value ?? null; } + + /// Internal Acessors for SystemData + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISystemData Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemData; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemData = value ?? null /* model class */; } + + /// Internal Acessors for SystemDataCreatedAt + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataCreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataCreatedAt = value ?? default(global::System.DateTime); } + + /// Internal Acessors for SystemDataCreatedBy + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataCreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataCreatedBy = value ?? null; } + + /// Internal Acessors for SystemDataCreatedByType + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataCreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataCreatedByType = value ?? null; } + + /// Internal Acessors for SystemDataLastModifiedAt + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedAt = value ?? default(global::System.DateTime); } + + /// Internal Acessors for SystemDataLastModifiedBy + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedBy = value ?? null; } + + /// Internal Acessors for SystemDataLastModifiedByType + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedByType = value ?? null; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).Type = value ?? null; } + + /// Internal Acessors for AssociatedResourceId + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkInternal.AssociatedResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkPropertiesInternal)Property).AssociatedResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkPropertiesInternal)Property).AssociatedResourceId = value ?? null /* arrayOf */; } + + /// Internal Acessors for ClusterId + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkInternal.ClusterId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkPropertiesInternal)Property).ClusterId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkPropertiesInternal)Property).ClusterId = value ?? null; } + + /// Internal Acessors for DetailedStatus + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkInternal.DetailedStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkPropertiesInternal)Property).DetailedStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkPropertiesInternal)Property).DetailedStatus = value ?? null; } + + /// Internal Acessors for DetailedStatusMessage + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkInternal.DetailedStatusMessage { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkPropertiesInternal)Property).DetailedStatusMessage; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkPropertiesInternal)Property).DetailedStatusMessage = value ?? null; } + + /// Internal Acessors for Etag + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkInternal.Etag { get => this._etag; set { {_etag = value;} } } + + /// Internal Acessors for ExtendedLocation + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocation Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkInternal.ExtendedLocation { get => (this._extendedLocation = this._extendedLocation ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ExtendedLocation()); set { {_extendedLocation = value;} } } + + /// Internal Acessors for HybridAksClustersAssociatedId + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkInternal.HybridAksClustersAssociatedId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkPropertiesInternal)Property).HybridAksClustersAssociatedId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkPropertiesInternal)Property).HybridAksClustersAssociatedId = value ?? null /* arrayOf */; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkProperties Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.TrunkedNetworkProperties()); set { {_property = value;} } } + + /// Internal Acessors for ProvisioningState + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkPropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkPropertiesInternal)Property).ProvisioningState = value ?? null; } + + /// Internal Acessors for VirtualMachinesAssociatedId + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkInternal.VirtualMachinesAssociatedId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkPropertiesInternal)Property).VirtualMachinesAssociatedId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkPropertiesInternal)Property).VirtualMachinesAssociatedId = value ?? null /* arrayOf */; } + + /// The name of the resource + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).Name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkProperties _property; + + /// The list of the resource properties. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.TrunkedNetworkProperties()); set => this._property = value; } + + /// The provisioning state of the trunked network. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkPropertiesInternal)Property).ProvisioningState; } + + /// Gets the resource group name + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string ResourceGroupName { get => (new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Success ? new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Groups["resourceGroupName"].Value : null); } + + /// + /// Azure Resource Manager metadata containing createdBy and modifiedBy information. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISystemData SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemData; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemData = value ?? null /* model class */; } + + /// The timestamp of resource creation (UTC). + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataCreatedAt; } + + /// The identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataCreatedBy; } + + /// The type of identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public string SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataCreatedByType; } + + /// The timestamp of resource last modification (UTC) + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedAt; } + + /// The identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedBy; } + + /// The type of identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public string SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedByType; } + + /// Resource tags. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)__trackedResource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).Type; } + + /// + /// Field Deprecated. These fields will be empty/omitted. The list of virtual machine resource IDs, excluding any Hybrid AKS + /// virtual machines, that are currently using this trunked network. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public System.Collections.Generic.List VirtualMachinesAssociatedId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkPropertiesInternal)Property).VirtualMachinesAssociatedId; } + + /// The list of vlans that are selected from the isolation domains for trunking. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public System.Collections.Generic.List Vlan { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkPropertiesInternal)Property).Vlan; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkPropertiesInternal)Property).Vlan = value ?? null /* arrayOf */; } + + /// Creates an new instance. + public TrunkedNetwork() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__trackedResource), __trackedResource); + await eventListener.AssertObjectIsValid(nameof(__trackedResource), __trackedResource); + } + } + /// TrunkedNetwork represents a network that utilizes multiple isolation domains and specified VLANs to create a trunked network. + public partial interface ITrunkedNetwork : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResource + { + /// + /// The list of resource IDs for the other Microsoft.NetworkCloud resources that have attached this network. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The list of resource IDs for the other Microsoft.NetworkCloud resources that have attached this network.", + SerializedName = @"associatedResourceIds", + PossibleTypes = new [] { typeof(string) })] + System.Collections.Generic.List AssociatedResourceId { get; } + /// + /// The resource ID of the Network Cloud cluster this trunked network is associated with. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The resource ID of the Network Cloud cluster this trunked network is associated with.", + SerializedName = @"clusterId", + PossibleTypes = new [] { typeof(string) })] + string ClusterId { get; } + /// The more detailed status of the trunked network. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The more detailed status of the trunked network.", + SerializedName = @"detailedStatus", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Error", "Available", "Provisioning")] + string DetailedStatus { get; } + /// The descriptive message about the current detailed status. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The descriptive message about the current detailed status.", + SerializedName = @"detailedStatusMessage", + PossibleTypes = new [] { typeof(string) })] + string DetailedStatusMessage { get; } + /// Resource ETag. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"Resource ETag.", + SerializedName = @"etag", + PossibleTypes = new [] { typeof(string) })] + string Etag { get; } + /// The resource ID of the extended location on which the resource will be created. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The resource ID of the extended location on which the resource will be created.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string ExtendedLocationName { get; set; } + /// The extended location type, for example, CustomLocation. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The extended location type, for example, CustomLocation.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + string ExtendedLocationType { get; set; } + /// + /// Field Deprecated. These fields will be empty/omitted. The list of Hybrid AKS cluster resource IDs that are associated + /// with this trunked network. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"Field Deprecated. These fields will be empty/omitted. The list of Hybrid AKS cluster resource IDs that are associated with this trunked network.", + SerializedName = @"hybridAksClustersAssociatedIds", + PossibleTypes = new [] { typeof(string) })] + System.Collections.Generic.List HybridAksClustersAssociatedId { get; } + /// + /// Field Deprecated. The field was previously optional, now it will have no defined behavior and will be ignored. The network + /// plugin type for Hybrid AKS. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"Field Deprecated. The field was previously optional, now it will have no defined behavior and will be ignored. The network plugin type for Hybrid AKS.", + SerializedName = @"hybridAksPluginType", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("DPDK", "SRIOV", "OSDevice")] + string HybridAksPluginType { get; set; } + /// + /// The default interface name for this trunked network in the virtual machine. This name can be overridden by the name supplied + /// in the network attachment configuration of that virtual machine. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The default interface name for this trunked network in the virtual machine. This name can be overridden by the name supplied in the network attachment configuration of that virtual machine.", + SerializedName = @"interfaceName", + PossibleTypes = new [] { typeof(string) })] + string InterfaceName { get; set; } + /// + /// The list of resource IDs representing the Network Fabric isolation domains. It can be any combination of l2IsolationDomain + /// and l3IsolationDomain resources. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The list of resource IDs representing the Network Fabric isolation domains. It can be any combination of l2IsolationDomain and l3IsolationDomain resources.", + SerializedName = @"isolationDomainIds", + PossibleTypes = new [] { typeof(string) })] + System.Collections.Generic.List IsolationDomainId { get; set; } + /// The provisioning state of the trunked network. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The provisioning state of the trunked network.", + SerializedName = @"provisioningState", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Succeeded", "Failed", "Canceled", "Provisioning", "Accepted")] + string ProvisioningState { get; } + /// + /// Field Deprecated. These fields will be empty/omitted. The list of virtual machine resource IDs, excluding any Hybrid AKS + /// virtual machines, that are currently using this trunked network. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"Field Deprecated. These fields will be empty/omitted. The list of virtual machine resource IDs, excluding any Hybrid AKS virtual machines, that are currently using this trunked network.", + SerializedName = @"virtualMachinesAssociatedIds", + PossibleTypes = new [] { typeof(string) })] + System.Collections.Generic.List VirtualMachinesAssociatedId { get; } + /// The list of vlans that are selected from the isolation domains for trunking. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The list of vlans that are selected from the isolation domains for trunking.", + SerializedName = @"vlans", + PossibleTypes = new [] { typeof(long) })] + System.Collections.Generic.List Vlan { get; set; } + + } + /// TrunkedNetwork represents a network that utilizes multiple isolation domains and specified VLANs to create a trunked network. + internal partial interface ITrunkedNetworkInternal : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal + { + /// + /// The list of resource IDs for the other Microsoft.NetworkCloud resources that have attached this network. + /// + System.Collections.Generic.List AssociatedResourceId { get; set; } + /// + /// The resource ID of the Network Cloud cluster this trunked network is associated with. + /// + string ClusterId { get; set; } + /// The more detailed status of the trunked network. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Error", "Available", "Provisioning")] + string DetailedStatus { get; set; } + /// The descriptive message about the current detailed status. + string DetailedStatusMessage { get; set; } + /// Resource ETag. + string Etag { get; set; } + /// The extended location of the cluster associated with the resource. + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocation ExtendedLocation { get; set; } + /// The resource ID of the extended location on which the resource will be created. + string ExtendedLocationName { get; set; } + /// The extended location type, for example, CustomLocation. + string ExtendedLocationType { get; set; } + /// + /// Field Deprecated. These fields will be empty/omitted. The list of Hybrid AKS cluster resource IDs that are associated + /// with this trunked network. + /// + System.Collections.Generic.List HybridAksClustersAssociatedId { get; set; } + /// + /// Field Deprecated. The field was previously optional, now it will have no defined behavior and will be ignored. The network + /// plugin type for Hybrid AKS. + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("DPDK", "SRIOV", "OSDevice")] + string HybridAksPluginType { get; set; } + /// + /// The default interface name for this trunked network in the virtual machine. This name can be overridden by the name supplied + /// in the network attachment configuration of that virtual machine. + /// + string InterfaceName { get; set; } + /// + /// The list of resource IDs representing the Network Fabric isolation domains. It can be any combination of l2IsolationDomain + /// and l3IsolationDomain resources. + /// + System.Collections.Generic.List IsolationDomainId { get; set; } + /// The list of the resource properties. + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkProperties Property { get; set; } + /// The provisioning state of the trunked network. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Succeeded", "Failed", "Canceled", "Provisioning", "Accepted")] + string ProvisioningState { get; set; } + /// + /// Field Deprecated. These fields will be empty/omitted. The list of virtual machine resource IDs, excluding any Hybrid AKS + /// virtual machines, that are currently using this trunked network. + /// + System.Collections.Generic.List VirtualMachinesAssociatedId { get; set; } + /// The list of vlans that are selected from the isolation domains for trunking. + System.Collections.Generic.List Vlan { get; set; } + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/TrunkedNetwork.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/TrunkedNetwork.json.cs similarity index 91% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/TrunkedNetwork.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/TrunkedNetwork.json.cs index 1db1f6c6e401..16cd97fcfc32 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/TrunkedNetwork.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/TrunkedNetwork.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -56,13 +56,13 @@ public partial class TrunkedNetwork partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetwork. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetwork. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetwork. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetwork. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetwork FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetwork FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new TrunkedNetwork(json) : null; } @@ -89,7 +89,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode ToJ __trackedResource?.ToJson(container, serializationMode); AddIf( null != this._extendedLocation ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) this._extendedLocation.ToJson(null,serializationMode) : null, "extendedLocation" ,container.Add ); AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._etag)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._etag.ToString()) : null, "etag" ,container.Add ); } @@ -109,10 +109,10 @@ internal TrunkedNetwork(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime. { return; } - __trackedResource = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.TrackedResource(json); - {_extendedLocation = If( json?.PropertyT("extendedLocation"), out var __jsonExtendedLocation) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ExtendedLocation.FromJson(__jsonExtendedLocation) : ExtendedLocation;} - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.TrunkedNetworkProperties.FromJson(__jsonProperties) : Property;} - {_etag = If( json?.PropertyT("etag"), out var __jsonEtag) ? (string)__jsonEtag : (string)Etag;} + __trackedResource = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.TrackedResource(json); + {_extendedLocation = If( json?.PropertyT("extendedLocation"), out var __jsonExtendedLocation) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ExtendedLocation.FromJson(__jsonExtendedLocation) : _extendedLocation;} + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.TrunkedNetworkProperties.FromJson(__jsonProperties) : _property;} + {_etag = If( json?.PropertyT("etag"), out var __jsonEtag) ? (string)__jsonEtag : (string)_etag;} AfterFromJson(json); } } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/TrunkedNetworkAttachmentConfiguration.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/TrunkedNetworkAttachmentConfiguration.PowerShell.cs similarity index 77% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/TrunkedNetworkAttachmentConfiguration.PowerShell.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/TrunkedNetworkAttachmentConfiguration.PowerShell.cs index e7be13d31729..e4b9ad613281 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/TrunkedNetworkAttachmentConfiguration.PowerShell.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/TrunkedNetworkAttachmentConfiguration.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; @@ -65,29 +65,29 @@ public partial class TrunkedNetworkAttachmentConfiguration 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.NetworkCloud.Models.Api20250201.ITrunkedNetworkAttachmentConfiguration DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkAttachmentConfiguration DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new TrunkedNetworkAttachmentConfiguration(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.NetworkCloud.Models.Api20250201.ITrunkedNetworkAttachmentConfiguration DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkAttachmentConfiguration DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new TrunkedNetworkAttachmentConfiguration(content); } @@ -100,7 +100,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201 /// /// an instance of the model class. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkAttachmentConfiguration FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkAttachmentConfiguration FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. @@ -120,7 +120,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. @@ -135,17 +135,17 @@ internal TrunkedNetworkAttachmentConfiguration(global::System.Collections.IDicti // actually deserialize if (content.Contains("NetworkId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkAttachmentConfigurationInternal)this).NetworkId = (string) content.GetValueForProperty("NetworkId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkAttachmentConfigurationInternal)this).NetworkId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkAttachmentConfigurationInternal)this).NetworkId = (string) content.GetValueForProperty("NetworkId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkAttachmentConfigurationInternal)this).NetworkId, global::System.Convert.ToString); } if (content.Contains("PluginType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkAttachmentConfigurationInternal)this).PluginType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesPluginType?) content.GetValueForProperty("PluginType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkAttachmentConfigurationInternal)this).PluginType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesPluginType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkAttachmentConfigurationInternal)this).PluginType = (string) content.GetValueForProperty("PluginType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkAttachmentConfigurationInternal)this).PluginType, 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. @@ -160,11 +160,11 @@ internal TrunkedNetworkAttachmentConfiguration(global::System.Management.Automat // actually deserialize if (content.Contains("NetworkId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkAttachmentConfigurationInternal)this).NetworkId = (string) content.GetValueForProperty("NetworkId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkAttachmentConfigurationInternal)this).NetworkId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkAttachmentConfigurationInternal)this).NetworkId = (string) content.GetValueForProperty("NetworkId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkAttachmentConfigurationInternal)this).NetworkId, global::System.Convert.ToString); } if (content.Contains("PluginType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkAttachmentConfigurationInternal)this).PluginType = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesPluginType?) content.GetValueForProperty("PluginType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkAttachmentConfigurationInternal)this).PluginType, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesPluginType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkAttachmentConfigurationInternal)this).PluginType = (string) content.GetValueForProperty("PluginType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkAttachmentConfigurationInternal)this).PluginType, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/TrunkedNetworkAttachmentConfiguration.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/TrunkedNetworkAttachmentConfiguration.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/TrunkedNetworkAttachmentConfiguration.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/TrunkedNetworkAttachmentConfiguration.TypeConverter.cs index 062433f51fba..987e6aceb3aa 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/TrunkedNetworkAttachmentConfiguration.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/TrunkedNetworkAttachmentConfiguration.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.ITrunkedNetworkAttachmentConfiguration ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkAttachmentConfiguration ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkAttachmentConfiguration).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkAttachmentConfiguration).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/TrunkedNetworkAttachmentConfiguration.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/TrunkedNetworkAttachmentConfiguration.cs similarity index 77% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/TrunkedNetworkAttachmentConfiguration.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/TrunkedNetworkAttachmentConfiguration.cs index 060eb900544d..397d6e915cbb 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/TrunkedNetworkAttachmentConfiguration.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/TrunkedNetworkAttachmentConfiguration.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -11,8 +11,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201 /// TrunkedNetworkAttachmentConfiguration represents the configuration of the attachment of a trunked network. /// public partial class TrunkedNetworkAttachmentConfiguration : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkAttachmentConfiguration, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkAttachmentConfigurationInternal + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkAttachmentConfiguration, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkAttachmentConfigurationInternal { /// Backing field for property. @@ -23,11 +23,11 @@ public partial class TrunkedNetworkAttachmentConfiguration : public string NetworkId { get => this._networkId; set => this._networkId = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesPluginType? _pluginType; + private string _pluginType; /// The indicator of how this network will be utilized by the Kubernetes cluster. [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesPluginType? PluginType { get => this._pluginType; set => this._pluginType = value; } + public string PluginType { get => this._pluginType; set => this._pluginType = value; } /// Creates an new instance. public TrunkedNetworkAttachmentConfiguration() @@ -41,8 +41,11 @@ public partial interface ITrunkedNetworkAttachmentConfiguration : { /// The resource ID of the network that is being configured for attachment. [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, + Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = false, Description = @"The resource ID of the network that is being configured for attachment.", SerializedName = @"networkId", PossibleTypes = new [] { typeof(string) })] @@ -51,10 +54,14 @@ public partial interface ITrunkedNetworkAttachmentConfiguration : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = false, Description = @"The indicator of how this network will be utilized by the Kubernetes cluster.", SerializedName = @"pluginType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesPluginType) })] - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesPluginType? PluginType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("DPDK", "SRIOV", "OSDevice", "MACVLAN", "IPVLAN")] + string PluginType { get; set; } } /// TrunkedNetworkAttachmentConfiguration represents the configuration of the attachment of a trunked network. @@ -64,7 +71,8 @@ internal partial interface ITrunkedNetworkAttachmentConfigurationInternal /// The resource ID of the network that is being configured for attachment. string NetworkId { get; set; } /// The indicator of how this network will be utilized by the Kubernetes cluster. - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesPluginType? PluginType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("DPDK", "SRIOV", "OSDevice", "MACVLAN", "IPVLAN")] + string PluginType { get; set; } } } \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/TrunkedNetworkAttachmentConfiguration.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/TrunkedNetworkAttachmentConfiguration.json.cs similarity index 82% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/TrunkedNetworkAttachmentConfiguration.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/TrunkedNetworkAttachmentConfiguration.json.cs index d5cee4106dd0..17e5917b506d 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/TrunkedNetworkAttachmentConfiguration.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/TrunkedNetworkAttachmentConfiguration.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -56,13 +56,13 @@ public partial class TrunkedNetworkAttachmentConfiguration partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkAttachmentConfiguration. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkAttachmentConfiguration. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkAttachmentConfiguration. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkAttachmentConfiguration. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkAttachmentConfiguration FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkAttachmentConfiguration FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new TrunkedNetworkAttachmentConfiguration(json) : null; } @@ -87,8 +87,14 @@ public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode ToJ { return container; } - AddIf( null != (((object)this._networkId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._networkId.ToString()) : null, "networkId" ,container.Add ); - AddIf( null != (((object)this._pluginType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._pluginType.ToString()) : null, "pluginType" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)||serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate)) + { + AddIf( null != (((object)this._networkId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._networkId.ToString()) : null, "networkId" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)||serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate)) + { + AddIf( null != (((object)this._pluginType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._pluginType.ToString()) : null, "pluginType" ,container.Add ); + } AfterToJson(ref container); return container; } @@ -105,8 +111,8 @@ internal TrunkedNetworkAttachmentConfiguration(Microsoft.Azure.PowerShell.Cmdlet { return; } - {_networkId = If( json?.PropertyT("networkId"), out var __jsonNetworkId) ? (string)__jsonNetworkId : (string)NetworkId;} - {_pluginType = If( json?.PropertyT("pluginType"), out var __jsonPluginType) ? (string)__jsonPluginType : (string)PluginType;} + {_networkId = If( json?.PropertyT("networkId"), out var __jsonNetworkId) ? (string)__jsonNetworkId : (string)_networkId;} + {_pluginType = If( json?.PropertyT("pluginType"), out var __jsonPluginType) ? (string)__jsonPluginType : (string)_pluginType;} AfterFromJson(json); } } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/TrunkedNetworkList.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/TrunkedNetworkList.PowerShell.cs similarity index 76% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/TrunkedNetworkList.PowerShell.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/TrunkedNetworkList.PowerShell.cs index 52c9c910a41e..17a85e9e3361 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/TrunkedNetworkList.PowerShell.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/TrunkedNetworkList.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; @@ -63,27 +63,27 @@ public partial class TrunkedNetworkList 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.NetworkCloud.Models.Api20250201.ITrunkedNetworkList DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkList DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new TrunkedNetworkList(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.NetworkCloud.Models.Api20250201.ITrunkedNetworkList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new TrunkedNetworkList(content); } @@ -93,7 +93,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 TrunkedNetworkList(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkListInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkListInternal)this).NextLink, global::System.Convert.ToString); } if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetwork[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.TrunkedNetworkTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkListInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkListInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.TrunkedNetworkTypeConverter.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. @@ -153,11 +153,11 @@ internal TrunkedNetworkList(global::System.Management.Automation.PSObject conten // actually deserialize if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkListInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkListInternal)this).NextLink, global::System.Convert.ToString); } if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetwork[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.TrunkedNetworkTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkListInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkListInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.TrunkedNetworkTypeConverter.ConvertFrom)); } AfterDeserializePSObject(content); } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/TrunkedNetworkList.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/TrunkedNetworkList.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/TrunkedNetworkList.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/TrunkedNetworkList.TypeConverter.cs index 2bc622021624..2c2b6f95095d 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/TrunkedNetworkList.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/TrunkedNetworkList.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.ITrunkedNetworkList ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkList ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkList).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkList).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/TrunkedNetworkList.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/TrunkedNetworkList.cs new file mode 100644 index 000000000000..c92ab4d004ce --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/TrunkedNetworkList.cs @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + + /// TrunkedNetworkList represents a list of trunked networks. + public partial class TrunkedNetworkList : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkList, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkListInternal + { + + /// Backing field for property. + private string _nextLink; + + /// The link used to get the next page of operations. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; set => this._nextLink = value; } + + /// Backing field for property. + private System.Collections.Generic.List _value; + + /// The list of trunked networks. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public System.Collections.Generic.List Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public TrunkedNetworkList() + { + + } + } + /// TrunkedNetworkList represents a list of trunked networks. + public partial interface ITrunkedNetworkList : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable + { + /// The link used to get the next page of operations. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The link used to get the next page of operations.", + SerializedName = @"nextLink", + PossibleTypes = new [] { typeof(string) })] + string NextLink { get; set; } + /// The list of trunked networks. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The list of trunked networks.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetwork) })] + System.Collections.Generic.List Value { get; set; } + + } + /// TrunkedNetworkList represents a list of trunked networks. + internal partial interface ITrunkedNetworkListInternal + + { + /// The link used to get the next page of operations. + string NextLink { get; set; } + /// The list of trunked networks. + System.Collections.Generic.List Value { get; set; } + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/TrunkedNetworkList.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/TrunkedNetworkList.json.cs similarity index 90% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/TrunkedNetworkList.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/TrunkedNetworkList.json.cs index d1bb35dc56ba..8a1999dcd873 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/TrunkedNetworkList.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/TrunkedNetworkList.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class TrunkedNetworkList partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkList. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkList. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkList. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkList. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkList FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkList FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new TrunkedNetworkList(json) : null; } @@ -110,8 +110,8 @@ internal TrunkedNetworkList(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runt { return; } - {_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.NetworkCloud.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.NetworkCloud.Models.Api20250201.ITrunkedNetwork) (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.TrunkedNetwork.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.NetworkCloud.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.NetworkCloud.Models.ITrunkedNetwork) (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.TrunkedNetwork.FromJson(__u) )) ))() : null : _value;} AfterFromJson(json); } } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/TrunkedNetworkPatchParameters.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/TrunkedNetworkPatchParameters.PowerShell.cs similarity index 81% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/TrunkedNetworkPatchParameters.PowerShell.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/TrunkedNetworkPatchParameters.PowerShell.cs index 7d88be4a38ce..5aecea7c3fd1 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/TrunkedNetworkPatchParameters.PowerShell.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/TrunkedNetworkPatchParameters.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; @@ -65,29 +65,27 @@ public partial class TrunkedNetworkPatchParameters 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.NetworkCloud.Models.Api20250201.ITrunkedNetworkPatchParameters DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkPatchParameters DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new TrunkedNetworkPatchParameters(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.NetworkCloud.Models.Api20250201.ITrunkedNetworkPatchParameters DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkPatchParameters DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new TrunkedNetworkPatchParameters(content); } @@ -97,7 +95,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkPatchParameters FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkPatchParameters FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 TrunkedNetworkPatchParameters(global::System.Collections.IDictionary co // actually deserialize if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkPatchParametersInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkPatchParametersTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkPatchParametersInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.TrunkedNetworkPatchParametersTagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkPatchParametersInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkPatchParametersTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkPatchParametersInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.TrunkedNetworkPatchParametersTagsTypeConverter.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. @@ -153,7 +151,7 @@ internal TrunkedNetworkPatchParameters(global::System.Management.Automation.PSOb // actually deserialize if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkPatchParametersInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkPatchParametersTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkPatchParametersInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.TrunkedNetworkPatchParametersTagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkPatchParametersInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkPatchParametersTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkPatchParametersInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.TrunkedNetworkPatchParametersTagsTypeConverter.ConvertFrom); } AfterDeserializePSObject(content); } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/TrunkedNetworkPatchParameters.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/TrunkedNetworkPatchParameters.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/TrunkedNetworkPatchParameters.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/TrunkedNetworkPatchParameters.TypeConverter.cs index d8ab9ab8b0fe..e6fdc0ce77d8 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/TrunkedNetworkPatchParameters.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/TrunkedNetworkPatchParameters.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.ITrunkedNetworkPatchParameters ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkPatchParameters ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkPatchParameters).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkPatchParameters).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/TrunkedNetworkPatchParameters.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/TrunkedNetworkPatchParameters.cs new file mode 100644 index 000000000000..f7fca67a427a --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/TrunkedNetworkPatchParameters.cs @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + + /// + /// TrunkedNetworkPatchParameters represents the body of the request to patch the Trunked network. + /// + public partial class TrunkedNetworkPatchParameters : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkPatchParameters, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkPatchParametersInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkPatchParametersTags _tag; + + /// The Azure resource tags that will replace the existing ones. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkPatchParametersTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.TrunkedNetworkPatchParametersTags()); set => this._tag = value; } + + /// Creates an new instance. + public TrunkedNetworkPatchParameters() + { + + } + } + /// TrunkedNetworkPatchParameters represents the body of the request to patch the Trunked network. + public partial interface ITrunkedNetworkPatchParameters : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable + { + /// The Azure resource tags that will replace the existing ones. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The Azure resource tags that will replace the existing ones.", + SerializedName = @"tags", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkPatchParametersTags) })] + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkPatchParametersTags Tag { get; set; } + + } + /// TrunkedNetworkPatchParameters represents the body of the request to patch the Trunked network. + internal partial interface ITrunkedNetworkPatchParametersInternal + + { + /// The Azure resource tags that will replace the existing ones. + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkPatchParametersTags Tag { get; set; } + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/TrunkedNetworkPatchParameters.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/TrunkedNetworkPatchParameters.json.cs similarity index 94% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/TrunkedNetworkPatchParameters.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/TrunkedNetworkPatchParameters.json.cs index e9bb2554ef01..5754a3fe08f6 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/TrunkedNetworkPatchParameters.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/TrunkedNetworkPatchParameters.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -56,13 +56,13 @@ public partial class TrunkedNetworkPatchParameters partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkPatchParameters. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkPatchParameters. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkPatchParameters. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkPatchParameters. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkPatchParameters FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkPatchParameters FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new TrunkedNetworkPatchParameters(json) : null; } @@ -103,7 +103,7 @@ internal TrunkedNetworkPatchParameters(Microsoft.Azure.PowerShell.Cmdlets.Networ { return; } - {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.TrunkedNetworkPatchParametersTags.FromJson(__jsonTags) : Tag;} + {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.TrunkedNetworkPatchParametersTags.FromJson(__jsonTags) : _tag;} AfterFromJson(json); } } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/TrunkedNetworkPatchParametersTags.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/TrunkedNetworkPatchParametersTags.PowerShell.cs similarity index 88% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/TrunkedNetworkPatchParametersTags.PowerShell.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/TrunkedNetworkPatchParametersTags.PowerShell.cs index 4e625925ceb0..6dab9eb40093 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/TrunkedNetworkPatchParametersTags.PowerShell.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/TrunkedNetworkPatchParametersTags.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; @@ -63,29 +63,27 @@ public partial class TrunkedNetworkPatchParametersTags 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.NetworkCloud.Models.Api20250201.ITrunkedNetworkPatchParametersTags DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkPatchParametersTags DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new TrunkedNetworkPatchParametersTags(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.NetworkCloud.Models.Api20250201.ITrunkedNetworkPatchParametersTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkPatchParametersTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new TrunkedNetworkPatchParametersTags(content); } @@ -97,7 +95,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201 /// /// an instance of the model class. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkPatchParametersTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkPatchParametersTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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. @@ -136,7 +134,7 @@ internal TrunkedNetworkPatchParametersTags(global::System.Collections.IDictionar } /// - /// 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/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/TrunkedNetworkPatchParametersTags.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/TrunkedNetworkPatchParametersTags.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/TrunkedNetworkPatchParametersTags.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/TrunkedNetworkPatchParametersTags.TypeConverter.cs index eb4d5cf559c9..50853e7044ad 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/TrunkedNetworkPatchParametersTags.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/TrunkedNetworkPatchParametersTags.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.ITrunkedNetworkPatchParametersTags ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkPatchParametersTags ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkPatchParametersTags).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkPatchParametersTags).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/TrunkedNetworkPatchParametersTags.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/TrunkedNetworkPatchParametersTags.cs similarity index 84% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/TrunkedNetworkPatchParametersTags.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/TrunkedNetworkPatchParametersTags.cs index b335ff7ea632..f4a8e417ec59 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/TrunkedNetworkPatchParametersTags.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/TrunkedNetworkPatchParametersTags.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; /// The Azure resource tags that will replace the existing ones. public partial class TrunkedNetworkPatchParametersTags : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkPatchParametersTags, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkPatchParametersTagsInternal + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkPatchParametersTags, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkPatchParametersTagsInternal { /// Creates an new instance. diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/TrunkedNetworkPatchParametersTags.dictionary.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/TrunkedNetworkPatchParametersTags.dictionary.cs similarity index 96% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/TrunkedNetworkPatchParametersTags.dictionary.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/TrunkedNetworkPatchParametersTags.dictionary.cs index 853325e6365c..4b191c752aa5 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/TrunkedNetworkPatchParametersTags.dictionary.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/TrunkedNetworkPatchParametersTags.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.TrunkedNetworkPatchParametersTags source) => source.__additionalProperties; + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.TrunkedNetworkPatchParametersTags source) => source.__additionalProperties; } } \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/TrunkedNetworkPatchParametersTags.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/TrunkedNetworkPatchParametersTags.json.cs similarity index 95% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/TrunkedNetworkPatchParametersTags.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/TrunkedNetworkPatchParametersTags.json.cs index 215797db61a2..b26509dedbc5 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/TrunkedNetworkPatchParametersTags.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/TrunkedNetworkPatchParametersTags.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class TrunkedNetworkPatchParametersTags partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkPatchParametersTags. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkPatchParametersTags. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkPatchParametersTags. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkPatchParametersTags. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkPatchParametersTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkPatchParametersTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new TrunkedNetworkPatchParametersTags(json) : null; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/TrunkedNetworkProperties.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/TrunkedNetworkProperties.PowerShell.cs new file mode 100644 index 000000000000..738dfbbbae1b --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/TrunkedNetworkProperties.PowerShell.cs @@ -0,0 +1,244 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + + /// TrunkedNetworkProperties represents properties of the trunked network. + [System.ComponentModel.TypeConverter(typeof(TrunkedNetworkPropertiesTypeConverter))] + public partial class TrunkedNetworkProperties + { + + /// + /// 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.NetworkCloud.Models.ITrunkedNetworkProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new TrunkedNetworkProperties(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.NetworkCloud.Models.ITrunkedNetworkProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new TrunkedNetworkProperties(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.NetworkCloud.Models.ITrunkedNetworkProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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 TrunkedNetworkProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("AssociatedResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkPropertiesInternal)this).AssociatedResourceId = (System.Collections.Generic.List) content.GetValueForProperty("AssociatedResourceId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkPropertiesInternal)this).AssociatedResourceId, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("ClusterId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkPropertiesInternal)this).ClusterId = (string) content.GetValueForProperty("ClusterId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkPropertiesInternal)this).ClusterId, global::System.Convert.ToString); + } + if (content.Contains("DetailedStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkPropertiesInternal)this).DetailedStatus = (string) content.GetValueForProperty("DetailedStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkPropertiesInternal)this).DetailedStatus, global::System.Convert.ToString); + } + if (content.Contains("DetailedStatusMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkPropertiesInternal)this).DetailedStatusMessage = (string) content.GetValueForProperty("DetailedStatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkPropertiesInternal)this).DetailedStatusMessage, global::System.Convert.ToString); + } + if (content.Contains("HybridAksClustersAssociatedId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkPropertiesInternal)this).HybridAksClustersAssociatedId = (System.Collections.Generic.List) content.GetValueForProperty("HybridAksClustersAssociatedId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkPropertiesInternal)this).HybridAksClustersAssociatedId, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("HybridAksPluginType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkPropertiesInternal)this).HybridAksPluginType = (string) content.GetValueForProperty("HybridAksPluginType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkPropertiesInternal)this).HybridAksPluginType, global::System.Convert.ToString); + } + if (content.Contains("InterfaceName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkPropertiesInternal)this).InterfaceName = (string) content.GetValueForProperty("InterfaceName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkPropertiesInternal)this).InterfaceName, global::System.Convert.ToString); + } + if (content.Contains("IsolationDomainId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkPropertiesInternal)this).IsolationDomainId = (System.Collections.Generic.List) content.GetValueForProperty("IsolationDomainId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkPropertiesInternal)this).IsolationDomainId, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkPropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkPropertiesInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("VirtualMachinesAssociatedId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkPropertiesInternal)this).VirtualMachinesAssociatedId = (System.Collections.Generic.List) content.GetValueForProperty("VirtualMachinesAssociatedId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkPropertiesInternal)this).VirtualMachinesAssociatedId, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("Vlan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkPropertiesInternal)this).Vlan = (System.Collections.Generic.List) content.GetValueForProperty("Vlan",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkPropertiesInternal)this).Vlan, __y => TypeConverterExtensions.SelectToList(__y, (__w)=> (long) global::System.Convert.ChangeType(__w, typeof(long)))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal TrunkedNetworkProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("AssociatedResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkPropertiesInternal)this).AssociatedResourceId = (System.Collections.Generic.List) content.GetValueForProperty("AssociatedResourceId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkPropertiesInternal)this).AssociatedResourceId, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("ClusterId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkPropertiesInternal)this).ClusterId = (string) content.GetValueForProperty("ClusterId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkPropertiesInternal)this).ClusterId, global::System.Convert.ToString); + } + if (content.Contains("DetailedStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkPropertiesInternal)this).DetailedStatus = (string) content.GetValueForProperty("DetailedStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkPropertiesInternal)this).DetailedStatus, global::System.Convert.ToString); + } + if (content.Contains("DetailedStatusMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkPropertiesInternal)this).DetailedStatusMessage = (string) content.GetValueForProperty("DetailedStatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkPropertiesInternal)this).DetailedStatusMessage, global::System.Convert.ToString); + } + if (content.Contains("HybridAksClustersAssociatedId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkPropertiesInternal)this).HybridAksClustersAssociatedId = (System.Collections.Generic.List) content.GetValueForProperty("HybridAksClustersAssociatedId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkPropertiesInternal)this).HybridAksClustersAssociatedId, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("HybridAksPluginType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkPropertiesInternal)this).HybridAksPluginType = (string) content.GetValueForProperty("HybridAksPluginType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkPropertiesInternal)this).HybridAksPluginType, global::System.Convert.ToString); + } + if (content.Contains("InterfaceName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkPropertiesInternal)this).InterfaceName = (string) content.GetValueForProperty("InterfaceName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkPropertiesInternal)this).InterfaceName, global::System.Convert.ToString); + } + if (content.Contains("IsolationDomainId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkPropertiesInternal)this).IsolationDomainId = (System.Collections.Generic.List) content.GetValueForProperty("IsolationDomainId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkPropertiesInternal)this).IsolationDomainId, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkPropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkPropertiesInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("VirtualMachinesAssociatedId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkPropertiesInternal)this).VirtualMachinesAssociatedId = (System.Collections.Generic.List) content.GetValueForProperty("VirtualMachinesAssociatedId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkPropertiesInternal)this).VirtualMachinesAssociatedId, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("Vlan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkPropertiesInternal)this).Vlan = (System.Collections.Generic.List) content.GetValueForProperty("Vlan",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkPropertiesInternal)this).Vlan, __y => TypeConverterExtensions.SelectToList(__y, (__w)=> (long) global::System.Convert.ChangeType(__w, typeof(long)))); + } + AfterDeserializePSObject(content); + } + } + /// TrunkedNetworkProperties represents properties of the trunked network. + [System.ComponentModel.TypeConverter(typeof(TrunkedNetworkPropertiesTypeConverter))] + public partial interface ITrunkedNetworkProperties + + { + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/TrunkedNetworkProperties.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/TrunkedNetworkProperties.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/TrunkedNetworkProperties.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/TrunkedNetworkProperties.TypeConverter.cs index 262a9ffaad26..2a4d92f696a1 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/TrunkedNetworkProperties.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/TrunkedNetworkProperties.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.ITrunkedNetworkProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/TrunkedNetworkProperties.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/TrunkedNetworkProperties.cs new file mode 100644 index 000000000000..dcbe6832e9a5 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/TrunkedNetworkProperties.cs @@ -0,0 +1,338 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + + /// TrunkedNetworkProperties represents properties of the trunked network. + public partial class TrunkedNetworkProperties : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkProperties, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkPropertiesInternal + { + + /// Backing field for property. + private System.Collections.Generic.List _associatedResourceId; + + /// + /// The list of resource IDs for the other Microsoft.NetworkCloud resources that have attached this network. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public System.Collections.Generic.List AssociatedResourceId { get => this._associatedResourceId; } + + /// Backing field for property. + private string _clusterId; + + /// + /// The resource ID of the Network Cloud cluster this trunked network is associated with. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string ClusterId { get => this._clusterId; } + + /// Backing field for property. + private string _detailedStatus; + + /// The more detailed status of the trunked network. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string DetailedStatus { get => this._detailedStatus; } + + /// Backing field for property. + private string _detailedStatusMessage; + + /// The descriptive message about the current detailed status. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string DetailedStatusMessage { get => this._detailedStatusMessage; } + + /// Backing field for property. + private System.Collections.Generic.List _hybridAksClustersAssociatedId; + + /// + /// Field Deprecated. These fields will be empty/omitted. The list of Hybrid AKS cluster resource IDs that are associated + /// with this trunked network. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public System.Collections.Generic.List HybridAksClustersAssociatedId { get => this._hybridAksClustersAssociatedId; } + + /// Backing field for property. + private string _hybridAksPluginType; + + /// + /// Field Deprecated. The field was previously optional, now it will have no defined behavior and will be ignored. The network + /// plugin type for Hybrid AKS. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string HybridAksPluginType { get => this._hybridAksPluginType; set => this._hybridAksPluginType = value; } + + /// Backing field for property. + private string _interfaceName; + + /// + /// The default interface name for this trunked network in the virtual machine. This name can be overridden by the name supplied + /// in the network attachment configuration of that virtual machine. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string InterfaceName { get => this._interfaceName; set => this._interfaceName = value; } + + /// Backing field for property. + private System.Collections.Generic.List _isolationDomainId; + + /// + /// The list of resource IDs representing the Network Fabric isolation domains. It can be any combination of l2IsolationDomain + /// and l3IsolationDomain resources. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public System.Collections.Generic.List IsolationDomainId { get => this._isolationDomainId; set => this._isolationDomainId = value; } + + /// Internal Acessors for AssociatedResourceId + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkPropertiesInternal.AssociatedResourceId { get => this._associatedResourceId; set { {_associatedResourceId = value;} } } + + /// Internal Acessors for ClusterId + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkPropertiesInternal.ClusterId { get => this._clusterId; set { {_clusterId = value;} } } + + /// Internal Acessors for DetailedStatus + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkPropertiesInternal.DetailedStatus { get => this._detailedStatus; set { {_detailedStatus = value;} } } + + /// Internal Acessors for DetailedStatusMessage + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkPropertiesInternal.DetailedStatusMessage { get => this._detailedStatusMessage; set { {_detailedStatusMessage = value;} } } + + /// Internal Acessors for HybridAksClustersAssociatedId + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkPropertiesInternal.HybridAksClustersAssociatedId { get => this._hybridAksClustersAssociatedId; set { {_hybridAksClustersAssociatedId = value;} } } + + /// Internal Acessors for ProvisioningState + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkPropertiesInternal.ProvisioningState { get => this._provisioningState; set { {_provisioningState = value;} } } + + /// Internal Acessors for VirtualMachinesAssociatedId + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkPropertiesInternal.VirtualMachinesAssociatedId { get => this._virtualMachinesAssociatedId; set { {_virtualMachinesAssociatedId = value;} } } + + /// Backing field for property. + private string _provisioningState; + + /// The provisioning state of the trunked network. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string ProvisioningState { get => this._provisioningState; } + + /// Backing field for property. + private System.Collections.Generic.List _virtualMachinesAssociatedId; + + /// + /// Field Deprecated. These fields will be empty/omitted. The list of virtual machine resource IDs, excluding any Hybrid AKS + /// virtual machines, that are currently using this trunked network. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public System.Collections.Generic.List VirtualMachinesAssociatedId { get => this._virtualMachinesAssociatedId; } + + /// Backing field for property. + private System.Collections.Generic.List _vlan; + + /// The list of vlans that are selected from the isolation domains for trunking. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public System.Collections.Generic.List Vlan { get => this._vlan; set => this._vlan = value; } + + /// Creates an new instance. + public TrunkedNetworkProperties() + { + + } + } + /// TrunkedNetworkProperties represents properties of the trunked network. + public partial interface ITrunkedNetworkProperties : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable + { + /// + /// The list of resource IDs for the other Microsoft.NetworkCloud resources that have attached this network. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The list of resource IDs for the other Microsoft.NetworkCloud resources that have attached this network.", + SerializedName = @"associatedResourceIds", + PossibleTypes = new [] { typeof(string) })] + System.Collections.Generic.List AssociatedResourceId { get; } + /// + /// The resource ID of the Network Cloud cluster this trunked network is associated with. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The resource ID of the Network Cloud cluster this trunked network is associated with.", + SerializedName = @"clusterId", + PossibleTypes = new [] { typeof(string) })] + string ClusterId { get; } + /// The more detailed status of the trunked network. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The more detailed status of the trunked network.", + SerializedName = @"detailedStatus", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Error", "Available", "Provisioning")] + string DetailedStatus { get; } + /// The descriptive message about the current detailed status. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The descriptive message about the current detailed status.", + SerializedName = @"detailedStatusMessage", + PossibleTypes = new [] { typeof(string) })] + string DetailedStatusMessage { get; } + /// + /// Field Deprecated. These fields will be empty/omitted. The list of Hybrid AKS cluster resource IDs that are associated + /// with this trunked network. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"Field Deprecated. These fields will be empty/omitted. The list of Hybrid AKS cluster resource IDs that are associated with this trunked network.", + SerializedName = @"hybridAksClustersAssociatedIds", + PossibleTypes = new [] { typeof(string) })] + System.Collections.Generic.List HybridAksClustersAssociatedId { get; } + /// + /// Field Deprecated. The field was previously optional, now it will have no defined behavior and will be ignored. The network + /// plugin type for Hybrid AKS. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"Field Deprecated. The field was previously optional, now it will have no defined behavior and will be ignored. The network plugin type for Hybrid AKS.", + SerializedName = @"hybridAksPluginType", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("DPDK", "SRIOV", "OSDevice")] + string HybridAksPluginType { get; set; } + /// + /// The default interface name for this trunked network in the virtual machine. This name can be overridden by the name supplied + /// in the network attachment configuration of that virtual machine. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The default interface name for this trunked network in the virtual machine. This name can be overridden by the name supplied in the network attachment configuration of that virtual machine.", + SerializedName = @"interfaceName", + PossibleTypes = new [] { typeof(string) })] + string InterfaceName { get; set; } + /// + /// The list of resource IDs representing the Network Fabric isolation domains. It can be any combination of l2IsolationDomain + /// and l3IsolationDomain resources. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The list of resource IDs representing the Network Fabric isolation domains. It can be any combination of l2IsolationDomain and l3IsolationDomain resources.", + SerializedName = @"isolationDomainIds", + PossibleTypes = new [] { typeof(string) })] + System.Collections.Generic.List IsolationDomainId { get; set; } + /// The provisioning state of the trunked network. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The provisioning state of the trunked network.", + SerializedName = @"provisioningState", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Succeeded", "Failed", "Canceled", "Provisioning", "Accepted")] + string ProvisioningState { get; } + /// + /// Field Deprecated. These fields will be empty/omitted. The list of virtual machine resource IDs, excluding any Hybrid AKS + /// virtual machines, that are currently using this trunked network. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"Field Deprecated. These fields will be empty/omitted. The list of virtual machine resource IDs, excluding any Hybrid AKS virtual machines, that are currently using this trunked network.", + SerializedName = @"virtualMachinesAssociatedIds", + PossibleTypes = new [] { typeof(string) })] + System.Collections.Generic.List VirtualMachinesAssociatedId { get; } + /// The list of vlans that are selected from the isolation domains for trunking. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The list of vlans that are selected from the isolation domains for trunking.", + SerializedName = @"vlans", + PossibleTypes = new [] { typeof(long) })] + System.Collections.Generic.List Vlan { get; set; } + + } + /// TrunkedNetworkProperties represents properties of the trunked network. + internal partial interface ITrunkedNetworkPropertiesInternal + + { + /// + /// The list of resource IDs for the other Microsoft.NetworkCloud resources that have attached this network. + /// + System.Collections.Generic.List AssociatedResourceId { get; set; } + /// + /// The resource ID of the Network Cloud cluster this trunked network is associated with. + /// + string ClusterId { get; set; } + /// The more detailed status of the trunked network. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Error", "Available", "Provisioning")] + string DetailedStatus { get; set; } + /// The descriptive message about the current detailed status. + string DetailedStatusMessage { get; set; } + /// + /// Field Deprecated. These fields will be empty/omitted. The list of Hybrid AKS cluster resource IDs that are associated + /// with this trunked network. + /// + System.Collections.Generic.List HybridAksClustersAssociatedId { get; set; } + /// + /// Field Deprecated. The field was previously optional, now it will have no defined behavior and will be ignored. The network + /// plugin type for Hybrid AKS. + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("DPDK", "SRIOV", "OSDevice")] + string HybridAksPluginType { get; set; } + /// + /// The default interface name for this trunked network in the virtual machine. This name can be overridden by the name supplied + /// in the network attachment configuration of that virtual machine. + /// + string InterfaceName { get; set; } + /// + /// The list of resource IDs representing the Network Fabric isolation domains. It can be any combination of l2IsolationDomain + /// and l3IsolationDomain resources. + /// + System.Collections.Generic.List IsolationDomainId { get; set; } + /// The provisioning state of the trunked network. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Succeeded", "Failed", "Canceled", "Provisioning", "Accepted")] + string ProvisioningState { get; set; } + /// + /// Field Deprecated. These fields will be empty/omitted. The list of virtual machine resource IDs, excluding any Hybrid AKS + /// virtual machines, that are currently using this trunked network. + /// + System.Collections.Generic.List VirtualMachinesAssociatedId { get; set; } + /// The list of vlans that are selected from the isolation domains for trunking. + System.Collections.Generic.List Vlan { get; set; } + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/TrunkedNetworkProperties.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/TrunkedNetworkProperties.json.cs new file mode 100644 index 000000000000..06163f41f9d5 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/TrunkedNetworkProperties.json.cs @@ -0,0 +1,201 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + + /// TrunkedNetworkProperties represents properties of the trunked network. + public partial class TrunkedNetworkProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new TrunkedNetworkProperties(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) + { + if (null != this._associatedResourceId) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.XNodeArray(); + foreach( var __x in this._associatedResourceId ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("associatedResourceIds",__w); + } + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) + { + AddIf( null != (((object)this._clusterId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._clusterId.ToString()) : null, "clusterId" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) + { + AddIf( null != (((object)this._detailedStatus)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._detailedStatus.ToString()) : null, "detailedStatus" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) + { + AddIf( null != (((object)this._detailedStatusMessage)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._detailedStatusMessage.ToString()) : null, "detailedStatusMessage" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) + { + if (null != this._hybridAksClustersAssociatedId) + { + var __r = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.XNodeArray(); + foreach( var __s in this._hybridAksClustersAssociatedId ) + { + AddIf(null != (((object)__s)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(__s.ToString()) : null ,__r.Add); + } + container.Add("hybridAksClustersAssociatedIds",__r); + } + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)||serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate)) + { + AddIf( null != (((object)this._hybridAksPluginType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._hybridAksPluginType.ToString()) : null, "hybridAksPluginType" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)||serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate)) + { + AddIf( null != (((object)this._interfaceName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._interfaceName.ToString()) : null, "interfaceName" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)||serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate)) + { + if (null != this._isolationDomainId) + { + var __m = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.XNodeArray(); + foreach( var __n in this._isolationDomainId ) + { + AddIf(null != (((object)__n)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(__n.ToString()) : null ,__m.Add); + } + container.Add("isolationDomainIds",__m); + } + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) + { + AddIf( null != (((object)this._provisioningState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._provisioningState.ToString()) : null, "provisioningState" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) + { + if (null != this._virtualMachinesAssociatedId) + { + var __h = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.XNodeArray(); + foreach( var __i in this._virtualMachinesAssociatedId ) + { + AddIf(null != (((object)__i)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(__i.ToString()) : null ,__h.Add); + } + container.Add("virtualMachinesAssociatedIds",__h); + } + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)||serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate)) + { + if (null != this._vlan) + { + var __c = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.XNodeArray(); + foreach( var __d in this._vlan ) + { + AddIf((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNumber(__d) ,__c.Add); + } + container.Add("vlans",__c); + } + } + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject instance to deserialize from. + internal TrunkedNetworkProperties(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_associatedResourceId = If( json?.PropertyT("associatedResourceIds"), out var __jsonAssociatedResourceIds) ? If( __jsonAssociatedResourceIds as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : _associatedResourceId;} + {_clusterId = If( json?.PropertyT("clusterId"), out var __jsonClusterId) ? (string)__jsonClusterId : (string)_clusterId;} + {_detailedStatus = If( json?.PropertyT("detailedStatus"), out var __jsonDetailedStatus) ? (string)__jsonDetailedStatus : (string)_detailedStatus;} + {_detailedStatusMessage = If( json?.PropertyT("detailedStatusMessage"), out var __jsonDetailedStatusMessage) ? (string)__jsonDetailedStatusMessage : (string)_detailedStatusMessage;} + {_hybridAksClustersAssociatedId = If( json?.PropertyT("hybridAksClustersAssociatedIds"), out var __jsonHybridAksClustersAssociatedIds) ? If( __jsonHybridAksClustersAssociatedIds as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Json.JsonString __o ? (string)(__o.ToString()) : null)) ))() : null : _hybridAksClustersAssociatedId;} + {_hybridAksPluginType = If( json?.PropertyT("hybridAksPluginType"), out var __jsonHybridAksPluginType) ? (string)__jsonHybridAksPluginType : (string)_hybridAksPluginType;} + {_interfaceName = If( json?.PropertyT("interfaceName"), out var __jsonInterfaceName) ? (string)__jsonInterfaceName : (string)_interfaceName;} + {_isolationDomainId = If( json?.PropertyT("isolationDomainIds"), out var __jsonIsolationDomainIds) ? If( __jsonIsolationDomainIds as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Json.JsonString __j ? (string)(__j.ToString()) : null)) ))() : null : _isolationDomainId;} + {_provisioningState = If( json?.PropertyT("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)_provisioningState;} + {_virtualMachinesAssociatedId = If( json?.PropertyT("virtualMachinesAssociatedIds"), out var __jsonVirtualMachinesAssociatedIds) ? If( __jsonVirtualMachinesAssociatedIds as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Json.JsonString __e ? (string)(__e.ToString()) : null)) ))() : null : _virtualMachinesAssociatedId;} + {_vlan = If( json?.PropertyT("vlans"), out var __jsonVlans) ? If( __jsonVlans as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonArray, out var __b) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__b, (__a)=>(long) (__a is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNumber ___z ? (long)___z : default(long))) ))() : null : _vlan;} + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/UserAssignedIdentities.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/UserAssignedIdentities.PowerShell.cs new file mode 100644 index 000000000000..915b8bde85d0 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/UserAssignedIdentities.PowerShell.cs @@ -0,0 +1,166 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + + /// + /// 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. + /// + [System.ComponentModel.TypeConverter(typeof(UserAssignedIdentitiesTypeConverter))] + public partial class UserAssignedIdentities + { + + /// + /// 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.NetworkCloud.Models.IUserAssignedIdentities DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new UserAssignedIdentities(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.NetworkCloud.Models.IUserAssignedIdentities DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new UserAssignedIdentities(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.NetworkCloud.Models.IUserAssignedIdentities FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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 UserAssignedIdentities(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal UserAssignedIdentities(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializePSObject(content); + } + } + /// 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. + [System.ComponentModel.TypeConverter(typeof(UserAssignedIdentitiesTypeConverter))] + public partial interface IUserAssignedIdentities + + { + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/UserAssignedIdentities.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/UserAssignedIdentities.TypeConverter.cs new file mode 100644 index 000000000000..21e85fe0d600 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/UserAssignedIdentities.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class UserAssignedIdentitiesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IUserAssignedIdentities ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IUserAssignedIdentities).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return UserAssignedIdentities.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return UserAssignedIdentities.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return UserAssignedIdentities.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/UserAssignedIdentities.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/UserAssignedIdentities.cs new file mode 100644 index 000000000000..bc56d01ce7b9 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/UserAssignedIdentities.cs @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + + /// + /// 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. + /// + public partial class UserAssignedIdentities : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IUserAssignedIdentities, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IUserAssignedIdentitiesInternal + { + + /// Creates an new instance. + public UserAssignedIdentities() + { + + } + } + /// 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. + public partial interface IUserAssignedIdentities : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IAssociativeArray + { + + } + /// 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. + internal partial interface IUserAssignedIdentitiesInternal + + { + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/UserAssignedIdentities.dictionary.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/UserAssignedIdentities.dictionary.cs new file mode 100644 index 000000000000..a85e3a75e886 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/UserAssignedIdentities.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.NetworkCloud.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + + public partial class UserAssignedIdentities : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IAssociativeArray + { + protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); + + global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; } + + int Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IAssociativeArray.Values { get => __additionalProperties.Values; } + + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.IUserAssignedIdentity 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.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.IUserAssignedIdentity value) => __additionalProperties.TryGetValue( key, out value); + + /// + + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.UserAssignedIdentities source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/UserAssignedIdentities.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/UserAssignedIdentities.json.cs new file mode 100644 index 000000000000..47a8fa3d7fed --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/UserAssignedIdentities.json.cs @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + + /// + /// 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. + /// + public partial class UserAssignedIdentities + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IUserAssignedIdentities. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IUserAssignedIdentities. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IUserAssignedIdentities FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new UserAssignedIdentities(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IAssociativeArray)this).AdditionalProperties, container); + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject instance to deserialize from. + /// + internal UserAssignedIdentities(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IAssociativeArray)this).AdditionalProperties, (j) => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.UserAssignedIdentity.FromJson(j) ,exclusions ); + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/UserAssignedIdentity.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/UserAssignedIdentity.PowerShell.cs new file mode 100644 index 000000000000..39e759eedaab --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/UserAssignedIdentity.PowerShell.cs @@ -0,0 +1,172 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + + /// User assigned identity properties + [System.ComponentModel.TypeConverter(typeof(UserAssignedIdentityTypeConverter))] + public partial class UserAssignedIdentity + { + + /// + /// 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.NetworkCloud.Models.IUserAssignedIdentity DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new UserAssignedIdentity(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.NetworkCloud.Models.IUserAssignedIdentity DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new UserAssignedIdentity(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.NetworkCloud.Models.IUserAssignedIdentity FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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 UserAssignedIdentity(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("PrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IUserAssignedIdentityInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IUserAssignedIdentityInternal)this).PrincipalId, global::System.Convert.ToString); + } + if (content.Contains("ClientId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IUserAssignedIdentityInternal)this).ClientId = (string) content.GetValueForProperty("ClientId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IUserAssignedIdentityInternal)this).ClientId, 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 UserAssignedIdentity(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("PrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IUserAssignedIdentityInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IUserAssignedIdentityInternal)this).PrincipalId, global::System.Convert.ToString); + } + if (content.Contains("ClientId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IUserAssignedIdentityInternal)this).ClientId = (string) content.GetValueForProperty("ClientId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IUserAssignedIdentityInternal)this).ClientId, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + } + /// User assigned identity properties + [System.ComponentModel.TypeConverter(typeof(UserAssignedIdentityTypeConverter))] + public partial interface IUserAssignedIdentity + + { + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/UserAssignedIdentity.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/UserAssignedIdentity.TypeConverter.cs new file mode 100644 index 000000000000..8259666998b4 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/UserAssignedIdentity.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class UserAssignedIdentityTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IUserAssignedIdentity ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IUserAssignedIdentity).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return UserAssignedIdentity.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return UserAssignedIdentity.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return UserAssignedIdentity.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/UserAssignedIdentity.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/UserAssignedIdentity.cs new file mode 100644 index 000000000000..936f005d671f --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/UserAssignedIdentity.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + + /// User assigned identity properties + public partial class UserAssignedIdentity : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IUserAssignedIdentity, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IUserAssignedIdentityInternal + { + + /// Backing field for property. + private string _clientId; + + /// The client ID of the assigned identity. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string ClientId { get => this._clientId; } + + /// Internal Acessors for ClientId + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IUserAssignedIdentityInternal.ClientId { get => this._clientId; set { {_clientId = value;} } } + + /// Internal Acessors for PrincipalId + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IUserAssignedIdentityInternal.PrincipalId { get => this._principalId; set { {_principalId = value;} } } + + /// Backing field for property. + private string _principalId; + + /// The principal ID of the assigned identity. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string PrincipalId { get => this._principalId; } + + /// Creates an new instance. + public UserAssignedIdentity() + { + + } + } + /// User assigned identity properties + public partial interface IUserAssignedIdentity : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable + { + /// The client ID of the assigned identity. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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) })] + string ClientId { get; } + /// The principal ID of the assigned identity. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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) })] + string PrincipalId { get; } + + } + /// User assigned identity properties + internal partial interface IUserAssignedIdentityInternal + + { + /// The client ID of the assigned identity. + string ClientId { get; set; } + /// The principal ID of the assigned identity. + string PrincipalId { get; set; } + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/UserAssignedIdentity.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/UserAssignedIdentity.json.cs new file mode 100644 index 000000000000..667356942fee --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/UserAssignedIdentity.json.cs @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + + /// User assigned identity properties + public partial class UserAssignedIdentity + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IUserAssignedIdentity. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IUserAssignedIdentity. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IUserAssignedIdentity FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new UserAssignedIdentity(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) + { + AddIf( null != (((object)this._principalId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._principalId.ToString()) : null, "principalId" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) + { + AddIf( null != (((object)this._clientId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._clientId.ToString()) : null, "clientId" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject instance to deserialize from. + internal UserAssignedIdentity(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_principalId = If( json?.PropertyT("principalId"), out var __jsonPrincipalId) ? (string)__jsonPrincipalId : (string)_principalId;} + {_clientId = If( json?.PropertyT("clientId"), out var __jsonClientId) ? (string)__jsonClientId : (string)_clientId;} + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ValidationThreshold.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ValidationThreshold.PowerShell.cs new file mode 100644 index 000000000000..8eb94e4b1cf6 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ValidationThreshold.PowerShell.cs @@ -0,0 +1,182 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + + /// + /// ValidationThreshold indicates allowed machine and node hardware and deployment failures. + /// + [System.ComponentModel.TypeConverter(typeof(ValidationThresholdTypeConverter))] + public partial class ValidationThreshold + { + + /// + /// 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.NetworkCloud.Models.IValidationThreshold DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ValidationThreshold(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.NetworkCloud.Models.IValidationThreshold DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ValidationThreshold(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.NetworkCloud.Models.IValidationThreshold FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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 ValidationThreshold(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Grouping")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IValidationThresholdInternal)this).Grouping = (string) content.GetValueForProperty("Grouping",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IValidationThresholdInternal)this).Grouping, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IValidationThresholdInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IValidationThresholdInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IValidationThresholdInternal)this).Value = (long) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IValidationThresholdInternal)this).Value, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ValidationThreshold(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Grouping")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IValidationThresholdInternal)this).Grouping = (string) content.GetValueForProperty("Grouping",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IValidationThresholdInternal)this).Grouping, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IValidationThresholdInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IValidationThresholdInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IValidationThresholdInternal)this).Value = (long) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IValidationThresholdInternal)this).Value, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + AfterDeserializePSObject(content); + } + } + /// ValidationThreshold indicates allowed machine and node hardware and deployment failures. + [System.ComponentModel.TypeConverter(typeof(ValidationThresholdTypeConverter))] + public partial interface IValidationThreshold + + { + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ValidationThreshold.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ValidationThreshold.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ValidationThreshold.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ValidationThreshold.TypeConverter.cs index d5b959279d49..14c55a805fde 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ValidationThreshold.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ValidationThreshold.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IValidationThreshold ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IValidationThreshold ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IValidationThreshold).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IValidationThreshold).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ValidationThreshold.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ValidationThreshold.cs new file mode 100644 index 000000000000..7ebec8423975 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ValidationThreshold.cs @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + + /// + /// ValidationThreshold indicates allowed machine and node hardware and deployment failures. + /// + public partial class ValidationThreshold : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IValidationThreshold, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IValidationThresholdInternal + { + + /// Backing field for property. + private string _grouping; + + /// Selection of how the type evaluation is applied to the cluster calculation. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string Grouping { get => this._grouping; set => this._grouping = value; } + + /// Backing field for property. + private string _type; + + /// Selection of how the threshold should be evaluated. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string Type { get => this._type; set => this._type = value; } + + /// Backing field for property. + private long _value; + + /// The numeric threshold value. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public long Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public ValidationThreshold() + { + + } + } + /// ValidationThreshold indicates allowed machine and node hardware and deployment failures. + public partial interface IValidationThreshold : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable + { + /// Selection of how the type evaluation is applied to the cluster calculation. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"Selection of how the type evaluation is applied to the cluster calculation.", + SerializedName = @"grouping", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("PerCluster", "PerRack")] + string Grouping { get; set; } + /// Selection of how the threshold should be evaluated. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"Selection of how the threshold should be evaluated.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("CountSuccess", "PercentSuccess")] + string Type { get; set; } + /// The numeric threshold value. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The numeric threshold value.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(long) })] + long Value { get; set; } + + } + /// ValidationThreshold indicates allowed machine and node hardware and deployment failures. + internal partial interface IValidationThresholdInternal + + { + /// Selection of how the type evaluation is applied to the cluster calculation. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("PerCluster", "PerRack")] + string Grouping { get; set; } + /// Selection of how the threshold should be evaluated. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("CountSuccess", "PercentSuccess")] + string Type { get; set; } + /// The numeric threshold value. + long Value { get; set; } + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ValidationThreshold.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ValidationThreshold.json.cs similarity index 94% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ValidationThreshold.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ValidationThreshold.json.cs index caaeaf667b0a..6844d2690a85 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/ValidationThreshold.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/ValidationThreshold.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -56,13 +56,13 @@ public partial class ValidationThreshold partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IValidationThreshold. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IValidationThreshold. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IValidationThreshold. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IValidationThreshold. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IValidationThreshold FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IValidationThreshold FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new ValidationThreshold(json) : null; } @@ -105,9 +105,9 @@ internal ValidationThreshold(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Run { return; } - {_grouping = If( json?.PropertyT("grouping"), out var __jsonGrouping) ? (string)__jsonGrouping : (string)Grouping;} - {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)Type;} - {_value = If( json?.PropertyT("value"), out var __jsonValue) ? (long)__jsonValue : Value;} + {_grouping = If( json?.PropertyT("grouping"), out var __jsonGrouping) ? (string)__jsonGrouping : (string)_grouping;} + {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)_type;} + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? (long)__jsonValue : _value;} AfterFromJson(json); } } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VirtualMachine.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VirtualMachine.PowerShell.cs new file mode 100644 index 000000000000..a707950fc0f7 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VirtualMachine.PowerShell.cs @@ -0,0 +1,628 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + + /// VirtualMachine represents the on-premises Network Cloud virtual machine. + [System.ComponentModel.TypeConverter(typeof(VirtualMachineTypeConverter))] + public partial class VirtualMachine + { + + /// + /// 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.NetworkCloud.Models.IVirtualMachine DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new VirtualMachine(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.NetworkCloud.Models.IVirtualMachine DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new VirtualMachine(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.NetworkCloud.Models.IVirtualMachine FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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 VirtualMachine(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ExtendedLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).ExtendedLocation = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocation) content.GetValueForProperty("ExtendedLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).ExtendedLocation, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ExtendedLocationTypeConverter.ConvertFrom); + } + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.VirtualMachinePropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Etag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).Etag, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)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("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedByType = (string) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedByType = (string) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.TrackedResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("ExtendedLocationName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).ExtendedLocationName = (string) content.GetValueForProperty("ExtendedLocationName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).ExtendedLocationName, global::System.Convert.ToString); + } + if (content.Contains("ExtendedLocationType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).ExtendedLocationType = (string) content.GetValueForProperty("ExtendedLocationType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).ExtendedLocationType, global::System.Convert.ToString); + } + if (content.Contains("StorageProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).StorageProfile = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageProfile) content.GetValueForProperty("StorageProfile",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).StorageProfile, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.StorageProfileTypeConverter.ConvertFrom); + } + if (content.Contains("CloudServicesNetworkAttachment")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).CloudServicesNetworkAttachment = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkAttachment) content.GetValueForProperty("CloudServicesNetworkAttachment",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).CloudServicesNetworkAttachment, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.NetworkAttachmentTypeConverter.ConvertFrom); + } + if (content.Contains("ConsoleExtendedLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).ConsoleExtendedLocation = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocation) content.GetValueForProperty("ConsoleExtendedLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).ConsoleExtendedLocation, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ExtendedLocationTypeConverter.ConvertFrom); + } + if (content.Contains("VMImageRepositoryCredentials")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).VMImageRepositoryCredentials = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IImageRepositoryCredentials) content.GetValueForProperty("VMImageRepositoryCredentials",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).VMImageRepositoryCredentials, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ImageRepositoryCredentialsTypeConverter.ConvertFrom); + } + if (content.Contains("AdminUsername")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).AdminUsername = (string) content.GetValueForProperty("AdminUsername",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).AdminUsername, global::System.Convert.ToString); + } + if (content.Contains("AvailabilityZone")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).AvailabilityZone = (string) content.GetValueForProperty("AvailabilityZone",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).AvailabilityZone, global::System.Convert.ToString); + } + if (content.Contains("BareMetalMachineId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).BareMetalMachineId = (string) content.GetValueForProperty("BareMetalMachineId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).BareMetalMachineId, global::System.Convert.ToString); + } + if (content.Contains("BootMethod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).BootMethod = (string) content.GetValueForProperty("BootMethod",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).BootMethod, global::System.Convert.ToString); + } + if (content.Contains("ClusterId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).ClusterId = (string) content.GetValueForProperty("ClusterId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).ClusterId, global::System.Convert.ToString); + } + if (content.Contains("CpuCore")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).CpuCore = (long?) content.GetValueForProperty("CpuCore",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).CpuCore, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("DetailedStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).DetailedStatus = (string) content.GetValueForProperty("DetailedStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).DetailedStatus, global::System.Convert.ToString); + } + if (content.Contains("DetailedStatusMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).DetailedStatusMessage = (string) content.GetValueForProperty("DetailedStatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).DetailedStatusMessage, global::System.Convert.ToString); + } + if (content.Contains("IsolateEmulatorThread")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).IsolateEmulatorThread = (string) content.GetValueForProperty("IsolateEmulatorThread",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).IsolateEmulatorThread, global::System.Convert.ToString); + } + if (content.Contains("MemorySizeGb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).MemorySizeGb = (long?) content.GetValueForProperty("MemorySizeGb",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).MemorySizeGb, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("NetworkAttachment")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).NetworkAttachment = (System.Collections.Generic.List) content.GetValueForProperty("NetworkAttachment",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).NetworkAttachment, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.NetworkAttachmentTypeConverter.ConvertFrom)); + } + if (content.Contains("NetworkData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).NetworkData = (string) content.GetValueForProperty("NetworkData",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).NetworkData, global::System.Convert.ToString); + } + if (content.Contains("PlacementHint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).PlacementHint = (System.Collections.Generic.List) content.GetValueForProperty("PlacementHint",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).PlacementHint, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.VirtualMachinePlacementHintTypeConverter.ConvertFrom)); + } + if (content.Contains("PowerState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).PowerState = (string) content.GetValueForProperty("PowerState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).PowerState, global::System.Convert.ToString); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("SshPublicKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).SshPublicKey = (System.Collections.Generic.List) content.GetValueForProperty("SshPublicKey",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).SshPublicKey, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.SshPublicKeyTypeConverter.ConvertFrom)); + } + if (content.Contains("UserData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).UserData = (string) content.GetValueForProperty("UserData",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).UserData, global::System.Convert.ToString); + } + if (content.Contains("VirtioInterface")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).VirtioInterface = (string) content.GetValueForProperty("VirtioInterface",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).VirtioInterface, global::System.Convert.ToString); + } + if (content.Contains("VMDeviceModel")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).VMDeviceModel = (string) content.GetValueForProperty("VMDeviceModel",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).VMDeviceModel, global::System.Convert.ToString); + } + if (content.Contains("VMImage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).VMImage = (string) content.GetValueForProperty("VMImage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).VMImage, global::System.Convert.ToString); + } + if (content.Contains("Volume")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).Volume = (System.Collections.Generic.List) content.GetValueForProperty("Volume",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).Volume, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("CloudServiceNetworkAttachmentDefaultGateway")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).CloudServiceNetworkAttachmentDefaultGateway = (string) content.GetValueForProperty("CloudServiceNetworkAttachmentDefaultGateway",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).CloudServiceNetworkAttachmentDefaultGateway, global::System.Convert.ToString); + } + if (content.Contains("StorageProfileOSDisk")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).StorageProfileOSDisk = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOSDisk) content.GetValueForProperty("StorageProfileOSDisk",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).StorageProfileOSDisk, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.OSDiskTypeConverter.ConvertFrom); + } + if (content.Contains("StorageProfileVolumeAttachment")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).StorageProfileVolumeAttachment = (System.Collections.Generic.List) content.GetValueForProperty("StorageProfileVolumeAttachment",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).StorageProfileVolumeAttachment, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("CloudServiceNetworkAttachmentAttachedNetworkId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).CloudServiceNetworkAttachmentAttachedNetworkId = (string) content.GetValueForProperty("CloudServiceNetworkAttachmentAttachedNetworkId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).CloudServiceNetworkAttachmentAttachedNetworkId, global::System.Convert.ToString); + } + if (content.Contains("CloudServiceNetworkAttachmentIPAllocationMethod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).CloudServiceNetworkAttachmentIPAllocationMethod = (string) content.GetValueForProperty("CloudServiceNetworkAttachmentIPAllocationMethod",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).CloudServiceNetworkAttachmentIPAllocationMethod, global::System.Convert.ToString); + } + if (content.Contains("CloudServiceNetworkAttachmentIpv4Address")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).CloudServiceNetworkAttachmentIpv4Address = (string) content.GetValueForProperty("CloudServiceNetworkAttachmentIpv4Address",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).CloudServiceNetworkAttachmentIpv4Address, global::System.Convert.ToString); + } + if (content.Contains("CloudServiceNetworkAttachmentIpv6Address")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).CloudServiceNetworkAttachmentIpv6Address = (string) content.GetValueForProperty("CloudServiceNetworkAttachmentIpv6Address",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).CloudServiceNetworkAttachmentIpv6Address, global::System.Convert.ToString); + } + if (content.Contains("CloudServiceNetworkAttachmentMacAddress")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).CloudServiceNetworkAttachmentMacAddress = (string) content.GetValueForProperty("CloudServiceNetworkAttachmentMacAddress",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).CloudServiceNetworkAttachmentMacAddress, global::System.Convert.ToString); + } + if (content.Contains("CloudServiceNetworkAttachmentName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).CloudServiceNetworkAttachmentName = (string) content.GetValueForProperty("CloudServiceNetworkAttachmentName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).CloudServiceNetworkAttachmentName, global::System.Convert.ToString); + } + if (content.Contains("ConsoleExtendedLocationName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).ConsoleExtendedLocationName = (string) content.GetValueForProperty("ConsoleExtendedLocationName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).ConsoleExtendedLocationName, global::System.Convert.ToString); + } + if (content.Contains("ConsoleExtendedLocationType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).ConsoleExtendedLocationType = (string) content.GetValueForProperty("ConsoleExtendedLocationType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).ConsoleExtendedLocationType, global::System.Convert.ToString); + } + if (content.Contains("VMImageRepositoryCredentialsPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).VMImageRepositoryCredentialsPassword = (System.Security.SecureString) content.GetValueForProperty("VMImageRepositoryCredentialsPassword",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).VMImageRepositoryCredentialsPassword, (object ss) => (System.Security.SecureString)ss); + } + if (content.Contains("VMImageRepositoryCredentialsRegistryUrl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).VMImageRepositoryCredentialsRegistryUrl = (string) content.GetValueForProperty("VMImageRepositoryCredentialsRegistryUrl",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).VMImageRepositoryCredentialsRegistryUrl, global::System.Convert.ToString); + } + if (content.Contains("VMImageRepositoryCredentialsUsername")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).VMImageRepositoryCredentialsUsername = (string) content.GetValueForProperty("VMImageRepositoryCredentialsUsername",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).VMImageRepositoryCredentialsUsername, global::System.Convert.ToString); + } + if (content.Contains("OSDiskCreateOption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).OSDiskCreateOption = (string) content.GetValueForProperty("OSDiskCreateOption",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).OSDiskCreateOption, global::System.Convert.ToString); + } + if (content.Contains("OSDiskDeleteOption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).OSDiskDeleteOption = (string) content.GetValueForProperty("OSDiskDeleteOption",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).OSDiskDeleteOption, global::System.Convert.ToString); + } + if (content.Contains("OSDiskSizeGb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).OSDiskSizeGb = (long?) content.GetValueForProperty("OSDiskSizeGb",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).OSDiskSizeGb, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal VirtualMachine(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ExtendedLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).ExtendedLocation = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocation) content.GetValueForProperty("ExtendedLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).ExtendedLocation, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ExtendedLocationTypeConverter.ConvertFrom); + } + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.VirtualMachinePropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Etag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).Etag, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)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("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedByType = (string) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedByType = (string) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.TrackedResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("ExtendedLocationName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).ExtendedLocationName = (string) content.GetValueForProperty("ExtendedLocationName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).ExtendedLocationName, global::System.Convert.ToString); + } + if (content.Contains("ExtendedLocationType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).ExtendedLocationType = (string) content.GetValueForProperty("ExtendedLocationType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).ExtendedLocationType, global::System.Convert.ToString); + } + if (content.Contains("StorageProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).StorageProfile = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageProfile) content.GetValueForProperty("StorageProfile",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).StorageProfile, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.StorageProfileTypeConverter.ConvertFrom); + } + if (content.Contains("CloudServicesNetworkAttachment")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).CloudServicesNetworkAttachment = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkAttachment) content.GetValueForProperty("CloudServicesNetworkAttachment",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).CloudServicesNetworkAttachment, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.NetworkAttachmentTypeConverter.ConvertFrom); + } + if (content.Contains("ConsoleExtendedLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).ConsoleExtendedLocation = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocation) content.GetValueForProperty("ConsoleExtendedLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).ConsoleExtendedLocation, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ExtendedLocationTypeConverter.ConvertFrom); + } + if (content.Contains("VMImageRepositoryCredentials")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).VMImageRepositoryCredentials = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IImageRepositoryCredentials) content.GetValueForProperty("VMImageRepositoryCredentials",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).VMImageRepositoryCredentials, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ImageRepositoryCredentialsTypeConverter.ConvertFrom); + } + if (content.Contains("AdminUsername")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).AdminUsername = (string) content.GetValueForProperty("AdminUsername",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).AdminUsername, global::System.Convert.ToString); + } + if (content.Contains("AvailabilityZone")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).AvailabilityZone = (string) content.GetValueForProperty("AvailabilityZone",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).AvailabilityZone, global::System.Convert.ToString); + } + if (content.Contains("BareMetalMachineId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).BareMetalMachineId = (string) content.GetValueForProperty("BareMetalMachineId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).BareMetalMachineId, global::System.Convert.ToString); + } + if (content.Contains("BootMethod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).BootMethod = (string) content.GetValueForProperty("BootMethod",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).BootMethod, global::System.Convert.ToString); + } + if (content.Contains("ClusterId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).ClusterId = (string) content.GetValueForProperty("ClusterId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).ClusterId, global::System.Convert.ToString); + } + if (content.Contains("CpuCore")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).CpuCore = (long?) content.GetValueForProperty("CpuCore",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).CpuCore, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("DetailedStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).DetailedStatus = (string) content.GetValueForProperty("DetailedStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).DetailedStatus, global::System.Convert.ToString); + } + if (content.Contains("DetailedStatusMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).DetailedStatusMessage = (string) content.GetValueForProperty("DetailedStatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).DetailedStatusMessage, global::System.Convert.ToString); + } + if (content.Contains("IsolateEmulatorThread")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).IsolateEmulatorThread = (string) content.GetValueForProperty("IsolateEmulatorThread",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).IsolateEmulatorThread, global::System.Convert.ToString); + } + if (content.Contains("MemorySizeGb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).MemorySizeGb = (long?) content.GetValueForProperty("MemorySizeGb",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).MemorySizeGb, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("NetworkAttachment")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).NetworkAttachment = (System.Collections.Generic.List) content.GetValueForProperty("NetworkAttachment",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).NetworkAttachment, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.NetworkAttachmentTypeConverter.ConvertFrom)); + } + if (content.Contains("NetworkData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).NetworkData = (string) content.GetValueForProperty("NetworkData",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).NetworkData, global::System.Convert.ToString); + } + if (content.Contains("PlacementHint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).PlacementHint = (System.Collections.Generic.List) content.GetValueForProperty("PlacementHint",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).PlacementHint, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.VirtualMachinePlacementHintTypeConverter.ConvertFrom)); + } + if (content.Contains("PowerState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).PowerState = (string) content.GetValueForProperty("PowerState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).PowerState, global::System.Convert.ToString); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("SshPublicKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).SshPublicKey = (System.Collections.Generic.List) content.GetValueForProperty("SshPublicKey",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).SshPublicKey, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.SshPublicKeyTypeConverter.ConvertFrom)); + } + if (content.Contains("UserData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).UserData = (string) content.GetValueForProperty("UserData",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).UserData, global::System.Convert.ToString); + } + if (content.Contains("VirtioInterface")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).VirtioInterface = (string) content.GetValueForProperty("VirtioInterface",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).VirtioInterface, global::System.Convert.ToString); + } + if (content.Contains("VMDeviceModel")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).VMDeviceModel = (string) content.GetValueForProperty("VMDeviceModel",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).VMDeviceModel, global::System.Convert.ToString); + } + if (content.Contains("VMImage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).VMImage = (string) content.GetValueForProperty("VMImage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).VMImage, global::System.Convert.ToString); + } + if (content.Contains("Volume")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).Volume = (System.Collections.Generic.List) content.GetValueForProperty("Volume",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).Volume, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("CloudServiceNetworkAttachmentDefaultGateway")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).CloudServiceNetworkAttachmentDefaultGateway = (string) content.GetValueForProperty("CloudServiceNetworkAttachmentDefaultGateway",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).CloudServiceNetworkAttachmentDefaultGateway, global::System.Convert.ToString); + } + if (content.Contains("StorageProfileOSDisk")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).StorageProfileOSDisk = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOSDisk) content.GetValueForProperty("StorageProfileOSDisk",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).StorageProfileOSDisk, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.OSDiskTypeConverter.ConvertFrom); + } + if (content.Contains("StorageProfileVolumeAttachment")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).StorageProfileVolumeAttachment = (System.Collections.Generic.List) content.GetValueForProperty("StorageProfileVolumeAttachment",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).StorageProfileVolumeAttachment, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("CloudServiceNetworkAttachmentAttachedNetworkId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).CloudServiceNetworkAttachmentAttachedNetworkId = (string) content.GetValueForProperty("CloudServiceNetworkAttachmentAttachedNetworkId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).CloudServiceNetworkAttachmentAttachedNetworkId, global::System.Convert.ToString); + } + if (content.Contains("CloudServiceNetworkAttachmentIPAllocationMethod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).CloudServiceNetworkAttachmentIPAllocationMethod = (string) content.GetValueForProperty("CloudServiceNetworkAttachmentIPAllocationMethod",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).CloudServiceNetworkAttachmentIPAllocationMethod, global::System.Convert.ToString); + } + if (content.Contains("CloudServiceNetworkAttachmentIpv4Address")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).CloudServiceNetworkAttachmentIpv4Address = (string) content.GetValueForProperty("CloudServiceNetworkAttachmentIpv4Address",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).CloudServiceNetworkAttachmentIpv4Address, global::System.Convert.ToString); + } + if (content.Contains("CloudServiceNetworkAttachmentIpv6Address")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).CloudServiceNetworkAttachmentIpv6Address = (string) content.GetValueForProperty("CloudServiceNetworkAttachmentIpv6Address",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).CloudServiceNetworkAttachmentIpv6Address, global::System.Convert.ToString); + } + if (content.Contains("CloudServiceNetworkAttachmentMacAddress")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).CloudServiceNetworkAttachmentMacAddress = (string) content.GetValueForProperty("CloudServiceNetworkAttachmentMacAddress",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).CloudServiceNetworkAttachmentMacAddress, global::System.Convert.ToString); + } + if (content.Contains("CloudServiceNetworkAttachmentName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).CloudServiceNetworkAttachmentName = (string) content.GetValueForProperty("CloudServiceNetworkAttachmentName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).CloudServiceNetworkAttachmentName, global::System.Convert.ToString); + } + if (content.Contains("ConsoleExtendedLocationName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).ConsoleExtendedLocationName = (string) content.GetValueForProperty("ConsoleExtendedLocationName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).ConsoleExtendedLocationName, global::System.Convert.ToString); + } + if (content.Contains("ConsoleExtendedLocationType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).ConsoleExtendedLocationType = (string) content.GetValueForProperty("ConsoleExtendedLocationType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).ConsoleExtendedLocationType, global::System.Convert.ToString); + } + if (content.Contains("VMImageRepositoryCredentialsPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).VMImageRepositoryCredentialsPassword = (System.Security.SecureString) content.GetValueForProperty("VMImageRepositoryCredentialsPassword",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).VMImageRepositoryCredentialsPassword, (object ss) => (System.Security.SecureString)ss); + } + if (content.Contains("VMImageRepositoryCredentialsRegistryUrl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).VMImageRepositoryCredentialsRegistryUrl = (string) content.GetValueForProperty("VMImageRepositoryCredentialsRegistryUrl",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).VMImageRepositoryCredentialsRegistryUrl, global::System.Convert.ToString); + } + if (content.Contains("VMImageRepositoryCredentialsUsername")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).VMImageRepositoryCredentialsUsername = (string) content.GetValueForProperty("VMImageRepositoryCredentialsUsername",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).VMImageRepositoryCredentialsUsername, global::System.Convert.ToString); + } + if (content.Contains("OSDiskCreateOption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).OSDiskCreateOption = (string) content.GetValueForProperty("OSDiskCreateOption",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).OSDiskCreateOption, global::System.Convert.ToString); + } + if (content.Contains("OSDiskDeleteOption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).OSDiskDeleteOption = (string) content.GetValueForProperty("OSDiskDeleteOption",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).OSDiskDeleteOption, global::System.Convert.ToString); + } + if (content.Contains("OSDiskSizeGb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).OSDiskSizeGb = (long?) content.GetValueForProperty("OSDiskSizeGb",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal)this).OSDiskSizeGb, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + AfterDeserializePSObject(content); + } + } + /// VirtualMachine represents the on-premises Network Cloud virtual machine. + [System.ComponentModel.TypeConverter(typeof(VirtualMachineTypeConverter))] + public partial interface IVirtualMachine + + { + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VirtualMachine.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VirtualMachine.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VirtualMachine.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VirtualMachine.TypeConverter.cs index 0bf6eb966d69..80194444ac07 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VirtualMachine.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VirtualMachine.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IVirtualMachine ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachine ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachine).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachine).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VirtualMachine.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VirtualMachine.cs new file mode 100644 index 000000000000..42101f705c6b --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VirtualMachine.cs @@ -0,0 +1,1111 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + + /// VirtualMachine represents the on-premises Network Cloud virtual machine. + public partial class VirtualMachine : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachine, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResource __trackedResource = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.TrackedResource(); + + /// + /// The name of the administrator to which the ssh public keys will be added into the authorized keys. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string AdminUsername { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)Property).AdminUsername; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)Property).AdminUsername = value ?? null; } + + /// The cluster availability zone containing this virtual machine. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string AvailabilityZone { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)Property).AvailabilityZone; } + + /// The resource ID of the bare metal machine that hosts the virtual machine. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string BareMetalMachineId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)Property).BareMetalMachineId; } + + /// Selects the boot method for the virtual machine. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string BootMethod { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)Property).BootMethod; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)Property).BootMethod = value ?? null; } + + /// + /// The resource ID of the associated network attached to the virtual machine. + /// It can be one of cloudServicesNetwork, l3Network, l2Network or trunkedNetwork resources. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string CloudServiceNetworkAttachmentAttachedNetworkId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)Property).CloudServiceNetworkAttachmentAttachedNetworkId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)Property).CloudServiceNetworkAttachmentAttachedNetworkId = value ?? null; } + + /// + /// The indicator of whether this is the default gateway. + /// Only one of the attached networks (including the CloudServicesNetwork attachment) for a single machine may be specified + /// as True. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string CloudServiceNetworkAttachmentDefaultGateway { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)Property).CloudServiceNetworkAttachmentDefaultGateway; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)Property).CloudServiceNetworkAttachmentDefaultGateway = value ?? null; } + + /// + /// The IP allocation mechanism for the virtual machine. + /// Dynamic and Static are only valid for l3Network which may also specify Disabled. + /// Otherwise, Disabled is the only permitted value. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string CloudServiceNetworkAttachmentIPAllocationMethod { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)Property).CloudServiceNetworkAttachmentIPAllocationMethod; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)Property).CloudServiceNetworkAttachmentIPAllocationMethod = value ?? null; } + + /// + /// The IPv4 address of the virtual machine. + /// This field is used only if the attached network has IPAllocationType of IPV4 or DualStack. + /// If IPAllocationMethod is: + /// Static - this field must contain a user specified IPv4 address from within the subnet specified in the attached network. + /// Dynamic - this field is read-only, but will be populated with an address from within the subnet specified in the attached + /// network. + /// Disabled - this field will be empty. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string CloudServiceNetworkAttachmentIpv4Address { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)Property).CloudServiceNetworkAttachmentIpv4Address; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)Property).CloudServiceNetworkAttachmentIpv4Address = value ?? null; } + + /// + /// The IPv6 address of the virtual machine. + /// This field is used only if the attached network has IPAllocationType of IPV6 or DualStack. + /// If IPAllocationMethod is: + /// Static - this field must contain an IPv6 address range from within the range specified in the attached network. + /// Dynamic - this field is read-only, but will be populated with an range from within the subnet specified in the attached + /// network. + /// Disabled - this field will be empty. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string CloudServiceNetworkAttachmentIpv6Address { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)Property).CloudServiceNetworkAttachmentIpv6Address; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)Property).CloudServiceNetworkAttachmentIpv6Address = value ?? null; } + + /// + /// The MAC address of the interface for the virtual machine that corresponds to this network attachment. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string CloudServiceNetworkAttachmentMacAddress { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)Property).CloudServiceNetworkAttachmentMacAddress; } + + /// + /// The associated network's interface name. + /// If specified, the network attachment name has a maximum length of 15 characters and must be unique to this virtual machine. + /// If the user doesn’t specify this value, the default interface name of the network resource will be used. + /// For a CloudServicesNetwork resource, this name will be ignored. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string CloudServiceNetworkAttachmentName { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)Property).CloudServiceNetworkAttachmentName; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)Property).CloudServiceNetworkAttachmentName = value ?? null; } + + /// The resource ID of the cluster the virtual machine is created for. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string ClusterId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)Property).ClusterId; } + + /// The resource ID of the extended location on which the resource will be created. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string ConsoleExtendedLocationName { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)Property).ConsoleExtendedLocationName; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)Property).ConsoleExtendedLocationName = value ?? null; } + + /// The extended location type, for example, CustomLocation. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string ConsoleExtendedLocationType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)Property).ConsoleExtendedLocationType; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)Property).ConsoleExtendedLocationType = value ?? null; } + + /// The number of CPU cores in the virtual machine. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public long? CpuCore { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)Property).CpuCore; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)Property).CpuCore = value ?? default(long); } + + /// The more detailed status of the virtual machine. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string DetailedStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)Property).DetailedStatus; } + + /// The descriptive message about the current detailed status. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string DetailedStatusMessage { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)Property).DetailedStatusMessage; } + + /// Backing field for property. + private string _etag; + + /// Resource ETag. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string Etag { get => this._etag; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocation _extendedLocation; + + /// The extended location of the cluster associated with the resource. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocation ExtendedLocation { get => (this._extendedLocation = this._extendedLocation ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ExtendedLocation()); set => this._extendedLocation = value; } + + /// The resource ID of the extended location on which the resource will be created. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string ExtendedLocationName { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocationInternal)ExtendedLocation).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocationInternal)ExtendedLocation).Name = value ?? null; } + + /// The extended location type, for example, CustomLocation. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string ExtendedLocationType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocationInternal)ExtendedLocation).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocationInternal)ExtendedLocation).Type = value ?? null; } + + /// + /// Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).Id; } + + /// + /// Field Deprecated, the value will be ignored if provided. The indicator of whether one of the specified CPU cores is isolated + /// to run the emulator thread for this virtual machine. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string IsolateEmulatorThread { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)Property).IsolateEmulatorThread; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)Property).IsolateEmulatorThread = value ?? null; } + + /// The geo-location where the resource lives + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)__trackedResource).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)__trackedResource).Location = value ?? null; } + + /// The memory size of the virtual machine. Allocations are measured in gibibytes. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public long? MemorySizeGb { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)Property).MemorySizeGb; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)Property).MemorySizeGb = value ?? default(long); } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).Id = value ?? null; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).Name = value ?? null; } + + /// Internal Acessors for SystemData + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISystemData Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemData; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemData = value ?? null /* model class */; } + + /// Internal Acessors for SystemDataCreatedAt + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataCreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataCreatedAt = value ?? default(global::System.DateTime); } + + /// Internal Acessors for SystemDataCreatedBy + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataCreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataCreatedBy = value ?? null; } + + /// Internal Acessors for SystemDataCreatedByType + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataCreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataCreatedByType = value ?? null; } + + /// Internal Acessors for SystemDataLastModifiedAt + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedAt = value ?? default(global::System.DateTime); } + + /// Internal Acessors for SystemDataLastModifiedBy + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedBy = value ?? null; } + + /// Internal Acessors for SystemDataLastModifiedByType + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedByType = value ?? null; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).Type = value ?? null; } + + /// Internal Acessors for AvailabilityZone + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal.AvailabilityZone { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)Property).AvailabilityZone; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)Property).AvailabilityZone = value ?? null; } + + /// Internal Acessors for BareMetalMachineId + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal.BareMetalMachineId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)Property).BareMetalMachineId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)Property).BareMetalMachineId = value ?? null; } + + /// Internal Acessors for CloudServiceNetworkAttachmentMacAddress + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal.CloudServiceNetworkAttachmentMacAddress { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)Property).CloudServiceNetworkAttachmentMacAddress; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)Property).CloudServiceNetworkAttachmentMacAddress = value ?? null; } + + /// Internal Acessors for CloudServicesNetworkAttachment + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkAttachment Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal.CloudServicesNetworkAttachment { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)Property).CloudServicesNetworkAttachment; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)Property).CloudServicesNetworkAttachment = value ?? null /* model class */; } + + /// Internal Acessors for ClusterId + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal.ClusterId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)Property).ClusterId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)Property).ClusterId = value ?? null; } + + /// Internal Acessors for ConsoleExtendedLocation + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocation Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal.ConsoleExtendedLocation { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)Property).ConsoleExtendedLocation; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)Property).ConsoleExtendedLocation = value ?? null /* model class */; } + + /// Internal Acessors for DetailedStatus + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal.DetailedStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)Property).DetailedStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)Property).DetailedStatus = value ?? null; } + + /// Internal Acessors for DetailedStatusMessage + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal.DetailedStatusMessage { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)Property).DetailedStatusMessage; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)Property).DetailedStatusMessage = value ?? null; } + + /// Internal Acessors for Etag + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal.Etag { get => this._etag; set { {_etag = value;} } } + + /// Internal Acessors for ExtendedLocation + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocation Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal.ExtendedLocation { get => (this._extendedLocation = this._extendedLocation ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ExtendedLocation()); set { {_extendedLocation = value;} } } + + /// Internal Acessors for PowerState + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal.PowerState { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)Property).PowerState; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)Property).PowerState = value ?? null; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineProperties Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.VirtualMachineProperties()); set { {_property = value;} } } + + /// Internal Acessors for ProvisioningState + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)Property).ProvisioningState = value ?? null; } + + /// Internal Acessors for StorageProfile + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageProfile Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal.StorageProfile { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)Property).StorageProfile; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)Property).StorageProfile = value ?? null /* model class */; } + + /// Internal Acessors for StorageProfileOSDisk + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOSDisk Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal.StorageProfileOSDisk { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)Property).StorageProfileOSDisk; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)Property).StorageProfileOSDisk = value ?? null /* model class */; } + + /// Internal Acessors for VMImageRepositoryCredentials + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IImageRepositoryCredentials Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal.VMImageRepositoryCredentials { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)Property).VMImageRepositoryCredentials; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)Property).VMImageRepositoryCredentials = value ?? null /* model class */; } + + /// Internal Acessors for Volume + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineInternal.Volume { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)Property).Volume; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)Property).Volume = value ?? null /* arrayOf */; } + + /// The name of the resource + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).Name; } + + /// The list of network attachments to the virtual machine. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public System.Collections.Generic.List NetworkAttachment { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)Property).NetworkAttachment; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)Property).NetworkAttachment = value ?? null /* arrayOf */; } + + /// The Base64 encoded cloud-init network data. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string NetworkData { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)Property).NetworkData; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)Property).NetworkData = value ?? null; } + + /// The strategy for creating the OS disk. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string OSDiskCreateOption { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)Property).OSDiskCreateOption; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)Property).OSDiskCreateOption = value ?? null; } + + /// The strategy for deleting the OS disk. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string OSDiskDeleteOption { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)Property).OSDiskDeleteOption; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)Property).OSDiskDeleteOption = value ?? null; } + + /// + /// The size of the disk. Required if the createOption is Ephemeral. Allocations are measured in gibibytes. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public long? OSDiskSizeGb { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)Property).OSDiskSizeGb; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)Property).OSDiskSizeGb = value ?? default(long); } + + /// The scheduling hints for the virtual machine. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public System.Collections.Generic.List PlacementHint { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)Property).PlacementHint; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)Property).PlacementHint = value ?? null /* arrayOf */; } + + /// The power state of the virtual machine. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string PowerState { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)Property).PowerState; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineProperties _property; + + /// The list of the resource properties. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.VirtualMachineProperties()); set => this._property = value; } + + /// The provisioning state of the virtual machine. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)Property).ProvisioningState; } + + /// Gets the resource group name + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string ResourceGroupName { get => (new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Success ? new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Groups["resourceGroupName"].Value : null); } + + /// + /// The list of ssh public keys. Each key will be added to the virtual machine using the cloud-init ssh_authorized_keys mechanism + /// for the adminUsername. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public System.Collections.Generic.List SshPublicKey { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)Property).SshPublicKey; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)Property).SshPublicKey = value ?? null /* arrayOf */; } + + /// + /// The resource IDs of volumes that are requested to be attached to the virtual machine. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public System.Collections.Generic.List StorageProfileVolumeAttachment { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)Property).StorageProfileVolumeAttachment; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)Property).StorageProfileVolumeAttachment = value ?? null /* arrayOf */; } + + /// + /// Azure Resource Manager metadata containing createdBy and modifiedBy information. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISystemData SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemData; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemData = value ?? null /* model class */; } + + /// The timestamp of resource creation (UTC). + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataCreatedAt; } + + /// The identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataCreatedBy; } + + /// The type of identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public string SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataCreatedByType; } + + /// The timestamp of resource last modification (UTC) + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedAt; } + + /// The identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedBy; } + + /// The type of identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public string SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedByType; } + + /// Resource tags. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)__trackedResource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).Type; } + + /// The Base64 encoded cloud-init user data. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string UserData { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)Property).UserData; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)Property).UserData = value ?? null; } + + /// The type of the device model to use. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string VMDeviceModel { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)Property).VMDeviceModel; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)Property).VMDeviceModel = value ?? null; } + + /// + /// The virtual machine image that is currently provisioned to the OS disk, using the full url and tag notation used to pull + /// the image. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string VMImage { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)Property).VMImage; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)Property).VMImage = value ?? null; } + + /// The password or token used to access an image in the target repository. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public System.Security.SecureString VMImageRepositoryCredentialsPassword { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)Property).VMImageRepositoryCredentialsPassword; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)Property).VMImageRepositoryCredentialsPassword = value ?? null; } + + /// + /// The URL of the authentication server used to validate the repository credentials. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string VMImageRepositoryCredentialsRegistryUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)Property).VMImageRepositoryCredentialsRegistryUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)Property).VMImageRepositoryCredentialsRegistryUrl = value ?? null; } + + /// The username used to access an image in the target repository. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string VMImageRepositoryCredentialsUsername { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)Property).VMImageRepositoryCredentialsUsername; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)Property).VMImageRepositoryCredentialsUsername = value ?? null; } + + /// + /// Field Deprecated, use virtualizationModel instead. The type of the virtio interface. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string VirtioInterface { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)Property).VirtioInterface; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)Property).VirtioInterface = value ?? null; } + + /// The resource IDs of volumes that are attached to the virtual machine. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public System.Collections.Generic.List Volume { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)Property).Volume; } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__trackedResource), __trackedResource); + await eventListener.AssertObjectIsValid(nameof(__trackedResource), __trackedResource); + } + + /// Creates an new instance. + public VirtualMachine() + { + + } + } + /// VirtualMachine represents the on-premises Network Cloud virtual machine. + public partial interface IVirtualMachine : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResource + { + /// + /// The name of the administrator to which the ssh public keys will be added into the authorized keys. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The name of the administrator to which the ssh public keys will be added into the authorized keys.", + SerializedName = @"adminUsername", + PossibleTypes = new [] { typeof(string) })] + string AdminUsername { get; set; } + /// The cluster availability zone containing this virtual machine. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The cluster availability zone containing this virtual machine.", + SerializedName = @"availabilityZone", + PossibleTypes = new [] { typeof(string) })] + string AvailabilityZone { get; } + /// The resource ID of the bare metal machine that hosts the virtual machine. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The resource ID of the bare metal machine that hosts the virtual machine.", + SerializedName = @"bareMetalMachineId", + PossibleTypes = new [] { typeof(string) })] + string BareMetalMachineId { get; } + /// Selects the boot method for the virtual machine. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"Selects the boot method for the virtual machine.", + SerializedName = @"bootMethod", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("UEFI", "BIOS")] + string BootMethod { get; set; } + /// + /// The resource ID of the associated network attached to the virtual machine. + /// It can be one of cloudServicesNetwork, l3Network, l2Network or trunkedNetwork resources. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The resource ID of the associated network attached to the virtual machine. + It can be one of cloudServicesNetwork, l3Network, l2Network or trunkedNetwork resources.", + SerializedName = @"attachedNetworkId", + PossibleTypes = new [] { typeof(string) })] + string CloudServiceNetworkAttachmentAttachedNetworkId { get; set; } + /// + /// The indicator of whether this is the default gateway. + /// Only one of the attached networks (including the CloudServicesNetwork attachment) for a single machine may be specified + /// as True. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The indicator of whether this is the default gateway. + Only one of the attached networks (including the CloudServicesNetwork attachment) for a single machine may be specified as True.", + SerializedName = @"defaultGateway", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("True", "False")] + string CloudServiceNetworkAttachmentDefaultGateway { get; set; } + /// + /// The IP allocation mechanism for the virtual machine. + /// Dynamic and Static are only valid for l3Network which may also specify Disabled. + /// Otherwise, Disabled is the only permitted value. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The IP allocation mechanism for the virtual machine. + Dynamic and Static are only valid for l3Network which may also specify Disabled. + Otherwise, Disabled is the only permitted value.", + SerializedName = @"ipAllocationMethod", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Dynamic", "Static", "Disabled")] + string CloudServiceNetworkAttachmentIPAllocationMethod { get; set; } + /// + /// The IPv4 address of the virtual machine. + /// This field is used only if the attached network has IPAllocationType of IPV4 or DualStack. + /// If IPAllocationMethod is: + /// Static - this field must contain a user specified IPv4 address from within the subnet specified in the attached network. + /// Dynamic - this field is read-only, but will be populated with an address from within the subnet specified in the attached + /// network. + /// Disabled - this field will be empty. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The IPv4 address of the virtual machine. + + This field is used only if the attached network has IPAllocationType of IPV4 or DualStack. + + If IPAllocationMethod is: + Static - this field must contain a user specified IPv4 address from within the subnet specified in the attached network. + Dynamic - this field is read-only, but will be populated with an address from within the subnet specified in the attached network. + Disabled - this field will be empty.", + SerializedName = @"ipv4Address", + PossibleTypes = new [] { typeof(string) })] + string CloudServiceNetworkAttachmentIpv4Address { get; set; } + /// + /// The IPv6 address of the virtual machine. + /// This field is used only if the attached network has IPAllocationType of IPV6 or DualStack. + /// If IPAllocationMethod is: + /// Static - this field must contain an IPv6 address range from within the range specified in the attached network. + /// Dynamic - this field is read-only, but will be populated with an range from within the subnet specified in the attached + /// network. + /// Disabled - this field will be empty. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The IPv6 address of the virtual machine. + + This field is used only if the attached network has IPAllocationType of IPV6 or DualStack. + + If IPAllocationMethod is: + Static - this field must contain an IPv6 address range from within the range specified in the attached network. + Dynamic - this field is read-only, but will be populated with an range from within the subnet specified in the attached network. + Disabled - this field will be empty.", + SerializedName = @"ipv6Address", + PossibleTypes = new [] { typeof(string) })] + string CloudServiceNetworkAttachmentIpv6Address { get; set; } + /// + /// The MAC address of the interface for the virtual machine that corresponds to this network attachment. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The MAC address of the interface for the virtual machine that corresponds to this network attachment.", + SerializedName = @"macAddress", + PossibleTypes = new [] { typeof(string) })] + string CloudServiceNetworkAttachmentMacAddress { get; } + /// + /// The associated network's interface name. + /// If specified, the network attachment name has a maximum length of 15 characters and must be unique to this virtual machine. + /// If the user doesn’t specify this value, the default interface name of the network resource will be used. + /// For a CloudServicesNetwork resource, this name will be ignored. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The associated network's interface name. + If specified, the network attachment name has a maximum length of 15 characters and must be unique to this virtual machine. + If the user doesn’t specify this value, the default interface name of the network resource will be used. + For a CloudServicesNetwork resource, this name will be ignored.", + SerializedName = @"networkAttachmentName", + PossibleTypes = new [] { typeof(string) })] + string CloudServiceNetworkAttachmentName { get; set; } + /// The resource ID of the cluster the virtual machine is created for. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The resource ID of the cluster the virtual machine is created for.", + SerializedName = @"clusterId", + PossibleTypes = new [] { typeof(string) })] + string ClusterId { get; } + /// The resource ID of the extended location on which the resource will be created. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The resource ID of the extended location on which the resource will be created.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string ConsoleExtendedLocationName { get; set; } + /// The extended location type, for example, CustomLocation. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The extended location type, for example, CustomLocation.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + string ConsoleExtendedLocationType { get; set; } + /// The number of CPU cores in the virtual machine. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The number of CPU cores in the virtual machine.", + SerializedName = @"cpuCores", + PossibleTypes = new [] { typeof(long) })] + long? CpuCore { get; set; } + /// The more detailed status of the virtual machine. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The more detailed status of the virtual machine.", + SerializedName = @"detailedStatus", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Available", "Error", "Provisioning", "Running", "Scheduling", "Stopped", "Terminating", "Unknown")] + string DetailedStatus { get; } + /// The descriptive message about the current detailed status. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The descriptive message about the current detailed status.", + SerializedName = @"detailedStatusMessage", + PossibleTypes = new [] { typeof(string) })] + string DetailedStatusMessage { get; } + /// Resource ETag. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"Resource ETag.", + SerializedName = @"etag", + PossibleTypes = new [] { typeof(string) })] + string Etag { get; } + /// The resource ID of the extended location on which the resource will be created. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The resource ID of the extended location on which the resource will be created.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string ExtendedLocationName { get; set; } + /// The extended location type, for example, CustomLocation. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The extended location type, for example, CustomLocation.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + string ExtendedLocationType { get; set; } + /// + /// Field Deprecated, the value will be ignored if provided. The indicator of whether one of the specified CPU cores is isolated + /// to run the emulator thread for this virtual machine. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"Field Deprecated, the value will be ignored if provided. The indicator of whether one of the specified CPU cores is isolated to run the emulator thread for this virtual machine.", + SerializedName = @"isolateEmulatorThread", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("True", "False")] + string IsolateEmulatorThread { get; set; } + /// The memory size of the virtual machine. Allocations are measured in gibibytes. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The memory size of the virtual machine. Allocations are measured in gibibytes.", + SerializedName = @"memorySizeGB", + PossibleTypes = new [] { typeof(long) })] + long? MemorySizeGb { get; set; } + /// The list of network attachments to the virtual machine. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The list of network attachments to the virtual machine.", + SerializedName = @"networkAttachments", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkAttachment) })] + System.Collections.Generic.List NetworkAttachment { get; set; } + /// The Base64 encoded cloud-init network data. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The Base64 encoded cloud-init network data.", + SerializedName = @"networkData", + PossibleTypes = new [] { typeof(string) })] + string NetworkData { get; set; } + /// The strategy for creating the OS disk. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The strategy for creating the OS disk.", + SerializedName = @"createOption", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Ephemeral", "Persistent")] + string OSDiskCreateOption { get; set; } + /// The strategy for deleting the OS disk. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The strategy for deleting the OS disk.", + SerializedName = @"deleteOption", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Delete")] + string OSDiskDeleteOption { get; set; } + /// + /// The size of the disk. Required if the createOption is Ephemeral. Allocations are measured in gibibytes. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The size of the disk. Required if the createOption is Ephemeral. Allocations are measured in gibibytes.", + SerializedName = @"diskSizeGB", + PossibleTypes = new [] { typeof(long) })] + long? OSDiskSizeGb { get; set; } + /// The scheduling hints for the virtual machine. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The scheduling hints for the virtual machine.", + SerializedName = @"placementHints", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePlacementHint) })] + System.Collections.Generic.List PlacementHint { get; set; } + /// The power state of the virtual machine. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The power state of the virtual machine.", + SerializedName = @"powerState", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("On", "Off", "Unknown")] + string PowerState { get; } + /// The provisioning state of the virtual machine. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The provisioning state of the virtual machine.", + SerializedName = @"provisioningState", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Succeeded", "Failed", "Canceled", "Provisioning", "Accepted")] + string ProvisioningState { get; } + /// + /// The list of ssh public keys. Each key will be added to the virtual machine using the cloud-init ssh_authorized_keys mechanism + /// for the adminUsername. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The list of ssh public keys. Each key will be added to the virtual machine using the cloud-init ssh_authorized_keys mechanism for the adminUsername.", + SerializedName = @"sshPublicKeys", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISshPublicKey) })] + System.Collections.Generic.List SshPublicKey { get; set; } + /// + /// The resource IDs of volumes that are requested to be attached to the virtual machine. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The resource IDs of volumes that are requested to be attached to the virtual machine.", + SerializedName = @"volumeAttachments", + PossibleTypes = new [] { typeof(string) })] + System.Collections.Generic.List StorageProfileVolumeAttachment { get; set; } + /// The Base64 encoded cloud-init user data. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The Base64 encoded cloud-init user data.", + SerializedName = @"userData", + PossibleTypes = new [] { typeof(string) })] + string UserData { get; set; } + /// The type of the device model to use. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The type of the device model to use.", + SerializedName = @"vmDeviceModel", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("T1", "T2", "T3")] + string VMDeviceModel { get; set; } + /// + /// The virtual machine image that is currently provisioned to the OS disk, using the full url and tag notation used to pull + /// the image. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The virtual machine image that is currently provisioned to the OS disk, using the full url and tag notation used to pull the image.", + SerializedName = @"vmImage", + PossibleTypes = new [] { typeof(string) })] + string VMImage { get; set; } + /// The password or token used to access an image in the target repository. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The password or token used to access an image in the target repository.", + SerializedName = @"password", + PossibleTypes = new [] { typeof(System.Security.SecureString) })] + System.Security.SecureString VMImageRepositoryCredentialsPassword { get; set; } + /// + /// The URL of the authentication server used to validate the repository credentials. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The URL of the authentication server used to validate the repository credentials.", + SerializedName = @"registryUrl", + PossibleTypes = new [] { typeof(string) })] + string VMImageRepositoryCredentialsRegistryUrl { get; set; } + /// The username used to access an image in the target repository. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The username used to access an image in the target repository.", + SerializedName = @"username", + PossibleTypes = new [] { typeof(string) })] + string VMImageRepositoryCredentialsUsername { get; set; } + /// + /// Field Deprecated, use virtualizationModel instead. The type of the virtio interface. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"Field Deprecated, use virtualizationModel instead. The type of the virtio interface.", + SerializedName = @"virtioInterface", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Modern", "Transitional")] + string VirtioInterface { get; set; } + /// The resource IDs of volumes that are attached to the virtual machine. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The resource IDs of volumes that are attached to the virtual machine.", + SerializedName = @"volumes", + PossibleTypes = new [] { typeof(string) })] + System.Collections.Generic.List Volume { get; } + + } + /// VirtualMachine represents the on-premises Network Cloud virtual machine. + internal partial interface IVirtualMachineInternal : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal + { + /// + /// The name of the administrator to which the ssh public keys will be added into the authorized keys. + /// + string AdminUsername { get; set; } + /// The cluster availability zone containing this virtual machine. + string AvailabilityZone { get; set; } + /// The resource ID of the bare metal machine that hosts the virtual machine. + string BareMetalMachineId { get; set; } + /// Selects the boot method for the virtual machine. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("UEFI", "BIOS")] + string BootMethod { get; set; } + /// + /// The resource ID of the associated network attached to the virtual machine. + /// It can be one of cloudServicesNetwork, l3Network, l2Network or trunkedNetwork resources. + /// + string CloudServiceNetworkAttachmentAttachedNetworkId { get; set; } + /// + /// The indicator of whether this is the default gateway. + /// Only one of the attached networks (including the CloudServicesNetwork attachment) for a single machine may be specified + /// as True. + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("True", "False")] + string CloudServiceNetworkAttachmentDefaultGateway { get; set; } + /// + /// The IP allocation mechanism for the virtual machine. + /// Dynamic and Static are only valid for l3Network which may also specify Disabled. + /// Otherwise, Disabled is the only permitted value. + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Dynamic", "Static", "Disabled")] + string CloudServiceNetworkAttachmentIPAllocationMethod { get; set; } + /// + /// The IPv4 address of the virtual machine. + /// This field is used only if the attached network has IPAllocationType of IPV4 or DualStack. + /// If IPAllocationMethod is: + /// Static - this field must contain a user specified IPv4 address from within the subnet specified in the attached network. + /// Dynamic - this field is read-only, but will be populated with an address from within the subnet specified in the attached + /// network. + /// Disabled - this field will be empty. + /// + string CloudServiceNetworkAttachmentIpv4Address { get; set; } + /// + /// The IPv6 address of the virtual machine. + /// This field is used only if the attached network has IPAllocationType of IPV6 or DualStack. + /// If IPAllocationMethod is: + /// Static - this field must contain an IPv6 address range from within the range specified in the attached network. + /// Dynamic - this field is read-only, but will be populated with an range from within the subnet specified in the attached + /// network. + /// Disabled - this field will be empty. + /// + string CloudServiceNetworkAttachmentIpv6Address { get; set; } + /// + /// The MAC address of the interface for the virtual machine that corresponds to this network attachment. + /// + string CloudServiceNetworkAttachmentMacAddress { get; set; } + /// + /// The associated network's interface name. + /// If specified, the network attachment name has a maximum length of 15 characters and must be unique to this virtual machine. + /// If the user doesn’t specify this value, the default interface name of the network resource will be used. + /// For a CloudServicesNetwork resource, this name will be ignored. + /// + string CloudServiceNetworkAttachmentName { get; set; } + /// + /// The cloud service network that provides platform-level services for the virtual machine. + /// + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkAttachment CloudServicesNetworkAttachment { get; set; } + /// The resource ID of the cluster the virtual machine is created for. + string ClusterId { get; set; } + /// The extended location to use for creation of a VM console resource. + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocation ConsoleExtendedLocation { get; set; } + /// The resource ID of the extended location on which the resource will be created. + string ConsoleExtendedLocationName { get; set; } + /// The extended location type, for example, CustomLocation. + string ConsoleExtendedLocationType { get; set; } + /// The number of CPU cores in the virtual machine. + long? CpuCore { get; set; } + /// The more detailed status of the virtual machine. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Available", "Error", "Provisioning", "Running", "Scheduling", "Stopped", "Terminating", "Unknown")] + string DetailedStatus { get; set; } + /// The descriptive message about the current detailed status. + string DetailedStatusMessage { get; set; } + /// Resource ETag. + string Etag { get; set; } + /// The extended location of the cluster associated with the resource. + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocation ExtendedLocation { get; set; } + /// The resource ID of the extended location on which the resource will be created. + string ExtendedLocationName { get; set; } + /// The extended location type, for example, CustomLocation. + string ExtendedLocationType { get; set; } + /// + /// Field Deprecated, the value will be ignored if provided. The indicator of whether one of the specified CPU cores is isolated + /// to run the emulator thread for this virtual machine. + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("True", "False")] + string IsolateEmulatorThread { get; set; } + /// The memory size of the virtual machine. Allocations are measured in gibibytes. + long? MemorySizeGb { get; set; } + /// The list of network attachments to the virtual machine. + System.Collections.Generic.List NetworkAttachment { get; set; } + /// The Base64 encoded cloud-init network data. + string NetworkData { get; set; } + /// The strategy for creating the OS disk. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Ephemeral", "Persistent")] + string OSDiskCreateOption { get; set; } + /// The strategy for deleting the OS disk. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Delete")] + string OSDiskDeleteOption { get; set; } + /// + /// The size of the disk. Required if the createOption is Ephemeral. Allocations are measured in gibibytes. + /// + long? OSDiskSizeGb { get; set; } + /// The scheduling hints for the virtual machine. + System.Collections.Generic.List PlacementHint { get; set; } + /// The power state of the virtual machine. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("On", "Off", "Unknown")] + string PowerState { get; set; } + /// The list of the resource properties. + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineProperties Property { get; set; } + /// The provisioning state of the virtual machine. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Succeeded", "Failed", "Canceled", "Provisioning", "Accepted")] + string ProvisioningState { get; set; } + /// + /// The list of ssh public keys. Each key will be added to the virtual machine using the cloud-init ssh_authorized_keys mechanism + /// for the adminUsername. + /// + System.Collections.Generic.List SshPublicKey { get; set; } + /// + /// The storage profile that specifies size and other parameters about the disks related to the virtual machine. + /// + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageProfile StorageProfile { get; set; } + /// The disk to use with this virtual machine. + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOSDisk StorageProfileOSDisk { get; set; } + /// + /// The resource IDs of volumes that are requested to be attached to the virtual machine. + /// + System.Collections.Generic.List StorageProfileVolumeAttachment { get; set; } + /// The Base64 encoded cloud-init user data. + string UserData { get; set; } + /// The type of the device model to use. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("T1", "T2", "T3")] + string VMDeviceModel { get; set; } + /// + /// The virtual machine image that is currently provisioned to the OS disk, using the full url and tag notation used to pull + /// the image. + /// + string VMImage { get; set; } + /// + /// The credentials used to login to the image repository that has access to the specified image. + /// + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IImageRepositoryCredentials VMImageRepositoryCredentials { get; set; } + /// The password or token used to access an image in the target repository. + System.Security.SecureString VMImageRepositoryCredentialsPassword { get; set; } + /// + /// The URL of the authentication server used to validate the repository credentials. + /// + string VMImageRepositoryCredentialsRegistryUrl { get; set; } + /// The username used to access an image in the target repository. + string VMImageRepositoryCredentialsUsername { get; set; } + /// + /// Field Deprecated, use virtualizationModel instead. The type of the virtio interface. + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Modern", "Transitional")] + string VirtioInterface { get; set; } + /// The resource IDs of volumes that are attached to the virtual machine. + System.Collections.Generic.List Volume { get; set; } + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VirtualMachine.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VirtualMachine.json.cs similarity index 91% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VirtualMachine.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VirtualMachine.json.cs index e3252a2604c3..5351d40694ad 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VirtualMachine.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VirtualMachine.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class VirtualMachine partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachine. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachine. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachine. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachine. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachine FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachine FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new VirtualMachine(json) : null; } @@ -87,7 +87,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode ToJ __trackedResource?.ToJson(container, serializationMode); AddIf( null != this._extendedLocation ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) this._extendedLocation.ToJson(null,serializationMode) : null, "extendedLocation" ,container.Add ); AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._etag)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._etag.ToString()) : null, "etag" ,container.Add ); } @@ -107,10 +107,10 @@ internal VirtualMachine(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime. { return; } - __trackedResource = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.TrackedResource(json); - {_extendedLocation = If( json?.PropertyT("extendedLocation"), out var __jsonExtendedLocation) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ExtendedLocation.FromJson(__jsonExtendedLocation) : ExtendedLocation;} - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.VirtualMachineProperties.FromJson(__jsonProperties) : Property;} - {_etag = If( json?.PropertyT("etag"), out var __jsonEtag) ? (string)__jsonEtag : (string)Etag;} + __trackedResource = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.TrackedResource(json); + {_extendedLocation = If( json?.PropertyT("extendedLocation"), out var __jsonExtendedLocation) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ExtendedLocation.FromJson(__jsonExtendedLocation) : _extendedLocation;} + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.VirtualMachineProperties.FromJson(__jsonProperties) : _property;} + {_etag = If( json?.PropertyT("etag"), out var __jsonEtag) ? (string)__jsonEtag : (string)_etag;} AfterFromJson(json); } } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VirtualMachineList.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VirtualMachineList.PowerShell.cs similarity index 76% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VirtualMachineList.PowerShell.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VirtualMachineList.PowerShell.cs index 829c43615dc4..13d06ba96551 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VirtualMachineList.PowerShell.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VirtualMachineList.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; @@ -63,27 +63,27 @@ public partial class VirtualMachineList 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.NetworkCloud.Models.Api20250201.IVirtualMachineList DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineList DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new VirtualMachineList(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.NetworkCloud.Models.Api20250201.IVirtualMachineList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new VirtualMachineList(content); } @@ -93,7 +93,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 VirtualMachineList(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineListInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineListInternal)this).NextLink, global::System.Convert.ToString); } if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachine[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.VirtualMachineTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineListInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineListInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.VirtualMachineTypeConverter.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. @@ -153,11 +153,11 @@ internal VirtualMachineList(global::System.Management.Automation.PSObject conten // actually deserialize if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineListInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineListInternal)this).NextLink, global::System.Convert.ToString); } if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachine[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.VirtualMachineTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineListInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineListInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.VirtualMachineTypeConverter.ConvertFrom)); } AfterDeserializePSObject(content); } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VirtualMachineList.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VirtualMachineList.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VirtualMachineList.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VirtualMachineList.TypeConverter.cs index 2b8994d87f1a..673d7853cfd4 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VirtualMachineList.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VirtualMachineList.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IVirtualMachineList ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineList ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineList).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineList).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VirtualMachineList.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VirtualMachineList.cs new file mode 100644 index 000000000000..4f5653f61174 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VirtualMachineList.cs @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + + /// VirtualMachineList represents a list of virtual machines. + public partial class VirtualMachineList : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineList, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineListInternal + { + + /// Backing field for property. + private string _nextLink; + + /// The link used to get the next page of operations. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; set => this._nextLink = value; } + + /// Backing field for property. + private System.Collections.Generic.List _value; + + /// The list of virtual machines. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public System.Collections.Generic.List Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public VirtualMachineList() + { + + } + } + /// VirtualMachineList represents a list of virtual machines. + public partial interface IVirtualMachineList : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable + { + /// The link used to get the next page of operations. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The link used to get the next page of operations.", + SerializedName = @"nextLink", + PossibleTypes = new [] { typeof(string) })] + string NextLink { get; set; } + /// The list of virtual machines. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The list of virtual machines.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachine) })] + System.Collections.Generic.List Value { get; set; } + + } + /// VirtualMachineList represents a list of virtual machines. + internal partial interface IVirtualMachineListInternal + + { + /// The link used to get the next page of operations. + string NextLink { get; set; } + /// The list of virtual machines. + System.Collections.Generic.List Value { get; set; } + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VirtualMachineList.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VirtualMachineList.json.cs similarity index 90% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VirtualMachineList.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VirtualMachineList.json.cs index e4b1e24d1863..4bb987b4f3df 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VirtualMachineList.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VirtualMachineList.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class VirtualMachineList partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineList. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineList. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineList. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineList. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineList FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineList FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new VirtualMachineList(json) : null; } @@ -110,8 +110,8 @@ internal VirtualMachineList(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runt { return; } - {_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.NetworkCloud.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.NetworkCloud.Models.Api20250201.IVirtualMachine) (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.VirtualMachine.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.NetworkCloud.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.NetworkCloud.Models.IVirtualMachine) (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.VirtualMachine.FromJson(__u) )) ))() : null : _value;} AfterFromJson(json); } } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VirtualMachinePatchParameters.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VirtualMachinePatchParameters.PowerShell.cs new file mode 100644 index 000000000000..80927cc5ac0f --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VirtualMachinePatchParameters.PowerShell.cs @@ -0,0 +1,206 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + + /// + /// VirtualMachinePatchParameters represents the body of the request to patch the virtual machine. + /// + [System.ComponentModel.TypeConverter(typeof(VirtualMachinePatchParametersTypeConverter))] + public partial class VirtualMachinePatchParameters + { + + /// + /// 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.NetworkCloud.Models.IVirtualMachinePatchParameters DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new VirtualMachinePatchParameters(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.NetworkCloud.Models.IVirtualMachinePatchParameters DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new VirtualMachinePatchParameters(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.NetworkCloud.Models.IVirtualMachinePatchParameters FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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 VirtualMachinePatchParameters(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.NetworkCloud.Models.IVirtualMachinePatchParametersInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePatchProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePatchParametersInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.VirtualMachinePatchPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePatchParametersInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePatchParametersTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePatchParametersInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.VirtualMachinePatchParametersTagsTypeConverter.ConvertFrom); + } + if (content.Contains("VMImageRepositoryCredentials")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePatchParametersInternal)this).VMImageRepositoryCredentials = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IImageRepositoryCredentials) content.GetValueForProperty("VMImageRepositoryCredentials",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePatchParametersInternal)this).VMImageRepositoryCredentials, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ImageRepositoryCredentialsTypeConverter.ConvertFrom); + } + if (content.Contains("VMImageRepositoryCredentialsPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePatchParametersInternal)this).VMImageRepositoryCredentialsPassword = (System.Security.SecureString) content.GetValueForProperty("VMImageRepositoryCredentialsPassword",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePatchParametersInternal)this).VMImageRepositoryCredentialsPassword, (object ss) => (System.Security.SecureString)ss); + } + if (content.Contains("VMImageRepositoryCredentialsRegistryUrl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePatchParametersInternal)this).VMImageRepositoryCredentialsRegistryUrl = (string) content.GetValueForProperty("VMImageRepositoryCredentialsRegistryUrl",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePatchParametersInternal)this).VMImageRepositoryCredentialsRegistryUrl, global::System.Convert.ToString); + } + if (content.Contains("VMImageRepositoryCredentialsUsername")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePatchParametersInternal)this).VMImageRepositoryCredentialsUsername = (string) content.GetValueForProperty("VMImageRepositoryCredentialsUsername",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePatchParametersInternal)this).VMImageRepositoryCredentialsUsername, 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 VirtualMachinePatchParameters(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.NetworkCloud.Models.IVirtualMachinePatchParametersInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePatchProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePatchParametersInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.VirtualMachinePatchPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePatchParametersInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePatchParametersTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePatchParametersInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.VirtualMachinePatchParametersTagsTypeConverter.ConvertFrom); + } + if (content.Contains("VMImageRepositoryCredentials")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePatchParametersInternal)this).VMImageRepositoryCredentials = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IImageRepositoryCredentials) content.GetValueForProperty("VMImageRepositoryCredentials",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePatchParametersInternal)this).VMImageRepositoryCredentials, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ImageRepositoryCredentialsTypeConverter.ConvertFrom); + } + if (content.Contains("VMImageRepositoryCredentialsPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePatchParametersInternal)this).VMImageRepositoryCredentialsPassword = (System.Security.SecureString) content.GetValueForProperty("VMImageRepositoryCredentialsPassword",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePatchParametersInternal)this).VMImageRepositoryCredentialsPassword, (object ss) => (System.Security.SecureString)ss); + } + if (content.Contains("VMImageRepositoryCredentialsRegistryUrl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePatchParametersInternal)this).VMImageRepositoryCredentialsRegistryUrl = (string) content.GetValueForProperty("VMImageRepositoryCredentialsRegistryUrl",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePatchParametersInternal)this).VMImageRepositoryCredentialsRegistryUrl, global::System.Convert.ToString); + } + if (content.Contains("VMImageRepositoryCredentialsUsername")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePatchParametersInternal)this).VMImageRepositoryCredentialsUsername = (string) content.GetValueForProperty("VMImageRepositoryCredentialsUsername",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePatchParametersInternal)this).VMImageRepositoryCredentialsUsername, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + } + /// VirtualMachinePatchParameters represents the body of the request to patch the virtual machine. + [System.ComponentModel.TypeConverter(typeof(VirtualMachinePatchParametersTypeConverter))] + public partial interface IVirtualMachinePatchParameters + + { + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VirtualMachinePatchParameters.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VirtualMachinePatchParameters.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VirtualMachinePatchParameters.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VirtualMachinePatchParameters.TypeConverter.cs index 8f6b22aa9882..29413ea1665b 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VirtualMachinePatchParameters.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VirtualMachinePatchParameters.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IVirtualMachinePatchParameters ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePatchParameters ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePatchParameters).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePatchParameters).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VirtualMachinePatchParameters.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VirtualMachinePatchParameters.cs new file mode 100644 index 000000000000..cd01237e2b51 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VirtualMachinePatchParameters.cs @@ -0,0 +1,132 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + + /// + /// VirtualMachinePatchParameters represents the body of the request to patch the virtual machine. + /// + public partial class VirtualMachinePatchParameters : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePatchParameters, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePatchParametersInternal + { + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePatchProperties Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePatchParametersInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.VirtualMachinePatchProperties()); set { {_property = value;} } } + + /// Internal Acessors for VMImageRepositoryCredentials + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IImageRepositoryCredentials Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePatchParametersInternal.VMImageRepositoryCredentials { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePatchPropertiesInternal)Property).VMImageRepositoryCredentials; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePatchPropertiesInternal)Property).VMImageRepositoryCredentials = value ?? null /* model class */; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePatchProperties _property; + + /// The list of the resource properties. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePatchProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.VirtualMachinePatchProperties()); set => this._property = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePatchParametersTags _tag; + + /// The Azure resource tags that will replace the existing ones. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePatchParametersTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.VirtualMachinePatchParametersTags()); set => this._tag = value; } + + /// The password or token used to access an image in the target repository. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public System.Security.SecureString VMImageRepositoryCredentialsPassword { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePatchPropertiesInternal)Property).VMImageRepositoryCredentialsPassword; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePatchPropertiesInternal)Property).VMImageRepositoryCredentialsPassword = value ?? null; } + + /// + /// The URL of the authentication server used to validate the repository credentials. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string VMImageRepositoryCredentialsRegistryUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePatchPropertiesInternal)Property).VMImageRepositoryCredentialsRegistryUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePatchPropertiesInternal)Property).VMImageRepositoryCredentialsRegistryUrl = value ?? null; } + + /// The username used to access an image in the target repository. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string VMImageRepositoryCredentialsUsername { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePatchPropertiesInternal)Property).VMImageRepositoryCredentialsUsername; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePatchPropertiesInternal)Property).VMImageRepositoryCredentialsUsername = value ?? null; } + + /// Creates an new instance. + public VirtualMachinePatchParameters() + { + + } + } + /// VirtualMachinePatchParameters represents the body of the request to patch the virtual machine. + public partial interface IVirtualMachinePatchParameters : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable + { + /// The Azure resource tags that will replace the existing ones. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The Azure resource tags that will replace the existing ones.", + SerializedName = @"tags", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePatchParametersTags) })] + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePatchParametersTags Tag { get; set; } + /// The password or token used to access an image in the target repository. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The password or token used to access an image in the target repository.", + SerializedName = @"password", + PossibleTypes = new [] { typeof(System.Security.SecureString) })] + System.Security.SecureString VMImageRepositoryCredentialsPassword { get; set; } + /// + /// The URL of the authentication server used to validate the repository credentials. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The URL of the authentication server used to validate the repository credentials.", + SerializedName = @"registryUrl", + PossibleTypes = new [] { typeof(string) })] + string VMImageRepositoryCredentialsRegistryUrl { get; set; } + /// The username used to access an image in the target repository. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The username used to access an image in the target repository.", + SerializedName = @"username", + PossibleTypes = new [] { typeof(string) })] + string VMImageRepositoryCredentialsUsername { get; set; } + + } + /// VirtualMachinePatchParameters represents the body of the request to patch the virtual machine. + internal partial interface IVirtualMachinePatchParametersInternal + + { + /// The list of the resource properties. + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePatchProperties Property { get; set; } + /// The Azure resource tags that will replace the existing ones. + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePatchParametersTags Tag { get; set; } + /// + /// The credentials used to login to the image repository that has access to the specified image. + /// + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IImageRepositoryCredentials VMImageRepositoryCredentials { get; set; } + /// The password or token used to access an image in the target repository. + System.Security.SecureString VMImageRepositoryCredentialsPassword { get; set; } + /// + /// The URL of the authentication server used to validate the repository credentials. + /// + string VMImageRepositoryCredentialsRegistryUrl { get; set; } + /// The username used to access an image in the target repository. + string VMImageRepositoryCredentialsUsername { get; set; } + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VirtualMachinePatchParameters.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VirtualMachinePatchParameters.json.cs similarity index 93% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VirtualMachinePatchParameters.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VirtualMachinePatchParameters.json.cs index 78d3f7426a67..75041ed674df 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VirtualMachinePatchParameters.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VirtualMachinePatchParameters.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -56,13 +56,13 @@ public partial class VirtualMachinePatchParameters partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePatchParameters. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePatchParameters. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePatchParameters. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePatchParameters. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePatchParameters FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePatchParameters FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new VirtualMachinePatchParameters(json) : null; } @@ -104,8 +104,8 @@ internal VirtualMachinePatchParameters(Microsoft.Azure.PowerShell.Cmdlets.Networ { return; } - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.VirtualMachinePatchProperties.FromJson(__jsonProperties) : Property;} - {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.VirtualMachinePatchParametersTags.FromJson(__jsonTags) : Tag;} + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.VirtualMachinePatchProperties.FromJson(__jsonProperties) : _property;} + {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.VirtualMachinePatchParametersTags.FromJson(__jsonTags) : _tag;} AfterFromJson(json); } } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VirtualMachinePatchParametersTags.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VirtualMachinePatchParametersTags.PowerShell.cs similarity index 88% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VirtualMachinePatchParametersTags.PowerShell.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VirtualMachinePatchParametersTags.PowerShell.cs index 7afb6ad1d288..2ec2c9e60101 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VirtualMachinePatchParametersTags.PowerShell.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VirtualMachinePatchParametersTags.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; @@ -63,29 +63,27 @@ public partial class VirtualMachinePatchParametersTags 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.NetworkCloud.Models.Api20250201.IVirtualMachinePatchParametersTags DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePatchParametersTags DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new VirtualMachinePatchParametersTags(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.NetworkCloud.Models.Api20250201.IVirtualMachinePatchParametersTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePatchParametersTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new VirtualMachinePatchParametersTags(content); } @@ -97,7 +95,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201 /// /// an instance of the model class. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePatchParametersTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePatchParametersTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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. @@ -136,7 +134,7 @@ internal VirtualMachinePatchParametersTags(global::System.Collections.IDictionar } /// - /// 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/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VirtualMachinePatchParametersTags.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VirtualMachinePatchParametersTags.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VirtualMachinePatchParametersTags.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VirtualMachinePatchParametersTags.TypeConverter.cs index 09594cc3b2d3..c5b14210b03e 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VirtualMachinePatchParametersTags.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VirtualMachinePatchParametersTags.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IVirtualMachinePatchParametersTags ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePatchParametersTags ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePatchParametersTags).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePatchParametersTags).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VirtualMachinePatchParametersTags.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VirtualMachinePatchParametersTags.cs similarity index 84% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VirtualMachinePatchParametersTags.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VirtualMachinePatchParametersTags.cs index 3ff0049b430c..037eaccca848 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VirtualMachinePatchParametersTags.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VirtualMachinePatchParametersTags.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; /// The Azure resource tags that will replace the existing ones. public partial class VirtualMachinePatchParametersTags : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePatchParametersTags, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePatchParametersTagsInternal + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePatchParametersTags, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePatchParametersTagsInternal { /// Creates an new instance. diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VirtualMachinePatchParametersTags.dictionary.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VirtualMachinePatchParametersTags.dictionary.cs similarity index 96% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VirtualMachinePatchParametersTags.dictionary.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VirtualMachinePatchParametersTags.dictionary.cs index ce111d8866c5..097f5e33191b 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VirtualMachinePatchParametersTags.dictionary.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VirtualMachinePatchParametersTags.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.VirtualMachinePatchParametersTags source) => source.__additionalProperties; + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.VirtualMachinePatchParametersTags source) => source.__additionalProperties; } } \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VirtualMachinePatchParametersTags.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VirtualMachinePatchParametersTags.json.cs similarity index 95% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VirtualMachinePatchParametersTags.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VirtualMachinePatchParametersTags.json.cs index 42d847eebef5..459660c02f15 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VirtualMachinePatchParametersTags.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VirtualMachinePatchParametersTags.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class VirtualMachinePatchParametersTags partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePatchParametersTags. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePatchParametersTags. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePatchParametersTags. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePatchParametersTags. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePatchParametersTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePatchParametersTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new VirtualMachinePatchParametersTags(json) : null; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VirtualMachinePatchProperties.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VirtualMachinePatchProperties.PowerShell.cs new file mode 100644 index 000000000000..6e1cab097d15 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VirtualMachinePatchProperties.PowerShell.cs @@ -0,0 +1,190 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + + /// + /// VirtualMachinePatchProperties represents the properties of the virtual machine that can be patched. + /// + [System.ComponentModel.TypeConverter(typeof(VirtualMachinePatchPropertiesTypeConverter))] + public partial class VirtualMachinePatchProperties + { + + /// + /// 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.NetworkCloud.Models.IVirtualMachinePatchProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new VirtualMachinePatchProperties(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.NetworkCloud.Models.IVirtualMachinePatchProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new VirtualMachinePatchProperties(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.NetworkCloud.Models.IVirtualMachinePatchProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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 VirtualMachinePatchProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("VMImageRepositoryCredentials")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePatchPropertiesInternal)this).VMImageRepositoryCredentials = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IImageRepositoryCredentials) content.GetValueForProperty("VMImageRepositoryCredentials",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePatchPropertiesInternal)this).VMImageRepositoryCredentials, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ImageRepositoryCredentialsTypeConverter.ConvertFrom); + } + if (content.Contains("VMImageRepositoryCredentialsPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePatchPropertiesInternal)this).VMImageRepositoryCredentialsPassword = (System.Security.SecureString) content.GetValueForProperty("VMImageRepositoryCredentialsPassword",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePatchPropertiesInternal)this).VMImageRepositoryCredentialsPassword, (object ss) => (System.Security.SecureString)ss); + } + if (content.Contains("VMImageRepositoryCredentialsRegistryUrl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePatchPropertiesInternal)this).VMImageRepositoryCredentialsRegistryUrl = (string) content.GetValueForProperty("VMImageRepositoryCredentialsRegistryUrl",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePatchPropertiesInternal)this).VMImageRepositoryCredentialsRegistryUrl, global::System.Convert.ToString); + } + if (content.Contains("VMImageRepositoryCredentialsUsername")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePatchPropertiesInternal)this).VMImageRepositoryCredentialsUsername = (string) content.GetValueForProperty("VMImageRepositoryCredentialsUsername",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePatchPropertiesInternal)this).VMImageRepositoryCredentialsUsername, 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 VirtualMachinePatchProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("VMImageRepositoryCredentials")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePatchPropertiesInternal)this).VMImageRepositoryCredentials = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IImageRepositoryCredentials) content.GetValueForProperty("VMImageRepositoryCredentials",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePatchPropertiesInternal)this).VMImageRepositoryCredentials, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ImageRepositoryCredentialsTypeConverter.ConvertFrom); + } + if (content.Contains("VMImageRepositoryCredentialsPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePatchPropertiesInternal)this).VMImageRepositoryCredentialsPassword = (System.Security.SecureString) content.GetValueForProperty("VMImageRepositoryCredentialsPassword",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePatchPropertiesInternal)this).VMImageRepositoryCredentialsPassword, (object ss) => (System.Security.SecureString)ss); + } + if (content.Contains("VMImageRepositoryCredentialsRegistryUrl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePatchPropertiesInternal)this).VMImageRepositoryCredentialsRegistryUrl = (string) content.GetValueForProperty("VMImageRepositoryCredentialsRegistryUrl",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePatchPropertiesInternal)this).VMImageRepositoryCredentialsRegistryUrl, global::System.Convert.ToString); + } + if (content.Contains("VMImageRepositoryCredentialsUsername")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePatchPropertiesInternal)this).VMImageRepositoryCredentialsUsername = (string) content.GetValueForProperty("VMImageRepositoryCredentialsUsername",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePatchPropertiesInternal)this).VMImageRepositoryCredentialsUsername, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + } + /// VirtualMachinePatchProperties represents the properties of the virtual machine that can be patched. + [System.ComponentModel.TypeConverter(typeof(VirtualMachinePatchPropertiesTypeConverter))] + public partial interface IVirtualMachinePatchProperties + + { + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VirtualMachinePatchProperties.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VirtualMachinePatchProperties.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VirtualMachinePatchProperties.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VirtualMachinePatchProperties.TypeConverter.cs index c416cf431607..c8fd17fd186a 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VirtualMachinePatchProperties.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VirtualMachinePatchProperties.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IVirtualMachinePatchProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePatchProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePatchProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePatchProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VirtualMachinePatchProperties.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VirtualMachinePatchProperties.cs new file mode 100644 index 000000000000..3418abc55b53 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VirtualMachinePatchProperties.cs @@ -0,0 +1,109 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + + /// + /// VirtualMachinePatchProperties represents the properties of the virtual machine that can be patched. + /// + public partial class VirtualMachinePatchProperties : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePatchProperties, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePatchPropertiesInternal + { + + /// Internal Acessors for VMImageRepositoryCredentials + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IImageRepositoryCredentials Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePatchPropertiesInternal.VMImageRepositoryCredentials { get => (this._vMImageRepositoryCredentials = this._vMImageRepositoryCredentials ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ImageRepositoryCredentials()); set { {_vMImageRepositoryCredentials = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IImageRepositoryCredentials _vMImageRepositoryCredentials; + + /// + /// The credentials used to login to the image repository that has access to the specified image. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IImageRepositoryCredentials VMImageRepositoryCredentials { get => (this._vMImageRepositoryCredentials = this._vMImageRepositoryCredentials ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ImageRepositoryCredentials()); set => this._vMImageRepositoryCredentials = value; } + + /// The password or token used to access an image in the target repository. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public System.Security.SecureString VMImageRepositoryCredentialsPassword { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IImageRepositoryCredentialsInternal)VMImageRepositoryCredentials).Password; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IImageRepositoryCredentialsInternal)VMImageRepositoryCredentials).Password = value ?? null; } + + /// + /// The URL of the authentication server used to validate the repository credentials. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string VMImageRepositoryCredentialsRegistryUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IImageRepositoryCredentialsInternal)VMImageRepositoryCredentials).RegistryUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IImageRepositoryCredentialsInternal)VMImageRepositoryCredentials).RegistryUrl = value ?? null; } + + /// The username used to access an image in the target repository. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string VMImageRepositoryCredentialsUsername { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IImageRepositoryCredentialsInternal)VMImageRepositoryCredentials).Username; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IImageRepositoryCredentialsInternal)VMImageRepositoryCredentials).Username = value ?? null; } + + /// Creates an new instance. + public VirtualMachinePatchProperties() + { + + } + } + /// VirtualMachinePatchProperties represents the properties of the virtual machine that can be patched. + public partial interface IVirtualMachinePatchProperties : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable + { + /// The password or token used to access an image in the target repository. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The password or token used to access an image in the target repository.", + SerializedName = @"password", + PossibleTypes = new [] { typeof(System.Security.SecureString) })] + System.Security.SecureString VMImageRepositoryCredentialsPassword { get; set; } + /// + /// The URL of the authentication server used to validate the repository credentials. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The URL of the authentication server used to validate the repository credentials.", + SerializedName = @"registryUrl", + PossibleTypes = new [] { typeof(string) })] + string VMImageRepositoryCredentialsRegistryUrl { get; set; } + /// The username used to access an image in the target repository. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The username used to access an image in the target repository.", + SerializedName = @"username", + PossibleTypes = new [] { typeof(string) })] + string VMImageRepositoryCredentialsUsername { get; set; } + + } + /// VirtualMachinePatchProperties represents the properties of the virtual machine that can be patched. + internal partial interface IVirtualMachinePatchPropertiesInternal + + { + /// + /// The credentials used to login to the image repository that has access to the specified image. + /// + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IImageRepositoryCredentials VMImageRepositoryCredentials { get; set; } + /// The password or token used to access an image in the target repository. + System.Security.SecureString VMImageRepositoryCredentialsPassword { get; set; } + /// + /// The URL of the authentication server used to validate the repository credentials. + /// + string VMImageRepositoryCredentialsRegistryUrl { get; set; } + /// The username used to access an image in the target repository. + string VMImageRepositoryCredentialsUsername { get; set; } + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VirtualMachinePatchProperties.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VirtualMachinePatchProperties.json.cs similarity index 93% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VirtualMachinePatchProperties.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VirtualMachinePatchProperties.json.cs index 93c15063155a..f3cb5a8d7b9d 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VirtualMachinePatchProperties.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VirtualMachinePatchProperties.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -56,13 +56,13 @@ public partial class VirtualMachinePatchProperties partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePatchProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePatchProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePatchProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePatchProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePatchProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePatchProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new VirtualMachinePatchProperties(json) : null; } @@ -103,7 +103,7 @@ internal VirtualMachinePatchProperties(Microsoft.Azure.PowerShell.Cmdlets.Networ { return; } - {_vMImageRepositoryCredentials = If( json?.PropertyT("vmImageRepositoryCredentials"), out var __jsonVMImageRepositoryCredentials) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ImageRepositoryCredentials.FromJson(__jsonVMImageRepositoryCredentials) : VMImageRepositoryCredentials;} + {_vMImageRepositoryCredentials = If( json?.PropertyT("vmImageRepositoryCredentials"), out var __jsonVMImageRepositoryCredentials) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ImageRepositoryCredentials.FromJson(__jsonVMImageRepositoryCredentials) : _vMImageRepositoryCredentials;} AfterFromJson(json); } } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VirtualMachinePlacementHint.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VirtualMachinePlacementHint.PowerShell.cs new file mode 100644 index 000000000000..6c92b83ee4ab --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VirtualMachinePlacementHint.PowerShell.cs @@ -0,0 +1,190 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + + /// + /// VirtualMachinePlacementHint represents a single scheduling hint of the virtual machine. + /// + [System.ComponentModel.TypeConverter(typeof(VirtualMachinePlacementHintTypeConverter))] + public partial class VirtualMachinePlacementHint + { + + /// + /// 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.NetworkCloud.Models.IVirtualMachinePlacementHint DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new VirtualMachinePlacementHint(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.NetworkCloud.Models.IVirtualMachinePlacementHint DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new VirtualMachinePlacementHint(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.NetworkCloud.Models.IVirtualMachinePlacementHint FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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 VirtualMachinePlacementHint(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("HintType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePlacementHintInternal)this).HintType = (string) content.GetValueForProperty("HintType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePlacementHintInternal)this).HintType, global::System.Convert.ToString); + } + if (content.Contains("ResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePlacementHintInternal)this).ResourceId = (string) content.GetValueForProperty("ResourceId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePlacementHintInternal)this).ResourceId, global::System.Convert.ToString); + } + if (content.Contains("SchedulingExecution")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePlacementHintInternal)this).SchedulingExecution = (string) content.GetValueForProperty("SchedulingExecution",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePlacementHintInternal)this).SchedulingExecution, global::System.Convert.ToString); + } + if (content.Contains("Scope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePlacementHintInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePlacementHintInternal)this).Scope, 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 VirtualMachinePlacementHint(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("HintType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePlacementHintInternal)this).HintType = (string) content.GetValueForProperty("HintType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePlacementHintInternal)this).HintType, global::System.Convert.ToString); + } + if (content.Contains("ResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePlacementHintInternal)this).ResourceId = (string) content.GetValueForProperty("ResourceId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePlacementHintInternal)this).ResourceId, global::System.Convert.ToString); + } + if (content.Contains("SchedulingExecution")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePlacementHintInternal)this).SchedulingExecution = (string) content.GetValueForProperty("SchedulingExecution",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePlacementHintInternal)this).SchedulingExecution, global::System.Convert.ToString); + } + if (content.Contains("Scope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePlacementHintInternal)this).Scope = (string) content.GetValueForProperty("Scope",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePlacementHintInternal)this).Scope, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + } + /// VirtualMachinePlacementHint represents a single scheduling hint of the virtual machine. + [System.ComponentModel.TypeConverter(typeof(VirtualMachinePlacementHintTypeConverter))] + public partial interface IVirtualMachinePlacementHint + + { + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VirtualMachinePlacementHint.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VirtualMachinePlacementHint.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VirtualMachinePlacementHint.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VirtualMachinePlacementHint.TypeConverter.cs index 51d48f55a0e0..a02e407805b3 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VirtualMachinePlacementHint.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VirtualMachinePlacementHint.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IVirtualMachinePlacementHint ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePlacementHint ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePlacementHint).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePlacementHint).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VirtualMachinePlacementHint.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VirtualMachinePlacementHint.cs new file mode 100644 index 000000000000..2e6109fce23a --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VirtualMachinePlacementHint.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + + /// + /// VirtualMachinePlacementHint represents a single scheduling hint of the virtual machine. + /// + public partial class VirtualMachinePlacementHint : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePlacementHint, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePlacementHintInternal + { + + /// Backing field for property. + private string _hintType; + + /// + /// The specification of whether this hint supports affinity or anti-affinity with the referenced resources. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string HintType { get => this._hintType; set => this._hintType = value; } + + /// Backing field for property. + private string _resourceId; + + /// + /// The resource ID of the target object that the placement hints will be checked against, e.g., the bare metal node to host + /// the virtual machine. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string ResourceId { get => this._resourceId; set => this._resourceId = value; } + + /// Backing field for property. + private string _schedulingExecution; + + /// + /// The indicator of whether the hint is a hard or soft requirement during scheduling. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string SchedulingExecution { get => this._schedulingExecution; set => this._schedulingExecution = value; } + + /// Backing field for property. + private string _scope; + + /// + /// The scope for the virtual machine affinity or anti-affinity placement hint. It should always be "Machine" in the case + /// of node affinity. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string Scope { get => this._scope; set => this._scope = value; } + + /// Creates an new instance. + public VirtualMachinePlacementHint() + { + + } + } + /// VirtualMachinePlacementHint represents a single scheduling hint of the virtual machine. + public partial interface IVirtualMachinePlacementHint : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable + { + /// + /// The specification of whether this hint supports affinity or anti-affinity with the referenced resources. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The specification of whether this hint supports affinity or anti-affinity with the referenced resources.", + SerializedName = @"hintType", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Affinity", "AntiAffinity")] + string HintType { get; set; } + /// + /// The resource ID of the target object that the placement hints will be checked against, e.g., the bare metal node to host + /// the virtual machine. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The resource ID of the target object that the placement hints will be checked against, e.g., the bare metal node to host the virtual machine.", + SerializedName = @"resourceId", + PossibleTypes = new [] { typeof(string) })] + string ResourceId { get; set; } + /// + /// The indicator of whether the hint is a hard or soft requirement during scheduling. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The indicator of whether the hint is a hard or soft requirement during scheduling.", + SerializedName = @"schedulingExecution", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Hard", "Soft")] + string SchedulingExecution { get; set; } + /// + /// The scope for the virtual machine affinity or anti-affinity placement hint. It should always be "Machine" in the case + /// of node affinity. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The scope for the virtual machine affinity or anti-affinity placement hint. It should always be ""Machine"" in the case of node affinity.", + SerializedName = @"scope", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Rack", "Machine")] + string Scope { get; set; } + + } + /// VirtualMachinePlacementHint represents a single scheduling hint of the virtual machine. + internal partial interface IVirtualMachinePlacementHintInternal + + { + /// + /// The specification of whether this hint supports affinity or anti-affinity with the referenced resources. + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Affinity", "AntiAffinity")] + string HintType { get; set; } + /// + /// The resource ID of the target object that the placement hints will be checked against, e.g., the bare metal node to host + /// the virtual machine. + /// + string ResourceId { get; set; } + /// + /// The indicator of whether the hint is a hard or soft requirement during scheduling. + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Hard", "Soft")] + string SchedulingExecution { get; set; } + /// + /// The scope for the virtual machine affinity or anti-affinity placement hint. It should always be "Machine" in the case + /// of node affinity. + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Rack", "Machine")] + string Scope { get; set; } + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VirtualMachinePlacementHint.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VirtualMachinePlacementHint.json.cs similarity index 93% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VirtualMachinePlacementHint.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VirtualMachinePlacementHint.json.cs index 0c6bd4428046..6c132adc9b85 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VirtualMachinePlacementHint.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VirtualMachinePlacementHint.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -56,13 +56,13 @@ public partial class VirtualMachinePlacementHint partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePlacementHint. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePlacementHint. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePlacementHint. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePlacementHint. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePlacementHint FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePlacementHint FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new VirtualMachinePlacementHint(json) : null; } @@ -106,10 +106,10 @@ internal VirtualMachinePlacementHint(Microsoft.Azure.PowerShell.Cmdlets.NetworkC { return; } - {_hintType = If( json?.PropertyT("hintType"), out var __jsonHintType) ? (string)__jsonHintType : (string)HintType;} - {_resourceId = If( json?.PropertyT("resourceId"), out var __jsonResourceId) ? (string)__jsonResourceId : (string)ResourceId;} - {_schedulingExecution = If( json?.PropertyT("schedulingExecution"), out var __jsonSchedulingExecution) ? (string)__jsonSchedulingExecution : (string)SchedulingExecution;} - {_scope = If( json?.PropertyT("scope"), out var __jsonScope) ? (string)__jsonScope : (string)Scope;} + {_hintType = If( json?.PropertyT("hintType"), out var __jsonHintType) ? (string)__jsonHintType : (string)_hintType;} + {_resourceId = If( json?.PropertyT("resourceId"), out var __jsonResourceId) ? (string)__jsonResourceId : (string)_resourceId;} + {_schedulingExecution = If( json?.PropertyT("schedulingExecution"), out var __jsonSchedulingExecution) ? (string)__jsonSchedulingExecution : (string)_schedulingExecution;} + {_scope = If( json?.PropertyT("scope"), out var __jsonScope) ? (string)__jsonScope : (string)_scope;} AfterFromJson(json); } } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VirtualMachinePowerOffParameters.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VirtualMachinePowerOffParameters.PowerShell.cs similarity index 81% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VirtualMachinePowerOffParameters.PowerShell.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VirtualMachinePowerOffParameters.PowerShell.cs index e3b923d50f9d..cb30cb6f2e2c 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VirtualMachinePowerOffParameters.PowerShell.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VirtualMachinePowerOffParameters.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; @@ -65,29 +65,27 @@ public partial class VirtualMachinePowerOffParameters 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.NetworkCloud.Models.Api20250201.IVirtualMachinePowerOffParameters DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePowerOffParameters DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new VirtualMachinePowerOffParameters(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.NetworkCloud.Models.Api20250201.IVirtualMachinePowerOffParameters DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePowerOffParameters DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new VirtualMachinePowerOffParameters(content); } @@ -97,7 +95,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePowerOffParameters FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePowerOffParameters FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 VirtualMachinePowerOffParameters(global::System.Collections.IDictionary // actually deserialize if (content.Contains("SkipShutdown")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePowerOffParametersInternal)this).SkipShutdown = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.SkipShutdown?) content.GetValueForProperty("SkipShutdown",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePowerOffParametersInternal)this).SkipShutdown, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.SkipShutdown.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePowerOffParametersInternal)this).SkipShutdown = (string) content.GetValueForProperty("SkipShutdown",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePowerOffParametersInternal)this).SkipShutdown, 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 VirtualMachinePowerOffParameters(global::System.Management.Automation.P // actually deserialize if (content.Contains("SkipShutdown")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePowerOffParametersInternal)this).SkipShutdown = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.SkipShutdown?) content.GetValueForProperty("SkipShutdown",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePowerOffParametersInternal)this).SkipShutdown, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.SkipShutdown.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePowerOffParametersInternal)this).SkipShutdown = (string) content.GetValueForProperty("SkipShutdown",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePowerOffParametersInternal)this).SkipShutdown, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VirtualMachinePowerOffParameters.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VirtualMachinePowerOffParameters.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VirtualMachinePowerOffParameters.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VirtualMachinePowerOffParameters.TypeConverter.cs index 8d0d2d0b5c78..1b48312407ae 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VirtualMachinePowerOffParameters.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VirtualMachinePowerOffParameters.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IVirtualMachinePowerOffParameters ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePowerOffParameters ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePowerOffParameters).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePowerOffParameters).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VirtualMachinePowerOffParameters.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VirtualMachinePowerOffParameters.cs new file mode 100644 index 000000000000..ef5c70feaf24 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VirtualMachinePowerOffParameters.cs @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + + /// + /// VirtualMachinePowerOffParameters represents the body of the request to power off virtual machine. + /// + public partial class VirtualMachinePowerOffParameters : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePowerOffParameters, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePowerOffParametersInternal + { + + /// Backing field for property. + private string _skipShutdown; + + /// + /// The indicator of whether to skip the graceful OS shutdown and power off the virtual machine immediately. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string SkipShutdown { get => this._skipShutdown; set => this._skipShutdown = value; } + + /// Creates an new instance. + public VirtualMachinePowerOffParameters() + { + + } + } + /// VirtualMachinePowerOffParameters represents the body of the request to power off virtual machine. + public partial interface IVirtualMachinePowerOffParameters : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable + { + /// + /// The indicator of whether to skip the graceful OS shutdown and power off the virtual machine immediately. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The indicator of whether to skip the graceful OS shutdown and power off the virtual machine immediately.", + SerializedName = @"skipShutdown", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("True", "False")] + string SkipShutdown { get; set; } + + } + /// VirtualMachinePowerOffParameters represents the body of the request to power off virtual machine. + internal partial interface IVirtualMachinePowerOffParametersInternal + + { + /// + /// The indicator of whether to skip the graceful OS shutdown and power off the virtual machine immediately. + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("True", "False")] + string SkipShutdown { get; set; } + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VirtualMachinePowerOffParameters.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VirtualMachinePowerOffParameters.json.cs similarity index 95% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VirtualMachinePowerOffParameters.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VirtualMachinePowerOffParameters.json.cs index c8d49108afa9..0e19b76f2cf4 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VirtualMachinePowerOffParameters.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VirtualMachinePowerOffParameters.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -56,13 +56,13 @@ public partial class VirtualMachinePowerOffParameters partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePowerOffParameters. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePowerOffParameters. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePowerOffParameters. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePowerOffParameters. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePowerOffParameters FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePowerOffParameters FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new VirtualMachinePowerOffParameters(json) : null; } @@ -103,7 +103,7 @@ internal VirtualMachinePowerOffParameters(Microsoft.Azure.PowerShell.Cmdlets.Net { return; } - {_skipShutdown = If( json?.PropertyT("skipShutdown"), out var __jsonSkipShutdown) ? (string)__jsonSkipShutdown : (string)SkipShutdown;} + {_skipShutdown = If( json?.PropertyT("skipShutdown"), out var __jsonSkipShutdown) ? (string)__jsonSkipShutdown : (string)_skipShutdown;} AfterFromJson(json); } } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VirtualMachineProperties.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VirtualMachineProperties.PowerShell.cs new file mode 100644 index 000000000000..afc390f2c17e --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VirtualMachineProperties.PowerShell.cs @@ -0,0 +1,492 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + + /// VirtualMachineProperties represents the properties of the virtual machine. + [System.ComponentModel.TypeConverter(typeof(VirtualMachinePropertiesTypeConverter))] + public partial class VirtualMachineProperties + { + + /// + /// 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.NetworkCloud.Models.IVirtualMachineProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new VirtualMachineProperties(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.NetworkCloud.Models.IVirtualMachineProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new VirtualMachineProperties(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.NetworkCloud.Models.IVirtualMachineProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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 VirtualMachineProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("CloudServicesNetworkAttachment")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)this).CloudServicesNetworkAttachment = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkAttachment) content.GetValueForProperty("CloudServicesNetworkAttachment",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)this).CloudServicesNetworkAttachment, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.NetworkAttachmentTypeConverter.ConvertFrom); + } + if (content.Contains("ConsoleExtendedLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)this).ConsoleExtendedLocation = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocation) content.GetValueForProperty("ConsoleExtendedLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)this).ConsoleExtendedLocation, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ExtendedLocationTypeConverter.ConvertFrom); + } + if (content.Contains("StorageProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)this).StorageProfile = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageProfile) content.GetValueForProperty("StorageProfile",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)this).StorageProfile, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.StorageProfileTypeConverter.ConvertFrom); + } + if (content.Contains("VMImageRepositoryCredentials")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)this).VMImageRepositoryCredentials = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IImageRepositoryCredentials) content.GetValueForProperty("VMImageRepositoryCredentials",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)this).VMImageRepositoryCredentials, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ImageRepositoryCredentialsTypeConverter.ConvertFrom); + } + if (content.Contains("AdminUsername")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)this).AdminUsername = (string) content.GetValueForProperty("AdminUsername",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)this).AdminUsername, global::System.Convert.ToString); + } + if (content.Contains("AvailabilityZone")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)this).AvailabilityZone = (string) content.GetValueForProperty("AvailabilityZone",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)this).AvailabilityZone, global::System.Convert.ToString); + } + if (content.Contains("BareMetalMachineId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)this).BareMetalMachineId = (string) content.GetValueForProperty("BareMetalMachineId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)this).BareMetalMachineId, global::System.Convert.ToString); + } + if (content.Contains("BootMethod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)this).BootMethod = (string) content.GetValueForProperty("BootMethod",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)this).BootMethod, global::System.Convert.ToString); + } + if (content.Contains("ClusterId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)this).ClusterId = (string) content.GetValueForProperty("ClusterId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)this).ClusterId, global::System.Convert.ToString); + } + if (content.Contains("CpuCore")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)this).CpuCore = (long?) content.GetValueForProperty("CpuCore",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)this).CpuCore, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("DetailedStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)this).DetailedStatus = (string) content.GetValueForProperty("DetailedStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)this).DetailedStatus, global::System.Convert.ToString); + } + if (content.Contains("DetailedStatusMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)this).DetailedStatusMessage = (string) content.GetValueForProperty("DetailedStatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)this).DetailedStatusMessage, global::System.Convert.ToString); + } + if (content.Contains("IsolateEmulatorThread")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)this).IsolateEmulatorThread = (string) content.GetValueForProperty("IsolateEmulatorThread",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)this).IsolateEmulatorThread, global::System.Convert.ToString); + } + if (content.Contains("MemorySizeGb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)this).MemorySizeGb = (long?) content.GetValueForProperty("MemorySizeGb",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)this).MemorySizeGb, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("NetworkAttachment")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)this).NetworkAttachment = (System.Collections.Generic.List) content.GetValueForProperty("NetworkAttachment",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)this).NetworkAttachment, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.NetworkAttachmentTypeConverter.ConvertFrom)); + } + if (content.Contains("NetworkData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)this).NetworkData = (string) content.GetValueForProperty("NetworkData",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)this).NetworkData, global::System.Convert.ToString); + } + if (content.Contains("PlacementHint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)this).PlacementHint = (System.Collections.Generic.List) content.GetValueForProperty("PlacementHint",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)this).PlacementHint, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.VirtualMachinePlacementHintTypeConverter.ConvertFrom)); + } + if (content.Contains("PowerState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)this).PowerState = (string) content.GetValueForProperty("PowerState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)this).PowerState, global::System.Convert.ToString); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("SshPublicKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)this).SshPublicKey = (System.Collections.Generic.List) content.GetValueForProperty("SshPublicKey",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)this).SshPublicKey, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.SshPublicKeyTypeConverter.ConvertFrom)); + } + if (content.Contains("UserData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)this).UserData = (string) content.GetValueForProperty("UserData",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)this).UserData, global::System.Convert.ToString); + } + if (content.Contains("VirtioInterface")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)this).VirtioInterface = (string) content.GetValueForProperty("VirtioInterface",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)this).VirtioInterface, global::System.Convert.ToString); + } + if (content.Contains("VMDeviceModel")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)this).VMDeviceModel = (string) content.GetValueForProperty("VMDeviceModel",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)this).VMDeviceModel, global::System.Convert.ToString); + } + if (content.Contains("VMImage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)this).VMImage = (string) content.GetValueForProperty("VMImage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)this).VMImage, global::System.Convert.ToString); + } + if (content.Contains("Volume")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)this).Volume = (System.Collections.Generic.List) content.GetValueForProperty("Volume",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)this).Volume, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("CloudServiceNetworkAttachmentDefaultGateway")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)this).CloudServiceNetworkAttachmentDefaultGateway = (string) content.GetValueForProperty("CloudServiceNetworkAttachmentDefaultGateway",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)this).CloudServiceNetworkAttachmentDefaultGateway, global::System.Convert.ToString); + } + if (content.Contains("StorageProfileOSDisk")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)this).StorageProfileOSDisk = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOSDisk) content.GetValueForProperty("StorageProfileOSDisk",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)this).StorageProfileOSDisk, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.OSDiskTypeConverter.ConvertFrom); + } + if (content.Contains("StorageProfileVolumeAttachment")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)this).StorageProfileVolumeAttachment = (System.Collections.Generic.List) content.GetValueForProperty("StorageProfileVolumeAttachment",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)this).StorageProfileVolumeAttachment, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("CloudServiceNetworkAttachmentAttachedNetworkId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)this).CloudServiceNetworkAttachmentAttachedNetworkId = (string) content.GetValueForProperty("CloudServiceNetworkAttachmentAttachedNetworkId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)this).CloudServiceNetworkAttachmentAttachedNetworkId, global::System.Convert.ToString); + } + if (content.Contains("CloudServiceNetworkAttachmentIPAllocationMethod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)this).CloudServiceNetworkAttachmentIPAllocationMethod = (string) content.GetValueForProperty("CloudServiceNetworkAttachmentIPAllocationMethod",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)this).CloudServiceNetworkAttachmentIPAllocationMethod, global::System.Convert.ToString); + } + if (content.Contains("CloudServiceNetworkAttachmentIpv4Address")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)this).CloudServiceNetworkAttachmentIpv4Address = (string) content.GetValueForProperty("CloudServiceNetworkAttachmentIpv4Address",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)this).CloudServiceNetworkAttachmentIpv4Address, global::System.Convert.ToString); + } + if (content.Contains("CloudServiceNetworkAttachmentIpv6Address")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)this).CloudServiceNetworkAttachmentIpv6Address = (string) content.GetValueForProperty("CloudServiceNetworkAttachmentIpv6Address",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)this).CloudServiceNetworkAttachmentIpv6Address, global::System.Convert.ToString); + } + if (content.Contains("CloudServiceNetworkAttachmentMacAddress")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)this).CloudServiceNetworkAttachmentMacAddress = (string) content.GetValueForProperty("CloudServiceNetworkAttachmentMacAddress",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)this).CloudServiceNetworkAttachmentMacAddress, global::System.Convert.ToString); + } + if (content.Contains("CloudServiceNetworkAttachmentName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)this).CloudServiceNetworkAttachmentName = (string) content.GetValueForProperty("CloudServiceNetworkAttachmentName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)this).CloudServiceNetworkAttachmentName, global::System.Convert.ToString); + } + if (content.Contains("ConsoleExtendedLocationName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)this).ConsoleExtendedLocationName = (string) content.GetValueForProperty("ConsoleExtendedLocationName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)this).ConsoleExtendedLocationName, global::System.Convert.ToString); + } + if (content.Contains("ConsoleExtendedLocationType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)this).ConsoleExtendedLocationType = (string) content.GetValueForProperty("ConsoleExtendedLocationType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)this).ConsoleExtendedLocationType, global::System.Convert.ToString); + } + if (content.Contains("VMImageRepositoryCredentialsPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)this).VMImageRepositoryCredentialsPassword = (System.Security.SecureString) content.GetValueForProperty("VMImageRepositoryCredentialsPassword",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)this).VMImageRepositoryCredentialsPassword, (object ss) => (System.Security.SecureString)ss); + } + if (content.Contains("VMImageRepositoryCredentialsRegistryUrl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)this).VMImageRepositoryCredentialsRegistryUrl = (string) content.GetValueForProperty("VMImageRepositoryCredentialsRegistryUrl",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)this).VMImageRepositoryCredentialsRegistryUrl, global::System.Convert.ToString); + } + if (content.Contains("VMImageRepositoryCredentialsUsername")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)this).VMImageRepositoryCredentialsUsername = (string) content.GetValueForProperty("VMImageRepositoryCredentialsUsername",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)this).VMImageRepositoryCredentialsUsername, global::System.Convert.ToString); + } + if (content.Contains("OSDiskCreateOption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)this).OSDiskCreateOption = (string) content.GetValueForProperty("OSDiskCreateOption",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)this).OSDiskCreateOption, global::System.Convert.ToString); + } + if (content.Contains("OSDiskDeleteOption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)this).OSDiskDeleteOption = (string) content.GetValueForProperty("OSDiskDeleteOption",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)this).OSDiskDeleteOption, global::System.Convert.ToString); + } + if (content.Contains("OSDiskSizeGb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)this).OSDiskSizeGb = (long?) content.GetValueForProperty("OSDiskSizeGb",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)this).OSDiskSizeGb, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal VirtualMachineProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("CloudServicesNetworkAttachment")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)this).CloudServicesNetworkAttachment = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkAttachment) content.GetValueForProperty("CloudServicesNetworkAttachment",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)this).CloudServicesNetworkAttachment, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.NetworkAttachmentTypeConverter.ConvertFrom); + } + if (content.Contains("ConsoleExtendedLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)this).ConsoleExtendedLocation = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocation) content.GetValueForProperty("ConsoleExtendedLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)this).ConsoleExtendedLocation, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ExtendedLocationTypeConverter.ConvertFrom); + } + if (content.Contains("StorageProfile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)this).StorageProfile = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageProfile) content.GetValueForProperty("StorageProfile",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)this).StorageProfile, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.StorageProfileTypeConverter.ConvertFrom); + } + if (content.Contains("VMImageRepositoryCredentials")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)this).VMImageRepositoryCredentials = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IImageRepositoryCredentials) content.GetValueForProperty("VMImageRepositoryCredentials",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)this).VMImageRepositoryCredentials, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ImageRepositoryCredentialsTypeConverter.ConvertFrom); + } + if (content.Contains("AdminUsername")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)this).AdminUsername = (string) content.GetValueForProperty("AdminUsername",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)this).AdminUsername, global::System.Convert.ToString); + } + if (content.Contains("AvailabilityZone")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)this).AvailabilityZone = (string) content.GetValueForProperty("AvailabilityZone",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)this).AvailabilityZone, global::System.Convert.ToString); + } + if (content.Contains("BareMetalMachineId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)this).BareMetalMachineId = (string) content.GetValueForProperty("BareMetalMachineId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)this).BareMetalMachineId, global::System.Convert.ToString); + } + if (content.Contains("BootMethod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)this).BootMethod = (string) content.GetValueForProperty("BootMethod",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)this).BootMethod, global::System.Convert.ToString); + } + if (content.Contains("ClusterId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)this).ClusterId = (string) content.GetValueForProperty("ClusterId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)this).ClusterId, global::System.Convert.ToString); + } + if (content.Contains("CpuCore")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)this).CpuCore = (long?) content.GetValueForProperty("CpuCore",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)this).CpuCore, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("DetailedStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)this).DetailedStatus = (string) content.GetValueForProperty("DetailedStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)this).DetailedStatus, global::System.Convert.ToString); + } + if (content.Contains("DetailedStatusMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)this).DetailedStatusMessage = (string) content.GetValueForProperty("DetailedStatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)this).DetailedStatusMessage, global::System.Convert.ToString); + } + if (content.Contains("IsolateEmulatorThread")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)this).IsolateEmulatorThread = (string) content.GetValueForProperty("IsolateEmulatorThread",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)this).IsolateEmulatorThread, global::System.Convert.ToString); + } + if (content.Contains("MemorySizeGb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)this).MemorySizeGb = (long?) content.GetValueForProperty("MemorySizeGb",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)this).MemorySizeGb, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("NetworkAttachment")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)this).NetworkAttachment = (System.Collections.Generic.List) content.GetValueForProperty("NetworkAttachment",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)this).NetworkAttachment, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.NetworkAttachmentTypeConverter.ConvertFrom)); + } + if (content.Contains("NetworkData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)this).NetworkData = (string) content.GetValueForProperty("NetworkData",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)this).NetworkData, global::System.Convert.ToString); + } + if (content.Contains("PlacementHint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)this).PlacementHint = (System.Collections.Generic.List) content.GetValueForProperty("PlacementHint",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)this).PlacementHint, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.VirtualMachinePlacementHintTypeConverter.ConvertFrom)); + } + if (content.Contains("PowerState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)this).PowerState = (string) content.GetValueForProperty("PowerState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)this).PowerState, global::System.Convert.ToString); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("SshPublicKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)this).SshPublicKey = (System.Collections.Generic.List) content.GetValueForProperty("SshPublicKey",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)this).SshPublicKey, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.SshPublicKeyTypeConverter.ConvertFrom)); + } + if (content.Contains("UserData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)this).UserData = (string) content.GetValueForProperty("UserData",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)this).UserData, global::System.Convert.ToString); + } + if (content.Contains("VirtioInterface")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)this).VirtioInterface = (string) content.GetValueForProperty("VirtioInterface",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)this).VirtioInterface, global::System.Convert.ToString); + } + if (content.Contains("VMDeviceModel")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)this).VMDeviceModel = (string) content.GetValueForProperty("VMDeviceModel",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)this).VMDeviceModel, global::System.Convert.ToString); + } + if (content.Contains("VMImage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)this).VMImage = (string) content.GetValueForProperty("VMImage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)this).VMImage, global::System.Convert.ToString); + } + if (content.Contains("Volume")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)this).Volume = (System.Collections.Generic.List) content.GetValueForProperty("Volume",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)this).Volume, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("CloudServiceNetworkAttachmentDefaultGateway")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)this).CloudServiceNetworkAttachmentDefaultGateway = (string) content.GetValueForProperty("CloudServiceNetworkAttachmentDefaultGateway",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)this).CloudServiceNetworkAttachmentDefaultGateway, global::System.Convert.ToString); + } + if (content.Contains("StorageProfileOSDisk")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)this).StorageProfileOSDisk = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOSDisk) content.GetValueForProperty("StorageProfileOSDisk",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)this).StorageProfileOSDisk, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.OSDiskTypeConverter.ConvertFrom); + } + if (content.Contains("StorageProfileVolumeAttachment")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)this).StorageProfileVolumeAttachment = (System.Collections.Generic.List) content.GetValueForProperty("StorageProfileVolumeAttachment",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)this).StorageProfileVolumeAttachment, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("CloudServiceNetworkAttachmentAttachedNetworkId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)this).CloudServiceNetworkAttachmentAttachedNetworkId = (string) content.GetValueForProperty("CloudServiceNetworkAttachmentAttachedNetworkId",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)this).CloudServiceNetworkAttachmentAttachedNetworkId, global::System.Convert.ToString); + } + if (content.Contains("CloudServiceNetworkAttachmentIPAllocationMethod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)this).CloudServiceNetworkAttachmentIPAllocationMethod = (string) content.GetValueForProperty("CloudServiceNetworkAttachmentIPAllocationMethod",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)this).CloudServiceNetworkAttachmentIPAllocationMethod, global::System.Convert.ToString); + } + if (content.Contains("CloudServiceNetworkAttachmentIpv4Address")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)this).CloudServiceNetworkAttachmentIpv4Address = (string) content.GetValueForProperty("CloudServiceNetworkAttachmentIpv4Address",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)this).CloudServiceNetworkAttachmentIpv4Address, global::System.Convert.ToString); + } + if (content.Contains("CloudServiceNetworkAttachmentIpv6Address")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)this).CloudServiceNetworkAttachmentIpv6Address = (string) content.GetValueForProperty("CloudServiceNetworkAttachmentIpv6Address",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)this).CloudServiceNetworkAttachmentIpv6Address, global::System.Convert.ToString); + } + if (content.Contains("CloudServiceNetworkAttachmentMacAddress")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)this).CloudServiceNetworkAttachmentMacAddress = (string) content.GetValueForProperty("CloudServiceNetworkAttachmentMacAddress",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)this).CloudServiceNetworkAttachmentMacAddress, global::System.Convert.ToString); + } + if (content.Contains("CloudServiceNetworkAttachmentName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)this).CloudServiceNetworkAttachmentName = (string) content.GetValueForProperty("CloudServiceNetworkAttachmentName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)this).CloudServiceNetworkAttachmentName, global::System.Convert.ToString); + } + if (content.Contains("ConsoleExtendedLocationName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)this).ConsoleExtendedLocationName = (string) content.GetValueForProperty("ConsoleExtendedLocationName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)this).ConsoleExtendedLocationName, global::System.Convert.ToString); + } + if (content.Contains("ConsoleExtendedLocationType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)this).ConsoleExtendedLocationType = (string) content.GetValueForProperty("ConsoleExtendedLocationType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)this).ConsoleExtendedLocationType, global::System.Convert.ToString); + } + if (content.Contains("VMImageRepositoryCredentialsPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)this).VMImageRepositoryCredentialsPassword = (System.Security.SecureString) content.GetValueForProperty("VMImageRepositoryCredentialsPassword",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)this).VMImageRepositoryCredentialsPassword, (object ss) => (System.Security.SecureString)ss); + } + if (content.Contains("VMImageRepositoryCredentialsRegistryUrl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)this).VMImageRepositoryCredentialsRegistryUrl = (string) content.GetValueForProperty("VMImageRepositoryCredentialsRegistryUrl",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)this).VMImageRepositoryCredentialsRegistryUrl, global::System.Convert.ToString); + } + if (content.Contains("VMImageRepositoryCredentialsUsername")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)this).VMImageRepositoryCredentialsUsername = (string) content.GetValueForProperty("VMImageRepositoryCredentialsUsername",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)this).VMImageRepositoryCredentialsUsername, global::System.Convert.ToString); + } + if (content.Contains("OSDiskCreateOption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)this).OSDiskCreateOption = (string) content.GetValueForProperty("OSDiskCreateOption",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)this).OSDiskCreateOption, global::System.Convert.ToString); + } + if (content.Contains("OSDiskDeleteOption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)this).OSDiskDeleteOption = (string) content.GetValueForProperty("OSDiskDeleteOption",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)this).OSDiskDeleteOption, global::System.Convert.ToString); + } + if (content.Contains("OSDiskSizeGb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)this).OSDiskSizeGb = (long?) content.GetValueForProperty("OSDiskSizeGb",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal)this).OSDiskSizeGb, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + AfterDeserializePSObject(content); + } + } + /// VirtualMachineProperties represents the properties of the virtual machine. + [System.ComponentModel.TypeConverter(typeof(VirtualMachinePropertiesTypeConverter))] + public partial interface IVirtualMachineProperties + + { + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VirtualMachineProperties.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VirtualMachineProperties.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VirtualMachineProperties.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VirtualMachineProperties.TypeConverter.cs index 5b6c5223538a..d4fb2e60dd3b 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VirtualMachineProperties.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VirtualMachineProperties.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IVirtualMachineProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachineProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VirtualMachineProperties.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VirtualMachineProperties.cs new file mode 100644 index 000000000000..06703105e34a --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VirtualMachineProperties.cs @@ -0,0 +1,1020 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + + /// VirtualMachineProperties represents the properties of the virtual machine. + public partial class VirtualMachineProperties : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineProperties, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal + { + + /// Backing field for property. + private string _adminUsername; + + /// + /// The name of the administrator to which the ssh public keys will be added into the authorized keys. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string AdminUsername { get => this._adminUsername; set => this._adminUsername = value; } + + /// Backing field for property. + private string _availabilityZone; + + /// The cluster availability zone containing this virtual machine. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string AvailabilityZone { get => this._availabilityZone; } + + /// Backing field for property. + private string _bareMetalMachineId; + + /// The resource ID of the bare metal machine that hosts the virtual machine. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string BareMetalMachineId { get => this._bareMetalMachineId; } + + /// Backing field for property. + private string _bootMethod; + + /// Selects the boot method for the virtual machine. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string BootMethod { get => this._bootMethod; set => this._bootMethod = value; } + + /// + /// The resource ID of the associated network attached to the virtual machine. + /// It can be one of cloudServicesNetwork, l3Network, l2Network or trunkedNetwork resources. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string CloudServiceNetworkAttachmentAttachedNetworkId { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkAttachmentInternal)CloudServicesNetworkAttachment).AttachedNetworkId; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkAttachmentInternal)CloudServicesNetworkAttachment).AttachedNetworkId = value ?? null; } + + /// + /// The indicator of whether this is the default gateway. + /// Only one of the attached networks (including the CloudServicesNetwork attachment) for a single machine may be specified + /// as True. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string CloudServiceNetworkAttachmentDefaultGateway { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkAttachmentInternal)CloudServicesNetworkAttachment).DefaultGateway; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkAttachmentInternal)CloudServicesNetworkAttachment).DefaultGateway = value ?? null; } + + /// + /// The IP allocation mechanism for the virtual machine. + /// Dynamic and Static are only valid for l3Network which may also specify Disabled. + /// Otherwise, Disabled is the only permitted value. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string CloudServiceNetworkAttachmentIPAllocationMethod { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkAttachmentInternal)CloudServicesNetworkAttachment).IPAllocationMethod; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkAttachmentInternal)CloudServicesNetworkAttachment).IPAllocationMethod = value ?? null; } + + /// + /// The IPv4 address of the virtual machine. + /// This field is used only if the attached network has IPAllocationType of IPV4 or DualStack. + /// If IPAllocationMethod is: + /// Static - this field must contain a user specified IPv4 address from within the subnet specified in the attached network. + /// Dynamic - this field is read-only, but will be populated with an address from within the subnet specified in the attached + /// network. + /// Disabled - this field will be empty. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string CloudServiceNetworkAttachmentIpv4Address { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkAttachmentInternal)CloudServicesNetworkAttachment).Ipv4Address; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkAttachmentInternal)CloudServicesNetworkAttachment).Ipv4Address = value ?? null; } + + /// + /// The IPv6 address of the virtual machine. + /// This field is used only if the attached network has IPAllocationType of IPV6 or DualStack. + /// If IPAllocationMethod is: + /// Static - this field must contain an IPv6 address range from within the range specified in the attached network. + /// Dynamic - this field is read-only, but will be populated with an range from within the subnet specified in the attached + /// network. + /// Disabled - this field will be empty. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string CloudServiceNetworkAttachmentIpv6Address { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkAttachmentInternal)CloudServicesNetworkAttachment).Ipv6Address; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkAttachmentInternal)CloudServicesNetworkAttachment).Ipv6Address = value ?? null; } + + /// + /// The MAC address of the interface for the virtual machine that corresponds to this network attachment. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string CloudServiceNetworkAttachmentMacAddress { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkAttachmentInternal)CloudServicesNetworkAttachment).MacAddress; } + + /// + /// The associated network's interface name. + /// If specified, the network attachment name has a maximum length of 15 characters and must be unique to this virtual machine. + /// If the user doesn’t specify this value, the default interface name of the network resource will be used. + /// For a CloudServicesNetwork resource, this name will be ignored. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string CloudServiceNetworkAttachmentName { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkAttachmentInternal)CloudServicesNetworkAttachment).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkAttachmentInternal)CloudServicesNetworkAttachment).Name = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkAttachment _cloudServicesNetworkAttachment; + + /// + /// The cloud service network that provides platform-level services for the virtual machine. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkAttachment CloudServicesNetworkAttachment { get => (this._cloudServicesNetworkAttachment = this._cloudServicesNetworkAttachment ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.NetworkAttachment()); set => this._cloudServicesNetworkAttachment = value; } + + /// Backing field for property. + private string _clusterId; + + /// The resource ID of the cluster the virtual machine is created for. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string ClusterId { get => this._clusterId; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocation _consoleExtendedLocation; + + /// The extended location to use for creation of a VM console resource. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocation ConsoleExtendedLocation { get => (this._consoleExtendedLocation = this._consoleExtendedLocation ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ExtendedLocation()); set => this._consoleExtendedLocation = value; } + + /// The resource ID of the extended location on which the resource will be created. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string ConsoleExtendedLocationName { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocationInternal)ConsoleExtendedLocation).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocationInternal)ConsoleExtendedLocation).Name = value ?? null; } + + /// The extended location type, for example, CustomLocation. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string ConsoleExtendedLocationType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocationInternal)ConsoleExtendedLocation).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocationInternal)ConsoleExtendedLocation).Type = value ?? null; } + + /// Backing field for property. + private long? _cpuCore; + + /// The number of CPU cores in the virtual machine. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public long? CpuCore { get => this._cpuCore; set => this._cpuCore = value; } + + /// Backing field for property. + private string _detailedStatus; + + /// The more detailed status of the virtual machine. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string DetailedStatus { get => this._detailedStatus; } + + /// Backing field for property. + private string _detailedStatusMessage; + + /// The descriptive message about the current detailed status. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string DetailedStatusMessage { get => this._detailedStatusMessage; } + + /// Backing field for property. + private string _isolateEmulatorThread; + + /// + /// Field Deprecated, the value will be ignored if provided. The indicator of whether one of the specified CPU cores is isolated + /// to run the emulator thread for this virtual machine. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string IsolateEmulatorThread { get => this._isolateEmulatorThread; set => this._isolateEmulatorThread = value; } + + /// Backing field for property. + private long? _memorySizeGb; + + /// The memory size of the virtual machine. Allocations are measured in gibibytes. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public long? MemorySizeGb { get => this._memorySizeGb; set => this._memorySizeGb = value; } + + /// Internal Acessors for AvailabilityZone + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal.AvailabilityZone { get => this._availabilityZone; set { {_availabilityZone = value;} } } + + /// Internal Acessors for BareMetalMachineId + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal.BareMetalMachineId { get => this._bareMetalMachineId; set { {_bareMetalMachineId = value;} } } + + /// Internal Acessors for CloudServiceNetworkAttachmentMacAddress + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal.CloudServiceNetworkAttachmentMacAddress { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkAttachmentInternal)CloudServicesNetworkAttachment).MacAddress; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkAttachmentInternal)CloudServicesNetworkAttachment).MacAddress = value ?? null; } + + /// Internal Acessors for CloudServicesNetworkAttachment + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkAttachment Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal.CloudServicesNetworkAttachment { get => (this._cloudServicesNetworkAttachment = this._cloudServicesNetworkAttachment ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.NetworkAttachment()); set { {_cloudServicesNetworkAttachment = value;} } } + + /// Internal Acessors for ClusterId + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal.ClusterId { get => this._clusterId; set { {_clusterId = value;} } } + + /// Internal Acessors for ConsoleExtendedLocation + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocation Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal.ConsoleExtendedLocation { get => (this._consoleExtendedLocation = this._consoleExtendedLocation ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ExtendedLocation()); set { {_consoleExtendedLocation = value;} } } + + /// Internal Acessors for DetailedStatus + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal.DetailedStatus { get => this._detailedStatus; set { {_detailedStatus = value;} } } + + /// Internal Acessors for DetailedStatusMessage + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal.DetailedStatusMessage { get => this._detailedStatusMessage; set { {_detailedStatusMessage = value;} } } + + /// Internal Acessors for PowerState + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal.PowerState { get => this._powerState; set { {_powerState = value;} } } + + /// Internal Acessors for ProvisioningState + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal.ProvisioningState { get => this._provisioningState; set { {_provisioningState = value;} } } + + /// Internal Acessors for StorageProfile + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageProfile Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal.StorageProfile { get => (this._storageProfile = this._storageProfile ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.StorageProfile()); set { {_storageProfile = value;} } } + + /// Internal Acessors for StorageProfileOSDisk + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOSDisk Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal.StorageProfileOSDisk { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageProfileInternal)StorageProfile).OSDisk; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageProfileInternal)StorageProfile).OSDisk = value ?? null /* model class */; } + + /// Internal Acessors for VMImageRepositoryCredentials + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IImageRepositoryCredentials Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal.VMImageRepositoryCredentials { get => (this._vMImageRepositoryCredentials = this._vMImageRepositoryCredentials ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ImageRepositoryCredentials()); set { {_vMImageRepositoryCredentials = value;} } } + + /// Internal Acessors for Volume + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePropertiesInternal.Volume { get => this._volume; set { {_volume = value;} } } + + /// Backing field for property. + private System.Collections.Generic.List _networkAttachment; + + /// The list of network attachments to the virtual machine. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public System.Collections.Generic.List NetworkAttachment { get => this._networkAttachment; set => this._networkAttachment = value; } + + /// Backing field for property. + private string _networkData; + + /// The Base64 encoded cloud-init network data. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string NetworkData { get => this._networkData; set => this._networkData = value; } + + /// The strategy for creating the OS disk. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string OSDiskCreateOption { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageProfileInternal)StorageProfile).OSDiskCreateOption; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageProfileInternal)StorageProfile).OSDiskCreateOption = value ?? null; } + + /// The strategy for deleting the OS disk. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string OSDiskDeleteOption { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageProfileInternal)StorageProfile).OSDiskDeleteOption; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageProfileInternal)StorageProfile).OSDiskDeleteOption = value ?? null; } + + /// + /// The size of the disk. Required if the createOption is Ephemeral. Allocations are measured in gibibytes. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public long? OSDiskSizeGb { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageProfileInternal)StorageProfile).OSDiskSizeGb; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageProfileInternal)StorageProfile).OSDiskSizeGb = value ?? default(long); } + + /// Backing field for property. + private System.Collections.Generic.List _placementHint; + + /// The scheduling hints for the virtual machine. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public System.Collections.Generic.List PlacementHint { get => this._placementHint; set => this._placementHint = value; } + + /// Backing field for property. + private string _powerState; + + /// The power state of the virtual machine. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string PowerState { get => this._powerState; } + + /// Backing field for property. + private string _provisioningState; + + /// The provisioning state of the virtual machine. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string ProvisioningState { get => this._provisioningState; } + + /// Backing field for property. + private System.Collections.Generic.List _sshPublicKey; + + /// + /// The list of ssh public keys. Each key will be added to the virtual machine using the cloud-init ssh_authorized_keys mechanism + /// for the adminUsername. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public System.Collections.Generic.List SshPublicKey { get => this._sshPublicKey; set => this._sshPublicKey = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageProfile _storageProfile; + + /// + /// The storage profile that specifies size and other parameters about the disks related to the virtual machine. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageProfile StorageProfile { get => (this._storageProfile = this._storageProfile ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.StorageProfile()); set => this._storageProfile = value; } + + /// + /// The resource IDs of volumes that are requested to be attached to the virtual machine. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public System.Collections.Generic.List StorageProfileVolumeAttachment { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageProfileInternal)StorageProfile).VolumeAttachment; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageProfileInternal)StorageProfile).VolumeAttachment = value ?? null /* arrayOf */; } + + /// Backing field for property. + private string _userData; + + /// The Base64 encoded cloud-init user data. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string UserData { get => this._userData; set => this._userData = value; } + + /// Backing field for property. + private string _vMDeviceModel; + + /// The type of the device model to use. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string VMDeviceModel { get => this._vMDeviceModel; set => this._vMDeviceModel = value; } + + /// Backing field for property. + private string _vMImage; + + /// + /// The virtual machine image that is currently provisioned to the OS disk, using the full url and tag notation used to pull + /// the image. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string VMImage { get => this._vMImage; set => this._vMImage = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IImageRepositoryCredentials _vMImageRepositoryCredentials; + + /// + /// The credentials used to login to the image repository that has access to the specified image. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IImageRepositoryCredentials VMImageRepositoryCredentials { get => (this._vMImageRepositoryCredentials = this._vMImageRepositoryCredentials ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ImageRepositoryCredentials()); set => this._vMImageRepositoryCredentials = value; } + + /// The password or token used to access an image in the target repository. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public System.Security.SecureString VMImageRepositoryCredentialsPassword { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IImageRepositoryCredentialsInternal)VMImageRepositoryCredentials).Password; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IImageRepositoryCredentialsInternal)VMImageRepositoryCredentials).Password = value ?? null; } + + /// + /// The URL of the authentication server used to validate the repository credentials. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string VMImageRepositoryCredentialsRegistryUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IImageRepositoryCredentialsInternal)VMImageRepositoryCredentials).RegistryUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IImageRepositoryCredentialsInternal)VMImageRepositoryCredentials).RegistryUrl = value ?? null; } + + /// The username used to access an image in the target repository. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string VMImageRepositoryCredentialsUsername { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IImageRepositoryCredentialsInternal)VMImageRepositoryCredentials).Username; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IImageRepositoryCredentialsInternal)VMImageRepositoryCredentials).Username = value ?? null; } + + /// Backing field for property. + private string _virtioInterface; + + /// + /// Field Deprecated, use virtualizationModel instead. The type of the virtio interface. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string VirtioInterface { get => this._virtioInterface; set => this._virtioInterface = value; } + + /// Backing field for property. + private System.Collections.Generic.List _volume; + + /// The resource IDs of volumes that are attached to the virtual machine. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public System.Collections.Generic.List Volume { get => this._volume; } + + /// Creates an new instance. + public VirtualMachineProperties() + { + + } + } + /// VirtualMachineProperties represents the properties of the virtual machine. + public partial interface IVirtualMachineProperties : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable + { + /// + /// The name of the administrator to which the ssh public keys will be added into the authorized keys. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The name of the administrator to which the ssh public keys will be added into the authorized keys.", + SerializedName = @"adminUsername", + PossibleTypes = new [] { typeof(string) })] + string AdminUsername { get; set; } + /// The cluster availability zone containing this virtual machine. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The cluster availability zone containing this virtual machine.", + SerializedName = @"availabilityZone", + PossibleTypes = new [] { typeof(string) })] + string AvailabilityZone { get; } + /// The resource ID of the bare metal machine that hosts the virtual machine. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The resource ID of the bare metal machine that hosts the virtual machine.", + SerializedName = @"bareMetalMachineId", + PossibleTypes = new [] { typeof(string) })] + string BareMetalMachineId { get; } + /// Selects the boot method for the virtual machine. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"Selects the boot method for the virtual machine.", + SerializedName = @"bootMethod", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("UEFI", "BIOS")] + string BootMethod { get; set; } + /// + /// The resource ID of the associated network attached to the virtual machine. + /// It can be one of cloudServicesNetwork, l3Network, l2Network or trunkedNetwork resources. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The resource ID of the associated network attached to the virtual machine. + It can be one of cloudServicesNetwork, l3Network, l2Network or trunkedNetwork resources.", + SerializedName = @"attachedNetworkId", + PossibleTypes = new [] { typeof(string) })] + string CloudServiceNetworkAttachmentAttachedNetworkId { get; set; } + /// + /// The indicator of whether this is the default gateway. + /// Only one of the attached networks (including the CloudServicesNetwork attachment) for a single machine may be specified + /// as True. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The indicator of whether this is the default gateway. + Only one of the attached networks (including the CloudServicesNetwork attachment) for a single machine may be specified as True.", + SerializedName = @"defaultGateway", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("True", "False")] + string CloudServiceNetworkAttachmentDefaultGateway { get; set; } + /// + /// The IP allocation mechanism for the virtual machine. + /// Dynamic and Static are only valid for l3Network which may also specify Disabled. + /// Otherwise, Disabled is the only permitted value. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The IP allocation mechanism for the virtual machine. + Dynamic and Static are only valid for l3Network which may also specify Disabled. + Otherwise, Disabled is the only permitted value.", + SerializedName = @"ipAllocationMethod", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Dynamic", "Static", "Disabled")] + string CloudServiceNetworkAttachmentIPAllocationMethod { get; set; } + /// + /// The IPv4 address of the virtual machine. + /// This field is used only if the attached network has IPAllocationType of IPV4 or DualStack. + /// If IPAllocationMethod is: + /// Static - this field must contain a user specified IPv4 address from within the subnet specified in the attached network. + /// Dynamic - this field is read-only, but will be populated with an address from within the subnet specified in the attached + /// network. + /// Disabled - this field will be empty. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The IPv4 address of the virtual machine. + + This field is used only if the attached network has IPAllocationType of IPV4 or DualStack. + + If IPAllocationMethod is: + Static - this field must contain a user specified IPv4 address from within the subnet specified in the attached network. + Dynamic - this field is read-only, but will be populated with an address from within the subnet specified in the attached network. + Disabled - this field will be empty.", + SerializedName = @"ipv4Address", + PossibleTypes = new [] { typeof(string) })] + string CloudServiceNetworkAttachmentIpv4Address { get; set; } + /// + /// The IPv6 address of the virtual machine. + /// This field is used only if the attached network has IPAllocationType of IPV6 or DualStack. + /// If IPAllocationMethod is: + /// Static - this field must contain an IPv6 address range from within the range specified in the attached network. + /// Dynamic - this field is read-only, but will be populated with an range from within the subnet specified in the attached + /// network. + /// Disabled - this field will be empty. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The IPv6 address of the virtual machine. + + This field is used only if the attached network has IPAllocationType of IPV6 or DualStack. + + If IPAllocationMethod is: + Static - this field must contain an IPv6 address range from within the range specified in the attached network. + Dynamic - this field is read-only, but will be populated with an range from within the subnet specified in the attached network. + Disabled - this field will be empty.", + SerializedName = @"ipv6Address", + PossibleTypes = new [] { typeof(string) })] + string CloudServiceNetworkAttachmentIpv6Address { get; set; } + /// + /// The MAC address of the interface for the virtual machine that corresponds to this network attachment. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The MAC address of the interface for the virtual machine that corresponds to this network attachment.", + SerializedName = @"macAddress", + PossibleTypes = new [] { typeof(string) })] + string CloudServiceNetworkAttachmentMacAddress { get; } + /// + /// The associated network's interface name. + /// If specified, the network attachment name has a maximum length of 15 characters and must be unique to this virtual machine. + /// If the user doesn’t specify this value, the default interface name of the network resource will be used. + /// For a CloudServicesNetwork resource, this name will be ignored. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The associated network's interface name. + If specified, the network attachment name has a maximum length of 15 characters and must be unique to this virtual machine. + If the user doesn’t specify this value, the default interface name of the network resource will be used. + For a CloudServicesNetwork resource, this name will be ignored.", + SerializedName = @"networkAttachmentName", + PossibleTypes = new [] { typeof(string) })] + string CloudServiceNetworkAttachmentName { get; set; } + /// The resource ID of the cluster the virtual machine is created for. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The resource ID of the cluster the virtual machine is created for.", + SerializedName = @"clusterId", + PossibleTypes = new [] { typeof(string) })] + string ClusterId { get; } + /// The resource ID of the extended location on which the resource will be created. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The resource ID of the extended location on which the resource will be created.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string ConsoleExtendedLocationName { get; set; } + /// The extended location type, for example, CustomLocation. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The extended location type, for example, CustomLocation.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + string ConsoleExtendedLocationType { get; set; } + /// The number of CPU cores in the virtual machine. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The number of CPU cores in the virtual machine.", + SerializedName = @"cpuCores", + PossibleTypes = new [] { typeof(long) })] + long? CpuCore { get; set; } + /// The more detailed status of the virtual machine. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The more detailed status of the virtual machine.", + SerializedName = @"detailedStatus", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Available", "Error", "Provisioning", "Running", "Scheduling", "Stopped", "Terminating", "Unknown")] + string DetailedStatus { get; } + /// The descriptive message about the current detailed status. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The descriptive message about the current detailed status.", + SerializedName = @"detailedStatusMessage", + PossibleTypes = new [] { typeof(string) })] + string DetailedStatusMessage { get; } + /// + /// Field Deprecated, the value will be ignored if provided. The indicator of whether one of the specified CPU cores is isolated + /// to run the emulator thread for this virtual machine. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"Field Deprecated, the value will be ignored if provided. The indicator of whether one of the specified CPU cores is isolated to run the emulator thread for this virtual machine.", + SerializedName = @"isolateEmulatorThread", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("True", "False")] + string IsolateEmulatorThread { get; set; } + /// The memory size of the virtual machine. Allocations are measured in gibibytes. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The memory size of the virtual machine. Allocations are measured in gibibytes.", + SerializedName = @"memorySizeGB", + PossibleTypes = new [] { typeof(long) })] + long? MemorySizeGb { get; set; } + /// The list of network attachments to the virtual machine. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The list of network attachments to the virtual machine.", + SerializedName = @"networkAttachments", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkAttachment) })] + System.Collections.Generic.List NetworkAttachment { get; set; } + /// The Base64 encoded cloud-init network data. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The Base64 encoded cloud-init network data.", + SerializedName = @"networkData", + PossibleTypes = new [] { typeof(string) })] + string NetworkData { get; set; } + /// The strategy for creating the OS disk. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The strategy for creating the OS disk.", + SerializedName = @"createOption", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Ephemeral", "Persistent")] + string OSDiskCreateOption { get; set; } + /// The strategy for deleting the OS disk. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The strategy for deleting the OS disk.", + SerializedName = @"deleteOption", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Delete")] + string OSDiskDeleteOption { get; set; } + /// + /// The size of the disk. Required if the createOption is Ephemeral. Allocations are measured in gibibytes. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The size of the disk. Required if the createOption is Ephemeral. Allocations are measured in gibibytes.", + SerializedName = @"diskSizeGB", + PossibleTypes = new [] { typeof(long) })] + long? OSDiskSizeGb { get; set; } + /// The scheduling hints for the virtual machine. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The scheduling hints for the virtual machine.", + SerializedName = @"placementHints", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePlacementHint) })] + System.Collections.Generic.List PlacementHint { get; set; } + /// The power state of the virtual machine. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The power state of the virtual machine.", + SerializedName = @"powerState", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("On", "Off", "Unknown")] + string PowerState { get; } + /// The provisioning state of the virtual machine. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The provisioning state of the virtual machine.", + SerializedName = @"provisioningState", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Succeeded", "Failed", "Canceled", "Provisioning", "Accepted")] + string ProvisioningState { get; } + /// + /// The list of ssh public keys. Each key will be added to the virtual machine using the cloud-init ssh_authorized_keys mechanism + /// for the adminUsername. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The list of ssh public keys. Each key will be added to the virtual machine using the cloud-init ssh_authorized_keys mechanism for the adminUsername.", + SerializedName = @"sshPublicKeys", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISshPublicKey) })] + System.Collections.Generic.List SshPublicKey { get; set; } + /// + /// The resource IDs of volumes that are requested to be attached to the virtual machine. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The resource IDs of volumes that are requested to be attached to the virtual machine.", + SerializedName = @"volumeAttachments", + PossibleTypes = new [] { typeof(string) })] + System.Collections.Generic.List StorageProfileVolumeAttachment { get; set; } + /// The Base64 encoded cloud-init user data. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The Base64 encoded cloud-init user data.", + SerializedName = @"userData", + PossibleTypes = new [] { typeof(string) })] + string UserData { get; set; } + /// The type of the device model to use. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The type of the device model to use.", + SerializedName = @"vmDeviceModel", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("T1", "T2", "T3")] + string VMDeviceModel { get; set; } + /// + /// The virtual machine image that is currently provisioned to the OS disk, using the full url and tag notation used to pull + /// the image. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The virtual machine image that is currently provisioned to the OS disk, using the full url and tag notation used to pull the image.", + SerializedName = @"vmImage", + PossibleTypes = new [] { typeof(string) })] + string VMImage { get; set; } + /// The password or token used to access an image in the target repository. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The password or token used to access an image in the target repository.", + SerializedName = @"password", + PossibleTypes = new [] { typeof(System.Security.SecureString) })] + System.Security.SecureString VMImageRepositoryCredentialsPassword { get; set; } + /// + /// The URL of the authentication server used to validate the repository credentials. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The URL of the authentication server used to validate the repository credentials.", + SerializedName = @"registryUrl", + PossibleTypes = new [] { typeof(string) })] + string VMImageRepositoryCredentialsRegistryUrl { get; set; } + /// The username used to access an image in the target repository. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The username used to access an image in the target repository.", + SerializedName = @"username", + PossibleTypes = new [] { typeof(string) })] + string VMImageRepositoryCredentialsUsername { get; set; } + /// + /// Field Deprecated, use virtualizationModel instead. The type of the virtio interface. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"Field Deprecated, use virtualizationModel instead. The type of the virtio interface.", + SerializedName = @"virtioInterface", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Modern", "Transitional")] + string VirtioInterface { get; set; } + /// The resource IDs of volumes that are attached to the virtual machine. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The resource IDs of volumes that are attached to the virtual machine.", + SerializedName = @"volumes", + PossibleTypes = new [] { typeof(string) })] + System.Collections.Generic.List Volume { get; } + + } + /// VirtualMachineProperties represents the properties of the virtual machine. + internal partial interface IVirtualMachinePropertiesInternal + + { + /// + /// The name of the administrator to which the ssh public keys will be added into the authorized keys. + /// + string AdminUsername { get; set; } + /// The cluster availability zone containing this virtual machine. + string AvailabilityZone { get; set; } + /// The resource ID of the bare metal machine that hosts the virtual machine. + string BareMetalMachineId { get; set; } + /// Selects the boot method for the virtual machine. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("UEFI", "BIOS")] + string BootMethod { get; set; } + /// + /// The resource ID of the associated network attached to the virtual machine. + /// It can be one of cloudServicesNetwork, l3Network, l2Network or trunkedNetwork resources. + /// + string CloudServiceNetworkAttachmentAttachedNetworkId { get; set; } + /// + /// The indicator of whether this is the default gateway. + /// Only one of the attached networks (including the CloudServicesNetwork attachment) for a single machine may be specified + /// as True. + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("True", "False")] + string CloudServiceNetworkAttachmentDefaultGateway { get; set; } + /// + /// The IP allocation mechanism for the virtual machine. + /// Dynamic and Static are only valid for l3Network which may also specify Disabled. + /// Otherwise, Disabled is the only permitted value. + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Dynamic", "Static", "Disabled")] + string CloudServiceNetworkAttachmentIPAllocationMethod { get; set; } + /// + /// The IPv4 address of the virtual machine. + /// This field is used only if the attached network has IPAllocationType of IPV4 or DualStack. + /// If IPAllocationMethod is: + /// Static - this field must contain a user specified IPv4 address from within the subnet specified in the attached network. + /// Dynamic - this field is read-only, but will be populated with an address from within the subnet specified in the attached + /// network. + /// Disabled - this field will be empty. + /// + string CloudServiceNetworkAttachmentIpv4Address { get; set; } + /// + /// The IPv6 address of the virtual machine. + /// This field is used only if the attached network has IPAllocationType of IPV6 or DualStack. + /// If IPAllocationMethod is: + /// Static - this field must contain an IPv6 address range from within the range specified in the attached network. + /// Dynamic - this field is read-only, but will be populated with an range from within the subnet specified in the attached + /// network. + /// Disabled - this field will be empty. + /// + string CloudServiceNetworkAttachmentIpv6Address { get; set; } + /// + /// The MAC address of the interface for the virtual machine that corresponds to this network attachment. + /// + string CloudServiceNetworkAttachmentMacAddress { get; set; } + /// + /// The associated network's interface name. + /// If specified, the network attachment name has a maximum length of 15 characters and must be unique to this virtual machine. + /// If the user doesn’t specify this value, the default interface name of the network resource will be used. + /// For a CloudServicesNetwork resource, this name will be ignored. + /// + string CloudServiceNetworkAttachmentName { get; set; } + /// + /// The cloud service network that provides platform-level services for the virtual machine. + /// + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkAttachment CloudServicesNetworkAttachment { get; set; } + /// The resource ID of the cluster the virtual machine is created for. + string ClusterId { get; set; } + /// The extended location to use for creation of a VM console resource. + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocation ConsoleExtendedLocation { get; set; } + /// The resource ID of the extended location on which the resource will be created. + string ConsoleExtendedLocationName { get; set; } + /// The extended location type, for example, CustomLocation. + string ConsoleExtendedLocationType { get; set; } + /// The number of CPU cores in the virtual machine. + long? CpuCore { get; set; } + /// The more detailed status of the virtual machine. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Available", "Error", "Provisioning", "Running", "Scheduling", "Stopped", "Terminating", "Unknown")] + string DetailedStatus { get; set; } + /// The descriptive message about the current detailed status. + string DetailedStatusMessage { get; set; } + /// + /// Field Deprecated, the value will be ignored if provided. The indicator of whether one of the specified CPU cores is isolated + /// to run the emulator thread for this virtual machine. + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("True", "False")] + string IsolateEmulatorThread { get; set; } + /// The memory size of the virtual machine. Allocations are measured in gibibytes. + long? MemorySizeGb { get; set; } + /// The list of network attachments to the virtual machine. + System.Collections.Generic.List NetworkAttachment { get; set; } + /// The Base64 encoded cloud-init network data. + string NetworkData { get; set; } + /// The strategy for creating the OS disk. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Ephemeral", "Persistent")] + string OSDiskCreateOption { get; set; } + /// The strategy for deleting the OS disk. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Delete")] + string OSDiskDeleteOption { get; set; } + /// + /// The size of the disk. Required if the createOption is Ephemeral. Allocations are measured in gibibytes. + /// + long? OSDiskSizeGb { get; set; } + /// The scheduling hints for the virtual machine. + System.Collections.Generic.List PlacementHint { get; set; } + /// The power state of the virtual machine. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("On", "Off", "Unknown")] + string PowerState { get; set; } + /// The provisioning state of the virtual machine. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Succeeded", "Failed", "Canceled", "Provisioning", "Accepted")] + string ProvisioningState { get; set; } + /// + /// The list of ssh public keys. Each key will be added to the virtual machine using the cloud-init ssh_authorized_keys mechanism + /// for the adminUsername. + /// + System.Collections.Generic.List SshPublicKey { get; set; } + /// + /// The storage profile that specifies size and other parameters about the disks related to the virtual machine. + /// + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageProfile StorageProfile { get; set; } + /// The disk to use with this virtual machine. + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOSDisk StorageProfileOSDisk { get; set; } + /// + /// The resource IDs of volumes that are requested to be attached to the virtual machine. + /// + System.Collections.Generic.List StorageProfileVolumeAttachment { get; set; } + /// The Base64 encoded cloud-init user data. + string UserData { get; set; } + /// The type of the device model to use. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("T1", "T2", "T3")] + string VMDeviceModel { get; set; } + /// + /// The virtual machine image that is currently provisioned to the OS disk, using the full url and tag notation used to pull + /// the image. + /// + string VMImage { get; set; } + /// + /// The credentials used to login to the image repository that has access to the specified image. + /// + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IImageRepositoryCredentials VMImageRepositoryCredentials { get; set; } + /// The password or token used to access an image in the target repository. + System.Security.SecureString VMImageRepositoryCredentialsPassword { get; set; } + /// + /// The URL of the authentication server used to validate the repository credentials. + /// + string VMImageRepositoryCredentialsRegistryUrl { get; set; } + /// The username used to access an image in the target repository. + string VMImageRepositoryCredentialsUsername { get; set; } + /// + /// Field Deprecated, use virtualizationModel instead. The type of the virtio interface. + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Modern", "Transitional")] + string VirtioInterface { get; set; } + /// The resource IDs of volumes that are attached to the virtual machine. + System.Collections.Generic.List Volume { get; set; } + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VirtualMachineProperties.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VirtualMachineProperties.json.cs new file mode 100644 index 000000000000..2bcca200f858 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VirtualMachineProperties.json.cs @@ -0,0 +1,257 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + + /// VirtualMachineProperties represents the properties of the virtual machine. + public partial class VirtualMachineProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new VirtualMachineProperties(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)||serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate)) + { + AddIf( null != this._cloudServicesNetworkAttachment ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) this._cloudServicesNetworkAttachment.ToJson(null,serializationMode) : null, "cloudServicesNetworkAttachment" ,container.Add ); + } + AddIf( null != this._consoleExtendedLocation ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) this._consoleExtendedLocation.ToJson(null,serializationMode) : null, "consoleExtendedLocation" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)||serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate)) + { + AddIf( null != this._storageProfile ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) this._storageProfile.ToJson(null,serializationMode) : null, "storageProfile" ,container.Add ); + } + AddIf( null != this._vMImageRepositoryCredentials ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) this._vMImageRepositoryCredentials.ToJson(null,serializationMode) : null, "vmImageRepositoryCredentials" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)||serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate)) + { + AddIf( null != (((object)this._adminUsername)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._adminUsername.ToString()) : null, "adminUsername" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) + { + AddIf( null != (((object)this._availabilityZone)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._availabilityZone.ToString()) : null, "availabilityZone" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) + { + AddIf( null != (((object)this._bareMetalMachineId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._bareMetalMachineId.ToString()) : null, "bareMetalMachineId" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)||serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate)) + { + AddIf( null != (((object)this._bootMethod)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._bootMethod.ToString()) : null, "bootMethod" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) + { + AddIf( null != (((object)this._clusterId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._clusterId.ToString()) : null, "clusterId" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)||serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate)) + { + AddIf( null != this._cpuCore ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNumber((long)this._cpuCore) : null, "cpuCores" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) + { + AddIf( null != (((object)this._detailedStatus)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._detailedStatus.ToString()) : null, "detailedStatus" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) + { + AddIf( null != (((object)this._detailedStatusMessage)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._detailedStatusMessage.ToString()) : null, "detailedStatusMessage" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)||serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate)) + { + AddIf( null != (((object)this._isolateEmulatorThread)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._isolateEmulatorThread.ToString()) : null, "isolateEmulatorThread" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)||serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate)) + { + AddIf( null != this._memorySizeGb ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNumber((long)this._memorySizeGb) : null, "memorySizeGB" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)||serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate)) + { + if (null != this._networkAttachment) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.XNodeArray(); + foreach( var __x in this._networkAttachment ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("networkAttachments",__w); + } + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)||serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate)) + { + AddIf( null != (((object)this._networkData)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._networkData.ToString()) : null, "networkData" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)||serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate)) + { + if (null != this._placementHint) + { + var __r = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.XNodeArray(); + foreach( var __s in this._placementHint ) + { + AddIf(__s?.ToJson(null, serializationMode) ,__r.Add); + } + container.Add("placementHints",__r); + } + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) + { + AddIf( null != (((object)this._powerState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._powerState.ToString()) : null, "powerState" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) + { + AddIf( null != (((object)this._provisioningState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._provisioningState.ToString()) : null, "provisioningState" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)||serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate)) + { + if (null != this._sshPublicKey) + { + var __m = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.XNodeArray(); + foreach( var __n in this._sshPublicKey ) + { + AddIf(__n?.ToJson(null, serializationMode) ,__m.Add); + } + container.Add("sshPublicKeys",__m); + } + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)||serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate)) + { + AddIf( null != (((object)this._userData)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._userData.ToString()) : null, "userData" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)||serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate)) + { + AddIf( null != (((object)this._virtioInterface)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._virtioInterface.ToString()) : null, "virtioInterface" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)||serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate)) + { + AddIf( null != (((object)this._vMDeviceModel)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._vMDeviceModel.ToString()) : null, "vmDeviceModel" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)||serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate)) + { + AddIf( null != (((object)this._vMImage)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._vMImage.ToString()) : null, "vmImage" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) + { + if (null != this._volume) + { + var __h = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.XNodeArray(); + foreach( var __i in this._volume ) + { + AddIf(null != (((object)__i)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(__i.ToString()) : null ,__h.Add); + } + container.Add("volumes",__h); + } + } + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject instance to deserialize from. + internal VirtualMachineProperties(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_cloudServicesNetworkAttachment = If( json?.PropertyT("cloudServicesNetworkAttachment"), out var __jsonCloudServicesNetworkAttachment) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.NetworkAttachment.FromJson(__jsonCloudServicesNetworkAttachment) : _cloudServicesNetworkAttachment;} + {_consoleExtendedLocation = If( json?.PropertyT("consoleExtendedLocation"), out var __jsonConsoleExtendedLocation) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ExtendedLocation.FromJson(__jsonConsoleExtendedLocation) : _consoleExtendedLocation;} + {_storageProfile = If( json?.PropertyT("storageProfile"), out var __jsonStorageProfile) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.StorageProfile.FromJson(__jsonStorageProfile) : _storageProfile;} + {_vMImageRepositoryCredentials = If( json?.PropertyT("vmImageRepositoryCredentials"), out var __jsonVMImageRepositoryCredentials) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ImageRepositoryCredentials.FromJson(__jsonVMImageRepositoryCredentials) : _vMImageRepositoryCredentials;} + {_adminUsername = If( json?.PropertyT("adminUsername"), out var __jsonAdminUsername) ? (string)__jsonAdminUsername : (string)_adminUsername;} + {_availabilityZone = If( json?.PropertyT("availabilityZone"), out var __jsonAvailabilityZone) ? (string)__jsonAvailabilityZone : (string)_availabilityZone;} + {_bareMetalMachineId = If( json?.PropertyT("bareMetalMachineId"), out var __jsonBareMetalMachineId) ? (string)__jsonBareMetalMachineId : (string)_bareMetalMachineId;} + {_bootMethod = If( json?.PropertyT("bootMethod"), out var __jsonBootMethod) ? (string)__jsonBootMethod : (string)_bootMethod;} + {_clusterId = If( json?.PropertyT("clusterId"), out var __jsonClusterId) ? (string)__jsonClusterId : (string)_clusterId;} + {_cpuCore = If( json?.PropertyT("cpuCores"), out var __jsonCpuCores) ? (long?)__jsonCpuCores : _cpuCore;} + {_detailedStatus = If( json?.PropertyT("detailedStatus"), out var __jsonDetailedStatus) ? (string)__jsonDetailedStatus : (string)_detailedStatus;} + {_detailedStatusMessage = If( json?.PropertyT("detailedStatusMessage"), out var __jsonDetailedStatusMessage) ? (string)__jsonDetailedStatusMessage : (string)_detailedStatusMessage;} + {_isolateEmulatorThread = If( json?.PropertyT("isolateEmulatorThread"), out var __jsonIsolateEmulatorThread) ? (string)__jsonIsolateEmulatorThread : (string)_isolateEmulatorThread;} + {_memorySizeGb = If( json?.PropertyT("memorySizeGB"), out var __jsonMemorySizeGb) ? (long?)__jsonMemorySizeGb : _memorySizeGb;} + {_networkAttachment = If( json?.PropertyT("networkAttachments"), out var __jsonNetworkAttachments) ? If( __jsonNetworkAttachments as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.INetworkAttachment) (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.NetworkAttachment.FromJson(__u) )) ))() : null : _networkAttachment;} + {_networkData = If( json?.PropertyT("networkData"), out var __jsonNetworkData) ? (string)__jsonNetworkData : (string)_networkData;} + {_placementHint = If( json?.PropertyT("placementHints"), out var __jsonPlacementHints) ? If( __jsonPlacementHints as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.IVirtualMachinePlacementHint) (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.VirtualMachinePlacementHint.FromJson(__p) )) ))() : null : _placementHint;} + {_powerState = If( json?.PropertyT("powerState"), out var __jsonPowerState) ? (string)__jsonPowerState : (string)_powerState;} + {_provisioningState = If( json?.PropertyT("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)_provisioningState;} + {_sshPublicKey = If( json?.PropertyT("sshPublicKeys"), out var __jsonSshPublicKeys) ? If( __jsonSshPublicKeys as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonArray, out var __l) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__l, (__k)=>(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISshPublicKey) (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.SshPublicKey.FromJson(__k) )) ))() : null : _sshPublicKey;} + {_userData = If( json?.PropertyT("userData"), out var __jsonUserData) ? (string)__jsonUserData : (string)_userData;} + {_virtioInterface = If( json?.PropertyT("virtioInterface"), out var __jsonVirtioInterface) ? (string)__jsonVirtioInterface : (string)_virtioInterface;} + {_vMDeviceModel = If( json?.PropertyT("vmDeviceModel"), out var __jsonVMDeviceModel) ? (string)__jsonVMDeviceModel : (string)_vMDeviceModel;} + {_vMImage = If( json?.PropertyT("vmImage"), out var __jsonVMImage) ? (string)__jsonVMImage : (string)_vMImage;} + {_volume = If( json?.PropertyT("volumes"), out var __jsonVolumes) ? If( __jsonVolumes as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Json.JsonString __e ? (string)(__e.ToString()) : null)) ))() : null : _volume;} + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Volume.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Volume.PowerShell.cs new file mode 100644 index 000000000000..78ce603c596e --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Volume.PowerShell.cs @@ -0,0 +1,342 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + + /// + /// Volume represents storage made available for use by resources running on the cluster. + /// + [System.ComponentModel.TypeConverter(typeof(VolumeTypeConverter))] + public partial class Volume + { + + /// + /// 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.NetworkCloud.Models.IVolume DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new Volume(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.NetworkCloud.Models.IVolume DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new Volume(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.NetworkCloud.Models.IVolume FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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 Volume(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ExtendedLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumeInternal)this).ExtendedLocation = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocation) content.GetValueForProperty("ExtendedLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumeInternal)this).ExtendedLocation, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ExtendedLocationTypeConverter.ConvertFrom); + } + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumeInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumeProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumeInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.VolumePropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Etag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumeInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumeInternal)this).Etag, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)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("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedByType = (string) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedByType = (string) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.TrackedResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("ExtendedLocationName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumeInternal)this).ExtendedLocationName = (string) content.GetValueForProperty("ExtendedLocationName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumeInternal)this).ExtendedLocationName, global::System.Convert.ToString); + } + if (content.Contains("ExtendedLocationType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumeInternal)this).ExtendedLocationType = (string) content.GetValueForProperty("ExtendedLocationType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumeInternal)this).ExtendedLocationType, global::System.Convert.ToString); + } + if (content.Contains("AttachedTo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumeInternal)this).AttachedTo = (System.Collections.Generic.List) content.GetValueForProperty("AttachedTo",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumeInternal)this).AttachedTo, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("DetailedStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumeInternal)this).DetailedStatus = (string) content.GetValueForProperty("DetailedStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumeInternal)this).DetailedStatus, global::System.Convert.ToString); + } + if (content.Contains("DetailedStatusMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumeInternal)this).DetailedStatusMessage = (string) content.GetValueForProperty("DetailedStatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumeInternal)this).DetailedStatusMessage, global::System.Convert.ToString); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumeInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumeInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("SerialNumber")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumeInternal)this).SerialNumber = (string) content.GetValueForProperty("SerialNumber",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumeInternal)this).SerialNumber, global::System.Convert.ToString); + } + if (content.Contains("SizeMiB")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumeInternal)this).SizeMiB = (long?) content.GetValueForProperty("SizeMiB",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumeInternal)this).SizeMiB, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal Volume(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ExtendedLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumeInternal)this).ExtendedLocation = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocation) content.GetValueForProperty("ExtendedLocation",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumeInternal)this).ExtendedLocation, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ExtendedLocationTypeConverter.ConvertFrom); + } + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumeInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumeProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumeInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.VolumePropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Etag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumeInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumeInternal)this).Etag, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)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("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedByType = (string) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataCreatedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedByType = (string) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.TrackedResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("ExtendedLocationName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumeInternal)this).ExtendedLocationName = (string) content.GetValueForProperty("ExtendedLocationName",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumeInternal)this).ExtendedLocationName, global::System.Convert.ToString); + } + if (content.Contains("ExtendedLocationType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumeInternal)this).ExtendedLocationType = (string) content.GetValueForProperty("ExtendedLocationType",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumeInternal)this).ExtendedLocationType, global::System.Convert.ToString); + } + if (content.Contains("AttachedTo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumeInternal)this).AttachedTo = (System.Collections.Generic.List) content.GetValueForProperty("AttachedTo",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumeInternal)this).AttachedTo, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("DetailedStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumeInternal)this).DetailedStatus = (string) content.GetValueForProperty("DetailedStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumeInternal)this).DetailedStatus, global::System.Convert.ToString); + } + if (content.Contains("DetailedStatusMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumeInternal)this).DetailedStatusMessage = (string) content.GetValueForProperty("DetailedStatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumeInternal)this).DetailedStatusMessage, global::System.Convert.ToString); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumeInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumeInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("SerialNumber")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumeInternal)this).SerialNumber = (string) content.GetValueForProperty("SerialNumber",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumeInternal)this).SerialNumber, global::System.Convert.ToString); + } + if (content.Contains("SizeMiB")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumeInternal)this).SizeMiB = (long?) content.GetValueForProperty("SizeMiB",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumeInternal)this).SizeMiB, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + AfterDeserializePSObject(content); + } + } + /// Volume represents storage made available for use by resources running on the cluster. + [System.ComponentModel.TypeConverter(typeof(VolumeTypeConverter))] + public partial interface IVolume + + { + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/Volume.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Volume.TypeConverter.cs similarity index 98% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/Volume.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Volume.TypeConverter.cs index 7312410d4812..121a8fc9dbc3 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/Volume.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Volume.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IVolume ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolume ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolume).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolume).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Volume.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Volume.cs new file mode 100644 index 000000000000..45b24d8f47e3 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Volume.cs @@ -0,0 +1,351 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + + /// + /// Volume represents storage made available for use by resources running on the cluster. + /// + public partial class Volume : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolume, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumeInternal, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResource __trackedResource = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.TrackedResource(); + + /// + /// The list of resource IDs that attach the volume. It may include virtual machines and Hybrid AKS clusters. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public System.Collections.Generic.List AttachedTo { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumePropertiesInternal)Property).AttachedTo; } + + /// The more detailed status of the volume. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string DetailedStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumePropertiesInternal)Property).DetailedStatus; } + + /// The descriptive message about the current detailed status. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string DetailedStatusMessage { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumePropertiesInternal)Property).DetailedStatusMessage; } + + /// Backing field for property. + private string _etag; + + /// Resource ETag. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string Etag { get => this._etag; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocation _extendedLocation; + + /// The extended location of the cluster associated with the resource. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocation ExtendedLocation { get => (this._extendedLocation = this._extendedLocation ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ExtendedLocation()); set => this._extendedLocation = value; } + + /// The resource ID of the extended location on which the resource will be created. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string ExtendedLocationName { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocationInternal)ExtendedLocation).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocationInternal)ExtendedLocation).Name = value ?? null; } + + /// The extended location type, for example, CustomLocation. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string ExtendedLocationType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocationInternal)ExtendedLocation).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocationInternal)ExtendedLocation).Type = value ?? null; } + + /// + /// Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).Id; } + + /// The geo-location where the resource lives + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)__trackedResource).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)__trackedResource).Location = value ?? null; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).Id = value ?? null; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).Name = value ?? null; } + + /// Internal Acessors for SystemData + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISystemData Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemData; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemData = value ?? null /* model class */; } + + /// Internal Acessors for SystemDataCreatedAt + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataCreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataCreatedAt = value ?? default(global::System.DateTime); } + + /// Internal Acessors for SystemDataCreatedBy + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataCreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataCreatedBy = value ?? null; } + + /// Internal Acessors for SystemDataCreatedByType + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataCreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataCreatedByType = value ?? null; } + + /// Internal Acessors for SystemDataLastModifiedAt + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedAt = value ?? default(global::System.DateTime); } + + /// Internal Acessors for SystemDataLastModifiedBy + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedBy = value ?? null; } + + /// Internal Acessors for SystemDataLastModifiedByType + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedByType = value ?? null; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).Type = value ?? null; } + + /// Internal Acessors for AttachedTo + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumeInternal.AttachedTo { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumePropertiesInternal)Property).AttachedTo; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumePropertiesInternal)Property).AttachedTo = value ?? null /* arrayOf */; } + + /// Internal Acessors for DetailedStatus + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumeInternal.DetailedStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumePropertiesInternal)Property).DetailedStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumePropertiesInternal)Property).DetailedStatus = value ?? null; } + + /// Internal Acessors for DetailedStatusMessage + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumeInternal.DetailedStatusMessage { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumePropertiesInternal)Property).DetailedStatusMessage; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumePropertiesInternal)Property).DetailedStatusMessage = value ?? null; } + + /// Internal Acessors for Etag + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumeInternal.Etag { get => this._etag; set { {_etag = value;} } } + + /// Internal Acessors for ExtendedLocation + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocation Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumeInternal.ExtendedLocation { get => (this._extendedLocation = this._extendedLocation ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ExtendedLocation()); set { {_extendedLocation = value;} } } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumeProperties Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumeInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.VolumeProperties()); set { {_property = value;} } } + + /// Internal Acessors for ProvisioningState + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumeInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumePropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumePropertiesInternal)Property).ProvisioningState = value ?? null; } + + /// Internal Acessors for SerialNumber + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumeInternal.SerialNumber { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumePropertiesInternal)Property).SerialNumber; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumePropertiesInternal)Property).SerialNumber = value ?? null; } + + /// The name of the resource + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).Name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumeProperties _property; + + /// The list of the resource properties. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumeProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.VolumeProperties()); set => this._property = value; } + + /// The provisioning state of the volume. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumePropertiesInternal)Property).ProvisioningState; } + + /// Gets the resource group name + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string ResourceGroupName { get => (new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Success ? new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Groups["resourceGroupName"].Value : null); } + + /// The unique identifier of the volume. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public string SerialNumber { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumePropertiesInternal)Property).SerialNumber; } + + /// The size of the allocation for this volume in Mebibytes. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inlined)] + public long? SizeMiB { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumePropertiesInternal)Property).SizeMiB; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumePropertiesInternal)Property).SizeMiB = value ?? default(long); } + + /// + /// Azure Resource Manager metadata containing createdBy and modifiedBy information. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + internal Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISystemData SystemData { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemData; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemData = value ?? null /* model class */; } + + /// The timestamp of resource creation (UTC). + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataCreatedAt; } + + /// The identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataCreatedBy; } + + /// The type of identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public string SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataCreatedByType; } + + /// The timestamp of resource last modification (UTC) + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedAt; } + + /// The identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedBy; } + + /// The type of identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public string SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).SystemDataLastModifiedByType; } + + /// Resource tags. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal)__trackedResource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IResourceInternal)__trackedResource).Type; } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__trackedResource), __trackedResource); + await eventListener.AssertObjectIsValid(nameof(__trackedResource), __trackedResource); + } + + /// Creates an new instance. + public Volume() + { + + } + } + /// Volume represents storage made available for use by resources running on the cluster. + public partial interface IVolume : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResource + { + /// + /// The list of resource IDs that attach the volume. It may include virtual machines and Hybrid AKS clusters. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The list of resource IDs that attach the volume. It may include virtual machines and Hybrid AKS clusters.", + SerializedName = @"attachedTo", + PossibleTypes = new [] { typeof(string) })] + System.Collections.Generic.List AttachedTo { get; } + /// The more detailed status of the volume. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The more detailed status of the volume.", + SerializedName = @"detailedStatus", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Error", "Active", "Provisioning")] + string DetailedStatus { get; } + /// The descriptive message about the current detailed status. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The descriptive message about the current detailed status.", + SerializedName = @"detailedStatusMessage", + PossibleTypes = new [] { typeof(string) })] + string DetailedStatusMessage { get; } + /// Resource ETag. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"Resource ETag.", + SerializedName = @"etag", + PossibleTypes = new [] { typeof(string) })] + string Etag { get; } + /// The resource ID of the extended location on which the resource will be created. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The resource ID of the extended location on which the resource will be created.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string ExtendedLocationName { get; set; } + /// The extended location type, for example, CustomLocation. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The extended location type, for example, CustomLocation.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + string ExtendedLocationType { get; set; } + /// The provisioning state of the volume. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The provisioning state of the volume.", + SerializedName = @"provisioningState", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Succeeded", "Failed", "Canceled", "Provisioning", "Accepted")] + string ProvisioningState { get; } + /// The unique identifier of the volume. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The unique identifier of the volume.", + SerializedName = @"serialNumber", + PossibleTypes = new [] { typeof(string) })] + string SerialNumber { get; } + /// The size of the allocation for this volume in Mebibytes. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The size of the allocation for this volume in Mebibytes.", + SerializedName = @"sizeMiB", + PossibleTypes = new [] { typeof(long) })] + long? SizeMiB { get; set; } + + } + /// Volume represents storage made available for use by resources running on the cluster. + internal partial interface IVolumeInternal : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceInternal + { + /// + /// The list of resource IDs that attach the volume. It may include virtual machines and Hybrid AKS clusters. + /// + System.Collections.Generic.List AttachedTo { get; set; } + /// The more detailed status of the volume. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Error", "Active", "Provisioning")] + string DetailedStatus { get; set; } + /// The descriptive message about the current detailed status. + string DetailedStatusMessage { get; set; } + /// Resource ETag. + string Etag { get; set; } + /// The extended location of the cluster associated with the resource. + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IExtendedLocation ExtendedLocation { get; set; } + /// The resource ID of the extended location on which the resource will be created. + string ExtendedLocationName { get; set; } + /// The extended location type, for example, CustomLocation. + string ExtendedLocationType { get; set; } + /// The list of the resource properties. + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumeProperties Property { get; set; } + /// The provisioning state of the volume. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Succeeded", "Failed", "Canceled", "Provisioning", "Accepted")] + string ProvisioningState { get; set; } + /// The unique identifier of the volume. + string SerialNumber { get; set; } + /// The size of the allocation for this volume in Mebibytes. + long? SizeMiB { get; set; } + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/Volume.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Volume.json.cs similarity index 90% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/Volume.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Volume.json.cs index 9aeffacdc7dc..dd1f09e31569 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/Volume.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Volume.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -56,13 +56,11 @@ public partial class Volume partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolume. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolume. /// /// a to deserialize from. - /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolume. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolume FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolume. + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolume FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new Volume(json) : null; } @@ -89,7 +87,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode ToJ __trackedResource?.ToJson(container, serializationMode); AddIf( null != this._extendedLocation ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) this._extendedLocation.ToJson(null,serializationMode) : null, "extendedLocation" ,container.Add ); AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._etag)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._etag.ToString()) : null, "etag" ,container.Add ); } @@ -109,10 +107,10 @@ internal Volume(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.Jso { return; } - __trackedResource = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.TrackedResource(json); - {_extendedLocation = If( json?.PropertyT("extendedLocation"), out var __jsonExtendedLocation) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ExtendedLocation.FromJson(__jsonExtendedLocation) : ExtendedLocation;} - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.VolumeProperties.FromJson(__jsonProperties) : Property;} - {_etag = If( json?.PropertyT("etag"), out var __jsonEtag) ? (string)__jsonEtag : (string)Etag;} + __trackedResource = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.TrackedResource(json); + {_extendedLocation = If( json?.PropertyT("extendedLocation"), out var __jsonExtendedLocation) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ExtendedLocation.FromJson(__jsonExtendedLocation) : _extendedLocation;} + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.VolumeProperties.FromJson(__jsonProperties) : _property;} + {_etag = If( json?.PropertyT("etag"), out var __jsonEtag) ? (string)__jsonEtag : (string)_etag;} AfterFromJson(json); } } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VolumeList.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VolumeList.PowerShell.cs similarity index 78% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VolumeList.PowerShell.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VolumeList.PowerShell.cs index 12d44749b44b..8efc392e606b 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VolumeList.PowerShell.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VolumeList.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; @@ -63,27 +63,27 @@ public partial class VolumeList 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.NetworkCloud.Models.Api20250201.IVolumeList DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumeList DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new VolumeList(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.NetworkCloud.Models.Api20250201.IVolumeList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumeList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new VolumeList(content); } @@ -93,7 +93,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolumeList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumeList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 VolumeList(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolumeListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolumeListInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumeListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumeListInternal)this).NextLink, global::System.Convert.ToString); } if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolumeListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolume[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolumeListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.VolumeTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumeListInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumeListInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.VolumeTypeConverter.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. @@ -153,11 +153,11 @@ internal VolumeList(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolumeListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolumeListInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumeListInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumeListInternal)this).NextLink, global::System.Convert.ToString); } if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolumeListInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolume[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolumeListInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.VolumeTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumeListInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumeListInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.VolumeTypeConverter.ConvertFrom)); } AfterDeserializePSObject(content); } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VolumeList.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VolumeList.TypeConverter.cs similarity index 98% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VolumeList.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VolumeList.TypeConverter.cs index 1dea3f3e96f1..7e9f6bb386a4 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VolumeList.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VolumeList.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IVolumeList ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumeList ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolumeList).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumeList).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VolumeList.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VolumeList.cs new file mode 100644 index 000000000000..a48e1d80aa9c --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VolumeList.cs @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + + /// VolumeList represents a list of volumes. + public partial class VolumeList : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumeList, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumeListInternal + { + + /// Backing field for property. + private string _nextLink; + + /// The link used to get the next page of operations. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; set => this._nextLink = value; } + + /// Backing field for property. + private System.Collections.Generic.List _value; + + /// The list of volumes. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public System.Collections.Generic.List Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public VolumeList() + { + + } + } + /// VolumeList represents a list of volumes. + public partial interface IVolumeList : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable + { + /// The link used to get the next page of operations. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The link used to get the next page of operations.", + SerializedName = @"nextLink", + PossibleTypes = new [] { typeof(string) })] + string NextLink { get; set; } + /// The list of volumes. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The list of volumes.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolume) })] + System.Collections.Generic.List Value { get; set; } + + } + /// VolumeList represents a list of volumes. + internal partial interface IVolumeListInternal + + { + /// The link used to get the next page of operations. + string NextLink { get; set; } + /// The list of volumes. + System.Collections.Generic.List Value { get; set; } + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VolumeList.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VolumeList.json.cs similarity index 91% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VolumeList.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VolumeList.json.cs index acad8651b896..43f1cf7bfaa9 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VolumeList.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VolumeList.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class VolumeList partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolumeList. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumeList. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolumeList. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumeList. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolumeList FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumeList FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new VolumeList(json) : null; } @@ -110,8 +110,8 @@ internal VolumeList(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json { return; } - {_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.NetworkCloud.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.NetworkCloud.Models.Api20250201.IVolume) (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.Volume.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.NetworkCloud.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.NetworkCloud.Models.IVolume) (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Volume.FromJson(__u) )) ))() : null : _value;} AfterFromJson(json); } } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VolumePatchParameters.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VolumePatchParameters.PowerShell.cs similarity index 82% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VolumePatchParameters.PowerShell.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VolumePatchParameters.PowerShell.cs index d0764dbf42bb..91fa47cb4702 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VolumePatchParameters.PowerShell.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VolumePatchParameters.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; @@ -65,27 +65,27 @@ public partial class VolumePatchParameters 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.NetworkCloud.Models.Api20250201.IVolumePatchParameters DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumePatchParameters DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new VolumePatchParameters(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.NetworkCloud.Models.Api20250201.IVolumePatchParameters DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumePatchParameters DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new VolumePatchParameters(content); } @@ -95,7 +95,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolumePatchParameters FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumePatchParameters FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 VolumePatchParameters(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolumePatchParametersInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolumePatchParametersTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolumePatchParametersInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.VolumePatchParametersTagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumePatchParametersInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumePatchParametersTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumePatchParametersInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.VolumePatchParametersTagsTypeConverter.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 VolumePatchParameters(global::System.Management.Automation.PSObject con // actually deserialize if (content.Contains("Tag")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolumePatchParametersInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolumePatchParametersTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolumePatchParametersInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.VolumePatchParametersTagsTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumePatchParametersInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumePatchParametersTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumePatchParametersInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.VolumePatchParametersTagsTypeConverter.ConvertFrom); } AfterDeserializePSObject(content); } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VolumePatchParameters.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VolumePatchParameters.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VolumePatchParameters.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VolumePatchParameters.TypeConverter.cs index d3b94aa1b197..99119d98865b 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VolumePatchParameters.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VolumePatchParameters.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IVolumePatchParameters ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumePatchParameters ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolumePatchParameters).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumePatchParameters).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VolumePatchParameters.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VolumePatchParameters.cs new file mode 100644 index 000000000000..21446b5e852d --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VolumePatchParameters.cs @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + + /// + /// VolumePatchParameters represents the body of the request to patch the volume resource. + /// + public partial class VolumePatchParameters : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumePatchParameters, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumePatchParametersInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumePatchParametersTags _tag; + + /// The Azure resource tags that will replace the existing ones. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumePatchParametersTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.VolumePatchParametersTags()); set => this._tag = value; } + + /// Creates an new instance. + public VolumePatchParameters() + { + + } + } + /// VolumePatchParameters represents the body of the request to patch the volume resource. + public partial interface IVolumePatchParameters : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable + { + /// The Azure resource tags that will replace the existing ones. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The Azure resource tags that will replace the existing ones.", + SerializedName = @"tags", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumePatchParametersTags) })] + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumePatchParametersTags Tag { get; set; } + + } + /// VolumePatchParameters represents the body of the request to patch the volume resource. + internal partial interface IVolumePatchParametersInternal + + { + /// The Azure resource tags that will replace the existing ones. + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumePatchParametersTags Tag { get; set; } + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VolumePatchParameters.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VolumePatchParameters.json.cs similarity index 94% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VolumePatchParameters.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VolumePatchParameters.json.cs index 88576b240ea1..1121c42c3462 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VolumePatchParameters.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VolumePatchParameters.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -56,13 +56,13 @@ public partial class VolumePatchParameters partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolumePatchParameters. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumePatchParameters. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolumePatchParameters. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumePatchParameters. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolumePatchParameters FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumePatchParameters FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new VolumePatchParameters(json) : null; } @@ -103,7 +103,7 @@ internal VolumePatchParameters(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.R { return; } - {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.VolumePatchParametersTags.FromJson(__jsonTags) : Tag;} + {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.VolumePatchParametersTags.FromJson(__jsonTags) : _tag;} AfterFromJson(json); } } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VolumePatchParametersTags.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VolumePatchParametersTags.PowerShell.cs similarity index 89% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VolumePatchParametersTags.PowerShell.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VolumePatchParametersTags.PowerShell.cs index 938adfef811d..f8be932898ff 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VolumePatchParametersTags.PowerShell.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VolumePatchParametersTags.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; @@ -63,29 +63,27 @@ public partial class VolumePatchParametersTags 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.NetworkCloud.Models.Api20250201.IVolumePatchParametersTags DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumePatchParametersTags DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new VolumePatchParametersTags(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.NetworkCloud.Models.Api20250201.IVolumePatchParametersTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumePatchParametersTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new VolumePatchParametersTags(content); } @@ -95,7 +93,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolumePatchParametersTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumePatchParametersTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 VolumePatchParametersTags(global::System.Collections.IDictionary conten } /// - /// 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/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VolumePatchParametersTags.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VolumePatchParametersTags.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VolumePatchParametersTags.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VolumePatchParametersTags.TypeConverter.cs index fa1dde217dcb..bcac0eb78d4c 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VolumePatchParametersTags.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VolumePatchParametersTags.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IVolumePatchParametersTags ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumePatchParametersTags ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolumePatchParametersTags).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumePatchParametersTags).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VolumePatchParametersTags.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VolumePatchParametersTags.cs similarity index 84% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VolumePatchParametersTags.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VolumePatchParametersTags.cs index a0bea2d3bab1..27f05820e498 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VolumePatchParametersTags.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VolumePatchParametersTags.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; /// The Azure resource tags that will replace the existing ones. public partial class VolumePatchParametersTags : - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolumePatchParametersTags, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolumePatchParametersTagsInternal + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumePatchParametersTags, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumePatchParametersTagsInternal { /// Creates an new instance. diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VolumePatchParametersTags.dictionary.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VolumePatchParametersTags.dictionary.cs similarity index 96% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VolumePatchParametersTags.dictionary.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VolumePatchParametersTags.dictionary.cs index 2ccdbdc14f0a..ab2081cdf698 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VolumePatchParametersTags.dictionary.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VolumePatchParametersTags.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.VolumePatchParametersTags source) => source.__additionalProperties; + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.VolumePatchParametersTags source) => source.__additionalProperties; } } \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VolumePatchParametersTags.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VolumePatchParametersTags.json.cs similarity index 95% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VolumePatchParametersTags.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VolumePatchParametersTags.json.cs index fe62b088eeec..0fd2d9e1e895 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VolumePatchParametersTags.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VolumePatchParametersTags.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class VolumePatchParametersTags partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolumePatchParametersTags. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumePatchParametersTags. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolumePatchParametersTags. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumePatchParametersTags. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolumePatchParametersTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumePatchParametersTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new VolumePatchParametersTags(json) : null; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VolumeProperties.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VolumeProperties.PowerShell.cs new file mode 100644 index 000000000000..1d7db62e372d --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VolumeProperties.PowerShell.cs @@ -0,0 +1,204 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + + /// VolumeProperties represents properties of the volume resource. + [System.ComponentModel.TypeConverter(typeof(VolumePropertiesTypeConverter))] + public partial class VolumeProperties + { + + /// + /// 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.NetworkCloud.Models.IVolumeProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new VolumeProperties(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.NetworkCloud.Models.IVolumeProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new VolumeProperties(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.NetworkCloud.Models.IVolumeProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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 VolumeProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("AttachedTo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumePropertiesInternal)this).AttachedTo = (System.Collections.Generic.List) content.GetValueForProperty("AttachedTo",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumePropertiesInternal)this).AttachedTo, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("DetailedStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumePropertiesInternal)this).DetailedStatus = (string) content.GetValueForProperty("DetailedStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumePropertiesInternal)this).DetailedStatus, global::System.Convert.ToString); + } + if (content.Contains("DetailedStatusMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumePropertiesInternal)this).DetailedStatusMessage = (string) content.GetValueForProperty("DetailedStatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumePropertiesInternal)this).DetailedStatusMessage, global::System.Convert.ToString); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumePropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumePropertiesInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("SerialNumber")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumePropertiesInternal)this).SerialNumber = (string) content.GetValueForProperty("SerialNumber",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumePropertiesInternal)this).SerialNumber, global::System.Convert.ToString); + } + if (content.Contains("SizeMiB")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumePropertiesInternal)this).SizeMiB = (long?) content.GetValueForProperty("SizeMiB",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumePropertiesInternal)this).SizeMiB, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal VolumeProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("AttachedTo")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumePropertiesInternal)this).AttachedTo = (System.Collections.Generic.List) content.GetValueForProperty("AttachedTo",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumePropertiesInternal)this).AttachedTo, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("DetailedStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumePropertiesInternal)this).DetailedStatus = (string) content.GetValueForProperty("DetailedStatus",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumePropertiesInternal)this).DetailedStatus, global::System.Convert.ToString); + } + if (content.Contains("DetailedStatusMessage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumePropertiesInternal)this).DetailedStatusMessage = (string) content.GetValueForProperty("DetailedStatusMessage",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumePropertiesInternal)this).DetailedStatusMessage, global::System.Convert.ToString); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumePropertiesInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumePropertiesInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("SerialNumber")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumePropertiesInternal)this).SerialNumber = (string) content.GetValueForProperty("SerialNumber",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumePropertiesInternal)this).SerialNumber, global::System.Convert.ToString); + } + if (content.Contains("SizeMiB")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumePropertiesInternal)this).SizeMiB = (long?) content.GetValueForProperty("SizeMiB",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumePropertiesInternal)this).SizeMiB, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + AfterDeserializePSObject(content); + } + } + /// VolumeProperties represents properties of the volume resource. + [System.ComponentModel.TypeConverter(typeof(VolumePropertiesTypeConverter))] + public partial interface IVolumeProperties + + { + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VolumeProperties.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VolumeProperties.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VolumeProperties.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VolumeProperties.TypeConverter.cs index 047f6264a232..59ae14232356 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VolumeProperties.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VolumeProperties.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IVolumeProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumeProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolumeProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumeProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VolumeProperties.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VolumeProperties.cs new file mode 100644 index 000000000000..83c61e97fd2b --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VolumeProperties.cs @@ -0,0 +1,179 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + + /// VolumeProperties represents properties of the volume resource. + public partial class VolumeProperties : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumeProperties, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumePropertiesInternal + { + + /// Backing field for property. + private System.Collections.Generic.List _attachedTo; + + /// + /// The list of resource IDs that attach the volume. It may include virtual machines and Hybrid AKS clusters. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public System.Collections.Generic.List AttachedTo { get => this._attachedTo; } + + /// Backing field for property. + private string _detailedStatus; + + /// The more detailed status of the volume. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string DetailedStatus { get => this._detailedStatus; } + + /// Backing field for property. + private string _detailedStatusMessage; + + /// The descriptive message about the current detailed status. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string DetailedStatusMessage { get => this._detailedStatusMessage; } + + /// Internal Acessors for AttachedTo + System.Collections.Generic.List Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumePropertiesInternal.AttachedTo { get => this._attachedTo; set { {_attachedTo = value;} } } + + /// Internal Acessors for DetailedStatus + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumePropertiesInternal.DetailedStatus { get => this._detailedStatus; set { {_detailedStatus = value;} } } + + /// Internal Acessors for DetailedStatusMessage + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumePropertiesInternal.DetailedStatusMessage { get => this._detailedStatusMessage; set { {_detailedStatusMessage = value;} } } + + /// Internal Acessors for ProvisioningState + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumePropertiesInternal.ProvisioningState { get => this._provisioningState; set { {_provisioningState = value;} } } + + /// Internal Acessors for SerialNumber + string Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumePropertiesInternal.SerialNumber { get => this._serialNumber; set { {_serialNumber = value;} } } + + /// Backing field for property. + private string _provisioningState; + + /// The provisioning state of the volume. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string ProvisioningState { get => this._provisioningState; } + + /// Backing field for property. + private string _serialNumber; + + /// The unique identifier of the volume. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string SerialNumber { get => this._serialNumber; } + + /// Backing field for property. + private long? _sizeMiB; + + /// The size of the allocation for this volume in Mebibytes. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public long? SizeMiB { get => this._sizeMiB; set => this._sizeMiB = value; } + + /// Creates an new instance. + public VolumeProperties() + { + + } + } + /// VolumeProperties represents properties of the volume resource. + public partial interface IVolumeProperties : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable + { + /// + /// The list of resource IDs that attach the volume. It may include virtual machines and Hybrid AKS clusters. + /// + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The list of resource IDs that attach the volume. It may include virtual machines and Hybrid AKS clusters.", + SerializedName = @"attachedTo", + PossibleTypes = new [] { typeof(string) })] + System.Collections.Generic.List AttachedTo { get; } + /// The more detailed status of the volume. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The more detailed status of the volume.", + SerializedName = @"detailedStatus", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Error", "Active", "Provisioning")] + string DetailedStatus { get; } + /// The descriptive message about the current detailed status. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The descriptive message about the current detailed status.", + SerializedName = @"detailedStatusMessage", + PossibleTypes = new [] { typeof(string) })] + string DetailedStatusMessage { get; } + /// The provisioning state of the volume. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The provisioning state of the volume.", + SerializedName = @"provisioningState", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Succeeded", "Failed", "Canceled", "Provisioning", "Accepted")] + string ProvisioningState { get; } + /// The unique identifier of the volume. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, + Description = @"The unique identifier of the volume.", + SerializedName = @"serialNumber", + PossibleTypes = new [] { typeof(string) })] + string SerialNumber { get; } + /// The size of the allocation for this volume in Mebibytes. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = false, + Description = @"The size of the allocation for this volume in Mebibytes.", + SerializedName = @"sizeMiB", + PossibleTypes = new [] { typeof(long) })] + long? SizeMiB { get; set; } + + } + /// VolumeProperties represents properties of the volume resource. + internal partial interface IVolumePropertiesInternal + + { + /// + /// The list of resource IDs that attach the volume. It may include virtual machines and Hybrid AKS clusters. + /// + System.Collections.Generic.List AttachedTo { get; set; } + /// The more detailed status of the volume. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Error", "Active", "Provisioning")] + string DetailedStatus { get; set; } + /// The descriptive message about the current detailed status. + string DetailedStatusMessage { get; set; } + /// The provisioning state of the volume. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Succeeded", "Failed", "Canceled", "Provisioning", "Accepted")] + string ProvisioningState { get; set; } + /// The unique identifier of the volume. + string SerialNumber { get; set; } + /// The size of the allocation for this volume in Mebibytes. + long? SizeMiB { get; set; } + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VolumeProperties.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VolumeProperties.json.cs similarity index 85% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VolumeProperties.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VolumeProperties.json.cs index 590215330594..670bcd7687b0 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VolumeProperties.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VolumeProperties.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class VolumeProperties partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolumeProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumeProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolumeProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumeProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolumeProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumeProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new VolumeProperties(json) : null; } @@ -84,7 +84,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode ToJ { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { if (null != this._attachedTo) { @@ -96,23 +96,26 @@ public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode ToJ container.Add("attachedTo",__w); } } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._detailedStatus)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._detailedStatus.ToString()) : null, "detailedStatus" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._detailedStatusMessage)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._detailedStatusMessage.ToString()) : null, "detailedStatusMessage" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._provisioningState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._provisioningState.ToString()) : null, "provisioningState" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._serialNumber)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonString(this._serialNumber.ToString()) : null, "serialNumber" ,container.Add ); } - AddIf( (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNumber(this._sizeMiB), "sizeMiB" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeRead)||serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate)) + { + AddIf( null != this._sizeMiB ? (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNumber((long)this._sizeMiB) : null, "sizeMiB" ,container.Add ); + } AfterToJson(ref container); return container; } @@ -129,12 +132,12 @@ internal VolumeProperties(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtim { return; } - {_attachedTo = If( json?.PropertyT("attachedTo"), out var __jsonAttachedTo) ? If( __jsonAttachedTo as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : AttachedTo;} - {_detailedStatus = If( json?.PropertyT("detailedStatus"), out var __jsonDetailedStatus) ? (string)__jsonDetailedStatus : (string)DetailedStatus;} - {_detailedStatusMessage = If( json?.PropertyT("detailedStatusMessage"), out var __jsonDetailedStatusMessage) ? (string)__jsonDetailedStatusMessage : (string)DetailedStatusMessage;} - {_provisioningState = If( json?.PropertyT("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)ProvisioningState;} - {_serialNumber = If( json?.PropertyT("serialNumber"), out var __jsonSerialNumber) ? (string)__jsonSerialNumber : (string)SerialNumber;} - {_sizeMiB = If( json?.PropertyT("sizeMiB"), out var __jsonSizeMiB) ? (long)__jsonSizeMiB : SizeMiB;} + {_attachedTo = If( json?.PropertyT("attachedTo"), out var __jsonAttachedTo) ? If( __jsonAttachedTo as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : _attachedTo;} + {_detailedStatus = If( json?.PropertyT("detailedStatus"), out var __jsonDetailedStatus) ? (string)__jsonDetailedStatus : (string)_detailedStatus;} + {_detailedStatusMessage = If( json?.PropertyT("detailedStatusMessage"), out var __jsonDetailedStatusMessage) ? (string)__jsonDetailedStatusMessage : (string)_detailedStatusMessage;} + {_provisioningState = If( json?.PropertyT("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)_provisioningState;} + {_serialNumber = If( json?.PropertyT("serialNumber"), out var __jsonSerialNumber) ? (string)__jsonSerialNumber : (string)_serialNumber;} + {_sizeMiB = If( json?.PropertyT("sizeMiB"), out var __jsonSizeMiB) ? (long?)__jsonSizeMiB : _sizeMiB;} AfterFromJson(json); } } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VulnerabilityScanningSettings.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VulnerabilityScanningSettings.PowerShell.cs similarity index 81% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VulnerabilityScanningSettings.PowerShell.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VulnerabilityScanningSettings.PowerShell.cs index e73f3dd20b9a..20e54448eec6 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VulnerabilityScanningSettings.PowerShell.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VulnerabilityScanningSettings.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; @@ -65,29 +65,27 @@ public partial class VulnerabilityScanningSettings 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.NetworkCloud.Models.Api20250201.IVulnerabilityScanningSettings DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVulnerabilityScanningSettings DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new VulnerabilityScanningSettings(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.NetworkCloud.Models.Api20250201.IVulnerabilityScanningSettings DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVulnerabilityScanningSettings DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new VulnerabilityScanningSettings(content); } @@ -97,7 +95,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201 /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVulnerabilityScanningSettings FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVulnerabilityScanningSettings FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 VulnerabilityScanningSettings(global::System.Collections.IDictionary co // actually deserialize if (content.Contains("ContainerScan")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVulnerabilityScanningSettingsInternal)this).ContainerScan = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VulnerabilityScanningSettingsContainerScan?) content.GetValueForProperty("ContainerScan",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVulnerabilityScanningSettingsInternal)this).ContainerScan, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VulnerabilityScanningSettingsContainerScan.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVulnerabilityScanningSettingsInternal)this).ContainerScan = (string) content.GetValueForProperty("ContainerScan",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVulnerabilityScanningSettingsInternal)this).ContainerScan, 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 VulnerabilityScanningSettings(global::System.Management.Automation.PSOb // actually deserialize if (content.Contains("ContainerScan")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVulnerabilityScanningSettingsInternal)this).ContainerScan = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VulnerabilityScanningSettingsContainerScan?) content.GetValueForProperty("ContainerScan",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVulnerabilityScanningSettingsInternal)this).ContainerScan, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VulnerabilityScanningSettingsContainerScan.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVulnerabilityScanningSettingsInternal)this).ContainerScan = (string) content.GetValueForProperty("ContainerScan",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVulnerabilityScanningSettingsInternal)this).ContainerScan, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VulnerabilityScanningSettings.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VulnerabilityScanningSettings.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VulnerabilityScanningSettings.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VulnerabilityScanningSettings.TypeConverter.cs index dd4a50217fbf..aab699501cc9 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VulnerabilityScanningSettings.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VulnerabilityScanningSettings.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IVulnerabilityScanningSettings ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVulnerabilityScanningSettings ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVulnerabilityScanningSettings).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVulnerabilityScanningSettings).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VulnerabilityScanningSettings.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VulnerabilityScanningSettings.cs new file mode 100644 index 000000000000..fa01d171b882 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VulnerabilityScanningSettings.cs @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + + /// + /// VulnerabilityScanningSettings represents the settings for how security vulnerability scanning is applied to the cluster. + /// + public partial class VulnerabilityScanningSettings : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVulnerabilityScanningSettings, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVulnerabilityScanningSettingsInternal + { + + /// Backing field for property. + private string _containerScan; + + /// The mode selection for container vulnerability scanning. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string ContainerScan { get => this._containerScan; set => this._containerScan = value; } + + /// Creates an new instance. + public VulnerabilityScanningSettings() + { + + } + } + /// VulnerabilityScanningSettings represents the settings for how security vulnerability scanning is applied to the cluster. + public partial interface IVulnerabilityScanningSettings : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable + { + /// The mode selection for container vulnerability scanning. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The mode selection for container vulnerability scanning.", + SerializedName = @"containerScan", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Disabled", "Enabled")] + string ContainerScan { get; set; } + + } + /// VulnerabilityScanningSettings represents the settings for how security vulnerability scanning is applied to the cluster. + internal partial interface IVulnerabilityScanningSettingsInternal + + { + /// The mode selection for container vulnerability scanning. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Disabled", "Enabled")] + string ContainerScan { get; set; } + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VulnerabilityScanningSettings.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VulnerabilityScanningSettings.json.cs similarity index 95% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VulnerabilityScanningSettings.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VulnerabilityScanningSettings.json.cs index 08b7cee44f59..4711be5a00ea 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VulnerabilityScanningSettings.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VulnerabilityScanningSettings.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -56,13 +56,13 @@ public partial class VulnerabilityScanningSettings partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVulnerabilityScanningSettings. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVulnerabilityScanningSettings. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVulnerabilityScanningSettings. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVulnerabilityScanningSettings. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVulnerabilityScanningSettings FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVulnerabilityScanningSettings FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new VulnerabilityScanningSettings(json) : null; } @@ -103,7 +103,7 @@ internal VulnerabilityScanningSettings(Microsoft.Azure.PowerShell.Cmdlets.Networ { return; } - {_containerScan = If( json?.PropertyT("containerScan"), out var __jsonContainerScan) ? (string)__jsonContainerScan : (string)ContainerScan;} + {_containerScan = If( json?.PropertyT("containerScan"), out var __jsonContainerScan) ? (string)__jsonContainerScan : (string)_containerScan;} AfterFromJson(json); } } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VulnerabilityScanningSettingsPatch.PowerShell.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VulnerabilityScanningSettingsPatch.PowerShell.cs similarity index 81% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VulnerabilityScanningSettingsPatch.PowerShell.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VulnerabilityScanningSettingsPatch.PowerShell.cs index 2c466c6b3439..f3aafe00bc5e 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VulnerabilityScanningSettingsPatch.PowerShell.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VulnerabilityScanningSettingsPatch.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; @@ -65,29 +65,29 @@ public partial class VulnerabilityScanningSettingsPatch 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.NetworkCloud.Models.Api20250201.IVulnerabilityScanningSettingsPatch DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVulnerabilityScanningSettingsPatch DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new VulnerabilityScanningSettingsPatch(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.NetworkCloud.Models.Api20250201.IVulnerabilityScanningSettingsPatch DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVulnerabilityScanningSettingsPatch DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new VulnerabilityScanningSettingsPatch(content); } @@ -99,7 +99,7 @@ public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201 /// /// an instance of the model class. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVulnerabilityScanningSettingsPatch FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVulnerabilityScanningSettingsPatch FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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. @@ -134,13 +134,13 @@ internal VulnerabilityScanningSettingsPatch(global::System.Collections.IDictiona // actually deserialize if (content.Contains("ContainerScan")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVulnerabilityScanningSettingsPatchInternal)this).ContainerScan = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VulnerabilityScanningSettingsContainerScan?) content.GetValueForProperty("ContainerScan",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVulnerabilityScanningSettingsPatchInternal)this).ContainerScan, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VulnerabilityScanningSettingsContainerScan.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVulnerabilityScanningSettingsPatchInternal)this).ContainerScan = (string) content.GetValueForProperty("ContainerScan",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVulnerabilityScanningSettingsPatchInternal)this).ContainerScan, 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,7 +155,7 @@ internal VulnerabilityScanningSettingsPatch(global::System.Management.Automation // actually deserialize if (content.Contains("ContainerScan")) { - ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVulnerabilityScanningSettingsPatchInternal)this).ContainerScan = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VulnerabilityScanningSettingsContainerScan?) content.GetValueForProperty("ContainerScan",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVulnerabilityScanningSettingsPatchInternal)this).ContainerScan, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VulnerabilityScanningSettingsContainerScan.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVulnerabilityScanningSettingsPatchInternal)this).ContainerScan = (string) content.GetValueForProperty("ContainerScan",((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVulnerabilityScanningSettingsPatchInternal)this).ContainerScan, global::System.Convert.ToString); } AfterDeserializePSObject(content); } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VulnerabilityScanningSettingsPatch.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VulnerabilityScanningSettingsPatch.TypeConverter.cs similarity index 97% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VulnerabilityScanningSettingsPatch.TypeConverter.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VulnerabilityScanningSettingsPatch.TypeConverter.cs index 8f7db4d84a58..cf238686401e 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VulnerabilityScanningSettingsPatch.TypeConverter.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VulnerabilityScanningSettingsPatch.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IVulnerabilityScanningSettingsPatch ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVulnerabilityScanningSettingsPatch ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVulnerabilityScanningSettingsPatch).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVulnerabilityScanningSettingsPatch).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VulnerabilityScanningSettingsPatch.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VulnerabilityScanningSettingsPatch.cs new file mode 100644 index 000000000000..355e7832f039 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VulnerabilityScanningSettingsPatch.cs @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + + /// + /// VulnerabilityScanningSettingsPatch represents the settings for how security vulnerability scanning is applied to the cluster. + /// + public partial class VulnerabilityScanningSettingsPatch : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVulnerabilityScanningSettingsPatch, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVulnerabilityScanningSettingsPatchInternal + { + + /// Backing field for property. + private string _containerScan; + + /// The mode selection for container vulnerability scanning. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Origin(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PropertyOrigin.Owned)] + public string ContainerScan { get => this._containerScan; set => this._containerScan = value; } + + /// Creates an new instance. + public VulnerabilityScanningSettingsPatch() + { + + } + } + /// VulnerabilityScanningSettingsPatch represents the settings for how security vulnerability scanning is applied to the cluster. + public partial interface IVulnerabilityScanningSettingsPatch : + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IJsonSerializable + { + /// The mode selection for container vulnerability scanning. + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Read = true, + Create = true, + Update = true, + Description = @"The mode selection for container vulnerability scanning.", + SerializedName = @"containerScan", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Disabled", "Enabled")] + string ContainerScan { get; set; } + + } + /// VulnerabilityScanningSettingsPatch represents the settings for how security vulnerability scanning is applied to the cluster. + internal partial interface IVulnerabilityScanningSettingsPatchInternal + + { + /// The mode selection for container vulnerability scanning. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Disabled", "Enabled")] + string ContainerScan { get; set; } + + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VulnerabilityScanningSettingsPatch.json.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VulnerabilityScanningSettingsPatch.json.cs similarity index 95% rename from generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VulnerabilityScanningSettingsPatch.json.cs rename to generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VulnerabilityScanningSettingsPatch.json.cs index 75a7d30c296f..67a289322c8f 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/Api20250201/VulnerabilityScanningSettingsPatch.json.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Models/VulnerabilityScanningSettingsPatch.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.NetworkCloud.Models.Api20250201 +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; @@ -56,13 +56,13 @@ public partial class VulnerabilityScanningSettingsPatch partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVulnerabilityScanningSettingsPatch. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVulnerabilityScanningSettingsPatch. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVulnerabilityScanningSettingsPatch. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVulnerabilityScanningSettingsPatch. /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVulnerabilityScanningSettingsPatch FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVulnerabilityScanningSettingsPatch FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json ? new VulnerabilityScanningSettingsPatch(json) : null; } @@ -104,7 +104,7 @@ internal VulnerabilityScanningSettingsPatch(Microsoft.Azure.PowerShell.Cmdlets.N { return; } - {_containerScan = If( json?.PropertyT("containerScan"), out var __jsonContainerScan) ? (string)__jsonContainerScan : (string)ContainerScan;} + {_containerScan = If( json?.PropertyT("containerScan"), out var __jsonContainerScan) ? (string)__jsonContainerScan : (string)_containerScan;} AfterFromJson(json); } } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/NetworkCloud.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/NetworkCloud.cs index cab7fa12d372..59e23d1d558f 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/NetworkCloud.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/NetworkCloud.cs @@ -16,7 +16,7 @@ public partial class NetworkCloud { /// - /// Create a new Kubernetes cluster agent pool or update the properties of the existing one. + /// update a new Kubernetes cluster agent pool or update the properties of the existing one. /// /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. @@ -32,10 +32,11 @@ public partial class NetworkCloud /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 AgentPoolsCreateOrUpdate(string subscriptionId, string resourceGroupName, string kubernetesClusterName, string agentPoolName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPool body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task AgentPoolsCreateOrUpdate(string subscriptionId, string resourceGroupName, string kubernetesClusterName, string agentPoolName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPool body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -74,16 +75,16 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // 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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.AgentPoolsCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + await this.AgentPoolsCreateOrUpdate_Call (request, onOk,onDefault,eventListener,sender); } } /// - /// Create a new Kubernetes cluster agent pool or update the properties of the existing one. + /// update a new Kubernetes cluster agent pool or update the properties of the existing one. /// /// /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify @@ -96,10 +97,11 @@ public partial class NetworkCloud /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 AgentPoolsCreateOrUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPool body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task AgentPoolsCreateOrUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPool body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -151,15 +153,441 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // 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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.AgentPoolsCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + await this.AgentPoolsCreateOrUpdate_Call (request, onOk,onDefault,eventListener,sender); } } - /// Actual wire call for method. + /// + /// update a new Kubernetes cluster agent pool or update the properties of the existing one. + /// + /// + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// The request body. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 AgentPoolsCreateOrUpdateViaIdentityWithResult(global::System.String viaIdentity, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPool body, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/kubernetesClusters/(?[^/]+)/agentPools/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/kubernetesClusters/{kubernetesClusterName}/agentPools/{agentPoolName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var kubernetesClusterName = _match.Groups["kubernetesClusterName"].Value; + var agentPoolName = _match.Groups["agentPoolName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.NetworkCloud/kubernetesClusters/" + + kubernetesClusterName + + "/agentPools/" + + agentPoolName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + if (null != ifNoneMatch) + { + request.Headers.Add("If-None-Match",ifNoneMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.AgentPoolsCreateOrUpdateWithResult_Call (request, eventListener,sender); + } + } + + /// + /// update a new Kubernetes cluster agent pool or update the properties of the existing one. + /// + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Kubernetes cluster. + /// The name of the Kubernetes cluster agent pool. + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// Json string supplied to the AgentPoolsCreateOrUpdate 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.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task AgentPoolsCreateOrUpdateViaJsonString(string subscriptionId, string resourceGroupName, string kubernetesClusterName, string agentPoolName, string ifMatch, string ifNoneMatch, 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.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.NetworkCloud/kubernetesClusters/" + + global::System.Uri.EscapeDataString(kubernetesClusterName) + + "/agentPools/" + + global::System.Uri.EscapeDataString(agentPoolName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + if (null != ifNoneMatch) + { + request.Headers.Add("If-None-Match",ifNoneMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.AgentPoolsCreateOrUpdate_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// + /// update a new Kubernetes cluster agent pool or update the properties of the existing one. + /// + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Kubernetes cluster. + /// The name of the Kubernetes cluster agent pool. + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// Json string supplied to the AgentPoolsCreateOrUpdate operation + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A + /// that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task AgentPoolsCreateOrUpdateViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string kubernetesClusterName, string agentPoolName, string ifMatch, string ifNoneMatch, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.NetworkCloud/kubernetesClusters/" + + global::System.Uri.EscapeDataString(kubernetesClusterName) + + "/agentPools/" + + global::System.Uri.EscapeDataString(agentPoolName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + if (null != ifNoneMatch) + { + request.Headers.Add("If-None-Match",ifNoneMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.AgentPoolsCreateOrUpdateWithResult_Call (request, eventListener,sender); + } + } + + /// + /// update a new Kubernetes cluster agent pool or update the properties of the existing one. + /// + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Kubernetes cluster. + /// The name of the Kubernetes cluster agent pool. + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// The request body. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 AgentPoolsCreateOrUpdateWithResult(string subscriptionId, string resourceGroupName, string kubernetesClusterName, string agentPoolName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPool body, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.NetworkCloud/kubernetesClusters/" + + global::System.Uri.EscapeDataString(kubernetesClusterName) + + "/agentPools/" + + global::System.Uri.EscapeDataString(agentPoolName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + if (null != ifNoneMatch) + { + request.Headers.Add("If-None-Match",ifNoneMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.AgentPoolsCreateOrUpdateWithResult_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.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A + /// that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task AgentPoolsCreateOrUpdateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + // declared final-state-via: azure-async-operation + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + break; + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AgentPool.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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 @@ -169,31 +597,28 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task AgentPoolsCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task AgentPoolsCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { global::System.Net.Http.HttpResponseMessage _response = null; try { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; var sendTask = sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // this operation supports x-ms-long-running-operation - var _originalUri = request.RequestUri.AbsoluteUri; // declared final-state-via: azure-async-operation var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) { - - // get the delay before polling. (default to 30 seconds if not present) - int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // start the delay timer (we'll await later...) - var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } // while we wait, let's grab the headers and get ready to poll. if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { @@ -202,15 +627,14 @@ public partial class NetworkCloud if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { location = _response.GetFirstHeader(@"Location"); } - var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); // and let's look at the current response body and see if we have some information we can give back to the listener var content = await _response.Content.ReadAsStringAsync(); - await waiting; - - // check for cancellation - if( eventListener.Token.IsCancellationRequested ) { return; } // drop the old response _response?.Dispose(); @@ -219,45 +643,45 @@ public partial class NetworkCloud _response = await sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // if we got back an OK, take a peek inside and see if it's done - if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) - { - var error = false; - try { - if( Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) - { - var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); - if( state is null ) - { - // the body doesn't contain any information that has the state of the LRO - // we're going to just get out, and let the consumer have the result - break; - } - - switch( state?.ToString()?.ToLower() ) - { - case "failed": - error = true; + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result break; - case "succeeded": - case "canceled": - // we're done polling. - break; - - default: - // need to keep polling! - _response.StatusCode = global::System.Net.HttpStatusCode.Created; - continue; - } - } - } catch { - // if we run into a problem peeking into the result, - // we really don't want to do anything special. - } - if (error) { - throw new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException(_response); - } - } + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException(_response); + } + } // check for terminal status code if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) @@ -276,6 +700,7 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } break; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -283,13 +708,13 @@ public partial class NetworkCloud case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AgentPool.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AgentPool.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -321,7 +746,7 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task AgentPoolsCreateOrUpdate_Validate(string subscriptionId, string resourceGroupName, string kubernetesClusterName, string agentPoolName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPool body, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task AgentPoolsCreateOrUpdate_Validate(string subscriptionId, string resourceGroupName, string kubernetesClusterName, string agentPoolName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPool body, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -331,9 +756,9 @@ public partial class NetworkCloud await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); await eventListener.AssertNotNull(nameof(kubernetesClusterName),kubernetesClusterName); - await eventListener.AssertRegEx(nameof(kubernetesClusterName),kubernetesClusterName,@"^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$"); + await eventListener.AssertRegEx(nameof(kubernetesClusterName), kubernetesClusterName, @"^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$"); await eventListener.AssertNotNull(nameof(agentPoolName),agentPoolName); - await eventListener.AssertRegEx(nameof(agentPoolName),agentPoolName,@"^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$"); + await eventListener.AssertRegEx(nameof(agentPoolName), agentPoolName, @"^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$"); await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); await eventListener.AssertNotNull(nameof(ifNoneMatch),ifNoneMatch); await eventListener.AssertNotNull(nameof(body), body); @@ -359,7 +784,7 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task AgentPoolsDelete(string subscriptionId, string resourceGroupName, string kubernetesClusterName, string agentPoolName, string ifMatch, string ifNoneMatch, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task AgentPoolsDelete(string subscriptionId, string resourceGroupName, string kubernetesClusterName, string agentPoolName, string ifMatch, string ifNoneMatch, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -398,7 +823,7 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.AgentPoolsDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + await this.AgentPoolsDelete_Call (request, onOk,onNoContent,onDefault,eventListener,sender); } } @@ -417,7 +842,7 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task AgentPoolsDeleteViaIdentity(global::System.String viaIdentity, string ifMatch, string ifNoneMatch, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task AgentPoolsDeleteViaIdentity(global::System.String viaIdentity, string ifMatch, string ifNoneMatch, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -469,11 +894,11 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.AgentPoolsDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + await this.AgentPoolsDelete_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). @@ -484,32 +909,29 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task AgentPoolsDelete_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.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task AgentPoolsDelete_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.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { global::System.Net.Http.HttpResponseMessage _response = null; try { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; var sendTask = sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // this operation supports x-ms-long-running-operation - var _originalUri = request.RequestUri.AbsoluteUri; // declared final-state-via: location var _finalUri = _response.GetFirstHeader(@"Location"); var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) { - - // get the delay before polling. (default to 30 seconds if not present) - int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // start the delay timer (we'll await later...) - var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } // while we wait, let's grab the headers and get ready to poll. if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { @@ -518,15 +940,14 @@ public partial class NetworkCloud if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { location = _response.GetFirstHeader(@"Location"); } - var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); // and let's look at the current response body and see if we have some information we can give back to the listener var content = await _response.Content.ReadAsStringAsync(); - await waiting; - - // check for cancellation - if( eventListener.Token.IsCancellationRequested ) { return; } // drop the old response _response?.Dispose(); @@ -535,45 +956,45 @@ public partial class NetworkCloud _response = await sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // if we got back an OK, take a peek inside and see if it's done - if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) - { - var error = false; - try { - if( Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) - { - var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); - if( state is null ) - { - // the body doesn't contain any information that has the state of the LRO - // we're going to just get out, and let the consumer have the result - break; - } - - switch( state?.ToString()?.ToLower() ) - { - case "failed": - error = true; + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. break; - case "succeeded": - case "canceled": - // we're done polling. - break; - - default: - // need to keep polling! - _response.StatusCode = global::System.Net.HttpStatusCode.Created; - continue; - } - } - } catch { - // if we run into a problem peeking into the result, - // we really don't want to do anything special. - } - if (error) { - throw new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException(_response); - } - } + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException(_response); + } + } // check for terminal status code if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) @@ -592,6 +1013,7 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } break; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -611,7 +1033,7 @@ public partial class NetworkCloud default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -652,9 +1074,9 @@ public partial class NetworkCloud await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); await eventListener.AssertNotNull(nameof(kubernetesClusterName),kubernetesClusterName); - await eventListener.AssertRegEx(nameof(kubernetesClusterName),kubernetesClusterName,@"^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$"); + await eventListener.AssertRegEx(nameof(kubernetesClusterName), kubernetesClusterName, @"^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$"); await eventListener.AssertNotNull(nameof(agentPoolName),agentPoolName); - await eventListener.AssertRegEx(nameof(agentPoolName),agentPoolName,@"^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$"); + await eventListener.AssertRegEx(nameof(agentPoolName), agentPoolName, @"^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$"); await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); await eventListener.AssertNotNull(nameof(ifNoneMatch),ifNoneMatch); } @@ -673,7 +1095,7 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task AgentPoolsGet(string subscriptionId, string resourceGroupName, string kubernetesClusterName, string agentPoolName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task AgentPoolsGet(string subscriptionId, string resourceGroupName, string kubernetesClusterName, string agentPoolName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -702,7 +1124,7 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.AgentPoolsGet_Call(request,onOk,onDefault,eventListener,sender); + await this.AgentPoolsGet_Call (request, onOk,onDefault,eventListener,sender); } } @@ -716,7 +1138,7 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task AgentPoolsGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task AgentPoolsGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -758,11 +1180,169 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.AgentPoolsGet_Call(request,onOk,onDefault,eventListener,sender); + await this.AgentPoolsGet_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Get properties of the provided Kubernetes cluster agent pool. + /// + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A + /// that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task AgentPoolsGetViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/kubernetesClusters/(?[^/]+)/agentPools/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/kubernetesClusters/{kubernetesClusterName}/agentPools/{agentPoolName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var kubernetesClusterName = _match.Groups["kubernetesClusterName"].Value; + var agentPoolName = _match.Groups["agentPoolName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.NetworkCloud/kubernetesClusters/" + + kubernetesClusterName + + "/agentPools/" + + agentPoolName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.AgentPoolsGetWithResult_Call (request, eventListener,sender); + } + } + + /// Get properties of the provided Kubernetes cluster agent pool. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Kubernetes cluster. + /// The name of the Kubernetes cluster agent pool. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A + /// that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task AgentPoolsGetWithResult(string subscriptionId, string resourceGroupName, string kubernetesClusterName, string agentPoolName, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.NetworkCloud/kubernetesClusters/" + + global::System.Uri.EscapeDataString(kubernetesClusterName) + + "/agentPools/" + + global::System.Uri.EscapeDataString(agentPoolName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.AgentPoolsGetWithResult_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.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A + /// that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task AgentPoolsGetWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AgentPool.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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 @@ -772,7 +1352,7 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task AgentPoolsGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task AgentPoolsGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -783,6 +1363,7 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -790,13 +1371,13 @@ public partial class NetworkCloud case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AgentPool.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AgentPool.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -833,9 +1414,9 @@ public partial class NetworkCloud await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); await eventListener.AssertNotNull(nameof(kubernetesClusterName),kubernetesClusterName); - await eventListener.AssertRegEx(nameof(kubernetesClusterName),kubernetesClusterName,@"^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$"); + await eventListener.AssertRegEx(nameof(kubernetesClusterName), kubernetesClusterName, @"^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$"); await eventListener.AssertNotNull(nameof(agentPoolName),agentPoolName); - await eventListener.AssertRegEx(nameof(agentPoolName),agentPoolName,@"^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$"); + await eventListener.AssertRegEx(nameof(agentPoolName), agentPoolName, @"^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$"); } } @@ -851,7 +1432,7 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task AgentPoolsListByKubernetesCluster(string subscriptionId, string resourceGroupName, string kubernetesClusterName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task AgentPoolsListByKubernetesCluster(string subscriptionId, string resourceGroupName, string kubernetesClusterName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -879,7 +1460,7 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.AgentPoolsListByKubernetesCluster_Call(request,onOk,onDefault,eventListener,sender); + await this.AgentPoolsListByKubernetesCluster_Call (request, onOk,onDefault,eventListener,sender); } } @@ -893,7 +1474,7 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task AgentPoolsListByKubernetesClusterViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task AgentPoolsListByKubernetesClusterViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -933,63 +1514,220 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.AgentPoolsListByKubernetesCluster_Call(request,onOk,onDefault,eventListener,sender); + await this.AgentPoolsListByKubernetesCluster_Call (request, onOk,onDefault,eventListener,sender); } } - /// Actual wire call for method. - /// the prepared HttpRequestMessage to send. - /// a delegate that is called 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 a list of agent pools for the provided Kubernetes cluster. + /// /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 AgentPoolsListByKubernetesCluster_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task AgentPoolsListByKubernetesClusterViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { + var apiVersion = @"2025-02-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.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AgentPoolList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/kubernetesClusters/(?[^/]+)/agentPools$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/kubernetesClusters/{kubernetesClusterName}/agentPools'"); } - } - } - /// - /// Validation method for method. Call this like the actual call, but you - /// will get validation events back. - /// + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var kubernetesClusterName = _match.Groups["kubernetesClusterName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.NetworkCloud/kubernetesClusters/" + + kubernetesClusterName + + "/agentPools" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.AgentPoolsListByKubernetesClusterWithResult_Call (request, eventListener,sender); + } + } + + /// Get a list of agent pools for the provided Kubernetes cluster. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Kubernetes cluster. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task AgentPoolsListByKubernetesClusterWithResult(string subscriptionId, string resourceGroupName, string kubernetesClusterName, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.NetworkCloud/kubernetesClusters/" + + global::System.Uri.EscapeDataString(kubernetesClusterName) + + "/agentPools" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.AgentPoolsListByKubernetesClusterWithResult_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.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task AgentPoolsListByKubernetesClusterWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AgentPoolList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task AgentPoolsListByKubernetesCluster_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AgentPoolList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you + /// will get validation events back. + /// /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// The name of the Kubernetes cluster. @@ -1007,13 +1745,13 @@ public partial class NetworkCloud await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); await eventListener.AssertNotNull(nameof(kubernetesClusterName),kubernetesClusterName); - await eventListener.AssertRegEx(nameof(kubernetesClusterName),kubernetesClusterName,@"^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$"); + await eventListener.AssertRegEx(nameof(kubernetesClusterName), kubernetesClusterName, @"^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$"); } } /// /// Patch the properties of the provided Kubernetes cluster agent pool, or update the tags associated with the Kubernetes - /// cluster agent pool. Properties and tag updates can be done independently. + /// cluster agent pool. Properties and tag update can be done independently. /// /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. @@ -1029,10 +1767,11 @@ public partial class NetworkCloud /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 AgentPoolsUpdate(string subscriptionId, string resourceGroupName, string kubernetesClusterName, string agentPoolName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPatchParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task AgentPoolsUpdate(string subscriptionId, string resourceGroupName, string kubernetesClusterName, string agentPoolName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPatchParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -1071,17 +1810,17 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // 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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.AgentPoolsUpdate_Call(request,onOk,onDefault,eventListener,sender); + await this.AgentPoolsUpdate_Call (request, onOk,onDefault,eventListener,sender); } } /// /// Patch the properties of the provided Kubernetes cluster agent pool, or update the tags associated with the Kubernetes - /// cluster agent pool. Properties and tag updates can be done independently. + /// cluster agent pool. Properties and tag update can be done independently. /// /// /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify @@ -1094,10 +1833,88 @@ public partial class NetworkCloud /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 AgentPoolsUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPatchParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task AgentPoolsUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPatchParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/kubernetesClusters/(?[^/]+)/agentPools/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/kubernetesClusters/{kubernetesClusterName}/agentPools/{agentPoolName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var kubernetesClusterName = _match.Groups["kubernetesClusterName"].Value; + var agentPoolName = _match.Groups["agentPoolName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.NetworkCloud/kubernetesClusters/" + + kubernetesClusterName + + "/agentPools/" + + agentPoolName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + if (null != ifNoneMatch) + { + request.Headers.Add("If-None-Match",ifNoneMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.AgentPoolsUpdate_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// + /// Patch the properties of the provided Kubernetes cluster agent pool, or update the tags associated with the Kubernetes + /// cluster agent pool. Properties and tag update can be done independently. + /// + /// + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// The request body. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 AgentPoolsUpdateViaIdentityWithResult(global::System.String viaIdentity, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPatchParameters body, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -1130,6 +1947,74 @@ public partial class NetworkCloud + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + if (null != ifNoneMatch) + { + request.Headers.Add("If-None-Match",ifNoneMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.AgentPoolsUpdateWithResult_Call (request, eventListener,sender); + } + } + + /// + /// Patch the properties of the provided Kubernetes cluster agent pool, or update the tags associated with the Kubernetes + /// cluster agent pool. Properties and tag update can be done independently. + /// + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Kubernetes cluster. + /// The name of the Kubernetes cluster agent pool. + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// Json string supplied to the AgentPoolsUpdate 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.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task AgentPoolsUpdateViaJsonString(string subscriptionId, string resourceGroupName, string kubernetesClusterName, string agentPoolName, string ifMatch, string ifNoneMatch, 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.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.NetworkCloud/kubernetesClusters/" + + global::System.Uri.EscapeDataString(kubernetesClusterName) + + "/agentPools/" + + global::System.Uri.EscapeDataString(agentPoolName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } // generate request object @@ -1149,15 +2034,300 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // 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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.AgentPoolsUpdate_Call(request,onOk,onDefault,eventListener,sender); + await this.AgentPoolsUpdate_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// + /// Patch the properties of the provided Kubernetes cluster agent pool, or update the tags associated with the Kubernetes + /// cluster agent pool. Properties and tag update can be done independently. + /// + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Kubernetes cluster. + /// The name of the Kubernetes cluster agent pool. + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// Json string supplied to the AgentPoolsUpdate operation + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A + /// that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task AgentPoolsUpdateViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string kubernetesClusterName, string agentPoolName, string ifMatch, string ifNoneMatch, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.NetworkCloud/kubernetesClusters/" + + global::System.Uri.EscapeDataString(kubernetesClusterName) + + "/agentPools/" + + global::System.Uri.EscapeDataString(agentPoolName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + if (null != ifNoneMatch) + { + request.Headers.Add("If-None-Match",ifNoneMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.AgentPoolsUpdateWithResult_Call (request, eventListener,sender); + } + } + + /// + /// Patch the properties of the provided Kubernetes cluster agent pool, or update the tags associated with the Kubernetes + /// cluster agent pool. Properties and tag update can be done independently. + /// + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Kubernetes cluster. + /// The name of the Kubernetes cluster agent pool. + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// The request body. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 AgentPoolsUpdateWithResult(string subscriptionId, string resourceGroupName, string kubernetesClusterName, string agentPoolName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPatchParameters body, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.NetworkCloud/kubernetesClusters/" + + global::System.Uri.EscapeDataString(kubernetesClusterName) + + "/agentPools/" + + global::System.Uri.EscapeDataString(agentPoolName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + if (null != ifNoneMatch) + { + request.Headers.Add("If-None-Match",ifNoneMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.AgentPoolsUpdateWithResult_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.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A + /// that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task AgentPoolsUpdateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + // declared final-state-via: azure-async-operation + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + break; + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AgentPool.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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 @@ -1167,31 +2337,28 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task AgentPoolsUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task AgentPoolsUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { global::System.Net.Http.HttpResponseMessage _response = null; try { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; var sendTask = sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // this operation supports x-ms-long-running-operation - var _originalUri = request.RequestUri.AbsoluteUri; // declared final-state-via: azure-async-operation var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) { - - // get the delay before polling. (default to 30 seconds if not present) - int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // start the delay timer (we'll await later...) - var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } // while we wait, let's grab the headers and get ready to poll. if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { @@ -1200,15 +2367,14 @@ public partial class NetworkCloud if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { location = _response.GetFirstHeader(@"Location"); } - var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); // and let's look at the current response body and see if we have some information we can give back to the listener var content = await _response.Content.ReadAsStringAsync(); - await waiting; - - // check for cancellation - if( eventListener.Token.IsCancellationRequested ) { return; } // drop the old response _response?.Dispose(); @@ -1217,45 +2383,45 @@ public partial class NetworkCloud _response = await sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // if we got back an OK, take a peek inside and see if it's done - if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) - { - var error = false; - try { - if( Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) - { - var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); - if( state is null ) - { - // the body doesn't contain any information that has the state of the LRO - // we're going to just get out, and let the consumer have the result - break; - } - - switch( state?.ToString()?.ToLower() ) - { - case "failed": - error = true; + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. break; - case "succeeded": - case "canceled": - // we're done polling. - break; - - default: - // need to keep polling! - _response.StatusCode = global::System.Net.HttpStatusCode.Created; - continue; - } - } - } catch { - // if we run into a problem peeking into the result, - // we really don't want to do anything special. - } - if (error) { - throw new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException(_response); - } - } + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException(_response); + } + } // check for terminal status code if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) @@ -1274,6 +2440,7 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } break; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -1281,13 +2448,13 @@ public partial class NetworkCloud case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AgentPool.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AgentPool.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -1319,7 +2486,7 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task AgentPoolsUpdate_Validate(string subscriptionId, string resourceGroupName, string kubernetesClusterName, string agentPoolName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPatchParameters body, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task AgentPoolsUpdate_Validate(string subscriptionId, string resourceGroupName, string kubernetesClusterName, string agentPoolName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPatchParameters body, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -1329,9 +2496,9 @@ public partial class NetworkCloud await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); await eventListener.AssertNotNull(nameof(kubernetesClusterName),kubernetesClusterName); - await eventListener.AssertRegEx(nameof(kubernetesClusterName),kubernetesClusterName,@"^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$"); + await eventListener.AssertRegEx(nameof(kubernetesClusterName), kubernetesClusterName, @"^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$"); await eventListener.AssertNotNull(nameof(agentPoolName),agentPoolName); - await eventListener.AssertRegEx(nameof(agentPoolName),agentPoolName,@"^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$"); + await eventListener.AssertRegEx(nameof(agentPoolName), agentPoolName, @"^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$"); await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); await eventListener.AssertNotNull(nameof(ifNoneMatch),ifNoneMatch); await eventListener.AssertNotNull(nameof(body), body); @@ -1340,7 +2507,7 @@ public partial class NetworkCloud } /// - /// Create a new bare metal machine key set or update the existing one for the provided cluster. + /// update a new bare metal machine key set or update the existing one for the provided cluster. /// /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. @@ -1356,10 +2523,11 @@ public partial class NetworkCloud /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 BareMetalMachineKeySetsCreateOrUpdate(string subscriptionId, string resourceGroupName, string clusterName, string bareMetalMachineKeySetName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySet body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task BareMetalMachineKeySetsCreateOrUpdate(string subscriptionId, string resourceGroupName, string clusterName, string bareMetalMachineKeySetName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySet body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -1398,16 +2566,16 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // 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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.BareMetalMachineKeySetsCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + await this.BareMetalMachineKeySetsCreateOrUpdate_Call (request, onOk,onDefault,eventListener,sender); } } /// - /// Create a new bare metal machine key set or update the existing one for the provided cluster. + /// update a new bare metal machine key set or update the existing one for the provided cluster. /// /// /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify @@ -1420,10 +2588,11 @@ public partial class NetworkCloud /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 BareMetalMachineKeySetsCreateOrUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySet body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task BareMetalMachineKeySetsCreateOrUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySet body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -1475,51 +2644,476 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // 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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.BareMetalMachineKeySetsCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + await this.BareMetalMachineKeySetsCreateOrUpdate_Call (request, onOk,onDefault,eventListener,sender); } } /// - /// Actual wire call for method. + /// update a new bare metal machine key set or update the existing one for the provided cluster. /// - /// the prepared HttpRequestMessage to send. - /// a delegate that is called 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 ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// The request body. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 BareMetalMachineKeySetsCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task BareMetalMachineKeySetsCreateOrUpdateViaIdentityWithResult(global::System.String viaIdentity, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySet body, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate) { + var apiVersion = @"2025-02-01"; + // 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("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/clusters/(?[^/]+)/bareMetalMachineKeySets/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) { - var sendTask = sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // this operation supports x-ms-long-running-operation - var _originalUri = request.RequestUri.AbsoluteUri; - // declared final-state-via: azure-async-operation - var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/bareMetalMachineKeySets/{bareMetalMachineKeySetName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var clusterName = _match.Groups["clusterName"].Value; + var bareMetalMachineKeySetName = _match.Groups["bareMetalMachineKeySetName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.NetworkCloud/clusters/" + + clusterName + + "/bareMetalMachineKeySets/" + + bareMetalMachineKeySetName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + if (null != ifNoneMatch) + { + request.Headers.Add("If-None-Match",ifNoneMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.BareMetalMachineKeySetsCreateOrUpdateWithResult_Call (request, eventListener,sender); + } + } + + /// + /// update a new bare metal machine key set or update the existing one for the provided cluster. + /// + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the cluster. + /// The name of the bare metal machine key set. + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// Json string supplied to the BareMetalMachineKeySetsCreateOrUpdate 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.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task BareMetalMachineKeySetsCreateOrUpdateViaJsonString(string subscriptionId, string resourceGroupName, string clusterName, string bareMetalMachineKeySetName, string ifMatch, string ifNoneMatch, 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.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.NetworkCloud/clusters/" + + global::System.Uri.EscapeDataString(clusterName) + + "/bareMetalMachineKeySets/" + + global::System.Uri.EscapeDataString(bareMetalMachineKeySetName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + if (null != ifNoneMatch) + { + request.Headers.Add("If-None-Match",ifNoneMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.BareMetalMachineKeySetsCreateOrUpdate_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// + /// update a new bare metal machine key set or update the existing one for the provided cluster. + /// + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the cluster. + /// The name of the bare metal machine key set. + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// Json string supplied to the BareMetalMachineKeySetsCreateOrUpdate operation + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task BareMetalMachineKeySetsCreateOrUpdateViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string clusterName, string bareMetalMachineKeySetName, string ifMatch, string ifNoneMatch, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.NetworkCloud/clusters/" + + global::System.Uri.EscapeDataString(clusterName) + + "/bareMetalMachineKeySets/" + + global::System.Uri.EscapeDataString(bareMetalMachineKeySetName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + if (null != ifNoneMatch) + { + request.Headers.Add("If-None-Match",ifNoneMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.BareMetalMachineKeySetsCreateOrUpdateWithResult_Call (request, eventListener,sender); + } + } + + /// + /// update a new bare metal machine key set or update the existing one for the provided cluster. + /// + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the cluster. + /// The name of the bare metal machine key set. + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// The request body. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 BareMetalMachineKeySetsCreateOrUpdateWithResult(string subscriptionId, string resourceGroupName, string clusterName, string bareMetalMachineKeySetName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySet body, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.NetworkCloud/clusters/" + + global::System.Uri.EscapeDataString(clusterName) + + "/bareMetalMachineKeySets/" + + global::System.Uri.EscapeDataString(bareMetalMachineKeySetName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + if (null != ifNoneMatch) + { + request.Headers.Add("If-None-Match",ifNoneMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.BareMetalMachineKeySetsCreateOrUpdateWithResult_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.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task BareMetalMachineKeySetsCreateOrUpdateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + // declared final-state-via: azure-async-operation + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + break; + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; - // get the delay before polling. (default to 30 seconds if not present) - int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BareMetalMachineKeySet.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } - // start the delay timer (we'll await later...) - var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task BareMetalMachineKeySetsCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // declared final-state-via: azure-async-operation + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } // while we wait, let's grab the headers and get ready to poll. if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { @@ -1528,15 +3122,14 @@ public partial class NetworkCloud if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { location = _response.GetFirstHeader(@"Location"); } - var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); // and let's look at the current response body and see if we have some information we can give back to the listener var content = await _response.Content.ReadAsStringAsync(); - await waiting; - - // check for cancellation - if( eventListener.Token.IsCancellationRequested ) { return; } // drop the old response _response?.Dispose(); @@ -1545,45 +3138,45 @@ public partial class NetworkCloud _response = await sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // if we got back an OK, take a peek inside and see if it's done - if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) - { - var error = false; - try { - if( Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) - { - var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); - if( state is null ) - { - // the body doesn't contain any information that has the state of the LRO - // we're going to just get out, and let the consumer have the result - break; - } - - switch( state?.ToString()?.ToLower() ) - { - case "failed": - error = true; + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. break; - case "succeeded": - case "canceled": - // we're done polling. - break; - - default: - // need to keep polling! - _response.StatusCode = global::System.Net.HttpStatusCode.Created; - continue; - } - } - } catch { - // if we run into a problem peeking into the result, - // we really don't want to do anything special. - } - if (error) { - throw new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException(_response); - } - } + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException(_response); + } + } // check for terminal status code if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) @@ -1602,6 +3195,7 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } break; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -1609,13 +3203,13 @@ public partial class NetworkCloud case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BareMetalMachineKeySet.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BareMetalMachineKeySet.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -1647,7 +3241,7 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task BareMetalMachineKeySetsCreateOrUpdate_Validate(string subscriptionId, string resourceGroupName, string clusterName, string bareMetalMachineKeySetName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySet body, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task BareMetalMachineKeySetsCreateOrUpdate_Validate(string subscriptionId, string resourceGroupName, string clusterName, string bareMetalMachineKeySetName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySet body, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -1657,9 +3251,9 @@ public partial class NetworkCloud await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); await eventListener.AssertNotNull(nameof(clusterName),clusterName); - await eventListener.AssertRegEx(nameof(clusterName),clusterName,@"^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$"); + await eventListener.AssertRegEx(nameof(clusterName), clusterName, @"^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$"); await eventListener.AssertNotNull(nameof(bareMetalMachineKeySetName),bareMetalMachineKeySetName); - await eventListener.AssertRegEx(nameof(bareMetalMachineKeySetName),bareMetalMachineKeySetName,@"^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$"); + await eventListener.AssertRegEx(nameof(bareMetalMachineKeySetName), bareMetalMachineKeySetName, @"^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$"); await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); await eventListener.AssertNotNull(nameof(ifNoneMatch),ifNoneMatch); await eventListener.AssertNotNull(nameof(body), body); @@ -1685,7 +3279,7 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task BareMetalMachineKeySetsDelete(string subscriptionId, string resourceGroupName, string clusterName, string bareMetalMachineKeySetName, string ifMatch, string ifNoneMatch, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task BareMetalMachineKeySetsDelete(string subscriptionId, string resourceGroupName, string clusterName, string bareMetalMachineKeySetName, string ifMatch, string ifNoneMatch, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -1724,7 +3318,7 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.BareMetalMachineKeySetsDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + await this.BareMetalMachineKeySetsDelete_Call (request, onOk,onNoContent,onDefault,eventListener,sender); } } @@ -1743,7 +3337,7 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task BareMetalMachineKeySetsDeleteViaIdentity(global::System.String viaIdentity, string ifMatch, string ifNoneMatch, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task BareMetalMachineKeySetsDeleteViaIdentity(global::System.String viaIdentity, string ifMatch, string ifNoneMatch, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -1795,11 +3389,11 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.BareMetalMachineKeySetsDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + await this.BareMetalMachineKeySetsDelete_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). @@ -1810,32 +3404,29 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task BareMetalMachineKeySetsDelete_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.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task BareMetalMachineKeySetsDelete_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.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { global::System.Net.Http.HttpResponseMessage _response = null; try { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; var sendTask = sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // this operation supports x-ms-long-running-operation - var _originalUri = request.RequestUri.AbsoluteUri; // declared final-state-via: location var _finalUri = _response.GetFirstHeader(@"Location"); var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) { - - // get the delay before polling. (default to 30 seconds if not present) - int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // start the delay timer (we'll await later...) - var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } // while we wait, let's grab the headers and get ready to poll. if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { @@ -1844,15 +3435,14 @@ public partial class NetworkCloud if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { location = _response.GetFirstHeader(@"Location"); } - var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); // and let's look at the current response body and see if we have some information we can give back to the listener var content = await _response.Content.ReadAsStringAsync(); - await waiting; - - // check for cancellation - if( eventListener.Token.IsCancellationRequested ) { return; } // drop the old response _response?.Dispose(); @@ -1861,45 +3451,45 @@ public partial class NetworkCloud _response = await sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // if we got back an OK, take a peek inside and see if it's done - if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) - { - var error = false; - try { - if( Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) - { - var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); - if( state is null ) - { - // the body doesn't contain any information that has the state of the LRO - // we're going to just get out, and let the consumer have the result - break; - } - - switch( state?.ToString()?.ToLower() ) - { - case "failed": - error = true; + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result break; - case "succeeded": - case "canceled": - // we're done polling. - break; - - default: - // need to keep polling! - _response.StatusCode = global::System.Net.HttpStatusCode.Created; - continue; - } - } - } catch { - // if we run into a problem peeking into the result, - // we really don't want to do anything special. - } - if (error) { - throw new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException(_response); - } - } + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException(_response); + } + } // check for terminal status code if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) @@ -1918,6 +3508,7 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } break; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -1937,7 +3528,7 @@ public partial class NetworkCloud default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -1978,9 +3569,9 @@ public partial class NetworkCloud await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); await eventListener.AssertNotNull(nameof(clusterName),clusterName); - await eventListener.AssertRegEx(nameof(clusterName),clusterName,@"^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$"); + await eventListener.AssertRegEx(nameof(clusterName), clusterName, @"^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$"); await eventListener.AssertNotNull(nameof(bareMetalMachineKeySetName),bareMetalMachineKeySetName); - await eventListener.AssertRegEx(nameof(bareMetalMachineKeySetName),bareMetalMachineKeySetName,@"^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$"); + await eventListener.AssertRegEx(nameof(bareMetalMachineKeySetName), bareMetalMachineKeySetName, @"^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$"); await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); await eventListener.AssertNotNull(nameof(ifNoneMatch),ifNoneMatch); } @@ -1999,7 +3590,7 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task BareMetalMachineKeySetsGet(string subscriptionId, string resourceGroupName, string clusterName, string bareMetalMachineKeySetName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task BareMetalMachineKeySetsGet(string subscriptionId, string resourceGroupName, string clusterName, string bareMetalMachineKeySetName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -2028,7 +3619,7 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.BareMetalMachineKeySetsGet_Call(request,onOk,onDefault,eventListener,sender); + await this.BareMetalMachineKeySetsGet_Call (request, onOk,onDefault,eventListener,sender); } } @@ -2042,7 +3633,7 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task BareMetalMachineKeySetsGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task BareMetalMachineKeySetsGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -2084,11 +3675,171 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.BareMetalMachineKeySetsGet_Call(request,onOk,onDefault,eventListener,sender); + await this.BareMetalMachineKeySetsGet_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Get bare metal machine key set of the provided cluster. + /// + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task BareMetalMachineKeySetsGetViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/clusters/(?[^/]+)/bareMetalMachineKeySets/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/bareMetalMachineKeySets/{bareMetalMachineKeySetName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var clusterName = _match.Groups["clusterName"].Value; + var bareMetalMachineKeySetName = _match.Groups["bareMetalMachineKeySetName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.NetworkCloud/clusters/" + + clusterName + + "/bareMetalMachineKeySets/" + + bareMetalMachineKeySetName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.BareMetalMachineKeySetsGetWithResult_Call (request, eventListener,sender); + } + } + + /// Get bare metal machine key set of the provided cluster. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the cluster. + /// The name of the bare metal machine key set. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task BareMetalMachineKeySetsGetWithResult(string subscriptionId, string resourceGroupName, string clusterName, string bareMetalMachineKeySetName, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.NetworkCloud/clusters/" + + global::System.Uri.EscapeDataString(clusterName) + + "/bareMetalMachineKeySets/" + + global::System.Uri.EscapeDataString(bareMetalMachineKeySetName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.BareMetalMachineKeySetsGetWithResult_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.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task BareMetalMachineKeySetsGetWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BareMetalMachineKeySet.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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 @@ -2098,7 +3849,7 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task BareMetalMachineKeySetsGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task BareMetalMachineKeySetsGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -2109,6 +3860,7 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -2116,13 +3868,13 @@ public partial class NetworkCloud case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BareMetalMachineKeySet.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BareMetalMachineKeySet.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -2159,9 +3911,9 @@ public partial class NetworkCloud await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); await eventListener.AssertNotNull(nameof(clusterName),clusterName); - await eventListener.AssertRegEx(nameof(clusterName),clusterName,@"^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$"); + await eventListener.AssertRegEx(nameof(clusterName), clusterName, @"^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$"); await eventListener.AssertNotNull(nameof(bareMetalMachineKeySetName),bareMetalMachineKeySetName); - await eventListener.AssertRegEx(nameof(bareMetalMachineKeySetName),bareMetalMachineKeySetName,@"^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$"); + await eventListener.AssertRegEx(nameof(bareMetalMachineKeySetName), bareMetalMachineKeySetName, @"^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$"); } } @@ -2177,7 +3929,7 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task BareMetalMachineKeySetsListByCluster(string subscriptionId, string resourceGroupName, string clusterName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task BareMetalMachineKeySetsListByCluster(string subscriptionId, string resourceGroupName, string clusterName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -2205,7 +3957,7 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.BareMetalMachineKeySetsListByCluster_Call(request,onOk,onDefault,eventListener,sender); + await this.BareMetalMachineKeySetsListByCluster_Call (request, onOk,onDefault,eventListener,sender); } } @@ -2219,7 +3971,7 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task BareMetalMachineKeySetsListByClusterViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task BareMetalMachineKeySetsListByClusterViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -2259,64 +4011,221 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.BareMetalMachineKeySetsListByCluster_Call(request,onOk,onDefault,eventListener,sender); + await this.BareMetalMachineKeySetsListByCluster_Call (request, onOk,onDefault,eventListener,sender); } } - /// - /// Actual wire call for method. - /// - /// the prepared HttpRequestMessage to send. - /// a delegate that is called 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 a list of bare metal machine key sets for the provided cluster. + /// /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 BareMetalMachineKeySetsListByCluster_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task BareMetalMachineKeySetsListByClusterViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { + var apiVersion = @"2025-02-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.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BareMetalMachineKeySetList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/clusters/(?[^/]+)/bareMetalMachineKeySets$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/bareMetalMachineKeySets'"); } - } - } - /// - /// Validation method for method. Call this like the actual call, but - /// you will get validation events back. + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var clusterName = _match.Groups["clusterName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.NetworkCloud/clusters/" + + clusterName + + "/bareMetalMachineKeySets" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.BareMetalMachineKeySetsListByClusterWithResult_Call (request, eventListener,sender); + } + } + + /// Get a list of bare metal machine key sets for the provided cluster. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the cluster. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task BareMetalMachineKeySetsListByClusterWithResult(string subscriptionId, string resourceGroupName, string clusterName, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.NetworkCloud/clusters/" + + global::System.Uri.EscapeDataString(clusterName) + + "/bareMetalMachineKeySets" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.BareMetalMachineKeySetsListByClusterWithResult_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.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task BareMetalMachineKeySetsListByClusterWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BareMetalMachineKeySetList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task BareMetalMachineKeySetsListByCluster_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BareMetalMachineKeySetList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but + /// you will get validation events back. /// /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. @@ -2335,13 +4244,13 @@ public partial class NetworkCloud await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); await eventListener.AssertNotNull(nameof(clusterName),clusterName); - await eventListener.AssertRegEx(nameof(clusterName),clusterName,@"^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$"); + await eventListener.AssertRegEx(nameof(clusterName), clusterName, @"^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$"); } } /// /// Patch properties of bare metal machine key set for the provided cluster, or update the tags associated with it. Properties - /// and tag updates can be done independently. + /// and tag update can be done independently. /// /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. @@ -2357,10 +4266,11 @@ public partial class NetworkCloud /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 BareMetalMachineKeySetsUpdate(string subscriptionId, string resourceGroupName, string clusterName, string bareMetalMachineKeySetName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetPatchParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task BareMetalMachineKeySetsUpdate(string subscriptionId, string resourceGroupName, string clusterName, string bareMetalMachineKeySetName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetPatchParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -2399,17 +4309,17 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // 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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.BareMetalMachineKeySetsUpdate_Call(request,onOk,onDefault,eventListener,sender); + await this.BareMetalMachineKeySetsUpdate_Call (request, onOk,onDefault,eventListener,sender); } } /// /// Patch properties of bare metal machine key set for the provided cluster, or update the tags associated with it. Properties - /// and tag updates can be done independently. + /// and tag update can be done independently. /// /// /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify @@ -2422,10 +4332,88 @@ public partial class NetworkCloud /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 BareMetalMachineKeySetsUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetPatchParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task BareMetalMachineKeySetsUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetPatchParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/clusters/(?[^/]+)/bareMetalMachineKeySets/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/bareMetalMachineKeySets/{bareMetalMachineKeySetName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var clusterName = _match.Groups["clusterName"].Value; + var bareMetalMachineKeySetName = _match.Groups["bareMetalMachineKeySetName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.NetworkCloud/clusters/" + + clusterName + + "/bareMetalMachineKeySets/" + + bareMetalMachineKeySetName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + if (null != ifNoneMatch) + { + request.Headers.Add("If-None-Match",ifNoneMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.BareMetalMachineKeySetsUpdate_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// + /// Patch properties of bare metal machine key set for the provided cluster, or update the tags associated with it. Properties + /// and tag update can be done independently. + /// + /// + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// The request body. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 BareMetalMachineKeySetsUpdateViaIdentityWithResult(global::System.String viaIdentity, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetPatchParameters body, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -2458,6 +4446,74 @@ public partial class NetworkCloud + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + if (null != ifNoneMatch) + { + request.Headers.Add("If-None-Match",ifNoneMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.BareMetalMachineKeySetsUpdateWithResult_Call (request, eventListener,sender); + } + } + + /// + /// Patch properties of bare metal machine key set for the provided cluster, or update the tags associated with it. Properties + /// and tag update can be done independently. + /// + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the cluster. + /// The name of the bare metal machine key set. + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// Json string supplied to the BareMetalMachineKeySetsUpdate 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.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task BareMetalMachineKeySetsUpdateViaJsonString(string subscriptionId, string resourceGroupName, string clusterName, string bareMetalMachineKeySetName, string ifMatch, string ifNoneMatch, 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.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.NetworkCloud/clusters/" + + global::System.Uri.EscapeDataString(clusterName) + + "/bareMetalMachineKeySets/" + + global::System.Uri.EscapeDataString(bareMetalMachineKeySetName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } // generate request object @@ -2477,15 +4533,302 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // 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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.BareMetalMachineKeySetsUpdate_Call(request,onOk,onDefault,eventListener,sender); + await this.BareMetalMachineKeySetsUpdate_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// + /// Patch properties of bare metal machine key set for the provided cluster, or update the tags associated with it. Properties + /// and tag update can be done independently. + /// + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the cluster. + /// The name of the bare metal machine key set. + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// Json string supplied to the BareMetalMachineKeySetsUpdate operation + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task BareMetalMachineKeySetsUpdateViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string clusterName, string bareMetalMachineKeySetName, string ifMatch, string ifNoneMatch, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.NetworkCloud/clusters/" + + global::System.Uri.EscapeDataString(clusterName) + + "/bareMetalMachineKeySets/" + + global::System.Uri.EscapeDataString(bareMetalMachineKeySetName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + if (null != ifNoneMatch) + { + request.Headers.Add("If-None-Match",ifNoneMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.BareMetalMachineKeySetsUpdateWithResult_Call (request, eventListener,sender); + } + } + + /// + /// Patch properties of bare metal machine key set for the provided cluster, or update the tags associated with it. Properties + /// and tag update can be done independently. + /// + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the cluster. + /// The name of the bare metal machine key set. + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// The request body. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 BareMetalMachineKeySetsUpdateWithResult(string subscriptionId, string resourceGroupName, string clusterName, string bareMetalMachineKeySetName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetPatchParameters body, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.NetworkCloud/clusters/" + + global::System.Uri.EscapeDataString(clusterName) + + "/bareMetalMachineKeySets/" + + global::System.Uri.EscapeDataString(bareMetalMachineKeySetName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + if (null != ifNoneMatch) + { + request.Headers.Add("If-None-Match",ifNoneMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.BareMetalMachineKeySetsUpdateWithResult_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.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task BareMetalMachineKeySetsUpdateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + // declared final-state-via: azure-async-operation + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + break; + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BareMetalMachineKeySet.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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 @@ -2495,31 +4838,28 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task BareMetalMachineKeySetsUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task BareMetalMachineKeySetsUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { global::System.Net.Http.HttpResponseMessage _response = null; try { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; var sendTask = sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // this operation supports x-ms-long-running-operation - var _originalUri = request.RequestUri.AbsoluteUri; // declared final-state-via: azure-async-operation var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) { - - // get the delay before polling. (default to 30 seconds if not present) - int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // start the delay timer (we'll await later...) - var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } // while we wait, let's grab the headers and get ready to poll. if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { @@ -2528,15 +4868,14 @@ public partial class NetworkCloud if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { location = _response.GetFirstHeader(@"Location"); } - var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); // and let's look at the current response body and see if we have some information we can give back to the listener var content = await _response.Content.ReadAsStringAsync(); - await waiting; - - // check for cancellation - if( eventListener.Token.IsCancellationRequested ) { return; } // drop the old response _response?.Dispose(); @@ -2545,45 +4884,45 @@ public partial class NetworkCloud _response = await sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // if we got back an OK, take a peek inside and see if it's done - if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) - { - var error = false; - try { - if( Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) - { - var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); - if( state is null ) - { - // the body doesn't contain any information that has the state of the LRO - // we're going to just get out, and let the consumer have the result - break; - } - - switch( state?.ToString()?.ToLower() ) - { - case "failed": - error = true; + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result break; - case "succeeded": - case "canceled": - // we're done polling. - break; - - default: - // need to keep polling! - _response.StatusCode = global::System.Net.HttpStatusCode.Created; - continue; - } - } - } catch { - // if we run into a problem peeking into the result, - // we really don't want to do anything special. - } - if (error) { - throw new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException(_response); - } - } + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException(_response); + } + } // check for terminal status code if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) @@ -2602,6 +4941,7 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } break; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -2609,13 +4949,13 @@ public partial class NetworkCloud case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BareMetalMachineKeySet.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BareMetalMachineKeySet.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -2647,7 +4987,7 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task BareMetalMachineKeySetsUpdate_Validate(string subscriptionId, string resourceGroupName, string clusterName, string bareMetalMachineKeySetName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetPatchParameters body, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task BareMetalMachineKeySetsUpdate_Validate(string subscriptionId, string resourceGroupName, string clusterName, string bareMetalMachineKeySetName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetPatchParameters body, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -2657,9 +4997,9 @@ public partial class NetworkCloud await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); await eventListener.AssertNotNull(nameof(clusterName),clusterName); - await eventListener.AssertRegEx(nameof(clusterName),clusterName,@"^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$"); + await eventListener.AssertRegEx(nameof(clusterName), clusterName, @"^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$"); await eventListener.AssertNotNull(nameof(bareMetalMachineKeySetName),bareMetalMachineKeySetName); - await eventListener.AssertRegEx(nameof(bareMetalMachineKeySetName),bareMetalMachineKeySetName,@"^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$"); + await eventListener.AssertRegEx(nameof(bareMetalMachineKeySetName), bareMetalMachineKeySetName, @"^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$"); await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); await eventListener.AssertNotNull(nameof(ifNoneMatch),ifNoneMatch); await eventListener.AssertNotNull(nameof(body), body); @@ -2677,10 +5017,11 @@ public partial class NetworkCloud /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 BareMetalMachinesCordon(string subscriptionId, string resourceGroupName, string bareMetalMachineName, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineCordonParameters body, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task BareMetalMachinesCordon(string subscriptionId, string resourceGroupName, string bareMetalMachineName, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineCordonParameters body, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -2708,11 +5049,11 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // 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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.BareMetalMachinesCordon_Call(request,onOk,onDefault,eventListener,sender); + await this.BareMetalMachinesCordon_Call (request, onOk,onDefault,eventListener,sender); } } @@ -2724,10 +5065,11 @@ public partial class NetworkCloud /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 BareMetalMachinesCordonViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineCordonParameters body, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task BareMetalMachinesCordonViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineCordonParameters body, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -2738,7 +5080,7 @@ public partial class NetworkCloud var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/bareMetalMachines/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/bareMetalMachines/{bareMetalMachineName}/cordon'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/bareMetalMachines/{bareMetalMachineName}'"); } // replace URI parameters with values from identity @@ -2767,16 +5109,19 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // 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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.BareMetalMachinesCordon_Call(request,onOk,onDefault,eventListener,sender); + await this.BareMetalMachinesCordon_Call (request, onOk,onDefault,eventListener,sender); } } - /// Actual wire call for method. - /// the prepared HttpRequestMessage to send. + /// Cordon the provided bare metal machine's Kubernetes node. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the bare metal machine. + /// Json string supplied to the BareMetalMachinesCordon 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). @@ -2785,32 +5130,75 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task BareMetalMachinesCordon_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task BareMetalMachinesCordonViaJsonString(string subscriptionId, string resourceGroupName, string bareMetalMachineName, global::System.String jsonString, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { + var apiVersion = @"2025-02-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.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // this operation supports x-ms-long-running-operation - var _originalUri = request.RequestUri.AbsoluteUri; - // declared final-state-via: location - var _finalUri = _response.GetFirstHeader(@"Location"); - var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - var location = _response.GetFirstHeader(@"Location"); - while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) - { - - // get the delay before polling. (default to 30 seconds if not present) - int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.NetworkCloud/bareMetalMachines/" + + global::System.Uri.EscapeDataString(bareMetalMachineName) + + "/cordon" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.BareMetalMachinesCordon_Call (request, onOk,onDefault,eventListener,sender); + } + } - // start the delay timer (we'll await later...) - var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task BareMetalMachinesCordon_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // declared final-state-via: location + var _finalUri = _response.GetFirstHeader(@"Location"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } // while we wait, let's grab the headers and get ready to poll. if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { @@ -2819,15 +5207,14 @@ public partial class NetworkCloud if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { location = _response.GetFirstHeader(@"Location"); } - var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); // and let's look at the current response body and see if we have some information we can give back to the listener var content = await _response.Content.ReadAsStringAsync(); - await waiting; - - // check for cancellation - if( eventListener.Token.IsCancellationRequested ) { return; } // drop the old response _response?.Dispose(); @@ -2836,45 +5223,45 @@ public partial class NetworkCloud _response = await sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // if we got back an OK, take a peek inside and see if it's done - if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) - { - var error = false; - try { - if( Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) - { - var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); - if( state is null ) - { - // the body doesn't contain any information that has the state of the LRO - // we're going to just get out, and let the consumer have the result - break; - } - - switch( state?.ToString()?.ToLower() ) - { - case "failed": - error = true; + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. break; - case "succeeded": - case "canceled": - // we're done polling. - break; - - default: - // need to keep polling! - _response.StatusCode = global::System.Net.HttpStatusCode.Created; - continue; - } - } - } catch { - // if we run into a problem peeking into the result, - // we really don't want to do anything special. - } - if (error) { - throw new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException(_response); - } - } + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException(_response); + } + } // check for terminal status code if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) @@ -2893,6 +5280,7 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } break; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -2906,7 +5294,7 @@ public partial class NetworkCloud default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -2933,7 +5321,7 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task BareMetalMachinesCordon_Validate(string subscriptionId, string resourceGroupName, string bareMetalMachineName, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineCordonParameters body, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task BareMetalMachinesCordon_Validate(string subscriptionId, string resourceGroupName, string bareMetalMachineName, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineCordonParameters body, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -2943,14 +5331,14 @@ public partial class NetworkCloud await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); await eventListener.AssertNotNull(nameof(bareMetalMachineName),bareMetalMachineName); - await eventListener.AssertRegEx(nameof(bareMetalMachineName),bareMetalMachineName,@"^([a-zA-Z0-9][a-zA-Z0-9]{0,62}[a-zA-Z0-9])$"); + await eventListener.AssertRegEx(nameof(bareMetalMachineName), bareMetalMachineName, @"^([a-zA-Z0-9][a-zA-Z0-9]{0,62}[a-zA-Z0-9])$"); await eventListener.AssertNotNull(nameof(body), body); await eventListener.AssertObjectIsValid(nameof(body), body); } } /// - /// Create a new bare metal machine or update the properties of the existing one. + /// update a new bare metal machine or update the properties of the existing one. /// All customer initiated requests will be rejected as the life cycle of this resource is managed by the system. /// /// The ID of the target subscription. The value must be an UUID. @@ -2966,10 +5354,11 @@ public partial class NetworkCloud /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 BareMetalMachinesCreateOrUpdate(string subscriptionId, string resourceGroupName, string bareMetalMachineName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachine body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task BareMetalMachinesCreateOrUpdate(string subscriptionId, string resourceGroupName, string bareMetalMachineName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachine body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -3006,16 +5395,16 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // 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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.BareMetalMachinesCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + await this.BareMetalMachinesCreateOrUpdate_Call (request, onOk,onDefault,eventListener,sender); } } /// - /// Create a new bare metal machine or update the properties of the existing one. + /// update a new bare metal machine or update the properties of the existing one. /// All customer initiated requests will be rejected as the life cycle of this resource is managed by the system. /// /// @@ -3029,10 +5418,85 @@ public partial class NetworkCloud /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 BareMetalMachinesCreateOrUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachine body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task BareMetalMachinesCreateOrUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachine body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/bareMetalMachines/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/bareMetalMachines/{bareMetalMachineName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var bareMetalMachineName = _match.Groups["bareMetalMachineName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.NetworkCloud/bareMetalMachines/" + + bareMetalMachineName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + if (null != ifNoneMatch) + { + request.Headers.Add("If-None-Match",ifNoneMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.BareMetalMachinesCreateOrUpdate_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// + /// update a new bare metal machine or update the properties of the existing one. + /// All customer initiated requests will be rejected as the life cycle of this resource is managed by the system. + /// + /// + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// The request body. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 BareMetalMachinesCreateOrUpdateViaIdentityWithResult(global::System.String viaIdentity, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachine body, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -3062,6 +5526,71 @@ public partial class NetworkCloud + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + if (null != ifNoneMatch) + { + request.Headers.Add("If-None-Match",ifNoneMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.BareMetalMachinesCreateOrUpdateWithResult_Call (request, eventListener,sender); + } + } + + /// + /// update a new bare metal machine or update the properties of the existing one. + /// All customer initiated requests will be rejected as the life cycle of this resource is managed by the system. + /// + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the bare metal machine. + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// Json string supplied to the BareMetalMachinesCreateOrUpdate 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.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task BareMetalMachinesCreateOrUpdateViaJsonString(string subscriptionId, string resourceGroupName, string bareMetalMachineName, string ifMatch, string ifNoneMatch, 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.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.NetworkCloud/bareMetalMachines/" + + global::System.Uri.EscapeDataString(bareMetalMachineName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } // generate request object @@ -3081,15 +5610,296 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // 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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.BareMetalMachinesCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + await this.BareMetalMachinesCreateOrUpdate_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// + /// update a new bare metal machine or update the properties of the existing one. + /// All customer initiated requests will be rejected as the life cycle of this resource is managed by the system. + /// + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the bare metal machine. + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// Json string supplied to the BareMetalMachinesCreateOrUpdate operation + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task BareMetalMachinesCreateOrUpdateViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string bareMetalMachineName, string ifMatch, string ifNoneMatch, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.NetworkCloud/bareMetalMachines/" + + global::System.Uri.EscapeDataString(bareMetalMachineName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + if (null != ifNoneMatch) + { + request.Headers.Add("If-None-Match",ifNoneMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.BareMetalMachinesCreateOrUpdateWithResult_Call (request, eventListener,sender); + } + } + + /// + /// update a new bare metal machine or update the properties of the existing one. + /// All customer initiated requests will be rejected as the life cycle of this resource is managed by the system. + /// + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the bare metal machine. + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// The request body. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 BareMetalMachinesCreateOrUpdateWithResult(string subscriptionId, string resourceGroupName, string bareMetalMachineName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachine body, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.NetworkCloud/bareMetalMachines/" + + global::System.Uri.EscapeDataString(bareMetalMachineName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + if (null != ifNoneMatch) + { + request.Headers.Add("If-None-Match",ifNoneMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.BareMetalMachinesCreateOrUpdateWithResult_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.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task BareMetalMachinesCreateOrUpdateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + // declared final-state-via: azure-async-operation + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + break; + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BareMetalMachine.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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 @@ -3099,31 +5909,28 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task BareMetalMachinesCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task BareMetalMachinesCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { global::System.Net.Http.HttpResponseMessage _response = null; try { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; var sendTask = sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // this operation supports x-ms-long-running-operation - var _originalUri = request.RequestUri.AbsoluteUri; // declared final-state-via: azure-async-operation var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) { - - // get the delay before polling. (default to 30 seconds if not present) - int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // start the delay timer (we'll await later...) - var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } // while we wait, let's grab the headers and get ready to poll. if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { @@ -3132,15 +5939,14 @@ public partial class NetworkCloud if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { location = _response.GetFirstHeader(@"Location"); } - var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); // and let's look at the current response body and see if we have some information we can give back to the listener var content = await _response.Content.ReadAsStringAsync(); - await waiting; - - // check for cancellation - if( eventListener.Token.IsCancellationRequested ) { return; } // drop the old response _response?.Dispose(); @@ -3149,45 +5955,45 @@ public partial class NetworkCloud _response = await sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // if we got back an OK, take a peek inside and see if it's done - if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) - { - var error = false; - try { - if( Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) - { - var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); - if( state is null ) - { - // the body doesn't contain any information that has the state of the LRO - // we're going to just get out, and let the consumer have the result - break; - } - - switch( state?.ToString()?.ToLower() ) - { - case "failed": - error = true; + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. break; - case "succeeded": - case "canceled": - // we're done polling. - break; - - default: - // need to keep polling! - _response.StatusCode = global::System.Net.HttpStatusCode.Created; - continue; - } - } - } catch { - // if we run into a problem peeking into the result, - // we really don't want to do anything special. - } - if (error) { - throw new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException(_response); - } - } + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException(_response); + } + } // check for terminal status code if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) @@ -3206,6 +6012,7 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } break; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -3213,13 +6020,13 @@ public partial class NetworkCloud case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BareMetalMachine.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BareMetalMachine.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -3250,7 +6057,7 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task BareMetalMachinesCreateOrUpdate_Validate(string subscriptionId, string resourceGroupName, string bareMetalMachineName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachine body, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task BareMetalMachinesCreateOrUpdate_Validate(string subscriptionId, string resourceGroupName, string bareMetalMachineName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachine body, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -3260,7 +6067,7 @@ public partial class NetworkCloud await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); await eventListener.AssertNotNull(nameof(bareMetalMachineName),bareMetalMachineName); - await eventListener.AssertRegEx(nameof(bareMetalMachineName),bareMetalMachineName,@"^([a-zA-Z0-9][a-zA-Z0-9]{0,62}[a-zA-Z0-9])$"); + await eventListener.AssertRegEx(nameof(bareMetalMachineName), bareMetalMachineName, @"^([a-zA-Z0-9][a-zA-Z0-9]{0,62}[a-zA-Z0-9])$"); await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); await eventListener.AssertNotNull(nameof(ifNoneMatch),ifNoneMatch); await eventListener.AssertNotNull(nameof(body), body); @@ -3288,7 +6095,7 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task BareMetalMachinesDelete(string subscriptionId, string resourceGroupName, string bareMetalMachineName, string ifMatch, string ifNoneMatch, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task BareMetalMachinesDelete(string subscriptionId, string resourceGroupName, string bareMetalMachineName, string ifMatch, string ifNoneMatch, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -3325,7 +6132,7 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.BareMetalMachinesDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + await this.BareMetalMachinesDelete_Call (request, onOk,onNoContent,onDefault,eventListener,sender); } } @@ -3347,7 +6154,7 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task BareMetalMachinesDeleteViaIdentity(global::System.String viaIdentity, string ifMatch, string ifNoneMatch, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task BareMetalMachinesDeleteViaIdentity(global::System.String viaIdentity, string ifMatch, string ifNoneMatch, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -3396,11 +6203,11 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.BareMetalMachinesDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + await this.BareMetalMachinesDelete_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). @@ -3411,32 +6218,29 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task BareMetalMachinesDelete_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.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task BareMetalMachinesDelete_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.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { global::System.Net.Http.HttpResponseMessage _response = null; try { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; var sendTask = sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // this operation supports x-ms-long-running-operation - var _originalUri = request.RequestUri.AbsoluteUri; // declared final-state-via: location var _finalUri = _response.GetFirstHeader(@"Location"); var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) { - - // get the delay before polling. (default to 30 seconds if not present) - int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // start the delay timer (we'll await later...) - var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } // while we wait, let's grab the headers and get ready to poll. if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { @@ -3445,15 +6249,14 @@ public partial class NetworkCloud if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { location = _response.GetFirstHeader(@"Location"); } - var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); // and let's look at the current response body and see if we have some information we can give back to the listener var content = await _response.Content.ReadAsStringAsync(); - await waiting; - - // check for cancellation - if( eventListener.Token.IsCancellationRequested ) { return; } // drop the old response _response?.Dispose(); @@ -3462,45 +6265,45 @@ public partial class NetworkCloud _response = await sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // if we got back an OK, take a peek inside and see if it's done - if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) - { - var error = false; - try { - if( Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) - { - var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); - if( state is null ) - { - // the body doesn't contain any information that has the state of the LRO - // we're going to just get out, and let the consumer have the result - break; - } - - switch( state?.ToString()?.ToLower() ) - { - case "failed": - error = true; + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result break; - case "succeeded": - case "canceled": - // we're done polling. - break; - - default: - // need to keep polling! - _response.StatusCode = global::System.Net.HttpStatusCode.Created; - continue; - } - } - } catch { - // if we run into a problem peeking into the result, - // we really don't want to do anything special. - } - if (error) { - throw new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException(_response); - } - } + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException(_response); + } + } // check for terminal status code if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) @@ -3519,6 +6322,7 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } break; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -3538,7 +6342,7 @@ public partial class NetworkCloud default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -3578,7 +6382,7 @@ public partial class NetworkCloud await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); await eventListener.AssertNotNull(nameof(bareMetalMachineName),bareMetalMachineName); - await eventListener.AssertRegEx(nameof(bareMetalMachineName),bareMetalMachineName,@"^([a-zA-Z0-9][a-zA-Z0-9]{0,62}[a-zA-Z0-9])$"); + await eventListener.AssertRegEx(nameof(bareMetalMachineName), bareMetalMachineName, @"^([a-zA-Z0-9][a-zA-Z0-9]{0,62}[a-zA-Z0-9])$"); await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); await eventListener.AssertNotNull(nameof(ifNoneMatch),ifNoneMatch); } @@ -3596,7 +6400,7 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task BareMetalMachinesGet(string subscriptionId, string resourceGroupName, string bareMetalMachineName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task BareMetalMachinesGet(string subscriptionId, string resourceGroupName, string bareMetalMachineName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -3623,7 +6427,7 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.BareMetalMachinesGet_Call(request,onOk,onDefault,eventListener,sender); + await this.BareMetalMachinesGet_Call (request, onOk,onDefault,eventListener,sender); } } @@ -3637,7 +6441,7 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task BareMetalMachinesGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task BareMetalMachinesGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -3676,96 +6480,72 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.BareMetalMachinesGet_Call(request,onOk,onDefault,eventListener,sender); + await this.BareMetalMachinesGet_Call (request, onOk,onDefault,eventListener,sender); } } - /// Actual wire call for method. - /// the prepared HttpRequestMessage to send. - /// a delegate that is called 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 properties of the provided bare metal machine. + /// /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 BareMetalMachinesGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task BareMetalMachinesGetViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { + var apiVersion = @"2025-02-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.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BareMetalMachine.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/bareMetalMachines/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/bareMetalMachines/{bareMetalMachineName}'"); } - } - } - /// - /// Validation method for method. Call this like the actual call, but you will get validation - /// events back. - /// - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of the bare metal machine. - /// an instance that will receive events. - /// - /// A that will be complete when handling of the response is completed. - /// - internal async global::System.Threading.Tasks.Task BareMetalMachinesGet_Validate(string subscriptionId, string resourceGroupName, string bareMetalMachineName, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) - { - using( NoSynchronizationContext ) - { - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); - await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); - await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); - await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); - await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertNotNull(nameof(bareMetalMachineName),bareMetalMachineName); - await eventListener.AssertRegEx(nameof(bareMetalMachineName),bareMetalMachineName,@"^([a-zA-Z0-9][a-zA-Z0-9]{0,62}[a-zA-Z0-9])$"); + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var bareMetalMachineName = _match.Groups["bareMetalMachineName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.NetworkCloud/bareMetalMachines/" + + bareMetalMachineName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.BareMetalMachinesGetWithResult_Call (request, eventListener,sender); } } - /// Get a list of bare metal machines in the provided resource group. + /// Get properties of the provided bare metal machine. /// The ID of the target subscription. The value must be an UUID. /// 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). + /// The name of the bare metal machine. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 BareMetalMachinesListByResourceGroup(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.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task BareMetalMachinesGetWithResult(string subscriptionId, string resourceGroupName, string bareMetalMachineName, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -3777,45 +6557,222 @@ public partial class NetworkCloud + global::System.Uri.EscapeDataString(subscriptionId) + "/resourceGroups/" + global::System.Uri.EscapeDataString(resourceGroupName) - + "/providers/Microsoft.NetworkCloud/bareMetalMachines" + + "/providers/Microsoft.NetworkCloud/bareMetalMachines/" + + global::System.Uri.EscapeDataString(bareMetalMachineName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.BareMetalMachinesListByResourceGroup_Call(request,onOk,onDefault,eventListener,sender); + return await this.BareMetalMachinesGetWithResult_Call (request, eventListener,sender); } } - /// Get a list of bare metal machines in the provided 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). + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 BareMetalMachinesListByResourceGroupViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task BareMetalMachinesGetWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { - var apiVersion = @"2025-02-01"; - // Constant Parameters using( NoSynchronizationContext ) { - // verify that Identity format is an exact match for uri - - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/bareMetalMachines$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); - if (!_match.Success) - { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BareMetalMachine.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task BareMetalMachinesGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BareMetalMachine.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the bare metal machine. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task BareMetalMachinesGet_Validate(string subscriptionId, string resourceGroupName, string bareMetalMachineName, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(bareMetalMachineName),bareMetalMachineName); + await eventListener.AssertRegEx(nameof(bareMetalMachineName), bareMetalMachineName, @"^([a-zA-Z0-9][a-zA-Z0-9]{0,62}[a-zA-Z0-9])$"); + } + } + + /// Get a list of bare metal machines in the provided resource group. + /// The ID of the target subscription. The value must be an UUID. + /// 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.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task BareMetalMachinesListByResourceGroup(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.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.NetworkCloud/bareMetalMachines" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.BareMetalMachinesListByResourceGroup_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Get a list of bare metal machines in the provided 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.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task BareMetalMachinesListByResourceGroupViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/bareMetalMachines$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/bareMetalMachines'"); } @@ -3842,12 +6799,162 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.BareMetalMachinesListByResourceGroup_Call(request,onOk,onDefault,eventListener,sender); + await this.BareMetalMachinesListByResourceGroup_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Get a list of bare metal machines in the provided resource group. + /// + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task BareMetalMachinesListByResourceGroupViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/bareMetalMachines$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/bareMetalMachines'"); + } + + // 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.NetworkCloud/bareMetalMachines" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.BareMetalMachinesListByResourceGroupWithResult_Call (request, eventListener,sender); + } + } + + /// Get a list of bare metal machines in the provided resource group. + /// The ID of the target subscription. The value must be an UUID. + /// 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.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task BareMetalMachinesListByResourceGroupWithResult(string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.NetworkCloud/bareMetalMachines" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.BareMetalMachinesListByResourceGroupWithResult_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.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task BareMetalMachinesListByResourceGroupWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BareMetalMachineList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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). @@ -3858,7 +6965,7 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task BareMetalMachinesListByResourceGroup_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task BareMetalMachinesListByResourceGroup_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -3869,6 +6976,7 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -3876,13 +6984,13 @@ public partial class NetworkCloud case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BareMetalMachineList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BareMetalMachineList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -3929,7 +7037,7 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task BareMetalMachinesListBySubscription(string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task BareMetalMachinesListBySubscription(string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -3953,7 +7061,7 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.BareMetalMachinesListBySubscription_Call(request,onOk,onDefault,eventListener,sender); + await this.BareMetalMachinesListBySubscription_Call (request, onOk,onDefault,eventListener,sender); } } @@ -3967,7 +7075,7 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task BareMetalMachinesListBySubscriptionViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task BareMetalMachinesListBySubscriptionViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -4001,11 +7109,157 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.BareMetalMachinesListBySubscription_Call(request,onOk,onDefault,eventListener,sender); + await this.BareMetalMachinesListBySubscription_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Get a list of bare metal machines in the provided subscription. + /// + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task BareMetalMachinesListBySubscriptionViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-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.NetworkCloud/bareMetalMachines$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.NetworkCloud/bareMetalMachines'"); + } + + // 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.NetworkCloud/bareMetalMachines" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.BareMetalMachinesListBySubscriptionWithResult_Call (request, eventListener,sender); + } + } + + /// Get a list of bare metal machines in the provided subscription. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task BareMetalMachinesListBySubscriptionWithResult(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/providers/Microsoft.NetworkCloud/bareMetalMachines" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.BareMetalMachinesListBySubscriptionWithResult_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.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task BareMetalMachinesListBySubscriptionWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BareMetalMachineList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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 @@ -4015,7 +7269,7 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task BareMetalMachinesListBySubscription_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task BareMetalMachinesListBySubscription_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -4026,6 +7280,7 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -4033,13 +7288,13 @@ public partial class NetworkCloud case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BareMetalMachineList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BareMetalMachineList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -4082,10 +7337,11 @@ public partial class NetworkCloud /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 BareMetalMachinesPowerOff(string subscriptionId, string resourceGroupName, string bareMetalMachineName, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePowerOffParameters body, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task BareMetalMachinesPowerOff(string subscriptionId, string resourceGroupName, string bareMetalMachineName, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePowerOffParameters body, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -4113,11 +7369,11 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // 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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.BareMetalMachinesPowerOff_Call(request,onOk,onDefault,eventListener,sender); + await this.BareMetalMachinesPowerOff_Call (request, onOk,onDefault,eventListener,sender); } } @@ -4129,10 +7385,11 @@ public partial class NetworkCloud /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 BareMetalMachinesPowerOffViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePowerOffParameters body, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task BareMetalMachinesPowerOffViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePowerOffParameters body, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -4143,7 +7400,7 @@ public partial class NetworkCloud var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/bareMetalMachines/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/bareMetalMachines/{bareMetalMachineName}/powerOff'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/bareMetalMachines/{bareMetalMachineName}'"); } // replace URI parameters with values from identity @@ -4172,15 +7429,64 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // 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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.BareMetalMachinesPowerOff_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Power off the provided bare metal machine. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the bare metal machine. + /// Json string supplied to the BareMetalMachinesPowerOff 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.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task BareMetalMachinesPowerOffViaJsonString(string subscriptionId, string resourceGroupName, string bareMetalMachineName, global::System.String jsonString, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.NetworkCloud/bareMetalMachines/" + + global::System.Uri.EscapeDataString(bareMetalMachineName) + + "/powerOff" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.BareMetalMachinesPowerOff_Call(request,onOk,onDefault,eventListener,sender); + await this.BareMetalMachinesPowerOff_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 @@ -4190,32 +7496,29 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task BareMetalMachinesPowerOff_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task BareMetalMachinesPowerOff_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { global::System.Net.Http.HttpResponseMessage _response = null; try { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; var sendTask = sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // this operation supports x-ms-long-running-operation - var _originalUri = request.RequestUri.AbsoluteUri; // declared final-state-via: location var _finalUri = _response.GetFirstHeader(@"Location"); var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) { - - // get the delay before polling. (default to 30 seconds if not present) - int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // start the delay timer (we'll await later...) - var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } // while we wait, let's grab the headers and get ready to poll. if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { @@ -4224,15 +7527,14 @@ public partial class NetworkCloud if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { location = _response.GetFirstHeader(@"Location"); } - var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); // and let's look at the current response body and see if we have some information we can give back to the listener var content = await _response.Content.ReadAsStringAsync(); - await waiting; - - // check for cancellation - if( eventListener.Token.IsCancellationRequested ) { return; } // drop the old response _response?.Dispose(); @@ -4241,45 +7543,45 @@ public partial class NetworkCloud _response = await sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // if we got back an OK, take a peek inside and see if it's done - if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) - { - var error = false; - try { - if( Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) - { - var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); - if( state is null ) - { - // the body doesn't contain any information that has the state of the LRO - // we're going to just get out, and let the consumer have the result - break; - } - - switch( state?.ToString()?.ToLower() ) - { - case "failed": - error = true; + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result break; - case "succeeded": - case "canceled": - // we're done polling. - break; - - default: - // need to keep polling! - _response.StatusCode = global::System.Net.HttpStatusCode.Created; - continue; - } - } - } catch { - // if we run into a problem peeking into the result, - // we really don't want to do anything special. - } - if (error) { - throw new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException(_response); - } - } + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException(_response); + } + } // check for terminal status code if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) @@ -4298,6 +7600,7 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } break; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -4311,7 +7614,7 @@ public partial class NetworkCloud default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -4338,7 +7641,7 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task BareMetalMachinesPowerOff_Validate(string subscriptionId, string resourceGroupName, string bareMetalMachineName, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePowerOffParameters body, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task BareMetalMachinesPowerOff_Validate(string subscriptionId, string resourceGroupName, string bareMetalMachineName, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePowerOffParameters body, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -4348,7 +7651,7 @@ public partial class NetworkCloud await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); await eventListener.AssertNotNull(nameof(bareMetalMachineName),bareMetalMachineName); - await eventListener.AssertRegEx(nameof(bareMetalMachineName),bareMetalMachineName,@"^([a-zA-Z0-9][a-zA-Z0-9]{0,62}[a-zA-Z0-9])$"); + await eventListener.AssertRegEx(nameof(bareMetalMachineName), bareMetalMachineName, @"^([a-zA-Z0-9][a-zA-Z0-9]{0,62}[a-zA-Z0-9])$"); await eventListener.AssertNotNull(nameof(body), body); await eventListener.AssertObjectIsValid(nameof(body), body); } @@ -4366,7 +7669,7 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task BareMetalMachinesReimage(string subscriptionId, string resourceGroupName, string bareMetalMachineName, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task BareMetalMachinesReimage(string subscriptionId, string resourceGroupName, string bareMetalMachineName, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -4394,7 +7697,7 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.BareMetalMachinesReimage_Call(request,onOk,onDefault,eventListener,sender); + await this.BareMetalMachinesReimage_Call (request, onOk,onDefault,eventListener,sender); } } @@ -4408,7 +7711,7 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task BareMetalMachinesReimageViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task BareMetalMachinesReimageViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -4419,7 +7722,7 @@ public partial class NetworkCloud var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/bareMetalMachines/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/bareMetalMachines/{bareMetalMachineName}/reimage'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/bareMetalMachines/{bareMetalMachineName}'"); } // replace URI parameters with values from identity @@ -4448,11 +7751,11 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.BareMetalMachinesReimage_Call(request,onOk,onDefault,eventListener,sender); + await this.BareMetalMachinesReimage_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 @@ -4462,32 +7765,29 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task BareMetalMachinesReimage_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task BareMetalMachinesReimage_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { global::System.Net.Http.HttpResponseMessage _response = null; try { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; var sendTask = sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // this operation supports x-ms-long-running-operation - var _originalUri = request.RequestUri.AbsoluteUri; // declared final-state-via: location var _finalUri = _response.GetFirstHeader(@"Location"); var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) { - - // get the delay before polling. (default to 30 seconds if not present) - int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // start the delay timer (we'll await later...) - var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } // while we wait, let's grab the headers and get ready to poll. if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { @@ -4496,15 +7796,14 @@ public partial class NetworkCloud if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { location = _response.GetFirstHeader(@"Location"); } - var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); // and let's look at the current response body and see if we have some information we can give back to the listener var content = await _response.Content.ReadAsStringAsync(); - await waiting; - - // check for cancellation - if( eventListener.Token.IsCancellationRequested ) { return; } // drop the old response _response?.Dispose(); @@ -4513,45 +7812,45 @@ public partial class NetworkCloud _response = await sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // if we got back an OK, take a peek inside and see if it's done - if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) - { - var error = false; - try { - if( Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) - { - var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); - if( state is null ) - { - // the body doesn't contain any information that has the state of the LRO - // we're going to just get out, and let the consumer have the result - break; - } - - switch( state?.ToString()?.ToLower() ) - { - case "failed": - error = true; + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result break; - case "succeeded": - case "canceled": - // we're done polling. - break; - - default: - // need to keep polling! - _response.StatusCode = global::System.Net.HttpStatusCode.Created; - continue; - } - } - } catch { - // if we run into a problem peeking into the result, - // we really don't want to do anything special. - } - if (error) { - throw new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException(_response); - } - } + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException(_response); + } + } // check for terminal status code if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) @@ -4570,6 +7869,7 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } break; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -4583,7 +7883,7 @@ public partial class NetworkCloud default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -4619,7 +7919,7 @@ public partial class NetworkCloud await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); await eventListener.AssertNotNull(nameof(bareMetalMachineName),bareMetalMachineName); - await eventListener.AssertRegEx(nameof(bareMetalMachineName),bareMetalMachineName,@"^([a-zA-Z0-9][a-zA-Z0-9]{0,62}[a-zA-Z0-9])$"); + await eventListener.AssertRegEx(nameof(bareMetalMachineName), bareMetalMachineName, @"^([a-zA-Z0-9][a-zA-Z0-9]{0,62}[a-zA-Z0-9])$"); } } @@ -4633,10 +7933,11 @@ public partial class NetworkCloud /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 BareMetalMachinesReplace(string subscriptionId, string resourceGroupName, string bareMetalMachineName, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineReplaceParameters body, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task BareMetalMachinesReplace(string subscriptionId, string resourceGroupName, string bareMetalMachineName, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineReplaceParameters body, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -4664,11 +7965,11 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // 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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.BareMetalMachinesReplace_Call(request,onOk,onDefault,eventListener,sender); + await this.BareMetalMachinesReplace_Call (request, onOk,onDefault,eventListener,sender); } } @@ -4680,10 +7981,11 @@ public partial class NetworkCloud /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 BareMetalMachinesReplaceViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineReplaceParameters body, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task BareMetalMachinesReplaceViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineReplaceParameters body, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -4694,7 +7996,7 @@ public partial class NetworkCloud var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/bareMetalMachines/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/bareMetalMachines/{bareMetalMachineName}/replace'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/bareMetalMachines/{bareMetalMachineName}'"); } // replace URI parameters with values from identity @@ -4723,15 +8025,64 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // 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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.BareMetalMachinesReplace_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Replace the provided bare metal machine. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the bare metal machine. + /// Json string supplied to the BareMetalMachinesReplace 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.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task BareMetalMachinesReplaceViaJsonString(string subscriptionId, string resourceGroupName, string bareMetalMachineName, global::System.String jsonString, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.NetworkCloud/bareMetalMachines/" + + global::System.Uri.EscapeDataString(bareMetalMachineName) + + "/replace" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.BareMetalMachinesReplace_Call(request,onOk,onDefault,eventListener,sender); + await this.BareMetalMachinesReplace_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 @@ -4741,32 +8092,29 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task BareMetalMachinesReplace_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task BareMetalMachinesReplace_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { global::System.Net.Http.HttpResponseMessage _response = null; try { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; var sendTask = sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // this operation supports x-ms-long-running-operation - var _originalUri = request.RequestUri.AbsoluteUri; // declared final-state-via: location var _finalUri = _response.GetFirstHeader(@"Location"); var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) { - - // get the delay before polling. (default to 30 seconds if not present) - int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // start the delay timer (we'll await later...) - var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } // while we wait, let's grab the headers and get ready to poll. if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { @@ -4775,15 +8123,14 @@ public partial class NetworkCloud if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { location = _response.GetFirstHeader(@"Location"); } - var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); // and let's look at the current response body and see if we have some information we can give back to the listener var content = await _response.Content.ReadAsStringAsync(); - await waiting; - - // check for cancellation - if( eventListener.Token.IsCancellationRequested ) { return; } // drop the old response _response?.Dispose(); @@ -4792,45 +8139,45 @@ public partial class NetworkCloud _response = await sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // if we got back an OK, take a peek inside and see if it's done - if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) - { - var error = false; - try { - if( Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) - { - var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); - if( state is null ) - { - // the body doesn't contain any information that has the state of the LRO - // we're going to just get out, and let the consumer have the result - break; - } - - switch( state?.ToString()?.ToLower() ) - { - case "failed": - error = true; + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. break; - case "succeeded": - case "canceled": - // we're done polling. - break; - - default: - // need to keep polling! - _response.StatusCode = global::System.Net.HttpStatusCode.Created; - continue; - } - } - } catch { - // if we run into a problem peeking into the result, - // we really don't want to do anything special. - } - if (error) { - throw new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException(_response); - } - } + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException(_response); + } + } // check for terminal status code if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) @@ -4849,6 +8196,7 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } break; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -4862,7 +8210,7 @@ public partial class NetworkCloud default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -4889,7 +8237,7 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task BareMetalMachinesReplace_Validate(string subscriptionId, string resourceGroupName, string bareMetalMachineName, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineReplaceParameters body, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task BareMetalMachinesReplace_Validate(string subscriptionId, string resourceGroupName, string bareMetalMachineName, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineReplaceParameters body, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -4899,7 +8247,7 @@ public partial class NetworkCloud await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); await eventListener.AssertNotNull(nameof(bareMetalMachineName),bareMetalMachineName); - await eventListener.AssertRegEx(nameof(bareMetalMachineName),bareMetalMachineName,@"^([a-zA-Z0-9][a-zA-Z0-9]{0,62}[a-zA-Z0-9])$"); + await eventListener.AssertRegEx(nameof(bareMetalMachineName), bareMetalMachineName, @"^([a-zA-Z0-9][a-zA-Z0-9]{0,62}[a-zA-Z0-9])$"); await eventListener.AssertNotNull(nameof(body), body); await eventListener.AssertObjectIsValid(nameof(body), body); } @@ -4917,7 +8265,7 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task BareMetalMachinesRestart(string subscriptionId, string resourceGroupName, string bareMetalMachineName, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task BareMetalMachinesRestart(string subscriptionId, string resourceGroupName, string bareMetalMachineName, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -4945,7 +8293,7 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.BareMetalMachinesRestart_Call(request,onOk,onDefault,eventListener,sender); + await this.BareMetalMachinesRestart_Call (request, onOk,onDefault,eventListener,sender); } } @@ -4959,7 +8307,7 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task BareMetalMachinesRestartViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task BareMetalMachinesRestartViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -4970,7 +8318,7 @@ public partial class NetworkCloud var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/bareMetalMachines/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/bareMetalMachines/{bareMetalMachineName}/restart'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/bareMetalMachines/{bareMetalMachineName}'"); } // replace URI parameters with values from identity @@ -4999,11 +8347,11 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.BareMetalMachinesRestart_Call(request,onOk,onDefault,eventListener,sender); + await this.BareMetalMachinesRestart_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 @@ -5013,32 +8361,29 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task BareMetalMachinesRestart_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task BareMetalMachinesRestart_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { global::System.Net.Http.HttpResponseMessage _response = null; try { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; var sendTask = sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // this operation supports x-ms-long-running-operation - var _originalUri = request.RequestUri.AbsoluteUri; // declared final-state-via: location var _finalUri = _response.GetFirstHeader(@"Location"); var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) { - - // get the delay before polling. (default to 30 seconds if not present) - int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // start the delay timer (we'll await later...) - var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } // while we wait, let's grab the headers and get ready to poll. if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { @@ -5047,15 +8392,14 @@ public partial class NetworkCloud if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { location = _response.GetFirstHeader(@"Location"); } - var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); // and let's look at the current response body and see if we have some information we can give back to the listener var content = await _response.Content.ReadAsStringAsync(); - await waiting; - - // check for cancellation - if( eventListener.Token.IsCancellationRequested ) { return; } // drop the old response _response?.Dispose(); @@ -5064,45 +8408,45 @@ public partial class NetworkCloud _response = await sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // if we got back an OK, take a peek inside and see if it's done - if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) - { - var error = false; - try { - if( Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) - { - var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); - if( state is null ) - { - // the body doesn't contain any information that has the state of the LRO - // we're going to just get out, and let the consumer have the result - break; - } - - switch( state?.ToString()?.ToLower() ) - { - case "failed": - error = true; + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result break; - case "succeeded": - case "canceled": - // we're done polling. - break; - - default: - // need to keep polling! - _response.StatusCode = global::System.Net.HttpStatusCode.Created; - continue; - } - } - } catch { - // if we run into a problem peeking into the result, - // we really don't want to do anything special. - } - if (error) { - throw new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException(_response); - } - } + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException(_response); + } + } // check for terminal status code if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) @@ -5121,6 +8465,7 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } break; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -5134,7 +8479,7 @@ public partial class NetworkCloud default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -5170,7 +8515,7 @@ public partial class NetworkCloud await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); await eventListener.AssertNotNull(nameof(bareMetalMachineName),bareMetalMachineName); - await eventListener.AssertRegEx(nameof(bareMetalMachineName),bareMetalMachineName,@"^([a-zA-Z0-9][a-zA-Z0-9]{0,62}[a-zA-Z0-9])$"); + await eventListener.AssertRegEx(nameof(bareMetalMachineName), bareMetalMachineName, @"^([a-zA-Z0-9][a-zA-Z0-9]{0,62}[a-zA-Z0-9])$"); } } @@ -5187,10 +8532,11 @@ public partial class NetworkCloud /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 BareMetalMachinesRunCommand(string subscriptionId, string resourceGroupName, string bareMetalMachineName, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineRunCommandParameters body, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task BareMetalMachinesRunCommand(string subscriptionId, string resourceGroupName, string bareMetalMachineName, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineRunCommandParameters body, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -5218,11 +8564,11 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // 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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.BareMetalMachinesRunCommand_Call(request,onOk,onDefault,eventListener,sender); + await this.BareMetalMachinesRunCommand_Call (request, onOk,onDefault,eventListener,sender); } } @@ -5237,10 +8583,11 @@ public partial class NetworkCloud /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 BareMetalMachinesRunCommandViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineRunCommandParameters body, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task BareMetalMachinesRunCommandViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineRunCommandParameters body, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -5251,7 +8598,7 @@ public partial class NetworkCloud var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/bareMetalMachines/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/bareMetalMachines/{bareMetalMachineName}/runCommand'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/bareMetalMachines/{bareMetalMachineName}'"); } // replace URI parameters with values from identity @@ -5280,15 +8627,67 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // 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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.BareMetalMachinesRunCommand_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// + /// Run the command or the script on the provided bare metal machine. The URL to storage account with the command execution + /// results and the command exit code can be retrieved from the operation status API once available. + /// + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the bare metal machine. + /// Json string supplied to the BareMetalMachinesRunCommand 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.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task BareMetalMachinesRunCommandViaJsonString(string subscriptionId, string resourceGroupName, string bareMetalMachineName, global::System.String jsonString, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.NetworkCloud/bareMetalMachines/" + + global::System.Uri.EscapeDataString(bareMetalMachineName) + + "/runCommand" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.BareMetalMachinesRunCommand_Call(request,onOk,onDefault,eventListener,sender); + await this.BareMetalMachinesRunCommand_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 @@ -5298,32 +8697,29 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task BareMetalMachinesRunCommand_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task BareMetalMachinesRunCommand_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { global::System.Net.Http.HttpResponseMessage _response = null; try { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; var sendTask = sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // this operation supports x-ms-long-running-operation - var _originalUri = request.RequestUri.AbsoluteUri; // declared final-state-via: location var _finalUri = _response.GetFirstHeader(@"Location"); var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) { - - // get the delay before polling. (default to 30 seconds if not present) - int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // start the delay timer (we'll await later...) - var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } // while we wait, let's grab the headers and get ready to poll. if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { @@ -5332,15 +8728,14 @@ public partial class NetworkCloud if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { location = _response.GetFirstHeader(@"Location"); } - var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); // and let's look at the current response body and see if we have some information we can give back to the listener var content = await _response.Content.ReadAsStringAsync(); - await waiting; - - // check for cancellation - if( eventListener.Token.IsCancellationRequested ) { return; } // drop the old response _response?.Dispose(); @@ -5349,45 +8744,45 @@ public partial class NetworkCloud _response = await sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // if we got back an OK, take a peek inside and see if it's done - if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) - { - var error = false; - try { - if( Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) - { - var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); - if( state is null ) - { - // the body doesn't contain any information that has the state of the LRO - // we're going to just get out, and let the consumer have the result - break; - } - - switch( state?.ToString()?.ToLower() ) - { - case "failed": - error = true; + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result break; - case "succeeded": - case "canceled": - // we're done polling. - break; - - default: - // need to keep polling! - _response.StatusCode = global::System.Net.HttpStatusCode.Created; - continue; - } - } - } catch { - // if we run into a problem peeking into the result, - // we really don't want to do anything special. - } - if (error) { - throw new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException(_response); - } - } + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException(_response); + } + } // check for terminal status code if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) @@ -5406,6 +8801,7 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } break; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -5419,7 +8815,7 @@ public partial class NetworkCloud default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -5446,7 +8842,7 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task BareMetalMachinesRunCommand_Validate(string subscriptionId, string resourceGroupName, string bareMetalMachineName, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineRunCommandParameters body, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task BareMetalMachinesRunCommand_Validate(string subscriptionId, string resourceGroupName, string bareMetalMachineName, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineRunCommandParameters body, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -5456,7 +8852,7 @@ public partial class NetworkCloud await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); await eventListener.AssertNotNull(nameof(bareMetalMachineName),bareMetalMachineName); - await eventListener.AssertRegEx(nameof(bareMetalMachineName),bareMetalMachineName,@"^([a-zA-Z0-9][a-zA-Z0-9]{0,62}[a-zA-Z0-9])$"); + await eventListener.AssertRegEx(nameof(bareMetalMachineName), bareMetalMachineName, @"^([a-zA-Z0-9][a-zA-Z0-9]{0,62}[a-zA-Z0-9])$"); await eventListener.AssertNotNull(nameof(body), body); await eventListener.AssertObjectIsValid(nameof(body), body); } @@ -5475,10 +8871,11 @@ public partial class NetworkCloud /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 BareMetalMachinesRunDataExtracts(string subscriptionId, string resourceGroupName, string bareMetalMachineName, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineRunDataExtractsParameters body, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task BareMetalMachinesRunDataExtracts(string subscriptionId, string resourceGroupName, string bareMetalMachineName, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineRunDataExtractsParameters body, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -5506,11 +8903,11 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // 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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.BareMetalMachinesRunDataExtracts_Call(request,onOk,onDefault,eventListener,sender); + await this.BareMetalMachinesRunDataExtracts_Call (request, onOk,onDefault,eventListener,sender); } } @@ -5525,10 +8922,11 @@ public partial class NetworkCloud /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 BareMetalMachinesRunDataExtractsViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineRunDataExtractsParameters body, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task BareMetalMachinesRunDataExtractsViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineRunDataExtractsParameters body, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -5539,7 +8937,7 @@ public partial class NetworkCloud var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/bareMetalMachines/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/bareMetalMachines/{bareMetalMachineName}/runDataExtracts'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/bareMetalMachines/{bareMetalMachineName}'"); } // replace URI parameters with values from identity @@ -5568,15 +8966,67 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // 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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.BareMetalMachinesRunDataExtracts_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// + /// Run one or more data extractions on the provided bare metal machine. The URL to storage account with the command execution + /// results and the command exit code can be retrieved from the operation status API once available. + /// + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the bare metal machine. + /// Json string supplied to the BareMetalMachinesRunDataExtracts 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.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task BareMetalMachinesRunDataExtractsViaJsonString(string subscriptionId, string resourceGroupName, string bareMetalMachineName, global::System.String jsonString, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.NetworkCloud/bareMetalMachines/" + + global::System.Uri.EscapeDataString(bareMetalMachineName) + + "/runDataExtracts" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.BareMetalMachinesRunDataExtracts_Call(request,onOk,onDefault,eventListener,sender); + await this.BareMetalMachinesRunDataExtracts_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 @@ -5586,32 +9036,29 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task BareMetalMachinesRunDataExtracts_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task BareMetalMachinesRunDataExtracts_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { global::System.Net.Http.HttpResponseMessage _response = null; try { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; var sendTask = sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // this operation supports x-ms-long-running-operation - var _originalUri = request.RequestUri.AbsoluteUri; // declared final-state-via: location var _finalUri = _response.GetFirstHeader(@"Location"); var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) { - - // get the delay before polling. (default to 30 seconds if not present) - int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // start the delay timer (we'll await later...) - var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } // while we wait, let's grab the headers and get ready to poll. if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { @@ -5620,15 +9067,14 @@ public partial class NetworkCloud if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { location = _response.GetFirstHeader(@"Location"); } - var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); // and let's look at the current response body and see if we have some information we can give back to the listener var content = await _response.Content.ReadAsStringAsync(); - await waiting; - - // check for cancellation - if( eventListener.Token.IsCancellationRequested ) { return; } // drop the old response _response?.Dispose(); @@ -5637,45 +9083,45 @@ public partial class NetworkCloud _response = await sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // if we got back an OK, take a peek inside and see if it's done - if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) - { - var error = false; - try { - if( Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) - { - var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); - if( state is null ) - { - // the body doesn't contain any information that has the state of the LRO - // we're going to just get out, and let the consumer have the result - break; - } - - switch( state?.ToString()?.ToLower() ) - { - case "failed": - error = true; + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result break; - case "succeeded": - case "canceled": - // we're done polling. - break; - - default: - // need to keep polling! - _response.StatusCode = global::System.Net.HttpStatusCode.Created; - continue; - } - } - } catch { - // if we run into a problem peeking into the result, - // we really don't want to do anything special. - } - if (error) { - throw new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException(_response); - } - } + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException(_response); + } + } // check for terminal status code if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) @@ -5694,6 +9140,7 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } break; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -5707,7 +9154,7 @@ public partial class NetworkCloud default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -5734,7 +9181,7 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task BareMetalMachinesRunDataExtracts_Validate(string subscriptionId, string resourceGroupName, string bareMetalMachineName, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineRunDataExtractsParameters body, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task BareMetalMachinesRunDataExtracts_Validate(string subscriptionId, string resourceGroupName, string bareMetalMachineName, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineRunDataExtractsParameters body, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -5744,7 +9191,7 @@ public partial class NetworkCloud await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); await eventListener.AssertNotNull(nameof(bareMetalMachineName),bareMetalMachineName); - await eventListener.AssertRegEx(nameof(bareMetalMachineName),bareMetalMachineName,@"^([a-zA-Z0-9][a-zA-Z0-9]{0,62}[a-zA-Z0-9])$"); + await eventListener.AssertRegEx(nameof(bareMetalMachineName), bareMetalMachineName, @"^([a-zA-Z0-9][a-zA-Z0-9]{0,62}[a-zA-Z0-9])$"); await eventListener.AssertNotNull(nameof(body), body); await eventListener.AssertObjectIsValid(nameof(body), body); } @@ -5763,10 +9210,11 @@ public partial class NetworkCloud /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 BareMetalMachinesRunReadCommands(string subscriptionId, string resourceGroupName, string bareMetalMachineName, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineRunReadCommandsParameters body, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task BareMetalMachinesRunReadCommands(string subscriptionId, string resourceGroupName, string bareMetalMachineName, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineRunReadCommandsParameters body, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -5794,11 +9242,11 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // 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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.BareMetalMachinesRunReadCommands_Call(request,onOk,onDefault,eventListener,sender); + await this.BareMetalMachinesRunReadCommands_Call (request, onOk,onDefault,eventListener,sender); } } @@ -5813,10 +9261,11 @@ public partial class NetworkCloud /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 BareMetalMachinesRunReadCommandsViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineRunReadCommandsParameters body, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task BareMetalMachinesRunReadCommandsViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineRunReadCommandsParameters body, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -5827,7 +9276,7 @@ public partial class NetworkCloud var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/bareMetalMachines/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/bareMetalMachines/{bareMetalMachineName}/runReadCommands'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/bareMetalMachines/{bareMetalMachineName}'"); } // replace URI parameters with values from identity @@ -5856,192 +9305,22 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // 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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.BareMetalMachinesRunReadCommands_Call(request,onOk,onDefault,eventListener,sender); - } - } - - /// Actual wire call for method. - /// the prepared HttpRequestMessage to send. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. - /// - /// A that will be complete when handling of the response is completed. - /// - internal async global::System.Threading.Tasks.Task BareMetalMachinesRunReadCommands_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) - { - using( NoSynchronizationContext ) - { - global::System.Net.Http.HttpResponseMessage _response = null; - try - { - var sendTask = sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // this operation supports x-ms-long-running-operation - var _originalUri = request.RequestUri.AbsoluteUri; - // declared final-state-via: location - var _finalUri = _response.GetFirstHeader(@"Location"); - var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - var location = _response.GetFirstHeader(@"Location"); - while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) - { - - // get the delay before polling. (default to 30 seconds if not present) - int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // start the delay timer (we'll await later...) - var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); - - // while we wait, let's grab the headers and get ready to poll. - if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { - asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - } - if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { - location = _response.GetFirstHeader(@"Location"); - } - var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; - request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); - - // and let's look at the current response body and see if we have some information we can give back to the listener - var content = await _response.Content.ReadAsStringAsync(); - await waiting; - - // check for cancellation - if( eventListener.Token.IsCancellationRequested ) { return; } - - // drop the old response - _response?.Dispose(); - - // make the polling call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // if we got back an OK, take a peek inside and see if it's done - if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) - { - var error = false; - try { - if( Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) - { - var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); - if( state is null ) - { - // the body doesn't contain any information that has the state of the LRO - // we're going to just get out, and let the consumer have the result - break; - } - - switch( state?.ToString()?.ToLower() ) - { - case "failed": - error = true; - break; - case "succeeded": - case "canceled": - // we're done polling. - break; - - default: - // need to keep polling! - _response.StatusCode = global::System.Net.HttpStatusCode.Created; - continue; - } - } - } catch { - // if we run into a problem peeking into the result, - // we really don't want to do anything special. - } - if (error) { - throw new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException(_response); - } - } - - // check for terminal status code - if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) - { - continue; - } - // we are done polling, do a request on final target? - // create a new request with the final uri - request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); - - // drop the old response - _response?.Dispose(); - - // make the final call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - break; - } - var _contentType = _response.Content.Headers.ContentType?.MediaType; - - switch ( _response.StatusCode ) - { - case global::System.Net.HttpStatusCode.OK: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally - { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); - } + await this.BareMetalMachinesRunReadCommands_Call (request, onOk,onDefault,eventListener,sender); } } /// - /// Validation method for method. Call this like the actual call, but you - /// will get validation events back. + /// Run one or more read-only commands on the provided bare metal machine. The URL to storage account with the command execution + /// results and the command exit code can be retrieved from the operation status API once available. /// /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// The name of the bare metal machine. - /// The request body. - /// an instance that will receive events. - /// - /// A that will be complete when handling of the response is completed. - /// - internal async global::System.Threading.Tasks.Task BareMetalMachinesRunReadCommands_Validate(string subscriptionId, string resourceGroupName, string bareMetalMachineName, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineRunReadCommandsParameters body, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) - { - using( NoSynchronizationContext ) - { - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); - await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); - await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); - await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); - await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertNotNull(nameof(bareMetalMachineName),bareMetalMachineName); - await eventListener.AssertRegEx(nameof(bareMetalMachineName),bareMetalMachineName,@"^([a-zA-Z0-9][a-zA-Z0-9]{0,62}[a-zA-Z0-9])$"); - await eventListener.AssertNotNull(nameof(body), body); - await eventListener.AssertObjectIsValid(nameof(body), body); - } - } - - /// Start the provided bare metal machine. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of the bare metal machine. + /// Json string supplied to the BareMetalMachinesRunReadCommands 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). @@ -6050,7 +9329,226 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task BareMetalMachinesStart(string subscriptionId, string resourceGroupName, string bareMetalMachineName, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task BareMetalMachinesRunReadCommandsViaJsonString(string subscriptionId, string resourceGroupName, string bareMetalMachineName, global::System.String jsonString, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.NetworkCloud/bareMetalMachines/" + + global::System.Uri.EscapeDataString(bareMetalMachineName) + + "/runReadCommands" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.BareMetalMachinesRunReadCommands_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task BareMetalMachinesRunReadCommands_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // declared final-state-via: location + var _finalUri = _response.GetFirstHeader(@"Location"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you + /// will get validation events back. + /// + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the bare metal machine. + /// The request body. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task BareMetalMachinesRunReadCommands_Validate(string subscriptionId, string resourceGroupName, string bareMetalMachineName, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineRunReadCommandsParameters body, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(bareMetalMachineName),bareMetalMachineName); + await eventListener.AssertRegEx(nameof(bareMetalMachineName), bareMetalMachineName, @"^([a-zA-Z0-9][a-zA-Z0-9]{0,62}[a-zA-Z0-9])$"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Start the provided bare metal machine. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the bare metal machine. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task BareMetalMachinesStart(string subscriptionId, string resourceGroupName, string bareMetalMachineName, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -6078,7 +9576,7 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.BareMetalMachinesStart_Call(request,onOk,onDefault,eventListener,sender); + await this.BareMetalMachinesStart_Call (request, onOk,onDefault,eventListener,sender); } } @@ -6092,7 +9590,7 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task BareMetalMachinesStartViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task BareMetalMachinesStartViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -6103,7 +9601,7 @@ public partial class NetworkCloud var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/bareMetalMachines/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/bareMetalMachines/{bareMetalMachineName}/start'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/bareMetalMachines/{bareMetalMachineName}'"); } // replace URI parameters with values from identity @@ -6132,11 +9630,11 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.BareMetalMachinesStart_Call(request,onOk,onDefault,eventListener,sender); + await this.BareMetalMachinesStart_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 @@ -6146,32 +9644,29 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task BareMetalMachinesStart_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task BareMetalMachinesStart_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { global::System.Net.Http.HttpResponseMessage _response = null; try { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; var sendTask = sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // this operation supports x-ms-long-running-operation - var _originalUri = request.RequestUri.AbsoluteUri; // declared final-state-via: location var _finalUri = _response.GetFirstHeader(@"Location"); var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) { - - // get the delay before polling. (default to 30 seconds if not present) - int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // start the delay timer (we'll await later...) - var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } // while we wait, let's grab the headers and get ready to poll. if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { @@ -6180,15 +9675,14 @@ public partial class NetworkCloud if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { location = _response.GetFirstHeader(@"Location"); } - var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); // and let's look at the current response body and see if we have some information we can give back to the listener var content = await _response.Content.ReadAsStringAsync(); - await waiting; - - // check for cancellation - if( eventListener.Token.IsCancellationRequested ) { return; } // drop the old response _response?.Dispose(); @@ -6197,45 +9691,45 @@ public partial class NetworkCloud _response = await sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // if we got back an OK, take a peek inside and see if it's done - if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) - { - var error = false; - try { - if( Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) - { - var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); - if( state is null ) - { - // the body doesn't contain any information that has the state of the LRO - // we're going to just get out, and let the consumer have the result - break; - } - - switch( state?.ToString()?.ToLower() ) - { - case "failed": - error = true; + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result break; - case "succeeded": - case "canceled": - // we're done polling. - break; - - default: - // need to keep polling! - _response.StatusCode = global::System.Net.HttpStatusCode.Created; - continue; - } - } - } catch { - // if we run into a problem peeking into the result, - // we really don't want to do anything special. - } - if (error) { - throw new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException(_response); - } - } + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException(_response); + } + } // check for terminal status code if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) @@ -6254,6 +9748,7 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } break; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -6267,7 +9762,7 @@ public partial class NetworkCloud default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -6303,7 +9798,7 @@ public partial class NetworkCloud await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); await eventListener.AssertNotNull(nameof(bareMetalMachineName),bareMetalMachineName); - await eventListener.AssertRegEx(nameof(bareMetalMachineName),bareMetalMachineName,@"^([a-zA-Z0-9][a-zA-Z0-9]{0,62}[a-zA-Z0-9])$"); + await eventListener.AssertRegEx(nameof(bareMetalMachineName), bareMetalMachineName, @"^([a-zA-Z0-9][a-zA-Z0-9]{0,62}[a-zA-Z0-9])$"); } } @@ -6319,7 +9814,7 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task BareMetalMachinesUncordon(string subscriptionId, string resourceGroupName, string bareMetalMachineName, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task BareMetalMachinesUncordon(string subscriptionId, string resourceGroupName, string bareMetalMachineName, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -6347,7 +9842,7 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.BareMetalMachinesUncordon_Call(request,onOk,onDefault,eventListener,sender); + await this.BareMetalMachinesUncordon_Call (request, onOk,onDefault,eventListener,sender); } } @@ -6361,7 +9856,7 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task BareMetalMachinesUncordonViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task BareMetalMachinesUncordonViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -6372,7 +9867,7 @@ public partial class NetworkCloud var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/bareMetalMachines/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/bareMetalMachines/{bareMetalMachineName}/uncordon'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/bareMetalMachines/{bareMetalMachineName}'"); } // replace URI parameters with values from identity @@ -6401,11 +9896,11 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.BareMetalMachinesUncordon_Call(request,onOk,onDefault,eventListener,sender); + await this.BareMetalMachinesUncordon_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 @@ -6415,32 +9910,29 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task BareMetalMachinesUncordon_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task BareMetalMachinesUncordon_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { global::System.Net.Http.HttpResponseMessage _response = null; try { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; var sendTask = sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // this operation supports x-ms-long-running-operation - var _originalUri = request.RequestUri.AbsoluteUri; // declared final-state-via: location var _finalUri = _response.GetFirstHeader(@"Location"); var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) { - - // get the delay before polling. (default to 30 seconds if not present) - int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // start the delay timer (we'll await later...) - var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } // while we wait, let's grab the headers and get ready to poll. if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { @@ -6449,15 +9941,14 @@ public partial class NetworkCloud if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { location = _response.GetFirstHeader(@"Location"); } - var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); // and let's look at the current response body and see if we have some information we can give back to the listener var content = await _response.Content.ReadAsStringAsync(); - await waiting; - - // check for cancellation - if( eventListener.Token.IsCancellationRequested ) { return; } // drop the old response _response?.Dispose(); @@ -6466,45 +9957,45 @@ public partial class NetworkCloud _response = await sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // if we got back an OK, take a peek inside and see if it's done - if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) - { - var error = false; - try { - if( Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) - { - var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); - if( state is null ) - { - // the body doesn't contain any information that has the state of the LRO - // we're going to just get out, and let the consumer have the result - break; - } - - switch( state?.ToString()?.ToLower() ) - { - case "failed": - error = true; + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result break; - case "succeeded": - case "canceled": - // we're done polling. - break; - - default: - // need to keep polling! - _response.StatusCode = global::System.Net.HttpStatusCode.Created; - continue; - } - } - } catch { - // if we run into a problem peeking into the result, - // we really don't want to do anything special. - } - if (error) { - throw new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException(_response); - } - } + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException(_response); + } + } // check for terminal status code if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) @@ -6523,6 +10014,7 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } break; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -6536,7 +10028,7 @@ public partial class NetworkCloud default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -6572,13 +10064,13 @@ public partial class NetworkCloud await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); await eventListener.AssertNotNull(nameof(bareMetalMachineName),bareMetalMachineName); - await eventListener.AssertRegEx(nameof(bareMetalMachineName),bareMetalMachineName,@"^([a-zA-Z0-9][a-zA-Z0-9]{0,62}[a-zA-Z0-9])$"); + await eventListener.AssertRegEx(nameof(bareMetalMachineName), bareMetalMachineName, @"^([a-zA-Z0-9][a-zA-Z0-9]{0,62}[a-zA-Z0-9])$"); } } /// /// Patch properties of the provided bare metal machine, or update tags associated with the bare metal machine. Properties - /// and tag updates can be done independently. + /// and tag update can be done independently. /// /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. @@ -6593,10 +10085,11 @@ public partial class NetworkCloud /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 BareMetalMachinesUpdate(string subscriptionId, string resourceGroupName, string bareMetalMachineName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePatchParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task BareMetalMachinesUpdate(string subscriptionId, string resourceGroupName, string bareMetalMachineName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePatchParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -6633,17 +10126,17 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // 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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.BareMetalMachinesUpdate_Call(request,onOk,onDefault,eventListener,sender); + await this.BareMetalMachinesUpdate_Call (request, onOk,onDefault,eventListener,sender); } } /// /// Patch properties of the provided bare metal machine, or update tags associated with the bare metal machine. Properties - /// and tag updates can be done independently. + /// and tag update can be done independently. /// /// /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify @@ -6656,10 +10149,11 @@ public partial class NetworkCloud /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 BareMetalMachinesUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePatchParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task BareMetalMachinesUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePatchParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -6708,205 +10202,100 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // 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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.BareMetalMachinesUpdate_Call(request,onOk,onDefault,eventListener,sender); + await this.BareMetalMachinesUpdate_Call (request, onOk,onDefault,eventListener,sender); } } - /// Actual wire call for method. - /// the prepared HttpRequestMessage to send. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). + /// + /// Patch properties of the provided bare metal machine, or update tags associated with the bare metal machine. Properties + /// and tag update can be done independently. + /// + /// + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// The request body. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 BareMetalMachinesUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task BareMetalMachinesUpdateViaIdentityWithResult(global::System.String viaIdentity, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePatchParameters body, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate) { + var apiVersion = @"2025-02-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.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // this operation supports x-ms-long-running-operation - var _originalUri = request.RequestUri.AbsoluteUri; - // declared final-state-via: azure-async-operation - var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - var location = _response.GetFirstHeader(@"Location"); - while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) - { - - // get the delay before polling. (default to 30 seconds if not present) - int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // start the delay timer (we'll await later...) - var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); - - // while we wait, let's grab the headers and get ready to poll. - if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { - asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - } - if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { - location = _response.GetFirstHeader(@"Location"); - } - var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; - request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); - - // and let's look at the current response body and see if we have some information we can give back to the listener - var content = await _response.Content.ReadAsStringAsync(); - await waiting; - - // check for cancellation - if( eventListener.Token.IsCancellationRequested ) { return; } - - // drop the old response - _response?.Dispose(); - - // make the polling call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // verify that Identity format is an exact match for uri - // if we got back an OK, take a peek inside and see if it's done - if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) - { - var error = false; - try { - if( Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) - { - var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); - if( state is null ) - { - // the body doesn't contain any information that has the state of the LRO - // we're going to just get out, and let the consumer have the result - break; - } - - switch( state?.ToString()?.ToLower() ) - { - case "failed": - error = true; - break; - case "succeeded": - case "canceled": - // we're done polling. - break; - - default: - // need to keep polling! - _response.StatusCode = global::System.Net.HttpStatusCode.Created; - continue; - } - } - } catch { - // if we run into a problem peeking into the result, - // we really don't want to do anything special. - } - if (error) { - throw new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException(_response); - } - } + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/bareMetalMachines/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/bareMetalMachines/{bareMetalMachineName}'"); + } - // check for terminal status code - if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) - { - continue; - } - // we are done polling, do a request on final target? - // create a new request with the final uri - request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var bareMetalMachineName = _match.Groups["bareMetalMachineName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.NetworkCloud/bareMetalMachines/" + + bareMetalMachineName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - // drop the old response - _response?.Dispose(); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - // make the final call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - break; - } - var _contentType = _response.Content.Headers.ContentType?.MediaType; + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - switch ( _response.StatusCode ) - { - case global::System.Net.HttpStatusCode.OK: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BareMetalMachine.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); } - finally + if (null != ifNoneMatch) { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); + request.Headers.Add("If-None-Match",ifNoneMatch); } - } - } - /// - /// Validation method for method. Call this like the actual call, but you will get - /// validation events back. - /// - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of the bare metal machine. - /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify - /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. - /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. - /// Other values will result in error from server as they are not supported. - /// The request body. - /// an instance that will receive events. - /// - /// A that will be complete when handling of the response is completed. - /// - internal async global::System.Threading.Tasks.Task BareMetalMachinesUpdate_Validate(string subscriptionId, string resourceGroupName, string bareMetalMachineName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePatchParameters body, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) - { - using( NoSynchronizationContext ) - { - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); - await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); - await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); - await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); - await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertNotNull(nameof(bareMetalMachineName),bareMetalMachineName); - await eventListener.AssertRegEx(nameof(bareMetalMachineName),bareMetalMachineName,@"^([a-zA-Z0-9][a-zA-Z0-9]{0,62}[a-zA-Z0-9])$"); - await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); - await eventListener.AssertNotNull(nameof(ifNoneMatch),ifNoneMatch); - await eventListener.AssertNotNull(nameof(body), body); - await eventListener.AssertObjectIsValid(nameof(body), body); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.BareMetalMachinesUpdateWithResult_Call (request, eventListener,sender); } } /// - /// Create a new baseboard management controller key set or update the existing one for the provided cluster. + /// Patch properties of the provided bare metal machine, or update tags associated with the bare metal machine. Properties + /// and tag update can be done independently. /// /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. - /// The name of the cluster. - /// The name of the baseboard management controller key set. + /// The name of the bare metal machine. /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. /// Other values will result in error from server as they are not supported. - /// The request body. + /// Json string supplied to the BareMetalMachinesUpdate 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). @@ -6915,7 +10304,7 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task BmcKeySetsCreateOrUpdate(string subscriptionId, string resourceGroupName, string clusterName, string bmcKeySetName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySet body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task BareMetalMachinesUpdateViaJsonString(string subscriptionId, string resourceGroupName, string bareMetalMachineName, string ifMatch, string ifNoneMatch, 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.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -6927,10 +10316,8 @@ public partial class NetworkCloud + global::System.Uri.EscapeDataString(subscriptionId) + "/resourceGroups/" + global::System.Uri.EscapeDataString(resourceGroupName) - + "/providers/Microsoft.NetworkCloud/clusters/" - + global::System.Uri.EscapeDataString(clusterName) - + "/bmcKeySets/" - + global::System.Uri.EscapeDataString(bmcKeySetName) + + "/providers/Microsoft.NetworkCloud/bareMetalMachines/" + + global::System.Uri.EscapeDataString(bareMetalMachineName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -6939,7 +10326,7 @@ public partial class NetworkCloud // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Put, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Patch, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } // add headers parameters @@ -6954,70 +10341,120 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // 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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.BmcKeySetsCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + await this.BareMetalMachinesUpdate_Call (request, onOk,onDefault,eventListener,sender); } } /// - /// Create a new baseboard management controller key set or update the existing one for the provided cluster. + /// Patch properties of the provided bare metal machine, or update tags associated with the bare metal machine. Properties + /// and tag update can be done independently. /// - /// + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the bare metal machine. /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. /// Other values will result in error from server as they are not supported. - /// The request body. - /// a delegate that is called 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 BareMetalMachinesUpdate operation /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 BmcKeySetsCreateOrUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySet body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task BareMetalMachinesUpdateViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string bareMetalMachineName, string ifMatch, string ifNoneMatch, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { var apiVersion = @"2025-02-01"; // 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.NetworkCloud/bareMetalMachines/" + + global::System.Uri.EscapeDataString(bareMetalMachineName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/clusters/(?[^/]+)/bmcKeySets/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); - if (!_match.Success) + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // add headers parameters + if (null != ifMatch) { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/bmcKeySets/{bmcKeySetName}'"); + request.Headers.Add("If-Match",ifMatch); + } + if (null != ifNoneMatch) + { + request.Headers.Add("If-None-Match",ifNoneMatch); } - // replace URI parameters with values from identity - var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var clusterName = _match.Groups["clusterName"].Value; - var bmcKeySetName = _match.Groups["bmcKeySetName"].Value; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.BareMetalMachinesUpdateWithResult_Call (request, eventListener,sender); + } + } + + /// + /// Patch properties of the provided bare metal machine, or update tags associated with the bare metal machine. Properties + /// and tag update can be done independently. + /// + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the bare metal machine. + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// The request body. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 BareMetalMachinesUpdateWithResult(string subscriptionId, string resourceGroupName, string bareMetalMachineName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePatchParameters body, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" - + subscriptionId + + global::System.Uri.EscapeDataString(subscriptionId) + "/resourceGroups/" - + resourceGroupName - + "/providers/Microsoft.NetworkCloud/clusters/" - + clusterName - + "/bmcKeySets/" - + bmcKeySetName + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.NetworkCloud/bareMetalMachines/" + + global::System.Uri.EscapeDataString(bareMetalMachineName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Put, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } // add headers parameters if (null != ifMatch) @@ -7029,17 +10466,169 @@ public partial class NetworkCloud request.Headers.Add("If-None-Match",ifNoneMatch); } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.BmcKeySetsCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + return await this.BareMetalMachinesUpdateWithResult_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.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task BareMetalMachinesUpdateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + // declared final-state-via: azure-async-operation + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + break; + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BareMetalMachine.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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 @@ -7049,31 +10638,28 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task BmcKeySetsCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task BareMetalMachinesUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { global::System.Net.Http.HttpResponseMessage _response = null; try { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; var sendTask = sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // this operation supports x-ms-long-running-operation - var _originalUri = request.RequestUri.AbsoluteUri; // declared final-state-via: azure-async-operation var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) { - - // get the delay before polling. (default to 30 seconds if not present) - int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // start the delay timer (we'll await later...) - var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } // while we wait, let's grab the headers and get ready to poll. if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { @@ -7082,15 +10668,14 @@ public partial class NetworkCloud if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { location = _response.GetFirstHeader(@"Location"); } - var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); // and let's look at the current response body and see if we have some information we can give back to the listener var content = await _response.Content.ReadAsStringAsync(); - await waiting; - - // check for cancellation - if( eventListener.Token.IsCancellationRequested ) { return; } // drop the old response _response?.Dispose(); @@ -7099,45 +10684,45 @@ public partial class NetworkCloud _response = await sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // if we got back an OK, take a peek inside and see if it's done - if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) - { - var error = false; - try { - if( Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) - { - var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); - if( state is null ) - { - // the body doesn't contain any information that has the state of the LRO - // we're going to just get out, and let the consumer have the result - break; - } - - switch( state?.ToString()?.ToLower() ) - { - case "failed": - error = true; + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result break; - case "succeeded": - case "canceled": - // we're done polling. - break; - - default: - // need to keep polling! - _response.StatusCode = global::System.Net.HttpStatusCode.Created; - continue; - } - } - } catch { - // if we run into a problem peeking into the result, - // we really don't want to do anything special. - } - if (error) { - throw new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException(_response); - } - } + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException(_response); + } + } // check for terminal status code if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) @@ -7156,6 +10741,7 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } break; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -7163,13 +10749,13 @@ public partial class NetworkCloud case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BmcKeySet.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BareMetalMachine.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -7185,13 +10771,12 @@ public partial class NetworkCloud } /// - /// 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 value must be an UUID. /// The name of the resource group. The name is case insensitive. - /// The name of the cluster. - /// The name of the baseboard management controller key set. + /// The name of the bare metal machine. /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. @@ -7201,7 +10786,7 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task BmcKeySetsCreateOrUpdate_Validate(string subscriptionId, string resourceGroupName, string clusterName, string bmcKeySetName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySet body, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task BareMetalMachinesUpdate_Validate(string subscriptionId, string resourceGroupName, string bareMetalMachineName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePatchParameters body, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -7210,10 +10795,8 @@ public partial class NetworkCloud await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertNotNull(nameof(clusterName),clusterName); - await eventListener.AssertRegEx(nameof(clusterName),clusterName,@"^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$"); - await eventListener.AssertNotNull(nameof(bmcKeySetName),bmcKeySetName); - await eventListener.AssertRegEx(nameof(bmcKeySetName),bmcKeySetName,@"^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$"); + await eventListener.AssertNotNull(nameof(bareMetalMachineName),bareMetalMachineName); + await eventListener.AssertRegEx(nameof(bareMetalMachineName), bareMetalMachineName, @"^([a-zA-Z0-9][a-zA-Z0-9]{0,62}[a-zA-Z0-9])$"); await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); await eventListener.AssertNotNull(nameof(ifNoneMatch),ifNoneMatch); await eventListener.AssertNotNull(nameof(body), body); @@ -7221,7 +10804,9 @@ public partial class NetworkCloud } } - /// Delete the baseboard management controller key set of the provided cluster. + /// + /// update a new baseboard management controller key set or update the existing one for the provided cluster. + /// /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// The name of the cluster. @@ -7230,16 +10815,17 @@ public partial class NetworkCloud /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. /// Other values will result in error from server as they are not supported. + /// The request body. /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns 204 (NoContent). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 BmcKeySetsDelete(string subscriptionId, string resourceGroupName, string clusterName, string bmcKeySetName, string ifMatch, string ifNoneMatch, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task BmcKeySetsCreateOrUpdate(string subscriptionId, string resourceGroupName, string clusterName, string bmcKeySetName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySet body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -7263,7 +10849,7 @@ public partial class NetworkCloud // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Delete, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Put, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } // add headers parameters @@ -7277,27 +10863,34 @@ public partial class NetworkCloud } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.BmcKeySetsDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + await this.BmcKeySetsCreateOrUpdate_Call (request, onOk,onDefault,eventListener,sender); } } - /// Delete the baseboard management controller key set of the provided cluster. + /// + /// update a new baseboard management controller key set or update the existing one for the provided cluster. + /// /// /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. /// Other values will result in error from server as they are not supported. + /// The request body. /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns 204 (NoContent). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 BmcKeySetsDeleteViaIdentity(global::System.String viaIdentity, string ifMatch, string ifNoneMatch, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task BmcKeySetsCreateOrUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySet body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -7334,7 +10927,7 @@ public partial class NetworkCloud // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Delete, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Put, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } // add headers parameters @@ -7348,167 +10941,93 @@ public partial class NetworkCloud } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.BmcKeySetsDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + await this.BmcKeySetsCreateOrUpdate_Call (request, onOk,onDefault,eventListener,sender); } } - /// Actual wire call for method. - /// the prepared HttpRequestMessage 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 new baseboard management controller key set or update the existing one for the provided cluster. + /// + /// + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// The request body. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 BmcKeySetsDelete_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.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task BmcKeySetsCreateOrUpdateViaIdentityWithResult(global::System.String viaIdentity, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySet body, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate) { + var apiVersion = @"2025-02-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.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // this operation supports x-ms-long-running-operation - var _originalUri = request.RequestUri.AbsoluteUri; - // declared final-state-via: location - var _finalUri = _response.GetFirstHeader(@"Location"); - var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - var location = _response.GetFirstHeader(@"Location"); - while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) - { - - // get the delay before polling. (default to 30 seconds if not present) - int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // start the delay timer (we'll await later...) - var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); - - // while we wait, let's grab the headers and get ready to poll. - if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { - asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - } - if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { - location = _response.GetFirstHeader(@"Location"); - } - var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; - request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); - - // and let's look at the current response body and see if we have some information we can give back to the listener - var content = await _response.Content.ReadAsStringAsync(); - await waiting; - - // check for cancellation - if( eventListener.Token.IsCancellationRequested ) { return; } - - // drop the old response - _response?.Dispose(); - - // make the polling call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // verify that Identity format is an exact match for uri - // if we got back an OK, take a peek inside and see if it's done - if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) - { - var error = false; - try { - if( Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) - { - var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); - if( state is null ) - { - // the body doesn't contain any information that has the state of the LRO - // we're going to just get out, and let the consumer have the result - break; - } - - switch( state?.ToString()?.ToLower() ) - { - case "failed": - error = true; - break; - case "succeeded": - case "canceled": - // we're done polling. - break; - - default: - // need to keep polling! - _response.StatusCode = global::System.Net.HttpStatusCode.Created; - continue; - } - } - } catch { - // if we run into a problem peeking into the result, - // we really don't want to do anything special. - } - if (error) { - throw new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException(_response); - } - } + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/clusters/(?[^/]+)/bmcKeySets/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/bmcKeySets/{bmcKeySetName}'"); + } - // check for terminal status code - if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) - { - continue; - } - // we are done polling, do a request on final target? - // create a new request with the final uri - request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var clusterName = _match.Groups["clusterName"].Value; + var bmcKeySetName = _match.Groups["bmcKeySetName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.NetworkCloud/clusters/" + + clusterName + + "/bmcKeySets/" + + bmcKeySetName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - // drop the old response - _response?.Dispose(); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - // make the final call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - break; - } - var _contentType = _response.Content.Headers.ContentType?.MediaType; + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - switch ( _response.StatusCode ) - { - case global::System.Net.HttpStatusCode.OK: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onNoContent(_response); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); } - finally + if (null != ifNoneMatch) { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); + request.Headers.Add("If-None-Match",ifNoneMatch); } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.BmcKeySetsCreateOrUpdateWithResult_Call (request, eventListener,sender); } } /// - /// Validation method for method. Call this like the actual call, but you will get validation - /// events back. + /// update a new baseboard management controller key set or update the existing one for the provided cluster. /// /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. @@ -7518,42 +11037,81 @@ public partial class NetworkCloud /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. /// Other values will result in error from server as they are not supported. + /// Json string supplied to the BmcKeySetsCreateOrUpdate 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.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task BmcKeySetsDelete_Validate(string subscriptionId, string resourceGroupName, string clusterName, string bmcKeySetName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) + public async global::System.Threading.Tasks.Task BmcKeySetsCreateOrUpdateViaJsonString(string subscriptionId, string resourceGroupName, string clusterName, string bmcKeySetName, string ifMatch, string ifNoneMatch, 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.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { + var apiVersion = @"2025-02-01"; + // Constant Parameters using( NoSynchronizationContext ) { - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); - await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); - await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); - await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); - await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertNotNull(nameof(clusterName),clusterName); - await eventListener.AssertRegEx(nameof(clusterName),clusterName,@"^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$"); - await eventListener.AssertNotNull(nameof(bmcKeySetName),bmcKeySetName); - await eventListener.AssertRegEx(nameof(bmcKeySetName),bmcKeySetName,@"^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$"); - await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); - await eventListener.AssertNotNull(nameof(ifNoneMatch),ifNoneMatch); + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.NetworkCloud/clusters/" + + global::System.Uri.EscapeDataString(clusterName) + + "/bmcKeySets/" + + global::System.Uri.EscapeDataString(bmcKeySetName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + if (null != ifNoneMatch) + { + request.Headers.Add("If-None-Match",ifNoneMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.BmcKeySetsCreateOrUpdate_Call (request, onOk,onDefault,eventListener,sender); } } - /// Get baseboard management controller key set of the provided cluster. + /// + /// update a new baseboard management controller key set or update the existing one for the provided cluster. + /// /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// The name of the cluster. /// The name of the baseboard management controller key set. - /// a delegate that is called 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 ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// Json string supplied to the BmcKeySetsCreateOrUpdate operation /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 BmcKeySetsGet(string subscriptionId, string resourceGroupName, string clusterName, string bmcKeySetName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task BmcKeySetsCreateOrUpdateViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string clusterName, string bmcKeySetName, string ifMatch, string ifNoneMatch, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -7573,290 +11131,238 @@ public partial class NetworkCloud + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + if (null != ifNoneMatch) + { + request.Headers.Add("If-None-Match",ifNoneMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.BmcKeySetsGet_Call(request,onOk,onDefault,eventListener,sender); + return await this.BmcKeySetsCreateOrUpdateWithResult_Call (request, eventListener,sender); } } - /// Get baseboard management controller key set of the provided cluster. - /// - /// a delegate that is called 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 baseboard management controller key set or update the existing one for the provided cluster. + /// + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the cluster. + /// The name of the baseboard management controller key set. + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// The request body. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 BmcKeySetsGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task BmcKeySetsCreateOrUpdateWithResult(string subscriptionId, string resourceGroupName, string clusterName, string bmcKeySetName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySet body, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2025-02-01"; // Constant Parameters using( NoSynchronizationContext ) { - // verify that Identity format is an exact match for uri - - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/clusters/(?[^/]+)/bmcKeySets/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); - if (!_match.Success) - { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/bmcKeySets/{bmcKeySetName}'"); - } - - // replace URI parameters with values from identity - var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var clusterName = _match.Groups["clusterName"].Value; - var bmcKeySetName = _match.Groups["bmcKeySetName"].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.NetworkCloud/clusters/" - + clusterName + + global::System.Uri.EscapeDataString(clusterName) + "/bmcKeySets/" - + bmcKeySetName + + global::System.Uri.EscapeDataString(bmcKeySetName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + if (null != ifNoneMatch) + { + request.Headers.Add("If-None-Match",ifNoneMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.BmcKeySetsGet_Call(request,onOk,onDefault,eventListener,sender); + return await this.BmcKeySetsCreateOrUpdateWithResult_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). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 BmcKeySetsGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task BmcKeySetsCreateOrUpdateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { global::System.Net.Http.HttpResponseMessage _response = null; try { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; var sendTask = sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return null; } _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - var _contentType = _response.Content.Headers.ContentType?.MediaType; - - switch ( _response.StatusCode ) + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + // declared final-state-via: azure-async-operation + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) { - case global::System.Net.HttpStatusCode.OK: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BmcKeySet.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); } - } - } - finally - { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); - } - } - } - - /// - /// Validation method for method. Call this like the actual call, but you will get validation - /// events back. - /// - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of the cluster. - /// The name of the baseboard management controller key set. - /// an instance that will receive events. - /// - /// A that will be complete when handling of the response is completed. - /// - internal async global::System.Threading.Tasks.Task BmcKeySetsGet_Validate(string subscriptionId, string resourceGroupName, string clusterName, string bmcKeySetName, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) - { - using( NoSynchronizationContext ) - { - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); - await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); - await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); - await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); - await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertNotNull(nameof(clusterName),clusterName); - await eventListener.AssertRegEx(nameof(clusterName),clusterName,@"^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$"); - await eventListener.AssertNotNull(nameof(bmcKeySetName),bmcKeySetName); - await eventListener.AssertRegEx(nameof(bmcKeySetName),bmcKeySetName,@"^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$"); - } - } - - /// - /// Get a list of baseboard management controller key sets for the provided cluster. - /// - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of the cluster. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. - /// - /// A that will be complete when handling of the response is completed. - /// - public async global::System.Threading.Tasks.Task BmcKeySetsListByCluster(string subscriptionId, string resourceGroupName, string clusterName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) - { - var apiVersion = @"2025-02-01"; - // Constant Parameters - using( NoSynchronizationContext ) - { - // construct URL - var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/subscriptions/" - + global::System.Uri.EscapeDataString(subscriptionId) - + "/resourceGroups/" - + global::System.Uri.EscapeDataString(resourceGroupName) - + "/providers/Microsoft.NetworkCloud/clusters/" - + global::System.Uri.EscapeDataString(clusterName) - + "/bmcKeySets" - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - // generate request object - var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.BmcKeySetsListByCluster_Call(request,onOk,onDefault,eventListener,sender); - } - } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); - /// - /// Get a list of baseboard management controller key sets for the provided cluster. - /// - /// - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. - /// - /// A that will be complete when handling of the response is completed. - /// - public async global::System.Threading.Tasks.Task BmcKeySetsListByClusterViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) - { - var apiVersion = @"2025-02-01"; - // Constant Parameters - using( NoSynchronizationContext ) - { - // verify that Identity format is an exact match for uri + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/clusters/(?[^/]+)/bmcKeySets$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); - if (!_match.Success) - { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/bmcKeySets'"); - } + // drop the old response + _response?.Dispose(); - // replace URI parameters with values from identity - var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var clusterName = _match.Groups["clusterName"].Value; - // construct URL - var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/subscriptions/" - + subscriptionId - + "/resourceGroups/" - + resourceGroupName - + "/providers/Microsoft.NetworkCloud/clusters/" - + clusterName - + "/bmcKeySets" - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException(_response); + } + } - // generate request object - var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.BmcKeySetsListByCluster_Call(request,onOk,onDefault,eventListener,sender); - } - } + // drop the old response + _response?.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.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. - /// - /// A that will be complete when handling of the response is completed. - /// - internal async global::System.Threading.Tasks.Task BmcKeySetsListByCluster_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) - { - using( NoSynchronizationContext ) - { - global::System.Net.Http.HttpResponseMessage _response = null; - try - { - var sendTask = sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + break; + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BmcKeySetList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BmcKeySet.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; } default: { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } } } } @@ -7870,178 +11376,7 @@ public partial class NetworkCloud } } - /// - /// Validation method for method. Call this like the actual call, but you will get - /// validation events back. - /// - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of the cluster. - /// an instance that will receive events. - /// - /// A that will be complete when handling of the response is completed. - /// - internal async global::System.Threading.Tasks.Task BmcKeySetsListByCluster_Validate(string subscriptionId, string resourceGroupName, string clusterName, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) - { - using( NoSynchronizationContext ) - { - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); - await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); - await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); - await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); - await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertNotNull(nameof(clusterName),clusterName); - await eventListener.AssertRegEx(nameof(clusterName),clusterName,@"^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$"); - } - } - - /// - /// Patch properties of baseboard management controller key set for the provided cluster, or update the tags associated with - /// it. Properties and tag updates can be done independently. - /// - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of the cluster. - /// The name of the baseboard management controller key set. - /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify - /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. - /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. - /// Other values will result in error from server as they are not supported. - /// The request body. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. - /// - /// A that will be complete when handling of the response is completed. - /// - public async global::System.Threading.Tasks.Task BmcKeySetsUpdate(string subscriptionId, string resourceGroupName, string clusterName, string bmcKeySetName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetPatchParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) - { - var apiVersion = @"2025-02-01"; - // Constant Parameters - using( NoSynchronizationContext ) - { - // construct URL - var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/subscriptions/" - + global::System.Uri.EscapeDataString(subscriptionId) - + "/resourceGroups/" - + global::System.Uri.EscapeDataString(resourceGroupName) - + "/providers/Microsoft.NetworkCloud/clusters/" - + global::System.Uri.EscapeDataString(clusterName) - + "/bmcKeySets/" - + global::System.Uri.EscapeDataString(bmcKeySetName) - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - // generate request object - var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Patch, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - // add headers parameters - if (null != ifMatch) - { - request.Headers.Add("If-Match",ifMatch); - } - if (null != ifNoneMatch) - { - request.Headers.Add("If-None-Match",ifNoneMatch); - } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); - request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.BmcKeySetsUpdate_Call(request,onOk,onDefault,eventListener,sender); - } - } - - /// - /// Patch properties of baseboard management controller key set for the provided cluster, or update the tags associated with - /// it. Properties and tag updates can be done independently. - /// - /// - /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify - /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. - /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. - /// Other values will result in error from server as they are not supported. - /// The request body. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. - /// - /// A that will be complete when handling of the response is completed. - /// - public async global::System.Threading.Tasks.Task BmcKeySetsUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetPatchParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) - { - var apiVersion = @"2025-02-01"; - // Constant Parameters - using( NoSynchronizationContext ) - { - // verify that Identity format is an exact match for uri - - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/clusters/(?[^/]+)/bmcKeySets/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); - if (!_match.Success) - { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/bmcKeySets/{bmcKeySetName}'"); - } - - // replace URI parameters with values from identity - var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var clusterName = _match.Groups["clusterName"].Value; - var bmcKeySetName = _match.Groups["bmcKeySetName"].Value; - // construct URL - var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/subscriptions/" - + subscriptionId - + "/resourceGroups/" - + resourceGroupName - + "/providers/Microsoft.NetworkCloud/clusters/" - + clusterName - + "/bmcKeySets/" - + bmcKeySetName - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - // generate request object - var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Patch, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - // add headers parameters - if (null != ifMatch) - { - request.Headers.Add("If-Match",ifMatch); - } - if (null != ifNoneMatch) - { - request.Headers.Add("If-None-Match",ifNoneMatch); - } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); - request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.BmcKeySetsUpdate_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 @@ -8051,31 +11386,28 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task BmcKeySetsUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task BmcKeySetsCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { global::System.Net.Http.HttpResponseMessage _response = null; try { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; var sendTask = sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // this operation supports x-ms-long-running-operation - var _originalUri = request.RequestUri.AbsoluteUri; // declared final-state-via: azure-async-operation var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) { - - // get the delay before polling. (default to 30 seconds if not present) - int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // start the delay timer (we'll await later...) - var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } // while we wait, let's grab the headers and get ready to poll. if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { @@ -8084,15 +11416,14 @@ public partial class NetworkCloud if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { location = _response.GetFirstHeader(@"Location"); } - var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); // and let's look at the current response body and see if we have some information we can give back to the listener var content = await _response.Content.ReadAsStringAsync(); - await waiting; - - // check for cancellation - if( eventListener.Token.IsCancellationRequested ) { return; } // drop the old response _response?.Dispose(); @@ -8101,45 +11432,45 @@ public partial class NetworkCloud _response = await sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // if we got back an OK, take a peek inside and see if it's done - if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) - { - var error = false; - try { - if( Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) - { - var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); - if( state is null ) - { - // the body doesn't contain any information that has the state of the LRO - // we're going to just get out, and let the consumer have the result - break; - } - - switch( state?.ToString()?.ToLower() ) - { - case "failed": - error = true; + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result break; - case "succeeded": - case "canceled": - // we're done polling. - break; - - default: - // need to keep polling! - _response.StatusCode = global::System.Net.HttpStatusCode.Created; - continue; - } - } - } catch { - // if we run into a problem peeking into the result, - // we really don't want to do anything special. - } - if (error) { - throw new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException(_response); - } - } + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException(_response); + } + } // check for terminal status code if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) @@ -8158,6 +11489,7 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } break; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -8165,13 +11497,13 @@ public partial class NetworkCloud case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BmcKeySet.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BmcKeySet.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -8187,8 +11519,8 @@ public partial class NetworkCloud } /// - /// 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 value must be an UUID. /// The name of the resource group. The name is case insensitive. @@ -8203,7 +11535,7 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task BmcKeySetsUpdate_Validate(string subscriptionId, string resourceGroupName, string clusterName, string bmcKeySetName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetPatchParameters body, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task BmcKeySetsCreateOrUpdate_Validate(string subscriptionId, string resourceGroupName, string clusterName, string bmcKeySetName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySet body, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -8213,9 +11545,9 @@ public partial class NetworkCloud await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); await eventListener.AssertNotNull(nameof(clusterName),clusterName); - await eventListener.AssertRegEx(nameof(clusterName),clusterName,@"^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$"); + await eventListener.AssertRegEx(nameof(clusterName), clusterName, @"^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$"); await eventListener.AssertNotNull(nameof(bmcKeySetName),bmcKeySetName); - await eventListener.AssertRegEx(nameof(bmcKeySetName),bmcKeySetName,@"^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$"); + await eventListener.AssertRegEx(nameof(bmcKeySetName), bmcKeySetName, @"^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$"); await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); await eventListener.AssertNotNull(nameof(ifNoneMatch),ifNoneMatch); await eventListener.AssertNotNull(nameof(body), body); @@ -8223,18 +11555,17 @@ public partial class NetworkCloud } } - /// - /// Create a new cloud services network or update the properties of the existing cloud services network. - /// + /// Delete the baseboard management controller key set of the provided cluster. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. - /// The name of the cloud services network. + /// The name of the cluster. + /// The name of the baseboard management controller key set. /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. /// Other values will result in error from server as they are not supported. - /// The request body. /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. @@ -8242,7 +11573,7 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task CloudServicesNetworksCreateOrUpdate(string subscriptionId, string resourceGroupName, string cloudServicesNetworkName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetwork body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task BmcKeySetsDelete(string subscriptionId, string resourceGroupName, string clusterName, string bmcKeySetName, string ifMatch, string ifNoneMatch, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -8254,8 +11585,10 @@ public partial class NetworkCloud + global::System.Uri.EscapeDataString(subscriptionId) + "/resourceGroups/" + global::System.Uri.EscapeDataString(resourceGroupName) - + "/providers/Microsoft.NetworkCloud/cloudServicesNetworks/" - + global::System.Uri.EscapeDataString(cloudServicesNetworkName) + + "/providers/Microsoft.NetworkCloud/clusters/" + + global::System.Uri.EscapeDataString(clusterName) + + "/bmcKeySets/" + + global::System.Uri.EscapeDataString(bmcKeySetName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -8264,7 +11597,7 @@ public partial class NetworkCloud // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Put, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Delete, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } // add headers parameters @@ -8278,25 +11611,19 @@ public partial class NetworkCloud } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); - request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.CloudServicesNetworksCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + await this.BmcKeySetsDelete_Call (request, onOk,onNoContent,onDefault,eventListener,sender); } } - /// - /// Create a new cloud services network or update the properties of the existing cloud services network. - /// + /// Delete the baseboard management controller key set of the provided cluster. /// /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. /// Other values will result in error from server as they are not supported. - /// The request body. /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. @@ -8304,7 +11631,7 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task CloudServicesNetworksCreateOrUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetwork body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task BmcKeySetsDeleteViaIdentity(global::System.String viaIdentity, string ifMatch, string ifNoneMatch, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -8312,24 +11639,27 @@ public partial class NetworkCloud { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/cloudServicesNetworks/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/clusters/(?[^/]+)/bmcKeySets/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/cloudServicesNetworks/{cloudServicesNetworkName}'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/bmcKeySets/{bmcKeySetName}'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var cloudServicesNetworkName = _match.Groups["cloudServicesNetworkName"].Value; + var clusterName = _match.Groups["clusterName"].Value; + var bmcKeySetName = _match.Groups["bmcKeySetName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + subscriptionId + "/resourceGroups/" + resourceGroupName - + "/providers/Microsoft.NetworkCloud/cloudServicesNetworks/" - + cloudServicesNetworkName + + "/providers/Microsoft.NetworkCloud/clusters/" + + clusterName + + "/bmcKeySets/" + + bmcKeySetName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -8338,7 +11668,7 @@ public partial class NetworkCloud // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Put, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Delete, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } // add headers parameters @@ -8352,18 +11682,15 @@ public partial class NetworkCloud } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); - request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.CloudServicesNetworksCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + await this.BmcKeySetsDelete_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. @@ -8371,31 +11698,29 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task CloudServicesNetworksCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task BmcKeySetsDelete_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.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { global::System.Net.Http.HttpResponseMessage _response = null; try { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; var sendTask = sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // this operation supports x-ms-long-running-operation - var _originalUri = request.RequestUri.AbsoluteUri; - // declared final-state-via: azure-async-operation + // declared final-state-via: location + var _finalUri = _response.GetFirstHeader(@"Location"); var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) { - - // get the delay before polling. (default to 30 seconds if not present) - int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // start the delay timer (we'll await later...) - var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } // while we wait, let's grab the headers and get ready to poll. if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { @@ -8404,15 +11729,14 @@ public partial class NetworkCloud if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { location = _response.GetFirstHeader(@"Location"); } - var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); // and let's look at the current response body and see if we have some information we can give back to the listener var content = await _response.Content.ReadAsStringAsync(); - await waiting; - - // check for cancellation - if( eventListener.Token.IsCancellationRequested ) { return; } // drop the old response _response?.Dispose(); @@ -8421,45 +11745,45 @@ public partial class NetworkCloud _response = await sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // if we got back an OK, take a peek inside and see if it's done - if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) - { - var error = false; - try { - if( Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) - { - var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); - if( state is null ) - { - // the body doesn't contain any information that has the state of the LRO - // we're going to just get out, and let the consumer have the result - break; - } - - switch( state?.ToString()?.ToLower() ) - { - case "failed": - error = true; + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. break; - case "succeeded": - case "canceled": - // we're done polling. - break; - - default: - // need to keep polling! - _response.StatusCode = global::System.Net.HttpStatusCode.Created; - continue; - } - } - } catch { - // if we run into a problem peeking into the result, - // we really don't want to do anything special. - } - if (error) { - throw new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException(_response); - } - } + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException(_response); + } + } // check for terminal status code if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) @@ -8468,7 +11792,7 @@ public partial class NetworkCloud } // we are done polling, do a request on final target? // create a new request with the final uri - request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); + request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); // drop the old response _response?.Dispose(); @@ -8478,6 +11802,7 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } break; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -8485,13 +11810,19 @@ public partial class NetworkCloud case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.CloudServicesNetwork.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -8507,22 +11838,22 @@ public partial class NetworkCloud } /// - /// 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 value must be an UUID. /// The name of the resource group. The name is case insensitive. - /// The name of the cloud services network. + /// The name of the cluster. + /// The name of the baseboard management controller key set. /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. /// Other values will result in error from server as they are not supported. - /// The request body. /// an instance that will receive events. /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task CloudServicesNetworksCreateOrUpdate_Validate(string subscriptionId, string resourceGroupName, string cloudServicesNetworkName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetwork body, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task BmcKeySetsDelete_Validate(string subscriptionId, string resourceGroupName, string clusterName, string bmcKeySetName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -8531,25 +11862,21 @@ public partial class NetworkCloud await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertNotNull(nameof(cloudServicesNetworkName),cloudServicesNetworkName); - await eventListener.AssertRegEx(nameof(cloudServicesNetworkName),cloudServicesNetworkName,@"^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$"); + await eventListener.AssertNotNull(nameof(clusterName),clusterName); + await eventListener.AssertRegEx(nameof(clusterName), clusterName, @"^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$"); + await eventListener.AssertNotNull(nameof(bmcKeySetName),bmcKeySetName); + await eventListener.AssertRegEx(nameof(bmcKeySetName), bmcKeySetName, @"^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$"); await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); await eventListener.AssertNotNull(nameof(ifNoneMatch),ifNoneMatch); - await eventListener.AssertNotNull(nameof(body), body); - await eventListener.AssertObjectIsValid(nameof(body), body); } } - /// Delete the provided cloud services network. + /// Get baseboard management controller key set of the provided cluster. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. - /// The name of the cloud services network. - /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify - /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. - /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. - /// Other values will result in error from server as they are not supported. + /// The name of the cluster. + /// The name of the baseboard management controller key set. /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns 204 (NoContent). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. @@ -8557,7 +11884,7 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task CloudServicesNetworksDelete(string subscriptionId, string resourceGroupName, string cloudServicesNetworkName, string ifMatch, string ifNoneMatch, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task BmcKeySetsGet(string subscriptionId, string resourceGroupName, string clusterName, string bmcKeySetName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -8569,8 +11896,10 @@ public partial class NetworkCloud + global::System.Uri.EscapeDataString(subscriptionId) + "/resourceGroups/" + global::System.Uri.EscapeDataString(resourceGroupName) - + "/providers/Microsoft.NetworkCloud/cloudServicesNetworks/" - + global::System.Uri.EscapeDataString(cloudServicesNetworkName) + + "/providers/Microsoft.NetworkCloud/clusters/" + + global::System.Uri.EscapeDataString(clusterName) + + "/bmcKeySets/" + + global::System.Uri.EscapeDataString(bmcKeySetName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -8579,33 +11908,18 @@ public partial class NetworkCloud // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Delete, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - // add headers parameters - if (null != ifMatch) - { - request.Headers.Add("If-Match",ifMatch); - } - if (null != ifNoneMatch) - { - request.Headers.Add("If-None-Match",ifNoneMatch); - } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.CloudServicesNetworksDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + await this.BmcKeySetsGet_Call (request, onOk,onDefault,eventListener,sender); } } - /// Delete the provided cloud services network. + /// Get baseboard management controller key set of the provided cluster. /// - /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify - /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. - /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. - /// Other values will result in error from server as they are not supported. /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns 204 (NoContent). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. @@ -8613,7 +11927,7 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task CloudServicesNetworksDeleteViaIdentity(global::System.String viaIdentity, string ifMatch, string ifNoneMatch, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task BmcKeySetsGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -8621,24 +11935,27 @@ public partial class NetworkCloud { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/cloudServicesNetworks/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/clusters/(?[^/]+)/bmcKeySets/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/cloudServicesNetworks/{cloudServicesNetworkName}'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/bmcKeySets/{bmcKeySetName}'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var cloudServicesNetworkName = _match.Groups["cloudServicesNetworkName"].Value; + var clusterName = _match.Groups["clusterName"].Value; + var bmcKeySetName = _match.Groups["bmcKeySetName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + subscriptionId + "/resourceGroups/" + resourceGroupName - + "/providers/Microsoft.NetworkCloud/cloudServicesNetworks/" - + cloudServicesNetworkName + + "/providers/Microsoft.NetworkCloud/clusters/" + + clusterName + + "/bmcKeySets/" + + bmcKeySetName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -8647,222 +11964,81 @@ public partial class NetworkCloud // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Delete, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - // add headers parameters - if (null != ifMatch) - { - request.Headers.Add("If-Match",ifMatch); - } - if (null != ifNoneMatch) - { - request.Headers.Add("If-None-Match",ifNoneMatch); - } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.CloudServicesNetworksDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + await this.BmcKeySetsGet_Call (request, onOk,onDefault,eventListener,sender); } } - /// Actual wire call for method. - /// the prepared HttpRequestMessage 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). + /// Get baseboard management controller key set of the provided cluster. + /// /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 CloudServicesNetworksDelete_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.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task BmcKeySetsGetViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { + var apiVersion = @"2025-02-01"; + // 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("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/clusters/(?[^/]+)/bmcKeySets/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) { - var sendTask = sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // this operation supports x-ms-long-running-operation - var _originalUri = request.RequestUri.AbsoluteUri; - // declared final-state-via: location - var _finalUri = _response.GetFirstHeader(@"Location"); - var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - var location = _response.GetFirstHeader(@"Location"); - while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) - { - - // get the delay before polling. (default to 30 seconds if not present) - int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // start the delay timer (we'll await later...) - var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); - - // while we wait, let's grab the headers and get ready to poll. - if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { - asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - } - if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { - location = _response.GetFirstHeader(@"Location"); - } - var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; - request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); - - // and let's look at the current response body and see if we have some information we can give back to the listener - var content = await _response.Content.ReadAsStringAsync(); - await waiting; - - // check for cancellation - if( eventListener.Token.IsCancellationRequested ) { return; } - - // drop the old response - _response?.Dispose(); - - // make the polling call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // if we got back an OK, take a peek inside and see if it's done - if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) - { - var error = false; - try { - if( Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) - { - var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); - if( state is null ) - { - // the body doesn't contain any information that has the state of the LRO - // we're going to just get out, and let the consumer have the result - break; - } - - switch( state?.ToString()?.ToLower() ) - { - case "failed": - error = true; - break; - case "succeeded": - case "canceled": - // we're done polling. - break; - - default: - // need to keep polling! - _response.StatusCode = global::System.Net.HttpStatusCode.Created; - continue; - } - } - } catch { - // if we run into a problem peeking into the result, - // we really don't want to do anything special. - } - if (error) { - throw new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException(_response); - } - } - - // check for terminal status code - if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) - { - continue; - } - // we are done polling, do a request on final target? - // create a new request with the final uri - request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/bmcKeySets/{bmcKeySetName}'"); + } - // drop the old response - _response?.Dispose(); + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var clusterName = _match.Groups["clusterName"].Value; + var bmcKeySetName = _match.Groups["bmcKeySetName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.NetworkCloud/clusters/" + + clusterName + + "/bmcKeySets/" + + bmcKeySetName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - // make the final call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - break; - } - var _contentType = _response.Content.Headers.ContentType?.MediaType; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - switch ( _response.StatusCode ) - { - case global::System.Net.HttpStatusCode.OK: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onNoContent(_response); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally - { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); - } - } - } + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of the cloud services network. - /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify - /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. - /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. - /// Other values will result in error from server as they are not supported. - /// an instance that will receive events. - /// - /// A that will be complete when handling of the response is completed. - /// - internal async global::System.Threading.Tasks.Task CloudServicesNetworksDelete_Validate(string subscriptionId, string resourceGroupName, string cloudServicesNetworkName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) - { - using( NoSynchronizationContext ) - { - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); - await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); - await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); - await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); - await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertNotNull(nameof(cloudServicesNetworkName),cloudServicesNetworkName); - await eventListener.AssertRegEx(nameof(cloudServicesNetworkName),cloudServicesNetworkName,@"^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$"); - await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); - await eventListener.AssertNotNull(nameof(ifNoneMatch),ifNoneMatch); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.BmcKeySetsGetWithResult_Call (request, eventListener,sender); } } - /// Get properties of the provided cloud services network. + /// Get baseboard management controller key set of the provided cluster. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. - /// The name of the cloud services network. - /// a delegate that is called 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 cluster. + /// The name of the baseboard management controller key set. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 CloudServicesNetworksGet(string subscriptionId, string resourceGroupName, string cloudServicesNetworkName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task BmcKeySetsGetWithResult(string subscriptionId, string resourceGroupName, string clusterName, string bmcKeySetName, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -8874,79 +12050,88 @@ public partial class NetworkCloud + global::System.Uri.EscapeDataString(subscriptionId) + "/resourceGroups/" + global::System.Uri.EscapeDataString(resourceGroupName) - + "/providers/Microsoft.NetworkCloud/cloudServicesNetworks/" - + global::System.Uri.EscapeDataString(cloudServicesNetworkName) + + "/providers/Microsoft.NetworkCloud/clusters/" + + global::System.Uri.EscapeDataString(clusterName) + + "/bmcKeySets/" + + global::System.Uri.EscapeDataString(bmcKeySetName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.CloudServicesNetworksGet_Call(request,onOk,onDefault,eventListener,sender); + return await this.BmcKeySetsGetWithResult_Call (request, eventListener,sender); } } - /// Get properties of the provided cloud services network. - /// - /// a delegate that is called 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.NetworkCloud.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 CloudServicesNetworksGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task BmcKeySetsGetWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { - var apiVersion = @"2025-02-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.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud/cloudServicesNetworks/(?[^/]+)$", 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.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BmcKeySet.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud/cloudServicesNetworks/{cloudServicesNetworkName}'"); + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); } - - // replace URI parameters with values from identity - var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var cloudServicesNetworkName = _match.Groups["cloudServicesNetworkName"].Value; - // construct URL - var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/subscriptions/" - + subscriptionId - + "/resourceGroups/" - + resourceGroupName - + "/providers/Microsoft.NetworkCloud/cloudServicesNetworks/" - + cloudServicesNetworkName - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - // generate request object - var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.CloudServicesNetworksGet_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 @@ -8956,7 +12141,7 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task CloudServicesNetworksGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task BmcKeySetsGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -8967,6 +12152,7 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -8974,13 +12160,13 @@ public partial class NetworkCloud case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.CloudServicesNetwork.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BmcKeySet.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -8996,17 +12182,18 @@ public partial class NetworkCloud } /// - /// 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 value must be an UUID. /// The name of the resource group. The name is case insensitive. - /// The name of the cloud services network. + /// The name of the cluster. + /// The name of the baseboard management controller key set. /// an instance that will receive events. /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task CloudServicesNetworksGet_Validate(string subscriptionId, string resourceGroupName, string cloudServicesNetworkName, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task BmcKeySetsGet_Validate(string subscriptionId, string resourceGroupName, string clusterName, string bmcKeySetName, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -9015,14 +12202,19 @@ public partial class NetworkCloud await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertNotNull(nameof(cloudServicesNetworkName),cloudServicesNetworkName); - await eventListener.AssertRegEx(nameof(cloudServicesNetworkName),cloudServicesNetworkName,@"^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$"); + await eventListener.AssertNotNull(nameof(clusterName),clusterName); + await eventListener.AssertRegEx(nameof(clusterName), clusterName, @"^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$"); + await eventListener.AssertNotNull(nameof(bmcKeySetName),bmcKeySetName); + await eventListener.AssertRegEx(nameof(bmcKeySetName), bmcKeySetName, @"^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$"); } } - /// Get a list of cloud services networks in the provided resource group. + /// + /// Get a list of baseboard management controller key sets for the provided cluster. + /// /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. + /// The name of the cluster. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). @@ -9031,7 +12223,7 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task CloudServicesNetworksListByResourceGroup(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.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task BmcKeySetsListByCluster(string subscriptionId, string resourceGroupName, string clusterName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -9043,7 +12235,9 @@ public partial class NetworkCloud + global::System.Uri.EscapeDataString(subscriptionId) + "/resourceGroups/" + global::System.Uri.EscapeDataString(resourceGroupName) - + "/providers/Microsoft.NetworkCloud/cloudServicesNetworks" + + "/providers/Microsoft.NetworkCloud/clusters/" + + global::System.Uri.EscapeDataString(clusterName) + + "/bmcKeySets" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -9057,11 +12251,13 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.CloudServicesNetworksListByResourceGroup_Call(request,onOk,onDefault,eventListener,sender); + await this.BmcKeySetsListByCluster_Call (request, onOk,onDefault,eventListener,sender); } } - /// Get a list of cloud services networks in the provided resource group. + /// + /// Get a list of baseboard management controller key sets for the provided cluster. + /// /// /// a delegate that is 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 +12267,7 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task CloudServicesNetworksListByResourceGroupViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task BmcKeySetsListByClusterViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -9079,22 +12275,25 @@ public partial class NetworkCloud { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/cloudServicesNetworks$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/clusters/(?[^/]+)/bmcKeySets$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/cloudServicesNetworks'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/bmcKeySets'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var clusterName = _match.Groups["clusterName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + subscriptionId + "/resourceGroups/" + resourceGroupName - + "/providers/Microsoft.NetworkCloud/cloudServicesNetworks" + + "/providers/Microsoft.NetworkCloud/clusters/" + + clusterName + + "/bmcKeySets" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -9108,94 +12307,77 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.CloudServicesNetworksListByResourceGroup_Call(request,onOk,onDefault,eventListener,sender); + await this.BmcKeySetsListByCluster_Call (request, onOk,onDefault,eventListener,sender); } } /// - /// Actual wire call for method. + /// Get a list of baseboard management controller key sets for the provided cluster. /// - /// the prepared HttpRequestMessage to send. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). + /// /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 CloudServicesNetworksListByResourceGroup_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task BmcKeySetsListByClusterViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { + var apiVersion = @"2025-02-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.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.CloudServicesNetworkList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/clusters/(?[^/]+)/bmcKeySets$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/bmcKeySets'"); } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var clusterName = _match.Groups["clusterName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.NetworkCloud/clusters/" + + clusterName + + "/bmcKeySets" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.BmcKeySetsListByClusterWithResult_Call (request, eventListener,sender); } } /// - /// Validation method for method. Call this like the actual call, - /// but you will get validation events back. + /// Get a list of baseboard management controller key sets for the provided cluster. /// /// The ID of the target subscription. The value must be an UUID. /// 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 CloudServicesNetworksListByResourceGroup_Validate(string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) - { - using( NoSynchronizationContext ) - { - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); - await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); - await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); - await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); - await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - } - } - - /// Get a list of cloud services networks in the provided subscription. - /// The ID of the target subscription. The value must be an UUID. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). + /// The name of the cluster. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 CloudServicesNetworksListBySubscription(string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task BmcKeySetsListByClusterWithResult(string subscriptionId, string resourceGroupName, string clusterName, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -9205,75 +12387,89 @@ public partial class NetworkCloud var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + global::System.Uri.EscapeDataString(subscriptionId) - + "/providers/Microsoft.NetworkCloud/cloudServicesNetworks" + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.NetworkCloud/clusters/" + + global::System.Uri.EscapeDataString(clusterName) + + "/bmcKeySets" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.CloudServicesNetworksListBySubscription_Call(request,onOk,onDefault,eventListener,sender); + return await this.BmcKeySetsListByClusterWithResult_Call (request, eventListener,sender); } } - /// Get a list of cloud services networks in the provided 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). + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 CloudServicesNetworksListBySubscriptionViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task BmcKeySetsListByClusterWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { - var apiVersion = @"2025-02-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.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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/(?[^/]+)/providers/Microsoft.NetworkCloud/cloudServicesNetworks$", 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.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BmcKeySetList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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}/providers/Microsoft.NetworkCloud/cloudServicesNetworks'"); + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); } - - // 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.NetworkCloud/cloudServicesNetworks" - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - // generate request object - var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.CloudServicesNetworksListBySubscription_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 @@ -9283,7 +12479,7 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task CloudServicesNetworksListBySubscription_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task BmcKeySetsListByCluster_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -9294,6 +12490,7 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -9301,13 +12498,13 @@ public partial class NetworkCloud case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.CloudServicesNetworkList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BmcKeySetList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -9323,30 +12520,38 @@ public partial class NetworkCloud } /// - /// 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 value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the cluster. /// an instance that will receive events. /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task CloudServicesNetworksListBySubscription_Validate(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task BmcKeySetsListByCluster_Validate(string subscriptionId, string resourceGroupName, string clusterName, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(clusterName),clusterName); + await eventListener.AssertRegEx(nameof(clusterName), clusterName, @"^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$"); } } /// - /// Update properties of the provided cloud services network, or update the tags associated with it. Properties and tag updates - /// can be done independently. + /// Patch properties of baseboard management controller key set for the provided cluster, or update the tags associated with + /// it. Properties and tag update can be done independently. /// /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. - /// The name of the cloud services network. + /// The name of the cluster. + /// The name of the baseboard management controller key set. /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. @@ -9357,10 +12562,11 @@ public partial class NetworkCloud /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 CloudServicesNetworksUpdate(string subscriptionId, string resourceGroupName, string cloudServicesNetworkName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkPatchParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task BmcKeySetsUpdate(string subscriptionId, string resourceGroupName, string clusterName, string bmcKeySetName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetPatchParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -9372,8 +12578,10 @@ public partial class NetworkCloud + global::System.Uri.EscapeDataString(subscriptionId) + "/resourceGroups/" + global::System.Uri.EscapeDataString(resourceGroupName) - + "/providers/Microsoft.NetworkCloud/cloudServicesNetworks/" - + global::System.Uri.EscapeDataString(cloudServicesNetworkName) + + "/providers/Microsoft.NetworkCloud/clusters/" + + global::System.Uri.EscapeDataString(clusterName) + + "/bmcKeySets/" + + global::System.Uri.EscapeDataString(bmcKeySetName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -9397,17 +12605,17 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // 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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.CloudServicesNetworksUpdate_Call(request,onOk,onDefault,eventListener,sender); + await this.BmcKeySetsUpdate_Call (request, onOk,onDefault,eventListener,sender); } } /// - /// Update properties of the provided cloud services network, or update the tags associated with it. Properties and tag updates - /// can be done independently. + /// Patch properties of baseboard management controller key set for the provided cluster, or update the tags associated with + /// it. Properties and tag update can be done independently. /// /// /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify @@ -9420,10 +12628,11 @@ public partial class NetworkCloud /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 CloudServicesNetworksUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkPatchParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task BmcKeySetsUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetPatchParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -9431,24 +12640,27 @@ public partial class NetworkCloud { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/cloudServicesNetworks/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/clusters/(?[^/]+)/bmcKeySets/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/cloudServicesNetworks/{cloudServicesNetworkName}'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/bmcKeySets/{bmcKeySetName}'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var cloudServicesNetworkName = _match.Groups["cloudServicesNetworkName"].Value; + var clusterName = _match.Groups["clusterName"].Value; + var bmcKeySetName = _match.Groups["bmcKeySetName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + subscriptionId + "/resourceGroups/" + resourceGroupName - + "/providers/Microsoft.NetworkCloud/cloudServicesNetworks/" - + cloudServicesNetworkName + + "/providers/Microsoft.NetworkCloud/clusters/" + + clusterName + + "/bmcKeySets/" + + bmcKeySetName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -9472,213 +12684,179 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // 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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.CloudServicesNetworksUpdate_Call(request,onOk,onDefault,eventListener,sender); + await this.BmcKeySetsUpdate_Call (request, onOk,onDefault,eventListener,sender); } } - /// Actual wire call for method. - /// the prepared HttpRequestMessage to send. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). + /// + /// Patch properties of baseboard management controller key set for the provided cluster, or update the tags associated with + /// it. Properties and tag update can be done independently. + /// + /// + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// The request body. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 CloudServicesNetworksUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task BmcKeySetsUpdateViaIdentityWithResult(global::System.String viaIdentity, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetPatchParameters body, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate) { + var apiVersion = @"2025-02-01"; + // 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("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/clusters/(?[^/]+)/bmcKeySets/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) { - var sendTask = sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // this operation supports x-ms-long-running-operation - var _originalUri = request.RequestUri.AbsoluteUri; - // declared final-state-via: azure-async-operation - var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - var location = _response.GetFirstHeader(@"Location"); - while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) - { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/bmcKeySets/{bmcKeySetName}'"); + } - // get the delay before polling. (default to 30 seconds if not present) - int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var clusterName = _match.Groups["clusterName"].Value; + var bmcKeySetName = _match.Groups["bmcKeySetName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.NetworkCloud/clusters/" + + clusterName + + "/bmcKeySets/" + + bmcKeySetName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - // start the delay timer (we'll await later...) - var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - // while we wait, let's grab the headers and get ready to poll. - if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { - asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - } - if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { - location = _response.GetFirstHeader(@"Location"); - } - var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; - request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - // and let's look at the current response body and see if we have some information we can give back to the listener - var content = await _response.Content.ReadAsStringAsync(); - await waiting; - - // check for cancellation - if( eventListener.Token.IsCancellationRequested ) { return; } - - // drop the old response - _response?.Dispose(); - - // make the polling call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // if we got back an OK, take a peek inside and see if it's done - if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) - { - var error = false; - try { - if( Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) - { - var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); - if( state is null ) - { - // the body doesn't contain any information that has the state of the LRO - // we're going to just get out, and let the consumer have the result - break; - } - - switch( state?.ToString()?.ToLower() ) - { - case "failed": - error = true; - break; - case "succeeded": - case "canceled": - // we're done polling. - break; - - default: - // need to keep polling! - _response.StatusCode = global::System.Net.HttpStatusCode.Created; - continue; - } - } - } catch { - // if we run into a problem peeking into the result, - // we really don't want to do anything special. - } - if (error) { - throw new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException(_response); - } - } - - // check for terminal status code - if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) - { - continue; - } - // we are done polling, do a request on final target? - // create a new request with the final uri - request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); - - // drop the old response - _response?.Dispose(); - - // make the final call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - break; - } - var _contentType = _response.Content.Headers.ContentType?.MediaType; - - switch ( _response.StatusCode ) - { - case global::System.Net.HttpStatusCode.OK: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.CloudServicesNetwork.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); } - finally + if (null != ifNoneMatch) { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); + request.Headers.Add("If-None-Match",ifNoneMatch); } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.BmcKeySetsUpdateWithResult_Call (request, eventListener,sender); } } /// - /// Validation method for method. Call this like the actual call, but you will - /// get validation events back. + /// Patch properties of baseboard management controller key set for the provided cluster, or update the tags associated with + /// it. Properties and tag update can be done independently. /// /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. - /// The name of the cloud services network. + /// The name of the cluster. + /// The name of the baseboard management controller key set. /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. /// Other values will result in error from server as they are not supported. - /// The request body. + /// Json string supplied to the BmcKeySetsUpdate 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.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task CloudServicesNetworksUpdate_Validate(string subscriptionId, string resourceGroupName, string cloudServicesNetworkName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkPatchParameters body, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) + public async global::System.Threading.Tasks.Task BmcKeySetsUpdateViaJsonString(string subscriptionId, string resourceGroupName, string clusterName, string bmcKeySetName, string ifMatch, string ifNoneMatch, 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.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { + var apiVersion = @"2025-02-01"; + // Constant Parameters using( NoSynchronizationContext ) { - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); - await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); - await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); - await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); - await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertNotNull(nameof(cloudServicesNetworkName),cloudServicesNetworkName); - await eventListener.AssertRegEx(nameof(cloudServicesNetworkName),cloudServicesNetworkName,@"^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$"); - await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); - await eventListener.AssertNotNull(nameof(ifNoneMatch),ifNoneMatch); - 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.NetworkCloud/clusters/" + + global::System.Uri.EscapeDataString(clusterName) + + "/bmcKeySets/" + + global::System.Uri.EscapeDataString(bmcKeySetName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + if (null != ifNoneMatch) + { + request.Headers.Add("If-None-Match",ifNoneMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.BmcKeySetsUpdate_Call (request, onOk,onDefault,eventListener,sender); } } /// - /// Create a new cluster manager or update properties of the cluster manager if it exists. + /// Patch properties of baseboard management controller key set for the provided cluster, or update the tags associated with + /// it. Properties and tag update can be done independently. /// /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. - /// The name of the cluster manager. + /// The name of the cluster. + /// The name of the baseboard management controller key set. /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. /// Other values will result in error from server as they are not supported. - /// The request body. - /// a delegate that is called 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 BmcKeySetsUpdate operation /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ClusterManagersCreateOrUpdate(string subscriptionId, string resourceGroupName, string clusterManagerName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManager body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task BmcKeySetsUpdateViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string clusterName, string bmcKeySetName, string ifMatch, string ifNoneMatch, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -9690,18 +12868,20 @@ public partial class NetworkCloud + global::System.Uri.EscapeDataString(subscriptionId) + "/resourceGroups/" + global::System.Uri.EscapeDataString(resourceGroupName) - + "/providers/Microsoft.NetworkCloud/clusterManagers/" - + global::System.Uri.EscapeDataString(clusterManagerName) + + "/providers/Microsoft.NetworkCloud/clusters/" + + global::System.Uri.EscapeDataString(clusterName) + + "/bmcKeySets/" + + global::System.Uri.EscapeDataString(bmcKeySetName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Put, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } // add headers parameters if (null != ifMatch) @@ -9713,69 +12893,62 @@ public partial class NetworkCloud request.Headers.Add("If-None-Match",ifNoneMatch); } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.ClusterManagersCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + return await this.BmcKeySetsUpdateWithResult_Call (request, eventListener,sender); } } /// - /// Create a new cluster manager or update properties of the cluster manager if it exists. + /// Patch properties of baseboard management controller key set for the provided cluster, or update the tags associated with + /// it. Properties and tag update can be done independently. /// - /// + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the cluster. + /// The name of the baseboard management controller key set. /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. /// Other values will result in error from server as they are not supported. /// The request body. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ClusterManagersCreateOrUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManager body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task BmcKeySetsUpdateWithResult(string subscriptionId, string resourceGroupName, string clusterName, string bmcKeySetName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetPatchParameters body, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2025-02-01"; // Constant Parameters using( NoSynchronizationContext ) { - // verify that Identity format is an exact match for uri - - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/clusterManagers/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); - if (!_match.Success) - { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusterManagers/{clusterManagerName}'"); - } - - // replace URI parameters with values from identity - var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var clusterManagerName = _match.Groups["clusterManagerName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" - + subscriptionId + + global::System.Uri.EscapeDataString(subscriptionId) + "/resourceGroups/" - + resourceGroupName - + "/providers/Microsoft.NetworkCloud/clusterManagers/" - + clusterManagerName + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.NetworkCloud/clusters/" + + global::System.Uri.EscapeDataString(clusterName) + + "/bmcKeySets/" + + global::System.Uri.EscapeDataString(bmcKeySetName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Put, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } // add headers parameters if (null != ifMatch) @@ -9787,17 +12960,169 @@ public partial class NetworkCloud request.Headers.Add("If-None-Match",ifNoneMatch); } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.ClusterManagersCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + return await this.BmcKeySetsUpdateWithResult_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.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A + /// that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task BmcKeySetsUpdateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + // declared final-state-via: azure-async-operation + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + break; + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BmcKeySet.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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 @@ -9807,31 +13132,28 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task ClusterManagersCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task BmcKeySetsUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { global::System.Net.Http.HttpResponseMessage _response = null; try { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; var sendTask = sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // this operation supports x-ms-long-running-operation - var _originalUri = request.RequestUri.AbsoluteUri; // declared final-state-via: azure-async-operation var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) { - - // get the delay before polling. (default to 30 seconds if not present) - int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // start the delay timer (we'll await later...) - var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } // while we wait, let's grab the headers and get ready to poll. if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { @@ -9840,15 +13162,14 @@ public partial class NetworkCloud if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { location = _response.GetFirstHeader(@"Location"); } - var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); // and let's look at the current response body and see if we have some information we can give back to the listener var content = await _response.Content.ReadAsStringAsync(); - await waiting; - - // check for cancellation - if( eventListener.Token.IsCancellationRequested ) { return; } // drop the old response _response?.Dispose(); @@ -9857,45 +13178,45 @@ public partial class NetworkCloud _response = await sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // if we got back an OK, take a peek inside and see if it's done - if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) - { - var error = false; - try { - if( Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) - { - var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); - if( state is null ) - { - // the body doesn't contain any information that has the state of the LRO - // we're going to just get out, and let the consumer have the result - break; - } - - switch( state?.ToString()?.ToLower() ) - { - case "failed": - error = true; + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result break; - case "succeeded": - case "canceled": - // we're done polling. - break; - - default: - // need to keep polling! - _response.StatusCode = global::System.Net.HttpStatusCode.Created; - continue; - } - } - } catch { - // if we run into a problem peeking into the result, - // we really don't want to do anything special. - } - if (error) { - throw new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException(_response); - } - } + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException(_response); + } + } // check for terminal status code if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) @@ -9914,6 +13235,7 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } break; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -9921,13 +13243,13 @@ public partial class NetworkCloud case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ClusterManager.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BmcKeySet.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -9943,12 +13265,13 @@ public partial class NetworkCloud } /// - /// 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 value must be an UUID. /// The name of the resource group. The name is case insensitive. - /// The name of the cluster manager. + /// The name of the cluster. + /// The name of the baseboard management controller key set. /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. @@ -9958,7 +13281,7 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task ClusterManagersCreateOrUpdate_Validate(string subscriptionId, string resourceGroupName, string clusterManagerName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManager body, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task BmcKeySetsUpdate_Validate(string subscriptionId, string resourceGroupName, string clusterName, string bmcKeySetName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetPatchParameters body, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -9967,8 +13290,10 @@ public partial class NetworkCloud await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertNotNull(nameof(clusterManagerName),clusterManagerName); - await eventListener.AssertRegEx(nameof(clusterManagerName),clusterManagerName,@"^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$"); + await eventListener.AssertNotNull(nameof(clusterName),clusterName); + await eventListener.AssertRegEx(nameof(clusterName), clusterName, @"^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$"); + await eventListener.AssertNotNull(nameof(bmcKeySetName),bmcKeySetName); + await eventListener.AssertRegEx(nameof(bmcKeySetName), bmcKeySetName, @"^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$"); await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); await eventListener.AssertNotNull(nameof(ifNoneMatch),ifNoneMatch); await eventListener.AssertNotNull(nameof(body), body); @@ -9976,24 +13301,27 @@ public partial class NetworkCloud } } - /// Delete the provided cluster manager. + /// + /// update a new cloud services network or update the properties of the existing cloud services network. + /// /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. - /// The name of the cluster manager. + /// The name of the cloud services network. /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. /// Other values will result in error from server as they are not supported. + /// The request body. /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns 204 (NoContent). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ClusterManagersDelete(string subscriptionId, string resourceGroupName, string clusterManagerName, string ifMatch, string ifNoneMatch, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task CloudServicesNetworksCreateOrUpdate(string subscriptionId, string resourceGroupName, string cloudServicesNetworkName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetwork body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -10005,8 +13333,8 @@ public partial class NetworkCloud + global::System.Uri.EscapeDataString(subscriptionId) + "/resourceGroups/" + global::System.Uri.EscapeDataString(resourceGroupName) - + "/providers/Microsoft.NetworkCloud/clusterManagers/" - + global::System.Uri.EscapeDataString(clusterManagerName) + + "/providers/Microsoft.NetworkCloud/cloudServicesNetworks/" + + global::System.Uri.EscapeDataString(cloudServicesNetworkName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -10015,7 +13343,7 @@ public partial class NetworkCloud // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Delete, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Put, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } // add headers parameters @@ -10029,27 +13357,34 @@ public partial class NetworkCloud } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ClusterManagersDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + await this.CloudServicesNetworksCreateOrUpdate_Call (request, onOk,onDefault,eventListener,sender); } } - /// Delete the provided cluster manager. + /// + /// update a new cloud services network or update the properties of the existing cloud services network. + /// /// /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. /// Other values will result in error from server as they are not supported. + /// The request body. /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns 204 (NoContent). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ClusterManagersDeleteViaIdentity(global::System.String viaIdentity, string ifMatch, string ifNoneMatch, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task CloudServicesNetworksCreateOrUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetwork body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -10057,24 +13392,24 @@ public partial class NetworkCloud { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/clusterManagers/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/cloudServicesNetworks/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusterManagers/{clusterManagerName}'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/cloudServicesNetworks/{cloudServicesNetworkName}'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var clusterManagerName = _match.Groups["clusterManagerName"].Value; + var cloudServicesNetworkName = _match.Groups["cloudServicesNetworkName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + subscriptionId + "/resourceGroups/" + resourceGroupName - + "/providers/Microsoft.NetworkCloud/clusterManagers/" - + clusterManagerName + + "/providers/Microsoft.NetworkCloud/cloudServicesNetworks/" + + cloudServicesNetworkName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -10083,7 +13418,7 @@ public partial class NetworkCloud // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Delete, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Put, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } // add headers parameters @@ -10097,199 +13432,99 @@ public partial class NetworkCloud } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ClusterManagersDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + await this.CloudServicesNetworksCreateOrUpdate_Call (request, onOk,onDefault,eventListener,sender); } } - /// Actual wire call for method. - /// the prepared HttpRequestMessage 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 new cloud services network or update the properties of the existing cloud services network. + /// + /// + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// The request body. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ClusterManagersDelete_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.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task CloudServicesNetworksCreateOrUpdateViaIdentityWithResult(global::System.String viaIdentity, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetwork body, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate) { + var apiVersion = @"2025-02-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.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // this operation supports x-ms-long-running-operation - var _originalUri = request.RequestUri.AbsoluteUri; - // declared final-state-via: location - var _finalUri = _response.GetFirstHeader(@"Location"); - var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - var location = _response.GetFirstHeader(@"Location"); - while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) - { - - // get the delay before polling. (default to 30 seconds if not present) - int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // start the delay timer (we'll await later...) - var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); - - // while we wait, let's grab the headers and get ready to poll. - if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { - asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - } - if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { - location = _response.GetFirstHeader(@"Location"); - } - var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; - request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); - - // and let's look at the current response body and see if we have some information we can give back to the listener - var content = await _response.Content.ReadAsStringAsync(); - await waiting; - - // check for cancellation - if( eventListener.Token.IsCancellationRequested ) { return; } - - // drop the old response - _response?.Dispose(); - - // make the polling call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // verify that Identity format is an exact match for uri - // if we got back an OK, take a peek inside and see if it's done - if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) - { - var error = false; - try { - if( Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) - { - var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); - if( state is null ) - { - // the body doesn't contain any information that has the state of the LRO - // we're going to just get out, and let the consumer have the result - break; - } - - switch( state?.ToString()?.ToLower() ) - { - case "failed": - error = true; - break; - case "succeeded": - case "canceled": - // we're done polling. - break; - - default: - // need to keep polling! - _response.StatusCode = global::System.Net.HttpStatusCode.Created; - continue; - } - } - } catch { - // if we run into a problem peeking into the result, - // we really don't want to do anything special. - } - if (error) { - throw new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException(_response); - } - } + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/cloudServicesNetworks/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/cloudServicesNetworks/{cloudServicesNetworkName}'"); + } - // check for terminal status code - if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) - { - continue; - } - // we are done polling, do a request on final target? - // create a new request with the final uri - request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var cloudServicesNetworkName = _match.Groups["cloudServicesNetworkName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.NetworkCloud/cloudServicesNetworks/" + + cloudServicesNetworkName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - // drop the old response - _response?.Dispose(); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - // make the final call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - break; - } - var _contentType = _response.Content.Headers.ContentType?.MediaType; + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - switch ( _response.StatusCode ) - { - case global::System.Net.HttpStatusCode.OK: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onNoContent(_response); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); } - finally + if (null != ifNoneMatch) { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); + request.Headers.Add("If-None-Match",ifNoneMatch); } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.CloudServicesNetworksCreateOrUpdateWithResult_Call (request, eventListener,sender); } } /// - /// Validation method for method. Call this like the actual call, but you will get validation - /// events back. + /// update a new cloud services network or update the properties of the existing cloud services network. /// /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. - /// The name of the cluster manager. + /// The name of the cloud services network. /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. /// Other values will result in error from server as they are not supported. - /// an instance that will receive events. - /// - /// A that will be complete when handling of the response is completed. - /// - internal async global::System.Threading.Tasks.Task ClusterManagersDelete_Validate(string subscriptionId, string resourceGroupName, string clusterManagerName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) - { - using( NoSynchronizationContext ) - { - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); - await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); - await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); - await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); - await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertNotNull(nameof(clusterManagerName),clusterManagerName); - await eventListener.AssertRegEx(nameof(clusterManagerName),clusterManagerName,@"^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$"); - await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); - await eventListener.AssertNotNull(nameof(ifNoneMatch),ifNoneMatch); - } - } - - /// Get the properties of the provided cluster manager. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of the cluster manager. + /// Json string supplied to the CloudServicesNetworksCreateOrUpdate 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). @@ -10298,7 +13533,7 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ClusterManagersGet(string subscriptionId, string resourceGroupName, string clusterManagerName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task CloudServicesNetworksCreateOrUpdateViaJsonString(string subscriptionId, string resourceGroupName, string cloudServicesNetworkName, string ifMatch, string ifNoneMatch, 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.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -10310,8 +13545,8 @@ public partial class NetworkCloud + global::System.Uri.EscapeDataString(subscriptionId) + "/resourceGroups/" + global::System.Uri.EscapeDataString(resourceGroupName) - + "/providers/Microsoft.NetworkCloud/clusterManagers/" - + global::System.Uri.EscapeDataString(clusterManagerName) + + "/providers/Microsoft.NetworkCloud/cloudServicesNetworks/" + + global::System.Uri.EscapeDataString(cloudServicesNetworkName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -10320,69 +13555,311 @@ public partial class NetworkCloud // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Put, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + if (null != ifNoneMatch) + { + request.Headers.Add("If-None-Match",ifNoneMatch); + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ClusterManagersGet_Call(request,onOk,onDefault,eventListener,sender); + await this.CloudServicesNetworksCreateOrUpdate_Call (request, onOk,onDefault,eventListener,sender); } } - /// Get the properties of the provided cluster manager. - /// - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. - /// - /// A that will be complete when handling of the response is completed. - /// - public async global::System.Threading.Tasks.Task ClusterManagersGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) - { - var apiVersion = @"2025-02-01"; + /// + /// update a new cloud services network or update the properties of the existing cloud services network. + /// + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the cloud services network. + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// Json string supplied to the CloudServicesNetworksCreateOrUpdate operation + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task CloudServicesNetworksCreateOrUpdateViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string cloudServicesNetworkName, string ifMatch, string ifNoneMatch, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-01"; // 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.NetworkCloud/cloudServicesNetworks/" + + global::System.Uri.EscapeDataString(cloudServicesNetworkName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/clusterManagers/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); - if (!_match.Success) + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // add headers parameters + if (null != ifMatch) { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusterManagers/{clusterManagerName}'"); + request.Headers.Add("If-Match",ifMatch); + } + if (null != ifNoneMatch) + { + request.Headers.Add("If-None-Match",ifNoneMatch); } - // replace URI parameters with values from identity - var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var clusterManagerName = _match.Groups["clusterManagerName"].Value; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.CloudServicesNetworksCreateOrUpdateWithResult_Call (request, eventListener,sender); + } + } + + /// + /// update a new cloud services network or update the properties of the existing cloud services network. + /// + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the cloud services network. + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// The request body. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 CloudServicesNetworksCreateOrUpdateWithResult(string subscriptionId, string resourceGroupName, string cloudServicesNetworkName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetwork body, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" - + subscriptionId + + global::System.Uri.EscapeDataString(subscriptionId) + "/resourceGroups/" - + resourceGroupName - + "/providers/Microsoft.NetworkCloud/clusterManagers/" - + clusterManagerName + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.NetworkCloud/cloudServicesNetworks/" + + global::System.Uri.EscapeDataString(cloudServicesNetworkName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + if (null != ifNoneMatch) + { + request.Headers.Add("If-None-Match",ifNoneMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.ClusterManagersGet_Call(request,onOk,onDefault,eventListener,sender); + return await this.CloudServicesNetworksCreateOrUpdateWithResult_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.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task CloudServicesNetworksCreateOrUpdateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + // declared final-state-via: azure-async-operation + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + break; + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.CloudServicesNetwork.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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 @@ -10392,17 +13869,110 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task ClusterManagersGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task CloudServicesNetworksCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { global::System.Net.Http.HttpResponseMessage _response = null; try { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; var sendTask = sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // declared final-state-via: azure-async-operation + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -10410,13 +13980,13 @@ public partial class NetworkCloud case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ClusterManager.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.CloudServicesNetwork.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -10432,17 +14002,22 @@ public partial class NetworkCloud } /// - /// 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 value must be an UUID. /// The name of the resource group. The name is case insensitive. - /// The name of the cluster manager. + /// The name of the cloud services network. + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// The request body. /// an instance that will receive events. /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task ClusterManagersGet_Validate(string subscriptionId, string resourceGroupName, string clusterManagerName, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task CloudServicesNetworksCreateOrUpdate_Validate(string subscriptionId, string resourceGroupName, string cloudServicesNetworkName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetwork body, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -10451,15 +14026,25 @@ public partial class NetworkCloud await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertNotNull(nameof(clusterManagerName),clusterManagerName); - await eventListener.AssertRegEx(nameof(clusterManagerName),clusterManagerName,@"^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$"); + await eventListener.AssertNotNull(nameof(cloudServicesNetworkName),cloudServicesNetworkName); + await eventListener.AssertRegEx(nameof(cloudServicesNetworkName), cloudServicesNetworkName, @"^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$"); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(ifNoneMatch),ifNoneMatch); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); } } - /// Get a list of cluster managers in the provided resource group. + /// Delete the provided cloud services network. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. + /// The name of the cloud services network. + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. @@ -10467,7 +14052,7 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ClusterManagersListByResourceGroup(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.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task CloudServicesNetworksDelete(string subscriptionId, string resourceGroupName, string cloudServicesNetworkName, string ifMatch, string ifNoneMatch, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -10479,7 +14064,8 @@ public partial class NetworkCloud + global::System.Uri.EscapeDataString(subscriptionId) + "/resourceGroups/" + global::System.Uri.EscapeDataString(resourceGroupName) - + "/providers/Microsoft.NetworkCloud/clusterManagers" + + "/providers/Microsoft.NetworkCloud/cloudServicesNetworks/" + + global::System.Uri.EscapeDataString(cloudServicesNetworkName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -10488,18 +14074,33 @@ public partial class NetworkCloud // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Delete, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + if (null != ifNoneMatch) + { + request.Headers.Add("If-None-Match",ifNoneMatch); + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ClusterManagersListByResourceGroup_Call(request,onOk,onDefault,eventListener,sender); + await this.CloudServicesNetworksDelete_Call (request, onOk,onNoContent,onDefault,eventListener,sender); } } - /// Get a list of cluster managers in the provided resource group. + /// Delete the provided cloud services network. /// + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. @@ -10507,7 +14108,7 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ClusterManagersListByResourceGroupViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task CloudServicesNetworksDeleteViaIdentity(global::System.String viaIdentity, string ifMatch, string ifNoneMatch, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -10515,22 +14116,24 @@ public partial class NetworkCloud { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/clusterManagers$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/cloudServicesNetworks/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusterManagers'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/cloudServicesNetworks/{cloudServicesNetworkName}'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var cloudServicesNetworkName = _match.Groups["cloudServicesNetworkName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + subscriptionId + "/resourceGroups/" + resourceGroupName - + "/providers/Microsoft.NetworkCloud/clusterManagers" + + "/providers/Microsoft.NetworkCloud/cloudServicesNetworks/" + + cloudServicesNetworkName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -10539,18 +14142,29 @@ public partial class NetworkCloud // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Delete, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + if (null != ifNoneMatch) + { + request.Headers.Add("If-None-Match",ifNoneMatch); + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ClusterManagersListByResourceGroup_Call(request,onOk,onDefault,eventListener,sender); + await this.CloudServicesNetworksDelete_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. @@ -10558,17 +14172,111 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task ClusterManagersListByResourceGroup_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task CloudServicesNetworksDelete_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.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { global::System.Net.Http.HttpResponseMessage _response = null; try { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; var sendTask = sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // declared final-state-via: location + var _finalUri = _response.GetFirstHeader(@"Location"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -10576,13 +14284,19 @@ public partial class NetworkCloud case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ClusterManagerList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -10598,16 +14312,21 @@ public partial class NetworkCloud } /// - /// 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 value must be an UUID. /// The name of the resource group. The name is case insensitive. + /// The name of the cloud services network. + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. /// an instance that will receive events. /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task ClusterManagersListByResourceGroup_Validate(string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task CloudServicesNetworksDelete_Validate(string subscriptionId, string resourceGroupName, string cloudServicesNetworkName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -10616,11 +14335,17 @@ public partial class NetworkCloud await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(cloudServicesNetworkName),cloudServicesNetworkName); + await eventListener.AssertRegEx(nameof(cloudServicesNetworkName), cloudServicesNetworkName, @"^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$"); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(ifNoneMatch),ifNoneMatch); } } - /// Get a list of cluster managers in the provided subscription. + /// Get properties of the provided cloud services network. /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the cloud services network. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). @@ -10629,7 +14354,7 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ClusterManagersListBySubscription(string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task CloudServicesNetworksGet(string subscriptionId, string resourceGroupName, string cloudServicesNetworkName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -10639,7 +14364,10 @@ public partial class NetworkCloud var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + global::System.Uri.EscapeDataString(subscriptionId) - + "/providers/Microsoft.NetworkCloud/clusterManagers" + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.NetworkCloud/cloudServicesNetworks/" + + global::System.Uri.EscapeDataString(cloudServicesNetworkName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -10653,11 +14381,11 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ClusterManagersListBySubscription_Call(request,onOk,onDefault,eventListener,sender); + await this.CloudServicesNetworksGet_Call (request, onOk,onDefault,eventListener,sender); } } - /// Get a list of cluster managers in the provided subscription. + /// Get properties of the provided cloud services network. /// /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled @@ -10667,7 +14395,7 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ClusterManagersListBySubscriptionViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task CloudServicesNetworksGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -10675,19 +14403,24 @@ public partial class NetworkCloud { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/providers/Microsoft.NetworkCloud/clusterManagers$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/cloudServicesNetworks/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.NetworkCloud/clusterManagers'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/cloudServicesNetworks/{cloudServicesNetworkName}'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var cloudServicesNetworkName = _match.Groups["cloudServicesNetworkName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + subscriptionId - + "/providers/Microsoft.NetworkCloud/clusterManagers" + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.NetworkCloud/cloudServicesNetworks/" + + cloudServicesNetworkName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -10701,11 +14434,163 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ClusterManagersListBySubscription_Call(request,onOk,onDefault,eventListener,sender); + await this.CloudServicesNetworksGet_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Get properties of the provided cloud services network. + /// + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task CloudServicesNetworksGetViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/cloudServicesNetworks/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/cloudServicesNetworks/{cloudServicesNetworkName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var cloudServicesNetworkName = _match.Groups["cloudServicesNetworkName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.NetworkCloud/cloudServicesNetworks/" + + cloudServicesNetworkName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.CloudServicesNetworksGetWithResult_Call (request, eventListener,sender); + } + } + + /// Get properties of the provided cloud services network. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the cloud services network. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task CloudServicesNetworksGetWithResult(string subscriptionId, string resourceGroupName, string cloudServicesNetworkName, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.NetworkCloud/cloudServicesNetworks/" + + global::System.Uri.EscapeDataString(cloudServicesNetworkName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.CloudServicesNetworksGetWithResult_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.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task CloudServicesNetworksGetWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.CloudServicesNetwork.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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 @@ -10715,7 +14600,7 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task ClusterManagersListBySubscription_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task CloudServicesNetworksGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -10726,6 +14611,7 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -10733,13 +14619,13 @@ public partial class NetworkCloud case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ClusterManagerList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.CloudServicesNetwork.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -10755,35 +14641,33 @@ public partial class NetworkCloud } /// - /// 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 value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the cloud services network. /// an instance that will receive events. /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task ClusterManagersListBySubscription_Validate(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task CloudServicesNetworksGet_Validate(string subscriptionId, string resourceGroupName, string cloudServicesNetworkName, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(cloudServicesNetworkName),cloudServicesNetworkName); + await eventListener.AssertRegEx(nameof(cloudServicesNetworkName), cloudServicesNetworkName, @"^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$"); } } - /// - /// Patch properties of the provided cluster manager, or update the tags assigned to the cluster manager. Properties and tag - /// updates can be done independently. - /// + /// Get a list of cloud services networks in the provided resource group. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. - /// The name of the cluster manager. - /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify - /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. - /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. - /// Other values will result in error from server as they are not supported. - /// The request body. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). @@ -10792,7 +14676,7 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ClusterManagersUpdate(string subscriptionId, string resourceGroupName, string clusterManagerName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerPatchParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task CloudServicesNetworksListByResourceGroup(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.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -10804,8 +14688,7 @@ public partial class NetworkCloud + global::System.Uri.EscapeDataString(subscriptionId) + "/resourceGroups/" + global::System.Uri.EscapeDataString(resourceGroupName) - + "/providers/Microsoft.NetworkCloud/clusterManagers/" - + global::System.Uri.EscapeDataString(clusterManagerName) + + "/providers/Microsoft.NetworkCloud/cloudServicesNetworks" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -10814,39 +14697,17 @@ public partial class NetworkCloud // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Patch, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - // add headers parameters - if (null != ifMatch) - { - request.Headers.Add("If-Match",ifMatch); - } - if (null != ifNoneMatch) - { - request.Headers.Add("If-None-Match",ifNoneMatch); - } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); - request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ClusterManagersUpdate_Call(request,onOk,onDefault,eventListener,sender); + await this.CloudServicesNetworksListByResourceGroup_Call (request, onOk,onDefault,eventListener,sender); } } - /// - /// Patch properties of the provided cluster manager, or update the tags assigned to the cluster manager. Properties and tag - /// updates can be done independently. - /// + /// Get a list of cloud services networks in the provided resource group. /// - /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify - /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. - /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. - /// Other values will result in error from server as they are not supported. - /// The request body. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). @@ -10855,7 +14716,7 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ClusterManagersUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerPatchParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task CloudServicesNetworksListByResourceGroupViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -10863,24 +14724,22 @@ public partial class NetworkCloud { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/clusterManagers/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/cloudServicesNetworks$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusterManagers/{clusterManagerName}'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/cloudServicesNetworks'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var clusterManagerName = _match.Groups["clusterManagerName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + subscriptionId + "/resourceGroups/" + resourceGroupName - + "/providers/Microsoft.NetworkCloud/clusterManagers/" - + clusterManagerName + + "/providers/Microsoft.NetworkCloud/cloudServicesNetworks" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -10889,30 +14748,168 @@ public partial class NetworkCloud // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Patch, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - // add headers parameters - if (null != ifMatch) - { - request.Headers.Add("If-Match",ifMatch); - } - if (null != ifNoneMatch) + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.CloudServicesNetworksListByResourceGroup_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Get a list of cloud services networks in the provided resource group. + /// + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task CloudServicesNetworksListByResourceGroupViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/cloudServicesNetworks$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) { - request.Headers.Add("If-None-Match",ifNoneMatch); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/cloudServicesNetworks'"); } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); - request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // 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.NetworkCloud/cloudServicesNetworks" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.CloudServicesNetworksListByResourceGroupWithResult_Call (request, eventListener,sender); + } + } + + /// Get a list of cloud services networks in the provided resource group. + /// The ID of the target subscription. The value must be an UUID. + /// 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.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task CloudServicesNetworksListByResourceGroupWithResult(string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.NetworkCloud/cloudServicesNetworks" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.ClusterManagersUpdate_Call(request,onOk,onDefault,eventListener,sender); + return await this.CloudServicesNetworksListByResourceGroupWithResult_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.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task CloudServicesNetworksListByResourceGroupWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.CloudServicesNetworkList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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 @@ -10922,7 +14919,7 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task ClusterManagersUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task CloudServicesNetworksListByResourceGroup_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -10933,6 +14930,7 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -10940,13 +14938,13 @@ public partial class NetworkCloud case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ClusterManager.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.CloudServicesNetworkList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -10962,22 +14960,16 @@ public partial class NetworkCloud } /// - /// 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 value must be an UUID. /// The name of the resource group. The name is case insensitive. - /// The name of the cluster manager. - /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify - /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. - /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. - /// Other values will result in error from server as they are not supported. - /// The request body. /// an instance that will receive events. /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task ClusterManagersUpdate_Validate(string subscriptionId, string resourceGroupName, string clusterManagerName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerPatchParameters body, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task CloudServicesNetworksListByResourceGroup_Validate(string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -10986,23 +14978,11 @@ public partial class NetworkCloud await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertNotNull(nameof(clusterManagerName),clusterManagerName); - await eventListener.AssertRegEx(nameof(clusterManagerName),clusterManagerName,@"^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$"); - await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); - await eventListener.AssertNotNull(nameof(ifNoneMatch),ifNoneMatch); - await eventListener.AssertNotNull(nameof(body), body); - await eventListener.AssertObjectIsValid(nameof(body), body); } } - /// - /// Trigger the continuation of an update for a cluster with a matching update strategy that has paused after completing a - /// segment of the update. - /// + /// Get a list of cloud services networks in the provided subscription. /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of the cluster. - /// The request body. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). @@ -11011,7 +14991,7 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ClustersContinueUpdateVersion(string subscriptionId, string resourceGroupName, string clusterName, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterContinueUpdateVersionParameters body, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task CloudServicesNetworksListBySubscription(string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -11021,11 +15001,7 @@ public partial class NetworkCloud var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + global::System.Uri.EscapeDataString(subscriptionId) - + "/resourceGroups/" - + global::System.Uri.EscapeDataString(resourceGroupName) - + "/providers/Microsoft.NetworkCloud/clusters/" - + global::System.Uri.EscapeDataString(clusterName) - + "/continueUpdateVersion" + + "/providers/Microsoft.NetworkCloud/cloudServicesNetworks" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -11034,25 +15010,17 @@ public partial class NetworkCloud // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Post, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); - request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ClustersContinueUpdateVersion_Call(request,onOk,onDefault,eventListener,sender); + await this.CloudServicesNetworksListBySubscription_Call (request, onOk,onDefault,eventListener,sender); } } - /// - /// Trigger the continuation of an update for a cluster with a matching update strategy that has paused after completing a - /// segment of the update. - /// + /// Get a list of cloud services networks in the provided subscription. /// - /// The request body. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). @@ -11061,7 +15029,7 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ClustersContinueUpdateVersionViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterContinueUpdateVersionParameters body, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task CloudServicesNetworksListBySubscriptionViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -11069,25 +15037,19 @@ public partial class NetworkCloud { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/clusters/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/providers/Microsoft.NetworkCloud/cloudServicesNetworks$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/continueUpdateVersion'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.NetworkCloud/cloudServicesNetworks'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var clusterName = _match.Groups["clusterName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + subscriptionId - + "/resourceGroups/" - + resourceGroupName - + "/providers/Microsoft.NetworkCloud/clusters/" - + clusterName - + "/continueUpdateVersion" + + "/providers/Microsoft.NetworkCloud/cloudServicesNetworks" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -11096,137 +15058,183 @@ public partial class NetworkCloud // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Post, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); - request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ClustersContinueUpdateVersion_Call(request,onOk,onDefault,eventListener,sender); + await this.CloudServicesNetworksListBySubscription_Call (request, onOk,onDefault,eventListener,sender); } } - /// Actual wire call for method. - /// the prepared HttpRequestMessage to send. - /// a delegate that is called 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 a list of cloud services networks in the provided subscription. + /// /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ClustersContinueUpdateVersion_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task CloudServicesNetworksListBySubscriptionViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { + var apiVersion = @"2025-02-01"; + // 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("^/subscriptions/(?[^/]+)/providers/Microsoft.NetworkCloud/cloudServicesNetworks$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) { - var sendTask = sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // this operation supports x-ms-long-running-operation - var _originalUri = request.RequestUri.AbsoluteUri; - // declared final-state-via: location - var _finalUri = _response.GetFirstHeader(@"Location"); - var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - var location = _response.GetFirstHeader(@"Location"); - while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) - { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.NetworkCloud/cloudServicesNetworks'"); + } - // get the delay before polling. (default to 30 seconds if not present) - int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // 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.NetworkCloud/cloudServicesNetworks" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - // start the delay timer (we'll await later...) - var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - // while we wait, let's grab the headers and get ready to poll. - if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { - asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - } - if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { - location = _response.GetFirstHeader(@"Location"); - } - var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; - request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - // and let's look at the current response body and see if we have some information we can give back to the listener - var content = await _response.Content.ReadAsStringAsync(); - await waiting; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.CloudServicesNetworksListBySubscriptionWithResult_Call (request, eventListener,sender); + } + } - // check for cancellation - if( eventListener.Token.IsCancellationRequested ) { return; } + /// Get a list of cloud services networks in the provided subscription. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task CloudServicesNetworksListBySubscriptionWithResult(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/providers/Microsoft.NetworkCloud/cloudServicesNetworks" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - // drop the old response - _response?.Dispose(); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - // make the polling call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - // if we got back an OK, take a peek inside and see if it's done - if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) - { - var error = false; - try { - if( Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) - { - var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); - if( state is null ) - { - // the body doesn't contain any information that has the state of the LRO - // we're going to just get out, and let the consumer have the result - break; - } - - switch( state?.ToString()?.ToLower() ) - { - case "failed": - error = true; - break; - case "succeeded": - case "canceled": - // we're done polling. - break; - - default: - // need to keep polling! - _response.StatusCode = global::System.Net.HttpStatusCode.Created; - continue; - } - } - } catch { - // if we run into a problem peeking into the result, - // we really don't want to do anything special. - } - if (error) { - throw new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException(_response); - } - } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.CloudServicesNetworksListBySubscriptionWithResult_Call (request, eventListener,sender); + } + } - // check for terminal status code - if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task CloudServicesNetworksListBySubscriptionWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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: { - continue; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.CloudServicesNetworkList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } } - // we are done polling, do a request on final target? - // create a new request with the final uri - request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); - - // drop the old response - _response?.Dispose(); - - // make the final call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - break; } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task CloudServicesNetworksListBySubscription_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -11234,13 +15242,13 @@ public partial class NetworkCloud case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.CloudServicesNetworkList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -11256,37 +15264,30 @@ public partial class NetworkCloud } /// - /// 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 value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of the cluster. - /// The request body. /// an instance that will receive events. /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task ClustersContinueUpdateVersion_Validate(string subscriptionId, string resourceGroupName, string clusterName, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterContinueUpdateVersionParameters body, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task CloudServicesNetworksListBySubscription_Validate(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); - await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); - await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); - await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertNotNull(nameof(clusterName),clusterName); - await eventListener.AssertRegEx(nameof(clusterName),clusterName,@"^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$"); - await eventListener.AssertNotNull(nameof(body), body); - await eventListener.AssertObjectIsValid(nameof(body), body); } } - /// Create a new cluster or update the properties of the cluster if it exists. + /// + /// update properties of the provided cloud services network, or update the tags associated with it. Properties and tag update + /// can be done independently. + /// /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. - /// The name of the cluster. + /// The name of the cloud services network. /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. @@ -11297,10 +15298,11 @@ public partial class NetworkCloud /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ClustersCreateOrUpdate(string subscriptionId, string resourceGroupName, string clusterName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICluster body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task CloudServicesNetworksUpdate(string subscriptionId, string resourceGroupName, string cloudServicesNetworkName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkPatchParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -11312,8 +15314,8 @@ public partial class NetworkCloud + global::System.Uri.EscapeDataString(subscriptionId) + "/resourceGroups/" + global::System.Uri.EscapeDataString(resourceGroupName) - + "/providers/Microsoft.NetworkCloud/clusters/" - + global::System.Uri.EscapeDataString(clusterName) + + "/providers/Microsoft.NetworkCloud/cloudServicesNetworks/" + + global::System.Uri.EscapeDataString(cloudServicesNetworkName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -11322,7 +15324,7 @@ public partial class NetworkCloud // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Put, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Patch, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } // add headers parameters @@ -11337,15 +15339,18 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // 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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ClustersCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + await this.CloudServicesNetworksUpdate_Call (request, onOk,onDefault,eventListener,sender); } } - /// Create a new cluster or update the properties of the cluster if it exists. + /// + /// update properties of the provided cloud services network, or update the tags associated with it. Properties and tag update + /// can be done independently. + /// /// /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. @@ -11357,10 +15362,11 @@ public partial class NetworkCloud /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ClustersCreateOrUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICluster body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task CloudServicesNetworksUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkPatchParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -11368,24 +15374,24 @@ public partial class NetworkCloud { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/clusters/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/cloudServicesNetworks/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/cloudServicesNetworks/{cloudServicesNetworkName}'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var clusterName = _match.Groups["clusterName"].Value; + var cloudServicesNetworkName = _match.Groups["cloudServicesNetworkName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + subscriptionId + "/resourceGroups/" + resourceGroupName - + "/providers/Microsoft.NetworkCloud/clusters/" - + clusterName + + "/providers/Microsoft.NetworkCloud/cloudServicesNetworks/" + + cloudServicesNetworkName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -11394,7 +15400,7 @@ public partial class NetworkCloud // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Put, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Patch, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } // add headers parameters @@ -11409,211 +15415,172 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // 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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ClustersCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + await this.CloudServicesNetworksUpdate_Call (request, onOk,onDefault,eventListener,sender); } } - /// Actual wire call for method. - /// the prepared HttpRequestMessage to send. - /// a delegate that is called 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 properties of the provided cloud services network, or update the tags associated with it. Properties and tag update + /// can be done independently. + /// + /// + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// The request body. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ClustersCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task CloudServicesNetworksUpdateViaIdentityWithResult(global::System.String viaIdentity, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkPatchParameters body, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate) { + var apiVersion = @"2025-02-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.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // this operation supports x-ms-long-running-operation - var _originalUri = request.RequestUri.AbsoluteUri; - // declared final-state-via: azure-async-operation - var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - var location = _response.GetFirstHeader(@"Location"); - while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) - { + // verify that Identity format is an exact match for uri - // get the delay before polling. (default to 30 seconds if not present) - int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/cloudServicesNetworks/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/cloudServicesNetworks/{cloudServicesNetworkName}'"); + } - // start the delay timer (we'll await later...) - var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var cloudServicesNetworkName = _match.Groups["cloudServicesNetworkName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.NetworkCloud/cloudServicesNetworks/" + + cloudServicesNetworkName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - // while we wait, let's grab the headers and get ready to poll. - if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { - asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - } - if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { - location = _response.GetFirstHeader(@"Location"); - } - var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; - request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - // and let's look at the current response body and see if we have some information we can give back to the listener - var content = await _response.Content.ReadAsStringAsync(); - await waiting; + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - // check for cancellation - if( eventListener.Token.IsCancellationRequested ) { return; } + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + if (null != ifNoneMatch) + { + request.Headers.Add("If-None-Match",ifNoneMatch); + } - // drop the old response - _response?.Dispose(); - - // make the polling call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // if we got back an OK, take a peek inside and see if it's done - if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) - { - var error = false; - try { - if( Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) - { - var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); - if( state is null ) - { - // the body doesn't contain any information that has the state of the LRO - // we're going to just get out, and let the consumer have the result - break; - } - - switch( state?.ToString()?.ToLower() ) - { - case "failed": - error = true; - break; - case "succeeded": - case "canceled": - // we're done polling. - break; - - default: - // need to keep polling! - _response.StatusCode = global::System.Net.HttpStatusCode.Created; - continue; - } - } - } catch { - // if we run into a problem peeking into the result, - // we really don't want to do anything special. - } - if (error) { - throw new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException(_response); - } - } - - // check for terminal status code - if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) - { - continue; - } - // we are done polling, do a request on final target? - // create a new request with the final uri - request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); - - // drop the old response - _response?.Dispose(); - - // make the final call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - break; - } - var _contentType = _response.Content.Headers.ContentType?.MediaType; - - switch ( _response.StatusCode ) - { - case global::System.Net.HttpStatusCode.OK: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.Cluster.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally - { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); - } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.CloudServicesNetworksUpdateWithResult_Call (request, eventListener,sender); } } /// - /// Validation method for method. Call this like the actual call, but you will get validation - /// events back. + /// update properties of the provided cloud services network, or update the tags associated with it. Properties and tag update + /// can be done independently. /// /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. - /// The name of the cluster. + /// The name of the cloud services network. /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. /// Other values will result in error from server as they are not supported. - /// The request body. + /// Json string supplied to the CloudServicesNetworksUpdate 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.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task ClustersCreateOrUpdate_Validate(string subscriptionId, string resourceGroupName, string clusterName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICluster body, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) + public async global::System.Threading.Tasks.Task CloudServicesNetworksUpdateViaJsonString(string subscriptionId, string resourceGroupName, string cloudServicesNetworkName, string ifMatch, string ifNoneMatch, 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.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { + var apiVersion = @"2025-02-01"; + // Constant Parameters using( NoSynchronizationContext ) { - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); - await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); - await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); - await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); - await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertNotNull(nameof(clusterName),clusterName); - await eventListener.AssertRegEx(nameof(clusterName),clusterName,@"^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$"); - await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); - await eventListener.AssertNotNull(nameof(ifNoneMatch),ifNoneMatch); - 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.NetworkCloud/cloudServicesNetworks/" + + global::System.Uri.EscapeDataString(cloudServicesNetworkName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + if (null != ifNoneMatch) + { + request.Headers.Add("If-None-Match",ifNoneMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.CloudServicesNetworksUpdate_Call (request, onOk,onDefault,eventListener,sender); } } - /// Delete the provided cluster. + /// + /// update properties of the provided cloud services network, or update the tags associated with it. Properties and tag update + /// can be done independently. + /// /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. - /// The name of the cluster. + /// The name of the cloud services network. /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. /// Other values will result in error from server as they are not supported. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called 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 CloudServicesNetworksUpdate operation /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ClustersDelete(string subscriptionId, string resourceGroupName, string clusterName, string ifMatch, string ifNoneMatch, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task CloudServicesNetworksUpdateViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string cloudServicesNetworkName, string ifMatch, string ifNoneMatch, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -11625,18 +15592,18 @@ public partial class NetworkCloud + global::System.Uri.EscapeDataString(subscriptionId) + "/resourceGroups/" + global::System.Uri.EscapeDataString(resourceGroupName) - + "/providers/Microsoft.NetworkCloud/clusters/" - + global::System.Uri.EscapeDataString(clusterName) + + "/providers/Microsoft.NetworkCloud/cloudServicesNetworks/" + + global::System.Uri.EscapeDataString(cloudServicesNetworkName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Delete, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } // add headers parameters if (null != ifMatch) @@ -11648,63 +15615,59 @@ public partial class NetworkCloud request.Headers.Add("If-None-Match",ifNoneMatch); } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.ClustersDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + return await this.CloudServicesNetworksUpdateWithResult_Call (request, eventListener,sender); } } - /// Delete the provided cluster. - /// + /// + /// update properties of the provided cloud services network, or update the tags associated with it. Properties and tag update + /// can be done independently. + /// + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the cloud services network. /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. /// Other values will result in error from server as they are not supported. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns 204 (NoContent). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). + /// The request body. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ClustersDeleteViaIdentity(global::System.String viaIdentity, string ifMatch, string ifNoneMatch, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task CloudServicesNetworksUpdateWithResult(string subscriptionId, string resourceGroupName, string cloudServicesNetworkName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkPatchParameters body, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2025-02-01"; // Constant Parameters using( NoSynchronizationContext ) { - // verify that Identity format is an exact match for uri - - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/clusters/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); - if (!_match.Success) - { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}'"); - } - - // replace URI parameters with values from identity - var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var clusterName = _match.Groups["clusterName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" - + subscriptionId + + global::System.Uri.EscapeDataString(subscriptionId) + "/resourceGroups/" - + resourceGroupName - + "/providers/Microsoft.NetworkCloud/clusters/" - + clusterName + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.NetworkCloud/cloudServicesNetworks/" + + global::System.Uri.EscapeDataString(cloudServicesNetworkName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Delete, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } // add headers parameters if (null != ifMatch) @@ -11716,49 +15679,48 @@ public partial class NetworkCloud request.Headers.Add("If-None-Match",ifNoneMatch); } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.ClustersDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + return await this.CloudServicesNetworksUpdateWithResult_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). - /// a delegate that is called when the remote service returns 204 (NoContent). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ClustersDelete_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.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task CloudServicesNetworksUpdateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { global::System.Net.Http.HttpResponseMessage _response = null; try { - var sendTask = sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } // this operation supports x-ms-long-running-operation var _originalUri = request.RequestUri.AbsoluteUri; - // declared final-state-via: location - var _finalUri = _response.GetFirstHeader(@"Location"); + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + // declared final-state-via: azure-async-operation var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) { - - // get the delay before polling. (default to 30 seconds if not present) - int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // start the delay timer (we'll await later...) - var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } // while we wait, let's grab the headers and get ready to poll. if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { @@ -11767,62 +15729,61 @@ public partial class NetworkCloud if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { location = _response.GetFirstHeader(@"Location"); } - var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); // and let's look at the current response body and see if we have some information we can give back to the listener var content = await _response.Content.ReadAsStringAsync(); - await waiting; - - // check for cancellation - if( eventListener.Token.IsCancellationRequested ) { return; } // drop the old response _response?.Dispose(); // make the polling call _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // if we got back an OK, take a peek inside and see if it's done - if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) - { - var error = false; - try { - if( Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) - { - var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); - if( state is null ) - { - // the body doesn't contain any information that has the state of the LRO - // we're going to just get out, and let the consumer have the result - break; - } - - switch( state?.ToString()?.ToLower() ) - { - case "failed": - error = true; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result break; - case "succeeded": - case "canceled": - // we're done polling. - break; - - default: - // need to keep polling! - _response.StatusCode = global::System.Net.HttpStatusCode.Created; - continue; - } - } - } catch { - // if we run into a problem peeking into the result, - // we really don't want to do anything special. - } - if (error) { - throw new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException(_response); - } - } + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException(_response); + } + } // check for terminal status code if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) @@ -11831,37 +15792,44 @@ public partial class NetworkCloud } // we are done polling, do a request on final target? // create a new request with the final uri - request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); // drop the old response _response?.Dispose(); // make the final call _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } break; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onNoContent(_response); - break; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.CloudServicesNetwork.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; } default: { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } } } } @@ -11875,146 +15843,7 @@ public partial class NetworkCloud } } - /// - /// Validation method for method. Call this like the actual call, but you will get validation - /// events back. - /// - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of the cluster. - /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify - /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. - /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. - /// Other values will result in error from server as they are not supported. - /// an instance that will receive events. - /// - /// A that will be complete when handling of the response is completed. - /// - internal async global::System.Threading.Tasks.Task ClustersDelete_Validate(string subscriptionId, string resourceGroupName, string clusterName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) - { - using( NoSynchronizationContext ) - { - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); - await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); - await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); - await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); - await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertNotNull(nameof(clusterName),clusterName); - await eventListener.AssertRegEx(nameof(clusterName),clusterName,@"^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$"); - await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); - await eventListener.AssertNotNull(nameof(ifNoneMatch),ifNoneMatch); - } - } - - /// Deploy the cluster using the rack configuration provided during creation. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of the cluster. - /// The request body. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. - /// - /// A that will be complete when handling of the response is completed. - /// - public async global::System.Threading.Tasks.Task ClustersDeploy(string subscriptionId, string resourceGroupName, string clusterName, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterDeployParameters body, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) - { - var apiVersion = @"2025-02-01"; - // Constant Parameters - using( NoSynchronizationContext ) - { - // construct URL - var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/subscriptions/" - + global::System.Uri.EscapeDataString(subscriptionId) - + "/resourceGroups/" - + global::System.Uri.EscapeDataString(resourceGroupName) - + "/providers/Microsoft.NetworkCloud/clusters/" - + global::System.Uri.EscapeDataString(clusterName) - + "/deploy" - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - // generate request object - var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Post, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); - request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.ClustersDeploy_Call(request,onOk,onDefault,eventListener,sender); - } - } - - /// Deploy the cluster using the rack configuration provided during creation. - /// - /// The request body. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. - /// - /// A that will be complete when handling of the response is completed. - /// - public async global::System.Threading.Tasks.Task ClustersDeployViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterDeployParameters body, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) - { - var apiVersion = @"2025-02-01"; - // Constant Parameters - using( NoSynchronizationContext ) - { - // verify that Identity format is an exact match for uri - - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/clusters/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); - if (!_match.Success) - { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/deploy'"); - } - - // replace URI parameters with values from identity - var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var clusterName = _match.Groups["clusterName"].Value; - // construct URL - var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/subscriptions/" - + subscriptionId - + "/resourceGroups/" - + resourceGroupName - + "/providers/Microsoft.NetworkCloud/clusters/" - + clusterName - + "/deploy" - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - // generate request object - var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Post, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); - request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.ClustersDeploy_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 @@ -12024,32 +15853,28 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task ClustersDeploy_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task CloudServicesNetworksUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { global::System.Net.Http.HttpResponseMessage _response = null; try { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; var sendTask = sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // this operation supports x-ms-long-running-operation - var _originalUri = request.RequestUri.AbsoluteUri; - // declared final-state-via: location - var _finalUri = _response.GetFirstHeader(@"Location"); + // declared final-state-via: azure-async-operation var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) { - - // get the delay before polling. (default to 30 seconds if not present) - int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // start the delay timer (we'll await later...) - var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } // while we wait, let's grab the headers and get ready to poll. if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { @@ -12058,15 +15883,14 @@ public partial class NetworkCloud if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { location = _response.GetFirstHeader(@"Location"); } - var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); // and let's look at the current response body and see if we have some information we can give back to the listener var content = await _response.Content.ReadAsStringAsync(); - await waiting; - - // check for cancellation - if( eventListener.Token.IsCancellationRequested ) { return; } // drop the old response _response?.Dispose(); @@ -12075,45 +15899,45 @@ public partial class NetworkCloud _response = await sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // if we got back an OK, take a peek inside and see if it's done - if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) - { - var error = false; - try { - if( Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) - { - var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); - if( state is null ) - { - // the body doesn't contain any information that has the state of the LRO - // we're going to just get out, and let the consumer have the result - break; - } - - switch( state?.ToString()?.ToLower() ) - { - case "failed": - error = true; + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. break; - case "succeeded": - case "canceled": - // we're done polling. - break; - - default: - // need to keep polling! - _response.StatusCode = global::System.Net.HttpStatusCode.Created; - continue; - } - } - } catch { - // if we run into a problem peeking into the result, - // we really don't want to do anything special. - } - if (error) { - throw new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException(_response); - } - } + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException(_response); + } + } // check for terminal status code if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) @@ -12122,7 +15946,7 @@ public partial class NetworkCloud } // we are done polling, do a request on final target? // create a new request with the final uri - request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); // drop the old response _response?.Dispose(); @@ -12132,6 +15956,7 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } break; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -12139,13 +15964,13 @@ public partial class NetworkCloud case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.CloudServicesNetwork.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -12161,18 +15986,22 @@ public partial class NetworkCloud } /// - /// 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 value must be an UUID. /// The name of the resource group. The name is case insensitive. - /// The name of the cluster. + /// The name of the cloud services network. + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. /// The request body. /// an instance that will receive events. /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task ClustersDeploy_Validate(string subscriptionId, string resourceGroupName, string clusterName, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterDeployParameters body, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task CloudServicesNetworksUpdate_Validate(string subscriptionId, string resourceGroupName, string cloudServicesNetworkName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkPatchParameters body, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -12181,26 +16010,36 @@ public partial class NetworkCloud await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertNotNull(nameof(clusterName),clusterName); - await eventListener.AssertRegEx(nameof(clusterName),clusterName,@"^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$"); + await eventListener.AssertNotNull(nameof(cloudServicesNetworkName),cloudServicesNetworkName); + await eventListener.AssertRegEx(nameof(cloudServicesNetworkName), cloudServicesNetworkName, @"^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$"); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(ifNoneMatch),ifNoneMatch); await eventListener.AssertNotNull(nameof(body), body); await eventListener.AssertObjectIsValid(nameof(body), body); } } - /// Get properties of the provided cluster. + /// + /// update a new cluster manager or update properties of the cluster manager if it exists. + /// /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. - /// The name of the cluster. + /// The name of the cluster manager. + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// The request body. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ClustersGet(string subscriptionId, string resourceGroupName, string clusterName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ClusterManagersCreateOrUpdate(string subscriptionId, string resourceGroupName, string clusterManagerName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManager body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -12212,8 +16051,8 @@ public partial class NetworkCloud + global::System.Uri.EscapeDataString(subscriptionId) + "/resourceGroups/" + global::System.Uri.EscapeDataString(resourceGroupName) - + "/providers/Microsoft.NetworkCloud/clusters/" - + global::System.Uri.EscapeDataString(clusterName) + + "/providers/Microsoft.NetworkCloud/clusterManagers/" + + global::System.Uri.EscapeDataString(clusterManagerName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -12222,26 +16061,48 @@ public partial class NetworkCloud // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Put, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + if (null != ifNoneMatch) + { + request.Headers.Add("If-None-Match",ifNoneMatch); + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ClustersGet_Call(request,onOk,onDefault,eventListener,sender); + await this.ClusterManagersCreateOrUpdate_Call (request, onOk,onDefault,eventListener,sender); } } - /// Get properties of the provided cluster. + /// + /// update a new cluster manager or update properties of the cluster manager if it exists. + /// /// + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// The request body. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ClustersGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ClusterManagersCreateOrUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManager body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -12249,24 +16110,24 @@ public partial class NetworkCloud { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/clusters/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/clusterManagers/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusterManagers/{clusterManagerName}'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var clusterName = _match.Groups["clusterName"].Value; + var clusterManagerName = _match.Groups["clusterManagerName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + subscriptionId + "/resourceGroups/" + resourceGroupName - + "/providers/Microsoft.NetworkCloud/clusters/" - + clusterName + + "/providers/Microsoft.NetworkCloud/clusterManagers/" + + clusterManagerName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -12275,132 +16136,113 @@ public partial class NetworkCloud // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Put, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.ClustersGet_Call(request,onOk,onDefault,eventListener,sender); - } - } - - /// Actual wire call for method. - /// the prepared HttpRequestMessage to send. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. - /// - /// A that will be complete when handling of the response is completed. - /// - internal async global::System.Threading.Tasks.Task ClustersGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) - { - using( NoSynchronizationContext ) - { - global::System.Net.Http.HttpResponseMessage _response = null; - try + // add headers parameters + if (null != ifMatch) { - var sendTask = sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - var _contentType = _response.Content.Headers.ContentType?.MediaType; - - switch ( _response.StatusCode ) - { - case global::System.Net.HttpStatusCode.OK: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.Cluster.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } + request.Headers.Add("If-Match",ifMatch); } - finally + if (null != ifNoneMatch) { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); + request.Headers.Add("If-None-Match",ifNoneMatch); } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ClusterManagersCreateOrUpdate_Call (request, onOk,onDefault,eventListener,sender); } } /// - /// Validation method for method. Call this like the actual call, but you will get validation events - /// back. + /// update a new cluster manager or update properties of the cluster manager if it exists. /// - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of the cluster. + /// + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// The request body. /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ClustersGet_Validate(string subscriptionId, string resourceGroupName, string clusterName, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) + public async global::System.Threading.Tasks.Task ClusterManagersCreateOrUpdateViaIdentityWithResult(global::System.String viaIdentity, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManager body, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate) { + var apiVersion = @"2025-02-01"; + // Constant Parameters using( NoSynchronizationContext ) { - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); - await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); - await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); - await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); - await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertNotNull(nameof(clusterName),clusterName); - await eventListener.AssertRegEx(nameof(clusterName),clusterName,@"^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$"); - } - } + // verify that Identity format is an exact match for uri - /// Get a list of clusters in the provided resource group. - /// The ID of the target subscription. The value must be an UUID. - /// 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.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. - /// - /// A that will be complete when handling of the response is completed. - /// - public async global::System.Threading.Tasks.Task ClustersListByResourceGroup(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.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) - { - var apiVersion = @"2025-02-01"; - // Constant Parameters - using( NoSynchronizationContext ) - { + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/clusterManagers/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusterManagers/{clusterManagerName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var clusterManagerName = _match.Groups["clusterManagerName"].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.NetworkCloud/clusters" + + resourceGroupName + + "/providers/Microsoft.NetworkCloud/clusterManagers/" + + clusterManagerName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + if (null != ifNoneMatch) + { + request.Headers.Add("If-None-Match",ifNoneMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.ClustersListByResourceGroup_Call(request,onOk,onDefault,eventListener,sender); + return await this.ClusterManagersCreateOrUpdateWithResult_Call (request, eventListener,sender); } } - /// Get a list of clusters in the provided resource group. - /// + /// + /// update a new cluster manager or update properties of the cluster manager if it exists. + /// + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the cluster manager. + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// Json string supplied to the ClusterManagersCreateOrUpdate 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). @@ -12409,30 +16251,20 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ClustersListByResourceGroupViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ClusterManagersCreateOrUpdateViaJsonString(string subscriptionId, string resourceGroupName, string clusterManagerName, string ifMatch, string ifNoneMatch, 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.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { var apiVersion = @"2025-02-01"; // Constant Parameters using( NoSynchronizationContext ) { - // verify that Identity format is an exact match for uri - - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/clusters$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); - if (!_match.Success) - { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters'"); - } - - // 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 + + global::System.Uri.EscapeDataString(subscriptionId) + "/resourceGroups/" - + resourceGroupName - + "/providers/Microsoft.NetworkCloud/clusters" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.NetworkCloud/clusterManagers/" + + global::System.Uri.EscapeDataString(clusterManagerName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -12441,97 +16273,110 @@ public partial class NetworkCloud // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Put, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + if (null != ifNoneMatch) + { + request.Headers.Add("If-None-Match",ifNoneMatch); + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ClustersListByResourceGroup_Call(request,onOk,onDefault,eventListener,sender); + await this.ClusterManagersCreateOrUpdate_Call (request, onOk,onDefault,eventListener,sender); } } - /// Actual wire call for method. - /// the prepared HttpRequestMessage to send. - /// a delegate that is called 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 cluster manager or update properties of the cluster manager if it exists. + /// + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the cluster manager. + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// Json string supplied to the ClusterManagersCreateOrUpdate operation /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ClustersListByResourceGroup_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ClusterManagersCreateOrUpdateViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string clusterManagerName, string ifMatch, string ifNoneMatch, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { + var apiVersion = @"2025-02-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.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud/clusterManagers/" + + global::System.Uri.EscapeDataString(clusterManagerName) + + "?" + + "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.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ClusterList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); } - finally + if (null != ifNoneMatch) { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); + request.Headers.Add("If-None-Match",ifNoneMatch); } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ClusterManagersCreateOrUpdateWithResult_Call (request, eventListener,sender); } } /// - /// Validation method for method. Call this like the actual call, but you will - /// get validation events back. + /// update a new cluster manager or update properties of the cluster manager if it exists. /// /// The ID of the target subscription. The value must be an UUID. /// 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 ClustersListByResourceGroup_Validate(string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) - { - using( NoSynchronizationContext ) - { - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); - await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); - await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); - await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); - await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - } - } - - /// Get a list of clusters in the provided subscription. - /// The ID of the target subscription. The value must be an UUID. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). + /// The name of the cluster manager. + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// The request body. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ClustersListBySubscription(string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ClusterManagersCreateOrUpdateWithResult(string subscriptionId, string resourceGroupName, string clusterManagerName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManager body, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -12541,73 +16386,196 @@ public partial class NetworkCloud var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + global::System.Uri.EscapeDataString(subscriptionId) - + "/providers/Microsoft.NetworkCloud/clusters" + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.NetworkCloud/clusterManagers/" + + global::System.Uri.EscapeDataString(clusterManagerName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + if (null != ifNoneMatch) + { + request.Headers.Add("If-None-Match",ifNoneMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.ClustersListBySubscription_Call(request,onOk,onDefault,eventListener,sender); + return await this.ClusterManagersCreateOrUpdateWithResult_Call (request, eventListener,sender); } } - /// Get a list of clusters in the provided 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). + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ClustersListBySubscriptionViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task ClusterManagersCreateOrUpdateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { - var apiVersion = @"2025-02-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.NetworkCloud/clusters$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); - if (!_match.Success) + global::System.Net.Http.HttpResponseMessage _response = null; + try { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.NetworkCloud/clusters'"); - } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + // declared final-state-via: azure-async-operation + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - // 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.NetworkCloud/clusters" - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); - // generate request object - var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + // drop the old response + _response?.Dispose(); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.ClustersListBySubscription_Call(request,onOk,onDefault,eventListener,sender); + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + break; + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterManager.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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 @@ -12617,17 +16585,110 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task ClustersListBySubscription_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task ClusterManagersCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { global::System.Net.Http.HttpResponseMessage _response = null; try { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; var sendTask = sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // declared final-state-via: azure-async-operation + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -12635,13 +16696,13 @@ public partial class NetworkCloud case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ClusterList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterManager.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -12657,32 +16718,49 @@ public partial class NetworkCloud } /// - /// 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 value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the cluster manager. + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// The request body. /// an instance that will receive events. /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task ClustersListBySubscription_Validate(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task ClusterManagersCreateOrUpdate_Validate(string subscriptionId, string resourceGroupName, string clusterManagerName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManager body, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(clusterManagerName),clusterManagerName); + await eventListener.AssertRegEx(nameof(clusterManagerName), clusterManagerName, @"^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$"); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(ifNoneMatch),ifNoneMatch); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); } } - /// - /// Triggers the execution of a runtime protection scan to detect and remediate detected issues, in accordance with the cluster - /// configuration. - /// + /// Delete the provided cluster manager. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. - /// The name of the cluster. - /// The request body. + /// The name of the cluster manager. + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. @@ -12690,7 +16768,7 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ClustersScanRuntime(string subscriptionId, string resourceGroupName, string clusterName, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterScanRuntimeParameters body, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ClusterManagersDelete(string subscriptionId, string resourceGroupName, string clusterManagerName, string ifMatch, string ifNoneMatch, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -12702,9 +16780,8 @@ public partial class NetworkCloud + global::System.Uri.EscapeDataString(subscriptionId) + "/resourceGroups/" + global::System.Uri.EscapeDataString(resourceGroupName) - + "/providers/Microsoft.NetworkCloud/clusters/" - + global::System.Uri.EscapeDataString(clusterName) - + "/scanRuntime" + + "/providers/Microsoft.NetworkCloud/clusterManagers/" + + global::System.Uri.EscapeDataString(clusterManagerName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -12713,26 +16790,33 @@ public partial class NetworkCloud // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Post, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Delete, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + if (null != ifNoneMatch) + { + request.Headers.Add("If-None-Match",ifNoneMatch); + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); - request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ClustersScanRuntime_Call(request,onOk,onDefault,eventListener,sender); + await this.ClusterManagersDelete_Call (request, onOk,onNoContent,onDefault,eventListener,sender); } } - /// - /// Triggers the execution of a runtime protection scan to detect and remediate detected issues, in accordance with the cluster - /// configuration. - /// + /// Delete the provided cluster manager. /// - /// The request body. + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. @@ -12740,7 +16824,7 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ClustersScanRuntimeViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterScanRuntimeParameters body, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ClusterManagersDeleteViaIdentity(global::System.String viaIdentity, string ifMatch, string ifNoneMatch, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -12748,25 +16832,24 @@ public partial class NetworkCloud { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/clusters/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/clusterManagers/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/scanRuntime'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusterManagers/{clusterManagerName}'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var clusterName = _match.Groups["clusterName"].Value; + var clusterManagerName = _match.Groups["clusterManagerName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + subscriptionId + "/resourceGroups/" + resourceGroupName - + "/providers/Microsoft.NetworkCloud/clusters/" - + clusterName - + "/scanRuntime" + + "/providers/Microsoft.NetworkCloud/clusterManagers/" + + clusterManagerName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -12775,22 +16858,29 @@ public partial class NetworkCloud // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Post, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Delete, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + if (null != ifNoneMatch) + { + request.Headers.Add("If-None-Match",ifNoneMatch); + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); - request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ClustersScanRuntime_Call(request,onOk,onDefault,eventListener,sender); + await this.ClusterManagersDelete_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. @@ -12798,32 +16888,29 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task ClustersScanRuntime_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task ClusterManagersDelete_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.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { global::System.Net.Http.HttpResponseMessage _response = null; try { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; var sendTask = sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // this operation supports x-ms-long-running-operation - var _originalUri = request.RequestUri.AbsoluteUri; // declared final-state-via: location var _finalUri = _response.GetFirstHeader(@"Location"); var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) { - - // get the delay before polling. (default to 30 seconds if not present) - int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // start the delay timer (we'll await later...) - var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } // while we wait, let's grab the headers and get ready to poll. if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { @@ -12832,15 +16919,14 @@ public partial class NetworkCloud if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { location = _response.GetFirstHeader(@"Location"); } - var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); // and let's look at the current response body and see if we have some information we can give back to the listener var content = await _response.Content.ReadAsStringAsync(); - await waiting; - - // check for cancellation - if( eventListener.Token.IsCancellationRequested ) { return; } // drop the old response _response?.Dispose(); @@ -12849,45 +16935,45 @@ public partial class NetworkCloud _response = await sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // if we got back an OK, take a peek inside and see if it's done - if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) - { - var error = false; - try { - if( Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) - { - var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); - if( state is null ) - { - // the body doesn't contain any information that has the state of the LRO - // we're going to just get out, and let the consumer have the result - break; - } - - switch( state?.ToString()?.ToLower() ) - { - case "failed": - error = true; + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. break; - case "succeeded": - case "canceled": - // we're done polling. - break; - - default: - // need to keep polling! - _response.StatusCode = global::System.Net.HttpStatusCode.Created; - continue; - } - } - } catch { - // if we run into a problem peeking into the result, - // we really don't want to do anything special. - } - if (error) { - throw new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException(_response); - } - } + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException(_response); + } + } // check for terminal status code if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) @@ -12906,6 +16992,7 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } break; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -12916,10 +17003,16 @@ public partial class NetworkCloud await onOk(_response); break; } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -12935,18 +17028,21 @@ public partial class NetworkCloud } /// - /// 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 value must be an UUID. /// The name of the resource group. The name is case insensitive. - /// The name of the cluster. - /// The request body. + /// The name of the cluster manager. + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. /// an instance that will receive events. /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task ClustersScanRuntime_Validate(string subscriptionId, string resourceGroupName, string clusterName, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterScanRuntimeParameters body, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task ClusterManagersDelete_Validate(string subscriptionId, string resourceGroupName, string clusterManagerName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -12955,25 +17051,17 @@ public partial class NetworkCloud await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertNotNull(nameof(clusterName),clusterName); - await eventListener.AssertRegEx(nameof(clusterName),clusterName,@"^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$"); - await eventListener.AssertNotNull(nameof(body), body); - await eventListener.AssertObjectIsValid(nameof(body), body); + await eventListener.AssertNotNull(nameof(clusterManagerName),clusterManagerName); + await eventListener.AssertRegEx(nameof(clusterManagerName), clusterManagerName, @"^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$"); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(ifNoneMatch),ifNoneMatch); } } - /// - /// Patch the properties of the provided cluster, or update the tags associated with the cluster. Properties and tag updates - /// can be done independently. - /// + /// Get the properties of the provided cluster manager. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. - /// The name of the cluster. - /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify - /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. - /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. - /// Other values will result in error from server as they are not supported. - /// The request body. + /// The name of the cluster manager. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). @@ -12982,7 +17070,7 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ClustersUpdate(string subscriptionId, string resourceGroupName, string clusterName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ClusterManagersGet(string subscriptionId, string resourceGroupName, string clusterManagerName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -12994,8 +17082,8 @@ public partial class NetworkCloud + global::System.Uri.EscapeDataString(subscriptionId) + "/resourceGroups/" + global::System.Uri.EscapeDataString(resourceGroupName) - + "/providers/Microsoft.NetworkCloud/clusters/" - + global::System.Uri.EscapeDataString(clusterName) + + "/providers/Microsoft.NetworkCloud/clusterManagers/" + + global::System.Uri.EscapeDataString(clusterManagerName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -13004,36 +17092,17 @@ public partial class NetworkCloud // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Patch, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - // add headers parameters - if (null != ifMatch) - { - request.Headers.Add("If-Match",ifMatch); - } - if (null != ifNoneMatch) - { - request.Headers.Add("If-None-Match",ifNoneMatch); - } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); - request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ClustersUpdate_Call(request,onOk,onDefault,eventListener,sender); + await this.ClusterManagersGet_Call (request, onOk,onDefault,eventListener,sender); } } - /// - /// Update the version of the provided cluster to one of the available supported versions. - /// - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of the cluster. - /// The request body. + /// Get the properties of the provided cluster manager. + /// /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). @@ -13042,21 +17111,32 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ClustersUpdateVersion(string subscriptionId, string resourceGroupName, string clusterName, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterUpdateVersionParameters body, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ClusterManagersGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { var apiVersion = @"2025-02-01"; // Constant Parameters using( NoSynchronizationContext ) { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/clusterManagers/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusterManagers/{clusterManagerName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var clusterManagerName = _match.Groups["clusterManagerName"].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.NetworkCloud/clusters/" - + global::System.Uri.EscapeDataString(clusterName) - + "/updateVersion" + + resourceGroupName + + "/providers/Microsoft.NetworkCloud/clusterManagers/" + + clusterManagerName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -13065,33 +17145,24 @@ public partial class NetworkCloud // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Post, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); - request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ClustersUpdateVersion_Call(request,onOk,onDefault,eventListener,sender); + await this.ClusterManagersGet_Call (request, onOk,onDefault,eventListener,sender); } } - /// - /// Update the version of the provided cluster to one of the available supported versions. - /// + /// Get the properties of the provided cluster manager. /// - /// The request body. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ClustersUpdateVersionViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterUpdateVersionParameters body, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ClusterManagersGetViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -13099,57 +17170,91 @@ public partial class NetworkCloud { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/clusters/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/clusterManagers/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/updateVersion'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusterManagers/{clusterManagerName}'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var clusterName = _match.Groups["clusterName"].Value; + var clusterManagerName = _match.Groups["clusterManagerName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + subscriptionId + "/resourceGroups/" + resourceGroupName - + "/providers/Microsoft.NetworkCloud/clusters/" - + clusterName - + "/updateVersion" + + "/providers/Microsoft.NetworkCloud/clusterManagers/" + + clusterManagerName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Post, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); - request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.ClustersUpdateVersion_Call(request,onOk,onDefault,eventListener,sender); + return await this.ClusterManagersGetWithResult_Call (request, eventListener,sender); } } - /// Actual wire call for method. + /// Get the properties of the provided cluster manager. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the cluster manager. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ClusterManagersGetWithResult(string subscriptionId, string resourceGroupName, string clusterManagerName, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.NetworkCloud/clusterManagers/" + + global::System.Uri.EscapeDataString(clusterManagerName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ClusterManagersGetWithResult_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.NetworkCloud.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 ClustersUpdateVersion_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task ClusterManagersGetWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -13157,106 +17262,72 @@ public partial class NetworkCloud try { var sendTask = sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // this operation supports x-ms-long-running-operation - var _originalUri = request.RequestUri.AbsoluteUri; - // declared final-state-via: location - var _finalUri = _response.GetFirstHeader(@"Location"); - var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - var location = _response.GetFirstHeader(@"Location"); - while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) - { - - // get the delay before polling. (default to 30 seconds if not present) - int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // start the delay timer (we'll await later...) - var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; - // while we wait, let's grab the headers and get ready to poll. - if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { - asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - } - if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { - location = _response.GetFirstHeader(@"Location"); + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterManager.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; } - var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; - request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); - - // and let's look at the current response body and see if we have some information we can give back to the listener - var content = await _response.Content.ReadAsStringAsync(); - await waiting; - - // check for cancellation - if( eventListener.Token.IsCancellationRequested ) { return; } - - // drop the old response - _response?.Dispose(); - - // make the polling call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // if we got back an OK, take a peek inside and see if it's done - if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) - { - var error = false; - try { - if( Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) - { - var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); - if( state is null ) - { - // the body doesn't contain any information that has the state of the LRO - // we're going to just get out, and let the consumer have the result - break; - } - - switch( state?.ToString()?.ToLower() ) - { - case "failed": - error = true; - break; - case "succeeded": - case "canceled": - // we're done polling. - break; - - default: - // need to keep polling! - _response.StatusCode = global::System.Net.HttpStatusCode.Created; - continue; - } - } - } catch { - // if we run into a problem peeking into the result, - // we really don't want to do anything special. + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.RestException(_response, await _result); + throw ex; } - if (error) { - throw new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException(_response); + else + { + throw new global::System.Exception($"[{code}] : {message}"); } } - - // check for terminal status code - if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) - { - continue; - } - // we are done polling, do a request on final target? - // create a new request with the final uri - request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); - - // drop the old response - _response?.Dispose(); - - // make the final call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - break; } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ClusterManagersGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -13264,13 +17335,13 @@ public partial class NetworkCloud case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterManager.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -13286,18 +17357,17 @@ public partial class NetworkCloud } /// - /// 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 value must be an UUID. /// The name of the resource group. The name is case insensitive. - /// The name of the cluster. - /// The request body. + /// The name of the cluster manager. /// an instance that will receive events. /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task ClustersUpdateVersion_Validate(string subscriptionId, string resourceGroupName, string clusterName, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterUpdateVersionParameters body, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task ClusterManagersGet_Validate(string subscriptionId, string resourceGroupName, string clusterManagerName, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -13306,23 +17376,54 @@ public partial class NetworkCloud await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertNotNull(nameof(clusterName),clusterName); - await eventListener.AssertRegEx(nameof(clusterName),clusterName,@"^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$"); - await eventListener.AssertNotNull(nameof(body), body); - await eventListener.AssertObjectIsValid(nameof(body), body); + await eventListener.AssertNotNull(nameof(clusterManagerName),clusterManagerName); + await eventListener.AssertRegEx(nameof(clusterManagerName), clusterManagerName, @"^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$"); } } - /// - /// Patch the properties of the provided cluster, or update the tags associated with the cluster. Properties and tag updates - /// can be done independently. - /// + /// Get a list of cluster managers in the provided resource group. + /// The ID of the target subscription. The value must be an UUID. + /// 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.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ClusterManagersListByResourceGroup(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.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.NetworkCloud/clusterManagers" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ClusterManagersListByResourceGroup_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Get a list of cluster managers in the provided resource group. /// - /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify - /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. - /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. - /// Other values will result in error from server as they are not supported. - /// The request body. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). @@ -13331,7 +17432,7 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ClustersUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ClusterManagersListByResourceGroupViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -13339,24 +17440,22 @@ public partial class NetworkCloud { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/clusters/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/clusterManagers$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusterManagers'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var clusterName = _match.Groups["clusterName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + subscriptionId + "/resourceGroups/" + resourceGroupName - + "/providers/Microsoft.NetworkCloud/clusters/" - + clusterName + + "/providers/Microsoft.NetworkCloud/clusterManagers" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -13365,40 +17464,114 @@ public partial class NetworkCloud // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Patch, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - // add headers parameters - if (null != ifMatch) - { - request.Headers.Add("If-Match",ifMatch); - } - if (null != ifNoneMatch) + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ClusterManagersListByResourceGroup_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Get a list of cluster managers in the provided resource group. + /// + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ClusterManagersListByResourceGroupViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/clusterManagers$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) { - request.Headers.Add("If-None-Match",ifNoneMatch); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusterManagers'"); } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); - request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // 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.NetworkCloud/clusterManagers" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ClusterManagersListByResourceGroupWithResult_Call (request, eventListener,sender); + } + } + + /// Get a list of cluster managers in the provided resource group. + /// The ID of the target subscription. The value must be an UUID. + /// 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.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ClusterManagersListByResourceGroupWithResult(string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.NetworkCloud/clusterManagers" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.ClustersUpdate_Call(request,onOk,onDefault,eventListener,sender); + return await this.ClusterManagersListByResourceGroupWithResult_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). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ClustersUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task ClusterManagersListByResourceGroupWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -13406,105 +17579,72 @@ public partial class NetworkCloud try { var sendTask = sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // this operation supports x-ms-long-running-operation - var _originalUri = request.RequestUri.AbsoluteUri; - // declared final-state-via: azure-async-operation - var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - var location = _response.GetFirstHeader(@"Location"); - while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) - { - - // get the delay before polling. (default to 30 seconds if not present) - int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // start the delay timer (we'll await later...) - var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; - // while we wait, let's grab the headers and get ready to poll. - if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { - asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - } - if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { - location = _response.GetFirstHeader(@"Location"); + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterManagerList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; } - var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; - request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); - - // and let's look at the current response body and see if we have some information we can give back to the listener - var content = await _response.Content.ReadAsStringAsync(); - await waiting; - - // check for cancellation - if( eventListener.Token.IsCancellationRequested ) { return; } - - // drop the old response - _response?.Dispose(); - - // make the polling call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // if we got back an OK, take a peek inside and see if it's done - if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) - { - var error = false; - try { - if( Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) - { - var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); - if( state is null ) - { - // the body doesn't contain any information that has the state of the LRO - // we're going to just get out, and let the consumer have the result - break; - } - - switch( state?.ToString()?.ToLower() ) - { - case "failed": - error = true; - break; - case "succeeded": - case "canceled": - // we're done polling. - break; - - default: - // need to keep polling! - _response.StatusCode = global::System.Net.HttpStatusCode.Created; - continue; - } - } - } catch { - // if we run into a problem peeking into the result, - // we really don't want to do anything special. + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.RestException(_response, await _result); + throw ex; } - if (error) { - throw new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException(_response); + else + { + throw new global::System.Exception($"[{code}] : {message}"); } } - - // check for terminal status code - if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) - { - continue; - } - // we are done polling, do a request on final target? - // create a new request with the final uri - request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); - - // drop the old response - _response?.Dispose(); - - // make the final call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - break; } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ClusterManagersListByResourceGroup_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -13512,13 +17652,13 @@ public partial class NetworkCloud case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.Cluster.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterManagerList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -13534,22 +17674,16 @@ public partial class NetworkCloud } /// - /// 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 value must be an UUID. /// The name of the resource group. The name is case insensitive. - /// The name of the cluster. - /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify - /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. - /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. - /// Other values will result in error from server as they are not supported. - /// The request body. /// an instance that will receive events. /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task ClustersUpdate_Validate(string subscriptionId, string resourceGroupName, string clusterName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParameters body, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task ClusterManagersListByResourceGroup_Validate(string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -13558,27 +17692,11 @@ public partial class NetworkCloud await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertNotNull(nameof(clusterName),clusterName); - await eventListener.AssertRegEx(nameof(clusterName),clusterName,@"^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$"); - await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); - await eventListener.AssertNotNull(nameof(ifNoneMatch),ifNoneMatch); - await eventListener.AssertNotNull(nameof(body), body); - await eventListener.AssertObjectIsValid(nameof(body), body); } } - /// - /// Create a new virtual machine console or update the properties of the existing virtual machine console. - /// + /// Get a list of cluster managers in the provided subscription. /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of the virtual machine. - /// The name of the virtual machine console. - /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify - /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. - /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. - /// Other values will result in error from server as they are not supported. - /// The request body. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). @@ -13587,7 +17705,7 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ConsolesCreateOrUpdate(string subscriptionId, string resourceGroupName, string virtualMachineName, string consoleName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsole body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ClusterManagersListBySubscription(string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -13597,12 +17715,7 @@ public partial class NetworkCloud var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + global::System.Uri.EscapeDataString(subscriptionId) - + "/resourceGroups/" - + global::System.Uri.EscapeDataString(resourceGroupName) - + "/providers/Microsoft.NetworkCloud/virtualMachines/" - + global::System.Uri.EscapeDataString(virtualMachineName) - + "/consoles/" - + global::System.Uri.EscapeDataString(consoleName) + + "/providers/Microsoft.NetworkCloud/clusterManagers" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -13611,38 +17724,17 @@ public partial class NetworkCloud // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Put, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - // add headers parameters - if (null != ifMatch) - { - request.Headers.Add("If-Match",ifMatch); - } - if (null != ifNoneMatch) - { - request.Headers.Add("If-None-Match",ifNoneMatch); - } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); - request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ConsolesCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + await this.ClusterManagersListBySubscription_Call (request, onOk,onDefault,eventListener,sender); } } - /// - /// Create a new virtual machine console or update the properties of the existing virtual machine console. - /// + /// Get a list of cluster managers in the provided subscription. /// - /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify - /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. - /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. - /// Other values will result in error from server as they are not supported. - /// The request body. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). @@ -13651,7 +17743,7 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ConsolesCreateOrUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsole body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task ClusterManagersListBySubscriptionViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -13659,27 +17751,19 @@ public partial class NetworkCloud { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/virtualMachines/(?[^/]+)/consoles/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/providers/Microsoft.NetworkCloud/clusterManagers$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/virtualMachines/{virtualMachineName}/consoles/{consoleName}'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.NetworkCloud/clusterManagers'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var virtualMachineName = _match.Groups["virtualMachineName"].Value; - var consoleName = _match.Groups["consoleName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + subscriptionId - + "/resourceGroups/" - + resourceGroupName - + "/providers/Microsoft.NetworkCloud/virtualMachines/" - + virtualMachineName - + "/consoles/" - + consoleName + + "/providers/Microsoft.NetworkCloud/clusterManagers" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -13688,30 +17772,17236 @@ public partial class NetworkCloud // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Put, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - // add headers parameters - if (null != ifMatch) - { - request.Headers.Add("If-Match",ifMatch); - } - if (null != ifNoneMatch) - { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ClusterManagersListBySubscription_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Get a list of cluster managers in the provided subscription. + /// + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ClusterManagersListBySubscriptionViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-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.NetworkCloud/clusterManagers$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.NetworkCloud/clusterManagers'"); + } + + // 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.NetworkCloud/clusterManagers" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ClusterManagersListBySubscriptionWithResult_Call (request, eventListener,sender); + } + } + + /// Get a list of cluster managers in the provided subscription. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ClusterManagersListBySubscriptionWithResult(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/providers/Microsoft.NetworkCloud/clusterManagers" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ClusterManagersListBySubscriptionWithResult_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.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ClusterManagersListBySubscriptionWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterManagerList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ClusterManagersListBySubscription_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterManagerList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you + /// will get validation events back. + /// + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ClusterManagersListBySubscription_Validate(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// + /// Patch properties of the provided cluster manager, or update the tags assigned to the cluster manager. Properties and tag + /// updates can be done independently. + /// + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the cluster manager. + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// The request body. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ClusterManagersUpdate(string subscriptionId, string resourceGroupName, string clusterManagerName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerPatchParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.NetworkCloud/clusterManagers/" + + global::System.Uri.EscapeDataString(clusterManagerName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + if (null != ifNoneMatch) + { + request.Headers.Add("If-None-Match",ifNoneMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ClusterManagersUpdate_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// + /// Patch properties of the provided cluster manager, or update the tags assigned to the cluster manager. Properties and tag + /// updates can be done independently. + /// + /// + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// The request body. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ClusterManagersUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerPatchParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/clusterManagers/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusterManagers/{clusterManagerName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var clusterManagerName = _match.Groups["clusterManagerName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.NetworkCloud/clusterManagers/" + + clusterManagerName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + if (null != ifNoneMatch) + { + request.Headers.Add("If-None-Match",ifNoneMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ClusterManagersUpdate_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// + /// Patch properties of the provided cluster manager, or update the tags assigned to the cluster manager. Properties and tag + /// updates can be done independently. + /// + /// + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// The request body. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ClusterManagersUpdateViaIdentityWithResult(global::System.String viaIdentity, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerPatchParameters body, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/clusterManagers/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusterManagers/{clusterManagerName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var clusterManagerName = _match.Groups["clusterManagerName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.NetworkCloud/clusterManagers/" + + clusterManagerName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + if (null != ifNoneMatch) + { + request.Headers.Add("If-None-Match",ifNoneMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ClusterManagersUpdateWithResult_Call (request, eventListener,sender); + } + } + + /// + /// Patch properties of the provided cluster manager, or update the tags assigned to the cluster manager. Properties and tag + /// updates can be done independently. + /// + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the cluster manager. + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// Json string supplied to the ClusterManagersUpdate 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.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ClusterManagersUpdateViaJsonString(string subscriptionId, string resourceGroupName, string clusterManagerName, string ifMatch, string ifNoneMatch, 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.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.NetworkCloud/clusterManagers/" + + global::System.Uri.EscapeDataString(clusterManagerName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + if (null != ifNoneMatch) + { + request.Headers.Add("If-None-Match",ifNoneMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ClusterManagersUpdate_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// + /// Patch properties of the provided cluster manager, or update the tags assigned to the cluster manager. Properties and tag + /// updates can be done independently. + /// + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the cluster manager. + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// Json string supplied to the ClusterManagersUpdate operation + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ClusterManagersUpdateViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string clusterManagerName, string ifMatch, string ifNoneMatch, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.NetworkCloud/clusterManagers/" + + global::System.Uri.EscapeDataString(clusterManagerName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + if (null != ifNoneMatch) + { request.Headers.Add("If-None-Match",ifNoneMatch); } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); - request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.ConsolesCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ClusterManagersUpdateWithResult_Call (request, eventListener,sender); + } + } + + /// + /// Patch properties of the provided cluster manager, or update the tags assigned to the cluster manager. Properties and tag + /// updates can be done independently. + /// + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the cluster manager. + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// The request body. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ClusterManagersUpdateWithResult(string subscriptionId, string resourceGroupName, string clusterManagerName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerPatchParameters body, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.NetworkCloud/clusterManagers/" + + global::System.Uri.EscapeDataString(clusterManagerName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + if (null != ifNoneMatch) + { + request.Headers.Add("If-None-Match",ifNoneMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ClusterManagersUpdateWithResult_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.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ClusterManagersUpdateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterManager.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ClusterManagersUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterManager.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the cluster manager. + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// The request body. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ClusterManagersUpdate_Validate(string subscriptionId, string resourceGroupName, string clusterManagerName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerPatchParameters body, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(clusterManagerName),clusterManagerName); + await eventListener.AssertRegEx(nameof(clusterManagerName), clusterManagerName, @"^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$"); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(ifNoneMatch),ifNoneMatch); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// + /// Trigger the continuation of an continue for a cluster with a matching continue strategy that has paused after completing + /// a segment of the continue + /// + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the cluster. + /// The request body. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ClustersContinueUpdateVersion(string subscriptionId, string resourceGroupName, string clusterName, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterContinueUpdateVersionParameters body, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.NetworkCloud/clusters/" + + global::System.Uri.EscapeDataString(clusterName) + + "/continueUpdateVersion" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ClustersContinueUpdateVersion_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// + /// Trigger the continuation of an continue for a cluster with a matching continue strategy that has paused after completing + /// a segment of the continue + /// + /// + /// The request body. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ClustersContinueUpdateVersionViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterContinueUpdateVersionParameters body, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/clusters/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var clusterName = _match.Groups["clusterName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.NetworkCloud/clusters/" + + clusterName + + "/continueUpdateVersion" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ClustersContinueUpdateVersion_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// + /// Trigger the continuation of an continue for a cluster with a matching continue strategy that has paused after completing + /// a segment of the continue + /// + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the cluster. + /// Json string supplied to the ClustersContinueUpdateVersion 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.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ClustersContinueUpdateVersionViaJsonString(string subscriptionId, string resourceGroupName, string clusterName, global::System.String jsonString, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.NetworkCloud/clusters/" + + global::System.Uri.EscapeDataString(clusterName) + + "/continueUpdateVersion" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ClustersContinueUpdateVersion_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ClustersContinueUpdateVersion_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // declared final-state-via: location + var _finalUri = _response.GetFirstHeader(@"Location"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the cluster. + /// The request body. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ClustersContinueUpdateVersion_Validate(string subscriptionId, string resourceGroupName, string clusterName, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterContinueUpdateVersionParameters body, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(clusterName),clusterName); + await eventListener.AssertRegEx(nameof(clusterName), clusterName, @"^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// update a new cluster or update the properties of the cluster if it exists. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the cluster. + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// The request body. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ClustersCreateOrUpdate(string subscriptionId, string resourceGroupName, string clusterName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICluster body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.NetworkCloud/clusters/" + + global::System.Uri.EscapeDataString(clusterName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + if (null != ifNoneMatch) + { + request.Headers.Add("If-None-Match",ifNoneMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ClustersCreateOrUpdate_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// update a new cluster or update the properties of the cluster if it exists. + /// + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// The request body. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ClustersCreateOrUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICluster body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/clusters/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var clusterName = _match.Groups["clusterName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.NetworkCloud/clusters/" + + clusterName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + if (null != ifNoneMatch) + { + request.Headers.Add("If-None-Match",ifNoneMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ClustersCreateOrUpdate_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// update a new cluster or update the properties of the cluster if it exists. + /// + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// The request body. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ClustersCreateOrUpdateViaIdentityWithResult(global::System.String viaIdentity, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICluster body, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/clusters/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var clusterName = _match.Groups["clusterName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.NetworkCloud/clusters/" + + clusterName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + if (null != ifNoneMatch) + { + request.Headers.Add("If-None-Match",ifNoneMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ClustersCreateOrUpdateWithResult_Call (request, eventListener,sender); + } + } + + /// update a new cluster or update the properties of the cluster if it exists. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the cluster. + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// Json string supplied to the ClustersCreateOrUpdate 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.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ClustersCreateOrUpdateViaJsonString(string subscriptionId, string resourceGroupName, string clusterName, string ifMatch, string ifNoneMatch, 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.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.NetworkCloud/clusters/" + + global::System.Uri.EscapeDataString(clusterName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + if (null != ifNoneMatch) + { + request.Headers.Add("If-None-Match",ifNoneMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ClustersCreateOrUpdate_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// update a new cluster or update the properties of the cluster if it exists. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the cluster. + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// Json string supplied to the ClustersCreateOrUpdate operation + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A + /// that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ClustersCreateOrUpdateViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string clusterName, string ifMatch, string ifNoneMatch, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.NetworkCloud/clusters/" + + global::System.Uri.EscapeDataString(clusterName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + if (null != ifNoneMatch) + { + request.Headers.Add("If-None-Match",ifNoneMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ClustersCreateOrUpdateWithResult_Call (request, eventListener,sender); + } + } + + /// update a new cluster or update the properties of the cluster if it exists. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the cluster. + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// The request body. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ClustersCreateOrUpdateWithResult(string subscriptionId, string resourceGroupName, string clusterName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICluster body, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.NetworkCloud/clusters/" + + global::System.Uri.EscapeDataString(clusterName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + if (null != ifNoneMatch) + { + request.Headers.Add("If-None-Match",ifNoneMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ClustersCreateOrUpdateWithResult_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.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A + /// that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ClustersCreateOrUpdateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + // declared final-state-via: azure-async-operation + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + break; + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Cluster.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ClustersCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // declared final-state-via: azure-async-operation + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Cluster.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the cluster. + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// The request body. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ClustersCreateOrUpdate_Validate(string subscriptionId, string resourceGroupName, string clusterName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICluster body, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(clusterName),clusterName); + await eventListener.AssertRegEx(nameof(clusterName), clusterName, @"^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$"); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(ifNoneMatch),ifNoneMatch); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Delete the provided cluster. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the cluster. + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ClustersDelete(string subscriptionId, string resourceGroupName, string clusterName, string ifMatch, string ifNoneMatch, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.NetworkCloud/clusters/" + + global::System.Uri.EscapeDataString(clusterName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + if (null != ifNoneMatch) + { + request.Headers.Add("If-None-Match",ifNoneMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ClustersDelete_Call (request, onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Delete the provided cluster. + /// + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ClustersDeleteViaIdentity(global::System.String viaIdentity, string ifMatch, string ifNoneMatch, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/clusters/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var clusterName = _match.Groups["clusterName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.NetworkCloud/clusters/" + + clusterName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + if (null != ifNoneMatch) + { + request.Headers.Add("If-None-Match",ifNoneMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ClustersDelete_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.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ClustersDelete_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.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // declared final-state-via: location + var _finalUri = _response.GetFirstHeader(@"Location"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the cluster. + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ClustersDelete_Validate(string subscriptionId, string resourceGroupName, string clusterName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(clusterName),clusterName); + await eventListener.AssertRegEx(nameof(clusterName), clusterName, @"^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$"); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(ifNoneMatch),ifNoneMatch); + } + } + + /// Deploy the cluster using the rack configuration provided during creation. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the cluster. + /// The request body. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ClustersDeploy(string subscriptionId, string resourceGroupName, string clusterName, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterDeployParameters body, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.NetworkCloud/clusters/" + + global::System.Uri.EscapeDataString(clusterName) + + "/deploy" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ClustersDeploy_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Deploy the cluster using the rack configuration provided during creation. + /// + /// The request body. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ClustersDeployViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterDeployParameters body, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/clusters/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var clusterName = _match.Groups["clusterName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.NetworkCloud/clusters/" + + clusterName + + "/deploy" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ClustersDeploy_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Deploy the cluster using the rack configuration provided during creation. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the cluster. + /// Json string supplied to the ClustersDeploy 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.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ClustersDeployViaJsonString(string subscriptionId, string resourceGroupName, string clusterName, global::System.String jsonString, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.NetworkCloud/clusters/" + + global::System.Uri.EscapeDataString(clusterName) + + "/deploy" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ClustersDeploy_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ClustersDeploy_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // declared final-state-via: location + var _finalUri = _response.GetFirstHeader(@"Location"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the cluster. + /// The request body. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ClustersDeploy_Validate(string subscriptionId, string resourceGroupName, string clusterName, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterDeployParameters body, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(clusterName),clusterName); + await eventListener.AssertRegEx(nameof(clusterName), clusterName, @"^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Get properties of the provided cluster. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the cluster. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ClustersGet(string subscriptionId, string resourceGroupName, string clusterName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.NetworkCloud/clusters/" + + global::System.Uri.EscapeDataString(clusterName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ClustersGet_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Get properties of the provided cluster. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ClustersGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/clusters/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var clusterName = _match.Groups["clusterName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.NetworkCloud/clusters/" + + clusterName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ClustersGet_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Get properties of the provided cluster. + /// + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A + /// that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ClustersGetViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/clusters/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var clusterName = _match.Groups["clusterName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.NetworkCloud/clusters/" + + clusterName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ClustersGetWithResult_Call (request, eventListener,sender); + } + } + + /// Get properties of the provided cluster. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the cluster. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A + /// that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ClustersGetWithResult(string subscriptionId, string resourceGroupName, string clusterName, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.NetworkCloud/clusters/" + + global::System.Uri.EscapeDataString(clusterName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ClustersGetWithResult_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.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A + /// that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ClustersGetWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Cluster.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ClustersGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Cluster.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation events + /// back. + /// + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the cluster. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ClustersGet_Validate(string subscriptionId, string resourceGroupName, string clusterName, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(clusterName),clusterName); + await eventListener.AssertRegEx(nameof(clusterName), clusterName, @"^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$"); + } + } + + /// Get a list of clusters in the provided resource group. + /// The ID of the target subscription. The value must be an UUID. + /// 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.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ClustersListByResourceGroup(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.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.NetworkCloud/clusters" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ClustersListByResourceGroup_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Get a list of clusters in the provided 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.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ClustersListByResourceGroupViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/clusters$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters'"); + } + + // 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.NetworkCloud/clusters" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ClustersListByResourceGroup_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Get a list of clusters in the provided resource group. + /// + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ClustersListByResourceGroupViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/clusters$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters'"); + } + + // 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.NetworkCloud/clusters" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ClustersListByResourceGroupWithResult_Call (request, eventListener,sender); + } + } + + /// Get a list of clusters in the provided resource group. + /// The ID of the target subscription. The value must be an UUID. + /// 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.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ClustersListByResourceGroupWithResult(string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.NetworkCloud/clusters" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ClustersListByResourceGroupWithResult_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.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ClustersListByResourceGroupWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ClustersListByResourceGroup_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ClustersListByResourceGroup_Validate(string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + } + } + + /// Get a list of clusters in the provided subscription. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ClustersListBySubscription(string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/providers/Microsoft.NetworkCloud/clusters" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ClustersListBySubscription_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Get a list of clusters in the provided 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.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ClustersListBySubscriptionViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-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.NetworkCloud/clusters$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.NetworkCloud/clusters'"); + } + + // 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.NetworkCloud/clusters" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ClustersListBySubscription_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Get a list of clusters in the provided subscription. + /// + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ClustersListBySubscriptionViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-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.NetworkCloud/clusters$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.NetworkCloud/clusters'"); + } + + // 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.NetworkCloud/clusters" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ClustersListBySubscriptionWithResult_Call (request, eventListener,sender); + } + } + + /// Get a list of clusters in the provided subscription. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ClustersListBySubscriptionWithResult(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/providers/Microsoft.NetworkCloud/clusters" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ClustersListBySubscriptionWithResult_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.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ClustersListBySubscriptionWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ClustersListBySubscription_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ClustersListBySubscription_Validate(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// + /// Triggers the execution of a runtime protection scan to detect and remediate detected issues, in accordance with the cluster + /// configuration. + /// + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the cluster. + /// The request body. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ClustersScanRuntime(string subscriptionId, string resourceGroupName, string clusterName, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterScanRuntimeParameters body, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.NetworkCloud/clusters/" + + global::System.Uri.EscapeDataString(clusterName) + + "/scanRuntime" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ClustersScanRuntime_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// + /// Triggers the execution of a runtime protection scan to detect and remediate detected issues, in accordance with the cluster + /// configuration. + /// + /// + /// The request body. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ClustersScanRuntimeViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterScanRuntimeParameters body, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/clusters/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var clusterName = _match.Groups["clusterName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.NetworkCloud/clusters/" + + clusterName + + "/scanRuntime" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ClustersScanRuntime_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// + /// Triggers the execution of a runtime protection scan to detect and remediate detected issues, in accordance with the cluster + /// configuration. + /// + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the cluster. + /// Json string supplied to the ClustersScanRuntime 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.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ClustersScanRuntimeViaJsonString(string subscriptionId, string resourceGroupName, string clusterName, global::System.String jsonString, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.NetworkCloud/clusters/" + + global::System.Uri.EscapeDataString(clusterName) + + "/scanRuntime" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ClustersScanRuntime_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ClustersScanRuntime_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // declared final-state-via: location + var _finalUri = _response.GetFirstHeader(@"Location"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the cluster. + /// The request body. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ClustersScanRuntime_Validate(string subscriptionId, string resourceGroupName, string clusterName, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterScanRuntimeParameters body, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(clusterName),clusterName); + await eventListener.AssertRegEx(nameof(clusterName), clusterName, @"^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// + /// Patch the properties of the provided cluster, or update the tags associated with the cluster. Properties and tag updates + /// can be done independently. + /// + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the cluster. + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// The request body. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ClustersUpdate(string subscriptionId, string resourceGroupName, string clusterName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.NetworkCloud/clusters/" + + global::System.Uri.EscapeDataString(clusterName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + if (null != ifNoneMatch) + { + request.Headers.Add("If-None-Match",ifNoneMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ClustersUpdate_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// + /// update the version of the provided cluster to one of the available supported versions. + /// + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the cluster. + /// The request body. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ClustersUpdateVersion(string subscriptionId, string resourceGroupName, string clusterName, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterUpdateVersionParameters body, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.NetworkCloud/clusters/" + + global::System.Uri.EscapeDataString(clusterName) + + "/updateVersion" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ClustersUpdateVersion_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// + /// update the version of the provided cluster to one of the available supported versions. + /// + /// + /// The request body. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ClustersUpdateVersionViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterUpdateVersionParameters body, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/clusters/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var clusterName = _match.Groups["clusterName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.NetworkCloud/clusters/" + + clusterName + + "/updateVersion" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ClustersUpdateVersion_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// + /// update the version of the provided cluster to one of the available supported versions. + /// + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the cluster. + /// Json string supplied to the ClustersUpdateVersion 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.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ClustersUpdateVersionViaJsonString(string subscriptionId, string resourceGroupName, string clusterName, global::System.String jsonString, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.NetworkCloud/clusters/" + + global::System.Uri.EscapeDataString(clusterName) + + "/updateVersion" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ClustersUpdateVersion_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ClustersUpdateVersion_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // declared final-state-via: location + var _finalUri = _response.GetFirstHeader(@"Location"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the cluster. + /// The request body. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ClustersUpdateVersion_Validate(string subscriptionId, string resourceGroupName, string clusterName, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterUpdateVersionParameters body, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(clusterName),clusterName); + await eventListener.AssertRegEx(nameof(clusterName), clusterName, @"^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// + /// Patch the properties of the provided cluster, or update the tags associated with the cluster. Properties and tag updates + /// can be done independently. + /// + /// + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// The request body. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ClustersUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/clusters/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var clusterName = _match.Groups["clusterName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.NetworkCloud/clusters/" + + clusterName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + if (null != ifNoneMatch) + { + request.Headers.Add("If-None-Match",ifNoneMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ClustersUpdate_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// + /// Patch the properties of the provided cluster, or update the tags associated with the cluster. Properties and tag updates + /// can be done independently. + /// + /// + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// The request body. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ClustersUpdateViaIdentityWithResult(global::System.String viaIdentity, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParameters body, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/clusters/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var clusterName = _match.Groups["clusterName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.NetworkCloud/clusters/" + + clusterName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + if (null != ifNoneMatch) + { + request.Headers.Add("If-None-Match",ifNoneMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ClustersUpdateWithResult_Call (request, eventListener,sender); + } + } + + /// + /// Patch the properties of the provided cluster, or update the tags associated with the cluster. Properties and tag updates + /// can be done independently. + /// + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the cluster. + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// Json string supplied to the ClustersUpdate 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.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ClustersUpdateViaJsonString(string subscriptionId, string resourceGroupName, string clusterName, string ifMatch, string ifNoneMatch, 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.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.NetworkCloud/clusters/" + + global::System.Uri.EscapeDataString(clusterName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + if (null != ifNoneMatch) + { + request.Headers.Add("If-None-Match",ifNoneMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ClustersUpdate_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// + /// Patch the properties of the provided cluster, or update the tags associated with the cluster. Properties and tag updates + /// can be done independently. + /// + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the cluster. + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// Json string supplied to the ClustersUpdate operation + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A + /// that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ClustersUpdateViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string clusterName, string ifMatch, string ifNoneMatch, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.NetworkCloud/clusters/" + + global::System.Uri.EscapeDataString(clusterName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + if (null != ifNoneMatch) + { + request.Headers.Add("If-None-Match",ifNoneMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ClustersUpdateWithResult_Call (request, eventListener,sender); + } + } + + /// + /// Patch the properties of the provided cluster, or update the tags associated with the cluster. Properties and tag updates + /// can be done independently. + /// + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the cluster. + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// The request body. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ClustersUpdateWithResult(string subscriptionId, string resourceGroupName, string clusterName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParameters body, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.NetworkCloud/clusters/" + + global::System.Uri.EscapeDataString(clusterName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + if (null != ifNoneMatch) + { + request.Headers.Add("If-None-Match",ifNoneMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ClustersUpdateWithResult_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.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A + /// that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ClustersUpdateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + // declared final-state-via: azure-async-operation + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + break; + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Cluster.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ClustersUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // declared final-state-via: azure-async-operation + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Cluster.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the cluster. + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// The request body. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ClustersUpdate_Validate(string subscriptionId, string resourceGroupName, string clusterName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterPatchParameters body, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(clusterName),clusterName); + await eventListener.AssertRegEx(nameof(clusterName), clusterName, @"^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$"); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(ifNoneMatch),ifNoneMatch); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// + /// update a new virtual machine console or update the properties of the existing virtual machine console. + /// + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the virtual machine. + /// The name of the virtual machine console. + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// The request body. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ConsolesCreateOrUpdate(string subscriptionId, string resourceGroupName, string virtualMachineName, string consoleName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsole body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.NetworkCloud/virtualMachines/" + + global::System.Uri.EscapeDataString(virtualMachineName) + + "/consoles/" + + global::System.Uri.EscapeDataString(consoleName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + if (null != ifNoneMatch) + { + request.Headers.Add("If-None-Match",ifNoneMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ConsolesCreateOrUpdate_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// + /// update a new virtual machine console or update the properties of the existing virtual machine console. + /// + /// + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// The request body. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ConsolesCreateOrUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsole body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/virtualMachines/(?[^/]+)/consoles/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/virtualMachines/{virtualMachineName}/consoles/{consoleName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var virtualMachineName = _match.Groups["virtualMachineName"].Value; + var consoleName = _match.Groups["consoleName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.NetworkCloud/virtualMachines/" + + virtualMachineName + + "/consoles/" + + consoleName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + if (null != ifNoneMatch) + { + request.Headers.Add("If-None-Match",ifNoneMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ConsolesCreateOrUpdate_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// + /// update a new virtual machine console or update the properties of the existing virtual machine console. + /// + /// + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// The request body. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ConsolesCreateOrUpdateViaIdentityWithResult(global::System.String viaIdentity, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsole body, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/virtualMachines/(?[^/]+)/consoles/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/virtualMachines/{virtualMachineName}/consoles/{consoleName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var virtualMachineName = _match.Groups["virtualMachineName"].Value; + var consoleName = _match.Groups["consoleName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.NetworkCloud/virtualMachines/" + + virtualMachineName + + "/consoles/" + + consoleName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + if (null != ifNoneMatch) + { + request.Headers.Add("If-None-Match",ifNoneMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ConsolesCreateOrUpdateWithResult_Call (request, eventListener,sender); + } + } + + /// + /// update a new virtual machine console or update the properties of the existing virtual machine console. + /// + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the virtual machine. + /// The name of the virtual machine console. + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// Json string supplied to the ConsolesCreateOrUpdate 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.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ConsolesCreateOrUpdateViaJsonString(string subscriptionId, string resourceGroupName, string virtualMachineName, string consoleName, string ifMatch, string ifNoneMatch, 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.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.NetworkCloud/virtualMachines/" + + global::System.Uri.EscapeDataString(virtualMachineName) + + "/consoles/" + + global::System.Uri.EscapeDataString(consoleName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + if (null != ifNoneMatch) + { + request.Headers.Add("If-None-Match",ifNoneMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ConsolesCreateOrUpdate_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// + /// update a new virtual machine console or update the properties of the existing virtual machine console. + /// + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the virtual machine. + /// The name of the virtual machine console. + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// Json string supplied to the ConsolesCreateOrUpdate operation + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A + /// that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ConsolesCreateOrUpdateViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string virtualMachineName, string consoleName, string ifMatch, string ifNoneMatch, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.NetworkCloud/virtualMachines/" + + global::System.Uri.EscapeDataString(virtualMachineName) + + "/consoles/" + + global::System.Uri.EscapeDataString(consoleName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + if (null != ifNoneMatch) + { + request.Headers.Add("If-None-Match",ifNoneMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ConsolesCreateOrUpdateWithResult_Call (request, eventListener,sender); + } + } + + /// + /// update a new virtual machine console or update the properties of the existing virtual machine console. + /// + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the virtual machine. + /// The name of the virtual machine console. + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// The request body. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ConsolesCreateOrUpdateWithResult(string subscriptionId, string resourceGroupName, string virtualMachineName, string consoleName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsole body, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.NetworkCloud/virtualMachines/" + + global::System.Uri.EscapeDataString(virtualMachineName) + + "/consoles/" + + global::System.Uri.EscapeDataString(consoleName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + if (null != ifNoneMatch) + { + request.Headers.Add("If-None-Match",ifNoneMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ConsolesCreateOrUpdateWithResult_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.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A + /// that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ConsolesCreateOrUpdateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + // declared final-state-via: azure-async-operation + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + break; + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Console.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ConsolesCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // declared final-state-via: azure-async-operation + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Console.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the virtual machine. + /// The name of the virtual machine console. + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// The request body. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ConsolesCreateOrUpdate_Validate(string subscriptionId, string resourceGroupName, string virtualMachineName, string consoleName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsole body, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(virtualMachineName),virtualMachineName); + await eventListener.AssertRegEx(nameof(virtualMachineName), virtualMachineName, @"^([a-zA-Z0-9][a-zA-Z0-9]{0,62}[a-zA-Z0-9])$"); + await eventListener.AssertNotNull(nameof(consoleName),consoleName); + await eventListener.AssertRegEx(nameof(consoleName), consoleName, @"^default$"); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(ifNoneMatch),ifNoneMatch); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Delete the provided virtual machine console. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the virtual machine. + /// The name of the virtual machine console. + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ConsolesDelete(string subscriptionId, string resourceGroupName, string virtualMachineName, string consoleName, string ifMatch, string ifNoneMatch, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.NetworkCloud/virtualMachines/" + + global::System.Uri.EscapeDataString(virtualMachineName) + + "/consoles/" + + global::System.Uri.EscapeDataString(consoleName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + if (null != ifNoneMatch) + { + request.Headers.Add("If-None-Match",ifNoneMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ConsolesDelete_Call (request, onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Delete the provided virtual machine console. + /// + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ConsolesDeleteViaIdentity(global::System.String viaIdentity, string ifMatch, string ifNoneMatch, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/virtualMachines/(?[^/]+)/consoles/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/virtualMachines/{virtualMachineName}/consoles/{consoleName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var virtualMachineName = _match.Groups["virtualMachineName"].Value; + var consoleName = _match.Groups["consoleName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.NetworkCloud/virtualMachines/" + + virtualMachineName + + "/consoles/" + + consoleName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + if (null != ifNoneMatch) + { + request.Headers.Add("If-None-Match",ifNoneMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ConsolesDelete_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.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ConsolesDelete_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.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // declared final-state-via: location + var _finalUri = _response.GetFirstHeader(@"Location"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the virtual machine. + /// The name of the virtual machine console. + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ConsolesDelete_Validate(string subscriptionId, string resourceGroupName, string virtualMachineName, string consoleName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(virtualMachineName),virtualMachineName); + await eventListener.AssertRegEx(nameof(virtualMachineName), virtualMachineName, @"^([a-zA-Z0-9][a-zA-Z0-9]{0,62}[a-zA-Z0-9])$"); + await eventListener.AssertNotNull(nameof(consoleName),consoleName); + await eventListener.AssertRegEx(nameof(consoleName), consoleName, @"^default$"); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(ifNoneMatch),ifNoneMatch); + } + } + + /// Get properties of the provided virtual machine console. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the virtual machine. + /// The name of the virtual machine console. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ConsolesGet(string subscriptionId, string resourceGroupName, string virtualMachineName, string consoleName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.NetworkCloud/virtualMachines/" + + global::System.Uri.EscapeDataString(virtualMachineName) + + "/consoles/" + + global::System.Uri.EscapeDataString(consoleName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ConsolesGet_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Get properties of the provided virtual machine console. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ConsolesGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/virtualMachines/(?[^/]+)/consoles/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/virtualMachines/{virtualMachineName}/consoles/{consoleName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var virtualMachineName = _match.Groups["virtualMachineName"].Value; + var consoleName = _match.Groups["consoleName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.NetworkCloud/virtualMachines/" + + virtualMachineName + + "/consoles/" + + consoleName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ConsolesGet_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Get properties of the provided virtual machine console. + /// + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A + /// that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ConsolesGetViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/virtualMachines/(?[^/]+)/consoles/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/virtualMachines/{virtualMachineName}/consoles/{consoleName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var virtualMachineName = _match.Groups["virtualMachineName"].Value; + var consoleName = _match.Groups["consoleName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.NetworkCloud/virtualMachines/" + + virtualMachineName + + "/consoles/" + + consoleName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ConsolesGetWithResult_Call (request, eventListener,sender); + } + } + + /// Get properties of the provided virtual machine console. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the virtual machine. + /// The name of the virtual machine console. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A + /// that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ConsolesGetWithResult(string subscriptionId, string resourceGroupName, string virtualMachineName, string consoleName, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.NetworkCloud/virtualMachines/" + + global::System.Uri.EscapeDataString(virtualMachineName) + + "/consoles/" + + global::System.Uri.EscapeDataString(consoleName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ConsolesGetWithResult_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.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A + /// that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ConsolesGetWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Console.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ConsolesGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Console.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation events + /// back. + /// + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the virtual machine. + /// The name of the virtual machine console. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ConsolesGet_Validate(string subscriptionId, string resourceGroupName, string virtualMachineName, string consoleName, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(virtualMachineName),virtualMachineName); + await eventListener.AssertRegEx(nameof(virtualMachineName), virtualMachineName, @"^([a-zA-Z0-9][a-zA-Z0-9]{0,62}[a-zA-Z0-9])$"); + await eventListener.AssertNotNull(nameof(consoleName),consoleName); + await eventListener.AssertRegEx(nameof(consoleName), consoleName, @"^default$"); + } + } + + /// Get a list of consoles for the provided virtual machine. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the virtual machine. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ConsolesListByVirtualMachine(string subscriptionId, string resourceGroupName, string virtualMachineName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.NetworkCloud/virtualMachines/" + + global::System.Uri.EscapeDataString(virtualMachineName) + + "/consoles" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ConsolesListByVirtualMachine_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Get a list of consoles for the provided virtual machine. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ConsolesListByVirtualMachineViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/virtualMachines/(?[^/]+)/consoles$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/virtualMachines/{virtualMachineName}/consoles'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var virtualMachineName = _match.Groups["virtualMachineName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.NetworkCloud/virtualMachines/" + + virtualMachineName + + "/consoles" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ConsolesListByVirtualMachine_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Get a list of consoles for the provided virtual machine. + /// + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ConsolesListByVirtualMachineViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/virtualMachines/(?[^/]+)/consoles$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/virtualMachines/{virtualMachineName}/consoles'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var virtualMachineName = _match.Groups["virtualMachineName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.NetworkCloud/virtualMachines/" + + virtualMachineName + + "/consoles" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ConsolesListByVirtualMachineWithResult_Call (request, eventListener,sender); + } + } + + /// Get a list of consoles for the provided virtual machine. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the virtual machine. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ConsolesListByVirtualMachineWithResult(string subscriptionId, string resourceGroupName, string virtualMachineName, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.NetworkCloud/virtualMachines/" + + global::System.Uri.EscapeDataString(virtualMachineName) + + "/consoles" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ConsolesListByVirtualMachineWithResult_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.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ConsolesListByVirtualMachineWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ConsoleList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ConsolesListByVirtualMachine_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ConsoleList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the virtual machine. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ConsolesListByVirtualMachine_Validate(string subscriptionId, string resourceGroupName, string virtualMachineName, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(virtualMachineName),virtualMachineName); + await eventListener.AssertRegEx(nameof(virtualMachineName), virtualMachineName, @"^([a-zA-Z0-9][a-zA-Z0-9]{0,62}[a-zA-Z0-9])$"); + } + } + + /// + /// Patch the properties of the provided virtual machine console, or update the tags associated with the virtual machine console. + /// Properties and tag update can be done independently. + /// + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the virtual machine. + /// The name of the virtual machine console. + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// The request body. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ConsolesUpdate(string subscriptionId, string resourceGroupName, string virtualMachineName, string consoleName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsolePatchParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.NetworkCloud/virtualMachines/" + + global::System.Uri.EscapeDataString(virtualMachineName) + + "/consoles/" + + global::System.Uri.EscapeDataString(consoleName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + if (null != ifNoneMatch) + { + request.Headers.Add("If-None-Match",ifNoneMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ConsolesUpdate_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// + /// Patch the properties of the provided virtual machine console, or update the tags associated with the virtual machine console. + /// Properties and tag update can be done independently. + /// + /// + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// The request body. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ConsolesUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsolePatchParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/virtualMachines/(?[^/]+)/consoles/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/virtualMachines/{virtualMachineName}/consoles/{consoleName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var virtualMachineName = _match.Groups["virtualMachineName"].Value; + var consoleName = _match.Groups["consoleName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.NetworkCloud/virtualMachines/" + + virtualMachineName + + "/consoles/" + + consoleName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + if (null != ifNoneMatch) + { + request.Headers.Add("If-None-Match",ifNoneMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ConsolesUpdate_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// + /// Patch the properties of the provided virtual machine console, or update the tags associated with the virtual machine console. + /// Properties and tag update can be done independently. + /// + /// + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// The request body. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ConsolesUpdateViaIdentityWithResult(global::System.String viaIdentity, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsolePatchParameters body, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/virtualMachines/(?[^/]+)/consoles/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/virtualMachines/{virtualMachineName}/consoles/{consoleName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var virtualMachineName = _match.Groups["virtualMachineName"].Value; + var consoleName = _match.Groups["consoleName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.NetworkCloud/virtualMachines/" + + virtualMachineName + + "/consoles/" + + consoleName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + if (null != ifNoneMatch) + { + request.Headers.Add("If-None-Match",ifNoneMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ConsolesUpdateWithResult_Call (request, eventListener,sender); + } + } + + /// + /// Patch the properties of the provided virtual machine console, or update the tags associated with the virtual machine console. + /// Properties and tag update can be done independently. + /// + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the virtual machine. + /// The name of the virtual machine console. + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// Json string supplied to the ConsolesUpdate 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.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ConsolesUpdateViaJsonString(string subscriptionId, string resourceGroupName, string virtualMachineName, string consoleName, string ifMatch, string ifNoneMatch, 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.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.NetworkCloud/virtualMachines/" + + global::System.Uri.EscapeDataString(virtualMachineName) + + "/consoles/" + + global::System.Uri.EscapeDataString(consoleName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + if (null != ifNoneMatch) + { + request.Headers.Add("If-None-Match",ifNoneMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ConsolesUpdate_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// + /// Patch the properties of the provided virtual machine console, or update the tags associated with the virtual machine console. + /// Properties and tag update can be done independently. + /// + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the virtual machine. + /// The name of the virtual machine console. + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// Json string supplied to the ConsolesUpdate operation + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A + /// that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ConsolesUpdateViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string virtualMachineName, string consoleName, string ifMatch, string ifNoneMatch, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.NetworkCloud/virtualMachines/" + + global::System.Uri.EscapeDataString(virtualMachineName) + + "/consoles/" + + global::System.Uri.EscapeDataString(consoleName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + if (null != ifNoneMatch) + { + request.Headers.Add("If-None-Match",ifNoneMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ConsolesUpdateWithResult_Call (request, eventListener,sender); + } + } + + /// + /// Patch the properties of the provided virtual machine console, or update the tags associated with the virtual machine console. + /// Properties and tag update can be done independently. + /// + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the virtual machine. + /// The name of the virtual machine console. + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// The request body. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ConsolesUpdateWithResult(string subscriptionId, string resourceGroupName, string virtualMachineName, string consoleName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsolePatchParameters body, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.NetworkCloud/virtualMachines/" + + global::System.Uri.EscapeDataString(virtualMachineName) + + "/consoles/" + + global::System.Uri.EscapeDataString(consoleName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + if (null != ifNoneMatch) + { + request.Headers.Add("If-None-Match",ifNoneMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.ConsolesUpdateWithResult_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.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A + /// that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ConsolesUpdateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + // declared final-state-via: azure-async-operation + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + break; + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Console.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ConsolesUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // declared final-state-via: azure-async-operation + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Console.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the virtual machine. + /// The name of the virtual machine console. + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// The request body. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ConsolesUpdate_Validate(string subscriptionId, string resourceGroupName, string virtualMachineName, string consoleName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsolePatchParameters body, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(virtualMachineName),virtualMachineName); + await eventListener.AssertRegEx(nameof(virtualMachineName), virtualMachineName, @"^([a-zA-Z0-9][a-zA-Z0-9]{0,62}[a-zA-Z0-9])$"); + await eventListener.AssertNotNull(nameof(consoleName),consoleName); + await eventListener.AssertRegEx(nameof(consoleName), consoleName, @"^default$"); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(ifNoneMatch),ifNoneMatch); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// + /// update a new Kubernetes cluster feature or update properties of the Kubernetes cluster feature if it exists. + /// + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Kubernetes cluster. + /// The name of the feature. + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// The request body. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 KubernetesClusterFeaturesCreateOrUpdate(string subscriptionId, string resourceGroupName, string kubernetesClusterName, string featureName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeature body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.NetworkCloud/kubernetesClusters/" + + global::System.Uri.EscapeDataString(kubernetesClusterName) + + "/features/" + + global::System.Uri.EscapeDataString(featureName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + if (null != ifNoneMatch) + { + request.Headers.Add("If-None-Match",ifNoneMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.KubernetesClusterFeaturesCreateOrUpdate_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// + /// update a new Kubernetes cluster feature or update properties of the Kubernetes cluster feature if it exists. + /// + /// + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// The request body. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 KubernetesClusterFeaturesCreateOrUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeature body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/kubernetesClusters/(?[^/]+)/features/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/kubernetesClusters/{kubernetesClusterName}/features/{featureName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var kubernetesClusterName = _match.Groups["kubernetesClusterName"].Value; + var featureName = _match.Groups["featureName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.NetworkCloud/kubernetesClusters/" + + kubernetesClusterName + + "/features/" + + featureName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + if (null != ifNoneMatch) + { + request.Headers.Add("If-None-Match",ifNoneMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.KubernetesClusterFeaturesCreateOrUpdate_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// + /// update a new Kubernetes cluster feature or update properties of the Kubernetes cluster feature if it exists. + /// + /// + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// The request body. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 KubernetesClusterFeaturesCreateOrUpdateViaIdentityWithResult(global::System.String viaIdentity, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeature body, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/kubernetesClusters/(?[^/]+)/features/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/kubernetesClusters/{kubernetesClusterName}/features/{featureName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var kubernetesClusterName = _match.Groups["kubernetesClusterName"].Value; + var featureName = _match.Groups["featureName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.NetworkCloud/kubernetesClusters/" + + kubernetesClusterName + + "/features/" + + featureName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + if (null != ifNoneMatch) + { + request.Headers.Add("If-None-Match",ifNoneMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.KubernetesClusterFeaturesCreateOrUpdateWithResult_Call (request, eventListener,sender); + } + } + + /// + /// update a new Kubernetes cluster feature or update properties of the Kubernetes cluster feature if it exists. + /// + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Kubernetes cluster. + /// The name of the feature. + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// Json string supplied to the KubernetesClusterFeaturesCreateOrUpdate 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.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task KubernetesClusterFeaturesCreateOrUpdateViaJsonString(string subscriptionId, string resourceGroupName, string kubernetesClusterName, string featureName, string ifMatch, string ifNoneMatch, 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.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.NetworkCloud/kubernetesClusters/" + + global::System.Uri.EscapeDataString(kubernetesClusterName) + + "/features/" + + global::System.Uri.EscapeDataString(featureName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + if (null != ifNoneMatch) + { + request.Headers.Add("If-None-Match",ifNoneMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.KubernetesClusterFeaturesCreateOrUpdate_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// + /// update a new Kubernetes cluster feature or update properties of the Kubernetes cluster feature if it exists. + /// + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Kubernetes cluster. + /// The name of the feature. + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// Json string supplied to the KubernetesClusterFeaturesCreateOrUpdate operation + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task KubernetesClusterFeaturesCreateOrUpdateViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string kubernetesClusterName, string featureName, string ifMatch, string ifNoneMatch, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.NetworkCloud/kubernetesClusters/" + + global::System.Uri.EscapeDataString(kubernetesClusterName) + + "/features/" + + global::System.Uri.EscapeDataString(featureName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + if (null != ifNoneMatch) + { + request.Headers.Add("If-None-Match",ifNoneMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.KubernetesClusterFeaturesCreateOrUpdateWithResult_Call (request, eventListener,sender); + } + } + + /// + /// update a new Kubernetes cluster feature or update properties of the Kubernetes cluster feature if it exists. + /// + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Kubernetes cluster. + /// The name of the feature. + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// The request body. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 KubernetesClusterFeaturesCreateOrUpdateWithResult(string subscriptionId, string resourceGroupName, string kubernetesClusterName, string featureName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeature body, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.NetworkCloud/kubernetesClusters/" + + global::System.Uri.EscapeDataString(kubernetesClusterName) + + "/features/" + + global::System.Uri.EscapeDataString(featureName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + if (null != ifNoneMatch) + { + request.Headers.Add("If-None-Match",ifNoneMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.KubernetesClusterFeaturesCreateOrUpdateWithResult_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.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task KubernetesClusterFeaturesCreateOrUpdateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + // declared final-state-via: azure-async-operation + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + break; + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.KubernetesClusterFeature.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task KubernetesClusterFeaturesCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // declared final-state-via: azure-async-operation + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.KubernetesClusterFeature.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but + /// you will get validation events back. + /// + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Kubernetes cluster. + /// The name of the feature. + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// The request body. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task KubernetesClusterFeaturesCreateOrUpdate_Validate(string subscriptionId, string resourceGroupName, string kubernetesClusterName, string featureName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeature body, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(kubernetesClusterName),kubernetesClusterName); + await eventListener.AssertRegEx(nameof(kubernetesClusterName), kubernetesClusterName, @"^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$"); + await eventListener.AssertNotNull(nameof(featureName),featureName); + await eventListener.AssertRegEx(nameof(featureName), featureName, @"^([a-zA-Z0-9][a-zA-Z0-9-]{0,61}[a-zA-Z0-9])$"); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(ifNoneMatch),ifNoneMatch); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Delete the provided Kubernetes cluster feature. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Kubernetes cluster. + /// The name of the feature. + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task KubernetesClusterFeaturesDelete(string subscriptionId, string resourceGroupName, string kubernetesClusterName, string featureName, string ifMatch, string ifNoneMatch, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.NetworkCloud/kubernetesClusters/" + + global::System.Uri.EscapeDataString(kubernetesClusterName) + + "/features/" + + global::System.Uri.EscapeDataString(featureName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + if (null != ifNoneMatch) + { + request.Headers.Add("If-None-Match",ifNoneMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.KubernetesClusterFeaturesDelete_Call (request, onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Delete the provided Kubernetes cluster feature. + /// + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task KubernetesClusterFeaturesDeleteViaIdentity(global::System.String viaIdentity, string ifMatch, string ifNoneMatch, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/kubernetesClusters/(?[^/]+)/features/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/kubernetesClusters/{kubernetesClusterName}/features/{featureName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var kubernetesClusterName = _match.Groups["kubernetesClusterName"].Value; + var featureName = _match.Groups["featureName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.NetworkCloud/kubernetesClusters/" + + kubernetesClusterName + + "/features/" + + featureName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + if (null != ifNoneMatch) + { + request.Headers.Add("If-None-Match",ifNoneMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.KubernetesClusterFeaturesDelete_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.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task KubernetesClusterFeaturesDelete_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.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // declared final-state-via: location + var _finalUri = _response.GetFirstHeader(@"Location"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Kubernetes cluster. + /// The name of the feature. + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task KubernetesClusterFeaturesDelete_Validate(string subscriptionId, string resourceGroupName, string kubernetesClusterName, string featureName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(kubernetesClusterName),kubernetesClusterName); + await eventListener.AssertRegEx(nameof(kubernetesClusterName), kubernetesClusterName, @"^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$"); + await eventListener.AssertNotNull(nameof(featureName),featureName); + await eventListener.AssertRegEx(nameof(featureName), featureName, @"^([a-zA-Z0-9][a-zA-Z0-9-]{0,61}[a-zA-Z0-9])$"); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(ifNoneMatch),ifNoneMatch); + } + } + + /// Get properties of the provided the Kubernetes cluster feature. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Kubernetes cluster. + /// The name of the feature. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task KubernetesClusterFeaturesGet(string subscriptionId, string resourceGroupName, string kubernetesClusterName, string featureName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.NetworkCloud/kubernetesClusters/" + + global::System.Uri.EscapeDataString(kubernetesClusterName) + + "/features/" + + global::System.Uri.EscapeDataString(featureName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.KubernetesClusterFeaturesGet_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Get properties of the provided the Kubernetes cluster feature. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task KubernetesClusterFeaturesGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/kubernetesClusters/(?[^/]+)/features/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/kubernetesClusters/{kubernetesClusterName}/features/{featureName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var kubernetesClusterName = _match.Groups["kubernetesClusterName"].Value; + var featureName = _match.Groups["featureName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.NetworkCloud/kubernetesClusters/" + + kubernetesClusterName + + "/features/" + + featureName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.KubernetesClusterFeaturesGet_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Get properties of the provided the Kubernetes cluster feature. + /// + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task KubernetesClusterFeaturesGetViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/kubernetesClusters/(?[^/]+)/features/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/kubernetesClusters/{kubernetesClusterName}/features/{featureName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var kubernetesClusterName = _match.Groups["kubernetesClusterName"].Value; + var featureName = _match.Groups["featureName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.NetworkCloud/kubernetesClusters/" + + kubernetesClusterName + + "/features/" + + featureName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.KubernetesClusterFeaturesGetWithResult_Call (request, eventListener,sender); + } + } + + /// Get properties of the provided the Kubernetes cluster feature. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Kubernetes cluster. + /// The name of the feature. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task KubernetesClusterFeaturesGetWithResult(string subscriptionId, string resourceGroupName, string kubernetesClusterName, string featureName, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.NetworkCloud/kubernetesClusters/" + + global::System.Uri.EscapeDataString(kubernetesClusterName) + + "/features/" + + global::System.Uri.EscapeDataString(featureName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.KubernetesClusterFeaturesGetWithResult_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.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task KubernetesClusterFeaturesGetWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.KubernetesClusterFeature.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task KubernetesClusterFeaturesGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.KubernetesClusterFeature.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Kubernetes cluster. + /// The name of the feature. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task KubernetesClusterFeaturesGet_Validate(string subscriptionId, string resourceGroupName, string kubernetesClusterName, string featureName, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(kubernetesClusterName),kubernetesClusterName); + await eventListener.AssertRegEx(nameof(kubernetesClusterName), kubernetesClusterName, @"^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$"); + await eventListener.AssertNotNull(nameof(featureName),featureName); + await eventListener.AssertRegEx(nameof(featureName), featureName, @"^([a-zA-Z0-9][a-zA-Z0-9-]{0,61}[a-zA-Z0-9])$"); + } + } + + /// Get a list of features for the provided Kubernetes cluster. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Kubernetes cluster. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task KubernetesClusterFeaturesListByKubernetesCluster(string subscriptionId, string resourceGroupName, string kubernetesClusterName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.NetworkCloud/kubernetesClusters/" + + global::System.Uri.EscapeDataString(kubernetesClusterName) + + "/features" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.KubernetesClusterFeaturesListByKubernetesCluster_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Get a list of features for the provided Kubernetes cluster. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task KubernetesClusterFeaturesListByKubernetesClusterViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/kubernetesClusters/(?[^/]+)/features$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/kubernetesClusters/{kubernetesClusterName}/features'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var kubernetesClusterName = _match.Groups["kubernetesClusterName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.NetworkCloud/kubernetesClusters/" + + kubernetesClusterName + + "/features" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.KubernetesClusterFeaturesListByKubernetesCluster_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Get a list of features for the provided Kubernetes cluster. + /// + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task KubernetesClusterFeaturesListByKubernetesClusterViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/kubernetesClusters/(?[^/]+)/features$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/kubernetesClusters/{kubernetesClusterName}/features'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var kubernetesClusterName = _match.Groups["kubernetesClusterName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.NetworkCloud/kubernetesClusters/" + + kubernetesClusterName + + "/features" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.KubernetesClusterFeaturesListByKubernetesClusterWithResult_Call (request, eventListener,sender); + } + } + + /// Get a list of features for the provided Kubernetes cluster. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Kubernetes cluster. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task KubernetesClusterFeaturesListByKubernetesClusterWithResult(string subscriptionId, string resourceGroupName, string kubernetesClusterName, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.NetworkCloud/kubernetesClusters/" + + global::System.Uri.EscapeDataString(kubernetesClusterName) + + "/features" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.KubernetesClusterFeaturesListByKubernetesClusterWithResult_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.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task KubernetesClusterFeaturesListByKubernetesClusterWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.KubernetesClusterFeatureList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task KubernetesClusterFeaturesListByKubernetesCluster_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.KubernetesClusterFeatureList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual + /// call, but you will get validation events back. + /// + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Kubernetes cluster. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task KubernetesClusterFeaturesListByKubernetesCluster_Validate(string subscriptionId, string resourceGroupName, string kubernetesClusterName, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(kubernetesClusterName),kubernetesClusterName); + await eventListener.AssertRegEx(nameof(kubernetesClusterName), kubernetesClusterName, @"^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$"); + } + } + + /// Patch properties of the provided Kubernetes cluster feature. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Kubernetes cluster. + /// The name of the feature. + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// The request body. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 KubernetesClusterFeaturesUpdate(string subscriptionId, string resourceGroupName, string kubernetesClusterName, string featureName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeaturePatchParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.NetworkCloud/kubernetesClusters/" + + global::System.Uri.EscapeDataString(kubernetesClusterName) + + "/features/" + + global::System.Uri.EscapeDataString(featureName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + if (null != ifNoneMatch) + { + request.Headers.Add("If-None-Match",ifNoneMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.KubernetesClusterFeaturesUpdate_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Patch properties of the provided Kubernetes cluster feature. + /// + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// The request body. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 KubernetesClusterFeaturesUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeaturePatchParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/kubernetesClusters/(?[^/]+)/features/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/kubernetesClusters/{kubernetesClusterName}/features/{featureName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var kubernetesClusterName = _match.Groups["kubernetesClusterName"].Value; + var featureName = _match.Groups["featureName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.NetworkCloud/kubernetesClusters/" + + kubernetesClusterName + + "/features/" + + featureName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + if (null != ifNoneMatch) + { + request.Headers.Add("If-None-Match",ifNoneMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.KubernetesClusterFeaturesUpdate_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Patch properties of the provided Kubernetes cluster feature. + /// + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// The request body. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 KubernetesClusterFeaturesUpdateViaIdentityWithResult(global::System.String viaIdentity, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeaturePatchParameters body, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/kubernetesClusters/(?[^/]+)/features/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/kubernetesClusters/{kubernetesClusterName}/features/{featureName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var kubernetesClusterName = _match.Groups["kubernetesClusterName"].Value; + var featureName = _match.Groups["featureName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.NetworkCloud/kubernetesClusters/" + + kubernetesClusterName + + "/features/" + + featureName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + if (null != ifNoneMatch) + { + request.Headers.Add("If-None-Match",ifNoneMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.KubernetesClusterFeaturesUpdateWithResult_Call (request, eventListener,sender); + } + } + + /// Patch properties of the provided Kubernetes cluster feature. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Kubernetes cluster. + /// The name of the feature. + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// Json string supplied to the KubernetesClusterFeaturesUpdate 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.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task KubernetesClusterFeaturesUpdateViaJsonString(string subscriptionId, string resourceGroupName, string kubernetesClusterName, string featureName, string ifMatch, string ifNoneMatch, 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.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.NetworkCloud/kubernetesClusters/" + + global::System.Uri.EscapeDataString(kubernetesClusterName) + + "/features/" + + global::System.Uri.EscapeDataString(featureName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + if (null != ifNoneMatch) + { + request.Headers.Add("If-None-Match",ifNoneMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.KubernetesClusterFeaturesUpdate_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Patch properties of the provided Kubernetes cluster feature. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Kubernetes cluster. + /// The name of the feature. + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// Json string supplied to the KubernetesClusterFeaturesUpdate operation + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task KubernetesClusterFeaturesUpdateViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string kubernetesClusterName, string featureName, string ifMatch, string ifNoneMatch, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.NetworkCloud/kubernetesClusters/" + + global::System.Uri.EscapeDataString(kubernetesClusterName) + + "/features/" + + global::System.Uri.EscapeDataString(featureName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + if (null != ifNoneMatch) + { + request.Headers.Add("If-None-Match",ifNoneMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.KubernetesClusterFeaturesUpdateWithResult_Call (request, eventListener,sender); + } + } + + /// Patch properties of the provided Kubernetes cluster feature. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Kubernetes cluster. + /// The name of the feature. + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// The request body. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 KubernetesClusterFeaturesUpdateWithResult(string subscriptionId, string resourceGroupName, string kubernetesClusterName, string featureName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeaturePatchParameters body, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.NetworkCloud/kubernetesClusters/" + + global::System.Uri.EscapeDataString(kubernetesClusterName) + + "/features/" + + global::System.Uri.EscapeDataString(featureName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + if (null != ifNoneMatch) + { + request.Headers.Add("If-None-Match",ifNoneMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.KubernetesClusterFeaturesUpdateWithResult_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.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task KubernetesClusterFeaturesUpdateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + // declared final-state-via: azure-async-operation + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + break; + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.KubernetesClusterFeature.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task KubernetesClusterFeaturesUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // declared final-state-via: azure-async-operation + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.KubernetesClusterFeature.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Kubernetes cluster. + /// The name of the feature. + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// The request body. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task KubernetesClusterFeaturesUpdate_Validate(string subscriptionId, string resourceGroupName, string kubernetesClusterName, string featureName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeaturePatchParameters body, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(kubernetesClusterName),kubernetesClusterName); + await eventListener.AssertRegEx(nameof(kubernetesClusterName), kubernetesClusterName, @"^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$"); + await eventListener.AssertNotNull(nameof(featureName),featureName); + await eventListener.AssertRegEx(nameof(featureName), featureName, @"^([a-zA-Z0-9][a-zA-Z0-9-]{0,61}[a-zA-Z0-9])$"); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(ifNoneMatch),ifNoneMatch); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// update a new Kubernetes cluster or update the properties of the existing one. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Kubernetes cluster. + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// The request body. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 KubernetesClustersCreateOrUpdate(string subscriptionId, string resourceGroupName, string kubernetesClusterName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesCluster body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.NetworkCloud/kubernetesClusters/" + + global::System.Uri.EscapeDataString(kubernetesClusterName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + if (null != ifNoneMatch) + { + request.Headers.Add("If-None-Match",ifNoneMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.KubernetesClustersCreateOrUpdate_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// update a new Kubernetes cluster or update the properties of the existing one. + /// + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// The request body. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 KubernetesClustersCreateOrUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesCluster body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/kubernetesClusters/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/kubernetesClusters/{kubernetesClusterName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var kubernetesClusterName = _match.Groups["kubernetesClusterName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.NetworkCloud/kubernetesClusters/" + + kubernetesClusterName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + if (null != ifNoneMatch) + { + request.Headers.Add("If-None-Match",ifNoneMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.KubernetesClustersCreateOrUpdate_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// update a new Kubernetes cluster or update the properties of the existing one. + /// + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// The request body. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 KubernetesClustersCreateOrUpdateViaIdentityWithResult(global::System.String viaIdentity, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesCluster body, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/kubernetesClusters/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/kubernetesClusters/{kubernetesClusterName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var kubernetesClusterName = _match.Groups["kubernetesClusterName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.NetworkCloud/kubernetesClusters/" + + kubernetesClusterName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + if (null != ifNoneMatch) + { + request.Headers.Add("If-None-Match",ifNoneMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.KubernetesClustersCreateOrUpdateWithResult_Call (request, eventListener,sender); + } + } + + /// update a new Kubernetes cluster or update the properties of the existing one. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Kubernetes cluster. + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// Json string supplied to the KubernetesClustersCreateOrUpdate 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.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task KubernetesClustersCreateOrUpdateViaJsonString(string subscriptionId, string resourceGroupName, string kubernetesClusterName, string ifMatch, string ifNoneMatch, 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.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.NetworkCloud/kubernetesClusters/" + + global::System.Uri.EscapeDataString(kubernetesClusterName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + if (null != ifNoneMatch) + { + request.Headers.Add("If-None-Match",ifNoneMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.KubernetesClustersCreateOrUpdate_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// update a new Kubernetes cluster or update the properties of the existing one. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Kubernetes cluster. + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// Json string supplied to the KubernetesClustersCreateOrUpdate operation + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task KubernetesClustersCreateOrUpdateViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string kubernetesClusterName, string ifMatch, string ifNoneMatch, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.NetworkCloud/kubernetesClusters/" + + global::System.Uri.EscapeDataString(kubernetesClusterName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + if (null != ifNoneMatch) + { + request.Headers.Add("If-None-Match",ifNoneMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.KubernetesClustersCreateOrUpdateWithResult_Call (request, eventListener,sender); + } + } + + /// update a new Kubernetes cluster or update the properties of the existing one. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Kubernetes cluster. + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// The request body. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 KubernetesClustersCreateOrUpdateWithResult(string subscriptionId, string resourceGroupName, string kubernetesClusterName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesCluster body, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.NetworkCloud/kubernetesClusters/" + + global::System.Uri.EscapeDataString(kubernetesClusterName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + if (null != ifNoneMatch) + { + request.Headers.Add("If-None-Match",ifNoneMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.KubernetesClustersCreateOrUpdateWithResult_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.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task KubernetesClustersCreateOrUpdateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + // declared final-state-via: azure-async-operation + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + break; + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.KubernetesCluster.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task KubernetesClustersCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // declared final-state-via: azure-async-operation + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.KubernetesCluster.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you + /// will get validation events back. + /// + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Kubernetes cluster. + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// The request body. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task KubernetesClustersCreateOrUpdate_Validate(string subscriptionId, string resourceGroupName, string kubernetesClusterName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesCluster body, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(kubernetesClusterName),kubernetesClusterName); + await eventListener.AssertRegEx(nameof(kubernetesClusterName), kubernetesClusterName, @"^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$"); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(ifNoneMatch),ifNoneMatch); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Delete the provided Kubernetes cluster. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Kubernetes cluster. + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task KubernetesClustersDelete(string subscriptionId, string resourceGroupName, string kubernetesClusterName, string ifMatch, string ifNoneMatch, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.NetworkCloud/kubernetesClusters/" + + global::System.Uri.EscapeDataString(kubernetesClusterName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + if (null != ifNoneMatch) + { + request.Headers.Add("If-None-Match",ifNoneMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.KubernetesClustersDelete_Call (request, onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Delete the provided Kubernetes cluster. + /// + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task KubernetesClustersDeleteViaIdentity(global::System.String viaIdentity, string ifMatch, string ifNoneMatch, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/kubernetesClusters/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/kubernetesClusters/{kubernetesClusterName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var kubernetesClusterName = _match.Groups["kubernetesClusterName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.NetworkCloud/kubernetesClusters/" + + kubernetesClusterName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + if (null != ifNoneMatch) + { + request.Headers.Add("If-None-Match",ifNoneMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.KubernetesClustersDelete_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.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task KubernetesClustersDelete_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.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // declared final-state-via: location + var _finalUri = _response.GetFirstHeader(@"Location"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Kubernetes cluster. + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task KubernetesClustersDelete_Validate(string subscriptionId, string resourceGroupName, string kubernetesClusterName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(kubernetesClusterName),kubernetesClusterName); + await eventListener.AssertRegEx(nameof(kubernetesClusterName), kubernetesClusterName, @"^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$"); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(ifNoneMatch),ifNoneMatch); + } + } + + /// Get properties of the provided the Kubernetes cluster. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Kubernetes cluster. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task KubernetesClustersGet(string subscriptionId, string resourceGroupName, string kubernetesClusterName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.NetworkCloud/kubernetesClusters/" + + global::System.Uri.EscapeDataString(kubernetesClusterName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.KubernetesClustersGet_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Get properties of the provided the Kubernetes cluster. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task KubernetesClustersGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/kubernetesClusters/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/kubernetesClusters/{kubernetesClusterName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var kubernetesClusterName = _match.Groups["kubernetesClusterName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.NetworkCloud/kubernetesClusters/" + + kubernetesClusterName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.KubernetesClustersGet_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Get properties of the provided the Kubernetes cluster. + /// + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task KubernetesClustersGetViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/kubernetesClusters/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/kubernetesClusters/{kubernetesClusterName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var kubernetesClusterName = _match.Groups["kubernetesClusterName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.NetworkCloud/kubernetesClusters/" + + kubernetesClusterName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.KubernetesClustersGetWithResult_Call (request, eventListener,sender); + } + } + + /// Get properties of the provided the Kubernetes cluster. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Kubernetes cluster. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task KubernetesClustersGetWithResult(string subscriptionId, string resourceGroupName, string kubernetesClusterName, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.NetworkCloud/kubernetesClusters/" + + global::System.Uri.EscapeDataString(kubernetesClusterName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.KubernetesClustersGetWithResult_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.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task KubernetesClustersGetWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.KubernetesCluster.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task KubernetesClustersGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.KubernetesCluster.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Kubernetes cluster. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task KubernetesClustersGet_Validate(string subscriptionId, string resourceGroupName, string kubernetesClusterName, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(kubernetesClusterName),kubernetesClusterName); + await eventListener.AssertRegEx(nameof(kubernetesClusterName), kubernetesClusterName, @"^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$"); + } + } + + /// Get a list of Kubernetes clusters in the provided resource group. + /// The ID of the target subscription. The value must be an UUID. + /// 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.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task KubernetesClustersListByResourceGroup(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.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.NetworkCloud/kubernetesClusters" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.KubernetesClustersListByResourceGroup_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Get a list of Kubernetes clusters in the provided 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.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task KubernetesClustersListByResourceGroupViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/kubernetesClusters$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/kubernetesClusters'"); + } + + // 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.NetworkCloud/kubernetesClusters" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.KubernetesClustersListByResourceGroup_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Get a list of Kubernetes clusters in the provided resource group. + /// + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task KubernetesClustersListByResourceGroupViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/kubernetesClusters$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/kubernetesClusters'"); + } + + // 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.NetworkCloud/kubernetesClusters" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.KubernetesClustersListByResourceGroupWithResult_Call (request, eventListener,sender); + } + } + + /// Get a list of Kubernetes clusters in the provided resource group. + /// The ID of the target subscription. The value must be an UUID. + /// 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.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task KubernetesClustersListByResourceGroupWithResult(string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.NetworkCloud/kubernetesClusters" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.KubernetesClustersListByResourceGroupWithResult_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.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task KubernetesClustersListByResourceGroupWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.KubernetesClusterList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task KubernetesClustersListByResourceGroup_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.KubernetesClusterList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but + /// you will get validation events back. + /// + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task KubernetesClustersListByResourceGroup_Validate(string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + } + } + + /// Get a list of Kubernetes clusters in the provided subscription. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task KubernetesClustersListBySubscription(string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/providers/Microsoft.NetworkCloud/kubernetesClusters" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.KubernetesClustersListBySubscription_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Get a list of Kubernetes clusters in the provided 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.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task KubernetesClustersListBySubscriptionViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-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.NetworkCloud/kubernetesClusters$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.NetworkCloud/kubernetesClusters'"); + } + + // 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.NetworkCloud/kubernetesClusters" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.KubernetesClustersListBySubscription_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Get a list of Kubernetes clusters in the provided subscription. + /// + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task KubernetesClustersListBySubscriptionViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-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.NetworkCloud/kubernetesClusters$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.NetworkCloud/kubernetesClusters'"); + } + + // 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.NetworkCloud/kubernetesClusters" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.KubernetesClustersListBySubscriptionWithResult_Call (request, eventListener,sender); + } + } + + /// Get a list of Kubernetes clusters in the provided subscription. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task KubernetesClustersListBySubscriptionWithResult(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/providers/Microsoft.NetworkCloud/kubernetesClusters" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.KubernetesClustersListBySubscriptionWithResult_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.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task KubernetesClustersListBySubscriptionWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.KubernetesClusterList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task KubernetesClustersListBySubscription_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.KubernetesClusterList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but + /// you will get validation events back. + /// + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task KubernetesClustersListBySubscription_Validate(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// Restart a targeted node of a Kubernetes cluster. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Kubernetes cluster. + /// The request body. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 KubernetesClustersRestartNode(string subscriptionId, string resourceGroupName, string kubernetesClusterName, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterRestartNodeParameters body, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.NetworkCloud/kubernetesClusters/" + + global::System.Uri.EscapeDataString(kubernetesClusterName) + + "/restartNode" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.KubernetesClustersRestartNode_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Restart a targeted node of a Kubernetes cluster. + /// + /// The request body. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 KubernetesClustersRestartNodeViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterRestartNodeParameters body, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/kubernetesClusters/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/kubernetesClusters/{kubernetesClusterName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var kubernetesClusterName = _match.Groups["kubernetesClusterName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.NetworkCloud/kubernetesClusters/" + + kubernetesClusterName + + "/restartNode" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.KubernetesClustersRestartNode_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Restart a targeted node of a Kubernetes cluster. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Kubernetes cluster. + /// Json string supplied to the KubernetesClustersRestartNode 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.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task KubernetesClustersRestartNodeViaJsonString(string subscriptionId, string resourceGroupName, string kubernetesClusterName, global::System.String jsonString, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.NetworkCloud/kubernetesClusters/" + + global::System.Uri.EscapeDataString(kubernetesClusterName) + + "/restartNode" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.KubernetesClustersRestartNode_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task KubernetesClustersRestartNode_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // declared final-state-via: location + var _finalUri = _response.GetFirstHeader(@"Location"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Kubernetes cluster. + /// The request body. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task KubernetesClustersRestartNode_Validate(string subscriptionId, string resourceGroupName, string kubernetesClusterName, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterRestartNodeParameters body, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(kubernetesClusterName),kubernetesClusterName); + await eventListener.AssertRegEx(nameof(kubernetesClusterName), kubernetesClusterName, @"^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// + /// Patch the properties of the provided Kubernetes cluster, or update the tags associated with the Kubernetes cluster. Properties + /// and tag update can be done independently. + /// + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Kubernetes cluster. + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// The request body. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 KubernetesClustersUpdate(string subscriptionId, string resourceGroupName, string kubernetesClusterName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPatchParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.NetworkCloud/kubernetesClusters/" + + global::System.Uri.EscapeDataString(kubernetesClusterName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + if (null != ifNoneMatch) + { + request.Headers.Add("If-None-Match",ifNoneMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.KubernetesClustersUpdate_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// + /// Patch the properties of the provided Kubernetes cluster, or update the tags associated with the Kubernetes cluster. Properties + /// and tag update can be done independently. + /// + /// + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// The request body. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 KubernetesClustersUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPatchParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/kubernetesClusters/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/kubernetesClusters/{kubernetesClusterName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var kubernetesClusterName = _match.Groups["kubernetesClusterName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.NetworkCloud/kubernetesClusters/" + + kubernetesClusterName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + if (null != ifNoneMatch) + { + request.Headers.Add("If-None-Match",ifNoneMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.KubernetesClustersUpdate_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// + /// Patch the properties of the provided Kubernetes cluster, or update the tags associated with the Kubernetes cluster. Properties + /// and tag update can be done independently. + /// + /// + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// The request body. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 KubernetesClustersUpdateViaIdentityWithResult(global::System.String viaIdentity, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPatchParameters body, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/kubernetesClusters/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/kubernetesClusters/{kubernetesClusterName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var kubernetesClusterName = _match.Groups["kubernetesClusterName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.NetworkCloud/kubernetesClusters/" + + kubernetesClusterName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + if (null != ifNoneMatch) + { + request.Headers.Add("If-None-Match",ifNoneMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.KubernetesClustersUpdateWithResult_Call (request, eventListener,sender); + } + } + + /// + /// Patch the properties of the provided Kubernetes cluster, or update the tags associated with the Kubernetes cluster. Properties + /// and tag update can be done independently. + /// + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Kubernetes cluster. + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// Json string supplied to the KubernetesClustersUpdate 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.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task KubernetesClustersUpdateViaJsonString(string subscriptionId, string resourceGroupName, string kubernetesClusterName, string ifMatch, string ifNoneMatch, 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.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.NetworkCloud/kubernetesClusters/" + + global::System.Uri.EscapeDataString(kubernetesClusterName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + if (null != ifNoneMatch) + { + request.Headers.Add("If-None-Match",ifNoneMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.KubernetesClustersUpdate_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// + /// Patch the properties of the provided Kubernetes cluster, or update the tags associated with the Kubernetes cluster. Properties + /// and tag update can be done independently. + /// + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Kubernetes cluster. + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// Json string supplied to the KubernetesClustersUpdate operation + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task KubernetesClustersUpdateViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string kubernetesClusterName, string ifMatch, string ifNoneMatch, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.NetworkCloud/kubernetesClusters/" + + global::System.Uri.EscapeDataString(kubernetesClusterName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + if (null != ifNoneMatch) + { + request.Headers.Add("If-None-Match",ifNoneMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.KubernetesClustersUpdateWithResult_Call (request, eventListener,sender); + } + } + + /// + /// Patch the properties of the provided Kubernetes cluster, or update the tags associated with the Kubernetes cluster. Properties + /// and tag update can be done independently. + /// + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Kubernetes cluster. + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// The request body. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 KubernetesClustersUpdateWithResult(string subscriptionId, string resourceGroupName, string kubernetesClusterName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPatchParameters body, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.NetworkCloud/kubernetesClusters/" + + global::System.Uri.EscapeDataString(kubernetesClusterName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + if (null != ifNoneMatch) + { + request.Headers.Add("If-None-Match",ifNoneMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.KubernetesClustersUpdateWithResult_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.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task KubernetesClustersUpdateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + // declared final-state-via: azure-async-operation + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + break; + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.KubernetesCluster.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task KubernetesClustersUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // declared final-state-via: azure-async-operation + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.KubernetesCluster.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Kubernetes cluster. + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// The request body. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task KubernetesClustersUpdate_Validate(string subscriptionId, string resourceGroupName, string kubernetesClusterName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPatchParameters body, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(kubernetesClusterName),kubernetesClusterName); + await eventListener.AssertRegEx(nameof(kubernetesClusterName), kubernetesClusterName, @"^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$"); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(ifNoneMatch),ifNoneMatch); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// + /// update a new layer 2 (L2) network or update the properties of the existing network. + /// + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the L2 network. + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// The request body. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 L2NetworksCreateOrUpdate(string subscriptionId, string resourceGroupName, string l2NetworkName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2Network body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.NetworkCloud/l2Networks/" + + global::System.Uri.EscapeDataString(l2NetworkName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + if (null != ifNoneMatch) + { + request.Headers.Add("If-None-Match",ifNoneMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.L2NetworksCreateOrUpdate_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// + /// update a new layer 2 (L2) network or update the properties of the existing network. + /// + /// + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// The request body. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 L2NetworksCreateOrUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2Network body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/l2Networks/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/l2Networks/{l2NetworkName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var l2NetworkName = _match.Groups["l2NetworkName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.NetworkCloud/l2Networks/" + + l2NetworkName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + if (null != ifNoneMatch) + { + request.Headers.Add("If-None-Match",ifNoneMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.L2NetworksCreateOrUpdate_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// + /// update a new layer 2 (L2) network or update the properties of the existing network. + /// + /// + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// The request body. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 L2NetworksCreateOrUpdateViaIdentityWithResult(global::System.String viaIdentity, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2Network body, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/l2Networks/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/l2Networks/{l2NetworkName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var l2NetworkName = _match.Groups["l2NetworkName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.NetworkCloud/l2Networks/" + + l2NetworkName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + if (null != ifNoneMatch) + { + request.Headers.Add("If-None-Match",ifNoneMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.L2NetworksCreateOrUpdateWithResult_Call (request, eventListener,sender); + } + } + + /// + /// update a new layer 2 (L2) network or update the properties of the existing network. + /// + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the L2 network. + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// Json string supplied to the L2NetworksCreateOrUpdate 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.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task L2NetworksCreateOrUpdateViaJsonString(string subscriptionId, string resourceGroupName, string l2NetworkName, string ifMatch, string ifNoneMatch, 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.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.NetworkCloud/l2Networks/" + + global::System.Uri.EscapeDataString(l2NetworkName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + if (null != ifNoneMatch) + { + request.Headers.Add("If-None-Match",ifNoneMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.L2NetworksCreateOrUpdate_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// + /// update a new layer 2 (L2) network or update the properties of the existing network. + /// + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the L2 network. + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// Json string supplied to the L2NetworksCreateOrUpdate operation + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A + /// that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task L2NetworksCreateOrUpdateViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string l2NetworkName, string ifMatch, string ifNoneMatch, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.NetworkCloud/l2Networks/" + + global::System.Uri.EscapeDataString(l2NetworkName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + if (null != ifNoneMatch) + { + request.Headers.Add("If-None-Match",ifNoneMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.L2NetworksCreateOrUpdateWithResult_Call (request, eventListener,sender); + } + } + + /// + /// update a new layer 2 (L2) network or update the properties of the existing network. + /// + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the L2 network. + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// The request body. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 L2NetworksCreateOrUpdateWithResult(string subscriptionId, string resourceGroupName, string l2NetworkName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2Network body, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.NetworkCloud/l2Networks/" + + global::System.Uri.EscapeDataString(l2NetworkName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + if (null != ifNoneMatch) + { + request.Headers.Add("If-None-Match",ifNoneMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.L2NetworksCreateOrUpdateWithResult_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.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A + /// that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task L2NetworksCreateOrUpdateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + // declared final-state-via: azure-async-operation + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + break; + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.L2Network.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task L2NetworksCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // declared final-state-via: azure-async-operation + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.L2Network.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the L2 network. + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// The request body. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task L2NetworksCreateOrUpdate_Validate(string subscriptionId, string resourceGroupName, string l2NetworkName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2Network body, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(l2NetworkName),l2NetworkName); + await eventListener.AssertRegEx(nameof(l2NetworkName), l2NetworkName, @"^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$"); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(ifNoneMatch),ifNoneMatch); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Delete the provided layer 2 (L2) network. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the L2 network. + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task L2NetworksDelete(string subscriptionId, string resourceGroupName, string l2NetworkName, string ifMatch, string ifNoneMatch, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.NetworkCloud/l2Networks/" + + global::System.Uri.EscapeDataString(l2NetworkName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + if (null != ifNoneMatch) + { + request.Headers.Add("If-None-Match",ifNoneMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.L2NetworksDelete_Call (request, onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Delete the provided layer 2 (L2) network. + /// + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task L2NetworksDeleteViaIdentity(global::System.String viaIdentity, string ifMatch, string ifNoneMatch, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/l2Networks/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/l2Networks/{l2NetworkName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var l2NetworkName = _match.Groups["l2NetworkName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.NetworkCloud/l2Networks/" + + l2NetworkName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + if (null != ifNoneMatch) + { + request.Headers.Add("If-None-Match",ifNoneMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.L2NetworksDelete_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.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task L2NetworksDelete_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.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // declared final-state-via: location + var _finalUri = _response.GetFirstHeader(@"Location"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the L2 network. + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task L2NetworksDelete_Validate(string subscriptionId, string resourceGroupName, string l2NetworkName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(l2NetworkName),l2NetworkName); + await eventListener.AssertRegEx(nameof(l2NetworkName), l2NetworkName, @"^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$"); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(ifNoneMatch),ifNoneMatch); + } + } + + /// Get properties of the provided layer 2 (L2) network. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the L2 network. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task L2NetworksGet(string subscriptionId, string resourceGroupName, string l2NetworkName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.NetworkCloud/l2Networks/" + + global::System.Uri.EscapeDataString(l2NetworkName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.L2NetworksGet_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Get properties of the provided layer 2 (L2) network. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task L2NetworksGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/l2Networks/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/l2Networks/{l2NetworkName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var l2NetworkName = _match.Groups["l2NetworkName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.NetworkCloud/l2Networks/" + + l2NetworkName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.L2NetworksGet_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Get properties of the provided layer 2 (L2) network. + /// + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A + /// that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task L2NetworksGetViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/l2Networks/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/l2Networks/{l2NetworkName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var l2NetworkName = _match.Groups["l2NetworkName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.NetworkCloud/l2Networks/" + + l2NetworkName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.L2NetworksGetWithResult_Call (request, eventListener,sender); + } + } + + /// Get properties of the provided layer 2 (L2) network. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the L2 network. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A + /// that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task L2NetworksGetWithResult(string subscriptionId, string resourceGroupName, string l2NetworkName, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.NetworkCloud/l2Networks/" + + global::System.Uri.EscapeDataString(l2NetworkName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.L2NetworksGetWithResult_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.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A + /// that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task L2NetworksGetWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.L2Network.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task L2NetworksGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.L2Network.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the L2 network. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task L2NetworksGet_Validate(string subscriptionId, string resourceGroupName, string l2NetworkName, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(l2NetworkName),l2NetworkName); + await eventListener.AssertRegEx(nameof(l2NetworkName), l2NetworkName, @"^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$"); + } + } + + /// Get a list of layer 2 (L2) networks in the provided resource group. + /// The ID of the target subscription. The value must be an UUID. + /// 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.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task L2NetworksListByResourceGroup(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.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.NetworkCloud/l2Networks" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.L2NetworksListByResourceGroup_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Get a list of layer 2 (L2) networks in the provided 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.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task L2NetworksListByResourceGroupViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/l2Networks$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/l2Networks'"); + } + + // 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.NetworkCloud/l2Networks" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.L2NetworksListByResourceGroup_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Get a list of layer 2 (L2) networks in the provided resource group. + /// + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task L2NetworksListByResourceGroupViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/l2Networks$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/l2Networks'"); + } + + // 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.NetworkCloud/l2Networks" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.L2NetworksListByResourceGroupWithResult_Call (request, eventListener,sender); + } + } + + /// Get a list of layer 2 (L2) networks in the provided resource group. + /// The ID of the target subscription. The value must be an UUID. + /// 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.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task L2NetworksListByResourceGroupWithResult(string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.NetworkCloud/l2Networks" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.L2NetworksListByResourceGroupWithResult_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.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task L2NetworksListByResourceGroupWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.L2NetworkList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task L2NetworksListByResourceGroup_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.L2NetworkList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task L2NetworksListByResourceGroup_Validate(string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + } + } + + /// Get a list of layer 2 (L2) networks in the provided subscription. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task L2NetworksListBySubscription(string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/providers/Microsoft.NetworkCloud/l2Networks" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.L2NetworksListBySubscription_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Get a list of layer 2 (L2) networks in the provided 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.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task L2NetworksListBySubscriptionViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-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.NetworkCloud/l2Networks$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.NetworkCloud/l2Networks'"); + } + + // 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.NetworkCloud/l2Networks" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.L2NetworksListBySubscription_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Get a list of layer 2 (L2) networks in the provided subscription. + /// + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task L2NetworksListBySubscriptionViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-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.NetworkCloud/l2Networks$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.NetworkCloud/l2Networks'"); + } + + // 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.NetworkCloud/l2Networks" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.L2NetworksListBySubscriptionWithResult_Call (request, eventListener,sender); + } + } + + /// Get a list of layer 2 (L2) networks in the provided subscription. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task L2NetworksListBySubscriptionWithResult(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/providers/Microsoft.NetworkCloud/l2Networks" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.L2NetworksListBySubscriptionWithResult_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.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task L2NetworksListBySubscriptionWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.L2NetworkList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task L2NetworksListBySubscription_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.L2NetworkList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task L2NetworksListBySubscription_Validate(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + } + } + + /// update tags associated with the provided layer 2 (L2) network. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the L2 network. + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// The request body. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 L2NetworksUpdate(string subscriptionId, string resourceGroupName, string l2NetworkName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkPatchParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.NetworkCloud/l2Networks/" + + global::System.Uri.EscapeDataString(l2NetworkName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + if (null != ifNoneMatch) + { + request.Headers.Add("If-None-Match",ifNoneMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.L2NetworksUpdate_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// update tags associated with the provided layer 2 (L2) network. + /// + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// The request body. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 L2NetworksUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkPatchParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/l2Networks/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/l2Networks/{l2NetworkName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var l2NetworkName = _match.Groups["l2NetworkName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.NetworkCloud/l2Networks/" + + l2NetworkName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + if (null != ifNoneMatch) + { + request.Headers.Add("If-None-Match",ifNoneMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.L2NetworksUpdate_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// update tags associated with the provided layer 2 (L2) network. + /// + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// The request body. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 L2NetworksUpdateViaIdentityWithResult(global::System.String viaIdentity, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkPatchParameters body, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/l2Networks/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/l2Networks/{l2NetworkName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var l2NetworkName = _match.Groups["l2NetworkName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.NetworkCloud/l2Networks/" + + l2NetworkName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + if (null != ifNoneMatch) + { + request.Headers.Add("If-None-Match",ifNoneMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.L2NetworksUpdateWithResult_Call (request, eventListener,sender); + } + } + + /// update tags associated with the provided layer 2 (L2) network. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the L2 network. + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// Json string supplied to the L2NetworksUpdate 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.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task L2NetworksUpdateViaJsonString(string subscriptionId, string resourceGroupName, string l2NetworkName, string ifMatch, string ifNoneMatch, 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.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.NetworkCloud/l2Networks/" + + global::System.Uri.EscapeDataString(l2NetworkName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + if (null != ifNoneMatch) + { + request.Headers.Add("If-None-Match",ifNoneMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.L2NetworksUpdate_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// update tags associated with the provided layer 2 (L2) network. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the L2 network. + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// Json string supplied to the L2NetworksUpdate operation + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A + /// that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task L2NetworksUpdateViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string l2NetworkName, string ifMatch, string ifNoneMatch, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.NetworkCloud/l2Networks/" + + global::System.Uri.EscapeDataString(l2NetworkName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + if (null != ifNoneMatch) + { + request.Headers.Add("If-None-Match",ifNoneMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.L2NetworksUpdateWithResult_Call (request, eventListener,sender); + } + } + + /// update tags associated with the provided layer 2 (L2) network. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the L2 network. + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// The request body. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 L2NetworksUpdateWithResult(string subscriptionId, string resourceGroupName, string l2NetworkName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkPatchParameters body, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.NetworkCloud/l2Networks/" + + global::System.Uri.EscapeDataString(l2NetworkName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + if (null != ifNoneMatch) + { + request.Headers.Add("If-None-Match",ifNoneMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.L2NetworksUpdateWithResult_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.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A + /// that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task L2NetworksUpdateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.L2Network.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task L2NetworksUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.L2Network.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the L2 network. + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// The request body. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task L2NetworksUpdate_Validate(string subscriptionId, string resourceGroupName, string l2NetworkName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkPatchParameters body, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(l2NetworkName),l2NetworkName); + await eventListener.AssertRegEx(nameof(l2NetworkName), l2NetworkName, @"^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$"); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(ifNoneMatch),ifNoneMatch); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// + /// update a new layer 3 (L3) network or update the properties of the existing network. + /// + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the L3 network. + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// The request body. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 L3NetworksCreateOrUpdate(string subscriptionId, string resourceGroupName, string l3NetworkName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3Network body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.NetworkCloud/l3Networks/" + + global::System.Uri.EscapeDataString(l3NetworkName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + if (null != ifNoneMatch) + { + request.Headers.Add("If-None-Match",ifNoneMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.L3NetworksCreateOrUpdate_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// + /// update a new layer 3 (L3) network or update the properties of the existing network. + /// + /// + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// The request body. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 L3NetworksCreateOrUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3Network body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/l3Networks/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/l3Networks/{l3NetworkName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var l3NetworkName = _match.Groups["l3NetworkName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.NetworkCloud/l3Networks/" + + l3NetworkName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + if (null != ifNoneMatch) + { + request.Headers.Add("If-None-Match",ifNoneMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.L3NetworksCreateOrUpdate_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// + /// update a new layer 3 (L3) network or update the properties of the existing network. + /// + /// + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// The request body. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 L3NetworksCreateOrUpdateViaIdentityWithResult(global::System.String viaIdentity, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3Network body, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/l3Networks/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/l3Networks/{l3NetworkName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var l3NetworkName = _match.Groups["l3NetworkName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.NetworkCloud/l3Networks/" + + l3NetworkName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + if (null != ifNoneMatch) + { + request.Headers.Add("If-None-Match",ifNoneMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.L3NetworksCreateOrUpdateWithResult_Call (request, eventListener,sender); + } + } + + /// + /// update a new layer 3 (L3) network or update the properties of the existing network. + /// + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the L3 network. + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// Json string supplied to the L3NetworksCreateOrUpdate 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.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task L3NetworksCreateOrUpdateViaJsonString(string subscriptionId, string resourceGroupName, string l3NetworkName, string ifMatch, string ifNoneMatch, 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.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.NetworkCloud/l3Networks/" + + global::System.Uri.EscapeDataString(l3NetworkName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + if (null != ifNoneMatch) + { + request.Headers.Add("If-None-Match",ifNoneMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.L3NetworksCreateOrUpdate_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// + /// update a new layer 3 (L3) network or update the properties of the existing network. + /// + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the L3 network. + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// Json string supplied to the L3NetworksCreateOrUpdate operation + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A + /// that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task L3NetworksCreateOrUpdateViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string l3NetworkName, string ifMatch, string ifNoneMatch, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.NetworkCloud/l3Networks/" + + global::System.Uri.EscapeDataString(l3NetworkName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + if (null != ifNoneMatch) + { + request.Headers.Add("If-None-Match",ifNoneMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.L3NetworksCreateOrUpdateWithResult_Call (request, eventListener,sender); + } + } + + /// + /// update a new layer 3 (L3) network or update the properties of the existing network. + /// + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the L3 network. + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// The request body. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 L3NetworksCreateOrUpdateWithResult(string subscriptionId, string resourceGroupName, string l3NetworkName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3Network body, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.NetworkCloud/l3Networks/" + + global::System.Uri.EscapeDataString(l3NetworkName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + if (null != ifNoneMatch) + { + request.Headers.Add("If-None-Match",ifNoneMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.L3NetworksCreateOrUpdateWithResult_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.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A + /// that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task L3NetworksCreateOrUpdateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + // declared final-state-via: azure-async-operation + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + break; + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.L3Network.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task L3NetworksCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // declared final-state-via: azure-async-operation + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.L3Network.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the L3 network. + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// The request body. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task L3NetworksCreateOrUpdate_Validate(string subscriptionId, string resourceGroupName, string l3NetworkName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3Network body, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(l3NetworkName),l3NetworkName); + await eventListener.AssertRegEx(nameof(l3NetworkName), l3NetworkName, @"^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$"); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(ifNoneMatch),ifNoneMatch); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Delete the provided layer 3 (L3) network. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the L3 network. + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task L3NetworksDelete(string subscriptionId, string resourceGroupName, string l3NetworkName, string ifMatch, string ifNoneMatch, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.NetworkCloud/l3Networks/" + + global::System.Uri.EscapeDataString(l3NetworkName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + if (null != ifNoneMatch) + { + request.Headers.Add("If-None-Match",ifNoneMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.L3NetworksDelete_Call (request, onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Delete the provided layer 3 (L3) network. + /// + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task L3NetworksDeleteViaIdentity(global::System.String viaIdentity, string ifMatch, string ifNoneMatch, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/l3Networks/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/l3Networks/{l3NetworkName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var l3NetworkName = _match.Groups["l3NetworkName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.NetworkCloud/l3Networks/" + + l3NetworkName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + if (null != ifNoneMatch) + { + request.Headers.Add("If-None-Match",ifNoneMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.L3NetworksDelete_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.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task L3NetworksDelete_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.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // declared final-state-via: location + var _finalUri = _response.GetFirstHeader(@"Location"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the L3 network. + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task L3NetworksDelete_Validate(string subscriptionId, string resourceGroupName, string l3NetworkName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(l3NetworkName),l3NetworkName); + await eventListener.AssertRegEx(nameof(l3NetworkName), l3NetworkName, @"^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$"); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(ifNoneMatch),ifNoneMatch); + } + } + + /// Get properties of the provided layer 3 (L3) network. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the L3 network. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task L3NetworksGet(string subscriptionId, string resourceGroupName, string l3NetworkName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.NetworkCloud/l3Networks/" + + global::System.Uri.EscapeDataString(l3NetworkName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.L3NetworksGet_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Get properties of the provided layer 3 (L3) network. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task L3NetworksGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/l3Networks/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/l3Networks/{l3NetworkName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var l3NetworkName = _match.Groups["l3NetworkName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.NetworkCloud/l3Networks/" + + l3NetworkName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.L3NetworksGet_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Get properties of the provided layer 3 (L3) network. + /// + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A + /// that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task L3NetworksGetViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/l3Networks/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/l3Networks/{l3NetworkName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var l3NetworkName = _match.Groups["l3NetworkName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.NetworkCloud/l3Networks/" + + l3NetworkName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.L3NetworksGetWithResult_Call (request, eventListener,sender); + } + } + + /// Get properties of the provided layer 3 (L3) network. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the L3 network. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A + /// that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task L3NetworksGetWithResult(string subscriptionId, string resourceGroupName, string l3NetworkName, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.NetworkCloud/l3Networks/" + + global::System.Uri.EscapeDataString(l3NetworkName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.L3NetworksGetWithResult_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.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A + /// that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task L3NetworksGetWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.L3Network.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task L3NetworksGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.L3Network.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the L3 network. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task L3NetworksGet_Validate(string subscriptionId, string resourceGroupName, string l3NetworkName, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(l3NetworkName),l3NetworkName); + await eventListener.AssertRegEx(nameof(l3NetworkName), l3NetworkName, @"^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$"); + } + } + + /// Get a list of layer 3 (L3) networks in the provided resource group. + /// The ID of the target subscription. The value must be an UUID. + /// 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.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task L3NetworksListByResourceGroup(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.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.NetworkCloud/l3Networks" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.L3NetworksListByResourceGroup_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Get a list of layer 3 (L3) networks in the provided 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.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task L3NetworksListByResourceGroupViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/l3Networks$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/l3Networks'"); + } + + // 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.NetworkCloud/l3Networks" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.L3NetworksListByResourceGroup_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Get a list of layer 3 (L3) networks in the provided resource group. + /// + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task L3NetworksListByResourceGroupViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/l3Networks$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/l3Networks'"); + } + + // 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.NetworkCloud/l3Networks" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.L3NetworksListByResourceGroupWithResult_Call (request, eventListener,sender); + } + } + + /// Get a list of layer 3 (L3) networks in the provided resource group. + /// The ID of the target subscription. The value must be an UUID. + /// 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.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task L3NetworksListByResourceGroupWithResult(string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.NetworkCloud/l3Networks" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.L3NetworksListByResourceGroupWithResult_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.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task L3NetworksListByResourceGroupWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.L3NetworkList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task L3NetworksListByResourceGroup_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.L3NetworkList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task L3NetworksListByResourceGroup_Validate(string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + } + } + + /// Get a list of layer 3 (L3) networks in the provided subscription. + /// The ID of the target subscription. The value must be an UUID. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task L3NetworksListBySubscription(string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/providers/Microsoft.NetworkCloud/l3Networks" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.L3NetworksListBySubscription_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Get a list of layer 3 (L3) networks in the provided 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.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task L3NetworksListBySubscriptionViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-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.NetworkCloud/l3Networks$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.NetworkCloud/l3Networks'"); + } + + // 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.NetworkCloud/l3Networks" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.L3NetworksListBySubscription_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Get a list of layer 3 (L3) networks in the provided subscription. + /// + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task L3NetworksListBySubscriptionViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-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.NetworkCloud/l3Networks$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.NetworkCloud/l3Networks'"); + } + + // 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.NetworkCloud/l3Networks" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.L3NetworksListBySubscriptionWithResult_Call (request, eventListener,sender); + } + } + + /// Get a list of layer 3 (L3) networks in the provided subscription. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task L3NetworksListBySubscriptionWithResult(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/providers/Microsoft.NetworkCloud/l3Networks" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.L3NetworksListBySubscriptionWithResult_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.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task L3NetworksListBySubscriptionWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.L3NetworkList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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 @@ -13721,7 +35011,7 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task ConsolesCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task L3NetworksListBySubscription_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -13732,102 +35022,7 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // this operation supports x-ms-long-running-operation - var _originalUri = request.RequestUri.AbsoluteUri; - // declared final-state-via: azure-async-operation - var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - var location = _response.GetFirstHeader(@"Location"); - while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) - { - - // get the delay before polling. (default to 30 seconds if not present) - int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // start the delay timer (we'll await later...) - var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); - - // while we wait, let's grab the headers and get ready to poll. - if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { - asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - } - if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { - location = _response.GetFirstHeader(@"Location"); - } - var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; - request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); - - // and let's look at the current response body and see if we have some information we can give back to the listener - var content = await _response.Content.ReadAsStringAsync(); - await waiting; - - // check for cancellation - if( eventListener.Token.IsCancellationRequested ) { return; } - - // drop the old response - _response?.Dispose(); - - // make the polling call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // if we got back an OK, take a peek inside and see if it's done - if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) - { - var error = false; - try { - if( Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) - { - var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); - if( state is null ) - { - // the body doesn't contain any information that has the state of the LRO - // we're going to just get out, and let the consumer have the result - break; - } - - switch( state?.ToString()?.ToLower() ) - { - case "failed": - error = true; - break; - case "succeeded": - case "canceled": - // we're done polling. - break; - - default: - // need to keep polling! - _response.StatusCode = global::System.Net.HttpStatusCode.Created; - continue; - } - } - } catch { - // if we run into a problem peeking into the result, - // we really don't want to do anything special. - } - if (error) { - throw new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException(_response); - } - } - - // check for terminal status code - if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) - { - continue; - } - // we are done polling, do a request on final target? - // create a new request with the final uri - request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); - - // drop the old response - _response?.Dispose(); - - // make the final call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - break; - } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -13835,13 +35030,13 @@ public partial class NetworkCloud case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.Console.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.L3NetworkList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -13857,61 +35052,42 @@ public partial class NetworkCloud } /// - /// 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 value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of the virtual machine. - /// The name of the virtual machine console. - /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify - /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. - /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. - /// Other values will result in error from server as they are not supported. - /// The request body. /// an instance that will receive events. /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task ConsolesCreateOrUpdate_Validate(string subscriptionId, string resourceGroupName, string virtualMachineName, string consoleName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsole body, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task L3NetworksListBySubscription_Validate(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); - await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); - await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); - await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertNotNull(nameof(virtualMachineName),virtualMachineName); - await eventListener.AssertRegEx(nameof(virtualMachineName),virtualMachineName,@"^([a-zA-Z0-9][a-zA-Z0-9]{0,62}[a-zA-Z0-9])$"); - await eventListener.AssertNotNull(nameof(consoleName),consoleName); - await eventListener.AssertRegEx(nameof(consoleName),consoleName,@"^default$"); - await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); - await eventListener.AssertNotNull(nameof(ifNoneMatch),ifNoneMatch); - await eventListener.AssertNotNull(nameof(body), body); - await eventListener.AssertObjectIsValid(nameof(body), body); } } - /// Delete the provided virtual machine console. + /// update tags associated with the provided layer 3 (L3) network. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. - /// The name of the virtual machine. - /// The name of the virtual machine console. + /// The name of the L3 network. /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. /// Other values will result in error from server as they are not supported. + /// The request body. /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns 204 (NoContent). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ConsolesDelete(string subscriptionId, string resourceGroupName, string virtualMachineName, string consoleName, string ifMatch, string ifNoneMatch, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task L3NetworksUpdate(string subscriptionId, string resourceGroupName, string l3NetworkName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkPatchParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -13923,10 +35099,8 @@ public partial class NetworkCloud + global::System.Uri.EscapeDataString(subscriptionId) + "/resourceGroups/" + global::System.Uri.EscapeDataString(resourceGroupName) - + "/providers/Microsoft.NetworkCloud/virtualMachines/" - + global::System.Uri.EscapeDataString(virtualMachineName) - + "/consoles/" - + global::System.Uri.EscapeDataString(consoleName) + + "/providers/Microsoft.NetworkCloud/l3Networks/" + + global::System.Uri.EscapeDataString(l3NetworkName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -13935,7 +35109,7 @@ public partial class NetworkCloud // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Delete, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Patch, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } // add headers parameters @@ -13949,27 +35123,32 @@ public partial class NetworkCloud } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ConsolesDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + await this.L3NetworksUpdate_Call (request, onOk,onDefault,eventListener,sender); } } - /// Delete the provided virtual machine console. + /// update tags associated with the provided layer 3 (L3) network. /// /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. /// Other values will result in error from server as they are not supported. + /// The request body. /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns 204 (NoContent). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ConsolesDeleteViaIdentity(global::System.String viaIdentity, string ifMatch, string ifNoneMatch, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task L3NetworksUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkPatchParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -13977,27 +35156,24 @@ public partial class NetworkCloud { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/virtualMachines/(?[^/]+)/consoles/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/l3Networks/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/virtualMachines/{virtualMachineName}/consoles/{consoleName}'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/l3Networks/{l3NetworkName}'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var virtualMachineName = _match.Groups["virtualMachineName"].Value; - var consoleName = _match.Groups["consoleName"].Value; + var l3NetworkName = _match.Groups["l3NetworkName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + subscriptionId + "/resourceGroups/" + resourceGroupName - + "/providers/Microsoft.NetworkCloud/virtualMachines/" - + virtualMachineName - + "/consoles/" - + consoleName + + "/providers/Microsoft.NetworkCloud/l3Networks/" + + l3NetworkName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -14006,7 +35182,7 @@ public partial class NetworkCloud // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Delete, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Patch, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } // add headers parameters @@ -14020,203 +35196,95 @@ public partial class NetworkCloud } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ConsolesDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + await this.L3NetworksUpdate_Call (request, onOk,onDefault,eventListener,sender); } } - /// Actual wire call for method. - /// the prepared HttpRequestMessage 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 tags associated with the provided layer 3 (L3) network. + /// + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// The request body. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ConsolesDelete_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.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task L3NetworksUpdateViaIdentityWithResult(global::System.String viaIdentity, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkPatchParameters body, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate) { + var apiVersion = @"2025-02-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.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // this operation supports x-ms-long-running-operation - var _originalUri = request.RequestUri.AbsoluteUri; - // declared final-state-via: location - var _finalUri = _response.GetFirstHeader(@"Location"); - var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - var location = _response.GetFirstHeader(@"Location"); - while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) - { - - // get the delay before polling. (default to 30 seconds if not present) - int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // start the delay timer (we'll await later...) - var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); - - // while we wait, let's grab the headers and get ready to poll. - if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { - asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - } - if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { - location = _response.GetFirstHeader(@"Location"); - } - var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; - request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); - - // and let's look at the current response body and see if we have some information we can give back to the listener - var content = await _response.Content.ReadAsStringAsync(); - await waiting; - - // check for cancellation - if( eventListener.Token.IsCancellationRequested ) { return; } - - // drop the old response - _response?.Dispose(); - - // make the polling call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // verify that Identity format is an exact match for uri - // if we got back an OK, take a peek inside and see if it's done - if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) - { - var error = false; - try { - if( Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) - { - var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); - if( state is null ) - { - // the body doesn't contain any information that has the state of the LRO - // we're going to just get out, and let the consumer have the result - break; - } - - switch( state?.ToString()?.ToLower() ) - { - case "failed": - error = true; - break; - case "succeeded": - case "canceled": - // we're done polling. - break; - - default: - // need to keep polling! - _response.StatusCode = global::System.Net.HttpStatusCode.Created; - continue; - } - } - } catch { - // if we run into a problem peeking into the result, - // we really don't want to do anything special. - } - if (error) { - throw new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException(_response); - } - } + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/l3Networks/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/l3Networks/{l3NetworkName}'"); + } - // check for terminal status code - if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) - { - continue; - } - // we are done polling, do a request on final target? - // create a new request with the final uri - request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var l3NetworkName = _match.Groups["l3NetworkName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.NetworkCloud/l3Networks/" + + l3NetworkName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - // drop the old response - _response?.Dispose(); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - // make the final call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - break; - } - var _contentType = _response.Content.Headers.ContentType?.MediaType; + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - switch ( _response.StatusCode ) - { - case global::System.Net.HttpStatusCode.OK: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onNoContent(_response); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); } - finally + if (null != ifNoneMatch) { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); + request.Headers.Add("If-None-Match",ifNoneMatch); } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.L3NetworksUpdateWithResult_Call (request, eventListener,sender); } } - /// - /// Validation method for method. Call this like the actual call, but you will get validation - /// events back. - /// + /// update tags associated with the provided layer 3 (L3) network. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. - /// The name of the virtual machine. - /// The name of the virtual machine console. + /// The name of the L3 network. /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. /// Other values will result in error from server as they are not supported. - /// an instance that will receive events. - /// - /// A that will be complete when handling of the response is completed. - /// - internal async global::System.Threading.Tasks.Task ConsolesDelete_Validate(string subscriptionId, string resourceGroupName, string virtualMachineName, string consoleName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) - { - using( NoSynchronizationContext ) - { - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); - await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); - await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); - await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); - await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertNotNull(nameof(virtualMachineName),virtualMachineName); - await eventListener.AssertRegEx(nameof(virtualMachineName),virtualMachineName,@"^([a-zA-Z0-9][a-zA-Z0-9]{0,62}[a-zA-Z0-9])$"); - await eventListener.AssertNotNull(nameof(consoleName),consoleName); - await eventListener.AssertRegEx(nameof(consoleName),consoleName,@"^default$"); - await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); - await eventListener.AssertNotNull(nameof(ifNoneMatch),ifNoneMatch); - } - } - - /// Get properties of the provided virtual machine console. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of the virtual machine. - /// The name of the virtual machine console. + /// Json string supplied to the L3NetworksUpdate 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). @@ -14225,7 +35293,7 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task ConsolesGet(string subscriptionId, string resourceGroupName, string virtualMachineName, string consoleName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task L3NetworksUpdateViaJsonString(string subscriptionId, string resourceGroupName, string l3NetworkName, string ifMatch, string ifNoneMatch, 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.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -14237,10 +35305,8 @@ public partial class NetworkCloud + global::System.Uri.EscapeDataString(subscriptionId) + "/resourceGroups/" + global::System.Uri.EscapeDataString(resourceGroupName) - + "/providers/Microsoft.NetworkCloud/virtualMachines/" - + global::System.Uri.EscapeDataString(virtualMachineName) - + "/consoles/" - + global::System.Uri.EscapeDataString(consoleName) + + "/providers/Microsoft.NetworkCloud/l3Networks/" + + global::System.Uri.EscapeDataString(l3NetworkName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -14249,161 +35315,106 @@ public partial class NetworkCloud // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Patch, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + if (null != ifNoneMatch) + { + request.Headers.Add("If-None-Match",ifNoneMatch); + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ConsolesGet_Call(request,onOk,onDefault,eventListener,sender); + await this.L3NetworksUpdate_Call (request, onOk,onDefault,eventListener,sender); } } - /// Get properties of the provided virtual machine console. - /// - /// a delegate that is called 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 tags associated with the provided layer 3 (L3) network. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the L3 network. + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// Json string supplied to the L3NetworksUpdate operation /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ConsolesGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task L3NetworksUpdateViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string l3NetworkName, string ifMatch, string ifNoneMatch, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { var apiVersion = @"2025-02-01"; // Constant Parameters using( NoSynchronizationContext ) { - // verify that Identity format is an exact match for uri - - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/virtualMachines/(?[^/]+)/consoles/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); - if (!_match.Success) - { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/virtualMachines/{virtualMachineName}/consoles/{consoleName}'"); - } - - // replace URI parameters with values from identity - var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var virtualMachineName = _match.Groups["virtualMachineName"].Value; - var consoleName = _match.Groups["consoleName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" - + subscriptionId + + global::System.Uri.EscapeDataString(subscriptionId) + "/resourceGroups/" - + resourceGroupName - + "/providers/Microsoft.NetworkCloud/virtualMachines/" - + virtualMachineName - + "/consoles/" - + consoleName + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.NetworkCloud/l3Networks/" + + global::System.Uri.EscapeDataString(l3NetworkName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.ConsolesGet_Call(request,onOk,onDefault,eventListener,sender); - } - } + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - /// Actual wire call for method. - /// the prepared HttpRequestMessage to send. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. - /// - /// A that will be complete when handling of the response is completed. - /// - internal async global::System.Threading.Tasks.Task ConsolesGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) - { - using( NoSynchronizationContext ) - { - global::System.Net.Http.HttpResponseMessage _response = null; - try + // add headers parameters + if (null != ifMatch) { - var sendTask = sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - var _contentType = _response.Content.Headers.ContentType?.MediaType; - - switch ( _response.StatusCode ) - { - case global::System.Net.HttpStatusCode.OK: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.Console.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } + request.Headers.Add("If-Match",ifMatch); } - finally + if (null != ifNoneMatch) { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); + request.Headers.Add("If-None-Match",ifNoneMatch); } - } - } - /// - /// Validation method for method. Call this like the actual call, but you will get validation events - /// back. - /// - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of the virtual machine. - /// The name of the virtual machine console. - /// an instance that will receive events. - /// - /// A that will be complete when handling of the response is completed. - /// - internal async global::System.Threading.Tasks.Task ConsolesGet_Validate(string subscriptionId, string resourceGroupName, string virtualMachineName, string consoleName, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) - { - using( NoSynchronizationContext ) - { - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); - await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); - await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); - await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); - await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertNotNull(nameof(virtualMachineName),virtualMachineName); - await eventListener.AssertRegEx(nameof(virtualMachineName),virtualMachineName,@"^([a-zA-Z0-9][a-zA-Z0-9]{0,62}[a-zA-Z0-9])$"); - await eventListener.AssertNotNull(nameof(consoleName),consoleName); - await eventListener.AssertRegEx(nameof(consoleName),consoleName,@"^default$"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.L3NetworksUpdateWithResult_Call (request, eventListener,sender); } } - /// Get a list of consoles for the provided virtual machine. + /// update tags associated with the provided layer 3 (L3) network. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. - /// The name of the virtual machine. - /// a delegate that is called 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 L3 network. + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// The request body. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ConsolesListByVirtualMachine(string subscriptionId, string resourceGroupName, string virtualMachineName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task L3NetworksUpdateWithResult(string subscriptionId, string resourceGroupName, string l3NetworkName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkPatchParameters body, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -14415,81 +35426,100 @@ public partial class NetworkCloud + global::System.Uri.EscapeDataString(subscriptionId) + "/resourceGroups/" + global::System.Uri.EscapeDataString(resourceGroupName) - + "/providers/Microsoft.NetworkCloud/virtualMachines/" - + global::System.Uri.EscapeDataString(virtualMachineName) - + "/consoles" + + "/providers/Microsoft.NetworkCloud/l3Networks/" + + global::System.Uri.EscapeDataString(l3NetworkName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + if (null != ifNoneMatch) + { + request.Headers.Add("If-None-Match",ifNoneMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.ConsolesListByVirtualMachine_Call(request,onOk,onDefault,eventListener,sender); + return await this.L3NetworksUpdateWithResult_Call (request, eventListener,sender); } } - /// Get a list of consoles for the provided virtual machine. - /// - /// a delegate that is called 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.NetworkCloud.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 ConsolesListByVirtualMachineViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task L3NetworksUpdateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { - var apiVersion = @"2025-02-01"; - // Constant Parameters using( NoSynchronizationContext ) { - // verify that Identity format is an exact match for uri - - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/virtualMachines/(?[^/]+)/consoles$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); - if (!_match.Success) + global::System.Net.Http.HttpResponseMessage _response = null; + try { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/virtualMachines/{virtualMachineName}/consoles'"); - } - - // replace URI parameters with values from identity - var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var virtualMachineName = _match.Groups["virtualMachineName"].Value; - // construct URL - var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/subscriptions/" - + subscriptionId - + "/resourceGroups/" - + resourceGroupName - + "/providers/Microsoft.NetworkCloud/virtualMachines/" - + virtualMachineName - + "/consoles" - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - // generate request object - var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.ConsolesListByVirtualMachine_Call(request,onOk,onDefault,eventListener,sender); + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.L3Network.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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 @@ -14499,7 +35529,7 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task ConsolesListByVirtualMachine_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task L3NetworksUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -14510,6 +35540,7 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -14517,13 +35548,13 @@ public partial class NetworkCloud case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ConsoleList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.L3Network.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -14539,17 +35570,22 @@ public partial class NetworkCloud } /// - /// 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 value must be an UUID. /// The name of the resource group. The name is case insensitive. - /// The name of the virtual machine. + /// The name of the L3 network. + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// The request body. /// an instance that will receive events. /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task ConsolesListByVirtualMachine_Validate(string subscriptionId, string resourceGroupName, string virtualMachineName, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task L3NetworksUpdate_Validate(string subscriptionId, string resourceGroupName, string l3NetworkName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkPatchParameters body, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -14558,19 +35594,22 @@ public partial class NetworkCloud await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertNotNull(nameof(virtualMachineName),virtualMachineName); - await eventListener.AssertRegEx(nameof(virtualMachineName),virtualMachineName,@"^([a-zA-Z0-9][a-zA-Z0-9]{0,62}[a-zA-Z0-9])$"); + await eventListener.AssertNotNull(nameof(l3NetworkName),l3NetworkName); + await eventListener.AssertRegEx(nameof(l3NetworkName), l3NetworkName, @"^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$"); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(ifNoneMatch),ifNoneMatch); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); } } /// - /// Patch the properties of the provided virtual machine console, or update the tags associated with the virtual machine console. - /// Properties and tag updates can be done independently. + /// update new or update the existing metrics configuration of the provided cluster. /// /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. - /// The name of the virtual machine. - /// The name of the virtual machine console. + /// The name of the cluster. + /// The name of the metrics configuration for the cluster. /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. @@ -14581,10 +35620,11 @@ public partial class NetworkCloud /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ConsolesUpdate(string subscriptionId, string resourceGroupName, string virtualMachineName, string consoleName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsolePatchParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task MetricsConfigurationsCreateOrUpdate(string subscriptionId, string resourceGroupName, string clusterName, string metricsConfigurationName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfiguration body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -14596,10 +35636,10 @@ public partial class NetworkCloud + global::System.Uri.EscapeDataString(subscriptionId) + "/resourceGroups/" + global::System.Uri.EscapeDataString(resourceGroupName) - + "/providers/Microsoft.NetworkCloud/virtualMachines/" - + global::System.Uri.EscapeDataString(virtualMachineName) - + "/consoles/" - + global::System.Uri.EscapeDataString(consoleName) + + "/providers/Microsoft.NetworkCloud/clusters/" + + global::System.Uri.EscapeDataString(clusterName) + + "/metricsConfigurations/" + + global::System.Uri.EscapeDataString(metricsConfigurationName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -14608,7 +35648,7 @@ public partial class NetworkCloud // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Patch, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Put, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } // add headers parameters @@ -14623,17 +35663,16 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // 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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ConsolesUpdate_Call(request,onOk,onDefault,eventListener,sender); + await this.MetricsConfigurationsCreateOrUpdate_Call (request, onOk,onDefault,eventListener,sender); } } /// - /// Patch the properties of the provided virtual machine console, or update the tags associated with the virtual machine console. - /// Properties and tag updates can be done independently. + /// update new or update the existing metrics configuration of the provided cluster. /// /// /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify @@ -14646,10 +35685,11 @@ public partial class NetworkCloud /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ConsolesUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsolePatchParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task MetricsConfigurationsCreateOrUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfiguration body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -14657,27 +35697,27 @@ public partial class NetworkCloud { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/virtualMachines/(?[^/]+)/consoles/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/clusters/(?[^/]+)/metricsConfigurations/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/virtualMachines/{virtualMachineName}/consoles/{consoleName}'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/metricsConfigurations/{metricsConfigurationName}'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var virtualMachineName = _match.Groups["virtualMachineName"].Value; - var consoleName = _match.Groups["consoleName"].Value; + var clusterName = _match.Groups["clusterName"].Value; + var metricsConfigurationName = _match.Groups["metricsConfigurationName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + subscriptionId + "/resourceGroups/" + resourceGroupName - + "/providers/Microsoft.NetworkCloud/virtualMachines/" - + virtualMachineName - + "/consoles/" - + consoleName + + "/providers/Microsoft.NetworkCloud/clusters/" + + clusterName + + "/metricsConfigurations/" + + metricsConfigurationName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -14686,7 +35726,7 @@ public partial class NetworkCloud // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Patch, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Put, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } // add headers parameters @@ -14701,217 +35741,176 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // 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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.ConsolesUpdate_Call(request,onOk,onDefault,eventListener,sender); + await this.MetricsConfigurationsCreateOrUpdate_Call (request, onOk,onDefault,eventListener,sender); } } - /// Actual wire call for method. - /// the prepared HttpRequestMessage to send. - /// a delegate that is called 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 new or update the existing metrics configuration of the provided cluster. + /// + /// + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// The request body. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ConsolesUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task MetricsConfigurationsCreateOrUpdateViaIdentityWithResult(global::System.String viaIdentity, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfiguration body, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate) { + var apiVersion = @"2025-02-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.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // this operation supports x-ms-long-running-operation - var _originalUri = request.RequestUri.AbsoluteUri; - // declared final-state-via: azure-async-operation - var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - var location = _response.GetFirstHeader(@"Location"); - while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) - { - - // get the delay before polling. (default to 30 seconds if not present) - int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // start the delay timer (we'll await later...) - var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); - - // while we wait, let's grab the headers and get ready to poll. - if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { - asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - } - if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { - location = _response.GetFirstHeader(@"Location"); - } - var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; - request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); - - // and let's look at the current response body and see if we have some information we can give back to the listener - var content = await _response.Content.ReadAsStringAsync(); - await waiting; - - // check for cancellation - if( eventListener.Token.IsCancellationRequested ) { return; } - - // drop the old response - _response?.Dispose(); - - // make the polling call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // verify that Identity format is an exact match for uri - // if we got back an OK, take a peek inside and see if it's done - if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) - { - var error = false; - try { - if( Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) - { - var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); - if( state is null ) - { - // the body doesn't contain any information that has the state of the LRO - // we're going to just get out, and let the consumer have the result - break; - } - - switch( state?.ToString()?.ToLower() ) - { - case "failed": - error = true; - break; - case "succeeded": - case "canceled": - // we're done polling. - break; - - default: - // need to keep polling! - _response.StatusCode = global::System.Net.HttpStatusCode.Created; - continue; - } - } - } catch { - // if we run into a problem peeking into the result, - // we really don't want to do anything special. - } - if (error) { - throw new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException(_response); - } - } + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/clusters/(?[^/]+)/metricsConfigurations/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/metricsConfigurations/{metricsConfigurationName}'"); + } - // check for terminal status code - if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) - { - continue; - } - // we are done polling, do a request on final target? - // create a new request with the final uri - request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var clusterName = _match.Groups["clusterName"].Value; + var metricsConfigurationName = _match.Groups["metricsConfigurationName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.NetworkCloud/clusters/" + + clusterName + + "/metricsConfigurations/" + + metricsConfigurationName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - // drop the old response - _response?.Dispose(); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - // make the final call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - break; - } - var _contentType = _response.Content.Headers.ContentType?.MediaType; + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - switch ( _response.StatusCode ) - { - case global::System.Net.HttpStatusCode.OK: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.Console.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); } - finally + if (null != ifNoneMatch) { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); + request.Headers.Add("If-None-Match",ifNoneMatch); } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.MetricsConfigurationsCreateOrUpdateWithResult_Call (request, eventListener,sender); } } /// - /// Validation method for method. Call this like the actual call, but you will get validation - /// events back. + /// update new or update the existing metrics configuration of the provided cluster. /// /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. - /// The name of the virtual machine. - /// The name of the virtual machine console. + /// The name of the cluster. + /// The name of the metrics configuration for the cluster. /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. /// Other values will result in error from server as they are not supported. - /// The request body. + /// Json string supplied to the MetricsConfigurationsCreateOrUpdate 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.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task ConsolesUpdate_Validate(string subscriptionId, string resourceGroupName, string virtualMachineName, string consoleName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsolePatchParameters body, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) + public async global::System.Threading.Tasks.Task MetricsConfigurationsCreateOrUpdateViaJsonString(string subscriptionId, string resourceGroupName, string clusterName, string metricsConfigurationName, string ifMatch, string ifNoneMatch, 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.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { + var apiVersion = @"2025-02-01"; + // Constant Parameters using( NoSynchronizationContext ) { - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); - await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); - await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); - await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); - await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertNotNull(nameof(virtualMachineName),virtualMachineName); - await eventListener.AssertRegEx(nameof(virtualMachineName),virtualMachineName,@"^([a-zA-Z0-9][a-zA-Z0-9]{0,62}[a-zA-Z0-9])$"); - await eventListener.AssertNotNull(nameof(consoleName),consoleName); - await eventListener.AssertRegEx(nameof(consoleName),consoleName,@"^default$"); - await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); - await eventListener.AssertNotNull(nameof(ifNoneMatch),ifNoneMatch); - 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.NetworkCloud/clusters/" + + global::System.Uri.EscapeDataString(clusterName) + + "/metricsConfigurations/" + + global::System.Uri.EscapeDataString(metricsConfigurationName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + if (null != ifNoneMatch) + { + request.Headers.Add("If-None-Match",ifNoneMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.MetricsConfigurationsCreateOrUpdate_Call (request, onOk,onDefault,eventListener,sender); } } /// - /// Create a new Kubernetes cluster feature or update properties of the Kubernetes cluster feature if it exists. + /// update new or update the existing metrics configuration of the provided cluster. /// /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. - /// The name of the Kubernetes cluster. - /// The name of the feature. + /// The name of the cluster. + /// The name of the metrics configuration for the cluster. /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. /// Other values will result in error from server as they are not supported. - /// The request body. - /// a delegate that is called 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 MetricsConfigurationsCreateOrUpdate operation /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 KubernetesClusterFeaturesCreateOrUpdate(string subscriptionId, string resourceGroupName, string kubernetesClusterName, string featureName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeature body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task MetricsConfigurationsCreateOrUpdateViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string clusterName, string metricsConfigurationName, string ifMatch, string ifNoneMatch, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -14923,20 +35922,20 @@ public partial class NetworkCloud + global::System.Uri.EscapeDataString(subscriptionId) + "/resourceGroups/" + global::System.Uri.EscapeDataString(resourceGroupName) - + "/providers/Microsoft.NetworkCloud/kubernetesClusters/" - + global::System.Uri.EscapeDataString(kubernetesClusterName) - + "/features/" - + global::System.Uri.EscapeDataString(featureName) + + "/providers/Microsoft.NetworkCloud/clusters/" + + global::System.Uri.EscapeDataString(clusterName) + + "/metricsConfigurations/" + + global::System.Uri.EscapeDataString(metricsConfigurationName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Put, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } // add headers parameters if (null != ifMatch) @@ -14948,72 +35947,61 @@ public partial class NetworkCloud request.Headers.Add("If-None-Match",ifNoneMatch); } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.KubernetesClusterFeaturesCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + return await this.MetricsConfigurationsCreateOrUpdateWithResult_Call (request, eventListener,sender); } } /// - /// Create a new Kubernetes cluster feature or update properties of the Kubernetes cluster feature if it exists. + /// update new or update the existing metrics configuration of the provided cluster. /// - /// + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the cluster. + /// The name of the metrics configuration for the cluster. /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. /// Other values will result in error from server as they are not supported. /// The request body. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 KubernetesClusterFeaturesCreateOrUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeature body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task MetricsConfigurationsCreateOrUpdateWithResult(string subscriptionId, string resourceGroupName, string clusterName, string metricsConfigurationName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfiguration body, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2025-02-01"; // Constant Parameters using( NoSynchronizationContext ) { - // verify that Identity format is an exact match for uri - - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/kubernetesClusters/(?[^/]+)/features/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); - if (!_match.Success) - { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/kubernetesClusters/{kubernetesClusterName}/features/{featureName}'"); - } - - // replace URI parameters with values from identity - var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var kubernetesClusterName = _match.Groups["kubernetesClusterName"].Value; - var featureName = _match.Groups["featureName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" - + subscriptionId + + global::System.Uri.EscapeDataString(subscriptionId) + "/resourceGroups/" - + resourceGroupName - + "/providers/Microsoft.NetworkCloud/kubernetesClusters/" - + kubernetesClusterName - + "/features/" - + featureName + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.NetworkCloud/clusters/" + + global::System.Uri.EscapeDataString(clusterName) + + "/metricsConfigurations/" + + global::System.Uri.EscapeDataString(metricsConfigurationName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Put, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } // add headers parameters if (null != ifMatch) @@ -15025,18 +36013,172 @@ public partial class NetworkCloud request.Headers.Add("If-None-Match",ifNoneMatch); } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.KubernetesClusterFeaturesCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + return await this.MetricsConfigurationsCreateOrUpdateWithResult_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.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task MetricsConfigurationsCreateOrUpdateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + // declared final-state-via: azure-async-operation + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + break; + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterMetricsConfiguration.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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). @@ -15047,31 +36189,28 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task KubernetesClusterFeaturesCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task MetricsConfigurationsCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { global::System.Net.Http.HttpResponseMessage _response = null; try { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; var sendTask = sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // this operation supports x-ms-long-running-operation - var _originalUri = request.RequestUri.AbsoluteUri; // declared final-state-via: azure-async-operation var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) { - - // get the delay before polling. (default to 30 seconds if not present) - int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // start the delay timer (we'll await later...) - var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } // while we wait, let's grab the headers and get ready to poll. if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { @@ -15080,15 +36219,14 @@ public partial class NetworkCloud if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { location = _response.GetFirstHeader(@"Location"); } - var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); // and let's look at the current response body and see if we have some information we can give back to the listener var content = await _response.Content.ReadAsStringAsync(); - await waiting; - - // check for cancellation - if( eventListener.Token.IsCancellationRequested ) { return; } // drop the old response _response?.Dispose(); @@ -15097,45 +36235,45 @@ public partial class NetworkCloud _response = await sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // if we got back an OK, take a peek inside and see if it's done - if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) - { - var error = false; - try { - if( Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) - { - var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); - if( state is null ) - { - // the body doesn't contain any information that has the state of the LRO - // we're going to just get out, and let the consumer have the result - break; - } - - switch( state?.ToString()?.ToLower() ) - { - case "failed": - error = true; + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. break; - case "succeeded": - case "canceled": - // we're done polling. - break; - - default: - // need to keep polling! - _response.StatusCode = global::System.Net.HttpStatusCode.Created; - continue; - } - } - } catch { - // if we run into a problem peeking into the result, - // we really don't want to do anything special. - } - if (error) { - throw new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException(_response); - } - } + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException(_response); + } + } // check for terminal status code if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) @@ -15154,6 +36292,7 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } break; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -15161,13 +36300,13 @@ public partial class NetworkCloud case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.KubernetesClusterFeature.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterMetricsConfiguration.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -15183,13 +36322,13 @@ public partial class NetworkCloud } /// - /// 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 value must be an UUID. /// The name of the resource group. The name is case insensitive. - /// The name of the Kubernetes cluster. - /// The name of the feature. + /// The name of the cluster. + /// The name of the metrics configuration for the cluster. /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. @@ -15199,7 +36338,7 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task KubernetesClusterFeaturesCreateOrUpdate_Validate(string subscriptionId, string resourceGroupName, string kubernetesClusterName, string featureName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeature body, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task MetricsConfigurationsCreateOrUpdate_Validate(string subscriptionId, string resourceGroupName, string clusterName, string metricsConfigurationName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfiguration body, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -15208,10 +36347,10 @@ public partial class NetworkCloud await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertNotNull(nameof(kubernetesClusterName),kubernetesClusterName); - await eventListener.AssertRegEx(nameof(kubernetesClusterName),kubernetesClusterName,@"^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$"); - await eventListener.AssertNotNull(nameof(featureName),featureName); - await eventListener.AssertRegEx(nameof(featureName),featureName,@"^([a-zA-Z0-9][a-zA-Z0-9-]{0,61}[a-zA-Z0-9])$"); + await eventListener.AssertNotNull(nameof(clusterName),clusterName); + await eventListener.AssertRegEx(nameof(clusterName), clusterName, @"^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$"); + await eventListener.AssertNotNull(nameof(metricsConfigurationName),metricsConfigurationName); + await eventListener.AssertRegEx(nameof(metricsConfigurationName), metricsConfigurationName, @"^default$"); await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); await eventListener.AssertNotNull(nameof(ifNoneMatch),ifNoneMatch); await eventListener.AssertNotNull(nameof(body), body); @@ -15219,11 +36358,11 @@ public partial class NetworkCloud } } - /// Delete the provided Kubernetes cluster feature. + /// Delete the metrics configuration of the provided cluster. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. - /// The name of the Kubernetes cluster. - /// The name of the feature. + /// The name of the cluster. + /// The name of the metrics configuration for the cluster. /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. @@ -15237,7 +36376,7 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task KubernetesClusterFeaturesDelete(string subscriptionId, string resourceGroupName, string kubernetesClusterName, string featureName, string ifMatch, string ifNoneMatch, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task MetricsConfigurationsDelete(string subscriptionId, string resourceGroupName, string clusterName, string metricsConfigurationName, string ifMatch, string ifNoneMatch, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -15249,10 +36388,10 @@ public partial class NetworkCloud + global::System.Uri.EscapeDataString(subscriptionId) + "/resourceGroups/" + global::System.Uri.EscapeDataString(resourceGroupName) - + "/providers/Microsoft.NetworkCloud/kubernetesClusters/" - + global::System.Uri.EscapeDataString(kubernetesClusterName) - + "/features/" - + global::System.Uri.EscapeDataString(featureName) + + "/providers/Microsoft.NetworkCloud/clusters/" + + global::System.Uri.EscapeDataString(clusterName) + + "/metricsConfigurations/" + + global::System.Uri.EscapeDataString(metricsConfigurationName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -15276,11 +36415,11 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.KubernetesClusterFeaturesDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + await this.MetricsConfigurationsDelete_Call (request, onOk,onNoContent,onDefault,eventListener,sender); } } - /// Delete the provided Kubernetes cluster feature. + /// Delete the metrics configuration of the provided cluster. /// /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. @@ -15295,7 +36434,7 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task KubernetesClusterFeaturesDeleteViaIdentity(global::System.String viaIdentity, string ifMatch, string ifNoneMatch, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task MetricsConfigurationsDeleteViaIdentity(global::System.String viaIdentity, string ifMatch, string ifNoneMatch, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -15303,27 +36442,27 @@ public partial class NetworkCloud { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/kubernetesClusters/(?[^/]+)/features/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/clusters/(?[^/]+)/metricsConfigurations/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/kubernetesClusters/{kubernetesClusterName}/features/{featureName}'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/metricsConfigurations/{metricsConfigurationName}'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var kubernetesClusterName = _match.Groups["kubernetesClusterName"].Value; - var featureName = _match.Groups["featureName"].Value; + var clusterName = _match.Groups["clusterName"].Value; + var metricsConfigurationName = _match.Groups["metricsConfigurationName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + subscriptionId + "/resourceGroups/" + resourceGroupName - + "/providers/Microsoft.NetworkCloud/kubernetesClusters/" - + kubernetesClusterName - + "/features/" - + featureName + + "/providers/Microsoft.NetworkCloud/clusters/" + + clusterName + + "/metricsConfigurations/" + + metricsConfigurationName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -15347,11 +36486,11 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.KubernetesClusterFeaturesDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + await this.MetricsConfigurationsDelete_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). @@ -15362,32 +36501,29 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task KubernetesClusterFeaturesDelete_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.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task MetricsConfigurationsDelete_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.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { global::System.Net.Http.HttpResponseMessage _response = null; try { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; var sendTask = sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // this operation supports x-ms-long-running-operation - var _originalUri = request.RequestUri.AbsoluteUri; // declared final-state-via: location var _finalUri = _response.GetFirstHeader(@"Location"); var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) { - - // get the delay before polling. (default to 30 seconds if not present) - int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // start the delay timer (we'll await later...) - var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } // while we wait, let's grab the headers and get ready to poll. if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { @@ -15396,15 +36532,14 @@ public partial class NetworkCloud if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { location = _response.GetFirstHeader(@"Location"); } - var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); // and let's look at the current response body and see if we have some information we can give back to the listener var content = await _response.Content.ReadAsStringAsync(); - await waiting; - - // check for cancellation - if( eventListener.Token.IsCancellationRequested ) { return; } // drop the old response _response?.Dispose(); @@ -15413,45 +36548,45 @@ public partial class NetworkCloud _response = await sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // if we got back an OK, take a peek inside and see if it's done - if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) - { - var error = false; - try { - if( Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) - { - var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); - if( state is null ) - { - // the body doesn't contain any information that has the state of the LRO - // we're going to just get out, and let the consumer have the result - break; - } - - switch( state?.ToString()?.ToLower() ) - { - case "failed": - error = true; + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result break; - case "succeeded": - case "canceled": - // we're done polling. - break; - - default: - // need to keep polling! - _response.StatusCode = global::System.Net.HttpStatusCode.Created; - continue; - } - } - } catch { - // if we run into a problem peeking into the result, - // we really don't want to do anything special. - } - if (error) { - throw new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException(_response); - } - } + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException(_response); + } + } // check for terminal status code if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) @@ -15470,6 +36605,7 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } break; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -15489,7 +36625,7 @@ public partial class NetworkCloud default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -15505,13 +36641,13 @@ public partial class NetworkCloud } /// - /// 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 value must be an UUID. /// The name of the resource group. The name is case insensitive. - /// The name of the Kubernetes cluster. - /// The name of the feature. + /// The name of the cluster. + /// The name of the metrics configuration for the cluster. /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. @@ -15520,7 +36656,7 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task KubernetesClusterFeaturesDelete_Validate(string subscriptionId, string resourceGroupName, string kubernetesClusterName, string featureName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task MetricsConfigurationsDelete_Validate(string subscriptionId, string resourceGroupName, string clusterName, string metricsConfigurationName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -15529,20 +36665,63 @@ public partial class NetworkCloud await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertNotNull(nameof(kubernetesClusterName),kubernetesClusterName); - await eventListener.AssertRegEx(nameof(kubernetesClusterName),kubernetesClusterName,@"^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$"); - await eventListener.AssertNotNull(nameof(featureName),featureName); - await eventListener.AssertRegEx(nameof(featureName),featureName,@"^([a-zA-Z0-9][a-zA-Z0-9-]{0,61}[a-zA-Z0-9])$"); + await eventListener.AssertNotNull(nameof(clusterName),clusterName); + await eventListener.AssertRegEx(nameof(clusterName), clusterName, @"^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$"); + await eventListener.AssertNotNull(nameof(metricsConfigurationName),metricsConfigurationName); + await eventListener.AssertRegEx(nameof(metricsConfigurationName), metricsConfigurationName, @"^default$"); await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); await eventListener.AssertNotNull(nameof(ifNoneMatch),ifNoneMatch); } } - /// Get properties of the provided the Kubernetes cluster feature. + /// Get metrics configuration of the provided cluster. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. - /// The name of the Kubernetes cluster. - /// The name of the feature. + /// The name of the cluster. + /// The name of the metrics configuration for the cluster. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task MetricsConfigurationsGet(string subscriptionId, string resourceGroupName, string clusterName, string metricsConfigurationName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.NetworkCloud/clusters/" + + global::System.Uri.EscapeDataString(clusterName) + + "/metricsConfigurations/" + + global::System.Uri.EscapeDataString(metricsConfigurationName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.MetricsConfigurationsGet_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Get metrics configuration of the provided cluster. + /// /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). @@ -15551,22 +36730,35 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task KubernetesClusterFeaturesGet(string subscriptionId, string resourceGroupName, string kubernetesClusterName, string featureName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task MetricsConfigurationsGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { var apiVersion = @"2025-02-01"; // Constant Parameters using( NoSynchronizationContext ) { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/clusters/(?[^/]+)/metricsConfigurations/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/metricsConfigurations/{metricsConfigurationName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var clusterName = _match.Groups["clusterName"].Value; + var metricsConfigurationName = _match.Groups["metricsConfigurationName"].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.NetworkCloud/kubernetesClusters/" - + global::System.Uri.EscapeDataString(kubernetesClusterName) - + "/features/" - + global::System.Uri.EscapeDataString(featureName) + + resourceGroupName + + "/providers/Microsoft.NetworkCloud/clusters/" + + clusterName + + "/metricsConfigurations/" + + metricsConfigurationName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -15580,21 +36772,19 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.KubernetesClusterFeaturesGet_Call(request,onOk,onDefault,eventListener,sender); + await this.MetricsConfigurationsGet_Call (request, onOk,onDefault,eventListener,sender); } } - /// Get properties of the provided the Kubernetes cluster feature. + /// Get metrics configuration of the provided cluster. /// - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 KubernetesClusterFeaturesGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task MetricsConfigurationsGetViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -15602,45 +36792,149 @@ public partial class NetworkCloud { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/kubernetesClusters/(?[^/]+)/features/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/clusters/(?[^/]+)/metricsConfigurations/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/kubernetesClusters/{kubernetesClusterName}/features/{featureName}'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/metricsConfigurations/{metricsConfigurationName}'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var kubernetesClusterName = _match.Groups["kubernetesClusterName"].Value; - var featureName = _match.Groups["featureName"].Value; + var clusterName = _match.Groups["clusterName"].Value; + var metricsConfigurationName = _match.Groups["metricsConfigurationName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + subscriptionId + "/resourceGroups/" + resourceGroupName - + "/providers/Microsoft.NetworkCloud/kubernetesClusters/" - + kubernetesClusterName - + "/features/" - + featureName + + "/providers/Microsoft.NetworkCloud/clusters/" + + clusterName + + "/metricsConfigurations/" + + metricsConfigurationName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.MetricsConfigurationsGetWithResult_Call (request, eventListener,sender); + } + } + + /// Get metrics configuration of the provided cluster. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the cluster. + /// The name of the metrics configuration for the cluster. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task MetricsConfigurationsGetWithResult(string subscriptionId, string resourceGroupName, string clusterName, string metricsConfigurationName, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.NetworkCloud/clusters/" + + global::System.Uri.EscapeDataString(clusterName) + + "/metricsConfigurations/" + + global::System.Uri.EscapeDataString(metricsConfigurationName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.KubernetesClusterFeaturesGet_Call(request,onOk,onDefault,eventListener,sender); + return await this.MetricsConfigurationsGetWithResult_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.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task MetricsConfigurationsGetWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterMetricsConfiguration.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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 @@ -15650,7 +36944,7 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task KubernetesClusterFeaturesGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task MetricsConfigurationsGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -15661,6 +36955,7 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -15668,13 +36963,13 @@ public partial class NetworkCloud case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.KubernetesClusterFeature.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterMetricsConfiguration.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -15690,18 +36985,18 @@ public partial class NetworkCloud } /// - /// 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 value must be an UUID. /// The name of the resource group. The name is case insensitive. - /// The name of the Kubernetes cluster. - /// The name of the feature. + /// The name of the cluster. + /// The name of the metrics configuration for the cluster. /// an instance that will receive events. /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task KubernetesClusterFeaturesGet_Validate(string subscriptionId, string resourceGroupName, string kubernetesClusterName, string featureName, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task MetricsConfigurationsGet_Validate(string subscriptionId, string resourceGroupName, string clusterName, string metricsConfigurationName, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -15710,17 +37005,17 @@ public partial class NetworkCloud await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertNotNull(nameof(kubernetesClusterName),kubernetesClusterName); - await eventListener.AssertRegEx(nameof(kubernetesClusterName),kubernetesClusterName,@"^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$"); - await eventListener.AssertNotNull(nameof(featureName),featureName); - await eventListener.AssertRegEx(nameof(featureName),featureName,@"^([a-zA-Z0-9][a-zA-Z0-9-]{0,61}[a-zA-Z0-9])$"); + await eventListener.AssertNotNull(nameof(clusterName),clusterName); + await eventListener.AssertRegEx(nameof(clusterName), clusterName, @"^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$"); + await eventListener.AssertNotNull(nameof(metricsConfigurationName),metricsConfigurationName); + await eventListener.AssertRegEx(nameof(metricsConfigurationName), metricsConfigurationName, @"^default$"); } } - /// Get a list of features for the provided Kubernetes cluster. + /// Get a list of metrics configurations for the provided cluster. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. - /// The name of the Kubernetes cluster. + /// The name of the cluster. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). @@ -15729,7 +37024,7 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task KubernetesClusterFeaturesListByKubernetesCluster(string subscriptionId, string resourceGroupName, string kubernetesClusterName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task MetricsConfigurationsListByCluster(string subscriptionId, string resourceGroupName, string clusterName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -15741,9 +37036,9 @@ public partial class NetworkCloud + global::System.Uri.EscapeDataString(subscriptionId) + "/resourceGroups/" + global::System.Uri.EscapeDataString(resourceGroupName) - + "/providers/Microsoft.NetworkCloud/kubernetesClusters/" - + global::System.Uri.EscapeDataString(kubernetesClusterName) - + "/features" + + "/providers/Microsoft.NetworkCloud/clusters/" + + global::System.Uri.EscapeDataString(clusterName) + + "/metricsConfigurations" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -15757,11 +37052,11 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.KubernetesClusterFeaturesListByKubernetesCluster_Call(request,onOk,onDefault,eventListener,sender); + await this.MetricsConfigurationsListByCluster_Call (request, onOk,onDefault,eventListener,sender); } } - /// Get a list of features for the provided Kubernetes cluster. + /// Get a list of metrics configurations for the provided cluster. /// /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled @@ -15771,7 +37066,7 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task KubernetesClusterFeaturesListByKubernetesClusterViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task MetricsConfigurationsListByClusterViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -15779,25 +37074,25 @@ public partial class NetworkCloud { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/kubernetesClusters/(?[^/]+)/features$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/clusters/(?[^/]+)/metricsConfigurations$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/kubernetesClusters/{kubernetesClusterName}/features'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/metricsConfigurations'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var kubernetesClusterName = _match.Groups["kubernetesClusterName"].Value; + var clusterName = _match.Groups["clusterName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + subscriptionId + "/resourceGroups/" + resourceGroupName - + "/providers/Microsoft.NetworkCloud/kubernetesClusters/" - + kubernetesClusterName - + "/features" + + "/providers/Microsoft.NetworkCloud/clusters/" + + clusterName + + "/metricsConfigurations" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -15811,105 +37106,73 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.KubernetesClusterFeaturesListByKubernetesCluster_Call(request,onOk,onDefault,eventListener,sender); + await this.MetricsConfigurationsListByCluster_Call (request, onOk,onDefault,eventListener,sender); } } - /// - /// Actual wire call for method. - /// - /// the prepared HttpRequestMessage to send. - /// a delegate that is called 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 a list of metrics configurations for the provided cluster. + /// /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 KubernetesClusterFeaturesListByKubernetesCluster_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task MetricsConfigurationsListByClusterViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { + var apiVersion = @"2025-02-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.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.KubernetesClusterFeatureList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/clusters/(?[^/]+)/metricsConfigurations$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/metricsConfigurations'"); } - } - } - /// - /// Validation method for method. Call this like the actual - /// call, but you will get validation events back. - /// - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of the Kubernetes cluster. - /// an instance that will receive events. - /// - /// A that will be complete when handling of the response is completed. - /// - internal async global::System.Threading.Tasks.Task KubernetesClusterFeaturesListByKubernetesCluster_Validate(string subscriptionId, string resourceGroupName, string kubernetesClusterName, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) - { - using( NoSynchronizationContext ) - { - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); - await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); - await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); - await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); - await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertNotNull(nameof(kubernetesClusterName),kubernetesClusterName); - await eventListener.AssertRegEx(nameof(kubernetesClusterName),kubernetesClusterName,@"^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$"); + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var clusterName = _match.Groups["clusterName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.NetworkCloud/clusters/" + + clusterName + + "/metricsConfigurations" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.MetricsConfigurationsListByClusterWithResult_Call (request, eventListener,sender); } } - /// Patch properties of the provided Kubernetes cluster feature. + /// Get a list of metrics configurations for the provided cluster. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. - /// The name of the Kubernetes cluster. - /// The name of the feature. - /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify - /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. - /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. - /// Other values will result in error from server as they are not supported. - /// The request body. - /// a delegate that is called 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 cluster. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 KubernetesClusterFeaturesUpdate(string subscriptionId, string resourceGroupName, string kubernetesClusterName, string featureName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeaturePatchParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task MetricsConfigurationsListByClusterWithResult(string subscriptionId, string resourceGroupName, string clusterName, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -15921,117 +37184,89 @@ public partial class NetworkCloud + global::System.Uri.EscapeDataString(subscriptionId) + "/resourceGroups/" + global::System.Uri.EscapeDataString(resourceGroupName) - + "/providers/Microsoft.NetworkCloud/kubernetesClusters/" - + global::System.Uri.EscapeDataString(kubernetesClusterName) - + "/features/" - + global::System.Uri.EscapeDataString(featureName) + + "/providers/Microsoft.NetworkCloud/clusters/" + + global::System.Uri.EscapeDataString(clusterName) + + "/metricsConfigurations" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Patch, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - // add headers parameters - if (null != ifMatch) - { - request.Headers.Add("If-Match",ifMatch); - } - if (null != ifNoneMatch) - { - request.Headers.Add("If-None-Match",ifNoneMatch); - } + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); - request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.KubernetesClusterFeaturesUpdate_Call(request,onOk,onDefault,eventListener,sender); + return await this.MetricsConfigurationsListByClusterWithResult_Call (request, eventListener,sender); } } - /// Patch properties of the provided Kubernetes cluster feature. - /// - /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify - /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. - /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. - /// Other values will result in error from server as they are not supported. - /// The request body. - /// a delegate that is called 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.NetworkCloud.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 KubernetesClusterFeaturesUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeaturePatchParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task MetricsConfigurationsListByClusterWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { - var apiVersion = @"2025-02-01"; - // Constant Parameters using( NoSynchronizationContext ) { - // verify that Identity format is an exact match for uri - - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/kubernetesClusters/(?[^/]+)/features/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); - if (!_match.Success) + global::System.Net.Http.HttpResponseMessage _response = null; + try { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/kubernetesClusters/{kubernetesClusterName}/features/{featureName}'"); - } - - // replace URI parameters with values from identity - var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var kubernetesClusterName = _match.Groups["kubernetesClusterName"].Value; - var featureName = _match.Groups["featureName"].Value; - // construct URL - var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/subscriptions/" - + subscriptionId - + "/resourceGroups/" - + resourceGroupName - + "/providers/Microsoft.NetworkCloud/kubernetesClusters/" - + kubernetesClusterName - + "/features/" - + featureName - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - // generate request object - var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Patch, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; - // add headers parameters - if (null != ifMatch) - { - request.Headers.Add("If-Match",ifMatch); + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterMetricsConfigurationList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } } - if (null != ifNoneMatch) + finally { - request.Headers.Add("If-None-Match",ifNoneMatch); + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); - request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.KubernetesClusterFeaturesUpdate_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 @@ -16041,7 +37276,7 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task KubernetesClusterFeaturesUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task MetricsConfigurationsListByCluster_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -16052,102 +37287,7 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // this operation supports x-ms-long-running-operation - var _originalUri = request.RequestUri.AbsoluteUri; - // declared final-state-via: azure-async-operation - var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - var location = _response.GetFirstHeader(@"Location"); - while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) - { - - // get the delay before polling. (default to 30 seconds if not present) - int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // start the delay timer (we'll await later...) - var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); - - // while we wait, let's grab the headers and get ready to poll. - if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { - asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - } - if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { - location = _response.GetFirstHeader(@"Location"); - } - var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; - request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); - - // and let's look at the current response body and see if we have some information we can give back to the listener - var content = await _response.Content.ReadAsStringAsync(); - await waiting; - - // check for cancellation - if( eventListener.Token.IsCancellationRequested ) { return; } - - // drop the old response - _response?.Dispose(); - - // make the polling call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // if we got back an OK, take a peek inside and see if it's done - if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) - { - var error = false; - try { - if( Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) - { - var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); - if( state is null ) - { - // the body doesn't contain any information that has the state of the LRO - // we're going to just get out, and let the consumer have the result - break; - } - - switch( state?.ToString()?.ToLower() ) - { - case "failed": - error = true; - break; - case "succeeded": - case "canceled": - // we're done polling. - break; - - default: - // need to keep polling! - _response.StatusCode = global::System.Net.HttpStatusCode.Created; - continue; - } - } - } catch { - // if we run into a problem peeking into the result, - // we really don't want to do anything special. - } - if (error) { - throw new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException(_response); - } - } - - // check for terminal status code - if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) - { - continue; - } - // we are done polling, do a request on final target? - // create a new request with the final uri - request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); - - // drop the old response - _response?.Dispose(); - - // make the final call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - break; - } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -16155,13 +37295,13 @@ public partial class NetworkCloud case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.KubernetesClusterFeature.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterMetricsConfigurationList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -16177,23 +37317,17 @@ public partial class NetworkCloud } /// - /// 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 value must be an UUID. /// The name of the resource group. The name is case insensitive. - /// The name of the Kubernetes cluster. - /// The name of the feature. - /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify - /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. - /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. - /// Other values will result in error from server as they are not supported. - /// The request body. + /// The name of the cluster. /// an instance that will receive events. /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task KubernetesClusterFeaturesUpdate_Validate(string subscriptionId, string resourceGroupName, string kubernetesClusterName, string featureName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeaturePatchParameters body, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task MetricsConfigurationsListByCluster_Validate(string subscriptionId, string resourceGroupName, string clusterName, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -16202,21 +37336,85 @@ public partial class NetworkCloud await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertNotNull(nameof(kubernetesClusterName),kubernetesClusterName); - await eventListener.AssertRegEx(nameof(kubernetesClusterName),kubernetesClusterName,@"^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$"); - await eventListener.AssertNotNull(nameof(featureName),featureName); - await eventListener.AssertRegEx(nameof(featureName),featureName,@"^([a-zA-Z0-9][a-zA-Z0-9-]{0,61}[a-zA-Z0-9])$"); - await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); - await eventListener.AssertNotNull(nameof(ifNoneMatch),ifNoneMatch); - await eventListener.AssertNotNull(nameof(body), body); - await eventListener.AssertObjectIsValid(nameof(body), body); + await eventListener.AssertNotNull(nameof(clusterName),clusterName); + await eventListener.AssertRegEx(nameof(clusterName), clusterName, @"^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$"); } } - /// Create a new Kubernetes cluster or update the properties of the existing one. + /// + /// Patch properties of metrics configuration for the provided cluster, or update the tags associated with it. Properties + /// and tag update can be done independently. + /// /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. - /// The name of the Kubernetes cluster. + /// The name of the cluster. + /// The name of the metrics configuration for the cluster. + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// The request body. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 MetricsConfigurationsUpdate(string subscriptionId, string resourceGroupName, string clusterName, string metricsConfigurationName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationPatchParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.NetworkCloud/clusters/" + + global::System.Uri.EscapeDataString(clusterName) + + "/metricsConfigurations/" + + global::System.Uri.EscapeDataString(metricsConfigurationName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + if (null != ifNoneMatch) + { + request.Headers.Add("If-None-Match",ifNoneMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.MetricsConfigurationsUpdate_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// + /// Patch properties of metrics configuration for the provided cluster, or update the tags associated with it. Properties + /// and tag update can be done independently. + /// + /// /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. @@ -16227,23 +37425,39 @@ public partial class NetworkCloud /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 KubernetesClustersCreateOrUpdate(string subscriptionId, string resourceGroupName, string kubernetesClusterName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesCluster body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task MetricsConfigurationsUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationPatchParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2025-02-01"; // Constant Parameters using( NoSynchronizationContext ) { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/clusters/(?[^/]+)/metricsConfigurations/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/metricsConfigurations/{metricsConfigurationName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var clusterName = _match.Groups["clusterName"].Value; + var metricsConfigurationName = _match.Groups["metricsConfigurationName"].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.NetworkCloud/kubernetesClusters/" - + global::System.Uri.EscapeDataString(kubernetesClusterName) + + resourceGroupName + + "/providers/Microsoft.NetworkCloud/clusters/" + + clusterName + + "/metricsConfigurations/" + + metricsConfigurationName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -16252,7 +37466,7 @@ public partial class NetworkCloud // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Put, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Patch, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } // add headers parameters @@ -16267,30 +37481,32 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // 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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.KubernetesClustersCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + await this.MetricsConfigurationsUpdate_Call (request, onOk,onDefault,eventListener,sender); } } - /// Create a new Kubernetes cluster or update the properties of the existing one. + /// + /// Patch properties of metrics configuration for the provided cluster, or update the tags associated with it. Properties + /// and tag update can be done independently. + /// /// /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. /// Other values will result in error from server as they are not supported. /// The request body. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 KubernetesClustersCreateOrUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesCluster body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task MetricsConfigurationsUpdateViaIdentityWithResult(global::System.String viaIdentity, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationPatchParameters body, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -16298,34 +37514,37 @@ public partial class NetworkCloud { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/kubernetesClusters/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/clusters/(?[^/]+)/metricsConfigurations/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/kubernetesClusters/{kubernetesClusterName}'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/metricsConfigurations/{metricsConfigurationName}'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var kubernetesClusterName = _match.Groups["kubernetesClusterName"].Value; + var clusterName = _match.Groups["clusterName"].Value; + var metricsConfigurationName = _match.Groups["metricsConfigurationName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + subscriptionId + "/resourceGroups/" + resourceGroupName - + "/providers/Microsoft.NetworkCloud/kubernetesClusters/" - + kubernetesClusterName + + "/providers/Microsoft.NetworkCloud/clusters/" + + clusterName + + "/metricsConfigurations/" + + metricsConfigurationName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Put, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } // add headers parameters if (null != ifMatch) @@ -16337,18 +37556,29 @@ public partial class NetworkCloud request.Headers.Add("If-None-Match",ifNoneMatch); } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.KubernetesClustersCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + return await this.MetricsConfigurationsUpdateWithResult_Call (request, eventListener,sender); } } - /// Actual wire call for method. - /// the prepared HttpRequestMessage to send. + /// + /// Patch properties of metrics configuration for the provided cluster, or update the tags associated with it. Properties + /// and tag update can be done independently. + /// + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the cluster. + /// The name of the metrics configuration for the cluster. + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// Json string supplied to the MetricsConfigurationsUpdate 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). @@ -16357,193 +37587,73 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task KubernetesClustersCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task MetricsConfigurationsUpdateViaJsonString(string subscriptionId, string resourceGroupName, string clusterName, string metricsConfigurationName, string ifMatch, string ifNoneMatch, 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.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { + var apiVersion = @"2025-02-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.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // this operation supports x-ms-long-running-operation - var _originalUri = request.RequestUri.AbsoluteUri; - // declared final-state-via: azure-async-operation - var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - var location = _response.GetFirstHeader(@"Location"); - while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) - { - - // get the delay before polling. (default to 30 seconds if not present) - int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // start the delay timer (we'll await later...) - var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); - - // while we wait, let's grab the headers and get ready to poll. - if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { - asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - } - if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { - location = _response.GetFirstHeader(@"Location"); - } - var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; - request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); - - // and let's look at the current response body and see if we have some information we can give back to the listener - var content = await _response.Content.ReadAsStringAsync(); - await waiting; - - // check for cancellation - if( eventListener.Token.IsCancellationRequested ) { return; } - - // drop the old response - _response?.Dispose(); - - // make the polling call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // if we got back an OK, take a peek inside and see if it's done - if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) - { - var error = false; - try { - if( Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) - { - var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); - if( state is null ) - { - // the body doesn't contain any information that has the state of the LRO - // we're going to just get out, and let the consumer have the result - break; - } - - switch( state?.ToString()?.ToLower() ) - { - case "failed": - error = true; - break; - case "succeeded": - case "canceled": - // we're done polling. - break; - - default: - // need to keep polling! - _response.StatusCode = global::System.Net.HttpStatusCode.Created; - continue; - } - } - } catch { - // if we run into a problem peeking into the result, - // we really don't want to do anything special. - } - if (error) { - throw new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException(_response); - } - } - - // check for terminal status code - if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) - { - continue; - } - // we are done polling, do a request on final target? - // create a new request with the final uri - request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.NetworkCloud/clusters/" + + global::System.Uri.EscapeDataString(clusterName) + + "/metricsConfigurations/" + + global::System.Uri.EscapeDataString(metricsConfigurationName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - // drop the old response - _response?.Dispose(); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the final call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - break; - } - var _contentType = _response.Content.Headers.ContentType?.MediaType; + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - switch ( _response.StatusCode ) - { - case global::System.Net.HttpStatusCode.OK: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.KubernetesCluster.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); } - finally + if (null != ifNoneMatch) { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); + request.Headers.Add("If-None-Match",ifNoneMatch); } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.MetricsConfigurationsUpdate_Call (request, onOk,onDefault,eventListener,sender); } } /// - /// Validation method for method. Call this like the actual call, but you - /// will get validation events back. + /// Patch properties of metrics configuration for the provided cluster, or update the tags associated with it. Properties + /// and tag update can be done independently. /// /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. - /// The name of the Kubernetes cluster. - /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify - /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. - /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. - /// Other values will result in error from server as they are not supported. - /// The request body. - /// an instance that will receive events. - /// - /// A that will be complete when handling of the response is completed. - /// - internal async global::System.Threading.Tasks.Task KubernetesClustersCreateOrUpdate_Validate(string subscriptionId, string resourceGroupName, string kubernetesClusterName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesCluster body, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) - { - using( NoSynchronizationContext ) - { - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); - await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); - await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); - await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); - await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertNotNull(nameof(kubernetesClusterName),kubernetesClusterName); - await eventListener.AssertRegEx(nameof(kubernetesClusterName),kubernetesClusterName,@"^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$"); - await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); - await eventListener.AssertNotNull(nameof(ifNoneMatch),ifNoneMatch); - await eventListener.AssertNotNull(nameof(body), body); - await eventListener.AssertObjectIsValid(nameof(body), body); - } - } - - /// Delete the provided Kubernetes cluster. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of the Kubernetes cluster. + /// The name of the cluster. + /// The name of the metrics configuration for the cluster. /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. /// Other values will result in error from server as they are not supported. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called 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 MetricsConfigurationsUpdate operation /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 KubernetesClustersDelete(string subscriptionId, string resourceGroupName, string kubernetesClusterName, string ifMatch, string ifNoneMatch, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task MetricsConfigurationsUpdateViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string clusterName, string metricsConfigurationName, string ifMatch, string ifNoneMatch, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -16555,18 +37665,20 @@ public partial class NetworkCloud + global::System.Uri.EscapeDataString(subscriptionId) + "/resourceGroups/" + global::System.Uri.EscapeDataString(resourceGroupName) - + "/providers/Microsoft.NetworkCloud/kubernetesClusters/" - + global::System.Uri.EscapeDataString(kubernetesClusterName) + + "/providers/Microsoft.NetworkCloud/clusters/" + + global::System.Uri.EscapeDataString(clusterName) + + "/metricsConfigurations/" + + global::System.Uri.EscapeDataString(metricsConfigurationName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Delete, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } // add headers parameters if (null != ifMatch) @@ -16578,63 +37690,62 @@ public partial class NetworkCloud request.Headers.Add("If-None-Match",ifNoneMatch); } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.KubernetesClustersDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + return await this.MetricsConfigurationsUpdateWithResult_Call (request, eventListener,sender); } } - /// Delete the provided Kubernetes cluster. - /// + /// + /// Patch properties of metrics configuration for the provided cluster, or update the tags associated with it. Properties + /// and tag update can be done independently. + /// + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the cluster. + /// The name of the metrics configuration for the cluster. /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. /// Other values will result in error from server as they are not supported. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns 204 (NoContent). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). + /// The request body. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 KubernetesClustersDeleteViaIdentity(global::System.String viaIdentity, string ifMatch, string ifNoneMatch, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task MetricsConfigurationsUpdateWithResult(string subscriptionId, string resourceGroupName, string clusterName, string metricsConfigurationName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationPatchParameters body, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2025-02-01"; // Constant Parameters using( NoSynchronizationContext ) { - // verify that Identity format is an exact match for uri - - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/kubernetesClusters/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); - if (!_match.Success) - { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/kubernetesClusters/{kubernetesClusterName}'"); - } - - // replace URI parameters with values from identity - var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var kubernetesClusterName = _match.Groups["kubernetesClusterName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" - + subscriptionId + + global::System.Uri.EscapeDataString(subscriptionId) + "/resourceGroups/" - + resourceGroupName - + "/providers/Microsoft.NetworkCloud/kubernetesClusters/" - + kubernetesClusterName + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.NetworkCloud/clusters/" + + global::System.Uri.EscapeDataString(clusterName) + + "/metricsConfigurations/" + + global::System.Uri.EscapeDataString(metricsConfigurationName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Delete, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } // add headers parameters if (null != ifMatch) @@ -16646,16 +37757,173 @@ public partial class NetworkCloud request.Headers.Add("If-None-Match",ifNoneMatch); } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.KubernetesClustersDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + return await this.MetricsConfigurationsUpdateWithResult_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.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task MetricsConfigurationsUpdateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + // declared final-state-via: azure-async-operation + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + break; + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterMetricsConfiguration.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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. @@ -16663,32 +37931,28 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task KubernetesClustersDelete_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.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task MetricsConfigurationsUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { global::System.Net.Http.HttpResponseMessage _response = null; try { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; var sendTask = sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // this operation supports x-ms-long-running-operation - var _originalUri = request.RequestUri.AbsoluteUri; - // declared final-state-via: location - var _finalUri = _response.GetFirstHeader(@"Location"); + // declared final-state-via: azure-async-operation var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) { - - // get the delay before polling. (default to 30 seconds if not present) - int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // start the delay timer (we'll await later...) - var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } // while we wait, let's grab the headers and get ready to poll. if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { @@ -16697,15 +37961,14 @@ public partial class NetworkCloud if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { location = _response.GetFirstHeader(@"Location"); } - var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); // and let's look at the current response body and see if we have some information we can give back to the listener var content = await _response.Content.ReadAsStringAsync(); - await waiting; - - // check for cancellation - if( eventListener.Token.IsCancellationRequested ) { return; } // drop the old response _response?.Dispose(); @@ -16714,45 +37977,45 @@ public partial class NetworkCloud _response = await sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // if we got back an OK, take a peek inside and see if it's done - if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) - { - var error = false; - try { - if( Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) - { - var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); - if( state is null ) - { - // the body doesn't contain any information that has the state of the LRO - // we're going to just get out, and let the consumer have the result - break; - } - - switch( state?.ToString()?.ToLower() ) - { - case "failed": - error = true; + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result break; - case "succeeded": - case "canceled": - // we're done polling. - break; - - default: - // need to keep polling! - _response.StatusCode = global::System.Net.HttpStatusCode.Created; - continue; - } - } - } catch { - // if we run into a problem peeking into the result, - // we really don't want to do anything special. - } - if (error) { - throw new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException(_response); - } - } + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException(_response); + } + } // check for terminal status code if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) @@ -16761,7 +38024,7 @@ public partial class NetworkCloud } // we are done polling, do a request on final target? // create a new request with the final uri - request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); // drop the old response _response?.Dispose(); @@ -16771,6 +38034,7 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } break; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -16778,19 +38042,13 @@ public partial class NetworkCloud case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onNoContent(_response); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterMetricsConfiguration.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -16806,21 +38064,23 @@ public partial class NetworkCloud } /// - /// 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 value must be an UUID. /// The name of the resource group. The name is case insensitive. - /// The name of the Kubernetes cluster. + /// The name of the cluster. + /// The name of the metrics configuration for the cluster. /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. /// Other values will result in error from server as they are not supported. + /// The request body. /// an instance that will receive events. /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task KubernetesClustersDelete_Validate(string subscriptionId, string resourceGroupName, string kubernetesClusterName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task MetricsConfigurationsUpdate_Validate(string subscriptionId, string resourceGroupName, string clusterName, string metricsConfigurationName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationPatchParameters body, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -16829,17 +38089,20 @@ public partial class NetworkCloud await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertNotNull(nameof(kubernetesClusterName),kubernetesClusterName); - await eventListener.AssertRegEx(nameof(kubernetesClusterName),kubernetesClusterName,@"^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$"); + await eventListener.AssertNotNull(nameof(clusterName),clusterName); + await eventListener.AssertRegEx(nameof(clusterName), clusterName, @"^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$"); + await eventListener.AssertNotNull(nameof(metricsConfigurationName),metricsConfigurationName); + await eventListener.AssertRegEx(nameof(metricsConfigurationName), metricsConfigurationName, @"^default$"); await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); await eventListener.AssertNotNull(nameof(ifNoneMatch),ifNoneMatch); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); } } - /// Get properties of the provided the Kubernetes cluster. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of the Kubernetes cluster. + /// + /// Get a list of all available resource provider operations. It contains a URL link to get the next set of results. + /// /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). @@ -16848,7 +38111,7 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task KubernetesClustersGet(string subscriptionId, string resourceGroupName, string kubernetesClusterName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + 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.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -16856,12 +38119,7 @@ public partial class NetworkCloud { // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/subscriptions/" - + global::System.Uri.EscapeDataString(subscriptionId) - + "/resourceGroups/" - + global::System.Uri.EscapeDataString(resourceGroupName) - + "/providers/Microsoft.NetworkCloud/kubernetesClusters/" - + global::System.Uri.EscapeDataString(kubernetesClusterName) + "/providers/Microsoft.NetworkCloud/operations" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -16875,11 +38133,13 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.KubernetesClustersGet_Call(request,onOk,onDefault,eventListener,sender); + await this.OperationsList_Call (request, onOk,onDefault,eventListener,sender); } } - /// Get properties of the provided the Kubernetes cluster. + /// + /// Get a list of all available resource provider operations. It contains a URL link to get the next set of results. + /// /// /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled @@ -16889,7 +38149,7 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task KubernetesClustersGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + 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.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -16897,24 +38157,16 @@ public partial class NetworkCloud { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/kubernetesClusters/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/providers/Microsoft.NetworkCloud/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.NetworkCloud/kubernetesClusters/{kubernetesClusterName}'"); + throw new global::System.Exception("Invalid identity for URI '/providers/Microsoft.NetworkCloud/operations'"); } // replace URI parameters with values from identity - var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var kubernetesClusterName = _match.Groups["kubernetesClusterName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/subscriptions/" - + subscriptionId - + "/resourceGroups/" - + resourceGroupName - + "/providers/Microsoft.NetworkCloud/kubernetesClusters/" - + kubernetesClusterName + "/providers/Microsoft.NetworkCloud/operations" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -16928,11 +38180,151 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.KubernetesClustersGet_Call(request,onOk,onDefault,eventListener,sender); + await this.OperationsList_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// + /// Get a list of all available resource provider operations. It contains a URL link to get the next set of results. + /// + /// + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync pipeline to 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.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/providers/Microsoft.NetworkCloud/operations$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/providers/Microsoft.NetworkCloud/operations'"); + } + + // replace URI parameters with values from identity + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/providers/Microsoft.NetworkCloud/operations" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.OperationsListWithResult_Call (request, eventListener,sender); + } + } + + /// + /// Get a list of all available resource provider operations. It contains a URL link to get the next set of results. + /// + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync pipeline to 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.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/providers/Microsoft.NetworkCloud/operations" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.ISendAsync pipeline to 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.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.OperationListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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 @@ -16942,7 +38334,7 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task KubernetesClustersGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + 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.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -16953,6 +38345,7 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -16960,13 +38353,13 @@ public partial class NetworkCloud case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.KubernetesCluster.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.OperationListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -16982,33 +38375,24 @@ public partial class NetworkCloud } /// - /// 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 value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of the Kubernetes cluster. /// an instance that will receive events. /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task KubernetesClustersGet_Validate(string subscriptionId, string resourceGroupName, string kubernetesClusterName, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task OperationsList_Validate(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); - await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); - await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); - await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); - await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertNotNull(nameof(kubernetesClusterName),kubernetesClusterName); - await eventListener.AssertRegEx(nameof(kubernetesClusterName),kubernetesClusterName,@"^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$"); + } } - /// Get a list of Kubernetes clusters in the provided resource group. + /// Get the properties of the provided rack SKU. /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. + /// The name of the rack SKU. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). @@ -17017,7 +38401,7 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task KubernetesClustersListByResourceGroup(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.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task RackSkusGet(string subscriptionId, string rackSkuName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -17027,9 +38411,8 @@ public partial class NetworkCloud var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + global::System.Uri.EscapeDataString(subscriptionId) - + "/resourceGroups/" - + global::System.Uri.EscapeDataString(resourceGroupName) - + "/providers/Microsoft.NetworkCloud/kubernetesClusters" + + "/providers/Microsoft.NetworkCloud/rackSkus/" + + global::System.Uri.EscapeDataString(rackSkuName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -17043,11 +38426,11 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.KubernetesClustersListByResourceGroup_Call(request,onOk,onDefault,eventListener,sender); + await this.RackSkusGet_Call (request, onOk,onDefault,eventListener,sender); } } - /// Get a list of Kubernetes clusters in the provided resource group. + /// Get the properties of the provided rack SKU. /// /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled @@ -17057,7 +38440,7 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task KubernetesClustersListByResourceGroupViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task RackSkusGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -17065,22 +38448,21 @@ public partial class NetworkCloud { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/kubernetesClusters$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/providers/Microsoft.NetworkCloud/rackSkus/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/kubernetesClusters'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.NetworkCloud/rackSkus/{rackSkuName}'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var rackSkuName = _match.Groups["rackSkuName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + subscriptionId - + "/resourceGroups/" - + resourceGroupName - + "/providers/Microsoft.NetworkCloud/kubernetesClusters" + + "/providers/Microsoft.NetworkCloud/rackSkus/" + + rackSkuName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -17094,13 +38476,157 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.KubernetesClustersListByResourceGroup_Call(request,onOk,onDefault,eventListener,sender); + await this.RackSkusGet_Call (request, onOk,onDefault,eventListener,sender); } } - /// - /// Actual wire call for method. - /// + /// Get the properties of the provided rack SKU. + /// + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A + /// that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task RackSkusGetViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-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.NetworkCloud/rackSkus/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.NetworkCloud/rackSkus/{rackSkuName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var rackSkuName = _match.Groups["rackSkuName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/providers/Microsoft.NetworkCloud/rackSkus/" + + rackSkuName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.RackSkusGetWithResult_Call (request, eventListener,sender); + } + } + + /// Get the properties of the provided rack SKU. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the rack SKU. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A + /// that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task RackSkusGetWithResult(string subscriptionId, string rackSkuName, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/providers/Microsoft.NetworkCloud/rackSkus/" + + global::System.Uri.EscapeDataString(rackSkuName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.RackSkusGetWithResult_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.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A + /// that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task RackSkusGetWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.RackSku.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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 @@ -17110,7 +38636,7 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task KubernetesClustersListByResourceGroup_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task RackSkusGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -17121,6 +38647,7 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -17128,13 +38655,13 @@ public partial class NetworkCloud case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.KubernetesClusterList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.RackSku.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -17150,28 +38677,27 @@ public partial class NetworkCloud } /// - /// 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 value must be an UUID. - /// The name of the resource group. The name is case insensitive. + /// The name of the rack SKU. /// an instance that will receive events. /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task KubernetesClustersListByResourceGroup_Validate(string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task RackSkusGet_Validate(string subscriptionId, string rackSkuName, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); - await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); - await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); - await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(rackSkuName),rackSkuName); + await eventListener.AssertRegEx(nameof(rackSkuName), rackSkuName, @"^([a-zA-Z0-9][a-zA-Z0-9-_]{0,126}[a-zA-Z0-9])$"); } } - /// Get a list of Kubernetes clusters in the provided subscription. + /// Get a list of rack SKUs in the provided subscription. /// The ID of the target subscription. The value must be an UUID. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled @@ -17181,7 +38707,7 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task KubernetesClustersListBySubscription(string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task RackSkusListBySubscription(string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -17191,7 +38717,7 @@ public partial class NetworkCloud var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + global::System.Uri.EscapeDataString(subscriptionId) - + "/providers/Microsoft.NetworkCloud/kubernetesClusters" + + "/providers/Microsoft.NetworkCloud/rackSkus" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -17205,11 +38731,11 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.KubernetesClustersListBySubscription_Call(request,onOk,onDefault,eventListener,sender); + await this.RackSkusListBySubscription_Call (request, onOk,onDefault,eventListener,sender); } } - /// Get a list of Kubernetes clusters in the provided subscription. + /// Get a list of rack SKUs in the provided 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 @@ -17219,7 +38745,7 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task KubernetesClustersListBySubscriptionViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task RackSkusListBySubscriptionViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -17227,10 +38753,10 @@ public partial class NetworkCloud { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/providers/Microsoft.NetworkCloud/kubernetesClusters$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/providers/Microsoft.NetworkCloud/rackSkus$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.NetworkCloud/kubernetesClusters'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.NetworkCloud/rackSkus'"); } // replace URI parameters with values from identity @@ -17239,7 +38765,7 @@ public partial class NetworkCloud var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + subscriptionId - + "/providers/Microsoft.NetworkCloud/kubernetesClusters" + + "/providers/Microsoft.NetworkCloud/rackSkus" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -17253,14 +38779,156 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.KubernetesClustersListBySubscription_Call(request,onOk,onDefault,eventListener,sender); + await this.RackSkusListBySubscription_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Get a list of rack SKUs in the provided subscription. + /// + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task RackSkusListBySubscriptionViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-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.NetworkCloud/rackSkus$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.NetworkCloud/rackSkus'"); + } + + // 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.NetworkCloud/rackSkus" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.RackSkusListBySubscriptionWithResult_Call (request, eventListener,sender); + } + } + + /// Get a list of rack SKUs in the provided subscription. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task RackSkusListBySubscriptionWithResult(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/providers/Microsoft.NetworkCloud/rackSkus" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.RackSkusListBySubscriptionWithResult_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.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task RackSkusListBySubscriptionWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.RackSkuList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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). @@ -17269,7 +38937,7 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task KubernetesClustersListBySubscription_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task RackSkusListBySubscription_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -17280,6 +38948,7 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -17287,13 +38956,13 @@ public partial class NetworkCloud case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.KubernetesClusterList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.RackSkuList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -17309,15 +38978,15 @@ public partial class NetworkCloud } /// - /// 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 value must be an UUID. /// an instance that will receive events. /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task KubernetesClustersListBySubscription_Validate(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task RackSkusListBySubscription_Validate(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -17326,20 +38995,28 @@ public partial class NetworkCloud } } - /// Restart a targeted node of a Kubernetes cluster. + /// + /// update a new rack or update properties of the existing one. + /// All customer initiated requests will be rejected as the life cycle of this resource is managed by the system. + /// /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. - /// The name of the Kubernetes cluster. + /// The name of the rack. + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. /// The request body. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 KubernetesClustersRestartNode(string subscriptionId, string resourceGroupName, string kubernetesClusterName, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterRestartNodeParameters body, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task RacksCreateOrUpdate(string subscriptionId, string resourceGroupName, string rackName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRack body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -17351,9 +39028,8 @@ public partial class NetworkCloud + global::System.Uri.EscapeDataString(subscriptionId) + "/resourceGroups/" + global::System.Uri.EscapeDataString(resourceGroupName) - + "/providers/Microsoft.NetworkCloud/kubernetesClusters/" - + global::System.Uri.EscapeDataString(kubernetesClusterName) - + "/restartNode" + + "/providers/Microsoft.NetworkCloud/racks/" + + global::System.Uri.EscapeDataString(rackName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -17362,31 +39038,49 @@ public partial class NetworkCloud // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Post, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Put, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + if (null != ifNoneMatch) + { + request.Headers.Add("If-None-Match",ifNoneMatch); + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // 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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.KubernetesClustersRestartNode_Call(request,onOk,onDefault,eventListener,sender); + await this.RacksCreateOrUpdate_Call (request, onOk,onDefault,eventListener,sender); } } - /// Restart a targeted node of a Kubernetes cluster. + /// + /// update a new rack or update properties of the existing one. + /// All customer initiated requests will be rejected as the life cycle of this resource is managed by the system. + /// /// + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. /// The request body. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 KubernetesClustersRestartNodeViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterRestartNodeParameters body, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task RacksCreateOrUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRack body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -17394,25 +39088,24 @@ public partial class NetworkCloud { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/kubernetesClusters/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/racks/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/kubernetesClusters/{kubernetesClusterName}/restartNode'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/racks/{rackName}'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var kubernetesClusterName = _match.Groups["kubernetesClusterName"].Value; + var rackName = _match.Groups["rackName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + subscriptionId + "/resourceGroups/" + resourceGroupName - + "/providers/Microsoft.NetworkCloud/kubernetesClusters/" - + kubernetesClusterName - + "/restartNode" + + "/providers/Microsoft.NetworkCloud/racks/" + + rackName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -17421,214 +39114,187 @@ public partial class NetworkCloud // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Post, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Put, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + if (null != ifNoneMatch) + { + request.Headers.Add("If-None-Match",ifNoneMatch); + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // 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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.KubernetesClustersRestartNode_Call(request,onOk,onDefault,eventListener,sender); + await this.RacksCreateOrUpdate_Call (request, onOk,onDefault,eventListener,sender); } } - /// Actual wire call for method. - /// the prepared HttpRequestMessage to send. - /// a delegate that is called 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 rack or update properties of the existing one. + /// All customer initiated requests will be rejected as the life cycle of this resource is managed by the system. + /// + /// + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// The request body. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 KubernetesClustersRestartNode_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task RacksCreateOrUpdateViaIdentityWithResult(global::System.String viaIdentity, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRack body, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate) { + var apiVersion = @"2025-02-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.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // this operation supports x-ms-long-running-operation - var _originalUri = request.RequestUri.AbsoluteUri; - // declared final-state-via: location - var _finalUri = _response.GetFirstHeader(@"Location"); - var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - var location = _response.GetFirstHeader(@"Location"); - while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) - { - - // get the delay before polling. (default to 30 seconds if not present) - int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // start the delay timer (we'll await later...) - var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); - - // while we wait, let's grab the headers and get ready to poll. - if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { - asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - } - if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { - location = _response.GetFirstHeader(@"Location"); - } - var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; - request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); - - // and let's look at the current response body and see if we have some information we can give back to the listener - var content = await _response.Content.ReadAsStringAsync(); - await waiting; - - // check for cancellation - if( eventListener.Token.IsCancellationRequested ) { return; } - - // drop the old response - _response?.Dispose(); - - // make the polling call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // verify that Identity format is an exact match for uri - // if we got back an OK, take a peek inside and see if it's done - if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) - { - var error = false; - try { - if( Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) - { - var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); - if( state is null ) - { - // the body doesn't contain any information that has the state of the LRO - // we're going to just get out, and let the consumer have the result - break; - } - - switch( state?.ToString()?.ToLower() ) - { - case "failed": - error = true; - break; - case "succeeded": - case "canceled": - // we're done polling. - break; - - default: - // need to keep polling! - _response.StatusCode = global::System.Net.HttpStatusCode.Created; - continue; - } - } - } catch { - // if we run into a problem peeking into the result, - // we really don't want to do anything special. - } - if (error) { - throw new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException(_response); - } - } + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/racks/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/racks/{rackName}'"); + } - // check for terminal status code - if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) - { - continue; - } - // we are done polling, do a request on final target? - // create a new request with the final uri - request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var rackName = _match.Groups["rackName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.NetworkCloud/racks/" + + rackName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - // drop the old response - _response?.Dispose(); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - // make the final call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - break; - } - var _contentType = _response.Content.Headers.ContentType?.MediaType; + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - switch ( _response.StatusCode ) - { - case global::System.Net.HttpStatusCode.OK: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); } - finally + if (null != ifNoneMatch) { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); + request.Headers.Add("If-None-Match",ifNoneMatch); } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.RacksCreateOrUpdateWithResult_Call (request, eventListener,sender); } } /// - /// Validation method for method. Call this like the actual call, but you will - /// get validation events back. + /// update a new rack or update properties of the existing one. + /// All customer initiated requests will be rejected as the life cycle of this resource is managed by the system. /// /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. - /// The name of the Kubernetes cluster. - /// The request body. + /// The name of the rack. + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// Json string supplied to the RacksCreateOrUpdate 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.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task KubernetesClustersRestartNode_Validate(string subscriptionId, string resourceGroupName, string kubernetesClusterName, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterRestartNodeParameters body, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) + public async global::System.Threading.Tasks.Task RacksCreateOrUpdateViaJsonString(string subscriptionId, string resourceGroupName, string rackName, string ifMatch, string ifNoneMatch, 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.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { + var apiVersion = @"2025-02-01"; + // Constant Parameters using( NoSynchronizationContext ) { - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); - await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); - await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); - await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); - await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertNotNull(nameof(kubernetesClusterName),kubernetesClusterName); - await eventListener.AssertRegEx(nameof(kubernetesClusterName),kubernetesClusterName,@"^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$"); - 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.NetworkCloud/racks/" + + global::System.Uri.EscapeDataString(rackName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + if (null != ifNoneMatch) + { + request.Headers.Add("If-None-Match",ifNoneMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.RacksCreateOrUpdate_Call (request, onOk,onDefault,eventListener,sender); } } /// - /// Patch the properties of the provided Kubernetes cluster, or update the tags associated with the Kubernetes cluster. Properties - /// and tag updates can be done independently. + /// update a new rack or update properties of the existing one. + /// All customer initiated requests will be rejected as the life cycle of this resource is managed by the system. /// /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. - /// The name of the Kubernetes cluster. + /// The name of the rack. /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. /// Other values will result in error from server as they are not supported. - /// The request body. - /// a delegate that is called 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 RacksCreateOrUpdate operation /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 KubernetesClustersUpdate(string subscriptionId, string resourceGroupName, string kubernetesClusterName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPatchParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task RacksCreateOrUpdateViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string rackName, string ifMatch, string ifNoneMatch, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -17640,18 +39306,18 @@ public partial class NetworkCloud + global::System.Uri.EscapeDataString(subscriptionId) + "/resourceGroups/" + global::System.Uri.EscapeDataString(resourceGroupName) - + "/providers/Microsoft.NetworkCloud/kubernetesClusters/" - + global::System.Uri.EscapeDataString(kubernetesClusterName) + + "/providers/Microsoft.NetworkCloud/racks/" + + global::System.Uri.EscapeDataString(rackName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Patch, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } // add headers parameters if (null != ifMatch) @@ -17663,70 +39329,59 @@ public partial class NetworkCloud request.Headers.Add("If-None-Match",ifNoneMatch); } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.KubernetesClustersUpdate_Call(request,onOk,onDefault,eventListener,sender); + return await this.RacksCreateOrUpdateWithResult_Call (request, eventListener,sender); } } /// - /// Patch the properties of the provided Kubernetes cluster, or update the tags associated with the Kubernetes cluster. Properties - /// and tag updates can be done independently. + /// update a new rack or update properties of the existing one. + /// All customer initiated requests will be rejected as the life cycle of this resource is managed by the system. /// - /// + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the rack. /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. /// Other values will result in error from server as they are not supported. /// The request body. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 KubernetesClustersUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPatchParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task RacksCreateOrUpdateWithResult(string subscriptionId, string resourceGroupName, string rackName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRack body, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2025-02-01"; // Constant Parameters using( NoSynchronizationContext ) { - // verify that Identity format is an exact match for uri - - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/kubernetesClusters/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); - if (!_match.Success) - { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/kubernetesClusters/{kubernetesClusterName}'"); - } - - // replace URI parameters with values from identity - var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var kubernetesClusterName = _match.Groups["kubernetesClusterName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" - + subscriptionId + + global::System.Uri.EscapeDataString(subscriptionId) + "/resourceGroups/" - + resourceGroupName - + "/providers/Microsoft.NetworkCloud/kubernetesClusters/" - + kubernetesClusterName + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.NetworkCloud/racks/" + + global::System.Uri.EscapeDataString(rackName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Patch, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } // add headers parameters if (null != ifMatch) @@ -17738,51 +39393,46 @@ public partial class NetworkCloud request.Headers.Add("If-None-Match",ifNoneMatch); } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.KubernetesClustersUpdate_Call(request,onOk,onDefault,eventListener,sender); + return await this.RacksCreateOrUpdateWithResult_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). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 KubernetesClustersUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task RacksCreateOrUpdateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { global::System.Net.Http.HttpResponseMessage _response = null; try { - var sendTask = sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } // this operation supports x-ms-long-running-operation var _originalUri = request.RequestUri.AbsoluteUri; + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } // declared final-state-via: azure-async-operation var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) { - - // get the delay before polling. (default to 30 seconds if not present) - int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // start the delay timer (we'll await later...) - var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } // while we wait, let's grab the headers and get ready to poll. if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { @@ -17791,62 +39441,61 @@ public partial class NetworkCloud if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { location = _response.GetFirstHeader(@"Location"); } - var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); // and let's look at the current response body and see if we have some information we can give back to the listener var content = await _response.Content.ReadAsStringAsync(); - await waiting; - - // check for cancellation - if( eventListener.Token.IsCancellationRequested ) { return; } // drop the old response _response?.Dispose(); // make the polling call _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // if we got back an OK, take a peek inside and see if it's done - if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) - { - var error = false; - try { - if( Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) - { - var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); - if( state is null ) - { - // the body doesn't contain any information that has the state of the LRO - // we're going to just get out, and let the consumer have the result - break; - } - - switch( state?.ToString()?.ToLower() ) - { - case "failed": - error = true; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. break; - case "succeeded": - case "canceled": - // we're done polling. - break; - - default: - // need to keep polling! - _response.StatusCode = global::System.Net.HttpStatusCode.Created; - continue; - } - } - } catch { - // if we run into a problem peeking into the result, - // we really don't want to do anything special. - } - if (error) { - throw new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException(_response); - } - } + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException(_response); + } + } // check for terminal status code if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) @@ -17862,24 +39511,37 @@ public partial class NetworkCloud // make the final call _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } break; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.KubernetesCluster.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Rack.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; } default: { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } } } } @@ -17893,179 +39555,7 @@ public partial class NetworkCloud } } - /// - /// Validation method for method. Call this like the actual call, but you will get - /// validation events back. - /// - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of the Kubernetes cluster. - /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify - /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. - /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. - /// Other values will result in error from server as they are not supported. - /// The request body. - /// an instance that will receive events. - /// - /// A that will be complete when handling of the response is completed. - /// - internal async global::System.Threading.Tasks.Task KubernetesClustersUpdate_Validate(string subscriptionId, string resourceGroupName, string kubernetesClusterName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPatchParameters body, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) - { - using( NoSynchronizationContext ) - { - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); - await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); - await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); - await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); - await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertNotNull(nameof(kubernetesClusterName),kubernetesClusterName); - await eventListener.AssertRegEx(nameof(kubernetesClusterName),kubernetesClusterName,@"^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$"); - await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); - await eventListener.AssertNotNull(nameof(ifNoneMatch),ifNoneMatch); - await eventListener.AssertNotNull(nameof(body), body); - await eventListener.AssertObjectIsValid(nameof(body), body); - } - } - - /// - /// Create a new layer 2 (L2) network or update the properties of the existing network. - /// - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of the L2 network. - /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify - /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. - /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. - /// Other values will result in error from server as they are not supported. - /// The request body. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. - /// - /// A that will be complete when handling of the response is completed. - /// - public async global::System.Threading.Tasks.Task L2NetworksCreateOrUpdate(string subscriptionId, string resourceGroupName, string l2NetworkName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2Network body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) - { - var apiVersion = @"2025-02-01"; - // Constant Parameters - using( NoSynchronizationContext ) - { - // construct URL - var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/subscriptions/" - + global::System.Uri.EscapeDataString(subscriptionId) - + "/resourceGroups/" - + global::System.Uri.EscapeDataString(resourceGroupName) - + "/providers/Microsoft.NetworkCloud/l2Networks/" - + global::System.Uri.EscapeDataString(l2NetworkName) - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - // generate request object - var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Put, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - // add headers parameters - if (null != ifMatch) - { - request.Headers.Add("If-Match",ifMatch); - } - if (null != ifNoneMatch) - { - request.Headers.Add("If-None-Match",ifNoneMatch); - } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); - request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.L2NetworksCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); - } - } - - /// - /// Create a new layer 2 (L2) network or update the properties of the existing network. - /// - /// - /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify - /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. - /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. - /// Other values will result in error from server as they are not supported. - /// The request body. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. - /// - /// A that will be complete when handling of the response is completed. - /// - public async global::System.Threading.Tasks.Task L2NetworksCreateOrUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2Network body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) - { - var apiVersion = @"2025-02-01"; - // Constant Parameters - using( NoSynchronizationContext ) - { - // verify that Identity format is an exact match for uri - - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/l2Networks/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); - if (!_match.Success) - { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/l2Networks/{l2NetworkName}'"); - } - - // replace URI parameters with values from identity - var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var l2NetworkName = _match.Groups["l2NetworkName"].Value; - // construct URL - var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/subscriptions/" - + subscriptionId - + "/resourceGroups/" - + resourceGroupName - + "/providers/Microsoft.NetworkCloud/l2Networks/" - + l2NetworkName - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - // generate request object - var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Put, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - // add headers parameters - if (null != ifMatch) - { - request.Headers.Add("If-Match",ifMatch); - } - if (null != ifNoneMatch) - { - request.Headers.Add("If-None-Match",ifNoneMatch); - } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); - request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.L2NetworksCreateOrUpdate_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 @@ -18075,31 +39565,28 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task L2NetworksCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task RacksCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { global::System.Net.Http.HttpResponseMessage _response = null; try { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; var sendTask = sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // this operation supports x-ms-long-running-operation - var _originalUri = request.RequestUri.AbsoluteUri; // declared final-state-via: azure-async-operation var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) { - - // get the delay before polling. (default to 30 seconds if not present) - int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // start the delay timer (we'll await later...) - var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } // while we wait, let's grab the headers and get ready to poll. if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { @@ -18108,15 +39595,14 @@ public partial class NetworkCloud if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { location = _response.GetFirstHeader(@"Location"); } - var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); // and let's look at the current response body and see if we have some information we can give back to the listener var content = await _response.Content.ReadAsStringAsync(); - await waiting; - - // check for cancellation - if( eventListener.Token.IsCancellationRequested ) { return; } // drop the old response _response?.Dispose(); @@ -18125,45 +39611,45 @@ public partial class NetworkCloud _response = await sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // if we got back an OK, take a peek inside and see if it's done - if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) - { - var error = false; - try { - if( Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) - { - var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); - if( state is null ) - { - // the body doesn't contain any information that has the state of the LRO - // we're going to just get out, and let the consumer have the result - break; - } - - switch( state?.ToString()?.ToLower() ) - { - case "failed": - error = true; + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. break; - case "succeeded": - case "canceled": - // we're done polling. - break; - - default: - // need to keep polling! - _response.StatusCode = global::System.Net.HttpStatusCode.Created; - continue; - } - } - } catch { - // if we run into a problem peeking into the result, - // we really don't want to do anything special. - } - if (error) { - throw new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException(_response); - } - } + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException(_response); + } + } // check for terminal status code if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) @@ -18182,6 +39668,7 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } break; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -18189,13 +39676,13 @@ public partial class NetworkCloud case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.L2Network.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Rack.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -18211,12 +39698,12 @@ public partial class NetworkCloud } /// - /// 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 value must be an UUID. /// The name of the resource group. The name is case insensitive. - /// The name of the L2 network. + /// The name of the rack. /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. @@ -18226,7 +39713,7 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task L2NetworksCreateOrUpdate_Validate(string subscriptionId, string resourceGroupName, string l2NetworkName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2Network body, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task RacksCreateOrUpdate_Validate(string subscriptionId, string resourceGroupName, string rackName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRack body, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -18235,8 +39722,8 @@ public partial class NetworkCloud await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertNotNull(nameof(l2NetworkName),l2NetworkName); - await eventListener.AssertRegEx(nameof(l2NetworkName),l2NetworkName,@"^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$"); + await eventListener.AssertNotNull(nameof(rackName),rackName); + await eventListener.AssertRegEx(nameof(rackName), rackName, @"^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$"); await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); await eventListener.AssertNotNull(nameof(ifNoneMatch),ifNoneMatch); await eventListener.AssertNotNull(nameof(body), body); @@ -18244,10 +39731,13 @@ public partial class NetworkCloud } } - /// Delete the provided layer 2 (L2) network. + /// + /// Delete the provided rack. + /// All customer initiated requests will be rejected as the life cycle of this resource is managed by the system. + /// /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. - /// The name of the L2 network. + /// The name of the rack. /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. @@ -18261,7 +39751,7 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task L2NetworksDelete(string subscriptionId, string resourceGroupName, string l2NetworkName, string ifMatch, string ifNoneMatch, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task RacksDelete(string subscriptionId, string resourceGroupName, string rackName, string ifMatch, string ifNoneMatch, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -18273,8 +39763,8 @@ public partial class NetworkCloud + global::System.Uri.EscapeDataString(subscriptionId) + "/resourceGroups/" + global::System.Uri.EscapeDataString(resourceGroupName) - + "/providers/Microsoft.NetworkCloud/l2Networks/" - + global::System.Uri.EscapeDataString(l2NetworkName) + + "/providers/Microsoft.NetworkCloud/racks/" + + global::System.Uri.EscapeDataString(rackName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -18298,11 +39788,14 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.L2NetworksDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + await this.RacksDelete_Call (request, onOk,onNoContent,onDefault,eventListener,sender); } } - /// Delete the provided layer 2 (L2) network. + /// + /// Delete the provided rack. + /// All customer initiated requests will be rejected as the life cycle of this resource is managed by the system. + /// /// /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. @@ -18317,7 +39810,7 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task L2NetworksDeleteViaIdentity(global::System.String viaIdentity, string ifMatch, string ifNoneMatch, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task RacksDeleteViaIdentity(global::System.String viaIdentity, string ifMatch, string ifNoneMatch, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -18325,24 +39818,24 @@ public partial class NetworkCloud { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/l2Networks/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/racks/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/l2Networks/{l2NetworkName}'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/racks/{rackName}'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var l2NetworkName = _match.Groups["l2NetworkName"].Value; + var rackName = _match.Groups["rackName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + subscriptionId + "/resourceGroups/" + resourceGroupName - + "/providers/Microsoft.NetworkCloud/l2Networks/" - + l2NetworkName + + "/providers/Microsoft.NetworkCloud/racks/" + + rackName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -18366,11 +39859,11 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.L2NetworksDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + await this.RacksDelete_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). @@ -18381,32 +39874,29 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task L2NetworksDelete_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.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task RacksDelete_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.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { global::System.Net.Http.HttpResponseMessage _response = null; try { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; var sendTask = sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // this operation supports x-ms-long-running-operation - var _originalUri = request.RequestUri.AbsoluteUri; // declared final-state-via: location var _finalUri = _response.GetFirstHeader(@"Location"); var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) { - - // get the delay before polling. (default to 30 seconds if not present) - int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // start the delay timer (we'll await later...) - var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } // while we wait, let's grab the headers and get ready to poll. if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { @@ -18415,15 +39905,14 @@ public partial class NetworkCloud if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { location = _response.GetFirstHeader(@"Location"); } - var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); // and let's look at the current response body and see if we have some information we can give back to the listener var content = await _response.Content.ReadAsStringAsync(); - await waiting; - - // check for cancellation - if( eventListener.Token.IsCancellationRequested ) { return; } // drop the old response _response?.Dispose(); @@ -18432,45 +39921,45 @@ public partial class NetworkCloud _response = await sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // if we got back an OK, take a peek inside and see if it's done - if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) - { - var error = false; - try { - if( Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) - { - var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); - if( state is null ) - { - // the body doesn't contain any information that has the state of the LRO - // we're going to just get out, and let the consumer have the result - break; - } - - switch( state?.ToString()?.ToLower() ) - { - case "failed": - error = true; + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result break; - case "succeeded": - case "canceled": - // we're done polling. - break; - - default: - // need to keep polling! - _response.StatusCode = global::System.Net.HttpStatusCode.Created; - continue; - } - } - } catch { - // if we run into a problem peeking into the result, - // we really don't want to do anything special. - } - if (error) { - throw new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException(_response); - } - } + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException(_response); + } + } // check for terminal status code if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) @@ -18489,6 +39978,7 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } break; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -18508,7 +39998,7 @@ public partial class NetworkCloud default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -18524,12 +40014,12 @@ public partial class NetworkCloud } /// - /// 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 value must be an UUID. /// The name of the resource group. The name is case insensitive. - /// The name of the L2 network. + /// The name of the rack. /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. @@ -18538,7 +40028,7 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task L2NetworksDelete_Validate(string subscriptionId, string resourceGroupName, string l2NetworkName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task RacksDelete_Validate(string subscriptionId, string resourceGroupName, string rackName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -18547,17 +40037,17 @@ public partial class NetworkCloud await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertNotNull(nameof(l2NetworkName),l2NetworkName); - await eventListener.AssertRegEx(nameof(l2NetworkName),l2NetworkName,@"^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$"); + await eventListener.AssertNotNull(nameof(rackName),rackName); + await eventListener.AssertRegEx(nameof(rackName), rackName, @"^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$"); await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); await eventListener.AssertNotNull(nameof(ifNoneMatch),ifNoneMatch); } } - /// Get properties of the provided layer 2 (L2) network. + /// Get properties of the provided rack. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. - /// The name of the L2 network. + /// The name of the rack. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). @@ -18566,7 +40056,7 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task L2NetworksGet(string subscriptionId, string resourceGroupName, string l2NetworkName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task RacksGet(string subscriptionId, string resourceGroupName, string rackName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -18578,8 +40068,8 @@ public partial class NetworkCloud + global::System.Uri.EscapeDataString(subscriptionId) + "/resourceGroups/" + global::System.Uri.EscapeDataString(resourceGroupName) - + "/providers/Microsoft.NetworkCloud/l2Networks/" - + global::System.Uri.EscapeDataString(l2NetworkName) + + "/providers/Microsoft.NetworkCloud/racks/" + + global::System.Uri.EscapeDataString(rackName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -18593,11 +40083,11 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.L2NetworksGet_Call(request,onOk,onDefault,eventListener,sender); + await this.RacksGet_Call (request, onOk,onDefault,eventListener,sender); } } - /// Get properties of the provided layer 2 (L2) network. + /// Get properties of the provided rack. /// /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled @@ -18607,7 +40097,7 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task L2NetworksGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task RacksGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -18615,24 +40105,24 @@ public partial class NetworkCloud { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/l2Networks/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/racks/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/l2Networks/{l2NetworkName}'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/racks/{rackName}'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var l2NetworkName = _match.Groups["l2NetworkName"].Value; + var rackName = _match.Groups["rackName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + subscriptionId + "/resourceGroups/" + resourceGroupName - + "/providers/Microsoft.NetworkCloud/l2Networks/" - + l2NetworkName + + "/providers/Microsoft.NetworkCloud/racks/" + + rackName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -18646,96 +40136,72 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.L2NetworksGet_Call(request,onOk,onDefault,eventListener,sender); + await this.RacksGet_Call (request, onOk,onDefault,eventListener,sender); } } - /// Actual wire call for method. - /// the prepared HttpRequestMessage to send. - /// a delegate that is called 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 properties of the provided rack. + /// /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 L2NetworksGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task RacksGetViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { + var apiVersion = @"2025-02-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.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.L2Network.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/racks/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/racks/{rackName}'"); } - } - } - /// - /// Validation method for method. Call this like the actual call, but you will get validation - /// events back. - /// - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of the L2 network. - /// an instance that will receive events. - /// - /// A that will be complete when handling of the response is completed. - /// - internal async global::System.Threading.Tasks.Task L2NetworksGet_Validate(string subscriptionId, string resourceGroupName, string l2NetworkName, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) - { - using( NoSynchronizationContext ) - { - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); - await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); - await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); - await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); - await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertNotNull(nameof(l2NetworkName),l2NetworkName); - await eventListener.AssertRegEx(nameof(l2NetworkName),l2NetworkName,@"^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$"); + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var rackName = _match.Groups["rackName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.NetworkCloud/racks/" + + rackName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.RacksGetWithResult_Call (request, eventListener,sender); } } - /// Get a list of layer 2 (L2) networks in the provided resource group. + /// Get properties of the provided rack. /// The ID of the target subscription. The value must be an UUID. /// 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). + /// The name of the rack. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 L2NetworksListByResourceGroup(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.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task RacksGetWithResult(string subscriptionId, string resourceGroupName, string rackName, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -18747,76 +40213,86 @@ public partial class NetworkCloud + global::System.Uri.EscapeDataString(subscriptionId) + "/resourceGroups/" + global::System.Uri.EscapeDataString(resourceGroupName) - + "/providers/Microsoft.NetworkCloud/l2Networks" + + "/providers/Microsoft.NetworkCloud/racks/" + + global::System.Uri.EscapeDataString(rackName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.L2NetworksListByResourceGroup_Call(request,onOk,onDefault,eventListener,sender); + return await this.RacksGetWithResult_Call (request, eventListener,sender); } } - /// Get a list of layer 2 (L2) networks in the provided 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). + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 L2NetworksListByResourceGroupViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task RacksGetWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { - var apiVersion = @"2025-02-01"; - // Constant Parameters using( NoSynchronizationContext ) { - // verify that Identity format is an exact match for uri - - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/l2Networks$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); - if (!_match.Success) + global::System.Net.Http.HttpResponseMessage _response = null; + try { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/l2Networks'"); - } - - // 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.NetworkCloud/l2Networks" - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - // generate request object - var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.L2NetworksListByResourceGroup_Call(request,onOk,onDefault,eventListener,sender); + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Rack.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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 @@ -18826,7 +40302,7 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task L2NetworksListByResourceGroup_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task RacksGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -18837,6 +40313,7 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -18844,13 +40321,13 @@ public partial class NetworkCloud case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.L2NetworkList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Rack.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -18866,16 +40343,17 @@ public partial class NetworkCloud } /// - /// 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 value must be an UUID. /// The name of the resource group. The name is case insensitive. + /// The name of the rack. /// an instance that will receive events. /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task L2NetworksListByResourceGroup_Validate(string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task RacksGet_Validate(string subscriptionId, string resourceGroupName, string rackName, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -18884,11 +40362,14 @@ public partial class NetworkCloud await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(rackName),rackName); + await eventListener.AssertRegEx(nameof(rackName), rackName, @"^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$"); } } - /// Get a list of layer 2 (L2) networks in the provided subscription. + /// Get a list of racks in the provided resource group. /// The ID of the target subscription. The value must be an UUID. + /// 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). @@ -18897,7 +40378,7 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task L2NetworksListBySubscription(string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task RacksListByResourceGroup(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.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -18907,7 +40388,9 @@ public partial class NetworkCloud var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + global::System.Uri.EscapeDataString(subscriptionId) - + "/providers/Microsoft.NetworkCloud/l2Networks" + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.NetworkCloud/racks" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -18921,11 +40404,11 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.L2NetworksListBySubscription_Call(request,onOk,onDefault,eventListener,sender); + await this.RacksListByResourceGroup_Call (request, onOk,onDefault,eventListener,sender); } } - /// Get a list of layer 2 (L2) networks in the provided subscription. + /// Get a list of racks in the provided 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 @@ -18935,7 +40418,7 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task L2NetworksListBySubscriptionViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task RacksListByResourceGroupViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -18943,19 +40426,22 @@ public partial class NetworkCloud { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/providers/Microsoft.NetworkCloud/l2Networks$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/racks$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.NetworkCloud/l2Networks'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/racks'"); } // 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.NetworkCloud/l2Networks" + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.NetworkCloud/racks" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -18969,11 +40455,159 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.L2NetworksListBySubscription_Call(request,onOk,onDefault,eventListener,sender); + await this.RacksListByResourceGroup_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Get a list of racks in the provided resource group. + /// + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A + /// that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task RacksListByResourceGroupViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/racks$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/racks'"); + } + + // 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.NetworkCloud/racks" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.RacksListByResourceGroupWithResult_Call (request, eventListener,sender); + } + } + + /// Get a list of racks in the provided resource group. + /// The ID of the target subscription. The value must be an UUID. + /// 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.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A + /// that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task RacksListByResourceGroupWithResult(string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.NetworkCloud/racks" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.RacksListByResourceGroupWithResult_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.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A + /// that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task RacksListByResourceGroupWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.RackList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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 @@ -18983,7 +40617,7 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task L2NetworksListBySubscription_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task RacksListByResourceGroup_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -18994,6 +40628,7 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -19001,13 +40636,13 @@ public partial class NetworkCloud case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.L2NetworkList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.RackList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -19023,32 +40658,29 @@ public partial class NetworkCloud } /// - /// 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 value must be an UUID. + /// 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 L2NetworksListBySubscription_Validate(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task RacksListByResourceGroup_Validate(string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); } } - /// Update tags associated with the provided layer 2 (L2) network. + /// Get a list of racks in the provided subscription. /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of the L2 network. - /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify - /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. - /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. - /// Other values will result in error from server as they are not supported. - /// The request body. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). @@ -19057,7 +40689,7 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task L2NetworksUpdate(string subscriptionId, string resourceGroupName, string l2NetworkName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkPatchParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task RacksListBySubscription(string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -19067,10 +40699,7 @@ public partial class NetworkCloud var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + global::System.Uri.EscapeDataString(subscriptionId) - + "/resourceGroups/" - + global::System.Uri.EscapeDataString(resourceGroupName) - + "/providers/Microsoft.NetworkCloud/l2Networks/" - + global::System.Uri.EscapeDataString(l2NetworkName) + + "/providers/Microsoft.NetworkCloud/racks" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -19079,36 +40708,17 @@ public partial class NetworkCloud // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Patch, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - // add headers parameters - if (null != ifMatch) - { - request.Headers.Add("If-Match",ifMatch); - } - if (null != ifNoneMatch) - { - request.Headers.Add("If-None-Match",ifNoneMatch); - } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); - request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.L2NetworksUpdate_Call(request,onOk,onDefault,eventListener,sender); + await this.RacksListBySubscription_Call (request, onOk,onDefault,eventListener,sender); } } - /// Update tags associated with the provided layer 2 (L2) network. + /// Get a list of racks in the provided subscription. /// - /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify - /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. - /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. - /// Other values will result in error from server as they are not supported. - /// The request body. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). @@ -19117,7 +40727,7 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task L2NetworksUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkPatchParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task RacksListBySubscriptionViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -19125,24 +40735,19 @@ public partial class NetworkCloud { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/l2Networks/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/providers/Microsoft.NetworkCloud/racks$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/l2Networks/{l2NetworkName}'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.NetworkCloud/racks'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var l2NetworkName = _match.Groups["l2NetworkName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + subscriptionId - + "/resourceGroups/" - + resourceGroupName - + "/providers/Microsoft.NetworkCloud/l2Networks/" - + l2NetworkName + + "/providers/Microsoft.NetworkCloud/racks" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -19151,30 +40756,158 @@ public partial class NetworkCloud // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Patch, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - // add headers parameters - if (null != ifMatch) - { - request.Headers.Add("If-Match",ifMatch); - } - if (null != ifNoneMatch) + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.RacksListBySubscription_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Get a list of racks in the provided subscription. + /// + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A + /// that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task RacksListBySubscriptionViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-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.NetworkCloud/racks$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) { - request.Headers.Add("If-None-Match",ifNoneMatch); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.NetworkCloud/racks'"); } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); - request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // 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.NetworkCloud/racks" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.RacksListBySubscriptionWithResult_Call (request, eventListener,sender); + } + } + + /// Get a list of racks in the provided subscription. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A + /// that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task RacksListBySubscriptionWithResult(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/providers/Microsoft.NetworkCloud/racks" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.L2NetworksUpdate_Call(request,onOk,onDefault,eventListener,sender); + return await this.RacksListBySubscriptionWithResult_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.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A + /// that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task RacksListBySubscriptionWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.RackList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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 @@ -19184,7 +40917,7 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task L2NetworksUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task RacksListBySubscription_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -19195,6 +40928,7 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -19202,13 +40936,13 @@ public partial class NetworkCloud case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.L2Network.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.RackList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -19224,45 +40958,30 @@ public partial class NetworkCloud } /// - /// 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 value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of the L2 network. - /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify - /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. - /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. - /// Other values will result in error from server as they are not supported. - /// The request body. /// an instance that will receive events. /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task L2NetworksUpdate_Validate(string subscriptionId, string resourceGroupName, string l2NetworkName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkPatchParameters body, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task RacksListBySubscription_Validate(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); - await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); - await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); - await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertNotNull(nameof(l2NetworkName),l2NetworkName); - await eventListener.AssertRegEx(nameof(l2NetworkName),l2NetworkName,@"^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$"); - await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); - await eventListener.AssertNotNull(nameof(ifNoneMatch),ifNoneMatch); - await eventListener.AssertNotNull(nameof(body), body); - await eventListener.AssertObjectIsValid(nameof(body), body); } } /// - /// Create a new layer 3 (L3) network or update the properties of the existing network. + /// Patch properties of the provided rack, or update the tags associated with the rack. Properties and tag update can be done + /// independently. /// /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. - /// The name of the L3 network. + /// The name of the rack. /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. @@ -19273,10 +40992,11 @@ public partial class NetworkCloud /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 L3NetworksCreateOrUpdate(string subscriptionId, string resourceGroupName, string l3NetworkName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3Network body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task RacksUpdate(string subscriptionId, string resourceGroupName, string rackName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackPatchParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -19288,8 +41008,8 @@ public partial class NetworkCloud + global::System.Uri.EscapeDataString(subscriptionId) + "/resourceGroups/" + global::System.Uri.EscapeDataString(resourceGroupName) - + "/providers/Microsoft.NetworkCloud/l3Networks/" - + global::System.Uri.EscapeDataString(l3NetworkName) + + "/providers/Microsoft.NetworkCloud/racks/" + + global::System.Uri.EscapeDataString(rackName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -19298,7 +41018,7 @@ public partial class NetworkCloud // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Put, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Patch, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } // add headers parameters @@ -19313,16 +41033,17 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // 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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.L3NetworksCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + await this.RacksUpdate_Call (request, onOk,onDefault,eventListener,sender); } } /// - /// Create a new layer 3 (L3) network or update the properties of the existing network. + /// Patch properties of the provided rack, or update the tags associated with the rack. Properties and tag update can be done + /// independently. /// /// /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify @@ -19335,10 +41056,11 @@ public partial class NetworkCloud /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 L3NetworksCreateOrUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3Network body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task RacksUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackPatchParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -19346,24 +41068,24 @@ public partial class NetworkCloud { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/l3Networks/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/racks/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/l3Networks/{l3NetworkName}'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/racks/{rackName}'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var l3NetworkName = _match.Groups["l3NetworkName"].Value; + var rackName = _match.Groups["rackName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + subscriptionId + "/resourceGroups/" + resourceGroupName - + "/providers/Microsoft.NetworkCloud/l3Networks/" - + l3NetworkName + + "/providers/Microsoft.NetworkCloud/racks/" + + rackName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -19372,7 +41094,7 @@ public partial class NetworkCloud // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Put, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Patch, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } // add headers parameters @@ -19387,203 +41109,101 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // 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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.L3NetworksCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + await this.RacksUpdate_Call (request, onOk,onDefault,eventListener,sender); } } - /// Actual wire call for method. - /// the prepared HttpRequestMessage to send. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). + /// + /// Patch properties of the provided rack, or update the tags associated with the rack. Properties and tag update can be done + /// independently. + /// + /// + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// The request body. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 L3NetworksCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task RacksUpdateViaIdentityWithResult(global::System.String viaIdentity, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackPatchParameters body, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate) { + var apiVersion = @"2025-02-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.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // this operation supports x-ms-long-running-operation - var _originalUri = request.RequestUri.AbsoluteUri; - // declared final-state-via: azure-async-operation - var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - var location = _response.GetFirstHeader(@"Location"); - while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) - { - - // get the delay before polling. (default to 30 seconds if not present) - int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // start the delay timer (we'll await later...) - var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); - - // while we wait, let's grab the headers and get ready to poll. - if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { - asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - } - if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { - location = _response.GetFirstHeader(@"Location"); - } - var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; - request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); - - // and let's look at the current response body and see if we have some information we can give back to the listener - var content = await _response.Content.ReadAsStringAsync(); - await waiting; - - // check for cancellation - if( eventListener.Token.IsCancellationRequested ) { return; } - - // drop the old response - _response?.Dispose(); - - // make the polling call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // verify that Identity format is an exact match for uri - // if we got back an OK, take a peek inside and see if it's done - if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) - { - var error = false; - try { - if( Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) - { - var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); - if( state is null ) - { - // the body doesn't contain any information that has the state of the LRO - // we're going to just get out, and let the consumer have the result - break; - } - - switch( state?.ToString()?.ToLower() ) - { - case "failed": - error = true; - break; - case "succeeded": - case "canceled": - // we're done polling. - break; - - default: - // need to keep polling! - _response.StatusCode = global::System.Net.HttpStatusCode.Created; - continue; - } - } - } catch { - // if we run into a problem peeking into the result, - // we really don't want to do anything special. - } - if (error) { - throw new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException(_response); - } - } + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/racks/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/racks/{rackName}'"); + } - // check for terminal status code - if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) - { - continue; - } - // we are done polling, do a request on final target? - // create a new request with the final uri - request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var rackName = _match.Groups["rackName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.NetworkCloud/racks/" + + rackName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - // drop the old response - _response?.Dispose(); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - // make the final call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - break; - } - var _contentType = _response.Content.Headers.ContentType?.MediaType; + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - switch ( _response.StatusCode ) - { - case global::System.Net.HttpStatusCode.OK: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.L3Network.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); } - finally + if (null != ifNoneMatch) { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); + request.Headers.Add("If-None-Match",ifNoneMatch); } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.RacksUpdateWithResult_Call (request, eventListener,sender); } } /// - /// Validation method for method. Call this like the actual call, but you will get - /// validation events back. + /// Patch properties of the provided rack, or update the tags associated with the rack. Properties and tag update can be done + /// independently. /// /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. - /// The name of the L3 network. - /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify - /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. - /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. - /// Other values will result in error from server as they are not supported. - /// The request body. - /// an instance that will receive events. - /// - /// A that will be complete when handling of the response is completed. - /// - internal async global::System.Threading.Tasks.Task L3NetworksCreateOrUpdate_Validate(string subscriptionId, string resourceGroupName, string l3NetworkName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3Network body, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) - { - using( NoSynchronizationContext ) - { - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); - await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); - await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); - await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); - await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertNotNull(nameof(l3NetworkName),l3NetworkName); - await eventListener.AssertRegEx(nameof(l3NetworkName),l3NetworkName,@"^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$"); - await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); - await eventListener.AssertNotNull(nameof(ifNoneMatch),ifNoneMatch); - await eventListener.AssertNotNull(nameof(body), body); - await eventListener.AssertObjectIsValid(nameof(body), body); - } - } - - /// Delete the provided layer 3 (L3) network. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of the L3 network. + /// The name of the rack. /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. /// Other values will result in error from server as they are not supported. + /// Json string supplied to the RacksUpdate operation /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns 204 (NoContent). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. @@ -19591,7 +41211,7 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task L3NetworksDelete(string subscriptionId, string resourceGroupName, string l3NetworkName, string ifMatch, string ifNoneMatch, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task RacksUpdateViaJsonString(string subscriptionId, string resourceGroupName, string rackName, string ifMatch, string ifNoneMatch, 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.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -19603,8 +41223,8 @@ public partial class NetworkCloud + global::System.Uri.EscapeDataString(subscriptionId) + "/resourceGroups/" + global::System.Uri.EscapeDataString(resourceGroupName) - + "/providers/Microsoft.NetworkCloud/l3Networks/" - + global::System.Uri.EscapeDataString(l3NetworkName) + + "/providers/Microsoft.NetworkCloud/racks/" + + global::System.Uri.EscapeDataString(rackName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -19613,7 +41233,7 @@ public partial class NetworkCloud // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Delete, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Patch, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } // add headers parameters @@ -19627,62 +41247,121 @@ public partial class NetworkCloud } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.L3NetworksDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + await this.RacksUpdate_Call (request, onOk,onDefault,eventListener,sender); } } - /// Delete the provided layer 3 (L3) network. - /// + /// + /// Patch properties of the provided rack, or update the tags associated with the rack. Properties and tag update can be done + /// independently. + /// + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the rack. /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. /// Other values will result in error from server as they are not supported. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called 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 RacksUpdate operation /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 L3NetworksDeleteViaIdentity(global::System.String viaIdentity, string ifMatch, string ifNoneMatch, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task RacksUpdateViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string rackName, string ifMatch, string ifNoneMatch, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { var apiVersion = @"2025-02-01"; // 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.NetworkCloud/racks/" + + global::System.Uri.EscapeDataString(rackName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/l3Networks/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); - if (!_match.Success) + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // add headers parameters + if (null != ifMatch) { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/l3Networks/{l3NetworkName}'"); + request.Headers.Add("If-Match",ifMatch); + } + if (null != ifNoneMatch) + { + request.Headers.Add("If-None-Match",ifNoneMatch); } - // replace URI parameters with values from identity - var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var l3NetworkName = _match.Groups["l3NetworkName"].Value; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.RacksUpdateWithResult_Call (request, eventListener,sender); + } + } + + /// + /// Patch properties of the provided rack, or update the tags associated with the rack. Properties and tag update can be done + /// independently. + /// + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the rack. + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// The request body. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 RacksUpdateWithResult(string subscriptionId, string resourceGroupName, string rackName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackPatchParameters body, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" - + subscriptionId + + global::System.Uri.EscapeDataString(subscriptionId) + "/resourceGroups/" - + resourceGroupName - + "/providers/Microsoft.NetworkCloud/l3Networks/" - + l3NetworkName + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.NetworkCloud/racks/" + + global::System.Uri.EscapeDataString(rackName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Delete, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } // add headers parameters if (null != ifMatch) @@ -19694,16 +41373,171 @@ public partial class NetworkCloud request.Headers.Add("If-None-Match",ifNoneMatch); } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.L3NetworksDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + return await this.RacksUpdateWithResult_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.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that + /// will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task RacksUpdateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + // declared final-state-via: azure-async-operation + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + break; + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Rack.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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. @@ -19711,32 +41545,28 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task L3NetworksDelete_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.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task RacksUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { global::System.Net.Http.HttpResponseMessage _response = null; try { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; var sendTask = sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // this operation supports x-ms-long-running-operation - var _originalUri = request.RequestUri.AbsoluteUri; - // declared final-state-via: location - var _finalUri = _response.GetFirstHeader(@"Location"); + // declared final-state-via: azure-async-operation var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) { - - // get the delay before polling. (default to 30 seconds if not present) - int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // start the delay timer (we'll await later...) - var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } // while we wait, let's grab the headers and get ready to poll. if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { @@ -19745,15 +41575,14 @@ public partial class NetworkCloud if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { location = _response.GetFirstHeader(@"Location"); } - var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); // and let's look at the current response body and see if we have some information we can give back to the listener var content = await _response.Content.ReadAsStringAsync(); - await waiting; - - // check for cancellation - if( eventListener.Token.IsCancellationRequested ) { return; } // drop the old response _response?.Dispose(); @@ -19762,45 +41591,45 @@ public partial class NetworkCloud _response = await sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // if we got back an OK, take a peek inside and see if it's done - if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) - { - var error = false; - try { - if( Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) - { - var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); - if( state is null ) - { - // the body doesn't contain any information that has the state of the LRO - // we're going to just get out, and let the consumer have the result - break; - } - - switch( state?.ToString()?.ToLower() ) - { - case "failed": - error = true; + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. break; - case "succeeded": - case "canceled": - // we're done polling. - break; - - default: - // need to keep polling! - _response.StatusCode = global::System.Net.HttpStatusCode.Created; - continue; - } - } - } catch { - // if we run into a problem peeking into the result, - // we really don't want to do anything special. - } - if (error) { - throw new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException(_response); - } - } + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException(_response); + } + } // check for terminal status code if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) @@ -19809,7 +41638,7 @@ public partial class NetworkCloud } // we are done polling, do a request on final target? // create a new request with the final uri - request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); // drop the old response _response?.Dispose(); @@ -19819,6 +41648,7 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } break; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -19826,19 +41656,13 @@ public partial class NetworkCloud case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onNoContent(_response); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Rack.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -19854,21 +41678,22 @@ public partial class NetworkCloud } /// - /// 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 value must be an UUID. /// The name of the resource group. The name is case insensitive. - /// The name of the L3 network. + /// The name of the rack. /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. /// Other values will result in error from server as they are not supported. + /// The request body. /// an instance that will receive events. /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task L3NetworksDelete_Validate(string subscriptionId, string resourceGroupName, string l3NetworkName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task RacksUpdate_Validate(string subscriptionId, string resourceGroupName, string rackName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackPatchParameters body, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -19877,26 +41702,37 @@ public partial class NetworkCloud await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertNotNull(nameof(l3NetworkName),l3NetworkName); - await eventListener.AssertRegEx(nameof(l3NetworkName),l3NetworkName,@"^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$"); + await eventListener.AssertNotNull(nameof(rackName),rackName); + await eventListener.AssertRegEx(nameof(rackName), rackName, @"^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$"); await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); await eventListener.AssertNotNull(nameof(ifNoneMatch),ifNoneMatch); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); } } - /// Get properties of the provided layer 3 (L3) network. + /// + /// update a new storage appliance or update the properties of the existing one. + /// All customer initiated requests will be rejected as the life cycle of this resource is managed by the system. + /// /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. - /// The name of the L3 network. + /// The name of the storage appliance. + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// The request body. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 L3NetworksGet(string subscriptionId, string resourceGroupName, string l3NetworkName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task StorageAppliancesCreateOrUpdate(string subscriptionId, string resourceGroupName, string storageApplianceName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliance body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -19908,8 +41744,8 @@ public partial class NetworkCloud + global::System.Uri.EscapeDataString(subscriptionId) + "/resourceGroups/" + global::System.Uri.EscapeDataString(resourceGroupName) - + "/providers/Microsoft.NetworkCloud/l3Networks/" - + global::System.Uri.EscapeDataString(l3NetworkName) + + "/providers/Microsoft.NetworkCloud/storageAppliances/" + + global::System.Uri.EscapeDataString(storageApplianceName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -19918,26 +41754,49 @@ public partial class NetworkCloud // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Put, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + if (null != ifNoneMatch) + { + request.Headers.Add("If-None-Match",ifNoneMatch); + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.L3NetworksGet_Call(request,onOk,onDefault,eventListener,sender); + await this.StorageAppliancesCreateOrUpdate_Call (request, onOk,onDefault,eventListener,sender); } } - /// Get properties of the provided layer 3 (L3) network. + /// + /// update a new storage appliance or update the properties of the existing one. + /// All customer initiated requests will be rejected as the life cycle of this resource is managed by the system. + /// /// + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// The request body. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 L3NetworksGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task StorageAppliancesCreateOrUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliance body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -19945,24 +41804,24 @@ public partial class NetworkCloud { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/l3Networks/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/storageAppliances/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/l3Networks/{l3NetworkName}'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/storageAppliances/{storageApplianceName}'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var l3NetworkName = _match.Groups["l3NetworkName"].Value; + var storageApplianceName = _match.Groups["storageApplianceName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + subscriptionId + "/resourceGroups/" + resourceGroupName - + "/providers/Microsoft.NetworkCloud/l3Networks/" - + l3NetworkName + + "/providers/Microsoft.NetworkCloud/storageAppliances/" + + storageApplianceName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -19971,132 +41830,115 @@ public partial class NetworkCloud // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Put, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.L3NetworksGet_Call(request,onOk,onDefault,eventListener,sender); - } - } - - /// Actual wire call for method. - /// the prepared HttpRequestMessage to send. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. - /// - /// A that will be complete when handling of the response is completed. - /// - internal async global::System.Threading.Tasks.Task L3NetworksGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) - { - using( NoSynchronizationContext ) - { - global::System.Net.Http.HttpResponseMessage _response = null; - try + // add headers parameters + if (null != ifMatch) { - var sendTask = sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - var _contentType = _response.Content.Headers.ContentType?.MediaType; - - switch ( _response.StatusCode ) - { - case global::System.Net.HttpStatusCode.OK: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.L3Network.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } + request.Headers.Add("If-Match",ifMatch); } - finally + if (null != ifNoneMatch) { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); + request.Headers.Add("If-None-Match",ifNoneMatch); } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.StorageAppliancesCreateOrUpdate_Call (request, onOk,onDefault,eventListener,sender); } } /// - /// Validation method for method. Call this like the actual call, but you will get validation - /// events back. + /// update a new storage appliance or update the properties of the existing one. + /// All customer initiated requests will be rejected as the life cycle of this resource is managed by the system. /// - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of the L3 network. - /// an instance that will receive events. - /// - /// A that will be complete when handling of the response is completed. - /// - internal async global::System.Threading.Tasks.Task L3NetworksGet_Validate(string subscriptionId, string resourceGroupName, string l3NetworkName, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) - { - using( NoSynchronizationContext ) - { - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); - await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); - await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); - await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); - await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertNotNull(nameof(l3NetworkName),l3NetworkName); - await eventListener.AssertRegEx(nameof(l3NetworkName),l3NetworkName,@"^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$"); - } - } - - /// Get a list of layer 3 (L3) networks in the provided resource group. - /// The ID of the target subscription. The value must be an UUID. - /// 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). + /// + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// The request body. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 L3NetworksListByResourceGroup(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.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task StorageAppliancesCreateOrUpdateViaIdentityWithResult(global::System.String viaIdentity, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliance body, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2025-02-01"; // Constant Parameters using( NoSynchronizationContext ) { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/storageAppliances/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/storageAppliances/{storageApplianceName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var storageApplianceName = _match.Groups["storageApplianceName"].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.NetworkCloud/l3Networks" + + resourceGroupName + + "/providers/Microsoft.NetworkCloud/storageAppliances/" + + storageApplianceName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + if (null != ifNoneMatch) + { + request.Headers.Add("If-None-Match",ifNoneMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.L3NetworksListByResourceGroup_Call(request,onOk,onDefault,eventListener,sender); + return await this.StorageAppliancesCreateOrUpdateWithResult_Call (request, eventListener,sender); } } - /// Get a list of layer 3 (L3) networks in the provided resource group. - /// + /// + /// update a new storage appliance or update the properties of the existing one. + /// All customer initiated requests will be rejected as the life cycle of this resource is managed by the system. + /// + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the storage appliance. + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// Json string supplied to the StorageAppliancesCreateOrUpdate 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). @@ -20105,30 +41947,20 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task L3NetworksListByResourceGroupViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task StorageAppliancesCreateOrUpdateViaJsonString(string subscriptionId, string resourceGroupName, string storageApplianceName, string ifMatch, string ifNoneMatch, 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.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { var apiVersion = @"2025-02-01"; // Constant Parameters using( NoSynchronizationContext ) { - // verify that Identity format is an exact match for uri - - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/l3Networks$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); - if (!_match.Success) - { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/l3Networks'"); - } - - // 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 + + global::System.Uri.EscapeDataString(subscriptionId) + "/resourceGroups/" - + resourceGroupName - + "/providers/Microsoft.NetworkCloud/l3Networks" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.NetworkCloud/storageAppliances/" + + global::System.Uri.EscapeDataString(storageApplianceName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -20137,97 +41969,112 @@ public partial class NetworkCloud // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Put, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.L3NetworksListByResourceGroup_Call(request,onOk,onDefault,eventListener,sender); - } - } - - /// Actual wire call for method. - /// the prepared HttpRequestMessage to send. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. - /// - /// A that will be complete when handling of the response is completed. - /// - internal async global::System.Threading.Tasks.Task L3NetworksListByResourceGroup_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) - { - using( NoSynchronizationContext ) - { - global::System.Net.Http.HttpResponseMessage _response = null; - try + // add headers parameters + if (null != ifMatch) { - var sendTask = sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - var _contentType = _response.Content.Headers.ContentType?.MediaType; - - switch ( _response.StatusCode ) - { - case global::System.Net.HttpStatusCode.OK: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.L3NetworkList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } + request.Headers.Add("If-Match",ifMatch); } - finally + if (null != ifNoneMatch) { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); + request.Headers.Add("If-None-Match",ifNoneMatch); } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.StorageAppliancesCreateOrUpdate_Call (request, onOk,onDefault,eventListener,sender); } } /// - /// Validation method for method. Call this like the actual call, but you will - /// get validation events back. + /// update a new storage appliance or update the properties of the existing one. + /// All customer initiated requests will be rejected as the life cycle of this resource is managed by the system. /// /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. + /// The name of the storage appliance. + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// Json string supplied to the StorageAppliancesCreateOrUpdate operation /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 L3NetworksListByResourceGroup_Validate(string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) + public async global::System.Threading.Tasks.Task StorageAppliancesCreateOrUpdateViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string storageApplianceName, string ifMatch, string ifNoneMatch, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { + var apiVersion = @"2025-02-01"; + // Constant Parameters using( NoSynchronizationContext ) { - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); - await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); - await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); - await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); - await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.NetworkCloud/storageAppliances/" + + global::System.Uri.EscapeDataString(storageApplianceName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + if (null != ifNoneMatch) + { + request.Headers.Add("If-None-Match",ifNoneMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.StorageAppliancesCreateOrUpdateWithResult_Call (request, eventListener,sender); } } - /// Get a list of layer 3 (L3) networks in the provided subscription. + /// + /// update a new storage appliance or update the properties of the existing one. + /// All customer initiated requests will be rejected as the life cycle of this resource is managed by the system. + /// /// The ID of the target subscription. The value must be an UUID. - /// a delegate that is called 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 group. The name is case insensitive. + /// The name of the storage appliance. + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// The request body. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 L3NetworksListBySubscription(string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task StorageAppliancesCreateOrUpdateWithResult(string subscriptionId, string resourceGroupName, string storageApplianceName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliance body, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -20237,73 +42084,196 @@ public partial class NetworkCloud var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + global::System.Uri.EscapeDataString(subscriptionId) - + "/providers/Microsoft.NetworkCloud/l3Networks" + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.NetworkCloud/storageAppliances/" + + global::System.Uri.EscapeDataString(storageApplianceName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + if (null != ifNoneMatch) + { + request.Headers.Add("If-None-Match",ifNoneMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.L3NetworksListBySubscription_Call(request,onOk,onDefault,eventListener,sender); + return await this.StorageAppliancesCreateOrUpdateWithResult_Call (request, eventListener,sender); } } - /// Get a list of layer 3 (L3) networks in the provided 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). + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 L3NetworksListBySubscriptionViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task StorageAppliancesCreateOrUpdateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { - var apiVersion = @"2025-02-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.NetworkCloud/l3Networks$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); - if (!_match.Success) + global::System.Net.Http.HttpResponseMessage _response = null; + try { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.NetworkCloud/l3Networks'"); - } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + // declared final-state-via: azure-async-operation + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } - // 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.NetworkCloud/l3Networks" - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); - // generate request object - var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + // drop the old response + _response?.Dispose(); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.L3NetworksListBySubscription_Call(request,onOk,onDefault,eventListener,sender); + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + break; + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.StorageAppliance.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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 @@ -20313,17 +42283,110 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task L3NetworksListBySubscription_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task StorageAppliancesCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { global::System.Net.Http.HttpResponseMessage _response = null; try { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; var sendTask = sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // declared final-state-via: azure-async-operation + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -20331,13 +42394,13 @@ public partial class NetworkCloud case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.L3NetworkList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.StorageAppliance.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -20353,33 +42416,52 @@ public partial class NetworkCloud } /// - /// 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 value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the storage appliance. + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// The request body. /// an instance that will receive events. /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task L3NetworksListBySubscription_Validate(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task StorageAppliancesCreateOrUpdate_Validate(string subscriptionId, string resourceGroupName, string storageApplianceName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliance body, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(storageApplianceName),storageApplianceName); + await eventListener.AssertRegEx(nameof(storageApplianceName), storageApplianceName, @"^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$"); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(ifNoneMatch),ifNoneMatch); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); } } - /// Update tags associated with the provided layer 3 (L3) network. + /// + /// Delete the provided storage appliance. + /// All customer initiated requests will be rejected as the life cycle of this resource is managed by the system. + /// /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. - /// The name of the L3 network. + /// The name of the storage appliance. /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. /// Other values will result in error from server as they are not supported. - /// The request body. /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. @@ -20387,7 +42469,7 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task L3NetworksUpdate(string subscriptionId, string resourceGroupName, string l3NetworkName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkPatchParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task StorageAppliancesDelete(string subscriptionId, string resourceGroupName, string storageApplianceName, string ifMatch, string ifNoneMatch, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -20399,8 +42481,8 @@ public partial class NetworkCloud + global::System.Uri.EscapeDataString(subscriptionId) + "/resourceGroups/" + global::System.Uri.EscapeDataString(resourceGroupName) - + "/providers/Microsoft.NetworkCloud/l3Networks/" - + global::System.Uri.EscapeDataString(l3NetworkName) + + "/providers/Microsoft.NetworkCloud/storageAppliances/" + + global::System.Uri.EscapeDataString(storageApplianceName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -20409,7 +42491,7 @@ public partial class NetworkCloud // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Patch, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Delete, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } // add headers parameters @@ -20423,23 +42505,22 @@ public partial class NetworkCloud } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); - request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.L3NetworksUpdate_Call(request,onOk,onDefault,eventListener,sender); + await this.StorageAppliancesDelete_Call (request, onOk,onNoContent,onDefault,eventListener,sender); } } - /// Update tags associated with the provided layer 3 (L3) network. + /// + /// Delete the provided storage appliance. + /// All customer initiated requests will be rejected as the life cycle of this resource is managed by the system. + /// /// /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. /// Other values will result in error from server as they are not supported. - /// The request body. /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. @@ -20447,7 +42528,7 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task L3NetworksUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkPatchParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task StorageAppliancesDeleteViaIdentity(global::System.String viaIdentity, string ifMatch, string ifNoneMatch, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -20455,24 +42536,24 @@ public partial class NetworkCloud { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/l3Networks/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/storageAppliances/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/l3Networks/{l3NetworkName}'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/storageAppliances/{storageApplianceName}'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var l3NetworkName = _match.Groups["l3NetworkName"].Value; + var storageApplianceName = _match.Groups["storageApplianceName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + subscriptionId + "/resourceGroups/" + resourceGroupName - + "/providers/Microsoft.NetworkCloud/l3Networks/" - + l3NetworkName + + "/providers/Microsoft.NetworkCloud/storageAppliances/" + + storageApplianceName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -20481,7 +42562,7 @@ public partial class NetworkCloud // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Patch, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Delete, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } // add headers parameters @@ -20495,18 +42576,15 @@ public partial class NetworkCloud } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); - request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.L3NetworksUpdate_Call(request,onOk,onDefault,eventListener,sender); + await this.StorageAppliancesDelete_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. @@ -20514,17 +42592,111 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task L3NetworksUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task StorageAppliancesDelete_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.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { global::System.Net.Http.HttpResponseMessage _response = null; try { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; var sendTask = sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // declared final-state-via: location + var _finalUri = _response.GetFirstHeader(@"Location"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -20532,13 +42704,19 @@ public partial class NetworkCloud case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.L3Network.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -20554,22 +42732,21 @@ public partial class NetworkCloud } /// - /// 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 value must be an UUID. /// The name of the resource group. The name is case insensitive. - /// The name of the L3 network. + /// The name of the storage appliance. /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. /// Other values will result in error from server as they are not supported. - /// The request body. /// an instance that will receive events. /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task L3NetworksUpdate_Validate(string subscriptionId, string resourceGroupName, string l3NetworkName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkPatchParameters body, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task StorageAppliancesDelete_Validate(string subscriptionId, string resourceGroupName, string storageApplianceName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -20578,27 +42755,17 @@ public partial class NetworkCloud await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertNotNull(nameof(l3NetworkName),l3NetworkName); - await eventListener.AssertRegEx(nameof(l3NetworkName),l3NetworkName,@"^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$"); + await eventListener.AssertNotNull(nameof(storageApplianceName),storageApplianceName); + await eventListener.AssertRegEx(nameof(storageApplianceName), storageApplianceName, @"^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$"); await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); await eventListener.AssertNotNull(nameof(ifNoneMatch),ifNoneMatch); - await eventListener.AssertNotNull(nameof(body), body); - await eventListener.AssertObjectIsValid(nameof(body), body); } } - /// - /// Create new or update the existing metrics configuration of the provided cluster. - /// + /// Disable remote vendor management of the provided storage appliance. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. - /// The name of the cluster. - /// The name of the metrics configuration for the cluster. - /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify - /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. - /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. - /// Other values will result in error from server as they are not supported. - /// The request body. + /// The name of the storage appliance. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). @@ -20607,7 +42774,7 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task MetricsConfigurationsCreateOrUpdate(string subscriptionId, string resourceGroupName, string clusterName, string metricsConfigurationName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfiguration body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task StorageAppliancesDisableRemoteVendorManagement(string subscriptionId, string resourceGroupName, string storageApplianceName, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -20619,10 +42786,9 @@ public partial class NetworkCloud + global::System.Uri.EscapeDataString(subscriptionId) + "/resourceGroups/" + global::System.Uri.EscapeDataString(resourceGroupName) - + "/providers/Microsoft.NetworkCloud/clusters/" - + global::System.Uri.EscapeDataString(clusterName) - + "/metricsConfigurations/" - + global::System.Uri.EscapeDataString(metricsConfigurationName) + + "/providers/Microsoft.NetworkCloud/storageAppliances/" + + global::System.Uri.EscapeDataString(storageApplianceName) + + "/disableRemoteVendorManagement" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -20631,38 +42797,17 @@ public partial class NetworkCloud // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Put, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Post, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - // add headers parameters - if (null != ifMatch) - { - request.Headers.Add("If-Match",ifMatch); - } - if (null != ifNoneMatch) - { - request.Headers.Add("If-None-Match",ifNoneMatch); - } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); - request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.MetricsConfigurationsCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + await this.StorageAppliancesDisableRemoteVendorManagement_Call (request, onOk,onDefault,eventListener,sender); } } - /// - /// Create new or update the existing metrics configuration of the provided cluster. - /// + /// Disable remote vendor management of the provided storage appliance. /// - /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify - /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. - /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. - /// Other values will result in error from server as they are not supported. - /// The request body. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). @@ -20671,7 +42816,7 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task MetricsConfigurationsCreateOrUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfiguration body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task StorageAppliancesDisableRemoteVendorManagementViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -20679,27 +42824,25 @@ public partial class NetworkCloud { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/clusters/(?[^/]+)/metricsConfigurations/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/storageAppliances/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/metricsConfigurations/{metricsConfigurationName}'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/storageAppliances/{storageApplianceName}'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var clusterName = _match.Groups["clusterName"].Value; - var metricsConfigurationName = _match.Groups["metricsConfigurationName"].Value; + var storageApplianceName = _match.Groups["storageApplianceName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + subscriptionId + "/resourceGroups/" + resourceGroupName - + "/providers/Microsoft.NetworkCloud/clusters/" - + clusterName - + "/metricsConfigurations/" - + metricsConfigurationName + + "/providers/Microsoft.NetworkCloud/storageAppliances/" + + storageApplianceName + + "/disableRemoteVendorManagement" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -20708,30 +42851,18 @@ public partial class NetworkCloud // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Put, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Post, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - // add headers parameters - if (null != ifMatch) - { - request.Headers.Add("If-Match",ifMatch); - } - if (null != ifNoneMatch) - { - request.Headers.Add("If-None-Match",ifNoneMatch); - } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); - request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.MetricsConfigurationsCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + await this.StorageAppliancesDisableRemoteVendorManagement_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 @@ -20741,31 +42872,29 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task MetricsConfigurationsCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task StorageAppliancesDisableRemoteVendorManagement_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { global::System.Net.Http.HttpResponseMessage _response = null; try { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; var sendTask = sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // this operation supports x-ms-long-running-operation - var _originalUri = request.RequestUri.AbsoluteUri; - // declared final-state-via: azure-async-operation + // declared final-state-via: location + var _finalUri = _response.GetFirstHeader(@"Location"); var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) { - - // get the delay before polling. (default to 30 seconds if not present) - int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // start the delay timer (we'll await later...) - var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } // while we wait, let's grab the headers and get ready to poll. if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { @@ -20774,15 +42903,14 @@ public partial class NetworkCloud if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { location = _response.GetFirstHeader(@"Location"); } - var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); // and let's look at the current response body and see if we have some information we can give back to the listener var content = await _response.Content.ReadAsStringAsync(); - await waiting; - - // check for cancellation - if( eventListener.Token.IsCancellationRequested ) { return; } // drop the old response _response?.Dispose(); @@ -20791,45 +42919,45 @@ public partial class NetworkCloud _response = await sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // if we got back an OK, take a peek inside and see if it's done - if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) - { - var error = false; - try { - if( Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) - { - var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); - if( state is null ) - { - // the body doesn't contain any information that has the state of the LRO - // we're going to just get out, and let the consumer have the result - break; - } - - switch( state?.ToString()?.ToLower() ) - { - case "failed": - error = true; + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result break; - case "succeeded": - case "canceled": - // we're done polling. - break; - - default: - // need to keep polling! - _response.StatusCode = global::System.Net.HttpStatusCode.Created; - continue; - } - } - } catch { - // if we run into a problem peeking into the result, - // we really don't want to do anything special. - } - if (error) { - throw new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException(_response); - } - } + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException(_response); + } + } // check for terminal status code if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) @@ -20838,7 +42966,7 @@ public partial class NetworkCloud } // we are done polling, do a request on final target? // create a new request with the final uri - request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); + request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); // drop the old response _response?.Dispose(); @@ -20848,6 +42976,7 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } break; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -20855,13 +42984,13 @@ public partial class NetworkCloud case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ClusterMetricsConfiguration.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -20877,23 +43006,17 @@ public partial class NetworkCloud } /// - /// 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 value must be an UUID. /// The name of the resource group. The name is case insensitive. - /// The name of the cluster. - /// The name of the metrics configuration for the cluster. - /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify - /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. - /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. - /// Other values will result in error from server as they are not supported. - /// The request body. + /// The name of the storage appliance. /// an instance that will receive events. /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task MetricsConfigurationsCreateOrUpdate_Validate(string subscriptionId, string resourceGroupName, string clusterName, string metricsConfigurationName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfiguration body, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task StorageAppliancesDisableRemoteVendorManagement_Validate(string subscriptionId, string resourceGroupName, string storageApplianceName, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -20902,36 +43025,26 @@ public partial class NetworkCloud await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertNotNull(nameof(clusterName),clusterName); - await eventListener.AssertRegEx(nameof(clusterName),clusterName,@"^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$"); - await eventListener.AssertNotNull(nameof(metricsConfigurationName),metricsConfigurationName); - await eventListener.AssertRegEx(nameof(metricsConfigurationName),metricsConfigurationName,@"^default$"); - await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); - await eventListener.AssertNotNull(nameof(ifNoneMatch),ifNoneMatch); - await eventListener.AssertNotNull(nameof(body), body); - await eventListener.AssertObjectIsValid(nameof(body), body); + await eventListener.AssertNotNull(nameof(storageApplianceName),storageApplianceName); + await eventListener.AssertRegEx(nameof(storageApplianceName), storageApplianceName, @"^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$"); } } - /// Delete the metrics configuration of the provided cluster. + /// Enable remote vendor management of the provided storage appliance. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. - /// The name of the cluster. - /// The name of the metrics configuration for the cluster. - /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify - /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. - /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. - /// Other values will result in error from server as they are not supported. + /// The name of the storage appliance. + /// The request body. /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns 204 (NoContent). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 MetricsConfigurationsDelete(string subscriptionId, string resourceGroupName, string clusterName, string metricsConfigurationName, string ifMatch, string ifNoneMatch, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task StorageAppliancesEnableRemoteVendorManagement(string subscriptionId, string resourceGroupName, string storageApplianceName, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceEnableRemoteVendorManagementParameters body, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -20943,10 +43056,9 @@ public partial class NetworkCloud + global::System.Uri.EscapeDataString(subscriptionId) + "/resourceGroups/" + global::System.Uri.EscapeDataString(resourceGroupName) - + "/providers/Microsoft.NetworkCloud/clusters/" - + global::System.Uri.EscapeDataString(clusterName) - + "/metricsConfigurations/" - + global::System.Uri.EscapeDataString(metricsConfigurationName) + + "/providers/Microsoft.NetworkCloud/storageAppliances/" + + global::System.Uri.EscapeDataString(storageApplianceName) + + "/enableRemoteVendorManagement" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -20955,33 +43067,85 @@ public partial class NetworkCloud // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Delete, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Post, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - // add headers parameters - if (null != ifMatch) - { - request.Headers.Add("If-Match",ifMatch); - } - if (null != ifNoneMatch) + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.StorageAppliancesEnableRemoteVendorManagement_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Enable remote vendor management of the provided storage appliance. + /// + /// The request body. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 StorageAppliancesEnableRemoteVendorManagementViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceEnableRemoteVendorManagementParameters body, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/storageAppliances/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) { - request.Headers.Add("If-None-Match",ifNoneMatch); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/storageAppliances/{storageApplianceName}'"); } + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var storageApplianceName = _match.Groups["storageApplianceName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.NetworkCloud/storageAppliances/" + + storageApplianceName + + "/enableRemoteVendorManagement" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.MetricsConfigurationsDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + await this.StorageAppliancesEnableRemoteVendorManagement_Call (request, onOk,onDefault,eventListener,sender); } } - /// Delete the metrics configuration of the provided cluster. - /// - /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify - /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. - /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. - /// Other values will result in error from server as they are not supported. + /// Enable remote vendor management of the provided storage appliance. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the storage appliance. + /// Json string supplied to the StorageAppliancesEnableRemoteVendorManagement operation /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns 204 (NoContent). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. @@ -20989,35 +43153,21 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task MetricsConfigurationsDeleteViaIdentity(global::System.String viaIdentity, string ifMatch, string ifNoneMatch, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task StorageAppliancesEnableRemoteVendorManagementViaJsonString(string subscriptionId, string resourceGroupName, string storageApplianceName, global::System.String jsonString, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { var apiVersion = @"2025-02-01"; // Constant Parameters using( NoSynchronizationContext ) { - // verify that Identity format is an exact match for uri - - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/clusters/(?[^/]+)/metricsConfigurations/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); - if (!_match.Success) - { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/metricsConfigurations/{metricsConfigurationName}'"); - } - - // replace URI parameters with values from identity - var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var clusterName = _match.Groups["clusterName"].Value; - var metricsConfigurationName = _match.Groups["metricsConfigurationName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" - + subscriptionId + + global::System.Uri.EscapeDataString(subscriptionId) + "/resourceGroups/" - + resourceGroupName - + "/providers/Microsoft.NetworkCloud/clusters/" - + clusterName - + "/metricsConfigurations/" - + metricsConfigurationName + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.NetworkCloud/storageAppliances/" + + global::System.Uri.EscapeDataString(storageApplianceName) + + "/enableRemoteVendorManagement" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -21026,29 +43176,24 @@ public partial class NetworkCloud // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Delete, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Post, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - // add headers parameters - if (null != ifMatch) - { - request.Headers.Add("If-Match",ifMatch); - } - if (null != ifNoneMatch) - { - request.Headers.Add("If-None-Match",ifNoneMatch); - } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.MetricsConfigurationsDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + await this.StorageAppliancesEnableRemoteVendorManagement_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 204 (NoContent). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. @@ -21056,32 +43201,29 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task MetricsConfigurationsDelete_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.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task StorageAppliancesEnableRemoteVendorManagement_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { global::System.Net.Http.HttpResponseMessage _response = null; try { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; var sendTask = sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // this operation supports x-ms-long-running-operation - var _originalUri = request.RequestUri.AbsoluteUri; // declared final-state-via: location var _finalUri = _response.GetFirstHeader(@"Location"); var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) { - - // get the delay before polling. (default to 30 seconds if not present) - int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // start the delay timer (we'll await later...) - var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } // while we wait, let's grab the headers and get ready to poll. if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { @@ -21090,15 +43232,14 @@ public partial class NetworkCloud if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { location = _response.GetFirstHeader(@"Location"); } - var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); // and let's look at the current response body and see if we have some information we can give back to the listener var content = await _response.Content.ReadAsStringAsync(); - await waiting; - - // check for cancellation - if( eventListener.Token.IsCancellationRequested ) { return; } // drop the old response _response?.Dispose(); @@ -21107,45 +43248,45 @@ public partial class NetworkCloud _response = await sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // if we got back an OK, take a peek inside and see if it's done - if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) - { - var error = false; - try { - if( Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) - { - var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); - if( state is null ) - { - // the body doesn't contain any information that has the state of the LRO - // we're going to just get out, and let the consumer have the result - break; - } - - switch( state?.ToString()?.ToLower() ) - { - case "failed": - error = true; + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result break; - case "succeeded": - case "canceled": - // we're done polling. - break; - - default: - // need to keep polling! - _response.StatusCode = global::System.Net.HttpStatusCode.Created; - continue; - } - } - } catch { - // if we run into a problem peeking into the result, - // we really don't want to do anything special. - } - if (error) { - throw new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException(_response); - } - } + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException(_response); + } + } // check for terminal status code if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) @@ -21164,6 +43305,7 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } break; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -21174,16 +43316,10 @@ public partial class NetworkCloud await onOk(_response); break; } - case global::System.Net.HttpStatusCode.NoContent: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onNoContent(_response); - break; - } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -21199,22 +43335,18 @@ public partial class NetworkCloud } /// - /// 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 value must be an UUID. /// The name of the resource group. The name is case insensitive. - /// The name of the cluster. - /// The name of the metrics configuration for the cluster. - /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify - /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. - /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. - /// Other values will result in error from server as they are not supported. + /// The name of the storage appliance. + /// The request body. /// an instance that will receive events. /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task MetricsConfigurationsDelete_Validate(string subscriptionId, string resourceGroupName, string clusterName, string metricsConfigurationName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task StorageAppliancesEnableRemoteVendorManagement_Validate(string subscriptionId, string resourceGroupName, string storageApplianceName, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceEnableRemoteVendorManagementParameters body, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -21223,20 +43355,17 @@ public partial class NetworkCloud await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertNotNull(nameof(clusterName),clusterName); - await eventListener.AssertRegEx(nameof(clusterName),clusterName,@"^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$"); - await eventListener.AssertNotNull(nameof(metricsConfigurationName),metricsConfigurationName); - await eventListener.AssertRegEx(nameof(metricsConfigurationName),metricsConfigurationName,@"^default$"); - await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); - await eventListener.AssertNotNull(nameof(ifNoneMatch),ifNoneMatch); + await eventListener.AssertNotNull(nameof(storageApplianceName),storageApplianceName); + await eventListener.AssertRegEx(nameof(storageApplianceName), storageApplianceName, @"^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); } } - /// Get metrics configuration of the provided cluster. + /// Get properties of the provided storage appliance. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. - /// The name of the cluster. - /// The name of the metrics configuration for the cluster. + /// The name of the storage appliance. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). @@ -21245,7 +43374,7 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task MetricsConfigurationsGet(string subscriptionId, string resourceGroupName, string clusterName, string metricsConfigurationName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task StorageAppliancesGet(string subscriptionId, string resourceGroupName, string storageApplianceName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -21257,10 +43386,8 @@ public partial class NetworkCloud + global::System.Uri.EscapeDataString(subscriptionId) + "/resourceGroups/" + global::System.Uri.EscapeDataString(resourceGroupName) - + "/providers/Microsoft.NetworkCloud/clusters/" - + global::System.Uri.EscapeDataString(clusterName) - + "/metricsConfigurations/" - + global::System.Uri.EscapeDataString(metricsConfigurationName) + + "/providers/Microsoft.NetworkCloud/storageAppliances/" + + global::System.Uri.EscapeDataString(storageApplianceName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -21274,11 +43401,11 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.MetricsConfigurationsGet_Call(request,onOk,onDefault,eventListener,sender); + await this.StorageAppliancesGet_Call (request, onOk,onDefault,eventListener,sender); } } - /// Get metrics configuration of the provided cluster. + /// Get properties of the provided storage appliance. /// /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled @@ -21288,7 +43415,7 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task MetricsConfigurationsGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task StorageAppliancesGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -21296,27 +43423,24 @@ public partial class NetworkCloud { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/clusters/(?[^/]+)/metricsConfigurations/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/storageAppliances/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/metricsConfigurations/{metricsConfigurationName}'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/storageAppliances/{storageApplianceName}'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var clusterName = _match.Groups["clusterName"].Value; - var metricsConfigurationName = _match.Groups["metricsConfigurationName"].Value; + var storageApplianceName = _match.Groups["storageApplianceName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + subscriptionId + "/resourceGroups/" + resourceGroupName - + "/providers/Microsoft.NetworkCloud/clusters/" - + clusterName - + "/metricsConfigurations/" - + metricsConfigurationName + + "/providers/Microsoft.NetworkCloud/storageAppliances/" + + storageApplianceName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -21330,100 +43454,72 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.MetricsConfigurationsGet_Call(request,onOk,onDefault,eventListener,sender); + await this.StorageAppliancesGet_Call (request, onOk,onDefault,eventListener,sender); } } - /// Actual wire call for method. - /// the prepared HttpRequestMessage to send. - /// a delegate that is called 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 properties of the provided storage appliance. + /// /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 MetricsConfigurationsGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task StorageAppliancesGetViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { + var apiVersion = @"2025-02-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.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ClusterMetricsConfiguration.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/storageAppliances/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/storageAppliances/{storageApplianceName}'"); } - } - } - /// - /// Validation method for method. Call this like the actual call, but you will get - /// validation events back. - /// - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of the cluster. - /// The name of the metrics configuration for the cluster. - /// an instance that will receive events. - /// - /// A that will be complete when handling of the response is completed. - /// - internal async global::System.Threading.Tasks.Task MetricsConfigurationsGet_Validate(string subscriptionId, string resourceGroupName, string clusterName, string metricsConfigurationName, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) - { - using( NoSynchronizationContext ) - { - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); - await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); - await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); - await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); - await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertNotNull(nameof(clusterName),clusterName); - await eventListener.AssertRegEx(nameof(clusterName),clusterName,@"^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$"); - await eventListener.AssertNotNull(nameof(metricsConfigurationName),metricsConfigurationName); - await eventListener.AssertRegEx(nameof(metricsConfigurationName),metricsConfigurationName,@"^default$"); + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var storageApplianceName = _match.Groups["storageApplianceName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.NetworkCloud/storageAppliances/" + + storageApplianceName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.StorageAppliancesGetWithResult_Call (request, eventListener,sender); } } - /// Get a list of metrics configurations for the provided cluster. + /// Get properties of the provided storage appliance. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. - /// The name of the cluster. - /// a delegate that is called 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 storage appliance. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 MetricsConfigurationsListByCluster(string subscriptionId, string resourceGroupName, string clusterName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task StorageAppliancesGetWithResult(string subscriptionId, string resourceGroupName, string storageApplianceName, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -21435,81 +43531,86 @@ public partial class NetworkCloud + global::System.Uri.EscapeDataString(subscriptionId) + "/resourceGroups/" + global::System.Uri.EscapeDataString(resourceGroupName) - + "/providers/Microsoft.NetworkCloud/clusters/" - + global::System.Uri.EscapeDataString(clusterName) - + "/metricsConfigurations" + + "/providers/Microsoft.NetworkCloud/storageAppliances/" + + global::System.Uri.EscapeDataString(storageApplianceName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.MetricsConfigurationsListByCluster_Call(request,onOk,onDefault,eventListener,sender); + return await this.StorageAppliancesGetWithResult_Call (request, eventListener,sender); } } - /// Get a list of metrics configurations for the provided cluster. - /// - /// a delegate that is called 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.NetworkCloud.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 MetricsConfigurationsListByClusterViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task StorageAppliancesGetWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { - var apiVersion = @"2025-02-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.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud/clusters/(?[^/]+)/metricsConfigurations$", 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.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.StorageAppliance.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud/clusters/{clusterName}/metricsConfigurations'"); + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); } - - // replace URI parameters with values from identity - var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var clusterName = _match.Groups["clusterName"].Value; - // construct URL - var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/subscriptions/" - + subscriptionId - + "/resourceGroups/" - + resourceGroupName - + "/providers/Microsoft.NetworkCloud/clusters/" - + clusterName - + "/metricsConfigurations" - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - // generate request object - var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.MetricsConfigurationsListByCluster_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 @@ -21519,7 +43620,7 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task MetricsConfigurationsListByCluster_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task StorageAppliancesGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -21530,6 +43631,7 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -21537,13 +43639,13 @@ public partial class NetworkCloud case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ClusterMetricsConfigurationList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.StorageAppliance.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -21559,17 +43661,17 @@ public partial class NetworkCloud } /// - /// 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 value must be an UUID. /// The name of the resource group. The name is case insensitive. - /// The name of the cluster. + /// The name of the storage appliance. /// an instance that will receive events. /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task MetricsConfigurationsListByCluster_Validate(string subscriptionId, string resourceGroupName, string clusterName, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task StorageAppliancesGet_Validate(string subscriptionId, string resourceGroupName, string storageApplianceName, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -21578,24 +43680,14 @@ public partial class NetworkCloud await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertNotNull(nameof(clusterName),clusterName); - await eventListener.AssertRegEx(nameof(clusterName),clusterName,@"^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$"); + await eventListener.AssertNotNull(nameof(storageApplianceName),storageApplianceName); + await eventListener.AssertRegEx(nameof(storageApplianceName), storageApplianceName, @"^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$"); } } - /// - /// Patch properties of metrics configuration for the provided cluster, or update the tags associated with it. Properties - /// and tag updates can be done independently. - /// + /// Get a list of storage appliances in the provided resource group. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. - /// The name of the cluster. - /// The name of the metrics configuration for the cluster. - /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify - /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. - /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. - /// Other values will result in error from server as they are not supported. - /// The request body. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). @@ -21604,7 +43696,7 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task MetricsConfigurationsUpdate(string subscriptionId, string resourceGroupName, string clusterName, string metricsConfigurationName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationPatchParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task StorageAppliancesListByResourceGroup(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.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -21616,10 +43708,7 @@ public partial class NetworkCloud + global::System.Uri.EscapeDataString(subscriptionId) + "/resourceGroups/" + global::System.Uri.EscapeDataString(resourceGroupName) - + "/providers/Microsoft.NetworkCloud/clusters/" - + global::System.Uri.EscapeDataString(clusterName) - + "/metricsConfigurations/" - + global::System.Uri.EscapeDataString(metricsConfigurationName) + + "/providers/Microsoft.NetworkCloud/storageAppliances" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -21628,39 +43717,17 @@ public partial class NetworkCloud // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Patch, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - // add headers parameters - if (null != ifMatch) - { - request.Headers.Add("If-Match",ifMatch); - } - if (null != ifNoneMatch) - { - request.Headers.Add("If-None-Match",ifNoneMatch); - } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); - request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.MetricsConfigurationsUpdate_Call(request,onOk,onDefault,eventListener,sender); + await this.StorageAppliancesListByResourceGroup_Call (request, onOk,onDefault,eventListener,sender); } } - /// - /// Patch properties of metrics configuration for the provided cluster, or update the tags associated with it. Properties - /// and tag updates can be done independently. - /// + /// Get a list of storage appliances in the provided resource group. /// - /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify - /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. - /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. - /// Other values will result in error from server as they are not supported. - /// The request body. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). @@ -21669,7 +43736,7 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task MetricsConfigurationsUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationPatchParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task StorageAppliancesListByResourceGroupViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -21677,27 +43744,22 @@ public partial class NetworkCloud { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/clusters/(?[^/]+)/metricsConfigurations/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/storageAppliances$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/metricsConfigurations/{metricsConfigurationName}'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/storageAppliances'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var clusterName = _match.Groups["clusterName"].Value; - var metricsConfigurationName = _match.Groups["metricsConfigurationName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + subscriptionId + "/resourceGroups/" + resourceGroupName - + "/providers/Microsoft.NetworkCloud/clusters/" - + clusterName - + "/metricsConfigurations/" - + metricsConfigurationName + + "/providers/Microsoft.NetworkCloud/storageAppliances" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -21706,223 +43768,74 @@ public partial class NetworkCloud // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Patch, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - // add headers parameters - if (null != ifMatch) - { - request.Headers.Add("If-Match",ifMatch); - } - if (null != ifNoneMatch) - { - request.Headers.Add("If-None-Match",ifNoneMatch); - } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); - request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.MetricsConfigurationsUpdate_Call(request,onOk,onDefault,eventListener,sender); + await this.StorageAppliancesListByResourceGroup_Call (request, onOk,onDefault,eventListener,sender); } } - /// Actual wire call for method. - /// the prepared HttpRequestMessage to send. - /// a delegate that is called 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 a list of storage appliances in the provided resource group. + /// /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 MetricsConfigurationsUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task StorageAppliancesListByResourceGroupViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { + var apiVersion = @"2025-02-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.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // this operation supports x-ms-long-running-operation - var _originalUri = request.RequestUri.AbsoluteUri; - // declared final-state-via: azure-async-operation - var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - var location = _response.GetFirstHeader(@"Location"); - while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) - { - - // get the delay before polling. (default to 30 seconds if not present) - int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // start the delay timer (we'll await later...) - var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); - - // while we wait, let's grab the headers and get ready to poll. - if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { - asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - } - if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { - location = _response.GetFirstHeader(@"Location"); - } - var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; - request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); - - // and let's look at the current response body and see if we have some information we can give back to the listener - var content = await _response.Content.ReadAsStringAsync(); - await waiting; - - // check for cancellation - if( eventListener.Token.IsCancellationRequested ) { return; } - - // drop the old response - _response?.Dispose(); - - // make the polling call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // if we got back an OK, take a peek inside and see if it's done - if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) - { - var error = false; - try { - if( Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) - { - var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); - if( state is null ) - { - // the body doesn't contain any information that has the state of the LRO - // we're going to just get out, and let the consumer have the result - break; - } - - switch( state?.ToString()?.ToLower() ) - { - case "failed": - error = true; - break; - case "succeeded": - case "canceled": - // we're done polling. - break; - - default: - // need to keep polling! - _response.StatusCode = global::System.Net.HttpStatusCode.Created; - continue; - } - } - } catch { - // if we run into a problem peeking into the result, - // we really don't want to do anything special. - } - if (error) { - throw new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException(_response); - } - } - - // check for terminal status code - if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) - { - continue; - } - // we are done polling, do a request on final target? - // create a new request with the final uri - request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); - - // drop the old response - _response?.Dispose(); - - // make the final call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - break; - } - 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.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ClusterMetricsConfiguration.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/storageAppliances$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/storageAppliances'"); } - } - } - /// - /// Validation method for method. Call this like the actual call, but you will - /// get validation events back. - /// - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of the cluster. - /// The name of the metrics configuration for the cluster. - /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify - /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. - /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. - /// Other values will result in error from server as they are not supported. - /// The request body. - /// an instance that will receive events. - /// - /// A that will be complete when handling of the response is completed. - /// - internal async global::System.Threading.Tasks.Task MetricsConfigurationsUpdate_Validate(string subscriptionId, string resourceGroupName, string clusterName, string metricsConfigurationName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationPatchParameters body, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) - { - using( NoSynchronizationContext ) - { - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); - await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); - await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); - await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); - await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertNotNull(nameof(clusterName),clusterName); - await eventListener.AssertRegEx(nameof(clusterName),clusterName,@"^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$"); - await eventListener.AssertNotNull(nameof(metricsConfigurationName),metricsConfigurationName); - await eventListener.AssertRegEx(nameof(metricsConfigurationName),metricsConfigurationName,@"^default$"); - await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); - await eventListener.AssertNotNull(nameof(ifNoneMatch),ifNoneMatch); - 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; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.NetworkCloud/storageAppliances" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.StorageAppliancesListByResourceGroupWithResult_Call (request, eventListener,sender); } } - /// - /// Get a list of all available resource provider operations. It contains a URL link to get the next set of results. - /// - /// a delegate that is called 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 a list of storage appliances in the provided resource group. + /// The ID of the target subscription. The value must be an UUID. + /// 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.NetworkCloud.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 OperationsList(global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task StorageAppliancesListByResourceGroupWithResult(string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -21930,72 +43843,93 @@ public partial class NetworkCloud { // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/providers/Microsoft.NetworkCloud/operations" + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.NetworkCloud/storageAppliances" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.OperationsList_Call(request,onOk,onDefault,eventListener,sender); + return await this.StorageAppliancesListByResourceGroupWithResult_Call (request, eventListener,sender); } } /// - /// Get a list of all available resource provider operations. It contains a URL link to get the next set of results. + /// 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.NetworkCloud.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.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task StorageAppliancesListByResourceGroupWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { - var apiVersion = @"2025-02-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.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud/operations$", 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.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.StorageApplianceList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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 '/providers/Microsoft.NetworkCloud/operations'"); + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); } - - // replace URI parameters with values from identity - // construct URL - var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/providers/Microsoft.NetworkCloud/operations" - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - // generate request object - var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.OperationsList_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 @@ -22005,7 +43939,7 @@ public partial class NetworkCloud /// /// 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.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task StorageAppliancesListByResourceGroup_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -22016,6 +43950,7 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -22023,13 +43958,13 @@ public partial class NetworkCloud case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.OperationListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.StorageApplianceList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -22045,24 +43980,29 @@ public partial class NetworkCloud } /// - /// 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 value must be an UUID. + /// 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 OperationsList_Validate(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task StorageAppliancesListByResourceGroup_Validate(string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { - + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); } } - /// Get the properties of the provided rack SKU. + /// Get a list of storage appliances in the provided subscription. /// The ID of the target subscription. The value must be an UUID. - /// The name of the rack SKU. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). @@ -22071,7 +44011,7 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task RackSkusGet(string subscriptionId, string rackSkuName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task StorageAppliancesListBySubscription(string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -22081,8 +44021,7 @@ public partial class NetworkCloud var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + global::System.Uri.EscapeDataString(subscriptionId) - + "/providers/Microsoft.NetworkCloud/rackSkus/" - + global::System.Uri.EscapeDataString(rackSkuName) + + "/providers/Microsoft.NetworkCloud/storageAppliances" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -22096,11 +44035,11 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.RackSkusGet_Call(request,onOk,onDefault,eventListener,sender); + await this.StorageAppliancesListBySubscription_Call (request, onOk,onDefault,eventListener,sender); } } - /// Get the properties of the provided rack SKU. + /// Get a list of storage appliances in the provided 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 @@ -22110,7 +44049,7 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task RackSkusGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task StorageAppliancesListBySubscriptionViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -22118,21 +44057,19 @@ public partial class NetworkCloud { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/providers/Microsoft.NetworkCloud/rackSkus/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/providers/Microsoft.NetworkCloud/storageAppliances$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.NetworkCloud/rackSkus/{rackSkuName}'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.NetworkCloud/storageAppliances'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; - var rackSkuName = _match.Groups["rackSkuName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + subscriptionId - + "/providers/Microsoft.NetworkCloud/rackSkus/" - + rackSkuName + + "/providers/Microsoft.NetworkCloud/storageAppliances" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -22146,91 +44083,65 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.RackSkusGet_Call(request,onOk,onDefault,eventListener,sender); + await this.StorageAppliancesListBySubscription_Call (request, onOk,onDefault,eventListener,sender); } } - /// Actual wire call for method. - /// the prepared HttpRequestMessage to send. - /// a delegate that is called 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 a list of storage appliances in the provided subscription. + /// /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 RackSkusGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task StorageAppliancesListBySubscriptionViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { + var apiVersion = @"2025-02-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.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.RackSku.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/providers/Microsoft.NetworkCloud/storageAppliances$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.NetworkCloud/storageAppliances'"); } - } - } - /// - /// Validation method for method. Call this like the actual call, but you will get validation events - /// back. - /// - /// The ID of the target subscription. The value must be an UUID. - /// The name of the rack SKU. - /// an instance that will receive events. - /// - /// A that will be complete when handling of the response is completed. - /// - internal async global::System.Threading.Tasks.Task RackSkusGet_Validate(string subscriptionId, string rackSkuName, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) - { - using( NoSynchronizationContext ) - { - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); - await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); - await eventListener.AssertNotNull(nameof(rackSkuName),rackSkuName); - await eventListener.AssertRegEx(nameof(rackSkuName),rackSkuName,@"^([a-zA-Z0-9][a-zA-Z0-9-_]{0,126}[a-zA-Z0-9])$"); + // 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.NetworkCloud/storageAppliances" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.StorageAppliancesListBySubscriptionWithResult_Call (request, eventListener,sender); } } - /// Get a list of rack SKUs in the provided subscription. + /// Get a list of storage appliances in the provided subscription. /// The ID of the target subscription. The value must be an UUID. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 RackSkusListBySubscription(string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task StorageAppliancesListBySubscriptionWithResult(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -22240,73 +44151,89 @@ public partial class NetworkCloud var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + global::System.Uri.EscapeDataString(subscriptionId) - + "/providers/Microsoft.NetworkCloud/rackSkus" + + "/providers/Microsoft.NetworkCloud/storageAppliances" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.RackSkusListBySubscription_Call(request,onOk,onDefault,eventListener,sender); + return await this.StorageAppliancesListBySubscriptionWithResult_Call (request, eventListener,sender); } } - /// Get a list of rack SKUs in the provided 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). + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 RackSkusListBySubscriptionViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task StorageAppliancesListBySubscriptionWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { - var apiVersion = @"2025-02-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.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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/(?[^/]+)/providers/Microsoft.NetworkCloud/rackSkus$", 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.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.StorageApplianceList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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}/providers/Microsoft.NetworkCloud/rackSkus'"); + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); } - - // 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.NetworkCloud/rackSkus" - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - // generate request object - var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.RackSkusListBySubscription_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 @@ -22316,7 +44243,7 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task RackSkusListBySubscription_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task StorageAppliancesListBySubscription_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -22327,6 +44254,7 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -22334,13 +44262,13 @@ public partial class NetworkCloud case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.RackSkuList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.StorageApplianceList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -22356,15 +44284,15 @@ public partial class NetworkCloud } /// - /// 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 value must be an UUID. /// an instance that will receive events. /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task RackSkusListBySubscription_Validate(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task StorageAppliancesListBySubscription_Validate(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -22374,12 +44302,12 @@ public partial class NetworkCloud } /// - /// Create a new rack or update properties of the existing one. - /// All customer initiated requests will be rejected as the life cycle of this resource is managed by the system. + /// update properties of the provided storage appliance, or update tags associated with the storage appliance Properties and + /// tag update can be done independently. /// /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. - /// The name of the rack. + /// The name of the storage appliance. /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. @@ -22390,10 +44318,11 @@ public partial class NetworkCloud /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 RacksCreateOrUpdate(string subscriptionId, string resourceGroupName, string rackName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRack body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task StorageAppliancesUpdate(string subscriptionId, string resourceGroupName, string storageApplianceName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePatchParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -22405,8 +44334,8 @@ public partial class NetworkCloud + global::System.Uri.EscapeDataString(subscriptionId) + "/resourceGroups/" + global::System.Uri.EscapeDataString(resourceGroupName) - + "/providers/Microsoft.NetworkCloud/racks/" - + global::System.Uri.EscapeDataString(rackName) + + "/providers/Microsoft.NetworkCloud/storageAppliances/" + + global::System.Uri.EscapeDataString(storageApplianceName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -22415,7 +44344,7 @@ public partial class NetworkCloud // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Put, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Patch, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } // add headers parameters @@ -22430,17 +44359,17 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // 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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.RacksCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + await this.StorageAppliancesUpdate_Call (request, onOk,onDefault,eventListener,sender); } } /// - /// Create a new rack or update properties of the existing one. - /// All customer initiated requests will be rejected as the life cycle of this resource is managed by the system. + /// update properties of the provided storage appliance, or update tags associated with the storage appliance Properties and + /// tag update can be done independently. /// /// /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify @@ -22453,10 +44382,11 @@ public partial class NetworkCloud /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 RacksCreateOrUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRack body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task StorageAppliancesUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePatchParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -22464,24 +44394,24 @@ public partial class NetworkCloud { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/racks/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/storageAppliances/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/racks/{rackName}'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/storageAppliances/{storageApplianceName}'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var rackName = _match.Groups["rackName"].Value; + var storageApplianceName = _match.Groups["storageApplianceName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + subscriptionId + "/resourceGroups/" + resourceGroupName - + "/providers/Microsoft.NetworkCloud/racks/" - + rackName + + "/providers/Microsoft.NetworkCloud/storageAppliances/" + + storageApplianceName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -22490,7 +44420,7 @@ public partial class NetworkCloud // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Put, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Patch, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } // add headers parameters @@ -22505,206 +44435,101 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // 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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.RacksCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + await this.StorageAppliancesUpdate_Call (request, onOk,onDefault,eventListener,sender); } } - /// Actual wire call for method. - /// the prepared HttpRequestMessage to send. - /// a delegate that is called 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 properties of the provided storage appliance, or update tags associated with the storage appliance Properties and + /// tag update can be done independently. + /// + /// + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// The request body. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 RacksCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task StorageAppliancesUpdateViaIdentityWithResult(global::System.String viaIdentity, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePatchParameters body, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate) { + var apiVersion = @"2025-02-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.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // this operation supports x-ms-long-running-operation - var _originalUri = request.RequestUri.AbsoluteUri; - // declared final-state-via: azure-async-operation - var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - var location = _response.GetFirstHeader(@"Location"); - while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) - { - - // get the delay before polling. (default to 30 seconds if not present) - int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // start the delay timer (we'll await later...) - var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); - - // while we wait, let's grab the headers and get ready to poll. - if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { - asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - } - if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { - location = _response.GetFirstHeader(@"Location"); - } - var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; - request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); - - // and let's look at the current response body and see if we have some information we can give back to the listener - var content = await _response.Content.ReadAsStringAsync(); - await waiting; - - // check for cancellation - if( eventListener.Token.IsCancellationRequested ) { return; } - - // drop the old response - _response?.Dispose(); - - // make the polling call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // verify that Identity format is an exact match for uri - // if we got back an OK, take a peek inside and see if it's done - if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) - { - var error = false; - try { - if( Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) - { - var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); - if( state is null ) - { - // the body doesn't contain any information that has the state of the LRO - // we're going to just get out, and let the consumer have the result - break; - } - - switch( state?.ToString()?.ToLower() ) - { - case "failed": - error = true; - break; - case "succeeded": - case "canceled": - // we're done polling. - break; - - default: - // need to keep polling! - _response.StatusCode = global::System.Net.HttpStatusCode.Created; - continue; - } - } - } catch { - // if we run into a problem peeking into the result, - // we really don't want to do anything special. - } - if (error) { - throw new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException(_response); - } - } + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/storageAppliances/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/storageAppliances/{storageApplianceName}'"); + } - // check for terminal status code - if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) - { - continue; - } - // we are done polling, do a request on final target? - // create a new request with the final uri - request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var storageApplianceName = _match.Groups["storageApplianceName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.NetworkCloud/storageAppliances/" + + storageApplianceName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - // drop the old response - _response?.Dispose(); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - // make the final call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - break; - } - var _contentType = _response.Content.Headers.ContentType?.MediaType; + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - switch ( _response.StatusCode ) - { - case global::System.Net.HttpStatusCode.OK: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.Rack.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); } - finally + if (null != ifNoneMatch) { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); + request.Headers.Add("If-None-Match",ifNoneMatch); } - } - } - /// - /// Validation method for method. Call this like the actual call, but you will get validation - /// events back. - /// - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of the rack. - /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify - /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. - /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. - /// Other values will result in error from server as they are not supported. - /// The request body. - /// an instance that will receive events. - /// - /// A that will be complete when handling of the response is completed. - /// - internal async global::System.Threading.Tasks.Task RacksCreateOrUpdate_Validate(string subscriptionId, string resourceGroupName, string rackName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRack body, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) - { - using( NoSynchronizationContext ) - { - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); - await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); - await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); - await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); - await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertNotNull(nameof(rackName),rackName); - await eventListener.AssertRegEx(nameof(rackName),rackName,@"^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$"); - await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); - await eventListener.AssertNotNull(nameof(ifNoneMatch),ifNoneMatch); - await eventListener.AssertNotNull(nameof(body), body); - await eventListener.AssertObjectIsValid(nameof(body), body); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.StorageAppliancesUpdateWithResult_Call (request, eventListener,sender); } } /// - /// Delete the provided rack. - /// All customer initiated requests will be rejected as the life cycle of this resource is managed by the system. + /// update properties of the provided storage appliance, or update tags associated with the storage appliance Properties and + /// tag update can be done independently. /// /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. - /// The name of the rack. + /// The name of the storage appliance. /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. /// Other values will result in error from server as they are not supported. + /// Json string supplied to the StorageAppliancesUpdate operation /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns 204 (NoContent). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. @@ -22712,7 +44537,7 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task RacksDelete(string subscriptionId, string resourceGroupName, string rackName, string ifMatch, string ifNoneMatch, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task StorageAppliancesUpdateViaJsonString(string subscriptionId, string resourceGroupName, string storageApplianceName, string ifMatch, string ifNoneMatch, 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.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -22724,8 +44549,8 @@ public partial class NetworkCloud + global::System.Uri.EscapeDataString(subscriptionId) + "/resourceGroups/" + global::System.Uri.EscapeDataString(resourceGroupName) - + "/providers/Microsoft.NetworkCloud/racks/" - + global::System.Uri.EscapeDataString(rackName) + + "/providers/Microsoft.NetworkCloud/storageAppliances/" + + global::System.Uri.EscapeDataString(storageApplianceName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -22734,7 +44559,7 @@ public partial class NetworkCloud // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Delete, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Patch, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } // add headers parameters @@ -22748,65 +44573,121 @@ public partial class NetworkCloud } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.RacksDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + await this.StorageAppliancesUpdate_Call (request, onOk,onDefault,eventListener,sender); } } /// - /// Delete the provided rack. - /// All customer initiated requests will be rejected as the life cycle of this resource is managed by the system. + /// update properties of the provided storage appliance, or update tags associated with the storage appliance Properties and + /// tag update can be done independently. /// - /// + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the storage appliance. /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. /// Other values will result in error from server as they are not supported. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called 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 StorageAppliancesUpdate operation /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 RacksDeleteViaIdentity(global::System.String viaIdentity, string ifMatch, string ifNoneMatch, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task StorageAppliancesUpdateViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string storageApplianceName, string ifMatch, string ifNoneMatch, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { var apiVersion = @"2025-02-01"; // 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.NetworkCloud/storageAppliances/" + + global::System.Uri.EscapeDataString(storageApplianceName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/racks/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); - if (!_match.Success) + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // add headers parameters + if (null != ifMatch) { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/racks/{rackName}'"); + request.Headers.Add("If-Match",ifMatch); + } + if (null != ifNoneMatch) + { + request.Headers.Add("If-None-Match",ifNoneMatch); } - // replace URI parameters with values from identity - var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var rackName = _match.Groups["rackName"].Value; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.StorageAppliancesUpdateWithResult_Call (request, eventListener,sender); + } + } + + /// + /// update properties of the provided storage appliance, or update tags associated with the storage appliance Properties and + /// tag update can be done independently. + /// + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the storage appliance. + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// The request body. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 StorageAppliancesUpdateWithResult(string subscriptionId, string resourceGroupName, string storageApplianceName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePatchParameters body, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" - + subscriptionId + + global::System.Uri.EscapeDataString(subscriptionId) + "/resourceGroups/" - + resourceGroupName - + "/providers/Microsoft.NetworkCloud/racks/" - + rackName + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.NetworkCloud/storageAppliances/" + + global::System.Uri.EscapeDataString(storageApplianceName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Delete, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } // add headers parameters if (null != ifMatch) @@ -22818,49 +44699,46 @@ public partial class NetworkCloud request.Headers.Add("If-None-Match",ifNoneMatch); } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.RacksDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + return await this.StorageAppliancesUpdateWithResult_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). - /// a delegate that is called when the remote service returns 204 (NoContent). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 RacksDelete_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.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task StorageAppliancesUpdateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { global::System.Net.Http.HttpResponseMessage _response = null; try { - var sendTask = sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } // this operation supports x-ms-long-running-operation var _originalUri = request.RequestUri.AbsoluteUri; - // declared final-state-via: location - var _finalUri = _response.GetFirstHeader(@"Location"); + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + // declared final-state-via: azure-async-operation var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) { - - // get the delay before polling. (default to 30 seconds if not present) - int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // start the delay timer (we'll await later...) - var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } // while we wait, let's grab the headers and get ready to poll. if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { @@ -22869,62 +44747,61 @@ public partial class NetworkCloud if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { location = _response.GetFirstHeader(@"Location"); } - var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); // and let's look at the current response body and see if we have some information we can give back to the listener var content = await _response.Content.ReadAsStringAsync(); - await waiting; - - // check for cancellation - if( eventListener.Token.IsCancellationRequested ) { return; } // drop the old response _response?.Dispose(); // make the polling call _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // if we got back an OK, take a peek inside and see if it's done - if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) - { - var error = false; - try { - if( Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) - { - var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); - if( state is null ) - { - // the body doesn't contain any information that has the state of the LRO - // we're going to just get out, and let the consumer have the result - break; - } - - switch( state?.ToString()?.ToLower() ) - { - case "failed": - error = true; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result break; - case "succeeded": - case "canceled": - // we're done polling. - break; - - default: - // need to keep polling! - _response.StatusCode = global::System.Net.HttpStatusCode.Created; - continue; - } - } - } catch { - // if we run into a problem peeking into the result, - // we really don't want to do anything special. - } - if (error) { - throw new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException(_response); - } - } + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException(_response); + } + } // check for terminal status code if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) @@ -22933,37 +44810,44 @@ public partial class NetworkCloud } // we are done polling, do a request on final target? // create a new request with the final uri - request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); // drop the old response _response?.Dispose(); // make the final call _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } break; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onNoContent(_response); - break; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.StorageAppliance.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; } default: { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } } } } @@ -22977,41 +44861,8 @@ public partial class NetworkCloud } } - /// - /// Validation method for method. Call this like the actual call, but you will get validation events - /// back. - /// - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of the rack. - /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify - /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. - /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. - /// Other values will result in error from server as they are not supported. - /// an instance that will receive events. - /// - /// A that will be complete when handling of the response is completed. - /// - internal async global::System.Threading.Tasks.Task RacksDelete_Validate(string subscriptionId, string resourceGroupName, string rackName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) - { - using( NoSynchronizationContext ) - { - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); - await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); - await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); - await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); - await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertNotNull(nameof(rackName),rackName); - await eventListener.AssertRegEx(nameof(rackName),rackName,@"^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$"); - await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); - await eventListener.AssertNotNull(nameof(ifNoneMatch),ifNoneMatch); - } - } - - /// Get properties of the provided rack. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of the rack. + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). @@ -23020,111 +44871,110 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task RacksGet(string subscriptionId, string resourceGroupName, string rackName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task StorageAppliancesUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { - var apiVersion = @"2025-02-01"; - // Constant Parameters using( NoSynchronizationContext ) { - // construct URL - var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/subscriptions/" - + global::System.Uri.EscapeDataString(subscriptionId) - + "/resourceGroups/" - + global::System.Uri.EscapeDataString(resourceGroupName) - + "/providers/Microsoft.NetworkCloud/racks/" - + global::System.Uri.EscapeDataString(rackName) - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // declared final-state-via: azure-async-operation + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // generate request object - var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.RacksGet_Call(request,onOk,onDefault,eventListener,sender); - } - } + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); - /// Get properties of the provided rack. - /// - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. - /// - /// A that will be complete when handling of the response is completed. - /// - public async global::System.Threading.Tasks.Task RacksGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) - { - var apiVersion = @"2025-02-01"; - // Constant Parameters - using( NoSynchronizationContext ) - { - // verify that Identity format is an exact match for uri + // drop the old response + _response?.Dispose(); - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/racks/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); - if (!_match.Success) - { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/racks/{rackName}'"); - } + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // replace URI parameters with values from identity - var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var rackName = _match.Groups["rackName"].Value; - // construct URL - var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/subscriptions/" - + subscriptionId - + "/resourceGroups/" - + resourceGroupName - + "/providers/Microsoft.NetworkCloud/racks/" - + rackName - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException(_response); + } + } - // generate request object - var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.RacksGet_Call(request,onOk,onDefault,eventListener,sender); - } - } + // drop the old response + _response?.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.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. - /// - /// A that will be complete when handling of the response is completed. - /// - internal async global::System.Threading.Tasks.Task RacksGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) - { - using( NoSynchronizationContext ) - { - global::System.Net.Http.HttpResponseMessage _response = null; - try - { - var sendTask = sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -23132,13 +44982,13 @@ public partial class NetworkCloud case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.Rack.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.StorageAppliance.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -23154,17 +45004,22 @@ public partial class NetworkCloud } /// - /// 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 value must be an UUID. /// The name of the resource group. The name is case insensitive. - /// The name of the rack. + /// The name of the storage appliance. + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// The request body. /// an instance that will receive events. /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task RacksGet_Validate(string subscriptionId, string resourceGroupName, string rackName, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task StorageAppliancesUpdate_Validate(string subscriptionId, string resourceGroupName, string storageApplianceName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePatchParameters body, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -23173,23 +45028,36 @@ public partial class NetworkCloud await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertNotNull(nameof(rackName),rackName); - await eventListener.AssertRegEx(nameof(rackName),rackName,@"^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$"); + await eventListener.AssertNotNull(nameof(storageApplianceName),storageApplianceName); + await eventListener.AssertRegEx(nameof(storageApplianceName), storageApplianceName, @"^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$"); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(ifNoneMatch),ifNoneMatch); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); } } - /// Get a list of racks in the provided resource group. + /// + /// update a new trunked network or update the properties of the existing trunked network. + /// /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. + /// The name of the trunked network. + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// The request body. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 RacksListByResourceGroup(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.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task TrunkedNetworksCreateOrUpdate(string subscriptionId, string resourceGroupName, string trunkedNetworkName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetwork body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -23201,7 +45069,8 @@ public partial class NetworkCloud + global::System.Uri.EscapeDataString(subscriptionId) + "/resourceGroups/" + global::System.Uri.EscapeDataString(resourceGroupName) - + "/providers/Microsoft.NetworkCloud/racks" + + "/providers/Microsoft.NetworkCloud/trunkedNetworks/" + + global::System.Uri.EscapeDataString(trunkedNetworkName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -23210,26 +45079,48 @@ public partial class NetworkCloud // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Put, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + if (null != ifNoneMatch) + { + request.Headers.Add("If-None-Match",ifNoneMatch); + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.RacksListByResourceGroup_Call(request,onOk,onDefault,eventListener,sender); + await this.TrunkedNetworksCreateOrUpdate_Call (request, onOk,onDefault,eventListener,sender); } } - /// Get a list of racks in the provided resource group. + /// + /// update a new trunked network or update the properties of the existing trunked network. + /// /// + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// The request body. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 RacksListByResourceGroupViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task TrunkedNetworksCreateOrUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetwork body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -23237,22 +45128,24 @@ public partial class NetworkCloud { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/racks$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/trunkedNetworks/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/racks'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/trunkedNetworks/{trunkedNetworkName}'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var trunkedNetworkName = _match.Groups["trunkedNetworkName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + subscriptionId + "/resourceGroups/" + resourceGroupName - + "/providers/Microsoft.NetworkCloud/racks" + + "/providers/Microsoft.NetworkCloud/trunkedNetworks/" + + trunkedNetworkName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -23261,126 +45154,113 @@ public partial class NetworkCloud // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Put, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.RacksListByResourceGroup_Call(request,onOk,onDefault,eventListener,sender); - } - } - - /// Actual wire call for method. - /// the prepared HttpRequestMessage to send. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. - /// - /// A that will be complete when handling of the response is completed. - /// - internal async global::System.Threading.Tasks.Task RacksListByResourceGroup_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) - { - using( NoSynchronizationContext ) - { - global::System.Net.Http.HttpResponseMessage _response = null; - try + // add headers parameters + if (null != ifMatch) { - var sendTask = sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - var _contentType = _response.Content.Headers.ContentType?.MediaType; - - switch ( _response.StatusCode ) - { - case global::System.Net.HttpStatusCode.OK: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.RackList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } + request.Headers.Add("If-Match",ifMatch); } - finally + if (null != ifNoneMatch) { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); + request.Headers.Add("If-None-Match",ifNoneMatch); } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TrunkedNetworksCreateOrUpdate_Call (request, onOk,onDefault,eventListener,sender); } } /// - /// Validation method for method. Call this like the actual call, but you will get - /// validation events back. + /// update a new trunked network or update the properties of the existing trunked network. /// - /// The ID of the target subscription. The value must be an UUID. - /// 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 RacksListByResourceGroup_Validate(string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) - { - using( NoSynchronizationContext ) - { - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); - await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); - await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); - await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); - await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - } - } - - /// Get a list of racks in the provided subscription. - /// The ID of the target subscription. The value must be an UUID. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). + /// + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// The request body. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 RacksListBySubscription(string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task TrunkedNetworksCreateOrUpdateViaIdentityWithResult(global::System.String viaIdentity, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetwork body, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2025-02-01"; // Constant Parameters using( NoSynchronizationContext ) { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/trunkedNetworks/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/trunkedNetworks/{trunkedNetworkName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var trunkedNetworkName = _match.Groups["trunkedNetworkName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" - + global::System.Uri.EscapeDataString(subscriptionId) - + "/providers/Microsoft.NetworkCloud/racks" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.NetworkCloud/trunkedNetworks/" + + trunkedNetworkName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + if (null != ifNoneMatch) + { + request.Headers.Add("If-None-Match",ifNoneMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.RacksListBySubscription_Call(request,onOk,onDefault,eventListener,sender); + return await this.TrunkedNetworksCreateOrUpdateWithResult_Call (request, eventListener,sender); } } - /// Get a list of racks in the provided subscription. - /// + /// + /// update a new trunked network or update the properties of the existing trunked network. + /// + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the trunked network. + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// Json string supplied to the TrunkedNetworksCreateOrUpdate 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). @@ -23389,27 +45269,20 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task RacksListBySubscriptionViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task TrunkedNetworksCreateOrUpdateViaJsonString(string subscriptionId, string resourceGroupName, string trunkedNetworkName, string ifMatch, string ifNoneMatch, 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.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { var apiVersion = @"2025-02-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.NetworkCloud/racks$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); - if (!_match.Success) - { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.NetworkCloud/racks'"); - } - - // 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.NetworkCloud/racks" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.NetworkCloud/trunkedNetworks/" + + global::System.Uri.EscapeDataString(trunkedNetworkName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -23418,103 +45291,47 @@ public partial class NetworkCloud // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Put, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.RacksListBySubscription_Call(request,onOk,onDefault,eventListener,sender); - } - } - - /// Actual wire call for method. - /// the prepared HttpRequestMessage to send. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. - /// - /// A that will be complete when handling of the response is completed. - /// - internal async global::System.Threading.Tasks.Task RacksListBySubscription_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) - { - using( NoSynchronizationContext ) - { - global::System.Net.Http.HttpResponseMessage _response = null; - try - { - var sendTask = sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - var _contentType = _response.Content.Headers.ContentType?.MediaType; - - switch ( _response.StatusCode ) - { - case global::System.Net.HttpStatusCode.OK: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.RackList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally - { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); - } - } - } - - /// - /// Validation method for method. Call this like the actual call, but you will get - /// validation events back. - /// - /// The ID of the target subscription. The value must be an UUID. - /// an instance that will receive events. - /// - /// A that will be complete when handling of the response is completed. - /// - internal async global::System.Threading.Tasks.Task RacksListBySubscription_Validate(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) - { - using( NoSynchronizationContext ) - { - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); - await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + if (null != ifNoneMatch) + { + request.Headers.Add("If-None-Match",ifNoneMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TrunkedNetworksCreateOrUpdate_Call (request, onOk,onDefault,eventListener,sender); } } /// - /// Patch properties of the provided rack, or update the tags associated with the rack. Properties and tag updates can be - /// done independently. + /// update a new trunked network or update the properties of the existing trunked network. /// /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. - /// The name of the rack. + /// The name of the trunked network. /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. /// Other values will result in error from server as they are not supported. - /// The request body. - /// a delegate that is called 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 TrunkedNetworksCreateOrUpdate operation /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 RacksUpdate(string subscriptionId, string resourceGroupName, string rackName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackPatchParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task TrunkedNetworksCreateOrUpdateViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string trunkedNetworkName, string ifMatch, string ifNoneMatch, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -23526,18 +45343,18 @@ public partial class NetworkCloud + global::System.Uri.EscapeDataString(subscriptionId) + "/resourceGroups/" + global::System.Uri.EscapeDataString(resourceGroupName) - + "/providers/Microsoft.NetworkCloud/racks/" - + global::System.Uri.EscapeDataString(rackName) + + "/providers/Microsoft.NetworkCloud/trunkedNetworks/" + + global::System.Uri.EscapeDataString(trunkedNetworkName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Patch, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } // add headers parameters if (null != ifMatch) @@ -23549,70 +45366,58 @@ public partial class NetworkCloud request.Headers.Add("If-None-Match",ifNoneMatch); } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.RacksUpdate_Call(request,onOk,onDefault,eventListener,sender); + return await this.TrunkedNetworksCreateOrUpdateWithResult_Call (request, eventListener,sender); } } /// - /// Patch properties of the provided rack, or update the tags associated with the rack. Properties and tag updates can be - /// done independently. + /// update a new trunked network or update the properties of the existing trunked network. /// - /// + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the trunked network. /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. /// Other values will result in error from server as they are not supported. /// The request body. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 RacksUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackPatchParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task TrunkedNetworksCreateOrUpdateWithResult(string subscriptionId, string resourceGroupName, string trunkedNetworkName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetwork body, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2025-02-01"; // Constant Parameters using( NoSynchronizationContext ) { - // verify that Identity format is an exact match for uri - - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/racks/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); - if (!_match.Success) - { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/racks/{rackName}'"); - } - - // replace URI parameters with values from identity - var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var rackName = _match.Groups["rackName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" - + subscriptionId + + global::System.Uri.EscapeDataString(subscriptionId) + "/resourceGroups/" - + resourceGroupName - + "/providers/Microsoft.NetworkCloud/racks/" - + rackName + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.NetworkCloud/trunkedNetworks/" + + global::System.Uri.EscapeDataString(trunkedNetworkName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Patch, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } // add headers parameters if (null != ifMatch) @@ -23624,51 +45429,48 @@ public partial class NetworkCloud request.Headers.Add("If-None-Match",ifNoneMatch); } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.RacksUpdate_Call(request,onOk,onDefault,eventListener,sender); + return await this.TrunkedNetworksCreateOrUpdateWithResult_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). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 RacksUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task TrunkedNetworksCreateOrUpdateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { global::System.Net.Http.HttpResponseMessage _response = null; try { - var sendTask = sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } // this operation supports x-ms-long-running-operation var _originalUri = request.RequestUri.AbsoluteUri; + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } // declared final-state-via: azure-async-operation var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) { - - // get the delay before polling. (default to 30 seconds if not present) - int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // start the delay timer (we'll await later...) - var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } // while we wait, let's grab the headers and get ready to poll. if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { @@ -23677,62 +45479,61 @@ public partial class NetworkCloud if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { location = _response.GetFirstHeader(@"Location"); } - var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); // and let's look at the current response body and see if we have some information we can give back to the listener var content = await _response.Content.ReadAsStringAsync(); - await waiting; - - // check for cancellation - if( eventListener.Token.IsCancellationRequested ) { return; } // drop the old response _response?.Dispose(); // make the polling call _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // if we got back an OK, take a peek inside and see if it's done - if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) - { - var error = false; - try { - if( Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) - { - var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); - if( state is null ) - { - // the body doesn't contain any information that has the state of the LRO - // we're going to just get out, and let the consumer have the result - break; - } - - switch( state?.ToString()?.ToLower() ) - { - case "failed": - error = true; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result break; - case "succeeded": - case "canceled": - // we're done polling. - break; - - default: - // need to keep polling! - _response.StatusCode = global::System.Net.HttpStatusCode.Created; - continue; - } - } - } catch { - // if we run into a problem peeking into the result, - // we really don't want to do anything special. - } - if (error) { - throw new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException(_response); - } - } + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException(_response); + } + } // check for terminal status code if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) @@ -23748,24 +45549,37 @@ public partial class NetworkCloud // make the final call _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } break; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.Rack.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.TrunkedNetwork.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; } default: { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } } } } @@ -23779,181 +45593,7 @@ public partial class NetworkCloud } } - /// - /// Validation method for method. Call this like the actual call, but you will get validation events - /// back. - /// - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of the rack. - /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify - /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. - /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. - /// Other values will result in error from server as they are not supported. - /// The request body. - /// an instance that will receive events. - /// - /// A that will be complete when handling of the response is completed. - /// - internal async global::System.Threading.Tasks.Task RacksUpdate_Validate(string subscriptionId, string resourceGroupName, string rackName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackPatchParameters body, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) - { - using( NoSynchronizationContext ) - { - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); - await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); - await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); - await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); - await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertNotNull(nameof(rackName),rackName); - await eventListener.AssertRegEx(nameof(rackName),rackName,@"^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$"); - await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); - await eventListener.AssertNotNull(nameof(ifNoneMatch),ifNoneMatch); - await eventListener.AssertNotNull(nameof(body), body); - await eventListener.AssertObjectIsValid(nameof(body), body); - } - } - - /// - /// Create a new storage appliance or update the properties of the existing one. - /// All customer initiated requests will be rejected as the life cycle of this resource is managed by the system. - /// - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of the storage appliance. - /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify - /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. - /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. - /// Other values will result in error from server as they are not supported. - /// The request body. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. - /// - /// A that will be complete when handling of the response is completed. - /// - public async global::System.Threading.Tasks.Task StorageAppliancesCreateOrUpdate(string subscriptionId, string resourceGroupName, string storageApplianceName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliance body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) - { - var apiVersion = @"2025-02-01"; - // Constant Parameters - using( NoSynchronizationContext ) - { - // construct URL - var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/subscriptions/" - + global::System.Uri.EscapeDataString(subscriptionId) - + "/resourceGroups/" - + global::System.Uri.EscapeDataString(resourceGroupName) - + "/providers/Microsoft.NetworkCloud/storageAppliances/" - + global::System.Uri.EscapeDataString(storageApplianceName) - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - // generate request object - var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Put, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - // add headers parameters - if (null != ifMatch) - { - request.Headers.Add("If-Match",ifMatch); - } - if (null != ifNoneMatch) - { - request.Headers.Add("If-None-Match",ifNoneMatch); - } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); - request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.StorageAppliancesCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); - } - } - - /// - /// Create a new storage appliance or update the properties of the existing one. - /// All customer initiated requests will be rejected as the life cycle of this resource is managed by the system. - /// - /// - /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify - /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. - /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. - /// Other values will result in error from server as they are not supported. - /// The request body. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. - /// - /// A that will be complete when handling of the response is completed. - /// - public async global::System.Threading.Tasks.Task StorageAppliancesCreateOrUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliance body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) - { - var apiVersion = @"2025-02-01"; - // Constant Parameters - using( NoSynchronizationContext ) - { - // verify that Identity format is an exact match for uri - - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/storageAppliances/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); - if (!_match.Success) - { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/storageAppliances/{storageApplianceName}'"); - } - - // replace URI parameters with values from identity - var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var storageApplianceName = _match.Groups["storageApplianceName"].Value; - // construct URL - var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/subscriptions/" - + subscriptionId - + "/resourceGroups/" - + resourceGroupName - + "/providers/Microsoft.NetworkCloud/storageAppliances/" - + storageApplianceName - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - // generate request object - var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Put, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - // add headers parameters - if (null != ifMatch) - { - request.Headers.Add("If-Match",ifMatch); - } - if (null != ifNoneMatch) - { - request.Headers.Add("If-None-Match",ifNoneMatch); - } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); - request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.StorageAppliancesCreateOrUpdate_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 @@ -23963,31 +45603,28 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task StorageAppliancesCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task TrunkedNetworksCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { global::System.Net.Http.HttpResponseMessage _response = null; try { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; var sendTask = sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // this operation supports x-ms-long-running-operation - var _originalUri = request.RequestUri.AbsoluteUri; // declared final-state-via: azure-async-operation var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) { - - // get the delay before polling. (default to 30 seconds if not present) - int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // start the delay timer (we'll await later...) - var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } // while we wait, let's grab the headers and get ready to poll. if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { @@ -23996,15 +45633,14 @@ public partial class NetworkCloud if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { location = _response.GetFirstHeader(@"Location"); } - var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); // and let's look at the current response body and see if we have some information we can give back to the listener var content = await _response.Content.ReadAsStringAsync(); - await waiting; - - // check for cancellation - if( eventListener.Token.IsCancellationRequested ) { return; } // drop the old response _response?.Dispose(); @@ -24013,45 +45649,45 @@ public partial class NetworkCloud _response = await sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // if we got back an OK, take a peek inside and see if it's done - if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) - { - var error = false; - try { - if( Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) - { - var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); - if( state is null ) - { - // the body doesn't contain any information that has the state of the LRO - // we're going to just get out, and let the consumer have the result - break; - } - - switch( state?.ToString()?.ToLower() ) - { - case "failed": - error = true; + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result break; - case "succeeded": - case "canceled": - // we're done polling. - break; - - default: - // need to keep polling! - _response.StatusCode = global::System.Net.HttpStatusCode.Created; - continue; - } - } - } catch { - // if we run into a problem peeking into the result, - // we really don't want to do anything special. - } - if (error) { - throw new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException(_response); - } - } + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException(_response); + } + } // check for terminal status code if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) @@ -24070,6 +45706,7 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } break; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -24077,13 +45714,13 @@ public partial class NetworkCloud case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.StorageAppliance.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.TrunkedNetwork.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -24099,12 +45736,12 @@ public partial class NetworkCloud } /// - /// 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 value must be an UUID. /// The name of the resource group. The name is case insensitive. - /// The name of the storage appliance. + /// The name of the trunked network. /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. @@ -24114,7 +45751,7 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task StorageAppliancesCreateOrUpdate_Validate(string subscriptionId, string resourceGroupName, string storageApplianceName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliance body, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task TrunkedNetworksCreateOrUpdate_Validate(string subscriptionId, string resourceGroupName, string trunkedNetworkName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetwork body, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -24123,8 +45760,8 @@ public partial class NetworkCloud await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertNotNull(nameof(storageApplianceName),storageApplianceName); - await eventListener.AssertRegEx(nameof(storageApplianceName),storageApplianceName,@"^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$"); + await eventListener.AssertNotNull(nameof(trunkedNetworkName),trunkedNetworkName); + await eventListener.AssertRegEx(nameof(trunkedNetworkName), trunkedNetworkName, @"^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$"); await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); await eventListener.AssertNotNull(nameof(ifNoneMatch),ifNoneMatch); await eventListener.AssertNotNull(nameof(body), body); @@ -24132,13 +45769,10 @@ public partial class NetworkCloud } } - /// - /// Delete the provided storage appliance. - /// All customer initiated requests will be rejected as the life cycle of this resource is managed by the system. - /// + /// Delete the provided trunked network. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. - /// The name of the storage appliance. + /// The name of the trunked network. /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. @@ -24152,7 +45786,7 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task StorageAppliancesDelete(string subscriptionId, string resourceGroupName, string storageApplianceName, string ifMatch, string ifNoneMatch, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task TrunkedNetworksDelete(string subscriptionId, string resourceGroupName, string trunkedNetworkName, string ifMatch, string ifNoneMatch, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -24164,8 +45798,8 @@ public partial class NetworkCloud + global::System.Uri.EscapeDataString(subscriptionId) + "/resourceGroups/" + global::System.Uri.EscapeDataString(resourceGroupName) - + "/providers/Microsoft.NetworkCloud/storageAppliances/" - + global::System.Uri.EscapeDataString(storageApplianceName) + + "/providers/Microsoft.NetworkCloud/trunkedNetworks/" + + global::System.Uri.EscapeDataString(trunkedNetworkName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -24189,14 +45823,11 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.StorageAppliancesDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + await this.TrunkedNetworksDelete_Call (request, onOk,onNoContent,onDefault,eventListener,sender); } } - /// - /// Delete the provided storage appliance. - /// All customer initiated requests will be rejected as the life cycle of this resource is managed by the system. - /// + /// Delete the provided trunked network. /// /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. @@ -24211,7 +45842,7 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task StorageAppliancesDeleteViaIdentity(global::System.String viaIdentity, string ifMatch, string ifNoneMatch, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task TrunkedNetworksDeleteViaIdentity(global::System.String viaIdentity, string ifMatch, string ifNoneMatch, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -24219,24 +45850,24 @@ public partial class NetworkCloud { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/storageAppliances/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/trunkedNetworks/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/storageAppliances/{storageApplianceName}'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/trunkedNetworks/{trunkedNetworkName}'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var storageApplianceName = _match.Groups["storageApplianceName"].Value; + var trunkedNetworkName = _match.Groups["trunkedNetworkName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + subscriptionId + "/resourceGroups/" + resourceGroupName - + "/providers/Microsoft.NetworkCloud/storageAppliances/" - + storageApplianceName + + "/providers/Microsoft.NetworkCloud/trunkedNetworks/" + + trunkedNetworkName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -24260,11 +45891,11 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.StorageAppliancesDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + await this.TrunkedNetworksDelete_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). @@ -24275,32 +45906,29 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task StorageAppliancesDelete_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.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task TrunkedNetworksDelete_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.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { global::System.Net.Http.HttpResponseMessage _response = null; try { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; var sendTask = sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // this operation supports x-ms-long-running-operation - var _originalUri = request.RequestUri.AbsoluteUri; // declared final-state-via: location var _finalUri = _response.GetFirstHeader(@"Location"); var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) { - - // get the delay before polling. (default to 30 seconds if not present) - int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // start the delay timer (we'll await later...) - var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } // while we wait, let's grab the headers and get ready to poll. if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { @@ -24309,15 +45937,14 @@ public partial class NetworkCloud if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { location = _response.GetFirstHeader(@"Location"); } - var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); // and let's look at the current response body and see if we have some information we can give back to the listener var content = await _response.Content.ReadAsStringAsync(); - await waiting; - - // check for cancellation - if( eventListener.Token.IsCancellationRequested ) { return; } // drop the old response _response?.Dispose(); @@ -24326,45 +45953,45 @@ public partial class NetworkCloud _response = await sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // if we got back an OK, take a peek inside and see if it's done - if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) - { - var error = false; - try { - if( Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) - { - var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); - if( state is null ) - { - // the body doesn't contain any information that has the state of the LRO - // we're going to just get out, and let the consumer have the result - break; - } - - switch( state?.ToString()?.ToLower() ) - { - case "failed": - error = true; + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. break; - case "succeeded": - case "canceled": - // we're done polling. - break; - - default: - // need to keep polling! - _response.StatusCode = global::System.Net.HttpStatusCode.Created; - continue; - } - } - } catch { - // if we run into a problem peeking into the result, - // we really don't want to do anything special. - } - if (error) { - throw new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException(_response); - } - } + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException(_response); + } + } // check for terminal status code if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) @@ -24383,6 +46010,7 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } break; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -24402,7 +46030,7 @@ public partial class NetworkCloud default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -24418,12 +46046,12 @@ public partial class NetworkCloud } /// - /// 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 value must be an UUID. /// The name of the resource group. The name is case insensitive. - /// The name of the storage appliance. + /// The name of the trunked network. /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. @@ -24432,7 +46060,7 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task StorageAppliancesDelete_Validate(string subscriptionId, string resourceGroupName, string storageApplianceName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task TrunkedNetworksDelete_Validate(string subscriptionId, string resourceGroupName, string trunkedNetworkName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -24441,17 +46069,17 @@ public partial class NetworkCloud await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertNotNull(nameof(storageApplianceName),storageApplianceName); - await eventListener.AssertRegEx(nameof(storageApplianceName),storageApplianceName,@"^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$"); + await eventListener.AssertNotNull(nameof(trunkedNetworkName),trunkedNetworkName); + await eventListener.AssertRegEx(nameof(trunkedNetworkName), trunkedNetworkName, @"^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$"); await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); await eventListener.AssertNotNull(nameof(ifNoneMatch),ifNoneMatch); } } - /// Disable remote vendor management of the provided storage appliance. + /// Get properties of the provided trunked network. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. - /// The name of the storage appliance. + /// The name of the trunked network. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). @@ -24460,7 +46088,7 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task StorageAppliancesDisableRemoteVendorManagement(string subscriptionId, string resourceGroupName, string storageApplianceName, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task TrunkedNetworksGet(string subscriptionId, string resourceGroupName, string trunkedNetworkName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -24472,9 +46100,8 @@ public partial class NetworkCloud + global::System.Uri.EscapeDataString(subscriptionId) + "/resourceGroups/" + global::System.Uri.EscapeDataString(resourceGroupName) - + "/providers/Microsoft.NetworkCloud/storageAppliances/" - + global::System.Uri.EscapeDataString(storageApplianceName) - + "/disableRemoteVendorManagement" + + "/providers/Microsoft.NetworkCloud/trunkedNetworks/" + + global::System.Uri.EscapeDataString(trunkedNetworkName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -24483,16 +46110,16 @@ public partial class NetworkCloud // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Post, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.StorageAppliancesDisableRemoteVendorManagement_Call(request,onOk,onDefault,eventListener,sender); + await this.TrunkedNetworksGet_Call (request, onOk,onDefault,eventListener,sender); } } - /// Disable remote vendor management of the provided storage appliance. + /// Get properties of the provided trunked network. /// /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled @@ -24502,7 +46129,7 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task StorageAppliancesDisableRemoteVendorManagementViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task TrunkedNetworksGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -24510,25 +46137,24 @@ public partial class NetworkCloud { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/storageAppliances/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/trunkedNetworks/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/storageAppliances/{storageApplianceName}/disableRemoteVendorManagement'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/trunkedNetworks/{trunkedNetworkName}'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var storageApplianceName = _match.Groups["storageApplianceName"].Value; + var trunkedNetworkName = _match.Groups["trunkedNetworkName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + subscriptionId + "/resourceGroups/" + resourceGroupName - + "/providers/Microsoft.NetworkCloud/storageAppliances/" - + storageApplianceName - + "/disableRemoteVendorManagement" + + "/providers/Microsoft.NetworkCloud/trunkedNetworks/" + + trunkedNetworkName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -24537,135 +46163,189 @@ public partial class NetworkCloud // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Post, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.StorageAppliancesDisableRemoteVendorManagement_Call(request,onOk,onDefault,eventListener,sender); + await this.TrunkedNetworksGet_Call (request, onOk,onDefault,eventListener,sender); } } - /// - /// Actual wire call for method. - /// - /// the prepared HttpRequestMessage to send. - /// a delegate that is called 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 properties of the provided trunked network. + /// /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 StorageAppliancesDisableRemoteVendorManagement_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task TrunkedNetworksGetViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { + var apiVersion = @"2025-02-01"; + // 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("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/trunkedNetworks/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) { - var sendTask = sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // this operation supports x-ms-long-running-operation - var _originalUri = request.RequestUri.AbsoluteUri; - // declared final-state-via: location - var _finalUri = _response.GetFirstHeader(@"Location"); - var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - var location = _response.GetFirstHeader(@"Location"); - while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) - { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/trunkedNetworks/{trunkedNetworkName}'"); + } - // get the delay before polling. (default to 30 seconds if not present) - int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var trunkedNetworkName = _match.Groups["trunkedNetworkName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.NetworkCloud/trunkedNetworks/" + + trunkedNetworkName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - // start the delay timer (we'll await later...) - var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - // while we wait, let's grab the headers and get ready to poll. - if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { - asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - } - if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { - location = _response.GetFirstHeader(@"Location"); - } - var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; - request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - // and let's look at the current response body and see if we have some information we can give back to the listener - var content = await _response.Content.ReadAsStringAsync(); - await waiting; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.TrunkedNetworksGetWithResult_Call (request, eventListener,sender); + } + } - // check for cancellation - if( eventListener.Token.IsCancellationRequested ) { return; } + /// Get properties of the provided trunked network. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the trunked network. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TrunkedNetworksGetWithResult(string subscriptionId, string resourceGroupName, string trunkedNetworkName, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.NetworkCloud/trunkedNetworks/" + + global::System.Uri.EscapeDataString(trunkedNetworkName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - // drop the old response - _response?.Dispose(); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - // make the polling call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - // if we got back an OK, take a peek inside and see if it's done - if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) - { - var error = false; - try { - if( Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) - { - var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); - if( state is null ) - { - // the body doesn't contain any information that has the state of the LRO - // we're going to just get out, and let the consumer have the result - break; - } - - switch( state?.ToString()?.ToLower() ) - { - case "failed": - error = true; - break; - case "succeeded": - case "canceled": - // we're done polling. - break; - - default: - // need to keep polling! - _response.StatusCode = global::System.Net.HttpStatusCode.Created; - continue; - } - } - } catch { - // if we run into a problem peeking into the result, - // we really don't want to do anything special. - } - if (error) { - throw new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException(_response); - } - } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.TrunkedNetworksGetWithResult_Call (request, eventListener,sender); + } + } - // check for terminal status code - if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TrunkedNetworksGetWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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: { - continue; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.TrunkedNetwork.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } } - // we are done polling, do a request on final target? - // create a new request with the final uri - request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); - - // drop the old response - _response?.Dispose(); - - // make the final call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - break; } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TrunkedNetworksGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -24673,13 +46353,13 @@ public partial class NetworkCloud case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.TrunkedNetwork.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -24695,17 +46375,17 @@ public partial class NetworkCloud } /// - /// 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 value must be an UUID. /// The name of the resource group. The name is case insensitive. - /// The name of the storage appliance. + /// The name of the trunked network. /// an instance that will receive events. /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task StorageAppliancesDisableRemoteVendorManagement_Validate(string subscriptionId, string resourceGroupName, string storageApplianceName, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task TrunkedNetworksGet_Validate(string subscriptionId, string resourceGroupName, string trunkedNetworkName, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -24714,16 +46394,14 @@ public partial class NetworkCloud await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertNotNull(nameof(storageApplianceName),storageApplianceName); - await eventListener.AssertRegEx(nameof(storageApplianceName),storageApplianceName,@"^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$"); + await eventListener.AssertNotNull(nameof(trunkedNetworkName),trunkedNetworkName); + await eventListener.AssertRegEx(nameof(trunkedNetworkName), trunkedNetworkName, @"^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$"); } } - /// Enable remote vendor management of the provided storage appliance. + /// Get a list of trunked networks in the provided resource group. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. - /// The name of the storage appliance. - /// The request body. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). @@ -24732,7 +46410,7 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task StorageAppliancesEnableRemoteVendorManagement(string subscriptionId, string resourceGroupName, string storageApplianceName, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceEnableRemoteVendorManagementParameters body, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task TrunkedNetworksListByResourceGroup(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.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -24744,9 +46422,7 @@ public partial class NetworkCloud + global::System.Uri.EscapeDataString(subscriptionId) + "/resourceGroups/" + global::System.Uri.EscapeDataString(resourceGroupName) - + "/providers/Microsoft.NetworkCloud/storageAppliances/" - + global::System.Uri.EscapeDataString(storageApplianceName) - + "/enableRemoteVendorManagement" + + "/providers/Microsoft.NetworkCloud/trunkedNetworks" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -24755,22 +46431,17 @@ public partial class NetworkCloud // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Post, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); - request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.StorageAppliancesEnableRemoteVendorManagement_Call(request,onOk,onDefault,eventListener,sender); + await this.TrunkedNetworksListByResourceGroup_Call (request, onOk,onDefault,eventListener,sender); } } - /// Enable remote vendor management of the provided storage appliance. + /// Get a list of trunked networks in the provided resource group. /// - /// The request body. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). @@ -24779,7 +46450,7 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task StorageAppliancesEnableRemoteVendorManagementViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceEnableRemoteVendorManagementParameters body, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task TrunkedNetworksListByResourceGroupViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -24787,25 +46458,22 @@ public partial class NetworkCloud { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/storageAppliances/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/trunkedNetworks$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/storageAppliances/{storageApplianceName}/enableRemoteVendorManagement'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/trunkedNetworks'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var storageApplianceName = _match.Groups["storageApplianceName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + subscriptionId + "/resourceGroups/" + resourceGroupName - + "/providers/Microsoft.NetworkCloud/storageAppliances/" - + storageApplianceName - + "/enableRemoteVendorManagement" + + "/providers/Microsoft.NetworkCloud/trunkedNetworks" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -24814,32 +46482,114 @@ public partial class NetworkCloud // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Post, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); - request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.StorageAppliancesEnableRemoteVendorManagement_Call(request,onOk,onDefault,eventListener,sender); + await this.TrunkedNetworksListByResourceGroup_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Get a list of trunked networks in the provided resource group. + /// + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TrunkedNetworksListByResourceGroupViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/trunkedNetworks$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/trunkedNetworks'"); + } + + // 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.NetworkCloud/trunkedNetworks" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.TrunkedNetworksListByResourceGroupWithResult_Call (request, eventListener,sender); + } + } + + /// Get a list of trunked networks in the provided resource group. + /// The ID of the target subscription. The value must be an UUID. + /// 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.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TrunkedNetworksListByResourceGroupWithResult(string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.NetworkCloud/trunkedNetworks" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.TrunkedNetworksListByResourceGroupWithResult_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). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 StorageAppliancesEnableRemoteVendorManagement_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task TrunkedNetworksListByResourceGroupWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -24847,106 +46597,72 @@ public partial class NetworkCloud try { var sendTask = sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // this operation supports x-ms-long-running-operation - var _originalUri = request.RequestUri.AbsoluteUri; - // declared final-state-via: location - var _finalUri = _response.GetFirstHeader(@"Location"); - var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - var location = _response.GetFirstHeader(@"Location"); - while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) - { - - // get the delay before polling. (default to 30 seconds if not present) - int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // start the delay timer (we'll await later...) - var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; - // while we wait, let's grab the headers and get ready to poll. - if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { - asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - } - if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { - location = _response.GetFirstHeader(@"Location"); + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.TrunkedNetworkList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; } - var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; - request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); - - // and let's look at the current response body and see if we have some information we can give back to the listener - var content = await _response.Content.ReadAsStringAsync(); - await waiting; - - // check for cancellation - if( eventListener.Token.IsCancellationRequested ) { return; } - - // drop the old response - _response?.Dispose(); - - // make the polling call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // if we got back an OK, take a peek inside and see if it's done - if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) - { - var error = false; - try { - if( Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) - { - var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); - if( state is null ) - { - // the body doesn't contain any information that has the state of the LRO - // we're going to just get out, and let the consumer have the result - break; - } - - switch( state?.ToString()?.ToLower() ) - { - case "failed": - error = true; - break; - case "succeeded": - case "canceled": - // we're done polling. - break; - - default: - // need to keep polling! - _response.StatusCode = global::System.Net.HttpStatusCode.Created; - continue; - } - } - } catch { - // if we run into a problem peeking into the result, - // we really don't want to do anything special. + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.RestException(_response, await _result); + throw ex; } - if (error) { - throw new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException(_response); + else + { + throw new global::System.Exception($"[{code}] : {message}"); } } - - // check for terminal status code - if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) - { - continue; - } - // we are done polling, do a request on final target? - // create a new request with the final uri - request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); - - // drop the old response - _response?.Dispose(); - - // make the final call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - break; } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TrunkedNetworksListByResourceGroup_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -24954,13 +46670,13 @@ public partial class NetworkCloud case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.TrunkedNetworkList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -24976,18 +46692,16 @@ public partial class NetworkCloud } /// - /// 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 value must be an UUID. /// The name of the resource group. The name is case insensitive. - /// The name of the storage appliance. - /// The request body. /// an instance that will receive events. /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task StorageAppliancesEnableRemoteVendorManagement_Validate(string subscriptionId, string resourceGroupName, string storageApplianceName, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceEnableRemoteVendorManagementParameters body, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task TrunkedNetworksListByResourceGroup_Validate(string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -24996,17 +46710,11 @@ public partial class NetworkCloud await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertNotNull(nameof(storageApplianceName),storageApplianceName); - await eventListener.AssertRegEx(nameof(storageApplianceName),storageApplianceName,@"^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$"); - await eventListener.AssertNotNull(nameof(body), body); - await eventListener.AssertObjectIsValid(nameof(body), body); } } - /// Get properties of the provided storage appliance. + /// Get a list of trunked networks in the provided subscription. /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of the storage appliance. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). @@ -25015,7 +46723,7 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task StorageAppliancesGet(string subscriptionId, string resourceGroupName, string storageApplianceName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task TrunkedNetworksListBySubscription(string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -25025,10 +46733,7 @@ public partial class NetworkCloud var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + global::System.Uri.EscapeDataString(subscriptionId) - + "/resourceGroups/" - + global::System.Uri.EscapeDataString(resourceGroupName) - + "/providers/Microsoft.NetworkCloud/storageAppliances/" - + global::System.Uri.EscapeDataString(storageApplianceName) + + "/providers/Microsoft.NetworkCloud/trunkedNetworks" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -25042,11 +46747,11 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.StorageAppliancesGet_Call(request,onOk,onDefault,eventListener,sender); + await this.TrunkedNetworksListBySubscription_Call (request, onOk,onDefault,eventListener,sender); } } - /// Get properties of the provided storage appliance. + /// Get a list of trunked networks in the provided 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 @@ -25056,7 +46761,7 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task StorageAppliancesGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task TrunkedNetworksListBySubscriptionViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -25064,24 +46769,19 @@ public partial class NetworkCloud { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/storageAppliances/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/providers/Microsoft.NetworkCloud/trunkedNetworks$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/storageAppliances/{storageApplianceName}'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.NetworkCloud/trunkedNetworks'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var storageApplianceName = _match.Groups["storageApplianceName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + subscriptionId - + "/resourceGroups/" - + resourceGroupName - + "/providers/Microsoft.NetworkCloud/storageAppliances/" - + storageApplianceName + + "/providers/Microsoft.NetworkCloud/trunkedNetworks" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -25095,11 +46795,155 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.StorageAppliancesGet_Call(request,onOk,onDefault,eventListener,sender); + await this.TrunkedNetworksListBySubscription_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Get a list of trunked networks in the provided subscription. + /// + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TrunkedNetworksListBySubscriptionViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-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.NetworkCloud/trunkedNetworks$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.NetworkCloud/trunkedNetworks'"); + } + + // 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.NetworkCloud/trunkedNetworks" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.TrunkedNetworksListBySubscriptionWithResult_Call (request, eventListener,sender); + } + } + + /// Get a list of trunked networks in the provided subscription. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TrunkedNetworksListBySubscriptionWithResult(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/providers/Microsoft.NetworkCloud/trunkedNetworks" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.TrunkedNetworksListBySubscriptionWithResult_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.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TrunkedNetworksListBySubscriptionWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.TrunkedNetworkList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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 @@ -25109,7 +46953,7 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task StorageAppliancesGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task TrunkedNetworksListBySubscription_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -25120,6 +46964,7 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -25127,13 +46972,13 @@ public partial class NetworkCloud case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.StorageAppliance.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.TrunkedNetworkList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -25149,42 +46994,42 @@ public partial class NetworkCloud } /// - /// 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 value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of the storage appliance. /// an instance that will receive events. /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task StorageAppliancesGet_Validate(string subscriptionId, string resourceGroupName, string storageApplianceName, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task TrunkedNetworksListBySubscription_Validate(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); - await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); - await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); - await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertNotNull(nameof(storageApplianceName),storageApplianceName); - await eventListener.AssertRegEx(nameof(storageApplianceName),storageApplianceName,@"^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$"); } } - /// Get a list of storage appliances in the provided resource group. + /// update tags associated with the provided trunked network. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. + /// The name of the trunked network. + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// The request body. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 StorageAppliancesListByResourceGroup(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.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task TrunkedNetworksUpdate(string subscriptionId, string resourceGroupName, string trunkedNetworkName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkPatchParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -25196,7 +47041,8 @@ public partial class NetworkCloud + global::System.Uri.EscapeDataString(subscriptionId) + "/resourceGroups/" + global::System.Uri.EscapeDataString(resourceGroupName) - + "/providers/Microsoft.NetworkCloud/storageAppliances" + + "/providers/Microsoft.NetworkCloud/trunkedNetworks/" + + global::System.Uri.EscapeDataString(trunkedNetworkName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -25205,26 +47051,46 @@ public partial class NetworkCloud // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Patch, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + if (null != ifNoneMatch) + { + request.Headers.Add("If-None-Match",ifNoneMatch); + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.StorageAppliancesListByResourceGroup_Call(request,onOk,onDefault,eventListener,sender); + await this.TrunkedNetworksUpdate_Call (request, onOk,onDefault,eventListener,sender); } } - /// Get a list of storage appliances in the provided resource group. + /// update tags associated with the provided trunked network. /// + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// The request body. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 StorageAppliancesListByResourceGroupViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task TrunkedNetworksUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkPatchParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -25232,22 +47098,24 @@ public partial class NetworkCloud { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/storageAppliances$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/trunkedNetworks/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/storageAppliances'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/trunkedNetworks/{trunkedNetworkName}'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var trunkedNetworkName = _match.Groups["trunkedNetworkName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + subscriptionId + "/resourceGroups/" + resourceGroupName - + "/providers/Microsoft.NetworkCloud/storageAppliances" + + "/providers/Microsoft.NetworkCloud/trunkedNetworks/" + + trunkedNetworkName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -25256,90 +47124,109 @@ public partial class NetworkCloud // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Patch, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + if (null != ifNoneMatch) + { + request.Headers.Add("If-None-Match",ifNoneMatch); + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.StorageAppliancesListByResourceGroup_Call(request,onOk,onDefault,eventListener,sender); + await this.TrunkedNetworksUpdate_Call (request, onOk,onDefault,eventListener,sender); } } - /// - /// Actual wire call for method. - /// - /// the prepared HttpRequestMessage to send. - /// a delegate that is called 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 tags associated with the provided trunked network. + /// + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// The request body. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 StorageAppliancesListByResourceGroup_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task TrunkedNetworksUpdateViaIdentityWithResult(global::System.String viaIdentity, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkPatchParameters body, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate) { + var apiVersion = @"2025-02-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.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.StorageApplianceList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/trunkedNetworks/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/trunkedNetworks/{trunkedNetworkName}'"); } - } - } - /// - /// Validation method for method. Call this like the actual call, but - /// you will get validation events back. - /// - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// an instance that will receive events. - /// - /// A that will be complete when handling of the response is completed. - /// - internal async global::System.Threading.Tasks.Task StorageAppliancesListByResourceGroup_Validate(string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) - { - using( NoSynchronizationContext ) - { - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); - await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); - await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); - await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); - await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var trunkedNetworkName = _match.Groups["trunkedNetworkName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.NetworkCloud/trunkedNetworks/" + + trunkedNetworkName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + if (null != ifNoneMatch) + { + request.Headers.Add("If-None-Match",ifNoneMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.TrunkedNetworksUpdateWithResult_Call (request, eventListener,sender); } } - /// Get a list of storage appliances in the provided subscription. + /// update tags associated with the provided trunked network. /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the trunked network. + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// Json string supplied to the TrunkedNetworksUpdate 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). @@ -25348,7 +47235,7 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task StorageAppliancesListBySubscription(string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task TrunkedNetworksUpdateViaJsonString(string subscriptionId, string resourceGroupName, string trunkedNetworkName, string ifMatch, string ifNoneMatch, 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.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -25358,7 +47245,10 @@ public partial class NetworkCloud var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + global::System.Uri.EscapeDataString(subscriptionId) - + "/providers/Microsoft.NetworkCloud/storageAppliances" + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.NetworkCloud/trunkedNetworks/" + + global::System.Uri.EscapeDataString(trunkedNetworkName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -25367,64 +47257,211 @@ public partial class NetworkCloud // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Patch, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + if (null != ifNoneMatch) + { + request.Headers.Add("If-None-Match",ifNoneMatch); + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.StorageAppliancesListBySubscription_Call(request,onOk,onDefault,eventListener,sender); + await this.TrunkedNetworksUpdate_Call (request, onOk,onDefault,eventListener,sender); } } - /// Get a list of storage appliances in the provided 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). + /// update tags associated with the provided trunked network. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the trunked network. + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// Json string supplied to the TrunkedNetworksUpdate operation /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 StorageAppliancesListBySubscriptionViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task TrunkedNetworksUpdateViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string trunkedNetworkName, string ifMatch, string ifNoneMatch, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { var apiVersion = @"2025-02-01"; // 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.NetworkCloud/trunkedNetworks/" + + global::System.Uri.EscapeDataString(trunkedNetworkName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/providers/Microsoft.NetworkCloud/storageAppliances$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); - if (!_match.Success) + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // add headers parameters + if (null != ifMatch) { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.NetworkCloud/storageAppliances'"); + request.Headers.Add("If-Match",ifMatch); + } + if (null != ifNoneMatch) + { + request.Headers.Add("If-None-Match",ifNoneMatch); } - // replace URI parameters with values from identity - var subscriptionId = _match.Groups["subscriptionId"].Value; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.TrunkedNetworksUpdateWithResult_Call (request, eventListener,sender); + } + } + + /// update tags associated with the provided trunked network. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the trunked network. + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// The request body. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 TrunkedNetworksUpdateWithResult(string subscriptionId, string resourceGroupName, string trunkedNetworkName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkPatchParameters body, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" - + subscriptionId - + "/providers/Microsoft.NetworkCloud/storageAppliances" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.NetworkCloud/trunkedNetworks/" + + global::System.Uri.EscapeDataString(trunkedNetworkName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + if (null != ifNoneMatch) + { + request.Headers.Add("If-None-Match",ifNoneMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.StorageAppliancesListBySubscription_Call(request,onOk,onDefault,eventListener,sender); + return await this.TrunkedNetworksUpdateWithResult_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.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TrunkedNetworksUpdateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.TrunkedNetwork.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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 @@ -25434,7 +47471,7 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task StorageAppliancesListBySubscription_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task TrunkedNetworksUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -25445,6 +47482,7 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -25452,13 +47490,13 @@ public partial class NetworkCloud case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.StorageApplianceList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.TrunkedNetwork.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -25474,30 +47512,45 @@ public partial class NetworkCloud } /// - /// 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 value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the trunked network. + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// The request body. /// an instance that will receive events. /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task StorageAppliancesListBySubscription_Validate(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task TrunkedNetworksUpdate_Validate(string subscriptionId, string resourceGroupName, string trunkedNetworkName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkPatchParameters body, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(trunkedNetworkName),trunkedNetworkName); + await eventListener.AssertRegEx(nameof(trunkedNetworkName), trunkedNetworkName, @"^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$"); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(ifNoneMatch),ifNoneMatch); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); } } /// - /// Update properties of the provided storage appliance, or update tags associated with the storage appliance Properties and - /// tag updates can be done independently. + /// update a new virtual machine or update the properties of the existing virtual machine. /// /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. - /// The name of the storage appliance. + /// The name of the virtual machine. /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. @@ -25508,10 +47561,11 @@ public partial class NetworkCloud /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 StorageAppliancesUpdate(string subscriptionId, string resourceGroupName, string storageApplianceName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePatchParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task VirtualMachinesCreateOrUpdate(string subscriptionId, string resourceGroupName, string virtualMachineName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachine body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -25523,8 +47577,8 @@ public partial class NetworkCloud + global::System.Uri.EscapeDataString(subscriptionId) + "/resourceGroups/" + global::System.Uri.EscapeDataString(resourceGroupName) - + "/providers/Microsoft.NetworkCloud/storageAppliances/" - + global::System.Uri.EscapeDataString(storageApplianceName) + + "/providers/Microsoft.NetworkCloud/virtualMachines/" + + global::System.Uri.EscapeDataString(virtualMachineName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -25533,7 +47587,7 @@ public partial class NetworkCloud // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Patch, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Put, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } // add headers parameters @@ -25548,17 +47602,16 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // 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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.StorageAppliancesUpdate_Call(request,onOk,onDefault,eventListener,sender); + await this.VirtualMachinesCreateOrUpdate_Call (request, onOk,onDefault,eventListener,sender); } } /// - /// Update properties of the provided storage appliance, or update tags associated with the storage appliance Properties and - /// tag updates can be done independently. + /// update a new virtual machine or update the properties of the existing virtual machine. /// /// /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify @@ -25571,10 +47624,11 @@ public partial class NetworkCloud /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 StorageAppliancesUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePatchParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task VirtualMachinesCreateOrUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachine body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -25582,24 +47636,24 @@ public partial class NetworkCloud { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/storageAppliances/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/virtualMachines/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/storageAppliances/{storageApplianceName}'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/virtualMachines/{virtualMachineName}'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var storageApplianceName = _match.Groups["storageApplianceName"].Value; + var virtualMachineName = _match.Groups["virtualMachineName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + subscriptionId + "/resourceGroups/" + resourceGroupName - + "/providers/Microsoft.NetworkCloud/storageAppliances/" - + storageApplianceName + + "/providers/Microsoft.NetworkCloud/virtualMachines/" + + virtualMachineName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -25608,7 +47662,7 @@ public partial class NetworkCloud // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Patch, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Put, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } // add headers parameters @@ -25623,213 +47677,169 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // 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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.StorageAppliancesUpdate_Call(request,onOk,onDefault,eventListener,sender); + await this.VirtualMachinesCreateOrUpdate_Call (request, onOk,onDefault,eventListener,sender); } } - /// Actual wire call for method. - /// the prepared HttpRequestMessage to send. - /// a delegate that is called 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 virtual machine or update the properties of the existing virtual machine. + /// + /// + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// The request body. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 StorageAppliancesUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task VirtualMachinesCreateOrUpdateViaIdentityWithResult(global::System.String viaIdentity, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachine body, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate) { + var apiVersion = @"2025-02-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.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // this operation supports x-ms-long-running-operation - var _originalUri = request.RequestUri.AbsoluteUri; - // declared final-state-via: azure-async-operation - var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - var location = _response.GetFirstHeader(@"Location"); - while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) - { - - // get the delay before polling. (default to 30 seconds if not present) - int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // start the delay timer (we'll await later...) - var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); - - // while we wait, let's grab the headers and get ready to poll. - if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { - asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - } - if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { - location = _response.GetFirstHeader(@"Location"); - } - var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; - request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); - - // and let's look at the current response body and see if we have some information we can give back to the listener - var content = await _response.Content.ReadAsStringAsync(); - await waiting; - - // check for cancellation - if( eventListener.Token.IsCancellationRequested ) { return; } - - // drop the old response - _response?.Dispose(); - - // make the polling call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // verify that Identity format is an exact match for uri - // if we got back an OK, take a peek inside and see if it's done - if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) - { - var error = false; - try { - if( Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) - { - var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); - if( state is null ) - { - // the body doesn't contain any information that has the state of the LRO - // we're going to just get out, and let the consumer have the result - break; - } - - switch( state?.ToString()?.ToLower() ) - { - case "failed": - error = true; - break; - case "succeeded": - case "canceled": - // we're done polling. - break; - - default: - // need to keep polling! - _response.StatusCode = global::System.Net.HttpStatusCode.Created; - continue; - } - } - } catch { - // if we run into a problem peeking into the result, - // we really don't want to do anything special. - } - if (error) { - throw new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException(_response); - } - } + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/virtualMachines/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/virtualMachines/{virtualMachineName}'"); + } - // check for terminal status code - if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) - { - continue; - } - // we are done polling, do a request on final target? - // create a new request with the final uri - request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var virtualMachineName = _match.Groups["virtualMachineName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.NetworkCloud/virtualMachines/" + + virtualMachineName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - // drop the old response - _response?.Dispose(); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - // make the final call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - break; - } - var _contentType = _response.Content.Headers.ContentType?.MediaType; + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - switch ( _response.StatusCode ) - { - case global::System.Net.HttpStatusCode.OK: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.StorageAppliance.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); } - finally + if (null != ifNoneMatch) { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); + request.Headers.Add("If-None-Match",ifNoneMatch); } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.VirtualMachinesCreateOrUpdateWithResult_Call (request, eventListener,sender); } } /// - /// Validation method for method. Call this like the actual call, but you will get - /// validation events back. + /// update a new virtual machine or update the properties of the existing virtual machine. /// /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. - /// The name of the storage appliance. + /// The name of the virtual machine. /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. /// Other values will result in error from server as they are not supported. - /// The request body. + /// Json string supplied to the VirtualMachinesCreateOrUpdate 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.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task StorageAppliancesUpdate_Validate(string subscriptionId, string resourceGroupName, string storageApplianceName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePatchParameters body, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) + public async global::System.Threading.Tasks.Task VirtualMachinesCreateOrUpdateViaJsonString(string subscriptionId, string resourceGroupName, string virtualMachineName, string ifMatch, string ifNoneMatch, 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.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { + var apiVersion = @"2025-02-01"; + // Constant Parameters using( NoSynchronizationContext ) { - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); - await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); - await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); - await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); - await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertNotNull(nameof(storageApplianceName),storageApplianceName); - await eventListener.AssertRegEx(nameof(storageApplianceName),storageApplianceName,@"^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$"); - await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); - await eventListener.AssertNotNull(nameof(ifNoneMatch),ifNoneMatch); - 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.NetworkCloud/virtualMachines/" + + global::System.Uri.EscapeDataString(virtualMachineName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + if (null != ifNoneMatch) + { + request.Headers.Add("If-None-Match",ifNoneMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.VirtualMachinesCreateOrUpdate_Call (request, onOk,onDefault,eventListener,sender); } } /// - /// Create a new trunked network or update the properties of the existing trunked network. + /// update a new virtual machine or update the properties of the existing virtual machine. /// /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. - /// The name of the trunked network. + /// The name of the virtual machine. /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. /// Other values will result in error from server as they are not supported. - /// The request body. - /// a delegate that is called 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 VirtualMachinesCreateOrUpdate operation /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 TrunkedNetworksCreateOrUpdate(string subscriptionId, string resourceGroupName, string trunkedNetworkName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetwork body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task VirtualMachinesCreateOrUpdateViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string virtualMachineName, string ifMatch, string ifNoneMatch, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -25841,18 +47851,18 @@ public partial class NetworkCloud + global::System.Uri.EscapeDataString(subscriptionId) + "/resourceGroups/" + global::System.Uri.EscapeDataString(resourceGroupName) - + "/providers/Microsoft.NetworkCloud/trunkedNetworks/" - + global::System.Uri.EscapeDataString(trunkedNetworkName) + + "/providers/Microsoft.NetworkCloud/virtualMachines/" + + global::System.Uri.EscapeDataString(virtualMachineName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Put, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } // add headers parameters if (null != ifMatch) @@ -25864,69 +47874,58 @@ public partial class NetworkCloud request.Headers.Add("If-None-Match",ifNoneMatch); } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.TrunkedNetworksCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + return await this.VirtualMachinesCreateOrUpdateWithResult_Call (request, eventListener,sender); } } /// - /// Create a new trunked network or update the properties of the existing trunked network. + /// update a new virtual machine or update the properties of the existing virtual machine. /// - /// + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the virtual machine. /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. /// Other values will result in error from server as they are not supported. /// The request body. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 TrunkedNetworksCreateOrUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetwork body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task VirtualMachinesCreateOrUpdateWithResult(string subscriptionId, string resourceGroupName, string virtualMachineName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachine body, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2025-02-01"; // Constant Parameters using( NoSynchronizationContext ) { - // verify that Identity format is an exact match for uri - - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/trunkedNetworks/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); - if (!_match.Success) - { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/trunkedNetworks/{trunkedNetworkName}'"); - } - - // replace URI parameters with values from identity - var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var trunkedNetworkName = _match.Groups["trunkedNetworkName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" - + subscriptionId + + global::System.Uri.EscapeDataString(subscriptionId) + "/resourceGroups/" - + resourceGroupName - + "/providers/Microsoft.NetworkCloud/trunkedNetworks/" - + trunkedNetworkName + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.NetworkCloud/virtualMachines/" + + global::System.Uri.EscapeDataString(virtualMachineName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Put, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } // add headers parameters if (null != ifMatch) @@ -25937,18 +47936,172 @@ public partial class NetworkCloud { request.Headers.Add("If-None-Match",ifNoneMatch); } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); - request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.TrunkedNetworksCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.VirtualMachinesCreateOrUpdateWithResult_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.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task VirtualMachinesCreateOrUpdateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + // declared final-state-via: azure-async-operation + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + break; + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.VirtualMachine.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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 @@ -25958,31 +48111,28 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task TrunkedNetworksCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task VirtualMachinesCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { global::System.Net.Http.HttpResponseMessage _response = null; try { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; var sendTask = sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // this operation supports x-ms-long-running-operation - var _originalUri = request.RequestUri.AbsoluteUri; // declared final-state-via: azure-async-operation var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) { - - // get the delay before polling. (default to 30 seconds if not present) - int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // start the delay timer (we'll await later...) - var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } // while we wait, let's grab the headers and get ready to poll. if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { @@ -25991,15 +48141,14 @@ public partial class NetworkCloud if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { location = _response.GetFirstHeader(@"Location"); } - var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); // and let's look at the current response body and see if we have some information we can give back to the listener var content = await _response.Content.ReadAsStringAsync(); - await waiting; - - // check for cancellation - if( eventListener.Token.IsCancellationRequested ) { return; } // drop the old response _response?.Dispose(); @@ -26008,45 +48157,45 @@ public partial class NetworkCloud _response = await sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // if we got back an OK, take a peek inside and see if it's done - if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) - { - var error = false; - try { - if( Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) - { - var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); - if( state is null ) - { - // the body doesn't contain any information that has the state of the LRO - // we're going to just get out, and let the consumer have the result - break; - } - - switch( state?.ToString()?.ToLower() ) - { - case "failed": - error = true; + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. break; - case "succeeded": - case "canceled": - // we're done polling. - break; - - default: - // need to keep polling! - _response.StatusCode = global::System.Net.HttpStatusCode.Created; - continue; - } - } - } catch { - // if we run into a problem peeking into the result, - // we really don't want to do anything special. - } - if (error) { - throw new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException(_response); - } - } + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException(_response); + } + } // check for terminal status code if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) @@ -26065,6 +48214,7 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } break; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -26072,13 +48222,13 @@ public partial class NetworkCloud case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.TrunkedNetwork.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.VirtualMachine.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -26094,12 +48244,12 @@ public partial class NetworkCloud } /// - /// 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 value must be an UUID. /// The name of the resource group. The name is case insensitive. - /// The name of the trunked network. + /// The name of the virtual machine. /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. @@ -26109,7 +48259,7 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task TrunkedNetworksCreateOrUpdate_Validate(string subscriptionId, string resourceGroupName, string trunkedNetworkName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetwork body, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task VirtualMachinesCreateOrUpdate_Validate(string subscriptionId, string resourceGroupName, string virtualMachineName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachine body, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -26118,8 +48268,8 @@ public partial class NetworkCloud await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertNotNull(nameof(trunkedNetworkName),trunkedNetworkName); - await eventListener.AssertRegEx(nameof(trunkedNetworkName),trunkedNetworkName,@"^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$"); + await eventListener.AssertNotNull(nameof(virtualMachineName),virtualMachineName); + await eventListener.AssertRegEx(nameof(virtualMachineName), virtualMachineName, @"^([a-zA-Z0-9][a-zA-Z0-9]{0,62}[a-zA-Z0-9])$"); await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); await eventListener.AssertNotNull(nameof(ifNoneMatch),ifNoneMatch); await eventListener.AssertNotNull(nameof(body), body); @@ -26127,10 +48277,10 @@ public partial class NetworkCloud } } - /// Delete the provided trunked network. + /// Delete the provided virtual machine. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. - /// The name of the trunked network. + /// The name of the virtual machine. /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. @@ -26144,7 +48294,7 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task TrunkedNetworksDelete(string subscriptionId, string resourceGroupName, string trunkedNetworkName, string ifMatch, string ifNoneMatch, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task VirtualMachinesDelete(string subscriptionId, string resourceGroupName, string virtualMachineName, string ifMatch, string ifNoneMatch, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -26156,8 +48306,8 @@ public partial class NetworkCloud + global::System.Uri.EscapeDataString(subscriptionId) + "/resourceGroups/" + global::System.Uri.EscapeDataString(resourceGroupName) - + "/providers/Microsoft.NetworkCloud/trunkedNetworks/" - + global::System.Uri.EscapeDataString(trunkedNetworkName) + + "/providers/Microsoft.NetworkCloud/virtualMachines/" + + global::System.Uri.EscapeDataString(virtualMachineName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -26181,11 +48331,11 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.TrunkedNetworksDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + await this.VirtualMachinesDelete_Call (request, onOk,onNoContent,onDefault,eventListener,sender); } } - /// Delete the provided trunked network. + /// Delete the provided virtual machine. /// /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. @@ -26200,7 +48350,7 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task TrunkedNetworksDeleteViaIdentity(global::System.String viaIdentity, string ifMatch, string ifNoneMatch, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task VirtualMachinesDeleteViaIdentity(global::System.String viaIdentity, string ifMatch, string ifNoneMatch, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -26208,24 +48358,24 @@ public partial class NetworkCloud { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/trunkedNetworks/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/virtualMachines/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/trunkedNetworks/{trunkedNetworkName}'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/virtualMachines/{virtualMachineName}'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var trunkedNetworkName = _match.Groups["trunkedNetworkName"].Value; + var virtualMachineName = _match.Groups["virtualMachineName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + subscriptionId + "/resourceGroups/" + resourceGroupName - + "/providers/Microsoft.NetworkCloud/trunkedNetworks/" - + trunkedNetworkName + + "/providers/Microsoft.NetworkCloud/virtualMachines/" + + virtualMachineName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -26249,11 +48399,11 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.TrunkedNetworksDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + await this.VirtualMachinesDelete_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). @@ -26264,32 +48414,29 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task TrunkedNetworksDelete_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.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task VirtualMachinesDelete_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.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { global::System.Net.Http.HttpResponseMessage _response = null; try { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; var sendTask = sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // this operation supports x-ms-long-running-operation - var _originalUri = request.RequestUri.AbsoluteUri; // declared final-state-via: location var _finalUri = _response.GetFirstHeader(@"Location"); var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) { - - // get the delay before polling. (default to 30 seconds if not present) - int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // start the delay timer (we'll await later...) - var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } // while we wait, let's grab the headers and get ready to poll. if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { @@ -26298,15 +48445,14 @@ public partial class NetworkCloud if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { location = _response.GetFirstHeader(@"Location"); } - var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); // and let's look at the current response body and see if we have some information we can give back to the listener var content = await _response.Content.ReadAsStringAsync(); - await waiting; - - // check for cancellation - if( eventListener.Token.IsCancellationRequested ) { return; } // drop the old response _response?.Dispose(); @@ -26315,45 +48461,45 @@ public partial class NetworkCloud _response = await sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // if we got back an OK, take a peek inside and see if it's done - if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) - { - var error = false; - try { - if( Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) - { - var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); - if( state is null ) - { - // the body doesn't contain any information that has the state of the LRO - // we're going to just get out, and let the consumer have the result - break; - } - - switch( state?.ToString()?.ToLower() ) - { - case "failed": - error = true; + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result break; - case "succeeded": - case "canceled": - // we're done polling. - break; - - default: - // need to keep polling! - _response.StatusCode = global::System.Net.HttpStatusCode.Created; - continue; - } - } - } catch { - // if we run into a problem peeking into the result, - // we really don't want to do anything special. - } - if (error) { - throw new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException(_response); - } - } + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException(_response); + } + } // check for terminal status code if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) @@ -26372,6 +48518,7 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } break; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -26391,7 +48538,7 @@ public partial class NetworkCloud default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -26407,12 +48554,12 @@ public partial class NetworkCloud } /// - /// 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 value must be an UUID. /// The name of the resource group. The name is case insensitive. - /// The name of the trunked network. + /// The name of the virtual machine. /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. @@ -26421,7 +48568,7 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task TrunkedNetworksDelete_Validate(string subscriptionId, string resourceGroupName, string trunkedNetworkName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task VirtualMachinesDelete_Validate(string subscriptionId, string resourceGroupName, string virtualMachineName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -26430,17 +48577,17 @@ public partial class NetworkCloud await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertNotNull(nameof(trunkedNetworkName),trunkedNetworkName); - await eventListener.AssertRegEx(nameof(trunkedNetworkName),trunkedNetworkName,@"^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$"); + await eventListener.AssertNotNull(nameof(virtualMachineName),virtualMachineName); + await eventListener.AssertRegEx(nameof(virtualMachineName), virtualMachineName, @"^([a-zA-Z0-9][a-zA-Z0-9]{0,62}[a-zA-Z0-9])$"); await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); await eventListener.AssertNotNull(nameof(ifNoneMatch),ifNoneMatch); } } - /// Get properties of the provided trunked network. + /// Get properties of the provided virtual machine. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. - /// The name of the trunked network. + /// The name of the virtual machine. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). @@ -26449,7 +48596,7 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task TrunkedNetworksGet(string subscriptionId, string resourceGroupName, string trunkedNetworkName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task VirtualMachinesGet(string subscriptionId, string resourceGroupName, string virtualMachineName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -26461,8 +48608,8 @@ public partial class NetworkCloud + global::System.Uri.EscapeDataString(subscriptionId) + "/resourceGroups/" + global::System.Uri.EscapeDataString(resourceGroupName) - + "/providers/Microsoft.NetworkCloud/trunkedNetworks/" - + global::System.Uri.EscapeDataString(trunkedNetworkName) + + "/providers/Microsoft.NetworkCloud/virtualMachines/" + + global::System.Uri.EscapeDataString(virtualMachineName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -26476,11 +48623,11 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.TrunkedNetworksGet_Call(request,onOk,onDefault,eventListener,sender); + await this.VirtualMachinesGet_Call (request, onOk,onDefault,eventListener,sender); } } - /// Get properties of the provided trunked network. + /// Get properties of the provided virtual machine. /// /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled @@ -26490,7 +48637,7 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task TrunkedNetworksGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task VirtualMachinesGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -26498,139 +48645,24 @@ public partial class NetworkCloud { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/trunkedNetworks/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/virtualMachines/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/trunkedNetworks/{trunkedNetworkName}'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/virtualMachines/{virtualMachineName}'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var trunkedNetworkName = _match.Groups["trunkedNetworkName"].Value; + var virtualMachineName = _match.Groups["virtualMachineName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + subscriptionId + "/resourceGroups/" + resourceGroupName - + "/providers/Microsoft.NetworkCloud/trunkedNetworks/" - + trunkedNetworkName - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - // generate request object - var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.TrunkedNetworksGet_Call(request,onOk,onDefault,eventListener,sender); - } - } - - /// Actual wire call for method. - /// the prepared HttpRequestMessage to send. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. - /// - /// A that will be complete when handling of the response is completed. - /// - internal async global::System.Threading.Tasks.Task TrunkedNetworksGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) - { - using( NoSynchronizationContext ) - { - global::System.Net.Http.HttpResponseMessage _response = null; - try - { - var sendTask = sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - var _contentType = _response.Content.Headers.ContentType?.MediaType; - - switch ( _response.StatusCode ) - { - case global::System.Net.HttpStatusCode.OK: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.TrunkedNetwork.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally - { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); - } - } - } - - /// - /// Validation method for method. Call this like the actual call, but you will get validation - /// events back. - /// - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of the trunked network. - /// an instance that will receive events. - /// - /// A that will be complete when handling of the response is completed. - /// - internal async global::System.Threading.Tasks.Task TrunkedNetworksGet_Validate(string subscriptionId, string resourceGroupName, string trunkedNetworkName, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) - { - using( NoSynchronizationContext ) - { - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); - await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); - await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); - await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); - await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertNotNull(nameof(trunkedNetworkName),trunkedNetworkName); - await eventListener.AssertRegEx(nameof(trunkedNetworkName),trunkedNetworkName,@"^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$"); - } - } - - /// Get a list of trunked networks in the provided resource group. - /// The ID of the target subscription. The value must be an UUID. - /// 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.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. - /// - /// A that will be complete when handling of the response is completed. - /// - public async global::System.Threading.Tasks.Task TrunkedNetworksListByResourceGroup(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.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) - { - var apiVersion = @"2025-02-01"; - // Constant Parameters - using( NoSynchronizationContext ) - { - // construct URL - var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/subscriptions/" - + global::System.Uri.EscapeDataString(subscriptionId) - + "/resourceGroups/" - + global::System.Uri.EscapeDataString(resourceGroupName) - + "/providers/Microsoft.NetworkCloud/trunkedNetworks" + + "/providers/Microsoft.NetworkCloud/virtualMachines/" + + virtualMachineName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -26644,21 +48676,19 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.TrunkedNetworksListByResourceGroup_Call(request,onOk,onDefault,eventListener,sender); + await this.VirtualMachinesGet_Call (request, onOk,onDefault,eventListener,sender); } } - /// Get a list of trunked networks in the provided resource group. + /// Get properties of the provided virtual machine. /// - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 TrunkedNetworksListByResourceGroupViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task VirtualMachinesGetViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -26666,281 +48696,52 @@ public partial class NetworkCloud { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/trunkedNetworks$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/virtualMachines/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/trunkedNetworks'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/virtualMachines/{virtualMachineName}'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var virtualMachineName = _match.Groups["virtualMachineName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + subscriptionId + "/resourceGroups/" + resourceGroupName - + "/providers/Microsoft.NetworkCloud/trunkedNetworks" - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - // generate request object - var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.TrunkedNetworksListByResourceGroup_Call(request,onOk,onDefault,eventListener,sender); - } - } - - /// Actual wire call for method. - /// the prepared HttpRequestMessage to send. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. - /// - /// A that will be complete when handling of the response is completed. - /// - internal async global::System.Threading.Tasks.Task TrunkedNetworksListByResourceGroup_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) - { - using( NoSynchronizationContext ) - { - global::System.Net.Http.HttpResponseMessage _response = null; - try - { - var sendTask = sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - var _contentType = _response.Content.Headers.ContentType?.MediaType; - - switch ( _response.StatusCode ) - { - case global::System.Net.HttpStatusCode.OK: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.TrunkedNetworkList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally - { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); - } - } - } - - /// - /// Validation method for method. Call this like the actual call, but you - /// will get validation events back. - /// - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// an instance that will receive events. - /// - /// A that will be complete when handling of the response is completed. - /// - internal async global::System.Threading.Tasks.Task TrunkedNetworksListByResourceGroup_Validate(string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) - { - using( NoSynchronizationContext ) - { - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); - await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); - await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); - await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); - await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - } - } - - /// Get a list of trunked networks in the provided subscription. - /// The ID of the target subscription. The value must be an UUID. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. - /// - /// A that will be complete when handling of the response is completed. - /// - public async global::System.Threading.Tasks.Task TrunkedNetworksListBySubscription(string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) - { - var apiVersion = @"2025-02-01"; - // Constant Parameters - using( NoSynchronizationContext ) - { - // construct URL - var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/subscriptions/" - + global::System.Uri.EscapeDataString(subscriptionId) - + "/providers/Microsoft.NetworkCloud/trunkedNetworks" - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - // generate request object - var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.TrunkedNetworksListBySubscription_Call(request,onOk,onDefault,eventListener,sender); - } - } - - /// Get a list of trunked networks in the provided 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.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. - /// - /// A that will be complete when handling of the response is completed. - /// - public async global::System.Threading.Tasks.Task TrunkedNetworksListBySubscriptionViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) - { - var apiVersion = @"2025-02-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.NetworkCloud/trunkedNetworks$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); - if (!_match.Success) - { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.NetworkCloud/trunkedNetworks'"); - } - - // 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.NetworkCloud/trunkedNetworks" + + "/providers/Microsoft.NetworkCloud/virtualMachines/" + + virtualMachineName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.TrunkedNetworksListBySubscription_Call(request,onOk,onDefault,eventListener,sender); - } - } - - /// Actual wire call for method. - /// the prepared HttpRequestMessage to send. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. - /// - /// A that will be complete when handling of the response is completed. - /// - internal async global::System.Threading.Tasks.Task TrunkedNetworksListBySubscription_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) - { - using( NoSynchronizationContext ) - { - global::System.Net.Http.HttpResponseMessage _response = null; - try - { - var sendTask = sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - var _contentType = _response.Content.Headers.ContentType?.MediaType; - - switch ( _response.StatusCode ) - { - case global::System.Net.HttpStatusCode.OK: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.TrunkedNetworkList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally - { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); - } - } - } - - /// - /// Validation method for method. Call this like the actual call, but you - /// will get validation events back. - /// - /// The ID of the target subscription. The value must be an UUID. - /// an instance that will receive events. - /// - /// A that will be complete when handling of the response is completed. - /// - internal async global::System.Threading.Tasks.Task TrunkedNetworksListBySubscription_Validate(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) - { - using( NoSynchronizationContext ) - { - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); - await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + return await this.VirtualMachinesGetWithResult_Call (request, eventListener,sender); } } - /// Update tags associated with the provided trunked network. + /// Get properties of the provided virtual machine. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. - /// The name of the trunked network. - /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify - /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. - /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. - /// Other values will result in error from server as they are not supported. - /// The request body. - /// a delegate that is called 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 virtual machine. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 TrunkedNetworksUpdate(string subscriptionId, string resourceGroupName, string trunkedNetworkName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkPatchParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task VirtualMachinesGetWithResult(string subscriptionId, string resourceGroupName, string virtualMachineName, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -26952,112 +48753,86 @@ public partial class NetworkCloud + global::System.Uri.EscapeDataString(subscriptionId) + "/resourceGroups/" + global::System.Uri.EscapeDataString(resourceGroupName) - + "/providers/Microsoft.NetworkCloud/trunkedNetworks/" - + global::System.Uri.EscapeDataString(trunkedNetworkName) + + "/providers/Microsoft.NetworkCloud/virtualMachines/" + + global::System.Uri.EscapeDataString(virtualMachineName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Patch, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - // add headers parameters - if (null != ifMatch) - { - request.Headers.Add("If-Match",ifMatch); - } - if (null != ifNoneMatch) - { - request.Headers.Add("If-None-Match",ifNoneMatch); - } + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); - request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.TrunkedNetworksUpdate_Call(request,onOk,onDefault,eventListener,sender); + return await this.VirtualMachinesGetWithResult_Call (request, eventListener,sender); } } - /// Update tags associated with the provided trunked network. - /// - /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify - /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. - /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. - /// Other values will result in error from server as they are not supported. - /// The request body. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. - /// - /// A that will be complete when handling of the response is completed. - /// - public async global::System.Threading.Tasks.Task TrunkedNetworksUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkPatchParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) - { - var apiVersion = @"2025-02-01"; - // Constant Parameters - using( NoSynchronizationContext ) - { - // verify that Identity format is an exact match for uri - - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/trunkedNetworks/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); - if (!_match.Success) - { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/trunkedNetworks/{trunkedNetworkName}'"); - } - - // replace URI parameters with values from identity - var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var trunkedNetworkName = _match.Groups["trunkedNetworkName"].Value; - // construct URL - var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/subscriptions/" - + subscriptionId - + "/resourceGroups/" - + resourceGroupName - + "/providers/Microsoft.NetworkCloud/trunkedNetworks/" - + trunkedNetworkName - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - // generate request object - var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Patch, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - // add headers parameters - if (null != ifMatch) + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task VirtualMachinesGetWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try { - request.Headers.Add("If-Match",ifMatch); + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.VirtualMachine.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } } - if (null != ifNoneMatch) + finally { - request.Headers.Add("If-None-Match",ifNoneMatch); + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); - request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.TrunkedNetworksUpdate_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 @@ -27067,7 +48842,7 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task TrunkedNetworksUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task VirtualMachinesGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -27078,6 +48853,7 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -27085,13 +48861,13 @@ public partial class NetworkCloud case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.TrunkedNetwork.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.VirtualMachine.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -27107,22 +48883,17 @@ public partial class NetworkCloud } /// - /// 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 value must be an UUID. /// The name of the resource group. The name is case insensitive. - /// The name of the trunked network. - /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify - /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. - /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. - /// Other values will result in error from server as they are not supported. - /// The request body. + /// The name of the virtual machine. /// an instance that will receive events. /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task TrunkedNetworksUpdate_Validate(string subscriptionId, string resourceGroupName, string trunkedNetworkName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkPatchParameters body, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task VirtualMachinesGet_Validate(string subscriptionId, string resourceGroupName, string virtualMachineName, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -27131,26 +48902,14 @@ public partial class NetworkCloud await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertNotNull(nameof(trunkedNetworkName),trunkedNetworkName); - await eventListener.AssertRegEx(nameof(trunkedNetworkName),trunkedNetworkName,@"^([a-zA-Z0-9][a-zA-Z0-9-_]{0,28}[a-zA-Z0-9])$"); - await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); - await eventListener.AssertNotNull(nameof(ifNoneMatch),ifNoneMatch); - await eventListener.AssertNotNull(nameof(body), body); - await eventListener.AssertObjectIsValid(nameof(body), body); + await eventListener.AssertNotNull(nameof(virtualMachineName),virtualMachineName); + await eventListener.AssertRegEx(nameof(virtualMachineName), virtualMachineName, @"^([a-zA-Z0-9][a-zA-Z0-9]{0,62}[a-zA-Z0-9])$"); } } - /// - /// Create a new virtual machine or update the properties of the existing virtual machine. - /// + /// Get a list of virtual machines in the provided resource group. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. - /// The name of the virtual machine. - /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify - /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. - /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. - /// Other values will result in error from server as they are not supported. - /// The request body. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). @@ -27159,7 +48918,7 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task VirtualMachinesCreateOrUpdate(string subscriptionId, string resourceGroupName, string virtualMachineName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachine body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task VirtualMachinesListByResourceGroup(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.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -27171,8 +48930,7 @@ public partial class NetworkCloud + global::System.Uri.EscapeDataString(subscriptionId) + "/resourceGroups/" + global::System.Uri.EscapeDataString(resourceGroupName) - + "/providers/Microsoft.NetworkCloud/virtualMachines/" - + global::System.Uri.EscapeDataString(virtualMachineName) + + "/providers/Microsoft.NetworkCloud/virtualMachines" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -27181,38 +48939,17 @@ public partial class NetworkCloud // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Put, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - // add headers parameters - if (null != ifMatch) - { - request.Headers.Add("If-Match",ifMatch); - } - if (null != ifNoneMatch) - { - request.Headers.Add("If-None-Match",ifNoneMatch); - } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); - request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.VirtualMachinesCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + await this.VirtualMachinesListByResourceGroup_Call (request, onOk,onDefault,eventListener,sender); } } - /// - /// Create a new virtual machine or update the properties of the existing virtual machine. - /// + /// Get a list of virtual machines in the provided resource group. /// - /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify - /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. - /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. - /// Other values will result in error from server as they are not supported. - /// The request body. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). @@ -27221,7 +48958,7 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task VirtualMachinesCreateOrUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachine body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task VirtualMachinesListByResourceGroupViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -27229,24 +48966,22 @@ public partial class NetworkCloud { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/virtualMachines/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/virtualMachines$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/virtualMachines/{virtualMachineName}'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/virtualMachines'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var virtualMachineName = _match.Groups["virtualMachineName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + subscriptionId + "/resourceGroups/" + resourceGroupName - + "/providers/Microsoft.NetworkCloud/virtualMachines/" - + virtualMachineName + + "/providers/Microsoft.NetworkCloud/virtualMachines" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -27255,40 +48990,114 @@ public partial class NetworkCloud // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Put, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - // add headers parameters - if (null != ifMatch) - { - request.Headers.Add("If-Match",ifMatch); - } - if (null != ifNoneMatch) + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.VirtualMachinesListByResourceGroup_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Get a list of virtual machines in the provided resource group. + /// + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task VirtualMachinesListByResourceGroupViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/virtualMachines$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) { - request.Headers.Add("If-None-Match",ifNoneMatch); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/virtualMachines'"); } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); - request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // 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.NetworkCloud/virtualMachines" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.VirtualMachinesListByResourceGroupWithResult_Call (request, eventListener,sender); + } + } + + /// Get a list of virtual machines in the provided resource group. + /// The ID of the target subscription. The value must be an UUID. + /// 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.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task VirtualMachinesListByResourceGroupWithResult(string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.NetworkCloud/virtualMachines" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.VirtualMachinesCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + return await this.VirtualMachinesListByResourceGroupWithResult_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). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 VirtualMachinesCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task VirtualMachinesListByResourceGroupWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -27296,105 +49105,72 @@ public partial class NetworkCloud try { var sendTask = sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // this operation supports x-ms-long-running-operation - var _originalUri = request.RequestUri.AbsoluteUri; - // declared final-state-via: azure-async-operation - var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - var location = _response.GetFirstHeader(@"Location"); - while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) - { - - // get the delay before polling. (default to 30 seconds if not present) - int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // start the delay timer (we'll await later...) - var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; - // while we wait, let's grab the headers and get ready to poll. - if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { - asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - } - if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { - location = _response.GetFirstHeader(@"Location"); + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.VirtualMachineList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; } - var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; - request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); - - // and let's look at the current response body and see if we have some information we can give back to the listener - var content = await _response.Content.ReadAsStringAsync(); - await waiting; - - // check for cancellation - if( eventListener.Token.IsCancellationRequested ) { return; } - - // drop the old response - _response?.Dispose(); - - // make the polling call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // if we got back an OK, take a peek inside and see if it's done - if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) - { - var error = false; - try { - if( Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) - { - var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); - if( state is null ) - { - // the body doesn't contain any information that has the state of the LRO - // we're going to just get out, and let the consumer have the result - break; - } - - switch( state?.ToString()?.ToLower() ) - { - case "failed": - error = true; - break; - case "succeeded": - case "canceled": - // we're done polling. - break; - - default: - // need to keep polling! - _response.StatusCode = global::System.Net.HttpStatusCode.Created; - continue; - } - } - } catch { - // if we run into a problem peeking into the result, - // we really don't want to do anything special. + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.RestException(_response, await _result); + throw ex; } - if (error) { - throw new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException(_response); + else + { + throw new global::System.Exception($"[{code}] : {message}"); } } - - // check for terminal status code - if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) - { - continue; - } - // we are done polling, do a request on final target? - // create a new request with the final uri - request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); - - // drop the old response - _response?.Dispose(); - - // make the final call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - break; } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task VirtualMachinesListByResourceGroup_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -27402,13 +49178,13 @@ public partial class NetworkCloud case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.VirtualMachine.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.VirtualMachineList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -27424,22 +49200,16 @@ public partial class NetworkCloud } /// - /// 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 value must be an UUID. /// The name of the resource group. The name is case insensitive. - /// The name of the virtual machine. - /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify - /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. - /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. - /// Other values will result in error from server as they are not supported. - /// The request body. /// an instance that will receive events. /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task VirtualMachinesCreateOrUpdate_Validate(string subscriptionId, string resourceGroupName, string virtualMachineName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachine body, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task VirtualMachinesListByResourceGroup_Validate(string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -27448,25 +49218,12 @@ public partial class NetworkCloud await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertNotNull(nameof(virtualMachineName),virtualMachineName); - await eventListener.AssertRegEx(nameof(virtualMachineName),virtualMachineName,@"^([a-zA-Z0-9][a-zA-Z0-9]{0,62}[a-zA-Z0-9])$"); - await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); - await eventListener.AssertNotNull(nameof(ifNoneMatch),ifNoneMatch); - await eventListener.AssertNotNull(nameof(body), body); - await eventListener.AssertObjectIsValid(nameof(body), body); } } - /// Delete the provided virtual machine. + /// Get a list of virtual machines in the provided subscription. /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of the virtual machine. - /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify - /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. - /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. - /// Other values will result in error from server as they are not supported. /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns 204 (NoContent). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. @@ -27474,7 +49231,7 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task VirtualMachinesDelete(string subscriptionId, string resourceGroupName, string virtualMachineName, string ifMatch, string ifNoneMatch, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task VirtualMachinesListBySubscription(string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -27484,10 +49241,7 @@ public partial class NetworkCloud var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + global::System.Uri.EscapeDataString(subscriptionId) - + "/resourceGroups/" - + global::System.Uri.EscapeDataString(resourceGroupName) - + "/providers/Microsoft.NetworkCloud/virtualMachines/" - + global::System.Uri.EscapeDataString(virtualMachineName) + + "/providers/Microsoft.NetworkCloud/virtualMachines" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -27496,33 +49250,18 @@ public partial class NetworkCloud // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Delete, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - // add headers parameters - if (null != ifMatch) - { - request.Headers.Add("If-Match",ifMatch); - } - if (null != ifNoneMatch) - { - request.Headers.Add("If-None-Match",ifNoneMatch); - } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.VirtualMachinesDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + await this.VirtualMachinesListBySubscription_Call (request, onOk,onDefault,eventListener,sender); } } - /// Delete the provided virtual machine. + /// Get a list of virtual machines in the provided subscription. /// - /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify - /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. - /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. - /// Other values will result in error from server as they are not supported. /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns 204 (NoContent). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. @@ -27530,7 +49269,7 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task VirtualMachinesDeleteViaIdentity(global::System.String viaIdentity, string ifMatch, string ifNoneMatch, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task VirtualMachinesListBySubscriptionViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -27538,24 +49277,19 @@ public partial class NetworkCloud { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/virtualMachines/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/providers/Microsoft.NetworkCloud/virtualMachines$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/virtualMachines/{virtualMachineName}'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.NetworkCloud/virtualMachines'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var virtualMachineName = _match.Groups["virtualMachineName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + subscriptionId - + "/resourceGroups/" - + resourceGroupName - + "/providers/Microsoft.NetworkCloud/virtualMachines/" - + virtualMachineName + + "/providers/Microsoft.NetworkCloud/virtualMachines" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -27564,37 +49298,108 @@ public partial class NetworkCloud // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Delete, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - // add headers parameters - if (null != ifMatch) - { - request.Headers.Add("If-Match",ifMatch); - } - if (null != ifNoneMatch) + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.VirtualMachinesListBySubscription_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Get a list of virtual machines in the provided subscription. + /// + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task VirtualMachinesListBySubscriptionViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-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.NetworkCloud/virtualMachines$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) { - request.Headers.Add("If-None-Match",ifNoneMatch); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.NetworkCloud/virtualMachines'"); } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // 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.NetworkCloud/virtualMachines" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.VirtualMachinesListBySubscriptionWithResult_Call (request, eventListener,sender); + } + } + + /// Get a list of virtual machines in the provided subscription. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task VirtualMachinesListBySubscriptionWithResult(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/providers/Microsoft.NetworkCloud/virtualMachines" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.VirtualMachinesDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + return await this.VirtualMachinesListBySubscriptionWithResult_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). - /// a delegate that is called when the remote service returns 204 (NoContent). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 VirtualMachinesDelete_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.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task VirtualMachinesListBySubscriptionWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -27602,106 +49407,72 @@ public partial class NetworkCloud try { var sendTask = sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // this operation supports x-ms-long-running-operation - var _originalUri = request.RequestUri.AbsoluteUri; - // declared final-state-via: location - var _finalUri = _response.GetFirstHeader(@"Location"); - var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - var location = _response.GetFirstHeader(@"Location"); - while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) - { - - // get the delay before polling. (default to 30 seconds if not present) - int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // start the delay timer (we'll await later...) - var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; - // while we wait, let's grab the headers and get ready to poll. - if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { - asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - } - if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { - location = _response.GetFirstHeader(@"Location"); + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.VirtualMachineList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; } - var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; - request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); - - // and let's look at the current response body and see if we have some information we can give back to the listener - var content = await _response.Content.ReadAsStringAsync(); - await waiting; - - // check for cancellation - if( eventListener.Token.IsCancellationRequested ) { return; } - - // drop the old response - _response?.Dispose(); - - // make the polling call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // if we got back an OK, take a peek inside and see if it's done - if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) - { - var error = false; - try { - if( Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) - { - var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); - if( state is null ) - { - // the body doesn't contain any information that has the state of the LRO - // we're going to just get out, and let the consumer have the result - break; - } - - switch( state?.ToString()?.ToLower() ) - { - case "failed": - error = true; - break; - case "succeeded": - case "canceled": - // we're done polling. - break; - - default: - // need to keep polling! - _response.StatusCode = global::System.Net.HttpStatusCode.Created; - continue; - } - } - } catch { - // if we run into a problem peeking into the result, - // we really don't want to do anything special. + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.RestException(_response, await _result); + throw ex; } - if (error) { - throw new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException(_response); + else + { + throw new global::System.Exception($"[{code}] : {message}"); } } - - // check for terminal status code - if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) - { - continue; - } - // we are done polling, do a request on final target? - // create a new request with the final uri - request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); - - // drop the old response - _response?.Dispose(); - - // make the final call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - break; } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task VirtualMachinesListBySubscription_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -27709,19 +49480,13 @@ public partial class NetworkCloud case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onNoContent(_response); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.VirtualMachineList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -27736,50 +49501,39 @@ public partial class NetworkCloud } } - /// - /// 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 value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of the virtual machine. - /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify - /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. - /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. - /// Other values will result in error from server as they are not supported. /// an instance that will receive events. /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task VirtualMachinesDelete_Validate(string subscriptionId, string resourceGroupName, string virtualMachineName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task VirtualMachinesListBySubscription_Validate(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); - await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); - await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); - await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertNotNull(nameof(virtualMachineName),virtualMachineName); - await eventListener.AssertRegEx(nameof(virtualMachineName),virtualMachineName,@"^([a-zA-Z0-9][a-zA-Z0-9]{0,62}[a-zA-Z0-9])$"); - await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); - await eventListener.AssertNotNull(nameof(ifNoneMatch),ifNoneMatch); } } - /// Get properties of the provided virtual machine. + /// Power off the provided virtual machine. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// The name of the virtual machine. + /// The request body. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 VirtualMachinesGet(string subscriptionId, string resourceGroupName, string virtualMachineName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task VirtualMachinesPowerOff(string subscriptionId, string resourceGroupName, string virtualMachineName, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePowerOffParameters body, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -27793,6 +49547,7 @@ public partial class NetworkCloud + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.NetworkCloud/virtualMachines/" + global::System.Uri.EscapeDataString(virtualMachineName) + + "/powerOff" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -27801,26 +49556,32 @@ public partial class NetworkCloud // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Post, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.VirtualMachinesGet_Call(request,onOk,onDefault,eventListener,sender); + await this.VirtualMachinesPowerOff_Call (request, onOk,onDefault,eventListener,sender); } } - /// Get properties of the provided virtual machine. + /// Power off the provided virtual machine. /// + /// The request body. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 VirtualMachinesGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task VirtualMachinesPowerOffViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePowerOffParameters body, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -27846,6 +49607,7 @@ public partial class NetworkCloud + resourceGroupName + "/providers/Microsoft.NetworkCloud/virtualMachines/" + virtualMachineName + + "/powerOff" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -27854,16 +49616,69 @@ public partial class NetworkCloud // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.VirtualMachinesPowerOff_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Power off the provided virtual machine. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the virtual machine. + /// Json string supplied to the VirtualMachinesPowerOff 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.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task VirtualMachinesPowerOffViaJsonString(string subscriptionId, string resourceGroupName, string virtualMachineName, global::System.String jsonString, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.NetworkCloud/virtualMachines/" + + global::System.Uri.EscapeDataString(virtualMachineName) + + "/powerOff" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Post, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.VirtualMachinesGet_Call(request,onOk,onDefault,eventListener,sender); + await this.VirtualMachinesPowerOff_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 @@ -27873,17 +49688,111 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task VirtualMachinesGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task VirtualMachinesPowerOff_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { global::System.Net.Http.HttpResponseMessage _response = null; try { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; var sendTask = sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // declared final-state-via: location + var _finalUri = _response.GetFirstHeader(@"Location"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -27891,13 +49800,13 @@ public partial class NetworkCloud case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.VirtualMachine.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -27913,17 +49822,18 @@ public partial class NetworkCloud } /// - /// 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 value must be an UUID. /// The name of the resource group. The name is case insensitive. /// The name of the virtual machine. + /// The request body. /// an instance that will receive events. /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task VirtualMachinesGet_Validate(string subscriptionId, string resourceGroupName, string virtualMachineName, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task VirtualMachinesPowerOff_Validate(string subscriptionId, string resourceGroupName, string virtualMachineName, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePowerOffParameters body, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -27933,13 +49843,16 @@ public partial class NetworkCloud await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); await eventListener.AssertNotNull(nameof(virtualMachineName),virtualMachineName); - await eventListener.AssertRegEx(nameof(virtualMachineName),virtualMachineName,@"^([a-zA-Z0-9][a-zA-Z0-9]{0,62}[a-zA-Z0-9])$"); + await eventListener.AssertRegEx(nameof(virtualMachineName), virtualMachineName, @"^([a-zA-Z0-9][a-zA-Z0-9]{0,62}[a-zA-Z0-9])$"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); } } - /// Get a list of virtual machines in the provided resource group. + /// Reimage the provided virtual machine. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. + /// The name of the virtual machine. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). @@ -27948,7 +49861,7 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task VirtualMachinesListByResourceGroup(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.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task VirtualMachinesReimage(string subscriptionId, string resourceGroupName, string virtualMachineName, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -27960,7 +49873,9 @@ public partial class NetworkCloud + global::System.Uri.EscapeDataString(subscriptionId) + "/resourceGroups/" + global::System.Uri.EscapeDataString(resourceGroupName) - + "/providers/Microsoft.NetworkCloud/virtualMachines" + + "/providers/Microsoft.NetworkCloud/virtualMachines/" + + global::System.Uri.EscapeDataString(virtualMachineName) + + "/reimage" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -27969,16 +49884,16 @@ public partial class NetworkCloud // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Post, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.VirtualMachinesListByResourceGroup_Call(request,onOk,onDefault,eventListener,sender); + await this.VirtualMachinesReimage_Call (request, onOk,onDefault,eventListener,sender); } } - /// Get a list of virtual machines in the provided resource group. + /// Reimage the provided virtual machine. /// /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled @@ -27988,7 +49903,7 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task VirtualMachinesListByResourceGroupViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task VirtualMachinesReimageViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -27996,22 +49911,25 @@ public partial class NetworkCloud { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/virtualMachines$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/virtualMachines/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/virtualMachines'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/virtualMachines/{virtualMachineName}'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var virtualMachineName = _match.Groups["virtualMachineName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + subscriptionId + "/resourceGroups/" + resourceGroupName - + "/providers/Microsoft.NetworkCloud/virtualMachines" + + "/providers/Microsoft.NetworkCloud/virtualMachines/" + + virtualMachineName + + "/reimage" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -28020,16 +49938,16 @@ public partial class NetworkCloud // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Post, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.VirtualMachinesListByResourceGroup_Call(request,onOk,onDefault,eventListener,sender); + await this.VirtualMachinesReimage_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 @@ -28039,17 +49957,111 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task VirtualMachinesListByResourceGroup_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task VirtualMachinesReimage_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { global::System.Net.Http.HttpResponseMessage _response = null; try { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; var sendTask = sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // declared final-state-via: location + var _finalUri = _response.GetFirstHeader(@"Location"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -28057,13 +50069,13 @@ public partial class NetworkCloud case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.VirtualMachineList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -28079,16 +50091,17 @@ public partial class NetworkCloud } /// - /// 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 value must be an UUID. /// The name of the resource group. The name is case insensitive. + /// The name of the virtual machine. /// an instance that will receive events. /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task VirtualMachinesListByResourceGroup_Validate(string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task VirtualMachinesReimage_Validate(string subscriptionId, string resourceGroupName, string virtualMachineName, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -28097,11 +50110,15 @@ public partial class NetworkCloud await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(virtualMachineName),virtualMachineName); + await eventListener.AssertRegEx(nameof(virtualMachineName), virtualMachineName, @"^([a-zA-Z0-9][a-zA-Z0-9]{0,62}[a-zA-Z0-9])$"); } } - /// Get a list of virtual machines in the provided subscription. + /// Restart the provided virtual machine. /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the virtual machine. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). @@ -28110,7 +50127,7 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task VirtualMachinesListBySubscription(string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task VirtualMachinesRestart(string subscriptionId, string resourceGroupName, string virtualMachineName, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -28120,7 +50137,11 @@ public partial class NetworkCloud var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + global::System.Uri.EscapeDataString(subscriptionId) - + "/providers/Microsoft.NetworkCloud/virtualMachines" + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.NetworkCloud/virtualMachines/" + + global::System.Uri.EscapeDataString(virtualMachineName) + + "/restart" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -28129,16 +50150,16 @@ public partial class NetworkCloud // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Post, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.VirtualMachinesListBySubscription_Call(request,onOk,onDefault,eventListener,sender); + await this.VirtualMachinesRestart_Call (request, onOk,onDefault,eventListener,sender); } } - /// Get a list of virtual machines in the provided subscription. + /// Restart the provided virtual machine. /// /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled @@ -28148,7 +50169,7 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task VirtualMachinesListBySubscriptionViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task VirtualMachinesRestartViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -28156,19 +50177,25 @@ public partial class NetworkCloud { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/providers/Microsoft.NetworkCloud/virtualMachines$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/virtualMachines/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.NetworkCloud/virtualMachines'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/virtualMachines/{virtualMachineName}'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var virtualMachineName = _match.Groups["virtualMachineName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + subscriptionId - + "/providers/Microsoft.NetworkCloud/virtualMachines" + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.NetworkCloud/virtualMachines/" + + virtualMachineName + + "/restart" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -28177,16 +50204,16 @@ public partial class NetworkCloud // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Post, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.VirtualMachinesListBySubscription_Call(request,onOk,onDefault,eventListener,sender); + await this.VirtualMachinesRestart_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 @@ -28196,17 +50223,111 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task VirtualMachinesListBySubscription_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task VirtualMachinesRestart_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { global::System.Net.Http.HttpResponseMessage _response = null; try { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; var sendTask = sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // declared final-state-via: location + var _finalUri = _response.GetFirstHeader(@"Location"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -28214,13 +50335,13 @@ public partial class NetworkCloud case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.VirtualMachineList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -28236,28 +50357,34 @@ public partial class NetworkCloud } /// - /// 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 value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the virtual machine. /// an instance that will receive events. /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task VirtualMachinesListBySubscription_Validate(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task VirtualMachinesRestart_Validate(string subscriptionId, string resourceGroupName, string virtualMachineName, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertNotNull(nameof(virtualMachineName),virtualMachineName); + await eventListener.AssertRegEx(nameof(virtualMachineName), virtualMachineName, @"^([a-zA-Z0-9][a-zA-Z0-9]{0,62}[a-zA-Z0-9])$"); } } - /// Power off the provided virtual machine. + /// Start the provided virtual machine. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// The name of the virtual machine. - /// The request body. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). @@ -28266,7 +50393,7 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task VirtualMachinesPowerOff(string subscriptionId, string resourceGroupName, string virtualMachineName, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePowerOffParameters body, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task VirtualMachinesStart(string subscriptionId, string resourceGroupName, string virtualMachineName, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -28280,7 +50407,7 @@ public partial class NetworkCloud + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.NetworkCloud/virtualMachines/" + global::System.Uri.EscapeDataString(virtualMachineName) - + "/powerOff" + + "/start" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -28293,18 +50420,13 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); - request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.VirtualMachinesPowerOff_Call(request,onOk,onDefault,eventListener,sender); + await this.VirtualMachinesStart_Call (request, onOk,onDefault,eventListener,sender); } } - /// Power off the provided virtual machine. + /// Start the provided virtual machine. /// - /// The request body. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). @@ -28313,7 +50435,7 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task VirtualMachinesPowerOffViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePowerOffParameters body, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task VirtualMachinesStartViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -28324,7 +50446,7 @@ public partial class NetworkCloud var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/virtualMachines/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/virtualMachines/{virtualMachineName}/powerOff'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/virtualMachines/{virtualMachineName}'"); } // replace URI parameters with values from identity @@ -28339,7 +50461,7 @@ public partial class NetworkCloud + resourceGroupName + "/providers/Microsoft.NetworkCloud/virtualMachines/" + virtualMachineName - + "/powerOff" + + "/start" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -28352,16 +50474,12 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); - request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.VirtualMachinesPowerOff_Call(request,onOk,onDefault,eventListener,sender); + await this.VirtualMachinesStart_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 @@ -28371,32 +50489,29 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task VirtualMachinesPowerOff_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task VirtualMachinesStart_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { global::System.Net.Http.HttpResponseMessage _response = null; try { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; var sendTask = sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // this operation supports x-ms-long-running-operation - var _originalUri = request.RequestUri.AbsoluteUri; // declared final-state-via: location var _finalUri = _response.GetFirstHeader(@"Location"); var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) { - - // get the delay before polling. (default to 30 seconds if not present) - int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // start the delay timer (we'll await later...) - var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } // while we wait, let's grab the headers and get ready to poll. if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { @@ -28405,15 +50520,14 @@ public partial class NetworkCloud if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { location = _response.GetFirstHeader(@"Location"); } - var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); // and let's look at the current response body and see if we have some information we can give back to the listener var content = await _response.Content.ReadAsStringAsync(); - await waiting; - - // check for cancellation - if( eventListener.Token.IsCancellationRequested ) { return; } // drop the old response _response?.Dispose(); @@ -28422,45 +50536,45 @@ public partial class NetworkCloud _response = await sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // if we got back an OK, take a peek inside and see if it's done - if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) - { - var error = false; - try { - if( Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) - { - var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); - if( state is null ) - { - // the body doesn't contain any information that has the state of the LRO - // we're going to just get out, and let the consumer have the result - break; - } - - switch( state?.ToString()?.ToLower() ) - { - case "failed": - error = true; + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. break; - case "succeeded": - case "canceled": - // we're done polling. - break; - - default: - // need to keep polling! - _response.StatusCode = global::System.Net.HttpStatusCode.Created; - continue; - } - } - } catch { - // if we run into a problem peeking into the result, - // we really don't want to do anything special. - } - if (error) { - throw new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException(_response); - } - } + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException(_response); + } + } // check for terminal status code if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) @@ -28479,6 +50593,7 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } break; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -28492,7 +50607,7 @@ public partial class NetworkCloud default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -28508,18 +50623,17 @@ public partial class NetworkCloud } /// - /// 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 value must be an UUID. /// The name of the resource group. The name is case insensitive. /// The name of the virtual machine. - /// The request body. /// an instance that will receive events. /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task VirtualMachinesPowerOff_Validate(string subscriptionId, string resourceGroupName, string virtualMachineName, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePowerOffParameters body, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task VirtualMachinesStart_Validate(string subscriptionId, string resourceGroupName, string virtualMachineName, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -28529,25 +50643,32 @@ public partial class NetworkCloud await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); await eventListener.AssertNotNull(nameof(virtualMachineName),virtualMachineName); - await eventListener.AssertRegEx(nameof(virtualMachineName),virtualMachineName,@"^([a-zA-Z0-9][a-zA-Z0-9]{0,62}[a-zA-Z0-9])$"); - await eventListener.AssertNotNull(nameof(body), body); - await eventListener.AssertObjectIsValid(nameof(body), body); + await eventListener.AssertRegEx(nameof(virtualMachineName), virtualMachineName, @"^([a-zA-Z0-9][a-zA-Z0-9]{0,62}[a-zA-Z0-9])$"); } } - /// Reimage the provided virtual machine. + /// + /// Patch the properties of the provided virtual machine, or update the tags associated with the virtual machine. Properties + /// and tag update can be done independently. + /// /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// The name of the virtual machine. + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// The request body. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 VirtualMachinesReimage(string subscriptionId, string resourceGroupName, string virtualMachineName, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task VirtualMachinesUpdate(string subscriptionId, string resourceGroupName, string virtualMachineName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePatchParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -28561,7 +50682,6 @@ public partial class NetworkCloud + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.NetworkCloud/virtualMachines/" + global::System.Uri.EscapeDataString(virtualMachineName) - + "/reimage" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -28570,26 +50690,49 @@ public partial class NetworkCloud // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Post, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Patch, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + if (null != ifNoneMatch) + { + request.Headers.Add("If-None-Match",ifNoneMatch); + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.VirtualMachinesReimage_Call(request,onOk,onDefault,eventListener,sender); + await this.VirtualMachinesUpdate_Call (request, onOk,onDefault,eventListener,sender); } } - /// Reimage the provided virtual machine. + /// + /// Patch the properties of the provided virtual machine, or update the tags associated with the virtual machine. Properties + /// and tag update can be done independently. + /// /// + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// The request body. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 VirtualMachinesReimageViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task VirtualMachinesUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePatchParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -28600,7 +50743,7 @@ public partial class NetworkCloud var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/virtualMachines/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/virtualMachines/{virtualMachineName}/reimage'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/virtualMachines/{virtualMachineName}'"); } // replace URI parameters with values from identity @@ -28615,7 +50758,6 @@ public partial class NetworkCloud + resourceGroupName + "/providers/Microsoft.NetworkCloud/virtualMachines/" + virtualMachineName - + "/reimage" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -28624,199 +50766,187 @@ public partial class NetworkCloud // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Post, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Patch, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + if (null != ifNoneMatch) + { + request.Headers.Add("If-None-Match",ifNoneMatch); + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.VirtualMachinesReimage_Call(request,onOk,onDefault,eventListener,sender); + await this.VirtualMachinesUpdate_Call (request, onOk,onDefault,eventListener,sender); } } - /// Actual wire call for method. - /// the prepared HttpRequestMessage to send. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). + /// + /// Patch the properties of the provided virtual machine, or update the tags associated with the virtual machine. Properties + /// and tag update can be done independently. + /// + /// + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// The request body. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 VirtualMachinesReimage_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task VirtualMachinesUpdateViaIdentityWithResult(global::System.String viaIdentity, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePatchParameters body, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate) { + var apiVersion = @"2025-02-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.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // this operation supports x-ms-long-running-operation - var _originalUri = request.RequestUri.AbsoluteUri; - // declared final-state-via: location - var _finalUri = _response.GetFirstHeader(@"Location"); - var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - var location = _response.GetFirstHeader(@"Location"); - while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) - { - - // get the delay before polling. (default to 30 seconds if not present) - int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // start the delay timer (we'll await later...) - var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); - - // while we wait, let's grab the headers and get ready to poll. - if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { - asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - } - if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { - location = _response.GetFirstHeader(@"Location"); - } - var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; - request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); - - // and let's look at the current response body and see if we have some information we can give back to the listener - var content = await _response.Content.ReadAsStringAsync(); - await waiting; - - // check for cancellation - if( eventListener.Token.IsCancellationRequested ) { return; } - - // drop the old response - _response?.Dispose(); - - // make the polling call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // if we got back an OK, take a peek inside and see if it's done - if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) - { - var error = false; - try { - if( Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) - { - var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); - if( state is null ) - { - // the body doesn't contain any information that has the state of the LRO - // we're going to just get out, and let the consumer have the result - break; - } - - switch( state?.ToString()?.ToLower() ) - { - case "failed": - error = true; - break; - case "succeeded": - case "canceled": - // we're done polling. - break; - - default: - // need to keep polling! - _response.StatusCode = global::System.Net.HttpStatusCode.Created; - continue; - } - } - } catch { - // if we run into a problem peeking into the result, - // we really don't want to do anything special. - } - if (error) { - throw new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException(_response); - } - } + // verify that Identity format is an exact match for uri - // check for terminal status code - if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) - { - continue; - } - // we are done polling, do a request on final target? - // create a new request with the final uri - request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/virtualMachines/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/virtualMachines/{virtualMachineName}'"); + } - // drop the old response - _response?.Dispose(); + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var virtualMachineName = _match.Groups["virtualMachineName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.NetworkCloud/virtualMachines/" + + virtualMachineName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - // make the final call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - break; - } - var _contentType = _response.Content.Headers.ContentType?.MediaType; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - switch ( _response.StatusCode ) - { - case global::System.Net.HttpStatusCode.OK: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); } - finally + if (null != ifNoneMatch) { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); + request.Headers.Add("If-None-Match",ifNoneMatch); } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.VirtualMachinesUpdateWithResult_Call (request, eventListener,sender); } } /// - /// Validation method for method. Call this like the actual call, but you will get validation - /// events back. + /// Patch the properties of the provided virtual machine, or update the tags associated with the virtual machine. Properties + /// and tag update can be done independently. /// /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// The name of the virtual machine. + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// Json string supplied to the VirtualMachinesUpdate 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.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task VirtualMachinesReimage_Validate(string subscriptionId, string resourceGroupName, string virtualMachineName, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) + public async global::System.Threading.Tasks.Task VirtualMachinesUpdateViaJsonString(string subscriptionId, string resourceGroupName, string virtualMachineName, string ifMatch, string ifNoneMatch, 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.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { + var apiVersion = @"2025-02-01"; + // Constant Parameters using( NoSynchronizationContext ) { - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); - await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); - await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); - await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); - await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertNotNull(nameof(virtualMachineName),virtualMachineName); - await eventListener.AssertRegEx(nameof(virtualMachineName),virtualMachineName,@"^([a-zA-Z0-9][a-zA-Z0-9]{0,62}[a-zA-Z0-9])$"); + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.NetworkCloud/virtualMachines/" + + global::System.Uri.EscapeDataString(virtualMachineName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + if (null != ifNoneMatch) + { + request.Headers.Add("If-None-Match",ifNoneMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.VirtualMachinesUpdate_Call (request, onOk,onDefault,eventListener,sender); } } - /// Restart the provided virtual machine. + /// + /// Patch the properties of the provided virtual machine, or update the tags associated with the virtual machine. Properties + /// and tag update can be done independently. + /// /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// The name of the virtual machine. - /// a delegate that is called 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 ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// Json string supplied to the VirtualMachinesUpdate operation /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 VirtualMachinesRestart(string subscriptionId, string resourceGroupName, string virtualMachineName, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task VirtualMachinesUpdateViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string virtualMachineName, string ifMatch, string ifNoneMatch, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -28830,114 +50960,131 @@ public partial class NetworkCloud + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.NetworkCloud/virtualMachines/" + global::System.Uri.EscapeDataString(virtualMachineName) - + "/restart" + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Post, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + if (null != ifNoneMatch) + { + request.Headers.Add("If-None-Match",ifNoneMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.VirtualMachinesRestart_Call(request,onOk,onDefault,eventListener,sender); + return await this.VirtualMachinesUpdateWithResult_Call (request, eventListener,sender); } } - /// Restart the provided virtual machine. - /// - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). + /// + /// Patch the properties of the provided virtual machine, or update the tags associated with the virtual machine. Properties + /// and tag update can be done independently. + /// + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the virtual machine. + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// The request body. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 VirtualMachinesRestartViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task VirtualMachinesUpdateWithResult(string subscriptionId, string resourceGroupName, string virtualMachineName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePatchParameters body, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2025-02-01"; // Constant Parameters using( NoSynchronizationContext ) { - // verify that Identity format is an exact match for uri - - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/virtualMachines/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); - if (!_match.Success) - { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/virtualMachines/{virtualMachineName}/restart'"); - } - - // replace URI parameters with values from identity - var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var virtualMachineName = _match.Groups["virtualMachineName"].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.NetworkCloud/virtualMachines/" - + virtualMachineName - + "/restart" + + global::System.Uri.EscapeDataString(virtualMachineName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Post, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + if (null != ifNoneMatch) + { + request.Headers.Add("If-None-Match",ifNoneMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.VirtualMachinesRestart_Call(request,onOk,onDefault,eventListener,sender); + return await this.VirtualMachinesUpdateWithResult_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). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 VirtualMachinesRestart_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task VirtualMachinesUpdateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { global::System.Net.Http.HttpResponseMessage _response = null; try { - var sendTask = sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } // this operation supports x-ms-long-running-operation var _originalUri = request.RequestUri.AbsoluteUri; - // declared final-state-via: location - var _finalUri = _response.GetFirstHeader(@"Location"); + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + // declared final-state-via: azure-async-operation var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) { - - // get the delay before polling. (default to 30 seconds if not present) - int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // start the delay timer (we'll await later...) - var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } // while we wait, let's grab the headers and get ready to poll. if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { @@ -28946,62 +51093,61 @@ public partial class NetworkCloud if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { location = _response.GetFirstHeader(@"Location"); } - var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); // and let's look at the current response body and see if we have some information we can give back to the listener var content = await _response.Content.ReadAsStringAsync(); - await waiting; - - // check for cancellation - if( eventListener.Token.IsCancellationRequested ) { return; } // drop the old response _response?.Dispose(); // make the polling call _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // if we got back an OK, take a peek inside and see if it's done - if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) - { - var error = false; - try { - if( Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) - { - var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); - if( state is null ) - { - // the body doesn't contain any information that has the state of the LRO - // we're going to just get out, and let the consumer have the result - break; - } - - switch( state?.ToString()?.ToLower() ) - { - case "failed": - error = true; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result break; - case "succeeded": - case "canceled": - // we're done polling. - break; - - default: - // need to keep polling! - _response.StatusCode = global::System.Net.HttpStatusCode.Created; - continue; - } - } - } catch { - // if we run into a problem peeking into the result, - // we really don't want to do anything special. - } - if (error) { - throw new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException(_response); - } - } + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException(_response); + } + } // check for terminal status code if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) @@ -29010,31 +51156,44 @@ public partial class NetworkCloud } // we are done polling, do a request on final target? // create a new request with the final uri - request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); // drop the old response _response?.Dispose(); // make the final call _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } break; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response); - break; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.VirtualMachine.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; } default: { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } } } } @@ -29048,130 +51207,7 @@ public partial class NetworkCloud } } - /// - /// Validation method for method. Call this like the actual call, but you will get validation - /// events back. - /// - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of the virtual machine. - /// an instance that will receive events. - /// - /// A that will be complete when handling of the response is completed. - /// - internal async global::System.Threading.Tasks.Task VirtualMachinesRestart_Validate(string subscriptionId, string resourceGroupName, string virtualMachineName, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) - { - using( NoSynchronizationContext ) - { - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); - await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); - await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); - await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); - await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertNotNull(nameof(virtualMachineName),virtualMachineName); - await eventListener.AssertRegEx(nameof(virtualMachineName),virtualMachineName,@"^([a-zA-Z0-9][a-zA-Z0-9]{0,62}[a-zA-Z0-9])$"); - } - } - - /// Start the provided virtual machine. - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of the virtual machine. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. - /// - /// A that will be complete when handling of the response is completed. - /// - public async global::System.Threading.Tasks.Task VirtualMachinesStart(string subscriptionId, string resourceGroupName, string virtualMachineName, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) - { - var apiVersion = @"2025-02-01"; - // Constant Parameters - using( NoSynchronizationContext ) - { - // construct URL - var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/subscriptions/" - + global::System.Uri.EscapeDataString(subscriptionId) - + "/resourceGroups/" - + global::System.Uri.EscapeDataString(resourceGroupName) - + "/providers/Microsoft.NetworkCloud/virtualMachines/" - + global::System.Uri.EscapeDataString(virtualMachineName) - + "/start" - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - // generate request object - var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Post, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.VirtualMachinesStart_Call(request,onOk,onDefault,eventListener,sender); - } - } - - /// Start the provided virtual machine. - /// - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). - /// an instance that will receive events. - /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. - /// - /// A that will be complete when handling of the response is completed. - /// - public async global::System.Threading.Tasks.Task VirtualMachinesStartViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) - { - var apiVersion = @"2025-02-01"; - // Constant Parameters - using( NoSynchronizationContext ) - { - // verify that Identity format is an exact match for uri - - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/virtualMachines/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); - if (!_match.Success) - { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/virtualMachines/{virtualMachineName}/start'"); - } - - // replace URI parameters with values from identity - var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var virtualMachineName = _match.Groups["virtualMachineName"].Value; - // construct URL - var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( - "/subscriptions/" - + subscriptionId - + "/resourceGroups/" - + resourceGroupName - + "/providers/Microsoft.NetworkCloud/virtualMachines/" - + virtualMachineName - + "/start" - + "?" - + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) - ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - // generate request object - var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Post, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.VirtualMachinesStart_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 @@ -29181,32 +51217,28 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task VirtualMachinesStart_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task VirtualMachinesUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { global::System.Net.Http.HttpResponseMessage _response = null; try { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; var sendTask = sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // this operation supports x-ms-long-running-operation - var _originalUri = request.RequestUri.AbsoluteUri; - // declared final-state-via: location - var _finalUri = _response.GetFirstHeader(@"Location"); + // declared final-state-via: azure-async-operation var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) { - - // get the delay before polling. (default to 30 seconds if not present) - int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // start the delay timer (we'll await later...) - var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } // while we wait, let's grab the headers and get ready to poll. if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { @@ -29215,15 +51247,14 @@ public partial class NetworkCloud if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { location = _response.GetFirstHeader(@"Location"); } - var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); // and let's look at the current response body and see if we have some information we can give back to the listener var content = await _response.Content.ReadAsStringAsync(); - await waiting; - - // check for cancellation - if( eventListener.Token.IsCancellationRequested ) { return; } // drop the old response _response?.Dispose(); @@ -29232,45 +51263,45 @@ public partial class NetworkCloud _response = await sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // if we got back an OK, take a peek inside and see if it's done - if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) - { - var error = false; - try { - if( Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) - { - var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); - if( state is null ) - { - // the body doesn't contain any information that has the state of the LRO - // we're going to just get out, and let the consumer have the result - break; - } - - switch( state?.ToString()?.ToLower() ) - { - case "failed": - error = true; + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. break; - case "succeeded": - case "canceled": - // we're done polling. - break; - - default: - // need to keep polling! - _response.StatusCode = global::System.Net.HttpStatusCode.Created; - continue; - } - } - } catch { - // if we run into a problem peeking into the result, - // we really don't want to do anything special. - } - if (error) { - throw new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException(_response); - } - } + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException(_response); + } + } // check for terminal status code if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) @@ -29279,7 +51310,7 @@ public partial class NetworkCloud } // we are done polling, do a request on final target? // create a new request with the final uri - request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); // drop the old response _response?.Dispose(); @@ -29289,6 +51320,7 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } break; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -29296,13 +51328,13 @@ public partial class NetworkCloud case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.VirtualMachine.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -29318,17 +51350,22 @@ public partial class NetworkCloud } /// - /// 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 value must be an UUID. /// The name of the resource group. The name is case insensitive. /// The name of the virtual machine. + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// The request body. /// an instance that will receive events. /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task VirtualMachinesStart_Validate(string subscriptionId, string resourceGroupName, string virtualMachineName, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task VirtualMachinesUpdate_Validate(string subscriptionId, string resourceGroupName, string virtualMachineName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePatchParameters body, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -29338,17 +51375,18 @@ public partial class NetworkCloud await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); await eventListener.AssertNotNull(nameof(virtualMachineName),virtualMachineName); - await eventListener.AssertRegEx(nameof(virtualMachineName),virtualMachineName,@"^([a-zA-Z0-9][a-zA-Z0-9]{0,62}[a-zA-Z0-9])$"); + await eventListener.AssertRegEx(nameof(virtualMachineName), virtualMachineName, @"^([a-zA-Z0-9][a-zA-Z0-9]{0,62}[a-zA-Z0-9])$"); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(ifNoneMatch),ifNoneMatch); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); } } - /// - /// Patch the properties of the provided virtual machine, or update the tags associated with the virtual machine. Properties - /// and tag updates can be done independently. - /// + /// update a new volume or update the properties of the existing one. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. - /// The name of the virtual machine. + /// The name of the volume. /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. @@ -29359,10 +51397,11 @@ public partial class NetworkCloud /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 VirtualMachinesUpdate(string subscriptionId, string resourceGroupName, string virtualMachineName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePatchParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task VolumesCreateOrUpdate(string subscriptionId, string resourceGroupName, string volumeName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolume body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -29374,8 +51413,8 @@ public partial class NetworkCloud + global::System.Uri.EscapeDataString(subscriptionId) + "/resourceGroups/" + global::System.Uri.EscapeDataString(resourceGroupName) - + "/providers/Microsoft.NetworkCloud/virtualMachines/" - + global::System.Uri.EscapeDataString(virtualMachineName) + + "/providers/Microsoft.NetworkCloud/volumes/" + + global::System.Uri.EscapeDataString(volumeName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -29384,7 +51423,7 @@ public partial class NetworkCloud // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Patch, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Put, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } // add headers parameters @@ -29399,18 +51438,15 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // 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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.VirtualMachinesUpdate_Call(request,onOk,onDefault,eventListener,sender); + await this.VolumesCreateOrUpdate_Call (request, onOk,onDefault,eventListener,sender); } } - /// - /// Patch the properties of the provided virtual machine, or update the tags associated with the virtual machine. Properties - /// and tag updates can be done independently. - /// + /// update a new volume or update the properties of the existing one. /// /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. @@ -29422,10 +51458,11 @@ public partial class NetworkCloud /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 VirtualMachinesUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePatchParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task VolumesCreateOrUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolume body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -29433,24 +51470,24 @@ public partial class NetworkCloud { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/virtualMachines/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/volumes/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/virtualMachines/{virtualMachineName}'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/volumes/{volumeName}'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var virtualMachineName = _match.Groups["virtualMachineName"].Value; + var volumeName = _match.Groups["volumeName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + subscriptionId + "/resourceGroups/" + resourceGroupName - + "/providers/Microsoft.NetworkCloud/virtualMachines/" - + virtualMachineName + + "/providers/Microsoft.NetworkCloud/volumes/" + + volumeName + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -29459,7 +51496,7 @@ public partial class NetworkCloud // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Patch, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Put, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } // add headers parameters @@ -29474,194 +51511,86 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // 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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.VirtualMachinesUpdate_Call(request,onOk,onDefault,eventListener,sender); + await this.VolumesCreateOrUpdate_Call (request, onOk,onDefault,eventListener,sender); } } - /// Actual wire call for method. - /// the prepared HttpRequestMessage to send. - /// a delegate that is called 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 volume or update the properties of the existing one. + /// + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// The request body. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 VirtualMachinesUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task VolumesCreateOrUpdateViaIdentityWithResult(global::System.String viaIdentity, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolume body, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate) { + var apiVersion = @"2025-02-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.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // this operation supports x-ms-long-running-operation - var _originalUri = request.RequestUri.AbsoluteUri; - // declared final-state-via: azure-async-operation - var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - var location = _response.GetFirstHeader(@"Location"); - while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) - { - - // get the delay before polling. (default to 30 seconds if not present) - int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // start the delay timer (we'll await later...) - var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); - - // while we wait, let's grab the headers and get ready to poll. - if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { - asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); - } - if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { - location = _response.GetFirstHeader(@"Location"); - } - var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; - request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); - - // and let's look at the current response body and see if we have some information we can give back to the listener - var content = await _response.Content.ReadAsStringAsync(); - await waiting; - - // check for cancellation - if( eventListener.Token.IsCancellationRequested ) { return; } - - // drop the old response - _response?.Dispose(); - - // make the polling call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // verify that Identity format is an exact match for uri - // if we got back an OK, take a peek inside and see if it's done - if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) - { - var error = false; - try { - if( Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) - { - var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); - if( state is null ) - { - // the body doesn't contain any information that has the state of the LRO - // we're going to just get out, and let the consumer have the result - break; - } - - switch( state?.ToString()?.ToLower() ) - { - case "failed": - error = true; - break; - case "succeeded": - case "canceled": - // we're done polling. - break; - - default: - // need to keep polling! - _response.StatusCode = global::System.Net.HttpStatusCode.Created; - continue; - } - } - } catch { - // if we run into a problem peeking into the result, - // we really don't want to do anything special. - } - if (error) { - throw new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException(_response); - } - } + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/volumes/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/volumes/{volumeName}'"); + } - // check for terminal status code - if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) - { - continue; - } - // we are done polling, do a request on final target? - // create a new request with the final uri - request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var volumeName = _match.Groups["volumeName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.NetworkCloud/volumes/" + + volumeName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - // drop the old response - _response?.Dispose(); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - // make the final call - _response = await sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - break; - } - var _contentType = _response.Content.Headers.ContentType?.MediaType; + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - switch ( _response.StatusCode ) - { - case global::System.Net.HttpStatusCode.OK: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.VirtualMachine.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); } - finally + if (null != ifNoneMatch) { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); + request.Headers.Add("If-None-Match",ifNoneMatch); } - } - } - /// - /// Validation method for method. Call this like the actual call, but you will get validation - /// events back. - /// - /// The ID of the target subscription. The value must be an UUID. - /// The name of the resource group. The name is case insensitive. - /// The name of the virtual machine. - /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify - /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. - /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. - /// Other values will result in error from server as they are not supported. - /// The request body. - /// an instance that will receive events. - /// - /// A that will be complete when handling of the response is completed. - /// - internal async global::System.Threading.Tasks.Task VirtualMachinesUpdate_Validate(string subscriptionId, string resourceGroupName, string virtualMachineName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePatchParameters body, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) - { - using( NoSynchronizationContext ) - { - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); - await eventListener.AssertRegEx(nameof(subscriptionId),subscriptionId,@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$"); - await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); - await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); - await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); - await eventListener.AssertNotNull(nameof(virtualMachineName),virtualMachineName); - await eventListener.AssertRegEx(nameof(virtualMachineName),virtualMachineName,@"^([a-zA-Z0-9][a-zA-Z0-9]{0,62}[a-zA-Z0-9])$"); - await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); - await eventListener.AssertNotNull(nameof(ifNoneMatch),ifNoneMatch); - await eventListener.AssertNotNull(nameof(body), body); - await eventListener.AssertObjectIsValid(nameof(body), body); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.VolumesCreateOrUpdateWithResult_Call (request, eventListener,sender); } } - /// Create a new volume or update the properties of the existing one. + /// update a new volume or update the properties of the existing one. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// The name of the volume. @@ -29669,7 +51598,7 @@ public partial class NetworkCloud /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. /// Other values will result in error from server as they are not supported. - /// The request body. + /// Json string supplied to the VolumesCreateOrUpdate 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). @@ -29678,7 +51607,7 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task VolumesCreateOrUpdate(string subscriptionId, string resourceGroupName, string volumeName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolume body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task VolumesCreateOrUpdateViaJsonString(string subscriptionId, string resourceGroupName, string volumeName, string ifMatch, string ifNoneMatch, 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.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -29715,65 +51644,114 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // 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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.VolumesCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + await this.VolumesCreateOrUpdate_Call (request, onOk,onDefault,eventListener,sender); } } - /// Create a new volume or update the properties of the existing one. - /// + /// update a new volume or update the properties of the existing one. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the volume. /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. /// Other values will result in error from server as they are not supported. - /// The request body. - /// a delegate that is called 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 VolumesCreateOrUpdate operation /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 VolumesCreateOrUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolume body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task VolumesCreateOrUpdateViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string volumeName, string ifMatch, string ifNoneMatch, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { var apiVersion = @"2025-02-01"; // 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.NetworkCloud/volumes/" + + global::System.Uri.EscapeDataString(volumeName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/volumes/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); - if (!_match.Success) + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // add headers parameters + if (null != ifMatch) { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/volumes/{volumeName}'"); + request.Headers.Add("If-Match",ifMatch); + } + if (null != ifNoneMatch) + { + request.Headers.Add("If-None-Match",ifNoneMatch); } - // replace URI parameters with values from identity - var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; - var volumeName = _match.Groups["volumeName"].Value; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.VolumesCreateOrUpdateWithResult_Call (request, eventListener,sender); + } + } + + /// update a new volume or update the properties of the existing one. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the volume. + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// The request body. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 VolumesCreateOrUpdateWithResult(string subscriptionId, string resourceGroupName, string volumeName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolume body, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2025-02-01"; + // 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.NetworkCloud/volumes/" - + volumeName + + global::System.Uri.EscapeDataString(volumeName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Put, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } // add headers parameters if (null != ifMatch) @@ -29785,17 +51763,169 @@ public partial class NetworkCloud request.Headers.Add("If-None-Match",ifNoneMatch); } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.VolumesCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + return await this.VolumesCreateOrUpdateWithResult_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.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that + /// will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task VolumesCreateOrUpdateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + // declared final-state-via: azure-async-operation + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + break; + } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Volume.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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 @@ -29805,31 +51935,28 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task VolumesCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task VolumesCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { global::System.Net.Http.HttpResponseMessage _response = null; try { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; var sendTask = sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // this operation supports x-ms-long-running-operation - var _originalUri = request.RequestUri.AbsoluteUri; // declared final-state-via: azure-async-operation var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) { - - // get the delay before polling. (default to 30 seconds if not present) - int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // start the delay timer (we'll await later...) - var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } // while we wait, let's grab the headers and get ready to poll. if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { @@ -29838,15 +51965,14 @@ public partial class NetworkCloud if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { location = _response.GetFirstHeader(@"Location"); } - var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); // and let's look at the current response body and see if we have some information we can give back to the listener var content = await _response.Content.ReadAsStringAsync(); - await waiting; - - // check for cancellation - if( eventListener.Token.IsCancellationRequested ) { return; } // drop the old response _response?.Dispose(); @@ -29855,45 +51981,45 @@ public partial class NetworkCloud _response = await sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // if we got back an OK, take a peek inside and see if it's done - if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) - { - var error = false; - try { - if( Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) - { - var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); - if( state is null ) - { - // the body doesn't contain any information that has the state of the LRO - // we're going to just get out, and let the consumer have the result - break; - } - - switch( state?.ToString()?.ToLower() ) - { - case "failed": - error = true; + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result break; - case "succeeded": - case "canceled": - // we're done polling. - break; - - default: - // need to keep polling! - _response.StatusCode = global::System.Net.HttpStatusCode.Created; - continue; - } - } - } catch { - // if we run into a problem peeking into the result, - // we really don't want to do anything special. - } - if (error) { - throw new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException(_response); - } - } + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException(_response); + } + } // check for terminal status code if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) @@ -29912,6 +52038,7 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } break; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -29919,13 +52046,13 @@ public partial class NetworkCloud case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.Volume.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Volume.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -29956,7 +52083,7 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task VolumesCreateOrUpdate_Validate(string subscriptionId, string resourceGroupName, string volumeName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolume body, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task VolumesCreateOrUpdate_Validate(string subscriptionId, string resourceGroupName, string volumeName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolume body, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -29966,7 +52093,7 @@ public partial class NetworkCloud await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); await eventListener.AssertNotNull(nameof(volumeName),volumeName); - await eventListener.AssertRegEx(nameof(volumeName),volumeName,@"^([a-zA-Z0-9][a-zA-Z0-9-_]{0,62}[a-zA-Z0-9])$"); + await eventListener.AssertRegEx(nameof(volumeName), volumeName, @"^([a-zA-Z0-9][a-zA-Z0-9-_]{0,62}[a-zA-Z0-9])$"); await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); await eventListener.AssertNotNull(nameof(ifNoneMatch),ifNoneMatch); await eventListener.AssertNotNull(nameof(body), body); @@ -29991,7 +52118,7 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task VolumesDelete(string subscriptionId, string resourceGroupName, string volumeName, string ifMatch, string ifNoneMatch, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task VolumesDelete(string subscriptionId, string resourceGroupName, string volumeName, string ifMatch, string ifNoneMatch, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -30028,7 +52155,7 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.VolumesDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + await this.VolumesDelete_Call (request, onOk,onNoContent,onDefault,eventListener,sender); } } @@ -30047,7 +52174,7 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task VolumesDeleteViaIdentity(global::System.String viaIdentity, string ifMatch, string ifNoneMatch, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task VolumesDeleteViaIdentity(global::System.String viaIdentity, string ifMatch, string ifNoneMatch, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -30096,11 +52223,11 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.VolumesDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + await this.VolumesDelete_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). @@ -30111,32 +52238,29 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task VolumesDelete_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.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task VolumesDelete_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.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { global::System.Net.Http.HttpResponseMessage _response = null; try { + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; var sendTask = sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 0); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // this operation supports x-ms-long-running-operation - var _originalUri = request.RequestUri.AbsoluteUri; // declared final-state-via: location var _finalUri = _response.GetFirstHeader(@"Location"); var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); var location = _response.GetFirstHeader(@"Location"); + var operationLocation = _response.GetFirstHeader(@"Operation-Location"); while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) { - - // get the delay before polling. (default to 30 seconds if not present) - int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } - - // start the delay timer (we'll await later...) - var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + // delay before making the next polling request + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } // while we wait, let's grab the headers and get ready to poll. if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { @@ -30145,15 +52269,14 @@ public partial class NetworkCloud if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { location = _response.GetFirstHeader(@"Location"); } - var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Operation-Location"))) { + operationLocation = _response.GetFirstHeader(@"Operation-Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? global::System.String.IsNullOrEmpty(operationLocation) ? _originalUri : operationLocation : location : asyncOperation; request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get); // and let's look at the current response body and see if we have some information we can give back to the listener var content = await _response.Content.ReadAsStringAsync(); - await waiting; - - // check for cancellation - if( eventListener.Token.IsCancellationRequested ) { return; } // drop the old response _response?.Dispose(); @@ -30162,45 +52285,45 @@ public partial class NetworkCloud _response = await sender.SendAsync(request, eventListener); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - // if we got back an OK, take a peek inside and see if it's done - if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) - { - var error = false; - try { - if( Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) - { - var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); - if( state is null ) - { - // the body doesn't contain any information that has the state of the LRO - // we're going to just get out, and let the consumer have the result - break; - } - - switch( state?.ToString()?.ToLower() ) - { - case "failed": - error = true; + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. break; - case "succeeded": - case "canceled": - // we're done polling. - break; - - default: - // need to keep polling! - _response.StatusCode = global::System.Net.HttpStatusCode.Created; - continue; - } - } - } catch { - // if we run into a problem peeking into the result, - // we really don't want to do anything special. - } - if (error) { - throw new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException(_response); - } - } + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException(_response); + } + } // check for terminal status code if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) @@ -30219,6 +52342,7 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } break; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -30238,7 +52362,7 @@ public partial class NetworkCloud default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -30278,7 +52402,7 @@ public partial class NetworkCloud await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); await eventListener.AssertNotNull(nameof(volumeName),volumeName); - await eventListener.AssertRegEx(nameof(volumeName),volumeName,@"^([a-zA-Z0-9][a-zA-Z0-9-_]{0,62}[a-zA-Z0-9])$"); + await eventListener.AssertRegEx(nameof(volumeName), volumeName, @"^([a-zA-Z0-9][a-zA-Z0-9-_]{0,62}[a-zA-Z0-9])$"); await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); await eventListener.AssertNotNull(nameof(ifNoneMatch),ifNoneMatch); } @@ -30296,7 +52420,7 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task VolumesGet(string subscriptionId, string resourceGroupName, string volumeName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task VolumesGet(string subscriptionId, string resourceGroupName, string volumeName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -30323,7 +52447,7 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.VolumesGet_Call(request,onOk,onDefault,eventListener,sender); + await this.VolumesGet_Call (request, onOk,onDefault,eventListener,sender); } } @@ -30337,7 +52461,7 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task VolumesGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task VolumesGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -30372,15 +52496,167 @@ public partial class NetworkCloud // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Get, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.VolumesGet_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Get properties of the provided volume. + /// + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that + /// will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task VolumesGetViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/volumes/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/volumes/{volumeName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var volumeName = _match.Groups["volumeName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.NetworkCloud/volumes/" + + volumeName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.VolumesGetWithResult_Call (request, eventListener,sender); + } + } + + /// Get properties of the provided volume. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the volume. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that + /// will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task VolumesGetWithResult(string subscriptionId, string resourceGroupName, string volumeName, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.NetworkCloud/volumes/" + + global::System.Uri.EscapeDataString(volumeName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.VolumesGet_Call(request,onOk,onDefault,eventListener,sender); + return await this.VolumesGetWithResult_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.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that + /// will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task VolumesGetWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Volume.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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 @@ -30390,7 +52666,7 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task VolumesGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task VolumesGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -30401,6 +52677,7 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -30408,13 +52685,13 @@ public partial class NetworkCloud case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.Volume.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Volume.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -30450,7 +52727,7 @@ public partial class NetworkCloud await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); await eventListener.AssertNotNull(nameof(volumeName),volumeName); - await eventListener.AssertRegEx(nameof(volumeName),volumeName,@"^([a-zA-Z0-9][a-zA-Z0-9-_]{0,62}[a-zA-Z0-9])$"); + await eventListener.AssertRegEx(nameof(volumeName), volumeName, @"^([a-zA-Z0-9][a-zA-Z0-9-_]{0,62}[a-zA-Z0-9])$"); } } @@ -30465,7 +52742,7 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task VolumesListByResourceGroup(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.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task VolumesListByResourceGroup(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.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -30491,7 +52768,7 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.VolumesListByResourceGroup_Call(request,onOk,onDefault,eventListener,sender); + await this.VolumesListByResourceGroup_Call (request, onOk,onDefault,eventListener,sender); } } @@ -30505,7 +52782,7 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task VolumesListByResourceGroupViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task VolumesListByResourceGroupViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -30542,11 +52819,161 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.VolumesListByResourceGroup_Call(request,onOk,onDefault,eventListener,sender); + await this.VolumesListByResourceGroup_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Get a list of volumes in the provided resource group. + /// + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task VolumesListByResourceGroupViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/volumes$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/volumes'"); + } + + // 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.NetworkCloud/volumes" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.VolumesListByResourceGroupWithResult_Call (request, eventListener,sender); + } + } + + /// Get a list of volumes in the provided resource group. + /// The ID of the target subscription. The value must be an UUID. + /// 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.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task VolumesListByResourceGroupWithResult(string subscriptionId, string resourceGroupName, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.NetworkCloud/volumes" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.VolumesListByResourceGroupWithResult_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.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task VolumesListByResourceGroupWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.VolumeList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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 @@ -30556,7 +52983,7 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task VolumesListByResourceGroup_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task VolumesListByResourceGroup_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -30567,6 +52994,7 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -30574,13 +53002,13 @@ public partial class NetworkCloud case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.VolumeList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.VolumeList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -30627,7 +53055,7 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task VolumesListBySubscription(string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task VolumesListBySubscription(string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -30651,7 +53079,7 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.VolumesListBySubscription_Call(request,onOk,onDefault,eventListener,sender); + await this.VolumesListBySubscription_Call (request, onOk,onDefault,eventListener,sender); } } @@ -30665,7 +53093,7 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task VolumesListBySubscriptionViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task VolumesListBySubscriptionViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -30699,11 +53127,155 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.VolumesListBySubscription_Call(request,onOk,onDefault,eventListener,sender); + await this.VolumesListBySubscription_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Get a list of volumes in the provided subscription. + /// + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task VolumesListBySubscriptionViaIdentityWithResult(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-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.NetworkCloud/volumes$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.NetworkCloud/volumes'"); + } + + // 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.NetworkCloud/volumes" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.VolumesListBySubscriptionWithResult_Call (request, eventListener,sender); + } + } + + /// Get a list of volumes in the provided subscription. + /// The ID of the target subscription. The value must be an UUID. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task VolumesListBySubscriptionWithResult(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/providers/Microsoft.NetworkCloud/volumes" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.VolumesListBySubscriptionWithResult_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.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task VolumesListBySubscriptionWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.VolumeList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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 @@ -30713,7 +53285,7 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task VolumesListBySubscription_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task VolumesListBySubscription_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -30724,6 +53296,7 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -30731,13 +53304,13 @@ public partial class NetworkCloud case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.VolumeList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.VolumeList.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -30770,7 +53343,7 @@ public partial class NetworkCloud } } - /// Update tags associated with the provided volume. + /// update tags associated with the provided volume. /// The ID of the target subscription. The value must be an UUID. /// The name of the resource group. The name is case insensitive. /// The name of the volume. @@ -30784,10 +53357,11 @@ public partial class NetworkCloud /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 VolumesUpdate(string subscriptionId, string resourceGroupName, string volumeName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolumePatchParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task VolumesUpdate(string subscriptionId, string resourceGroupName, string volumeName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumePatchParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -30824,15 +53398,15 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // 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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.VolumesUpdate_Call(request,onOk,onDefault,eventListener,sender); + await this.VolumesUpdate_Call (request, onOk,onDefault,eventListener,sender); } } - /// Update tags associated with the provided volume. + /// update tags associated with the provided volume. /// /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. @@ -30844,10 +53418,82 @@ public partial class NetworkCloud /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 VolumesUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolumePatchParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task VolumesUpdateViaIdentity(global::System.String viaIdentity, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumePatchParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.NetworkCloud/volumes/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/volumes/{volumeName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var volumeName = _match.Groups["volumeName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.NetworkCloud/volumes/" + + volumeName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + if (null != ifNoneMatch) + { + request.Headers.Add("If-None-Match",ifNoneMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.VolumesUpdate_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// update tags associated with the provided volume. + /// + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// The request body. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 VolumesUpdateViaIdentityWithResult(global::System.String viaIdentity, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumePatchParameters body, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2025-02-01"; // Constant Parameters @@ -30877,6 +53523,68 @@ public partial class NetworkCloud + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + if (null != ifNoneMatch) + { + request.Headers.Add("If-None-Match",ifNoneMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.VolumesUpdateWithResult_Call (request, eventListener,sender); + } + } + + /// update tags associated with the provided volume. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the volume. + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// Json string supplied to the VolumesUpdate 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.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task VolumesUpdateViaJsonString(string subscriptionId, string resourceGroupName, string volumeName, string ifMatch, string ifNoneMatch, 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.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.NetworkCloud/volumes/" + + global::System.Uri.EscapeDataString(volumeName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } // generate request object @@ -30896,15 +53604,196 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // 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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.VolumesUpdate_Call(request,onOk,onDefault,eventListener,sender); + await this.VolumesUpdate_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// update tags associated with the provided volume. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the volume. + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// Json string supplied to the VolumesUpdate operation + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that + /// will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task VolumesUpdateViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string volumeName, string ifMatch, string ifNoneMatch, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.NetworkCloud/volumes/" + + global::System.Uri.EscapeDataString(volumeName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + if (null != ifNoneMatch) + { + request.Headers.Add("If-None-Match",ifNoneMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.VolumesUpdateWithResult_Call (request, eventListener,sender); + } + } + + /// update tags associated with the provided volume. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the volume. + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify + /// the last-seen ETag value to prevent accidentally overwriting concurrent changes. + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. + /// Other values will result in error from server as they are not supported. + /// The request body. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 VolumesUpdateWithResult(string subscriptionId, string resourceGroupName, string volumeName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumePatchParameters body, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2025-02-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.NetworkCloud/volumes/" + + global::System.Uri.EscapeDataString(volumeName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + if (null != ifNoneMatch) + { + request.Headers.Add("If-None-Match",ifNoneMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.VolumesUpdateWithResult_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.NetworkCloud.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that + /// will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task VolumesUpdateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Volume.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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 @@ -30914,7 +53803,7 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task VolumesUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task VolumesUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -30925,6 +53814,7 @@ public partial class NetworkCloud await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -30932,13 +53822,13 @@ public partial class NetworkCloud case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.Volume.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Volume.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -30969,7 +53859,7 @@ public partial class NetworkCloud /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task VolumesUpdate_Validate(string subscriptionId, string resourceGroupName, string volumeName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolumePatchParameters body, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task VolumesUpdate_Validate(string subscriptionId, string resourceGroupName, string volumeName, string ifMatch, string ifNoneMatch, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumePatchParameters body, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { @@ -30979,7 +53869,7 @@ public partial class NetworkCloud await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); await eventListener.AssertNotNull(nameof(volumeName),volumeName); - await eventListener.AssertRegEx(nameof(volumeName),volumeName,@"^([a-zA-Z0-9][a-zA-Z0-9-_]{0,62}[a-zA-Z0-9])$"); + await eventListener.AssertRegEx(nameof(volumeName), volumeName, @"^([a-zA-Z0-9][a-zA-Z0-9-_]{0,62}[a-zA-Z0-9])$"); await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); await eventListener.AssertNotNull(nameof(ifNoneMatch),ifNoneMatch); await eventListener.AssertNotNull(nameof(body), body); diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ActionType.Completer.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ActionType.Completer.cs deleted file mode 100644 index f1983541319f..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ActionType.Completer.cs +++ /dev/null @@ -1,37 +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.NetworkCloud.Support -{ - - /// - /// Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. - /// - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ActionTypeTypeConverter))] - public partial struct ActionType : - 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) || "Internal".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Internal'", "Internal", global::System.Management.Automation.CompletionResultType.ParameterValue, "Internal"); - } - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ActionType.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ActionType.TypeConverter.cs deleted file mode 100644 index a23443676707..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ActionType.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.NetworkCloud.Support -{ - - /// - /// Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. - /// - public partial class ActionTypeTypeConverter : - 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) => ActionType.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/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ActionType.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ActionType.cs deleted file mode 100644 index fc040e123fb7..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ActionType.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.NetworkCloud.Support -{ - - /// - /// Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. - /// - public partial struct ActionType : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ActionType Internal = @"Internal"; - - /// 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 ActionType(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Conversion from arbitrary object to ActionType - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new ActionType(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type ActionType - /// 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.NetworkCloud.Support.ActionType e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type ActionType (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 ActionType && Equals((ActionType)obj); - } - - /// Returns hashCode for enum ActionType - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Returns string representation for ActionType - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to ActionType - /// the value to convert to an instance of . - - public static implicit operator ActionType(string value) - { - return new ActionType(value); - } - - /// Implicit operator to convert ActionType to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ActionType e) - { - return e._value; - } - - /// Overriding != operator for enum ActionType - /// 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.NetworkCloud.Support.ActionType e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ActionType e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum ActionType - /// 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.NetworkCloud.Support.ActionType e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ActionType e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/AdvertiseToFabric.Completer.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/AdvertiseToFabric.Completer.cs deleted file mode 100644 index 2c2e6f50503a..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/AdvertiseToFabric.Completer.cs +++ /dev/null @@ -1,42 +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.NetworkCloud.Support -{ - - /// - /// The indicator of if this advertisement is also made to the network fabric associated with the Network Cloud Cluster. This - /// field is ignored if fabricPeeringEnabled is set to False. - /// - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.AdvertiseToFabricTypeConverter))] - public partial struct AdvertiseToFabric : - 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) || "True".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'True'", "True", global::System.Management.Automation.CompletionResultType.ParameterValue, "True"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "False".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'False'", "False", global::System.Management.Automation.CompletionResultType.ParameterValue, "False"); - } - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/AdvertiseToFabric.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/AdvertiseToFabric.TypeConverter.cs deleted file mode 100644 index 7dbf448e082e..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/AdvertiseToFabric.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.NetworkCloud.Support -{ - - /// - /// The indicator of if this advertisement is also made to the network fabric associated with the Network Cloud Cluster. This - /// field is ignored if fabricPeeringEnabled is set to False. - /// - public partial class AdvertiseToFabricTypeConverter : - 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) => AdvertiseToFabric.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/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/AdvertiseToFabric.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/AdvertiseToFabric.cs deleted file mode 100644 index 00e5d57d2db2..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/AdvertiseToFabric.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.NetworkCloud.Support -{ - - /// - /// The indicator of if this advertisement is also made to the network fabric associated with the Network Cloud Cluster. This - /// field is ignored if fabricPeeringEnabled is set to False. - /// - public partial struct AdvertiseToFabric : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.AdvertiseToFabric False = @"False"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.AdvertiseToFabric True = @"True"; - - /// 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 AdvertiseToFabric(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Conversion from arbitrary object to AdvertiseToFabric - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new AdvertiseToFabric(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type AdvertiseToFabric - /// 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.NetworkCloud.Support.AdvertiseToFabric e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type AdvertiseToFabric (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 AdvertiseToFabric && Equals((AdvertiseToFabric)obj); - } - - /// Returns hashCode for enum AdvertiseToFabric - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Returns string representation for AdvertiseToFabric - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to AdvertiseToFabric - /// the value to convert to an instance of . - - public static implicit operator AdvertiseToFabric(string value) - { - return new AdvertiseToFabric(value); - } - - /// Implicit operator to convert AdvertiseToFabric to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.AdvertiseToFabric e) - { - return e._value; - } - - /// Overriding != operator for enum AdvertiseToFabric - /// 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.NetworkCloud.Support.AdvertiseToFabric e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.AdvertiseToFabric e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum AdvertiseToFabric - /// 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.NetworkCloud.Support.AdvertiseToFabric e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.AdvertiseToFabric e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/AgentPoolDetailedStatus.Completer.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/AgentPoolDetailedStatus.Completer.cs deleted file mode 100644 index ee2636a79b7b..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/AgentPoolDetailedStatus.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.NetworkCloud.Support -{ - - /// The current status of the agent pool. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.AgentPoolDetailedStatusTypeConverter))] - public partial struct AgentPoolDetailedStatus : - 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) || "Available".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Available'", "Available", global::System.Management.Automation.CompletionResultType.ParameterValue, "Available"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Error".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Error'", "Error", global::System.Management.Automation.CompletionResultType.ParameterValue, "Error"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Provisioning".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Provisioning'", "Provisioning", global::System.Management.Automation.CompletionResultType.ParameterValue, "Provisioning"); - } - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/AgentPoolDetailedStatus.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/AgentPoolDetailedStatus.TypeConverter.cs deleted file mode 100644 index f83ce759da19..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/AgentPoolDetailedStatus.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.NetworkCloud.Support -{ - - /// The current status of the agent pool. - public partial class AgentPoolDetailedStatusTypeConverter : - 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) => AgentPoolDetailedStatus.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/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/AgentPoolDetailedStatus.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/AgentPoolDetailedStatus.cs deleted file mode 100644 index e1c768702f71..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/AgentPoolDetailedStatus.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.NetworkCloud.Support -{ - - /// The current status of the agent pool. - public partial struct AgentPoolDetailedStatus : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.AgentPoolDetailedStatus Available = @"Available"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.AgentPoolDetailedStatus Error = @"Error"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.AgentPoolDetailedStatus Provisioning = @"Provisioning"; - - /// 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 AgentPoolDetailedStatus(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Conversion from arbitrary object to AgentPoolDetailedStatus - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new AgentPoolDetailedStatus(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type AgentPoolDetailedStatus - /// 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.NetworkCloud.Support.AgentPoolDetailedStatus e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type AgentPoolDetailedStatus (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 AgentPoolDetailedStatus && Equals((AgentPoolDetailedStatus)obj); - } - - /// Returns hashCode for enum AgentPoolDetailedStatus - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Returns string representation for AgentPoolDetailedStatus - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to AgentPoolDetailedStatus - /// the value to convert to an instance of . - - public static implicit operator AgentPoolDetailedStatus(string value) - { - return new AgentPoolDetailedStatus(value); - } - - /// Implicit operator to convert AgentPoolDetailedStatus to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.AgentPoolDetailedStatus e) - { - return e._value; - } - - /// Overriding != operator for enum AgentPoolDetailedStatus - /// 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.NetworkCloud.Support.AgentPoolDetailedStatus e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.AgentPoolDetailedStatus e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum AgentPoolDetailedStatus - /// 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.NetworkCloud.Support.AgentPoolDetailedStatus e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.AgentPoolDetailedStatus e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/AgentPoolMode.Completer.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/AgentPoolMode.Completer.cs deleted file mode 100644 index abb7a5aec7aa..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/AgentPoolMode.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.NetworkCloud.Support -{ - - /// - /// The selection of how this agent pool is utilized, either as a system pool or a user pool. System pools run the features - /// and critical services for the Kubernetes Cluster, while user pools are dedicated to user workloads. Every Kubernetes cluster - /// must contain at least one system node pool with at least one node. - /// - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.AgentPoolModeTypeConverter))] - public partial struct AgentPoolMode : - 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) || "System".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'System'", "System", global::System.Management.Automation.CompletionResultType.ParameterValue, "System"); - } - 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) || "NotApplicable".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'NotApplicable'", "NotApplicable", global::System.Management.Automation.CompletionResultType.ParameterValue, "NotApplicable"); - } - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/AgentPoolMode.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/AgentPoolMode.TypeConverter.cs deleted file mode 100644 index c417d3eb4311..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/AgentPoolMode.TypeConverter.cs +++ /dev/null @@ -1,63 +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.NetworkCloud.Support -{ - - /// - /// The selection of how this agent pool is utilized, either as a system pool or a user pool. System pools run the features - /// and critical services for the Kubernetes Cluster, while user pools are dedicated to user workloads. Every Kubernetes cluster - /// must contain at least one system node pool with at least one node. - /// - public partial class AgentPoolModeTypeConverter : - 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) => AgentPoolMode.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/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/AgentPoolMode.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/AgentPoolMode.cs deleted file mode 100644 index f0b76dcd5623..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/AgentPoolMode.cs +++ /dev/null @@ -1,104 +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.NetworkCloud.Support -{ - - /// - /// The selection of how this agent pool is utilized, either as a system pool or a user pool. System pools run the features - /// and critical services for the Kubernetes Cluster, while user pools are dedicated to user workloads. Every Kubernetes cluster - /// must contain at least one system node pool with at least one node. - /// - public partial struct AgentPoolMode : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.AgentPoolMode NotApplicable = @"NotApplicable"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.AgentPoolMode System = @"System"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.AgentPoolMode User = @"User"; - - /// 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 AgentPoolMode(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Conversion from arbitrary object to AgentPoolMode - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new AgentPoolMode(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type AgentPoolMode - /// 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.NetworkCloud.Support.AgentPoolMode e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type AgentPoolMode (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 AgentPoolMode && Equals((AgentPoolMode)obj); - } - - /// Returns hashCode for enum AgentPoolMode - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Returns string representation for AgentPoolMode - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to AgentPoolMode - /// the value to convert to an instance of . - - public static implicit operator AgentPoolMode(string value) - { - return new AgentPoolMode(value); - } - - /// Implicit operator to convert AgentPoolMode to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.AgentPoolMode e) - { - return e._value; - } - - /// Overriding != operator for enum AgentPoolMode - /// 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.NetworkCloud.Support.AgentPoolMode e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.AgentPoolMode e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum AgentPoolMode - /// 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.NetworkCloud.Support.AgentPoolMode e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.AgentPoolMode e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/AgentPoolProvisioningState.Completer.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/AgentPoolProvisioningState.Completer.cs deleted file mode 100644 index 07ae44e73a06..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/AgentPoolProvisioningState.Completer.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.NetworkCloud.Support -{ - - /// The provisioning state of the agent pool. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.AgentPoolProvisioningStateTypeConverter))] - public partial struct AgentPoolProvisioningState : - 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) || "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) || "Deleting".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Deleting'", "Deleting", global::System.Management.Automation.CompletionResultType.ParameterValue, "Deleting"); - } - 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) || "InProgress".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'InProgress'", "InProgress", global::System.Management.Automation.CompletionResultType.ParameterValue, "InProgress"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Succeeded".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Succeeded'", "Succeeded", global::System.Management.Automation.CompletionResultType.ParameterValue, "Succeeded"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Updating".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Updating'", "Updating", global::System.Management.Automation.CompletionResultType.ParameterValue, "Updating"); - } - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/AgentPoolProvisioningState.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/AgentPoolProvisioningState.TypeConverter.cs deleted file mode 100644 index 8bf422cce4c4..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/AgentPoolProvisioningState.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.NetworkCloud.Support -{ - - /// The provisioning state of the agent pool. - public partial class AgentPoolProvisioningStateTypeConverter : - 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) => AgentPoolProvisioningState.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/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/AgentPoolProvisioningState.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/AgentPoolProvisioningState.cs deleted file mode 100644 index b3d763f3b07d..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/AgentPoolProvisioningState.cs +++ /dev/null @@ -1,110 +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.NetworkCloud.Support -{ - - /// The provisioning state of the agent pool. - public partial struct AgentPoolProvisioningState : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.AgentPoolProvisioningState Accepted = @"Accepted"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.AgentPoolProvisioningState Canceled = @"Canceled"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.AgentPoolProvisioningState Deleting = @"Deleting"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.AgentPoolProvisioningState Failed = @"Failed"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.AgentPoolProvisioningState InProgress = @"InProgress"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.AgentPoolProvisioningState Succeeded = @"Succeeded"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.AgentPoolProvisioningState Updating = @"Updating"; - - /// - /// 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 AgentPoolProvisioningState(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Conversion from arbitrary object to AgentPoolProvisioningState - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new AgentPoolProvisioningState(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type AgentPoolProvisioningState - /// 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.NetworkCloud.Support.AgentPoolProvisioningState e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type AgentPoolProvisioningState (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 AgentPoolProvisioningState && Equals((AgentPoolProvisioningState)obj); - } - - /// Returns hashCode for enum AgentPoolProvisioningState - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Returns string representation for AgentPoolProvisioningState - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to AgentPoolProvisioningState - /// the value to convert to an instance of . - - public static implicit operator AgentPoolProvisioningState(string value) - { - return new AgentPoolProvisioningState(value); - } - - /// Implicit operator to convert AgentPoolProvisioningState to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.AgentPoolProvisioningState e) - { - return e._value; - } - - /// Overriding != operator for enum AgentPoolProvisioningState - /// 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.NetworkCloud.Support.AgentPoolProvisioningState e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.AgentPoolProvisioningState e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum AgentPoolProvisioningState - /// 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.NetworkCloud.Support.AgentPoolProvisioningState e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.AgentPoolProvisioningState e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/AvailabilityLifecycle.Completer.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/AvailabilityLifecycle.Completer.cs deleted file mode 100644 index 5c570acfd100..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/AvailabilityLifecycle.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.NetworkCloud.Support -{ - - /// The version lifecycle indicator. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.AvailabilityLifecycleTypeConverter))] - public partial struct AvailabilityLifecycle : - 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) || "Preview".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Preview'", "Preview", global::System.Management.Automation.CompletionResultType.ParameterValue, "Preview"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "GenerallyAvailable".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'GenerallyAvailable'", "GenerallyAvailable", global::System.Management.Automation.CompletionResultType.ParameterValue, "GenerallyAvailable"); - } - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/AvailabilityLifecycle.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/AvailabilityLifecycle.TypeConverter.cs deleted file mode 100644 index 3aefa7b2d131..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/AvailabilityLifecycle.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.NetworkCloud.Support -{ - - /// The version lifecycle indicator. - public partial class AvailabilityLifecycleTypeConverter : - 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) => AvailabilityLifecycle.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/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/AvailabilityLifecycle.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/AvailabilityLifecycle.cs deleted file mode 100644 index 7e81c8cbeb71..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/AvailabilityLifecycle.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.NetworkCloud.Support -{ - - /// The version lifecycle indicator. - public partial struct AvailabilityLifecycle : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.AvailabilityLifecycle GenerallyAvailable = @"GenerallyAvailable"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.AvailabilityLifecycle Preview = @"Preview"; - - /// 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 AvailabilityLifecycle(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Conversion from arbitrary object to AvailabilityLifecycle - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new AvailabilityLifecycle(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type AvailabilityLifecycle - /// 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.NetworkCloud.Support.AvailabilityLifecycle e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type AvailabilityLifecycle (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 AvailabilityLifecycle && Equals((AvailabilityLifecycle)obj); - } - - /// Returns hashCode for enum AvailabilityLifecycle - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Returns string representation for AvailabilityLifecycle - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to AvailabilityLifecycle - /// the value to convert to an instance of . - - public static implicit operator AvailabilityLifecycle(string value) - { - return new AvailabilityLifecycle(value); - } - - /// Implicit operator to convert AvailabilityLifecycle to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.AvailabilityLifecycle e) - { - return e._value; - } - - /// Overriding != operator for enum AvailabilityLifecycle - /// 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.NetworkCloud.Support.AvailabilityLifecycle e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.AvailabilityLifecycle e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum AvailabilityLifecycle - /// 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.NetworkCloud.Support.AvailabilityLifecycle e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.AvailabilityLifecycle e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/BareMetalMachineCordonStatus.Completer.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/BareMetalMachineCordonStatus.Completer.cs deleted file mode 100644 index c04f13242023..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/BareMetalMachineCordonStatus.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.NetworkCloud.Support -{ - - /// The cordon status of the bare metal machine. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineCordonStatusTypeConverter))] - public partial struct BareMetalMachineCordonStatus : - 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) || "Cordoned".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Cordoned'", "Cordoned", global::System.Management.Automation.CompletionResultType.ParameterValue, "Cordoned"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Uncordoned".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Uncordoned'", "Uncordoned", global::System.Management.Automation.CompletionResultType.ParameterValue, "Uncordoned"); - } - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/BareMetalMachineCordonStatus.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/BareMetalMachineCordonStatus.TypeConverter.cs deleted file mode 100644 index d86a0c70bb66..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/BareMetalMachineCordonStatus.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.NetworkCloud.Support -{ - - /// The cordon status of the bare metal machine. - public partial class BareMetalMachineCordonStatusTypeConverter : - 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) => BareMetalMachineCordonStatus.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/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/BareMetalMachineCordonStatus.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/BareMetalMachineCordonStatus.cs deleted file mode 100644 index 028e0af59133..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/BareMetalMachineCordonStatus.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.NetworkCloud.Support -{ - - /// The cordon status of the bare metal machine. - public partial struct BareMetalMachineCordonStatus : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineCordonStatus Cordoned = @"Cordoned"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineCordonStatus Uncordoned = @"Uncordoned"; - - /// - /// 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 BareMetalMachineCordonStatus(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Conversion from arbitrary object to BareMetalMachineCordonStatus - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new BareMetalMachineCordonStatus(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type BareMetalMachineCordonStatus - /// 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.NetworkCloud.Support.BareMetalMachineCordonStatus e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type BareMetalMachineCordonStatus (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 BareMetalMachineCordonStatus && Equals((BareMetalMachineCordonStatus)obj); - } - - /// Returns hashCode for enum BareMetalMachineCordonStatus - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Returns string representation for BareMetalMachineCordonStatus - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to BareMetalMachineCordonStatus - /// the value to convert to an instance of . - - public static implicit operator BareMetalMachineCordonStatus(string value) - { - return new BareMetalMachineCordonStatus(value); - } - - /// Implicit operator to convert BareMetalMachineCordonStatus to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineCordonStatus e) - { - return e._value; - } - - /// Overriding != operator for enum BareMetalMachineCordonStatus - /// 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.NetworkCloud.Support.BareMetalMachineCordonStatus e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineCordonStatus e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum BareMetalMachineCordonStatus - /// 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.NetworkCloud.Support.BareMetalMachineCordonStatus e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineCordonStatus e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/BareMetalMachineDetailedStatus.Completer.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/BareMetalMachineDetailedStatus.Completer.cs deleted file mode 100644 index 3bfa0cb19dca..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/BareMetalMachineDetailedStatus.Completer.cs +++ /dev/null @@ -1,55 +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.NetworkCloud.Support -{ - - /// The more detailed status of the bare metal machine. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineDetailedStatusTypeConverter))] - public partial struct BareMetalMachineDetailedStatus : - 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) || "Preparing".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Preparing'", "Preparing", global::System.Management.Automation.CompletionResultType.ParameterValue, "Preparing"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Error".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Error'", "Error", global::System.Management.Automation.CompletionResultType.ParameterValue, "Error"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Available".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Available'", "Available", global::System.Management.Automation.CompletionResultType.ParameterValue, "Available"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Provisioning".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Provisioning'", "Provisioning", global::System.Management.Automation.CompletionResultType.ParameterValue, "Provisioning"); - } - 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) || "Deprovisioning".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Deprovisioning'", "Deprovisioning", global::System.Management.Automation.CompletionResultType.ParameterValue, "Deprovisioning"); - } - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/BareMetalMachineDetailedStatus.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/BareMetalMachineDetailedStatus.TypeConverter.cs deleted file mode 100644 index 2994382ad3ef..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/BareMetalMachineDetailedStatus.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.NetworkCloud.Support -{ - - /// The more detailed status of the bare metal machine. - public partial class BareMetalMachineDetailedStatusTypeConverter : - 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) => BareMetalMachineDetailedStatus.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/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/BareMetalMachineDetailedStatus.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/BareMetalMachineDetailedStatus.cs deleted file mode 100644 index 924f7875b34f..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/BareMetalMachineDetailedStatus.cs +++ /dev/null @@ -1,112 +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.NetworkCloud.Support -{ - - /// The more detailed status of the bare metal machine. - public partial struct BareMetalMachineDetailedStatus : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineDetailedStatus Available = @"Available"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineDetailedStatus Deprovisioning = @"Deprovisioning"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineDetailedStatus Error = @"Error"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineDetailedStatus Preparing = @"Preparing"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineDetailedStatus Provisioned = @"Provisioned"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineDetailedStatus Provisioning = @"Provisioning"; - - /// - /// 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 BareMetalMachineDetailedStatus(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Conversion from arbitrary object to BareMetalMachineDetailedStatus - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new BareMetalMachineDetailedStatus(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type BareMetalMachineDetailedStatus - /// 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.NetworkCloud.Support.BareMetalMachineDetailedStatus e) - { - return _value.Equals(e._value); - } - - /// - /// Compares values of enum type BareMetalMachineDetailedStatus (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 BareMetalMachineDetailedStatus && Equals((BareMetalMachineDetailedStatus)obj); - } - - /// Returns hashCode for enum BareMetalMachineDetailedStatus - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Returns string representation for BareMetalMachineDetailedStatus - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to BareMetalMachineDetailedStatus - /// the value to convert to an instance of . - - public static implicit operator BareMetalMachineDetailedStatus(string value) - { - return new BareMetalMachineDetailedStatus(value); - } - - /// Implicit operator to convert BareMetalMachineDetailedStatus to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineDetailedStatus e) - { - return e._value; - } - - /// Overriding != operator for enum BareMetalMachineDetailedStatus - /// 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.NetworkCloud.Support.BareMetalMachineDetailedStatus e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineDetailedStatus e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum BareMetalMachineDetailedStatus - /// 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.NetworkCloud.Support.BareMetalMachineDetailedStatus e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineDetailedStatus e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/BareMetalMachineEvacuate.Completer.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/BareMetalMachineEvacuate.Completer.cs deleted file mode 100644 index cf82c36933a5..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/BareMetalMachineEvacuate.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.NetworkCloud.Support -{ - - /// - /// The indicator of whether to evacuate the node workload when the bare metal machine is cordoned. - /// - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineEvacuateTypeConverter))] - public partial struct BareMetalMachineEvacuate : - 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) || "True".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'True'", "True", global::System.Management.Automation.CompletionResultType.ParameterValue, "True"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "False".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'False'", "False", global::System.Management.Automation.CompletionResultType.ParameterValue, "False"); - } - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/BareMetalMachineEvacuate.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/BareMetalMachineEvacuate.TypeConverter.cs deleted file mode 100644 index 6feec4e4f9f3..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/BareMetalMachineEvacuate.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.NetworkCloud.Support -{ - - /// - /// The indicator of whether to evacuate the node workload when the bare metal machine is cordoned. - /// - public partial class BareMetalMachineEvacuateTypeConverter : - 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) => BareMetalMachineEvacuate.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/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/BareMetalMachineEvacuate.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/BareMetalMachineEvacuate.cs deleted file mode 100644 index 92243ffa3c81..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/BareMetalMachineEvacuate.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.NetworkCloud.Support -{ - - /// - /// The indicator of whether to evacuate the node workload when the bare metal machine is cordoned. - /// - public partial struct BareMetalMachineEvacuate : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineEvacuate False = @"False"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineEvacuate True = @"True"; - - /// 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 BareMetalMachineEvacuate(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Conversion from arbitrary object to BareMetalMachineEvacuate - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new BareMetalMachineEvacuate(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type BareMetalMachineEvacuate - /// 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.NetworkCloud.Support.BareMetalMachineEvacuate e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type BareMetalMachineEvacuate (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 BareMetalMachineEvacuate && Equals((BareMetalMachineEvacuate)obj); - } - - /// Returns hashCode for enum BareMetalMachineEvacuate - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Returns string representation for BareMetalMachineEvacuate - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to BareMetalMachineEvacuate - /// the value to convert to an instance of . - - public static implicit operator BareMetalMachineEvacuate(string value) - { - return new BareMetalMachineEvacuate(value); - } - - /// Implicit operator to convert BareMetalMachineEvacuate to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineEvacuate e) - { - return e._value; - } - - /// Overriding != operator for enum BareMetalMachineEvacuate - /// 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.NetworkCloud.Support.BareMetalMachineEvacuate e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineEvacuate e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum BareMetalMachineEvacuate - /// 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.NetworkCloud.Support.BareMetalMachineEvacuate e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineEvacuate e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/BareMetalMachineHardwareValidationResult.Completer.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/BareMetalMachineHardwareValidationResult.Completer.cs deleted file mode 100644 index 15bea754b923..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/BareMetalMachineHardwareValidationResult.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.NetworkCloud.Support -{ - - /// The outcome of the hardware validation. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineHardwareValidationResultTypeConverter))] - public partial struct BareMetalMachineHardwareValidationResult : - 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) || "Pass".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Pass'", "Pass", global::System.Management.Automation.CompletionResultType.ParameterValue, "Pass"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Fail".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Fail'", "Fail", global::System.Management.Automation.CompletionResultType.ParameterValue, "Fail"); - } - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/BareMetalMachineHardwareValidationResult.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/BareMetalMachineHardwareValidationResult.TypeConverter.cs deleted file mode 100644 index 99640790c61f..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/BareMetalMachineHardwareValidationResult.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.NetworkCloud.Support -{ - - /// The outcome of the hardware validation. - public partial class BareMetalMachineHardwareValidationResultTypeConverter : - 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) => BareMetalMachineHardwareValidationResult.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/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/BareMetalMachineHardwareValidationResult.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/BareMetalMachineHardwareValidationResult.cs deleted file mode 100644 index 32a149d31f10..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/BareMetalMachineHardwareValidationResult.cs +++ /dev/null @@ -1,104 +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.NetworkCloud.Support -{ - - /// The outcome of the hardware validation. - public partial struct BareMetalMachineHardwareValidationResult : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineHardwareValidationResult Fail = @"Fail"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineHardwareValidationResult Pass = @"Pass"; - - /// - /// 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 BareMetalMachineHardwareValidationResult(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Conversion from arbitrary object to BareMetalMachineHardwareValidationResult - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new BareMetalMachineHardwareValidationResult(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type BareMetalMachineHardwareValidationResult - /// 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.NetworkCloud.Support.BareMetalMachineHardwareValidationResult e) - { - return _value.Equals(e._value); - } - - /// - /// Compares values of enum type BareMetalMachineHardwareValidationResult (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 BareMetalMachineHardwareValidationResult && Equals((BareMetalMachineHardwareValidationResult)obj); - } - - /// Returns hashCode for enum BareMetalMachineHardwareValidationResult - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Returns string representation for BareMetalMachineHardwareValidationResult - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to BareMetalMachineHardwareValidationResult - /// the value to convert to an instance of . - - public static implicit operator BareMetalMachineHardwareValidationResult(string value) - { - return new BareMetalMachineHardwareValidationResult(value); - } - - /// Implicit operator to convert BareMetalMachineHardwareValidationResult to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineHardwareValidationResult e) - { - return e._value; - } - - /// Overriding != operator for enum BareMetalMachineHardwareValidationResult - /// 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.NetworkCloud.Support.BareMetalMachineHardwareValidationResult e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineHardwareValidationResult e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum BareMetalMachineHardwareValidationResult - /// 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.NetworkCloud.Support.BareMetalMachineHardwareValidationResult e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineHardwareValidationResult e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/BareMetalMachineKeySetDetailedStatus.Completer.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/BareMetalMachineKeySetDetailedStatus.Completer.cs deleted file mode 100644 index 032a76803b2e..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/BareMetalMachineKeySetDetailedStatus.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.NetworkCloud.Support -{ - - /// The more detailed status of the key set. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineKeySetDetailedStatusTypeConverter))] - public partial struct BareMetalMachineKeySetDetailedStatus : - 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) || "AllActive".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'AllActive'", "AllActive", global::System.Management.Automation.CompletionResultType.ParameterValue, "AllActive"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "SomeInvalid".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'SomeInvalid'", "SomeInvalid", global::System.Management.Automation.CompletionResultType.ParameterValue, "SomeInvalid"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "AllInvalid".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'AllInvalid'", "AllInvalid", global::System.Management.Automation.CompletionResultType.ParameterValue, "AllInvalid"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Validating".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Validating'", "Validating", global::System.Management.Automation.CompletionResultType.ParameterValue, "Validating"); - } - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/BareMetalMachineKeySetDetailedStatus.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/BareMetalMachineKeySetDetailedStatus.TypeConverter.cs deleted file mode 100644 index 9df705cd3797..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/BareMetalMachineKeySetDetailedStatus.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.NetworkCloud.Support -{ - - /// The more detailed status of the key set. - public partial class BareMetalMachineKeySetDetailedStatusTypeConverter : - 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) => BareMetalMachineKeySetDetailedStatus.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/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/BareMetalMachineKeySetDetailedStatus.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/BareMetalMachineKeySetDetailedStatus.cs deleted file mode 100644 index 82dea8238373..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/BareMetalMachineKeySetDetailedStatus.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.NetworkCloud.Support -{ - - /// The more detailed status of the key set. - public partial struct BareMetalMachineKeySetDetailedStatus : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineKeySetDetailedStatus AllActive = @"AllActive"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineKeySetDetailedStatus AllInvalid = @"AllInvalid"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineKeySetDetailedStatus SomeInvalid = @"SomeInvalid"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineKeySetDetailedStatus Validating = @"Validating"; - - /// - /// 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 BareMetalMachineKeySetDetailedStatus(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Conversion from arbitrary object to BareMetalMachineKeySetDetailedStatus - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new BareMetalMachineKeySetDetailedStatus(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type BareMetalMachineKeySetDetailedStatus - /// 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.NetworkCloud.Support.BareMetalMachineKeySetDetailedStatus e) - { - return _value.Equals(e._value); - } - - /// - /// Compares values of enum type BareMetalMachineKeySetDetailedStatus (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 BareMetalMachineKeySetDetailedStatus && Equals((BareMetalMachineKeySetDetailedStatus)obj); - } - - /// Returns hashCode for enum BareMetalMachineKeySetDetailedStatus - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Returns string representation for BareMetalMachineKeySetDetailedStatus - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to BareMetalMachineKeySetDetailedStatus - /// the value to convert to an instance of . - - public static implicit operator BareMetalMachineKeySetDetailedStatus(string value) - { - return new BareMetalMachineKeySetDetailedStatus(value); - } - - /// Implicit operator to convert BareMetalMachineKeySetDetailedStatus to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineKeySetDetailedStatus e) - { - return e._value; - } - - /// Overriding != operator for enum BareMetalMachineKeySetDetailedStatus - /// 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.NetworkCloud.Support.BareMetalMachineKeySetDetailedStatus e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineKeySetDetailedStatus e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum BareMetalMachineKeySetDetailedStatus - /// 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.NetworkCloud.Support.BareMetalMachineKeySetDetailedStatus e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineKeySetDetailedStatus e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/BareMetalMachineKeySetPrivilegeLevel.Completer.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/BareMetalMachineKeySetPrivilegeLevel.Completer.cs deleted file mode 100644 index 068aea00c421..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/BareMetalMachineKeySetPrivilegeLevel.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.NetworkCloud.Support -{ - - /// The access level allowed for the users in this key set. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineKeySetPrivilegeLevelTypeConverter))] - public partial struct BareMetalMachineKeySetPrivilegeLevel : - 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) || "Standard".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Standard'", "Standard", global::System.Management.Automation.CompletionResultType.ParameterValue, "Standard"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Superuser".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Superuser'", "Superuser", global::System.Management.Automation.CompletionResultType.ParameterValue, "Superuser"); - } - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/BareMetalMachineKeySetPrivilegeLevel.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/BareMetalMachineKeySetPrivilegeLevel.TypeConverter.cs deleted file mode 100644 index a9d57b23853d..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/BareMetalMachineKeySetPrivilegeLevel.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.NetworkCloud.Support -{ - - /// The access level allowed for the users in this key set. - public partial class BareMetalMachineKeySetPrivilegeLevelTypeConverter : - 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) => BareMetalMachineKeySetPrivilegeLevel.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/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/BareMetalMachineKeySetPrivilegeLevel.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/BareMetalMachineKeySetPrivilegeLevel.cs deleted file mode 100644 index afb124d4a361..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/BareMetalMachineKeySetPrivilegeLevel.cs +++ /dev/null @@ -1,104 +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.NetworkCloud.Support -{ - - /// The access level allowed for the users in this key set. - public partial struct BareMetalMachineKeySetPrivilegeLevel : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineKeySetPrivilegeLevel Standard = @"Standard"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineKeySetPrivilegeLevel Superuser = @"Superuser"; - - /// - /// 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 BareMetalMachineKeySetPrivilegeLevel(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Conversion from arbitrary object to BareMetalMachineKeySetPrivilegeLevel - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new BareMetalMachineKeySetPrivilegeLevel(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type BareMetalMachineKeySetPrivilegeLevel - /// 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.NetworkCloud.Support.BareMetalMachineKeySetPrivilegeLevel e) - { - return _value.Equals(e._value); - } - - /// - /// Compares values of enum type BareMetalMachineKeySetPrivilegeLevel (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 BareMetalMachineKeySetPrivilegeLevel && Equals((BareMetalMachineKeySetPrivilegeLevel)obj); - } - - /// Returns hashCode for enum BareMetalMachineKeySetPrivilegeLevel - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Returns string representation for BareMetalMachineKeySetPrivilegeLevel - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to BareMetalMachineKeySetPrivilegeLevel - /// the value to convert to an instance of . - - public static implicit operator BareMetalMachineKeySetPrivilegeLevel(string value) - { - return new BareMetalMachineKeySetPrivilegeLevel(value); - } - - /// Implicit operator to convert BareMetalMachineKeySetPrivilegeLevel to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineKeySetPrivilegeLevel e) - { - return e._value; - } - - /// Overriding != operator for enum BareMetalMachineKeySetPrivilegeLevel - /// 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.NetworkCloud.Support.BareMetalMachineKeySetPrivilegeLevel e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineKeySetPrivilegeLevel e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum BareMetalMachineKeySetPrivilegeLevel - /// 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.NetworkCloud.Support.BareMetalMachineKeySetPrivilegeLevel e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineKeySetPrivilegeLevel e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/BareMetalMachineKeySetProvisioningState.Completer.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/BareMetalMachineKeySetProvisioningState.Completer.cs deleted file mode 100644 index 5805cf8d1abf..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/BareMetalMachineKeySetProvisioningState.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.NetworkCloud.Support -{ - - /// The provisioning state of the bare metal machine key set. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineKeySetProvisioningStateTypeConverter))] - public partial struct BareMetalMachineKeySetProvisioningState : - 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) || "Succeeded".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Succeeded'", "Succeeded", global::System.Management.Automation.CompletionResultType.ParameterValue, "Succeeded"); - } - 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) || "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) || "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) || "Provisioning".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Provisioning'", "Provisioning", global::System.Management.Automation.CompletionResultType.ParameterValue, "Provisioning"); - } - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/BareMetalMachineKeySetProvisioningState.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/BareMetalMachineKeySetProvisioningState.TypeConverter.cs deleted file mode 100644 index d5958ecf7394..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/BareMetalMachineKeySetProvisioningState.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.NetworkCloud.Support -{ - - /// The provisioning state of the bare metal machine key set. - public partial class BareMetalMachineKeySetProvisioningStateTypeConverter : - 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) => BareMetalMachineKeySetProvisioningState.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/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/BareMetalMachineKeySetProvisioningState.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/BareMetalMachineKeySetProvisioningState.cs deleted file mode 100644 index 864e14734b3a..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/BareMetalMachineKeySetProvisioningState.cs +++ /dev/null @@ -1,110 +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.NetworkCloud.Support -{ - - /// The provisioning state of the bare metal machine key set. - public partial struct BareMetalMachineKeySetProvisioningState : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineKeySetProvisioningState Accepted = @"Accepted"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineKeySetProvisioningState Canceled = @"Canceled"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineKeySetProvisioningState Failed = @"Failed"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineKeySetProvisioningState Provisioning = @"Provisioning"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineKeySetProvisioningState Succeeded = @"Succeeded"; - - /// - /// the value for an instance of the Enum. - /// - private string _value { get; set; } - - /// - /// Creates an instance of the Enum class. - /// - /// the value to create an instance for. - private BareMetalMachineKeySetProvisioningState(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Conversion from arbitrary object to BareMetalMachineKeySetProvisioningState - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new BareMetalMachineKeySetProvisioningState(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type BareMetalMachineKeySetProvisioningState - /// 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.NetworkCloud.Support.BareMetalMachineKeySetProvisioningState e) - { - return _value.Equals(e._value); - } - - /// - /// Compares values of enum type BareMetalMachineKeySetProvisioningState (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 BareMetalMachineKeySetProvisioningState && Equals((BareMetalMachineKeySetProvisioningState)obj); - } - - /// Returns hashCode for enum BareMetalMachineKeySetProvisioningState - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Returns string representation for BareMetalMachineKeySetProvisioningState - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to BareMetalMachineKeySetProvisioningState - /// the value to convert to an instance of . - - public static implicit operator BareMetalMachineKeySetProvisioningState(string value) - { - return new BareMetalMachineKeySetProvisioningState(value); - } - - /// Implicit operator to convert BareMetalMachineKeySetProvisioningState to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineKeySetProvisioningState e) - { - return e._value; - } - - /// Overriding != operator for enum BareMetalMachineKeySetProvisioningState - /// 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.NetworkCloud.Support.BareMetalMachineKeySetProvisioningState e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineKeySetProvisioningState e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum BareMetalMachineKeySetProvisioningState - /// 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.NetworkCloud.Support.BareMetalMachineKeySetProvisioningState e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineKeySetProvisioningState e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/BareMetalMachineKeySetUserSetupStatus.Completer.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/BareMetalMachineKeySetUserSetupStatus.Completer.cs deleted file mode 100644 index 7d93af530aff..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/BareMetalMachineKeySetUserSetupStatus.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.NetworkCloud.Support -{ - - /// The indicator of whether the user is currently deployed for access. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineKeySetUserSetupStatusTypeConverter))] - public partial struct BareMetalMachineKeySetUserSetupStatus : - 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) || "Active".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Active'", "Active", global::System.Management.Automation.CompletionResultType.ParameterValue, "Active"); - } - 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"); - } - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/BareMetalMachineKeySetUserSetupStatus.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/BareMetalMachineKeySetUserSetupStatus.TypeConverter.cs deleted file mode 100644 index 2e36404b8060..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/BareMetalMachineKeySetUserSetupStatus.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.NetworkCloud.Support -{ - - /// The indicator of whether the user is currently deployed for access. - public partial class BareMetalMachineKeySetUserSetupStatusTypeConverter : - 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) => BareMetalMachineKeySetUserSetupStatus.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/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/BareMetalMachineKeySetUserSetupStatus.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/BareMetalMachineKeySetUserSetupStatus.cs deleted file mode 100644 index 88a4c43085fa..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/BareMetalMachineKeySetUserSetupStatus.cs +++ /dev/null @@ -1,104 +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.NetworkCloud.Support -{ - - /// The indicator of whether the user is currently deployed for access. - public partial struct BareMetalMachineKeySetUserSetupStatus : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineKeySetUserSetupStatus Active = @"Active"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineKeySetUserSetupStatus Invalid = @"Invalid"; - - /// - /// 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 BareMetalMachineKeySetUserSetupStatus(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Conversion from arbitrary object to BareMetalMachineKeySetUserSetupStatus - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new BareMetalMachineKeySetUserSetupStatus(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type BareMetalMachineKeySetUserSetupStatus - /// 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.NetworkCloud.Support.BareMetalMachineKeySetUserSetupStatus e) - { - return _value.Equals(e._value); - } - - /// - /// Compares values of enum type BareMetalMachineKeySetUserSetupStatus (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 BareMetalMachineKeySetUserSetupStatus && Equals((BareMetalMachineKeySetUserSetupStatus)obj); - } - - /// Returns hashCode for enum BareMetalMachineKeySetUserSetupStatus - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Returns string representation for BareMetalMachineKeySetUserSetupStatus - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to BareMetalMachineKeySetUserSetupStatus - /// the value to convert to an instance of . - - public static implicit operator BareMetalMachineKeySetUserSetupStatus(string value) - { - return new BareMetalMachineKeySetUserSetupStatus(value); - } - - /// Implicit operator to convert BareMetalMachineKeySetUserSetupStatus to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineKeySetUserSetupStatus e) - { - return e._value; - } - - /// Overriding != operator for enum BareMetalMachineKeySetUserSetupStatus - /// 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.NetworkCloud.Support.BareMetalMachineKeySetUserSetupStatus e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineKeySetUserSetupStatus e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum BareMetalMachineKeySetUserSetupStatus - /// 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.NetworkCloud.Support.BareMetalMachineKeySetUserSetupStatus e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineKeySetUserSetupStatus e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/BareMetalMachinePowerState.Completer.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/BareMetalMachinePowerState.Completer.cs deleted file mode 100644 index ef4acb1ca765..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/BareMetalMachinePowerState.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.NetworkCloud.Support -{ - - /// The power state derived from the baseboard management controller. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachinePowerStateTypeConverter))] - public partial struct BareMetalMachinePowerState : - 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) || "On".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'On'", "On", global::System.Management.Automation.CompletionResultType.ParameterValue, "On"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Off".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Off'", "Off", global::System.Management.Automation.CompletionResultType.ParameterValue, "Off"); - } - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/BareMetalMachinePowerState.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/BareMetalMachinePowerState.TypeConverter.cs deleted file mode 100644 index 90947374ff3b..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/BareMetalMachinePowerState.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.NetworkCloud.Support -{ - - /// The power state derived from the baseboard management controller. - public partial class BareMetalMachinePowerStateTypeConverter : - 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) => BareMetalMachinePowerState.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/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/BareMetalMachinePowerState.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/BareMetalMachinePowerState.cs deleted file mode 100644 index 11d6bfeb40ce..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/BareMetalMachinePowerState.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.NetworkCloud.Support -{ - - /// The power state derived from the baseboard management controller. - public partial struct BareMetalMachinePowerState : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachinePowerState Off = @"Off"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachinePowerState On = @"On"; - - /// - /// 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 BareMetalMachinePowerState(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Conversion from arbitrary object to BareMetalMachinePowerState - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new BareMetalMachinePowerState(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type BareMetalMachinePowerState - /// 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.NetworkCloud.Support.BareMetalMachinePowerState e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type BareMetalMachinePowerState (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 BareMetalMachinePowerState && Equals((BareMetalMachinePowerState)obj); - } - - /// Returns hashCode for enum BareMetalMachinePowerState - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Returns string representation for BareMetalMachinePowerState - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to BareMetalMachinePowerState - /// the value to convert to an instance of . - - public static implicit operator BareMetalMachinePowerState(string value) - { - return new BareMetalMachinePowerState(value); - } - - /// Implicit operator to convert BareMetalMachinePowerState to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachinePowerState e) - { - return e._value; - } - - /// Overriding != operator for enum BareMetalMachinePowerState - /// 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.NetworkCloud.Support.BareMetalMachinePowerState e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachinePowerState e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum BareMetalMachinePowerState - /// 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.NetworkCloud.Support.BareMetalMachinePowerState e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachinePowerState e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/BareMetalMachineProvisioningState.Completer.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/BareMetalMachineProvisioningState.Completer.cs deleted file mode 100644 index c5071b21ab25..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/BareMetalMachineProvisioningState.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.NetworkCloud.Support -{ - - /// The provisioning state of the bare metal machine. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineProvisioningStateTypeConverter))] - public partial struct BareMetalMachineProvisioningState : - 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) || "Succeeded".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Succeeded'", "Succeeded", global::System.Management.Automation.CompletionResultType.ParameterValue, "Succeeded"); - } - 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) || "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) || "Provisioning".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Provisioning'", "Provisioning", global::System.Management.Automation.CompletionResultType.ParameterValue, "Provisioning"); - } - 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"); - } - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/BareMetalMachineProvisioningState.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/BareMetalMachineProvisioningState.TypeConverter.cs deleted file mode 100644 index a74695951ec2..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/BareMetalMachineProvisioningState.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.NetworkCloud.Support -{ - - /// The provisioning state of the bare metal machine. - public partial class BareMetalMachineProvisioningStateTypeConverter : - 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) => BareMetalMachineProvisioningState.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/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/BareMetalMachineProvisioningState.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/BareMetalMachineProvisioningState.cs deleted file mode 100644 index 50a4bdcc4041..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/BareMetalMachineProvisioningState.cs +++ /dev/null @@ -1,110 +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.NetworkCloud.Support -{ - - /// The provisioning state of the bare metal machine. - public partial struct BareMetalMachineProvisioningState : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineProvisioningState Accepted = @"Accepted"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineProvisioningState Canceled = @"Canceled"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineProvisioningState Failed = @"Failed"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineProvisioningState Provisioning = @"Provisioning"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineProvisioningState Succeeded = @"Succeeded"; - - /// - /// the value for an instance of the Enum. - /// - private string _value { get; set; } - - /// - /// Creates an instance of the Enum class. - /// - /// the value to create an instance for. - private BareMetalMachineProvisioningState(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Conversion from arbitrary object to BareMetalMachineProvisioningState - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new BareMetalMachineProvisioningState(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type BareMetalMachineProvisioningState - /// 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.NetworkCloud.Support.BareMetalMachineProvisioningState e) - { - return _value.Equals(e._value); - } - - /// - /// Compares values of enum type BareMetalMachineProvisioningState (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 BareMetalMachineProvisioningState && Equals((BareMetalMachineProvisioningState)obj); - } - - /// Returns hashCode for enum BareMetalMachineProvisioningState - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Returns string representation for BareMetalMachineProvisioningState - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to BareMetalMachineProvisioningState - /// the value to convert to an instance of . - - public static implicit operator BareMetalMachineProvisioningState(string value) - { - return new BareMetalMachineProvisioningState(value); - } - - /// Implicit operator to convert BareMetalMachineProvisioningState to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineProvisioningState e) - { - return e._value; - } - - /// Overriding != operator for enum BareMetalMachineProvisioningState - /// 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.NetworkCloud.Support.BareMetalMachineProvisioningState e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineProvisioningState e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum BareMetalMachineProvisioningState - /// 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.NetworkCloud.Support.BareMetalMachineProvisioningState e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineProvisioningState e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/BareMetalMachineReadyState.Completer.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/BareMetalMachineReadyState.Completer.cs deleted file mode 100644 index fee0fb42cf62..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/BareMetalMachineReadyState.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.NetworkCloud.Support -{ - - /// The indicator of whether the bare metal machine is ready to receive workloads. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineReadyStateTypeConverter))] - public partial struct BareMetalMachineReadyState : - 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) || "True".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'True'", "True", global::System.Management.Automation.CompletionResultType.ParameterValue, "True"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "False".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'False'", "False", global::System.Management.Automation.CompletionResultType.ParameterValue, "False"); - } - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/BareMetalMachineReadyState.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/BareMetalMachineReadyState.TypeConverter.cs deleted file mode 100644 index b1864976a01b..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/BareMetalMachineReadyState.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.NetworkCloud.Support -{ - - /// The indicator of whether the bare metal machine is ready to receive workloads. - public partial class BareMetalMachineReadyStateTypeConverter : - 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) => BareMetalMachineReadyState.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/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/BareMetalMachineReadyState.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/BareMetalMachineReadyState.cs deleted file mode 100644 index c9179b7da6e9..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/BareMetalMachineReadyState.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.NetworkCloud.Support -{ - - /// The indicator of whether the bare metal machine is ready to receive workloads. - public partial struct BareMetalMachineReadyState : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineReadyState False = @"False"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineReadyState True = @"True"; - - /// - /// 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 BareMetalMachineReadyState(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Conversion from arbitrary object to BareMetalMachineReadyState - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new BareMetalMachineReadyState(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type BareMetalMachineReadyState - /// 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.NetworkCloud.Support.BareMetalMachineReadyState e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type BareMetalMachineReadyState (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 BareMetalMachineReadyState && Equals((BareMetalMachineReadyState)obj); - } - - /// Returns hashCode for enum BareMetalMachineReadyState - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Returns string representation for BareMetalMachineReadyState - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to BareMetalMachineReadyState - /// the value to convert to an instance of . - - public static implicit operator BareMetalMachineReadyState(string value) - { - return new BareMetalMachineReadyState(value); - } - - /// Implicit operator to convert BareMetalMachineReadyState to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineReadyState e) - { - return e._value; - } - - /// Overriding != operator for enum BareMetalMachineReadyState - /// 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.NetworkCloud.Support.BareMetalMachineReadyState e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineReadyState e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum BareMetalMachineReadyState - /// 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.NetworkCloud.Support.BareMetalMachineReadyState e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineReadyState e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/BareMetalMachineSkipShutdown.Completer.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/BareMetalMachineSkipShutdown.Completer.cs deleted file mode 100644 index 67619931b6ca..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/BareMetalMachineSkipShutdown.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.NetworkCloud.Support -{ - - /// - /// The indicator of whether to skip the graceful OS shutdown and power off the bare metal machine immediately. - /// - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineSkipShutdownTypeConverter))] - public partial struct BareMetalMachineSkipShutdown : - 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) || "True".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'True'", "True", global::System.Management.Automation.CompletionResultType.ParameterValue, "True"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "False".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'False'", "False", global::System.Management.Automation.CompletionResultType.ParameterValue, "False"); - } - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/BareMetalMachineSkipShutdown.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/BareMetalMachineSkipShutdown.TypeConverter.cs deleted file mode 100644 index 864eae0dd7aa..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/BareMetalMachineSkipShutdown.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.NetworkCloud.Support -{ - - /// - /// The indicator of whether to skip the graceful OS shutdown and power off the bare metal machine immediately. - /// - public partial class BareMetalMachineSkipShutdownTypeConverter : - 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) => BareMetalMachineSkipShutdown.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/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/BareMetalMachineSkipShutdown.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/BareMetalMachineSkipShutdown.cs deleted file mode 100644 index 8ecd2ccbe7e0..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/BareMetalMachineSkipShutdown.cs +++ /dev/null @@ -1,104 +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.NetworkCloud.Support -{ - - /// - /// The indicator of whether to skip the graceful OS shutdown and power off the bare metal machine immediately. - /// - public partial struct BareMetalMachineSkipShutdown : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineSkipShutdown False = @"False"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineSkipShutdown True = @"True"; - - /// - /// 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 BareMetalMachineSkipShutdown(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Conversion from arbitrary object to BareMetalMachineSkipShutdown - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new BareMetalMachineSkipShutdown(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type BareMetalMachineSkipShutdown - /// 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.NetworkCloud.Support.BareMetalMachineSkipShutdown e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type BareMetalMachineSkipShutdown (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 BareMetalMachineSkipShutdown && Equals((BareMetalMachineSkipShutdown)obj); - } - - /// Returns hashCode for enum BareMetalMachineSkipShutdown - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Returns string representation for BareMetalMachineSkipShutdown - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to BareMetalMachineSkipShutdown - /// the value to convert to an instance of . - - public static implicit operator BareMetalMachineSkipShutdown(string value) - { - return new BareMetalMachineSkipShutdown(value); - } - - /// Implicit operator to convert BareMetalMachineSkipShutdown to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineSkipShutdown e) - { - return e._value; - } - - /// Overriding != operator for enum BareMetalMachineSkipShutdown - /// 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.NetworkCloud.Support.BareMetalMachineSkipShutdown e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineSkipShutdown e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum BareMetalMachineSkipShutdown - /// 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.NetworkCloud.Support.BareMetalMachineSkipShutdown e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineSkipShutdown e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/BfdEnabled.Completer.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/BfdEnabled.Completer.cs deleted file mode 100644 index 7b8122d1a610..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/BfdEnabled.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.NetworkCloud.Support -{ - - /// The indicator to determine if automatic allocation from the pool should occur. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BfdEnabledTypeConverter))] - public partial struct BfdEnabled : - 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) || "True".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'True'", "True", global::System.Management.Automation.CompletionResultType.ParameterValue, "True"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "False".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'False'", "False", global::System.Management.Automation.CompletionResultType.ParameterValue, "False"); - } - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/BfdEnabled.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/BfdEnabled.TypeConverter.cs deleted file mode 100644 index d7d5dfb07291..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/BfdEnabled.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.NetworkCloud.Support -{ - - /// The indicator to determine if automatic allocation from the pool should occur. - public partial class BfdEnabledTypeConverter : - 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) => BfdEnabled.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/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/BfdEnabled.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/BfdEnabled.cs deleted file mode 100644 index 3ae8ec838bda..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/BfdEnabled.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.NetworkCloud.Support -{ - - /// The indicator to determine if automatic allocation from the pool should occur. - public partial struct BfdEnabled : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BfdEnabled False = @"False"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BfdEnabled True = @"True"; - - /// 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 BfdEnabled(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Conversion from arbitrary object to BfdEnabled - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new BfdEnabled(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type BfdEnabled - /// 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.NetworkCloud.Support.BfdEnabled e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type BfdEnabled (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 BfdEnabled && Equals((BfdEnabled)obj); - } - - /// Returns hashCode for enum BfdEnabled - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Returns string representation for BfdEnabled - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to BfdEnabled - /// the value to convert to an instance of . - - public static implicit operator BfdEnabled(string value) - { - return new BfdEnabled(value); - } - - /// Implicit operator to convert BfdEnabled to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BfdEnabled e) - { - return e._value; - } - - /// Overriding != operator for enum BfdEnabled - /// 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.NetworkCloud.Support.BfdEnabled e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BfdEnabled e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum BfdEnabled - /// 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.NetworkCloud.Support.BfdEnabled e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BfdEnabled e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/BgpMultiHop.Completer.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/BgpMultiHop.Completer.cs deleted file mode 100644 index a1537dd6c0c3..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/BgpMultiHop.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.NetworkCloud.Support -{ - - /// The indicator to enable multi-hop peering support. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BgpMultiHopTypeConverter))] - public partial struct BgpMultiHop : - 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) || "True".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'True'", "True", global::System.Management.Automation.CompletionResultType.ParameterValue, "True"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "False".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'False'", "False", global::System.Management.Automation.CompletionResultType.ParameterValue, "False"); - } - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/BgpMultiHop.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/BgpMultiHop.TypeConverter.cs deleted file mode 100644 index 3c5bcd267ebc..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/BgpMultiHop.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.NetworkCloud.Support -{ - - /// The indicator to enable multi-hop peering support. - public partial class BgpMultiHopTypeConverter : - 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) => BgpMultiHop.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/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/BgpMultiHop.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/BgpMultiHop.cs deleted file mode 100644 index a055c867e8a9..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/BgpMultiHop.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.NetworkCloud.Support -{ - - /// The indicator to enable multi-hop peering support. - public partial struct BgpMultiHop : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BgpMultiHop False = @"False"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BgpMultiHop True = @"True"; - - /// 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 BgpMultiHop(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Conversion from arbitrary object to BgpMultiHop - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new BgpMultiHop(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type BgpMultiHop - /// 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.NetworkCloud.Support.BgpMultiHop e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type BgpMultiHop (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 BgpMultiHop && Equals((BgpMultiHop)obj); - } - - /// Returns hashCode for enum BgpMultiHop - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Returns string representation for BgpMultiHop - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to BgpMultiHop - /// the value to convert to an instance of . - - public static implicit operator BgpMultiHop(string value) - { - return new BgpMultiHop(value); - } - - /// Implicit operator to convert BgpMultiHop to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BgpMultiHop e) - { - return e._value; - } - - /// Overriding != operator for enum BgpMultiHop - /// 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.NetworkCloud.Support.BgpMultiHop e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BgpMultiHop e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum BgpMultiHop - /// 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.NetworkCloud.Support.BgpMultiHop e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BgpMultiHop e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/BmcKeySetDetailedStatus.Completer.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/BmcKeySetDetailedStatus.Completer.cs deleted file mode 100644 index cf72d8b452bf..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/BmcKeySetDetailedStatus.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.NetworkCloud.Support -{ - - /// The more detailed status of the key set. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BmcKeySetDetailedStatusTypeConverter))] - public partial struct BmcKeySetDetailedStatus : - 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) || "AllActive".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'AllActive'", "AllActive", global::System.Management.Automation.CompletionResultType.ParameterValue, "AllActive"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "SomeInvalid".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'SomeInvalid'", "SomeInvalid", global::System.Management.Automation.CompletionResultType.ParameterValue, "SomeInvalid"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "AllInvalid".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'AllInvalid'", "AllInvalid", global::System.Management.Automation.CompletionResultType.ParameterValue, "AllInvalid"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Validating".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Validating'", "Validating", global::System.Management.Automation.CompletionResultType.ParameterValue, "Validating"); - } - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/BmcKeySetDetailedStatus.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/BmcKeySetDetailedStatus.TypeConverter.cs deleted file mode 100644 index ed55bfb7bc60..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/BmcKeySetDetailedStatus.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.NetworkCloud.Support -{ - - /// The more detailed status of the key set. - public partial class BmcKeySetDetailedStatusTypeConverter : - 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) => BmcKeySetDetailedStatus.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/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/BmcKeySetDetailedStatus.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/BmcKeySetDetailedStatus.cs deleted file mode 100644 index 3436952a843e..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/BmcKeySetDetailedStatus.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.NetworkCloud.Support -{ - - /// The more detailed status of the key set. - public partial struct BmcKeySetDetailedStatus : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BmcKeySetDetailedStatus AllActive = @"AllActive"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BmcKeySetDetailedStatus AllInvalid = @"AllInvalid"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BmcKeySetDetailedStatus SomeInvalid = @"SomeInvalid"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BmcKeySetDetailedStatus Validating = @"Validating"; - - /// 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 BmcKeySetDetailedStatus(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Conversion from arbitrary object to BmcKeySetDetailedStatus - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new BmcKeySetDetailedStatus(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type BmcKeySetDetailedStatus - /// 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.NetworkCloud.Support.BmcKeySetDetailedStatus e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type BmcKeySetDetailedStatus (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 BmcKeySetDetailedStatus && Equals((BmcKeySetDetailedStatus)obj); - } - - /// Returns hashCode for enum BmcKeySetDetailedStatus - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Returns string representation for BmcKeySetDetailedStatus - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to BmcKeySetDetailedStatus - /// the value to convert to an instance of . - - public static implicit operator BmcKeySetDetailedStatus(string value) - { - return new BmcKeySetDetailedStatus(value); - } - - /// Implicit operator to convert BmcKeySetDetailedStatus to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BmcKeySetDetailedStatus e) - { - return e._value; - } - - /// Overriding != operator for enum BmcKeySetDetailedStatus - /// 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.NetworkCloud.Support.BmcKeySetDetailedStatus e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BmcKeySetDetailedStatus e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum BmcKeySetDetailedStatus - /// 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.NetworkCloud.Support.BmcKeySetDetailedStatus e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BmcKeySetDetailedStatus e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/BmcKeySetPrivilegeLevel.Completer.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/BmcKeySetPrivilegeLevel.Completer.cs deleted file mode 100644 index 14688044f3da..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/BmcKeySetPrivilegeLevel.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.NetworkCloud.Support -{ - - /// The access level allowed for the users in this key set. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BmcKeySetPrivilegeLevelTypeConverter))] - public partial struct BmcKeySetPrivilegeLevel : - 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) || "ReadOnly".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'ReadOnly'", "ReadOnly", global::System.Management.Automation.CompletionResultType.ParameterValue, "ReadOnly"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Administrator".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Administrator'", "Administrator", global::System.Management.Automation.CompletionResultType.ParameterValue, "Administrator"); - } - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/BmcKeySetPrivilegeLevel.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/BmcKeySetPrivilegeLevel.TypeConverter.cs deleted file mode 100644 index 36ee32c48b46..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/BmcKeySetPrivilegeLevel.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.NetworkCloud.Support -{ - - /// The access level allowed for the users in this key set. - public partial class BmcKeySetPrivilegeLevelTypeConverter : - 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) => BmcKeySetPrivilegeLevel.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/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/BmcKeySetPrivilegeLevel.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/BmcKeySetPrivilegeLevel.cs deleted file mode 100644 index 4bf46b2481b1..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/BmcKeySetPrivilegeLevel.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.NetworkCloud.Support -{ - - /// The access level allowed for the users in this key set. - public partial struct BmcKeySetPrivilegeLevel : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BmcKeySetPrivilegeLevel Administrator = @"Administrator"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BmcKeySetPrivilegeLevel ReadOnly = @"ReadOnly"; - - /// 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 BmcKeySetPrivilegeLevel(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Conversion from arbitrary object to BmcKeySetPrivilegeLevel - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new BmcKeySetPrivilegeLevel(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type BmcKeySetPrivilegeLevel - /// 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.NetworkCloud.Support.BmcKeySetPrivilegeLevel e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type BmcKeySetPrivilegeLevel (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 BmcKeySetPrivilegeLevel && Equals((BmcKeySetPrivilegeLevel)obj); - } - - /// Returns hashCode for enum BmcKeySetPrivilegeLevel - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Returns string representation for BmcKeySetPrivilegeLevel - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to BmcKeySetPrivilegeLevel - /// the value to convert to an instance of . - - public static implicit operator BmcKeySetPrivilegeLevel(string value) - { - return new BmcKeySetPrivilegeLevel(value); - } - - /// Implicit operator to convert BmcKeySetPrivilegeLevel to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BmcKeySetPrivilegeLevel e) - { - return e._value; - } - - /// Overriding != operator for enum BmcKeySetPrivilegeLevel - /// 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.NetworkCloud.Support.BmcKeySetPrivilegeLevel e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BmcKeySetPrivilegeLevel e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum BmcKeySetPrivilegeLevel - /// 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.NetworkCloud.Support.BmcKeySetPrivilegeLevel e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BmcKeySetPrivilegeLevel e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/BmcKeySetProvisioningState.Completer.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/BmcKeySetProvisioningState.Completer.cs deleted file mode 100644 index b094af80a7ae..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/BmcKeySetProvisioningState.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.NetworkCloud.Support -{ - - /// The provisioning state of the baseboard management controller key set. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BmcKeySetProvisioningStateTypeConverter))] - public partial struct BmcKeySetProvisioningState : - 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) || "Succeeded".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Succeeded'", "Succeeded", global::System.Management.Automation.CompletionResultType.ParameterValue, "Succeeded"); - } - 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) || "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) || "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) || "Provisioning".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Provisioning'", "Provisioning", global::System.Management.Automation.CompletionResultType.ParameterValue, "Provisioning"); - } - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/BmcKeySetProvisioningState.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/BmcKeySetProvisioningState.TypeConverter.cs deleted file mode 100644 index f0b5380f1803..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/BmcKeySetProvisioningState.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.NetworkCloud.Support -{ - - /// The provisioning state of the baseboard management controller key set. - public partial class BmcKeySetProvisioningStateTypeConverter : - 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) => BmcKeySetProvisioningState.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/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/BmcKeySetProvisioningState.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/BmcKeySetProvisioningState.cs deleted file mode 100644 index fcf140c3774a..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/BmcKeySetProvisioningState.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.NetworkCloud.Support -{ - - /// The provisioning state of the baseboard management controller key set. - public partial struct BmcKeySetProvisioningState : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BmcKeySetProvisioningState Accepted = @"Accepted"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BmcKeySetProvisioningState Canceled = @"Canceled"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BmcKeySetProvisioningState Failed = @"Failed"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BmcKeySetProvisioningState Provisioning = @"Provisioning"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BmcKeySetProvisioningState Succeeded = @"Succeeded"; - - /// - /// the value for an instance of the Enum. - /// - private string _value { get; set; } - - /// Creates an instance of the Enum class. - /// the value to create an instance for. - private BmcKeySetProvisioningState(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Conversion from arbitrary object to BmcKeySetProvisioningState - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new BmcKeySetProvisioningState(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type BmcKeySetProvisioningState - /// 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.NetworkCloud.Support.BmcKeySetProvisioningState e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type BmcKeySetProvisioningState (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 BmcKeySetProvisioningState && Equals((BmcKeySetProvisioningState)obj); - } - - /// Returns hashCode for enum BmcKeySetProvisioningState - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Returns string representation for BmcKeySetProvisioningState - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to BmcKeySetProvisioningState - /// the value to convert to an instance of . - - public static implicit operator BmcKeySetProvisioningState(string value) - { - return new BmcKeySetProvisioningState(value); - } - - /// Implicit operator to convert BmcKeySetProvisioningState to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BmcKeySetProvisioningState e) - { - return e._value; - } - - /// Overriding != operator for enum BmcKeySetProvisioningState - /// 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.NetworkCloud.Support.BmcKeySetProvisioningState e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BmcKeySetProvisioningState e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum BmcKeySetProvisioningState - /// 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.NetworkCloud.Support.BmcKeySetProvisioningState e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BmcKeySetProvisioningState e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/BootstrapProtocol.Completer.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/BootstrapProtocol.Completer.cs deleted file mode 100644 index 53dbab861847..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/BootstrapProtocol.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.NetworkCloud.Support -{ - - /// The type of bootstrap protocol used. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BootstrapProtocolTypeConverter))] - public partial struct BootstrapProtocol : - 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) || "PXE".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'PXE'", "PXE", global::System.Management.Automation.CompletionResultType.ParameterValue, "PXE"); - } - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/BootstrapProtocol.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/BootstrapProtocol.TypeConverter.cs deleted file mode 100644 index 1457be6464b7..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/BootstrapProtocol.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.NetworkCloud.Support -{ - - /// The type of bootstrap protocol used. - public partial class BootstrapProtocolTypeConverter : - 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) => BootstrapProtocol.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/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/BootstrapProtocol.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/BootstrapProtocol.cs deleted file mode 100644 index 01981c17d389..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/BootstrapProtocol.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.NetworkCloud.Support -{ - - /// The type of bootstrap protocol used. - public partial struct BootstrapProtocol : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BootstrapProtocol Pxe = @"PXE"; - - /// 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 BootstrapProtocol(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Conversion from arbitrary object to BootstrapProtocol - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new BootstrapProtocol(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type BootstrapProtocol - /// 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.NetworkCloud.Support.BootstrapProtocol e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type BootstrapProtocol (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 BootstrapProtocol && Equals((BootstrapProtocol)obj); - } - - /// Returns hashCode for enum BootstrapProtocol - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Returns string representation for BootstrapProtocol - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to BootstrapProtocol - /// the value to convert to an instance of . - - public static implicit operator BootstrapProtocol(string value) - { - return new BootstrapProtocol(value); - } - - /// Implicit operator to convert BootstrapProtocol to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BootstrapProtocol e) - { - return e._value; - } - - /// Overriding != operator for enum BootstrapProtocol - /// 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.NetworkCloud.Support.BootstrapProtocol e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BootstrapProtocol e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum BootstrapProtocol - /// 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.NetworkCloud.Support.BootstrapProtocol e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BootstrapProtocol e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/CloudServicesNetworkDetailedStatus.Completer.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/CloudServicesNetworkDetailedStatus.Completer.cs deleted file mode 100644 index c8b0e85c8481..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/CloudServicesNetworkDetailedStatus.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.NetworkCloud.Support -{ - - /// The more detailed status of the cloud services network. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CloudServicesNetworkDetailedStatusTypeConverter))] - public partial struct CloudServicesNetworkDetailedStatus : - 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) || "Error".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Error'", "Error", global::System.Management.Automation.CompletionResultType.ParameterValue, "Error"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Available".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Available'", "Available", global::System.Management.Automation.CompletionResultType.ParameterValue, "Available"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Provisioning".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Provisioning'", "Provisioning", global::System.Management.Automation.CompletionResultType.ParameterValue, "Provisioning"); - } - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/CloudServicesNetworkDetailedStatus.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/CloudServicesNetworkDetailedStatus.TypeConverter.cs deleted file mode 100644 index 50723da1261e..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/CloudServicesNetworkDetailedStatus.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.NetworkCloud.Support -{ - - /// The more detailed status of the cloud services network. - public partial class CloudServicesNetworkDetailedStatusTypeConverter : - 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) => CloudServicesNetworkDetailedStatus.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/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/CloudServicesNetworkDetailedStatus.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/CloudServicesNetworkDetailedStatus.cs deleted file mode 100644 index dd3938248a53..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/CloudServicesNetworkDetailedStatus.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.NetworkCloud.Support -{ - - /// The more detailed status of the cloud services network. - public partial struct CloudServicesNetworkDetailedStatus : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CloudServicesNetworkDetailedStatus Available = @"Available"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CloudServicesNetworkDetailedStatus Error = @"Error"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CloudServicesNetworkDetailedStatus Provisioning = @"Provisioning"; - - /// - /// 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 CloudServicesNetworkDetailedStatus(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Conversion from arbitrary object to CloudServicesNetworkDetailedStatus - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new CloudServicesNetworkDetailedStatus(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type CloudServicesNetworkDetailedStatus - /// 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.NetworkCloud.Support.CloudServicesNetworkDetailedStatus e) - { - return _value.Equals(e._value); - } - - /// - /// Compares values of enum type CloudServicesNetworkDetailedStatus (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 CloudServicesNetworkDetailedStatus && Equals((CloudServicesNetworkDetailedStatus)obj); - } - - /// Returns hashCode for enum CloudServicesNetworkDetailedStatus - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Returns string representation for CloudServicesNetworkDetailedStatus - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to CloudServicesNetworkDetailedStatus - /// the value to convert to an instance of . - - public static implicit operator CloudServicesNetworkDetailedStatus(string value) - { - return new CloudServicesNetworkDetailedStatus(value); - } - - /// Implicit operator to convert CloudServicesNetworkDetailedStatus to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CloudServicesNetworkDetailedStatus e) - { - return e._value; - } - - /// Overriding != operator for enum CloudServicesNetworkDetailedStatus - /// 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.NetworkCloud.Support.CloudServicesNetworkDetailedStatus e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CloudServicesNetworkDetailedStatus e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum CloudServicesNetworkDetailedStatus - /// 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.NetworkCloud.Support.CloudServicesNetworkDetailedStatus e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CloudServicesNetworkDetailedStatus e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/CloudServicesNetworkEnableDefaultEgressEndpoints.Completer.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/CloudServicesNetworkEnableDefaultEgressEndpoints.Completer.cs deleted file mode 100644 index 8e3837852eaf..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/CloudServicesNetworkEnableDefaultEgressEndpoints.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.NetworkCloud.Support -{ - - /// - /// The indicator of whether the platform default endpoints are allowed for the egress traffic. - /// - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CloudServicesNetworkEnableDefaultEgressEndpointsTypeConverter))] - public partial struct CloudServicesNetworkEnableDefaultEgressEndpoints : - 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) || "True".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'True'", "True", global::System.Management.Automation.CompletionResultType.ParameterValue, "True"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "False".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'False'", "False", global::System.Management.Automation.CompletionResultType.ParameterValue, "False"); - } - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/CloudServicesNetworkEnableDefaultEgressEndpoints.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/CloudServicesNetworkEnableDefaultEgressEndpoints.TypeConverter.cs deleted file mode 100644 index a322155361c6..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/CloudServicesNetworkEnableDefaultEgressEndpoints.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.NetworkCloud.Support -{ - - /// - /// The indicator of whether the platform default endpoints are allowed for the egress traffic. - /// - public partial class CloudServicesNetworkEnableDefaultEgressEndpointsTypeConverter : - 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) => CloudServicesNetworkEnableDefaultEgressEndpoints.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/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/CloudServicesNetworkEnableDefaultEgressEndpoints.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/CloudServicesNetworkEnableDefaultEgressEndpoints.cs deleted file mode 100644 index da67cd9f3b38..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/CloudServicesNetworkEnableDefaultEgressEndpoints.cs +++ /dev/null @@ -1,120 +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.NetworkCloud.Support -{ - - /// - /// The indicator of whether the platform default endpoints are allowed for the egress traffic. - /// - public partial struct CloudServicesNetworkEnableDefaultEgressEndpoints : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CloudServicesNetworkEnableDefaultEgressEndpoints False = @"False"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CloudServicesNetworkEnableDefaultEgressEndpoints True = @"True"; - - /// - /// 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 CloudServicesNetworkEnableDefaultEgressEndpoints(string underlyingValue) - { - this._value = underlyingValue; - } - - /// - /// Conversion from arbitrary object to CloudServicesNetworkEnableDefaultEgressEndpoints - /// - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new CloudServicesNetworkEnableDefaultEgressEndpoints(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type CloudServicesNetworkEnableDefaultEgressEndpoints - /// 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.NetworkCloud.Support.CloudServicesNetworkEnableDefaultEgressEndpoints e) - { - return _value.Equals(e._value); - } - - /// - /// Compares values of enum type CloudServicesNetworkEnableDefaultEgressEndpoints (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 CloudServicesNetworkEnableDefaultEgressEndpoints && Equals((CloudServicesNetworkEnableDefaultEgressEndpoints)obj); - } - - /// Returns hashCode for enum CloudServicesNetworkEnableDefaultEgressEndpoints - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// - /// Returns string representation for CloudServicesNetworkEnableDefaultEgressEndpoints - /// - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// - /// Implicit operator to convert string to CloudServicesNetworkEnableDefaultEgressEndpoints - /// - /// the value to convert to an instance of . - - public static implicit operator CloudServicesNetworkEnableDefaultEgressEndpoints(string value) - { - return new CloudServicesNetworkEnableDefaultEgressEndpoints(value); - } - - /// - /// Implicit operator to convert CloudServicesNetworkEnableDefaultEgressEndpoints to string - /// - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CloudServicesNetworkEnableDefaultEgressEndpoints e) - { - return e._value; - } - - /// - /// Overriding != operator for enum CloudServicesNetworkEnableDefaultEgressEndpoints - /// - /// 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.NetworkCloud.Support.CloudServicesNetworkEnableDefaultEgressEndpoints e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CloudServicesNetworkEnableDefaultEgressEndpoints e2) - { - return !e2.Equals(e1); - } - - /// - /// Overriding == operator for enum CloudServicesNetworkEnableDefaultEgressEndpoints - /// - /// 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.NetworkCloud.Support.CloudServicesNetworkEnableDefaultEgressEndpoints e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CloudServicesNetworkEnableDefaultEgressEndpoints e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/CloudServicesNetworkProvisioningState.Completer.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/CloudServicesNetworkProvisioningState.Completer.cs deleted file mode 100644 index 41afc2a611f2..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/CloudServicesNetworkProvisioningState.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.NetworkCloud.Support -{ - - /// The provisioning state of the cloud services network. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CloudServicesNetworkProvisioningStateTypeConverter))] - public partial struct CloudServicesNetworkProvisioningState : - 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) || "Succeeded".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Succeeded'", "Succeeded", global::System.Management.Automation.CompletionResultType.ParameterValue, "Succeeded"); - } - 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) || "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) || "Provisioning".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Provisioning'", "Provisioning", global::System.Management.Automation.CompletionResultType.ParameterValue, "Provisioning"); - } - 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"); - } - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/CloudServicesNetworkProvisioningState.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/CloudServicesNetworkProvisioningState.TypeConverter.cs deleted file mode 100644 index 7a6dd00b7802..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/CloudServicesNetworkProvisioningState.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.NetworkCloud.Support -{ - - /// The provisioning state of the cloud services network. - public partial class CloudServicesNetworkProvisioningStateTypeConverter : - 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) => CloudServicesNetworkProvisioningState.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/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/CloudServicesNetworkProvisioningState.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/CloudServicesNetworkProvisioningState.cs deleted file mode 100644 index 99ef952f5c25..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/CloudServicesNetworkProvisioningState.cs +++ /dev/null @@ -1,110 +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.NetworkCloud.Support -{ - - /// The provisioning state of the cloud services network. - public partial struct CloudServicesNetworkProvisioningState : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CloudServicesNetworkProvisioningState Accepted = @"Accepted"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CloudServicesNetworkProvisioningState Canceled = @"Canceled"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CloudServicesNetworkProvisioningState Failed = @"Failed"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CloudServicesNetworkProvisioningState Provisioning = @"Provisioning"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CloudServicesNetworkProvisioningState Succeeded = @"Succeeded"; - - /// - /// the value for an instance of the Enum. - /// - private string _value { get; set; } - - /// - /// Creates an instance of the Enum class. - /// - /// the value to create an instance for. - private CloudServicesNetworkProvisioningState(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Conversion from arbitrary object to CloudServicesNetworkProvisioningState - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new CloudServicesNetworkProvisioningState(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type CloudServicesNetworkProvisioningState - /// 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.NetworkCloud.Support.CloudServicesNetworkProvisioningState e) - { - return _value.Equals(e._value); - } - - /// - /// Compares values of enum type CloudServicesNetworkProvisioningState (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 CloudServicesNetworkProvisioningState && Equals((CloudServicesNetworkProvisioningState)obj); - } - - /// Returns hashCode for enum CloudServicesNetworkProvisioningState - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Returns string representation for CloudServicesNetworkProvisioningState - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to CloudServicesNetworkProvisioningState - /// the value to convert to an instance of . - - public static implicit operator CloudServicesNetworkProvisioningState(string value) - { - return new CloudServicesNetworkProvisioningState(value); - } - - /// Implicit operator to convert CloudServicesNetworkProvisioningState to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CloudServicesNetworkProvisioningState e) - { - return e._value; - } - - /// Overriding != operator for enum CloudServicesNetworkProvisioningState - /// 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.NetworkCloud.Support.CloudServicesNetworkProvisioningState e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CloudServicesNetworkProvisioningState e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum CloudServicesNetworkProvisioningState - /// 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.NetworkCloud.Support.CloudServicesNetworkProvisioningState e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CloudServicesNetworkProvisioningState e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ClusterConnectionStatus.Completer.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ClusterConnectionStatus.Completer.cs deleted file mode 100644 index af49c50791fd..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ClusterConnectionStatus.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.NetworkCloud.Support -{ - - /// The latest heartbeat status between the cluster manager and the cluster. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterConnectionStatusTypeConverter))] - public partial struct ClusterConnectionStatus : - 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) || "Connected".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Connected'", "Connected", global::System.Management.Automation.CompletionResultType.ParameterValue, "Connected"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Disconnected".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Disconnected'", "Disconnected", global::System.Management.Automation.CompletionResultType.ParameterValue, "Disconnected"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Timeout".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Timeout'", "Timeout", global::System.Management.Automation.CompletionResultType.ParameterValue, "Timeout"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Undefined".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Undefined'", "Undefined", global::System.Management.Automation.CompletionResultType.ParameterValue, "Undefined"); - } - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ClusterConnectionStatus.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ClusterConnectionStatus.TypeConverter.cs deleted file mode 100644 index cd17a5328db4..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ClusterConnectionStatus.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.NetworkCloud.Support -{ - - /// The latest heartbeat status between the cluster manager and the cluster. - public partial class ClusterConnectionStatusTypeConverter : - 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) => ClusterConnectionStatus.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/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ClusterConnectionStatus.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ClusterConnectionStatus.cs deleted file mode 100644 index dfe22354b1eb..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ClusterConnectionStatus.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.NetworkCloud.Support -{ - - /// The latest heartbeat status between the cluster manager and the cluster. - public partial struct ClusterConnectionStatus : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterConnectionStatus Connected = @"Connected"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterConnectionStatus Disconnected = @"Disconnected"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterConnectionStatus Timeout = @"Timeout"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterConnectionStatus Undefined = @"Undefined"; - - /// 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 ClusterConnectionStatus(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Conversion from arbitrary object to ClusterConnectionStatus - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new ClusterConnectionStatus(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type ClusterConnectionStatus - /// 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.NetworkCloud.Support.ClusterConnectionStatus e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type ClusterConnectionStatus (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 ClusterConnectionStatus && Equals((ClusterConnectionStatus)obj); - } - - /// Returns hashCode for enum ClusterConnectionStatus - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Returns string representation for ClusterConnectionStatus - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to ClusterConnectionStatus - /// the value to convert to an instance of . - - public static implicit operator ClusterConnectionStatus(string value) - { - return new ClusterConnectionStatus(value); - } - - /// Implicit operator to convert ClusterConnectionStatus to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterConnectionStatus e) - { - return e._value; - } - - /// Overriding != operator for enum ClusterConnectionStatus - /// 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.NetworkCloud.Support.ClusterConnectionStatus e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterConnectionStatus e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum ClusterConnectionStatus - /// 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.NetworkCloud.Support.ClusterConnectionStatus e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterConnectionStatus e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ClusterContinueUpdateVersionMachineGroupTargetingMode.Completer.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ClusterContinueUpdateVersionMachineGroupTargetingMode.Completer.cs deleted file mode 100644 index a38e75ceba3f..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ClusterContinueUpdateVersionMachineGroupTargetingMode.Completer.cs +++ /dev/null @@ -1,37 +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.NetworkCloud.Support -{ - - /// - /// The mode by which the cluster will target the next grouping of servers to continue the update. - /// - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterContinueUpdateVersionMachineGroupTargetingModeTypeConverter))] - public partial struct ClusterContinueUpdateVersionMachineGroupTargetingMode : - 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) || "AlphaByRack".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'AlphaByRack'", "AlphaByRack", global::System.Management.Automation.CompletionResultType.ParameterValue, "AlphaByRack"); - } - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ClusterContinueUpdateVersionMachineGroupTargetingMode.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ClusterContinueUpdateVersionMachineGroupTargetingMode.TypeConverter.cs deleted file mode 100644 index bb877c70e0b8..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ClusterContinueUpdateVersionMachineGroupTargetingMode.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.NetworkCloud.Support -{ - - /// - /// The mode by which the cluster will target the next grouping of servers to continue the update. - /// - public partial class ClusterContinueUpdateVersionMachineGroupTargetingModeTypeConverter : - 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) => ClusterContinueUpdateVersionMachineGroupTargetingMode.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/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ClusterContinueUpdateVersionMachineGroupTargetingMode.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ClusterContinueUpdateVersionMachineGroupTargetingMode.cs deleted file mode 100644 index 3a0feb5ad1c3..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ClusterContinueUpdateVersionMachineGroupTargetingMode.cs +++ /dev/null @@ -1,121 +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.NetworkCloud.Support -{ - - /// - /// The mode by which the cluster will target the next grouping of servers to continue the update. - /// - public partial struct ClusterContinueUpdateVersionMachineGroupTargetingMode : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterContinueUpdateVersionMachineGroupTargetingMode AlphaByRack = @"AlphaByRack"; - - /// - /// 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 ClusterContinueUpdateVersionMachineGroupTargetingMode(string underlyingValue) - { - this._value = underlyingValue; - } - - /// - /// Conversion from arbitrary object to ClusterContinueUpdateVersionMachineGroupTargetingMode - /// - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new ClusterContinueUpdateVersionMachineGroupTargetingMode(global::System.Convert.ToString(value)); - } - - /// - /// Compares values of enum type ClusterContinueUpdateVersionMachineGroupTargetingMode - /// - /// 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.NetworkCloud.Support.ClusterContinueUpdateVersionMachineGroupTargetingMode e) - { - return _value.Equals(e._value); - } - - /// - /// Compares values of enum type ClusterContinueUpdateVersionMachineGroupTargetingMode (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 ClusterContinueUpdateVersionMachineGroupTargetingMode && Equals((ClusterContinueUpdateVersionMachineGroupTargetingMode)obj); - } - - /// Returns hashCode for enum ClusterContinueUpdateVersionMachineGroupTargetingMode - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// - /// Returns string representation for ClusterContinueUpdateVersionMachineGroupTargetingMode - /// - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// - /// Implicit operator to convert string to ClusterContinueUpdateVersionMachineGroupTargetingMode - /// - /// the value to convert to an instance of . - - public static implicit operator ClusterContinueUpdateVersionMachineGroupTargetingMode(string value) - { - return new ClusterContinueUpdateVersionMachineGroupTargetingMode(value); - } - - /// - /// Implicit operator to convert ClusterContinueUpdateVersionMachineGroupTargetingMode to string - /// - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterContinueUpdateVersionMachineGroupTargetingMode e) - { - return e._value; - } - - /// - /// Overriding != operator for enum ClusterContinueUpdateVersionMachineGroupTargetingMode - /// - /// 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.NetworkCloud.Support.ClusterContinueUpdateVersionMachineGroupTargetingMode e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterContinueUpdateVersionMachineGroupTargetingMode e2) - { - return !e2.Equals(e1); - } - - /// - /// Overriding == operator for enum ClusterContinueUpdateVersionMachineGroupTargetingMode - /// - /// 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.NetworkCloud.Support.ClusterContinueUpdateVersionMachineGroupTargetingMode e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterContinueUpdateVersionMachineGroupTargetingMode e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ClusterDetailedStatus.Completer.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ClusterDetailedStatus.Completer.cs deleted file mode 100644 index 0b168a1a5a41..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ClusterDetailedStatus.Completer.cs +++ /dev/null @@ -1,67 +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.NetworkCloud.Support -{ - - /// The current detailed status of the cluster. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterDetailedStatusTypeConverter))] - public partial struct ClusterDetailedStatus : - 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) || "PendingDeployment".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'PendingDeployment'", "PendingDeployment", global::System.Management.Automation.CompletionResultType.ParameterValue, "PendingDeployment"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Deploying".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Deploying'", "Deploying", global::System.Management.Automation.CompletionResultType.ParameterValue, "Deploying"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Running".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Running'", "Running", global::System.Management.Automation.CompletionResultType.ParameterValue, "Running"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Updating".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Updating'", "Updating", global::System.Management.Automation.CompletionResultType.ParameterValue, "Updating"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "UpdatePaused".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'UpdatePaused'", "UpdatePaused", global::System.Management.Automation.CompletionResultType.ParameterValue, "UpdatePaused"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Degraded".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Degraded'", "Degraded", global::System.Management.Automation.CompletionResultType.ParameterValue, "Degraded"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Deleting".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Deleting'", "Deleting", global::System.Management.Automation.CompletionResultType.ParameterValue, "Deleting"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Disconnected".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Disconnected'", "Disconnected", global::System.Management.Automation.CompletionResultType.ParameterValue, "Disconnected"); - } - 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"); - } - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ClusterDetailedStatus.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ClusterDetailedStatus.TypeConverter.cs deleted file mode 100644 index 55ed1f16bcb2..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ClusterDetailedStatus.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.NetworkCloud.Support -{ - - /// The current detailed status of the cluster. - public partial class ClusterDetailedStatusTypeConverter : - 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) => ClusterDetailedStatus.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/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ClusterDetailedStatus.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ClusterDetailedStatus.cs deleted file mode 100644 index b50a803d41f7..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ClusterDetailedStatus.cs +++ /dev/null @@ -1,112 +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.NetworkCloud.Support -{ - - /// The current detailed status of the cluster. - public partial struct ClusterDetailedStatus : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterDetailedStatus Degraded = @"Degraded"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterDetailedStatus Deleting = @"Deleting"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterDetailedStatus Deploying = @"Deploying"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterDetailedStatus Disconnected = @"Disconnected"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterDetailedStatus Failed = @"Failed"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterDetailedStatus PendingDeployment = @"PendingDeployment"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterDetailedStatus Running = @"Running"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterDetailedStatus UpdatePaused = @"UpdatePaused"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterDetailedStatus Updating = @"Updating"; - - /// 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 ClusterDetailedStatus(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Conversion from arbitrary object to ClusterDetailedStatus - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new ClusterDetailedStatus(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type ClusterDetailedStatus - /// 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.NetworkCloud.Support.ClusterDetailedStatus e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type ClusterDetailedStatus (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 ClusterDetailedStatus && Equals((ClusterDetailedStatus)obj); - } - - /// Returns hashCode for enum ClusterDetailedStatus - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Returns string representation for ClusterDetailedStatus - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to ClusterDetailedStatus - /// the value to convert to an instance of . - - public static implicit operator ClusterDetailedStatus(string value) - { - return new ClusterDetailedStatus(value); - } - - /// Implicit operator to convert ClusterDetailedStatus to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterDetailedStatus e) - { - return e._value; - } - - /// Overriding != operator for enum ClusterDetailedStatus - /// 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.NetworkCloud.Support.ClusterDetailedStatus e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterDetailedStatus e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum ClusterDetailedStatus - /// 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.NetworkCloud.Support.ClusterDetailedStatus e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterDetailedStatus e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ClusterManagerConnectionStatus.Completer.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ClusterManagerConnectionStatus.Completer.cs deleted file mode 100644 index 4c7ffb9ad7cd..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ClusterManagerConnectionStatus.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.NetworkCloud.Support -{ - - /// The latest connectivity status between cluster manager and the cluster. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterManagerConnectionStatusTypeConverter))] - public partial struct ClusterManagerConnectionStatus : - 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) || "Connected".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Connected'", "Connected", global::System.Management.Automation.CompletionResultType.ParameterValue, "Connected"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Unreachable".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Unreachable'", "Unreachable", global::System.Management.Automation.CompletionResultType.ParameterValue, "Unreachable"); - } - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ClusterManagerConnectionStatus.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ClusterManagerConnectionStatus.TypeConverter.cs deleted file mode 100644 index bd3ed39cdf71..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ClusterManagerConnectionStatus.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.NetworkCloud.Support -{ - - /// The latest connectivity status between cluster manager and the cluster. - public partial class ClusterManagerConnectionStatusTypeConverter : - 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) => ClusterManagerConnectionStatus.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/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ClusterManagerConnectionStatus.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ClusterManagerConnectionStatus.cs deleted file mode 100644 index 54a0a6289e6b..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ClusterManagerConnectionStatus.cs +++ /dev/null @@ -1,104 +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.NetworkCloud.Support -{ - - /// The latest connectivity status between cluster manager and the cluster. - public partial struct ClusterManagerConnectionStatus : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterManagerConnectionStatus Connected = @"Connected"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterManagerConnectionStatus Unreachable = @"Unreachable"; - - /// - /// 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 ClusterManagerConnectionStatus(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Conversion from arbitrary object to ClusterManagerConnectionStatus - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new ClusterManagerConnectionStatus(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type ClusterManagerConnectionStatus - /// 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.NetworkCloud.Support.ClusterManagerConnectionStatus e) - { - return _value.Equals(e._value); - } - - /// - /// Compares values of enum type ClusterManagerConnectionStatus (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 ClusterManagerConnectionStatus && Equals((ClusterManagerConnectionStatus)obj); - } - - /// Returns hashCode for enum ClusterManagerConnectionStatus - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Returns string representation for ClusterManagerConnectionStatus - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to ClusterManagerConnectionStatus - /// the value to convert to an instance of . - - public static implicit operator ClusterManagerConnectionStatus(string value) - { - return new ClusterManagerConnectionStatus(value); - } - - /// Implicit operator to convert ClusterManagerConnectionStatus to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterManagerConnectionStatus e) - { - return e._value; - } - - /// Overriding != operator for enum ClusterManagerConnectionStatus - /// 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.NetworkCloud.Support.ClusterManagerConnectionStatus e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterManagerConnectionStatus e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum ClusterManagerConnectionStatus - /// 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.NetworkCloud.Support.ClusterManagerConnectionStatus e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterManagerConnectionStatus e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ClusterManagerDetailedStatus.Completer.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ClusterManagerDetailedStatus.Completer.cs deleted file mode 100644 index 67fb66917581..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ClusterManagerDetailedStatus.Completer.cs +++ /dev/null @@ -1,57 +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.NetworkCloud.Support -{ - - /// - /// The detailed status that provides additional information about the cluster manager. - /// - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterManagerDetailedStatusTypeConverter))] - public partial struct ClusterManagerDetailedStatus : - 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) || "Error".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Error'", "Error", global::System.Management.Automation.CompletionResultType.ParameterValue, "Error"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Available".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Available'", "Available", global::System.Management.Automation.CompletionResultType.ParameterValue, "Available"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Provisioning".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Provisioning'", "Provisioning", global::System.Management.Automation.CompletionResultType.ParameterValue, "Provisioning"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "ProvisioningFailed".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'ProvisioningFailed'", "ProvisioningFailed", global::System.Management.Automation.CompletionResultType.ParameterValue, "ProvisioningFailed"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Updating".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Updating'", "Updating", global::System.Management.Automation.CompletionResultType.ParameterValue, "Updating"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "UpdateFailed".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'UpdateFailed'", "UpdateFailed", global::System.Management.Automation.CompletionResultType.ParameterValue, "UpdateFailed"); - } - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ClusterManagerDetailedStatus.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ClusterManagerDetailedStatus.TypeConverter.cs deleted file mode 100644 index c58d7676f909..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ClusterManagerDetailedStatus.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.NetworkCloud.Support -{ - - /// - /// The detailed status that provides additional information about the cluster manager. - /// - public partial class ClusterManagerDetailedStatusTypeConverter : - 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) => ClusterManagerDetailedStatus.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/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ClusterManagerDetailedStatus.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ClusterManagerDetailedStatus.cs deleted file mode 100644 index 3bab8606a848..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ClusterManagerDetailedStatus.cs +++ /dev/null @@ -1,112 +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.NetworkCloud.Support -{ - - /// - /// The detailed status that provides additional information about the cluster manager. - /// - public partial struct ClusterManagerDetailedStatus : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterManagerDetailedStatus Available = @"Available"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterManagerDetailedStatus Error = @"Error"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterManagerDetailedStatus Provisioning = @"Provisioning"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterManagerDetailedStatus ProvisioningFailed = @"ProvisioningFailed"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterManagerDetailedStatus UpdateFailed = @"UpdateFailed"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterManagerDetailedStatus Updating = @"Updating"; - - /// - /// 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 ClusterManagerDetailedStatus(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Conversion from arbitrary object to ClusterManagerDetailedStatus - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new ClusterManagerDetailedStatus(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type ClusterManagerDetailedStatus - /// 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.NetworkCloud.Support.ClusterManagerDetailedStatus e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type ClusterManagerDetailedStatus (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 ClusterManagerDetailedStatus && Equals((ClusterManagerDetailedStatus)obj); - } - - /// Returns hashCode for enum ClusterManagerDetailedStatus - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Returns string representation for ClusterManagerDetailedStatus - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to ClusterManagerDetailedStatus - /// the value to convert to an instance of . - - public static implicit operator ClusterManagerDetailedStatus(string value) - { - return new ClusterManagerDetailedStatus(value); - } - - /// Implicit operator to convert ClusterManagerDetailedStatus to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterManagerDetailedStatus e) - { - return e._value; - } - - /// Overriding != operator for enum ClusterManagerDetailedStatus - /// 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.NetworkCloud.Support.ClusterManagerDetailedStatus e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterManagerDetailedStatus e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum ClusterManagerDetailedStatus - /// 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.NetworkCloud.Support.ClusterManagerDetailedStatus e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterManagerDetailedStatus e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ClusterManagerProvisioningState.Completer.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ClusterManagerProvisioningState.Completer.cs deleted file mode 100644 index 94bcc6868e41..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ClusterManagerProvisioningState.Completer.cs +++ /dev/null @@ -1,55 +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.NetworkCloud.Support -{ - - /// The provisioning state of the cluster manager. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterManagerProvisioningStateTypeConverter))] - public partial struct ClusterManagerProvisioningState : - 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) || "Succeeded".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Succeeded'", "Succeeded", global::System.Management.Automation.CompletionResultType.ParameterValue, "Succeeded"); - } - 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) || "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) || "Provisioning".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Provisioning'", "Provisioning", global::System.Management.Automation.CompletionResultType.ParameterValue, "Provisioning"); - } - 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) || "Updating".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Updating'", "Updating", global::System.Management.Automation.CompletionResultType.ParameterValue, "Updating"); - } - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ClusterManagerProvisioningState.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ClusterManagerProvisioningState.TypeConverter.cs deleted file mode 100644 index 64685a51e4f7..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ClusterManagerProvisioningState.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.NetworkCloud.Support -{ - - /// The provisioning state of the cluster manager. - public partial class ClusterManagerProvisioningStateTypeConverter : - 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) => ClusterManagerProvisioningState.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/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ClusterManagerProvisioningState.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ClusterManagerProvisioningState.cs deleted file mode 100644 index f1ac59cc42e5..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ClusterManagerProvisioningState.cs +++ /dev/null @@ -1,112 +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.NetworkCloud.Support -{ - - /// The provisioning state of the cluster manager. - public partial struct ClusterManagerProvisioningState : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterManagerProvisioningState Accepted = @"Accepted"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterManagerProvisioningState Canceled = @"Canceled"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterManagerProvisioningState Failed = @"Failed"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterManagerProvisioningState Provisioning = @"Provisioning"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterManagerProvisioningState Succeeded = @"Succeeded"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterManagerProvisioningState Updating = @"Updating"; - - /// - /// 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 ClusterManagerProvisioningState(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Conversion from arbitrary object to ClusterManagerProvisioningState - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new ClusterManagerProvisioningState(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type ClusterManagerProvisioningState - /// 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.NetworkCloud.Support.ClusterManagerProvisioningState e) - { - return _value.Equals(e._value); - } - - /// - /// Compares values of enum type ClusterManagerProvisioningState (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 ClusterManagerProvisioningState && Equals((ClusterManagerProvisioningState)obj); - } - - /// Returns hashCode for enum ClusterManagerProvisioningState - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Returns string representation for ClusterManagerProvisioningState - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to ClusterManagerProvisioningState - /// the value to convert to an instance of . - - public static implicit operator ClusterManagerProvisioningState(string value) - { - return new ClusterManagerProvisioningState(value); - } - - /// Implicit operator to convert ClusterManagerProvisioningState to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterManagerProvisioningState e) - { - return e._value; - } - - /// Overriding != operator for enum ClusterManagerProvisioningState - /// 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.NetworkCloud.Support.ClusterManagerProvisioningState e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterManagerProvisioningState e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum ClusterManagerProvisioningState - /// 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.NetworkCloud.Support.ClusterManagerProvisioningState e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterManagerProvisioningState e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ClusterMetricsConfigurationDetailedStatus.Completer.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ClusterMetricsConfigurationDetailedStatus.Completer.cs deleted file mode 100644 index 25cb6e907682..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ClusterMetricsConfigurationDetailedStatus.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.NetworkCloud.Support -{ - - /// The more detailed status of the metrics configuration. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterMetricsConfigurationDetailedStatusTypeConverter))] - public partial struct ClusterMetricsConfigurationDetailedStatus : - 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) || "Processing".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Processing'", "Processing", global::System.Management.Automation.CompletionResultType.ParameterValue, "Processing"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Applied".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Applied'", "Applied", global::System.Management.Automation.CompletionResultType.ParameterValue, "Applied"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Error".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Error'", "Error", global::System.Management.Automation.CompletionResultType.ParameterValue, "Error"); - } - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ClusterMetricsConfigurationDetailedStatus.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ClusterMetricsConfigurationDetailedStatus.TypeConverter.cs deleted file mode 100644 index 644e6443389d..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ClusterMetricsConfigurationDetailedStatus.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.NetworkCloud.Support -{ - - /// The more detailed status of the metrics configuration. - public partial class ClusterMetricsConfigurationDetailedStatusTypeConverter : - 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) => ClusterMetricsConfigurationDetailedStatus.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/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ClusterMetricsConfigurationDetailedStatus.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ClusterMetricsConfigurationDetailedStatus.cs deleted file mode 100644 index 036e74196d41..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ClusterMetricsConfigurationDetailedStatus.cs +++ /dev/null @@ -1,110 +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.NetworkCloud.Support -{ - - /// The more detailed status of the metrics configuration. - public partial struct ClusterMetricsConfigurationDetailedStatus : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterMetricsConfigurationDetailedStatus Applied = @"Applied"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterMetricsConfigurationDetailedStatus Error = @"Error"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterMetricsConfigurationDetailedStatus Processing = @"Processing"; - - /// - /// 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 ClusterMetricsConfigurationDetailedStatus(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Conversion from arbitrary object to ClusterMetricsConfigurationDetailedStatus - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new ClusterMetricsConfigurationDetailedStatus(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type ClusterMetricsConfigurationDetailedStatus - /// 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.NetworkCloud.Support.ClusterMetricsConfigurationDetailedStatus e) - { - return _value.Equals(e._value); - } - - /// - /// Compares values of enum type ClusterMetricsConfigurationDetailedStatus (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 ClusterMetricsConfigurationDetailedStatus && Equals((ClusterMetricsConfigurationDetailedStatus)obj); - } - - /// Returns hashCode for enum ClusterMetricsConfigurationDetailedStatus - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Returns string representation for ClusterMetricsConfigurationDetailedStatus - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// - /// Implicit operator to convert string to ClusterMetricsConfigurationDetailedStatus - /// - /// the value to convert to an instance of . - - public static implicit operator ClusterMetricsConfigurationDetailedStatus(string value) - { - return new ClusterMetricsConfigurationDetailedStatus(value); - } - - /// - /// Implicit operator to convert ClusterMetricsConfigurationDetailedStatus to string - /// - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterMetricsConfigurationDetailedStatus e) - { - return e._value; - } - - /// Overriding != operator for enum ClusterMetricsConfigurationDetailedStatus - /// 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.NetworkCloud.Support.ClusterMetricsConfigurationDetailedStatus e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterMetricsConfigurationDetailedStatus e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum ClusterMetricsConfigurationDetailedStatus - /// 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.NetworkCloud.Support.ClusterMetricsConfigurationDetailedStatus e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterMetricsConfigurationDetailedStatus e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ClusterMetricsConfigurationProvisioningState.Completer.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ClusterMetricsConfigurationProvisioningState.Completer.cs deleted file mode 100644 index 9185feefdb52..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ClusterMetricsConfigurationProvisioningState.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.NetworkCloud.Support -{ - - /// The provisioning state of the metrics configuration. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterMetricsConfigurationProvisioningStateTypeConverter))] - public partial struct ClusterMetricsConfigurationProvisioningState : - 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) || "Succeeded".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Succeeded'", "Succeeded", global::System.Management.Automation.CompletionResultType.ParameterValue, "Succeeded"); - } - 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) || "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) || "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) || "Provisioning".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Provisioning'", "Provisioning", global::System.Management.Automation.CompletionResultType.ParameterValue, "Provisioning"); - } - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ClusterMetricsConfigurationProvisioningState.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ClusterMetricsConfigurationProvisioningState.TypeConverter.cs deleted file mode 100644 index 6cc23b2c9f7d..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ClusterMetricsConfigurationProvisioningState.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.NetworkCloud.Support -{ - - /// The provisioning state of the metrics configuration. - public partial class ClusterMetricsConfigurationProvisioningStateTypeConverter : - 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) => ClusterMetricsConfigurationProvisioningState.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/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ClusterMetricsConfigurationProvisioningState.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ClusterMetricsConfigurationProvisioningState.cs deleted file mode 100644 index ff48c2d5b180..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ClusterMetricsConfigurationProvisioningState.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.NetworkCloud.Support -{ - - /// The provisioning state of the metrics configuration. - public partial struct ClusterMetricsConfigurationProvisioningState : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterMetricsConfigurationProvisioningState Accepted = @"Accepted"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterMetricsConfigurationProvisioningState Canceled = @"Canceled"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterMetricsConfigurationProvisioningState Failed = @"Failed"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterMetricsConfigurationProvisioningState Provisioning = @"Provisioning"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterMetricsConfigurationProvisioningState Succeeded = @"Succeeded"; - - /// - /// the value for an instance of the Enum. - /// - private string _value { get; set; } - - /// - /// Creates an instance of the Enum class. - /// - /// the value to create an instance for. - private ClusterMetricsConfigurationProvisioningState(string underlyingValue) - { - this._value = underlyingValue; - } - - /// - /// Conversion from arbitrary object to ClusterMetricsConfigurationProvisioningState - /// - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new ClusterMetricsConfigurationProvisioningState(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type ClusterMetricsConfigurationProvisioningState - /// 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.NetworkCloud.Support.ClusterMetricsConfigurationProvisioningState e) - { - return _value.Equals(e._value); - } - - /// - /// Compares values of enum type ClusterMetricsConfigurationProvisioningState (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 ClusterMetricsConfigurationProvisioningState && Equals((ClusterMetricsConfigurationProvisioningState)obj); - } - - /// Returns hashCode for enum ClusterMetricsConfigurationProvisioningState - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Returns string representation for ClusterMetricsConfigurationProvisioningState - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// - /// Implicit operator to convert string to ClusterMetricsConfigurationProvisioningState - /// - /// the value to convert to an instance of . - - public static implicit operator ClusterMetricsConfigurationProvisioningState(string value) - { - return new ClusterMetricsConfigurationProvisioningState(value); - } - - /// - /// Implicit operator to convert ClusterMetricsConfigurationProvisioningState to string - /// - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterMetricsConfigurationProvisioningState e) - { - return e._value; - } - - /// Overriding != operator for enum ClusterMetricsConfigurationProvisioningState - /// 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.NetworkCloud.Support.ClusterMetricsConfigurationProvisioningState e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterMetricsConfigurationProvisioningState e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum ClusterMetricsConfigurationProvisioningState - /// 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.NetworkCloud.Support.ClusterMetricsConfigurationProvisioningState e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterMetricsConfigurationProvisioningState e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ClusterProvisioningState.Completer.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ClusterProvisioningState.Completer.cs deleted file mode 100644 index 93f9ff2fba84..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ClusterProvisioningState.Completer.cs +++ /dev/null @@ -1,55 +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.NetworkCloud.Support -{ - - /// The provisioning state of the cluster. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterProvisioningStateTypeConverter))] - public partial struct ClusterProvisioningState : - 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) || "Succeeded".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Succeeded'", "Succeeded", global::System.Management.Automation.CompletionResultType.ParameterValue, "Succeeded"); - } - 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) || "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) || "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) || "Validating".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Validating'", "Validating", global::System.Management.Automation.CompletionResultType.ParameterValue, "Validating"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Updating".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Updating'", "Updating", global::System.Management.Automation.CompletionResultType.ParameterValue, "Updating"); - } - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ClusterProvisioningState.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ClusterProvisioningState.TypeConverter.cs deleted file mode 100644 index da9a2800fda4..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ClusterProvisioningState.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.NetworkCloud.Support -{ - - /// The provisioning state of the cluster. - public partial class ClusterProvisioningStateTypeConverter : - 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) => ClusterProvisioningState.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/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ClusterProvisioningState.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ClusterProvisioningState.cs deleted file mode 100644 index 95af3aef9267..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ClusterProvisioningState.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.NetworkCloud.Support -{ - - /// The provisioning state of the cluster. - public partial struct ClusterProvisioningState : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterProvisioningState Accepted = @"Accepted"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterProvisioningState Canceled = @"Canceled"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterProvisioningState Failed = @"Failed"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterProvisioningState Succeeded = @"Succeeded"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterProvisioningState Updating = @"Updating"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterProvisioningState Validating = @"Validating"; - - /// 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 ClusterProvisioningState(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Conversion from arbitrary object to ClusterProvisioningState - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new ClusterProvisioningState(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type ClusterProvisioningState - /// 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.NetworkCloud.Support.ClusterProvisioningState e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type ClusterProvisioningState (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 ClusterProvisioningState && Equals((ClusterProvisioningState)obj); - } - - /// Returns hashCode for enum ClusterProvisioningState - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Returns string representation for ClusterProvisioningState - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to ClusterProvisioningState - /// the value to convert to an instance of . - - public static implicit operator ClusterProvisioningState(string value) - { - return new ClusterProvisioningState(value); - } - - /// Implicit operator to convert ClusterProvisioningState to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterProvisioningState e) - { - return e._value; - } - - /// Overriding != operator for enum ClusterProvisioningState - /// 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.NetworkCloud.Support.ClusterProvisioningState e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterProvisioningState e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum ClusterProvisioningState - /// 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.NetworkCloud.Support.ClusterProvisioningState e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterProvisioningState e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ClusterScanRuntimeParametersScanActivity.Completer.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ClusterScanRuntimeParametersScanActivity.Completer.cs deleted file mode 100644 index d6f6cdfbce7b..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ClusterScanRuntimeParametersScanActivity.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.NetworkCloud.Support -{ - - /// The choice of if the scan operation should run the scan. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterScanRuntimeParametersScanActivityTypeConverter))] - public partial struct ClusterScanRuntimeParametersScanActivity : - 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) || "Scan".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Scan'", "Scan", global::System.Management.Automation.CompletionResultType.ParameterValue, "Scan"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Skip".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Skip'", "Skip", global::System.Management.Automation.CompletionResultType.ParameterValue, "Skip"); - } - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ClusterScanRuntimeParametersScanActivity.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ClusterScanRuntimeParametersScanActivity.TypeConverter.cs deleted file mode 100644 index fbfcee341332..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ClusterScanRuntimeParametersScanActivity.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.NetworkCloud.Support -{ - - /// The choice of if the scan operation should run the scan. - public partial class ClusterScanRuntimeParametersScanActivityTypeConverter : - 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) => ClusterScanRuntimeParametersScanActivity.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/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ClusterScanRuntimeParametersScanActivity.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ClusterScanRuntimeParametersScanActivity.cs deleted file mode 100644 index 7e2d5059af54..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ClusterScanRuntimeParametersScanActivity.cs +++ /dev/null @@ -1,104 +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.NetworkCloud.Support -{ - - /// The choice of if the scan operation should run the scan. - public partial struct ClusterScanRuntimeParametersScanActivity : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterScanRuntimeParametersScanActivity Scan = @"Scan"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterScanRuntimeParametersScanActivity Skip = @"Skip"; - - /// - /// 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 ClusterScanRuntimeParametersScanActivity(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Conversion from arbitrary object to ClusterScanRuntimeParametersScanActivity - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new ClusterScanRuntimeParametersScanActivity(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type ClusterScanRuntimeParametersScanActivity - /// 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.NetworkCloud.Support.ClusterScanRuntimeParametersScanActivity e) - { - return _value.Equals(e._value); - } - - /// - /// Compares values of enum type ClusterScanRuntimeParametersScanActivity (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 ClusterScanRuntimeParametersScanActivity && Equals((ClusterScanRuntimeParametersScanActivity)obj); - } - - /// Returns hashCode for enum ClusterScanRuntimeParametersScanActivity - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Returns string representation for ClusterScanRuntimeParametersScanActivity - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to ClusterScanRuntimeParametersScanActivity - /// the value to convert to an instance of . - - public static implicit operator ClusterScanRuntimeParametersScanActivity(string value) - { - return new ClusterScanRuntimeParametersScanActivity(value); - } - - /// Implicit operator to convert ClusterScanRuntimeParametersScanActivity to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterScanRuntimeParametersScanActivity e) - { - return e._value; - } - - /// Overriding != operator for enum ClusterScanRuntimeParametersScanActivity - /// 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.NetworkCloud.Support.ClusterScanRuntimeParametersScanActivity e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterScanRuntimeParametersScanActivity e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum ClusterScanRuntimeParametersScanActivity - /// 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.NetworkCloud.Support.ClusterScanRuntimeParametersScanActivity e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterScanRuntimeParametersScanActivity e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ClusterSecretArchiveEnabled.Completer.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ClusterSecretArchiveEnabled.Completer.cs deleted file mode 100644 index e3abfc7f7a7d..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ClusterSecretArchiveEnabled.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.NetworkCloud.Support -{ - - /// - /// The indicator if the specified key vault should be used to archive the secrets of the cluster. - /// - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterSecretArchiveEnabledTypeConverter))] - public partial struct ClusterSecretArchiveEnabled : - 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) || "True".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'True'", "True", global::System.Management.Automation.CompletionResultType.ParameterValue, "True"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "False".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'False'", "False", global::System.Management.Automation.CompletionResultType.ParameterValue, "False"); - } - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ClusterSecretArchiveEnabled.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ClusterSecretArchiveEnabled.TypeConverter.cs deleted file mode 100644 index fffc6dab70ed..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ClusterSecretArchiveEnabled.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.NetworkCloud.Support -{ - - /// - /// The indicator if the specified key vault should be used to archive the secrets of the cluster. - /// - public partial class ClusterSecretArchiveEnabledTypeConverter : - 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) => ClusterSecretArchiveEnabled.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/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ClusterSecretArchiveEnabled.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ClusterSecretArchiveEnabled.cs deleted file mode 100644 index 2e914a66e2b4..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ClusterSecretArchiveEnabled.cs +++ /dev/null @@ -1,104 +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.NetworkCloud.Support -{ - - /// - /// The indicator if the specified key vault should be used to archive the secrets of the cluster. - /// - public partial struct ClusterSecretArchiveEnabled : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterSecretArchiveEnabled False = @"False"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterSecretArchiveEnabled True = @"True"; - - /// - /// 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 ClusterSecretArchiveEnabled(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Conversion from arbitrary object to ClusterSecretArchiveEnabled - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new ClusterSecretArchiveEnabled(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type ClusterSecretArchiveEnabled - /// 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.NetworkCloud.Support.ClusterSecretArchiveEnabled e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type ClusterSecretArchiveEnabled (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 ClusterSecretArchiveEnabled && Equals((ClusterSecretArchiveEnabled)obj); - } - - /// Returns hashCode for enum ClusterSecretArchiveEnabled - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Returns string representation for ClusterSecretArchiveEnabled - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to ClusterSecretArchiveEnabled - /// the value to convert to an instance of . - - public static implicit operator ClusterSecretArchiveEnabled(string value) - { - return new ClusterSecretArchiveEnabled(value); - } - - /// Implicit operator to convert ClusterSecretArchiveEnabled to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterSecretArchiveEnabled e) - { - return e._value; - } - - /// Overriding != operator for enum ClusterSecretArchiveEnabled - /// 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.NetworkCloud.Support.ClusterSecretArchiveEnabled e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterSecretArchiveEnabled e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum ClusterSecretArchiveEnabled - /// 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.NetworkCloud.Support.ClusterSecretArchiveEnabled e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterSecretArchiveEnabled e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ClusterType.Completer.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ClusterType.Completer.cs deleted file mode 100644 index 4f71a6b253b9..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ClusterType.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.NetworkCloud.Support -{ - - /// The type of rack configuration for the cluster. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterTypeTypeConverter))] - public partial struct ClusterType : - 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) || "SingleRack".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'SingleRack'", "SingleRack", global::System.Management.Automation.CompletionResultType.ParameterValue, "SingleRack"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "MultiRack".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'MultiRack'", "MultiRack", global::System.Management.Automation.CompletionResultType.ParameterValue, "MultiRack"); - } - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ClusterType.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ClusterType.TypeConverter.cs deleted file mode 100644 index 6e7424e0216c..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ClusterType.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.NetworkCloud.Support -{ - - /// The type of rack configuration for the cluster. - public partial class ClusterTypeTypeConverter : - 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) => ClusterType.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/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ClusterType.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ClusterType.cs deleted file mode 100644 index cdb2edac8975..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ClusterType.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.NetworkCloud.Support -{ - - /// The type of rack configuration for the cluster. - public partial struct ClusterType : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterType MultiRack = @"MultiRack"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterType SingleRack = @"SingleRack"; - - /// 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 ClusterType(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Conversion from arbitrary object to ClusterType - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new ClusterType(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type ClusterType - /// 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.NetworkCloud.Support.ClusterType e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type ClusterType (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 ClusterType && Equals((ClusterType)obj); - } - - /// Returns hashCode for enum ClusterType - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Returns string representation for ClusterType - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to ClusterType - /// the value to convert to an instance of . - - public static implicit operator ClusterType(string value) - { - return new ClusterType(value); - } - - /// Implicit operator to convert ClusterType to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterType e) - { - return e._value; - } - - /// Overriding != operator for enum ClusterType - /// 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.NetworkCloud.Support.ClusterType e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterType e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum ClusterType - /// 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.NetworkCloud.Support.ClusterType e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterType e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ClusterUpdateStrategyType.Completer.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ClusterUpdateStrategyType.Completer.cs deleted file mode 100644 index 8e70fcd28bff..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ClusterUpdateStrategyType.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.NetworkCloud.Support -{ - - /// The mode of operation for runtime protection. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterUpdateStrategyTypeTypeConverter))] - public partial struct ClusterUpdateStrategyType : - 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) || "Rack".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Rack'", "Rack", global::System.Management.Automation.CompletionResultType.ParameterValue, "Rack"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "PauseAfterRack".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'PauseAfterRack'", "PauseAfterRack", global::System.Management.Automation.CompletionResultType.ParameterValue, "PauseAfterRack"); - } - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ClusterUpdateStrategyType.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ClusterUpdateStrategyType.TypeConverter.cs deleted file mode 100644 index 785e01358365..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ClusterUpdateStrategyType.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.NetworkCloud.Support -{ - - /// The mode of operation for runtime protection. - public partial class ClusterUpdateStrategyTypeTypeConverter : - 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) => ClusterUpdateStrategyType.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/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ClusterUpdateStrategyType.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ClusterUpdateStrategyType.cs deleted file mode 100644 index 17a61f1f7af9..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ClusterUpdateStrategyType.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.NetworkCloud.Support -{ - - /// The mode of operation for runtime protection. - public partial struct ClusterUpdateStrategyType : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterUpdateStrategyType PauseAfterRack = @"PauseAfterRack"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterUpdateStrategyType Rack = @"Rack"; - - /// 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 ClusterUpdateStrategyType(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Conversion from arbitrary object to ClusterUpdateStrategyType - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new ClusterUpdateStrategyType(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type ClusterUpdateStrategyType - /// 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.NetworkCloud.Support.ClusterUpdateStrategyType e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type ClusterUpdateStrategyType (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 ClusterUpdateStrategyType && Equals((ClusterUpdateStrategyType)obj); - } - - /// Returns hashCode for enum ClusterUpdateStrategyType - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Returns string representation for ClusterUpdateStrategyType - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to ClusterUpdateStrategyType - /// the value to convert to an instance of . - - public static implicit operator ClusterUpdateStrategyType(string value) - { - return new ClusterUpdateStrategyType(value); - } - - /// Implicit operator to convert ClusterUpdateStrategyType to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterUpdateStrategyType e) - { - return e._value; - } - - /// Overriding != operator for enum ClusterUpdateStrategyType - /// 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.NetworkCloud.Support.ClusterUpdateStrategyType e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterUpdateStrategyType e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum ClusterUpdateStrategyType - /// 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.NetworkCloud.Support.ClusterUpdateStrategyType e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterUpdateStrategyType e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ConsoleDetailedStatus.Completer.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ConsoleDetailedStatus.Completer.cs deleted file mode 100644 index 0f20978fd319..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ConsoleDetailedStatus.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.NetworkCloud.Support -{ - - /// The more detailed status of the console. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ConsoleDetailedStatusTypeConverter))] - public partial struct ConsoleDetailedStatus : - 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) || "Ready".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Ready'", "Ready", global::System.Management.Automation.CompletionResultType.ParameterValue, "Ready"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Error".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Error'", "Error", global::System.Management.Automation.CompletionResultType.ParameterValue, "Error"); - } - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ConsoleDetailedStatus.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ConsoleDetailedStatus.TypeConverter.cs deleted file mode 100644 index f19f30701b34..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ConsoleDetailedStatus.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.NetworkCloud.Support -{ - - /// The more detailed status of the console. - public partial class ConsoleDetailedStatusTypeConverter : - 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) => ConsoleDetailedStatus.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/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ConsoleDetailedStatus.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ConsoleDetailedStatus.cs deleted file mode 100644 index 26b06d0e4da4..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ConsoleDetailedStatus.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.NetworkCloud.Support -{ - - /// The more detailed status of the console. - public partial struct ConsoleDetailedStatus : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ConsoleDetailedStatus Error = @"Error"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ConsoleDetailedStatus Ready = @"Ready"; - - /// 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 ConsoleDetailedStatus(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Conversion from arbitrary object to ConsoleDetailedStatus - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new ConsoleDetailedStatus(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type ConsoleDetailedStatus - /// 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.NetworkCloud.Support.ConsoleDetailedStatus e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type ConsoleDetailedStatus (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 ConsoleDetailedStatus && Equals((ConsoleDetailedStatus)obj); - } - - /// Returns hashCode for enum ConsoleDetailedStatus - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Returns string representation for ConsoleDetailedStatus - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to ConsoleDetailedStatus - /// the value to convert to an instance of . - - public static implicit operator ConsoleDetailedStatus(string value) - { - return new ConsoleDetailedStatus(value); - } - - /// Implicit operator to convert ConsoleDetailedStatus to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ConsoleDetailedStatus e) - { - return e._value; - } - - /// Overriding != operator for enum ConsoleDetailedStatus - /// 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.NetworkCloud.Support.ConsoleDetailedStatus e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ConsoleDetailedStatus e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum ConsoleDetailedStatus - /// 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.NetworkCloud.Support.ConsoleDetailedStatus e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ConsoleDetailedStatus e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ConsoleEnabled.Completer.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ConsoleEnabled.Completer.cs deleted file mode 100644 index 4dcf8b807c2b..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ConsoleEnabled.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.NetworkCloud.Support -{ - - /// The indicator of whether the console access is enabled. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ConsoleEnabledTypeConverter))] - public partial struct ConsoleEnabled : - 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) || "True".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'True'", "True", global::System.Management.Automation.CompletionResultType.ParameterValue, "True"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "False".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'False'", "False", global::System.Management.Automation.CompletionResultType.ParameterValue, "False"); - } - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ConsoleEnabled.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ConsoleEnabled.TypeConverter.cs deleted file mode 100644 index 3484834840e1..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ConsoleEnabled.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.NetworkCloud.Support -{ - - /// The indicator of whether the console access is enabled. - public partial class ConsoleEnabledTypeConverter : - 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) => ConsoleEnabled.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/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ConsoleEnabled.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ConsoleEnabled.cs deleted file mode 100644 index f8fb61cd5dba..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ConsoleEnabled.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.NetworkCloud.Support -{ - - /// The indicator of whether the console access is enabled. - public partial struct ConsoleEnabled : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ConsoleEnabled False = @"False"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ConsoleEnabled True = @"True"; - - /// 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 ConsoleEnabled(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Conversion from arbitrary object to ConsoleEnabled - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new ConsoleEnabled(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type ConsoleEnabled - /// 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.NetworkCloud.Support.ConsoleEnabled e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type ConsoleEnabled (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 ConsoleEnabled && Equals((ConsoleEnabled)obj); - } - - /// Returns hashCode for enum ConsoleEnabled - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Returns string representation for ConsoleEnabled - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to ConsoleEnabled - /// the value to convert to an instance of . - - public static implicit operator ConsoleEnabled(string value) - { - return new ConsoleEnabled(value); - } - - /// Implicit operator to convert ConsoleEnabled to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ConsoleEnabled e) - { - return e._value; - } - - /// Overriding != operator for enum ConsoleEnabled - /// 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.NetworkCloud.Support.ConsoleEnabled e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ConsoleEnabled e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum ConsoleEnabled - /// 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.NetworkCloud.Support.ConsoleEnabled e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ConsoleEnabled e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ConsoleProvisioningState.Completer.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ConsoleProvisioningState.Completer.cs deleted file mode 100644 index 83e8ee083148..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ConsoleProvisioningState.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.NetworkCloud.Support -{ - - /// The provisioning state of the virtual machine console. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ConsoleProvisioningStateTypeConverter))] - public partial struct ConsoleProvisioningState : - 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) || "Succeeded".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Succeeded'", "Succeeded", global::System.Management.Automation.CompletionResultType.ParameterValue, "Succeeded"); - } - 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) || "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) || "Provisioning".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Provisioning'", "Provisioning", global::System.Management.Automation.CompletionResultType.ParameterValue, "Provisioning"); - } - 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"); - } - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ConsoleProvisioningState.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ConsoleProvisioningState.TypeConverter.cs deleted file mode 100644 index 074d57562c20..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ConsoleProvisioningState.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.NetworkCloud.Support -{ - - /// The provisioning state of the virtual machine console. - public partial class ConsoleProvisioningStateTypeConverter : - 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) => ConsoleProvisioningState.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/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ConsoleProvisioningState.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ConsoleProvisioningState.cs deleted file mode 100644 index bb8aa482f1ca..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ConsoleProvisioningState.cs +++ /dev/null @@ -1,104 +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.NetworkCloud.Support -{ - - /// The provisioning state of the virtual machine console. - public partial struct ConsoleProvisioningState : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ConsoleProvisioningState Accepted = @"Accepted"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ConsoleProvisioningState Canceled = @"Canceled"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ConsoleProvisioningState Failed = @"Failed"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ConsoleProvisioningState Provisioning = @"Provisioning"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ConsoleProvisioningState Succeeded = @"Succeeded"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Creates an instance of the Enum class. - /// the value to create an instance for. - private ConsoleProvisioningState(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Conversion from arbitrary object to ConsoleProvisioningState - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new ConsoleProvisioningState(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type ConsoleProvisioningState - /// 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.NetworkCloud.Support.ConsoleProvisioningState e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type ConsoleProvisioningState (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 ConsoleProvisioningState && Equals((ConsoleProvisioningState)obj); - } - - /// Returns hashCode for enum ConsoleProvisioningState - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Returns string representation for ConsoleProvisioningState - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to ConsoleProvisioningState - /// the value to convert to an instance of . - - public static implicit operator ConsoleProvisioningState(string value) - { - return new ConsoleProvisioningState(value); - } - - /// Implicit operator to convert ConsoleProvisioningState to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ConsoleProvisioningState e) - { - return e._value; - } - - /// Overriding != operator for enum ConsoleProvisioningState - /// 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.NetworkCloud.Support.ConsoleProvisioningState e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ConsoleProvisioningState e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum ConsoleProvisioningState - /// 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.NetworkCloud.Support.ConsoleProvisioningState e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ConsoleProvisioningState e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ControlImpact.Completer.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ControlImpact.Completer.cs deleted file mode 100644 index 2bc78786d6c8..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ControlImpact.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.NetworkCloud.Support -{ - - /// The indicator of whether the control plane will be impacted during the upgrade. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ControlImpactTypeConverter))] - public partial struct ControlImpact : - 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) || "True".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'True'", "True", global::System.Management.Automation.CompletionResultType.ParameterValue, "True"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "False".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'False'", "False", global::System.Management.Automation.CompletionResultType.ParameterValue, "False"); - } - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ControlImpact.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ControlImpact.TypeConverter.cs deleted file mode 100644 index 94537d532267..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ControlImpact.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.NetworkCloud.Support -{ - - /// The indicator of whether the control plane will be impacted during the upgrade. - public partial class ControlImpactTypeConverter : - 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) => ControlImpact.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/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ControlImpact.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ControlImpact.cs deleted file mode 100644 index 8a798d541c54..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ControlImpact.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.NetworkCloud.Support -{ - - /// The indicator of whether the control plane will be impacted during the upgrade. - public partial struct ControlImpact : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ControlImpact False = @"False"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ControlImpact True = @"True"; - - /// 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 ControlImpact(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Conversion from arbitrary object to ControlImpact - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new ControlImpact(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type ControlImpact - /// 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.NetworkCloud.Support.ControlImpact e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type ControlImpact (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 ControlImpact && Equals((ControlImpact)obj); - } - - /// Returns hashCode for enum ControlImpact - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Returns string representation for ControlImpact - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to ControlImpact - /// the value to convert to an instance of . - - public static implicit operator ControlImpact(string value) - { - return new ControlImpact(value); - } - - /// Implicit operator to convert ControlImpact to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ControlImpact e) - { - return e._value; - } - - /// Overriding != operator for enum ControlImpact - /// 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.NetworkCloud.Support.ControlImpact e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ControlImpact e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum ControlImpact - /// 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.NetworkCloud.Support.ControlImpact e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ControlImpact e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/CreatedByType.Completer.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/CreatedByType.Completer.cs deleted file mode 100644 index 5dcea79b3147..000000000000 --- a/generated/NetworkCloud/NetworkCloud.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.NetworkCloud.Support -{ - - /// The type of identity that created the resource. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/CreatedByType.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/CreatedByType.TypeConverter.cs deleted file mode 100644 index b712e8130eaa..000000000000 --- a/generated/NetworkCloud/NetworkCloud.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.NetworkCloud.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/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/CreatedByType.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/CreatedByType.cs deleted file mode 100644 index 20a6a7bd8035..000000000000 --- a/generated/NetworkCloud/NetworkCloud.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.NetworkCloud.Support -{ - - /// The type of identity that created the resource. - public partial struct CreatedByType : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType Application = @"Application"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType Key = @"Key"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType ManagedIdentity = @"ManagedIdentity"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Support.CreatedByType e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Support.CreatedByType e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CreatedByType e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/DefaultGateway.Completer.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/DefaultGateway.Completer.cs deleted file mode 100644 index f2755c2260c1..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/DefaultGateway.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.NetworkCloud.Support -{ - - /// - /// The indicator of whether this is the default gateway. - /// Only one of the attached networks (including the CloudServicesNetwork attachment) for a single machine may be specified - /// as True. - /// - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.DefaultGatewayTypeConverter))] - public partial struct DefaultGateway : - 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) || "True".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'True'", "True", global::System.Management.Automation.CompletionResultType.ParameterValue, "True"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "False".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'False'", "False", global::System.Management.Automation.CompletionResultType.ParameterValue, "False"); - } - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/DefaultGateway.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/DefaultGateway.TypeConverter.cs deleted file mode 100644 index 9c54826491e3..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/DefaultGateway.TypeConverter.cs +++ /dev/null @@ -1,63 +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.NetworkCloud.Support -{ - - /// - /// The indicator of whether this is the default gateway. - /// Only one of the attached networks (including the CloudServicesNetwork attachment) for a single machine may be specified - /// as True. - /// - public partial class DefaultGatewayTypeConverter : - 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) => DefaultGateway.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/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/DefaultGateway.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/DefaultGateway.cs deleted file mode 100644 index e83cf3bbdfc7..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/DefaultGateway.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.NetworkCloud.Support -{ - - /// - /// The indicator of whether this is the default gateway. - /// Only one of the attached networks (including the CloudServicesNetwork attachment) for a single machine may be specified - /// as True. - /// - public partial struct DefaultGateway : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.DefaultGateway False = @"False"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.DefaultGateway True = @"True"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Conversion from arbitrary object to DefaultGateway - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new DefaultGateway(global::System.Convert.ToString(value)); - } - - /// Creates an instance of the Enum class. - /// the value to create an instance for. - private DefaultGateway(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Compares values of enum type DefaultGateway - /// 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.NetworkCloud.Support.DefaultGateway e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type DefaultGateway (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 DefaultGateway && Equals((DefaultGateway)obj); - } - - /// Returns hashCode for enum DefaultGateway - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Returns string representation for DefaultGateway - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to DefaultGateway - /// the value to convert to an instance of . - - public static implicit operator DefaultGateway(string value) - { - return new DefaultGateway(value); - } - - /// Implicit operator to convert DefaultGateway to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.DefaultGateway e) - { - return e._value; - } - - /// Overriding != operator for enum DefaultGateway - /// 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.NetworkCloud.Support.DefaultGateway e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.DefaultGateway e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum DefaultGateway - /// 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.NetworkCloud.Support.DefaultGateway e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.DefaultGateway e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/DeviceConnectionType.Completer.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/DeviceConnectionType.Completer.cs deleted file mode 100644 index f5b8f9d1e16e..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/DeviceConnectionType.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.NetworkCloud.Support -{ - - /// The connection type of the device. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.DeviceConnectionTypeTypeConverter))] - public partial struct DeviceConnectionType : - 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) || "PCI".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'PCI'", "PCI", global::System.Management.Automation.CompletionResultType.ParameterValue, "PCI"); - } - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/DeviceConnectionType.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/DeviceConnectionType.TypeConverter.cs deleted file mode 100644 index 2afa61b8b58d..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/DeviceConnectionType.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.NetworkCloud.Support -{ - - /// The connection type of the device. - public partial class DeviceConnectionTypeTypeConverter : - 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) => DeviceConnectionType.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/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/DeviceConnectionType.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/DeviceConnectionType.cs deleted file mode 100644 index e9e9f6dec33c..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/DeviceConnectionType.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.NetworkCloud.Support -{ - - /// The connection type of the device. - public partial struct DeviceConnectionType : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.DeviceConnectionType Pci = @"PCI"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Conversion from arbitrary object to DeviceConnectionType - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new DeviceConnectionType(global::System.Convert.ToString(value)); - } - - /// Creates an instance of the Enum class. - /// the value to create an instance for. - private DeviceConnectionType(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Compares values of enum type DeviceConnectionType - /// 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.NetworkCloud.Support.DeviceConnectionType e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type DeviceConnectionType (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 DeviceConnectionType && Equals((DeviceConnectionType)obj); - } - - /// Returns hashCode for enum DeviceConnectionType - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Returns string representation for DeviceConnectionType - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to DeviceConnectionType - /// the value to convert to an instance of . - - public static implicit operator DeviceConnectionType(string value) - { - return new DeviceConnectionType(value); - } - - /// Implicit operator to convert DeviceConnectionType to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.DeviceConnectionType e) - { - return e._value; - } - - /// Overriding != operator for enum DeviceConnectionType - /// 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.NetworkCloud.Support.DeviceConnectionType e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.DeviceConnectionType e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum DeviceConnectionType - /// 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.NetworkCloud.Support.DeviceConnectionType e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.DeviceConnectionType e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/DiskType.Completer.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/DiskType.Completer.cs deleted file mode 100644 index 41af116e2e75..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/DiskType.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.NetworkCloud.Support -{ - - /// The disk type of rack SKU resource. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.DiskTypeTypeConverter))] - public partial struct DiskType : - 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) || "HDD".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'HDD'", "HDD", global::System.Management.Automation.CompletionResultType.ParameterValue, "HDD"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "SSD".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'SSD'", "SSD", global::System.Management.Automation.CompletionResultType.ParameterValue, "SSD"); - } - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/DiskType.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/DiskType.TypeConverter.cs deleted file mode 100644 index 5faf3c12f4a6..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/DiskType.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.NetworkCloud.Support -{ - - /// The disk type of rack SKU resource. - public partial class DiskTypeTypeConverter : - 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) => DiskType.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/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/DiskType.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/DiskType.cs deleted file mode 100644 index 2ea61987ebd9..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/DiskType.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.NetworkCloud.Support -{ - - /// The disk type of rack SKU resource. - public partial struct DiskType : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.DiskType Hdd = @"HDD"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.DiskType Ssd = @"SSD"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Conversion from arbitrary object to DiskType - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new DiskType(global::System.Convert.ToString(value)); - } - - /// Creates an instance of the Enum class. - /// the value to create an instance for. - private DiskType(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Compares values of enum type DiskType - /// 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.NetworkCloud.Support.DiskType e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type DiskType (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 DiskType && Equals((DiskType)obj); - } - - /// Returns hashCode for enum DiskType - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Returns string representation for DiskType - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to DiskType - /// the value to convert to an instance of . - - public static implicit operator DiskType(string value) - { - return new DiskType(value); - } - - /// Implicit operator to convert DiskType to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.DiskType e) - { - return e._value; - } - - /// Overriding != operator for enum DiskType - /// 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.NetworkCloud.Support.DiskType e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.DiskType e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum DiskType - /// 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.NetworkCloud.Support.DiskType e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.DiskType e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/FabricPeeringEnabled.Completer.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/FabricPeeringEnabled.Completer.cs deleted file mode 100644 index 6bef9e2d1abe..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/FabricPeeringEnabled.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.NetworkCloud.Support -{ - - /// The indicator to specify if the load balancer peers with the network fabric. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.FabricPeeringEnabledTypeConverter))] - public partial struct FabricPeeringEnabled : - 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) || "True".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'True'", "True", global::System.Management.Automation.CompletionResultType.ParameterValue, "True"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "False".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'False'", "False", global::System.Management.Automation.CompletionResultType.ParameterValue, "False"); - } - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/FabricPeeringEnabled.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/FabricPeeringEnabled.TypeConverter.cs deleted file mode 100644 index aae1e246e504..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/FabricPeeringEnabled.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.NetworkCloud.Support -{ - - /// The indicator to specify if the load balancer peers with the network fabric. - public partial class FabricPeeringEnabledTypeConverter : - 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) => FabricPeeringEnabled.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/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/FabricPeeringEnabled.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/FabricPeeringEnabled.cs deleted file mode 100644 index 06966e0ff6db..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/FabricPeeringEnabled.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.NetworkCloud.Support -{ - - /// The indicator to specify if the load balancer peers with the network fabric. - public partial struct FabricPeeringEnabled : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.FabricPeeringEnabled False = @"False"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.FabricPeeringEnabled True = @"True"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Conversion from arbitrary object to FabricPeeringEnabled - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new FabricPeeringEnabled(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type FabricPeeringEnabled - /// 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.NetworkCloud.Support.FabricPeeringEnabled e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type FabricPeeringEnabled (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 FabricPeeringEnabled && Equals((FabricPeeringEnabled)obj); - } - - /// Creates an instance of the Enum class. - /// the value to create an instance for. - private FabricPeeringEnabled(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Returns hashCode for enum FabricPeeringEnabled - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Returns string representation for FabricPeeringEnabled - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to FabricPeeringEnabled - /// the value to convert to an instance of . - - public static implicit operator FabricPeeringEnabled(string value) - { - return new FabricPeeringEnabled(value); - } - - /// Implicit operator to convert FabricPeeringEnabled to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.FabricPeeringEnabled e) - { - return e._value; - } - - /// Overriding != operator for enum FabricPeeringEnabled - /// 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.NetworkCloud.Support.FabricPeeringEnabled e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.FabricPeeringEnabled e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum FabricPeeringEnabled - /// 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.NetworkCloud.Support.FabricPeeringEnabled e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.FabricPeeringEnabled e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/FeatureDetailedStatus.Completer.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/FeatureDetailedStatus.Completer.cs deleted file mode 100644 index 0ac88fd4319b..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/FeatureDetailedStatus.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.NetworkCloud.Support -{ - - /// The status representing the state of this feature. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.FeatureDetailedStatusTypeConverter))] - public partial struct FeatureDetailedStatus : - 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) || "Running".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Running'", "Running", global::System.Management.Automation.CompletionResultType.ParameterValue, "Running"); - } - 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) || "Unknown".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Unknown'", "Unknown", global::System.Management.Automation.CompletionResultType.ParameterValue, "Unknown"); - } - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/FeatureDetailedStatus.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/FeatureDetailedStatus.TypeConverter.cs deleted file mode 100644 index 1a8d831f5026..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/FeatureDetailedStatus.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.NetworkCloud.Support -{ - - /// The status representing the state of this feature. - public partial class FeatureDetailedStatusTypeConverter : - 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) => FeatureDetailedStatus.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/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/FeatureDetailedStatus.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/FeatureDetailedStatus.cs deleted file mode 100644 index 46e3aa4bed50..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/FeatureDetailedStatus.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.NetworkCloud.Support -{ - - /// The status representing the state of this feature. - public partial struct FeatureDetailedStatus : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.FeatureDetailedStatus Failed = @"Failed"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.FeatureDetailedStatus Running = @"Running"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.FeatureDetailedStatus Unknown = @"Unknown"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Conversion from arbitrary object to FeatureDetailedStatus - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new FeatureDetailedStatus(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type FeatureDetailedStatus - /// 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.NetworkCloud.Support.FeatureDetailedStatus e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type FeatureDetailedStatus (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 FeatureDetailedStatus && Equals((FeatureDetailedStatus)obj); - } - - /// Creates an instance of the Enum class. - /// the value to create an instance for. - private FeatureDetailedStatus(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Returns hashCode for enum FeatureDetailedStatus - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Returns string representation for FeatureDetailedStatus - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to FeatureDetailedStatus - /// the value to convert to an instance of . - - public static implicit operator FeatureDetailedStatus(string value) - { - return new FeatureDetailedStatus(value); - } - - /// Implicit operator to convert FeatureDetailedStatus to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.FeatureDetailedStatus e) - { - return e._value; - } - - /// Overriding != operator for enum FeatureDetailedStatus - /// 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.NetworkCloud.Support.FeatureDetailedStatus e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.FeatureDetailedStatus e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum FeatureDetailedStatus - /// 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.NetworkCloud.Support.FeatureDetailedStatus e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.FeatureDetailedStatus e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/HugepagesSize.Completer.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/HugepagesSize.Completer.cs deleted file mode 100644 index c5e0b6e00994..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/HugepagesSize.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.NetworkCloud.Support -{ - - /// The size of the hugepages to allocate. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HugepagesSizeTypeConverter))] - public partial struct HugepagesSize : - 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) || "2M".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'2M'", "2M", global::System.Management.Automation.CompletionResultType.ParameterValue, "2M"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "1G".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'1G'", "1G", global::System.Management.Automation.CompletionResultType.ParameterValue, "1G"); - } - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/HugepagesSize.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/HugepagesSize.TypeConverter.cs deleted file mode 100644 index e3fd3ca292bd..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/HugepagesSize.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.NetworkCloud.Support -{ - - /// The size of the hugepages to allocate. - public partial class HugepagesSizeTypeConverter : - 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) => HugepagesSize.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/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/HugepagesSize.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/HugepagesSize.cs deleted file mode 100644 index c5f989030384..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/HugepagesSize.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.NetworkCloud.Support -{ - - /// The size of the hugepages to allocate. - public partial struct HugepagesSize : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HugepagesSize OneG = @"1G"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HugepagesSize TwoM = @"2M"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Conversion from arbitrary object to HugepagesSize - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new HugepagesSize(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type HugepagesSize - /// 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.NetworkCloud.Support.HugepagesSize e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type HugepagesSize (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 HugepagesSize && Equals((HugepagesSize)obj); - } - - /// Returns hashCode for enum HugepagesSize - /// 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 HugepagesSize(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Returns string representation for HugepagesSize - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to HugepagesSize - /// the value to convert to an instance of . - - public static implicit operator HugepagesSize(string value) - { - return new HugepagesSize(value); - } - - /// Implicit operator to convert HugepagesSize to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HugepagesSize e) - { - return e._value; - } - - /// Overriding != operator for enum HugepagesSize - /// 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.NetworkCloud.Support.HugepagesSize e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HugepagesSize e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum HugepagesSize - /// 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.NetworkCloud.Support.HugepagesSize e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HugepagesSize e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/HybridAksIpamEnabled.Completer.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/HybridAksIpamEnabled.Completer.cs deleted file mode 100644 index 478c97466e01..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/HybridAksIpamEnabled.Completer.cs +++ /dev/null @@ -1,42 +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.NetworkCloud.Support -{ - - /// - /// Field Deprecated. The field was previously optional, now it will have no defined behavior and will be ignored. The indicator - /// of whether or not to disable IPAM allocation on the network attachment definition injected into the Hybrid AKS Cluster. - /// - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HybridAksIpamEnabledTypeConverter))] - public partial struct HybridAksIpamEnabled : - 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) || "True".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'True'", "True", global::System.Management.Automation.CompletionResultType.ParameterValue, "True"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "False".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'False'", "False", global::System.Management.Automation.CompletionResultType.ParameterValue, "False"); - } - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/HybridAksIpamEnabled.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/HybridAksIpamEnabled.TypeConverter.cs deleted file mode 100644 index b7671061b4a4..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/HybridAksIpamEnabled.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.NetworkCloud.Support -{ - - /// - /// Field Deprecated. The field was previously optional, now it will have no defined behavior and will be ignored. The indicator - /// of whether or not to disable IPAM allocation on the network attachment definition injected into the Hybrid AKS Cluster. - /// - public partial class HybridAksIpamEnabledTypeConverter : - 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) => HybridAksIpamEnabled.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/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/HybridAksIpamEnabled.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/HybridAksIpamEnabled.cs deleted file mode 100644 index 20b48ae30ae5..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/HybridAksIpamEnabled.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.NetworkCloud.Support -{ - - /// - /// Field Deprecated. The field was previously optional, now it will have no defined behavior and will be ignored. The indicator - /// of whether or not to disable IPAM allocation on the network attachment definition injected into the Hybrid AKS Cluster. - /// - public partial struct HybridAksIpamEnabled : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HybridAksIpamEnabled False = @"False"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HybridAksIpamEnabled True = @"True"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Conversion from arbitrary object to HybridAksIpamEnabled - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new HybridAksIpamEnabled(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type HybridAksIpamEnabled - /// 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.NetworkCloud.Support.HybridAksIpamEnabled e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type HybridAksIpamEnabled (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 HybridAksIpamEnabled && Equals((HybridAksIpamEnabled)obj); - } - - /// Returns hashCode for enum HybridAksIpamEnabled - /// 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 HybridAksIpamEnabled(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Returns string representation for HybridAksIpamEnabled - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to HybridAksIpamEnabled - /// the value to convert to an instance of . - - public static implicit operator HybridAksIpamEnabled(string value) - { - return new HybridAksIpamEnabled(value); - } - - /// Implicit operator to convert HybridAksIpamEnabled to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HybridAksIpamEnabled e) - { - return e._value; - } - - /// Overriding != operator for enum HybridAksIpamEnabled - /// 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.NetworkCloud.Support.HybridAksIpamEnabled e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HybridAksIpamEnabled e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum HybridAksIpamEnabled - /// 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.NetworkCloud.Support.HybridAksIpamEnabled e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HybridAksIpamEnabled e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/HybridAksPluginType.Completer.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/HybridAksPluginType.Completer.cs deleted file mode 100644 index b4e70856bb70..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/HybridAksPluginType.Completer.cs +++ /dev/null @@ -1,46 +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.NetworkCloud.Support -{ - - /// - /// Field Deprecated. The field was previously optional, now it will have no defined behavior and will be ignored. The network - /// plugin type for Hybrid AKS. - /// - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HybridAksPluginTypeTypeConverter))] - public partial struct HybridAksPluginType : - 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) || "DPDK".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'DPDK'", "DPDK", global::System.Management.Automation.CompletionResultType.ParameterValue, "DPDK"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "SRIOV".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'SRIOV'", "SRIOV", global::System.Management.Automation.CompletionResultType.ParameterValue, "SRIOV"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "OSDevice".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'OSDevice'", "OSDevice", global::System.Management.Automation.CompletionResultType.ParameterValue, "OSDevice"); - } - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/HybridAksPluginType.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/HybridAksPluginType.TypeConverter.cs deleted file mode 100644 index 0ba5e866176a..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/HybridAksPluginType.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.NetworkCloud.Support -{ - - /// - /// Field Deprecated. The field was previously optional, now it will have no defined behavior and will be ignored. The network - /// plugin type for Hybrid AKS. - /// - public partial class HybridAksPluginTypeTypeConverter : - 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) => HybridAksPluginType.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/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/HybridAksPluginType.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/HybridAksPluginType.cs deleted file mode 100644 index b661759e6733..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/HybridAksPluginType.cs +++ /dev/null @@ -1,103 +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.NetworkCloud.Support -{ - - /// - /// Field Deprecated. The field was previously optional, now it will have no defined behavior and will be ignored. The network - /// plugin type for Hybrid AKS. - /// - public partial struct HybridAksPluginType : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HybridAksPluginType Dpdk = @"DPDK"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HybridAksPluginType OSDevice = @"OSDevice"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HybridAksPluginType Sriov = @"SRIOV"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Conversion from arbitrary object to HybridAksPluginType - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new HybridAksPluginType(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type HybridAksPluginType - /// 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.NetworkCloud.Support.HybridAksPluginType e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type HybridAksPluginType (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 HybridAksPluginType && Equals((HybridAksPluginType)obj); - } - - /// Returns hashCode for enum HybridAksPluginType - /// 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 HybridAksPluginType(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Returns string representation for HybridAksPluginType - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to HybridAksPluginType - /// the value to convert to an instance of . - - public static implicit operator HybridAksPluginType(string value) - { - return new HybridAksPluginType(value); - } - - /// Implicit operator to convert HybridAksPluginType to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HybridAksPluginType e) - { - return e._value; - } - - /// Overriding != operator for enum HybridAksPluginType - /// 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.NetworkCloud.Support.HybridAksPluginType e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HybridAksPluginType e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum HybridAksPluginType - /// 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.NetworkCloud.Support.HybridAksPluginType e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HybridAksPluginType e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/IPAllocationType.Completer.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/IPAllocationType.Completer.cs deleted file mode 100644 index 3378272360fb..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/IPAllocationType.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.NetworkCloud.Support -{ - - /// The type of the IP address allocation, defaulted to "DualStack". - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.IPAllocationTypeTypeConverter))] - public partial struct IPAllocationType : - 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) || "IPV4".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'IPV4'", "IPV4", global::System.Management.Automation.CompletionResultType.ParameterValue, "IPV4"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "IPV6".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'IPV6'", "IPV6", global::System.Management.Automation.CompletionResultType.ParameterValue, "IPV6"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "DualStack".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'DualStack'", "DualStack", global::System.Management.Automation.CompletionResultType.ParameterValue, "DualStack"); - } - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/IPAllocationType.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/IPAllocationType.TypeConverter.cs deleted file mode 100644 index 6e0b4c0a9099..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/IPAllocationType.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.NetworkCloud.Support -{ - - /// The type of the IP address allocation, defaulted to "DualStack". - public partial class IPAllocationTypeTypeConverter : - 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) => IPAllocationType.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/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/IPAllocationType.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/IPAllocationType.cs deleted file mode 100644 index 3619f8e9ee03..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/IPAllocationType.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.NetworkCloud.Support -{ - - /// The type of the IP address allocation, defaulted to "DualStack". - public partial struct IPAllocationType : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.IPAllocationType DualStack = @"DualStack"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.IPAllocationType Ipv4 = @"IPV4"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.IPAllocationType Ipv6 = @"IPV6"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Conversion from arbitrary object to IPAllocationType - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new IPAllocationType(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type IPAllocationType - /// 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.NetworkCloud.Support.IPAllocationType e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type IPAllocationType (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 IPAllocationType && Equals((IPAllocationType)obj); - } - - /// Returns hashCode for enum IPAllocationType - /// 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 IPAllocationType(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Returns string representation for IPAllocationType - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to IPAllocationType - /// the value to convert to an instance of . - - public static implicit operator IPAllocationType(string value) - { - return new IPAllocationType(value); - } - - /// Implicit operator to convert IPAllocationType to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.IPAllocationType e) - { - return e._value; - } - - /// Overriding != operator for enum IPAllocationType - /// 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.NetworkCloud.Support.IPAllocationType e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.IPAllocationType e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum IPAllocationType - /// 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.NetworkCloud.Support.IPAllocationType e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.IPAllocationType e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/KubernetesClusterDetailedStatus.Completer.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/KubernetesClusterDetailedStatus.Completer.cs deleted file mode 100644 index c525a7f2c6bf..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/KubernetesClusterDetailedStatus.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.NetworkCloud.Support -{ - - /// The current status of the Kubernetes cluster. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterDetailedStatusTypeConverter))] - public partial struct KubernetesClusterDetailedStatus : - 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) || "Available".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Available'", "Available", global::System.Management.Automation.CompletionResultType.ParameterValue, "Available"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Error".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Error'", "Error", global::System.Management.Automation.CompletionResultType.ParameterValue, "Error"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Provisioning".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Provisioning'", "Provisioning", global::System.Management.Automation.CompletionResultType.ParameterValue, "Provisioning"); - } - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/KubernetesClusterDetailedStatus.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/KubernetesClusterDetailedStatus.TypeConverter.cs deleted file mode 100644 index a7199fadb475..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/KubernetesClusterDetailedStatus.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.NetworkCloud.Support -{ - - /// The current status of the Kubernetes cluster. - public partial class KubernetesClusterDetailedStatusTypeConverter : - 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) => KubernetesClusterDetailedStatus.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/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/KubernetesClusterDetailedStatus.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/KubernetesClusterDetailedStatus.cs deleted file mode 100644 index ec960892bf8c..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/KubernetesClusterDetailedStatus.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.NetworkCloud.Support -{ - - /// The current status of the Kubernetes cluster. - public partial struct KubernetesClusterDetailedStatus : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterDetailedStatus Available = @"Available"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterDetailedStatus Error = @"Error"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterDetailedStatus Provisioning = @"Provisioning"; - - /// - /// the value for an instance of the Enum. - /// - private string _value { get; set; } - - /// Conversion from arbitrary object to KubernetesClusterDetailedStatus - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new KubernetesClusterDetailedStatus(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type KubernetesClusterDetailedStatus - /// 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.NetworkCloud.Support.KubernetesClusterDetailedStatus e) - { - return _value.Equals(e._value); - } - - /// - /// Compares values of enum type KubernetesClusterDetailedStatus (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 KubernetesClusterDetailedStatus && Equals((KubernetesClusterDetailedStatus)obj); - } - - /// Returns hashCode for enum KubernetesClusterDetailedStatus - /// 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 KubernetesClusterDetailedStatus(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Returns string representation for KubernetesClusterDetailedStatus - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to KubernetesClusterDetailedStatus - /// the value to convert to an instance of . - - public static implicit operator KubernetesClusterDetailedStatus(string value) - { - return new KubernetesClusterDetailedStatus(value); - } - - /// Implicit operator to convert KubernetesClusterDetailedStatus to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterDetailedStatus e) - { - return e._value; - } - - /// Overriding != operator for enum KubernetesClusterDetailedStatus - /// 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.NetworkCloud.Support.KubernetesClusterDetailedStatus e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterDetailedStatus e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum KubernetesClusterDetailedStatus - /// 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.NetworkCloud.Support.KubernetesClusterDetailedStatus e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterDetailedStatus e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/KubernetesClusterFeatureAvailabilityLifecycle.Completer.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/KubernetesClusterFeatureAvailabilityLifecycle.Completer.cs deleted file mode 100644 index bcf79d4f26ee..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/KubernetesClusterFeatureAvailabilityLifecycle.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.NetworkCloud.Support -{ - - /// The lifecycle indicator of the feature. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterFeatureAvailabilityLifecycleTypeConverter))] - public partial struct KubernetesClusterFeatureAvailabilityLifecycle : - 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) || "Preview".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Preview'", "Preview", global::System.Management.Automation.CompletionResultType.ParameterValue, "Preview"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "GenerallyAvailable".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'GenerallyAvailable'", "GenerallyAvailable", global::System.Management.Automation.CompletionResultType.ParameterValue, "GenerallyAvailable"); - } - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/KubernetesClusterFeatureAvailabilityLifecycle.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/KubernetesClusterFeatureAvailabilityLifecycle.TypeConverter.cs deleted file mode 100644 index 8a5d6beaeec8..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/KubernetesClusterFeatureAvailabilityLifecycle.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.NetworkCloud.Support -{ - - /// The lifecycle indicator of the feature. - public partial class KubernetesClusterFeatureAvailabilityLifecycleTypeConverter : - 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) => KubernetesClusterFeatureAvailabilityLifecycle.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/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/KubernetesClusterFeatureAvailabilityLifecycle.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/KubernetesClusterFeatureAvailabilityLifecycle.cs deleted file mode 100644 index 2715a3917029..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/KubernetesClusterFeatureAvailabilityLifecycle.cs +++ /dev/null @@ -1,110 +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.NetworkCloud.Support -{ - - /// The lifecycle indicator of the feature. - public partial struct KubernetesClusterFeatureAvailabilityLifecycle : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterFeatureAvailabilityLifecycle GenerallyAvailable = @"GenerallyAvailable"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterFeatureAvailabilityLifecycle Preview = @"Preview"; - - /// - /// the value for an instance of the Enum. - /// - private string _value { get; set; } - - /// - /// Conversion from arbitrary object to KubernetesClusterFeatureAvailabilityLifecycle - /// - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new KubernetesClusterFeatureAvailabilityLifecycle(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type KubernetesClusterFeatureAvailabilityLifecycle - /// 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.NetworkCloud.Support.KubernetesClusterFeatureAvailabilityLifecycle e) - { - return _value.Equals(e._value); - } - - /// - /// Compares values of enum type KubernetesClusterFeatureAvailabilityLifecycle (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 KubernetesClusterFeatureAvailabilityLifecycle && Equals((KubernetesClusterFeatureAvailabilityLifecycle)obj); - } - - /// Returns hashCode for enum KubernetesClusterFeatureAvailabilityLifecycle - /// 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 KubernetesClusterFeatureAvailabilityLifecycle(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Returns string representation for KubernetesClusterFeatureAvailabilityLifecycle - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// - /// Implicit operator to convert string to KubernetesClusterFeatureAvailabilityLifecycle - /// - /// the value to convert to an instance of . - - public static implicit operator KubernetesClusterFeatureAvailabilityLifecycle(string value) - { - return new KubernetesClusterFeatureAvailabilityLifecycle(value); - } - - /// - /// Implicit operator to convert KubernetesClusterFeatureAvailabilityLifecycle to string - /// - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterFeatureAvailabilityLifecycle e) - { - return e._value; - } - - /// Overriding != operator for enum KubernetesClusterFeatureAvailabilityLifecycle - /// 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.NetworkCloud.Support.KubernetesClusterFeatureAvailabilityLifecycle e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterFeatureAvailabilityLifecycle e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum KubernetesClusterFeatureAvailabilityLifecycle - /// 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.NetworkCloud.Support.KubernetesClusterFeatureAvailabilityLifecycle e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterFeatureAvailabilityLifecycle e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/KubernetesClusterFeatureDetailedStatus.Completer.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/KubernetesClusterFeatureDetailedStatus.Completer.cs deleted file mode 100644 index a9cdc13bee07..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/KubernetesClusterFeatureDetailedStatus.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.NetworkCloud.Support -{ - - /// The detailed status of the feature. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterFeatureDetailedStatusTypeConverter))] - public partial struct KubernetesClusterFeatureDetailedStatus : - 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) || "Error".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Error'", "Error", global::System.Management.Automation.CompletionResultType.ParameterValue, "Error"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Provisioning".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Provisioning'", "Provisioning", global::System.Management.Automation.CompletionResultType.ParameterValue, "Provisioning"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Installed".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Installed'", "Installed", global::System.Management.Automation.CompletionResultType.ParameterValue, "Installed"); - } - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/KubernetesClusterFeatureDetailedStatus.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/KubernetesClusterFeatureDetailedStatus.TypeConverter.cs deleted file mode 100644 index 017a9c854d80..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/KubernetesClusterFeatureDetailedStatus.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.NetworkCloud.Support -{ - - /// The detailed status of the feature. - public partial class KubernetesClusterFeatureDetailedStatusTypeConverter : - 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) => KubernetesClusterFeatureDetailedStatus.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/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/KubernetesClusterFeatureDetailedStatus.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/KubernetesClusterFeatureDetailedStatus.cs deleted file mode 100644 index 3851fbd368ec..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/KubernetesClusterFeatureDetailedStatus.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.NetworkCloud.Support -{ - - /// The detailed status of the feature. - public partial struct KubernetesClusterFeatureDetailedStatus : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterFeatureDetailedStatus Error = @"Error"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterFeatureDetailedStatus Installed = @"Installed"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterFeatureDetailedStatus Provisioning = @"Provisioning"; - - /// - /// the value for an instance of the Enum. - /// - private string _value { get; set; } - - /// Conversion from arbitrary object to KubernetesClusterFeatureDetailedStatus - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new KubernetesClusterFeatureDetailedStatus(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type KubernetesClusterFeatureDetailedStatus - /// 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.NetworkCloud.Support.KubernetesClusterFeatureDetailedStatus e) - { - return _value.Equals(e._value); - } - - /// - /// Compares values of enum type KubernetesClusterFeatureDetailedStatus (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 KubernetesClusterFeatureDetailedStatus && Equals((KubernetesClusterFeatureDetailedStatus)obj); - } - - /// Returns hashCode for enum KubernetesClusterFeatureDetailedStatus - /// 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 KubernetesClusterFeatureDetailedStatus(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Returns string representation for KubernetesClusterFeatureDetailedStatus - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to KubernetesClusterFeatureDetailedStatus - /// the value to convert to an instance of . - - public static implicit operator KubernetesClusterFeatureDetailedStatus(string value) - { - return new KubernetesClusterFeatureDetailedStatus(value); - } - - /// Implicit operator to convert KubernetesClusterFeatureDetailedStatus to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterFeatureDetailedStatus e) - { - return e._value; - } - - /// Overriding != operator for enum KubernetesClusterFeatureDetailedStatus - /// 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.NetworkCloud.Support.KubernetesClusterFeatureDetailedStatus e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterFeatureDetailedStatus e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum KubernetesClusterFeatureDetailedStatus - /// 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.NetworkCloud.Support.KubernetesClusterFeatureDetailedStatus e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterFeatureDetailedStatus e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/KubernetesClusterFeatureProvisioningState.Completer.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/KubernetesClusterFeatureProvisioningState.Completer.cs deleted file mode 100644 index 571465c1ef77..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/KubernetesClusterFeatureProvisioningState.Completer.cs +++ /dev/null @@ -1,55 +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.NetworkCloud.Support -{ - - /// The provisioning state of the Kubernetes cluster feature. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterFeatureProvisioningStateTypeConverter))] - public partial struct KubernetesClusterFeatureProvisioningState : - 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) || "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) || "Deleting".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Deleting'", "Deleting", global::System.Management.Automation.CompletionResultType.ParameterValue, "Deleting"); - } - 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) || "Succeeded".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Succeeded'", "Succeeded", global::System.Management.Automation.CompletionResultType.ParameterValue, "Succeeded"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Updating".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Updating'", "Updating", global::System.Management.Automation.CompletionResultType.ParameterValue, "Updating"); - } - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/KubernetesClusterFeatureProvisioningState.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/KubernetesClusterFeatureProvisioningState.TypeConverter.cs deleted file mode 100644 index db19528a7532..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/KubernetesClusterFeatureProvisioningState.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.NetworkCloud.Support -{ - - /// The provisioning state of the Kubernetes cluster feature. - public partial class KubernetesClusterFeatureProvisioningStateTypeConverter : - 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) => KubernetesClusterFeatureProvisioningState.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/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/KubernetesClusterFeatureProvisioningState.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/KubernetesClusterFeatureProvisioningState.cs deleted file mode 100644 index 233349f4262b..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/KubernetesClusterFeatureProvisioningState.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.NetworkCloud.Support -{ - - /// The provisioning state of the Kubernetes cluster feature. - public partial struct KubernetesClusterFeatureProvisioningState : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterFeatureProvisioningState Accepted = @"Accepted"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterFeatureProvisioningState Canceled = @"Canceled"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterFeatureProvisioningState Deleting = @"Deleting"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterFeatureProvisioningState Failed = @"Failed"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterFeatureProvisioningState Succeeded = @"Succeeded"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterFeatureProvisioningState Updating = @"Updating"; - - /// - /// the value for an instance of the Enum. - /// - private string _value { get; set; } - - /// Conversion from arbitrary object to KubernetesClusterFeatureProvisioningState - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new KubernetesClusterFeatureProvisioningState(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type KubernetesClusterFeatureProvisioningState - /// 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.NetworkCloud.Support.KubernetesClusterFeatureProvisioningState e) - { - return _value.Equals(e._value); - } - - /// - /// Compares values of enum type KubernetesClusterFeatureProvisioningState (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 KubernetesClusterFeatureProvisioningState && Equals((KubernetesClusterFeatureProvisioningState)obj); - } - - /// Returns hashCode for enum KubernetesClusterFeatureProvisioningState - /// 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 KubernetesClusterFeatureProvisioningState(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Returns string representation for KubernetesClusterFeatureProvisioningState - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// - /// Implicit operator to convert string to KubernetesClusterFeatureProvisioningState - /// - /// the value to convert to an instance of . - - public static implicit operator KubernetesClusterFeatureProvisioningState(string value) - { - return new KubernetesClusterFeatureProvisioningState(value); - } - - /// - /// Implicit operator to convert KubernetesClusterFeatureProvisioningState to string - /// - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterFeatureProvisioningState e) - { - return e._value; - } - - /// Overriding != operator for enum KubernetesClusterFeatureProvisioningState - /// 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.NetworkCloud.Support.KubernetesClusterFeatureProvisioningState e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterFeatureProvisioningState e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum KubernetesClusterFeatureProvisioningState - /// 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.NetworkCloud.Support.KubernetesClusterFeatureProvisioningState e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterFeatureProvisioningState e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/KubernetesClusterFeatureRequired.Completer.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/KubernetesClusterFeatureRequired.Completer.cs deleted file mode 100644 index bcf030be4e54..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/KubernetesClusterFeatureRequired.Completer.cs +++ /dev/null @@ -1,42 +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.NetworkCloud.Support -{ - - /// - /// The indicator of if the feature is required or optional. Optional features may be deleted by the user, while required - /// features are managed with the kubernetes cluster lifecycle. - /// - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterFeatureRequiredTypeConverter))] - public partial struct KubernetesClusterFeatureRequired : - 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) || "True".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'True'", "True", global::System.Management.Automation.CompletionResultType.ParameterValue, "True"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "False".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'False'", "False", global::System.Management.Automation.CompletionResultType.ParameterValue, "False"); - } - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/KubernetesClusterFeatureRequired.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/KubernetesClusterFeatureRequired.TypeConverter.cs deleted file mode 100644 index 9fa67af25ceb..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/KubernetesClusterFeatureRequired.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.NetworkCloud.Support -{ - - /// - /// The indicator of if the feature is required or optional. Optional features may be deleted by the user, while required - /// features are managed with the kubernetes cluster lifecycle. - /// - public partial class KubernetesClusterFeatureRequiredTypeConverter : - 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) => KubernetesClusterFeatureRequired.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/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/KubernetesClusterFeatureRequired.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/KubernetesClusterFeatureRequired.cs deleted file mode 100644 index fef0e9029d0c..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/KubernetesClusterFeatureRequired.cs +++ /dev/null @@ -1,107 +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.NetworkCloud.Support -{ - - /// - /// The indicator of if the feature is required or optional. Optional features may be deleted by the user, while required - /// features are managed with the kubernetes cluster lifecycle. - /// - public partial struct KubernetesClusterFeatureRequired : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterFeatureRequired False = @"False"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterFeatureRequired True = @"True"; - - /// - /// the value for an instance of the Enum. - /// - private string _value { get; set; } - - /// Conversion from arbitrary object to KubernetesClusterFeatureRequired - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new KubernetesClusterFeatureRequired(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type KubernetesClusterFeatureRequired - /// 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.NetworkCloud.Support.KubernetesClusterFeatureRequired e) - { - return _value.Equals(e._value); - } - - /// - /// Compares values of enum type KubernetesClusterFeatureRequired (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 KubernetesClusterFeatureRequired && Equals((KubernetesClusterFeatureRequired)obj); - } - - /// Returns hashCode for enum KubernetesClusterFeatureRequired - /// 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 KubernetesClusterFeatureRequired(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Returns string representation for KubernetesClusterFeatureRequired - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to KubernetesClusterFeatureRequired - /// the value to convert to an instance of . - - public static implicit operator KubernetesClusterFeatureRequired(string value) - { - return new KubernetesClusterFeatureRequired(value); - } - - /// Implicit operator to convert KubernetesClusterFeatureRequired to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterFeatureRequired e) - { - return e._value; - } - - /// Overriding != operator for enum KubernetesClusterFeatureRequired - /// 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.NetworkCloud.Support.KubernetesClusterFeatureRequired e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterFeatureRequired e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum KubernetesClusterFeatureRequired - /// 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.NetworkCloud.Support.KubernetesClusterFeatureRequired e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterFeatureRequired e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/KubernetesClusterNodeDetailedStatus.Completer.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/KubernetesClusterNodeDetailedStatus.Completer.cs deleted file mode 100644 index ac582c211439..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/KubernetesClusterNodeDetailedStatus.Completer.cs +++ /dev/null @@ -1,63 +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.NetworkCloud.Support -{ - - /// The detailed state of this node. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterNodeDetailedStatusTypeConverter))] - public partial struct KubernetesClusterNodeDetailedStatus : - 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) || "Available".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Available'", "Available", global::System.Management.Automation.CompletionResultType.ParameterValue, "Available"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Error".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Error'", "Error", global::System.Management.Automation.CompletionResultType.ParameterValue, "Error"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Provisioning".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Provisioning'", "Provisioning", global::System.Management.Automation.CompletionResultType.ParameterValue, "Provisioning"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Running".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Running'", "Running", global::System.Management.Automation.CompletionResultType.ParameterValue, "Running"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Scheduling".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Scheduling'", "Scheduling", global::System.Management.Automation.CompletionResultType.ParameterValue, "Scheduling"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Stopped".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Stopped'", "Stopped", global::System.Management.Automation.CompletionResultType.ParameterValue, "Stopped"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Terminating".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Terminating'", "Terminating", global::System.Management.Automation.CompletionResultType.ParameterValue, "Terminating"); - } - 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"); - } - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/KubernetesClusterNodeDetailedStatus.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/KubernetesClusterNodeDetailedStatus.TypeConverter.cs deleted file mode 100644 index 475fb2eece60..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/KubernetesClusterNodeDetailedStatus.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.NetworkCloud.Support -{ - - /// The detailed state of this node. - public partial class KubernetesClusterNodeDetailedStatusTypeConverter : - 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) => KubernetesClusterNodeDetailedStatus.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/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/KubernetesClusterNodeDetailedStatus.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/KubernetesClusterNodeDetailedStatus.cs deleted file mode 100644 index 03ab055f7f4d..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/KubernetesClusterNodeDetailedStatus.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.NetworkCloud.Support -{ - - /// The detailed state of this node. - public partial struct KubernetesClusterNodeDetailedStatus : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterNodeDetailedStatus Available = @"Available"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterNodeDetailedStatus Error = @"Error"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterNodeDetailedStatus Provisioning = @"Provisioning"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterNodeDetailedStatus Running = @"Running"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterNodeDetailedStatus Scheduling = @"Scheduling"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterNodeDetailedStatus Stopped = @"Stopped"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterNodeDetailedStatus Terminating = @"Terminating"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterNodeDetailedStatus Unknown = @"Unknown"; - - /// - /// the value for an instance of the Enum. - /// - private string _value { get; set; } - - /// Conversion from arbitrary object to KubernetesClusterNodeDetailedStatus - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new KubernetesClusterNodeDetailedStatus(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type KubernetesClusterNodeDetailedStatus - /// 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.NetworkCloud.Support.KubernetesClusterNodeDetailedStatus e) - { - return _value.Equals(e._value); - } - - /// - /// Compares values of enum type KubernetesClusterNodeDetailedStatus (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 KubernetesClusterNodeDetailedStatus && Equals((KubernetesClusterNodeDetailedStatus)obj); - } - - /// Returns hashCode for enum KubernetesClusterNodeDetailedStatus - /// 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 KubernetesClusterNodeDetailedStatus(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Returns string representation for KubernetesClusterNodeDetailedStatus - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to KubernetesClusterNodeDetailedStatus - /// the value to convert to an instance of . - - public static implicit operator KubernetesClusterNodeDetailedStatus(string value) - { - return new KubernetesClusterNodeDetailedStatus(value); - } - - /// Implicit operator to convert KubernetesClusterNodeDetailedStatus to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterNodeDetailedStatus e) - { - return e._value; - } - - /// Overriding != operator for enum KubernetesClusterNodeDetailedStatus - /// 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.NetworkCloud.Support.KubernetesClusterNodeDetailedStatus e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterNodeDetailedStatus e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum KubernetesClusterNodeDetailedStatus - /// 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.NetworkCloud.Support.KubernetesClusterNodeDetailedStatus e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterNodeDetailedStatus e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/KubernetesClusterProvisioningState.Completer.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/KubernetesClusterProvisioningState.Completer.cs deleted file mode 100644 index 27b99f6822ba..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/KubernetesClusterProvisioningState.Completer.cs +++ /dev/null @@ -1,63 +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.NetworkCloud.Support -{ - - /// The provisioning state of the Kubernetes cluster resource. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterProvisioningStateTypeConverter))] - public partial struct KubernetesClusterProvisioningState : - 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) || "Succeeded".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Succeeded'", "Succeeded", global::System.Management.Automation.CompletionResultType.ParameterValue, "Succeeded"); - } - 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) || "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) || "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) || "InProgress".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'InProgress'", "InProgress", global::System.Management.Automation.CompletionResultType.ParameterValue, "InProgress"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Created".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Created'", "Created", global::System.Management.Automation.CompletionResultType.ParameterValue, "Created"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Updating".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Updating'", "Updating", global::System.Management.Automation.CompletionResultType.ParameterValue, "Updating"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Deleting".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Deleting'", "Deleting", global::System.Management.Automation.CompletionResultType.ParameterValue, "Deleting"); - } - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/KubernetesClusterProvisioningState.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/KubernetesClusterProvisioningState.TypeConverter.cs deleted file mode 100644 index 4ad11c4dcb78..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/KubernetesClusterProvisioningState.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.NetworkCloud.Support -{ - - /// The provisioning state of the Kubernetes cluster resource. - public partial class KubernetesClusterProvisioningStateTypeConverter : - 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) => KubernetesClusterProvisioningState.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/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/KubernetesClusterProvisioningState.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/KubernetesClusterProvisioningState.cs deleted file mode 100644 index c98285560de7..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/KubernetesClusterProvisioningState.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.NetworkCloud.Support -{ - - /// The provisioning state of the Kubernetes cluster resource. - public partial struct KubernetesClusterProvisioningState : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterProvisioningState Accepted = @"Accepted"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterProvisioningState Canceled = @"Canceled"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterProvisioningState Created = @"Created"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterProvisioningState Deleting = @"Deleting"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterProvisioningState Failed = @"Failed"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterProvisioningState InProgress = @"InProgress"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterProvisioningState Succeeded = @"Succeeded"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterProvisioningState Updating = @"Updating"; - - /// - /// the value for an instance of the Enum. - /// - private string _value { get; set; } - - /// Conversion from arbitrary object to KubernetesClusterProvisioningState - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new KubernetesClusterProvisioningState(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type KubernetesClusterProvisioningState - /// 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.NetworkCloud.Support.KubernetesClusterProvisioningState e) - { - return _value.Equals(e._value); - } - - /// - /// Compares values of enum type KubernetesClusterProvisioningState (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 KubernetesClusterProvisioningState && Equals((KubernetesClusterProvisioningState)obj); - } - - /// Returns hashCode for enum KubernetesClusterProvisioningState - /// 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 KubernetesClusterProvisioningState(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Returns string representation for KubernetesClusterProvisioningState - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to KubernetesClusterProvisioningState - /// the value to convert to an instance of . - - public static implicit operator KubernetesClusterProvisioningState(string value) - { - return new KubernetesClusterProvisioningState(value); - } - - /// Implicit operator to convert KubernetesClusterProvisioningState to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterProvisioningState e) - { - return e._value; - } - - /// Overriding != operator for enum KubernetesClusterProvisioningState - /// 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.NetworkCloud.Support.KubernetesClusterProvisioningState e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterProvisioningState e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum KubernetesClusterProvisioningState - /// 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.NetworkCloud.Support.KubernetesClusterProvisioningState e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesClusterProvisioningState e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/KubernetesNodePowerState.Completer.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/KubernetesNodePowerState.Completer.cs deleted file mode 100644 index b07685ab210c..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/KubernetesNodePowerState.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.NetworkCloud.Support -{ - - /// The power state of this node. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesNodePowerStateTypeConverter))] - public partial struct KubernetesNodePowerState : - 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) || "On".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'On'", "On", global::System.Management.Automation.CompletionResultType.ParameterValue, "On"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Off".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Off'", "Off", global::System.Management.Automation.CompletionResultType.ParameterValue, "Off"); - } - 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"); - } - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/KubernetesNodePowerState.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/KubernetesNodePowerState.TypeConverter.cs deleted file mode 100644 index c8c1fbde81ff..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/KubernetesNodePowerState.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.NetworkCloud.Support -{ - - /// The power state of this node. - public partial class KubernetesNodePowerStateTypeConverter : - 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) => KubernetesNodePowerState.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/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/KubernetesNodePowerState.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/KubernetesNodePowerState.cs deleted file mode 100644 index 87306e5bfac8..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/KubernetesNodePowerState.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.NetworkCloud.Support -{ - - /// The power state of this node. - public partial struct KubernetesNodePowerState : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesNodePowerState Off = @"Off"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesNodePowerState On = @"On"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesNodePowerState Unknown = @"Unknown"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Conversion from arbitrary object to KubernetesNodePowerState - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new KubernetesNodePowerState(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type KubernetesNodePowerState - /// 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.NetworkCloud.Support.KubernetesNodePowerState e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type KubernetesNodePowerState (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 KubernetesNodePowerState && Equals((KubernetesNodePowerState)obj); - } - - /// Returns hashCode for enum KubernetesNodePowerState - /// 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 KubernetesNodePowerState(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Returns string representation for KubernetesNodePowerState - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to KubernetesNodePowerState - /// the value to convert to an instance of . - - public static implicit operator KubernetesNodePowerState(string value) - { - return new KubernetesNodePowerState(value); - } - - /// Implicit operator to convert KubernetesNodePowerState to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesNodePowerState e) - { - return e._value; - } - - /// Overriding != operator for enum KubernetesNodePowerState - /// 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.NetworkCloud.Support.KubernetesNodePowerState e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesNodePowerState e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum KubernetesNodePowerState - /// 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.NetworkCloud.Support.KubernetesNodePowerState e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesNodePowerState e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/KubernetesNodeRole.Completer.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/KubernetesNodeRole.Completer.cs deleted file mode 100644 index 6629db6b97ab..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/KubernetesNodeRole.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.NetworkCloud.Support -{ - - /// The role of this node in the cluster. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesNodeRoleTypeConverter))] - public partial struct KubernetesNodeRole : - 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) || "ControlPlane".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'ControlPlane'", "ControlPlane", global::System.Management.Automation.CompletionResultType.ParameterValue, "ControlPlane"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Worker".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Worker'", "Worker", global::System.Management.Automation.CompletionResultType.ParameterValue, "Worker"); - } - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/KubernetesNodeRole.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/KubernetesNodeRole.TypeConverter.cs deleted file mode 100644 index ad9bff63fa7f..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/KubernetesNodeRole.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.NetworkCloud.Support -{ - - /// The role of this node in the cluster. - public partial class KubernetesNodeRoleTypeConverter : - 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) => KubernetesNodeRole.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/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/KubernetesNodeRole.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/KubernetesNodeRole.cs deleted file mode 100644 index a471dc79a552..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/KubernetesNodeRole.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.NetworkCloud.Support -{ - - /// The role of this node in the cluster. - public partial struct KubernetesNodeRole : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesNodeRole ControlPlane = @"ControlPlane"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesNodeRole Worker = @"Worker"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Conversion from arbitrary object to KubernetesNodeRole - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new KubernetesNodeRole(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type KubernetesNodeRole - /// 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.NetworkCloud.Support.KubernetesNodeRole e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type KubernetesNodeRole (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 KubernetesNodeRole && Equals((KubernetesNodeRole)obj); - } - - /// Returns hashCode for enum KubernetesNodeRole - /// 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 KubernetesNodeRole(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Returns string representation for KubernetesNodeRole - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to KubernetesNodeRole - /// the value to convert to an instance of . - - public static implicit operator KubernetesNodeRole(string value) - { - return new KubernetesNodeRole(value); - } - - /// Implicit operator to convert KubernetesNodeRole to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesNodeRole e) - { - return e._value; - } - - /// Overriding != operator for enum KubernetesNodeRole - /// 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.NetworkCloud.Support.KubernetesNodeRole e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesNodeRole e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum KubernetesNodeRole - /// 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.NetworkCloud.Support.KubernetesNodeRole e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesNodeRole e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/KubernetesPluginType.Completer.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/KubernetesPluginType.Completer.cs deleted file mode 100644 index d281792526c8..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/KubernetesPluginType.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.NetworkCloud.Support -{ - - /// The indicator of how this network will be utilized by the Kubernetes cluster. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesPluginTypeTypeConverter))] - public partial struct KubernetesPluginType : - 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) || "DPDK".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'DPDK'", "DPDK", global::System.Management.Automation.CompletionResultType.ParameterValue, "DPDK"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "SRIOV".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'SRIOV'", "SRIOV", global::System.Management.Automation.CompletionResultType.ParameterValue, "SRIOV"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "OSDevice".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'OSDevice'", "OSDevice", global::System.Management.Automation.CompletionResultType.ParameterValue, "OSDevice"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "MACVLAN".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'MACVLAN'", "MACVLAN", global::System.Management.Automation.CompletionResultType.ParameterValue, "MACVLAN"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "IPVLAN".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'IPVLAN'", "IPVLAN", global::System.Management.Automation.CompletionResultType.ParameterValue, "IPVLAN"); - } - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/KubernetesPluginType.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/KubernetesPluginType.TypeConverter.cs deleted file mode 100644 index 1c1bf587466a..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/KubernetesPluginType.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.NetworkCloud.Support -{ - - /// The indicator of how this network will be utilized by the Kubernetes cluster. - public partial class KubernetesPluginTypeTypeConverter : - 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) => KubernetesPluginType.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/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/KubernetesPluginType.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/KubernetesPluginType.cs deleted file mode 100644 index b48e5a972dfa..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/KubernetesPluginType.cs +++ /dev/null @@ -1,104 +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.NetworkCloud.Support -{ - - /// The indicator of how this network will be utilized by the Kubernetes cluster. - public partial struct KubernetesPluginType : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesPluginType Dpdk = @"DPDK"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesPluginType Ipvlan = @"IPVLAN"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesPluginType Macvlan = @"MACVLAN"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesPluginType OSDevice = @"OSDevice"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesPluginType Sriov = @"SRIOV"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Conversion from arbitrary object to KubernetesPluginType - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new KubernetesPluginType(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type KubernetesPluginType - /// 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.NetworkCloud.Support.KubernetesPluginType e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type KubernetesPluginType (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 KubernetesPluginType && Equals((KubernetesPluginType)obj); - } - - /// Returns hashCode for enum KubernetesPluginType - /// 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 KubernetesPluginType(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Returns string representation for KubernetesPluginType - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to KubernetesPluginType - /// the value to convert to an instance of . - - public static implicit operator KubernetesPluginType(string value) - { - return new KubernetesPluginType(value); - } - - /// Implicit operator to convert KubernetesPluginType to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesPluginType e) - { - return e._value; - } - - /// Overriding != operator for enum KubernetesPluginType - /// 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.NetworkCloud.Support.KubernetesPluginType e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesPluginType e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum KubernetesPluginType - /// 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.NetworkCloud.Support.KubernetesPluginType e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.KubernetesPluginType e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/L2NetworkDetailedStatus.Completer.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/L2NetworkDetailedStatus.Completer.cs deleted file mode 100644 index 6f8a2c905c85..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/L2NetworkDetailedStatus.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.NetworkCloud.Support -{ - - /// The more detailed status of the L2 network. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.L2NetworkDetailedStatusTypeConverter))] - public partial struct L2NetworkDetailedStatus : - 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) || "Error".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Error'", "Error", global::System.Management.Automation.CompletionResultType.ParameterValue, "Error"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Available".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Available'", "Available", global::System.Management.Automation.CompletionResultType.ParameterValue, "Available"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Provisioning".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Provisioning'", "Provisioning", global::System.Management.Automation.CompletionResultType.ParameterValue, "Provisioning"); - } - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/L2NetworkDetailedStatus.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/L2NetworkDetailedStatus.TypeConverter.cs deleted file mode 100644 index f6b794ceb82e..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/L2NetworkDetailedStatus.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.NetworkCloud.Support -{ - - /// The more detailed status of the L2 network. - public partial class L2NetworkDetailedStatusTypeConverter : - 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) => L2NetworkDetailedStatus.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/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/L2NetworkDetailedStatus.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/L2NetworkDetailedStatus.cs deleted file mode 100644 index 177ed8365ebe..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/L2NetworkDetailedStatus.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.NetworkCloud.Support -{ - - /// The more detailed status of the L2 network. - public partial struct L2NetworkDetailedStatus : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.L2NetworkDetailedStatus Available = @"Available"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.L2NetworkDetailedStatus Error = @"Error"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.L2NetworkDetailedStatus Provisioning = @"Provisioning"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Conversion from arbitrary object to L2NetworkDetailedStatus - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new L2NetworkDetailedStatus(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type L2NetworkDetailedStatus - /// 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.NetworkCloud.Support.L2NetworkDetailedStatus e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type L2NetworkDetailedStatus (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 L2NetworkDetailedStatus && Equals((L2NetworkDetailedStatus)obj); - } - - /// Returns hashCode for enum L2NetworkDetailedStatus - /// 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 L2NetworkDetailedStatus(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Returns string representation for L2NetworkDetailedStatus - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to L2NetworkDetailedStatus - /// the value to convert to an instance of . - - public static implicit operator L2NetworkDetailedStatus(string value) - { - return new L2NetworkDetailedStatus(value); - } - - /// Implicit operator to convert L2NetworkDetailedStatus to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.L2NetworkDetailedStatus e) - { - return e._value; - } - - /// Overriding != operator for enum L2NetworkDetailedStatus - /// 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.NetworkCloud.Support.L2NetworkDetailedStatus e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.L2NetworkDetailedStatus e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum L2NetworkDetailedStatus - /// 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.NetworkCloud.Support.L2NetworkDetailedStatus e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.L2NetworkDetailedStatus e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/L2NetworkProvisioningState.Completer.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/L2NetworkProvisioningState.Completer.cs deleted file mode 100644 index 6c13df428c06..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/L2NetworkProvisioningState.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.NetworkCloud.Support -{ - - /// The provisioning state of the L2 network. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.L2NetworkProvisioningStateTypeConverter))] - public partial struct L2NetworkProvisioningState : - 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) || "Succeeded".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Succeeded'", "Succeeded", global::System.Management.Automation.CompletionResultType.ParameterValue, "Succeeded"); - } - 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) || "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) || "Provisioning".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Provisioning'", "Provisioning", global::System.Management.Automation.CompletionResultType.ParameterValue, "Provisioning"); - } - 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"); - } - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/L2NetworkProvisioningState.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/L2NetworkProvisioningState.TypeConverter.cs deleted file mode 100644 index dc1710f25ccb..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/L2NetworkProvisioningState.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.NetworkCloud.Support -{ - - /// The provisioning state of the L2 network. - public partial class L2NetworkProvisioningStateTypeConverter : - 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) => L2NetworkProvisioningState.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/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/L2NetworkProvisioningState.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/L2NetworkProvisioningState.cs deleted file mode 100644 index ae0e040f14a9..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/L2NetworkProvisioningState.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.NetworkCloud.Support -{ - - /// The provisioning state of the L2 network. - public partial struct L2NetworkProvisioningState : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.L2NetworkProvisioningState Accepted = @"Accepted"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.L2NetworkProvisioningState Canceled = @"Canceled"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.L2NetworkProvisioningState Failed = @"Failed"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.L2NetworkProvisioningState Provisioning = @"Provisioning"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.L2NetworkProvisioningState Succeeded = @"Succeeded"; - - /// - /// the value for an instance of the Enum. - /// - private string _value { get; set; } - - /// Conversion from arbitrary object to L2NetworkProvisioningState - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new L2NetworkProvisioningState(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type L2NetworkProvisioningState - /// 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.NetworkCloud.Support.L2NetworkProvisioningState e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type L2NetworkProvisioningState (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 L2NetworkProvisioningState && Equals((L2NetworkProvisioningState)obj); - } - - /// Returns hashCode for enum L2NetworkProvisioningState - /// 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 L2NetworkProvisioningState(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Returns string representation for L2NetworkProvisioningState - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to L2NetworkProvisioningState - /// the value to convert to an instance of . - - public static implicit operator L2NetworkProvisioningState(string value) - { - return new L2NetworkProvisioningState(value); - } - - /// Implicit operator to convert L2NetworkProvisioningState to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.L2NetworkProvisioningState e) - { - return e._value; - } - - /// Overriding != operator for enum L2NetworkProvisioningState - /// 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.NetworkCloud.Support.L2NetworkProvisioningState e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.L2NetworkProvisioningState e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum L2NetworkProvisioningState - /// 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.NetworkCloud.Support.L2NetworkProvisioningState e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.L2NetworkProvisioningState e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/L3NetworkConfigurationIpamEnabled.Completer.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/L3NetworkConfigurationIpamEnabled.Completer.cs deleted file mode 100644 index 3402c7691fa3..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/L3NetworkConfigurationIpamEnabled.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.NetworkCloud.Support -{ - - /// - /// The indication of whether this network will or will not perform IP address management and allocate IP addresses when attached. - /// - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.L3NetworkConfigurationIpamEnabledTypeConverter))] - public partial struct L3NetworkConfigurationIpamEnabled : - 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) || "True".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'True'", "True", global::System.Management.Automation.CompletionResultType.ParameterValue, "True"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "False".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'False'", "False", global::System.Management.Automation.CompletionResultType.ParameterValue, "False"); - } - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/L3NetworkConfigurationIpamEnabled.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/L3NetworkConfigurationIpamEnabled.TypeConverter.cs deleted file mode 100644 index 772e3bdfd73c..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/L3NetworkConfigurationIpamEnabled.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.NetworkCloud.Support -{ - - /// - /// The indication of whether this network will or will not perform IP address management and allocate IP addresses when attached. - /// - public partial class L3NetworkConfigurationIpamEnabledTypeConverter : - 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) => L3NetworkConfigurationIpamEnabled.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/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/L3NetworkConfigurationIpamEnabled.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/L3NetworkConfigurationIpamEnabled.cs deleted file mode 100644 index 0f1f8a34b8b2..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/L3NetworkConfigurationIpamEnabled.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.NetworkCloud.Support -{ - - /// - /// The indication of whether this network will or will not perform IP address management and allocate IP addresses when attached. - /// - public partial struct L3NetworkConfigurationIpamEnabled : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.L3NetworkConfigurationIpamEnabled False = @"False"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.L3NetworkConfigurationIpamEnabled True = @"True"; - - /// - /// the value for an instance of the Enum. - /// - private string _value { get; set; } - - /// Conversion from arbitrary object to L3NetworkConfigurationIpamEnabled - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new L3NetworkConfigurationIpamEnabled(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type L3NetworkConfigurationIpamEnabled - /// 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.NetworkCloud.Support.L3NetworkConfigurationIpamEnabled e) - { - return _value.Equals(e._value); - } - - /// - /// Compares values of enum type L3NetworkConfigurationIpamEnabled (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 L3NetworkConfigurationIpamEnabled && Equals((L3NetworkConfigurationIpamEnabled)obj); - } - - /// Returns hashCode for enum L3NetworkConfigurationIpamEnabled - /// 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 L3NetworkConfigurationIpamEnabled(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Returns string representation for L3NetworkConfigurationIpamEnabled - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to L3NetworkConfigurationIpamEnabled - /// the value to convert to an instance of . - - public static implicit operator L3NetworkConfigurationIpamEnabled(string value) - { - return new L3NetworkConfigurationIpamEnabled(value); - } - - /// Implicit operator to convert L3NetworkConfigurationIpamEnabled to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.L3NetworkConfigurationIpamEnabled e) - { - return e._value; - } - - /// Overriding != operator for enum L3NetworkConfigurationIpamEnabled - /// 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.NetworkCloud.Support.L3NetworkConfigurationIpamEnabled e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.L3NetworkConfigurationIpamEnabled e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum L3NetworkConfigurationIpamEnabled - /// 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.NetworkCloud.Support.L3NetworkConfigurationIpamEnabled e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.L3NetworkConfigurationIpamEnabled e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/L3NetworkDetailedStatus.Completer.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/L3NetworkDetailedStatus.Completer.cs deleted file mode 100644 index 545e2801ed71..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/L3NetworkDetailedStatus.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.NetworkCloud.Support -{ - - /// The more detailed status of the L3 network. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.L3NetworkDetailedStatusTypeConverter))] - public partial struct L3NetworkDetailedStatus : - 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) || "Error".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Error'", "Error", global::System.Management.Automation.CompletionResultType.ParameterValue, "Error"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Available".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Available'", "Available", global::System.Management.Automation.CompletionResultType.ParameterValue, "Available"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Provisioning".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Provisioning'", "Provisioning", global::System.Management.Automation.CompletionResultType.ParameterValue, "Provisioning"); - } - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/L3NetworkDetailedStatus.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/L3NetworkDetailedStatus.TypeConverter.cs deleted file mode 100644 index 1322c4c7d03f..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/L3NetworkDetailedStatus.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.NetworkCloud.Support -{ - - /// The more detailed status of the L3 network. - public partial class L3NetworkDetailedStatusTypeConverter : - 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) => L3NetworkDetailedStatus.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/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/L3NetworkDetailedStatus.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/L3NetworkDetailedStatus.cs deleted file mode 100644 index aedd02f589d6..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/L3NetworkDetailedStatus.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.NetworkCloud.Support -{ - - /// The more detailed status of the L3 network. - public partial struct L3NetworkDetailedStatus : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.L3NetworkDetailedStatus Available = @"Available"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.L3NetworkDetailedStatus Error = @"Error"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.L3NetworkDetailedStatus Provisioning = @"Provisioning"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Conversion from arbitrary object to L3NetworkDetailedStatus - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new L3NetworkDetailedStatus(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type L3NetworkDetailedStatus - /// 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.NetworkCloud.Support.L3NetworkDetailedStatus e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type L3NetworkDetailedStatus (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 L3NetworkDetailedStatus && Equals((L3NetworkDetailedStatus)obj); - } - - /// Returns hashCode for enum L3NetworkDetailedStatus - /// 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 L3NetworkDetailedStatus(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Returns string representation for L3NetworkDetailedStatus - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to L3NetworkDetailedStatus - /// the value to convert to an instance of . - - public static implicit operator L3NetworkDetailedStatus(string value) - { - return new L3NetworkDetailedStatus(value); - } - - /// Implicit operator to convert L3NetworkDetailedStatus to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.L3NetworkDetailedStatus e) - { - return e._value; - } - - /// Overriding != operator for enum L3NetworkDetailedStatus - /// 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.NetworkCloud.Support.L3NetworkDetailedStatus e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.L3NetworkDetailedStatus e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum L3NetworkDetailedStatus - /// 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.NetworkCloud.Support.L3NetworkDetailedStatus e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.L3NetworkDetailedStatus e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/L3NetworkProvisioningState.Completer.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/L3NetworkProvisioningState.Completer.cs deleted file mode 100644 index 467dca43bf26..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/L3NetworkProvisioningState.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.NetworkCloud.Support -{ - - /// The provisioning state of the L3 network. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.L3NetworkProvisioningStateTypeConverter))] - public partial struct L3NetworkProvisioningState : - 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) || "Succeeded".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Succeeded'", "Succeeded", global::System.Management.Automation.CompletionResultType.ParameterValue, "Succeeded"); - } - 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) || "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) || "Provisioning".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Provisioning'", "Provisioning", global::System.Management.Automation.CompletionResultType.ParameterValue, "Provisioning"); - } - 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"); - } - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/L3NetworkProvisioningState.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/L3NetworkProvisioningState.TypeConverter.cs deleted file mode 100644 index d2cfd70e30cd..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/L3NetworkProvisioningState.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.NetworkCloud.Support -{ - - /// The provisioning state of the L3 network. - public partial class L3NetworkProvisioningStateTypeConverter : - 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) => L3NetworkProvisioningState.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/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/L3NetworkProvisioningState.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/L3NetworkProvisioningState.cs deleted file mode 100644 index cd315fe26162..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/L3NetworkProvisioningState.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.NetworkCloud.Support -{ - - /// The provisioning state of the L3 network. - public partial struct L3NetworkProvisioningState : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.L3NetworkProvisioningState Accepted = @"Accepted"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.L3NetworkProvisioningState Canceled = @"Canceled"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.L3NetworkProvisioningState Failed = @"Failed"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.L3NetworkProvisioningState Provisioning = @"Provisioning"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.L3NetworkProvisioningState Succeeded = @"Succeeded"; - - /// - /// the value for an instance of the Enum. - /// - private string _value { get; set; } - - /// Conversion from arbitrary object to L3NetworkProvisioningState - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new L3NetworkProvisioningState(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type L3NetworkProvisioningState - /// 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.NetworkCloud.Support.L3NetworkProvisioningState e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type L3NetworkProvisioningState (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 L3NetworkProvisioningState && Equals((L3NetworkProvisioningState)obj); - } - - /// Returns hashCode for enum L3NetworkProvisioningState - /// 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 L3NetworkProvisioningState(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Returns string representation for L3NetworkProvisioningState - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to L3NetworkProvisioningState - /// the value to convert to an instance of . - - public static implicit operator L3NetworkProvisioningState(string value) - { - return new L3NetworkProvisioningState(value); - } - - /// Implicit operator to convert L3NetworkProvisioningState to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.L3NetworkProvisioningState e) - { - return e._value; - } - - /// Overriding != operator for enum L3NetworkProvisioningState - /// 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.NetworkCloud.Support.L3NetworkProvisioningState e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.L3NetworkProvisioningState e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum L3NetworkProvisioningState - /// 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.NetworkCloud.Support.L3NetworkProvisioningState e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.L3NetworkProvisioningState e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/MachineSkuDiskConnectionType.Completer.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/MachineSkuDiskConnectionType.Completer.cs deleted file mode 100644 index 41881e5fe327..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/MachineSkuDiskConnectionType.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.NetworkCloud.Support -{ - - /// The connection type of the rack SKU resource. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.MachineSkuDiskConnectionTypeTypeConverter))] - public partial struct MachineSkuDiskConnectionType : - 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) || "PCIE".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'PCIE'", "PCIE", global::System.Management.Automation.CompletionResultType.ParameterValue, "PCIE"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "SATA".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'SATA'", "SATA", global::System.Management.Automation.CompletionResultType.ParameterValue, "SATA"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "RAID".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'RAID'", "RAID", global::System.Management.Automation.CompletionResultType.ParameterValue, "RAID"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "SAS".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'SAS'", "SAS", global::System.Management.Automation.CompletionResultType.ParameterValue, "SAS"); - } - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/MachineSkuDiskConnectionType.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/MachineSkuDiskConnectionType.TypeConverter.cs deleted file mode 100644 index 40c26a0224e9..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/MachineSkuDiskConnectionType.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.NetworkCloud.Support -{ - - /// The connection type of the rack SKU resource. - public partial class MachineSkuDiskConnectionTypeTypeConverter : - 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) => MachineSkuDiskConnectionType.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/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/MachineSkuDiskConnectionType.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/MachineSkuDiskConnectionType.cs deleted file mode 100644 index 41b7cae11904..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/MachineSkuDiskConnectionType.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.NetworkCloud.Support -{ - - /// The connection type of the rack SKU resource. - public partial struct MachineSkuDiskConnectionType : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.MachineSkuDiskConnectionType Pcie = @"PCIE"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.MachineSkuDiskConnectionType Raid = @"RAID"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.MachineSkuDiskConnectionType Sas = @"SAS"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.MachineSkuDiskConnectionType Sata = @"SATA"; - - /// - /// the value for an instance of the Enum. - /// - private string _value { get; set; } - - /// Conversion from arbitrary object to MachineSkuDiskConnectionType - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new MachineSkuDiskConnectionType(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type MachineSkuDiskConnectionType - /// 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.NetworkCloud.Support.MachineSkuDiskConnectionType e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type MachineSkuDiskConnectionType (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 MachineSkuDiskConnectionType && Equals((MachineSkuDiskConnectionType)obj); - } - - /// Returns hashCode for enum MachineSkuDiskConnectionType - /// 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 MachineSkuDiskConnectionType(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Returns string representation for MachineSkuDiskConnectionType - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to MachineSkuDiskConnectionType - /// the value to convert to an instance of . - - public static implicit operator MachineSkuDiskConnectionType(string value) - { - return new MachineSkuDiskConnectionType(value); - } - - /// Implicit operator to convert MachineSkuDiskConnectionType to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.MachineSkuDiskConnectionType e) - { - return e._value; - } - - /// Overriding != operator for enum MachineSkuDiskConnectionType - /// 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.NetworkCloud.Support.MachineSkuDiskConnectionType e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.MachineSkuDiskConnectionType e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum MachineSkuDiskConnectionType - /// 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.NetworkCloud.Support.MachineSkuDiskConnectionType e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.MachineSkuDiskConnectionType e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ManagedServiceIdentitySelectorType.Completer.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ManagedServiceIdentitySelectorType.Completer.cs deleted file mode 100644 index d3700ce140fd..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ManagedServiceIdentitySelectorType.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.NetworkCloud.Support -{ - - /// The type of managed identity that is being selected. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorTypeTypeConverter))] - public partial struct ManagedServiceIdentitySelectorType : - 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) || "SystemAssignedIdentity".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'SystemAssignedIdentity'", "SystemAssignedIdentity", global::System.Management.Automation.CompletionResultType.ParameterValue, "SystemAssignedIdentity"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "UserAssignedIdentity".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'UserAssignedIdentity'", "UserAssignedIdentity", global::System.Management.Automation.CompletionResultType.ParameterValue, "UserAssignedIdentity"); - } - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ManagedServiceIdentitySelectorType.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ManagedServiceIdentitySelectorType.TypeConverter.cs deleted file mode 100644 index 25a904fa7284..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ManagedServiceIdentitySelectorType.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.NetworkCloud.Support -{ - - /// The type of managed identity that is being selected. - public partial class ManagedServiceIdentitySelectorTypeTypeConverter : - 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) => ManagedServiceIdentitySelectorType.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/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ManagedServiceIdentitySelectorType.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ManagedServiceIdentitySelectorType.cs deleted file mode 100644 index 18a0d7c6bd6f..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ManagedServiceIdentitySelectorType.cs +++ /dev/null @@ -1,104 +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.NetworkCloud.Support -{ - - /// The type of managed identity that is being selected. - public partial struct ManagedServiceIdentitySelectorType : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType SystemAssignedIdentity = @"SystemAssignedIdentity"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType UserAssignedIdentity = @"UserAssignedIdentity"; - - /// - /// the value for an instance of the Enum. - /// - private string _value { get; set; } - - /// Conversion from arbitrary object to ManagedServiceIdentitySelectorType - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new ManagedServiceIdentitySelectorType(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type ManagedServiceIdentitySelectorType - /// 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.NetworkCloud.Support.ManagedServiceIdentitySelectorType e) - { - return _value.Equals(e._value); - } - - /// - /// Compares values of enum type ManagedServiceIdentitySelectorType (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 ManagedServiceIdentitySelectorType && Equals((ManagedServiceIdentitySelectorType)obj); - } - - /// Returns hashCode for enum ManagedServiceIdentitySelectorType - /// 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 ManagedServiceIdentitySelectorType(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Returns string representation for ManagedServiceIdentitySelectorType - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to ManagedServiceIdentitySelectorType - /// the value to convert to an instance of . - - public static implicit operator ManagedServiceIdentitySelectorType(string value) - { - return new ManagedServiceIdentitySelectorType(value); - } - - /// Implicit operator to convert ManagedServiceIdentitySelectorType to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType e) - { - return e._value; - } - - /// Overriding != operator for enum ManagedServiceIdentitySelectorType - /// 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.NetworkCloud.Support.ManagedServiceIdentitySelectorType e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum ManagedServiceIdentitySelectorType - /// 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.NetworkCloud.Support.ManagedServiceIdentitySelectorType e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ManagedServiceIdentityType.Completer.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ManagedServiceIdentityType.Completer.cs deleted file mode 100644 index 1b69e6c08f85..000000000000 --- a/generated/NetworkCloud/NetworkCloud.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.NetworkCloud.Support -{ - - /// - /// Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). - /// - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ManagedServiceIdentityType.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ManagedServiceIdentityType.TypeConverter.cs deleted file mode 100644 index 0f10a4333f9e..000000000000 --- a/generated/NetworkCloud/NetworkCloud.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.NetworkCloud.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/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ManagedServiceIdentityType.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ManagedServiceIdentityType.cs deleted file mode 100644 index fe9a67dc1d96..000000000000 --- a/generated/NetworkCloud/NetworkCloud.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.NetworkCloud.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.NetworkCloud.Support.ManagedServiceIdentityType None = @"None"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentityType SystemAssigned = @"SystemAssigned"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentityType SystemAssignedUserAssigned = @"SystemAssigned,UserAssigned"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Support.ManagedServiceIdentityType e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Support.ManagedServiceIdentityType e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentityType e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/OSDiskCreateOption.Completer.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/OSDiskCreateOption.Completer.cs deleted file mode 100644 index 2e367b5c87eb..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/OSDiskCreateOption.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.NetworkCloud.Support -{ - - /// The strategy for creating the OS disk. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.OSDiskCreateOptionTypeConverter))] - public partial struct OSDiskCreateOption : - 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) || "Ephemeral".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Ephemeral'", "Ephemeral", global::System.Management.Automation.CompletionResultType.ParameterValue, "Ephemeral"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Persistent".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Persistent'", "Persistent", global::System.Management.Automation.CompletionResultType.ParameterValue, "Persistent"); - } - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/OSDiskCreateOption.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/OSDiskCreateOption.TypeConverter.cs deleted file mode 100644 index c5f1be296cd6..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/OSDiskCreateOption.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.NetworkCloud.Support -{ - - /// The strategy for creating the OS disk. - public partial class OSDiskCreateOptionTypeConverter : - 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) => OSDiskCreateOption.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/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/OSDiskCreateOption.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/OSDiskCreateOption.cs deleted file mode 100644 index 2f276ec3c448..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/OSDiskCreateOption.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.NetworkCloud.Support -{ - - /// The strategy for creating the OS disk. - public partial struct OSDiskCreateOption : - System.IEquatable - { - /// Utilize the local storage of the host machine. - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.OSDiskCreateOption Ephemeral = @"Ephemeral"; - - /// Utilize a storage appliance backed volume to host the disk. - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.OSDiskCreateOption Persistent = @"Persistent"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Conversion from arbitrary object to OSDiskCreateOption - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new OSDiskCreateOption(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type OSDiskCreateOption - /// 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.NetworkCloud.Support.OSDiskCreateOption e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type OSDiskCreateOption (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 OSDiskCreateOption && Equals((OSDiskCreateOption)obj); - } - - /// Returns hashCode for enum OSDiskCreateOption - /// 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 OSDiskCreateOption(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Returns string representation for OSDiskCreateOption - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to OSDiskCreateOption - /// the value to convert to an instance of . - - public static implicit operator OSDiskCreateOption(string value) - { - return new OSDiskCreateOption(value); - } - - /// Implicit operator to convert OSDiskCreateOption to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.OSDiskCreateOption e) - { - return e._value; - } - - /// Overriding != operator for enum OSDiskCreateOption - /// 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.NetworkCloud.Support.OSDiskCreateOption e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.OSDiskCreateOption e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum OSDiskCreateOption - /// 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.NetworkCloud.Support.OSDiskCreateOption e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.OSDiskCreateOption e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/OSDiskDeleteOption.Completer.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/OSDiskDeleteOption.Completer.cs deleted file mode 100644 index 906ad6de6d34..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/OSDiskDeleteOption.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.NetworkCloud.Support -{ - - /// The strategy for deleting the OS disk. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.OSDiskDeleteOptionTypeConverter))] - public partial struct OSDiskDeleteOption : - 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) || "Delete".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Delete'", "Delete", global::System.Management.Automation.CompletionResultType.ParameterValue, "Delete"); - } - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/OSDiskDeleteOption.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/OSDiskDeleteOption.TypeConverter.cs deleted file mode 100644 index 610f8d813ae0..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/OSDiskDeleteOption.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.NetworkCloud.Support -{ - - /// The strategy for deleting the OS disk. - public partial class OSDiskDeleteOptionTypeConverter : - 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) => OSDiskDeleteOption.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/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/OSDiskDeleteOption.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/OSDiskDeleteOption.cs deleted file mode 100644 index f32f54ec3b34..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/OSDiskDeleteOption.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.NetworkCloud.Support -{ - - /// The strategy for deleting the OS disk. - public partial struct OSDiskDeleteOption : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.OSDiskDeleteOption Delete = @"Delete"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Conversion from arbitrary object to OSDiskDeleteOption - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new OSDiskDeleteOption(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type OSDiskDeleteOption - /// 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.NetworkCloud.Support.OSDiskDeleteOption e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type OSDiskDeleteOption (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 OSDiskDeleteOption && Equals((OSDiskDeleteOption)obj); - } - - /// Returns hashCode for enum OSDiskDeleteOption - /// 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 OSDiskDeleteOption(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Returns string representation for OSDiskDeleteOption - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to OSDiskDeleteOption - /// the value to convert to an instance of . - - public static implicit operator OSDiskDeleteOption(string value) - { - return new OSDiskDeleteOption(value); - } - - /// Implicit operator to convert OSDiskDeleteOption to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.OSDiskDeleteOption e) - { - return e._value; - } - - /// Overriding != operator for enum OSDiskDeleteOption - /// 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.NetworkCloud.Support.OSDiskDeleteOption e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.OSDiskDeleteOption e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum OSDiskDeleteOption - /// 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.NetworkCloud.Support.OSDiskDeleteOption e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.OSDiskDeleteOption e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/Origin.Completer.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/Origin.Completer.cs deleted file mode 100644 index 9c1c7c873e6f..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/Origin.Completer.cs +++ /dev/null @@ -1,46 +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.NetworkCloud.Support -{ - - /// - /// The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is - /// "user,system" - /// - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.OriginTypeConverter))] - public partial struct Origin : - 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) || "system".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'system'", "system", global::System.Management.Automation.CompletionResultType.ParameterValue, "system"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "user,system".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'user,system'", "user,system", global::System.Management.Automation.CompletionResultType.ParameterValue, "user,system"); - } - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/Origin.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/Origin.TypeConverter.cs deleted file mode 100644 index b1262902e438..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/Origin.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.NetworkCloud.Support -{ - - /// - /// The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is - /// "user,system" - /// - public partial class OriginTypeConverter : - 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) => Origin.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/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/Origin.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/Origin.cs deleted file mode 100644 index 09d1cbd9a7c6..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/Origin.cs +++ /dev/null @@ -1,103 +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.NetworkCloud.Support -{ - - /// - /// The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is - /// "user,system" - /// - public partial struct Origin : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.Origin System = @"system"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.Origin User = @"user"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.Origin UserSystem = @"user,system"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Conversion from arbitrary object to Origin - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new Origin(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type Origin - /// the value to compare against this instance. - /// true if the two instances are equal to the same value - public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.Origin e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type Origin (override for Object) - /// the value to compare against this instance. - /// true if the two instances are equal to the same value - public override bool Equals(object obj) - { - return obj is Origin && Equals((Origin)obj); - } - - /// Returns hashCode for enum Origin - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Creates an instance of the Enum class. - /// the value to create an instance for. - private Origin(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Returns string representation for Origin - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to Origin - /// the value to convert to an instance of . - - public static implicit operator Origin(string value) - { - return new Origin(value); - } - - /// Implicit operator to convert Origin to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.Origin e) - { - return e._value; - } - - /// Overriding != operator for enum Origin - /// the value to compare against - /// the value to compare against - /// true if the two instances are not equal to the same value - public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.Origin e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.Origin e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum Origin - /// the value to compare against - /// the value to compare against - /// true if the two instances are equal to the same value - public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.Origin e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.Origin e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/RackDetailedStatus.Completer.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/RackDetailedStatus.Completer.cs deleted file mode 100644 index 9f2ea59b3ab2..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/RackDetailedStatus.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.NetworkCloud.Support -{ - - /// The more detailed status of the rack. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RackDetailedStatusTypeConverter))] - public partial struct RackDetailedStatus : - 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) || "Error".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Error'", "Error", global::System.Management.Automation.CompletionResultType.ParameterValue, "Error"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Available".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Available'", "Available", global::System.Management.Automation.CompletionResultType.ParameterValue, "Available"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Provisioning".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Provisioning'", "Provisioning", global::System.Management.Automation.CompletionResultType.ParameterValue, "Provisioning"); - } - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/RackDetailedStatus.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/RackDetailedStatus.TypeConverter.cs deleted file mode 100644 index e5ba72f6bc81..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/RackDetailedStatus.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.NetworkCloud.Support -{ - - /// The more detailed status of the rack. - public partial class RackDetailedStatusTypeConverter : - 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) => RackDetailedStatus.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/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/RackDetailedStatus.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/RackDetailedStatus.cs deleted file mode 100644 index 3599cfe85e75..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/RackDetailedStatus.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.NetworkCloud.Support -{ - - /// The more detailed status of the rack. - public partial struct RackDetailedStatus : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RackDetailedStatus Available = @"Available"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RackDetailedStatus Error = @"Error"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RackDetailedStatus Provisioning = @"Provisioning"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Conversion from arbitrary object to RackDetailedStatus - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new RackDetailedStatus(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type RackDetailedStatus - /// 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.NetworkCloud.Support.RackDetailedStatus e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type RackDetailedStatus (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 RackDetailedStatus && Equals((RackDetailedStatus)obj); - } - - /// Returns hashCode for enum RackDetailedStatus - /// 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 RackDetailedStatus(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Returns string representation for RackDetailedStatus - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to RackDetailedStatus - /// the value to convert to an instance of . - - public static implicit operator RackDetailedStatus(string value) - { - return new RackDetailedStatus(value); - } - - /// Implicit operator to convert RackDetailedStatus to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RackDetailedStatus e) - { - return e._value; - } - - /// Overriding != operator for enum RackDetailedStatus - /// 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.NetworkCloud.Support.RackDetailedStatus e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RackDetailedStatus e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum RackDetailedStatus - /// 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.NetworkCloud.Support.RackDetailedStatus e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RackDetailedStatus e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/RackProvisioningState.Completer.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/RackProvisioningState.Completer.cs deleted file mode 100644 index 1eda7f39e107..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/RackProvisioningState.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.NetworkCloud.Support -{ - - /// The provisioning state of the rack resource. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RackProvisioningStateTypeConverter))] - public partial struct RackProvisioningState : - 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) || "Succeeded".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Succeeded'", "Succeeded", global::System.Management.Automation.CompletionResultType.ParameterValue, "Succeeded"); - } - 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) || "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) || "Provisioning".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Provisioning'", "Provisioning", global::System.Management.Automation.CompletionResultType.ParameterValue, "Provisioning"); - } - 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"); - } - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/RackProvisioningState.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/RackProvisioningState.TypeConverter.cs deleted file mode 100644 index 38a2f76be6a9..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/RackProvisioningState.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.NetworkCloud.Support -{ - - /// The provisioning state of the rack resource. - public partial class RackProvisioningStateTypeConverter : - 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) => RackProvisioningState.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/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/RackProvisioningState.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/RackProvisioningState.cs deleted file mode 100644 index 18f496cb4447..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/RackProvisioningState.cs +++ /dev/null @@ -1,104 +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.NetworkCloud.Support -{ - - /// The provisioning state of the rack resource. - public partial struct RackProvisioningState : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RackProvisioningState Accepted = @"Accepted"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RackProvisioningState Canceled = @"Canceled"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RackProvisioningState Failed = @"Failed"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RackProvisioningState Provisioning = @"Provisioning"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RackProvisioningState Succeeded = @"Succeeded"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Conversion from arbitrary object to RackProvisioningState - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new RackProvisioningState(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type RackProvisioningState - /// 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.NetworkCloud.Support.RackProvisioningState e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type RackProvisioningState (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 RackProvisioningState && Equals((RackProvisioningState)obj); - } - - /// Returns hashCode for enum RackProvisioningState - /// 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 RackProvisioningState(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Returns string representation for RackProvisioningState - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to RackProvisioningState - /// the value to convert to an instance of . - - public static implicit operator RackProvisioningState(string value) - { - return new RackProvisioningState(value); - } - - /// Implicit operator to convert RackProvisioningState to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RackProvisioningState e) - { - return e._value; - } - - /// Overriding != operator for enum RackProvisioningState - /// 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.NetworkCloud.Support.RackProvisioningState e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RackProvisioningState e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum RackProvisioningState - /// 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.NetworkCloud.Support.RackProvisioningState e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RackProvisioningState e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/RackSkuProvisioningState.Completer.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/RackSkuProvisioningState.Completer.cs deleted file mode 100644 index af544a4b234a..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/RackSkuProvisioningState.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.NetworkCloud.Support -{ - - /// The provisioning state of the rack SKU resource. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RackSkuProvisioningStateTypeConverter))] - public partial struct RackSkuProvisioningState : - 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) || "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) || "Succeeded".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Succeeded'", "Succeeded", global::System.Management.Automation.CompletionResultType.ParameterValue, "Succeeded"); - } - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/RackSkuProvisioningState.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/RackSkuProvisioningState.TypeConverter.cs deleted file mode 100644 index 058399f37eb4..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/RackSkuProvisioningState.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.NetworkCloud.Support -{ - - /// The provisioning state of the rack SKU resource. - public partial class RackSkuProvisioningStateTypeConverter : - 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) => RackSkuProvisioningState.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/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/RackSkuProvisioningState.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/RackSkuProvisioningState.cs deleted file mode 100644 index 7264bdc7cfd3..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/RackSkuProvisioningState.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.NetworkCloud.Support -{ - - /// The provisioning state of the rack SKU resource. - public partial struct RackSkuProvisioningState : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RackSkuProvisioningState Canceled = @"Canceled"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RackSkuProvisioningState Failed = @"Failed"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RackSkuProvisioningState Succeeded = @"Succeeded"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Conversion from arbitrary object to RackSkuProvisioningState - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new RackSkuProvisioningState(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type RackSkuProvisioningState - /// 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.NetworkCloud.Support.RackSkuProvisioningState e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type RackSkuProvisioningState (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 RackSkuProvisioningState && Equals((RackSkuProvisioningState)obj); - } - - /// Returns hashCode for enum RackSkuProvisioningState - /// 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 RackSkuProvisioningState(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Returns string representation for RackSkuProvisioningState - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to RackSkuProvisioningState - /// the value to convert to an instance of . - - public static implicit operator RackSkuProvisioningState(string value) - { - return new RackSkuProvisioningState(value); - } - - /// Implicit operator to convert RackSkuProvisioningState to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RackSkuProvisioningState e) - { - return e._value; - } - - /// Overriding != operator for enum RackSkuProvisioningState - /// 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.NetworkCloud.Support.RackSkuProvisioningState e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RackSkuProvisioningState e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum RackSkuProvisioningState - /// 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.NetworkCloud.Support.RackSkuProvisioningState e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RackSkuProvisioningState e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/RackSkuType.Completer.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/RackSkuType.Completer.cs deleted file mode 100644 index 55ed4daa62b9..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/RackSkuType.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.NetworkCloud.Support -{ - - /// The type of the rack. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RackSkuTypeTypeConverter))] - public partial struct RackSkuType : - 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) || "Aggregator".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Aggregator'", "Aggregator", global::System.Management.Automation.CompletionResultType.ParameterValue, "Aggregator"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Compute".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Compute'", "Compute", global::System.Management.Automation.CompletionResultType.ParameterValue, "Compute"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Single".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Single'", "Single", global::System.Management.Automation.CompletionResultType.ParameterValue, "Single"); - } - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/RackSkuType.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/RackSkuType.TypeConverter.cs deleted file mode 100644 index 292a0e9fed94..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/RackSkuType.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.NetworkCloud.Support -{ - - /// The type of the rack. - public partial class RackSkuTypeTypeConverter : - 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) => RackSkuType.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/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/RackSkuType.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/RackSkuType.cs deleted file mode 100644 index 79ebbaf3239b..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/RackSkuType.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.NetworkCloud.Support -{ - - /// The type of the rack. - public partial struct RackSkuType : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RackSkuType Aggregator = @"Aggregator"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RackSkuType Compute = @"Compute"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RackSkuType Single = @"Single"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Conversion from arbitrary object to RackSkuType - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new RackSkuType(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type RackSkuType - /// 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.NetworkCloud.Support.RackSkuType e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type RackSkuType (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 RackSkuType && Equals((RackSkuType)obj); - } - - /// Returns hashCode for enum RackSkuType - /// 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 RackSkuType(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Returns string representation for RackSkuType - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to RackSkuType - /// the value to convert to an instance of . - - public static implicit operator RackSkuType(string value) - { - return new RackSkuType(value); - } - - /// Implicit operator to convert RackSkuType to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RackSkuType e) - { - return e._value; - } - - /// Overriding != operator for enum RackSkuType - /// 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.NetworkCloud.Support.RackSkuType e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RackSkuType e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum RackSkuType - /// 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.NetworkCloud.Support.RackSkuType e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RackSkuType e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/RemoteVendorManagementFeature.Completer.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/RemoteVendorManagementFeature.Completer.cs deleted file mode 100644 index b8560c8ff1df..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/RemoteVendorManagementFeature.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.NetworkCloud.Support -{ - - /// - /// The indicator of whether the storage appliance supports remote vendor management. - /// - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RemoteVendorManagementFeatureTypeConverter))] - public partial struct RemoteVendorManagementFeature : - 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) || "Supported".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Supported'", "Supported", global::System.Management.Automation.CompletionResultType.ParameterValue, "Supported"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Unsupported".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Unsupported'", "Unsupported", global::System.Management.Automation.CompletionResultType.ParameterValue, "Unsupported"); - } - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/RemoteVendorManagementFeature.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/RemoteVendorManagementFeature.TypeConverter.cs deleted file mode 100644 index 77a85e0e1cc9..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/RemoteVendorManagementFeature.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.NetworkCloud.Support -{ - - /// - /// The indicator of whether the storage appliance supports remote vendor management. - /// - public partial class RemoteVendorManagementFeatureTypeConverter : - 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) => RemoteVendorManagementFeature.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/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/RemoteVendorManagementFeature.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/RemoteVendorManagementFeature.cs deleted file mode 100644 index f22d7e521486..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/RemoteVendorManagementFeature.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.NetworkCloud.Support -{ - - /// - /// The indicator of whether the storage appliance supports remote vendor management. - /// - public partial struct RemoteVendorManagementFeature : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RemoteVendorManagementFeature Supported = @"Supported"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RemoteVendorManagementFeature Unsupported = @"Unsupported"; - - /// - /// the value for an instance of the Enum. - /// - private string _value { get; set; } - - /// Conversion from arbitrary object to RemoteVendorManagementFeature - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new RemoteVendorManagementFeature(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type RemoteVendorManagementFeature - /// 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.NetworkCloud.Support.RemoteVendorManagementFeature e) - { - return _value.Equals(e._value); - } - - /// - /// Compares values of enum type RemoteVendorManagementFeature (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 RemoteVendorManagementFeature && Equals((RemoteVendorManagementFeature)obj); - } - - /// Returns hashCode for enum RemoteVendorManagementFeature - /// 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 RemoteVendorManagementFeature(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Returns string representation for RemoteVendorManagementFeature - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to RemoteVendorManagementFeature - /// the value to convert to an instance of . - - public static implicit operator RemoteVendorManagementFeature(string value) - { - return new RemoteVendorManagementFeature(value); - } - - /// Implicit operator to convert RemoteVendorManagementFeature to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RemoteVendorManagementFeature e) - { - return e._value; - } - - /// Overriding != operator for enum RemoteVendorManagementFeature - /// 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.NetworkCloud.Support.RemoteVendorManagementFeature e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RemoteVendorManagementFeature e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum RemoteVendorManagementFeature - /// 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.NetworkCloud.Support.RemoteVendorManagementFeature e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RemoteVendorManagementFeature e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/RemoteVendorManagementStatus.Completer.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/RemoteVendorManagementStatus.Completer.cs deleted file mode 100644 index 9d170f6cb69b..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/RemoteVendorManagementStatus.Completer.cs +++ /dev/null @@ -1,46 +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.NetworkCloud.Support -{ - - /// - /// The indicator of whether the remote vendor management feature is enabled or disabled, or unsupported if it is an unsupported - /// feature. - /// - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RemoteVendorManagementStatusTypeConverter))] - public partial struct RemoteVendorManagementStatus : - 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"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Unsupported".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Unsupported'", "Unsupported", global::System.Management.Automation.CompletionResultType.ParameterValue, "Unsupported"); - } - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/RemoteVendorManagementStatus.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/RemoteVendorManagementStatus.TypeConverter.cs deleted file mode 100644 index eab7e47a2370..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/RemoteVendorManagementStatus.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.NetworkCloud.Support -{ - - /// - /// The indicator of whether the remote vendor management feature is enabled or disabled, or unsupported if it is an unsupported - /// feature. - /// - public partial class RemoteVendorManagementStatusTypeConverter : - 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) => RemoteVendorManagementStatus.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/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/RemoteVendorManagementStatus.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/RemoteVendorManagementStatus.cs deleted file mode 100644 index 3d0adfd4da20..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/RemoteVendorManagementStatus.cs +++ /dev/null @@ -1,107 +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.NetworkCloud.Support -{ - - /// - /// The indicator of whether the remote vendor management feature is enabled or disabled, or unsupported if it is an unsupported - /// feature. - /// - public partial struct RemoteVendorManagementStatus : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RemoteVendorManagementStatus Disabled = @"Disabled"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RemoteVendorManagementStatus Enabled = @"Enabled"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RemoteVendorManagementStatus Unsupported = @"Unsupported"; - - /// - /// the value for an instance of the Enum. - /// - private string _value { get; set; } - - /// Conversion from arbitrary object to RemoteVendorManagementStatus - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new RemoteVendorManagementStatus(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type RemoteVendorManagementStatus - /// 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.NetworkCloud.Support.RemoteVendorManagementStatus e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type RemoteVendorManagementStatus (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 RemoteVendorManagementStatus && Equals((RemoteVendorManagementStatus)obj); - } - - /// Returns hashCode for enum RemoteVendorManagementStatus - /// 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 RemoteVendorManagementStatus(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Returns string representation for RemoteVendorManagementStatus - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to RemoteVendorManagementStatus - /// the value to convert to an instance of . - - public static implicit operator RemoteVendorManagementStatus(string value) - { - return new RemoteVendorManagementStatus(value); - } - - /// Implicit operator to convert RemoteVendorManagementStatus to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RemoteVendorManagementStatus e) - { - return e._value; - } - - /// Overriding != operator for enum RemoteVendorManagementStatus - /// 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.NetworkCloud.Support.RemoteVendorManagementStatus e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RemoteVendorManagementStatus e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum RemoteVendorManagementStatus - /// 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.NetworkCloud.Support.RemoteVendorManagementStatus e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RemoteVendorManagementStatus e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/RuntimeProtectionEnforcementLevel.Completer.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/RuntimeProtectionEnforcementLevel.Completer.cs deleted file mode 100644 index b0f40a0e4e46..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/RuntimeProtectionEnforcementLevel.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.NetworkCloud.Support -{ - - /// The mode of operation for runtime protection. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RuntimeProtectionEnforcementLevelTypeConverter))] - public partial struct RuntimeProtectionEnforcementLevel : - 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) || "Audit".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Audit'", "Audit", global::System.Management.Automation.CompletionResultType.ParameterValue, "Audit"); - } - 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"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "OnDemand".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'OnDemand'", "OnDemand", global::System.Management.Automation.CompletionResultType.ParameterValue, "OnDemand"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Passive".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Passive'", "Passive", global::System.Management.Automation.CompletionResultType.ParameterValue, "Passive"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "RealTime".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'RealTime'", "RealTime", global::System.Management.Automation.CompletionResultType.ParameterValue, "RealTime"); - } - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/RuntimeProtectionEnforcementLevel.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/RuntimeProtectionEnforcementLevel.TypeConverter.cs deleted file mode 100644 index a4930a6afa86..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/RuntimeProtectionEnforcementLevel.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.NetworkCloud.Support -{ - - /// The mode of operation for runtime protection. - public partial class RuntimeProtectionEnforcementLevelTypeConverter : - 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) => RuntimeProtectionEnforcementLevel.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/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/RuntimeProtectionEnforcementLevel.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/RuntimeProtectionEnforcementLevel.cs deleted file mode 100644 index 689d365460ca..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/RuntimeProtectionEnforcementLevel.cs +++ /dev/null @@ -1,110 +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.NetworkCloud.Support -{ - - /// The mode of operation for runtime protection. - public partial struct RuntimeProtectionEnforcementLevel : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RuntimeProtectionEnforcementLevel Audit = @"Audit"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RuntimeProtectionEnforcementLevel Disabled = @"Disabled"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RuntimeProtectionEnforcementLevel OnDemand = @"OnDemand"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RuntimeProtectionEnforcementLevel Passive = @"Passive"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RuntimeProtectionEnforcementLevel RealTime = @"RealTime"; - - /// - /// the value for an instance of the Enum. - /// - private string _value { get; set; } - - /// Conversion from arbitrary object to RuntimeProtectionEnforcementLevel - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new RuntimeProtectionEnforcementLevel(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type RuntimeProtectionEnforcementLevel - /// 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.NetworkCloud.Support.RuntimeProtectionEnforcementLevel e) - { - return _value.Equals(e._value); - } - - /// - /// Compares values of enum type RuntimeProtectionEnforcementLevel (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 RuntimeProtectionEnforcementLevel && Equals((RuntimeProtectionEnforcementLevel)obj); - } - - /// Returns hashCode for enum RuntimeProtectionEnforcementLevel - /// 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 RuntimeProtectionEnforcementLevel(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Returns string representation for RuntimeProtectionEnforcementLevel - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to RuntimeProtectionEnforcementLevel - /// the value to convert to an instance of . - - public static implicit operator RuntimeProtectionEnforcementLevel(string value) - { - return new RuntimeProtectionEnforcementLevel(value); - } - - /// Implicit operator to convert RuntimeProtectionEnforcementLevel to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RuntimeProtectionEnforcementLevel e) - { - return e._value; - } - - /// Overriding != operator for enum RuntimeProtectionEnforcementLevel - /// 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.NetworkCloud.Support.RuntimeProtectionEnforcementLevel e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RuntimeProtectionEnforcementLevel e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum RuntimeProtectionEnforcementLevel - /// 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.NetworkCloud.Support.RuntimeProtectionEnforcementLevel e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RuntimeProtectionEnforcementLevel e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/SkipShutdown.Completer.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/SkipShutdown.Completer.cs deleted file mode 100644 index 8d4165d36f8f..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/SkipShutdown.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.NetworkCloud.Support -{ - - /// - /// The indicator of whether to skip the graceful OS shutdown and power off the virtual machine immediately. - /// - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.SkipShutdownTypeConverter))] - public partial struct SkipShutdown : - 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) || "True".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'True'", "True", global::System.Management.Automation.CompletionResultType.ParameterValue, "True"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "False".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'False'", "False", global::System.Management.Automation.CompletionResultType.ParameterValue, "False"); - } - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/SkipShutdown.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/SkipShutdown.TypeConverter.cs deleted file mode 100644 index 2010405456eb..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/SkipShutdown.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.NetworkCloud.Support -{ - - /// - /// The indicator of whether to skip the graceful OS shutdown and power off the virtual machine immediately. - /// - public partial class SkipShutdownTypeConverter : - 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) => SkipShutdown.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/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/SkipShutdown.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/SkipShutdown.cs deleted file mode 100644 index f83e0b62939b..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/SkipShutdown.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.NetworkCloud.Support -{ - - /// - /// The indicator of whether to skip the graceful OS shutdown and power off the virtual machine immediately. - /// - public partial struct SkipShutdown : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.SkipShutdown False = @"False"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.SkipShutdown True = @"True"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Conversion from arbitrary object to SkipShutdown - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new SkipShutdown(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type SkipShutdown - /// 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.NetworkCloud.Support.SkipShutdown e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type SkipShutdown (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 SkipShutdown && Equals((SkipShutdown)obj); - } - - /// Returns hashCode for enum SkipShutdown - /// 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 SkipShutdown(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Returns string representation for SkipShutdown - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to SkipShutdown - /// the value to convert to an instance of . - - public static implicit operator SkipShutdown(string value) - { - return new SkipShutdown(value); - } - - /// Implicit operator to convert SkipShutdown to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.SkipShutdown e) - { - return e._value; - } - - /// Overriding != operator for enum SkipShutdown - /// 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.NetworkCloud.Support.SkipShutdown e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.SkipShutdown e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum SkipShutdown - /// 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.NetworkCloud.Support.SkipShutdown e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.SkipShutdown e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/StorageApplianceDetailedStatus.Completer.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/StorageApplianceDetailedStatus.Completer.cs deleted file mode 100644 index f886bd037df6..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/StorageApplianceDetailedStatus.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.NetworkCloud.Support -{ - - /// The detailed status of the storage appliance. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.StorageApplianceDetailedStatusTypeConverter))] - public partial struct StorageApplianceDetailedStatus : - 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) || "Available".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Available'", "Available", global::System.Management.Automation.CompletionResultType.ParameterValue, "Available"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Degraded".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Degraded'", "Degraded", global::System.Management.Automation.CompletionResultType.ParameterValue, "Degraded"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Error".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Error'", "Error", global::System.Management.Automation.CompletionResultType.ParameterValue, "Error"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Provisioning".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Provisioning'", "Provisioning", global::System.Management.Automation.CompletionResultType.ParameterValue, "Provisioning"); - } - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/StorageApplianceDetailedStatus.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/StorageApplianceDetailedStatus.TypeConverter.cs deleted file mode 100644 index d1d2fa935268..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/StorageApplianceDetailedStatus.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.NetworkCloud.Support -{ - - /// The detailed status of the storage appliance. - public partial class StorageApplianceDetailedStatusTypeConverter : - 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) => StorageApplianceDetailedStatus.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/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/StorageApplianceDetailedStatus.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/StorageApplianceDetailedStatus.cs deleted file mode 100644 index 5b61bea2ab0f..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/StorageApplianceDetailedStatus.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.NetworkCloud.Support -{ - - /// The detailed status of the storage appliance. - public partial struct StorageApplianceDetailedStatus : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.StorageApplianceDetailedStatus Available = @"Available"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.StorageApplianceDetailedStatus Degraded = @"Degraded"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.StorageApplianceDetailedStatus Error = @"Error"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.StorageApplianceDetailedStatus Provisioning = @"Provisioning"; - - /// - /// the value for an instance of the Enum. - /// - private string _value { get; set; } - - /// Conversion from arbitrary object to StorageApplianceDetailedStatus - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new StorageApplianceDetailedStatus(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type StorageApplianceDetailedStatus - /// 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.NetworkCloud.Support.StorageApplianceDetailedStatus e) - { - return _value.Equals(e._value); - } - - /// - /// Compares values of enum type StorageApplianceDetailedStatus (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 StorageApplianceDetailedStatus && Equals((StorageApplianceDetailedStatus)obj); - } - - /// Returns hashCode for enum StorageApplianceDetailedStatus - /// 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 StorageApplianceDetailedStatus(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Returns string representation for StorageApplianceDetailedStatus - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to StorageApplianceDetailedStatus - /// the value to convert to an instance of . - - public static implicit operator StorageApplianceDetailedStatus(string value) - { - return new StorageApplianceDetailedStatus(value); - } - - /// Implicit operator to convert StorageApplianceDetailedStatus to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.StorageApplianceDetailedStatus e) - { - return e._value; - } - - /// Overriding != operator for enum StorageApplianceDetailedStatus - /// 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.NetworkCloud.Support.StorageApplianceDetailedStatus e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.StorageApplianceDetailedStatus e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum StorageApplianceDetailedStatus - /// 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.NetworkCloud.Support.StorageApplianceDetailedStatus e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.StorageApplianceDetailedStatus e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/StorageApplianceProvisioningState.Completer.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/StorageApplianceProvisioningState.Completer.cs deleted file mode 100644 index ad1af84948b1..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/StorageApplianceProvisioningState.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.NetworkCloud.Support -{ - - /// The provisioning state of the storage appliance. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.StorageApplianceProvisioningStateTypeConverter))] - public partial struct StorageApplianceProvisioningState : - 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) || "Succeeded".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Succeeded'", "Succeeded", global::System.Management.Automation.CompletionResultType.ParameterValue, "Succeeded"); - } - 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) || "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) || "Provisioning".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Provisioning'", "Provisioning", global::System.Management.Automation.CompletionResultType.ParameterValue, "Provisioning"); - } - 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"); - } - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/StorageApplianceProvisioningState.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/StorageApplianceProvisioningState.TypeConverter.cs deleted file mode 100644 index 6aba4631efdb..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/StorageApplianceProvisioningState.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.NetworkCloud.Support -{ - - /// The provisioning state of the storage appliance. - public partial class StorageApplianceProvisioningStateTypeConverter : - 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) => StorageApplianceProvisioningState.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/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/StorageApplianceProvisioningState.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/StorageApplianceProvisioningState.cs deleted file mode 100644 index 70130d25fc90..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/StorageApplianceProvisioningState.cs +++ /dev/null @@ -1,110 +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.NetworkCloud.Support -{ - - /// The provisioning state of the storage appliance. - public partial struct StorageApplianceProvisioningState : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.StorageApplianceProvisioningState Accepted = @"Accepted"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.StorageApplianceProvisioningState Canceled = @"Canceled"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.StorageApplianceProvisioningState Failed = @"Failed"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.StorageApplianceProvisioningState Provisioning = @"Provisioning"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.StorageApplianceProvisioningState Succeeded = @"Succeeded"; - - /// - /// the value for an instance of the Enum. - /// - private string _value { get; set; } - - /// Conversion from arbitrary object to StorageApplianceProvisioningState - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new StorageApplianceProvisioningState(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type StorageApplianceProvisioningState - /// 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.NetworkCloud.Support.StorageApplianceProvisioningState e) - { - return _value.Equals(e._value); - } - - /// - /// Compares values of enum type StorageApplianceProvisioningState (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 StorageApplianceProvisioningState && Equals((StorageApplianceProvisioningState)obj); - } - - /// Returns hashCode for enum StorageApplianceProvisioningState - /// 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 StorageApplianceProvisioningState(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Returns string representation for StorageApplianceProvisioningState - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to StorageApplianceProvisioningState - /// the value to convert to an instance of . - - public static implicit operator StorageApplianceProvisioningState(string value) - { - return new StorageApplianceProvisioningState(value); - } - - /// Implicit operator to convert StorageApplianceProvisioningState to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.StorageApplianceProvisioningState e) - { - return e._value; - } - - /// Overriding != operator for enum StorageApplianceProvisioningState - /// 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.NetworkCloud.Support.StorageApplianceProvisioningState e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.StorageApplianceProvisioningState e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum StorageApplianceProvisioningState - /// 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.NetworkCloud.Support.StorageApplianceProvisioningState e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.StorageApplianceProvisioningState e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/TrunkedNetworkDetailedStatus.Completer.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/TrunkedNetworkDetailedStatus.Completer.cs deleted file mode 100644 index 1b00f7ef9e11..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/TrunkedNetworkDetailedStatus.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.NetworkCloud.Support -{ - - /// The more detailed status of the trunked network. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.TrunkedNetworkDetailedStatusTypeConverter))] - public partial struct TrunkedNetworkDetailedStatus : - 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) || "Error".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Error'", "Error", global::System.Management.Automation.CompletionResultType.ParameterValue, "Error"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Available".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Available'", "Available", global::System.Management.Automation.CompletionResultType.ParameterValue, "Available"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Provisioning".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Provisioning'", "Provisioning", global::System.Management.Automation.CompletionResultType.ParameterValue, "Provisioning"); - } - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/TrunkedNetworkDetailedStatus.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/TrunkedNetworkDetailedStatus.TypeConverter.cs deleted file mode 100644 index 32461708ea87..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/TrunkedNetworkDetailedStatus.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.NetworkCloud.Support -{ - - /// The more detailed status of the trunked network. - public partial class TrunkedNetworkDetailedStatusTypeConverter : - 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) => TrunkedNetworkDetailedStatus.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/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/TrunkedNetworkDetailedStatus.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/TrunkedNetworkDetailedStatus.cs deleted file mode 100644 index a98243d0eead..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/TrunkedNetworkDetailedStatus.cs +++ /dev/null @@ -1,104 +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.NetworkCloud.Support -{ - - /// The more detailed status of the trunked network. - public partial struct TrunkedNetworkDetailedStatus : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.TrunkedNetworkDetailedStatus Available = @"Available"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.TrunkedNetworkDetailedStatus Error = @"Error"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.TrunkedNetworkDetailedStatus Provisioning = @"Provisioning"; - - /// - /// the value for an instance of the Enum. - /// - private string _value { get; set; } - - /// Conversion from arbitrary object to TrunkedNetworkDetailedStatus - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new TrunkedNetworkDetailedStatus(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type TrunkedNetworkDetailedStatus - /// 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.NetworkCloud.Support.TrunkedNetworkDetailedStatus e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type TrunkedNetworkDetailedStatus (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 TrunkedNetworkDetailedStatus && Equals((TrunkedNetworkDetailedStatus)obj); - } - - /// Returns hashCode for enum TrunkedNetworkDetailedStatus - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Returns string representation for TrunkedNetworkDetailedStatus - /// 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 TrunkedNetworkDetailedStatus(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Implicit operator to convert string to TrunkedNetworkDetailedStatus - /// the value to convert to an instance of . - - public static implicit operator TrunkedNetworkDetailedStatus(string value) - { - return new TrunkedNetworkDetailedStatus(value); - } - - /// Implicit operator to convert TrunkedNetworkDetailedStatus to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.TrunkedNetworkDetailedStatus e) - { - return e._value; - } - - /// Overriding != operator for enum TrunkedNetworkDetailedStatus - /// 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.NetworkCloud.Support.TrunkedNetworkDetailedStatus e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.TrunkedNetworkDetailedStatus e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum TrunkedNetworkDetailedStatus - /// 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.NetworkCloud.Support.TrunkedNetworkDetailedStatus e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.TrunkedNetworkDetailedStatus e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/TrunkedNetworkProvisioningState.Completer.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/TrunkedNetworkProvisioningState.Completer.cs deleted file mode 100644 index 1de7c539e547..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/TrunkedNetworkProvisioningState.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.NetworkCloud.Support -{ - - /// The provisioning state of the trunked network. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.TrunkedNetworkProvisioningStateTypeConverter))] - public partial struct TrunkedNetworkProvisioningState : - 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) || "Succeeded".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Succeeded'", "Succeeded", global::System.Management.Automation.CompletionResultType.ParameterValue, "Succeeded"); - } - 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) || "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) || "Provisioning".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Provisioning'", "Provisioning", global::System.Management.Automation.CompletionResultType.ParameterValue, "Provisioning"); - } - 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"); - } - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/TrunkedNetworkProvisioningState.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/TrunkedNetworkProvisioningState.TypeConverter.cs deleted file mode 100644 index 403c07084cf0..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/TrunkedNetworkProvisioningState.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.NetworkCloud.Support -{ - - /// The provisioning state of the trunked network. - public partial class TrunkedNetworkProvisioningStateTypeConverter : - 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) => TrunkedNetworkProvisioningState.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/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/TrunkedNetworkProvisioningState.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/TrunkedNetworkProvisioningState.cs deleted file mode 100644 index c867bda3c5d1..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/TrunkedNetworkProvisioningState.cs +++ /dev/null @@ -1,110 +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.NetworkCloud.Support -{ - - /// The provisioning state of the trunked network. - public partial struct TrunkedNetworkProvisioningState : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.TrunkedNetworkProvisioningState Accepted = @"Accepted"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.TrunkedNetworkProvisioningState Canceled = @"Canceled"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.TrunkedNetworkProvisioningState Failed = @"Failed"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.TrunkedNetworkProvisioningState Provisioning = @"Provisioning"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.TrunkedNetworkProvisioningState Succeeded = @"Succeeded"; - - /// - /// the value for an instance of the Enum. - /// - private string _value { get; set; } - - /// Conversion from arbitrary object to TrunkedNetworkProvisioningState - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new TrunkedNetworkProvisioningState(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type TrunkedNetworkProvisioningState - /// 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.NetworkCloud.Support.TrunkedNetworkProvisioningState e) - { - return _value.Equals(e._value); - } - - /// - /// Compares values of enum type TrunkedNetworkProvisioningState (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 TrunkedNetworkProvisioningState && Equals((TrunkedNetworkProvisioningState)obj); - } - - /// Returns hashCode for enum TrunkedNetworkProvisioningState - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Returns string representation for TrunkedNetworkProvisioningState - /// 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 TrunkedNetworkProvisioningState(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Implicit operator to convert string to TrunkedNetworkProvisioningState - /// the value to convert to an instance of . - - public static implicit operator TrunkedNetworkProvisioningState(string value) - { - return new TrunkedNetworkProvisioningState(value); - } - - /// Implicit operator to convert TrunkedNetworkProvisioningState to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.TrunkedNetworkProvisioningState e) - { - return e._value; - } - - /// Overriding != operator for enum TrunkedNetworkProvisioningState - /// 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.NetworkCloud.Support.TrunkedNetworkProvisioningState e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.TrunkedNetworkProvisioningState e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum TrunkedNetworkProvisioningState - /// 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.NetworkCloud.Support.TrunkedNetworkProvisioningState e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.TrunkedNetworkProvisioningState e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ValidationThresholdGrouping.Completer.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ValidationThresholdGrouping.Completer.cs deleted file mode 100644 index 837c71a8df83..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ValidationThresholdGrouping.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.NetworkCloud.Support -{ - - /// Selection of how the type evaluation is applied to the cluster calculation. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdGroupingTypeConverter))] - public partial struct ValidationThresholdGrouping : - 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) || "PerCluster".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'PerCluster'", "PerCluster", global::System.Management.Automation.CompletionResultType.ParameterValue, "PerCluster"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "PerRack".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'PerRack'", "PerRack", global::System.Management.Automation.CompletionResultType.ParameterValue, "PerRack"); - } - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ValidationThresholdGrouping.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ValidationThresholdGrouping.TypeConverter.cs deleted file mode 100644 index 813fe893cedb..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ValidationThresholdGrouping.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.NetworkCloud.Support -{ - - /// Selection of how the type evaluation is applied to the cluster calculation. - public partial class ValidationThresholdGroupingTypeConverter : - 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) => ValidationThresholdGrouping.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/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ValidationThresholdGrouping.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ValidationThresholdGrouping.cs deleted file mode 100644 index 0c91c27d9114..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ValidationThresholdGrouping.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.NetworkCloud.Support -{ - - /// Selection of how the type evaluation is applied to the cluster calculation. - public partial struct ValidationThresholdGrouping : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdGrouping PerCluster = @"PerCluster"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdGrouping PerRack = @"PerRack"; - - /// - /// the value for an instance of the Enum. - /// - private string _value { get; set; } - - /// Conversion from arbitrary object to ValidationThresholdGrouping - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new ValidationThresholdGrouping(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type ValidationThresholdGrouping - /// 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.NetworkCloud.Support.ValidationThresholdGrouping e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type ValidationThresholdGrouping (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 ValidationThresholdGrouping && Equals((ValidationThresholdGrouping)obj); - } - - /// Returns hashCode for enum ValidationThresholdGrouping - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Returns string representation for ValidationThresholdGrouping - /// 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 ValidationThresholdGrouping(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Implicit operator to convert string to ValidationThresholdGrouping - /// the value to convert to an instance of . - - public static implicit operator ValidationThresholdGrouping(string value) - { - return new ValidationThresholdGrouping(value); - } - - /// Implicit operator to convert ValidationThresholdGrouping to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdGrouping e) - { - return e._value; - } - - /// Overriding != operator for enum ValidationThresholdGrouping - /// 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.NetworkCloud.Support.ValidationThresholdGrouping e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdGrouping e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum ValidationThresholdGrouping - /// 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.NetworkCloud.Support.ValidationThresholdGrouping e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdGrouping e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ValidationThresholdType.Completer.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ValidationThresholdType.Completer.cs deleted file mode 100644 index 83800f819325..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ValidationThresholdType.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.NetworkCloud.Support -{ - - /// Selection of how the threshold should be evaluated. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdTypeTypeConverter))] - public partial struct ValidationThresholdType : - 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) || "CountSuccess".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'CountSuccess'", "CountSuccess", global::System.Management.Automation.CompletionResultType.ParameterValue, "CountSuccess"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "PercentSuccess".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'PercentSuccess'", "PercentSuccess", global::System.Management.Automation.CompletionResultType.ParameterValue, "PercentSuccess"); - } - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ValidationThresholdType.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ValidationThresholdType.TypeConverter.cs deleted file mode 100644 index 9a4d4e79d3f1..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ValidationThresholdType.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.NetworkCloud.Support -{ - - /// Selection of how the threshold should be evaluated. - public partial class ValidationThresholdTypeTypeConverter : - 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) => ValidationThresholdType.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/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ValidationThresholdType.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ValidationThresholdType.cs deleted file mode 100644 index 673713d39e39..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/ValidationThresholdType.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.NetworkCloud.Support -{ - - /// Selection of how the threshold should be evaluated. - public partial struct ValidationThresholdType : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdType CountSuccess = @"CountSuccess"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdType PercentSuccess = @"PercentSuccess"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Conversion from arbitrary object to ValidationThresholdType - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new ValidationThresholdType(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type ValidationThresholdType - /// 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.NetworkCloud.Support.ValidationThresholdType e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type ValidationThresholdType (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 ValidationThresholdType && Equals((ValidationThresholdType)obj); - } - - /// Returns hashCode for enum ValidationThresholdType - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Returns string representation for ValidationThresholdType - /// 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 ValidationThresholdType(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Implicit operator to convert string to ValidationThresholdType - /// the value to convert to an instance of . - - public static implicit operator ValidationThresholdType(string value) - { - return new ValidationThresholdType(value); - } - - /// Implicit operator to convert ValidationThresholdType to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdType e) - { - return e._value; - } - - /// Overriding != operator for enum ValidationThresholdType - /// 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.NetworkCloud.Support.ValidationThresholdType e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdType e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum ValidationThresholdType - /// 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.NetworkCloud.Support.ValidationThresholdType e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdType e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/VirtualMachineBootMethod.Completer.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/VirtualMachineBootMethod.Completer.cs deleted file mode 100644 index 8a6ba858e1ca..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/VirtualMachineBootMethod.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.NetworkCloud.Support -{ - - /// Selects the boot method for the virtual machine. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineBootMethodTypeConverter))] - public partial struct VirtualMachineBootMethod : - 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) || "UEFI".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'UEFI'", "UEFI", global::System.Management.Automation.CompletionResultType.ParameterValue, "UEFI"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "BIOS".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'BIOS'", "BIOS", global::System.Management.Automation.CompletionResultType.ParameterValue, "BIOS"); - } - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/VirtualMachineBootMethod.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/VirtualMachineBootMethod.TypeConverter.cs deleted file mode 100644 index 69b18481217a..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/VirtualMachineBootMethod.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.NetworkCloud.Support -{ - - /// Selects the boot method for the virtual machine. - public partial class VirtualMachineBootMethodTypeConverter : - 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) => VirtualMachineBootMethod.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/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/VirtualMachineBootMethod.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/VirtualMachineBootMethod.cs deleted file mode 100644 index fdd1c75ad1b7..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/VirtualMachineBootMethod.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.NetworkCloud.Support -{ - - /// Selects the boot method for the virtual machine. - public partial struct VirtualMachineBootMethod : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineBootMethod Bios = @"BIOS"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineBootMethod Uefi = @"UEFI"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Conversion from arbitrary object to VirtualMachineBootMethod - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new VirtualMachineBootMethod(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type VirtualMachineBootMethod - /// 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.NetworkCloud.Support.VirtualMachineBootMethod e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type VirtualMachineBootMethod (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 VirtualMachineBootMethod && Equals((VirtualMachineBootMethod)obj); - } - - /// Returns hashCode for enum VirtualMachineBootMethod - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Returns string representation for VirtualMachineBootMethod - /// 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 VirtualMachineBootMethod(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Implicit operator to convert string to VirtualMachineBootMethod - /// the value to convert to an instance of . - - public static implicit operator VirtualMachineBootMethod(string value) - { - return new VirtualMachineBootMethod(value); - } - - /// Implicit operator to convert VirtualMachineBootMethod to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineBootMethod e) - { - return e._value; - } - - /// Overriding != operator for enum VirtualMachineBootMethod - /// 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.NetworkCloud.Support.VirtualMachineBootMethod e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineBootMethod e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum VirtualMachineBootMethod - /// 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.NetworkCloud.Support.VirtualMachineBootMethod e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineBootMethod e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/VirtualMachineDetailedStatus.Completer.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/VirtualMachineDetailedStatus.Completer.cs deleted file mode 100644 index c5fb06f618cf..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/VirtualMachineDetailedStatus.Completer.cs +++ /dev/null @@ -1,63 +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.NetworkCloud.Support -{ - - /// The more detailed status of the virtual machine. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineDetailedStatusTypeConverter))] - public partial struct VirtualMachineDetailedStatus : - 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) || "Available".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Available'", "Available", global::System.Management.Automation.CompletionResultType.ParameterValue, "Available"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Error".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Error'", "Error", global::System.Management.Automation.CompletionResultType.ParameterValue, "Error"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Provisioning".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Provisioning'", "Provisioning", global::System.Management.Automation.CompletionResultType.ParameterValue, "Provisioning"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Running".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Running'", "Running", global::System.Management.Automation.CompletionResultType.ParameterValue, "Running"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Scheduling".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Scheduling'", "Scheduling", global::System.Management.Automation.CompletionResultType.ParameterValue, "Scheduling"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Stopped".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Stopped'", "Stopped", global::System.Management.Automation.CompletionResultType.ParameterValue, "Stopped"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Terminating".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Terminating'", "Terminating", global::System.Management.Automation.CompletionResultType.ParameterValue, "Terminating"); - } - 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"); - } - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/VirtualMachineDetailedStatus.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/VirtualMachineDetailedStatus.TypeConverter.cs deleted file mode 100644 index e9292bbe27b0..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/VirtualMachineDetailedStatus.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.NetworkCloud.Support -{ - - /// The more detailed status of the virtual machine. - public partial class VirtualMachineDetailedStatusTypeConverter : - 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) => VirtualMachineDetailedStatus.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/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/VirtualMachineDetailedStatus.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/VirtualMachineDetailedStatus.cs deleted file mode 100644 index a29656c81b24..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/VirtualMachineDetailedStatus.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.NetworkCloud.Support -{ - - /// The more detailed status of the virtual machine. - public partial struct VirtualMachineDetailedStatus : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineDetailedStatus Available = @"Available"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineDetailedStatus Error = @"Error"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineDetailedStatus Provisioning = @"Provisioning"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineDetailedStatus Running = @"Running"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineDetailedStatus Scheduling = @"Scheduling"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineDetailedStatus Stopped = @"Stopped"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineDetailedStatus Terminating = @"Terminating"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineDetailedStatus Unknown = @"Unknown"; - - /// - /// the value for an instance of the Enum. - /// - private string _value { get; set; } - - /// Conversion from arbitrary object to VirtualMachineDetailedStatus - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new VirtualMachineDetailedStatus(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type VirtualMachineDetailedStatus - /// 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.NetworkCloud.Support.VirtualMachineDetailedStatus e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type VirtualMachineDetailedStatus (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 VirtualMachineDetailedStatus && Equals((VirtualMachineDetailedStatus)obj); - } - - /// Returns hashCode for enum VirtualMachineDetailedStatus - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Returns string representation for VirtualMachineDetailedStatus - /// 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 VirtualMachineDetailedStatus(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Implicit operator to convert string to VirtualMachineDetailedStatus - /// the value to convert to an instance of . - - public static implicit operator VirtualMachineDetailedStatus(string value) - { - return new VirtualMachineDetailedStatus(value); - } - - /// Implicit operator to convert VirtualMachineDetailedStatus to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineDetailedStatus e) - { - return e._value; - } - - /// Overriding != operator for enum VirtualMachineDetailedStatus - /// 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.NetworkCloud.Support.VirtualMachineDetailedStatus e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineDetailedStatus e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum VirtualMachineDetailedStatus - /// 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.NetworkCloud.Support.VirtualMachineDetailedStatus e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineDetailedStatus e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/VirtualMachineDeviceModelType.Completer.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/VirtualMachineDeviceModelType.Completer.cs deleted file mode 100644 index 8e972e49fd26..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/VirtualMachineDeviceModelType.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.NetworkCloud.Support -{ - - /// The type of the device model to use. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineDeviceModelTypeTypeConverter))] - public partial struct VirtualMachineDeviceModelType : - 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) || "T1".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'T1'", "T1", global::System.Management.Automation.CompletionResultType.ParameterValue, "T1"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "T2".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'T2'", "T2", global::System.Management.Automation.CompletionResultType.ParameterValue, "T2"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "T3".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'T3'", "T3", global::System.Management.Automation.CompletionResultType.ParameterValue, "T3"); - } - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/VirtualMachineDeviceModelType.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/VirtualMachineDeviceModelType.TypeConverter.cs deleted file mode 100644 index 57f8222c7bce..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/VirtualMachineDeviceModelType.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.NetworkCloud.Support -{ - - /// The type of the device model to use. - public partial class VirtualMachineDeviceModelTypeTypeConverter : - 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) => VirtualMachineDeviceModelType.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/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/VirtualMachineDeviceModelType.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/VirtualMachineDeviceModelType.cs deleted file mode 100644 index b0c106352a21..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/VirtualMachineDeviceModelType.cs +++ /dev/null @@ -1,111 +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.NetworkCloud.Support -{ - - /// The type of the device model to use. - public partial struct VirtualMachineDeviceModelType : - System.IEquatable - { - /// Traditional and most compatible device virtualization interface. - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineDeviceModelType T1 = @"T1"; - - /// Modern and enhanced device virtualization interface. - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineDeviceModelType T2 = @"T2"; - - /// - /// Improved security and functionality (including TPM and secure boot support). Required for windows 11 and server 2025. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineDeviceModelType T3 = @"T3"; - - /// - /// the value for an instance of the Enum. - /// - private string _value { get; set; } - - /// Conversion from arbitrary object to VirtualMachineDeviceModelType - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new VirtualMachineDeviceModelType(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type VirtualMachineDeviceModelType - /// 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.NetworkCloud.Support.VirtualMachineDeviceModelType e) - { - return _value.Equals(e._value); - } - - /// - /// Compares values of enum type VirtualMachineDeviceModelType (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 VirtualMachineDeviceModelType && Equals((VirtualMachineDeviceModelType)obj); - } - - /// Returns hashCode for enum VirtualMachineDeviceModelType - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Returns string representation for VirtualMachineDeviceModelType - /// 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 VirtualMachineDeviceModelType(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Implicit operator to convert string to VirtualMachineDeviceModelType - /// the value to convert to an instance of . - - public static implicit operator VirtualMachineDeviceModelType(string value) - { - return new VirtualMachineDeviceModelType(value); - } - - /// Implicit operator to convert VirtualMachineDeviceModelType to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineDeviceModelType e) - { - return e._value; - } - - /// Overriding != operator for enum VirtualMachineDeviceModelType - /// 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.NetworkCloud.Support.VirtualMachineDeviceModelType e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineDeviceModelType e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum VirtualMachineDeviceModelType - /// 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.NetworkCloud.Support.VirtualMachineDeviceModelType e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineDeviceModelType e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/VirtualMachineIPAllocationMethod.Completer.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/VirtualMachineIPAllocationMethod.Completer.cs deleted file mode 100644 index bfe6603ff7c0..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/VirtualMachineIPAllocationMethod.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.NetworkCloud.Support -{ - - /// - /// The IP allocation mechanism for the virtual machine. - /// Dynamic and Static are only valid for l3Network which may also specify Disabled. - /// Otherwise, Disabled is the only permitted value. - /// - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineIPAllocationMethodTypeConverter))] - public partial struct VirtualMachineIPAllocationMethod : - 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) || "Dynamic".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Dynamic'", "Dynamic", global::System.Management.Automation.CompletionResultType.ParameterValue, "Dynamic"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Static".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Static'", "Static", global::System.Management.Automation.CompletionResultType.ParameterValue, "Static"); - } - 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/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/VirtualMachineIPAllocationMethod.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/VirtualMachineIPAllocationMethod.TypeConverter.cs deleted file mode 100644 index 7d4811463386..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/VirtualMachineIPAllocationMethod.TypeConverter.cs +++ /dev/null @@ -1,63 +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.NetworkCloud.Support -{ - - /// - /// The IP allocation mechanism for the virtual machine. - /// Dynamic and Static are only valid for l3Network which may also specify Disabled. - /// Otherwise, Disabled is the only permitted value. - /// - public partial class VirtualMachineIPAllocationMethodTypeConverter : - 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) => VirtualMachineIPAllocationMethod.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/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/VirtualMachineIPAllocationMethod.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/VirtualMachineIPAllocationMethod.cs deleted file mode 100644 index 0ae26e8406fa..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/VirtualMachineIPAllocationMethod.cs +++ /dev/null @@ -1,110 +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.NetworkCloud.Support -{ - - /// - /// The IP allocation mechanism for the virtual machine. - /// Dynamic and Static are only valid for l3Network which may also specify Disabled. - /// Otherwise, Disabled is the only permitted value. - /// - public partial struct VirtualMachineIPAllocationMethod : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineIPAllocationMethod Disabled = @"Disabled"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineIPAllocationMethod Dynamic = @"Dynamic"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineIPAllocationMethod Static = @"Static"; - - /// - /// the value for an instance of the Enum. - /// - private string _value { get; set; } - - /// Conversion from arbitrary object to VirtualMachineIPAllocationMethod - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new VirtualMachineIPAllocationMethod(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type VirtualMachineIPAllocationMethod - /// 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.NetworkCloud.Support.VirtualMachineIPAllocationMethod e) - { - return _value.Equals(e._value); - } - - /// - /// Compares values of enum type VirtualMachineIPAllocationMethod (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 VirtualMachineIPAllocationMethod && Equals((VirtualMachineIPAllocationMethod)obj); - } - - /// Returns hashCode for enum VirtualMachineIPAllocationMethod - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Returns string representation for VirtualMachineIPAllocationMethod - /// 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 VirtualMachineIPAllocationMethod(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Implicit operator to convert string to VirtualMachineIPAllocationMethod - /// the value to convert to an instance of . - - public static implicit operator VirtualMachineIPAllocationMethod(string value) - { - return new VirtualMachineIPAllocationMethod(value); - } - - /// Implicit operator to convert VirtualMachineIPAllocationMethod to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineIPAllocationMethod e) - { - return e._value; - } - - /// Overriding != operator for enum VirtualMachineIPAllocationMethod - /// 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.NetworkCloud.Support.VirtualMachineIPAllocationMethod e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineIPAllocationMethod e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum VirtualMachineIPAllocationMethod - /// 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.NetworkCloud.Support.VirtualMachineIPAllocationMethod e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineIPAllocationMethod e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/VirtualMachineIsolateEmulatorThread.Completer.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/VirtualMachineIsolateEmulatorThread.Completer.cs deleted file mode 100644 index b35903de99d7..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/VirtualMachineIsolateEmulatorThread.Completer.cs +++ /dev/null @@ -1,42 +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.NetworkCloud.Support -{ - - /// - /// Field Deprecated, the value will be ignored if provided. The indicator of whether one of the specified CPU cores is isolated - /// to run the emulator thread for this virtual machine. - /// - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineIsolateEmulatorThreadTypeConverter))] - public partial struct VirtualMachineIsolateEmulatorThread : - 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) || "True".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'True'", "True", global::System.Management.Automation.CompletionResultType.ParameterValue, "True"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "False".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'False'", "False", global::System.Management.Automation.CompletionResultType.ParameterValue, "False"); - } - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/VirtualMachineIsolateEmulatorThread.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/VirtualMachineIsolateEmulatorThread.TypeConverter.cs deleted file mode 100644 index 7b62d0b08cd0..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/VirtualMachineIsolateEmulatorThread.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.NetworkCloud.Support -{ - - /// - /// Field Deprecated, the value will be ignored if provided. The indicator of whether one of the specified CPU cores is isolated - /// to run the emulator thread for this virtual machine. - /// - public partial class VirtualMachineIsolateEmulatorThreadTypeConverter : - 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) => VirtualMachineIsolateEmulatorThread.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/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/VirtualMachineIsolateEmulatorThread.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/VirtualMachineIsolateEmulatorThread.cs deleted file mode 100644 index cd0b054ee4e3..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/VirtualMachineIsolateEmulatorThread.cs +++ /dev/null @@ -1,107 +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.NetworkCloud.Support -{ - - /// - /// Field Deprecated, the value will be ignored if provided. The indicator of whether one of the specified CPU cores is isolated - /// to run the emulator thread for this virtual machine. - /// - public partial struct VirtualMachineIsolateEmulatorThread : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineIsolateEmulatorThread False = @"False"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineIsolateEmulatorThread True = @"True"; - - /// - /// the value for an instance of the Enum. - /// - private string _value { get; set; } - - /// Conversion from arbitrary object to VirtualMachineIsolateEmulatorThread - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new VirtualMachineIsolateEmulatorThread(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type VirtualMachineIsolateEmulatorThread - /// 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.NetworkCloud.Support.VirtualMachineIsolateEmulatorThread e) - { - return _value.Equals(e._value); - } - - /// - /// Compares values of enum type VirtualMachineIsolateEmulatorThread (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 VirtualMachineIsolateEmulatorThread && Equals((VirtualMachineIsolateEmulatorThread)obj); - } - - /// Returns hashCode for enum VirtualMachineIsolateEmulatorThread - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Returns string representation for VirtualMachineIsolateEmulatorThread - /// 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 VirtualMachineIsolateEmulatorThread(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Implicit operator to convert string to VirtualMachineIsolateEmulatorThread - /// the value to convert to an instance of . - - public static implicit operator VirtualMachineIsolateEmulatorThread(string value) - { - return new VirtualMachineIsolateEmulatorThread(value); - } - - /// Implicit operator to convert VirtualMachineIsolateEmulatorThread to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineIsolateEmulatorThread e) - { - return e._value; - } - - /// Overriding != operator for enum VirtualMachineIsolateEmulatorThread - /// 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.NetworkCloud.Support.VirtualMachineIsolateEmulatorThread e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineIsolateEmulatorThread e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum VirtualMachineIsolateEmulatorThread - /// 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.NetworkCloud.Support.VirtualMachineIsolateEmulatorThread e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineIsolateEmulatorThread e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/VirtualMachinePlacementHintPodAffinityScope.Completer.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/VirtualMachinePlacementHintPodAffinityScope.Completer.cs deleted file mode 100644 index 206907d37e88..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/VirtualMachinePlacementHintPodAffinityScope.Completer.cs +++ /dev/null @@ -1,42 +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.NetworkCloud.Support -{ - - /// - /// The scope for the virtual machine affinity or anti-affinity placement hint. It should always be "Machine" in the case - /// of node affinity. - /// - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachinePlacementHintPodAffinityScopeTypeConverter))] - public partial struct VirtualMachinePlacementHintPodAffinityScope : - 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) || "Rack".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Rack'", "Rack", global::System.Management.Automation.CompletionResultType.ParameterValue, "Rack"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Machine".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Machine'", "Machine", global::System.Management.Automation.CompletionResultType.ParameterValue, "Machine"); - } - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/VirtualMachinePlacementHintPodAffinityScope.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/VirtualMachinePlacementHintPodAffinityScope.TypeConverter.cs deleted file mode 100644 index 4574b45146d9..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/VirtualMachinePlacementHintPodAffinityScope.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.NetworkCloud.Support -{ - - /// - /// The scope for the virtual machine affinity or anti-affinity placement hint. It should always be "Machine" in the case - /// of node affinity. - /// - public partial class VirtualMachinePlacementHintPodAffinityScopeTypeConverter : - 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) => VirtualMachinePlacementHintPodAffinityScope.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/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/VirtualMachinePlacementHintPodAffinityScope.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/VirtualMachinePlacementHintPodAffinityScope.cs deleted file mode 100644 index bbe2200707ea..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/VirtualMachinePlacementHintPodAffinityScope.cs +++ /dev/null @@ -1,111 +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.NetworkCloud.Support -{ - - /// - /// The scope for the virtual machine affinity or anti-affinity placement hint. It should always be "Machine" in the case - /// of node affinity. - /// - public partial struct VirtualMachinePlacementHintPodAffinityScope : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachinePlacementHintPodAffinityScope Machine = @"Machine"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachinePlacementHintPodAffinityScope Rack = @"Rack"; - - /// - /// the value for an instance of the Enum. - /// - private string _value { get; set; } - - /// Conversion from arbitrary object to VirtualMachinePlacementHintPodAffinityScope - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new VirtualMachinePlacementHintPodAffinityScope(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type VirtualMachinePlacementHintPodAffinityScope - /// 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.NetworkCloud.Support.VirtualMachinePlacementHintPodAffinityScope e) - { - return _value.Equals(e._value); - } - - /// - /// Compares values of enum type VirtualMachinePlacementHintPodAffinityScope (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 VirtualMachinePlacementHintPodAffinityScope && Equals((VirtualMachinePlacementHintPodAffinityScope)obj); - } - - /// Returns hashCode for enum VirtualMachinePlacementHintPodAffinityScope - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Returns string representation for VirtualMachinePlacementHintPodAffinityScope - /// 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 VirtualMachinePlacementHintPodAffinityScope(string underlyingValue) - { - this._value = underlyingValue; - } - - /// - /// Implicit operator to convert string to VirtualMachinePlacementHintPodAffinityScope - /// - /// the value to convert to an instance of . - - public static implicit operator VirtualMachinePlacementHintPodAffinityScope(string value) - { - return new VirtualMachinePlacementHintPodAffinityScope(value); - } - - /// - /// Implicit operator to convert VirtualMachinePlacementHintPodAffinityScope to string - /// - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachinePlacementHintPodAffinityScope e) - { - return e._value; - } - - /// Overriding != operator for enum VirtualMachinePlacementHintPodAffinityScope - /// 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.NetworkCloud.Support.VirtualMachinePlacementHintPodAffinityScope e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachinePlacementHintPodAffinityScope e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum VirtualMachinePlacementHintPodAffinityScope - /// 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.NetworkCloud.Support.VirtualMachinePlacementHintPodAffinityScope e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachinePlacementHintPodAffinityScope e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/VirtualMachinePlacementHintType.Completer.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/VirtualMachinePlacementHintType.Completer.cs deleted file mode 100644 index 2807a37b5d07..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/VirtualMachinePlacementHintType.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.NetworkCloud.Support -{ - - /// - /// The specification of whether this hint supports affinity or anti-affinity with the referenced resources. - /// - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachinePlacementHintTypeTypeConverter))] - public partial struct VirtualMachinePlacementHintType : - 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) || "Affinity".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Affinity'", "Affinity", global::System.Management.Automation.CompletionResultType.ParameterValue, "Affinity"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "AntiAffinity".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'AntiAffinity'", "AntiAffinity", global::System.Management.Automation.CompletionResultType.ParameterValue, "AntiAffinity"); - } - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/VirtualMachinePlacementHintType.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/VirtualMachinePlacementHintType.TypeConverter.cs deleted file mode 100644 index 0ba8f14995a6..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/VirtualMachinePlacementHintType.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.NetworkCloud.Support -{ - - /// - /// The specification of whether this hint supports affinity or anti-affinity with the referenced resources. - /// - public partial class VirtualMachinePlacementHintTypeTypeConverter : - 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) => VirtualMachinePlacementHintType.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/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/VirtualMachinePlacementHintType.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/VirtualMachinePlacementHintType.cs deleted file mode 100644 index 5066842e54ab..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/VirtualMachinePlacementHintType.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.NetworkCloud.Support -{ - - /// - /// The specification of whether this hint supports affinity or anti-affinity with the referenced resources. - /// - public partial struct VirtualMachinePlacementHintType : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachinePlacementHintType Affinity = @"Affinity"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachinePlacementHintType AntiAffinity = @"AntiAffinity"; - - /// - /// the value for an instance of the Enum. - /// - private string _value { get; set; } - - /// Conversion from arbitrary object to VirtualMachinePlacementHintType - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new VirtualMachinePlacementHintType(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type VirtualMachinePlacementHintType - /// 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.NetworkCloud.Support.VirtualMachinePlacementHintType e) - { - return _value.Equals(e._value); - } - - /// - /// Compares values of enum type VirtualMachinePlacementHintType (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 VirtualMachinePlacementHintType && Equals((VirtualMachinePlacementHintType)obj); - } - - /// Returns hashCode for enum VirtualMachinePlacementHintType - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Returns string representation for VirtualMachinePlacementHintType - /// 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 VirtualMachinePlacementHintType(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Implicit operator to convert string to VirtualMachinePlacementHintType - /// the value to convert to an instance of . - - public static implicit operator VirtualMachinePlacementHintType(string value) - { - return new VirtualMachinePlacementHintType(value); - } - - /// Implicit operator to convert VirtualMachinePlacementHintType to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachinePlacementHintType e) - { - return e._value; - } - - /// Overriding != operator for enum VirtualMachinePlacementHintType - /// 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.NetworkCloud.Support.VirtualMachinePlacementHintType e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachinePlacementHintType e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum VirtualMachinePlacementHintType - /// 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.NetworkCloud.Support.VirtualMachinePlacementHintType e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachinePlacementHintType e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/VirtualMachinePowerState.Completer.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/VirtualMachinePowerState.Completer.cs deleted file mode 100644 index d8238be32e67..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/VirtualMachinePowerState.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.NetworkCloud.Support -{ - - /// The power state of the virtual machine. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachinePowerStateTypeConverter))] - public partial struct VirtualMachinePowerState : - 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) || "On".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'On'", "On", global::System.Management.Automation.CompletionResultType.ParameterValue, "On"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Off".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Off'", "Off", global::System.Management.Automation.CompletionResultType.ParameterValue, "Off"); - } - 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"); - } - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/VirtualMachinePowerState.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/VirtualMachinePowerState.TypeConverter.cs deleted file mode 100644 index 183f06164ff8..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/VirtualMachinePowerState.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.NetworkCloud.Support -{ - - /// The power state of the virtual machine. - public partial class VirtualMachinePowerStateTypeConverter : - 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) => VirtualMachinePowerState.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/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/VirtualMachinePowerState.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/VirtualMachinePowerState.cs deleted file mode 100644 index 3a359bb971ee..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/VirtualMachinePowerState.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.NetworkCloud.Support -{ - - /// The power state of the virtual machine. - public partial struct VirtualMachinePowerState : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachinePowerState Off = @"Off"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachinePowerState On = @"On"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachinePowerState Unknown = @"Unknown"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Conversion from arbitrary object to VirtualMachinePowerState - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new VirtualMachinePowerState(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type VirtualMachinePowerState - /// 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.NetworkCloud.Support.VirtualMachinePowerState e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type VirtualMachinePowerState (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 VirtualMachinePowerState && Equals((VirtualMachinePowerState)obj); - } - - /// Returns hashCode for enum VirtualMachinePowerState - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Returns string representation for VirtualMachinePowerState - /// 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 VirtualMachinePowerState(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Implicit operator to convert string to VirtualMachinePowerState - /// the value to convert to an instance of . - - public static implicit operator VirtualMachinePowerState(string value) - { - return new VirtualMachinePowerState(value); - } - - /// Implicit operator to convert VirtualMachinePowerState to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachinePowerState e) - { - return e._value; - } - - /// Overriding != operator for enum VirtualMachinePowerState - /// 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.NetworkCloud.Support.VirtualMachinePowerState e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachinePowerState e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum VirtualMachinePowerState - /// 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.NetworkCloud.Support.VirtualMachinePowerState e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachinePowerState e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/VirtualMachineProvisioningState.Completer.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/VirtualMachineProvisioningState.Completer.cs deleted file mode 100644 index 67598da90f2e..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/VirtualMachineProvisioningState.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.NetworkCloud.Support -{ - - /// The provisioning state of the virtual machine. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineProvisioningStateTypeConverter))] - public partial struct VirtualMachineProvisioningState : - 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) || "Succeeded".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Succeeded'", "Succeeded", global::System.Management.Automation.CompletionResultType.ParameterValue, "Succeeded"); - } - 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) || "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) || "Provisioning".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Provisioning'", "Provisioning", global::System.Management.Automation.CompletionResultType.ParameterValue, "Provisioning"); - } - 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"); - } - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/VirtualMachineProvisioningState.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/VirtualMachineProvisioningState.TypeConverter.cs deleted file mode 100644 index 37a980655d44..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/VirtualMachineProvisioningState.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.NetworkCloud.Support -{ - - /// The provisioning state of the virtual machine. - public partial class VirtualMachineProvisioningStateTypeConverter : - 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) => VirtualMachineProvisioningState.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/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/VirtualMachineProvisioningState.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/VirtualMachineProvisioningState.cs deleted file mode 100644 index ae3f4ec62f49..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/VirtualMachineProvisioningState.cs +++ /dev/null @@ -1,110 +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.NetworkCloud.Support -{ - - /// The provisioning state of the virtual machine. - public partial struct VirtualMachineProvisioningState : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineProvisioningState Accepted = @"Accepted"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineProvisioningState Canceled = @"Canceled"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineProvisioningState Failed = @"Failed"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineProvisioningState Provisioning = @"Provisioning"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineProvisioningState Succeeded = @"Succeeded"; - - /// - /// the value for an instance of the Enum. - /// - private string _value { get; set; } - - /// Conversion from arbitrary object to VirtualMachineProvisioningState - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new VirtualMachineProvisioningState(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type VirtualMachineProvisioningState - /// 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.NetworkCloud.Support.VirtualMachineProvisioningState e) - { - return _value.Equals(e._value); - } - - /// - /// Compares values of enum type VirtualMachineProvisioningState (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 VirtualMachineProvisioningState && Equals((VirtualMachineProvisioningState)obj); - } - - /// Returns hashCode for enum VirtualMachineProvisioningState - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Returns string representation for VirtualMachineProvisioningState - /// 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 VirtualMachineProvisioningState(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Implicit operator to convert string to VirtualMachineProvisioningState - /// the value to convert to an instance of . - - public static implicit operator VirtualMachineProvisioningState(string value) - { - return new VirtualMachineProvisioningState(value); - } - - /// Implicit operator to convert VirtualMachineProvisioningState to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineProvisioningState e) - { - return e._value; - } - - /// Overriding != operator for enum VirtualMachineProvisioningState - /// 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.NetworkCloud.Support.VirtualMachineProvisioningState e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineProvisioningState e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum VirtualMachineProvisioningState - /// 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.NetworkCloud.Support.VirtualMachineProvisioningState e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineProvisioningState e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/VirtualMachineSchedulingExecution.Completer.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/VirtualMachineSchedulingExecution.Completer.cs deleted file mode 100644 index b64ec5061a26..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/VirtualMachineSchedulingExecution.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.NetworkCloud.Support -{ - - /// - /// The indicator of whether the hint is a hard or soft requirement during scheduling. - /// - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineSchedulingExecutionTypeConverter))] - public partial struct VirtualMachineSchedulingExecution : - 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) || "Hard".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Hard'", "Hard", global::System.Management.Automation.CompletionResultType.ParameterValue, "Hard"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Soft".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Soft'", "Soft", global::System.Management.Automation.CompletionResultType.ParameterValue, "Soft"); - } - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/VirtualMachineSchedulingExecution.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/VirtualMachineSchedulingExecution.TypeConverter.cs deleted file mode 100644 index d43511a6cfe8..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/VirtualMachineSchedulingExecution.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.NetworkCloud.Support -{ - - /// - /// The indicator of whether the hint is a hard or soft requirement during scheduling. - /// - public partial class VirtualMachineSchedulingExecutionTypeConverter : - 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) => VirtualMachineSchedulingExecution.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/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/VirtualMachineSchedulingExecution.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/VirtualMachineSchedulingExecution.cs deleted file mode 100644 index 5da073ffb1ca..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/VirtualMachineSchedulingExecution.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.NetworkCloud.Support -{ - - /// - /// The indicator of whether the hint is a hard or soft requirement during scheduling. - /// - public partial struct VirtualMachineSchedulingExecution : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineSchedulingExecution Hard = @"Hard"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineSchedulingExecution Soft = @"Soft"; - - /// - /// the value for an instance of the Enum. - /// - private string _value { get; set; } - - /// Conversion from arbitrary object to VirtualMachineSchedulingExecution - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new VirtualMachineSchedulingExecution(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type VirtualMachineSchedulingExecution - /// 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.NetworkCloud.Support.VirtualMachineSchedulingExecution e) - { - return _value.Equals(e._value); - } - - /// - /// Compares values of enum type VirtualMachineSchedulingExecution (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 VirtualMachineSchedulingExecution && Equals((VirtualMachineSchedulingExecution)obj); - } - - /// Returns hashCode for enum VirtualMachineSchedulingExecution - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Returns string representation for VirtualMachineSchedulingExecution - /// 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 VirtualMachineSchedulingExecution(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Implicit operator to convert string to VirtualMachineSchedulingExecution - /// the value to convert to an instance of . - - public static implicit operator VirtualMachineSchedulingExecution(string value) - { - return new VirtualMachineSchedulingExecution(value); - } - - /// Implicit operator to convert VirtualMachineSchedulingExecution to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineSchedulingExecution e) - { - return e._value; - } - - /// Overriding != operator for enum VirtualMachineSchedulingExecution - /// 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.NetworkCloud.Support.VirtualMachineSchedulingExecution e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineSchedulingExecution e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum VirtualMachineSchedulingExecution - /// 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.NetworkCloud.Support.VirtualMachineSchedulingExecution e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineSchedulingExecution e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/VirtualMachineVirtioInterfaceType.Completer.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/VirtualMachineVirtioInterfaceType.Completer.cs deleted file mode 100644 index d08f5a158ff6..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/VirtualMachineVirtioInterfaceType.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.NetworkCloud.Support -{ - - /// - /// Field Deprecated, use virtualizationModel instead. The type of the virtio interface. - /// - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineVirtioInterfaceTypeTypeConverter))] - public partial struct VirtualMachineVirtioInterfaceType : - 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) || "Modern".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Modern'", "Modern", global::System.Management.Automation.CompletionResultType.ParameterValue, "Modern"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Transitional".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Transitional'", "Transitional", global::System.Management.Automation.CompletionResultType.ParameterValue, "Transitional"); - } - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/VirtualMachineVirtioInterfaceType.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/VirtualMachineVirtioInterfaceType.TypeConverter.cs deleted file mode 100644 index 5970d61aa399..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/VirtualMachineVirtioInterfaceType.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.NetworkCloud.Support -{ - - /// - /// Field Deprecated, use virtualizationModel instead. The type of the virtio interface. - /// - public partial class VirtualMachineVirtioInterfaceTypeTypeConverter : - 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) => VirtualMachineVirtioInterfaceType.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/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/VirtualMachineVirtioInterfaceType.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/VirtualMachineVirtioInterfaceType.cs deleted file mode 100644 index 01c13abedcda..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/VirtualMachineVirtioInterfaceType.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.NetworkCloud.Support -{ - - /// - /// Field Deprecated, use virtualizationModel instead. The type of the virtio interface. - /// - public partial struct VirtualMachineVirtioInterfaceType : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineVirtioInterfaceType Modern = @"Modern"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineVirtioInterfaceType Transitional = @"Transitional"; - - /// - /// the value for an instance of the Enum. - /// - private string _value { get; set; } - - /// Conversion from arbitrary object to VirtualMachineVirtioInterfaceType - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new VirtualMachineVirtioInterfaceType(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type VirtualMachineVirtioInterfaceType - /// 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.NetworkCloud.Support.VirtualMachineVirtioInterfaceType e) - { - return _value.Equals(e._value); - } - - /// - /// Compares values of enum type VirtualMachineVirtioInterfaceType (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 VirtualMachineVirtioInterfaceType && Equals((VirtualMachineVirtioInterfaceType)obj); - } - - /// Returns hashCode for enum VirtualMachineVirtioInterfaceType - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Returns string representation for VirtualMachineVirtioInterfaceType - /// 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 VirtualMachineVirtioInterfaceType(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Implicit operator to convert string to VirtualMachineVirtioInterfaceType - /// the value to convert to an instance of . - - public static implicit operator VirtualMachineVirtioInterfaceType(string value) - { - return new VirtualMachineVirtioInterfaceType(value); - } - - /// Implicit operator to convert VirtualMachineVirtioInterfaceType to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineVirtioInterfaceType e) - { - return e._value; - } - - /// Overriding != operator for enum VirtualMachineVirtioInterfaceType - /// 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.NetworkCloud.Support.VirtualMachineVirtioInterfaceType e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineVirtioInterfaceType e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum VirtualMachineVirtioInterfaceType - /// 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.NetworkCloud.Support.VirtualMachineVirtioInterfaceType e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineVirtioInterfaceType e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/VolumeDetailedStatus.Completer.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/VolumeDetailedStatus.Completer.cs deleted file mode 100644 index 035518e863b3..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/VolumeDetailedStatus.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.NetworkCloud.Support -{ - - /// The more detailed status of the volume. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VolumeDetailedStatusTypeConverter))] - public partial struct VolumeDetailedStatus : - 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) || "Error".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Error'", "Error", global::System.Management.Automation.CompletionResultType.ParameterValue, "Error"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Active".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Active'", "Active", global::System.Management.Automation.CompletionResultType.ParameterValue, "Active"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Provisioning".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Provisioning'", "Provisioning", global::System.Management.Automation.CompletionResultType.ParameterValue, "Provisioning"); - } - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/VolumeDetailedStatus.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/VolumeDetailedStatus.TypeConverter.cs deleted file mode 100644 index 25746e50654c..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/VolumeDetailedStatus.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.NetworkCloud.Support -{ - - /// The more detailed status of the volume. - public partial class VolumeDetailedStatusTypeConverter : - 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) => VolumeDetailedStatus.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/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/VolumeDetailedStatus.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/VolumeDetailedStatus.cs deleted file mode 100644 index bb5b2de5fd2b..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/VolumeDetailedStatus.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.NetworkCloud.Support -{ - - /// The more detailed status of the volume. - public partial struct VolumeDetailedStatus : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VolumeDetailedStatus Active = @"Active"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VolumeDetailedStatus Error = @"Error"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VolumeDetailedStatus Provisioning = @"Provisioning"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Conversion from arbitrary object to VolumeDetailedStatus - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new VolumeDetailedStatus(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type VolumeDetailedStatus - /// 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.NetworkCloud.Support.VolumeDetailedStatus e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type VolumeDetailedStatus (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 VolumeDetailedStatus && Equals((VolumeDetailedStatus)obj); - } - - /// Returns hashCode for enum VolumeDetailedStatus - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Returns string representation for VolumeDetailedStatus - /// 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 VolumeDetailedStatus(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Implicit operator to convert string to VolumeDetailedStatus - /// the value to convert to an instance of . - - public static implicit operator VolumeDetailedStatus(string value) - { - return new VolumeDetailedStatus(value); - } - - /// Implicit operator to convert VolumeDetailedStatus to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VolumeDetailedStatus e) - { - return e._value; - } - - /// Overriding != operator for enum VolumeDetailedStatus - /// 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.NetworkCloud.Support.VolumeDetailedStatus e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VolumeDetailedStatus e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum VolumeDetailedStatus - /// 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.NetworkCloud.Support.VolumeDetailedStatus e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VolumeDetailedStatus e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/VolumeProvisioningState.Completer.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/VolumeProvisioningState.Completer.cs deleted file mode 100644 index fdd923b359cb..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/VolumeProvisioningState.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.NetworkCloud.Support -{ - - /// The provisioning state of the volume. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VolumeProvisioningStateTypeConverter))] - public partial struct VolumeProvisioningState : - 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) || "Succeeded".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Succeeded'", "Succeeded", global::System.Management.Automation.CompletionResultType.ParameterValue, "Succeeded"); - } - 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) || "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) || "Provisioning".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Provisioning'", "Provisioning", global::System.Management.Automation.CompletionResultType.ParameterValue, "Provisioning"); - } - 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"); - } - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/VolumeProvisioningState.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/VolumeProvisioningState.TypeConverter.cs deleted file mode 100644 index 8289d56604e2..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/VolumeProvisioningState.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.NetworkCloud.Support -{ - - /// The provisioning state of the volume. - public partial class VolumeProvisioningStateTypeConverter : - 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) => VolumeProvisioningState.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/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/VolumeProvisioningState.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/VolumeProvisioningState.cs deleted file mode 100644 index 3a5c54003552..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/VolumeProvisioningState.cs +++ /dev/null @@ -1,104 +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.NetworkCloud.Support -{ - - /// The provisioning state of the volume. - public partial struct VolumeProvisioningState : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VolumeProvisioningState Accepted = @"Accepted"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VolumeProvisioningState Canceled = @"Canceled"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VolumeProvisioningState Failed = @"Failed"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VolumeProvisioningState Provisioning = @"Provisioning"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VolumeProvisioningState Succeeded = @"Succeeded"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Conversion from arbitrary object to VolumeProvisioningState - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new VolumeProvisioningState(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type VolumeProvisioningState - /// 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.NetworkCloud.Support.VolumeProvisioningState e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type VolumeProvisioningState (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 VolumeProvisioningState && Equals((VolumeProvisioningState)obj); - } - - /// Returns hashCode for enum VolumeProvisioningState - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Returns string representation for VolumeProvisioningState - /// 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 VolumeProvisioningState(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Implicit operator to convert string to VolumeProvisioningState - /// the value to convert to an instance of . - - public static implicit operator VolumeProvisioningState(string value) - { - return new VolumeProvisioningState(value); - } - - /// Implicit operator to convert VolumeProvisioningState to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VolumeProvisioningState e) - { - return e._value; - } - - /// Overriding != operator for enum VolumeProvisioningState - /// 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.NetworkCloud.Support.VolumeProvisioningState e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VolumeProvisioningState e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum VolumeProvisioningState - /// 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.NetworkCloud.Support.VolumeProvisioningState e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VolumeProvisioningState e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/VulnerabilityScanningSettingsContainerScan.Completer.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/VulnerabilityScanningSettingsContainerScan.Completer.cs deleted file mode 100644 index f1e8c9022c98..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/VulnerabilityScanningSettingsContainerScan.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.NetworkCloud.Support -{ - - /// The mode selection for container vulnerability scanning. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VulnerabilityScanningSettingsContainerScanTypeConverter))] - public partial struct VulnerabilityScanningSettingsContainerScan : - 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) || "Disabled".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Disabled'", "Disabled", global::System.Management.Automation.CompletionResultType.ParameterValue, "Disabled"); - } - 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"); - } - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/VulnerabilityScanningSettingsContainerScan.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/VulnerabilityScanningSettingsContainerScan.TypeConverter.cs deleted file mode 100644 index 1801779410e7..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/VulnerabilityScanningSettingsContainerScan.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.NetworkCloud.Support -{ - - /// The mode selection for container vulnerability scanning. - public partial class VulnerabilityScanningSettingsContainerScanTypeConverter : - 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) => VulnerabilityScanningSettingsContainerScan.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/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/VulnerabilityScanningSettingsContainerScan.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/VulnerabilityScanningSettingsContainerScan.cs deleted file mode 100644 index 77011146faac..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/VulnerabilityScanningSettingsContainerScan.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.NetworkCloud.Support -{ - - /// The mode selection for container vulnerability scanning. - public partial struct VulnerabilityScanningSettingsContainerScan : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VulnerabilityScanningSettingsContainerScan Disabled = @"Disabled"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VulnerabilityScanningSettingsContainerScan Enabled = @"Enabled"; - - /// - /// the value for an instance of the Enum. - /// - private string _value { get; set; } - - /// Conversion from arbitrary object to VulnerabilityScanningSettingsContainerScan - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new VulnerabilityScanningSettingsContainerScan(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type VulnerabilityScanningSettingsContainerScan - /// 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.NetworkCloud.Support.VulnerabilityScanningSettingsContainerScan e) - { - return _value.Equals(e._value); - } - - /// - /// Compares values of enum type VulnerabilityScanningSettingsContainerScan (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 VulnerabilityScanningSettingsContainerScan && Equals((VulnerabilityScanningSettingsContainerScan)obj); - } - - /// Returns hashCode for enum VulnerabilityScanningSettingsContainerScan - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Returns string representation for VulnerabilityScanningSettingsContainerScan - /// 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 VulnerabilityScanningSettingsContainerScan(string underlyingValue) - { - this._value = underlyingValue; - } - - /// - /// Implicit operator to convert string to VulnerabilityScanningSettingsContainerScan - /// - /// the value to convert to an instance of . - - public static implicit operator VulnerabilityScanningSettingsContainerScan(string value) - { - return new VulnerabilityScanningSettingsContainerScan(value); - } - - /// - /// Implicit operator to convert VulnerabilityScanningSettingsContainerScan to string - /// - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VulnerabilityScanningSettingsContainerScan e) - { - return e._value; - } - - /// Overriding != operator for enum VulnerabilityScanningSettingsContainerScan - /// 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.NetworkCloud.Support.VulnerabilityScanningSettingsContainerScan e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VulnerabilityScanningSettingsContainerScan e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum VulnerabilityScanningSettingsContainerScan - /// 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.NetworkCloud.Support.VulnerabilityScanningSettingsContainerScan e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VulnerabilityScanningSettingsContainerScan e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/WorkloadImpact.Completer.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/WorkloadImpact.Completer.cs deleted file mode 100644 index ee3e21f939c9..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/WorkloadImpact.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.NetworkCloud.Support -{ - - /// The indicator of whether the workload will be impacted during the upgrade. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.WorkloadImpactTypeConverter))] - public partial struct WorkloadImpact : - 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) || "True".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'True'", "True", global::System.Management.Automation.CompletionResultType.ParameterValue, "True"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "False".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'False'", "False", global::System.Management.Automation.CompletionResultType.ParameterValue, "False"); - } - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/WorkloadImpact.TypeConverter.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/WorkloadImpact.TypeConverter.cs deleted file mode 100644 index f683efdd3db8..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/WorkloadImpact.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.NetworkCloud.Support -{ - - /// The indicator of whether the workload will be impacted during the upgrade. - public partial class WorkloadImpactTypeConverter : - 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) => WorkloadImpact.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/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/WorkloadImpact.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/WorkloadImpact.cs deleted file mode 100644 index 9e08d0aedd71..000000000000 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/api/Support/WorkloadImpact.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.NetworkCloud.Support -{ - - /// The indicator of whether the workload will be impacted during the upgrade. - public partial struct WorkloadImpact : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.WorkloadImpact False = @"False"; - - public static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.WorkloadImpact True = @"True"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Conversion from arbitrary object to WorkloadImpact - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new WorkloadImpact(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type WorkloadImpact - /// 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.NetworkCloud.Support.WorkloadImpact e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type WorkloadImpact (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 WorkloadImpact && Equals((WorkloadImpact)obj); - } - - /// Returns hashCode for enum WorkloadImpact - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Returns string representation for WorkloadImpact - /// 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 WorkloadImpact(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Implicit operator to convert string to WorkloadImpact - /// the value to convert to an instance of . - - public static implicit operator WorkloadImpact(string value) - { - return new WorkloadImpact(value); - } - - /// Implicit operator to convert WorkloadImpact to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.WorkloadImpact e) - { - return e._value; - } - - /// Overriding != operator for enum WorkloadImpact - /// 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.NetworkCloud.Support.WorkloadImpact e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.WorkloadImpact e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum WorkloadImpact - /// 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.NetworkCloud.Support.WorkloadImpact e1, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.WorkloadImpact e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/DeployAzNetworkCloudCluster_DeployExpanded.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/DeployAzNetworkCloudCluster_DeployExpanded.cs index aa4fbfcdcec2..cd998306f112 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/DeployAzNetworkCloudCluster_DeployExpanded.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/DeployAzNetworkCloudCluster_DeployExpanded.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// Deploy the cluster using the rack configuration provided during creation. @@ -18,7 +20,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/deploy", ApiVersion = "2025-02-01")] public partial class DeployAzNetworkCloudCluster_DeployExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,7 +38,10 @@ public partial class DeployAzNetworkCloudCluster_DeployExpanded : global::System private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); /// ClusterDeployParameters represents the body of the request to deploy cluster. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterDeployParameters _clusterDeployParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ClusterDeployParameters(); + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterDeployParameters _clusterDeployParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterDeployParameters(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] @@ -47,6 +53,9 @@ public partial class DeployAzNetworkCloudCluster_DeployExpanded : global::System [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -60,6 +69,9 @@ public partial class DeployAzNetworkCloudCluster_DeployExpanded : global::System [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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] @@ -116,7 +128,7 @@ public partial class DeployAzNetworkCloudCluster_DeployExpanded : global::System /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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")] @@ -160,7 +172,7 @@ public partial class DeployAzNetworkCloudCluster_DeployExpanded : global::System Description = @"The names of bare metal machines in the cluster that should be skipped during environment validation.", SerializedName = @"skipValidationsForMachines", PossibleTypes = new [] { typeof(string) })] - public string[] SkipValidationsForMachine { get => _clusterDeployParametersBody.SkipValidationsForMachine ?? null /* arrayOf */; set => _clusterDeployParametersBody.SkipValidationsForMachine = value; } + public string[] SkipValidationsForMachine { get => _clusterDeployParametersBody.SkipValidationsForMachine?.ToArray() ?? null /* fixedArrayOf */; set => _clusterDeployParametersBody.SkipValidationsForMachine = (value != null ? new System.Collections.Generic.List(value) : null); } /// Backing field for property. private string _subscriptionId; @@ -176,7 +188,8 @@ public partial class DeployAzNetworkCloudCluster_DeployExpanded : global::System [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -185,12 +198,12 @@ public partial class DeployAzNetworkCloudCluster_DeployExpanded : 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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 @@ -245,7 +258,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets.DeployAzNetworkCl } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public DeployAzNetworkCloudCluster_DeployExpanded() { @@ -319,11 +332,36 @@ 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.NetworkCloud.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -335,10 +373,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -406,7 +460,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -424,7 +478,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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=_clusterDeployParametersBody}) + 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 } }); @@ -462,12 +516,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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ) { @@ -484,15 +538,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.NetworkCloud.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=_clusterDeployParametersBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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=_clusterDeployParametersBody }) + 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 } }); @@ -517,7 +571,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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/DeployAzNetworkCloudCluster_DeployViaIdentityExpanded.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/DeployAzNetworkCloudCluster_DeployViaIdentityExpanded.cs index abc9cc3c45b4..258dfab16bca 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/DeployAzNetworkCloudCluster_DeployViaIdentityExpanded.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/DeployAzNetworkCloudCluster_DeployViaIdentityExpanded.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// Deploy the cluster using the rack configuration provided during creation. @@ -18,7 +20,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/deploy", ApiVersion = "2025-02-01")] public partial class DeployAzNetworkCloudCluster_DeployViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,7 +38,10 @@ public partial class DeployAzNetworkCloudCluster_DeployViaIdentityExpanded : glo private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); /// ClusterDeployParameters represents the body of the request to deploy cluster. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterDeployParameters _clusterDeployParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ClusterDeployParameters(); + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterDeployParameters _clusterDeployParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterDeployParameters(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] @@ -47,6 +53,9 @@ public partial class DeployAzNetworkCloudCluster_DeployViaIdentityExpanded : glo [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -60,6 +69,9 @@ public partial class DeployAzNetworkCloudCluster_DeployViaIdentityExpanded : glo [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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] @@ -109,7 +121,7 @@ public partial class DeployAzNetworkCloudCluster_DeployViaIdentityExpanded : glo /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,19 +151,19 @@ public partial class DeployAzNetworkCloudCluster_DeployViaIdentityExpanded : glo Description = @"The names of bare metal machines in the cluster that should be skipped during environment validation.", SerializedName = @"skipValidationsForMachines", PossibleTypes = new [] { typeof(string) })] - public string[] SkipValidationsForMachine { get => _clusterDeployParametersBody.SkipValidationsForMachine ?? null /* arrayOf */; set => _clusterDeployParametersBody.SkipValidationsForMachine = value; } + public string[] SkipValidationsForMachine { get => _clusterDeployParametersBody.SkipValidationsForMachine?.ToArray() ?? null /* fixedArrayOf */; set => _clusterDeployParametersBody.SkipValidationsForMachine = (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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 @@ -203,7 +215,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets.DeployAzNetworkCl } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public DeployAzNetworkCloudCluster_DeployViaIdentityExpanded() { @@ -277,11 +289,36 @@ 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.NetworkCloud.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -293,10 +330,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -364,7 +417,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -402,7 +455,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_clusterDeployParametersBody}) + 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 } }); @@ -440,12 +493,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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ) { @@ -462,15 +515,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.NetworkCloud.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_clusterDeployParametersBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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=_clusterDeployParametersBody }) + 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 } }); @@ -495,7 +548,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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/DeployAzNetworkCloudCluster_DeployViaJsonFilePath.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/DeployAzNetworkCloudCluster_DeployViaJsonFilePath.cs new file mode 100644 index 000000000000..53bcaa3d135e --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/DeployAzNetworkCloudCluster_DeployViaJsonFilePath.cs @@ -0,0 +1,580 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; + using System; + + /// Deploy the cluster using the rack configuration provided during creation. + /// + /// [OpenAPI] Deploy=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/deploy" + /// + [global::System.Management.Automation.Cmdlet("Deploy", @"AzNetworkCloudCluster_DeployViaJsonFilePath", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Deploy the cluster using the rack configuration provided during creation.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/deploy", ApiVersion = "2025-02-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.NotSuggestDefaultParameterSet] + public partial class DeployAzNetworkCloudCluster_DeployViaJsonFilePath : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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(); + + public global::System.String _jsonString; + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 Deploy operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Path of Json file supplied to the Deploy operation")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Path of Json file supplied to the Deploy 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.NetworkCloud.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of the cluster. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the cluster.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the cluster.", + SerializedName = @"clusterName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("ClusterName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// 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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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. The value must be an UUID. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription. The value must be an UUID.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription. The value must be an UUID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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. + /// /// 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.NetworkCloud.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of DeployAzNetworkCloudCluster_DeployViaJsonFilePath + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets.DeployAzNetworkCloudCluster_DeployViaJsonFilePath Clone() + { + var clone = new DeployAzNetworkCloudCluster_DeployViaJsonFilePath(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.Name = this.Name; + clone.JsonFilePath = this.JsonFilePath; + return clone; + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public DeployAzNetworkCloudCluster_DeployViaJsonFilePath() + { + + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ClustersDeploy' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ClustersDeployViaJsonString(SubscriptionId, ResourceGroupName, Name, _jsonString, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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. + /// + /// 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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/DeployAzNetworkCloudCluster_DeployViaJsonString.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/DeployAzNetworkCloudCluster_DeployViaJsonString.cs new file mode 100644 index 000000000000..74cccabcac1b --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/DeployAzNetworkCloudCluster_DeployViaJsonString.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.NetworkCloud.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; + using System; + + /// Deploy the cluster using the rack configuration provided during creation. + /// + /// [OpenAPI] Deploy=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/deploy" + /// + [global::System.Management.Automation.Cmdlet("Deploy", @"AzNetworkCloudCluster_DeployViaJsonString", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Deploy the cluster using the rack configuration provided during creation.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/deploy", ApiVersion = "2025-02-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.NotSuggestDefaultParameterSet] + public partial class DeployAzNetworkCloudCluster_DeployViaJsonString : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 Deploy operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Json string supplied to the Deploy operation")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Json string supplied to the Deploy 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.NetworkCloud.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of the cluster. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the cluster.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the cluster.", + SerializedName = @"clusterName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("ClusterName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// 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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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. The value must be an UUID. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription. The value must be an UUID.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription. The value must be an UUID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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. + /// /// 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.NetworkCloud.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of DeployAzNetworkCloudCluster_DeployViaJsonString + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets.DeployAzNetworkCloudCluster_DeployViaJsonString Clone() + { + var clone = new DeployAzNetworkCloudCluster_DeployViaJsonString(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.Name = this.Name; + clone.JsonString = this.JsonString; + return clone; + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public DeployAzNetworkCloudCluster_DeployViaJsonString() + { + + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ClustersDeploy' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ClustersDeployViaJsonString(SubscriptionId, ResourceGroupName, Name, _jsonString, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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. + /// + /// 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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/DisableAzNetworkCloudStorageApplianceRemoteVendorManagement_Disable.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/DisableAzNetworkCloudStorageApplianceRemoteVendorManagement_Disable.cs index 1f4b57701f81..720bf493a471 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/DisableAzNetworkCloudStorageApplianceRemoteVendorManagement_Disable.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/DisableAzNetworkCloudStorageApplianceRemoteVendorManagement_Disable.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// Disable remote vendor management of the provided storage appliance. @@ -18,7 +20,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/storageAppliances/{storageApplianceName}/disableRemoteVendorManagement", ApiVersion = "2025-02-01")] public partial class DisableAzNetworkCloudStorageApplianceRemoteVendorManagement_Disable : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,6 +37,9 @@ public partial class DisableAzNetworkCloudStorageApplianceRemoteVendorManagement /// 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(); + /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] @@ -44,6 +50,9 @@ public partial class DisableAzNetworkCloudStorageApplianceRemoteVendorManagement [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -57,6 +66,9 @@ public partial class DisableAzNetworkCloudStorageApplianceRemoteVendorManagement [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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] @@ -98,7 +110,7 @@ public partial class DisableAzNetworkCloudStorageApplianceRemoteVendorManagement /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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")] @@ -158,7 +170,8 @@ public partial class DisableAzNetworkCloudStorageApplianceRemoteVendorManagement [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -167,12 +180,12 @@ public partial class DisableAzNetworkCloudStorageApplianceRemoteVendorManagement /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 @@ -228,7 +241,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets.DisableAzNetworkC } /// - /// Intializes a new instance of the cmdlet + /// Initializes a new instance of the cmdlet /// class. /// public DisableAzNetworkCloudStorageApplianceRemoteVendorManagement_Disable() @@ -303,11 +316,36 @@ 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.NetworkCloud.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -319,10 +357,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -390,7 +444,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -408,7 +462,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,StorageApplianceName=StorageApplianceName}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,StorageApplianceName=StorageApplianceName}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -446,12 +500,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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ) { @@ -468,15 +522,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.NetworkCloud.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, StorageApplianceName=StorageApplianceName }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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, StorageApplianceName=StorageApplianceName }) + 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 } }); @@ -501,7 +555,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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/DisableAzNetworkCloudStorageApplianceRemoteVendorManagement_DisableViaIdentity.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/DisableAzNetworkCloudStorageApplianceRemoteVendorManagement_DisableViaIdentity.cs index a74faba289c6..314900b339fd 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/DisableAzNetworkCloudStorageApplianceRemoteVendorManagement_DisableViaIdentity.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/DisableAzNetworkCloudStorageApplianceRemoteVendorManagement_DisableViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// Disable remote vendor management of the provided storage appliance. @@ -18,7 +20,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/storageAppliances/{storageApplianceName}/disableRemoteVendorManagement", ApiVersion = "2025-02-01")] public partial class DisableAzNetworkCloudStorageApplianceRemoteVendorManagement_DisableViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,6 +37,9 @@ public partial class DisableAzNetworkCloudStorageApplianceRemoteVendorManagement /// 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(); + /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] @@ -44,6 +50,9 @@ public partial class DisableAzNetworkCloudStorageApplianceRemoteVendorManagement [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -57,6 +66,9 @@ public partial class DisableAzNetworkCloudStorageApplianceRemoteVendorManagement [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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] @@ -106,7 +118,7 @@ public partial class DisableAzNetworkCloudStorageApplianceRemoteVendorManagement /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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")] @@ -129,12 +141,12 @@ public partial class DisableAzNetworkCloudStorageApplianceRemoteVendorManagement /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 @@ -187,7 +199,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets.DisableAzNetworkC } /// - /// Intializes a new instance of the cmdlet class. /// public DisableAzNetworkCloudStorageApplianceRemoteVendorManagement_DisableViaIdentity() @@ -262,11 +274,36 @@ 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.NetworkCloud.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -278,10 +315,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -349,7 +402,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -387,7 +440,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 } }); @@ -425,12 +478,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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ) { @@ -447,7 +500,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.NetworkCloud.Runtime.RestException(responseMessage, await response); + var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 } @@ -480,7 +533,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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/EnableAzNetworkCloudStorageApplianceRemoteVendorManagement_EnableExpanded.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/EnableAzNetworkCloudStorageApplianceRemoteVendorManagement_EnableExpanded.cs index 5618fe774deb..f1f84792f5fc 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/EnableAzNetworkCloudStorageApplianceRemoteVendorManagement_EnableExpanded.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/EnableAzNetworkCloudStorageApplianceRemoteVendorManagement_EnableExpanded.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// Enable remote vendor management of the provided storage appliance. @@ -18,7 +20,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/storageAppliances/{storageApplianceName}/enableRemoteVendorManagement", ApiVersion = "2025-02-01")] public partial class EnableAzNetworkCloudStorageApplianceRemoteVendorManagement_EnableExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,11 +37,14 @@ public partial class EnableAzNetworkCloudStorageApplianceRemoteVendorManagement_ /// 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(); + /// /// StorageApplianceEnableRemoteVendorManagementParameters represents the body of the request to enable remote vendor management /// of a storage appliance. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceEnableRemoteVendorManagementParameters _storageApplianceEnableRemoteVendorManagementParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.StorageApplianceEnableRemoteVendorManagementParameters(); + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceEnableRemoteVendorManagementParameters _storageApplianceEnableRemoteVendorManagementParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.StorageApplianceEnableRemoteVendorManagementParameters(); /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] @@ -50,6 +56,9 @@ public partial class EnableAzNetworkCloudStorageApplianceRemoteVendorManagement_ [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -63,6 +72,9 @@ public partial class EnableAzNetworkCloudStorageApplianceRemoteVendorManagement_ [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 +116,7 @@ public partial class EnableAzNetworkCloudStorageApplianceRemoteVendorManagement_ /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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")] @@ -164,7 +176,8 @@ public partial class EnableAzNetworkCloudStorageApplianceRemoteVendorManagement_ [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -182,19 +195,19 @@ public partial class EnableAzNetworkCloudStorageApplianceRemoteVendorManagement_ Description = @"Field Deprecated. This field is not used and will be rejected if provided. The list of IPv4 subnets (in CIDR format), IPv6 subnets (in CIDR format), or hostnames that the storage appliance needs accessible in order to turn on the remote vendor management.", SerializedName = @"supportEndpoints", PossibleTypes = new [] { typeof(string) })] - public string[] SupportEndpoint { get => _storageApplianceEnableRemoteVendorManagementParametersBody.SupportEndpoint ?? null /* arrayOf */; set => _storageApplianceEnableRemoteVendorManagementParametersBody.SupportEndpoint = value; } + public string[] SupportEndpoint { get => _storageApplianceEnableRemoteVendorManagementParametersBody.SupportEndpoint?.ToArray() ?? null /* fixedArrayOf */; set => _storageApplianceEnableRemoteVendorManagementParametersBody.SupportEndpoint = (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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 @@ -251,7 +264,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets.EnableAzNetworkCl } /// - /// Intializes a new instance of the cmdlet class. /// public EnableAzNetworkCloudStorageApplianceRemoteVendorManagement_EnableExpanded() @@ -326,11 +339,36 @@ 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.NetworkCloud.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -342,10 +380,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -413,7 +467,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -431,7 +485,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,StorageApplianceName=StorageApplianceName,body=_storageApplianceEnableRemoteVendorManagementParametersBody}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,StorageApplianceName=StorageApplianceName}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -469,12 +523,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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ) { @@ -491,15 +545,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.NetworkCloud.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, StorageApplianceName=StorageApplianceName, body=_storageApplianceEnableRemoteVendorManagementParametersBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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, StorageApplianceName=StorageApplianceName, body=_storageApplianceEnableRemoteVendorManagementParametersBody }) + 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 } }); @@ -524,7 +578,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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/EnableAzNetworkCloudStorageApplianceRemoteVendorManagement_EnableViaIdentityExpanded.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/EnableAzNetworkCloudStorageApplianceRemoteVendorManagement_EnableViaIdentityExpanded.cs index c309566c3a41..ecd1791b985e 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/EnableAzNetworkCloudStorageApplianceRemoteVendorManagement_EnableViaIdentityExpanded.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/EnableAzNetworkCloudStorageApplianceRemoteVendorManagement_EnableViaIdentityExpanded.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// Enable remote vendor management of the provided storage appliance. @@ -18,7 +20,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/storageAppliances/{storageApplianceName}/enableRemoteVendorManagement", ApiVersion = "2025-02-01")] public partial class EnableAzNetworkCloudStorageApplianceRemoteVendorManagement_EnableViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,11 +37,14 @@ public partial class EnableAzNetworkCloudStorageApplianceRemoteVendorManagement_ /// 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(); + /// /// StorageApplianceEnableRemoteVendorManagementParameters represents the body of the request to enable remote vendor management /// of a storage appliance. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceEnableRemoteVendorManagementParameters _storageApplianceEnableRemoteVendorManagementParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.StorageApplianceEnableRemoteVendorManagementParameters(); + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceEnableRemoteVendorManagementParameters _storageApplianceEnableRemoteVendorManagementParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.StorageApplianceEnableRemoteVendorManagementParameters(); /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] @@ -50,6 +56,9 @@ public partial class EnableAzNetworkCloudStorageApplianceRemoteVendorManagement_ [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -63,6 +72,9 @@ public partial class EnableAzNetworkCloudStorageApplianceRemoteVendorManagement_ [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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] @@ -112,7 +124,7 @@ public partial class EnableAzNetworkCloudStorageApplianceRemoteVendorManagement_ /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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")] @@ -144,19 +156,19 @@ public partial class EnableAzNetworkCloudStorageApplianceRemoteVendorManagement_ Description = @"Field Deprecated. This field is not used and will be rejected if provided. The list of IPv4 subnets (in CIDR format), IPv6 subnets (in CIDR format), or hostnames that the storage appliance needs accessible in order to turn on the remote vendor management.", SerializedName = @"supportEndpoints", PossibleTypes = new [] { typeof(string) })] - public string[] SupportEndpoint { get => _storageApplianceEnableRemoteVendorManagementParametersBody.SupportEndpoint ?? null /* arrayOf */; set => _storageApplianceEnableRemoteVendorManagementParametersBody.SupportEndpoint = value; } + public string[] SupportEndpoint { get => _storageApplianceEnableRemoteVendorManagementParametersBody.SupportEndpoint?.ToArray() ?? null /* fixedArrayOf */; set => _storageApplianceEnableRemoteVendorManagementParametersBody.SupportEndpoint = (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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 @@ -210,7 +222,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets.EnableAzNetworkCl } /// - /// Intializes a new instance of the cmdlet class. /// public EnableAzNetworkCloudStorageApplianceRemoteVendorManagement_EnableViaIdentityExpanded() @@ -285,11 +297,36 @@ 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.NetworkCloud.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -301,10 +338,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -372,7 +425,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -410,7 +463,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_storageApplianceEnableRemoteVendorManagementParametersBody}) + 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 } }); @@ -448,12 +501,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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ) { @@ -470,15 +523,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.NetworkCloud.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_storageApplianceEnableRemoteVendorManagementParametersBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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=_storageApplianceEnableRemoteVendorManagementParametersBody }) + 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 } }); @@ -503,7 +556,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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/EnableAzNetworkCloudStorageApplianceRemoteVendorManagement_EnableViaJsonFilePath.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/EnableAzNetworkCloudStorageApplianceRemoteVendorManagement_EnableViaJsonFilePath.cs new file mode 100644 index 000000000000..0df2bd9bf4b1 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/EnableAzNetworkCloudStorageApplianceRemoteVendorManagement_EnableViaJsonFilePath.cs @@ -0,0 +1,582 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; + using System; + + /// Enable remote vendor management of the provided storage appliance. + /// + /// [OpenAPI] EnableRemoteVendorManagement=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/storageAppliances/{storageApplianceName}/enableRemoteVendorManagement" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Enable, @"AzNetworkCloudStorageApplianceRemoteVendorManagement_EnableViaJsonFilePath", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Enable remote vendor management of the provided storage appliance.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/storageAppliances/{storageApplianceName}/enableRemoteVendorManagement", ApiVersion = "2025-02-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.NotSuggestDefaultParameterSet] + public partial class EnableAzNetworkCloudStorageApplianceRemoteVendorManagement_EnableViaJsonFilePath : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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(); + + public global::System.String _jsonString; + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 Enable operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Path of Json file supplied to the Enable operation")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Path of Json file supplied to the Enable 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.NetworkCloud.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// 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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _storageApplianceName; + + /// The name of the storage appliance. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the storage appliance.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the storage appliance.", + SerializedName = @"storageApplianceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] + public string StorageApplianceName { get => this._storageApplianceName; set => this._storageApplianceName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// The ID of the target subscription. The value must be an UUID. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription. The value must be an UUID.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription. The value must be an UUID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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. + /// /// 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.NetworkCloud.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of EnableAzNetworkCloudStorageApplianceRemoteVendorManagement_EnableViaJsonFilePath + /// + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets.EnableAzNetworkCloudStorageApplianceRemoteVendorManagement_EnableViaJsonFilePath Clone() + { + var clone = new EnableAzNetworkCloudStorageApplianceRemoteVendorManagement_EnableViaJsonFilePath(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.StorageApplianceName = this.StorageApplianceName; + clone.JsonFilePath = this.JsonFilePath; + return clone; + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public EnableAzNetworkCloudStorageApplianceRemoteVendorManagement_EnableViaJsonFilePath() + { + + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'StorageAppliancesEnableRemoteVendorManagement' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.StorageAppliancesEnableRemoteVendorManagementViaJsonString(SubscriptionId, ResourceGroupName, StorageApplianceName, _jsonString, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,StorageApplianceName=StorageApplianceName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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. + /// + /// 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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/EnableAzNetworkCloudStorageApplianceRemoteVendorManagement_EnableViaJsonString.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/EnableAzNetworkCloudStorageApplianceRemoteVendorManagement_EnableViaJsonString.cs new file mode 100644 index 000000000000..04e7ad82035d --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/EnableAzNetworkCloudStorageApplianceRemoteVendorManagement_EnableViaJsonString.cs @@ -0,0 +1,580 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; + using System; + + /// Enable remote vendor management of the provided storage appliance. + /// + /// [OpenAPI] EnableRemoteVendorManagement=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/storageAppliances/{storageApplianceName}/enableRemoteVendorManagement" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Enable, @"AzNetworkCloudStorageApplianceRemoteVendorManagement_EnableViaJsonString", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Enable remote vendor management of the provided storage appliance.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/storageAppliances/{storageApplianceName}/enableRemoteVendorManagement", ApiVersion = "2025-02-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.NotSuggestDefaultParameterSet] + public partial class EnableAzNetworkCloudStorageApplianceRemoteVendorManagement_EnableViaJsonString : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 Enable operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Json string supplied to the Enable operation")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Json string supplied to the Enable 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.NetworkCloud.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// 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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _storageApplianceName; + + /// The name of the storage appliance. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the storage appliance.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the storage appliance.", + SerializedName = @"storageApplianceName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] + public string StorageApplianceName { get => this._storageApplianceName; set => this._storageApplianceName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// The ID of the target subscription. The value must be an UUID. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription. The value must be an UUID.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription. The value must be an UUID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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. + /// /// 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.NetworkCloud.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of EnableAzNetworkCloudStorageApplianceRemoteVendorManagement_EnableViaJsonString + /// + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets.EnableAzNetworkCloudStorageApplianceRemoteVendorManagement_EnableViaJsonString Clone() + { + var clone = new EnableAzNetworkCloudStorageApplianceRemoteVendorManagement_EnableViaJsonString(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.StorageApplianceName = this.StorageApplianceName; + clone.JsonString = this.JsonString; + return clone; + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public EnableAzNetworkCloudStorageApplianceRemoteVendorManagement_EnableViaJsonString() + { + + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'StorageAppliancesEnableRemoteVendorManagement' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.StorageAppliancesEnableRemoteVendorManagementViaJsonString(SubscriptionId, ResourceGroupName, StorageApplianceName, _jsonString, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,StorageApplianceName=StorageApplianceName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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. + /// + /// 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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudAgentPool_Get.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudAgentPool_Get.cs index 69877a460697..4227f17afd15 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudAgentPool_Get.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudAgentPool_Get.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// Get properties of the provided Kubernetes cluster agent pool. @@ -13,13 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/kubernetesClusters/{kubernetesClusterName}/agentPools/{agentPoolName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzNetworkCloudAgentPool_Get")] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPool", "15.0.0", "2.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"AdministratorConfigurationSshPublicKey","AttachedNetworkConfigurationL2Network","AttachedNetworkConfigurationL3Network","AttachedNetworkConfigurationTrunkedNetwork","AvailabilityZone","Label","Taint"}, NewOutputProperties=new string[] {"AdministratorConfigurationSshPublicKey","AttachedNetworkConfigurationL2Network","AttachedNetworkConfigurationL3Network","AttachedNetworkConfigurationTrunkedNetwork","AvailabilityZone","Label","Taint"}, ChangeDescription="The types of properties will be changed from fixed array to 'List'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPool))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPool))] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Get properties of the provided Kubernetes cluster agent pool.")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/kubernetesClusters/{kubernetesClusterName}/agentPools/{agentPoolName}", ApiVersion = "2025-02-01")] public partial class GetAzNetworkCloudAgentPool_Get : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudAgentPool_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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -53,6 +70,9 @@ public partial class GetAzNetworkCloudAgentPool_Get : global::System.Management. [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudAgentPool_Get : global::System.Management. /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudAgentPool_Get : global::System.Management. [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -163,24 +184,24 @@ public partial class GetAzNetworkCloudAgentPool_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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IAgentPool + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPool /// 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) @@ -203,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.NetworkCloud.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -224,7 +250,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzNetworkCloudAgentPool_Get() { @@ -275,8 +301,33 @@ public GetAzNetworkCloudAgentPool_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.NetworkCloud.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.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -329,7 +380,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -350,7 +401,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,KubernetesClusterName=KubernetesClusterName,Name=Name}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,KubernetesClusterName=KubernetesClusterName,Name=Name}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -388,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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 +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.NetworkCloud.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, KubernetesClusterName=KubernetesClusterName, Name=Name }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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, KubernetesClusterName=KubernetesClusterName, 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 } }); @@ -428,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.NetworkCloud.Models.Api20250201.IAgentPool + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPool /// 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 +496,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPool - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPool + 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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudAgentPool_GetViaIdentity.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudAgentPool_GetViaIdentity.cs index 300c407d5922..67e79f93c259 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudAgentPool_GetViaIdentity.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudAgentPool_GetViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// Get properties of the provided Kubernetes cluster agent pool. @@ -13,13 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/kubernetesClusters/{kubernetesClusterName}/agentPools/{agentPoolName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzNetworkCloudAgentPool_GetViaIdentity")] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPool", "15.0.0", "2.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"AdministratorConfigurationSshPublicKey","AttachedNetworkConfigurationL2Network","AttachedNetworkConfigurationL3Network","AttachedNetworkConfigurationTrunkedNetwork","AvailabilityZone","Label","Taint"}, NewOutputProperties=new string[] {"AdministratorConfigurationSshPublicKey","AttachedNetworkConfigurationL2Network","AttachedNetworkConfigurationL3Network","AttachedNetworkConfigurationTrunkedNetwork","AvailabilityZone","Label","Taint"}, ChangeDescription="The types of properties will be changed from fixed array to 'List'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPool))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPool))] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Get properties of the provided Kubernetes cluster agent pool.")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/kubernetesClusters/{kubernetesClusterName}/agentPools/{agentPoolName}", ApiVersion = "2025-02-01")] public partial class GetAzNetworkCloudAgentPool_GetViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudAgentPool_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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -53,6 +70,9 @@ public partial class GetAzNetworkCloudAgentPool_GetViaIdentity : global::System. [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudAgentPool_GetViaIdentity : global::System. /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudAgentPool_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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IAgentPool + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPool /// 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.NetworkCloud.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 GetAzNetworkCloudAgentPool_GetViaIdentity() { @@ -222,8 +247,33 @@ public GetAzNetworkCloudAgentPool_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.NetworkCloud.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.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -318,7 +368,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ) { @@ -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.NetworkCloud.Runtime.RestException(responseMessage, await response); + var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IAgentPool + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPool /// 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.NetworkCloud.Models.Api20250201.IAgentPool - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPool + 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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudAgentPool_GetViaIdentityKubernetesCluster.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudAgentPool_GetViaIdentityKubernetesCluster.cs new file mode 100644 index 000000000000..607c2b31d5ac --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudAgentPool_GetViaIdentityKubernetesCluster.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.NetworkCloud.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; + using System; + + /// Get properties of the provided Kubernetes cluster agent pool. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/kubernetesClusters/{kubernetesClusterName}/agentPools/{agentPoolName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzNetworkCloudAgentPool_GetViaIdentityKubernetesCluster")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Get properties of the provided Kubernetes cluster agent pool.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/kubernetesClusters/{kubernetesClusterName}/agentPools/{agentPoolName}", ApiVersion = "2025-02-01")] + public partial class GetAzNetworkCloudAgentPool_GetViaIdentityKubernetesCluster : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity _kubernetesClusterInputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity KubernetesClusterInputObject { get => this._kubernetesClusterInputObject; set => this._kubernetesClusterInputObject = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of the Kubernetes cluster agent pool. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the Kubernetes cluster agent pool.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the Kubernetes cluster agent pool.", + SerializedName = @"agentPoolName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("AgentPoolName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.IAgentPool + /// 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.NetworkCloud.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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 GetAzNetworkCloudAgentPool_GetViaIdentityKubernetesCluster() + { + + } + + /// 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.NetworkCloud.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.NetworkCloud.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (KubernetesClusterInputObject?.Id != null) + { + this.KubernetesClusterInputObject.Id += $"/agentPools/{(global::System.Uri.EscapeDataString(this.Name.ToString()))}"; + await this.Client.AgentPoolsGetViaIdentity(KubernetesClusterInputObject.Id, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == KubernetesClusterInputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("KubernetesClusterInputObject has null value for KubernetesClusterInputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, KubernetesClusterInputObject) ); + } + if (null == KubernetesClusterInputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("KubernetesClusterInputObject has null value for KubernetesClusterInputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, KubernetesClusterInputObject) ); + } + if (null == KubernetesClusterInputObject.KubernetesClusterName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("KubernetesClusterInputObject has null value for KubernetesClusterInputObject.KubernetesClusterName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, KubernetesClusterInputObject) ); + } + await this.Client.AgentPoolsGet(KubernetesClusterInputObject.SubscriptionId ?? null, KubernetesClusterInputObject.ResourceGroupName ?? null, KubernetesClusterInputObject.KubernetesClusterName ?? null, Name, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.IAgentPool + /// 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.NetworkCloud.Models.IAgentPool + 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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudAgentPool_List.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudAgentPool_List.cs index 123e971b6262..aa7bb3d38442 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudAgentPool_List.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudAgentPool_List.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// Get a list of agent pools for the provided Kubernetes cluster. @@ -13,13 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets /// [OpenAPI] ListByKubernetesCluster=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/kubernetesClusters/{kubernetesClusterName}/agentPools" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzNetworkCloudAgentPool_List")] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPool", "15.0.0", "2.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"AdministratorConfigurationSshPublicKey","AttachedNetworkConfigurationL2Network","AttachedNetworkConfigurationL3Network","AttachedNetworkConfigurationTrunkedNetwork","AvailabilityZone","Label","Taint"}, NewOutputProperties=new string[] {"AdministratorConfigurationSshPublicKey","AttachedNetworkConfigurationL2Network","AttachedNetworkConfigurationL3Network","AttachedNetworkConfigurationTrunkedNetwork","AvailabilityZone","Label","Taint"}, ChangeDescription="The types of properties will be changed from fixed array to 'List'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPool))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPool))] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Get a list of agent pools for the provided Kubernetes cluster.")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/kubernetesClusters/{kubernetesClusterName}/agentPools", ApiVersion = "2025-02-01")] public partial class GetAzNetworkCloudAgentPool_List : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudAgentPool_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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -59,6 +76,9 @@ public partial class GetAzNetworkCloudAgentPool_List : global::System.Management [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudAgentPool_List : global::System.Management /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudAgentPool_List : global::System.Management [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -154,24 +175,24 @@ public partial class GetAzNetworkCloudAgentPool_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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IAgentPoolList + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolList /// 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.NetworkCloud.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 GetAzNetworkCloudAgentPool_List() { @@ -266,8 +292,33 @@ public GetAzNetworkCloudAgentPool_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.NetworkCloud.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.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -341,7 +392,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,KubernetesClusterName=KubernetesClusterName}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,KubernetesClusterName=KubernetesClusterName}) { 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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ) { @@ -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.NetworkCloud.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, KubernetesClusterName=KubernetesClusterName }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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, KubernetesClusterName=KubernetesClusterName }) + 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.NetworkCloud.Models.Api20250201.IAgentPoolList + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolList /// 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.NetworkCloud.Models.IAgentPoolList + 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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudBareMetalMachineKeySet_Get.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudBareMetalMachineKeySet_Get.cs index dbb36dcf2b18..301c5f9bea56 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudBareMetalMachineKeySet_Get.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudBareMetalMachineKeySet_Get.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// Get bare metal machine key set of the provided cluster. @@ -13,13 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/bareMetalMachineKeySets/{bareMetalMachineKeySetName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzNetworkCloudBareMetalMachineKeySet_Get")] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySet", "15.0.0", "2.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"JumpHostsAllowed","UserList","UserListStatus"}, NewOutputProperties=new string[] {"JumpHostsAllowed","UserList","UserListStatus"}, ChangeDescription="The types of properties will be changed from fixed array to 'List'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySet))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySet))] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Get bare metal machine key set of the provided cluster.")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/bareMetalMachineKeySets/{bareMetalMachineKeySetName}", ApiVersion = "2025-02-01")] public partial class GetAzNetworkCloudBareMetalMachineKeySet_Get : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudBareMetalMachineKeySet_Get : 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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -67,6 +84,9 @@ public partial class GetAzNetworkCloudBareMetalMachineKeySet_Get : global::Syste [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudBareMetalMachineKeySet_Get : global::Syste /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudBareMetalMachineKeySet_Get : global::Syste [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -163,24 +184,24 @@ public partial class GetAzNetworkCloudBareMetalMachineKeySet_Get : 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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySet + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySet /// 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) @@ -203,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.NetworkCloud.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -224,7 +250,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzNetworkCloudBareMetalMachineKeySet_Get() { @@ -275,8 +301,33 @@ public GetAzNetworkCloudBareMetalMachineKeySet_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.NetworkCloud.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.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -329,7 +380,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -350,7 +401,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,ClusterName=ClusterName,Name=Name}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,ClusterName=ClusterName,Name=Name}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -388,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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 +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.NetworkCloud.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, ClusterName=ClusterName, Name=Name }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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, ClusterName=ClusterName, 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 } }); @@ -428,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.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySet + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySet /// 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 +496,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySet - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySet + 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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudBareMetalMachineKeySet_GetViaIdentity.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudBareMetalMachineKeySet_GetViaIdentity.cs index 10a36de311f2..10c6194e80fe 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudBareMetalMachineKeySet_GetViaIdentity.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudBareMetalMachineKeySet_GetViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// Get bare metal machine key set of the provided cluster. @@ -13,13 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/bareMetalMachineKeySets/{bareMetalMachineKeySetName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzNetworkCloudBareMetalMachineKeySet_GetViaIdentity")] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySet", "15.0.0", "2.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"JumpHostsAllowed","UserList","UserListStatus"}, NewOutputProperties=new string[] {"JumpHostsAllowed","UserList","UserListStatus"}, ChangeDescription="The types of properties will be changed from fixed array to 'List'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySet))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySet))] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Get bare metal machine key set of the provided cluster.")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/bareMetalMachineKeySets/{bareMetalMachineKeySetName}", ApiVersion = "2025-02-01")] public partial class GetAzNetworkCloudBareMetalMachineKeySet_GetViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudBareMetalMachineKeySet_GetViaIdentity : 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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -53,6 +70,9 @@ public partial class GetAzNetworkCloudBareMetalMachineKeySet_GetViaIdentity : gl [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudBareMetalMachineKeySet_GetViaIdentity : gl /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudBareMetalMachineKeySet_GetViaIdentity : 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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySet + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySet /// 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.NetworkCloud.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 GetAzNetworkCloudBareMetalMachineKeySet_GetViaIdentity() { @@ -222,8 +247,33 @@ public GetAzNetworkCloudBareMetalMachineKeySet_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.NetworkCloud.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.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -318,7 +368,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ) { @@ -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.NetworkCloud.Runtime.RestException(responseMessage, await response); + var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySet + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySet /// 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.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySet - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySet + 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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudBareMetalMachineKeySet_GetViaIdentityCluster.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudBareMetalMachineKeySet_GetViaIdentityCluster.cs new file mode 100644 index 000000000000..677ccd7c9294 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudBareMetalMachineKeySet_GetViaIdentityCluster.cs @@ -0,0 +1,502 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; + using System; + + /// Get bare metal machine key set of the provided cluster. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/bareMetalMachineKeySets/{bareMetalMachineKeySetName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzNetworkCloudBareMetalMachineKeySet_GetViaIdentityCluster")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySet))] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Get bare metal machine key set of the provided cluster.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/bareMetalMachineKeySets/{bareMetalMachineKeySetName}", ApiVersion = "2025-02-01")] + public partial class GetAzNetworkCloudBareMetalMachineKeySet_GetViaIdentityCluster : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity _clusterInputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity ClusterInputObject { get => this._clusterInputObject; set => this._clusterInputObject = 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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of the bare metal machine key set. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the bare metal machine key set.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the bare metal machine key set.", + SerializedName = @"bareMetalMachineKeySetName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("BareMetalMachineKeySetName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.IBareMetalMachineKeySet + /// 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.NetworkCloud.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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 GetAzNetworkCloudBareMetalMachineKeySet_GetViaIdentityCluster() + { + + } + + /// 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.NetworkCloud.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.NetworkCloud.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (ClusterInputObject?.Id != null) + { + this.ClusterInputObject.Id += $"/bareMetalMachineKeySets/{(global::System.Uri.EscapeDataString(this.Name.ToString()))}"; + await this.Client.BareMetalMachineKeySetsGetViaIdentity(ClusterInputObject.Id, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == ClusterInputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("ClusterInputObject has null value for ClusterInputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, ClusterInputObject) ); + } + if (null == ClusterInputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("ClusterInputObject has null value for ClusterInputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, ClusterInputObject) ); + } + if (null == ClusterInputObject.ClusterName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("ClusterInputObject has null value for ClusterInputObject.ClusterName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, ClusterInputObject) ); + } + await this.Client.BareMetalMachineKeySetsGet(ClusterInputObject.SubscriptionId ?? null, ClusterInputObject.ResourceGroupName ?? null, ClusterInputObject.ClusterName ?? null, Name, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.IBareMetalMachineKeySet + /// 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.NetworkCloud.Models.IBareMetalMachineKeySet + 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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudBareMetalMachineKeySet_List.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudBareMetalMachineKeySet_List.cs index c79f65574682..b9cee624f05d 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudBareMetalMachineKeySet_List.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudBareMetalMachineKeySet_List.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// Get a list of bare metal machine key sets for the provided cluster. @@ -13,13 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets /// [OpenAPI] ListByCluster=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/bareMetalMachineKeySets" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzNetworkCloudBareMetalMachineKeySet_List")] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySet", "15.0.0", "2.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"JumpHostsAllowed","UserList","UserListStatus"}, NewOutputProperties=new string[] {"JumpHostsAllowed","UserList","UserListStatus"}, ChangeDescription="The types of properties will be changed from fixed array to 'List'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySet))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySet))] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Get a list of bare metal machine key sets for the provided cluster.")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/bareMetalMachineKeySets", ApiVersion = "2025-02-01")] public partial class GetAzNetworkCloudBareMetalMachineKeySet_List : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudBareMetalMachineKeySet_List : 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 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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -73,6 +90,9 @@ public partial class GetAzNetworkCloudBareMetalMachineKeySet_List : global::Syst [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudBareMetalMachineKeySet_List : global::Syst /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudBareMetalMachineKeySet_List : global::Syst [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -154,24 +175,24 @@ public partial class GetAzNetworkCloudBareMetalMachineKeySet_List : 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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetList + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetList /// 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.NetworkCloud.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 GetAzNetworkCloudBareMetalMachineKeySet_List() { @@ -266,8 +292,33 @@ public GetAzNetworkCloudBareMetalMachineKeySet_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.NetworkCloud.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.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -341,7 +392,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,ClusterName=ClusterName}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,ClusterName=ClusterName}) { 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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ) { @@ -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.NetworkCloud.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, ClusterName=ClusterName }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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, ClusterName=ClusterName }) + 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.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetList + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetList /// 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.NetworkCloud.Models.IBareMetalMachineKeySetList + 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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudBareMetalMachine_Get.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudBareMetalMachine_Get.cs index c9288394aa24..93adae1a8cbb 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudBareMetalMachine_Get.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudBareMetalMachine_Get.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// Get properties of the provided bare metal machine. @@ -13,13 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/bareMetalMachines/{bareMetalMachineName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzNetworkCloudBareMetalMachine_Get")] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachine", "15.0.0", "2.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"AssociatedResourceId","HardwareInventoryInterface","HardwareInventoryNic","HybridAksClustersAssociatedId","MachineRole","SecretRotationStatus","VirtualMachinesAssociatedId"}, NewOutputProperties=new string[] {"AssociatedResourceId","HardwareInventoryInterface","HardwareInventoryNic","HybridAksClustersAssociatedId","MachineRole","SecretRotationStatus","VirtualMachinesAssociatedId"}, ChangeDescription="The types of properties will be changed from fixed array to 'List'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachine))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachine))] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Get properties of the provided bare metal machine.")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/bareMetalMachines/{bareMetalMachineName}", ApiVersion = "2025-02-01")] public partial class GetAzNetworkCloudBareMetalMachine_Get : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudBareMetalMachine_Get : 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 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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -53,6 +70,9 @@ public partial class GetAzNetworkCloudBareMetalMachine_Get : global::System.Mana [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudBareMetalMachine_Get : global::System.Mana /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudBareMetalMachine_Get : global::System.Mana [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -149,24 +170,24 @@ public partial class GetAzNetworkCloudBareMetalMachine_Get : global::System.Mana /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IBareMetalMachine + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachine /// 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.NetworkCloud.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 GetAzNetworkCloudBareMetalMachine_Get() { @@ -261,8 +287,33 @@ public GetAzNetworkCloudBareMetalMachine_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.NetworkCloud.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.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -336,7 +387,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.Api20250201.IBareMetalMachine + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachine /// 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.NetworkCloud.Models.Api20250201.IBareMetalMachine - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachine + 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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudBareMetalMachine_GetViaIdentity.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudBareMetalMachine_GetViaIdentity.cs index ef017174b534..925692ee249b 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudBareMetalMachine_GetViaIdentity.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudBareMetalMachine_GetViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// Get properties of the provided bare metal machine. @@ -13,13 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/bareMetalMachines/{bareMetalMachineName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzNetworkCloudBareMetalMachine_GetViaIdentity")] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachine", "15.0.0", "2.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"AssociatedResourceId","HardwareInventoryInterface","HardwareInventoryNic","HybridAksClustersAssociatedId","MachineRole","SecretRotationStatus","VirtualMachinesAssociatedId"}, NewOutputProperties=new string[] {"AssociatedResourceId","HardwareInventoryInterface","HardwareInventoryNic","HybridAksClustersAssociatedId","MachineRole","SecretRotationStatus","VirtualMachinesAssociatedId"}, ChangeDescription="The types of properties will be changed from fixed array to 'List'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachine))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachine))] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Get properties of the provided bare metal machine.")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/bareMetalMachines/{bareMetalMachineName}", ApiVersion = "2025-02-01")] public partial class GetAzNetworkCloudBareMetalMachine_GetViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudBareMetalMachine_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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -53,6 +70,9 @@ public partial class GetAzNetworkCloudBareMetalMachine_GetViaIdentity : global:: [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudBareMetalMachine_GetViaIdentity : global:: /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudBareMetalMachine_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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IBareMetalMachine + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachine /// 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.NetworkCloud.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 GetAzNetworkCloudBareMetalMachine_GetViaIdentity() { @@ -222,8 +247,33 @@ public GetAzNetworkCloudBareMetalMachine_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.NetworkCloud.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.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -314,7 +364,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.RestException(responseMessage, await response); + var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IBareMetalMachine + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachine /// 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.NetworkCloud.Models.Api20250201.IBareMetalMachine - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachine + 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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudBareMetalMachine_List.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudBareMetalMachine_List.cs index dec8b380365b..4701ac5c0761 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudBareMetalMachine_List.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudBareMetalMachine_List.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// Get a list of bare metal machines in the provided subscription. @@ -13,13 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets /// [OpenAPI] ListBySubscription=>GET:"/subscriptions/{subscriptionId}/providers/Microsoft.NetworkCloud/bareMetalMachines" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzNetworkCloudBareMetalMachine_List")] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachine", "15.0.0", "2.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"AssociatedResourceId","HardwareInventoryInterface","HardwareInventoryNic","HybridAksClustersAssociatedId","MachineRole","SecretRotationStatus","VirtualMachinesAssociatedId"}, NewOutputProperties=new string[] {"AssociatedResourceId","HardwareInventoryInterface","HardwareInventoryNic","HybridAksClustersAssociatedId","MachineRole","SecretRotationStatus","VirtualMachinesAssociatedId"}, ChangeDescription="The types of properties will be changed from fixed array to 'List'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachine))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachine))] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Get a list of bare metal machines in the provided subscription.")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/providers/Microsoft.NetworkCloud/bareMetalMachines", ApiVersion = "2025-02-01")] public partial class GetAzNetworkCloudBareMetalMachine_List : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudBareMetalMachine_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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -59,6 +76,9 @@ public partial class GetAzNetworkCloudBareMetalMachine_List : global::System.Man [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudBareMetalMachine_List : global::System.Man /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudBareMetalMachine_List : global::System.Man [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -126,24 +147,24 @@ public partial class GetAzNetworkCloudBareMetalMachine_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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IBareMetalMachineList + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineList /// 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.NetworkCloud.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 GetAzNetworkCloudBareMetalMachine_List() { @@ -238,8 +264,33 @@ public GetAzNetworkCloudBareMetalMachine_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.NetworkCloud.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.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -313,7 +364,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.Api20250201.IBareMetalMachineList + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineList /// 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.NetworkCloud.Models.IBareMetalMachineList + 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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudBareMetalMachine_List1.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudBareMetalMachine_List1.cs index bc7a397351af..5aa74e43a29e 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudBareMetalMachine_List1.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudBareMetalMachine_List1.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// Get a list of bare metal machines in the provided resource group. @@ -13,13 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets /// [OpenAPI] ListByResourceGroup=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/bareMetalMachines" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzNetworkCloudBareMetalMachine_List1")] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachine", "15.0.0", "2.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"AssociatedResourceId","HardwareInventoryInterface","HardwareInventoryNic","HybridAksClustersAssociatedId","MachineRole","SecretRotationStatus","VirtualMachinesAssociatedId"}, NewOutputProperties=new string[] {"AssociatedResourceId","HardwareInventoryInterface","HardwareInventoryNic","HybridAksClustersAssociatedId","MachineRole","SecretRotationStatus","VirtualMachinesAssociatedId"}, ChangeDescription="The types of properties will be changed from fixed array to 'List'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachine))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachine))] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Get a list of bare metal machines in the provided resource group.")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/bareMetalMachines", ApiVersion = "2025-02-01")] public partial class GetAzNetworkCloudBareMetalMachine_List1 : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudBareMetalMachine_List1 : 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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -59,6 +76,9 @@ public partial class GetAzNetworkCloudBareMetalMachine_List1 : global::System.Ma [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudBareMetalMachine_List1 : global::System.Ma /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudBareMetalMachine_List1 : global::System.Ma [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -140,24 +161,24 @@ public partial class GetAzNetworkCloudBareMetalMachine_List1 : 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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IBareMetalMachineList + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineList /// 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.NetworkCloud.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 GetAzNetworkCloudBareMetalMachine_List1() { @@ -252,8 +278,33 @@ public GetAzNetworkCloudBareMetalMachine_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.NetworkCloud.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.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -327,7 +378,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.Api20250201.IBareMetalMachineList + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineList /// 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.NetworkCloud.Models.IBareMetalMachineList + 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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudBmcKeySet_Get.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudBmcKeySet_Get.cs index eb54d97cdcf6..d070e5d94d21 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudBmcKeySet_Get.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudBmcKeySet_Get.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// Get baseboard management controller key set of the provided cluster. @@ -13,13 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/bmcKeySets/{bmcKeySetName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzNetworkCloudBmcKeySet_Get")] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySet", "15.0.0", "2.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"UserList","UserListStatus"}, NewOutputProperties=new string[] {"UserList","UserListStatus"}, ChangeDescription="The types of properties will be changed from fixed array to 'List'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySet))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySet))] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Get baseboard management controller key set of the provided cluster.")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/bmcKeySets/{bmcKeySetName}", ApiVersion = "2025-02-01")] public partial class GetAzNetworkCloudBmcKeySet_Get : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudBmcKeySet_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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -67,6 +84,9 @@ public partial class GetAzNetworkCloudBmcKeySet_Get : global::System.Management. [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudBmcKeySet_Get : global::System.Management. /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudBmcKeySet_Get : global::System.Management. [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -163,24 +184,24 @@ public partial class GetAzNetworkCloudBmcKeySet_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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IBmcKeySet + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySet /// 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) @@ -203,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.NetworkCloud.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -224,7 +250,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzNetworkCloudBmcKeySet_Get() { @@ -275,8 +301,33 @@ public GetAzNetworkCloudBmcKeySet_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.NetworkCloud.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.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -329,7 +380,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -350,7 +401,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,ClusterName=ClusterName,Name=Name}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,ClusterName=ClusterName,Name=Name}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -388,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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 +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.NetworkCloud.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, ClusterName=ClusterName, Name=Name }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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, ClusterName=ClusterName, 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 } }); @@ -428,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.NetworkCloud.Models.Api20250201.IBmcKeySet + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySet /// 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 +496,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySet - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySet + 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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudBmcKeySet_GetViaIdentity.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudBmcKeySet_GetViaIdentity.cs index ce6bdd188b2e..0e1d5f7413b8 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudBmcKeySet_GetViaIdentity.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudBmcKeySet_GetViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// Get baseboard management controller key set of the provided cluster. @@ -13,13 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/bmcKeySets/{bmcKeySetName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzNetworkCloudBmcKeySet_GetViaIdentity")] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySet", "15.0.0", "2.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"UserList","UserListStatus"}, NewOutputProperties=new string[] {"UserList","UserListStatus"}, ChangeDescription="The types of properties will be changed from fixed array to 'List'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySet))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySet))] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Get baseboard management controller key set of the provided cluster.")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/bmcKeySets/{bmcKeySetName}", ApiVersion = "2025-02-01")] public partial class GetAzNetworkCloudBmcKeySet_GetViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudBmcKeySet_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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -53,6 +70,9 @@ public partial class GetAzNetworkCloudBmcKeySet_GetViaIdentity : global::System. [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudBmcKeySet_GetViaIdentity : global::System. /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudBmcKeySet_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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IBmcKeySet + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySet /// 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.NetworkCloud.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 GetAzNetworkCloudBmcKeySet_GetViaIdentity() { @@ -222,8 +247,33 @@ public GetAzNetworkCloudBmcKeySet_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.NetworkCloud.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.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -318,7 +368,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ) { @@ -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.NetworkCloud.Runtime.RestException(responseMessage, await response); + var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IBmcKeySet + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySet /// 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.NetworkCloud.Models.Api20250201.IBmcKeySet - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySet + 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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudBmcKeySet_GetViaIdentityCluster.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudBmcKeySet_GetViaIdentityCluster.cs new file mode 100644 index 000000000000..82ca77208c84 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudBmcKeySet_GetViaIdentityCluster.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.NetworkCloud.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; + using System; + + /// Get baseboard management controller key set of the provided cluster. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/bmcKeySets/{bmcKeySetName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzNetworkCloudBmcKeySet_GetViaIdentityCluster")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySet))] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Get baseboard management controller key set of the provided cluster.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/bmcKeySets/{bmcKeySetName}", ApiVersion = "2025-02-01")] + public partial class GetAzNetworkCloudBmcKeySet_GetViaIdentityCluster : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity _clusterInputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity ClusterInputObject { get => this._clusterInputObject; set => this._clusterInputObject = 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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of the baseboard management controller key set. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the baseboard management controller key set.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the baseboard management controller key set.", + SerializedName = @"bmcKeySetName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("BmcKeySetName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.IBmcKeySet + /// 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.NetworkCloud.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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 GetAzNetworkCloudBmcKeySet_GetViaIdentityCluster() + { + + } + + /// 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.NetworkCloud.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.NetworkCloud.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (ClusterInputObject?.Id != null) + { + this.ClusterInputObject.Id += $"/bmcKeySets/{(global::System.Uri.EscapeDataString(this.Name.ToString()))}"; + await this.Client.BmcKeySetsGetViaIdentity(ClusterInputObject.Id, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == ClusterInputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("ClusterInputObject has null value for ClusterInputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, ClusterInputObject) ); + } + if (null == ClusterInputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("ClusterInputObject has null value for ClusterInputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, ClusterInputObject) ); + } + if (null == ClusterInputObject.ClusterName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("ClusterInputObject has null value for ClusterInputObject.ClusterName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, ClusterInputObject) ); + } + await this.Client.BmcKeySetsGet(ClusterInputObject.SubscriptionId ?? null, ClusterInputObject.ResourceGroupName ?? null, ClusterInputObject.ClusterName ?? null, Name, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.IBmcKeySet + /// 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.NetworkCloud.Models.IBmcKeySet + 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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudBmcKeySet_List.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudBmcKeySet_List.cs index 25f6fd0e4e51..18099f6422cb 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudBmcKeySet_List.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudBmcKeySet_List.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// @@ -15,13 +17,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets /// [OpenAPI] ListByCluster=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/bmcKeySets" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzNetworkCloudBmcKeySet_List")] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySet", "15.0.0", "2.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"UserList","UserListStatus"}, NewOutputProperties=new string[] {"UserList","UserListStatus"}, ChangeDescription="The types of properties will be changed from fixed array to 'List'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySet))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySet))] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Get a list of baseboard management controller key sets for the provided cluster.")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/bmcKeySets", ApiVersion = "2025-02-01")] public partial class GetAzNetworkCloudBmcKeySet_List : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudBmcKeySet_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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -75,6 +92,9 @@ public partial class GetAzNetworkCloudBmcKeySet_List : global::System.Management [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 +121,7 @@ public partial class GetAzNetworkCloudBmcKeySet_List : global::System.Management /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 +167,8 @@ public partial class GetAzNetworkCloudBmcKeySet_List : global::System.Management [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -156,24 +177,24 @@ public partial class GetAzNetworkCloudBmcKeySet_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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IBmcKeySetList + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetList /// 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) @@ -196,6 +217,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.NetworkCloud.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -217,7 +243,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzNetworkCloudBmcKeySet_List() { @@ -268,8 +294,33 @@ public GetAzNetworkCloudBmcKeySet_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.NetworkCloud.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.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -322,7 +373,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -343,7 +394,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,ClusterName=ClusterName}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,ClusterName=ClusterName}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -381,12 +432,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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ) { @@ -403,15 +454,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.NetworkCloud.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, ClusterName=ClusterName }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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, ClusterName=ClusterName }) + 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 } }); @@ -421,12 +472,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.NetworkCloud.Models.Api20250201.IBmcKeySetList + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetList /// 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 ) { @@ -438,15 +489,38 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetList + 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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudClusterManager_Get.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudClusterManager_Get.cs index 5b58bcf7afec..3990a642b1de 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudClusterManager_Get.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudClusterManager_Get.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// Get the properties of the provided cluster manager. @@ -13,13 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusterManagers/{clusterManagerName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzNetworkCloudClusterManager_Get")] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManager", "15.0.0", "2.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"AvailabilityZone","ClusterVersion"}, NewOutputProperties=new string[] {"AvailabilityZone","ClusterVersion"}, ChangeDescription="The types of properties will be changed from fixed array to 'List'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManager))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManager))] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Get the properties of the provided cluster manager.")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusterManagers/{clusterManagerName}", ApiVersion = "2025-02-01")] public partial class GetAzNetworkCloudClusterManager_Get : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudClusterManager_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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -53,6 +70,9 @@ public partial class GetAzNetworkCloudClusterManager_Get : global::System.Manage [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudClusterManager_Get : global::System.Manage /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudClusterManager_Get : global::System.Manage [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -149,24 +170,24 @@ public partial class GetAzNetworkCloudClusterManager_Get : 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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IClusterManager + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManager /// 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.NetworkCloud.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 GetAzNetworkCloudClusterManager_Get() { @@ -261,8 +287,33 @@ public GetAzNetworkCloudClusterManager_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.NetworkCloud.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.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -336,7 +387,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.Api20250201.IClusterManager + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManager /// 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.NetworkCloud.Models.Api20250201.IClusterManager - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManager + 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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudClusterManager_GetViaIdentity.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudClusterManager_GetViaIdentity.cs index 7073bf119637..062bb8879ee3 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudClusterManager_GetViaIdentity.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudClusterManager_GetViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// Get the properties of the provided cluster manager. @@ -13,13 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusterManagers/{clusterManagerName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzNetworkCloudClusterManager_GetViaIdentity")] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManager", "15.0.0", "2.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"AvailabilityZone","ClusterVersion"}, NewOutputProperties=new string[] {"AvailabilityZone","ClusterVersion"}, ChangeDescription="The types of properties will be changed from fixed array to 'List'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManager))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManager))] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Get the properties of the provided cluster manager.")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusterManagers/{clusterManagerName}", ApiVersion = "2025-02-01")] public partial class GetAzNetworkCloudClusterManager_GetViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudClusterManager_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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -53,6 +70,9 @@ public partial class GetAzNetworkCloudClusterManager_GetViaIdentity : global::Sy [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudClusterManager_GetViaIdentity : global::Sy /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudClusterManager_GetViaIdentity : 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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IClusterManager + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManager /// 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.NetworkCloud.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 GetAzNetworkCloudClusterManager_GetViaIdentity() { @@ -222,8 +247,33 @@ public GetAzNetworkCloudClusterManager_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.NetworkCloud.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.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -314,7 +364,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.RestException(responseMessage, await response); + var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IClusterManager + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManager /// 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.NetworkCloud.Models.Api20250201.IClusterManager - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManager + 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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudClusterManager_List.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudClusterManager_List.cs index 64f567039d15..5e94d983fe34 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudClusterManager_List.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudClusterManager_List.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// Get a list of cluster managers in the provided subscription. @@ -13,13 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets /// [OpenAPI] ListBySubscription=>GET:"/subscriptions/{subscriptionId}/providers/Microsoft.NetworkCloud/clusterManagers" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzNetworkCloudClusterManager_List")] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManager", "15.0.0", "2.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"AvailabilityZone","ClusterVersion"}, NewOutputProperties=new string[] {"AvailabilityZone","ClusterVersion"}, ChangeDescription="The types of properties will be changed from fixed array to 'List'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManager))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManager))] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Get a list of cluster managers in the provided subscription.")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/providers/Microsoft.NetworkCloud/clusterManagers", ApiVersion = "2025-02-01")] public partial class GetAzNetworkCloudClusterManager_List : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudClusterManager_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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -59,6 +76,9 @@ public partial class GetAzNetworkCloudClusterManager_List : global::System.Manag [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudClusterManager_List : global::System.Manag /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudClusterManager_List : global::System.Manag [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -126,24 +147,24 @@ public partial class GetAzNetworkCloudClusterManager_List : 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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IClusterManagerList + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerList /// 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.NetworkCloud.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 GetAzNetworkCloudClusterManager_List() { @@ -238,8 +264,33 @@ public GetAzNetworkCloudClusterManager_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.NetworkCloud.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.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -313,7 +364,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.Api20250201.IClusterManagerList + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerList /// 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.NetworkCloud.Models.IClusterManagerList + 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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudClusterManager_List1.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudClusterManager_List1.cs index 6accbace2977..cd7e106fc27e 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudClusterManager_List1.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudClusterManager_List1.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// Get a list of cluster managers in the provided resource group. @@ -13,13 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets /// [OpenAPI] ListByResourceGroup=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusterManagers" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzNetworkCloudClusterManager_List1")] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManager", "15.0.0", "2.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"AvailabilityZone","ClusterVersion"}, NewOutputProperties=new string[] {"AvailabilityZone","ClusterVersion"}, ChangeDescription="The types of properties will be changed from fixed array to 'List'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManager))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManager))] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Get a list of cluster managers in the provided resource group.")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusterManagers", ApiVersion = "2025-02-01")] public partial class GetAzNetworkCloudClusterManager_List1 : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudClusterManager_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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -59,6 +76,9 @@ public partial class GetAzNetworkCloudClusterManager_List1 : global::System.Mana [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudClusterManager_List1 : global::System.Mana /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudClusterManager_List1 : global::System.Mana [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -140,24 +161,24 @@ public partial class GetAzNetworkCloudClusterManager_List1 : global::System.Mana /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IClusterManagerList + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerList /// 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.NetworkCloud.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 GetAzNetworkCloudClusterManager_List1() { @@ -252,8 +278,33 @@ public GetAzNetworkCloudClusterManager_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.NetworkCloud.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.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -327,7 +378,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.Api20250201.IClusterManagerList + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManagerList /// 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.NetworkCloud.Models.IClusterManagerList + 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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudCluster_Get.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudCluster_Get.cs index 50f6be87aa98..d333013520e1 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudCluster_Get.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudCluster_Get.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// Get properties of the provided cluster. @@ -13,13 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzNetworkCloudCluster_Get")] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICluster", "15.0.0", "2.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"AggregatorOrSingleRackDefinitionBareMetalMachineConfigurationData","AggregatorOrSingleRackDefinitionStorageApplianceConfigurationData","AvailableUpgradeVersion","ComputeRackDefinition","WorkloadResourceId"}, NewOutputProperties=new string[] {"AggregatorOrSingleRackDefinitionBareMetalMachineConfigurationData","AggregatorOrSingleRackDefinitionStorageApplianceConfigurationData","AvailableUpgradeVersion","ComputeRackDefinition","WorkloadResourceId"}, ChangeDescription="The types of properties will be changed from fixed array to 'List'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICluster))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICluster))] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Get properties of the provided cluster.")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}", ApiVersion = "2025-02-01")] public partial class GetAzNetworkCloudCluster_Get : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudCluster_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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -53,6 +70,9 @@ public partial class GetAzNetworkCloudCluster_Get : global::System.Management.Au [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudCluster_Get : global::System.Management.Au /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudCluster_Get : global::System.Management.Au [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -149,24 +170,24 @@ public partial class GetAzNetworkCloudCluster_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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.ICluster + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICluster /// 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.NetworkCloud.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 GetAzNetworkCloudCluster_Get() { @@ -261,8 +287,33 @@ public GetAzNetworkCloudCluster_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.NetworkCloud.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.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -336,7 +387,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.Api20250201.ICluster + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICluster /// 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.NetworkCloud.Models.Api20250201.ICluster - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICluster + 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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudCluster_GetViaIdentity.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudCluster_GetViaIdentity.cs index 6175e049cdad..872dfee305f5 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudCluster_GetViaIdentity.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudCluster_GetViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// Get properties of the provided cluster. @@ -13,13 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzNetworkCloudCluster_GetViaIdentity")] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICluster", "15.0.0", "2.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"AggregatorOrSingleRackDefinitionBareMetalMachineConfigurationData","AggregatorOrSingleRackDefinitionStorageApplianceConfigurationData","AvailableUpgradeVersion","ComputeRackDefinition","WorkloadResourceId"}, NewOutputProperties=new string[] {"AggregatorOrSingleRackDefinitionBareMetalMachineConfigurationData","AggregatorOrSingleRackDefinitionStorageApplianceConfigurationData","AvailableUpgradeVersion","ComputeRackDefinition","WorkloadResourceId"}, ChangeDescription="The types of properties will be changed from fixed array to 'List'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICluster))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICluster))] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Get properties of the provided cluster.")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}", ApiVersion = "2025-02-01")] public partial class GetAzNetworkCloudCluster_GetViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudCluster_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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -53,6 +70,9 @@ public partial class GetAzNetworkCloudCluster_GetViaIdentity : global::System.Ma [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudCluster_GetViaIdentity : global::System.Ma /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudCluster_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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.ICluster + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICluster /// 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.NetworkCloud.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 GetAzNetworkCloudCluster_GetViaIdentity() { @@ -222,8 +247,33 @@ public GetAzNetworkCloudCluster_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.NetworkCloud.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.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -314,7 +364,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.RestException(responseMessage, await response); + var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.ICluster + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICluster /// 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.NetworkCloud.Models.Api20250201.ICluster - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICluster + 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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudCluster_List.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudCluster_List.cs index 5ddbd2581b63..fdcc95e8f168 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudCluster_List.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudCluster_List.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// Get a list of clusters in the provided subscription. @@ -13,13 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets /// [OpenAPI] ListBySubscription=>GET:"/subscriptions/{subscriptionId}/providers/Microsoft.NetworkCloud/clusters" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzNetworkCloudCluster_List")] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICluster", "15.0.0", "2.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"AggregatorOrSingleRackDefinitionBareMetalMachineConfigurationData","AggregatorOrSingleRackDefinitionStorageApplianceConfigurationData","AvailableUpgradeVersion","ComputeRackDefinition","WorkloadResourceId"}, NewOutputProperties=new string[] {"AggregatorOrSingleRackDefinitionBareMetalMachineConfigurationData","AggregatorOrSingleRackDefinitionStorageApplianceConfigurationData","AvailableUpgradeVersion","ComputeRackDefinition","WorkloadResourceId"}, ChangeDescription="The types of properties will be changed from fixed array to 'List'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICluster))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICluster))] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Get a list of clusters in the provided subscription.")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/providers/Microsoft.NetworkCloud/clusters", ApiVersion = "2025-02-01")] public partial class GetAzNetworkCloudCluster_List : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudCluster_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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -59,6 +76,9 @@ public partial class GetAzNetworkCloudCluster_List : global::System.Management.A [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudCluster_List : global::System.Management.A /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudCluster_List : global::System.Management.A [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -126,24 +147,24 @@ public partial class GetAzNetworkCloudCluster_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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IClusterList + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterList /// 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.NetworkCloud.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 GetAzNetworkCloudCluster_List() { @@ -238,8 +264,33 @@ public GetAzNetworkCloudCluster_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.NetworkCloud.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.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -313,7 +364,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.Api20250201.IClusterList + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterList /// 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.NetworkCloud.Models.IClusterList + 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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudCluster_List1.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudCluster_List1.cs index 5eae5831ef24..b7c1fd2c591f 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudCluster_List1.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudCluster_List1.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// Get a list of clusters in the provided resource group. @@ -13,13 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets /// [OpenAPI] ListByResourceGroup=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzNetworkCloudCluster_List1")] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICluster", "15.0.0", "2.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"AggregatorOrSingleRackDefinitionBareMetalMachineConfigurationData","AggregatorOrSingleRackDefinitionStorageApplianceConfigurationData","AvailableUpgradeVersion","ComputeRackDefinition","WorkloadResourceId"}, NewOutputProperties=new string[] {"AggregatorOrSingleRackDefinitionBareMetalMachineConfigurationData","AggregatorOrSingleRackDefinitionStorageApplianceConfigurationData","AvailableUpgradeVersion","ComputeRackDefinition","WorkloadResourceId"}, ChangeDescription="The types of properties will be changed from fixed array to 'List'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICluster))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICluster))] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Get a list of clusters in the provided resource group.")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters", ApiVersion = "2025-02-01")] public partial class GetAzNetworkCloudCluster_List1 : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudCluster_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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -59,6 +76,9 @@ public partial class GetAzNetworkCloudCluster_List1 : global::System.Management. [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudCluster_List1 : global::System.Management. /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudCluster_List1 : global::System.Management. [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -140,24 +161,24 @@ public partial class GetAzNetworkCloudCluster_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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IClusterList + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterList /// 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.NetworkCloud.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 GetAzNetworkCloudCluster_List1() { @@ -252,8 +278,33 @@ public GetAzNetworkCloudCluster_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.NetworkCloud.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.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -327,7 +378,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.Api20250201.IClusterList + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterList /// 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.NetworkCloud.Models.IClusterList + 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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudConsole_Get.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudConsole_Get.cs index 2d4ce9196fe0..a6a3328d5f54 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudConsole_Get.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudConsole_Get.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// Get properties of the provided virtual machine console. @@ -13,12 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/virtualMachines/{virtualMachineName}/consoles/{consoleName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzNetworkCloudConsole_Get")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsole))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsole))] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Get properties of the provided virtual machine console.")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/virtualMachines/{virtualMachineName}/consoles/{consoleName}", ApiVersion = "2025-02-01")] public partial class GetAzNetworkCloudConsole_Get : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudConsole_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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -52,6 +70,9 @@ public partial class GetAzNetworkCloudConsole_Get : global::System.Management.Au [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudConsole_Get : global::System.Management.Au /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 +160,8 @@ public partial class GetAzNetworkCloudConsole_Get : global::System.Management.Au [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -162,24 +184,24 @@ public partial class GetAzNetworkCloudConsole_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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IConsole + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsole /// 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.NetworkCloud.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -223,7 +250,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzNetworkCloudConsole_Get() { @@ -274,8 +301,33 @@ public GetAzNetworkCloudConsole_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.NetworkCloud.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.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -328,7 +380,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -349,7 +401,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,VirtualMachineName=VirtualMachineName,Name=Name}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,VirtualMachineName=VirtualMachineName,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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ) { @@ -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.NetworkCloud.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, VirtualMachineName=VirtualMachineName, Name=Name }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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, VirtualMachineName=VirtualMachineName, 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 } }); @@ -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.NetworkCloud.Models.Api20250201.IConsole + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsole /// 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.NetworkCloud.Models.Api20250201.IConsole - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsole + 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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudConsole_GetViaIdentity.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudConsole_GetViaIdentity.cs index 487bfdaf95e2..6074eba7be0b 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudConsole_GetViaIdentity.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudConsole_GetViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// Get properties of the provided virtual machine console. @@ -13,12 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/virtualMachines/{virtualMachineName}/consoles/{consoleName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzNetworkCloudConsole_GetViaIdentity")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsole))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsole))] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Get properties of the provided virtual machine console.")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/virtualMachines/{virtualMachineName}/consoles/{consoleName}", ApiVersion = "2025-02-01")] public partial class GetAzNetworkCloudConsole_GetViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudConsole_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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -52,6 +70,9 @@ public partial class GetAzNetworkCloudConsole_GetViaIdentity : global::System.Ma [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudConsole_GetViaIdentity : global::System.Ma /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudConsole_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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IConsole + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsole /// 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.NetworkCloud.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 GetAzNetworkCloudConsole_GetViaIdentity() { @@ -221,8 +247,33 @@ public GetAzNetworkCloudConsole_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.NetworkCloud.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.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -317,7 +368,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 } }); @@ -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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ) { @@ -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.NetworkCloud.Runtime.RestException(responseMessage, await response); + var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 } @@ -395,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.NetworkCloud.Models.Api20250201.IConsole + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsole /// 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 ) { @@ -412,8 +463,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsole - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsole + 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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudConsole_GetViaIdentityVirtualMachine.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudConsole_GetViaIdentityVirtualMachine.cs new file mode 100644 index 000000000000..7e7bd51f398f --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudConsole_GetViaIdentityVirtualMachine.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.NetworkCloud.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; + using System; + + /// Get properties of the provided virtual machine console. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/virtualMachines/{virtualMachineName}/consoles/{consoleName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzNetworkCloudConsole_GetViaIdentityVirtualMachine")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsole))] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Get properties of the provided virtual machine console.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/virtualMachines/{virtualMachineName}/consoles/{consoleName}", ApiVersion = "2025-02-01")] + public partial class GetAzNetworkCloudConsole_GetViaIdentityVirtualMachine : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of the virtual machine console. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the virtual machine console.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the virtual machine console.", + SerializedName = @"consoleName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("ConsoleName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity _virtualMachineInputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity VirtualMachineInputObject { get => this._virtualMachineInputObject; set => this._virtualMachineInputObject = 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.NetworkCloud.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.NetworkCloud.Models.IConsole + /// 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.NetworkCloud.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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 GetAzNetworkCloudConsole_GetViaIdentityVirtualMachine() + { + + } + + /// 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.NetworkCloud.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.NetworkCloud.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (VirtualMachineInputObject?.Id != null) + { + this.VirtualMachineInputObject.Id += $"/consoles/{(global::System.Uri.EscapeDataString(this.Name.ToString()))}"; + await this.Client.ConsolesGetViaIdentity(VirtualMachineInputObject.Id, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == VirtualMachineInputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("VirtualMachineInputObject has null value for VirtualMachineInputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, VirtualMachineInputObject) ); + } + if (null == VirtualMachineInputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("VirtualMachineInputObject has null value for VirtualMachineInputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, VirtualMachineInputObject) ); + } + if (null == VirtualMachineInputObject.VirtualMachineName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("VirtualMachineInputObject has null value for VirtualMachineInputObject.VirtualMachineName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, VirtualMachineInputObject) ); + } + await this.Client.ConsolesGet(VirtualMachineInputObject.SubscriptionId ?? null, VirtualMachineInputObject.ResourceGroupName ?? null, VirtualMachineInputObject.VirtualMachineName ?? null, Name, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.IConsole + /// 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.NetworkCloud.Models.IConsole + 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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudConsole_List.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudConsole_List.cs index f6fb5caf4332..967a50273277 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudConsole_List.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudConsole_List.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// Get a list of consoles for the provided virtual machine. @@ -13,12 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets /// [OpenAPI] ListByVirtualMachine=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/virtualMachines/{virtualMachineName}/consoles" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzNetworkCloudConsole_List")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsole))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsole))] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Get a list of consoles for the provided virtual machine.")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/virtualMachines/{virtualMachineName}/consoles", ApiVersion = "2025-02-01")] public partial class GetAzNetworkCloudConsole_List : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudConsole_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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -58,6 +76,9 @@ public partial class GetAzNetworkCloudConsole_List : global::System.Management.A [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudConsole_List : global::System.Management.A /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,7 +151,8 @@ public partial class GetAzNetworkCloudConsole_List : global::System.Management.A [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -153,24 +175,24 @@ public partial class GetAzNetworkCloudConsole_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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IConsoleList + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsoleList /// 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) @@ -193,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.NetworkCloud.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -214,7 +241,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzNetworkCloudConsole_List() { @@ -265,8 +292,33 @@ public GetAzNetworkCloudConsole_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.NetworkCloud.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.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -340,7 +392,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,VirtualMachineName=VirtualMachineName}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,VirtualMachineName=VirtualMachineName}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -378,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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ) { @@ -400,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.NetworkCloud.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, VirtualMachineName=VirtualMachineName }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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, VirtualMachineName=VirtualMachineName }) + 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 } }); @@ -418,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.NetworkCloud.Models.Api20250201.IConsoleList + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsoleList /// 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 ) { @@ -435,15 +487,38 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsoleList + 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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudKubernetesClusterFeature_Get.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudKubernetesClusterFeature_Get.cs index 8755e5905074..2924fe939d52 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudKubernetesClusterFeature_Get.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudKubernetesClusterFeature_Get.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// Get properties of the provided the Kubernetes cluster feature. @@ -13,13 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/kubernetesClusters/{kubernetesClusterName}/features/{featureName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzNetworkCloudKubernetesClusterFeature_Get")] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeature", "15.0.0", "2.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"Option"}, NewOutputProperties=new string[] {"Option"}, ChangeDescription="The type of property will be changed from fixed array to 'List'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeature))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeature))] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Get properties of the provided the Kubernetes cluster feature.")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/kubernetesClusters/{kubernetesClusterName}/features/{featureName}", ApiVersion = "2025-02-01")] public partial class GetAzNetworkCloudKubernetesClusterFeature_Get : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudKubernetesClusterFeature_Get : 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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -53,6 +70,9 @@ public partial class GetAzNetworkCloudKubernetesClusterFeature_Get : global::Sys [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 _featureName; @@ -107,7 +127,7 @@ public partial class GetAzNetworkCloudKubernetesClusterFeature_Get : global::Sys /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudKubernetesClusterFeature_Get : global::Sys [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -162,24 +183,24 @@ public partial class GetAzNetworkCloudKubernetesClusterFeature_Get : 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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IKubernetesClusterFeature + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeature /// 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.NetworkCloud.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 GetAzNetworkCloudKubernetesClusterFeature_Get() { @@ -274,8 +300,33 @@ public GetAzNetworkCloudKubernetesClusterFeature_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.NetworkCloud.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.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -349,7 +400,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,KubernetesClusterName=KubernetesClusterName,FeatureName=FeatureName}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,KubernetesClusterName=KubernetesClusterName,FeatureName=FeatureName}) { 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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ) { @@ -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.NetworkCloud.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, KubernetesClusterName=KubernetesClusterName, FeatureName=FeatureName }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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, KubernetesClusterName=KubernetesClusterName, FeatureName=FeatureName }) + 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.NetworkCloud.Models.Api20250201.IKubernetesClusterFeature + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeature /// 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.NetworkCloud.Models.Api20250201.IKubernetesClusterFeature - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeature + 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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudKubernetesClusterFeature_GetViaIdentity.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudKubernetesClusterFeature_GetViaIdentity.cs index 7afc9ca19c68..a8051af8f093 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudKubernetesClusterFeature_GetViaIdentity.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudKubernetesClusterFeature_GetViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// Get properties of the provided the Kubernetes cluster feature. @@ -13,13 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/kubernetesClusters/{kubernetesClusterName}/features/{featureName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzNetworkCloudKubernetesClusterFeature_GetViaIdentity")] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeature", "15.0.0", "2.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"Option"}, NewOutputProperties=new string[] {"Option"}, ChangeDescription="The type of property will be changed from fixed array to 'List'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeature))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeature))] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Get properties of the provided the Kubernetes cluster feature.")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/kubernetesClusters/{kubernetesClusterName}/features/{featureName}", ApiVersion = "2025-02-01")] public partial class GetAzNetworkCloudKubernetesClusterFeature_GetViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudKubernetesClusterFeature_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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -53,6 +70,9 @@ public partial class GetAzNetworkCloudKubernetesClusterFeature_GetViaIdentity : [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudKubernetesClusterFeature_GetViaIdentity : /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudKubernetesClusterFeature_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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IKubernetesClusterFeature + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeature /// 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.NetworkCloud.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 GetAzNetworkCloudKubernetesClusterFeature_GetViaIdentity() { @@ -222,8 +247,33 @@ public GetAzNetworkCloudKubernetesClusterFeature_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.NetworkCloud.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.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -318,7 +368,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ) { @@ -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.NetworkCloud.Runtime.RestException(responseMessage, await response); + var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IKubernetesClusterFeature + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeature /// 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.NetworkCloud.Models.Api20250201.IKubernetesClusterFeature - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeature + 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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudKubernetesClusterFeature_GetViaIdentityKubernetesCluster.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudKubernetesClusterFeature_GetViaIdentityKubernetesCluster.cs new file mode 100644 index 000000000000..a4d6b4eab160 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudKubernetesClusterFeature_GetViaIdentityKubernetesCluster.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.NetworkCloud.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; + using System; + + /// Get properties of the provided the Kubernetes cluster feature. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/kubernetesClusters/{kubernetesClusterName}/features/{featureName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzNetworkCloudKubernetesClusterFeature_GetViaIdentityKubernetesCluster")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeature))] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Get properties of the provided the Kubernetes cluster feature.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/kubernetesClusters/{kubernetesClusterName}/features/{featureName}", ApiVersion = "2025-02-01")] + public partial class GetAzNetworkCloudKubernetesClusterFeature_GetViaIdentityKubernetesCluster : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 _featureName; + + /// The name of the feature. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the feature.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the feature.", + SerializedName = @"featureName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] + public string FeatureName { get => this._featureName; set => this._featureName = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity _kubernetesClusterInputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity KubernetesClusterInputObject { get => this._kubernetesClusterInputObject; set => this._kubernetesClusterInputObject = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.IKubernetesClusterFeature + /// 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.NetworkCloud.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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 GetAzNetworkCloudKubernetesClusterFeature_GetViaIdentityKubernetesCluster() + { + + } + + /// 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.NetworkCloud.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.NetworkCloud.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (KubernetesClusterInputObject?.Id != null) + { + this.KubernetesClusterInputObject.Id += $"/features/{(global::System.Uri.EscapeDataString(this.FeatureName.ToString()))}"; + await this.Client.KubernetesClusterFeaturesGetViaIdentity(KubernetesClusterInputObject.Id, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == KubernetesClusterInputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("KubernetesClusterInputObject has null value for KubernetesClusterInputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, KubernetesClusterInputObject) ); + } + if (null == KubernetesClusterInputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("KubernetesClusterInputObject has null value for KubernetesClusterInputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, KubernetesClusterInputObject) ); + } + if (null == KubernetesClusterInputObject.KubernetesClusterName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("KubernetesClusterInputObject has null value for KubernetesClusterInputObject.KubernetesClusterName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, KubernetesClusterInputObject) ); + } + await this.Client.KubernetesClusterFeaturesGet(KubernetesClusterInputObject.SubscriptionId ?? null, KubernetesClusterInputObject.ResourceGroupName ?? null, KubernetesClusterInputObject.KubernetesClusterName ?? null, FeatureName, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { FeatureName=FeatureName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.IKubernetesClusterFeature + /// 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.NetworkCloud.Models.IKubernetesClusterFeature + 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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudKubernetesClusterFeature_List.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudKubernetesClusterFeature_List.cs index 661334646c0e..ef0f504ae293 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudKubernetesClusterFeature_List.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudKubernetesClusterFeature_List.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// Get a list of features for the provided Kubernetes cluster. @@ -13,13 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets /// [OpenAPI] ListByKubernetesCluster=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/kubernetesClusters/{kubernetesClusterName}/features" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzNetworkCloudKubernetesClusterFeature_List")] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeature", "15.0.0", "2.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"Option"}, NewOutputProperties=new string[] {"Option"}, ChangeDescription="The type of property will be changed from fixed array to 'List'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeature))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeature))] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Get a list of features for the provided Kubernetes cluster.")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/kubernetesClusters/{kubernetesClusterName}/features", ApiVersion = "2025-02-01")] public partial class GetAzNetworkCloudKubernetesClusterFeature_List : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudKubernetesClusterFeature_List : 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 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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -59,6 +76,9 @@ public partial class GetAzNetworkCloudKubernetesClusterFeature_List : global::Sy [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudKubernetesClusterFeature_List : global::Sy /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudKubernetesClusterFeature_List : global::Sy [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -154,24 +175,24 @@ public partial class GetAzNetworkCloudKubernetesClusterFeature_List : 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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IKubernetesClusterFeatureList + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeatureList /// 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.NetworkCloud.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 GetAzNetworkCloudKubernetesClusterFeature_List() { @@ -266,8 +292,33 @@ public GetAzNetworkCloudKubernetesClusterFeature_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.NetworkCloud.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.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -341,7 +392,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,KubernetesClusterName=KubernetesClusterName}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,KubernetesClusterName=KubernetesClusterName}) { 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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ) { @@ -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.NetworkCloud.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, KubernetesClusterName=KubernetesClusterName }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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, KubernetesClusterName=KubernetesClusterName }) + 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.NetworkCloud.Models.Api20250201.IKubernetesClusterFeatureList + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeatureList /// 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.NetworkCloud.Models.IKubernetesClusterFeatureList + 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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudKubernetesCluster_Get.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudKubernetesCluster_Get.cs index 8d9f9f7302b0..bbe377c8fb83 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudKubernetesCluster_Get.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudKubernetesCluster_Get.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// Get properties of the provided the Kubernetes cluster. @@ -13,13 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/kubernetesClusters/{kubernetesClusterName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzNetworkCloudKubernetesCluster_Get")] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesCluster", "15.0.0", "2.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"AadConfigurationAdminGroupObjectId","AttachedNetworkConfigurationL2Network","AttachedNetworkConfigurationL3Network","AttachedNetworkConfigurationTrunkedNetwork","AttachedNetworkId","AvailableUpgrade","BgpServiceLoadBalancerConfigurationBgpAdvertisement","BgpServiceLoadBalancerConfigurationBgpPeer","BgpServiceLoadBalancerConfigurationIPAddressPool","ControlPlaneNodeConfigurationAdministratorConfigurationSshPublicKey","ControlPlaneNodeConfigurationAvailabilityZone","FeatureStatuses","InitialAgentPoolConfiguration","L2ServiceLoadBalancerConfigurationIPAddressPool","NetworkConfigurationPodCidr","NetworkConfigurationServiceCidr","Node","SshPublicKey"}, NewOutputProperties=new string[] {"AadConfigurationAdminGroupObjectId","AttachedNetworkConfigurationL2Network","AttachedNetworkConfigurationL3Network","AttachedNetworkConfigurationTrunkedNetwork","AttachedNetworkId","AvailableUpgrade","BgpServiceLoadBalancerConfigurationBgpAdvertisement","BgpServiceLoadBalancerConfigurationBgpPeer","BgpServiceLoadBalancerConfigurationIPAddressPool","ControlPlaneNodeConfigurationAdministratorConfigurationSshPublicKey","ControlPlaneNodeConfigurationAvailabilityZone","FeatureStatuses","InitialAgentPoolConfiguration","L2ServiceLoadBalancerConfigurationIPAddressPool","NetworkConfigurationPodCidr","NetworkConfigurationServiceCidr","Node","SshPublicKey"}, ChangeDescription="The types of properties will be changed from fixed array to 'List'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesCluster))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesCluster))] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Get properties of the provided the Kubernetes cluster.")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/kubernetesClusters/{kubernetesClusterName}", ApiVersion = "2025-02-01")] public partial class GetAzNetworkCloudKubernetesCluster_Get : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudKubernetesCluster_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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -53,6 +70,9 @@ public partial class GetAzNetworkCloudKubernetesCluster_Get : global::System.Man [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudKubernetesCluster_Get : global::System.Man /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudKubernetesCluster_Get : global::System.Man [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -149,24 +170,24 @@ public partial class GetAzNetworkCloudKubernetesCluster_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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IKubernetesCluster + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesCluster /// 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.NetworkCloud.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 GetAzNetworkCloudKubernetesCluster_Get() { @@ -261,8 +287,33 @@ public GetAzNetworkCloudKubernetesCluster_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.NetworkCloud.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.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -336,7 +387,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.Api20250201.IKubernetesCluster + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesCluster /// 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.NetworkCloud.Models.Api20250201.IKubernetesCluster - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesCluster + 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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudKubernetesCluster_GetViaIdentity.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudKubernetesCluster_GetViaIdentity.cs index 74e243c2f9f0..7c1dd6740116 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudKubernetesCluster_GetViaIdentity.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudKubernetesCluster_GetViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// Get properties of the provided the Kubernetes cluster. @@ -13,13 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/kubernetesClusters/{kubernetesClusterName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzNetworkCloudKubernetesCluster_GetViaIdentity")] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesCluster", "15.0.0", "2.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"AadConfigurationAdminGroupObjectId","AttachedNetworkConfigurationL2Network","AttachedNetworkConfigurationL3Network","AttachedNetworkConfigurationTrunkedNetwork","AttachedNetworkId","AvailableUpgrade","BgpServiceLoadBalancerConfigurationBgpAdvertisement","BgpServiceLoadBalancerConfigurationBgpPeer","BgpServiceLoadBalancerConfigurationIPAddressPool","ControlPlaneNodeConfigurationAdministratorConfigurationSshPublicKey","ControlPlaneNodeConfigurationAvailabilityZone","FeatureStatuses","InitialAgentPoolConfiguration","L2ServiceLoadBalancerConfigurationIPAddressPool","NetworkConfigurationPodCidr","NetworkConfigurationServiceCidr","Node","SshPublicKey"}, NewOutputProperties=new string[] {"AadConfigurationAdminGroupObjectId","AttachedNetworkConfigurationL2Network","AttachedNetworkConfigurationL3Network","AttachedNetworkConfigurationTrunkedNetwork","AttachedNetworkId","AvailableUpgrade","BgpServiceLoadBalancerConfigurationBgpAdvertisement","BgpServiceLoadBalancerConfigurationBgpPeer","BgpServiceLoadBalancerConfigurationIPAddressPool","ControlPlaneNodeConfigurationAdministratorConfigurationSshPublicKey","ControlPlaneNodeConfigurationAvailabilityZone","FeatureStatuses","InitialAgentPoolConfiguration","L2ServiceLoadBalancerConfigurationIPAddressPool","NetworkConfigurationPodCidr","NetworkConfigurationServiceCidr","Node","SshPublicKey"}, ChangeDescription="The types of properties will be changed from fixed array to 'List'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesCluster))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesCluster))] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Get properties of the provided the Kubernetes cluster.")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/kubernetesClusters/{kubernetesClusterName}", ApiVersion = "2025-02-01")] public partial class GetAzNetworkCloudKubernetesCluster_GetViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudKubernetesCluster_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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -53,6 +70,9 @@ public partial class GetAzNetworkCloudKubernetesCluster_GetViaIdentity : global: [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudKubernetesCluster_GetViaIdentity : global: /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudKubernetesCluster_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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IKubernetesCluster + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesCluster /// 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.NetworkCloud.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 GetAzNetworkCloudKubernetesCluster_GetViaIdentity() { @@ -222,8 +247,33 @@ public GetAzNetworkCloudKubernetesCluster_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.NetworkCloud.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.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -314,7 +364,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.RestException(responseMessage, await response); + var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IKubernetesCluster + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesCluster /// 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.NetworkCloud.Models.Api20250201.IKubernetesCluster - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesCluster + 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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudKubernetesCluster_List.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudKubernetesCluster_List.cs index bdd6183c9c2f..03ff32c136b7 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudKubernetesCluster_List.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudKubernetesCluster_List.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// Get a list of Kubernetes clusters in the provided subscription. @@ -13,13 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets /// [OpenAPI] ListBySubscription=>GET:"/subscriptions/{subscriptionId}/providers/Microsoft.NetworkCloud/kubernetesClusters" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzNetworkCloudKubernetesCluster_List")] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesCluster", "15.0.0", "2.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"AadConfigurationAdminGroupObjectId","AttachedNetworkConfigurationL2Network","AttachedNetworkConfigurationL3Network","AttachedNetworkConfigurationTrunkedNetwork","AttachedNetworkId","AvailableUpgrade","BgpServiceLoadBalancerConfigurationBgpAdvertisement","BgpServiceLoadBalancerConfigurationBgpPeer","BgpServiceLoadBalancerConfigurationIPAddressPool","ControlPlaneNodeConfigurationAdministratorConfigurationSshPublicKey","ControlPlaneNodeConfigurationAvailabilityZone","FeatureStatuses","InitialAgentPoolConfiguration","L2ServiceLoadBalancerConfigurationIPAddressPool","NetworkConfigurationPodCidr","NetworkConfigurationServiceCidr","Node","SshPublicKey"}, NewOutputProperties=new string[] {"AadConfigurationAdminGroupObjectId","AttachedNetworkConfigurationL2Network","AttachedNetworkConfigurationL3Network","AttachedNetworkConfigurationTrunkedNetwork","AttachedNetworkId","AvailableUpgrade","BgpServiceLoadBalancerConfigurationBgpAdvertisement","BgpServiceLoadBalancerConfigurationBgpPeer","BgpServiceLoadBalancerConfigurationIPAddressPool","ControlPlaneNodeConfigurationAdministratorConfigurationSshPublicKey","ControlPlaneNodeConfigurationAvailabilityZone","FeatureStatuses","InitialAgentPoolConfiguration","L2ServiceLoadBalancerConfigurationIPAddressPool","NetworkConfigurationPodCidr","NetworkConfigurationServiceCidr","Node","SshPublicKey"}, ChangeDescription="The types of properties will be changed from fixed array to 'List'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesCluster))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesCluster))] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Get a list of Kubernetes clusters in the provided subscription.")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/providers/Microsoft.NetworkCloud/kubernetesClusters", ApiVersion = "2025-02-01")] public partial class GetAzNetworkCloudKubernetesCluster_List : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudKubernetesCluster_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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -59,6 +76,9 @@ public partial class GetAzNetworkCloudKubernetesCluster_List : global::System.Ma [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudKubernetesCluster_List : global::System.Ma /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudKubernetesCluster_List : global::System.Ma [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -126,24 +147,24 @@ public partial class GetAzNetworkCloudKubernetesCluster_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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IKubernetesClusterList + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterList /// 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.NetworkCloud.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 GetAzNetworkCloudKubernetesCluster_List() { @@ -238,8 +264,33 @@ public GetAzNetworkCloudKubernetesCluster_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.NetworkCloud.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.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -313,7 +364,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.Api20250201.IKubernetesClusterList + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterList /// 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.NetworkCloud.Models.IKubernetesClusterList + 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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudKubernetesCluster_List1.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudKubernetesCluster_List1.cs index 204aa6a7336f..4b78b90eea2f 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudKubernetesCluster_List1.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudKubernetesCluster_List1.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// Get a list of Kubernetes clusters in the provided resource group. @@ -13,13 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets /// [OpenAPI] ListByResourceGroup=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/kubernetesClusters" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzNetworkCloudKubernetesCluster_List1")] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesCluster", "15.0.0", "2.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"AadConfigurationAdminGroupObjectId","AttachedNetworkConfigurationL2Network","AttachedNetworkConfigurationL3Network","AttachedNetworkConfigurationTrunkedNetwork","AttachedNetworkId","AvailableUpgrade","BgpServiceLoadBalancerConfigurationBgpAdvertisement","BgpServiceLoadBalancerConfigurationBgpPeer","BgpServiceLoadBalancerConfigurationIPAddressPool","ControlPlaneNodeConfigurationAdministratorConfigurationSshPublicKey","ControlPlaneNodeConfigurationAvailabilityZone","FeatureStatuses","InitialAgentPoolConfiguration","L2ServiceLoadBalancerConfigurationIPAddressPool","NetworkConfigurationPodCidr","NetworkConfigurationServiceCidr","Node","SshPublicKey"}, NewOutputProperties=new string[] {"AadConfigurationAdminGroupObjectId","AttachedNetworkConfigurationL2Network","AttachedNetworkConfigurationL3Network","AttachedNetworkConfigurationTrunkedNetwork","AttachedNetworkId","AvailableUpgrade","BgpServiceLoadBalancerConfigurationBgpAdvertisement","BgpServiceLoadBalancerConfigurationBgpPeer","BgpServiceLoadBalancerConfigurationIPAddressPool","ControlPlaneNodeConfigurationAdministratorConfigurationSshPublicKey","ControlPlaneNodeConfigurationAvailabilityZone","FeatureStatuses","InitialAgentPoolConfiguration","L2ServiceLoadBalancerConfigurationIPAddressPool","NetworkConfigurationPodCidr","NetworkConfigurationServiceCidr","Node","SshPublicKey"}, ChangeDescription="The types of properties will be changed from fixed array to 'List'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesCluster))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesCluster))] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Get a list of Kubernetes clusters in the provided resource group.")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/kubernetesClusters", ApiVersion = "2025-02-01")] public partial class GetAzNetworkCloudKubernetesCluster_List1 : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudKubernetesCluster_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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -59,6 +76,9 @@ public partial class GetAzNetworkCloudKubernetesCluster_List1 : global::System.M [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudKubernetesCluster_List1 : global::System.M /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudKubernetesCluster_List1 : global::System.M [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -140,24 +161,24 @@ public partial class GetAzNetworkCloudKubernetesCluster_List1 : 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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IKubernetesClusterList + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterList /// 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.NetworkCloud.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 GetAzNetworkCloudKubernetesCluster_List1() { @@ -252,8 +278,33 @@ public GetAzNetworkCloudKubernetesCluster_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.NetworkCloud.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.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -327,7 +378,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.Api20250201.IKubernetesClusterList + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterList /// 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.NetworkCloud.Models.IKubernetesClusterList + 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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudL2Network_Get.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudL2Network_Get.cs index bbdc212d8c4f..665ad68167f1 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudL2Network_Get.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudL2Network_Get.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// Get properties of the provided layer 2 (L2) network. @@ -13,13 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/l2Networks/{l2NetworkName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzNetworkCloudL2Network_Get")] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2Network", "15.0.0", "2.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"AssociatedResourceId","HybridAksClustersAssociatedId","VirtualMachinesAssociatedId"}, NewOutputProperties=new string[] {"AssociatedResourceId","HybridAksClustersAssociatedId","VirtualMachinesAssociatedId"}, ChangeDescription="The types of properties will be changed from fixed array to 'List'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2Network))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2Network))] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Get properties of the provided layer 2 (L2) network.")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/l2Networks/{l2NetworkName}", ApiVersion = "2025-02-01")] public partial class GetAzNetworkCloudL2Network_Get : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudL2Network_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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -53,6 +70,9 @@ public partial class GetAzNetworkCloudL2Network_Get : global::System.Management. [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudL2Network_Get : global::System.Management. /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudL2Network_Get : global::System.Management. [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -149,24 +170,24 @@ public partial class GetAzNetworkCloudL2Network_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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IL2Network + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2Network /// 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.NetworkCloud.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 GetAzNetworkCloudL2Network_Get() { @@ -261,8 +287,33 @@ public GetAzNetworkCloudL2Network_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.NetworkCloud.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.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -336,7 +387,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.Api20250201.IL2Network + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2Network /// 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.NetworkCloud.Models.Api20250201.IL2Network - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2Network + 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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudL2Network_GetViaIdentity.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudL2Network_GetViaIdentity.cs index e3185161335c..7c5483de2964 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudL2Network_GetViaIdentity.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudL2Network_GetViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// Get properties of the provided layer 2 (L2) network. @@ -13,13 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/l2Networks/{l2NetworkName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzNetworkCloudL2Network_GetViaIdentity")] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2Network", "15.0.0", "2.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"AssociatedResourceId","HybridAksClustersAssociatedId","VirtualMachinesAssociatedId"}, NewOutputProperties=new string[] {"AssociatedResourceId","HybridAksClustersAssociatedId","VirtualMachinesAssociatedId"}, ChangeDescription="The types of properties will be changed from fixed array to 'List'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2Network))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2Network))] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Get properties of the provided layer 2 (L2) network.")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/l2Networks/{l2NetworkName}", ApiVersion = "2025-02-01")] public partial class GetAzNetworkCloudL2Network_GetViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudL2Network_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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -53,6 +70,9 @@ public partial class GetAzNetworkCloudL2Network_GetViaIdentity : global::System. [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudL2Network_GetViaIdentity : global::System. /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudL2Network_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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IL2Network + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2Network /// 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.NetworkCloud.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 GetAzNetworkCloudL2Network_GetViaIdentity() { @@ -222,8 +247,33 @@ public GetAzNetworkCloudL2Network_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.NetworkCloud.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.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -314,7 +364,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.RestException(responseMessage, await response); + var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IL2Network + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2Network /// 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.NetworkCloud.Models.Api20250201.IL2Network - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2Network + 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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudL2Network_List.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudL2Network_List.cs index bb7d5a3ce346..d747583fa84e 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudL2Network_List.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudL2Network_List.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// Get a list of layer 2 (L2) networks in the provided subscription. @@ -13,13 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets /// [OpenAPI] ListBySubscription=>GET:"/subscriptions/{subscriptionId}/providers/Microsoft.NetworkCloud/l2Networks" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzNetworkCloudL2Network_List")] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2Network", "15.0.0", "2.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"AssociatedResourceId","HybridAksClustersAssociatedId","VirtualMachinesAssociatedId"}, NewOutputProperties=new string[] {"AssociatedResourceId","HybridAksClustersAssociatedId","VirtualMachinesAssociatedId"}, ChangeDescription="The types of properties will be changed from fixed array to 'List'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2Network))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2Network))] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Get a list of layer 2 (L2) networks in the provided subscription.")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/providers/Microsoft.NetworkCloud/l2Networks", ApiVersion = "2025-02-01")] public partial class GetAzNetworkCloudL2Network_List : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudL2Network_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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -59,6 +76,9 @@ public partial class GetAzNetworkCloudL2Network_List : global::System.Management [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudL2Network_List : global::System.Management /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudL2Network_List : global::System.Management [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -126,24 +147,24 @@ public partial class GetAzNetworkCloudL2Network_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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IL2NetworkList + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkList /// 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.NetworkCloud.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 GetAzNetworkCloudL2Network_List() { @@ -238,8 +264,33 @@ public GetAzNetworkCloudL2Network_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.NetworkCloud.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.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -313,7 +364,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.Api20250201.IL2NetworkList + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkList /// 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.NetworkCloud.Models.IL2NetworkList + 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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudL2Network_List1.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudL2Network_List1.cs index cc3eb5fdf875..ba34a452d66d 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudL2Network_List1.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudL2Network_List1.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// Get a list of layer 2 (L2) networks in the provided resource group. @@ -13,13 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets /// [OpenAPI] ListByResourceGroup=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/l2Networks" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzNetworkCloudL2Network_List1")] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2Network", "15.0.0", "2.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"AssociatedResourceId","HybridAksClustersAssociatedId","VirtualMachinesAssociatedId"}, NewOutputProperties=new string[] {"AssociatedResourceId","HybridAksClustersAssociatedId","VirtualMachinesAssociatedId"}, ChangeDescription="The types of properties will be changed from fixed array to 'List'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2Network))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2Network))] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Get a list of layer 2 (L2) networks in the provided resource group.")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/l2Networks", ApiVersion = "2025-02-01")] public partial class GetAzNetworkCloudL2Network_List1 : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudL2Network_List1 : 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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -59,6 +76,9 @@ public partial class GetAzNetworkCloudL2Network_List1 : global::System.Managemen [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudL2Network_List1 : global::System.Managemen /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudL2Network_List1 : global::System.Managemen [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -140,24 +161,24 @@ public partial class GetAzNetworkCloudL2Network_List1 : 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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IL2NetworkList + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkList /// 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.NetworkCloud.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 GetAzNetworkCloudL2Network_List1() { @@ -252,8 +278,33 @@ public GetAzNetworkCloudL2Network_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.NetworkCloud.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.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -327,7 +378,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.Api20250201.IL2NetworkList + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkList /// 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.NetworkCloud.Models.IL2NetworkList + 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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudL3Network_Get.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudL3Network_Get.cs index b172291311a0..2eb2ed903c8e 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudL3Network_Get.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudL3Network_Get.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// Get properties of the provided layer 3 (L3) network. @@ -13,13 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/l3Networks/{l3NetworkName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzNetworkCloudL3Network_Get")] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3Network", "15.0.0", "2.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"AssociatedResourceId","HybridAksClustersAssociatedId","VirtualMachinesAssociatedId"}, NewOutputProperties=new string[] {"AssociatedResourceId","HybridAksClustersAssociatedId","VirtualMachinesAssociatedId"}, ChangeDescription="The types of properties will be changed from fixed array to 'List'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3Network))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3Network))] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Get properties of the provided layer 3 (L3) network.")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/l3Networks/{l3NetworkName}", ApiVersion = "2025-02-01")] public partial class GetAzNetworkCloudL3Network_Get : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudL3Network_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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -53,6 +70,9 @@ public partial class GetAzNetworkCloudL3Network_Get : global::System.Management. [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudL3Network_Get : global::System.Management. /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudL3Network_Get : global::System.Management. [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -149,24 +170,24 @@ public partial class GetAzNetworkCloudL3Network_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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IL3Network + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3Network /// 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.NetworkCloud.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 GetAzNetworkCloudL3Network_Get() { @@ -261,8 +287,33 @@ public GetAzNetworkCloudL3Network_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.NetworkCloud.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.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -336,7 +387,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.Api20250201.IL3Network + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3Network /// 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.NetworkCloud.Models.Api20250201.IL3Network - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3Network + 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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudL3Network_GetViaIdentity.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudL3Network_GetViaIdentity.cs index f776635014d0..56b36e7808b3 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudL3Network_GetViaIdentity.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudL3Network_GetViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// Get properties of the provided layer 3 (L3) network. @@ -13,13 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/l3Networks/{l3NetworkName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzNetworkCloudL3Network_GetViaIdentity")] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3Network", "15.0.0", "2.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"AssociatedResourceId","HybridAksClustersAssociatedId","VirtualMachinesAssociatedId"}, NewOutputProperties=new string[] {"AssociatedResourceId","HybridAksClustersAssociatedId","VirtualMachinesAssociatedId"}, ChangeDescription="The types of properties will be changed from fixed array to 'List'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3Network))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3Network))] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Get properties of the provided layer 3 (L3) network.")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/l3Networks/{l3NetworkName}", ApiVersion = "2025-02-01")] public partial class GetAzNetworkCloudL3Network_GetViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudL3Network_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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -53,6 +70,9 @@ public partial class GetAzNetworkCloudL3Network_GetViaIdentity : global::System. [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudL3Network_GetViaIdentity : global::System. /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudL3Network_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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IL3Network + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3Network /// 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.NetworkCloud.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 GetAzNetworkCloudL3Network_GetViaIdentity() { @@ -222,8 +247,33 @@ public GetAzNetworkCloudL3Network_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.NetworkCloud.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.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -314,7 +364,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.RestException(responseMessage, await response); + var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IL3Network + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3Network /// 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.NetworkCloud.Models.Api20250201.IL3Network - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3Network + 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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudL3Network_List.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudL3Network_List.cs index 6f388b922133..37c958899125 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudL3Network_List.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudL3Network_List.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// Get a list of layer 3 (L3) networks in the provided subscription. @@ -13,13 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets /// [OpenAPI] ListBySubscription=>GET:"/subscriptions/{subscriptionId}/providers/Microsoft.NetworkCloud/l3Networks" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzNetworkCloudL3Network_List")] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3Network", "15.0.0", "2.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"AssociatedResourceId","HybridAksClustersAssociatedId","VirtualMachinesAssociatedId"}, NewOutputProperties=new string[] {"AssociatedResourceId","HybridAksClustersAssociatedId","VirtualMachinesAssociatedId"}, ChangeDescription="The types of properties will be changed from fixed array to 'List'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3Network))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3Network))] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Get a list of layer 3 (L3) networks in the provided subscription.")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/providers/Microsoft.NetworkCloud/l3Networks", ApiVersion = "2025-02-01")] public partial class GetAzNetworkCloudL3Network_List : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudL3Network_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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -59,6 +76,9 @@ public partial class GetAzNetworkCloudL3Network_List : global::System.Management [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudL3Network_List : global::System.Management /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudL3Network_List : global::System.Management [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -126,24 +147,24 @@ public partial class GetAzNetworkCloudL3Network_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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IL3NetworkList + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkList /// 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.NetworkCloud.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 GetAzNetworkCloudL3Network_List() { @@ -238,8 +264,33 @@ public GetAzNetworkCloudL3Network_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.NetworkCloud.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.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -313,7 +364,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.Api20250201.IL3NetworkList + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkList /// 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.NetworkCloud.Models.IL3NetworkList + 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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudL3Network_List1.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudL3Network_List1.cs index 1110a1c943de..4b4c5d05e1ee 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudL3Network_List1.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudL3Network_List1.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// Get a list of layer 3 (L3) networks in the provided resource group. @@ -13,13 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets /// [OpenAPI] ListByResourceGroup=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/l3Networks" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzNetworkCloudL3Network_List1")] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3Network", "15.0.0", "2.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"AssociatedResourceId","HybridAksClustersAssociatedId","VirtualMachinesAssociatedId"}, NewOutputProperties=new string[] {"AssociatedResourceId","HybridAksClustersAssociatedId","VirtualMachinesAssociatedId"}, ChangeDescription="The types of properties will be changed from fixed array to 'List'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3Network))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3Network))] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Get a list of layer 3 (L3) networks in the provided resource group.")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/l3Networks", ApiVersion = "2025-02-01")] public partial class GetAzNetworkCloudL3Network_List1 : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudL3Network_List1 : 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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -59,6 +76,9 @@ public partial class GetAzNetworkCloudL3Network_List1 : global::System.Managemen [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudL3Network_List1 : global::System.Managemen /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudL3Network_List1 : global::System.Managemen [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -140,24 +161,24 @@ public partial class GetAzNetworkCloudL3Network_List1 : 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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IL3NetworkList + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkList /// 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.NetworkCloud.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 GetAzNetworkCloudL3Network_List1() { @@ -252,8 +278,33 @@ public GetAzNetworkCloudL3Network_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.NetworkCloud.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.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -327,7 +378,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.Api20250201.IL3NetworkList + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkList /// 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.NetworkCloud.Models.IL3NetworkList + 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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudMetricsConfiguration_Get.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudMetricsConfiguration_Get.cs index 921c5274bd6c..c1f5acfc24c5 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudMetricsConfiguration_Get.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudMetricsConfiguration_Get.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// Get metrics configuration of the provided cluster. @@ -13,13 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/metricsConfigurations/{metricsConfigurationName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzNetworkCloudMetricsConfiguration_Get")] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfiguration", "15.0.0", "2.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"DisabledMetric","EnabledMetric"}, NewOutputProperties=new string[] {"DisabledMetric","EnabledMetric"}, ChangeDescription="The types of properties will be changed from fixed array to 'List'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfiguration))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfiguration))] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Get metrics configuration of the provided cluster.")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/metricsConfigurations/{metricsConfigurationName}", ApiVersion = "2025-02-01")] public partial class GetAzNetworkCloudMetricsConfiguration_Get : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudMetricsConfiguration_Get : 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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -67,6 +84,9 @@ public partial class GetAzNetworkCloudMetricsConfiguration_Get : global::System. [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudMetricsConfiguration_Get : global::System. /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudMetricsConfiguration_Get : global::System. [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -163,24 +184,24 @@ public partial class GetAzNetworkCloudMetricsConfiguration_Get : 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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IClusterMetricsConfiguration + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfiguration /// 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) @@ -203,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.NetworkCloud.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -224,7 +250,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzNetworkCloudMetricsConfiguration_Get() { @@ -275,8 +301,33 @@ public GetAzNetworkCloudMetricsConfiguration_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.NetworkCloud.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.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -329,7 +380,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -350,7 +401,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,ClusterName=ClusterName,Name=Name}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,ClusterName=ClusterName,Name=Name}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -388,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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 +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.NetworkCloud.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, ClusterName=ClusterName, Name=Name }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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, ClusterName=ClusterName, 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 } }); @@ -428,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.NetworkCloud.Models.Api20250201.IClusterMetricsConfiguration + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfiguration /// 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 +496,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfiguration - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfiguration + 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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudMetricsConfiguration_GetViaIdentity.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudMetricsConfiguration_GetViaIdentity.cs index e26b5d0f6930..8c6092215bdb 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudMetricsConfiguration_GetViaIdentity.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudMetricsConfiguration_GetViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// Get metrics configuration of the provided cluster. @@ -13,13 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/metricsConfigurations/{metricsConfigurationName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzNetworkCloudMetricsConfiguration_GetViaIdentity")] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfiguration", "15.0.0", "2.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"DisabledMetric","EnabledMetric"}, NewOutputProperties=new string[] {"DisabledMetric","EnabledMetric"}, ChangeDescription="The types of properties will be changed from fixed array to 'List'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfiguration))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfiguration))] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Get metrics configuration of the provided cluster.")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/metricsConfigurations/{metricsConfigurationName}", ApiVersion = "2025-02-01")] public partial class GetAzNetworkCloudMetricsConfiguration_GetViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudMetricsConfiguration_GetViaIdentity : 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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -53,6 +70,9 @@ public partial class GetAzNetworkCloudMetricsConfiguration_GetViaIdentity : glob [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudMetricsConfiguration_GetViaIdentity : glob /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudMetricsConfiguration_GetViaIdentity : 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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IClusterMetricsConfiguration + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfiguration /// 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.NetworkCloud.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 GetAzNetworkCloudMetricsConfiguration_GetViaIdentity() { @@ -222,8 +247,33 @@ public GetAzNetworkCloudMetricsConfiguration_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.NetworkCloud.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.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -318,7 +368,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ) { @@ -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.NetworkCloud.Runtime.RestException(responseMessage, await response); + var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IClusterMetricsConfiguration + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfiguration /// 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.NetworkCloud.Models.Api20250201.IClusterMetricsConfiguration - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfiguration + 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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudMetricsConfiguration_GetViaIdentityCluster.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudMetricsConfiguration_GetViaIdentityCluster.cs new file mode 100644 index 000000000000..084b716d0989 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudMetricsConfiguration_GetViaIdentityCluster.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.NetworkCloud.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; + using System; + + /// Get metrics configuration of the provided cluster. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/metricsConfigurations/{metricsConfigurationName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzNetworkCloudMetricsConfiguration_GetViaIdentityCluster")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfiguration))] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Get metrics configuration of the provided cluster.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/metricsConfigurations/{metricsConfigurationName}", ApiVersion = "2025-02-01")] + public partial class GetAzNetworkCloudMetricsConfiguration_GetViaIdentityCluster : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity _clusterInputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity ClusterInputObject { get => this._clusterInputObject; set => this._clusterInputObject = 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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of the metrics configuration for the cluster. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the metrics configuration for the cluster.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the metrics configuration for the cluster.", + SerializedName = @"metricsConfigurationName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("MetricsConfigurationName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.IClusterMetricsConfiguration + /// 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.NetworkCloud.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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 GetAzNetworkCloudMetricsConfiguration_GetViaIdentityCluster() + { + + } + + /// 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.NetworkCloud.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.NetworkCloud.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (ClusterInputObject?.Id != null) + { + this.ClusterInputObject.Id += $"/metricsConfigurations/{(global::System.Uri.EscapeDataString(this.Name.ToString()))}"; + await this.Client.MetricsConfigurationsGetViaIdentity(ClusterInputObject.Id, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == ClusterInputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("ClusterInputObject has null value for ClusterInputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, ClusterInputObject) ); + } + if (null == ClusterInputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("ClusterInputObject has null value for ClusterInputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, ClusterInputObject) ); + } + if (null == ClusterInputObject.ClusterName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("ClusterInputObject has null value for ClusterInputObject.ClusterName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, ClusterInputObject) ); + } + await this.Client.MetricsConfigurationsGet(ClusterInputObject.SubscriptionId ?? null, ClusterInputObject.ResourceGroupName ?? null, ClusterInputObject.ClusterName ?? null, Name, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.IClusterMetricsConfiguration + /// 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.NetworkCloud.Models.IClusterMetricsConfiguration + 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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudMetricsConfiguration_List.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudMetricsConfiguration_List.cs index 5203cd16f9aa..5ed895cad684 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudMetricsConfiguration_List.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudMetricsConfiguration_List.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// Get a list of metrics configurations for the provided cluster. @@ -13,13 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets /// [OpenAPI] ListByCluster=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/metricsConfigurations" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzNetworkCloudMetricsConfiguration_List")] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfiguration", "15.0.0", "2.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"DisabledMetric","EnabledMetric"}, NewOutputProperties=new string[] {"DisabledMetric","EnabledMetric"}, ChangeDescription="The types of properties will be changed from fixed array to 'List'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfiguration))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfiguration))] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Get a list of metrics configurations for the provided cluster.")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/metricsConfigurations", ApiVersion = "2025-02-01")] public partial class GetAzNetworkCloudMetricsConfiguration_List : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudMetricsConfiguration_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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -73,6 +90,9 @@ public partial class GetAzNetworkCloudMetricsConfiguration_List : global::System [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudMetricsConfiguration_List : global::System /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudMetricsConfiguration_List : global::System [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -154,24 +175,24 @@ public partial class GetAzNetworkCloudMetricsConfiguration_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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationList + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationList /// 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.NetworkCloud.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 GetAzNetworkCloudMetricsConfiguration_List() { @@ -266,8 +292,33 @@ public GetAzNetworkCloudMetricsConfiguration_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.NetworkCloud.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.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -341,7 +392,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,ClusterName=ClusterName}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,ClusterName=ClusterName}) { 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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ) { @@ -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.NetworkCloud.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, ClusterName=ClusterName }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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, ClusterName=ClusterName }) + 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.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationList + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationList /// 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.NetworkCloud.Models.IClusterMetricsConfigurationList + 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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudOperation_List.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudOperation_List.cs index b62061cf9c9f..f95274977263 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudOperation_List.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudOperation_List.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// @@ -16,12 +18,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets /// [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.InternalExport] [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzNetworkCloudOperation_List")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IOperation))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperation))] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Get a list of all available resource provider operations. It contains a URL link to get the next set of results.")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/providers/Microsoft.NetworkCloud/operations", ApiVersion = "2025-02-01")] public partial class GetAzNetworkCloudOperation_List : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -37,17 +40,32 @@ public partial class GetAzNetworkCloudOperation_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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -61,6 +79,9 @@ public partial class GetAzNetworkCloudOperation_List : global::System.Management [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudOperation_List : global::System.Management /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudOperation_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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api50.IOperationListResult + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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) @@ -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.NetworkCloud.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 GetAzNetworkCloudOperation_List() { @@ -222,8 +248,33 @@ public GetAzNetworkCloudOperation_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.NetworkCloud.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.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -294,7 +345,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,12 +383,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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ) { @@ -354,7 +405,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.NetworkCloud.Runtime.RestException(responseMessage, await response); + var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 } @@ -372,12 +423,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.NetworkCloud.Models.Api50.IOperationListResult + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ) { @@ -389,15 +440,38 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudRackSku_Get.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudRackSku_Get.cs index cb9f8d901bb7..f36e5da40aca 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudRackSku_Get.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudRackSku_Get.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// Get the properties of the provided rack SKU. @@ -13,13 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/providers/Microsoft.NetworkCloud/rackSkus/{rackSkuName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzNetworkCloudRackSku_Get")] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackSku", "15.0.0", "2.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"ComputeMachine","ControllerMachine","StorageAppliance","SupportedRackSkuId"}, NewOutputProperties=new string[] {"ComputeMachine","ControllerMachine","StorageAppliance","SupportedRackSkuId"}, ChangeDescription="The types of properties will be changed from fixed array to 'List'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackSku))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackSku))] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Get the properties of the provided rack SKU.")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/providers/Microsoft.NetworkCloud/rackSkus/{rackSkuName}", ApiVersion = "2025-02-01")] public partial class GetAzNetworkCloudRackSku_Get : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudRackSku_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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -53,6 +70,9 @@ public partial class GetAzNetworkCloudRackSku_Get : global::System.Management.Au [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudRackSku_Get : global::System.Management.Au /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,7 +146,8 @@ public partial class GetAzNetworkCloudRackSku_Get : global::System.Management.Au [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -135,24 +156,24 @@ public partial class GetAzNetworkCloudRackSku_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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IRackSku + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackSku /// 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) @@ -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.NetworkCloud.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -196,7 +222,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzNetworkCloudRackSku_Get() { @@ -247,8 +273,33 @@ public GetAzNetworkCloudRackSku_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.NetworkCloud.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.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -301,7 +352,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -322,7 +373,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,Name=Name}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,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 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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ) { @@ -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.NetworkCloud.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId, Name=Name }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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, 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 } }); @@ -400,12 +451,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.NetworkCloud.Models.Api20250201.IRackSku + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackSku /// 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 ) { @@ -417,8 +468,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackSku - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackSku + 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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudRackSku_GetViaIdentity.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudRackSku_GetViaIdentity.cs index 6ca0a0f86969..c716cfe917b8 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudRackSku_GetViaIdentity.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudRackSku_GetViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// Get the properties of the provided rack SKU. @@ -13,13 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/providers/Microsoft.NetworkCloud/rackSkus/{rackSkuName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzNetworkCloudRackSku_GetViaIdentity")] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackSku", "15.0.0", "2.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"ComputeMachine","ControllerMachine","StorageAppliance","SupportedRackSkuId"}, NewOutputProperties=new string[] {"ComputeMachine","ControllerMachine","StorageAppliance","SupportedRackSkuId"}, ChangeDescription="The types of properties will be changed from fixed array to 'List'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackSku))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackSku))] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Get the properties of the provided rack SKU.")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/providers/Microsoft.NetworkCloud/rackSkus/{rackSkuName}", ApiVersion = "2025-02-01")] public partial class GetAzNetworkCloudRackSku_GetViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudRackSku_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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -53,6 +70,9 @@ public partial class GetAzNetworkCloudRackSku_GetViaIdentity : global::System.Ma [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudRackSku_GetViaIdentity : global::System.Ma /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudRackSku_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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IRackSku + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackSku /// 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.NetworkCloud.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 GetAzNetworkCloudRackSku_GetViaIdentity() { @@ -222,8 +247,33 @@ public GetAzNetworkCloudRackSku_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.NetworkCloud.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.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -310,7 +360,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 +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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ) { @@ -370,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.NetworkCloud.Runtime.RestException(responseMessage, await response); + var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 +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.NetworkCloud.Models.Api20250201.IRackSku + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackSku /// 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 +455,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackSku - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackSku + 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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudRackSku_List.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudRackSku_List.cs index 0be1dcd6f836..d8c17c23c9ed 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudRackSku_List.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudRackSku_List.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// Get a list of rack SKUs in the provided subscription. @@ -13,13 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets /// [OpenAPI] ListBySubscription=>GET:"/subscriptions/{subscriptionId}/providers/Microsoft.NetworkCloud/rackSkus" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzNetworkCloudRackSku_List")] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackSku", "15.0.0", "2.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"ComputeMachine","ControllerMachine","StorageAppliance","SupportedRackSkuId"}, NewOutputProperties=new string[] {"ComputeMachine","ControllerMachine","StorageAppliance","SupportedRackSkuId"}, ChangeDescription="The types of properties will be changed from fixed array to 'List'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackSku))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackSku))] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Get a list of rack SKUs in the provided subscription.")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/providers/Microsoft.NetworkCloud/rackSkus", ApiVersion = "2025-02-01")] public partial class GetAzNetworkCloudRackSku_List : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudRackSku_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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -59,6 +76,9 @@ public partial class GetAzNetworkCloudRackSku_List : global::System.Management.A [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudRackSku_List : global::System.Management.A /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudRackSku_List : global::System.Management.A [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -126,24 +147,24 @@ public partial class GetAzNetworkCloudRackSku_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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IRackSkuList + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackSkuList /// 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.NetworkCloud.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 GetAzNetworkCloudRackSku_List() { @@ -238,8 +264,33 @@ public GetAzNetworkCloudRackSku_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.NetworkCloud.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.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -313,7 +364,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.Api20250201.IRackSkuList + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackSkuList /// 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.NetworkCloud.Models.IRackSkuList + 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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudRack_Get.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudRack_Get.cs index 94ed4fdb4425..c6cfff259090 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudRack_Get.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudRack_Get.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// Get properties of the provided rack. @@ -13,12 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/racks/{rackName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzNetworkCloudRack_Get")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRack))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRack))] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Get properties of the provided rack.")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/racks/{rackName}", ApiVersion = "2025-02-01")] public partial class GetAzNetworkCloudRack_Get : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudRack_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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -52,6 +70,9 @@ public partial class GetAzNetworkCloudRack_Get : global::System.Management.Autom [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudRack_Get : global::System.Management.Autom /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 +160,8 @@ public partial class GetAzNetworkCloudRack_Get : global::System.Management.Autom [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -148,24 +170,24 @@ public partial class GetAzNetworkCloudRack_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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IRack + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRack /// 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 +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.NetworkCloud.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -209,7 +236,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzNetworkCloudRack_Get() { @@ -260,8 +287,33 @@ public GetAzNetworkCloudRack_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.NetworkCloud.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.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -314,7 +366,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -335,7 +387,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 +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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ) { @@ -395,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.NetworkCloud.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.NetworkCloud.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 +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.NetworkCloud.Models.Api20250201.IRack + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRack /// 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 +482,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRack - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRack + 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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudRack_GetViaIdentity.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudRack_GetViaIdentity.cs index 64a0f5995d6d..eda523ff53b5 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudRack_GetViaIdentity.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudRack_GetViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// Get properties of the provided rack. @@ -13,12 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/racks/{rackName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzNetworkCloudRack_GetViaIdentity")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRack))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRack))] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Get properties of the provided rack.")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/racks/{rackName}", ApiVersion = "2025-02-01")] public partial class GetAzNetworkCloudRack_GetViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudRack_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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -52,6 +70,9 @@ public partial class GetAzNetworkCloudRack_GetViaIdentity : global::System.Manag [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudRack_GetViaIdentity : global::System.Manag /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudRack_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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IRack + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRack /// 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.NetworkCloud.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 GetAzNetworkCloudRack_GetViaIdentity() { @@ -221,8 +247,33 @@ public GetAzNetworkCloudRack_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.NetworkCloud.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.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -313,7 +364,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 } }); @@ -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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,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.NetworkCloud.Runtime.RestException(responseMessage, await response); + var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 } @@ -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.NetworkCloud.Models.Api20250201.IRack + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRack /// 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 +459,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRack - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRack + 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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudRack_List.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudRack_List.cs index 71343e1feaba..1cb91eab2055 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudRack_List.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudRack_List.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// Get a list of racks in the provided subscription. @@ -13,12 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets /// [OpenAPI] ListBySubscription=>GET:"/subscriptions/{subscriptionId}/providers/Microsoft.NetworkCloud/racks" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzNetworkCloudRack_List")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRack))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRack))] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Get a list of racks in the provided subscription.")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/providers/Microsoft.NetworkCloud/racks", ApiVersion = "2025-02-01")] public partial class GetAzNetworkCloudRack_List : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudRack_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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -58,6 +76,9 @@ public partial class GetAzNetworkCloudRack_List : global::System.Management.Auto [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudRack_List : global::System.Management.Auto /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,7 +137,8 @@ public partial class GetAzNetworkCloudRack_List : global::System.Management.Auto [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -125,24 +147,24 @@ public partial class GetAzNetworkCloudRack_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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IRackList + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackList /// 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) @@ -165,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.NetworkCloud.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -186,7 +213,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzNetworkCloudRack_List() { @@ -237,8 +264,33 @@ public GetAzNetworkCloudRack_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.NetworkCloud.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.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -291,7 +343,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -312,7 +364,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 } }); @@ -350,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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ) { @@ -372,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.NetworkCloud.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.NetworkCloud.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 } }); @@ -390,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.NetworkCloud.Models.Api20250201.IRackList + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackList /// 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 ) { @@ -407,15 +459,38 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackList + 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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudRack_List1.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudRack_List1.cs index d1576cae3d57..ba680ecb7363 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudRack_List1.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudRack_List1.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// Get a list of racks in the provided resource group. @@ -13,12 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets /// [OpenAPI] ListByResourceGroup=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/racks" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzNetworkCloudRack_List1")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRack))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRack))] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Get a list of racks in the provided resource group.")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/racks", ApiVersion = "2025-02-01")] public partial class GetAzNetworkCloudRack_List1 : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudRack_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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -58,6 +76,9 @@ public partial class GetAzNetworkCloudRack_List1 : global::System.Management.Aut [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudRack_List1 : global::System.Management.Aut /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,7 +151,8 @@ public partial class GetAzNetworkCloudRack_List1 : global::System.Management.Aut [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -139,24 +161,24 @@ public partial class GetAzNetworkCloudRack_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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IRackList + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackList /// 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.NetworkCloud.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 GetAzNetworkCloudRack_List1() { @@ -251,8 +278,33 @@ public GetAzNetworkCloudRack_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.NetworkCloud.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.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -326,7 +378,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 } }); @@ -364,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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ) { @@ -386,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.NetworkCloud.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.NetworkCloud.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 } }); @@ -404,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.NetworkCloud.Models.Api20250201.IRackList + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackList /// 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 ) { @@ -421,15 +473,38 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackList + 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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudServicesNetwork_Get.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudServicesNetwork_Get.cs index 23cd38a78b7b..698c0a3aa894 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudServicesNetwork_Get.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudServicesNetwork_Get.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// Get properties of the provided cloud services network. @@ -13,12 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/cloudServicesNetworks/{cloudServicesNetworkName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzNetworkCloudServicesNetwork_Get")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetwork))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetwork))] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Get properties of the provided cloud services network.")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/cloudServicesNetworks/{cloudServicesNetworkName}", ApiVersion = "2025-02-01")] public partial class GetAzNetworkCloudServicesNetwork_Get : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudServicesNetwork_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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -52,6 +70,9 @@ public partial class GetAzNetworkCloudServicesNetwork_Get : global::System.Manag [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudServicesNetwork_Get : global::System.Manag /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 +160,8 @@ public partial class GetAzNetworkCloudServicesNetwork_Get : global::System.Manag [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -148,24 +170,24 @@ public partial class GetAzNetworkCloudServicesNetwork_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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.ICloudServicesNetwork + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetwork /// 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 +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.NetworkCloud.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -209,7 +236,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzNetworkCloudServicesNetwork_Get() { @@ -260,8 +287,33 @@ public GetAzNetworkCloudServicesNetwork_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.NetworkCloud.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.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -314,7 +366,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -335,7 +387,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 +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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ) { @@ -395,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.NetworkCloud.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.NetworkCloud.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 +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.NetworkCloud.Models.Api20250201.ICloudServicesNetwork + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetwork /// 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 +482,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetwork - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetwork + 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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudServicesNetwork_GetViaIdentity.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudServicesNetwork_GetViaIdentity.cs index fbc9c7835dce..5246de89602e 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudServicesNetwork_GetViaIdentity.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudServicesNetwork_GetViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// Get properties of the provided cloud services network. @@ -13,12 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/cloudServicesNetworks/{cloudServicesNetworkName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzNetworkCloudServicesNetwork_GetViaIdentity")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetwork))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetwork))] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Get properties of the provided cloud services network.")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/cloudServicesNetworks/{cloudServicesNetworkName}", ApiVersion = "2025-02-01")] public partial class GetAzNetworkCloudServicesNetwork_GetViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudServicesNetwork_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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -52,6 +70,9 @@ public partial class GetAzNetworkCloudServicesNetwork_GetViaIdentity : global::S [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudServicesNetwork_GetViaIdentity : global::S /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudServicesNetwork_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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.ICloudServicesNetwork + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetwork /// 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.NetworkCloud.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 GetAzNetworkCloudServicesNetwork_GetViaIdentity() { @@ -221,8 +247,33 @@ public GetAzNetworkCloudServicesNetwork_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.NetworkCloud.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.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -313,7 +364,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 } }); @@ -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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,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.NetworkCloud.Runtime.RestException(responseMessage, await response); + var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 } @@ -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.NetworkCloud.Models.Api20250201.ICloudServicesNetwork + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetwork /// 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 +459,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetwork - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetwork + 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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudServicesNetwork_List.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudServicesNetwork_List.cs index e8c429b9e31f..0676a44dbd4d 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudServicesNetwork_List.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudServicesNetwork_List.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// Get a list of cloud services networks in the provided subscription. @@ -13,12 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets /// [OpenAPI] ListBySubscription=>GET:"/subscriptions/{subscriptionId}/providers/Microsoft.NetworkCloud/cloudServicesNetworks" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzNetworkCloudServicesNetwork_List")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetwork))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetwork))] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Get a list of cloud services networks in the provided subscription.")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/providers/Microsoft.NetworkCloud/cloudServicesNetworks", ApiVersion = "2025-02-01")] public partial class GetAzNetworkCloudServicesNetwork_List : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudServicesNetwork_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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -58,6 +76,9 @@ public partial class GetAzNetworkCloudServicesNetwork_List : global::System.Mana [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudServicesNetwork_List : global::System.Mana /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,7 +137,8 @@ public partial class GetAzNetworkCloudServicesNetwork_List : global::System.Mana [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -125,24 +147,24 @@ public partial class GetAzNetworkCloudServicesNetwork_List : global::System.Mana /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.ICloudServicesNetworkList + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkList /// 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) @@ -165,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.NetworkCloud.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -186,7 +213,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzNetworkCloudServicesNetwork_List() { @@ -237,8 +264,33 @@ public GetAzNetworkCloudServicesNetwork_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.NetworkCloud.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.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -291,7 +343,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -312,7 +364,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 } }); @@ -350,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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ) { @@ -372,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.NetworkCloud.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.NetworkCloud.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 } }); @@ -390,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.NetworkCloud.Models.Api20250201.ICloudServicesNetworkList + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkList /// 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 ) { @@ -407,15 +459,38 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkList + 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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudServicesNetwork_List1.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudServicesNetwork_List1.cs index 30e05caa261d..cba8af7ca495 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudServicesNetwork_List1.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudServicesNetwork_List1.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// Get a list of cloud services networks in the provided resource group. @@ -13,12 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets /// [OpenAPI] ListByResourceGroup=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/cloudServicesNetworks" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzNetworkCloudServicesNetwork_List1")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetwork))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetwork))] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Get a list of cloud services networks in the provided resource group.")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/cloudServicesNetworks", ApiVersion = "2025-02-01")] public partial class GetAzNetworkCloudServicesNetwork_List1 : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudServicesNetwork_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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -58,6 +76,9 @@ public partial class GetAzNetworkCloudServicesNetwork_List1 : global::System.Man [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudServicesNetwork_List1 : global::System.Man /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,7 +151,8 @@ public partial class GetAzNetworkCloudServicesNetwork_List1 : global::System.Man [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -139,24 +161,24 @@ public partial class GetAzNetworkCloudServicesNetwork_List1 : 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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.ICloudServicesNetworkList + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkList /// 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.NetworkCloud.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 GetAzNetworkCloudServicesNetwork_List1() { @@ -251,8 +278,33 @@ public GetAzNetworkCloudServicesNetwork_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.NetworkCloud.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.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -326,7 +378,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 } }); @@ -364,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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ) { @@ -386,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.NetworkCloud.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.NetworkCloud.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 } }); @@ -404,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.NetworkCloud.Models.Api20250201.ICloudServicesNetworkList + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkList /// 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 ) { @@ -421,15 +473,38 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkList + 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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudStorageAppliance_Get.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudStorageAppliance_Get.cs index e104e3d3dfbc..da6af34eafe0 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudStorageAppliance_Get.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudStorageAppliance_Get.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// Get properties of the provided storage appliance. @@ -13,13 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/storageAppliances/{storageApplianceName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzNetworkCloudStorageAppliance_Get")] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliance", "15.0.0", "2.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"SecretRotationStatus"}, NewOutputProperties=new string[] {"SecretRotationStatus"}, ChangeDescription="The type of property will be changed from fixed array to 'List'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliance))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliance))] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Get properties of the provided storage appliance.")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/storageAppliances/{storageApplianceName}", ApiVersion = "2025-02-01")] public partial class GetAzNetworkCloudStorageAppliance_Get : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudStorageAppliance_Get : 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 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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -53,6 +70,9 @@ public partial class GetAzNetworkCloudStorageAppliance_Get : global::System.Mana [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudStorageAppliance_Get : global::System.Mana /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudStorageAppliance_Get : global::System.Mana [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -149,24 +170,24 @@ public partial class GetAzNetworkCloudStorageAppliance_Get : global::System.Mana /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IStorageAppliance + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliance /// 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.NetworkCloud.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 GetAzNetworkCloudStorageAppliance_Get() { @@ -261,8 +287,33 @@ public GetAzNetworkCloudStorageAppliance_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.NetworkCloud.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.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -336,7 +387,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.Api20250201.IStorageAppliance + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliance /// 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.NetworkCloud.Models.Api20250201.IStorageAppliance - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliance + 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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudStorageAppliance_GetViaIdentity.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudStorageAppliance_GetViaIdentity.cs index ae7203246398..1fa44128df52 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudStorageAppliance_GetViaIdentity.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudStorageAppliance_GetViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// Get properties of the provided storage appliance. @@ -13,13 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/storageAppliances/{storageApplianceName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzNetworkCloudStorageAppliance_GetViaIdentity")] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliance", "15.0.0", "2.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"SecretRotationStatus"}, NewOutputProperties=new string[] {"SecretRotationStatus"}, ChangeDescription="The type of property will be changed from fixed array to 'List'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliance))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliance))] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Get properties of the provided storage appliance.")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/storageAppliances/{storageApplianceName}", ApiVersion = "2025-02-01")] public partial class GetAzNetworkCloudStorageAppliance_GetViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudStorageAppliance_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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -53,6 +70,9 @@ public partial class GetAzNetworkCloudStorageAppliance_GetViaIdentity : global:: [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudStorageAppliance_GetViaIdentity : global:: /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudStorageAppliance_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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IStorageAppliance + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliance /// 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.NetworkCloud.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 GetAzNetworkCloudStorageAppliance_GetViaIdentity() { @@ -222,8 +247,33 @@ public GetAzNetworkCloudStorageAppliance_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.NetworkCloud.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.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -314,7 +364,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.RestException(responseMessage, await response); + var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IStorageAppliance + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliance /// 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.NetworkCloud.Models.Api20250201.IStorageAppliance - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliance + 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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudStorageAppliance_List.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudStorageAppliance_List.cs index ecd41606c923..5c7c852ed5d8 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudStorageAppliance_List.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudStorageAppliance_List.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// Get a list of storage appliances in the provided subscription. @@ -13,13 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets /// [OpenAPI] ListBySubscription=>GET:"/subscriptions/{subscriptionId}/providers/Microsoft.NetworkCloud/storageAppliances" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzNetworkCloudStorageAppliance_List")] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliance", "15.0.0", "2.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"SecretRotationStatus"}, NewOutputProperties=new string[] {"SecretRotationStatus"}, ChangeDescription="The type of property will be changed from fixed array to 'List'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliance))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliance))] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Get a list of storage appliances in the provided subscription.")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/providers/Microsoft.NetworkCloud/storageAppliances", ApiVersion = "2025-02-01")] public partial class GetAzNetworkCloudStorageAppliance_List : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudStorageAppliance_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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -59,6 +76,9 @@ public partial class GetAzNetworkCloudStorageAppliance_List : global::System.Man [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudStorageAppliance_List : global::System.Man /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudStorageAppliance_List : global::System.Man [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -126,24 +147,24 @@ public partial class GetAzNetworkCloudStorageAppliance_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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IStorageApplianceList + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceList /// 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.NetworkCloud.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 GetAzNetworkCloudStorageAppliance_List() { @@ -238,8 +264,33 @@ public GetAzNetworkCloudStorageAppliance_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.NetworkCloud.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.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -313,7 +364,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.Api20250201.IStorageApplianceList + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceList /// 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.NetworkCloud.Models.IStorageApplianceList + 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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudStorageAppliance_List1.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudStorageAppliance_List1.cs index d3eb26c60935..5176d5e703f6 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudStorageAppliance_List1.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudStorageAppliance_List1.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// Get a list of storage appliances in the provided resource group. @@ -13,13 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets /// [OpenAPI] ListByResourceGroup=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/storageAppliances" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzNetworkCloudStorageAppliance_List1")] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliance", "15.0.0", "2.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"SecretRotationStatus"}, NewOutputProperties=new string[] {"SecretRotationStatus"}, ChangeDescription="The type of property will be changed from fixed array to 'List'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliance))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliance))] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Get a list of storage appliances in the provided resource group.")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/storageAppliances", ApiVersion = "2025-02-01")] public partial class GetAzNetworkCloudStorageAppliance_List1 : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudStorageAppliance_List1 : 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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -59,6 +76,9 @@ public partial class GetAzNetworkCloudStorageAppliance_List1 : global::System.Ma [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudStorageAppliance_List1 : global::System.Ma /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudStorageAppliance_List1 : global::System.Ma [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -140,24 +161,24 @@ public partial class GetAzNetworkCloudStorageAppliance_List1 : 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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IStorageApplianceList + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceList /// 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.NetworkCloud.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 GetAzNetworkCloudStorageAppliance_List1() { @@ -252,8 +278,33 @@ public GetAzNetworkCloudStorageAppliance_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.NetworkCloud.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.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -327,7 +378,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.Api20250201.IStorageApplianceList + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceList /// 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.NetworkCloud.Models.IStorageApplianceList + 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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudTrunkedNetwork_Get.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudTrunkedNetwork_Get.cs index ff2f0552d7fc..41cdf848f91a 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudTrunkedNetwork_Get.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudTrunkedNetwork_Get.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// Get properties of the provided trunked network. @@ -13,13 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/trunkedNetworks/{trunkedNetworkName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzNetworkCloudTrunkedNetwork_Get")] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetwork", "15.0.0", "2.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"AssociatedResourceId","HybridAksClustersAssociatedId","IsolationDomainId","VirtualMachinesAssociatedId","Vlan"}, NewOutputProperties=new string[] {"AssociatedResourceId","HybridAksClustersAssociatedId","IsolationDomainId","VirtualMachinesAssociatedId","Vlan"}, ChangeDescription="The types of properties will be changed from fixed array to 'List'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetwork))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetwork))] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Get properties of the provided trunked network.")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/trunkedNetworks/{trunkedNetworkName}", ApiVersion = "2025-02-01")] public partial class GetAzNetworkCloudTrunkedNetwork_Get : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudTrunkedNetwork_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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -53,6 +70,9 @@ public partial class GetAzNetworkCloudTrunkedNetwork_Get : global::System.Manage [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudTrunkedNetwork_Get : global::System.Manage /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudTrunkedNetwork_Get : global::System.Manage [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -149,24 +170,24 @@ public partial class GetAzNetworkCloudTrunkedNetwork_Get : 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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.ITrunkedNetwork + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetwork /// 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.NetworkCloud.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 GetAzNetworkCloudTrunkedNetwork_Get() { @@ -261,8 +287,33 @@ public GetAzNetworkCloudTrunkedNetwork_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.NetworkCloud.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.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -336,7 +387,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.Api20250201.ITrunkedNetwork + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetwork /// 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.NetworkCloud.Models.Api20250201.ITrunkedNetwork - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetwork + 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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudTrunkedNetwork_GetViaIdentity.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudTrunkedNetwork_GetViaIdentity.cs index 65f8cf8fe93d..dc25cb5f69ca 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudTrunkedNetwork_GetViaIdentity.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudTrunkedNetwork_GetViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// Get properties of the provided trunked network. @@ -13,13 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/trunkedNetworks/{trunkedNetworkName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzNetworkCloudTrunkedNetwork_GetViaIdentity")] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetwork", "15.0.0", "2.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"AssociatedResourceId","HybridAksClustersAssociatedId","IsolationDomainId","VirtualMachinesAssociatedId","Vlan"}, NewOutputProperties=new string[] {"AssociatedResourceId","HybridAksClustersAssociatedId","IsolationDomainId","VirtualMachinesAssociatedId","Vlan"}, ChangeDescription="The types of properties will be changed from fixed array to 'List'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetwork))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetwork))] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Get properties of the provided trunked network.")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/trunkedNetworks/{trunkedNetworkName}", ApiVersion = "2025-02-01")] public partial class GetAzNetworkCloudTrunkedNetwork_GetViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudTrunkedNetwork_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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -53,6 +70,9 @@ public partial class GetAzNetworkCloudTrunkedNetwork_GetViaIdentity : global::Sy [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudTrunkedNetwork_GetViaIdentity : global::Sy /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudTrunkedNetwork_GetViaIdentity : 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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.ITrunkedNetwork + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetwork /// 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.NetworkCloud.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 GetAzNetworkCloudTrunkedNetwork_GetViaIdentity() { @@ -222,8 +247,33 @@ public GetAzNetworkCloudTrunkedNetwork_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.NetworkCloud.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.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -314,7 +364,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.RestException(responseMessage, await response); + var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.ITrunkedNetwork + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetwork /// 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.NetworkCloud.Models.Api20250201.ITrunkedNetwork - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetwork + 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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudTrunkedNetwork_List.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudTrunkedNetwork_List.cs index c6087b9dc115..a359b66215c5 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudTrunkedNetwork_List.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudTrunkedNetwork_List.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// Get a list of trunked networks in the provided subscription. @@ -13,13 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets /// [OpenAPI] ListBySubscription=>GET:"/subscriptions/{subscriptionId}/providers/Microsoft.NetworkCloud/trunkedNetworks" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzNetworkCloudTrunkedNetwork_List")] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetwork", "15.0.0", "2.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"AssociatedResourceId","HybridAksClustersAssociatedId","IsolationDomainId","VirtualMachinesAssociatedId","Vlan"}, NewOutputProperties=new string[] {"AssociatedResourceId","HybridAksClustersAssociatedId","IsolationDomainId","VirtualMachinesAssociatedId","Vlan"}, ChangeDescription="The types of properties will be changed from fixed array to 'List'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetwork))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetwork))] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Get a list of trunked networks in the provided subscription.")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/providers/Microsoft.NetworkCloud/trunkedNetworks", ApiVersion = "2025-02-01")] public partial class GetAzNetworkCloudTrunkedNetwork_List : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudTrunkedNetwork_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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -59,6 +76,9 @@ public partial class GetAzNetworkCloudTrunkedNetwork_List : global::System.Manag [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudTrunkedNetwork_List : global::System.Manag /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudTrunkedNetwork_List : global::System.Manag [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -126,24 +147,24 @@ public partial class GetAzNetworkCloudTrunkedNetwork_List : 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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.ITrunkedNetworkList + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkList /// 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.NetworkCloud.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 GetAzNetworkCloudTrunkedNetwork_List() { @@ -238,8 +264,33 @@ public GetAzNetworkCloudTrunkedNetwork_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.NetworkCloud.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.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -313,7 +364,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.Api20250201.ITrunkedNetworkList + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkList /// 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.NetworkCloud.Models.ITrunkedNetworkList + 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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudTrunkedNetwork_List1.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudTrunkedNetwork_List1.cs index 14bb61ab8eb0..821bdad0e5ea 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudTrunkedNetwork_List1.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudTrunkedNetwork_List1.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// Get a list of trunked networks in the provided resource group. @@ -13,13 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets /// [OpenAPI] ListByResourceGroup=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/trunkedNetworks" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzNetworkCloudTrunkedNetwork_List1")] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetwork", "15.0.0", "2.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"AssociatedResourceId","HybridAksClustersAssociatedId","IsolationDomainId","VirtualMachinesAssociatedId","Vlan"}, NewOutputProperties=new string[] {"AssociatedResourceId","HybridAksClustersAssociatedId","IsolationDomainId","VirtualMachinesAssociatedId","Vlan"}, ChangeDescription="The types of properties will be changed from fixed array to 'List'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetwork))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetwork))] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Get a list of trunked networks in the provided resource group.")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/trunkedNetworks", ApiVersion = "2025-02-01")] public partial class GetAzNetworkCloudTrunkedNetwork_List1 : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudTrunkedNetwork_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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -59,6 +76,9 @@ public partial class GetAzNetworkCloudTrunkedNetwork_List1 : global::System.Mana [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudTrunkedNetwork_List1 : global::System.Mana /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudTrunkedNetwork_List1 : global::System.Mana [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -140,24 +161,24 @@ public partial class GetAzNetworkCloudTrunkedNetwork_List1 : global::System.Mana /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.ITrunkedNetworkList + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkList /// 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.NetworkCloud.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 GetAzNetworkCloudTrunkedNetwork_List1() { @@ -252,8 +278,33 @@ public GetAzNetworkCloudTrunkedNetwork_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.NetworkCloud.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.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -327,7 +378,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.Api20250201.ITrunkedNetworkList + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkList /// 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.NetworkCloud.Models.ITrunkedNetworkList + 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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudVirtualMachine_Get.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudVirtualMachine_Get.cs index c1a6dcb45412..27857777cc13 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudVirtualMachine_Get.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudVirtualMachine_Get.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// Get properties of the provided virtual machine. @@ -13,13 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/virtualMachines/{virtualMachineName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzNetworkCloudVirtualMachine_Get")] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachine", "15.0.0", "2.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"NetworkAttachment","PlacementHint","SshPublicKey","StorageProfileVolumeAttachment","Volume"}, NewOutputProperties=new string[] {"NetworkAttachment","PlacementHint","SshPublicKey","StorageProfileVolumeAttachment","Volume"}, ChangeDescription="The types of properties will be changed from fixed array to 'List'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachine))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachine))] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Get properties of the provided virtual machine.")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/virtualMachines/{virtualMachineName}", ApiVersion = "2025-02-01")] public partial class GetAzNetworkCloudVirtualMachine_Get : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudVirtualMachine_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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -53,6 +70,9 @@ public partial class GetAzNetworkCloudVirtualMachine_Get : global::System.Manage [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudVirtualMachine_Get : global::System.Manage /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudVirtualMachine_Get : global::System.Manage [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -149,24 +170,24 @@ public partial class GetAzNetworkCloudVirtualMachine_Get : 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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IVirtualMachine + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachine /// 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.NetworkCloud.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 GetAzNetworkCloudVirtualMachine_Get() { @@ -261,8 +287,33 @@ public GetAzNetworkCloudVirtualMachine_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.NetworkCloud.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.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -336,7 +387,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.Api20250201.IVirtualMachine + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachine /// 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.NetworkCloud.Models.Api20250201.IVirtualMachine - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachine + 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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudVirtualMachine_GetViaIdentity.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudVirtualMachine_GetViaIdentity.cs index 97bf7fea1e8f..452e1e64da64 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudVirtualMachine_GetViaIdentity.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudVirtualMachine_GetViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// Get properties of the provided virtual machine. @@ -13,13 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/virtualMachines/{virtualMachineName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzNetworkCloudVirtualMachine_GetViaIdentity")] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachine", "15.0.0", "2.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"NetworkAttachment","PlacementHint","SshPublicKey","StorageProfileVolumeAttachment","Volume"}, NewOutputProperties=new string[] {"NetworkAttachment","PlacementHint","SshPublicKey","StorageProfileVolumeAttachment","Volume"}, ChangeDescription="The types of properties will be changed from fixed array to 'List'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachine))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachine))] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Get properties of the provided virtual machine.")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/virtualMachines/{virtualMachineName}", ApiVersion = "2025-02-01")] public partial class GetAzNetworkCloudVirtualMachine_GetViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudVirtualMachine_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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -53,6 +70,9 @@ public partial class GetAzNetworkCloudVirtualMachine_GetViaIdentity : global::Sy [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudVirtualMachine_GetViaIdentity : global::Sy /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudVirtualMachine_GetViaIdentity : 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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IVirtualMachine + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachine /// 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.NetworkCloud.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 GetAzNetworkCloudVirtualMachine_GetViaIdentity() { @@ -222,8 +247,33 @@ public GetAzNetworkCloudVirtualMachine_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.NetworkCloud.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.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -314,7 +364,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.RestException(responseMessage, await response); + var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IVirtualMachine + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachine /// 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.NetworkCloud.Models.Api20250201.IVirtualMachine - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachine + 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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudVirtualMachine_List.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudVirtualMachine_List.cs index a4abc651d884..561fd19fc56b 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudVirtualMachine_List.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudVirtualMachine_List.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// Get a list of virtual machines in the provided subscription. @@ -13,13 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets /// [OpenAPI] ListBySubscription=>GET:"/subscriptions/{subscriptionId}/providers/Microsoft.NetworkCloud/virtualMachines" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzNetworkCloudVirtualMachine_List")] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachine", "15.0.0", "2.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"NetworkAttachment","PlacementHint","SshPublicKey","StorageProfileVolumeAttachment","Volume"}, NewOutputProperties=new string[] {"NetworkAttachment","PlacementHint","SshPublicKey","StorageProfileVolumeAttachment","Volume"}, ChangeDescription="The types of properties will be changed from fixed array to 'List'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachine))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachine))] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Get a list of virtual machines in the provided subscription.")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/providers/Microsoft.NetworkCloud/virtualMachines", ApiVersion = "2025-02-01")] public partial class GetAzNetworkCloudVirtualMachine_List : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudVirtualMachine_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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -59,6 +76,9 @@ public partial class GetAzNetworkCloudVirtualMachine_List : global::System.Manag [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudVirtualMachine_List : global::System.Manag /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudVirtualMachine_List : global::System.Manag [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -126,24 +147,24 @@ public partial class GetAzNetworkCloudVirtualMachine_List : 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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IVirtualMachineList + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineList /// 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.NetworkCloud.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 GetAzNetworkCloudVirtualMachine_List() { @@ -238,8 +264,33 @@ public GetAzNetworkCloudVirtualMachine_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.NetworkCloud.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.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -313,7 +364,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.Api20250201.IVirtualMachineList + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineList /// 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.NetworkCloud.Models.IVirtualMachineList + 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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudVirtualMachine_List1.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudVirtualMachine_List1.cs index a93ef0203222..194671b62f42 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudVirtualMachine_List1.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudVirtualMachine_List1.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// Get a list of virtual machines in the provided resource group. @@ -13,13 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets /// [OpenAPI] ListByResourceGroup=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/virtualMachines" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzNetworkCloudVirtualMachine_List1")] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachine", "15.0.0", "2.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"NetworkAttachment","PlacementHint","SshPublicKey","StorageProfileVolumeAttachment","Volume"}, NewOutputProperties=new string[] {"NetworkAttachment","PlacementHint","SshPublicKey","StorageProfileVolumeAttachment","Volume"}, ChangeDescription="The types of properties will be changed from fixed array to 'List'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachine))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachine))] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Get a list of virtual machines in the provided resource group.")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/virtualMachines", ApiVersion = "2025-02-01")] public partial class GetAzNetworkCloudVirtualMachine_List1 : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudVirtualMachine_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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -59,6 +76,9 @@ public partial class GetAzNetworkCloudVirtualMachine_List1 : global::System.Mana [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudVirtualMachine_List1 : global::System.Mana /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudVirtualMachine_List1 : global::System.Mana [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -140,24 +161,24 @@ public partial class GetAzNetworkCloudVirtualMachine_List1 : global::System.Mana /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IVirtualMachineList + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineList /// 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.NetworkCloud.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 GetAzNetworkCloudVirtualMachine_List1() { @@ -252,8 +278,33 @@ public GetAzNetworkCloudVirtualMachine_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.NetworkCloud.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.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -327,7 +378,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.Api20250201.IVirtualMachineList + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachineList /// 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.NetworkCloud.Models.IVirtualMachineList + 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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudVolume_Get.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudVolume_Get.cs index 2928d553c204..f2407caacc78 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudVolume_Get.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudVolume_Get.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// Get properties of the provided volume. @@ -13,13 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/volumes/{volumeName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzNetworkCloudVolume_Get")] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolume", "15.0.0", "2.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"AttachedTo"}, NewOutputProperties=new string[] {"AttachedTo"}, ChangeDescription="The type of property will be changed from fixed array to 'List'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolume))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolume))] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Get properties of the provided volume.")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/volumes/{volumeName}", ApiVersion = "2025-02-01")] public partial class GetAzNetworkCloudVolume_Get : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudVolume_Get : 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 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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -53,6 +70,9 @@ public partial class GetAzNetworkCloudVolume_Get : global::System.Management.Aut [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudVolume_Get : global::System.Management.Aut /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudVolume_Get : global::System.Management.Aut [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -149,24 +170,24 @@ public partial class GetAzNetworkCloudVolume_Get : 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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IVolume + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolume /// 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.NetworkCloud.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 GetAzNetworkCloudVolume_Get() { @@ -261,8 +287,33 @@ public GetAzNetworkCloudVolume_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.NetworkCloud.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.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -336,7 +387,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.Api20250201.IVolume + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolume /// 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.NetworkCloud.Models.Api20250201.IVolume - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolume + 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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudVolume_GetViaIdentity.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudVolume_GetViaIdentity.cs index 018a62affebb..6c641a59812b 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudVolume_GetViaIdentity.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudVolume_GetViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// Get properties of the provided volume. @@ -13,13 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/volumes/{volumeName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzNetworkCloudVolume_GetViaIdentity")] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolume", "15.0.0", "2.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"AttachedTo"}, NewOutputProperties=new string[] {"AttachedTo"}, ChangeDescription="The type of property will be changed from fixed array to 'List'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolume))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolume))] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Get properties of the provided volume.")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/volumes/{volumeName}", ApiVersion = "2025-02-01")] public partial class GetAzNetworkCloudVolume_GetViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudVolume_GetViaIdentity : 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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -53,6 +70,9 @@ public partial class GetAzNetworkCloudVolume_GetViaIdentity : global::System.Man [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudVolume_GetViaIdentity : global::System.Man /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudVolume_GetViaIdentity : 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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IVolume + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolume /// 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.NetworkCloud.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 GetAzNetworkCloudVolume_GetViaIdentity() { @@ -222,8 +247,33 @@ public GetAzNetworkCloudVolume_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.NetworkCloud.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.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -314,7 +364,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.RestException(responseMessage, await response); + var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IVolume + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolume /// 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.NetworkCloud.Models.Api20250201.IVolume - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolume + 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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudVolume_List.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudVolume_List.cs index cbde3462448b..443237a6bc46 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudVolume_List.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudVolume_List.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// Get a list of volumes in the provided subscription. @@ -13,13 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets /// [OpenAPI] ListBySubscription=>GET:"/subscriptions/{subscriptionId}/providers/Microsoft.NetworkCloud/volumes" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzNetworkCloudVolume_List")] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolume", "15.0.0", "2.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"AttachedTo"}, NewOutputProperties=new string[] {"AttachedTo"}, ChangeDescription="The type of property will be changed from fixed array to 'List'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolume))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolume))] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Get a list of volumes in the provided subscription.")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/providers/Microsoft.NetworkCloud/volumes", ApiVersion = "2025-02-01")] public partial class GetAzNetworkCloudVolume_List : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudVolume_List : 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 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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -59,6 +76,9 @@ public partial class GetAzNetworkCloudVolume_List : global::System.Management.Au [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudVolume_List : global::System.Management.Au /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudVolume_List : global::System.Management.Au [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -126,24 +147,24 @@ public partial class GetAzNetworkCloudVolume_List : 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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IVolumeList + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumeList /// 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.NetworkCloud.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 GetAzNetworkCloudVolume_List() { @@ -238,8 +264,33 @@ public GetAzNetworkCloudVolume_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.NetworkCloud.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.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -313,7 +364,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.Api20250201.IVolumeList + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumeList /// 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.NetworkCloud.Models.IVolumeList + 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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudVolume_List1.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudVolume_List1.cs index ab8d618c622d..88d5355bb3bf 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudVolume_List1.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/GetAzNetworkCloudVolume_List1.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// Get a list of volumes in the provided resource group. @@ -13,13 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets /// [OpenAPI] ListByResourceGroup=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/volumes" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzNetworkCloudVolume_List1")] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolume", "15.0.0", "2.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"AttachedTo"}, NewOutputProperties=new string[] {"AttachedTo"}, ChangeDescription="The type of property will be changed from fixed array to 'List'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolume))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolume))] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Get a list of volumes in the provided resource group.")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/volumes", ApiVersion = "2025-02-01")] public partial class GetAzNetworkCloudVolume_List1 : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudVolume_List1 : 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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -59,6 +76,9 @@ public partial class GetAzNetworkCloudVolume_List1 : global::System.Management.A [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudVolume_List1 : global::System.Management.A /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 GetAzNetworkCloudVolume_List1 : global::System.Management.A [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -140,24 +161,24 @@ public partial class GetAzNetworkCloudVolume_List1 : 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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IVolumeList + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumeList /// 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.NetworkCloud.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 GetAzNetworkCloudVolume_List1() { @@ -252,8 +278,33 @@ public GetAzNetworkCloudVolume_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.NetworkCloud.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.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -327,7 +378,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.Api20250201.IVolumeList + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumeList /// 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.NetworkCloud.Models.IVolumeList + 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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/InvokeAzNetworkCloudBareMetalMachineCordon_CordonExpanded.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/InvokeAzNetworkCloudBareMetalMachineCordon_CordonExpanded.cs index 1f6a2e4149e4..3850a48b314b 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/InvokeAzNetworkCloudBareMetalMachineCordon_CordonExpanded.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/InvokeAzNetworkCloudBareMetalMachineCordon_CordonExpanded.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// Cordon the provided bare metal machine's Kubernetes node. @@ -18,7 +20,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/bareMetalMachines/{bareMetalMachineName}/cordon", ApiVersion = "2025-02-01")] public partial class InvokeAzNetworkCloudBareMetalMachineCordon_CordonExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -32,13 +35,16 @@ public partial class InvokeAzNetworkCloudBareMetalMachineCordon_CordonExpanded : /// /// BareMetalMachineCordonParameters represents the body of the request to evacuate workloads from node on a bare metal machine. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineCordonParameters _bareMetalMachineCordonParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BareMetalMachineCordonParameters(); + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineCordonParameters _bareMetalMachineCordonParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BareMetalMachineCordonParameters(); /// /// 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(); + /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] @@ -63,6 +69,9 @@ public partial class InvokeAzNetworkCloudBareMetalMachineCordon_CordonExpanded : [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -86,9 +95,12 @@ public partial class InvokeAzNetworkCloudBareMetalMachineCordon_CordonExpanded : ReadOnly = false, Description = @"The indicator of whether to evacuate the node workload when the bare metal machine is cordoned.", SerializedName = @"evacuate", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineEvacuate) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineEvacuate))] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineEvacuate Evacuate { get => _bareMetalMachineCordonParametersBody.Evacuate ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineEvacuate)""); set => _bareMetalMachineCordonParametersBody.Evacuate = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("True", "False")] + public string Evacuate { get => _bareMetalMachineCordonParametersBody.Evacuate ?? null; set => _bareMetalMachineCordonParametersBody.Evacuate = 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")] @@ -131,7 +143,7 @@ public partial class InvokeAzNetworkCloudBareMetalMachineCordon_CordonExpanded : /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,7 +189,8 @@ public partial class InvokeAzNetworkCloudBareMetalMachineCordon_CordonExpanded : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -186,12 +199,12 @@ public partial class InvokeAzNetworkCloudBareMetalMachineCordon_CordonExpanded : /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 @@ -271,7 +284,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public InvokeAzNetworkCloudBareMetalMachineCordon_CordonExpanded() { @@ -322,11 +335,36 @@ public InvokeAzNetworkCloudBareMetalMachineCordon_CordonExpanded() 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.NetworkCloud.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -338,10 +376,26 @@ public InvokeAzNetworkCloudBareMetalMachineCordon_CordonExpanded() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -409,7 +463,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -427,7 +481,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,BareMetalMachineName=BareMetalMachineName,body=_bareMetalMachineCordonParametersBody}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,BareMetalMachineName=BareMetalMachineName}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -465,12 +519,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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ) { @@ -487,15 +541,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.NetworkCloud.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, BareMetalMachineName=BareMetalMachineName, body=_bareMetalMachineCordonParametersBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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, BareMetalMachineName=BareMetalMachineName, body=_bareMetalMachineCordonParametersBody }) + 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 } }); @@ -520,7 +574,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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/InvokeAzNetworkCloudBareMetalMachineCordon_CordonViaIdentityExpanded.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/InvokeAzNetworkCloudBareMetalMachineCordon_CordonViaIdentityExpanded.cs index b98b68b826e8..232fe672cafb 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/InvokeAzNetworkCloudBareMetalMachineCordon_CordonViaIdentityExpanded.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/InvokeAzNetworkCloudBareMetalMachineCordon_CordonViaIdentityExpanded.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// Cordon the provided bare metal machine's Kubernetes node. @@ -18,7 +20,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/bareMetalMachines/{bareMetalMachineName}/cordon", ApiVersion = "2025-02-01")] public partial class InvokeAzNetworkCloudBareMetalMachineCordon_CordonViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -32,13 +35,16 @@ public partial class InvokeAzNetworkCloudBareMetalMachineCordon_CordonViaIdentit /// /// BareMetalMachineCordonParameters represents the body of the request to evacuate workloads from node on a bare metal machine. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineCordonParameters _bareMetalMachineCordonParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BareMetalMachineCordonParameters(); + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineCordonParameters _bareMetalMachineCordonParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BareMetalMachineCordonParameters(); /// /// 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(); + /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] @@ -49,6 +55,9 @@ public partial class InvokeAzNetworkCloudBareMetalMachineCordon_CordonViaIdentit [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -72,9 +81,12 @@ public partial class InvokeAzNetworkCloudBareMetalMachineCordon_CordonViaIdentit ReadOnly = false, Description = @"The indicator of whether to evacuate the node workload when the bare metal machine is cordoned.", SerializedName = @"evacuate", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineEvacuate) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineEvacuate))] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineEvacuate Evacuate { get => _bareMetalMachineCordonParametersBody.Evacuate ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineEvacuate)""); set => _bareMetalMachineCordonParametersBody.Evacuate = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("True", "False")] + public string Evacuate { get => _bareMetalMachineCordonParametersBody.Evacuate ?? null; set => _bareMetalMachineCordonParametersBody.Evacuate = 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 +137,7 @@ public partial class InvokeAzNetworkCloudBareMetalMachineCordon_CordonViaIdentit /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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")] @@ -148,12 +160,12 @@ public partial class InvokeAzNetworkCloudBareMetalMachineCordon_CordonViaIdentit /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 @@ -230,8 +242,8 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet - /// class. + /// Initializes a new instance of the + /// cmdlet class. /// public InvokeAzNetworkCloudBareMetalMachineCordon_CordonViaIdentityExpanded() { @@ -282,11 +294,36 @@ public InvokeAzNetworkCloudBareMetalMachineCordon_CordonViaIdentityExpanded() 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.NetworkCloud.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -298,10 +335,26 @@ public InvokeAzNetworkCloudBareMetalMachineCordon_CordonViaIdentityExpanded() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -369,7 +422,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -407,7 +460,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_bareMetalMachineCordonParametersBody}) + 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 } }); @@ -445,12 +498,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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ) { @@ -467,15 +520,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.NetworkCloud.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_bareMetalMachineCordonParametersBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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=_bareMetalMachineCordonParametersBody }) + 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 } }); @@ -500,7 +553,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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/InvokeAzNetworkCloudBareMetalMachineCordon_CordonViaJsonFilePath.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/InvokeAzNetworkCloudBareMetalMachineCordon_CordonViaJsonFilePath.cs new file mode 100644 index 000000000000..9a33c75030c8 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/InvokeAzNetworkCloudBareMetalMachineCordon_CordonViaJsonFilePath.cs @@ -0,0 +1,582 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; + using System; + + /// Cordon the provided bare metal machine's Kubernetes node. + /// + /// [OpenAPI] Cordon=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/bareMetalMachines/{bareMetalMachineName}/cordon" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Invoke, @"AzNetworkCloudBareMetalMachineCordon_CordonViaJsonFilePath", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Cordon the provided bare metal machine's Kubernetes node.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/bareMetalMachines/{bareMetalMachineName}/cordon", ApiVersion = "2025-02-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.NotSuggestDefaultParameterSet] + public partial class InvokeAzNetworkCloudBareMetalMachineCordon_CordonViaJsonFilePath : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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(); + + public global::System.String _jsonString; + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Backing field for property. + private string _bareMetalMachineName; + + /// The name of the bare metal machine. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the bare metal machine.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the bare metal machine.", + SerializedName = @"bareMetalMachineName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] + public string BareMetalMachineName { get => this._bareMetalMachineName; set => this._bareMetalMachineName = 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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 Cordon operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Path of Json file supplied to the Cordon operation")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Path of Json file supplied to the Cordon 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.NetworkCloud.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// 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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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. The value must be an UUID. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription. The value must be an UUID.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription. The value must be an UUID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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. + /// /// 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.NetworkCloud.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of InvokeAzNetworkCloudBareMetalMachineCordon_CordonViaJsonFilePath + /// + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets.InvokeAzNetworkCloudBareMetalMachineCordon_CordonViaJsonFilePath Clone() + { + var clone = new InvokeAzNetworkCloudBareMetalMachineCordon_CordonViaJsonFilePath(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.BareMetalMachineName = this.BareMetalMachineName; + clone.JsonFilePath = this.JsonFilePath; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 InvokeAzNetworkCloudBareMetalMachineCordon_CordonViaJsonFilePath() + { + + } + + /// 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.NetworkCloud.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.NetworkCloud.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'BareMetalMachinesCordon' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.BareMetalMachinesCordonViaJsonString(SubscriptionId, ResourceGroupName, BareMetalMachineName, _jsonString, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,BareMetalMachineName=BareMetalMachineName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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. + /// + /// 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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/InvokeAzNetworkCloudBareMetalMachineCordon_CordonViaJsonString.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/InvokeAzNetworkCloudBareMetalMachineCordon_CordonViaJsonString.cs new file mode 100644 index 000000000000..f187048685bf --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/InvokeAzNetworkCloudBareMetalMachineCordon_CordonViaJsonString.cs @@ -0,0 +1,580 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; + using System; + + /// Cordon the provided bare metal machine's Kubernetes node. + /// + /// [OpenAPI] Cordon=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/bareMetalMachines/{bareMetalMachineName}/cordon" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Invoke, @"AzNetworkCloudBareMetalMachineCordon_CordonViaJsonString", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Cordon the provided bare metal machine's Kubernetes node.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/bareMetalMachines/{bareMetalMachineName}/cordon", ApiVersion = "2025-02-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.NotSuggestDefaultParameterSet] + public partial class InvokeAzNetworkCloudBareMetalMachineCordon_CordonViaJsonString : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Backing field for property. + private string _bareMetalMachineName; + + /// The name of the bare metal machine. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the bare metal machine.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the bare metal machine.", + SerializedName = @"bareMetalMachineName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] + public string BareMetalMachineName { get => this._bareMetalMachineName; set => this._bareMetalMachineName = 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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 Cordon operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Json string supplied to the Cordon operation")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Json string supplied to the Cordon 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.NetworkCloud.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// 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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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. The value must be an UUID. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription. The value must be an UUID.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription. The value must be an UUID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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. + /// /// 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.NetworkCloud.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of InvokeAzNetworkCloudBareMetalMachineCordon_CordonViaJsonString + /// + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets.InvokeAzNetworkCloudBareMetalMachineCordon_CordonViaJsonString Clone() + { + var clone = new InvokeAzNetworkCloudBareMetalMachineCordon_CordonViaJsonString(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.BareMetalMachineName = this.BareMetalMachineName; + clone.JsonString = this.JsonString; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 InvokeAzNetworkCloudBareMetalMachineCordon_CordonViaJsonString() + { + + } + + /// 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.NetworkCloud.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.NetworkCloud.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'BareMetalMachinesCordon' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.BareMetalMachinesCordonViaJsonString(SubscriptionId, ResourceGroupName, BareMetalMachineName, _jsonString, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,BareMetalMachineName=BareMetalMachineName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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. + /// + /// 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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/InvokeAzNetworkCloudBareMetalMachineDataExtract_RunExpanded.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/InvokeAzNetworkCloudBareMetalMachineDataExtract_RunExpanded.cs index d1110bcd31a1..24db6b8a3bb0 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/InvokeAzNetworkCloudBareMetalMachineDataExtract_RunExpanded.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/InvokeAzNetworkCloudBareMetalMachineDataExtract_RunExpanded.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// @@ -16,13 +18,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets /// [OpenAPI] RunDataExtracts=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/bareMetalMachines/{bareMetalMachineName}/runDataExtracts" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Invoke, @"AzNetworkCloudBareMetalMachineDataExtract_RunExpanded", SupportsShouldProcess = true)] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.OutputBreakingChange("bool", "15.0.0", "2.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"Argument"}, NewOutputProperties=new string[] {"Argument"}, ChangeDescription="The type of property will be changed from fixed array to 'List'.")] [global::System.Management.Automation.OutputType(typeof(bool))] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Run one or more data extractions on the provided bare metal machine. The URL to storage account with the command execution results and the command exit code can be retrieved from the operation status API once available.")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/bareMetalMachines/{bareMetalMachineName}/runDataExtracts", ApiVersion = "2025-02-01")] public partial class InvokeAzNetworkCloudBareMetalMachineDataExtract_RunExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -37,13 +39,16 @@ public partial class InvokeAzNetworkCloudBareMetalMachineDataExtract_RunExpanded /// BareMetalMachineRunDataExtractsParameters represents the body of request containing list of curated data extraction commands /// to run on the bare metal machine. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineRunDataExtractsParameters _bareMetalMachineRunDataExtractsParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BareMetalMachineRunDataExtractsParameters(); + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineRunDataExtractsParameters _bareMetalMachineRunDataExtractsParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BareMetalMachineRunDataExtractsParameters(); /// /// 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(); + /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] @@ -68,6 +73,9 @@ public partial class InvokeAzNetworkCloudBareMetalMachineDataExtract_RunExpanded [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -82,8 +90,8 @@ public partial class InvokeAzNetworkCloudBareMetalMachineDataExtract_RunExpanded ReadOnly = false, Description = @"The list of curated data extraction commands to be executed directly against the target machine.", SerializedName = @"commands", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineCommandSpecification) })] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineCommandSpecification[] Command { get => _bareMetalMachineRunDataExtractsParametersBody.Command ?? null /* arrayOf */; set => _bareMetalMachineRunDataExtractsParametersBody.Command = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineCommandSpecification) })] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineCommandSpecification[] Command { get => _bareMetalMachineRunDataExtractsParametersBody.Command?.ToArray() ?? null /* fixedArrayOf */; set => _bareMetalMachineRunDataExtractsParametersBody.Command = (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 @@ -95,6 +103,9 @@ public partial class InvokeAzNetworkCloudBareMetalMachineDataExtract_RunExpanded [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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] @@ -150,7 +161,7 @@ public partial class InvokeAzNetworkCloudBareMetalMachineDataExtract_RunExpanded /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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")] @@ -196,7 +207,8 @@ public partial class InvokeAzNetworkCloudBareMetalMachineDataExtract_RunExpanded [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -205,12 +217,12 @@ public partial class InvokeAzNetworkCloudBareMetalMachineDataExtract_RunExpanded /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 @@ -290,7 +302,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public InvokeAzNetworkCloudBareMetalMachineDataExtract_RunExpanded() { @@ -341,11 +353,36 @@ public InvokeAzNetworkCloudBareMetalMachineDataExtract_RunExpanded() 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.NetworkCloud.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -357,10 +394,26 @@ public InvokeAzNetworkCloudBareMetalMachineDataExtract_RunExpanded() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -428,7 +481,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -446,7 +499,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,BareMetalMachineName=BareMetalMachineName,body=_bareMetalMachineRunDataExtractsParametersBody}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,BareMetalMachineName=BareMetalMachineName}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -484,12 +537,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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ) { @@ -506,15 +559,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.NetworkCloud.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, BareMetalMachineName=BareMetalMachineName, body=_bareMetalMachineRunDataExtractsParametersBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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, BareMetalMachineName=BareMetalMachineName, body=_bareMetalMachineRunDataExtractsParametersBody }) + 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 } }); @@ -539,7 +592,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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/InvokeAzNetworkCloudBareMetalMachineDataExtract_RunViaIdentityExpanded.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/InvokeAzNetworkCloudBareMetalMachineDataExtract_RunViaIdentityExpanded.cs index 4ed3d5f51ced..3476f7792801 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/InvokeAzNetworkCloudBareMetalMachineDataExtract_RunViaIdentityExpanded.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/InvokeAzNetworkCloudBareMetalMachineDataExtract_RunViaIdentityExpanded.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// @@ -16,13 +18,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets /// [OpenAPI] RunDataExtracts=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/bareMetalMachines/{bareMetalMachineName}/runDataExtracts" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Invoke, @"AzNetworkCloudBareMetalMachineDataExtract_RunViaIdentityExpanded", SupportsShouldProcess = true)] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.OutputBreakingChange("bool", "15.0.0", "2.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"Argument"}, NewOutputProperties=new string[] {"Argument"}, ChangeDescription="The type of property will be changed from fixed array to 'List'.")] [global::System.Management.Automation.OutputType(typeof(bool))] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Run one or more data extractions on the provided bare metal machine. The URL to storage account with the command execution results and the command exit code can be retrieved from the operation status API once available.")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/bareMetalMachines/{bareMetalMachineName}/runDataExtracts", ApiVersion = "2025-02-01")] public partial class InvokeAzNetworkCloudBareMetalMachineDataExtract_RunViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -37,13 +39,16 @@ public partial class InvokeAzNetworkCloudBareMetalMachineDataExtract_RunViaIdent /// BareMetalMachineRunDataExtractsParameters represents the body of request containing list of curated data extraction commands /// to run on the bare metal machine. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineRunDataExtractsParameters _bareMetalMachineRunDataExtractsParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BareMetalMachineRunDataExtractsParameters(); + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineRunDataExtractsParameters _bareMetalMachineRunDataExtractsParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BareMetalMachineRunDataExtractsParameters(); /// /// 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(); + /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] @@ -54,6 +59,9 @@ public partial class InvokeAzNetworkCloudBareMetalMachineDataExtract_RunViaIdent [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -68,8 +76,8 @@ public partial class InvokeAzNetworkCloudBareMetalMachineDataExtract_RunViaIdent ReadOnly = false, Description = @"The list of curated data extraction commands to be executed directly against the target machine.", SerializedName = @"commands", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineCommandSpecification) })] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineCommandSpecification[] Command { get => _bareMetalMachineRunDataExtractsParametersBody.Command ?? null /* arrayOf */; set => _bareMetalMachineRunDataExtractsParametersBody.Command = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineCommandSpecification) })] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineCommandSpecification[] Command { get => _bareMetalMachineRunDataExtractsParametersBody.Command?.ToArray() ?? null /* fixedArrayOf */; set => _bareMetalMachineRunDataExtractsParametersBody.Command = (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 @@ -81,6 +89,9 @@ public partial class InvokeAzNetworkCloudBareMetalMachineDataExtract_RunViaIdent [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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] @@ -144,7 +155,7 @@ public partial class InvokeAzNetworkCloudBareMetalMachineDataExtract_RunViaIdent /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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")] @@ -167,12 +178,12 @@ public partial class InvokeAzNetworkCloudBareMetalMachineDataExtract_RunViaIdent /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 @@ -249,7 +260,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the + /// Initializes a new instance of the /// cmdlet class. /// public InvokeAzNetworkCloudBareMetalMachineDataExtract_RunViaIdentityExpanded() @@ -301,11 +312,36 @@ public InvokeAzNetworkCloudBareMetalMachineDataExtract_RunViaIdentityExpanded() 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.NetworkCloud.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -317,10 +353,26 @@ public InvokeAzNetworkCloudBareMetalMachineDataExtract_RunViaIdentityExpanded() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -388,7 +440,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -426,7 +478,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_bareMetalMachineRunDataExtractsParametersBody}) + 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 } }); @@ -464,12 +516,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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ) { @@ -486,15 +538,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.NetworkCloud.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_bareMetalMachineRunDataExtractsParametersBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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=_bareMetalMachineRunDataExtractsParametersBody }) + 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 } }); @@ -519,7 +571,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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/InvokeAzNetworkCloudBareMetalMachineDataExtract_RunViaJsonFilePath.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/InvokeAzNetworkCloudBareMetalMachineDataExtract_RunViaJsonFilePath.cs new file mode 100644 index 000000000000..a28a8f59e7a2 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/InvokeAzNetworkCloudBareMetalMachineDataExtract_RunViaJsonFilePath.cs @@ -0,0 +1,585 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; + using System; + + /// + /// Run one or more data extractions on the provided bare metal machine. The URL to storage account with the command execution + /// results and the command exit code can be retrieved from the operation status API once available. + /// + /// + /// [OpenAPI] RunDataExtracts=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/bareMetalMachines/{bareMetalMachineName}/runDataExtracts" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Invoke, @"AzNetworkCloudBareMetalMachineDataExtract_RunViaJsonFilePath", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Run one or more data extractions on the provided bare metal machine. The URL to storage account with the command execution results and the command exit code can be retrieved from the operation status API once available.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/bareMetalMachines/{bareMetalMachineName}/runDataExtracts", ApiVersion = "2025-02-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.NotSuggestDefaultParameterSet] + public partial class InvokeAzNetworkCloudBareMetalMachineDataExtract_RunViaJsonFilePath : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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(); + + public global::System.String _jsonString; + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Backing field for property. + private string _bareMetalMachineName; + + /// The name of the bare metal machine. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the bare metal machine.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the bare metal machine.", + SerializedName = @"bareMetalMachineName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] + public string BareMetalMachineName { get => this._bareMetalMachineName; set => this._bareMetalMachineName = 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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 Run operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Path of Json file supplied to the Run operation")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Path of Json file supplied to the Run 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.NetworkCloud.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// 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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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. The value must be an UUID. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription. The value must be an UUID.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription. The value must be an UUID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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. + /// /// 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.NetworkCloud.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of InvokeAzNetworkCloudBareMetalMachineDataExtract_RunViaJsonFilePath + /// + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets.InvokeAzNetworkCloudBareMetalMachineDataExtract_RunViaJsonFilePath Clone() + { + var clone = new InvokeAzNetworkCloudBareMetalMachineDataExtract_RunViaJsonFilePath(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.BareMetalMachineName = this.BareMetalMachineName; + clone.JsonFilePath = this.JsonFilePath; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 InvokeAzNetworkCloudBareMetalMachineDataExtract_RunViaJsonFilePath() + { + + } + + /// 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.NetworkCloud.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.NetworkCloud.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'BareMetalMachinesRunDataExtracts' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.BareMetalMachinesRunDataExtractsViaJsonString(SubscriptionId, ResourceGroupName, BareMetalMachineName, _jsonString, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,BareMetalMachineName=BareMetalMachineName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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. + /// + /// 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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/InvokeAzNetworkCloudBareMetalMachineDataExtract_RunViaJsonString.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/InvokeAzNetworkCloudBareMetalMachineDataExtract_RunViaJsonString.cs new file mode 100644 index 000000000000..9116315cd817 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/InvokeAzNetworkCloudBareMetalMachineDataExtract_RunViaJsonString.cs @@ -0,0 +1,583 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; + using System; + + /// + /// Run one or more data extractions on the provided bare metal machine. The URL to storage account with the command execution + /// results and the command exit code can be retrieved from the operation status API once available. + /// + /// + /// [OpenAPI] RunDataExtracts=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/bareMetalMachines/{bareMetalMachineName}/runDataExtracts" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Invoke, @"AzNetworkCloudBareMetalMachineDataExtract_RunViaJsonString", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Run one or more data extractions on the provided bare metal machine. The URL to storage account with the command execution results and the command exit code can be retrieved from the operation status API once available.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/bareMetalMachines/{bareMetalMachineName}/runDataExtracts", ApiVersion = "2025-02-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.NotSuggestDefaultParameterSet] + public partial class InvokeAzNetworkCloudBareMetalMachineDataExtract_RunViaJsonString : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Backing field for property. + private string _bareMetalMachineName; + + /// The name of the bare metal machine. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the bare metal machine.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the bare metal machine.", + SerializedName = @"bareMetalMachineName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] + public string BareMetalMachineName { get => this._bareMetalMachineName; set => this._bareMetalMachineName = 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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 Run operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Json string supplied to the Run operation")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Json string supplied to the Run 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.NetworkCloud.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// 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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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. The value must be an UUID. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription. The value must be an UUID.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription. The value must be an UUID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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. + /// /// 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.NetworkCloud.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of InvokeAzNetworkCloudBareMetalMachineDataExtract_RunViaJsonString + /// + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets.InvokeAzNetworkCloudBareMetalMachineDataExtract_RunViaJsonString Clone() + { + var clone = new InvokeAzNetworkCloudBareMetalMachineDataExtract_RunViaJsonString(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.BareMetalMachineName = this.BareMetalMachineName; + clone.JsonString = this.JsonString; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 InvokeAzNetworkCloudBareMetalMachineDataExtract_RunViaJsonString() + { + + } + + /// 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.NetworkCloud.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.NetworkCloud.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'BareMetalMachinesRunDataExtracts' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.BareMetalMachinesRunDataExtractsViaJsonString(SubscriptionId, ResourceGroupName, BareMetalMachineName, _jsonString, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,BareMetalMachineName=BareMetalMachineName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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. + /// + /// 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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/InvokeAzNetworkCloudBareMetalMachineReimage_Reimage.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/InvokeAzNetworkCloudBareMetalMachineReimage_Reimage.cs index 9085ce592a13..0494161ba59a 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/InvokeAzNetworkCloudBareMetalMachineReimage_Reimage.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/InvokeAzNetworkCloudBareMetalMachineReimage_Reimage.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// Reimage the provided bare metal machine. @@ -18,7 +20,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/bareMetalMachines/{bareMetalMachineName}/reimage", ApiVersion = "2025-02-01")] public partial class InvokeAzNetworkCloudBareMetalMachineReimage_Reimage : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,6 +37,9 @@ public partial class InvokeAzNetworkCloudBareMetalMachineReimage_Reimage : 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(); + /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] @@ -44,6 +50,9 @@ public partial class InvokeAzNetworkCloudBareMetalMachineReimage_Reimage : globa [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -57,6 +66,9 @@ public partial class InvokeAzNetworkCloudBareMetalMachineReimage_Reimage : globa [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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] @@ -113,7 +125,7 @@ public partial class InvokeAzNetworkCloudBareMetalMachineReimage_Reimage : globa /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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")] @@ -159,7 +171,8 @@ public partial class InvokeAzNetworkCloudBareMetalMachineReimage_Reimage : globa [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -168,12 +181,12 @@ public partial class InvokeAzNetworkCloudBareMetalMachineReimage_Reimage : 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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 @@ -250,7 +263,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public InvokeAzNetworkCloudBareMetalMachineReimage_Reimage() { @@ -301,11 +314,36 @@ public InvokeAzNetworkCloudBareMetalMachineReimage_Reimage() 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.NetworkCloud.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -317,10 +355,26 @@ public InvokeAzNetworkCloudBareMetalMachineReimage_Reimage() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -388,7 +442,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -406,7 +460,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 } }); @@ -444,12 +498,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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ) { @@ -466,15 +520,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.NetworkCloud.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.NetworkCloud.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 } }); @@ -499,7 +553,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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/InvokeAzNetworkCloudBareMetalMachineReimage_ReimageViaIdentity.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/InvokeAzNetworkCloudBareMetalMachineReimage_ReimageViaIdentity.cs index 223eaedf6c55..6b2b5c33d91f 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/InvokeAzNetworkCloudBareMetalMachineReimage_ReimageViaIdentity.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/InvokeAzNetworkCloudBareMetalMachineReimage_ReimageViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// Reimage the provided bare metal machine. @@ -18,7 +20,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/bareMetalMachines/{bareMetalMachineName}/reimage", ApiVersion = "2025-02-01")] public partial class InvokeAzNetworkCloudBareMetalMachineReimage_ReimageViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,6 +37,9 @@ public partial class InvokeAzNetworkCloudBareMetalMachineReimage_ReimageViaIdent /// 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(); + /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] @@ -44,6 +50,9 @@ public partial class InvokeAzNetworkCloudBareMetalMachineReimage_ReimageViaIdent [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -57,6 +66,9 @@ public partial class InvokeAzNetworkCloudBareMetalMachineReimage_ReimageViaIdent [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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] @@ -106,7 +118,7 @@ public partial class InvokeAzNetworkCloudBareMetalMachineReimage_ReimageViaIdent /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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")] @@ -129,12 +141,12 @@ public partial class InvokeAzNetworkCloudBareMetalMachineReimage_ReimageViaIdent /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 @@ -210,7 +222,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet + /// Initializes a new instance of the cmdlet /// class. /// public InvokeAzNetworkCloudBareMetalMachineReimage_ReimageViaIdentity() @@ -262,11 +274,36 @@ public InvokeAzNetworkCloudBareMetalMachineReimage_ReimageViaIdentity() 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.NetworkCloud.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -278,10 +315,26 @@ public InvokeAzNetworkCloudBareMetalMachineReimage_ReimageViaIdentity() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -349,7 +402,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -387,7 +440,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 } }); @@ -425,12 +478,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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ) { @@ -447,7 +500,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.NetworkCloud.Runtime.RestException(responseMessage, await response); + var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 } @@ -480,7 +533,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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/InvokeAzNetworkCloudBareMetalMachineReplace_ReplaceExpanded.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/InvokeAzNetworkCloudBareMetalMachineReplace_ReplaceExpanded.cs index 2f32fa34c8f3..9bd2759f320c 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/InvokeAzNetworkCloudBareMetalMachineReplace_ReplaceExpanded.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/InvokeAzNetworkCloudBareMetalMachineReplace_ReplaceExpanded.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// Replace the provided bare metal machine. @@ -18,7 +20,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/bareMetalMachines/{bareMetalMachineName}/replace", ApiVersion = "2025-02-01")] public partial class InvokeAzNetworkCloudBareMetalMachineReplace_ReplaceExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -32,13 +35,16 @@ public partial class InvokeAzNetworkCloudBareMetalMachineReplace_ReplaceExpanded /// /// BareMetalMachineReplaceParameters represents the body of the request to physically swap a bare metal machine for another. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineReplaceParameters _bareMetalMachineReplaceParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BareMetalMachineReplaceParameters(); + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineReplaceParameters _bareMetalMachineReplaceParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BareMetalMachineReplaceParameters(); /// /// 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(); + /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] @@ -93,6 +99,9 @@ public partial class InvokeAzNetworkCloudBareMetalMachineReplace_ReplaceExpanded [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -106,6 +115,9 @@ public partial class InvokeAzNetworkCloudBareMetalMachineReplace_ReplaceExpanded [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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] @@ -173,7 +185,7 @@ public partial class InvokeAzNetworkCloudBareMetalMachineReplace_ReplaceExpanded /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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")] @@ -230,7 +242,8 @@ public partial class InvokeAzNetworkCloudBareMetalMachineReplace_ReplaceExpanded [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -239,12 +252,12 @@ public partial class InvokeAzNetworkCloudBareMetalMachineReplace_ReplaceExpanded /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 @@ -324,7 +337,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public InvokeAzNetworkCloudBareMetalMachineReplace_ReplaceExpanded() { @@ -375,11 +388,36 @@ public InvokeAzNetworkCloudBareMetalMachineReplace_ReplaceExpanded() 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.NetworkCloud.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -391,10 +429,26 @@ public InvokeAzNetworkCloudBareMetalMachineReplace_ReplaceExpanded() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -462,7 +516,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -480,7 +534,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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=_bareMetalMachineReplaceParametersBody}) + 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 } }); @@ -518,12 +572,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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ) { @@ -540,15 +594,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.NetworkCloud.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=_bareMetalMachineReplaceParametersBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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=_bareMetalMachineReplaceParametersBody }) + 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 } }); @@ -573,7 +627,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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/InvokeAzNetworkCloudBareMetalMachineReplace_ReplaceViaIdentityExpanded.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/InvokeAzNetworkCloudBareMetalMachineReplace_ReplaceViaIdentityExpanded.cs index bd402d525f21..bd9d143eab95 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/InvokeAzNetworkCloudBareMetalMachineReplace_ReplaceViaIdentityExpanded.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/InvokeAzNetworkCloudBareMetalMachineReplace_ReplaceViaIdentityExpanded.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// Replace the provided bare metal machine. @@ -18,7 +20,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/bareMetalMachines/{bareMetalMachineName}/replace", ApiVersion = "2025-02-01")] public partial class InvokeAzNetworkCloudBareMetalMachineReplace_ReplaceViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -32,13 +35,16 @@ public partial class InvokeAzNetworkCloudBareMetalMachineReplace_ReplaceViaIdent /// /// BareMetalMachineReplaceParameters represents the body of the request to physically swap a bare metal machine for another. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineReplaceParameters _bareMetalMachineReplaceParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BareMetalMachineReplaceParameters(); + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineReplaceParameters _bareMetalMachineReplaceParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BareMetalMachineReplaceParameters(); /// /// 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(); + /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] @@ -93,6 +99,9 @@ public partial class InvokeAzNetworkCloudBareMetalMachineReplace_ReplaceViaIdent [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -106,6 +115,9 @@ public partial class InvokeAzNetworkCloudBareMetalMachineReplace_ReplaceViaIdent [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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] @@ -166,7 +178,7 @@ public partial class InvokeAzNetworkCloudBareMetalMachineReplace_ReplaceViaIdent /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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")] @@ -200,12 +212,12 @@ public partial class InvokeAzNetworkCloudBareMetalMachineReplace_ReplaceViaIdent /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 @@ -282,7 +294,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the + /// Initializes a new instance of the /// cmdlet class. /// public InvokeAzNetworkCloudBareMetalMachineReplace_ReplaceViaIdentityExpanded() @@ -334,11 +346,36 @@ public InvokeAzNetworkCloudBareMetalMachineReplace_ReplaceViaIdentityExpanded() 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.NetworkCloud.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -350,10 +387,26 @@ public InvokeAzNetworkCloudBareMetalMachineReplace_ReplaceViaIdentityExpanded() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -421,7 +474,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -459,7 +512,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_bareMetalMachineReplaceParametersBody}) + 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 } }); @@ -497,12 +550,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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ) { @@ -519,15 +572,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.NetworkCloud.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_bareMetalMachineReplaceParametersBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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=_bareMetalMachineReplaceParametersBody }) + 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 } }); @@ -552,7 +605,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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/InvokeAzNetworkCloudBareMetalMachineReplace_ReplaceViaJsonFilePath.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/InvokeAzNetworkCloudBareMetalMachineReplace_ReplaceViaJsonFilePath.cs new file mode 100644 index 000000000000..6af742bf5c8c --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/InvokeAzNetworkCloudBareMetalMachineReplace_ReplaceViaJsonFilePath.cs @@ -0,0 +1,583 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; + using System; + + /// Replace the provided bare metal machine. + /// + /// [OpenAPI] Replace=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/bareMetalMachines/{bareMetalMachineName}/replace" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Invoke, @"AzNetworkCloudBareMetalMachineReplace_ReplaceViaJsonFilePath", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Replace the provided bare metal machine.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/bareMetalMachines/{bareMetalMachineName}/replace", ApiVersion = "2025-02-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.NotSuggestDefaultParameterSet] + public partial class InvokeAzNetworkCloudBareMetalMachineReplace_ReplaceViaJsonFilePath : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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(); + + public global::System.String _jsonString; + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 Replace operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Path of Json file supplied to the Replace operation")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Path of Json file supplied to the Replace 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.NetworkCloud.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of the bare metal machine. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the bare metal machine.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the bare metal machine.", + SerializedName = @"bareMetalMachineName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("BareMetalMachineName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// 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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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. The value must be an UUID. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription. The value must be an UUID.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription. The value must be an UUID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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. + /// /// 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.NetworkCloud.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of InvokeAzNetworkCloudBareMetalMachineReplace_ReplaceViaJsonFilePath + /// + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets.InvokeAzNetworkCloudBareMetalMachineReplace_ReplaceViaJsonFilePath Clone() + { + var clone = new InvokeAzNetworkCloudBareMetalMachineReplace_ReplaceViaJsonFilePath(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.Name = this.Name; + clone.JsonFilePath = this.JsonFilePath; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 InvokeAzNetworkCloudBareMetalMachineReplace_ReplaceViaJsonFilePath() + { + + } + + /// 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.NetworkCloud.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.NetworkCloud.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'BareMetalMachinesReplace' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.BareMetalMachinesReplaceViaJsonString(SubscriptionId, ResourceGroupName, Name, _jsonString, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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. + /// + /// 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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/InvokeAzNetworkCloudBareMetalMachineReplace_ReplaceViaJsonString.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/InvokeAzNetworkCloudBareMetalMachineReplace_ReplaceViaJsonString.cs new file mode 100644 index 000000000000..f460e675491d --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/InvokeAzNetworkCloudBareMetalMachineReplace_ReplaceViaJsonString.cs @@ -0,0 +1,581 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; + using System; + + /// Replace the provided bare metal machine. + /// + /// [OpenAPI] Replace=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/bareMetalMachines/{bareMetalMachineName}/replace" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Invoke, @"AzNetworkCloudBareMetalMachineReplace_ReplaceViaJsonString", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Replace the provided bare metal machine.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/bareMetalMachines/{bareMetalMachineName}/replace", ApiVersion = "2025-02-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.NotSuggestDefaultParameterSet] + public partial class InvokeAzNetworkCloudBareMetalMachineReplace_ReplaceViaJsonString : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 Replace operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Json string supplied to the Replace operation")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Json string supplied to the Replace 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.NetworkCloud.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of the bare metal machine. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the bare metal machine.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the bare metal machine.", + SerializedName = @"bareMetalMachineName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("BareMetalMachineName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// 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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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. The value must be an UUID. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription. The value must be an UUID.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription. The value must be an UUID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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. + /// /// 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.NetworkCloud.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of InvokeAzNetworkCloudBareMetalMachineReplace_ReplaceViaJsonString + /// + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets.InvokeAzNetworkCloudBareMetalMachineReplace_ReplaceViaJsonString Clone() + { + var clone = new InvokeAzNetworkCloudBareMetalMachineReplace_ReplaceViaJsonString(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.Name = this.Name; + clone.JsonString = this.JsonString; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 InvokeAzNetworkCloudBareMetalMachineReplace_ReplaceViaJsonString() + { + + } + + /// 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.NetworkCloud.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.NetworkCloud.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'BareMetalMachinesReplace' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.BareMetalMachinesReplaceViaJsonString(SubscriptionId, ResourceGroupName, Name, _jsonString, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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. + /// + /// 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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/InvokeAzNetworkCloudBareMetalMachineRunCommand_RunExpanded.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/InvokeAzNetworkCloudBareMetalMachineRunCommand_RunExpanded.cs index 9610fe94201d..7ad8c52cf212 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/InvokeAzNetworkCloudBareMetalMachineRunCommand_RunExpanded.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/InvokeAzNetworkCloudBareMetalMachineRunCommand_RunExpanded.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// @@ -21,7 +23,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/bareMetalMachines/{bareMetalMachineName}/runCommand", ApiVersion = "2025-02-01")] public partial class InvokeAzNetworkCloudBareMetalMachineRunCommand_RunExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,13 +38,16 @@ public partial class InvokeAzNetworkCloudBareMetalMachineRunCommand_RunExpanded /// /// BareMetalMachineRunCommandParameters represents the body of the request to execute a script on the bare metal machine. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineRunCommandParameters _bareMetalMachineRunCommandParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BareMetalMachineRunCommandParameters(); + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineRunCommandParameters _bareMetalMachineRunCommandParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BareMetalMachineRunCommandParameters(); /// /// 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(); + /// /// The list of string arguments that will be passed to the script in order as separate arguments. /// @@ -54,7 +60,7 @@ public partial class InvokeAzNetworkCloudBareMetalMachineRunCommand_RunExpanded Description = @"The list of string arguments that will be passed to the script in order as separate arguments.", SerializedName = @"arguments", PossibleTypes = new [] { typeof(string) })] - public string[] Argument { get => _bareMetalMachineRunCommandParametersBody.Argument ?? null /* arrayOf */; set => _bareMetalMachineRunCommandParametersBody.Argument = value; } + public string[] Argument { get => _bareMetalMachineRunCommandParametersBody.Argument?.ToArray() ?? null /* fixedArrayOf */; set => _bareMetalMachineRunCommandParametersBody.Argument = (value != null ? new System.Collections.Generic.List(value) : null); } /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] @@ -80,6 +86,9 @@ public partial class InvokeAzNetworkCloudBareMetalMachineRunCommand_RunExpanded [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -93,6 +102,9 @@ public partial class InvokeAzNetworkCloudBareMetalMachineRunCommand_RunExpanded [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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] @@ -148,7 +160,7 @@ public partial class InvokeAzNetworkCloudBareMetalMachineRunCommand_RunExpanded /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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")] @@ -205,7 +217,8 @@ public partial class InvokeAzNetworkCloudBareMetalMachineRunCommand_RunExpanded [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -214,12 +227,12 @@ public partial class InvokeAzNetworkCloudBareMetalMachineRunCommand_RunExpanded /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 @@ -299,7 +312,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public InvokeAzNetworkCloudBareMetalMachineRunCommand_RunExpanded() { @@ -350,11 +363,36 @@ public InvokeAzNetworkCloudBareMetalMachineRunCommand_RunExpanded() 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.NetworkCloud.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -366,10 +404,26 @@ public InvokeAzNetworkCloudBareMetalMachineRunCommand_RunExpanded() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -437,7 +491,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -455,7 +509,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,BareMetalMachineName=BareMetalMachineName,body=_bareMetalMachineRunCommandParametersBody}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,BareMetalMachineName=BareMetalMachineName}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -493,12 +547,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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ) { @@ -515,15 +569,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.NetworkCloud.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, BareMetalMachineName=BareMetalMachineName, body=_bareMetalMachineRunCommandParametersBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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, BareMetalMachineName=BareMetalMachineName, body=_bareMetalMachineRunCommandParametersBody }) + 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,7 +602,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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/InvokeAzNetworkCloudBareMetalMachineRunCommand_RunViaIdentityExpanded.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/InvokeAzNetworkCloudBareMetalMachineRunCommand_RunViaIdentityExpanded.cs index ddce88733991..c76f924bb5d7 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/InvokeAzNetworkCloudBareMetalMachineRunCommand_RunViaIdentityExpanded.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/InvokeAzNetworkCloudBareMetalMachineRunCommand_RunViaIdentityExpanded.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// @@ -21,7 +23,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/bareMetalMachines/{bareMetalMachineName}/runCommand", ApiVersion = "2025-02-01")] public partial class InvokeAzNetworkCloudBareMetalMachineRunCommand_RunViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,13 +38,16 @@ public partial class InvokeAzNetworkCloudBareMetalMachineRunCommand_RunViaIdenti /// /// BareMetalMachineRunCommandParameters represents the body of the request to execute a script on the bare metal machine. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineRunCommandParameters _bareMetalMachineRunCommandParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BareMetalMachineRunCommandParameters(); + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineRunCommandParameters _bareMetalMachineRunCommandParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BareMetalMachineRunCommandParameters(); /// /// 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(); + /// /// The list of string arguments that will be passed to the script in order as separate arguments. /// @@ -54,7 +60,7 @@ public partial class InvokeAzNetworkCloudBareMetalMachineRunCommand_RunViaIdenti Description = @"The list of string arguments that will be passed to the script in order as separate arguments.", SerializedName = @"arguments", PossibleTypes = new [] { typeof(string) })] - public string[] Argument { get => _bareMetalMachineRunCommandParametersBody.Argument ?? null /* arrayOf */; set => _bareMetalMachineRunCommandParametersBody.Argument = value; } + public string[] Argument { get => _bareMetalMachineRunCommandParametersBody.Argument?.ToArray() ?? null /* fixedArrayOf */; set => _bareMetalMachineRunCommandParametersBody.Argument = (value != null ? new System.Collections.Generic.List(value) : null); } /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] @@ -66,6 +72,9 @@ public partial class InvokeAzNetworkCloudBareMetalMachineRunCommand_RunViaIdenti [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -79,6 +88,9 @@ public partial class InvokeAzNetworkCloudBareMetalMachineRunCommand_RunViaIdenti [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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] @@ -142,7 +154,7 @@ public partial class InvokeAzNetworkCloudBareMetalMachineRunCommand_RunViaIdenti /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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")] @@ -176,12 +188,12 @@ public partial class InvokeAzNetworkCloudBareMetalMachineRunCommand_RunViaIdenti /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 @@ -258,7 +270,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the + /// Initializes a new instance of the /// cmdlet class. /// public InvokeAzNetworkCloudBareMetalMachineRunCommand_RunViaIdentityExpanded() @@ -310,11 +322,36 @@ public InvokeAzNetworkCloudBareMetalMachineRunCommand_RunViaIdentityExpanded() 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.NetworkCloud.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -326,10 +363,26 @@ public InvokeAzNetworkCloudBareMetalMachineRunCommand_RunViaIdentityExpanded() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -397,7 +450,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -435,7 +488,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_bareMetalMachineRunCommandParametersBody}) + 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 } }); @@ -473,12 +526,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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ) { @@ -495,15 +548,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.NetworkCloud.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_bareMetalMachineRunCommandParametersBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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=_bareMetalMachineRunCommandParametersBody }) + 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 } }); @@ -528,7 +581,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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/InvokeAzNetworkCloudBareMetalMachineRunCommand_RunViaJsonFilePath.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/InvokeAzNetworkCloudBareMetalMachineRunCommand_RunViaJsonFilePath.cs new file mode 100644 index 000000000000..d5f90a5db490 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/InvokeAzNetworkCloudBareMetalMachineRunCommand_RunViaJsonFilePath.cs @@ -0,0 +1,585 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; + using System; + + /// + /// Run the command or the script on the provided bare metal machine. The URL to storage account with the command execution + /// results and the command exit code can be retrieved from the operation status API once available. + /// + /// + /// [OpenAPI] RunCommand=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/bareMetalMachines/{bareMetalMachineName}/runCommand" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Invoke, @"AzNetworkCloudBareMetalMachineRunCommand_RunViaJsonFilePath", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Run the command or the script on the provided bare metal machine. The URL to storage account with the command execution results and the command exit code can be retrieved from the operation status API once available.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/bareMetalMachines/{bareMetalMachineName}/runCommand", ApiVersion = "2025-02-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.NotSuggestDefaultParameterSet] + public partial class InvokeAzNetworkCloudBareMetalMachineRunCommand_RunViaJsonFilePath : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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(); + + public global::System.String _jsonString; + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Backing field for property. + private string _bareMetalMachineName; + + /// The name of the bare metal machine. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the bare metal machine.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the bare metal machine.", + SerializedName = @"bareMetalMachineName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] + public string BareMetalMachineName { get => this._bareMetalMachineName; set => this._bareMetalMachineName = 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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 Run operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Path of Json file supplied to the Run operation")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Path of Json file supplied to the Run 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.NetworkCloud.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// 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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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. The value must be an UUID. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription. The value must be an UUID.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription. The value must be an UUID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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. + /// /// 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.NetworkCloud.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of InvokeAzNetworkCloudBareMetalMachineRunCommand_RunViaJsonFilePath + /// + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets.InvokeAzNetworkCloudBareMetalMachineRunCommand_RunViaJsonFilePath Clone() + { + var clone = new InvokeAzNetworkCloudBareMetalMachineRunCommand_RunViaJsonFilePath(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.BareMetalMachineName = this.BareMetalMachineName; + clone.JsonFilePath = this.JsonFilePath; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 InvokeAzNetworkCloudBareMetalMachineRunCommand_RunViaJsonFilePath() + { + + } + + /// 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.NetworkCloud.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.NetworkCloud.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'BareMetalMachinesRunCommand' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.BareMetalMachinesRunCommandViaJsonString(SubscriptionId, ResourceGroupName, BareMetalMachineName, _jsonString, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,BareMetalMachineName=BareMetalMachineName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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. + /// + /// 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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/InvokeAzNetworkCloudBareMetalMachineRunCommand_RunViaJsonString.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/InvokeAzNetworkCloudBareMetalMachineRunCommand_RunViaJsonString.cs new file mode 100644 index 000000000000..3f55c617ae44 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/InvokeAzNetworkCloudBareMetalMachineRunCommand_RunViaJsonString.cs @@ -0,0 +1,583 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; + using System; + + /// + /// Run the command or the script on the provided bare metal machine. The URL to storage account with the command execution + /// results and the command exit code can be retrieved from the operation status API once available. + /// + /// + /// [OpenAPI] RunCommand=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/bareMetalMachines/{bareMetalMachineName}/runCommand" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Invoke, @"AzNetworkCloudBareMetalMachineRunCommand_RunViaJsonString", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Run the command or the script on the provided bare metal machine. The URL to storage account with the command execution results and the command exit code can be retrieved from the operation status API once available.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/bareMetalMachines/{bareMetalMachineName}/runCommand", ApiVersion = "2025-02-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.NotSuggestDefaultParameterSet] + public partial class InvokeAzNetworkCloudBareMetalMachineRunCommand_RunViaJsonString : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Backing field for property. + private string _bareMetalMachineName; + + /// The name of the bare metal machine. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the bare metal machine.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the bare metal machine.", + SerializedName = @"bareMetalMachineName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] + public string BareMetalMachineName { get => this._bareMetalMachineName; set => this._bareMetalMachineName = 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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 Run operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Json string supplied to the Run operation")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Json string supplied to the Run 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.NetworkCloud.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// 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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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. The value must be an UUID. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription. The value must be an UUID.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription. The value must be an UUID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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. + /// /// 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.NetworkCloud.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of InvokeAzNetworkCloudBareMetalMachineRunCommand_RunViaJsonString + /// + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets.InvokeAzNetworkCloudBareMetalMachineRunCommand_RunViaJsonString Clone() + { + var clone = new InvokeAzNetworkCloudBareMetalMachineRunCommand_RunViaJsonString(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.BareMetalMachineName = this.BareMetalMachineName; + clone.JsonString = this.JsonString; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 InvokeAzNetworkCloudBareMetalMachineRunCommand_RunViaJsonString() + { + + } + + /// 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.NetworkCloud.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.NetworkCloud.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'BareMetalMachinesRunCommand' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.BareMetalMachinesRunCommandViaJsonString(SubscriptionId, ResourceGroupName, BareMetalMachineName, _jsonString, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,BareMetalMachineName=BareMetalMachineName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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. + /// + /// 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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/InvokeAzNetworkCloudBareMetalMachineRunReadCommand_RunExpanded.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/InvokeAzNetworkCloudBareMetalMachineRunReadCommand_RunExpanded.cs index f463b0dc14be..cc6372121fec 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/InvokeAzNetworkCloudBareMetalMachineRunReadCommand_RunExpanded.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/InvokeAzNetworkCloudBareMetalMachineRunReadCommand_RunExpanded.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// @@ -21,7 +23,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/bareMetalMachines/{bareMetalMachineName}/runReadCommands", ApiVersion = "2025-02-01")] public partial class InvokeAzNetworkCloudBareMetalMachineRunReadCommand_RunExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -36,13 +39,16 @@ public partial class InvokeAzNetworkCloudBareMetalMachineRunReadCommand_RunExpan /// BareMetalMachineRunReadCommandsParameters represents the body of request containing list of read-only commands to run /// on the bare metal machine. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineRunReadCommandsParameters _bareMetalMachineRunReadCommandsParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BareMetalMachineRunReadCommandsParameters(); + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineRunReadCommandsParameters _bareMetalMachineRunReadCommandsParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BareMetalMachineRunReadCommandsParameters(); /// /// 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(); + /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] @@ -67,6 +73,9 @@ public partial class InvokeAzNetworkCloudBareMetalMachineRunReadCommand_RunExpan [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -81,8 +90,8 @@ public partial class InvokeAzNetworkCloudBareMetalMachineRunReadCommand_RunExpan ReadOnly = false, Description = @"The list of read-only commands to be executed directly against the target machine.", SerializedName = @"commands", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineCommandSpecification) })] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineCommandSpecification[] Command { get => _bareMetalMachineRunReadCommandsParametersBody.Command ?? null /* arrayOf */; set => _bareMetalMachineRunReadCommandsParametersBody.Command = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineCommandSpecification) })] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineCommandSpecification[] Command { get => _bareMetalMachineRunReadCommandsParametersBody.Command?.ToArray() ?? null /* fixedArrayOf */; set => _bareMetalMachineRunReadCommandsParametersBody.Command = (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 @@ -94,6 +103,9 @@ public partial class InvokeAzNetworkCloudBareMetalMachineRunReadCommand_RunExpan [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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] @@ -149,7 +161,7 @@ public partial class InvokeAzNetworkCloudBareMetalMachineRunReadCommand_RunExpan /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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")] @@ -195,7 +207,8 @@ public partial class InvokeAzNetworkCloudBareMetalMachineRunReadCommand_RunExpan [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -204,12 +217,12 @@ public partial class InvokeAzNetworkCloudBareMetalMachineRunReadCommand_RunExpan /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 @@ -289,7 +302,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet + /// Initializes a new instance of the cmdlet /// class. /// public InvokeAzNetworkCloudBareMetalMachineRunReadCommand_RunExpanded() @@ -341,11 +354,36 @@ public InvokeAzNetworkCloudBareMetalMachineRunReadCommand_RunExpanded() 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.NetworkCloud.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -357,10 +395,26 @@ public InvokeAzNetworkCloudBareMetalMachineRunReadCommand_RunExpanded() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -428,7 +482,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -446,7 +500,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,BareMetalMachineName=BareMetalMachineName,body=_bareMetalMachineRunReadCommandsParametersBody}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,BareMetalMachineName=BareMetalMachineName}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -484,12 +538,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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ) { @@ -506,15 +560,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.NetworkCloud.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, BareMetalMachineName=BareMetalMachineName, body=_bareMetalMachineRunReadCommandsParametersBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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, BareMetalMachineName=BareMetalMachineName, body=_bareMetalMachineRunReadCommandsParametersBody }) + 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 } }); @@ -539,7 +593,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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/InvokeAzNetworkCloudBareMetalMachineRunReadCommand_RunViaIdentityExpanded.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/InvokeAzNetworkCloudBareMetalMachineRunReadCommand_RunViaIdentityExpanded.cs index e52ce4ca5b4b..8bb23f77ad7c 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/InvokeAzNetworkCloudBareMetalMachineRunReadCommand_RunViaIdentityExpanded.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/InvokeAzNetworkCloudBareMetalMachineRunReadCommand_RunViaIdentityExpanded.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// @@ -21,7 +23,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/bareMetalMachines/{bareMetalMachineName}/runReadCommands", ApiVersion = "2025-02-01")] public partial class InvokeAzNetworkCloudBareMetalMachineRunReadCommand_RunViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -36,13 +39,16 @@ public partial class InvokeAzNetworkCloudBareMetalMachineRunReadCommand_RunViaId /// BareMetalMachineRunReadCommandsParameters represents the body of request containing list of read-only commands to run /// on the bare metal machine. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineRunReadCommandsParameters _bareMetalMachineRunReadCommandsParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BareMetalMachineRunReadCommandsParameters(); + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineRunReadCommandsParameters _bareMetalMachineRunReadCommandsParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BareMetalMachineRunReadCommandsParameters(); /// /// 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(); + /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] @@ -53,6 +59,9 @@ public partial class InvokeAzNetworkCloudBareMetalMachineRunReadCommand_RunViaId [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -67,8 +76,8 @@ public partial class InvokeAzNetworkCloudBareMetalMachineRunReadCommand_RunViaId ReadOnly = false, Description = @"The list of read-only commands to be executed directly against the target machine.", SerializedName = @"commands", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineCommandSpecification) })] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineCommandSpecification[] Command { get => _bareMetalMachineRunReadCommandsParametersBody.Command ?? null /* arrayOf */; set => _bareMetalMachineRunReadCommandsParametersBody.Command = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineCommandSpecification) })] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineCommandSpecification[] Command { get => _bareMetalMachineRunReadCommandsParametersBody.Command?.ToArray() ?? null /* fixedArrayOf */; set => _bareMetalMachineRunReadCommandsParametersBody.Command = (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 @@ -80,6 +89,9 @@ public partial class InvokeAzNetworkCloudBareMetalMachineRunReadCommand_RunViaId [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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] @@ -143,7 +155,7 @@ public partial class InvokeAzNetworkCloudBareMetalMachineRunReadCommand_RunViaId /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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")] @@ -166,12 +178,12 @@ public partial class InvokeAzNetworkCloudBareMetalMachineRunReadCommand_RunViaId /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 @@ -248,7 +260,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. /// public InvokeAzNetworkCloudBareMetalMachineRunReadCommand_RunViaIdentityExpanded() @@ -300,11 +312,36 @@ public InvokeAzNetworkCloudBareMetalMachineRunReadCommand_RunViaIdentityExpanded 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.NetworkCloud.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -316,10 +353,26 @@ public InvokeAzNetworkCloudBareMetalMachineRunReadCommand_RunViaIdentityExpanded return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -387,7 +440,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -425,7 +478,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_bareMetalMachineRunReadCommandsParametersBody}) + 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 } }); @@ -463,12 +516,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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ) { @@ -485,15 +538,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.NetworkCloud.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_bareMetalMachineRunReadCommandsParametersBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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=_bareMetalMachineRunReadCommandsParametersBody }) + 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 } }); @@ -518,7 +571,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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/InvokeAzNetworkCloudBareMetalMachineRunReadCommand_RunViaJsonFilePath.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/InvokeAzNetworkCloudBareMetalMachineRunReadCommand_RunViaJsonFilePath.cs new file mode 100644 index 000000000000..fded0118b4dd --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/InvokeAzNetworkCloudBareMetalMachineRunReadCommand_RunViaJsonFilePath.cs @@ -0,0 +1,585 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; + using System; + + /// + /// Run one or more read-only commands on the provided bare metal machine. The URL to storage account with the command execution + /// results and the command exit code can be retrieved from the operation status API once available. + /// + /// + /// [OpenAPI] RunReadCommands=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/bareMetalMachines/{bareMetalMachineName}/runReadCommands" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Invoke, @"AzNetworkCloudBareMetalMachineRunReadCommand_RunViaJsonFilePath", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Run one or more read-only commands on the provided bare metal machine. The URL to storage account with the command execution results and the command exit code can be retrieved from the operation status API once available.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/bareMetalMachines/{bareMetalMachineName}/runReadCommands", ApiVersion = "2025-02-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.NotSuggestDefaultParameterSet] + public partial class InvokeAzNetworkCloudBareMetalMachineRunReadCommand_RunViaJsonFilePath : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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(); + + public global::System.String _jsonString; + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Backing field for property. + private string _bareMetalMachineName; + + /// The name of the bare metal machine. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the bare metal machine.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the bare metal machine.", + SerializedName = @"bareMetalMachineName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] + public string BareMetalMachineName { get => this._bareMetalMachineName; set => this._bareMetalMachineName = 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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 Run operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Path of Json file supplied to the Run operation")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Path of Json file supplied to the Run 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.NetworkCloud.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// 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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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. The value must be an UUID. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription. The value must be an UUID.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription. The value must be an UUID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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. + /// /// 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.NetworkCloud.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of InvokeAzNetworkCloudBareMetalMachineRunReadCommand_RunViaJsonFilePath + /// + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets.InvokeAzNetworkCloudBareMetalMachineRunReadCommand_RunViaJsonFilePath Clone() + { + var clone = new InvokeAzNetworkCloudBareMetalMachineRunReadCommand_RunViaJsonFilePath(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.BareMetalMachineName = this.BareMetalMachineName; + clone.JsonFilePath = this.JsonFilePath; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 InvokeAzNetworkCloudBareMetalMachineRunReadCommand_RunViaJsonFilePath() + { + + } + + /// 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.NetworkCloud.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.NetworkCloud.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'BareMetalMachinesRunReadCommands' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.BareMetalMachinesRunReadCommandsViaJsonString(SubscriptionId, ResourceGroupName, BareMetalMachineName, _jsonString, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,BareMetalMachineName=BareMetalMachineName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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. + /// + /// 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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/InvokeAzNetworkCloudBareMetalMachineRunReadCommand_RunViaJsonString.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/InvokeAzNetworkCloudBareMetalMachineRunReadCommand_RunViaJsonString.cs new file mode 100644 index 000000000000..26c4c7325739 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/InvokeAzNetworkCloudBareMetalMachineRunReadCommand_RunViaJsonString.cs @@ -0,0 +1,583 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; + using System; + + /// + /// Run one or more read-only commands on the provided bare metal machine. The URL to storage account with the command execution + /// results and the command exit code can be retrieved from the operation status API once available. + /// + /// + /// [OpenAPI] RunReadCommands=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/bareMetalMachines/{bareMetalMachineName}/runReadCommands" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Invoke, @"AzNetworkCloudBareMetalMachineRunReadCommand_RunViaJsonString", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Run one or more read-only commands on the provided bare metal machine. The URL to storage account with the command execution results and the command exit code can be retrieved from the operation status API once available.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/bareMetalMachines/{bareMetalMachineName}/runReadCommands", ApiVersion = "2025-02-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.NotSuggestDefaultParameterSet] + public partial class InvokeAzNetworkCloudBareMetalMachineRunReadCommand_RunViaJsonString : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Backing field for property. + private string _bareMetalMachineName; + + /// The name of the bare metal machine. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the bare metal machine.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the bare metal machine.", + SerializedName = @"bareMetalMachineName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] + public string BareMetalMachineName { get => this._bareMetalMachineName; set => this._bareMetalMachineName = 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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 Run operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Json string supplied to the Run operation")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Json string supplied to the Run 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.NetworkCloud.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// 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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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. The value must be an UUID. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription. The value must be an UUID.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription. The value must be an UUID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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. + /// /// 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.NetworkCloud.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of InvokeAzNetworkCloudBareMetalMachineRunReadCommand_RunViaJsonString + /// + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets.InvokeAzNetworkCloudBareMetalMachineRunReadCommand_RunViaJsonString Clone() + { + var clone = new InvokeAzNetworkCloudBareMetalMachineRunReadCommand_RunViaJsonString(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.BareMetalMachineName = this.BareMetalMachineName; + clone.JsonString = this.JsonString; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 InvokeAzNetworkCloudBareMetalMachineRunReadCommand_RunViaJsonString() + { + + } + + /// 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.NetworkCloud.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.NetworkCloud.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'BareMetalMachinesRunReadCommands' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.BareMetalMachinesRunReadCommandsViaJsonString(SubscriptionId, ResourceGroupName, BareMetalMachineName, _jsonString, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,BareMetalMachineName=BareMetalMachineName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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. + /// + /// 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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/InvokeAzNetworkCloudBareMetalMachineUncordon_Uncordon.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/InvokeAzNetworkCloudBareMetalMachineUncordon_Uncordon.cs index ac4ab61b3b23..f91f2d5e2a9f 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/InvokeAzNetworkCloudBareMetalMachineUncordon_Uncordon.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/InvokeAzNetworkCloudBareMetalMachineUncordon_Uncordon.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// Uncordon the provided bare metal machine's Kubernetes node. @@ -18,7 +20,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/bareMetalMachines/{bareMetalMachineName}/uncordon", ApiVersion = "2025-02-01")] public partial class InvokeAzNetworkCloudBareMetalMachineUncordon_Uncordon : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,6 +37,9 @@ public partial class InvokeAzNetworkCloudBareMetalMachineUncordon_Uncordon : 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(); + /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] @@ -58,6 +64,9 @@ public partial class InvokeAzNetworkCloudBareMetalMachineUncordon_Uncordon : glo [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -71,6 +80,9 @@ public partial class InvokeAzNetworkCloudBareMetalMachineUncordon_Uncordon : glo [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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] @@ -112,7 +124,7 @@ public partial class InvokeAzNetworkCloudBareMetalMachineUncordon_Uncordon : glo /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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")] @@ -158,7 +170,8 @@ public partial class InvokeAzNetworkCloudBareMetalMachineUncordon_Uncordon : glo [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -167,12 +180,12 @@ public partial class InvokeAzNetworkCloudBareMetalMachineUncordon_Uncordon : 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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 @@ -249,7 +262,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public InvokeAzNetworkCloudBareMetalMachineUncordon_Uncordon() { @@ -300,11 +313,36 @@ public InvokeAzNetworkCloudBareMetalMachineUncordon_Uncordon() 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.NetworkCloud.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -316,10 +354,26 @@ public InvokeAzNetworkCloudBareMetalMachineUncordon_Uncordon() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -387,7 +441,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -405,7 +459,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,BareMetalMachineName=BareMetalMachineName}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,BareMetalMachineName=BareMetalMachineName}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -443,12 +497,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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ) { @@ -465,15 +519,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.NetworkCloud.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, BareMetalMachineName=BareMetalMachineName }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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, BareMetalMachineName=BareMetalMachineName }) + 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 } }); @@ -498,7 +552,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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/InvokeAzNetworkCloudBareMetalMachineUncordon_UncordonViaIdentity.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/InvokeAzNetworkCloudBareMetalMachineUncordon_UncordonViaIdentity.cs index 5218e9d08c34..9abf88ae1b6c 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/InvokeAzNetworkCloudBareMetalMachineUncordon_UncordonViaIdentity.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/InvokeAzNetworkCloudBareMetalMachineUncordon_UncordonViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// Uncordon the provided bare metal machine's Kubernetes node. @@ -18,7 +20,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/bareMetalMachines/{bareMetalMachineName}/uncordon", ApiVersion = "2025-02-01")] public partial class InvokeAzNetworkCloudBareMetalMachineUncordon_UncordonViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,6 +37,9 @@ public partial class InvokeAzNetworkCloudBareMetalMachineUncordon_UncordonViaIde /// 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(); + /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] @@ -44,6 +50,9 @@ public partial class InvokeAzNetworkCloudBareMetalMachineUncordon_UncordonViaIde [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -57,6 +66,9 @@ public partial class InvokeAzNetworkCloudBareMetalMachineUncordon_UncordonViaIde [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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] @@ -106,7 +118,7 @@ public partial class InvokeAzNetworkCloudBareMetalMachineUncordon_UncordonViaIde /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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")] @@ -129,12 +141,12 @@ public partial class InvokeAzNetworkCloudBareMetalMachineUncordon_UncordonViaIde /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 @@ -210,7 +222,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet + /// Initializes a new instance of the cmdlet /// class. /// public InvokeAzNetworkCloudBareMetalMachineUncordon_UncordonViaIdentity() @@ -262,11 +274,36 @@ public InvokeAzNetworkCloudBareMetalMachineUncordon_UncordonViaIdentity() 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.NetworkCloud.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -278,10 +315,26 @@ public InvokeAzNetworkCloudBareMetalMachineUncordon_UncordonViaIdentity() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -349,7 +402,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -387,7 +440,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 } }); @@ -425,12 +478,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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ) { @@ -447,7 +500,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.NetworkCloud.Runtime.RestException(responseMessage, await response); + var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 } @@ -480,7 +533,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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/InvokeAzNetworkCloudClusterContinueVersionUpdate_Continue.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/InvokeAzNetworkCloudClusterContinueVersionUpdate_Continue.cs index 2b0604511050..f159c7ca0139 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/InvokeAzNetworkCloudClusterContinueVersionUpdate_Continue.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/InvokeAzNetworkCloudClusterContinueVersionUpdate_Continue.cs @@ -6,22 +6,25 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// - /// Trigger the continuation of an update for a cluster with a matching update strategy that has paused after completing a - /// segment of the update. + /// Trigger the continuation of an continue for a cluster with a matching continue strategy that has paused after completing + /// a segment of the continue /// /// /// [OpenAPI] ContinueUpdateVersion=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/continueUpdateVersion" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Invoke, @"AzNetworkCloudClusterContinueVersionUpdate_Continue", SupportsShouldProcess = true)] [global::System.Management.Automation.OutputType(typeof(bool))] - [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Trigger the continuation of an update for a cluster with a matching update strategy that has paused after completing a segment of the update.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Trigger the continuation of an continue for a cluster with a matching continue strategy that has paused after completing a segment of the continue ")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/continueUpdateVersion", ApiVersion = "2025-02-01")] public partial class InvokeAzNetworkCloudClusterContinueVersionUpdate_Continue : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -37,6 +40,9 @@ public partial class InvokeAzNetworkCloudClusterContinueVersionUpdate_Continue : /// 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(); + /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] @@ -47,13 +53,16 @@ public partial class InvokeAzNetworkCloudClusterContinueVersionUpdate_Continue : [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; /// /// Backing field for property. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterContinueUpdateVersionParameters _clusterContinueUpdateVersionParameter; + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterContinueUpdateVersionParameters _clusterContinueUpdateVersionParameter; /// /// ClusterContinueUpdateVersionParameters represents the body of the request to continue the update of a cluster version. @@ -64,8 +73,9 @@ public partial class InvokeAzNetworkCloudClusterContinueVersionUpdate_Continue : ReadOnly = false, Description = @"ClusterContinueUpdateVersionParameters represents the body of the request to continue the update of a cluster version.", SerializedName = @"clusterContinueUpdateVersionParameters", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterContinueUpdateVersionParameters) })] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterContinueUpdateVersionParameters ClusterContinueUpdateVersionParameter { get => this._clusterContinueUpdateVersionParameter; set => this._clusterContinueUpdateVersionParameter = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterContinueUpdateVersionParameters) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Body)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterContinueUpdateVersionParameters ClusterContinueUpdateVersionParameter { get => this._clusterContinueUpdateVersionParameter; set => this._clusterContinueUpdateVersionParameter = value; } /// Backing field for property. private string _clusterName; @@ -91,6 +101,9 @@ public partial class InvokeAzNetworkCloudClusterContinueVersionUpdate_Continue : [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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] @@ -132,7 +145,7 @@ public partial class InvokeAzNetworkCloudClusterContinueVersionUpdate_Continue : /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 +191,8 @@ public partial class InvokeAzNetworkCloudClusterContinueVersionUpdate_Continue : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -187,12 +201,12 @@ public partial class InvokeAzNetworkCloudClusterContinueVersionUpdate_Continue : /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 @@ -272,7 +286,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public InvokeAzNetworkCloudClusterContinueVersionUpdate_Continue() { @@ -323,11 +337,36 @@ public InvokeAzNetworkCloudClusterContinueVersionUpdate_Continue() 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.NetworkCloud.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -339,10 +378,26 @@ public InvokeAzNetworkCloudClusterContinueVersionUpdate_Continue() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -410,7 +465,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -428,7 +483,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,ClusterName=ClusterName,body=ClusterContinueUpdateVersionParameter}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,ClusterName=ClusterName}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -466,12 +521,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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ) { @@ -488,15 +543,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.NetworkCloud.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, ClusterName=ClusterName, body=ClusterContinueUpdateVersionParameter }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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, ClusterName=ClusterName, body=ClusterContinueUpdateVersionParameter }) + 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 } }); @@ -521,7 +576,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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/InvokeAzNetworkCloudClusterContinueVersionUpdate_ContinueExpanded.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/InvokeAzNetworkCloudClusterContinueVersionUpdate_ContinueExpanded.cs index 0838462a58a0..d5e389b03d3d 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/InvokeAzNetworkCloudClusterContinueVersionUpdate_ContinueExpanded.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/InvokeAzNetworkCloudClusterContinueVersionUpdate_ContinueExpanded.cs @@ -6,22 +6,25 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// - /// Trigger the continuation of an update for a cluster with a matching update strategy that has paused after completing a - /// segment of the update. + /// Trigger the continuation of an continue for a cluster with a matching continue strategy that has paused after completing + /// a segment of the continue /// /// /// [OpenAPI] ContinueUpdateVersion=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/continueUpdateVersion" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Invoke, @"AzNetworkCloudClusterContinueVersionUpdate_ContinueExpanded", SupportsShouldProcess = true)] [global::System.Management.Automation.OutputType(typeof(bool))] - [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Trigger the continuation of an update for a cluster with a matching update strategy that has paused after completing a segment of the update.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Trigger the continuation of an continue for a cluster with a matching continue strategy that has paused after completing a segment of the continue ")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/continueUpdateVersion", ApiVersion = "2025-02-01")] public partial class InvokeAzNetworkCloudClusterContinueVersionUpdate_ContinueExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -40,7 +43,10 @@ public partial class InvokeAzNetworkCloudClusterContinueVersionUpdate_ContinueEx /// /// ClusterContinueUpdateVersionParameters represents the body of the request to continue the update of a cluster version. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterContinueUpdateVersionParameters _clusterContinueUpdateVersionParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ClusterContinueUpdateVersionParameters(); + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterContinueUpdateVersionParameters _clusterContinueUpdateVersionParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterContinueUpdateVersionParameters(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] @@ -52,6 +58,9 @@ public partial class InvokeAzNetworkCloudClusterContinueVersionUpdate_ContinueEx [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -79,6 +88,9 @@ public partial class InvokeAzNetworkCloudClusterContinueVersionUpdate_ContinueEx [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,9 +116,9 @@ public partial class InvokeAzNetworkCloudClusterContinueVersionUpdate_ContinueEx ReadOnly = false, Description = @"The mode by which the cluster will target the next grouping of servers to continue the update.", SerializedName = @"machineGroupTargetingMode", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterContinueUpdateVersionMachineGroupTargetingMode) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterContinueUpdateVersionMachineGroupTargetingMode))] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterContinueUpdateVersionMachineGroupTargetingMode MachineGroupTargetingMode { get => _clusterContinueUpdateVersionParametersBody.MachineGroupTargetingMode ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterContinueUpdateVersionMachineGroupTargetingMode)""); set => _clusterContinueUpdateVersionParametersBody.MachineGroupTargetingMode = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("AlphaByRack")] + public string MachineGroupTargetingMode { get => _clusterContinueUpdateVersionParametersBody.MachineGroupTargetingMode ?? null; set => _clusterContinueUpdateVersionParametersBody.MachineGroupTargetingMode = value; } /// /// cancellation delegate. Stops the cmdlet when called. @@ -134,7 +146,7 @@ public partial class InvokeAzNetworkCloudClusterContinueVersionUpdate_ContinueEx /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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")] @@ -180,7 +192,8 @@ public partial class InvokeAzNetworkCloudClusterContinueVersionUpdate_ContinueEx [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -189,12 +202,12 @@ public partial class InvokeAzNetworkCloudClusterContinueVersionUpdate_ContinueEx /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 @@ -274,7 +287,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet + /// Initializes a new instance of the cmdlet /// class. /// public InvokeAzNetworkCloudClusterContinueVersionUpdate_ContinueExpanded() @@ -326,11 +339,36 @@ public InvokeAzNetworkCloudClusterContinueVersionUpdate_ContinueExpanded() 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.NetworkCloud.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -342,10 +380,26 @@ public InvokeAzNetworkCloudClusterContinueVersionUpdate_ContinueExpanded() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -413,7 +467,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -431,7 +485,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,ClusterName=ClusterName,body=_clusterContinueUpdateVersionParametersBody}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,ClusterName=ClusterName}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -469,12 +523,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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ) { @@ -491,15 +545,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.NetworkCloud.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, ClusterName=ClusterName, body=_clusterContinueUpdateVersionParametersBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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, ClusterName=ClusterName, body=_clusterContinueUpdateVersionParametersBody }) + 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 } }); @@ -524,7 +578,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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/InvokeAzNetworkCloudClusterContinueVersionUpdate_ContinueViaIdentity.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/InvokeAzNetworkCloudClusterContinueVersionUpdate_ContinueViaIdentity.cs index eb9c31ed4ae2..8c0c8fd5f33a 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/InvokeAzNetworkCloudClusterContinueVersionUpdate_ContinueViaIdentity.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/InvokeAzNetworkCloudClusterContinueVersionUpdate_ContinueViaIdentity.cs @@ -6,22 +6,25 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// - /// Trigger the continuation of an update for a cluster with a matching update strategy that has paused after completing a - /// segment of the update. + /// Trigger the continuation of an continue for a cluster with a matching continue strategy that has paused after completing + /// a segment of the continue /// /// /// [OpenAPI] ContinueUpdateVersion=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/continueUpdateVersion" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Invoke, @"AzNetworkCloudClusterContinueVersionUpdate_ContinueViaIdentity", SupportsShouldProcess = true)] [global::System.Management.Automation.OutputType(typeof(bool))] - [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Trigger the continuation of an update for a cluster with a matching update strategy that has paused after completing a segment of the update.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Trigger the continuation of an continue for a cluster with a matching continue strategy that has paused after completing a segment of the continue ")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/continueUpdateVersion", ApiVersion = "2025-02-01")] public partial class InvokeAzNetworkCloudClusterContinueVersionUpdate_ContinueViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -37,6 +40,9 @@ public partial class InvokeAzNetworkCloudClusterContinueVersionUpdate_ContinueVi /// 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(); + /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] @@ -47,13 +53,16 @@ public partial class InvokeAzNetworkCloudClusterContinueVersionUpdate_ContinueVi [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; /// /// Backing field for property. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterContinueUpdateVersionParameters _clusterContinueUpdateVersionParameter; + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterContinueUpdateVersionParameters _clusterContinueUpdateVersionParameter; /// /// ClusterContinueUpdateVersionParameters represents the body of the request to continue the update of a cluster version. @@ -64,8 +73,9 @@ public partial class InvokeAzNetworkCloudClusterContinueVersionUpdate_ContinueVi ReadOnly = false, Description = @"ClusterContinueUpdateVersionParameters represents the body of the request to continue the update of a cluster version.", SerializedName = @"clusterContinueUpdateVersionParameters", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterContinueUpdateVersionParameters) })] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterContinueUpdateVersionParameters ClusterContinueUpdateVersionParameter { get => this._clusterContinueUpdateVersionParameter; set => this._clusterContinueUpdateVersionParameter = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterContinueUpdateVersionParameters) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Body)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterContinueUpdateVersionParameters ClusterContinueUpdateVersionParameter { get => this._clusterContinueUpdateVersionParameter; set => this._clusterContinueUpdateVersionParameter = value; } /// /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet @@ -77,6 +87,9 @@ public partial class InvokeAzNetworkCloudClusterContinueVersionUpdate_ContinueVi [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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] @@ -126,7 +139,7 @@ public partial class InvokeAzNetworkCloudClusterContinueVersionUpdate_ContinueVi /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 +162,12 @@ public partial class InvokeAzNetworkCloudClusterContinueVersionUpdate_ContinueVi /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 @@ -231,8 +244,8 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet - /// class. + /// Initializes a new instance of the + /// cmdlet class. /// public InvokeAzNetworkCloudClusterContinueVersionUpdate_ContinueViaIdentity() { @@ -283,11 +296,36 @@ public InvokeAzNetworkCloudClusterContinueVersionUpdate_ContinueViaIdentity() 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.NetworkCloud.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -299,10 +337,26 @@ public InvokeAzNetworkCloudClusterContinueVersionUpdate_ContinueViaIdentity() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -370,7 +424,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -408,7 +462,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=ClusterContinueUpdateVersionParameter}) + 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 } }); @@ -446,12 +500,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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ) { @@ -468,15 +522,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.NetworkCloud.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=ClusterContinueUpdateVersionParameter }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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=ClusterContinueUpdateVersionParameter }) + 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 } }); @@ -501,7 +555,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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/InvokeAzNetworkCloudClusterContinueVersionUpdate_ContinueViaIdentityExpanded.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/InvokeAzNetworkCloudClusterContinueVersionUpdate_ContinueViaIdentityExpanded.cs index 166b20b8320a..154d001e0148 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/InvokeAzNetworkCloudClusterContinueVersionUpdate_ContinueViaIdentityExpanded.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/InvokeAzNetworkCloudClusterContinueVersionUpdate_ContinueViaIdentityExpanded.cs @@ -6,22 +6,25 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// - /// Trigger the continuation of an update for a cluster with a matching update strategy that has paused after completing a - /// segment of the update. + /// Trigger the continuation of an continue for a cluster with a matching continue strategy that has paused after completing + /// a segment of the continue /// /// /// [OpenAPI] ContinueUpdateVersion=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/continueUpdateVersion" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Invoke, @"AzNetworkCloudClusterContinueVersionUpdate_ContinueViaIdentityExpanded", SupportsShouldProcess = true)] [global::System.Management.Automation.OutputType(typeof(bool))] - [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Trigger the continuation of an update for a cluster with a matching update strategy that has paused after completing a segment of the update.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Trigger the continuation of an continue for a cluster with a matching continue strategy that has paused after completing a segment of the continue ")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/continueUpdateVersion", ApiVersion = "2025-02-01")] public partial class InvokeAzNetworkCloudClusterContinueVersionUpdate_ContinueViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -40,7 +43,10 @@ public partial class InvokeAzNetworkCloudClusterContinueVersionUpdate_ContinueVi /// /// ClusterContinueUpdateVersionParameters represents the body of the request to continue the update of a cluster version. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterContinueUpdateVersionParameters _clusterContinueUpdateVersionParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ClusterContinueUpdateVersionParameters(); + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterContinueUpdateVersionParameters _clusterContinueUpdateVersionParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterContinueUpdateVersionParameters(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] @@ -52,6 +58,9 @@ public partial class InvokeAzNetworkCloudClusterContinueVersionUpdate_ContinueVi [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -65,6 +74,9 @@ public partial class InvokeAzNetworkCloudClusterContinueVersionUpdate_ContinueVi [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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] @@ -98,9 +110,9 @@ public partial class InvokeAzNetworkCloudClusterContinueVersionUpdate_ContinueVi ReadOnly = false, Description = @"The mode by which the cluster will target the next grouping of servers to continue the update.", SerializedName = @"machineGroupTargetingMode", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterContinueUpdateVersionMachineGroupTargetingMode) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterContinueUpdateVersionMachineGroupTargetingMode))] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterContinueUpdateVersionMachineGroupTargetingMode MachineGroupTargetingMode { get => _clusterContinueUpdateVersionParametersBody.MachineGroupTargetingMode ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterContinueUpdateVersionMachineGroupTargetingMode)""); set => _clusterContinueUpdateVersionParametersBody.MachineGroupTargetingMode = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("AlphaByRack")] + public string MachineGroupTargetingMode { get => _clusterContinueUpdateVersionParametersBody.MachineGroupTargetingMode ?? null; set => _clusterContinueUpdateVersionParametersBody.MachineGroupTargetingMode = value; } /// /// cancellation delegate. Stops the cmdlet when called. @@ -128,7 +140,7 @@ public partial class InvokeAzNetworkCloudClusterContinueVersionUpdate_ContinueVi /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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")] @@ -151,12 +163,12 @@ public partial class InvokeAzNetworkCloudClusterContinueVersionUpdate_ContinueVi /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 @@ -233,7 +245,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. /// public InvokeAzNetworkCloudClusterContinueVersionUpdate_ContinueViaIdentityExpanded() @@ -285,11 +297,36 @@ public InvokeAzNetworkCloudClusterContinueVersionUpdate_ContinueViaIdentityExpan 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.NetworkCloud.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -301,10 +338,26 @@ public InvokeAzNetworkCloudClusterContinueVersionUpdate_ContinueViaIdentityExpan return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -372,7 +425,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -410,7 +463,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_clusterContinueUpdateVersionParametersBody}) + 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 } }); @@ -448,12 +501,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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ) { @@ -470,15 +523,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.NetworkCloud.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_clusterContinueUpdateVersionParametersBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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=_clusterContinueUpdateVersionParametersBody }) + 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 } }); @@ -503,7 +556,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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/InvokeAzNetworkCloudClusterContinueVersionUpdate_ContinueViaJsonFilePath.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/InvokeAzNetworkCloudClusterContinueVersionUpdate_ContinueViaJsonFilePath.cs new file mode 100644 index 000000000000..50aab9de7532 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/InvokeAzNetworkCloudClusterContinueVersionUpdate_ContinueViaJsonFilePath.cs @@ -0,0 +1,585 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; + using System; + + /// + /// Trigger the continuation of an continue for a cluster with a matching continue strategy that has paused after completing + /// a segment of the continue + /// + /// + /// [OpenAPI] ContinueUpdateVersion=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/continueUpdateVersion" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Invoke, @"AzNetworkCloudClusterContinueVersionUpdate_ContinueViaJsonFilePath", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Trigger the continuation of an continue for a cluster with a matching continue strategy that has paused after completing a segment of the continue ")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/continueUpdateVersion", ApiVersion = "2025-02-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.NotSuggestDefaultParameterSet] + public partial class InvokeAzNetworkCloudClusterContinueVersionUpdate_ContinueViaJsonFilePath : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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(); + + public global::System.String _jsonString; + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; + + /// Backing field for property. + private string _clusterName; + + /// The name of the cluster. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the cluster.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the cluster.", + SerializedName = @"clusterName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] + public string ClusterName { get => this._clusterName; set => this._clusterName = 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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 Continue operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Path of Json file supplied to the Continue operation")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Path of Json file supplied to the Continue 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.NetworkCloud.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// 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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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. The value must be an UUID. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription. The value must be an UUID.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription. The value must be an UUID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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. + /// /// 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.NetworkCloud.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of InvokeAzNetworkCloudClusterContinueVersionUpdate_ContinueViaJsonFilePath + /// + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets.InvokeAzNetworkCloudClusterContinueVersionUpdate_ContinueViaJsonFilePath Clone() + { + var clone = new InvokeAzNetworkCloudClusterContinueVersionUpdate_ContinueViaJsonFilePath(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.ClusterName = this.ClusterName; + clone.JsonFilePath = this.JsonFilePath; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 InvokeAzNetworkCloudClusterContinueVersionUpdate_ContinueViaJsonFilePath() + { + + } + + /// 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.NetworkCloud.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.NetworkCloud.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ClustersContinueUpdateVersion' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ClustersContinueUpdateVersionViaJsonString(SubscriptionId, ResourceGroupName, ClusterName, _jsonString, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,ClusterName=ClusterName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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. + /// + /// 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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/InvokeAzNetworkCloudClusterContinueVersionUpdate_ContinueViaJsonString.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/InvokeAzNetworkCloudClusterContinueVersionUpdate_ContinueViaJsonString.cs new file mode 100644 index 000000000000..65e338b1bb4b --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/InvokeAzNetworkCloudClusterContinueVersionUpdate_ContinueViaJsonString.cs @@ -0,0 +1,583 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; + using System; + + /// + /// Trigger the continuation of an continue for a cluster with a matching continue strategy that has paused after completing + /// a segment of the continue + /// + /// + /// [OpenAPI] ContinueUpdateVersion=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/continueUpdateVersion" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Invoke, @"AzNetworkCloudClusterContinueVersionUpdate_ContinueViaJsonString", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Trigger the continuation of an continue for a cluster with a matching continue strategy that has paused after completing a segment of the continue ")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/continueUpdateVersion", ApiVersion = "2025-02-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.NotSuggestDefaultParameterSet] + public partial class InvokeAzNetworkCloudClusterContinueVersionUpdate_ContinueViaJsonString : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; + + /// Backing field for property. + private string _clusterName; + + /// The name of the cluster. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the cluster.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the cluster.", + SerializedName = @"clusterName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] + public string ClusterName { get => this._clusterName; set => this._clusterName = 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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 Continue operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Json string supplied to the Continue operation")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Json string supplied to the Continue 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.NetworkCloud.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// 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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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. The value must be an UUID. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription. The value must be an UUID.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription. The value must be an UUID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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. + /// /// 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.NetworkCloud.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of InvokeAzNetworkCloudClusterContinueVersionUpdate_ContinueViaJsonString + /// + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets.InvokeAzNetworkCloudClusterContinueVersionUpdate_ContinueViaJsonString Clone() + { + var clone = new InvokeAzNetworkCloudClusterContinueVersionUpdate_ContinueViaJsonString(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.ClusterName = this.ClusterName; + clone.JsonString = this.JsonString; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 InvokeAzNetworkCloudClusterContinueVersionUpdate_ContinueViaJsonString() + { + + } + + /// 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.NetworkCloud.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.NetworkCloud.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ClustersContinueUpdateVersion' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ClustersContinueUpdateVersionViaJsonString(SubscriptionId, ResourceGroupName, ClusterName, _jsonString, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,ClusterName=ClusterName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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. + /// + /// 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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/InvokeAzNetworkCloudClusterVersionUpdate_UpdateExpanded.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/InvokeAzNetworkCloudClusterVersionUpdate_UpdateExpanded.cs index 02fc8a656968..a4e45f18df68 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/InvokeAzNetworkCloudClusterVersionUpdate_UpdateExpanded.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/InvokeAzNetworkCloudClusterVersionUpdate_UpdateExpanded.cs @@ -6,21 +6,24 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// - /// Update the version of the provided cluster to one of the available supported versions. + /// update the version of the provided cluster to one of the available supported versions. /// /// /// [OpenAPI] UpdateVersion=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/updateVersion" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Invoke, @"AzNetworkCloudClusterVersionUpdate_UpdateExpanded", SupportsShouldProcess = true)] [global::System.Management.Automation.OutputType(typeof(bool))] - [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Update the version of the provided cluster to one of the available supported versions.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"update the version of the provided cluster to one of the available supported versions.")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/updateVersion", ApiVersion = "2025-02-01")] public partial class InvokeAzNetworkCloudClusterVersionUpdate_UpdateExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -39,7 +42,10 @@ public partial class InvokeAzNetworkCloudClusterVersionUpdate_UpdateExpanded : g /// /// ClusterUpdateVersionParameters represents the body of the request to update cluster version. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterUpdateVersionParameters _clusterUpdateVersionParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ClusterUpdateVersionParameters(); + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterUpdateVersionParameters _clusterUpdateVersionParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterUpdateVersionParameters(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] @@ -51,6 +57,9 @@ public partial class InvokeAzNetworkCloudClusterVersionUpdate_UpdateExpanded : g [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -78,6 +87,9 @@ public partial class InvokeAzNetworkCloudClusterVersionUpdate_UpdateExpanded : g [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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] @@ -119,7 +131,7 @@ public partial class InvokeAzNetworkCloudClusterVersionUpdate_UpdateExpanded : g /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 +177,8 @@ public partial class InvokeAzNetworkCloudClusterVersionUpdate_UpdateExpanded : g [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -185,12 +198,12 @@ public partial class InvokeAzNetworkCloudClusterVersionUpdate_UpdateExpanded : 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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 @@ -268,7 +281,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public InvokeAzNetworkCloudClusterVersionUpdate_UpdateExpanded() { @@ -319,11 +332,36 @@ public InvokeAzNetworkCloudClusterVersionUpdate_UpdateExpanded() 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.NetworkCloud.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -335,10 +373,26 @@ public InvokeAzNetworkCloudClusterVersionUpdate_UpdateExpanded() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -406,7 +460,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -424,7 +478,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,ClusterName=ClusterName,body=_clusterUpdateVersionParametersBody}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,ClusterName=ClusterName}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -462,12 +516,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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ) { @@ -484,15 +538,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.NetworkCloud.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, ClusterName=ClusterName, body=_clusterUpdateVersionParametersBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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, ClusterName=ClusterName, body=_clusterUpdateVersionParametersBody }) + 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 } }); @@ -517,7 +571,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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/InvokeAzNetworkCloudClusterVersionUpdate_UpdateViaIdentityExpanded.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/InvokeAzNetworkCloudClusterVersionUpdate_UpdateViaIdentityExpanded.cs index c4016b9565fb..b6db27249292 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/InvokeAzNetworkCloudClusterVersionUpdate_UpdateViaIdentityExpanded.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/InvokeAzNetworkCloudClusterVersionUpdate_UpdateViaIdentityExpanded.cs @@ -6,21 +6,24 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// - /// Update the version of the provided cluster to one of the available supported versions. + /// update the version of the provided cluster to one of the available supported versions. /// /// /// [OpenAPI] UpdateVersion=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/updateVersion" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Invoke, @"AzNetworkCloudClusterVersionUpdate_UpdateViaIdentityExpanded", SupportsShouldProcess = true)] [global::System.Management.Automation.OutputType(typeof(bool))] - [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Update the version of the provided cluster to one of the available supported versions.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"update the version of the provided cluster to one of the available supported versions.")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/updateVersion", ApiVersion = "2025-02-01")] public partial class InvokeAzNetworkCloudClusterVersionUpdate_UpdateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -39,7 +42,10 @@ public partial class InvokeAzNetworkCloudClusterVersionUpdate_UpdateViaIdentityE /// /// ClusterUpdateVersionParameters represents the body of the request to update cluster version. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterUpdateVersionParameters _clusterUpdateVersionParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ClusterUpdateVersionParameters(); + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterUpdateVersionParameters _clusterUpdateVersionParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterUpdateVersionParameters(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] @@ -51,6 +57,9 @@ public partial class InvokeAzNetworkCloudClusterVersionUpdate_UpdateViaIdentityE [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -64,6 +73,9 @@ public partial class InvokeAzNetworkCloudClusterVersionUpdate_UpdateViaIdentityE [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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] @@ -113,7 +125,7 @@ public partial class InvokeAzNetworkCloudClusterVersionUpdate_UpdateViaIdentityE /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,12 +159,12 @@ public partial class InvokeAzNetworkCloudClusterVersionUpdate_UpdateViaIdentityE /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 @@ -229,7 +241,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet + /// Initializes a new instance of the cmdlet /// class. /// public InvokeAzNetworkCloudClusterVersionUpdate_UpdateViaIdentityExpanded() @@ -281,11 +293,36 @@ public InvokeAzNetworkCloudClusterVersionUpdate_UpdateViaIdentityExpanded() 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.NetworkCloud.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -297,10 +334,26 @@ public InvokeAzNetworkCloudClusterVersionUpdate_UpdateViaIdentityExpanded() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -368,7 +421,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -406,7 +459,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_clusterUpdateVersionParametersBody}) + 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 } }); @@ -444,12 +497,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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ) { @@ -466,15 +519,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.NetworkCloud.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_clusterUpdateVersionParametersBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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=_clusterUpdateVersionParametersBody }) + 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 } }); @@ -499,7 +552,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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/InvokeAzNetworkCloudClusterVersionUpdate_UpdateViaJsonFilePath.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/InvokeAzNetworkCloudClusterVersionUpdate_UpdateViaJsonFilePath.cs new file mode 100644 index 000000000000..85e0a4c43652 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/InvokeAzNetworkCloudClusterVersionUpdate_UpdateViaJsonFilePath.cs @@ -0,0 +1,584 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; + using System; + + /// + /// update the version of the provided cluster to one of the available supported versions. + /// + /// + /// [OpenAPI] UpdateVersion=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/updateVersion" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Invoke, @"AzNetworkCloudClusterVersionUpdate_UpdateViaJsonFilePath", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"update the version of the provided cluster to one of the available supported versions.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/updateVersion", ApiVersion = "2025-02-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.NotSuggestDefaultParameterSet] + public partial class InvokeAzNetworkCloudClusterVersionUpdate_UpdateViaJsonFilePath : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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(); + + public global::System.String _jsonString; + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; + + /// Backing field for property. + private string _clusterName; + + /// The name of the cluster. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the cluster.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the cluster.", + SerializedName = @"clusterName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] + public string ClusterName { get => this._clusterName; set => this._clusterName = 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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// 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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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. The value must be an UUID. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription. The value must be an UUID.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription. The value must be an UUID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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. + /// /// 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.NetworkCloud.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of InvokeAzNetworkCloudClusterVersionUpdate_UpdateViaJsonFilePath + /// + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets.InvokeAzNetworkCloudClusterVersionUpdate_UpdateViaJsonFilePath Clone() + { + var clone = new InvokeAzNetworkCloudClusterVersionUpdate_UpdateViaJsonFilePath(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.ClusterName = this.ClusterName; + clone.JsonFilePath = this.JsonFilePath; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 InvokeAzNetworkCloudClusterVersionUpdate_UpdateViaJsonFilePath() + { + + } + + /// 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.NetworkCloud.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.NetworkCloud.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ClustersUpdateVersion' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ClustersUpdateVersionViaJsonString(SubscriptionId, ResourceGroupName, ClusterName, _jsonString, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,ClusterName=ClusterName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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. + /// + /// 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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/InvokeAzNetworkCloudClusterVersionUpdate_UpdateViaJsonString.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/InvokeAzNetworkCloudClusterVersionUpdate_UpdateViaJsonString.cs new file mode 100644 index 000000000000..cb4924013902 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/InvokeAzNetworkCloudClusterVersionUpdate_UpdateViaJsonString.cs @@ -0,0 +1,581 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; + using System; + + /// + /// update the version of the provided cluster to one of the available supported versions. + /// + /// + /// [OpenAPI] UpdateVersion=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/updateVersion" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Invoke, @"AzNetworkCloudClusterVersionUpdate_UpdateViaJsonString", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"update the version of the provided cluster to one of the available supported versions.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/updateVersion", ApiVersion = "2025-02-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.NotSuggestDefaultParameterSet] + public partial class InvokeAzNetworkCloudClusterVersionUpdate_UpdateViaJsonString : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; + + /// Backing field for property. + private string _clusterName; + + /// The name of the cluster. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the cluster.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the cluster.", + SerializedName = @"clusterName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] + public string ClusterName { get => this._clusterName; set => this._clusterName = 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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// 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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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. The value must be an UUID. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription. The value must be an UUID.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription. The value must be an UUID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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. + /// /// 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.NetworkCloud.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of InvokeAzNetworkCloudClusterVersionUpdate_UpdateViaJsonString + /// + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets.InvokeAzNetworkCloudClusterVersionUpdate_UpdateViaJsonString Clone() + { + var clone = new InvokeAzNetworkCloudClusterVersionUpdate_UpdateViaJsonString(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.ClusterName = this.ClusterName; + clone.JsonString = this.JsonString; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 InvokeAzNetworkCloudClusterVersionUpdate_UpdateViaJsonString() + { + + } + + /// 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.NetworkCloud.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.NetworkCloud.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ClustersUpdateVersion' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ClustersUpdateVersionViaJsonString(SubscriptionId, ResourceGroupName, ClusterName, _jsonString, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,ClusterName=ClusterName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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. + /// + /// 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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/InvokeAzNetworkCloudScanClusterRuntime_Scan.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/InvokeAzNetworkCloudScanClusterRuntime_Scan.cs index 44e3fc514a7a..847b2e790315 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/InvokeAzNetworkCloudScanClusterRuntime_Scan.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/InvokeAzNetworkCloudScanClusterRuntime_Scan.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// @@ -21,7 +23,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/scanRuntime", ApiVersion = "2025-02-01")] public partial class InvokeAzNetworkCloudScanClusterRuntime_Scan : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -37,6 +40,9 @@ public partial class InvokeAzNetworkCloudScanClusterRuntime_Scan : 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(); + /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] @@ -47,6 +53,9 @@ public partial class InvokeAzNetworkCloudScanClusterRuntime_Scan : global::Syste [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -65,7 +74,7 @@ public partial class InvokeAzNetworkCloudScanClusterRuntime_Scan : global::Syste public string ClusterName { get => this._clusterName; set => this._clusterName = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterScanRuntimeParameters _clusterScanRuntimeParameter; + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterScanRuntimeParameters _clusterScanRuntimeParameter; /// /// ClusterScanRuntimeParameters defines the parameters for the cluster scan runtime operation. @@ -76,8 +85,9 @@ public partial class InvokeAzNetworkCloudScanClusterRuntime_Scan : global::Syste ReadOnly = false, Description = @"ClusterScanRuntimeParameters defines the parameters for the cluster scan runtime operation.", SerializedName = @"clusterScanRuntimeParameters", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterScanRuntimeParameters) })] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterScanRuntimeParameters ClusterScanRuntimeParameter { get => this._clusterScanRuntimeParameter; set => this._clusterScanRuntimeParameter = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterScanRuntimeParameters) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Body)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterScanRuntimeParameters ClusterScanRuntimeParameter { get => this._clusterScanRuntimeParameter; set => this._clusterScanRuntimeParameter = value; } /// /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet @@ -89,6 +99,9 @@ public partial class InvokeAzNetworkCloudScanClusterRuntime_Scan : global::Syste [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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] @@ -130,7 +143,7 @@ public partial class InvokeAzNetworkCloudScanClusterRuntime_Scan : global::Syste /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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")] @@ -176,7 +189,8 @@ public partial class InvokeAzNetworkCloudScanClusterRuntime_Scan : global::Syste [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -185,12 +199,12 @@ public partial class InvokeAzNetworkCloudScanClusterRuntime_Scan : 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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 @@ -268,7 +282,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public InvokeAzNetworkCloudScanClusterRuntime_Scan() { @@ -319,11 +333,36 @@ public InvokeAzNetworkCloudScanClusterRuntime_Scan() 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.NetworkCloud.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -335,10 +374,26 @@ public InvokeAzNetworkCloudScanClusterRuntime_Scan() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -406,7 +461,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -424,7 +479,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,ClusterName=ClusterName,body=ClusterScanRuntimeParameter}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,ClusterName=ClusterName}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -462,12 +517,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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ) { @@ -484,15 +539,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.NetworkCloud.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, ClusterName=ClusterName, body=ClusterScanRuntimeParameter }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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, ClusterName=ClusterName, body=ClusterScanRuntimeParameter }) + 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 } }); @@ -517,7 +572,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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/InvokeAzNetworkCloudScanClusterRuntime_ScanExpanded.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/InvokeAzNetworkCloudScanClusterRuntime_ScanExpanded.cs index 0c221d3ee578..1bd433361613 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/InvokeAzNetworkCloudScanClusterRuntime_ScanExpanded.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/InvokeAzNetworkCloudScanClusterRuntime_ScanExpanded.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// @@ -21,7 +23,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/scanRuntime", ApiVersion = "2025-02-01")] public partial class InvokeAzNetworkCloudScanClusterRuntime_ScanExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -40,7 +43,10 @@ public partial class InvokeAzNetworkCloudScanClusterRuntime_ScanExpanded : globa /// /// ClusterScanRuntimeParameters defines the parameters for the cluster scan runtime operation. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterScanRuntimeParameters _clusterScanRuntimeParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ClusterScanRuntimeParameters(); + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterScanRuntimeParameters _clusterScanRuntimeParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterScanRuntimeParameters(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] @@ -52,6 +58,9 @@ public partial class InvokeAzNetworkCloudScanClusterRuntime_ScanExpanded : globa [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -79,6 +88,9 @@ public partial class InvokeAzNetworkCloudScanClusterRuntime_ScanExpanded : globa [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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] @@ -120,7 +132,7 @@ public partial class InvokeAzNetworkCloudScanClusterRuntime_ScanExpanded : globa /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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")] @@ -160,9 +172,9 @@ public partial class InvokeAzNetworkCloudScanClusterRuntime_ScanExpanded : globa ReadOnly = false, Description = @"The choice of if the scan operation should run the scan.", SerializedName = @"scanActivity", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterScanRuntimeParametersScanActivity) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterScanRuntimeParametersScanActivity))] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterScanRuntimeParametersScanActivity ScanActivity { get => _clusterScanRuntimeParametersBody.ScanActivity ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterScanRuntimeParametersScanActivity)""); set => _clusterScanRuntimeParametersBody.ScanActivity = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Scan", "Skip")] + public string ScanActivity { get => _clusterScanRuntimeParametersBody.ScanActivity ?? null; set => _clusterScanRuntimeParametersBody.ScanActivity = value; } /// Backing field for property. private string _subscriptionId; @@ -178,7 +190,8 @@ public partial class InvokeAzNetworkCloudScanClusterRuntime_ScanExpanded : globa [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -187,12 +200,12 @@ public partial class InvokeAzNetworkCloudScanClusterRuntime_ScanExpanded : 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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 @@ -270,7 +283,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public InvokeAzNetworkCloudScanClusterRuntime_ScanExpanded() { @@ -321,11 +334,36 @@ public InvokeAzNetworkCloudScanClusterRuntime_ScanExpanded() 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.NetworkCloud.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -337,10 +375,26 @@ public InvokeAzNetworkCloudScanClusterRuntime_ScanExpanded() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -408,7 +462,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -426,7 +480,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,ClusterName=ClusterName,body=_clusterScanRuntimeParametersBody}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,ClusterName=ClusterName}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -464,12 +518,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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ) { @@ -486,15 +540,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.NetworkCloud.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, ClusterName=ClusterName, body=_clusterScanRuntimeParametersBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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, ClusterName=ClusterName, body=_clusterScanRuntimeParametersBody }) + 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 } }); @@ -519,7 +573,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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/InvokeAzNetworkCloudScanClusterRuntime_ScanViaIdentity.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/InvokeAzNetworkCloudScanClusterRuntime_ScanViaIdentity.cs index 5de55576753e..fe73db7ba2c9 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/InvokeAzNetworkCloudScanClusterRuntime_ScanViaIdentity.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/InvokeAzNetworkCloudScanClusterRuntime_ScanViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// @@ -21,7 +23,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/scanRuntime", ApiVersion = "2025-02-01")] public partial class InvokeAzNetworkCloudScanClusterRuntime_ScanViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -37,6 +40,9 @@ public partial class InvokeAzNetworkCloudScanClusterRuntime_ScanViaIdentity : 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(); + /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] @@ -47,11 +53,14 @@ public partial class InvokeAzNetworkCloudScanClusterRuntime_ScanViaIdentity : gl [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterScanRuntimeParameters _clusterScanRuntimeParameter; + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterScanRuntimeParameters _clusterScanRuntimeParameter; /// /// ClusterScanRuntimeParameters defines the parameters for the cluster scan runtime operation. @@ -62,8 +71,9 @@ public partial class InvokeAzNetworkCloudScanClusterRuntime_ScanViaIdentity : gl ReadOnly = false, Description = @"ClusterScanRuntimeParameters defines the parameters for the cluster scan runtime operation.", SerializedName = @"clusterScanRuntimeParameters", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterScanRuntimeParameters) })] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterScanRuntimeParameters ClusterScanRuntimeParameter { get => this._clusterScanRuntimeParameter; set => this._clusterScanRuntimeParameter = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterScanRuntimeParameters) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Body)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterScanRuntimeParameters ClusterScanRuntimeParameter { get => this._clusterScanRuntimeParameter; set => this._clusterScanRuntimeParameter = value; } /// /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet @@ -75,6 +85,9 @@ public partial class InvokeAzNetworkCloudScanClusterRuntime_ScanViaIdentity : gl [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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] @@ -124,7 +137,7 @@ public partial class InvokeAzNetworkCloudScanClusterRuntime_ScanViaIdentity : gl /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,12 +160,12 @@ public partial class InvokeAzNetworkCloudScanClusterRuntime_ScanViaIdentity : 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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 @@ -227,7 +240,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public InvokeAzNetworkCloudScanClusterRuntime_ScanViaIdentity() { @@ -278,11 +291,36 @@ public InvokeAzNetworkCloudScanClusterRuntime_ScanViaIdentity() 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.NetworkCloud.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -294,10 +332,26 @@ public InvokeAzNetworkCloudScanClusterRuntime_ScanViaIdentity() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -365,7 +419,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -403,7 +457,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=ClusterScanRuntimeParameter}) + 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 } }); @@ -441,12 +495,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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ) { @@ -463,15 +517,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.NetworkCloud.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=ClusterScanRuntimeParameter }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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=ClusterScanRuntimeParameter }) + 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 } }); @@ -496,7 +550,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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/InvokeAzNetworkCloudScanClusterRuntime_ScanViaIdentityExpanded.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/InvokeAzNetworkCloudScanClusterRuntime_ScanViaIdentityExpanded.cs index 12ff72d33945..039cb1bd3475 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/InvokeAzNetworkCloudScanClusterRuntime_ScanViaIdentityExpanded.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/InvokeAzNetworkCloudScanClusterRuntime_ScanViaIdentityExpanded.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// @@ -21,7 +23,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/scanRuntime", ApiVersion = "2025-02-01")] public partial class InvokeAzNetworkCloudScanClusterRuntime_ScanViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -40,7 +43,10 @@ public partial class InvokeAzNetworkCloudScanClusterRuntime_ScanViaIdentityExpan /// /// ClusterScanRuntimeParameters defines the parameters for the cluster scan runtime operation. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterScanRuntimeParameters _clusterScanRuntimeParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ClusterScanRuntimeParameters(); + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterScanRuntimeParameters _clusterScanRuntimeParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterScanRuntimeParameters(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] @@ -52,6 +58,9 @@ public partial class InvokeAzNetworkCloudScanClusterRuntime_ScanViaIdentityExpan [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -65,6 +74,9 @@ public partial class InvokeAzNetworkCloudScanClusterRuntime_ScanViaIdentityExpan [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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] @@ -114,7 +126,7 @@ public partial class InvokeAzNetworkCloudScanClusterRuntime_ScanViaIdentityExpan /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,21 +152,21 @@ public partial class InvokeAzNetworkCloudScanClusterRuntime_ScanViaIdentityExpan ReadOnly = false, Description = @"The choice of if the scan operation should run the scan.", SerializedName = @"scanActivity", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterScanRuntimeParametersScanActivity) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterScanRuntimeParametersScanActivity))] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterScanRuntimeParametersScanActivity ScanActivity { get => _clusterScanRuntimeParametersBody.ScanActivity ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterScanRuntimeParametersScanActivity)""); set => _clusterScanRuntimeParametersBody.ScanActivity = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Scan", "Skip")] + public string ScanActivity { get => _clusterScanRuntimeParametersBody.ScanActivity ?? null; set => _clusterScanRuntimeParametersBody.ScanActivity = 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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 @@ -231,7 +243,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet + /// Initializes a new instance of the cmdlet /// class. /// public InvokeAzNetworkCloudScanClusterRuntime_ScanViaIdentityExpanded() @@ -283,11 +295,36 @@ public InvokeAzNetworkCloudScanClusterRuntime_ScanViaIdentityExpanded() 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.NetworkCloud.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -299,10 +336,26 @@ public InvokeAzNetworkCloudScanClusterRuntime_ScanViaIdentityExpanded() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -370,7 +423,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -408,7 +461,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_clusterScanRuntimeParametersBody}) + 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 } }); @@ -446,12 +499,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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ) { @@ -468,15 +521,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.NetworkCloud.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_clusterScanRuntimeParametersBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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=_clusterScanRuntimeParametersBody }) + 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 } }); @@ -501,7 +554,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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/InvokeAzNetworkCloudScanClusterRuntime_ScanViaJsonFilePath.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/InvokeAzNetworkCloudScanClusterRuntime_ScanViaJsonFilePath.cs new file mode 100644 index 000000000000..726668aaf098 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/InvokeAzNetworkCloudScanClusterRuntime_ScanViaJsonFilePath.cs @@ -0,0 +1,584 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; + using System; + + /// + /// Triggers the execution of a runtime protection scan to detect and remediate detected issues, in accordance with the cluster + /// configuration. + /// + /// + /// [OpenAPI] ScanRuntime=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/scanRuntime" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Invoke, @"AzNetworkCloudScanClusterRuntime_ScanViaJsonFilePath", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Triggers the execution of a runtime protection scan to detect and remediate detected issues, in accordance with the cluster configuration.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/scanRuntime", ApiVersion = "2025-02-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.NotSuggestDefaultParameterSet] + public partial class InvokeAzNetworkCloudScanClusterRuntime_ScanViaJsonFilePath : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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(); + + public global::System.String _jsonString; + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; + + /// Backing field for property. + private string _clusterName; + + /// The name of the cluster. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the cluster.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the cluster.", + SerializedName = @"clusterName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] + public string ClusterName { get => this._clusterName; set => this._clusterName = 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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 Scan operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Path of Json file supplied to the Scan operation")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Path of Json file supplied to the Scan 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.NetworkCloud.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// 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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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. The value must be an UUID. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription. The value must be an UUID.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription. The value must be an UUID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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. + /// /// 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.NetworkCloud.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of InvokeAzNetworkCloudScanClusterRuntime_ScanViaJsonFilePath + /// + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets.InvokeAzNetworkCloudScanClusterRuntime_ScanViaJsonFilePath Clone() + { + var clone = new InvokeAzNetworkCloudScanClusterRuntime_ScanViaJsonFilePath(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.ClusterName = this.ClusterName; + clone.JsonFilePath = this.JsonFilePath; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 InvokeAzNetworkCloudScanClusterRuntime_ScanViaJsonFilePath() + { + + } + + /// 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.NetworkCloud.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.NetworkCloud.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ClustersScanRuntime' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ClustersScanRuntimeViaJsonString(SubscriptionId, ResourceGroupName, ClusterName, _jsonString, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,ClusterName=ClusterName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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. + /// + /// 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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/InvokeAzNetworkCloudScanClusterRuntime_ScanViaJsonString.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/InvokeAzNetworkCloudScanClusterRuntime_ScanViaJsonString.cs new file mode 100644 index 000000000000..04564241ac24 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/InvokeAzNetworkCloudScanClusterRuntime_ScanViaJsonString.cs @@ -0,0 +1,582 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; + using System; + + /// + /// Triggers the execution of a runtime protection scan to detect and remediate detected issues, in accordance with the cluster + /// configuration. + /// + /// + /// [OpenAPI] ScanRuntime=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/scanRuntime" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Invoke, @"AzNetworkCloudScanClusterRuntime_ScanViaJsonString", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Triggers the execution of a runtime protection scan to detect and remediate detected issues, in accordance with the cluster configuration.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/scanRuntime", ApiVersion = "2025-02-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.NotSuggestDefaultParameterSet] + public partial class InvokeAzNetworkCloudScanClusterRuntime_ScanViaJsonString : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; + + /// Backing field for property. + private string _clusterName; + + /// The name of the cluster. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the cluster.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the cluster.", + SerializedName = @"clusterName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] + public string ClusterName { get => this._clusterName; set => this._clusterName = 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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 Scan operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Json string supplied to the Scan operation")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Json string supplied to the Scan 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.NetworkCloud.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// 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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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. The value must be an UUID. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription. The value must be an UUID.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription. The value must be an UUID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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. + /// /// 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.NetworkCloud.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of InvokeAzNetworkCloudScanClusterRuntime_ScanViaJsonString + /// + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets.InvokeAzNetworkCloudScanClusterRuntime_ScanViaJsonString Clone() + { + var clone = new InvokeAzNetworkCloudScanClusterRuntime_ScanViaJsonString(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.ClusterName = this.ClusterName; + clone.JsonString = this.JsonString; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 InvokeAzNetworkCloudScanClusterRuntime_ScanViaJsonString() + { + + } + + /// 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.NetworkCloud.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.NetworkCloud.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ClustersScanRuntime' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ClustersScanRuntimeViaJsonString(SubscriptionId, ResourceGroupName, ClusterName, _jsonString, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,ClusterName=ClusterName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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. + /// + /// 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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/InvokeAzNetworkCloudVirtualMachineReimage_Reimage.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/InvokeAzNetworkCloudVirtualMachineReimage_Reimage.cs index 8956715bb7eb..94ab3e716a00 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/InvokeAzNetworkCloudVirtualMachineReimage_Reimage.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/InvokeAzNetworkCloudVirtualMachineReimage_Reimage.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// Reimage the provided virtual machine. @@ -18,7 +20,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/virtualMachines/{virtualMachineName}/reimage", ApiVersion = "2025-02-01")] public partial class InvokeAzNetworkCloudVirtualMachineReimage_Reimage : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,6 +37,9 @@ public partial class InvokeAzNetworkCloudVirtualMachineReimage_Reimage : 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(); + /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] @@ -44,6 +50,9 @@ public partial class InvokeAzNetworkCloudVirtualMachineReimage_Reimage : global: [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -57,6 +66,9 @@ public partial class InvokeAzNetworkCloudVirtualMachineReimage_Reimage : global: [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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] @@ -113,7 +125,7 @@ public partial class InvokeAzNetworkCloudVirtualMachineReimage_Reimage : global: /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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")] @@ -159,7 +171,8 @@ public partial class InvokeAzNetworkCloudVirtualMachineReimage_Reimage : global: [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -168,12 +181,12 @@ public partial class InvokeAzNetworkCloudVirtualMachineReimage_Reimage : 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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 @@ -250,7 +263,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public InvokeAzNetworkCloudVirtualMachineReimage_Reimage() { @@ -301,11 +314,36 @@ public InvokeAzNetworkCloudVirtualMachineReimage_Reimage() 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.NetworkCloud.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -317,10 +355,26 @@ public InvokeAzNetworkCloudVirtualMachineReimage_Reimage() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -388,7 +442,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -406,7 +460,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 } }); @@ -444,12 +498,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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ) { @@ -466,15 +520,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.NetworkCloud.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.NetworkCloud.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 } }); @@ -499,7 +553,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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/InvokeAzNetworkCloudVirtualMachineReimage_ReimageViaIdentity.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/InvokeAzNetworkCloudVirtualMachineReimage_ReimageViaIdentity.cs index 4aabc71cfbcc..b4554145b3dc 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/InvokeAzNetworkCloudVirtualMachineReimage_ReimageViaIdentity.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/InvokeAzNetworkCloudVirtualMachineReimage_ReimageViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// Reimage the provided virtual machine. @@ -18,7 +20,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/virtualMachines/{virtualMachineName}/reimage", ApiVersion = "2025-02-01")] public partial class InvokeAzNetworkCloudVirtualMachineReimage_ReimageViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,6 +37,9 @@ public partial class InvokeAzNetworkCloudVirtualMachineReimage_ReimageViaIdentit /// 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(); + /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] @@ -44,6 +50,9 @@ public partial class InvokeAzNetworkCloudVirtualMachineReimage_ReimageViaIdentit [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -57,6 +66,9 @@ public partial class InvokeAzNetworkCloudVirtualMachineReimage_ReimageViaIdentit [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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] @@ -106,7 +118,7 @@ public partial class InvokeAzNetworkCloudVirtualMachineReimage_ReimageViaIdentit /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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")] @@ -129,12 +141,12 @@ public partial class InvokeAzNetworkCloudVirtualMachineReimage_ReimageViaIdentit /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 @@ -210,7 +222,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public InvokeAzNetworkCloudVirtualMachineReimage_ReimageViaIdentity() { @@ -261,11 +273,36 @@ public InvokeAzNetworkCloudVirtualMachineReimage_ReimageViaIdentity() 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.NetworkCloud.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -277,10 +314,26 @@ public InvokeAzNetworkCloudVirtualMachineReimage_ReimageViaIdentity() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -348,7 +401,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -386,7 +439,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 } }); @@ -424,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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ) { @@ -446,7 +499,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.NetworkCloud.Runtime.RestException(responseMessage, await response); + var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 } @@ -479,7 +532,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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/NewAzNetworkCloudAgentPool_CreateExpanded.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/NewAzNetworkCloudAgentPool_CreateExpanded.cs index c69a722787dc..f3650e3207b5 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/NewAzNetworkCloudAgentPool_CreateExpanded.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/NewAzNetworkCloudAgentPool_CreateExpanded.cs @@ -6,22 +6,24 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// - /// Create a new Kubernetes cluster agent pool or update the properties of the existing one. + /// create a new Kubernetes cluster agent pool or create the properties of the existing one. /// /// /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/kubernetesClusters/{kubernetesClusterName}/agentPools/{agentPoolName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzNetworkCloudAgentPool_CreateExpanded", SupportsShouldProcess = true)] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPool", "15.0.0", "2.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"AdministratorConfigurationSshPublicKey","AttachedNetworkConfigurationL2Network","AttachedNetworkConfigurationL3Network","AttachedNetworkConfigurationTrunkedNetwork","AvailabilityZone","Label","Taint"}, NewOutputProperties=new string[] {"AdministratorConfigurationSshPublicKey","AttachedNetworkConfigurationL2Network","AttachedNetworkConfigurationL3Network","AttachedNetworkConfigurationTrunkedNetwork","AvailabilityZone","Label","Taint"}, ChangeDescription="The types of properties will be changed from fixed array to 'List'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPool))] - [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Create a new Kubernetes cluster agent pool or update the properties of the existing one.")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"create a new Kubernetes cluster agent pool or create the properties of the existing one.")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/kubernetesClusters/{kubernetesClusterName}/agentPools/{agentPoolName}", ApiVersion = "2025-02-01")] public partial class NewAzNetworkCloudAgentPool_CreateExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -33,13 +35,16 @@ public partial class NewAzNetworkCloudAgentPool_CreateExpanded : global::System. private string __processRecordId; /// AgentPool represents the agent pool of Kubernetes cluster. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPool _agentPoolParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AgentPool(); + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPool _agentPoolParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AgentPool(); /// /// 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(); + /// /// The user name for the administrator that will be applied to the operating systems that run Kubernetes nodes. If not supplied, /// a user name will be chosen by the service. @@ -66,8 +71,8 @@ public partial class NewAzNetworkCloudAgentPool_CreateExpanded : global::System. ReadOnly = false, Description = @"The SSH configuration for the operating systems that run the nodes in the Kubernetes cluster. In some cases, specification of public keys may be required to produce a working environment.", SerializedName = @"sshPublicKeys", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey) })] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey[] AdministratorConfigurationSshPublicKey { get => _agentPoolParametersBody.AdministratorConfigurationSshPublicKey ?? null /* arrayOf */; set => _agentPoolParametersBody.AdministratorConfigurationSshPublicKey = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISshPublicKey) })] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISshPublicKey[] AdministratorConfigurationSshPublicKey { get => _agentPoolParametersBody.AdministratorConfigurationSshPublicKey?.ToArray() ?? null /* fixedArrayOf */; set => _agentPoolParametersBody.AdministratorConfigurationSshPublicKey = (value != null ? new System.Collections.Generic.List(value) : null); } /// The number of hugepages to allocate. [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The number of hugepages to allocate.")] @@ -88,9 +93,9 @@ public partial class NewAzNetworkCloudAgentPool_CreateExpanded : global::System. ReadOnly = false, Description = @"The size of the hugepages to allocate.", SerializedName = @"hugepagesSize", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HugepagesSize) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HugepagesSize))] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HugepagesSize AgentOptionHugepagesSize { get => _agentPoolParametersBody.AgentOptionHugepagesSize ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HugepagesSize)""); set => _agentPoolParametersBody.AgentOptionHugepagesSize = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("2M", "1G")] + public string AgentOptionHugepagesSize { get => _agentPoolParametersBody.AgentOptionHugepagesSize ?? null; set => _agentPoolParametersBody.AgentOptionHugepagesSize = value; } /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] @@ -106,8 +111,8 @@ public partial class NewAzNetworkCloudAgentPool_CreateExpanded : global::System. ReadOnly = false, Description = @"The list of Layer 2 Networks and related configuration for attachment.", SerializedName = @"l2Networks", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkAttachmentConfiguration) })] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkAttachmentConfiguration[] AttachedNetworkConfigurationL2Network { get => _agentPoolParametersBody.AttachedNetworkConfigurationL2Network ?? null /* arrayOf */; set => _agentPoolParametersBody.AttachedNetworkConfigurationL2Network = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkAttachmentConfiguration) })] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkAttachmentConfiguration[] AttachedNetworkConfigurationL2Network { get => _agentPoolParametersBody.AttachedNetworkConfigurationL2Network?.ToArray() ?? null /* fixedArrayOf */; set => _agentPoolParametersBody.AttachedNetworkConfigurationL2Network = (value != null ? new System.Collections.Generic.List(value) : null); } /// The list of Layer 3 Networks and related configuration for attachment. [global::System.Management.Automation.AllowEmptyCollection] @@ -118,8 +123,8 @@ public partial class NewAzNetworkCloudAgentPool_CreateExpanded : global::System. ReadOnly = false, Description = @"The list of Layer 3 Networks and related configuration for attachment.", SerializedName = @"l3Networks", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkAttachmentConfiguration) })] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkAttachmentConfiguration[] AttachedNetworkConfigurationL3Network { get => _agentPoolParametersBody.AttachedNetworkConfigurationL3Network ?? null /* arrayOf */; set => _agentPoolParametersBody.AttachedNetworkConfigurationL3Network = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkAttachmentConfiguration) })] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkAttachmentConfiguration[] AttachedNetworkConfigurationL3Network { get => _agentPoolParametersBody.AttachedNetworkConfigurationL3Network?.ToArray() ?? null /* fixedArrayOf */; set => _agentPoolParametersBody.AttachedNetworkConfigurationL3Network = (value != null ? new System.Collections.Generic.List(value) : null); } /// The list of Trunked Networks and related configuration for attachment. [global::System.Management.Automation.AllowEmptyCollection] @@ -130,8 +135,8 @@ public partial class NewAzNetworkCloudAgentPool_CreateExpanded : global::System. ReadOnly = false, Description = @"The list of Trunked Networks and related configuration for attachment.", SerializedName = @"trunkedNetworks", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkAttachmentConfiguration) })] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkAttachmentConfiguration[] AttachedNetworkConfigurationTrunkedNetwork { get => _agentPoolParametersBody.AttachedNetworkConfigurationTrunkedNetwork ?? null /* arrayOf */; set => _agentPoolParametersBody.AttachedNetworkConfigurationTrunkedNetwork = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkAttachmentConfiguration) })] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkAttachmentConfiguration[] AttachedNetworkConfigurationTrunkedNetwork { get => _agentPoolParametersBody.AttachedNetworkConfigurationTrunkedNetwork?.ToArray() ?? null /* fixedArrayOf */; set => _agentPoolParametersBody.AttachedNetworkConfigurationTrunkedNetwork = (value != null ? new System.Collections.Generic.List(value) : null); } /// /// The list of availability zones of the Network Cloud cluster used for the provisioning of nodes in this agent pool. If @@ -146,13 +151,16 @@ public partial class NewAzNetworkCloudAgentPool_CreateExpanded : global::System. Description = @"The list of availability zones of the Network Cloud cluster used for the provisioning of nodes in this agent pool. If not specified, all availability zones will be used.", SerializedName = @"availabilityZones", PossibleTypes = new [] { typeof(string) })] - public string[] AvailabilityZone { get => _agentPoolParametersBody.AvailabilityZone ?? null /* arrayOf */; set => _agentPoolParametersBody.AvailabilityZone = value; } + public string[] AvailabilityZone { get => _agentPoolParametersBody.AvailabilityZone?.ToArray() ?? null /* fixedArrayOf */; set => _agentPoolParametersBody.AvailabilityZone = (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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -199,6 +207,9 @@ public partial class NewAzNetworkCloudAgentPool_CreateExpanded : global::System. PossibleTypes = new [] { typeof(string) })] public string ExtendedLocationType { get => _agentPoolParametersBody.ExtendedLocationType ?? null; set => _agentPoolParametersBody.ExtendedLocationType = 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] @@ -271,8 +282,8 @@ public partial class NewAzNetworkCloudAgentPool_CreateExpanded : global::System. ReadOnly = false, Description = @"The labels applied to the nodes in this agent pool.", SerializedName = @"labels", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesLabel) })] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesLabel[] Label { get => _agentPoolParametersBody.Label ?? null /* arrayOf */; set => _agentPoolParametersBody.Label = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesLabel) })] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesLabel[] Label { get => _agentPoolParametersBody.Label?.ToArray() ?? null /* fixedArrayOf */; set => _agentPoolParametersBody.Label = (value != null ? new System.Collections.Generic.List(value) : null); } /// The geo-location where the resource lives [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The geo-location where the resource lives")] @@ -305,9 +316,9 @@ public partial class NewAzNetworkCloudAgentPool_CreateExpanded : global::System. ReadOnly = false, Description = @"The selection of how this agent pool is utilized, either as a system pool or a user pool. System pools run the features and critical services for the Kubernetes Cluster, while user pools are dedicated to user workloads. Every Kubernetes cluster must contain at least one system node pool with at least one node.", SerializedName = @"mode", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.AgentPoolMode) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.AgentPoolMode))] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.AgentPoolMode Mode { get => _agentPoolParametersBody.Mode; set => _agentPoolParametersBody.Mode = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("System", "User", "NotApplicable")] + public string Mode { get => _agentPoolParametersBody.Mode ?? null; set => _agentPoolParametersBody.Mode = value; } /// Backing field for property. private string _name; @@ -335,7 +346,7 @@ public partial class NewAzNetworkCloudAgentPool_CreateExpanded : global::System. /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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")] @@ -381,7 +392,8 @@ public partial class NewAzNetworkCloudAgentPool_CreateExpanded : global::System. [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -394,8 +406,8 @@ public partial class NewAzNetworkCloudAgentPool_CreateExpanded : global::System. ReadOnly = false, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceTags) })] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceTags Tag { get => _agentPoolParametersBody.Tag ?? null /* object */; set => _agentPoolParametersBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceTags Tag { get => _agentPoolParametersBody.Tag ?? null /* object */; set => _agentPoolParametersBody.Tag = value; } /// The taints applied to the nodes in this agent pool. [global::System.Management.Automation.AllowEmptyCollection] @@ -406,8 +418,8 @@ public partial class NewAzNetworkCloudAgentPool_CreateExpanded : global::System. ReadOnly = false, Description = @"The taints applied to the nodes in this agent pool.", SerializedName = @"taints", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesLabel) })] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesLabel[] Taint { get => _agentPoolParametersBody.Taint ?? null /* arrayOf */; set => _agentPoolParametersBody.Taint = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesLabel) })] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesLabel[] Taint { get => _agentPoolParametersBody.Taint?.ToArray() ?? null /* fixedArrayOf */; set => _agentPoolParametersBody.Taint = (value != null ? new System.Collections.Generic.List(value) : null); } /// /// The maximum time in seconds that is allowed for a node drain to complete before proceeding with the upgrade of the agent @@ -473,24 +485,24 @@ public partial class NewAzNetworkCloudAgentPool_CreateExpanded : 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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IAgentPool + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPool /// 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) @@ -604,11 +616,36 @@ 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.NetworkCloud.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -620,10 +657,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -633,7 +686,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public NewAzNetworkCloudAgentPool_CreateExpanded() { @@ -699,7 +752,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -712,12 +765,12 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.AgentPoolsCreateOrUpdate(SubscriptionId, ResourceGroupName, KubernetesClusterName, Name, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _agentPoolParametersBody, onOk, onDefault, this, Pipeline); + await this.Client.AgentPoolsCreateOrUpdate(SubscriptionId, ResourceGroupName, KubernetesClusterName, Name, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _agentPoolParametersBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate); await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,KubernetesClusterName=KubernetesClusterName,Name=Name,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null,body=_agentPoolParametersBody}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,KubernetesClusterName=KubernetesClusterName,Name=Name,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -755,12 +808,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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ) { @@ -777,15 +830,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.NetworkCloud.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, KubernetesClusterName=KubernetesClusterName, Name=Name, IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, body=_agentPoolParametersBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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, KubernetesClusterName=KubernetesClusterName, Name=Name, IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, body=_agentPoolParametersBody }) + 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 } }); @@ -795,12 +848,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.NetworkCloud.Models.Api20250201.IAgentPool + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPool /// 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 ) { @@ -812,8 +865,9 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPool - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPool + var result = (await response); + WriteObject(result, false); } } } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/NewAzNetworkCloudAgentPool_CreateViaIdentityKubernetesClusterExpanded.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/NewAzNetworkCloudAgentPool_CreateViaIdentityKubernetesClusterExpanded.cs new file mode 100644 index 000000000000..3519065a0e8a --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/NewAzNetworkCloudAgentPool_CreateViaIdentityKubernetesClusterExpanded.cs @@ -0,0 +1,856 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; + using System; + + /// + /// create a new Kubernetes cluster agent pool or create the properties of the existing one. + /// + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/kubernetesClusters/{kubernetesClusterName}/agentPools/{agentPoolName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzNetworkCloudAgentPool_CreateViaIdentityKubernetesClusterExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"create a new Kubernetes cluster agent pool or create the properties of the existing one.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/kubernetesClusters/{kubernetesClusterName}/agentPools/{agentPoolName}", ApiVersion = "2025-02-01")] + public partial class NewAzNetworkCloudAgentPool_CreateViaIdentityKubernetesClusterExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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; + + /// AgentPool represents the agent pool of Kubernetes cluster. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPool _agentPoolParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AgentPool(); + + /// + /// 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(); + + /// + /// The user name for the administrator that will be applied to the operating systems that run Kubernetes nodes. If not supplied, + /// a user name will be chosen by the service. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The user name for the administrator that will be applied to the operating systems that run Kubernetes nodes. If not supplied, a user name will be chosen by the service.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The user name for the administrator that will be applied to the operating systems that run Kubernetes nodes. If not supplied, a user name will be chosen by the service.", + SerializedName = @"adminUsername", + PossibleTypes = new [] { typeof(string) })] + public string AdministratorConfigurationAdminUsername { get => _agentPoolParametersBody.AdministratorConfigurationAdminUsername ?? null; set => _agentPoolParametersBody.AdministratorConfigurationAdminUsername = value; } + + /// + /// The SSH configuration for the operating systems that run the nodes in the Kubernetes cluster. In some cases, specification + /// of public keys may be required to produce a working environment. + /// + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The SSH configuration for the operating systems that run the nodes in the Kubernetes cluster. In some cases, specification of public keys may be required to produce a working environment.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The SSH configuration for the operating systems that run the nodes in the Kubernetes cluster. In some cases, specification of public keys may be required to produce a working environment.", + SerializedName = @"sshPublicKeys", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISshPublicKey) })] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISshPublicKey[] AdministratorConfigurationSshPublicKey { get => _agentPoolParametersBody.AdministratorConfigurationSshPublicKey?.ToArray() ?? null /* fixedArrayOf */; set => _agentPoolParametersBody.AdministratorConfigurationSshPublicKey = (value != null ? new System.Collections.Generic.List(value) : null); } + + /// The number of hugepages to allocate. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The number of hugepages to allocate.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The number of hugepages to allocate.", + SerializedName = @"hugepagesCount", + PossibleTypes = new [] { typeof(long) })] + public long AgentOptionHugepagesCount { get => _agentPoolParametersBody.AgentOptionHugepagesCount ?? default(long); set => _agentPoolParametersBody.AgentOptionHugepagesCount = value; } + + /// The size of the hugepages to allocate. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The size of the hugepages to allocate.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The size of the hugepages to allocate.", + SerializedName = @"hugepagesSize", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("2M", "1G")] + public string AgentOptionHugepagesSize { get => _agentPoolParametersBody.AgentOptionHugepagesSize ?? null; set => _agentPoolParametersBody.AgentOptionHugepagesSize = value; } + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// The list of Layer 2 Networks and related configuration for attachment. + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The list of Layer 2 Networks and related configuration for attachment.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The list of Layer 2 Networks and related configuration for attachment.", + SerializedName = @"l2Networks", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkAttachmentConfiguration) })] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkAttachmentConfiguration[] AttachedNetworkConfigurationL2Network { get => _agentPoolParametersBody.AttachedNetworkConfigurationL2Network?.ToArray() ?? null /* fixedArrayOf */; set => _agentPoolParametersBody.AttachedNetworkConfigurationL2Network = (value != null ? new System.Collections.Generic.List(value) : null); } + + /// The list of Layer 3 Networks and related configuration for attachment. + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The list of Layer 3 Networks and related configuration for attachment.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The list of Layer 3 Networks and related configuration for attachment.", + SerializedName = @"l3Networks", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkAttachmentConfiguration) })] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkAttachmentConfiguration[] AttachedNetworkConfigurationL3Network { get => _agentPoolParametersBody.AttachedNetworkConfigurationL3Network?.ToArray() ?? null /* fixedArrayOf */; set => _agentPoolParametersBody.AttachedNetworkConfigurationL3Network = (value != null ? new System.Collections.Generic.List(value) : null); } + + /// The list of Trunked Networks and related configuration for attachment. + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The list of Trunked Networks and related configuration for attachment.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The list of Trunked Networks and related configuration for attachment.", + SerializedName = @"trunkedNetworks", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkAttachmentConfiguration) })] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkAttachmentConfiguration[] AttachedNetworkConfigurationTrunkedNetwork { get => _agentPoolParametersBody.AttachedNetworkConfigurationTrunkedNetwork?.ToArray() ?? null /* fixedArrayOf */; set => _agentPoolParametersBody.AttachedNetworkConfigurationTrunkedNetwork = (value != null ? new System.Collections.Generic.List(value) : null); } + + /// + /// The list of availability zones of the Network Cloud cluster used for the provisioning of nodes in this agent pool. If + /// not specified, all availability zones will be used. + /// + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The list of availability zones of the Network Cloud cluster used for the provisioning of nodes in this agent pool. If not specified, all availability zones will be used.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The list of availability zones of the Network Cloud cluster used for the provisioning of nodes in this agent pool. If not specified, all availability zones will be used.", + SerializedName = @"availabilityZones", + PossibleTypes = new [] { typeof(string) })] + public string[] AvailabilityZone { get => _agentPoolParametersBody.AvailabilityZone?.ToArray() ?? null /* fixedArrayOf */; set => _agentPoolParametersBody.AvailabilityZone = (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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; + + /// The number of virtual machines that use this configuration. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The number of virtual machines that use this configuration.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The number of virtual machines that use this configuration.", + SerializedName = @"count", + PossibleTypes = new [] { typeof(long) })] + public long Count { get => _agentPoolParametersBody.Count; set => _agentPoolParametersBody.Count = 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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// The resource ID of the extended location on which the resource will be created. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The resource ID of the extended location on which the resource will be created.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The resource ID of the extended location on which the resource will be created.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + public string ExtendedLocationName { get => _agentPoolParametersBody.ExtendedLocationName ?? null; set => _agentPoolParametersBody.ExtendedLocationName = value; } + + /// The extended location type, for example, CustomLocation. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The extended location type, for example, CustomLocation.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The extended location type, for example, CustomLocation.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + public string ExtendedLocationType { get => _agentPoolParametersBody.ExtendedLocationType ?? null; set => _agentPoolParametersBody.ExtendedLocationType = 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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private string _ifMatch; + + /// + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value + /// to prevent accidentally overwriting concurrent changes. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes.", + SerializedName = @"If-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Header)] + public string IfMatch { get => this._ifMatch; set => this._ifMatch = value; } + + /// Backing field for property. + private string _ifNoneMatch; + + /// + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result + /// in error from server as they are not supported. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result in error from server as they are not supported.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result in error from server as they are not supported.", + SerializedName = @"If-None-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Header)] + public string IfNoneMatch { get => this._ifNoneMatch; set => this._ifNoneMatch = 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 Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity _kubernetesClusterInputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity KubernetesClusterInputObject { get => this._kubernetesClusterInputObject; set => this._kubernetesClusterInputObject = value; } + + /// The labels applied to the nodes in this agent pool. + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The labels applied to the nodes in this agent pool.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The labels applied to the nodes in this agent pool.", + SerializedName = @"labels", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesLabel) })] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesLabel[] Label { get => _agentPoolParametersBody.Label?.ToArray() ?? null /* fixedArrayOf */; set => _agentPoolParametersBody.Label = (value != null ? new System.Collections.Generic.List(value) : null); } + + /// The geo-location where the resource lives + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The geo-location where the resource lives")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The geo-location where the resource lives", + SerializedName = @"location", + PossibleTypes = new [] { typeof(string) })] + public string Location { get => _agentPoolParametersBody.Location ?? null; set => _agentPoolParametersBody.Location = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The selection of how this agent pool is utilized, either as a system pool or a user pool. System pools run the features + /// and critical services for the Kubernetes Cluster, while user pools are dedicated to user workloads. Every Kubernetes cluster + /// must contain at least one system node pool with at least one node. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The selection of how this agent pool is utilized, either as a system pool or a user pool. System pools run the features and critical services for the Kubernetes Cluster, while user pools are dedicated to user workloads. Every Kubernetes cluster must contain at least one system node pool with at least one node.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The selection of how this agent pool is utilized, either as a system pool or a user pool. System pools run the features and critical services for the Kubernetes Cluster, while user pools are dedicated to user workloads. Every Kubernetes cluster must contain at least one system node pool with at least one node.", + SerializedName = @"mode", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("System", "User", "NotApplicable")] + public string Mode { get => _agentPoolParametersBody.Mode ?? null; set => _agentPoolParametersBody.Mode = value; } + + /// Backing field for property. + private string _name; + + /// The name of the Kubernetes cluster agent pool. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the Kubernetes cluster agent pool.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the Kubernetes cluster agent pool.", + SerializedName = @"agentPoolName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("AgentPoolName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Resource tags. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ExportAs(typeof(global::System.Collections.Hashtable))] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Resource tags.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Resource tags.", + SerializedName = @"tags", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceTags Tag { get => _agentPoolParametersBody.Tag ?? null /* object */; set => _agentPoolParametersBody.Tag = value; } + + /// The taints applied to the nodes in this agent pool. + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The taints applied to the nodes in this agent pool.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The taints applied to the nodes in this agent pool.", + SerializedName = @"taints", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesLabel) })] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesLabel[] Taint { get => _agentPoolParametersBody.Taint?.ToArray() ?? null /* fixedArrayOf */; set => _agentPoolParametersBody.Taint = (value != null ? new System.Collections.Generic.List(value) : null); } + + /// + /// The maximum time in seconds that is allowed for a node drain to complete before proceeding with the upgrade of the agent + /// pool. If not specified during creation, a value of 1800 seconds is used. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The maximum time in seconds that is allowed for a node drain to complete before proceeding with the upgrade of the agent pool. If not specified during creation, a value of 1800 seconds is used.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The maximum time in seconds that is allowed for a node drain to complete before proceeding with the upgrade of the agent pool. If not specified during creation, a value of 1800 seconds is used.", + SerializedName = @"drainTimeout", + PossibleTypes = new [] { typeof(long) })] + public long UpgradeSettingDrainTimeout { get => _agentPoolParametersBody.UpgradeSettingDrainTimeout ?? default(long); set => _agentPoolParametersBody.UpgradeSettingDrainTimeout = value; } + + /// + /// The maximum number or percentage of nodes that are surged during upgrade. This can either be set to an integer (e.g. '5') + /// or a percentage (e.g. '50%'). If a percentage is specified, it is the percentage of the total agent pool size at the time + /// of the upgrade. For percentages, fractional nodes are rounded up. If not specified during creation, a value of 1 is used. + /// One of MaxSurge and MaxUnavailable must be greater than 0. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The maximum number or percentage of nodes that are surged during upgrade. This can either be set to an integer (e.g. '5') or a percentage (e.g. '50%'). If a percentage is specified, it is the percentage of the total agent pool size at the time of the upgrade. For percentages, fractional nodes are rounded up. If not specified during creation, a value of 1 is used. One of MaxSurge and MaxUnavailable must be greater than 0.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The maximum number or percentage of nodes that are surged during upgrade. This can either be set to an integer (e.g. '5') or a percentage (e.g. '50%'). If a percentage is specified, it is the percentage of the total agent pool size at the time of the upgrade. For percentages, fractional nodes are rounded up. If not specified during creation, a value of 1 is used. One of MaxSurge and MaxUnavailable must be greater than 0.", + SerializedName = @"maxSurge", + PossibleTypes = new [] { typeof(string) })] + public string UpgradeSettingMaxSurge { get => _agentPoolParametersBody.UpgradeSettingMaxSurge ?? null; set => _agentPoolParametersBody.UpgradeSettingMaxSurge = value; } + + /// + /// The maximum number or percentage of nodes that can be unavailable during upgrade. This can either be set to an integer + /// (e.g. '5') or a percentage (e.g. '50%'). If a percentage is specified, it is the percentage of the total agent pool size + /// at the time of the upgrade. For percentages, fractional nodes are rounded up. If not specified during creation, a value + /// of 0 is used. One of MaxSurge and MaxUnavailable must be greater than 0. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The maximum number or percentage of nodes that can be unavailable during upgrade. This can either be set to an integer (e.g. '5') or a percentage (e.g. '50%'). If a percentage is specified, it is the percentage of the total agent pool size at the time of the upgrade. For percentages, fractional nodes are rounded up. If not specified during creation, a value of 0 is used. One of MaxSurge and MaxUnavailable must be greater than 0.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The maximum number or percentage of nodes that can be unavailable during upgrade. This can either be set to an integer (e.g. '5') or a percentage (e.g. '50%'). If a percentage is specified, it is the percentage of the total agent pool size at the time of the upgrade. For percentages, fractional nodes are rounded up. If not specified during creation, a value of 0 is used. One of MaxSurge and MaxUnavailable must be greater than 0.", + SerializedName = @"maxUnavailable", + PossibleTypes = new [] { typeof(string) })] + public string UpgradeSettingMaxUnavailable { get => _agentPoolParametersBody.UpgradeSettingMaxUnavailable ?? null; set => _agentPoolParametersBody.UpgradeSettingMaxUnavailable = value; } + + /// + /// The name of the VM SKU that determines the size of resources allocated for node VMs. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the VM SKU that determines the size of resources allocated for node VMs.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the VM SKU that determines the size of resources allocated for node VMs.", + SerializedName = @"vmSkuName", + PossibleTypes = new [] { typeof(string) })] + public string VMSkuName { get => _agentPoolParametersBody.VMSkuName ?? null; set => _agentPoolParametersBody.VMSkuName = 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.NetworkCloud.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.NetworkCloud.Models.IAgentPool + /// 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.NetworkCloud.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of NewAzNetworkCloudAgentPool_CreateViaIdentityKubernetesClusterExpanded + /// + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets.NewAzNetworkCloudAgentPool_CreateViaIdentityKubernetesClusterExpanded Clone() + { + var clone = new NewAzNetworkCloudAgentPool_CreateViaIdentityKubernetesClusterExpanded(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone._agentPoolParametersBody = this._agentPoolParametersBody; + clone.IfMatch = this.IfMatch; + clone.IfNoneMatch = this.IfNoneMatch; + clone.Name = this.Name; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 NewAzNetworkCloudAgentPool_CreateViaIdentityKubernetesClusterExpanded() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'AgentPoolsCreateOrUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (KubernetesClusterInputObject?.Id != null) + { + this.KubernetesClusterInputObject.Id += $"/agentPools/{(global::System.Uri.EscapeDataString(this.Name.ToString()))}"; + await this.Client.AgentPoolsCreateOrUpdateViaIdentity(KubernetesClusterInputObject.Id, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _agentPoolParametersBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate); + } + else + { + // try to call with PATH parameters from Input Object + if (null == KubernetesClusterInputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("KubernetesClusterInputObject has null value for KubernetesClusterInputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, KubernetesClusterInputObject) ); + } + if (null == KubernetesClusterInputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("KubernetesClusterInputObject has null value for KubernetesClusterInputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, KubernetesClusterInputObject) ); + } + if (null == KubernetesClusterInputObject.KubernetesClusterName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("KubernetesClusterInputObject has null value for KubernetesClusterInputObject.KubernetesClusterName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, KubernetesClusterInputObject) ); + } + await this.Client.AgentPoolsCreateOrUpdate(KubernetesClusterInputObject.SubscriptionId ?? null, KubernetesClusterInputObject.ResourceGroupName ?? null, KubernetesClusterInputObject.KubernetesClusterName ?? null, Name, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _agentPoolParametersBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Name=Name,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.IAgentPool + /// 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.NetworkCloud.Models.IAgentPool + var result = (await response); + WriteObject(result, false); + } + } + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/NewAzNetworkCloudAgentPool_CreateViaJsonFilePath.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/NewAzNetworkCloudAgentPool_CreateViaJsonFilePath.cs new file mode 100644 index 000000000000..c2c63db9e990 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/NewAzNetworkCloudAgentPool_CreateViaJsonFilePath.cs @@ -0,0 +1,629 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; + using System; + + /// + /// create a new Kubernetes cluster agent pool or create the properties of the existing one. + /// + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/kubernetesClusters/{kubernetesClusterName}/agentPools/{agentPoolName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzNetworkCloudAgentPool_CreateViaJsonFilePath", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"create a new Kubernetes cluster agent pool or create the properties of the existing one.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/kubernetesClusters/{kubernetesClusterName}/agentPools/{agentPoolName}", ApiVersion = "2025-02-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.NotSuggestDefaultParameterSet] + public partial class NewAzNetworkCloudAgentPool_CreateViaJsonFilePath : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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(); + + public global::System.String _jsonString; + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private string _ifMatch; + + /// + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value + /// to prevent accidentally overwriting concurrent changes. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes.", + SerializedName = @"If-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Header)] + public string IfMatch { get => this._ifMatch; set => this._ifMatch = value; } + + /// Backing field for property. + private string _ifNoneMatch; + + /// + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result + /// in error from server as they are not supported. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result in error from server as they are not supported.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result in error from server as they are not supported.", + SerializedName = @"If-None-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Header)] + public string IfNoneMatch { get => this._ifNoneMatch; set => this._ifNoneMatch = 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 _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.NetworkCloud.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 _kubernetesClusterName; + + /// The name of the Kubernetes cluster. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the Kubernetes cluster.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the Kubernetes cluster.", + SerializedName = @"kubernetesClusterName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] + public string KubernetesClusterName { get => this._kubernetesClusterName; set => this._kubernetesClusterName = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of the Kubernetes cluster agent pool. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the Kubernetes cluster agent pool.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the Kubernetes cluster agent pool.", + SerializedName = @"agentPoolName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("AgentPoolName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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. The value must be an UUID. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription. The value must be an UUID.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription. The value must be an UUID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.IAgentPool + /// 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.NetworkCloud.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of NewAzNetworkCloudAgentPool_CreateViaJsonFilePath + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets.NewAzNetworkCloudAgentPool_CreateViaJsonFilePath Clone() + { + var clone = new NewAzNetworkCloudAgentPool_CreateViaJsonFilePath(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.KubernetesClusterName = this.KubernetesClusterName; + clone.Name = this.Name; + clone.IfMatch = this.IfMatch; + clone.IfNoneMatch = this.IfNoneMatch; + clone.JsonFilePath = this.JsonFilePath; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 NewAzNetworkCloudAgentPool_CreateViaJsonFilePath() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'AgentPoolsCreateOrUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.AgentPoolsCreateOrUpdateViaJsonString(SubscriptionId, ResourceGroupName, KubernetesClusterName, Name, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _jsonString, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,KubernetesClusterName=KubernetesClusterName,Name=Name,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.IAgentPool + /// 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.NetworkCloud.Models.IAgentPool + var result = (await response); + WriteObject(result, false); + } + } + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/NewAzNetworkCloudAgentPool_CreateViaJsonString.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/NewAzNetworkCloudAgentPool_CreateViaJsonString.cs new file mode 100644 index 000000000000..fa12047688f6 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/NewAzNetworkCloudAgentPool_CreateViaJsonString.cs @@ -0,0 +1,627 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; + using System; + + /// + /// create a new Kubernetes cluster agent pool or create the properties of the existing one. + /// + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/kubernetesClusters/{kubernetesClusterName}/agentPools/{agentPoolName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzNetworkCloudAgentPool_CreateViaJsonString", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"create a new Kubernetes cluster agent pool or create the properties of the existing one.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/kubernetesClusters/{kubernetesClusterName}/agentPools/{agentPoolName}", ApiVersion = "2025-02-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.NotSuggestDefaultParameterSet] + public partial class NewAzNetworkCloudAgentPool_CreateViaJsonString : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private string _ifMatch; + + /// + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value + /// to prevent accidentally overwriting concurrent changes. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes.", + SerializedName = @"If-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Header)] + public string IfMatch { get => this._ifMatch; set => this._ifMatch = value; } + + /// Backing field for property. + private string _ifNoneMatch; + + /// + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result + /// in error from server as they are not supported. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result in error from server as they are not supported.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result in error from server as they are not supported.", + SerializedName = @"If-None-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Header)] + public string IfNoneMatch { get => this._ifNoneMatch; set => this._ifNoneMatch = 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 Create operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Json string supplied to the Create operation")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 _kubernetesClusterName; + + /// The name of the Kubernetes cluster. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the Kubernetes cluster.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the Kubernetes cluster.", + SerializedName = @"kubernetesClusterName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] + public string KubernetesClusterName { get => this._kubernetesClusterName; set => this._kubernetesClusterName = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of the Kubernetes cluster agent pool. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the Kubernetes cluster agent pool.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the Kubernetes cluster agent pool.", + SerializedName = @"agentPoolName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("AgentPoolName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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. The value must be an UUID. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription. The value must be an UUID.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription. The value must be an UUID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.IAgentPool + /// 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.NetworkCloud.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of NewAzNetworkCloudAgentPool_CreateViaJsonString + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets.NewAzNetworkCloudAgentPool_CreateViaJsonString Clone() + { + var clone = new NewAzNetworkCloudAgentPool_CreateViaJsonString(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.KubernetesClusterName = this.KubernetesClusterName; + clone.Name = this.Name; + clone.IfMatch = this.IfMatch; + clone.IfNoneMatch = this.IfNoneMatch; + clone.JsonString = this.JsonString; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 NewAzNetworkCloudAgentPool_CreateViaJsonString() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'AgentPoolsCreateOrUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.AgentPoolsCreateOrUpdateViaJsonString(SubscriptionId, ResourceGroupName, KubernetesClusterName, Name, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _jsonString, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,KubernetesClusterName=KubernetesClusterName,Name=Name,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.IAgentPool + /// 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.NetworkCloud.Models.IAgentPool + var result = (await response); + WriteObject(result, false); + } + } + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/NewAzNetworkCloudBareMetalMachineKeySet_CreateExpanded.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/NewAzNetworkCloudBareMetalMachineKeySet_CreateExpanded.cs index e46c01c055fe..1975a625a071 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/NewAzNetworkCloudBareMetalMachineKeySet_CreateExpanded.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/NewAzNetworkCloudBareMetalMachineKeySet_CreateExpanded.cs @@ -6,22 +6,24 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// - /// Create a new bare metal machine key set or update the existing one for the provided cluster. + /// create a new bare metal machine key set or create the existing one for the provided cluster. /// /// /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/bareMetalMachineKeySets/{bareMetalMachineKeySetName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzNetworkCloudBareMetalMachineKeySet_CreateExpanded", SupportsShouldProcess = true)] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySet", "15.0.0", "2.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"JumpHostsAllowed","UserList","UserListStatus"}, NewOutputProperties=new string[] {"JumpHostsAllowed","UserList","UserListStatus"}, ChangeDescription="The types of properties will be changed from fixed array to 'List'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySet))] - [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Create a new bare metal machine key set or update the existing one for the provided cluster.")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySet))] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"create a new bare metal machine key set or create the existing one for the provided cluster.")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/bareMetalMachineKeySets/{bareMetalMachineKeySetName}", ApiVersion = "2025-02-01")] public partial class NewAzNetworkCloudBareMetalMachineKeySet_CreateExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -33,13 +35,16 @@ public partial class NewAzNetworkCloudBareMetalMachineKeySet_CreateExpanded : gl private string __processRecordId; /// BareMetalMachineKeySet represents the bare metal machine key set. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySet _bareMetalMachineKeySetParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BareMetalMachineKeySet(); + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySet _bareMetalMachineKeySetParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BareMetalMachineKeySet(); /// /// 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(); + /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] @@ -64,6 +69,9 @@ public partial class NewAzNetworkCloudBareMetalMachineKeySet_CreateExpanded : gl [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -126,6 +134,9 @@ public partial class NewAzNetworkCloudBareMetalMachineKeySet_CreateExpanded : gl PossibleTypes = new [] { typeof(string) })] public string ExtendedLocationType { get => _bareMetalMachineKeySetParametersBody.ExtendedLocationType ?? null; set => _bareMetalMachineKeySetParametersBody.ExtendedLocationType = 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] @@ -187,7 +198,7 @@ public partial class NewAzNetworkCloudBareMetalMachineKeySet_CreateExpanded : gl Description = @"The list of IP addresses of jump hosts with management network access from which a login will be allowed for the users.", SerializedName = @"jumpHostsAllowed", PossibleTypes = new [] { typeof(string) })] - public string[] JumpHostsAllowed { get => _bareMetalMachineKeySetParametersBody.JumpHostsAllowed ?? null /* arrayOf */; set => _bareMetalMachineKeySetParametersBody.JumpHostsAllowed = value; } + public string[] JumpHostsAllowed { get => _bareMetalMachineKeySetParametersBody.JumpHostsAllowed?.ToArray() ?? null /* fixedArrayOf */; set => _bareMetalMachineKeySetParametersBody.JumpHostsAllowed = (value != null ? new System.Collections.Generic.List(value) : null); } /// The geo-location where the resource lives [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The geo-location where the resource lives")] @@ -247,7 +258,7 @@ public partial class NewAzNetworkCloudBareMetalMachineKeySet_CreateExpanded : gl /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } /// The access level allowed for the users in this key set. [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The access level allowed for the users in this key set.")] @@ -257,9 +268,9 @@ public partial class NewAzNetworkCloudBareMetalMachineKeySet_CreateExpanded : gl ReadOnly = false, Description = @"The access level allowed for the users in this key set.", SerializedName = @"privilegeLevel", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineKeySetPrivilegeLevel) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineKeySetPrivilegeLevel))] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineKeySetPrivilegeLevel PrivilegeLevel { get => _bareMetalMachineKeySetParametersBody.PrivilegeLevel; set => _bareMetalMachineKeySetParametersBody.PrivilegeLevel = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Standard", "Superuser")] + public string PrivilegeLevel { get => _bareMetalMachineKeySetParametersBody.PrivilegeLevel ?? null; set => _bareMetalMachineKeySetParametersBody.PrivilegeLevel = 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")] @@ -305,7 +316,8 @@ public partial class NewAzNetworkCloudBareMetalMachineKeySet_CreateExpanded : gl [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -318,8 +330,8 @@ public partial class NewAzNetworkCloudBareMetalMachineKeySet_CreateExpanded : gl ReadOnly = false, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceTags) })] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceTags Tag { get => _bareMetalMachineKeySetParametersBody.Tag ?? null /* object */; set => _bareMetalMachineKeySetParametersBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceTags Tag { get => _bareMetalMachineKeySetParametersBody.Tag ?? null /* object */; set => _bareMetalMachineKeySetParametersBody.Tag = value; } /// The unique list of permitted users. [global::System.Management.Automation.AllowEmptyCollection] @@ -330,32 +342,32 @@ public partial class NewAzNetworkCloudBareMetalMachineKeySet_CreateExpanded : gl ReadOnly = false, Description = @"The unique list of permitted users.", SerializedName = @"userList", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKeySetUser) })] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKeySetUser[] UserList { get => _bareMetalMachineKeySetParametersBody.UserList ?? null /* arrayOf */; set => _bareMetalMachineKeySetParametersBody.UserList = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKeySetUser) })] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKeySetUser[] UserList { get => _bareMetalMachineKeySetParametersBody.UserList?.ToArray() ?? null /* fixedArrayOf */; set => _bareMetalMachineKeySetParametersBody.UserList = (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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySet + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySet /// 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) @@ -469,11 +481,36 @@ 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.NetworkCloud.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -485,10 +522,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -498,7 +551,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public NewAzNetworkCloudBareMetalMachineKeySet_CreateExpanded() { @@ -564,7 +617,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -577,12 +630,12 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.BareMetalMachineKeySetsCreateOrUpdate(SubscriptionId, ResourceGroupName, ClusterName, Name, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _bareMetalMachineKeySetParametersBody, onOk, onDefault, this, Pipeline); + await this.Client.BareMetalMachineKeySetsCreateOrUpdate(SubscriptionId, ResourceGroupName, ClusterName, Name, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _bareMetalMachineKeySetParametersBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate); await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,ClusterName=ClusterName,Name=Name,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null,body=_bareMetalMachineKeySetParametersBody}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,ClusterName=ClusterName,Name=Name,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -620,12 +673,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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ) { @@ -642,15 +695,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.NetworkCloud.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, ClusterName=ClusterName, Name=Name, IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, body=_bareMetalMachineKeySetParametersBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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, ClusterName=ClusterName, Name=Name, IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, body=_bareMetalMachineKeySetParametersBody }) + 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 } }); @@ -660,12 +713,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.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySet + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySet /// 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 ) { @@ -677,8 +730,9 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySet - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySet + var result = (await response); + WriteObject(result, false); } } } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/NewAzNetworkCloudBareMetalMachineKeySet_CreateViaIdentityClusterExpanded.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/NewAzNetworkCloudBareMetalMachineKeySet_CreateViaIdentityClusterExpanded.cs new file mode 100644 index 000000000000..176dd575fdfd --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/NewAzNetworkCloudBareMetalMachineKeySet_CreateViaIdentityClusterExpanded.cs @@ -0,0 +1,721 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; + using System; + + /// + /// create a new bare metal machine key set or create the existing one for the provided cluster. + /// + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/bareMetalMachineKeySets/{bareMetalMachineKeySetName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzNetworkCloudBareMetalMachineKeySet_CreateViaIdentityClusterExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySet))] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"create a new bare metal machine key set or create the existing one for the provided cluster.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/bareMetalMachineKeySets/{bareMetalMachineKeySetName}", ApiVersion = "2025-02-01")] + public partial class NewAzNetworkCloudBareMetalMachineKeySet_CreateViaIdentityClusterExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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; + + /// BareMetalMachineKeySet represents the bare metal machine key set. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySet _bareMetalMachineKeySetParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BareMetalMachineKeySet(); + + /// + /// 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(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// + /// The object ID of Azure Active Directory group that all users in the list must be in for access to be granted. Users that + /// are not in the group will not have access. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The object ID of Azure Active Directory group that all users in the list must be in for access to be granted. Users that are not in the group will not have access.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The object ID of Azure Active Directory group that all users in the list must be in for access to be granted. Users that are not in the group will not have access.", + SerializedName = @"azureGroupId", + PossibleTypes = new [] { typeof(string) })] + public string AzureGroupId { get => _bareMetalMachineKeySetParametersBody.AzureGroupId ?? null; set => _bareMetalMachineKeySetParametersBody.AzureGroupId = 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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity _clusterInputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity ClusterInputObject { get => this._clusterInputObject; set => this._clusterInputObject = 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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// + /// The date and time after which the users in this key set will be removed from the bare metal machines. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The date and time after which the users in this key set will be removed from the bare metal machines.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The date and time after which the users in this key set will be removed from the bare metal machines.", + SerializedName = @"expiration", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + public global::System.DateTime Expiration { get => _bareMetalMachineKeySetParametersBody.Expiration; set => _bareMetalMachineKeySetParametersBody.Expiration = value; } + + /// The resource ID of the extended location on which the resource will be created. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The resource ID of the extended location on which the resource will be created.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource ID of the extended location on which the resource will be created.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + public string ExtendedLocationName { get => _bareMetalMachineKeySetParametersBody.ExtendedLocationName ?? null; set => _bareMetalMachineKeySetParametersBody.ExtendedLocationName = value; } + + /// The extended location type, for example, CustomLocation. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The extended location type, for example, CustomLocation.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The extended location type, for example, CustomLocation.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + public string ExtendedLocationType { get => _bareMetalMachineKeySetParametersBody.ExtendedLocationType ?? null; set => _bareMetalMachineKeySetParametersBody.ExtendedLocationType = 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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private string _ifMatch; + + /// + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value + /// to prevent accidentally overwriting concurrent changes. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes.", + SerializedName = @"If-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Header)] + public string IfMatch { get => this._ifMatch; set => this._ifMatch = value; } + + /// Backing field for property. + private string _ifNoneMatch; + + /// + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result + /// in error from server as they are not supported. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result in error from server as they are not supported.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result in error from server as they are not supported.", + SerializedName = @"If-None-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Header)] + public string IfNoneMatch { get => this._ifNoneMatch; set => this._ifNoneMatch = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// The list of IP addresses of jump hosts with management network access from which a login will be allowed for the users. + /// + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The list of IP addresses of jump hosts with management network access from which a login will be allowed for the users.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The list of IP addresses of jump hosts with management network access from which a login will be allowed for the users.", + SerializedName = @"jumpHostsAllowed", + PossibleTypes = new [] { typeof(string) })] + public string[] JumpHostsAllowed { get => _bareMetalMachineKeySetParametersBody.JumpHostsAllowed?.ToArray() ?? null /* fixedArrayOf */; set => _bareMetalMachineKeySetParametersBody.JumpHostsAllowed = (value != null ? new System.Collections.Generic.List(value) : null); } + + /// The geo-location where the resource lives + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The geo-location where the resource lives")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The geo-location where the resource lives", + SerializedName = @"location", + PossibleTypes = new [] { typeof(string) })] + public string Location { get => _bareMetalMachineKeySetParametersBody.Location ?? null; set => _bareMetalMachineKeySetParametersBody.Location = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of the bare metal machine key set. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the bare metal machine key set.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the bare metal machine key set.", + SerializedName = @"bareMetalMachineKeySetName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("BareMetalMachineKeySetName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// The name of the group that users will be assigned to on the operating system of the machines. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The name of the group that users will be assigned to on the operating system of the machines.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The name of the group that users will be assigned to on the operating system of the machines.", + SerializedName = @"osGroupName", + PossibleTypes = new [] { typeof(string) })] + public string OSGroupName { get => _bareMetalMachineKeySetParametersBody.OSGroupName ?? null; set => _bareMetalMachineKeySetParametersBody.OSGroupName = value; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + + /// The access level allowed for the users in this key set. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The access level allowed for the users in this key set.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The access level allowed for the users in this key set.", + SerializedName = @"privilegeLevel", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Standard", "Superuser")] + public string PrivilegeLevel { get => _bareMetalMachineKeySetParametersBody.PrivilegeLevel ?? null; set => _bareMetalMachineKeySetParametersBody.PrivilegeLevel = 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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Resource tags. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ExportAs(typeof(global::System.Collections.Hashtable))] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Resource tags.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Resource tags.", + SerializedName = @"tags", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceTags Tag { get => _bareMetalMachineKeySetParametersBody.Tag ?? null /* object */; set => _bareMetalMachineKeySetParametersBody.Tag = value; } + + /// The unique list of permitted users. + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The unique list of permitted users.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The unique list of permitted users.", + SerializedName = @"userList", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKeySetUser) })] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKeySetUser[] UserList { get => _bareMetalMachineKeySetParametersBody.UserList?.ToArray() ?? null /* fixedArrayOf */; set => _bareMetalMachineKeySetParametersBody.UserList = (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.NetworkCloud.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.NetworkCloud.Models.IBareMetalMachineKeySet + /// 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.NetworkCloud.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of NewAzNetworkCloudBareMetalMachineKeySet_CreateViaIdentityClusterExpanded + /// + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets.NewAzNetworkCloudBareMetalMachineKeySet_CreateViaIdentityClusterExpanded Clone() + { + var clone = new NewAzNetworkCloudBareMetalMachineKeySet_CreateViaIdentityClusterExpanded(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone._bareMetalMachineKeySetParametersBody = this._bareMetalMachineKeySetParametersBody; + clone.IfMatch = this.IfMatch; + clone.IfNoneMatch = this.IfNoneMatch; + clone.Name = this.Name; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 NewAzNetworkCloudBareMetalMachineKeySet_CreateViaIdentityClusterExpanded() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'BareMetalMachineKeySetsCreateOrUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (ClusterInputObject?.Id != null) + { + this.ClusterInputObject.Id += $"/bareMetalMachineKeySets/{(global::System.Uri.EscapeDataString(this.Name.ToString()))}"; + await this.Client.BareMetalMachineKeySetsCreateOrUpdateViaIdentity(ClusterInputObject.Id, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _bareMetalMachineKeySetParametersBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate); + } + else + { + // try to call with PATH parameters from Input Object + if (null == ClusterInputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("ClusterInputObject has null value for ClusterInputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, ClusterInputObject) ); + } + if (null == ClusterInputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("ClusterInputObject has null value for ClusterInputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, ClusterInputObject) ); + } + if (null == ClusterInputObject.ClusterName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("ClusterInputObject has null value for ClusterInputObject.ClusterName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, ClusterInputObject) ); + } + await this.Client.BareMetalMachineKeySetsCreateOrUpdate(ClusterInputObject.SubscriptionId ?? null, ClusterInputObject.ResourceGroupName ?? null, ClusterInputObject.ClusterName ?? null, Name, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _bareMetalMachineKeySetParametersBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Name=Name,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.IBareMetalMachineKeySet + /// 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.NetworkCloud.Models.IBareMetalMachineKeySet + var result = (await response); + WriteObject(result, false); + } + } + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/NewAzNetworkCloudBareMetalMachineKeySet_CreateViaJsonFilePath.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/NewAzNetworkCloudBareMetalMachineKeySet_CreateViaJsonFilePath.cs new file mode 100644 index 000000000000..99188c5323a5 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/NewAzNetworkCloudBareMetalMachineKeySet_CreateViaJsonFilePath.cs @@ -0,0 +1,632 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; + using System; + + /// + /// create a new bare metal machine key set or create the existing one for the provided cluster. + /// + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/bareMetalMachineKeySets/{bareMetalMachineKeySetName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzNetworkCloudBareMetalMachineKeySet_CreateViaJsonFilePath", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySet))] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"create a new bare metal machine key set or create the existing one for the provided cluster.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/bareMetalMachineKeySets/{bareMetalMachineKeySetName}", ApiVersion = "2025-02-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.NotSuggestDefaultParameterSet] + public partial class NewAzNetworkCloudBareMetalMachineKeySet_CreateViaJsonFilePath : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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(); + + public global::System.String _jsonString; + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; + + /// Backing field for property. + private string _clusterName; + + /// The name of the cluster. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the cluster.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the cluster.", + SerializedName = @"clusterName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] + public string ClusterName { get => this._clusterName; set => this._clusterName = 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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private string _ifMatch; + + /// + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value + /// to prevent accidentally overwriting concurrent changes. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes.", + SerializedName = @"If-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Header)] + public string IfMatch { get => this._ifMatch; set => this._ifMatch = value; } + + /// Backing field for property. + private string _ifNoneMatch; + + /// + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result + /// in error from server as they are not supported. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result in error from server as they are not supported.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result in error from server as they are not supported.", + SerializedName = @"If-None-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Header)] + public string IfNoneMatch { get => this._ifNoneMatch; set => this._ifNoneMatch = 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 _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.NetworkCloud.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.NetworkCloud.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of the bare metal machine key set. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the bare metal machine key set.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the bare metal machine key set.", + SerializedName = @"bareMetalMachineKeySetName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("BareMetalMachineKeySetName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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. The value must be an UUID. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription. The value must be an UUID.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription. The value must be an UUID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.IBareMetalMachineKeySet + /// 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.NetworkCloud.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of NewAzNetworkCloudBareMetalMachineKeySet_CreateViaJsonFilePath + /// + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets.NewAzNetworkCloudBareMetalMachineKeySet_CreateViaJsonFilePath Clone() + { + var clone = new NewAzNetworkCloudBareMetalMachineKeySet_CreateViaJsonFilePath(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.ClusterName = this.ClusterName; + clone.Name = this.Name; + clone.IfMatch = this.IfMatch; + clone.IfNoneMatch = this.IfNoneMatch; + clone.JsonFilePath = this.JsonFilePath; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 NewAzNetworkCloudBareMetalMachineKeySet_CreateViaJsonFilePath() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'BareMetalMachineKeySetsCreateOrUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.BareMetalMachineKeySetsCreateOrUpdateViaJsonString(SubscriptionId, ResourceGroupName, ClusterName, Name, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _jsonString, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,ClusterName=ClusterName,Name=Name,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.IBareMetalMachineKeySet + /// 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.NetworkCloud.Models.IBareMetalMachineKeySet + var result = (await response); + WriteObject(result, false); + } + } + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/NewAzNetworkCloudBareMetalMachineKeySet_CreateViaJsonString.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/NewAzNetworkCloudBareMetalMachineKeySet_CreateViaJsonString.cs new file mode 100644 index 000000000000..f58280b1f254 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/NewAzNetworkCloudBareMetalMachineKeySet_CreateViaJsonString.cs @@ -0,0 +1,629 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; + using System; + + /// + /// create a new bare metal machine key set or create the existing one for the provided cluster. + /// + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/bareMetalMachineKeySets/{bareMetalMachineKeySetName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzNetworkCloudBareMetalMachineKeySet_CreateViaJsonString", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySet))] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"create a new bare metal machine key set or create the existing one for the provided cluster.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/bareMetalMachineKeySets/{bareMetalMachineKeySetName}", ApiVersion = "2025-02-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.NotSuggestDefaultParameterSet] + public partial class NewAzNetworkCloudBareMetalMachineKeySet_CreateViaJsonString : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; + + /// Backing field for property. + private string _clusterName; + + /// The name of the cluster. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the cluster.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the cluster.", + SerializedName = @"clusterName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] + public string ClusterName { get => this._clusterName; set => this._clusterName = 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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private string _ifMatch; + + /// + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value + /// to prevent accidentally overwriting concurrent changes. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes.", + SerializedName = @"If-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Header)] + public string IfMatch { get => this._ifMatch; set => this._ifMatch = value; } + + /// Backing field for property. + private string _ifNoneMatch; + + /// + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result + /// in error from server as they are not supported. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result in error from server as they are not supported.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result in error from server as they are not supported.", + SerializedName = @"If-None-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Header)] + public string IfNoneMatch { get => this._ifNoneMatch; set => this._ifNoneMatch = 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 Create operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Json string supplied to the Create operation")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of the bare metal machine key set. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the bare metal machine key set.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the bare metal machine key set.", + SerializedName = @"bareMetalMachineKeySetName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("BareMetalMachineKeySetName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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. The value must be an UUID. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription. The value must be an UUID.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription. The value must be an UUID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.IBareMetalMachineKeySet + /// 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.NetworkCloud.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of NewAzNetworkCloudBareMetalMachineKeySet_CreateViaJsonString + /// + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets.NewAzNetworkCloudBareMetalMachineKeySet_CreateViaJsonString Clone() + { + var clone = new NewAzNetworkCloudBareMetalMachineKeySet_CreateViaJsonString(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.ClusterName = this.ClusterName; + clone.Name = this.Name; + clone.IfMatch = this.IfMatch; + clone.IfNoneMatch = this.IfNoneMatch; + clone.JsonString = this.JsonString; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 NewAzNetworkCloudBareMetalMachineKeySet_CreateViaJsonString() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'BareMetalMachineKeySetsCreateOrUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.BareMetalMachineKeySetsCreateOrUpdateViaJsonString(SubscriptionId, ResourceGroupName, ClusterName, Name, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _jsonString, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,ClusterName=ClusterName,Name=Name,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.IBareMetalMachineKeySet + /// 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.NetworkCloud.Models.IBareMetalMachineKeySet + var result = (await response); + WriteObject(result, false); + } + } + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/NewAzNetworkCloudBmcKeySet_CreateExpanded.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/NewAzNetworkCloudBmcKeySet_CreateExpanded.cs index 3c1090686955..c79fd6a9ee65 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/NewAzNetworkCloudBmcKeySet_CreateExpanded.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/NewAzNetworkCloudBmcKeySet_CreateExpanded.cs @@ -6,22 +6,24 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// - /// Create a new baseboard management controller key set or update the existing one for the provided cluster. + /// create a new baseboard management controller key set or create the existing one for the provided cluster. /// /// /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/bmcKeySets/{bmcKeySetName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzNetworkCloudBmcKeySet_CreateExpanded", SupportsShouldProcess = true)] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySet", "15.0.0", "2.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"UserList","UserListStatus"}, NewOutputProperties=new string[] {"UserList","UserListStatus"}, ChangeDescription="The types of properties will be changed from fixed array to 'List'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySet))] - [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Create a new baseboard management controller key set or update the existing one for the provided cluster.")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySet))] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"create a new baseboard management controller key set or create the existing one for the provided cluster.")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/bmcKeySets/{bmcKeySetName}", ApiVersion = "2025-02-01")] public partial class NewAzNetworkCloudBmcKeySet_CreateExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -33,13 +35,16 @@ public partial class NewAzNetworkCloudBmcKeySet_CreateExpanded : global::System. private string __processRecordId; /// BmcKeySet represents the baseboard management controller key set. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySet _bmcKeySetParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BmcKeySet(); + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySet _bmcKeySetParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BmcKeySet(); /// /// 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(); + /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] @@ -64,6 +69,9 @@ public partial class NewAzNetworkCloudBmcKeySet_CreateExpanded : global::System. [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -126,6 +134,9 @@ public partial class NewAzNetworkCloudBmcKeySet_CreateExpanded : global::System. PossibleTypes = new [] { typeof(string) })] public string ExtendedLocationType { get => _bmcKeySetParametersBody.ExtendedLocationType ?? null; set => _bmcKeySetParametersBody.ExtendedLocationType = 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] @@ -220,7 +231,7 @@ public partial class NewAzNetworkCloudBmcKeySet_CreateExpanded : global::System. /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } /// The access level allowed for the users in this key set. [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The access level allowed for the users in this key set.")] @@ -230,9 +241,9 @@ public partial class NewAzNetworkCloudBmcKeySet_CreateExpanded : global::System. ReadOnly = false, Description = @"The access level allowed for the users in this key set.", SerializedName = @"privilegeLevel", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BmcKeySetPrivilegeLevel) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BmcKeySetPrivilegeLevel))] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BmcKeySetPrivilegeLevel PrivilegeLevel { get => _bmcKeySetParametersBody.PrivilegeLevel; set => _bmcKeySetParametersBody.PrivilegeLevel = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("ReadOnly", "Administrator")] + public string PrivilegeLevel { get => _bmcKeySetParametersBody.PrivilegeLevel ?? null; set => _bmcKeySetParametersBody.PrivilegeLevel = 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")] @@ -278,7 +289,8 @@ public partial class NewAzNetworkCloudBmcKeySet_CreateExpanded : global::System. [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -291,8 +303,8 @@ public partial class NewAzNetworkCloudBmcKeySet_CreateExpanded : global::System. ReadOnly = false, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceTags) })] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceTags Tag { get => _bmcKeySetParametersBody.Tag ?? null /* object */; set => _bmcKeySetParametersBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceTags Tag { get => _bmcKeySetParametersBody.Tag ?? null /* object */; set => _bmcKeySetParametersBody.Tag = value; } /// The unique list of permitted users. [global::System.Management.Automation.AllowEmptyCollection] @@ -303,32 +315,32 @@ public partial class NewAzNetworkCloudBmcKeySet_CreateExpanded : global::System. ReadOnly = false, Description = @"The unique list of permitted users.", SerializedName = @"userList", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKeySetUser) })] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKeySetUser[] UserList { get => _bmcKeySetParametersBody.UserList ?? null /* arrayOf */; set => _bmcKeySetParametersBody.UserList = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKeySetUser) })] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKeySetUser[] UserList { get => _bmcKeySetParametersBody.UserList?.ToArray() ?? null /* fixedArrayOf */; set => _bmcKeySetParametersBody.UserList = (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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IBmcKeySet + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySet /// 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) @@ -442,11 +454,36 @@ 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.NetworkCloud.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -458,10 +495,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -471,7 +524,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public NewAzNetworkCloudBmcKeySet_CreateExpanded() { @@ -537,7 +590,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -550,12 +603,12 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.BmcKeySetsCreateOrUpdate(SubscriptionId, ResourceGroupName, ClusterName, Name, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _bmcKeySetParametersBody, onOk, onDefault, this, Pipeline); + await this.Client.BmcKeySetsCreateOrUpdate(SubscriptionId, ResourceGroupName, ClusterName, Name, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _bmcKeySetParametersBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate); await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,ClusterName=ClusterName,Name=Name,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null,body=_bmcKeySetParametersBody}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,ClusterName=ClusterName,Name=Name,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -593,12 +646,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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ) { @@ -615,15 +668,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.NetworkCloud.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, ClusterName=ClusterName, Name=Name, IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, body=_bmcKeySetParametersBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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, ClusterName=ClusterName, Name=Name, IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, body=_bmcKeySetParametersBody }) + 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 } }); @@ -633,12 +686,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.NetworkCloud.Models.Api20250201.IBmcKeySet + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySet /// 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 ) { @@ -650,8 +703,9 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySet - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySet + var result = (await response); + WriteObject(result, false); } } } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/NewAzNetworkCloudBmcKeySet_CreateViaIdentityClusterExpanded.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/NewAzNetworkCloudBmcKeySet_CreateViaIdentityClusterExpanded.cs new file mode 100644 index 000000000000..02994016ffb6 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/NewAzNetworkCloudBmcKeySet_CreateViaIdentityClusterExpanded.cs @@ -0,0 +1,693 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; + using System; + + /// + /// create a new baseboard management controller key set or create the existing one for the provided cluster. + /// + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/bmcKeySets/{bmcKeySetName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzNetworkCloudBmcKeySet_CreateViaIdentityClusterExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySet))] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"create a new baseboard management controller key set or create the existing one for the provided cluster.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/bmcKeySets/{bmcKeySetName}", ApiVersion = "2025-02-01")] + public partial class NewAzNetworkCloudBmcKeySet_CreateViaIdentityClusterExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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; + + /// BmcKeySet represents the baseboard management controller key set. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySet _bmcKeySetParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BmcKeySet(); + + /// + /// 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(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// + /// The object ID of Azure Active Directory group that all users in the list must be in for access to be granted. Users that + /// are not in the group will not have access. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The object ID of Azure Active Directory group that all users in the list must be in for access to be granted. Users that are not in the group will not have access.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The object ID of Azure Active Directory group that all users in the list must be in for access to be granted. Users that are not in the group will not have access.", + SerializedName = @"azureGroupId", + PossibleTypes = new [] { typeof(string) })] + public string AzureGroupId { get => _bmcKeySetParametersBody.AzureGroupId ?? null; set => _bmcKeySetParametersBody.AzureGroupId = 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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity _clusterInputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity ClusterInputObject { get => this._clusterInputObject; set => this._clusterInputObject = 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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// + /// The date and time after which the users in this key set will be removed from the baseboard management controllers. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The date and time after which the users in this key set will be removed from the baseboard management controllers.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The date and time after which the users in this key set will be removed from the baseboard management controllers.", + SerializedName = @"expiration", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + public global::System.DateTime Expiration { get => _bmcKeySetParametersBody.Expiration; set => _bmcKeySetParametersBody.Expiration = value; } + + /// The resource ID of the extended location on which the resource will be created. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The resource ID of the extended location on which the resource will be created.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource ID of the extended location on which the resource will be created.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + public string ExtendedLocationName { get => _bmcKeySetParametersBody.ExtendedLocationName ?? null; set => _bmcKeySetParametersBody.ExtendedLocationName = value; } + + /// The extended location type, for example, CustomLocation. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The extended location type, for example, CustomLocation.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The extended location type, for example, CustomLocation.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + public string ExtendedLocationType { get => _bmcKeySetParametersBody.ExtendedLocationType ?? null; set => _bmcKeySetParametersBody.ExtendedLocationType = 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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private string _ifMatch; + + /// + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value + /// to prevent accidentally overwriting concurrent changes. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes.", + SerializedName = @"If-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Header)] + public string IfMatch { get => this._ifMatch; set => this._ifMatch = value; } + + /// Backing field for property. + private string _ifNoneMatch; + + /// + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result + /// in error from server as they are not supported. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result in error from server as they are not supported.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result in error from server as they are not supported.", + SerializedName = @"If-None-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Header)] + public string IfNoneMatch { get => this._ifNoneMatch; set => this._ifNoneMatch = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// The geo-location where the resource lives + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The geo-location where the resource lives")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The geo-location where the resource lives", + SerializedName = @"location", + PossibleTypes = new [] { typeof(string) })] + public string Location { get => _bmcKeySetParametersBody.Location ?? null; set => _bmcKeySetParametersBody.Location = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of the baseboard management controller key set. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the baseboard management controller key set.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the baseboard management controller key set.", + SerializedName = @"bmcKeySetName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("BmcKeySetName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + + /// The access level allowed for the users in this key set. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The access level allowed for the users in this key set.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The access level allowed for the users in this key set.", + SerializedName = @"privilegeLevel", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("ReadOnly", "Administrator")] + public string PrivilegeLevel { get => _bmcKeySetParametersBody.PrivilegeLevel ?? null; set => _bmcKeySetParametersBody.PrivilegeLevel = 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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Resource tags. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ExportAs(typeof(global::System.Collections.Hashtable))] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Resource tags.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Resource tags.", + SerializedName = @"tags", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceTags Tag { get => _bmcKeySetParametersBody.Tag ?? null /* object */; set => _bmcKeySetParametersBody.Tag = value; } + + /// The unique list of permitted users. + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The unique list of permitted users.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The unique list of permitted users.", + SerializedName = @"userList", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKeySetUser) })] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKeySetUser[] UserList { get => _bmcKeySetParametersBody.UserList?.ToArray() ?? null /* fixedArrayOf */; set => _bmcKeySetParametersBody.UserList = (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.NetworkCloud.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.NetworkCloud.Models.IBmcKeySet + /// 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.NetworkCloud.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of NewAzNetworkCloudBmcKeySet_CreateViaIdentityClusterExpanded + /// + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets.NewAzNetworkCloudBmcKeySet_CreateViaIdentityClusterExpanded Clone() + { + var clone = new NewAzNetworkCloudBmcKeySet_CreateViaIdentityClusterExpanded(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone._bmcKeySetParametersBody = this._bmcKeySetParametersBody; + clone.IfMatch = this.IfMatch; + clone.IfNoneMatch = this.IfNoneMatch; + clone.Name = this.Name; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 NewAzNetworkCloudBmcKeySet_CreateViaIdentityClusterExpanded() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'BmcKeySetsCreateOrUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (ClusterInputObject?.Id != null) + { + this.ClusterInputObject.Id += $"/bmcKeySets/{(global::System.Uri.EscapeDataString(this.Name.ToString()))}"; + await this.Client.BmcKeySetsCreateOrUpdateViaIdentity(ClusterInputObject.Id, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _bmcKeySetParametersBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate); + } + else + { + // try to call with PATH parameters from Input Object + if (null == ClusterInputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("ClusterInputObject has null value for ClusterInputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, ClusterInputObject) ); + } + if (null == ClusterInputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("ClusterInputObject has null value for ClusterInputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, ClusterInputObject) ); + } + if (null == ClusterInputObject.ClusterName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("ClusterInputObject has null value for ClusterInputObject.ClusterName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, ClusterInputObject) ); + } + await this.Client.BmcKeySetsCreateOrUpdate(ClusterInputObject.SubscriptionId ?? null, ClusterInputObject.ResourceGroupName ?? null, ClusterInputObject.ClusterName ?? null, Name, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _bmcKeySetParametersBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Name=Name,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.IBmcKeySet + /// 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.NetworkCloud.Models.IBmcKeySet + var result = (await response); + WriteObject(result, false); + } + } + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/NewAzNetworkCloudBmcKeySet_CreateViaJsonFilePath.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/NewAzNetworkCloudBmcKeySet_CreateViaJsonFilePath.cs new file mode 100644 index 000000000000..aa82d7ea3225 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/NewAzNetworkCloudBmcKeySet_CreateViaJsonFilePath.cs @@ -0,0 +1,629 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; + using System; + + /// + /// create a new baseboard management controller key set or create the existing one for the provided cluster. + /// + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/bmcKeySets/{bmcKeySetName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzNetworkCloudBmcKeySet_CreateViaJsonFilePath", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySet))] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"create a new baseboard management controller key set or create the existing one for the provided cluster.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/bmcKeySets/{bmcKeySetName}", ApiVersion = "2025-02-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.NotSuggestDefaultParameterSet] + public partial class NewAzNetworkCloudBmcKeySet_CreateViaJsonFilePath : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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(); + + public global::System.String _jsonString; + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; + + /// Backing field for property. + private string _clusterName; + + /// The name of the cluster. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the cluster.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the cluster.", + SerializedName = @"clusterName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] + public string ClusterName { get => this._clusterName; set => this._clusterName = 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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private string _ifMatch; + + /// + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value + /// to prevent accidentally overwriting concurrent changes. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes.", + SerializedName = @"If-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Header)] + public string IfMatch { get => this._ifMatch; set => this._ifMatch = value; } + + /// Backing field for property. + private string _ifNoneMatch; + + /// + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result + /// in error from server as they are not supported. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result in error from server as they are not supported.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result in error from server as they are not supported.", + SerializedName = @"If-None-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Header)] + public string IfNoneMatch { get => this._ifNoneMatch; set => this._ifNoneMatch = 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 _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.NetworkCloud.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.NetworkCloud.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of the baseboard management controller key set. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the baseboard management controller key set.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the baseboard management controller key set.", + SerializedName = @"bmcKeySetName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("BmcKeySetName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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. The value must be an UUID. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription. The value must be an UUID.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription. The value must be an UUID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.IBmcKeySet + /// 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.NetworkCloud.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of NewAzNetworkCloudBmcKeySet_CreateViaJsonFilePath + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets.NewAzNetworkCloudBmcKeySet_CreateViaJsonFilePath Clone() + { + var clone = new NewAzNetworkCloudBmcKeySet_CreateViaJsonFilePath(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.ClusterName = this.ClusterName; + clone.Name = this.Name; + clone.IfMatch = this.IfMatch; + clone.IfNoneMatch = this.IfNoneMatch; + clone.JsonFilePath = this.JsonFilePath; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 NewAzNetworkCloudBmcKeySet_CreateViaJsonFilePath() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'BmcKeySetsCreateOrUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.BmcKeySetsCreateOrUpdateViaJsonString(SubscriptionId, ResourceGroupName, ClusterName, Name, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _jsonString, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,ClusterName=ClusterName,Name=Name,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.IBmcKeySet + /// 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.NetworkCloud.Models.IBmcKeySet + var result = (await response); + WriteObject(result, false); + } + } + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/NewAzNetworkCloudBmcKeySet_CreateViaJsonString.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/NewAzNetworkCloudBmcKeySet_CreateViaJsonString.cs new file mode 100644 index 000000000000..eb12e1015aed --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/NewAzNetworkCloudBmcKeySet_CreateViaJsonString.cs @@ -0,0 +1,627 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; + using System; + + /// + /// create a new baseboard management controller key set or create the existing one for the provided cluster. + /// + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/bmcKeySets/{bmcKeySetName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzNetworkCloudBmcKeySet_CreateViaJsonString", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySet))] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"create a new baseboard management controller key set or create the existing one for the provided cluster.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/bmcKeySets/{bmcKeySetName}", ApiVersion = "2025-02-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.NotSuggestDefaultParameterSet] + public partial class NewAzNetworkCloudBmcKeySet_CreateViaJsonString : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; + + /// Backing field for property. + private string _clusterName; + + /// The name of the cluster. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the cluster.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the cluster.", + SerializedName = @"clusterName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] + public string ClusterName { get => this._clusterName; set => this._clusterName = 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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private string _ifMatch; + + /// + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value + /// to prevent accidentally overwriting concurrent changes. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes.", + SerializedName = @"If-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Header)] + public string IfMatch { get => this._ifMatch; set => this._ifMatch = value; } + + /// Backing field for property. + private string _ifNoneMatch; + + /// + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result + /// in error from server as they are not supported. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result in error from server as they are not supported.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result in error from server as they are not supported.", + SerializedName = @"If-None-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Header)] + public string IfNoneMatch { get => this._ifNoneMatch; set => this._ifNoneMatch = 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 Create operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Json string supplied to the Create operation")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of the baseboard management controller key set. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the baseboard management controller key set.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the baseboard management controller key set.", + SerializedName = @"bmcKeySetName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("BmcKeySetName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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. The value must be an UUID. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription. The value must be an UUID.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription. The value must be an UUID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.IBmcKeySet + /// 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.NetworkCloud.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of NewAzNetworkCloudBmcKeySet_CreateViaJsonString + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets.NewAzNetworkCloudBmcKeySet_CreateViaJsonString Clone() + { + var clone = new NewAzNetworkCloudBmcKeySet_CreateViaJsonString(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.ClusterName = this.ClusterName; + clone.Name = this.Name; + clone.IfMatch = this.IfMatch; + clone.IfNoneMatch = this.IfNoneMatch; + clone.JsonString = this.JsonString; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 NewAzNetworkCloudBmcKeySet_CreateViaJsonString() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'BmcKeySetsCreateOrUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.BmcKeySetsCreateOrUpdateViaJsonString(SubscriptionId, ResourceGroupName, ClusterName, Name, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _jsonString, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,ClusterName=ClusterName,Name=Name,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.IBmcKeySet + /// 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.NetworkCloud.Models.IBmcKeySet + var result = (await response); + WriteObject(result, false); + } + } + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/NewAzNetworkCloudClusterManager_CreateExpanded.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/NewAzNetworkCloudClusterManager_CreateExpanded.cs index 3ed468404085..5c7432817ce5 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/NewAzNetworkCloudClusterManager_CreateExpanded.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/NewAzNetworkCloudClusterManager_CreateExpanded.cs @@ -6,22 +6,24 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// - /// Create a new cluster manager or update properties of the cluster manager if it exists. + /// create a new cluster manager or create properties of the cluster manager if it exists. /// /// /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusterManagers/{clusterManagerName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzNetworkCloudClusterManager_CreateExpanded", SupportsShouldProcess = true)] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManager", "15.0.0", "2.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"AvailabilityZone"}, NewOutputProperties=new string[] {"AvailabilityZone"}, ChangeDescription="The type of property will be changed from fixed array to 'List'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManager))] - [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Create a new cluster manager or update properties of the cluster manager if it exists.")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManager))] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"create a new cluster manager or create properties of the cluster manager if it exists.")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusterManagers/{clusterManagerName}", ApiVersion = "2025-02-01")] public partial class NewAzNetworkCloudClusterManager_CreateExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -40,7 +42,10 @@ public partial class NewAzNetworkCloudClusterManager_CreateExpanded : global::Sy /// /// ClusterManager represents a control-plane to manage one or more on-premises clusters. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManager _clusterManagerParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ClusterManager(); + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManager _clusterManagerParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterManager(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); /// /// The resource ID of the Log Analytics workspace that is used for the logs collection. @@ -73,13 +78,16 @@ public partial class NewAzNetworkCloudClusterManager_CreateExpanded : global::Sy Description = @"Field deprecated, this value will no longer influence the cluster manager allocation process and will be removed in a future version. The Azure availability zones within the region that will be used to support the cluster manager resource.", SerializedName = @"availabilityZones", PossibleTypes = new [] { typeof(string) })] - public string[] AvailabilityZone { get => _clusterManagerParametersBody.AvailabilityZone ?? null /* arrayOf */; set => _clusterManagerParametersBody.AvailabilityZone = value; } + public string[] AvailabilityZone { get => _clusterManagerParametersBody.AvailabilityZone?.ToArray() ?? null /* fixedArrayOf */; set => _clusterManagerParametersBody.AvailabilityZone = (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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -93,6 +101,13 @@ public partial class NewAzNetworkCloudClusterManager_CreateExpanded : global::Sy [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// 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 => _clusterManagerParametersBody.IdentityType = value.IsPresent ? "SystemAssigned": null ; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// /// The resource ID of the fabric controller that has one to one mapping with the cluster manager. /// @@ -118,36 +133,6 @@ public partial class NewAzNetworkCloudClusterManager_CreateExpanded : global::Sy [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Support.ManagedServiceIdentityType) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentityType))] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentityType IdentityType { get => _clusterManagerParametersBody.IdentityType ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentityType)""); set => _clusterManagerParametersBody.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.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api50.IUserAssignedIdentities) })] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IUserAssignedIdentities IdentityUserAssignedIdentity { get => _clusterManagerParametersBody.IdentityUserAssignedIdentity ?? null /* object */; set => _clusterManagerParametersBody.IdentityUserAssignedIdentity = value; } - /// Backing field for property. private string _ifMatch; @@ -256,7 +241,7 @@ public partial class NewAzNetworkCloudClusterManager_CreateExpanded : global::Sy /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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")] @@ -302,7 +287,8 @@ public partial class NewAzNetworkCloudClusterManager_CreateExpanded : global::Sy [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -315,8 +301,16 @@ public partial class NewAzNetworkCloudClusterManager_CreateExpanded : global::Sy ReadOnly = false, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceTags) })] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceTags Tag { get => _clusterManagerParametersBody.Tag ?? null /* object */; set => _clusterManagerParametersBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceTags Tag { get => _clusterManagerParametersBody.Tag ?? null /* object */; set => _clusterManagerParametersBody.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; } /// /// Field deprecated, this value will no longer influence the cluster manager allocation process and will be removed in a @@ -337,24 +331,24 @@ public partial class NewAzNetworkCloudClusterManager_CreateExpanded : 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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IClusterManager + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManager /// 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) @@ -467,11 +461,36 @@ 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.NetworkCloud.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -483,10 +502,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -496,13 +531,38 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public NewAzNetworkCloudClusterManager_CreateExpanded() { } + private void PreProcessManagedIdentityParameters() + { + if (this.UserAssignedIdentity?.Length > 0) + { + // calculate UserAssignedIdentity + _clusterManagerParametersBody.IdentityUserAssignedIdentity.Clear(); + foreach( var id in this.UserAssignedIdentity ) + { + _clusterManagerParametersBody.IdentityUserAssignedIdentity.Add(id, new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.UserAssignedIdentity()); + } + } + // calculate IdentityType + if (this.UserAssignedIdentity?.Length > 0) + { + if ("SystemAssigned".Equals(_clusterManagerParametersBody.IdentityType, StringComparison.InvariantCultureIgnoreCase)) + { + _clusterManagerParametersBody.IdentityType = "SystemAssigned,UserAssigned"; + } + else + { + _clusterManagerParametersBody.IdentityType = "UserAssigned"; + } + } + } + /// Performs execution of the command. protected override void ProcessRecord() { @@ -562,7 +622,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -575,12 +635,13 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.ClusterManagersCreateOrUpdate(SubscriptionId, ResourceGroupName, Name, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _clusterManagerParametersBody, onOk, onDefault, this, Pipeline); + this.PreProcessManagedIdentityParameters(); + await this.Client.ClusterManagersCreateOrUpdate(SubscriptionId, ResourceGroupName, Name, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _clusterManagerParametersBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate); await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null,body=_clusterManagerParametersBody}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -618,12 +679,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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ) { @@ -640,15 +701,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.NetworkCloud.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, IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, body=_clusterManagerParametersBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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, IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, body=_clusterManagerParametersBody }) + 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 } }); @@ -658,12 +719,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.NetworkCloud.Models.Api20250201.IClusterManager + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManager /// 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 ) { @@ -675,8 +736,9 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManager - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManager + var result = (await response); + WriteObject(result, false); } } } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/NewAzNetworkCloudClusterManager_CreateViaJsonFilePath.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/NewAzNetworkCloudClusterManager_CreateViaJsonFilePath.cs new file mode 100644 index 000000000000..0c4e05f1c3fa --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/NewAzNetworkCloudClusterManager_CreateViaJsonFilePath.cs @@ -0,0 +1,614 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; + using System; + + /// + /// create a new cluster manager or create properties of the cluster manager if it exists. + /// + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusterManagers/{clusterManagerName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzNetworkCloudClusterManager_CreateViaJsonFilePath", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManager))] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"create a new cluster manager or create properties of the cluster manager if it exists.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusterManagers/{clusterManagerName}", ApiVersion = "2025-02-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.NotSuggestDefaultParameterSet] + public partial class NewAzNetworkCloudClusterManager_CreateViaJsonFilePath : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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(); + + public global::System.String _jsonString; + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private string _ifMatch; + + /// + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value + /// to prevent accidentally overwriting concurrent changes. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes.", + SerializedName = @"If-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Header)] + public string IfMatch { get => this._ifMatch; set => this._ifMatch = value; } + + /// Backing field for property. + private string _ifNoneMatch; + + /// + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result + /// in error from server as they are not supported. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result in error from server as they are not supported.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result in error from server as they are not supported.", + SerializedName = @"If-None-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Header)] + public string IfNoneMatch { get => this._ifNoneMatch; set => this._ifNoneMatch = 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 _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.NetworkCloud.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.NetworkCloud.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of the cluster manager. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the cluster manager.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the cluster manager.", + SerializedName = @"clusterManagerName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("ClusterManagerName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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. The value must be an UUID. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription. The value must be an UUID.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription. The value must be an UUID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.IClusterManager + /// 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.NetworkCloud.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of NewAzNetworkCloudClusterManager_CreateViaJsonFilePath + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets.NewAzNetworkCloudClusterManager_CreateViaJsonFilePath Clone() + { + var clone = new NewAzNetworkCloudClusterManager_CreateViaJsonFilePath(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.Name = this.Name; + clone.IfMatch = this.IfMatch; + clone.IfNoneMatch = this.IfNoneMatch; + clone.JsonFilePath = this.JsonFilePath; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 NewAzNetworkCloudClusterManager_CreateViaJsonFilePath() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ClusterManagersCreateOrUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ClusterManagersCreateOrUpdateViaJsonString(SubscriptionId, ResourceGroupName, Name, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _jsonString, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.IClusterManager + /// 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.NetworkCloud.Models.IClusterManager + var result = (await response); + WriteObject(result, false); + } + } + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/NewAzNetworkCloudClusterManager_CreateViaJsonString.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/NewAzNetworkCloudClusterManager_CreateViaJsonString.cs new file mode 100644 index 000000000000..a6b710eb731d --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/NewAzNetworkCloudClusterManager_CreateViaJsonString.cs @@ -0,0 +1,612 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; + using System; + + /// + /// create a new cluster manager or create properties of the cluster manager if it exists. + /// + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusterManagers/{clusterManagerName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzNetworkCloudClusterManager_CreateViaJsonString", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManager))] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"create a new cluster manager or create properties of the cluster manager if it exists.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusterManagers/{clusterManagerName}", ApiVersion = "2025-02-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.NotSuggestDefaultParameterSet] + public partial class NewAzNetworkCloudClusterManager_CreateViaJsonString : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private string _ifMatch; + + /// + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value + /// to prevent accidentally overwriting concurrent changes. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes.", + SerializedName = @"If-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Header)] + public string IfMatch { get => this._ifMatch; set => this._ifMatch = value; } + + /// Backing field for property. + private string _ifNoneMatch; + + /// + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result + /// in error from server as they are not supported. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result in error from server as they are not supported.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result in error from server as they are not supported.", + SerializedName = @"If-None-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Header)] + public string IfNoneMatch { get => this._ifNoneMatch; set => this._ifNoneMatch = 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 Create operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Json string supplied to the Create operation")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of the cluster manager. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the cluster manager.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the cluster manager.", + SerializedName = @"clusterManagerName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("ClusterManagerName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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. The value must be an UUID. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription. The value must be an UUID.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription. The value must be an UUID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.IClusterManager + /// 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.NetworkCloud.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of NewAzNetworkCloudClusterManager_CreateViaJsonString + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets.NewAzNetworkCloudClusterManager_CreateViaJsonString Clone() + { + var clone = new NewAzNetworkCloudClusterManager_CreateViaJsonString(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.Name = this.Name; + clone.IfMatch = this.IfMatch; + clone.IfNoneMatch = this.IfNoneMatch; + clone.JsonString = this.JsonString; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 NewAzNetworkCloudClusterManager_CreateViaJsonString() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ClusterManagersCreateOrUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ClusterManagersCreateOrUpdateViaJsonString(SubscriptionId, ResourceGroupName, Name, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _jsonString, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.IClusterManager + /// 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.NetworkCloud.Models.IClusterManager + var result = (await response); + WriteObject(result, false); + } + } + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/NewAzNetworkCloudCluster_CreateExpanded.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/NewAzNetworkCloudCluster_CreateExpanded.cs index 57361e6941fa..c6f0e32c8e62 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/NewAzNetworkCloudCluster_CreateExpanded.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/NewAzNetworkCloudCluster_CreateExpanded.cs @@ -6,20 +6,22 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; - /// Create a new cluster or update the properties of the cluster if it exists. + /// create a new cluster or create the properties of the cluster if it exists. /// /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzNetworkCloudCluster_CreateExpanded", SupportsShouldProcess = true)] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICluster", "15.0.0", "2.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"AggregatorOrSingleRackDefinitionBareMetalMachineConfigurationData","AggregatorOrSingleRackDefinitionStorageApplianceConfigurationData","AvailableUpgradeVersion","BareMetalMachineConfigurationData","ComputeRackDefinition","StorageApplianceConfigurationData","WorkloadResourceId"}, NewOutputProperties=new string[] {"AggregatorOrSingleRackDefinitionBareMetalMachineConfigurationData","AggregatorOrSingleRackDefinitionStorageApplianceConfigurationData","AvailableUpgradeVersion","BareMetalMachineConfigurationData","ComputeRackDefinition","StorageApplianceConfigurationData","WorkloadResourceId"}, ChangeDescription="The types of properties will be changed from fixed array to 'List'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICluster))] - [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Create a new cluster or update the properties of the cluster if it exists.")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICluster))] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"create a new cluster or create the properties of the cluster if it exists.")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}", ApiVersion = "2025-02-01")] public partial class NewAzNetworkCloudCluster_CreateExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -36,7 +38,10 @@ public partial class NewAzNetworkCloudCluster_CreateExpanded : global::System.Ma private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); /// Cluster represents the on-premises Network Cloud cluster. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICluster _clusterParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.Cluster(); + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICluster _clusterParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Cluster(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); /// /// The zone name used for this rack when created. Availability zones are used for workload placement. @@ -60,8 +65,8 @@ public partial class NewAzNetworkCloudCluster_CreateExpanded : global::System.Ma ReadOnly = false, Description = @"The unordered list of bare metal machine configuration.", SerializedName = @"bareMetalMachineConfigurationData", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineConfigurationData) })] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineConfigurationData[] AggregatorOrSingleRackDefinitionBareMetalMachineConfiguration { get => _clusterParametersBody.AggregatorOrSingleRackDefinitionBareMetalMachineConfigurationData ?? null /* arrayOf */; set => _clusterParametersBody.AggregatorOrSingleRackDefinitionBareMetalMachineConfigurationData = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineConfigurationData) })] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineConfigurationData[] AggregatorOrSingleRackDefinitionBareMetalMachineConfiguration { get => _clusterParametersBody.AggregatorOrSingleRackDefinitionBareMetalMachineConfigurationData?.ToArray() ?? null /* fixedArrayOf */; set => _clusterParametersBody.AggregatorOrSingleRackDefinitionBareMetalMachineConfigurationData = (value != null ? new System.Collections.Generic.List(value) : null); } /// The resource ID of the network rack that matches this rack definition. [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The resource ID of the network rack that matches this rack definition.")] @@ -119,8 +124,8 @@ public partial class NewAzNetworkCloudCluster_CreateExpanded : global::System.Ma ReadOnly = false, Description = @"The list of storage appliance configuration data for this rack.", SerializedName = @"storageApplianceConfigurationData", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceConfigurationData) })] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceConfigurationData[] AggregatorOrSingleRackDefinitionStorageApplianceConfiguration { get => _clusterParametersBody.AggregatorOrSingleRackDefinitionStorageApplianceConfigurationData ?? null /* arrayOf */; set => _clusterParametersBody.AggregatorOrSingleRackDefinitionStorageApplianceConfigurationData = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceConfigurationData) })] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceConfigurationData[] AggregatorOrSingleRackDefinitionStorageApplianceConfiguration { get => _clusterParametersBody.AggregatorOrSingleRackDefinitionStorageApplianceConfigurationData?.ToArray() ?? null /* fixedArrayOf */; set => _clusterParametersBody.AggregatorOrSingleRackDefinitionStorageApplianceConfigurationData = (value != null ? new System.Collections.Generic.List(value) : null); } /// /// The resource ID of the analytics workspace that is to be used by the specified identity. @@ -143,9 +148,9 @@ public partial class NewAzNetworkCloudCluster_CreateExpanded : global::System.Ma ReadOnly = false, Description = @"The type of managed identity that is being selected.", SerializedName = @"identityType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType))] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType AnalyticsOutputSettingsAssociatedIdentityType { get => _clusterParametersBody.AnalyticsOutputSettingsAssociatedIdentityType ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType)""); set => _clusterParametersBody.AnalyticsOutputSettingsAssociatedIdentityType = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("SystemAssignedIdentity", "UserAssignedIdentity")] + public string AnalyticsOutputSettingsAssociatedIdentityType { get => _clusterParametersBody.AnalyticsOutputSettingsAssociatedIdentityType ?? null; set => _clusterParametersBody.AnalyticsOutputSettingsAssociatedIdentityType = value; } /// /// The user assigned managed identity resource ID to use. Mutually exclusive with a system assigned identity type. @@ -186,9 +191,9 @@ public partial class NewAzNetworkCloudCluster_CreateExpanded : global::System.Ma ReadOnly = false, Description = @"The type of associated identity for CommandOutputSettings.", SerializedName = @"identityType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType))] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType AssociatedIdentityType { get => _clusterParametersBody.AssociatedIdentityType ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType)""); set => _clusterParametersBody.AssociatedIdentityType = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("SystemAssignedIdentity", "UserAssignedIdentity")] + public string AssociatedIdentityType { get => _clusterParametersBody.AssociatedIdentityType ?? null; set => _clusterParametersBody.AssociatedIdentityType = value; } /// The resource ID of the user assigned identity for CommandOutputSettings. [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The resource ID of the user assigned identity for CommandOutputSettings.")] @@ -206,6 +211,9 @@ public partial class NewAzNetworkCloudCluster_CreateExpanded : global::System.Ma [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -276,9 +284,9 @@ public partial class NewAzNetworkCloudCluster_CreateExpanded : global::System.Ma ReadOnly = false, Description = @"The type of rack configuration for the cluster.", SerializedName = @"clusterType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterType) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterType))] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterType ClusterType { get => _clusterParametersBody.ClusterType; set => _clusterParametersBody.ClusterType = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("SingleRack", "MultiRack")] + public string ClusterType { get => _clusterParametersBody.ClusterType ?? null; set => _clusterParametersBody.ClusterType = value; } /// The current runtime version of the cluster. [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The current runtime version of the cluster.")] @@ -312,9 +320,9 @@ public partial class NewAzNetworkCloudCluster_CreateExpanded : global::System.Ma ReadOnly = false, Description = @"Selection of how the type evaluation is applied to the cluster calculation.", SerializedName = @"grouping", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdGrouping) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdGrouping))] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdGrouping ComputeDeploymentThresholdGrouping { get => _clusterParametersBody.ComputeDeploymentThresholdGrouping ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdGrouping)""); set => _clusterParametersBody.ComputeDeploymentThresholdGrouping = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("PerCluster", "PerRack")] + public string ComputeDeploymentThresholdGrouping { get => _clusterParametersBody.ComputeDeploymentThresholdGrouping ?? null; set => _clusterParametersBody.ComputeDeploymentThresholdGrouping = value; } /// Selection of how the threshold should be evaluated. [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Selection of how the threshold should be evaluated.")] @@ -324,9 +332,9 @@ public partial class NewAzNetworkCloudCluster_CreateExpanded : global::System.Ma ReadOnly = false, Description = @"Selection of how the threshold should be evaluated.", SerializedName = @"type", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdType) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdType))] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdType ComputeDeploymentThresholdType { get => _clusterParametersBody.ComputeDeploymentThresholdType ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdType)""); set => _clusterParametersBody.ComputeDeploymentThresholdType = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("CountSuccess", "PercentSuccess")] + public string ComputeDeploymentThresholdType { get => _clusterParametersBody.ComputeDeploymentThresholdType ?? null; set => _clusterParametersBody.ComputeDeploymentThresholdType = value; } /// The numeric threshold value. [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The numeric threshold value.")] @@ -340,18 +348,18 @@ public partial class NewAzNetworkCloudCluster_CreateExpanded : global::System.Ma public long ComputeDeploymentThresholdValue { get => _clusterParametersBody.ComputeDeploymentThresholdValue ?? default(long); set => _clusterParametersBody.ComputeDeploymentThresholdValue = value; } /// - /// The list of rack definitions for the compute racks in a multi-rackcluster, or an empty list in a single-rack cluster. + /// The list of rack definitions for the compute racks in a multi-rack cluster, or an empty list in a single-rack cluster. /// [global::System.Management.Automation.AllowEmptyCollection] - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The list of rack definitions for the compute racks in a multi-rackcluster, or an empty list in a single-rack cluster.")] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The list of rack definitions for the compute racks in a multi-rack cluster, or an empty list in a single-rack cluster.")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Body)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = false, ReadOnly = false, - Description = @"The list of rack definitions for the compute racks in a multi-rackcluster, or an empty list in a single-rack cluster.", + Description = @"The list of rack definitions for the compute racks in a multi-rack cluster, or an empty list in a single-rack cluster.", SerializedName = @"computeRackDefinitions", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackDefinition) })] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackDefinition[] ComputeRackDefinition { get => _clusterParametersBody.ComputeRackDefinition ?? null /* arrayOf */; set => _clusterParametersBody.ComputeRackDefinition = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackDefinition) })] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackDefinition[] ComputeRackDefinition { get => _clusterParametersBody.ComputeRackDefinition?.ToArray() ?? null /* fixedArrayOf */; set => _clusterParametersBody.ComputeRackDefinition = (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 @@ -363,6 +371,10 @@ public partial class NewAzNetworkCloudCluster_CreateExpanded : global::System.Ma [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// 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 => _clusterParametersBody.IdentityType = value.IsPresent ? "SystemAssigned": null ; } + /// The resource ID of the extended location on which the resource will be created. [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The resource ID of the extended location on which the resource will be created.")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Body)] @@ -385,6 +397,9 @@ public partial class NewAzNetworkCloudCluster_CreateExpanded : global::System.Ma PossibleTypes = new [] { typeof(string) })] public string ExtendedLocationType { get => _clusterParametersBody.ExtendedLocationType ?? null; set => _clusterParametersBody.ExtendedLocationType = 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] @@ -397,36 +412,6 @@ public partial class NewAzNetworkCloudCluster_CreateExpanded : global::System.Ma [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Support.ManagedServiceIdentityType) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentityType))] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentityType IdentityType { get => _clusterParametersBody.IdentityType ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentityType)""); set => _clusterParametersBody.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.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api50.IUserAssignedIdentities) })] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IUserAssignedIdentities IdentityUserAssignedIdentity { get => _clusterParametersBody.IdentityUserAssignedIdentity ?? null /* object */; set => _clusterParametersBody.IdentityUserAssignedIdentity = value; } - /// Backing field for property. private string _ifMatch; @@ -546,7 +531,7 @@ public partial class NewAzNetworkCloudCluster_CreateExpanded : global::System.Ma /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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")] @@ -586,9 +571,9 @@ public partial class NewAzNetworkCloudCluster_CreateExpanded : global::System.Ma ReadOnly = false, Description = @"The mode of operation for runtime protection.", SerializedName = @"enforcementLevel", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RuntimeProtectionEnforcementLevel) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RuntimeProtectionEnforcementLevel))] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RuntimeProtectionEnforcementLevel RuntimeProtectionConfigurationEnforcementLevel { get => _clusterParametersBody.RuntimeProtectionConfigurationEnforcementLevel ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RuntimeProtectionEnforcementLevel)""); set => _clusterParametersBody.RuntimeProtectionConfigurationEnforcementLevel = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Audit", "Disabled", "OnDemand", "Passive", "RealTime")] + public string RuntimeProtectionConfigurationEnforcementLevel { get => _clusterParametersBody.RuntimeProtectionConfigurationEnforcementLevel ?? null; set => _clusterParametersBody.RuntimeProtectionConfigurationEnforcementLevel = value; } /// The resource ID of the key vault to archive the secrets of the cluster. [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The resource ID of the key vault to archive the secrets of the cluster.")] @@ -620,9 +605,9 @@ public partial class NewAzNetworkCloudCluster_CreateExpanded : global::System.Ma ReadOnly = false, Description = @"The type of managed identity that is being selected.", SerializedName = @"identityType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType))] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType SecretArchiveSettingsAssociatedIdentityType { get => _clusterParametersBody.SecretArchiveSettingsAssociatedIdentityType ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType)""); set => _clusterParametersBody.SecretArchiveSettingsAssociatedIdentityType = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("SystemAssignedIdentity", "UserAssignedIdentity")] + public string SecretArchiveSettingsAssociatedIdentityType { get => _clusterParametersBody.SecretArchiveSettingsAssociatedIdentityType ?? null; set => _clusterParametersBody.SecretArchiveSettingsAssociatedIdentityType = value; } /// /// The user assigned managed identity resource ID to use. Mutually exclusive with a system assigned identity type. @@ -647,9 +632,9 @@ public partial class NewAzNetworkCloudCluster_CreateExpanded : global::System.Ma ReadOnly = false, Description = @"The indicator if the specified key vault should be used to archive the secrets of the cluster.", SerializedName = @"useKeyVault", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterSecretArchiveEnabled) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterSecretArchiveEnabled))] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterSecretArchiveEnabled SecretArchiveUseKeyVault { get => _clusterParametersBody.SecretArchiveUseKeyVault ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterSecretArchiveEnabled)""); set => _clusterParametersBody.SecretArchiveUseKeyVault = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("True", "False")] + public string SecretArchiveUseKeyVault { get => _clusterParametersBody.SecretArchiveUseKeyVault ?? null; set => _clusterParametersBody.SecretArchiveUseKeyVault = value; } /// Backing field for property. private string _subscriptionId; @@ -665,7 +650,8 @@ public partial class NewAzNetworkCloudCluster_CreateExpanded : global::System.Ma [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -678,8 +664,8 @@ public partial class NewAzNetworkCloudCluster_CreateExpanded : global::System.Ma ReadOnly = false, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceTags) })] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceTags Tag { get => _clusterParametersBody.Tag ?? null /* object */; set => _clusterParametersBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceTags Tag { get => _clusterParametersBody.Tag ?? null /* object */; set => _clusterParametersBody.Tag = value; } /// /// The maximum number of worker nodes that can be offline within the increment of update, e.g., rack-by-rack.Limited by the @@ -703,9 +689,9 @@ public partial class NewAzNetworkCloudCluster_CreateExpanded : global::System.Ma ReadOnly = false, Description = @"Selection of how the threshold should be evaluated.", SerializedName = @"thresholdType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdType) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdType))] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdType UpdateStrategyThresholdType { get => _clusterParametersBody.UpdateStrategyThresholdType ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdType)""); set => _clusterParametersBody.UpdateStrategyThresholdType = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("CountSuccess", "PercentSuccess")] + public string UpdateStrategyThresholdType { get => _clusterParametersBody.UpdateStrategyThresholdType ?? null; set => _clusterParametersBody.UpdateStrategyThresholdType = value; } /// The numeric threshold value. [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The numeric threshold value.")] @@ -726,9 +712,9 @@ public partial class NewAzNetworkCloudCluster_CreateExpanded : global::System.Ma ReadOnly = false, Description = @"The mode of operation for runtime protection.", SerializedName = @"strategyType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterUpdateStrategyType) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterUpdateStrategyType))] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterUpdateStrategyType UpdateStrategyType { get => _clusterParametersBody.UpdateStrategyType ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterUpdateStrategyType)""); set => _clusterParametersBody.UpdateStrategyType = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Rack", "PauseAfterRack")] + public string UpdateStrategyType { get => _clusterParametersBody.UpdateStrategyType ?? null; set => _clusterParametersBody.UpdateStrategyType = value; } /// The time to wait between the increments of update defined by the strategy. [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The time to wait between the increments of update defined by the strategy.")] @@ -741,6 +727,14 @@ public partial class NewAzNetworkCloudCluster_CreateExpanded : global::System.Ma PossibleTypes = new [] { typeof(long) })] public long UpdateStrategyWaitTimeMinute { get => _clusterParametersBody.UpdateStrategyWaitTimeMinute ?? default(long); set => _clusterParametersBody.UpdateStrategyWaitTimeMinute = 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; } + /// The mode selection for container vulnerability scanning. [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The mode selection for container vulnerability scanning.")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Body)] @@ -749,33 +743,33 @@ public partial class NewAzNetworkCloudCluster_CreateExpanded : global::System.Ma ReadOnly = false, Description = @"The mode selection for container vulnerability scanning.", SerializedName = @"containerScan", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VulnerabilityScanningSettingsContainerScan) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VulnerabilityScanningSettingsContainerScan))] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VulnerabilityScanningSettingsContainerScan VulnerabilityScanningSettingContainerScan { get => _clusterParametersBody.VulnerabilityScanningSettingContainerScan ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VulnerabilityScanningSettingsContainerScan)""); set => _clusterParametersBody.VulnerabilityScanningSettingContainerScan = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Disabled", "Enabled")] + public string VulnerabilityScanningSettingContainerScan { get => _clusterParametersBody.VulnerabilityScanningSettingContainerScan ?? null; set => _clusterParametersBody.VulnerabilityScanningSettingContainerScan = 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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.ICluster + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICluster /// 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) @@ -888,11 +882,36 @@ 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.NetworkCloud.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -904,10 +923,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -917,13 +952,38 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public NewAzNetworkCloudCluster_CreateExpanded() { } + private void PreProcessManagedIdentityParameters() + { + if (this.UserAssignedIdentity?.Length > 0) + { + // calculate UserAssignedIdentity + _clusterParametersBody.IdentityUserAssignedIdentity.Clear(); + foreach( var id in this.UserAssignedIdentity ) + { + _clusterParametersBody.IdentityUserAssignedIdentity.Add(id, new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.UserAssignedIdentity()); + } + } + // calculate IdentityType + if (this.UserAssignedIdentity?.Length > 0) + { + if ("SystemAssigned".Equals(_clusterParametersBody.IdentityType, StringComparison.InvariantCultureIgnoreCase)) + { + _clusterParametersBody.IdentityType = "SystemAssigned,UserAssigned"; + } + else + { + _clusterParametersBody.IdentityType = "UserAssigned"; + } + } + } + /// Performs execution of the command. protected override void ProcessRecord() { @@ -983,7 +1043,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -996,12 +1056,13 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.ClustersCreateOrUpdate(SubscriptionId, ResourceGroupName, Name, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _clusterParametersBody, onOk, onDefault, this, Pipeline); + this.PreProcessManagedIdentityParameters(); + await this.Client.ClustersCreateOrUpdate(SubscriptionId, ResourceGroupName, Name, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _clusterParametersBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate); await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null,body=_clusterParametersBody}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -1039,12 +1100,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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ) { @@ -1061,15 +1122,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.NetworkCloud.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, IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, body=_clusterParametersBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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, IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, body=_clusterParametersBody }) + 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 } }); @@ -1079,12 +1140,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.NetworkCloud.Models.Api20250201.ICluster + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICluster /// 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 ) { @@ -1096,8 +1157,9 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICluster - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICluster + var result = (await response); + WriteObject(result, false); } } } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/NewAzNetworkCloudCluster_CreateViaJsonFilePath.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/NewAzNetworkCloudCluster_CreateViaJsonFilePath.cs new file mode 100644 index 000000000000..95fe81bdfe6f --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/NewAzNetworkCloudCluster_CreateViaJsonFilePath.cs @@ -0,0 +1,612 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; + using System; + + /// create a new cluster or create the properties of the cluster if it exists. + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzNetworkCloudCluster_CreateViaJsonFilePath", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICluster))] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"create a new cluster or create the properties of the cluster if it exists.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}", ApiVersion = "2025-02-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.NotSuggestDefaultParameterSet] + public partial class NewAzNetworkCloudCluster_CreateViaJsonFilePath : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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(); + + public global::System.String _jsonString; + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private string _ifMatch; + + /// + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value + /// to prevent accidentally overwriting concurrent changes. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes.", + SerializedName = @"If-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Header)] + public string IfMatch { get => this._ifMatch; set => this._ifMatch = value; } + + /// Backing field for property. + private string _ifNoneMatch; + + /// + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result + /// in error from server as they are not supported. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result in error from server as they are not supported.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result in error from server as they are not supported.", + SerializedName = @"If-None-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Header)] + public string IfNoneMatch { get => this._ifNoneMatch; set => this._ifNoneMatch = 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 _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.NetworkCloud.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.NetworkCloud.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of the cluster. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the cluster.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the cluster.", + SerializedName = @"clusterName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("ClusterName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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. The value must be an UUID. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription. The value must be an UUID.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription. The value must be an UUID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.ICluster + /// 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.NetworkCloud.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of NewAzNetworkCloudCluster_CreateViaJsonFilePath + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets.NewAzNetworkCloudCluster_CreateViaJsonFilePath Clone() + { + var clone = new NewAzNetworkCloudCluster_CreateViaJsonFilePath(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.Name = this.Name; + clone.IfMatch = this.IfMatch; + clone.IfNoneMatch = this.IfNoneMatch; + clone.JsonFilePath = this.JsonFilePath; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 NewAzNetworkCloudCluster_CreateViaJsonFilePath() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ClustersCreateOrUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ClustersCreateOrUpdateViaJsonString(SubscriptionId, ResourceGroupName, Name, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _jsonString, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.ICluster + /// 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.NetworkCloud.Models.ICluster + var result = (await response); + WriteObject(result, false); + } + } + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/NewAzNetworkCloudCluster_CreateViaJsonString.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/NewAzNetworkCloudCluster_CreateViaJsonString.cs new file mode 100644 index 000000000000..7e1315a156bc --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/NewAzNetworkCloudCluster_CreateViaJsonString.cs @@ -0,0 +1,610 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; + using System; + + /// create a new cluster or create the properties of the cluster if it exists. + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzNetworkCloudCluster_CreateViaJsonString", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICluster))] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"create a new cluster or create the properties of the cluster if it exists.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}", ApiVersion = "2025-02-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.NotSuggestDefaultParameterSet] + public partial class NewAzNetworkCloudCluster_CreateViaJsonString : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private string _ifMatch; + + /// + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value + /// to prevent accidentally overwriting concurrent changes. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes.", + SerializedName = @"If-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Header)] + public string IfMatch { get => this._ifMatch; set => this._ifMatch = value; } + + /// Backing field for property. + private string _ifNoneMatch; + + /// + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result + /// in error from server as they are not supported. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result in error from server as they are not supported.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result in error from server as they are not supported.", + SerializedName = @"If-None-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Header)] + public string IfNoneMatch { get => this._ifNoneMatch; set => this._ifNoneMatch = 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 Create operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Json string supplied to the Create operation")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of the cluster. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the cluster.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the cluster.", + SerializedName = @"clusterName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("ClusterName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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. The value must be an UUID. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription. The value must be an UUID.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription. The value must be an UUID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.ICluster + /// 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.NetworkCloud.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of NewAzNetworkCloudCluster_CreateViaJsonString + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets.NewAzNetworkCloudCluster_CreateViaJsonString Clone() + { + var clone = new NewAzNetworkCloudCluster_CreateViaJsonString(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.Name = this.Name; + clone.IfMatch = this.IfMatch; + clone.IfNoneMatch = this.IfNoneMatch; + clone.JsonString = this.JsonString; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 NewAzNetworkCloudCluster_CreateViaJsonString() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ClustersCreateOrUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ClustersCreateOrUpdateViaJsonString(SubscriptionId, ResourceGroupName, Name, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _jsonString, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.ICluster + /// 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.NetworkCloud.Models.ICluster + var result = (await response); + WriteObject(result, false); + } + } + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/NewAzNetworkCloudConsole_CreateExpanded.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/NewAzNetworkCloudConsole_CreateExpanded.cs index 4722c5dfcada..04be7c56ee88 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/NewAzNetworkCloudConsole_CreateExpanded.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/NewAzNetworkCloudConsole_CreateExpanded.cs @@ -6,21 +6,24 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// - /// Create a new virtual machine console or update the properties of the existing virtual machine console. + /// create a new virtual machine console or create the properties of the existing virtual machine console. /// /// /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/virtualMachines/{virtualMachineName}/consoles/{consoleName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzNetworkCloudConsole_CreateExpanded", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsole))] - [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Create a new virtual machine console or update the properties of the existing virtual machine console.")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsole))] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"create a new virtual machine console or create the properties of the existing virtual machine console.")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/virtualMachines/{virtualMachineName}/consoles/{consoleName}", ApiVersion = "2025-02-01")] public partial class NewAzNetworkCloudConsole_CreateExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -37,7 +40,10 @@ public partial class NewAzNetworkCloudConsole_CreateExpanded : global::System.Ma private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); /// Console represents the console of an on-premises Network Cloud virtual machine. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsole _consoleParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.Console(); + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsole _consoleParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Console(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] @@ -49,6 +55,9 @@ public partial class NewAzNetworkCloudConsole_CreateExpanded : global::System.Ma [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -70,9 +79,9 @@ public partial class NewAzNetworkCloudConsole_CreateExpanded : global::System.Ma ReadOnly = false, Description = @"The indicator of whether the console access is enabled.", SerializedName = @"enabled", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ConsoleEnabled) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ConsoleEnabled))] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ConsoleEnabled Enabled { get => _consoleParametersBody.Enabled; set => _consoleParametersBody.Enabled = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("True", "False")] + public string Enabled { get => _consoleParametersBody.Enabled ?? null; set => _consoleParametersBody.Enabled = value; } /// The date and time after which the key will be disallowed access. [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The date and time after which the key will be disallowed access.")] @@ -107,6 +116,9 @@ public partial class NewAzNetworkCloudConsole_CreateExpanded : global::System.Ma PossibleTypes = new [] { typeof(string) })] public string ExtendedLocationType { get => _consoleParametersBody.ExtendedLocationType ?? null; set => _consoleParametersBody.ExtendedLocationType = 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] @@ -201,7 +213,7 @@ public partial class NewAzNetworkCloudConsole_CreateExpanded : global::System.Ma /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,7 +270,8 @@ public partial class NewAzNetworkCloudConsole_CreateExpanded : global::System.Ma [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -271,8 +284,8 @@ public partial class NewAzNetworkCloudConsole_CreateExpanded : global::System.Ma ReadOnly = false, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceTags) })] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceTags Tag { get => _consoleParametersBody.Tag ?? null /* object */; set => _consoleParametersBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceTags Tag { get => _consoleParametersBody.Tag ?? null /* object */; set => _consoleParametersBody.Tag = value; } /// Backing field for property. private string _virtualMachineName; @@ -293,24 +306,24 @@ public partial class NewAzNetworkCloudConsole_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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IConsole + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsole /// 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) @@ -424,11 +437,36 @@ 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.NetworkCloud.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -440,10 +478,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -453,7 +507,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public NewAzNetworkCloudConsole_CreateExpanded() { @@ -519,7 +573,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -532,12 +586,12 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.ConsolesCreateOrUpdate(SubscriptionId, ResourceGroupName, VirtualMachineName, Name, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _consoleParametersBody, onOk, onDefault, this, Pipeline); + await this.Client.ConsolesCreateOrUpdate(SubscriptionId, ResourceGroupName, VirtualMachineName, Name, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _consoleParametersBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate); await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,VirtualMachineName=VirtualMachineName,Name=Name,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null,body=_consoleParametersBody}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,VirtualMachineName=VirtualMachineName,Name=Name,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -575,12 +629,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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ) { @@ -597,15 +651,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.NetworkCloud.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, VirtualMachineName=VirtualMachineName, Name=Name, IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, body=_consoleParametersBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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, VirtualMachineName=VirtualMachineName, Name=Name, IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, body=_consoleParametersBody }) + 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 } }); @@ -615,12 +669,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.NetworkCloud.Models.Api20250201.IConsole + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsole /// 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 ) { @@ -632,8 +686,9 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsole - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsole + var result = (await response); + WriteObject(result, false); } } } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/NewAzNetworkCloudConsole_CreateViaIdentityVirtualMachineExpanded.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/NewAzNetworkCloudConsole_CreateViaIdentityVirtualMachineExpanded.cs new file mode 100644 index 000000000000..96b84605b3d9 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/NewAzNetworkCloudConsole_CreateViaIdentityVirtualMachineExpanded.cs @@ -0,0 +1,677 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; + using System; + + /// + /// create a new virtual machine console or create the properties of the existing virtual machine console. + /// + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/virtualMachines/{virtualMachineName}/consoles/{consoleName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzNetworkCloudConsole_CreateViaIdentityVirtualMachineExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsole))] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"create a new virtual machine console or create the properties of the existing virtual machine console.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/virtualMachines/{virtualMachineName}/consoles/{consoleName}", ApiVersion = "2025-02-01")] + public partial class NewAzNetworkCloudConsole_CreateViaIdentityVirtualMachineExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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(); + + /// Console represents the console of an on-premises Network Cloud virtual machine. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsole _consoleParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Console(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// The indicator of whether the console access is enabled. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The indicator of whether the console access is enabled.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The indicator of whether the console access is enabled.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("True", "False")] + public string Enabled { get => _consoleParametersBody.Enabled ?? null; set => _consoleParametersBody.Enabled = value; } + + /// The date and time after which the key will be disallowed access. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The date and time after which the key will be disallowed access.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The date and time after which the key will be disallowed access.", + SerializedName = @"expiration", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + public global::System.DateTime Expiration { get => _consoleParametersBody.Expiration ?? default(global::System.DateTime); set => _consoleParametersBody.Expiration = value; } + + /// The resource ID of the extended location on which the resource will be created. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The resource ID of the extended location on which the resource will be created.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource ID of the extended location on which the resource will be created.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + public string ExtendedLocationName { get => _consoleParametersBody.ExtendedLocationName ?? null; set => _consoleParametersBody.ExtendedLocationName = value; } + + /// The extended location type, for example, CustomLocation. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The extended location type, for example, CustomLocation.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The extended location type, for example, CustomLocation.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + public string ExtendedLocationType { get => _consoleParametersBody.ExtendedLocationType ?? null; set => _consoleParametersBody.ExtendedLocationType = 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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private string _ifMatch; + + /// + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value + /// to prevent accidentally overwriting concurrent changes. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes.", + SerializedName = @"If-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Header)] + public string IfMatch { get => this._ifMatch; set => this._ifMatch = value; } + + /// Backing field for property. + private string _ifNoneMatch; + + /// + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result + /// in error from server as they are not supported. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result in error from server as they are not supported.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result in error from server as they are not supported.", + SerializedName = @"If-None-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Header)] + public string IfNoneMatch { get => this._ifNoneMatch; set => this._ifNoneMatch = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// The geo-location where the resource lives + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The geo-location where the resource lives")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The geo-location where the resource lives", + SerializedName = @"location", + PossibleTypes = new [] { typeof(string) })] + public string Location { get => _consoleParametersBody.Location ?? null; set => _consoleParametersBody.Location = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of the virtual machine console. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the virtual machine console.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the virtual machine console.", + SerializedName = @"consoleName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("ConsoleName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// The SSH public key data. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The SSH public key data.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The SSH public key data.", + SerializedName = @"keyData", + PossibleTypes = new [] { typeof(string) })] + public string SshPublicKeyData { get => _consoleParametersBody.SshPublicKeyData ?? null; set => _consoleParametersBody.SshPublicKeyData = value; } + + /// Resource tags. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ExportAs(typeof(global::System.Collections.Hashtable))] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Resource tags.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Resource tags.", + SerializedName = @"tags", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceTags Tag { get => _consoleParametersBody.Tag ?? null /* object */; set => _consoleParametersBody.Tag = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity _virtualMachineInputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity VirtualMachineInputObject { get => this._virtualMachineInputObject; set => this._virtualMachineInputObject = 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.NetworkCloud.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.NetworkCloud.Models.IConsole + /// 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.NetworkCloud.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of NewAzNetworkCloudConsole_CreateViaIdentityVirtualMachineExpanded + /// + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets.NewAzNetworkCloudConsole_CreateViaIdentityVirtualMachineExpanded Clone() + { + var clone = new NewAzNetworkCloudConsole_CreateViaIdentityVirtualMachineExpanded(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone._consoleParametersBody = this._consoleParametersBody; + clone.IfMatch = this.IfMatch; + clone.IfNoneMatch = this.IfNoneMatch; + clone.Name = this.Name; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 NewAzNetworkCloudConsole_CreateViaIdentityVirtualMachineExpanded() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ConsolesCreateOrUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (VirtualMachineInputObject?.Id != null) + { + this.VirtualMachineInputObject.Id += $"/consoles/{(global::System.Uri.EscapeDataString(this.Name.ToString()))}"; + await this.Client.ConsolesCreateOrUpdateViaIdentity(VirtualMachineInputObject.Id, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _consoleParametersBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate); + } + else + { + // try to call with PATH parameters from Input Object + if (null == VirtualMachineInputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("VirtualMachineInputObject has null value for VirtualMachineInputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, VirtualMachineInputObject) ); + } + if (null == VirtualMachineInputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("VirtualMachineInputObject has null value for VirtualMachineInputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, VirtualMachineInputObject) ); + } + if (null == VirtualMachineInputObject.VirtualMachineName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("VirtualMachineInputObject has null value for VirtualMachineInputObject.VirtualMachineName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, VirtualMachineInputObject) ); + } + await this.Client.ConsolesCreateOrUpdate(VirtualMachineInputObject.SubscriptionId ?? null, VirtualMachineInputObject.ResourceGroupName ?? null, VirtualMachineInputObject.VirtualMachineName ?? null, Name, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _consoleParametersBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Name=Name,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.IConsole + /// 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.NetworkCloud.Models.IConsole + var result = (await response); + WriteObject(result, false); + } + } + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/NewAzNetworkCloudConsole_CreateViaJsonFilePath.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/NewAzNetworkCloudConsole_CreateViaJsonFilePath.cs new file mode 100644 index 000000000000..ee89ed912fc4 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/NewAzNetworkCloudConsole_CreateViaJsonFilePath.cs @@ -0,0 +1,629 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; + using System; + + /// + /// create a new virtual machine console or create the properties of the existing virtual machine console. + /// + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/virtualMachines/{virtualMachineName}/consoles/{consoleName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzNetworkCloudConsole_CreateViaJsonFilePath", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsole))] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"create a new virtual machine console or create the properties of the existing virtual machine console.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/virtualMachines/{virtualMachineName}/consoles/{consoleName}", ApiVersion = "2025-02-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.NotSuggestDefaultParameterSet] + public partial class NewAzNetworkCloudConsole_CreateViaJsonFilePath : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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(); + + public global::System.String _jsonString; + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private string _ifMatch; + + /// + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value + /// to prevent accidentally overwriting concurrent changes. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes.", + SerializedName = @"If-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Header)] + public string IfMatch { get => this._ifMatch; set => this._ifMatch = value; } + + /// Backing field for property. + private string _ifNoneMatch; + + /// + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result + /// in error from server as they are not supported. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result in error from server as they are not supported.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result in error from server as they are not supported.", + SerializedName = @"If-None-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Header)] + public string IfNoneMatch { get => this._ifNoneMatch; set => this._ifNoneMatch = 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 _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.NetworkCloud.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.NetworkCloud.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of the virtual machine console. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the virtual machine console.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the virtual machine console.", + SerializedName = @"consoleName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("ConsoleName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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. The value must be an UUID. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription. The value must be an UUID.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription. The value must be an UUID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Backing field for property. + private string _virtualMachineName; + + /// The name of the virtual machine. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the virtual machine.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the virtual machine.", + SerializedName = @"virtualMachineName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] + public string VirtualMachineName { get => this._virtualMachineName; set => this._virtualMachineName = 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.NetworkCloud.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.NetworkCloud.Models.IConsole + /// 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.NetworkCloud.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of NewAzNetworkCloudConsole_CreateViaJsonFilePath + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets.NewAzNetworkCloudConsole_CreateViaJsonFilePath Clone() + { + var clone = new NewAzNetworkCloudConsole_CreateViaJsonFilePath(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.VirtualMachineName = this.VirtualMachineName; + clone.Name = this.Name; + clone.IfMatch = this.IfMatch; + clone.IfNoneMatch = this.IfNoneMatch; + clone.JsonFilePath = this.JsonFilePath; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 NewAzNetworkCloudConsole_CreateViaJsonFilePath() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ConsolesCreateOrUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ConsolesCreateOrUpdateViaJsonString(SubscriptionId, ResourceGroupName, VirtualMachineName, Name, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _jsonString, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,VirtualMachineName=VirtualMachineName,Name=Name,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.IConsole + /// 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.NetworkCloud.Models.IConsole + var result = (await response); + WriteObject(result, false); + } + } + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/NewAzNetworkCloudConsole_CreateViaJsonString.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/NewAzNetworkCloudConsole_CreateViaJsonString.cs new file mode 100644 index 000000000000..35763d8bafbb --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/NewAzNetworkCloudConsole_CreateViaJsonString.cs @@ -0,0 +1,627 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; + using System; + + /// + /// create a new virtual machine console or create the properties of the existing virtual machine console. + /// + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/virtualMachines/{virtualMachineName}/consoles/{consoleName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzNetworkCloudConsole_CreateViaJsonString", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsole))] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"create a new virtual machine console or create the properties of the existing virtual machine console.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/virtualMachines/{virtualMachineName}/consoles/{consoleName}", ApiVersion = "2025-02-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.NotSuggestDefaultParameterSet] + public partial class NewAzNetworkCloudConsole_CreateViaJsonString : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private string _ifMatch; + + /// + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value + /// to prevent accidentally overwriting concurrent changes. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes.", + SerializedName = @"If-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Header)] + public string IfMatch { get => this._ifMatch; set => this._ifMatch = value; } + + /// Backing field for property. + private string _ifNoneMatch; + + /// + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result + /// in error from server as they are not supported. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result in error from server as they are not supported.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result in error from server as they are not supported.", + SerializedName = @"If-None-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Header)] + public string IfNoneMatch { get => this._ifNoneMatch; set => this._ifNoneMatch = 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 Create operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Json string supplied to the Create operation")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of the virtual machine console. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the virtual machine console.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the virtual machine console.", + SerializedName = @"consoleName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("ConsoleName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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. The value must be an UUID. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription. The value must be an UUID.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription. The value must be an UUID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Backing field for property. + private string _virtualMachineName; + + /// The name of the virtual machine. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the virtual machine.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the virtual machine.", + SerializedName = @"virtualMachineName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] + public string VirtualMachineName { get => this._virtualMachineName; set => this._virtualMachineName = 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.NetworkCloud.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.NetworkCloud.Models.IConsole + /// 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.NetworkCloud.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of NewAzNetworkCloudConsole_CreateViaJsonString + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets.NewAzNetworkCloudConsole_CreateViaJsonString Clone() + { + var clone = new NewAzNetworkCloudConsole_CreateViaJsonString(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.VirtualMachineName = this.VirtualMachineName; + clone.Name = this.Name; + clone.IfMatch = this.IfMatch; + clone.IfNoneMatch = this.IfNoneMatch; + clone.JsonString = this.JsonString; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 NewAzNetworkCloudConsole_CreateViaJsonString() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ConsolesCreateOrUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ConsolesCreateOrUpdateViaJsonString(SubscriptionId, ResourceGroupName, VirtualMachineName, Name, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _jsonString, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,VirtualMachineName=VirtualMachineName,Name=Name,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.IConsole + /// 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.NetworkCloud.Models.IConsole + var result = (await response); + WriteObject(result, false); + } + } + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/NewAzNetworkCloudKubernetesClusterFeature_CreateExpanded.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/NewAzNetworkCloudKubernetesClusterFeature_CreateExpanded.cs index cb91c810ad51..5372d5f0f364 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/NewAzNetworkCloudKubernetesClusterFeature_CreateExpanded.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/NewAzNetworkCloudKubernetesClusterFeature_CreateExpanded.cs @@ -6,22 +6,24 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// - /// Create a new Kubernetes cluster feature or update properties of the Kubernetes cluster feature if it exists. + /// create a new Kubernetes cluster feature or create properties of the Kubernetes cluster feature if it exists. /// /// /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/kubernetesClusters/{kubernetesClusterName}/features/{featureName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzNetworkCloudKubernetesClusterFeature_CreateExpanded", SupportsShouldProcess = true)] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeature", "15.0.0", "2.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"Option"}, NewOutputProperties=new string[] {"Option"}, ChangeDescription="The type of property will be changed from fixed array to 'List'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeature))] - [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Create a new Kubernetes cluster feature or update properties of the Kubernetes cluster feature if it exists.")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeature))] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"create a new Kubernetes cluster feature or create properties of the Kubernetes cluster feature if it exists.")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/kubernetesClusters/{kubernetesClusterName}/features/{featureName}", ApiVersion = "2025-02-01")] public partial class NewAzNetworkCloudKubernetesClusterFeature_CreateExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -37,8 +39,11 @@ public partial class NewAzNetworkCloudKubernetesClusterFeature_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(); + /// KubernetesClusterFeature represents the feature of a Kubernetes cluster. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeature _kubernetesClusterFeatureParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.KubernetesClusterFeature(); + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeature _kubernetesClusterFeatureParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.KubernetesClusterFeature(); /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] @@ -50,6 +55,9 @@ public partial class NewAzNetworkCloudKubernetesClusterFeature_CreateExpanded : [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -63,6 +71,9 @@ public partial class NewAzNetworkCloudKubernetesClusterFeature_CreateExpanded : [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 _featureName; @@ -176,13 +187,13 @@ public partial class NewAzNetworkCloudKubernetesClusterFeature_CreateExpanded : ReadOnly = false, Description = @"The configured options for the feature.", SerializedName = @"options", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStringKeyValuePair) })] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStringKeyValuePair[] Option { get => _kubernetesClusterFeatureParametersBody.Option ?? null /* arrayOf */; set => _kubernetesClusterFeatureParametersBody.Option = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStringKeyValuePair) })] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStringKeyValuePair[] Option { get => _kubernetesClusterFeatureParametersBody.Option?.ToArray() ?? null /* fixedArrayOf */; set => _kubernetesClusterFeatureParametersBody.Option = (value != null ? new System.Collections.Generic.List(value) : null); } /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 +239,8 @@ public partial class NewAzNetworkCloudKubernetesClusterFeature_CreateExpanded : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -241,32 +253,32 @@ public partial class NewAzNetworkCloudKubernetesClusterFeature_CreateExpanded : ReadOnly = false, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceTags) })] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceTags Tag { get => _kubernetesClusterFeatureParametersBody.Tag ?? null /* object */; set => _kubernetesClusterFeatureParametersBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceTags Tag { get => _kubernetesClusterFeatureParametersBody.Tag ?? null /* object */; set => _kubernetesClusterFeatureParametersBody.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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IKubernetesClusterFeature + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeature /// 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) @@ -382,11 +394,36 @@ 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.NetworkCloud.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -398,10 +435,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -411,7 +464,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public NewAzNetworkCloudKubernetesClusterFeature_CreateExpanded() { @@ -477,7 +530,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -490,12 +543,12 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.KubernetesClusterFeaturesCreateOrUpdate(SubscriptionId, ResourceGroupName, KubernetesClusterName, FeatureName, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _kubernetesClusterFeatureParametersBody, onOk, onDefault, this, Pipeline); + await this.Client.KubernetesClusterFeaturesCreateOrUpdate(SubscriptionId, ResourceGroupName, KubernetesClusterName, FeatureName, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _kubernetesClusterFeatureParametersBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate); await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,KubernetesClusterName=KubernetesClusterName,FeatureName=FeatureName,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null,body=_kubernetesClusterFeatureParametersBody}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,KubernetesClusterName=KubernetesClusterName,FeatureName=FeatureName,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -533,12 +586,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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ) { @@ -555,15 +608,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.NetworkCloud.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, KubernetesClusterName=KubernetesClusterName, FeatureName=FeatureName, IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, body=_kubernetesClusterFeatureParametersBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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, KubernetesClusterName=KubernetesClusterName, FeatureName=FeatureName, IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, body=_kubernetesClusterFeatureParametersBody }) + 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 } }); @@ -573,12 +626,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.NetworkCloud.Models.Api20250201.IKubernetesClusterFeature + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeature /// 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 ) { @@ -590,8 +643,9 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeature - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeature + var result = (await response); + WriteObject(result, false); } } } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/NewAzNetworkCloudKubernetesClusterFeature_CreateViaIdentityKubernetesClusterExpanded.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/NewAzNetworkCloudKubernetesClusterFeature_CreateViaIdentityKubernetesClusterExpanded.cs new file mode 100644 index 000000000000..ce6062759ee4 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/NewAzNetworkCloudKubernetesClusterFeature_CreateViaIdentityKubernetesClusterExpanded.cs @@ -0,0 +1,632 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; + using System; + + /// + /// create a new Kubernetes cluster feature or create properties of the Kubernetes cluster feature if it exists. + /// + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/kubernetesClusters/{kubernetesClusterName}/features/{featureName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzNetworkCloudKubernetesClusterFeature_CreateViaIdentityKubernetesClusterExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeature))] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"create a new Kubernetes cluster feature or create properties of the Kubernetes cluster feature if it exists.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/kubernetesClusters/{kubernetesClusterName}/features/{featureName}", ApiVersion = "2025-02-01")] + public partial class NewAzNetworkCloudKubernetesClusterFeature_CreateViaIdentityKubernetesClusterExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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(); + + /// KubernetesClusterFeature represents the feature of a Kubernetes cluster. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeature _kubernetesClusterFeatureParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.KubernetesClusterFeature(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 _featureName; + + /// The name of the feature. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the feature.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the feature.", + SerializedName = @"featureName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] + public string FeatureName { get => this._featureName; set => this._featureName = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private string _ifMatch; + + /// + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value + /// to prevent accidentally overwriting concurrent changes. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes.", + SerializedName = @"If-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Header)] + public string IfMatch { get => this._ifMatch; set => this._ifMatch = value; } + + /// Backing field for property. + private string _ifNoneMatch; + + /// + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result + /// in error from server as they are not supported. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result in error from server as they are not supported.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result in error from server as they are not supported.", + SerializedName = @"If-None-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Header)] + public string IfNoneMatch { get => this._ifNoneMatch; set => this._ifNoneMatch = 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 Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity _kubernetesClusterInputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity KubernetesClusterInputObject { get => this._kubernetesClusterInputObject; set => this._kubernetesClusterInputObject = value; } + + /// The geo-location where the resource lives + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The geo-location where the resource lives")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The geo-location where the resource lives", + SerializedName = @"location", + PossibleTypes = new [] { typeof(string) })] + public string Location { get => _kubernetesClusterFeatureParametersBody.Location ?? null; set => _kubernetesClusterFeatureParametersBody.Location = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// The configured options for the feature. + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The configured options for the feature.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The configured options for the feature.", + SerializedName = @"options", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStringKeyValuePair) })] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStringKeyValuePair[] Option { get => _kubernetesClusterFeatureParametersBody.Option?.ToArray() ?? null /* fixedArrayOf */; set => _kubernetesClusterFeatureParametersBody.Option = (value != null ? new System.Collections.Generic.List(value) : null); } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Resource tags. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ExportAs(typeof(global::System.Collections.Hashtable))] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Resource tags.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Resource tags.", + SerializedName = @"tags", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceTags Tag { get => _kubernetesClusterFeatureParametersBody.Tag ?? null /* object */; set => _kubernetesClusterFeatureParametersBody.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.NetworkCloud.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.NetworkCloud.Models.IKubernetesClusterFeature + /// 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.NetworkCloud.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of NewAzNetworkCloudKubernetesClusterFeature_CreateViaIdentityKubernetesClusterExpanded + /// + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets.NewAzNetworkCloudKubernetesClusterFeature_CreateViaIdentityKubernetesClusterExpanded Clone() + { + var clone = new NewAzNetworkCloudKubernetesClusterFeature_CreateViaIdentityKubernetesClusterExpanded(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone._kubernetesClusterFeatureParametersBody = this._kubernetesClusterFeatureParametersBody; + clone.IfMatch = this.IfMatch; + clone.IfNoneMatch = this.IfNoneMatch; + clone.FeatureName = this.FeatureName; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 NewAzNetworkCloudKubernetesClusterFeature_CreateViaIdentityKubernetesClusterExpanded() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'KubernetesClusterFeaturesCreateOrUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (KubernetesClusterInputObject?.Id != null) + { + this.KubernetesClusterInputObject.Id += $"/features/{(global::System.Uri.EscapeDataString(this.FeatureName.ToString()))}"; + await this.Client.KubernetesClusterFeaturesCreateOrUpdateViaIdentity(KubernetesClusterInputObject.Id, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _kubernetesClusterFeatureParametersBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate); + } + else + { + // try to call with PATH parameters from Input Object + if (null == KubernetesClusterInputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("KubernetesClusterInputObject has null value for KubernetesClusterInputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, KubernetesClusterInputObject) ); + } + if (null == KubernetesClusterInputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("KubernetesClusterInputObject has null value for KubernetesClusterInputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, KubernetesClusterInputObject) ); + } + if (null == KubernetesClusterInputObject.KubernetesClusterName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("KubernetesClusterInputObject has null value for KubernetesClusterInputObject.KubernetesClusterName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, KubernetesClusterInputObject) ); + } + await this.Client.KubernetesClusterFeaturesCreateOrUpdate(KubernetesClusterInputObject.SubscriptionId ?? null, KubernetesClusterInputObject.ResourceGroupName ?? null, KubernetesClusterInputObject.KubernetesClusterName ?? null, FeatureName, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _kubernetesClusterFeatureParametersBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { FeatureName=FeatureName,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.IKubernetesClusterFeature + /// 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.NetworkCloud.Models.IKubernetesClusterFeature + var result = (await response); + WriteObject(result, false); + } + } + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/NewAzNetworkCloudKubernetesClusterFeature_CreateViaJsonFilePath.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/NewAzNetworkCloudKubernetesClusterFeature_CreateViaJsonFilePath.cs new file mode 100644 index 000000000000..0285c95783ba --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/NewAzNetworkCloudKubernetesClusterFeature_CreateViaJsonFilePath.cs @@ -0,0 +1,631 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; + using System; + + /// + /// create a new Kubernetes cluster feature or create properties of the Kubernetes cluster feature if it exists. + /// + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/kubernetesClusters/{kubernetesClusterName}/features/{featureName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzNetworkCloudKubernetesClusterFeature_CreateViaJsonFilePath", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeature))] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"create a new Kubernetes cluster feature or create properties of the Kubernetes cluster feature if it exists.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/kubernetesClusters/{kubernetesClusterName}/features/{featureName}", ApiVersion = "2025-02-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.NotSuggestDefaultParameterSet] + public partial class NewAzNetworkCloudKubernetesClusterFeature_CreateViaJsonFilePath : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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(); + + public global::System.String _jsonString; + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 _featureName; + + /// The name of the feature. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the feature.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the feature.", + SerializedName = @"featureName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] + public string FeatureName { get => this._featureName; set => this._featureName = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private string _ifMatch; + + /// + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value + /// to prevent accidentally overwriting concurrent changes. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes.", + SerializedName = @"If-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Header)] + public string IfMatch { get => this._ifMatch; set => this._ifMatch = value; } + + /// Backing field for property. + private string _ifNoneMatch; + + /// + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result + /// in error from server as they are not supported. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result in error from server as they are not supported.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result in error from server as they are not supported.", + SerializedName = @"If-None-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Header)] + public string IfNoneMatch { get => this._ifNoneMatch; set => this._ifNoneMatch = 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 _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.NetworkCloud.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 _kubernetesClusterName; + + /// The name of the Kubernetes cluster. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the Kubernetes cluster.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the Kubernetes cluster.", + SerializedName = @"kubernetesClusterName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] + public string KubernetesClusterName { get => this._kubernetesClusterName; set => this._kubernetesClusterName = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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. The value must be an UUID. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription. The value must be an UUID.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription. The value must be an UUID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.IKubernetesClusterFeature + /// 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.NetworkCloud.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of NewAzNetworkCloudKubernetesClusterFeature_CreateViaJsonFilePath + /// + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets.NewAzNetworkCloudKubernetesClusterFeature_CreateViaJsonFilePath Clone() + { + var clone = new NewAzNetworkCloudKubernetesClusterFeature_CreateViaJsonFilePath(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.KubernetesClusterName = this.KubernetesClusterName; + clone.FeatureName = this.FeatureName; + clone.IfMatch = this.IfMatch; + clone.IfNoneMatch = this.IfNoneMatch; + clone.JsonFilePath = this.JsonFilePath; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 NewAzNetworkCloudKubernetesClusterFeature_CreateViaJsonFilePath() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'KubernetesClusterFeaturesCreateOrUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.KubernetesClusterFeaturesCreateOrUpdateViaJsonString(SubscriptionId, ResourceGroupName, KubernetesClusterName, FeatureName, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _jsonString, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,KubernetesClusterName=KubernetesClusterName,FeatureName=FeatureName,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.IKubernetesClusterFeature + /// 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.NetworkCloud.Models.IKubernetesClusterFeature + var result = (await response); + WriteObject(result, false); + } + } + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/NewAzNetworkCloudKubernetesClusterFeature_CreateViaJsonString.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/NewAzNetworkCloudKubernetesClusterFeature_CreateViaJsonString.cs new file mode 100644 index 000000000000..8c405fca9e61 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/NewAzNetworkCloudKubernetesClusterFeature_CreateViaJsonString.cs @@ -0,0 +1,629 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; + using System; + + /// + /// create a new Kubernetes cluster feature or create properties of the Kubernetes cluster feature if it exists. + /// + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/kubernetesClusters/{kubernetesClusterName}/features/{featureName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzNetworkCloudKubernetesClusterFeature_CreateViaJsonString", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeature))] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"create a new Kubernetes cluster feature or create properties of the Kubernetes cluster feature if it exists.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/kubernetesClusters/{kubernetesClusterName}/features/{featureName}", ApiVersion = "2025-02-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.NotSuggestDefaultParameterSet] + public partial class NewAzNetworkCloudKubernetesClusterFeature_CreateViaJsonString : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 _featureName; + + /// The name of the feature. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the feature.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the feature.", + SerializedName = @"featureName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] + public string FeatureName { get => this._featureName; set => this._featureName = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private string _ifMatch; + + /// + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value + /// to prevent accidentally overwriting concurrent changes. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes.", + SerializedName = @"If-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Header)] + public string IfMatch { get => this._ifMatch; set => this._ifMatch = value; } + + /// Backing field for property. + private string _ifNoneMatch; + + /// + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result + /// in error from server as they are not supported. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result in error from server as they are not supported.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result in error from server as they are not supported.", + SerializedName = @"If-None-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Header)] + public string IfNoneMatch { get => this._ifNoneMatch; set => this._ifNoneMatch = 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 Create operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Json string supplied to the Create operation")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 _kubernetesClusterName; + + /// The name of the Kubernetes cluster. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the Kubernetes cluster.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the Kubernetes cluster.", + SerializedName = @"kubernetesClusterName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] + public string KubernetesClusterName { get => this._kubernetesClusterName; set => this._kubernetesClusterName = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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. The value must be an UUID. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription. The value must be an UUID.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription. The value must be an UUID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.IKubernetesClusterFeature + /// 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.NetworkCloud.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of NewAzNetworkCloudKubernetesClusterFeature_CreateViaJsonString + /// + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets.NewAzNetworkCloudKubernetesClusterFeature_CreateViaJsonString Clone() + { + var clone = new NewAzNetworkCloudKubernetesClusterFeature_CreateViaJsonString(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.KubernetesClusterName = this.KubernetesClusterName; + clone.FeatureName = this.FeatureName; + clone.IfMatch = this.IfMatch; + clone.IfNoneMatch = this.IfNoneMatch; + clone.JsonString = this.JsonString; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 NewAzNetworkCloudKubernetesClusterFeature_CreateViaJsonString() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'KubernetesClusterFeaturesCreateOrUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.KubernetesClusterFeaturesCreateOrUpdateViaJsonString(SubscriptionId, ResourceGroupName, KubernetesClusterName, FeatureName, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _jsonString, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,KubernetesClusterName=KubernetesClusterName,FeatureName=FeatureName,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.IKubernetesClusterFeature + /// 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.NetworkCloud.Models.IKubernetesClusterFeature + var result = (await response); + WriteObject(result, false); + } + } + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/NewAzNetworkCloudKubernetesCluster_CreateExpanded.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/NewAzNetworkCloudKubernetesCluster_CreateExpanded.cs index ad227bee6586..c86255ac9351 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/NewAzNetworkCloudKubernetesCluster_CreateExpanded.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/NewAzNetworkCloudKubernetesCluster_CreateExpanded.cs @@ -6,20 +6,22 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; - /// Create a new Kubernetes cluster or update the properties of the existing one. + /// create a new Kubernetes cluster or create the properties of the existing one. /// /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/kubernetesClusters/{kubernetesClusterName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzNetworkCloudKubernetesCluster_CreateExpanded", SupportsShouldProcess = true)] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesCluster", "15.0.0", "2.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"AadConfigurationAdminGroupObjectId","AdministratorConfigurationSshPublicKey","AttachedNetworkConfigurationL2Network","AttachedNetworkConfigurationL3Network","AttachedNetworkConfigurationTrunkedNetwork","AttachedNetworkId","AvailabilityZone","AvailableUpgrade","BgpServiceLoadBalancerConfigurationBgpAdvertisement","BgpServiceLoadBalancerConfigurationBgpPeer","BgpServiceLoadBalancerConfigurationIPAddressPool","ControlPlaneNodeConfigurationAdministratorConfigurationSshPublicKey","ControlPlaneNodeConfigurationAvailabilityZone","FeatureStatuses","InitialAgentPoolConfiguration","L2ServiceLoadBalancerConfigurationIPAddressPool","Label","NetworkConfigurationPodCidr","NetworkConfigurationServiceCidr","Node","SshPublicKey","Taint"}, NewOutputProperties=new string[] {"AadConfigurationAdminGroupObjectId","AdministratorConfigurationSshPublicKey","AttachedNetworkConfigurationL2Network","AttachedNetworkConfigurationL3Network","AttachedNetworkConfigurationTrunkedNetwork","AttachedNetworkId","AvailabilityZone","AvailableUpgrade","BgpServiceLoadBalancerConfigurationBgpAdvertisement","BgpServiceLoadBalancerConfigurationBgpPeer","BgpServiceLoadBalancerConfigurationIPAddressPool","ControlPlaneNodeConfigurationAdministratorConfigurationSshPublicKey","ControlPlaneNodeConfigurationAvailabilityZone","FeatureStatuses","InitialAgentPoolConfiguration","L2ServiceLoadBalancerConfigurationIPAddressPool","Label","NetworkConfigurationPodCidr","NetworkConfigurationServiceCidr","Node","SshPublicKey","Taint"}, ChangeDescription="The type of properties will be changed from fixed array to 'List'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesCluster))] - [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Create a new Kubernetes cluster or update the properties of the existing one.")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesCluster))] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"create a new Kubernetes cluster or create the properties of the existing one.")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/kubernetesClusters/{kubernetesClusterName}", ApiVersion = "2025-02-01")] public partial class NewAzNetworkCloudKubernetesCluster_CreateExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,8 +37,11 @@ public partial class NewAzNetworkCloudKubernetesCluster_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(); + /// KubernetesCluster represents the Kubernetes cluster hosted on Network Cloud. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesCluster _kubernetesClusterParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.KubernetesCluster(); + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesCluster _kubernetesClusterParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.KubernetesCluster(); /// /// The list of Azure Active Directory group object IDs that will have an administrative role on the Kubernetes cluster. @@ -50,7 +55,7 @@ public partial class NewAzNetworkCloudKubernetesCluster_CreateExpanded : global: Description = @"The list of Azure Active Directory group object IDs that will have an administrative role on the Kubernetes cluster.", SerializedName = @"adminGroupObjectIds", PossibleTypes = new [] { typeof(string) })] - public string[] AadConfigurationAdminGroupObjectId { get => _kubernetesClusterParametersBody.AadConfigurationAdminGroupObjectId ?? null /* arrayOf */; set => _kubernetesClusterParametersBody.AadConfigurationAdminGroupObjectId = value; } + public string[] AadConfigurationAdminGroupObjectId { get => _kubernetesClusterParametersBody.AadConfigurationAdminGroupObjectId?.ToArray() ?? null /* fixedArrayOf */; set => _kubernetesClusterParametersBody.AadConfigurationAdminGroupObjectId = (value != null ? new System.Collections.Generic.List(value) : null); } /// /// The user name for the administrator that will be applied to the operating systems that run Kubernetes nodes. If not supplied, @@ -80,8 +85,8 @@ public partial class NewAzNetworkCloudKubernetesCluster_CreateExpanded : global: ReadOnly = false, Description = @"The list of Layer 2 Networks and related configuration for attachment.", SerializedName = @"l2Networks", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkAttachmentConfiguration) })] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkAttachmentConfiguration[] AttachedNetworkConfigurationL2Network { get => _kubernetesClusterParametersBody.AttachedNetworkConfigurationL2Network ?? null /* arrayOf */; set => _kubernetesClusterParametersBody.AttachedNetworkConfigurationL2Network = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkAttachmentConfiguration) })] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkAttachmentConfiguration[] AttachedNetworkConfigurationL2Network { get => _kubernetesClusterParametersBody.AttachedNetworkConfigurationL2Network?.ToArray() ?? null /* fixedArrayOf */; set => _kubernetesClusterParametersBody.AttachedNetworkConfigurationL2Network = (value != null ? new System.Collections.Generic.List(value) : null); } /// The list of Layer 3 Networks and related configuration for attachment. [global::System.Management.Automation.AllowEmptyCollection] @@ -92,8 +97,8 @@ public partial class NewAzNetworkCloudKubernetesCluster_CreateExpanded : global: ReadOnly = false, Description = @"The list of Layer 3 Networks and related configuration for attachment.", SerializedName = @"l3Networks", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkAttachmentConfiguration) })] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkAttachmentConfiguration[] AttachedNetworkConfigurationL3Network { get => _kubernetesClusterParametersBody.AttachedNetworkConfigurationL3Network ?? null /* arrayOf */; set => _kubernetesClusterParametersBody.AttachedNetworkConfigurationL3Network = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkAttachmentConfiguration) })] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkAttachmentConfiguration[] AttachedNetworkConfigurationL3Network { get => _kubernetesClusterParametersBody.AttachedNetworkConfigurationL3Network?.ToArray() ?? null /* fixedArrayOf */; set => _kubernetesClusterParametersBody.AttachedNetworkConfigurationL3Network = (value != null ? new System.Collections.Generic.List(value) : null); } /// The list of Trunked Networks and related configuration for attachment. [global::System.Management.Automation.AllowEmptyCollection] @@ -104,8 +109,8 @@ public partial class NewAzNetworkCloudKubernetesCluster_CreateExpanded : global: ReadOnly = false, Description = @"The list of Trunked Networks and related configuration for attachment.", SerializedName = @"trunkedNetworks", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkAttachmentConfiguration) })] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkAttachmentConfiguration[] AttachedNetworkConfigurationTrunkedNetwork { get => _kubernetesClusterParametersBody.AttachedNetworkConfigurationTrunkedNetwork ?? null /* arrayOf */; set => _kubernetesClusterParametersBody.AttachedNetworkConfigurationTrunkedNetwork = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkAttachmentConfiguration) })] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkAttachmentConfiguration[] AttachedNetworkConfigurationTrunkedNetwork { get => _kubernetesClusterParametersBody.AttachedNetworkConfigurationTrunkedNetwork?.ToArray() ?? null /* fixedArrayOf */; set => _kubernetesClusterParametersBody.AttachedNetworkConfigurationTrunkedNetwork = (value != null ? new System.Collections.Generic.List(value) : null); } /// /// The association of IP address pools to the communities and peers, allowing for announcement of IPs. @@ -118,8 +123,8 @@ public partial class NewAzNetworkCloudKubernetesCluster_CreateExpanded : global: ReadOnly = false, Description = @"The association of IP address pools to the communities and peers, allowing for announcement of IPs.", SerializedName = @"bgpAdvertisements", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBgpAdvertisement) })] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBgpAdvertisement[] BgpAdvertisement { get => _kubernetesClusterParametersBody.BgpServiceLoadBalancerConfigurationBgpAdvertisement ?? null /* arrayOf */; set => _kubernetesClusterParametersBody.BgpServiceLoadBalancerConfigurationBgpAdvertisement = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBgpAdvertisement) })] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBgpAdvertisement[] BgpAdvertisement { get => _kubernetesClusterParametersBody.BgpServiceLoadBalancerConfigurationBgpAdvertisement?.ToArray() ?? null /* fixedArrayOf */; set => _kubernetesClusterParametersBody.BgpServiceLoadBalancerConfigurationBgpAdvertisement = (value != null ? new System.Collections.Generic.List(value) : null); } /// /// The list of pools of IP addresses that can be allocated to load balancer services. @@ -132,8 +137,8 @@ public partial class NewAzNetworkCloudKubernetesCluster_CreateExpanded : global: ReadOnly = false, Description = @"The list of pools of IP addresses that can be allocated to load balancer services.", SerializedName = @"ipAddressPools", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIPAddressPool) })] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIPAddressPool[] BgpIPAddressPool { get => _kubernetesClusterParametersBody.BgpServiceLoadBalancerConfigurationIPAddressPool ?? null /* arrayOf */; set => _kubernetesClusterParametersBody.BgpServiceLoadBalancerConfigurationIPAddressPool = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IIPAddressPool) })] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IIPAddressPool[] BgpIPAddressPool { get => _kubernetesClusterParametersBody.BgpServiceLoadBalancerConfigurationIPAddressPool?.ToArray() ?? null /* fixedArrayOf */; set => _kubernetesClusterParametersBody.BgpServiceLoadBalancerConfigurationIPAddressPool = (value != null ? new System.Collections.Generic.List(value) : null); } /// /// The list of additional BgpPeer entities that the Kubernetes cluster will peer with. All peering must be explicitly defined. @@ -146,8 +151,8 @@ public partial class NewAzNetworkCloudKubernetesCluster_CreateExpanded : global: ReadOnly = false, Description = @"The list of additional BgpPeer entities that the Kubernetes cluster will peer with. All peering must be explicitly defined.", SerializedName = @"bgpPeers", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IServiceLoadBalancerBgpPeer) })] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IServiceLoadBalancerBgpPeer[] BgpPeer { get => _kubernetesClusterParametersBody.BgpServiceLoadBalancerConfigurationBgpPeer ?? null /* arrayOf */; set => _kubernetesClusterParametersBody.BgpServiceLoadBalancerConfigurationBgpPeer = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IServiceLoadBalancerBgpPeer) })] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IServiceLoadBalancerBgpPeer[] BgpPeer { get => _kubernetesClusterParametersBody.BgpServiceLoadBalancerConfigurationBgpPeer?.ToArray() ?? null /* fixedArrayOf */; set => _kubernetesClusterParametersBody.BgpServiceLoadBalancerConfigurationBgpPeer = (value != null ? new System.Collections.Generic.List(value) : null); } /// The indicator to specify if the load balancer peers with the network fabric. [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The indicator to specify if the load balancer peers with the network fabric.")] @@ -157,15 +162,18 @@ public partial class NewAzNetworkCloudKubernetesCluster_CreateExpanded : global: ReadOnly = false, Description = @"The indicator to specify if the load balancer peers with the network fabric.", SerializedName = @"fabricPeeringEnabled", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.FabricPeeringEnabled) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.FabricPeeringEnabled))] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.FabricPeeringEnabled BgpServiceLoadBalancerConfigurationFabricPeeringEnabled { get => _kubernetesClusterParametersBody.BgpServiceLoadBalancerConfigurationFabricPeeringEnabled ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.FabricPeeringEnabled)""); set => _kubernetesClusterParametersBody.BgpServiceLoadBalancerConfigurationFabricPeeringEnabled = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("True", "False")] + public string BgpServiceLoadBalancerConfigurationFabricPeeringEnabled { get => _kubernetesClusterParametersBody.BgpServiceLoadBalancerConfigurationFabricPeeringEnabled ?? null; set => _kubernetesClusterParametersBody.BgpServiceLoadBalancerConfigurationFabricPeeringEnabled = 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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -181,8 +189,8 @@ public partial class NewAzNetworkCloudKubernetesCluster_CreateExpanded : global: ReadOnly = false, Description = @"The SSH configuration for the operating systems that run the nodes in the Kubernetes cluster. In some cases, specification of public keys may be required to produce a working environment.", SerializedName = @"sshPublicKeys", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey) })] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey[] ControlPlaneNodeConfigurationAdminPublicKey { get => _kubernetesClusterParametersBody.ControlPlaneNodeConfigurationAdministratorConfigurationSshPublicKey ?? null /* arrayOf */; set => _kubernetesClusterParametersBody.ControlPlaneNodeConfigurationAdministratorConfigurationSshPublicKey = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISshPublicKey) })] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISshPublicKey[] ControlPlaneNodeConfigurationAdminPublicKey { get => _kubernetesClusterParametersBody.ControlPlaneNodeConfigurationAdministratorConfigurationSshPublicKey?.ToArray() ?? null /* fixedArrayOf */; set => _kubernetesClusterParametersBody.ControlPlaneNodeConfigurationAdministratorConfigurationSshPublicKey = (value != null ? new System.Collections.Generic.List(value) : null); } /// /// The user name for the administrator that will be applied to the operating systems that run Kubernetes nodes. If not supplied, @@ -211,7 +219,7 @@ public partial class NewAzNetworkCloudKubernetesCluster_CreateExpanded : global: Description = @"The list of availability zones of the Network Cloud cluster to be used for the provisioning of nodes in the control plane. If not specified, all availability zones will be used.", SerializedName = @"availabilityZones", PossibleTypes = new [] { typeof(string) })] - public string[] ControlPlaneNodeConfigurationAvailabilityZone { get => _kubernetesClusterParametersBody.ControlPlaneNodeConfigurationAvailabilityZone ?? null /* arrayOf */; set => _kubernetesClusterParametersBody.ControlPlaneNodeConfigurationAvailabilityZone = value; } + public string[] ControlPlaneNodeConfigurationAvailabilityZone { get => _kubernetesClusterParametersBody.ControlPlaneNodeConfigurationAvailabilityZone?.ToArray() ?? null /* fixedArrayOf */; set => _kubernetesClusterParametersBody.ControlPlaneNodeConfigurationAvailabilityZone = (value != null ? new System.Collections.Generic.List(value) : null); } /// The number of virtual machines that use this configuration. [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The number of virtual machines that use this configuration.")] @@ -267,6 +275,9 @@ public partial class NewAzNetworkCloudKubernetesCluster_CreateExpanded : global: PossibleTypes = new [] { typeof(string) })] public string ExtendedLocationType { get => _kubernetesClusterParametersBody.ExtendedLocationType ?? null; set => _kubernetesClusterParametersBody.ExtendedLocationType = 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] @@ -326,26 +337,12 @@ public partial class NewAzNetworkCloudKubernetesCluster_CreateExpanded : global: ReadOnly = false, Description = @"The agent pools that are created with this Kubernetes cluster for running critical system services and workloads. This data in this field is only used during creation, and the field will be empty following the creation of the Kubernetes Cluster. After creation, the management of agent pools is done using the agentPools sub-resource.", SerializedName = @"initialAgentPoolConfigurations", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IInitialAgentPoolConfiguration) })] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IInitialAgentPoolConfiguration[] InitialAgentPoolConfiguration { get => _kubernetesClusterParametersBody.InitialAgentPoolConfiguration ?? null /* arrayOf */; set => _kubernetesClusterParametersBody.InitialAgentPoolConfiguration = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IInitialAgentPoolConfiguration) })] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IInitialAgentPoolConfiguration[] InitialAgentPoolConfiguration { get => _kubernetesClusterParametersBody.InitialAgentPoolConfiguration?.ToArray() ?? null /* fixedArrayOf */; set => _kubernetesClusterParametersBody.InitialAgentPoolConfiguration = (value != null ? new System.Collections.Generic.List(value) : null); } /// 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 _kubernetesClusterName; - - /// The name of the Kubernetes cluster. - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the Kubernetes cluster.")] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The name of the Kubernetes cluster.", - SerializedName = @"kubernetesClusterName", - PossibleTypes = new [] { typeof(string) })] - [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] - public string KubernetesClusterName { get => this._kubernetesClusterName; set => this._kubernetesClusterName = value; } - /// The Kubernetes version for this cluster. [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The Kubernetes version for this cluster.")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Body)] @@ -368,8 +365,8 @@ public partial class NewAzNetworkCloudKubernetesCluster_CreateExpanded : global: ReadOnly = false, Description = @"The list of pools of IP addresses that can be allocated to load balancer services.", SerializedName = @"ipAddressPools", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIPAddressPool) })] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IIPAddressPool[] L2ServiceLoadBalancerConfigurationIPAddressPool { get => _kubernetesClusterParametersBody.L2ServiceLoadBalancerConfigurationIPAddressPool ?? null /* arrayOf */; set => _kubernetesClusterParametersBody.L2ServiceLoadBalancerConfigurationIPAddressPool = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IIPAddressPool) })] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IIPAddressPool[] L2ServiceLoadBalancerConfigurationIPAddressPool { get => _kubernetesClusterParametersBody.L2ServiceLoadBalancerConfigurationIPAddressPool?.ToArray() ?? null /* fixedArrayOf */; set => _kubernetesClusterParametersBody.L2ServiceLoadBalancerConfigurationIPAddressPool = (value != null ? new System.Collections.Generic.List(value) : null); } /// The geo-location where the resource lives [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The geo-location where the resource lives")] @@ -416,6 +413,21 @@ public partial class NewAzNetworkCloudKubernetesCluster_CreateExpanded : global: /// cancellation token. global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + /// Backing field for property. + private string _name; + + /// The name of the Kubernetes cluster. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the Kubernetes cluster.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the Kubernetes cluster.", + SerializedName = @"kubernetesClusterName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("KubernetesClusterName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + /// The resource ID of the associated Cloud Services network. [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The resource ID of the associated Cloud Services network.")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Body)] @@ -467,7 +479,7 @@ public partial class NewAzNetworkCloudKubernetesCluster_CreateExpanded : global: Description = @"The CIDR notation IP ranges from which to assign pod IPs. One IPv4 CIDR is expected for single-stack networking. Two CIDRs, one for each IP family (IPv4/IPv6), is expected for dual-stack networking.", SerializedName = @"podCidrs", PossibleTypes = new [] { typeof(string) })] - public string[] NetworkConfigurationPodCidr { get => _kubernetesClusterParametersBody.NetworkConfigurationPodCidr ?? null /* arrayOf */; set => _kubernetesClusterParametersBody.NetworkConfigurationPodCidr = value; } + public string[] NetworkConfigurationPodCidr { get => _kubernetesClusterParametersBody.NetworkConfigurationPodCidr?.ToArray() ?? null /* fixedArrayOf */; set => _kubernetesClusterParametersBody.NetworkConfigurationPodCidr = (value != null ? new System.Collections.Generic.List(value) : null); } /// /// The CIDR notation IP ranges from which to assign service IPs. One IPv4 CIDR is expected for single-stack networking. Two @@ -482,7 +494,7 @@ public partial class NewAzNetworkCloudKubernetesCluster_CreateExpanded : global: Description = @"The CIDR notation IP ranges from which to assign service IPs. One IPv4 CIDR is expected for single-stack networking. Two CIDRs, one for each IP family (IPv4/IPv6), is expected for dual-stack networking.", SerializedName = @"serviceCidrs", PossibleTypes = new [] { typeof(string) })] - public string[] NetworkConfigurationServiceCidr { get => _kubernetesClusterParametersBody.NetworkConfigurationServiceCidr ?? null /* arrayOf */; set => _kubernetesClusterParametersBody.NetworkConfigurationServiceCidr = value; } + public string[] NetworkConfigurationServiceCidr { get => _kubernetesClusterParametersBody.NetworkConfigurationServiceCidr?.ToArray() ?? null /* fixedArrayOf */; set => _kubernetesClusterParametersBody.NetworkConfigurationServiceCidr = (value != null ? new System.Collections.Generic.List(value) : null); } /// /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue @@ -495,7 +507,7 @@ public partial class NewAzNetworkCloudKubernetesCluster_CreateExpanded : global: /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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")] @@ -539,8 +551,8 @@ public partial class NewAzNetworkCloudKubernetesCluster_CreateExpanded : global: ReadOnly = false, Description = @"The SSH configuration for the operating systems that run the nodes in the Kubernetes cluster. In some cases, specification of public keys may be required to produce a working environment.", SerializedName = @"sshPublicKeys", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey) })] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey[] SshPublicKey { get => _kubernetesClusterParametersBody.SshPublicKey ?? null /* arrayOf */; set => _kubernetesClusterParametersBody.SshPublicKey = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISshPublicKey) })] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISshPublicKey[] SshPublicKey { get => _kubernetesClusterParametersBody.SshPublicKey?.ToArray() ?? null /* fixedArrayOf */; set => _kubernetesClusterParametersBody.SshPublicKey = (value != null ? new System.Collections.Generic.List(value) : null); } /// Backing field for property. private string _subscriptionId; @@ -556,7 +568,8 @@ public partial class NewAzNetworkCloudKubernetesCluster_CreateExpanded : global: [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -569,32 +582,32 @@ public partial class NewAzNetworkCloudKubernetesCluster_CreateExpanded : global: ReadOnly = false, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceTags) })] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceTags Tag { get => _kubernetesClusterParametersBody.Tag ?? null /* object */; set => _kubernetesClusterParametersBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceTags Tag { get => _kubernetesClusterParametersBody.Tag ?? null /* object */; set => _kubernetesClusterParametersBody.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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IKubernetesCluster + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesCluster /// 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) @@ -634,7 +647,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets.NewAzNetworkCloud clone._kubernetesClusterParametersBody = this._kubernetesClusterParametersBody; clone.SubscriptionId = this.SubscriptionId; clone.ResourceGroupName = this.ResourceGroupName; - clone.KubernetesClusterName = this.KubernetesClusterName; + clone.Name = this.Name; clone.IfMatch = this.IfMatch; clone.IfNoneMatch = this.IfNoneMatch; return clone; @@ -707,11 +720,36 @@ 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.NetworkCloud.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -723,10 +761,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -736,7 +790,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public NewAzNetworkCloudKubernetesCluster_CreateExpanded() { @@ -802,7 +856,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -815,12 +869,12 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.KubernetesClustersCreateOrUpdate(SubscriptionId, ResourceGroupName, KubernetesClusterName, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _kubernetesClusterParametersBody, onOk, onDefault, this, Pipeline); + await this.Client.KubernetesClustersCreateOrUpdate(SubscriptionId, ResourceGroupName, Name, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _kubernetesClusterParametersBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate); await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,KubernetesClusterName=KubernetesClusterName,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null,body=_kubernetesClusterParametersBody}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -858,12 +912,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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ) { @@ -880,15 +934,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.NetworkCloud.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, KubernetesClusterName=KubernetesClusterName, IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, body=_kubernetesClusterParametersBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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, KubernetesClusterName=KubernetesClusterName, IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, body=_kubernetesClusterParametersBody }) + 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 } }); @@ -898,12 +952,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.NetworkCloud.Models.Api20250201.IKubernetesCluster + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesCluster /// 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 ) { @@ -915,8 +969,9 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesCluster - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesCluster + var result = (await response); + WriteObject(result, false); } } } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/NewAzNetworkCloudKubernetesCluster_CreateViaJsonFilePath.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/NewAzNetworkCloudKubernetesCluster_CreateViaJsonFilePath.cs new file mode 100644 index 000000000000..784c665329df --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/NewAzNetworkCloudKubernetesCluster_CreateViaJsonFilePath.cs @@ -0,0 +1,614 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; + using System; + + /// create a new Kubernetes cluster or create the properties of the existing one. + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/kubernetesClusters/{kubernetesClusterName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzNetworkCloudKubernetesCluster_CreateViaJsonFilePath", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesCluster))] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"create a new Kubernetes cluster or create the properties of the existing one.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/kubernetesClusters/{kubernetesClusterName}", ApiVersion = "2025-02-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.NotSuggestDefaultParameterSet] + public partial class NewAzNetworkCloudKubernetesCluster_CreateViaJsonFilePath : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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(); + + public global::System.String _jsonString; + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private string _ifMatch; + + /// + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value + /// to prevent accidentally overwriting concurrent changes. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes.", + SerializedName = @"If-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Header)] + public string IfMatch { get => this._ifMatch; set => this._ifMatch = value; } + + /// Backing field for property. + private string _ifNoneMatch; + + /// + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result + /// in error from server as they are not supported. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result in error from server as they are not supported.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result in error from server as they are not supported.", + SerializedName = @"If-None-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Header)] + public string IfNoneMatch { get => this._ifNoneMatch; set => this._ifNoneMatch = 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 _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.NetworkCloud.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.NetworkCloud.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of the Kubernetes cluster. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the Kubernetes cluster.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the Kubernetes cluster.", + SerializedName = @"kubernetesClusterName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("KubernetesClusterName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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. The value must be an UUID. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription. The value must be an UUID.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription. The value must be an UUID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.IKubernetesCluster + /// 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.NetworkCloud.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of NewAzNetworkCloudKubernetesCluster_CreateViaJsonFilePath + /// + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets.NewAzNetworkCloudKubernetesCluster_CreateViaJsonFilePath Clone() + { + var clone = new NewAzNetworkCloudKubernetesCluster_CreateViaJsonFilePath(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.Name = this.Name; + clone.IfMatch = this.IfMatch; + clone.IfNoneMatch = this.IfNoneMatch; + clone.JsonFilePath = this.JsonFilePath; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 NewAzNetworkCloudKubernetesCluster_CreateViaJsonFilePath() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'KubernetesClustersCreateOrUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.KubernetesClustersCreateOrUpdateViaJsonString(SubscriptionId, ResourceGroupName, Name, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _jsonString, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.IKubernetesCluster + /// 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.NetworkCloud.Models.IKubernetesCluster + var result = (await response); + WriteObject(result, false); + } + } + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/NewAzNetworkCloudKubernetesCluster_CreateViaJsonString.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/NewAzNetworkCloudKubernetesCluster_CreateViaJsonString.cs new file mode 100644 index 000000000000..f00b36c62850 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/NewAzNetworkCloudKubernetesCluster_CreateViaJsonString.cs @@ -0,0 +1,610 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; + using System; + + /// create a new Kubernetes cluster or create the properties of the existing one. + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/kubernetesClusters/{kubernetesClusterName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzNetworkCloudKubernetesCluster_CreateViaJsonString", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesCluster))] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"create a new Kubernetes cluster or create the properties of the existing one.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/kubernetesClusters/{kubernetesClusterName}", ApiVersion = "2025-02-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.NotSuggestDefaultParameterSet] + public partial class NewAzNetworkCloudKubernetesCluster_CreateViaJsonString : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private string _ifMatch; + + /// + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value + /// to prevent accidentally overwriting concurrent changes. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes.", + SerializedName = @"If-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Header)] + public string IfMatch { get => this._ifMatch; set => this._ifMatch = value; } + + /// Backing field for property. + private string _ifNoneMatch; + + /// + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result + /// in error from server as they are not supported. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result in error from server as they are not supported.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result in error from server as they are not supported.", + SerializedName = @"If-None-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Header)] + public string IfNoneMatch { get => this._ifNoneMatch; set => this._ifNoneMatch = 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 Create operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Json string supplied to the Create operation")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of the Kubernetes cluster. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the Kubernetes cluster.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the Kubernetes cluster.", + SerializedName = @"kubernetesClusterName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("KubernetesClusterName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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. The value must be an UUID. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription. The value must be an UUID.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription. The value must be an UUID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.IKubernetesCluster + /// 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.NetworkCloud.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of NewAzNetworkCloudKubernetesCluster_CreateViaJsonString + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets.NewAzNetworkCloudKubernetesCluster_CreateViaJsonString Clone() + { + var clone = new NewAzNetworkCloudKubernetesCluster_CreateViaJsonString(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.Name = this.Name; + clone.IfMatch = this.IfMatch; + clone.IfNoneMatch = this.IfNoneMatch; + clone.JsonString = this.JsonString; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 NewAzNetworkCloudKubernetesCluster_CreateViaJsonString() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'KubernetesClustersCreateOrUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.KubernetesClustersCreateOrUpdateViaJsonString(SubscriptionId, ResourceGroupName, Name, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _jsonString, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.IKubernetesCluster + /// 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.NetworkCloud.Models.IKubernetesCluster + var result = (await response); + WriteObject(result, false); + } + } + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/NewAzNetworkCloudL2Network_CreateExpanded.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/NewAzNetworkCloudL2Network_CreateExpanded.cs index 473d3c7141d7..408352cd7f0e 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/NewAzNetworkCloudL2Network_CreateExpanded.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/NewAzNetworkCloudL2Network_CreateExpanded.cs @@ -6,22 +6,24 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// - /// Create a new layer 2 (L2) network or update the properties of the existing network. + /// create a new layer 2 (L2) network or create the properties of the existing network. /// /// /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/l2Networks/{l2NetworkName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzNetworkCloudL2Network_CreateExpanded", SupportsShouldProcess = true)] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2Network", "15.0.0", "2.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"AssociatedResourceId","HybridAksClustersAssociatedId","VirtualMachinesAssociatedId"}, NewOutputProperties=new string[] {"AssociatedResourceId","HybridAksClustersAssociatedId","VirtualMachinesAssociatedId"}, ChangeDescription="The types of properties will be changed from fixed array to 'List'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2Network))] - [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Create a new layer 2 (L2) network or update the properties of the existing network.")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2Network))] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"create a new layer 2 (L2) network or create the properties of the existing network.")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/l2Networks/{l2NetworkName}", ApiVersion = "2025-02-01")] public partial class NewAzNetworkCloudL2Network_CreateExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -37,10 +39,13 @@ public partial class NewAzNetworkCloudL2Network_CreateExpanded : 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(); + /// /// L2Network represents a network that utilizes a single isolation domain set up for layer-2 resources. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2Network _l2NetworkParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.L2Network(); + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2Network _l2NetworkParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.L2Network(); /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] @@ -52,6 +57,9 @@ public partial class NewAzNetworkCloudL2Network_CreateExpanded : global::System. [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -87,6 +95,9 @@ public partial class NewAzNetworkCloudL2Network_CreateExpanded : global::System. PossibleTypes = new [] { typeof(string) })] public string ExtendedLocationType { get => _l2NetworkParametersBody.ExtendedLocationType ?? null; set => _l2NetworkParametersBody.ExtendedLocationType = 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] @@ -110,9 +121,9 @@ public partial class NewAzNetworkCloudL2Network_CreateExpanded : global::System. ReadOnly = false, Description = @"Field Deprecated. The field was previously optional, now it will have no defined behavior and will be ignored. The network plugin type for Hybrid AKS.", SerializedName = @"hybridAksPluginType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HybridAksPluginType) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HybridAksPluginType))] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HybridAksPluginType HybridAksPluginType { get => _l2NetworkParametersBody.HybridAksPluginType ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HybridAksPluginType)""); set => _l2NetworkParametersBody.HybridAksPluginType = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("DPDK", "SRIOV", "OSDevice")] + public string HybridAksPluginType { get => _l2NetworkParametersBody.HybridAksPluginType ?? null; set => _l2NetworkParametersBody.HybridAksPluginType = value; } /// Backing field for property. private string _ifMatch; @@ -221,7 +232,7 @@ public partial class NewAzNetworkCloudL2Network_CreateExpanded : global::System. /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 +278,8 @@ public partial class NewAzNetworkCloudL2Network_CreateExpanded : global::System. [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -280,32 +292,32 @@ public partial class NewAzNetworkCloudL2Network_CreateExpanded : global::System. ReadOnly = false, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceTags) })] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceTags Tag { get => _l2NetworkParametersBody.Tag ?? null /* object */; set => _l2NetworkParametersBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceTags Tag { get => _l2NetworkParametersBody.Tag ?? null /* object */; set => _l2NetworkParametersBody.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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IL2Network + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2Network /// 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) @@ -418,11 +430,36 @@ 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.NetworkCloud.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -434,10 +471,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -447,7 +500,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public NewAzNetworkCloudL2Network_CreateExpanded() { @@ -513,7 +566,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -526,12 +579,12 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.L2NetworksCreateOrUpdate(SubscriptionId, ResourceGroupName, Name, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _l2NetworkParametersBody, onOk, onDefault, this, Pipeline); + await this.Client.L2NetworksCreateOrUpdate(SubscriptionId, ResourceGroupName, Name, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _l2NetworkParametersBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate); await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null,body=_l2NetworkParametersBody}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -569,12 +622,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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ) { @@ -591,15 +644,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.NetworkCloud.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, IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, body=_l2NetworkParametersBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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, IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, body=_l2NetworkParametersBody }) + 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 } }); @@ -609,12 +662,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.NetworkCloud.Models.Api20250201.IL2Network + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2Network /// 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 ) { @@ -626,8 +679,9 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2Network - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2Network + var result = (await response); + WriteObject(result, false); } } } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/NewAzNetworkCloudL2Network_CreateViaJsonFilePath.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/NewAzNetworkCloudL2Network_CreateViaJsonFilePath.cs new file mode 100644 index 000000000000..9b35a185e3b2 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/NewAzNetworkCloudL2Network_CreateViaJsonFilePath.cs @@ -0,0 +1,614 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; + using System; + + /// + /// create a new layer 2 (L2) network or create the properties of the existing network. + /// + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/l2Networks/{l2NetworkName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzNetworkCloudL2Network_CreateViaJsonFilePath", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2Network))] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"create a new layer 2 (L2) network or create the properties of the existing network.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/l2Networks/{l2NetworkName}", ApiVersion = "2025-02-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.NotSuggestDefaultParameterSet] + public partial class NewAzNetworkCloudL2Network_CreateViaJsonFilePath : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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(); + + public global::System.String _jsonString; + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private string _ifMatch; + + /// + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value + /// to prevent accidentally overwriting concurrent changes. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes.", + SerializedName = @"If-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Header)] + public string IfMatch { get => this._ifMatch; set => this._ifMatch = value; } + + /// Backing field for property. + private string _ifNoneMatch; + + /// + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result + /// in error from server as they are not supported. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result in error from server as they are not supported.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result in error from server as they are not supported.", + SerializedName = @"If-None-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Header)] + public string IfNoneMatch { get => this._ifNoneMatch; set => this._ifNoneMatch = 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 _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.NetworkCloud.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.NetworkCloud.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of the L2 network. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the L2 network.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the L2 network.", + SerializedName = @"l2NetworkName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("L2NetworkName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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. The value must be an UUID. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription. The value must be an UUID.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription. The value must be an UUID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.IL2Network + /// 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.NetworkCloud.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of NewAzNetworkCloudL2Network_CreateViaJsonFilePath + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets.NewAzNetworkCloudL2Network_CreateViaJsonFilePath Clone() + { + var clone = new NewAzNetworkCloudL2Network_CreateViaJsonFilePath(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.Name = this.Name; + clone.IfMatch = this.IfMatch; + clone.IfNoneMatch = this.IfNoneMatch; + clone.JsonFilePath = this.JsonFilePath; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 NewAzNetworkCloudL2Network_CreateViaJsonFilePath() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'L2NetworksCreateOrUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.L2NetworksCreateOrUpdateViaJsonString(SubscriptionId, ResourceGroupName, Name, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _jsonString, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.IL2Network + /// 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.NetworkCloud.Models.IL2Network + var result = (await response); + WriteObject(result, false); + } + } + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/NewAzNetworkCloudL2Network_CreateViaJsonString.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/NewAzNetworkCloudL2Network_CreateViaJsonString.cs new file mode 100644 index 000000000000..7307d1c651ab --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/NewAzNetworkCloudL2Network_CreateViaJsonString.cs @@ -0,0 +1,612 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; + using System; + + /// + /// create a new layer 2 (L2) network or create the properties of the existing network. + /// + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/l2Networks/{l2NetworkName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzNetworkCloudL2Network_CreateViaJsonString", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2Network))] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"create a new layer 2 (L2) network or create the properties of the existing network.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/l2Networks/{l2NetworkName}", ApiVersion = "2025-02-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.NotSuggestDefaultParameterSet] + public partial class NewAzNetworkCloudL2Network_CreateViaJsonString : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private string _ifMatch; + + /// + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value + /// to prevent accidentally overwriting concurrent changes. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes.", + SerializedName = @"If-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Header)] + public string IfMatch { get => this._ifMatch; set => this._ifMatch = value; } + + /// Backing field for property. + private string _ifNoneMatch; + + /// + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result + /// in error from server as they are not supported. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result in error from server as they are not supported.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result in error from server as they are not supported.", + SerializedName = @"If-None-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Header)] + public string IfNoneMatch { get => this._ifNoneMatch; set => this._ifNoneMatch = 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 Create operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Json string supplied to the Create operation")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of the L2 network. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the L2 network.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the L2 network.", + SerializedName = @"l2NetworkName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("L2NetworkName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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. The value must be an UUID. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription. The value must be an UUID.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription. The value must be an UUID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.IL2Network + /// 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.NetworkCloud.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of NewAzNetworkCloudL2Network_CreateViaJsonString + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets.NewAzNetworkCloudL2Network_CreateViaJsonString Clone() + { + var clone = new NewAzNetworkCloudL2Network_CreateViaJsonString(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.Name = this.Name; + clone.IfMatch = this.IfMatch; + clone.IfNoneMatch = this.IfNoneMatch; + clone.JsonString = this.JsonString; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 NewAzNetworkCloudL2Network_CreateViaJsonString() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'L2NetworksCreateOrUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.L2NetworksCreateOrUpdateViaJsonString(SubscriptionId, ResourceGroupName, Name, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _jsonString, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.IL2Network + /// 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.NetworkCloud.Models.IL2Network + var result = (await response); + WriteObject(result, false); + } + } + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/NewAzNetworkCloudL3Network_CreateExpanded.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/NewAzNetworkCloudL3Network_CreateExpanded.cs index 7a75ea04bebb..612472c17db2 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/NewAzNetworkCloudL3Network_CreateExpanded.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/NewAzNetworkCloudL3Network_CreateExpanded.cs @@ -6,22 +6,24 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// - /// Create a new layer 3 (L3) network or update the properties of the existing network. + /// create a new layer 3 (L3) network or create the properties of the existing network. /// /// /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/l3Networks/{l3NetworkName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzNetworkCloudL3Network_CreateExpanded", SupportsShouldProcess = true)] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3Network", "15.0.0", "2.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"AssociatedResourceId","HybridAksClustersAssociatedId","VirtualMachinesAssociatedId"}, NewOutputProperties=new string[] {"AssociatedResourceId","HybridAksClustersAssociatedId","VirtualMachinesAssociatedId"}, ChangeDescription="The types of properties will be changed from fixed array to 'List'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3Network))] - [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Create a new layer 3 (L3) network or update the properties of the existing network.")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3Network))] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"create a new layer 3 (L3) network or create the properties of the existing network.")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/l3Networks/{l3NetworkName}", ApiVersion = "2025-02-01")] public partial class NewAzNetworkCloudL3Network_CreateExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -37,10 +39,13 @@ public partial class NewAzNetworkCloudL3Network_CreateExpanded : 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(); + /// /// L3Network represents a network that utilizes a single isolation domain set up for layer-3 resources. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3Network _l3NetworkParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.L3Network(); + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3Network _l3NetworkParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.L3Network(); /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] @@ -52,6 +57,9 @@ public partial class NewAzNetworkCloudL3Network_CreateExpanded : global::System. [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -87,6 +95,9 @@ public partial class NewAzNetworkCloudL3Network_CreateExpanded : global::System. PossibleTypes = new [] { typeof(string) })] public string ExtendedLocationType { get => _l3NetworkParametersBody.ExtendedLocationType ?? null; set => _l3NetworkParametersBody.ExtendedLocationType = 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] @@ -110,9 +121,9 @@ public partial class NewAzNetworkCloudL3Network_CreateExpanded : global::System. ReadOnly = false, Description = @"Field Deprecated. The field was previously optional, now it will have no defined behavior and will be ignored. The indicator of whether or not to disable IPAM allocation on the network attachment definition injected into the Hybrid AKS Cluster.", SerializedName = @"hybridAksIpamEnabled", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HybridAksIpamEnabled) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HybridAksIpamEnabled))] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HybridAksIpamEnabled HybridAksIpamEnabled { get => _l3NetworkParametersBody.HybridAksIpamEnabled ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HybridAksIpamEnabled)""); set => _l3NetworkParametersBody.HybridAksIpamEnabled = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("True", "False")] + public string HybridAksIpamEnabled { get => _l3NetworkParametersBody.HybridAksIpamEnabled ?? null; set => _l3NetworkParametersBody.HybridAksIpamEnabled = value; } /// /// Field Deprecated. The field was previously optional, now it will have no defined behavior and will be ignored. The network @@ -125,9 +136,9 @@ public partial class NewAzNetworkCloudL3Network_CreateExpanded : global::System. ReadOnly = false, Description = @"Field Deprecated. The field was previously optional, now it will have no defined behavior and will be ignored. The network plugin type for Hybrid AKS.", SerializedName = @"hybridAksPluginType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HybridAksPluginType) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HybridAksPluginType))] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HybridAksPluginType HybridAksPluginType { get => _l3NetworkParametersBody.HybridAksPluginType ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HybridAksPluginType)""); set => _l3NetworkParametersBody.HybridAksPluginType = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("DPDK", "SRIOV", "OSDevice")] + public string HybridAksPluginType { get => _l3NetworkParametersBody.HybridAksPluginType ?? null; set => _l3NetworkParametersBody.HybridAksPluginType = value; } /// The type of the IP address allocation, defaulted to "DualStack". [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The type of the IP address allocation, defaulted to \"DualStack\".")] @@ -137,9 +148,9 @@ public partial class NewAzNetworkCloudL3Network_CreateExpanded : global::System. ReadOnly = false, Description = @"The type of the IP address allocation, defaulted to ""DualStack"".", SerializedName = @"ipAllocationType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.IPAllocationType) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.IPAllocationType))] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.IPAllocationType IPAllocationType { get => _l3NetworkParametersBody.IPAllocationType ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.IPAllocationType)""); set => _l3NetworkParametersBody.IPAllocationType = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("IPV4", "IPV6", "DualStack")] + public string IPAllocationType { get => _l3NetworkParametersBody.IPAllocationType ?? null; set => _l3NetworkParametersBody.IPAllocationType = value; } /// Backing field for property. private string _ifMatch; @@ -274,7 +285,7 @@ public partial class NewAzNetworkCloudL3Network_CreateExpanded : global::System. /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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")] @@ -320,7 +331,8 @@ public partial class NewAzNetworkCloudL3Network_CreateExpanded : global::System. [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -333,8 +345,8 @@ public partial class NewAzNetworkCloudL3Network_CreateExpanded : global::System. ReadOnly = false, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceTags) })] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceTags Tag { get => _l3NetworkParametersBody.Tag ?? null /* object */; set => _l3NetworkParametersBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceTags Tag { get => _l3NetworkParametersBody.Tag ?? null /* object */; set => _l3NetworkParametersBody.Tag = value; } /// The VLAN from the l3IsolationDomain that is used for this network. [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The VLAN from the l3IsolationDomain that is used for this network.")] @@ -345,31 +357,31 @@ public partial class NewAzNetworkCloudL3Network_CreateExpanded : global::System. Description = @"The VLAN from the l3IsolationDomain that is used for this network.", SerializedName = @"vlan", PossibleTypes = new [] { typeof(long) })] - public long Vlan { get => _l3NetworkParametersBody.Vlan; set => _l3NetworkParametersBody.Vlan = value; } + public long Vlan { get => _l3NetworkParametersBody.Vlan ?? default(long); set => _l3NetworkParametersBody.Vlan = 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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IL3Network + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3Network /// 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) @@ -482,11 +494,36 @@ 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.NetworkCloud.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -498,10 +535,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -511,7 +564,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public NewAzNetworkCloudL3Network_CreateExpanded() { @@ -577,7 +630,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -590,12 +643,12 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.L3NetworksCreateOrUpdate(SubscriptionId, ResourceGroupName, Name, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _l3NetworkParametersBody, onOk, onDefault, this, Pipeline); + await this.Client.L3NetworksCreateOrUpdate(SubscriptionId, ResourceGroupName, Name, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _l3NetworkParametersBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate); await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null,body=_l3NetworkParametersBody}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -633,12 +686,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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ) { @@ -655,15 +708,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.NetworkCloud.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, IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, body=_l3NetworkParametersBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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, IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, body=_l3NetworkParametersBody }) + 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 } }); @@ -673,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.NetworkCloud.Models.Api20250201.IL3Network + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3Network /// 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 ) { @@ -690,8 +743,9 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3Network - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3Network + var result = (await response); + WriteObject(result, false); } } } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/NewAzNetworkCloudL3Network_CreateViaJsonFilePath.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/NewAzNetworkCloudL3Network_CreateViaJsonFilePath.cs new file mode 100644 index 000000000000..5a679fc82c8b --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/NewAzNetworkCloudL3Network_CreateViaJsonFilePath.cs @@ -0,0 +1,614 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; + using System; + + /// + /// create a new layer 3 (L3) network or create the properties of the existing network. + /// + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/l3Networks/{l3NetworkName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzNetworkCloudL3Network_CreateViaJsonFilePath", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3Network))] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"create a new layer 3 (L3) network or create the properties of the existing network.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/l3Networks/{l3NetworkName}", ApiVersion = "2025-02-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.NotSuggestDefaultParameterSet] + public partial class NewAzNetworkCloudL3Network_CreateViaJsonFilePath : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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(); + + public global::System.String _jsonString; + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private string _ifMatch; + + /// + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value + /// to prevent accidentally overwriting concurrent changes. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes.", + SerializedName = @"If-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Header)] + public string IfMatch { get => this._ifMatch; set => this._ifMatch = value; } + + /// Backing field for property. + private string _ifNoneMatch; + + /// + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result + /// in error from server as they are not supported. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result in error from server as they are not supported.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result in error from server as they are not supported.", + SerializedName = @"If-None-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Header)] + public string IfNoneMatch { get => this._ifNoneMatch; set => this._ifNoneMatch = 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 _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.NetworkCloud.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.NetworkCloud.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of the L3 network. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the L3 network.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the L3 network.", + SerializedName = @"l3NetworkName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("L3NetworkName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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. The value must be an UUID. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription. The value must be an UUID.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription. The value must be an UUID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.IL3Network + /// 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.NetworkCloud.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of NewAzNetworkCloudL3Network_CreateViaJsonFilePath + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets.NewAzNetworkCloudL3Network_CreateViaJsonFilePath Clone() + { + var clone = new NewAzNetworkCloudL3Network_CreateViaJsonFilePath(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.Name = this.Name; + clone.IfMatch = this.IfMatch; + clone.IfNoneMatch = this.IfNoneMatch; + clone.JsonFilePath = this.JsonFilePath; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 NewAzNetworkCloudL3Network_CreateViaJsonFilePath() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'L3NetworksCreateOrUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.L3NetworksCreateOrUpdateViaJsonString(SubscriptionId, ResourceGroupName, Name, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _jsonString, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.IL3Network + /// 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.NetworkCloud.Models.IL3Network + var result = (await response); + WriteObject(result, false); + } + } + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/NewAzNetworkCloudL3Network_CreateViaJsonString.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/NewAzNetworkCloudL3Network_CreateViaJsonString.cs new file mode 100644 index 000000000000..6473f74ff78e --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/NewAzNetworkCloudL3Network_CreateViaJsonString.cs @@ -0,0 +1,612 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; + using System; + + /// + /// create a new layer 3 (L3) network or create the properties of the existing network. + /// + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/l3Networks/{l3NetworkName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzNetworkCloudL3Network_CreateViaJsonString", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3Network))] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"create a new layer 3 (L3) network or create the properties of the existing network.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/l3Networks/{l3NetworkName}", ApiVersion = "2025-02-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.NotSuggestDefaultParameterSet] + public partial class NewAzNetworkCloudL3Network_CreateViaJsonString : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private string _ifMatch; + + /// + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value + /// to prevent accidentally overwriting concurrent changes. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes.", + SerializedName = @"If-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Header)] + public string IfMatch { get => this._ifMatch; set => this._ifMatch = value; } + + /// Backing field for property. + private string _ifNoneMatch; + + /// + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result + /// in error from server as they are not supported. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result in error from server as they are not supported.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result in error from server as they are not supported.", + SerializedName = @"If-None-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Header)] + public string IfNoneMatch { get => this._ifNoneMatch; set => this._ifNoneMatch = 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 Create operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Json string supplied to the Create operation")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of the L3 network. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the L3 network.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the L3 network.", + SerializedName = @"l3NetworkName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("L3NetworkName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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. The value must be an UUID. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription. The value must be an UUID.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription. The value must be an UUID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.IL3Network + /// 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.NetworkCloud.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of NewAzNetworkCloudL3Network_CreateViaJsonString + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets.NewAzNetworkCloudL3Network_CreateViaJsonString Clone() + { + var clone = new NewAzNetworkCloudL3Network_CreateViaJsonString(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.Name = this.Name; + clone.IfMatch = this.IfMatch; + clone.IfNoneMatch = this.IfNoneMatch; + clone.JsonString = this.JsonString; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 NewAzNetworkCloudL3Network_CreateViaJsonString() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'L3NetworksCreateOrUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.L3NetworksCreateOrUpdateViaJsonString(SubscriptionId, ResourceGroupName, Name, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _jsonString, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.IL3Network + /// 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.NetworkCloud.Models.IL3Network + var result = (await response); + WriteObject(result, false); + } + } + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/NewAzNetworkCloudMetricsConfiguration_CreateExpanded.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/NewAzNetworkCloudMetricsConfiguration_CreateExpanded.cs index 2a76a2f94469..4c5715985b71 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/NewAzNetworkCloudMetricsConfiguration_CreateExpanded.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/NewAzNetworkCloudMetricsConfiguration_CreateExpanded.cs @@ -6,22 +6,24 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// - /// Create new or update the existing metrics configuration of the provided cluster. + /// create new or create the existing metrics configuration of the provided cluster. /// /// /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/metricsConfigurations/{metricsConfigurationName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzNetworkCloudMetricsConfiguration_CreateExpanded", SupportsShouldProcess = true)] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfiguration", "15.0.0", "2.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"DisabledMetric","EnabledMetric"}, NewOutputProperties=new string[] {"DisabledMetric","EnabledMetric"}, ChangeDescription="The types of properties will be changed from fixed array to 'List'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfiguration))] - [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Create new or update the existing metrics configuration of the provided cluster.")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfiguration))] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"create new or create the existing metrics configuration of the provided cluster.")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/metricsConfigurations/{metricsConfigurationName}", ApiVersion = "2025-02-01")] public partial class NewAzNetworkCloudMetricsConfiguration_CreateExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -37,10 +39,13 @@ public partial class NewAzNetworkCloudMetricsConfiguration_CreateExpanded : 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(); + /// /// ClusterMetricsConfiguration represents the metrics configuration of an on-premises Network Cloud cluster. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfiguration _metricsConfigurationParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ClusterMetricsConfiguration(); + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfiguration _metricsConfigurationParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterMetricsConfiguration(); /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] @@ -52,6 +57,9 @@ public partial class NewAzNetworkCloudMetricsConfiguration_CreateExpanded : glob [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -102,7 +110,7 @@ public partial class NewAzNetworkCloudMetricsConfiguration_CreateExpanded : glob Description = @"The list of metric names that have been chosen to be enabled in addition to the core set of enabled metrics.", SerializedName = @"enabledMetrics", PossibleTypes = new [] { typeof(string) })] - public string[] EnabledMetric { get => _metricsConfigurationParametersBody.EnabledMetric ?? null /* arrayOf */; set => _metricsConfigurationParametersBody.EnabledMetric = value; } + public string[] EnabledMetric { get => _metricsConfigurationParametersBody.EnabledMetric?.ToArray() ?? null /* fixedArrayOf */; set => _metricsConfigurationParametersBody.EnabledMetric = (value != null ? new System.Collections.Generic.List(value) : null); } /// The resource ID of the extended location on which the resource will be created. [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The resource ID of the extended location on which the resource will be created.")] @@ -126,6 +134,9 @@ public partial class NewAzNetworkCloudMetricsConfiguration_CreateExpanded : glob PossibleTypes = new [] { typeof(string) })] public string ExtendedLocationType { get => _metricsConfigurationParametersBody.ExtendedLocationType ?? null; set => _metricsConfigurationParametersBody.ExtendedLocationType = 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] @@ -186,8 +197,16 @@ public partial class NewAzNetworkCloudMetricsConfiguration_CreateExpanded : glob PossibleTypes = new [] { typeof(string) })] public string Location { get => _metricsConfigurationParametersBody.Location ?? null; set => _metricsConfigurationParametersBody.Location = value; } - /// Backing field for property. - private string _metricsConfigurationName; + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; /// The name of the metrics configuration for the cluster. [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the metrics configuration for the cluster.")] @@ -197,16 +216,9 @@ public partial class NewAzNetworkCloudMetricsConfiguration_CreateExpanded : glob Description = @"The name of the metrics configuration for the cluster.", SerializedName = @"metricsConfigurationName", PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("MetricsConfigurationName")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] - public string MetricsConfigurationName { get => this._metricsConfigurationName; set => this._metricsConfigurationName = value; } - - /// - /// cancellation delegate. Stops the cmdlet when called. - /// - global::System.Action Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; - - /// cancellation token. - global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + public string Name { get => this._name; set => this._name = value; } /// /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue @@ -219,7 +231,7 @@ public partial class NewAzNetworkCloudMetricsConfiguration_CreateExpanded : glob /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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")] @@ -265,7 +277,8 @@ public partial class NewAzNetworkCloudMetricsConfiguration_CreateExpanded : glob [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -278,32 +291,32 @@ public partial class NewAzNetworkCloudMetricsConfiguration_CreateExpanded : glob ReadOnly = false, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceTags) })] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceTags Tag { get => _metricsConfigurationParametersBody.Tag ?? null /* object */; set => _metricsConfigurationParametersBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceTags Tag { get => _metricsConfigurationParametersBody.Tag ?? null /* object */; set => _metricsConfigurationParametersBody.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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IClusterMetricsConfiguration + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfiguration /// 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) @@ -344,7 +357,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets.NewAzNetworkCloud clone.SubscriptionId = this.SubscriptionId; clone.ResourceGroupName = this.ResourceGroupName; clone.ClusterName = this.ClusterName; - clone.MetricsConfigurationName = this.MetricsConfigurationName; + clone.Name = this.Name; clone.IfMatch = this.IfMatch; clone.IfNoneMatch = this.IfNoneMatch; return clone; @@ -417,11 +430,36 @@ 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.NetworkCloud.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -433,10 +471,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -446,7 +500,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public NewAzNetworkCloudMetricsConfiguration_CreateExpanded() { @@ -512,7 +566,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -525,12 +579,12 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.MetricsConfigurationsCreateOrUpdate(SubscriptionId, ResourceGroupName, ClusterName, MetricsConfigurationName, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _metricsConfigurationParametersBody, onOk, onDefault, this, Pipeline); + await this.Client.MetricsConfigurationsCreateOrUpdate(SubscriptionId, ResourceGroupName, ClusterName, Name, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _metricsConfigurationParametersBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate); await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,ClusterName=ClusterName,MetricsConfigurationName=MetricsConfigurationName,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null,body=_metricsConfigurationParametersBody}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,ClusterName=ClusterName,Name=Name,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -568,12 +622,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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ) { @@ -590,15 +644,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.NetworkCloud.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, ClusterName=ClusterName, MetricsConfigurationName=MetricsConfigurationName, IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, body=_metricsConfigurationParametersBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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, ClusterName=ClusterName, MetricsConfigurationName=MetricsConfigurationName, IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, body=_metricsConfigurationParametersBody }) + 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 } }); @@ -608,12 +662,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.NetworkCloud.Models.Api20250201.IClusterMetricsConfiguration + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfiguration /// 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 ) { @@ -625,8 +679,9 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfiguration - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfiguration + var result = (await response); + WriteObject(result, false); } } } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/NewAzNetworkCloudMetricsConfiguration_CreateViaIdentityClusterExpanded.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/NewAzNetworkCloudMetricsConfiguration_CreateViaIdentityClusterExpanded.cs new file mode 100644 index 000000000000..8882bc9f169e --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/NewAzNetworkCloudMetricsConfiguration_CreateViaIdentityClusterExpanded.cs @@ -0,0 +1,670 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; + using System; + + /// + /// create new or create the existing metrics configuration of the provided cluster. + /// + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/metricsConfigurations/{metricsConfigurationName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzNetworkCloudMetricsConfiguration_CreateViaIdentityClusterExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfiguration))] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"create new or create the existing metrics configuration of the provided cluster.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/metricsConfigurations/{metricsConfigurationName}", ApiVersion = "2025-02-01")] + public partial class NewAzNetworkCloudMetricsConfiguration_CreateViaIdentityClusterExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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(); + + /// + /// ClusterMetricsConfiguration represents the metrics configuration of an on-premises Network Cloud cluster. + /// + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfiguration _metricsConfigurationParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterMetricsConfiguration(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity _clusterInputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity ClusterInputObject { get => this._clusterInputObject; set => this._clusterInputObject = value; } + + /// The interval in minutes by which metrics will be collected. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The interval in minutes by which metrics will be collected.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The interval in minutes by which metrics will be collected.", + SerializedName = @"collectionInterval", + PossibleTypes = new [] { typeof(long) })] + public long CollectionInterval { get => _metricsConfigurationParametersBody.CollectionInterval; set => _metricsConfigurationParametersBody.CollectionInterval = 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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// + /// The list of metric names that have been chosen to be enabled in addition to the core set of enabled metrics. + /// + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The list of metric names that have been chosen to be enabled in addition to the core set of enabled metrics.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The list of metric names that have been chosen to be enabled in addition to the core set of enabled metrics.", + SerializedName = @"enabledMetrics", + PossibleTypes = new [] { typeof(string) })] + public string[] EnabledMetric { get => _metricsConfigurationParametersBody.EnabledMetric?.ToArray() ?? null /* fixedArrayOf */; set => _metricsConfigurationParametersBody.EnabledMetric = (value != null ? new System.Collections.Generic.List(value) : null); } + + /// The resource ID of the extended location on which the resource will be created. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The resource ID of the extended location on which the resource will be created.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource ID of the extended location on which the resource will be created.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + public string ExtendedLocationName { get => _metricsConfigurationParametersBody.ExtendedLocationName ?? null; set => _metricsConfigurationParametersBody.ExtendedLocationName = value; } + + /// The extended location type, for example, CustomLocation. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The extended location type, for example, CustomLocation.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The extended location type, for example, CustomLocation.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + public string ExtendedLocationType { get => _metricsConfigurationParametersBody.ExtendedLocationType ?? null; set => _metricsConfigurationParametersBody.ExtendedLocationType = 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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private string _ifMatch; + + /// + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value + /// to prevent accidentally overwriting concurrent changes. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes.", + SerializedName = @"If-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Header)] + public string IfMatch { get => this._ifMatch; set => this._ifMatch = value; } + + /// Backing field for property. + private string _ifNoneMatch; + + /// + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result + /// in error from server as they are not supported. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result in error from server as they are not supported.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result in error from server as they are not supported.", + SerializedName = @"If-None-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Header)] + public string IfNoneMatch { get => this._ifNoneMatch; set => this._ifNoneMatch = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// The geo-location where the resource lives + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The geo-location where the resource lives")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The geo-location where the resource lives", + SerializedName = @"location", + PossibleTypes = new [] { typeof(string) })] + public string Location { get => _metricsConfigurationParametersBody.Location ?? null; set => _metricsConfigurationParametersBody.Location = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of the metrics configuration for the cluster. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the metrics configuration for the cluster.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the metrics configuration for the cluster.", + SerializedName = @"metricsConfigurationName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("MetricsConfigurationName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Resource tags. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ExportAs(typeof(global::System.Collections.Hashtable))] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Resource tags.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Resource tags.", + SerializedName = @"tags", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceTags Tag { get => _metricsConfigurationParametersBody.Tag ?? null /* object */; set => _metricsConfigurationParametersBody.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.NetworkCloud.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.NetworkCloud.Models.IClusterMetricsConfiguration + /// 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.NetworkCloud.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of NewAzNetworkCloudMetricsConfiguration_CreateViaIdentityClusterExpanded + /// + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets.NewAzNetworkCloudMetricsConfiguration_CreateViaIdentityClusterExpanded Clone() + { + var clone = new NewAzNetworkCloudMetricsConfiguration_CreateViaIdentityClusterExpanded(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone._metricsConfigurationParametersBody = this._metricsConfigurationParametersBody; + clone.IfMatch = this.IfMatch; + clone.IfNoneMatch = this.IfNoneMatch; + clone.Name = this.Name; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 NewAzNetworkCloudMetricsConfiguration_CreateViaIdentityClusterExpanded() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'MetricsConfigurationsCreateOrUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (ClusterInputObject?.Id != null) + { + this.ClusterInputObject.Id += $"/metricsConfigurations/{(global::System.Uri.EscapeDataString(this.Name.ToString()))}"; + await this.Client.MetricsConfigurationsCreateOrUpdateViaIdentity(ClusterInputObject.Id, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _metricsConfigurationParametersBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate); + } + else + { + // try to call with PATH parameters from Input Object + if (null == ClusterInputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("ClusterInputObject has null value for ClusterInputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, ClusterInputObject) ); + } + if (null == ClusterInputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("ClusterInputObject has null value for ClusterInputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, ClusterInputObject) ); + } + if (null == ClusterInputObject.ClusterName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("ClusterInputObject has null value for ClusterInputObject.ClusterName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, ClusterInputObject) ); + } + await this.Client.MetricsConfigurationsCreateOrUpdate(ClusterInputObject.SubscriptionId ?? null, ClusterInputObject.ResourceGroupName ?? null, ClusterInputObject.ClusterName ?? null, Name, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _metricsConfigurationParametersBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Name=Name,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.IClusterMetricsConfiguration + /// 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.NetworkCloud.Models.IClusterMetricsConfiguration + var result = (await response); + WriteObject(result, false); + } + } + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/NewAzNetworkCloudMetricsConfiguration_CreateViaJsonFilePath.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/NewAzNetworkCloudMetricsConfiguration_CreateViaJsonFilePath.cs new file mode 100644 index 000000000000..55c26bf7d3d2 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/NewAzNetworkCloudMetricsConfiguration_CreateViaJsonFilePath.cs @@ -0,0 +1,631 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; + using System; + + /// + /// create new or create the existing metrics configuration of the provided cluster. + /// + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/metricsConfigurations/{metricsConfigurationName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzNetworkCloudMetricsConfiguration_CreateViaJsonFilePath", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfiguration))] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"create new or create the existing metrics configuration of the provided cluster.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/metricsConfigurations/{metricsConfigurationName}", ApiVersion = "2025-02-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.NotSuggestDefaultParameterSet] + public partial class NewAzNetworkCloudMetricsConfiguration_CreateViaJsonFilePath : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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(); + + public global::System.String _jsonString; + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; + + /// Backing field for property. + private string _clusterName; + + /// The name of the cluster. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the cluster.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the cluster.", + SerializedName = @"clusterName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] + public string ClusterName { get => this._clusterName; set => this._clusterName = 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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private string _ifMatch; + + /// + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value + /// to prevent accidentally overwriting concurrent changes. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes.", + SerializedName = @"If-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Header)] + public string IfMatch { get => this._ifMatch; set => this._ifMatch = value; } + + /// Backing field for property. + private string _ifNoneMatch; + + /// + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result + /// in error from server as they are not supported. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result in error from server as they are not supported.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result in error from server as they are not supported.", + SerializedName = @"If-None-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Header)] + public string IfNoneMatch { get => this._ifNoneMatch; set => this._ifNoneMatch = 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 _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.NetworkCloud.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.NetworkCloud.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of the metrics configuration for the cluster. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the metrics configuration for the cluster.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the metrics configuration for the cluster.", + SerializedName = @"metricsConfigurationName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("MetricsConfigurationName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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. The value must be an UUID. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription. The value must be an UUID.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription. The value must be an UUID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.IClusterMetricsConfiguration + /// 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.NetworkCloud.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of NewAzNetworkCloudMetricsConfiguration_CreateViaJsonFilePath + /// + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets.NewAzNetworkCloudMetricsConfiguration_CreateViaJsonFilePath Clone() + { + var clone = new NewAzNetworkCloudMetricsConfiguration_CreateViaJsonFilePath(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.ClusterName = this.ClusterName; + clone.Name = this.Name; + clone.IfMatch = this.IfMatch; + clone.IfNoneMatch = this.IfNoneMatch; + clone.JsonFilePath = this.JsonFilePath; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 NewAzNetworkCloudMetricsConfiguration_CreateViaJsonFilePath() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'MetricsConfigurationsCreateOrUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.MetricsConfigurationsCreateOrUpdateViaJsonString(SubscriptionId, ResourceGroupName, ClusterName, Name, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _jsonString, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,ClusterName=ClusterName,Name=Name,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.IClusterMetricsConfiguration + /// 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.NetworkCloud.Models.IClusterMetricsConfiguration + var result = (await response); + WriteObject(result, false); + } + } + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/NewAzNetworkCloudMetricsConfiguration_CreateViaJsonString.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/NewAzNetworkCloudMetricsConfiguration_CreateViaJsonString.cs new file mode 100644 index 000000000000..99f1ce034c9b --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/NewAzNetworkCloudMetricsConfiguration_CreateViaJsonString.cs @@ -0,0 +1,629 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; + using System; + + /// + /// create new or create the existing metrics configuration of the provided cluster. + /// + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/metricsConfigurations/{metricsConfigurationName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzNetworkCloudMetricsConfiguration_CreateViaJsonString", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfiguration))] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"create new or create the existing metrics configuration of the provided cluster.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/metricsConfigurations/{metricsConfigurationName}", ApiVersion = "2025-02-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.NotSuggestDefaultParameterSet] + public partial class NewAzNetworkCloudMetricsConfiguration_CreateViaJsonString : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; + + /// Backing field for property. + private string _clusterName; + + /// The name of the cluster. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the cluster.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the cluster.", + SerializedName = @"clusterName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] + public string ClusterName { get => this._clusterName; set => this._clusterName = 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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private string _ifMatch; + + /// + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value + /// to prevent accidentally overwriting concurrent changes. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes.", + SerializedName = @"If-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Header)] + public string IfMatch { get => this._ifMatch; set => this._ifMatch = value; } + + /// Backing field for property. + private string _ifNoneMatch; + + /// + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result + /// in error from server as they are not supported. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result in error from server as they are not supported.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result in error from server as they are not supported.", + SerializedName = @"If-None-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Header)] + public string IfNoneMatch { get => this._ifNoneMatch; set => this._ifNoneMatch = 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 Create operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Json string supplied to the Create operation")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of the metrics configuration for the cluster. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the metrics configuration for the cluster.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the metrics configuration for the cluster.", + SerializedName = @"metricsConfigurationName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("MetricsConfigurationName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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. The value must be an UUID. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription. The value must be an UUID.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription. The value must be an UUID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.IClusterMetricsConfiguration + /// 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.NetworkCloud.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of NewAzNetworkCloudMetricsConfiguration_CreateViaJsonString + /// + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets.NewAzNetworkCloudMetricsConfiguration_CreateViaJsonString Clone() + { + var clone = new NewAzNetworkCloudMetricsConfiguration_CreateViaJsonString(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.ClusterName = this.ClusterName; + clone.Name = this.Name; + clone.IfMatch = this.IfMatch; + clone.IfNoneMatch = this.IfNoneMatch; + clone.JsonString = this.JsonString; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 NewAzNetworkCloudMetricsConfiguration_CreateViaJsonString() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'MetricsConfigurationsCreateOrUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.MetricsConfigurationsCreateOrUpdateViaJsonString(SubscriptionId, ResourceGroupName, ClusterName, Name, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _jsonString, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,ClusterName=ClusterName,Name=Name,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.IClusterMetricsConfiguration + /// 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.NetworkCloud.Models.IClusterMetricsConfiguration + var result = (await response); + WriteObject(result, false); + } + } + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/NewAzNetworkCloudServicesNetwork_CreateExpanded.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/NewAzNetworkCloudServicesNetwork_CreateExpanded.cs index c68d8856056f..c2bb8f34eb37 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/NewAzNetworkCloudServicesNetwork_CreateExpanded.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/NewAzNetworkCloudServicesNetwork_CreateExpanded.cs @@ -6,21 +6,24 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// - /// Create a new cloud services network or update the properties of the existing cloud services network. + /// create a new cloud services network or create the properties of the existing cloud services network. /// /// /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/cloudServicesNetworks/{cloudServicesNetworkName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzNetworkCloudServicesNetwork_CreateExpanded", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetwork))] - [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Create a new cloud services network or update the properties of the existing cloud services network.")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetwork))] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"create a new cloud services network or create the properties of the existing cloud services network.")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/cloudServicesNetworks/{cloudServicesNetworkName}", ApiVersion = "2025-02-01")] public partial class NewAzNetworkCloudServicesNetwork_CreateExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -42,7 +45,10 @@ public partial class NewAzNetworkCloudServicesNetwork_CreateExpanded : global::S /// of the same layer 2 (L2) isolation domain. At least one service network must be created but may be reused across many /// virtual machines and/or Hybrid AKS clusters. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetwork _cloudServicesNetworkParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.CloudServicesNetwork(); + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetwork _cloudServicesNetworkParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.CloudServicesNetwork(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); /// /// The list of egress endpoints. This allows for connection from a Hybrid AKS cluster to the specified endpoint. @@ -55,8 +61,8 @@ public partial class NewAzNetworkCloudServicesNetwork_CreateExpanded : global::S ReadOnly = false, Description = @"The list of egress endpoints. This allows for connection from a Hybrid AKS cluster to the specified endpoint.", SerializedName = @"additionalEgressEndpoints", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IEgressEndpoint) })] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IEgressEndpoint[] AdditionalEgressEndpoint { get => _cloudServicesNetworkParametersBody.AdditionalEgressEndpoint ?? null /* arrayOf */; set => _cloudServicesNetworkParametersBody.AdditionalEgressEndpoint = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IEgressEndpoint) })] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IEgressEndpoint[] AdditionalEgressEndpoint { get => _cloudServicesNetworkParametersBody.AdditionalEgressEndpoint?.ToArray() ?? null /* fixedArrayOf */; set => _cloudServicesNetworkParametersBody.AdditionalEgressEndpoint = (value != null ? new System.Collections.Generic.List(value) : null); } /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] @@ -68,23 +74,12 @@ public partial class NewAzNetworkCloudServicesNetwork_CreateExpanded : global::S [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; - /// Backing field for property. - private string _cloudServicesNetworkName; - - /// The name of the cloud services network. - [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the cloud services network.")] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( - Required = true, - ReadOnly = false, - Description = @"The name of the cloud services network.", - SerializedName = @"cloudServicesNetworkName", - PossibleTypes = new [] { typeof(string) })] - [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] - public string CloudServicesNetworkName { get => this._cloudServicesNetworkName; set => this._cloudServicesNetworkName = value; } - /// /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet /// against a different subscription @@ -105,9 +100,9 @@ public partial class NewAzNetworkCloudServicesNetwork_CreateExpanded : global::S ReadOnly = false, Description = @"The indicator of whether the platform default endpoints are allowed for the egress traffic.", SerializedName = @"enableDefaultEgressEndpoints", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CloudServicesNetworkEnableDefaultEgressEndpoints) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CloudServicesNetworkEnableDefaultEgressEndpoints))] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CloudServicesNetworkEnableDefaultEgressEndpoints EnableDefaultEgressEndpoint { get => _cloudServicesNetworkParametersBody.EnableDefaultEgressEndpoint ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CloudServicesNetworkEnableDefaultEgressEndpoints)""); set => _cloudServicesNetworkParametersBody.EnableDefaultEgressEndpoint = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("True", "False")] + public string EnableDefaultEgressEndpoint { get => _cloudServicesNetworkParametersBody.EnableDefaultEgressEndpoint ?? null; set => _cloudServicesNetworkParametersBody.EnableDefaultEgressEndpoint = value; } /// The resource ID of the extended location on which the resource will be created. [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The resource ID of the extended location on which the resource will be created.")] @@ -131,6 +126,9 @@ public partial class NewAzNetworkCloudServicesNetwork_CreateExpanded : global::S PossibleTypes = new [] { typeof(string) })] public string ExtendedLocationType { get => _cloudServicesNetworkParametersBody.ExtendedLocationType ?? null; set => _cloudServicesNetworkParametersBody.ExtendedLocationType = 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] @@ -199,6 +197,21 @@ public partial class NewAzNetworkCloudServicesNetwork_CreateExpanded : global::S /// cancellation token. global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + /// Backing field for property. + private string _name; + + /// The name of the cloud services network. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the cloud services network.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the cloud services network.", + SerializedName = @"cloudServicesNetworkName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("CloudServicesNetworkName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + /// /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue /// asynchronously. @@ -210,7 +223,7 @@ public partial class NewAzNetworkCloudServicesNetwork_CreateExpanded : global::S /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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")] @@ -256,7 +269,8 @@ public partial class NewAzNetworkCloudServicesNetwork_CreateExpanded : global::S [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -269,32 +283,32 @@ public partial class NewAzNetworkCloudServicesNetwork_CreateExpanded : global::S ReadOnly = false, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceTags) })] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceTags Tag { get => _cloudServicesNetworkParametersBody.Tag ?? null /* object */; set => _cloudServicesNetworkParametersBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceTags Tag { get => _cloudServicesNetworkParametersBody.Tag ?? null /* object */; set => _cloudServicesNetworkParametersBody.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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.ICloudServicesNetwork + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetwork /// 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) @@ -334,7 +348,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets.NewAzNetworkCloud clone._cloudServicesNetworkParametersBody = this._cloudServicesNetworkParametersBody; clone.SubscriptionId = this.SubscriptionId; clone.ResourceGroupName = this.ResourceGroupName; - clone.CloudServicesNetworkName = this.CloudServicesNetworkName; + clone.Name = this.Name; clone.IfMatch = this.IfMatch; clone.IfNoneMatch = this.IfNoneMatch; return clone; @@ -407,11 +421,36 @@ 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.NetworkCloud.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -423,10 +462,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -436,7 +491,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public NewAzNetworkCloudServicesNetwork_CreateExpanded() { @@ -502,7 +557,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -515,12 +570,12 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.CloudServicesNetworksCreateOrUpdate(SubscriptionId, ResourceGroupName, CloudServicesNetworkName, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _cloudServicesNetworkParametersBody, onOk, onDefault, this, Pipeline); + await this.Client.CloudServicesNetworksCreateOrUpdate(SubscriptionId, ResourceGroupName, Name, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _cloudServicesNetworkParametersBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate); await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,CloudServicesNetworkName=CloudServicesNetworkName,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null,body=_cloudServicesNetworkParametersBody}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -558,12 +613,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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ) { @@ -580,15 +635,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.NetworkCloud.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, CloudServicesNetworkName=CloudServicesNetworkName, IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, body=_cloudServicesNetworkParametersBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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, CloudServicesNetworkName=CloudServicesNetworkName, IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, body=_cloudServicesNetworkParametersBody }) + 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 } }); @@ -598,12 +653,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.NetworkCloud.Models.Api20250201.ICloudServicesNetwork + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetwork /// 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 ) { @@ -615,8 +670,9 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetwork - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetwork + var result = (await response); + WriteObject(result, false); } } } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/NewAzNetworkCloudServicesNetwork_CreateViaJsonFilePath.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/NewAzNetworkCloudServicesNetwork_CreateViaJsonFilePath.cs new file mode 100644 index 000000000000..b3615a3f0e32 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/NewAzNetworkCloudServicesNetwork_CreateViaJsonFilePath.cs @@ -0,0 +1,614 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; + using System; + + /// + /// create a new cloud services network or create the properties of the existing cloud services network. + /// + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/cloudServicesNetworks/{cloudServicesNetworkName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzNetworkCloudServicesNetwork_CreateViaJsonFilePath", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetwork))] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"create a new cloud services network or create the properties of the existing cloud services network.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/cloudServicesNetworks/{cloudServicesNetworkName}", ApiVersion = "2025-02-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.NotSuggestDefaultParameterSet] + public partial class NewAzNetworkCloudServicesNetwork_CreateViaJsonFilePath : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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(); + + public global::System.String _jsonString; + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private string _ifMatch; + + /// + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value + /// to prevent accidentally overwriting concurrent changes. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes.", + SerializedName = @"If-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Header)] + public string IfMatch { get => this._ifMatch; set => this._ifMatch = value; } + + /// Backing field for property. + private string _ifNoneMatch; + + /// + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result + /// in error from server as they are not supported. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result in error from server as they are not supported.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result in error from server as they are not supported.", + SerializedName = @"If-None-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Header)] + public string IfNoneMatch { get => this._ifNoneMatch; set => this._ifNoneMatch = 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 _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.NetworkCloud.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.NetworkCloud.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of the cloud services network. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the cloud services network.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the cloud services network.", + SerializedName = @"cloudServicesNetworkName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("CloudServicesNetworkName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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. The value must be an UUID. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription. The value must be an UUID.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription. The value must be an UUID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.ICloudServicesNetwork + /// 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.NetworkCloud.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of NewAzNetworkCloudServicesNetwork_CreateViaJsonFilePath + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets.NewAzNetworkCloudServicesNetwork_CreateViaJsonFilePath Clone() + { + var clone = new NewAzNetworkCloudServicesNetwork_CreateViaJsonFilePath(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.Name = this.Name; + clone.IfMatch = this.IfMatch; + clone.IfNoneMatch = this.IfNoneMatch; + clone.JsonFilePath = this.JsonFilePath; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 NewAzNetworkCloudServicesNetwork_CreateViaJsonFilePath() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'CloudServicesNetworksCreateOrUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.CloudServicesNetworksCreateOrUpdateViaJsonString(SubscriptionId, ResourceGroupName, Name, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _jsonString, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.ICloudServicesNetwork + /// 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.NetworkCloud.Models.ICloudServicesNetwork + var result = (await response); + WriteObject(result, false); + } + } + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/NewAzNetworkCloudServicesNetwork_CreateViaJsonString.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/NewAzNetworkCloudServicesNetwork_CreateViaJsonString.cs new file mode 100644 index 000000000000..f8c785f7c740 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/NewAzNetworkCloudServicesNetwork_CreateViaJsonString.cs @@ -0,0 +1,612 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; + using System; + + /// + /// create a new cloud services network or create the properties of the existing cloud services network. + /// + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/cloudServicesNetworks/{cloudServicesNetworkName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzNetworkCloudServicesNetwork_CreateViaJsonString", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetwork))] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"create a new cloud services network or create the properties of the existing cloud services network.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/cloudServicesNetworks/{cloudServicesNetworkName}", ApiVersion = "2025-02-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.NotSuggestDefaultParameterSet] + public partial class NewAzNetworkCloudServicesNetwork_CreateViaJsonString : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private string _ifMatch; + + /// + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value + /// to prevent accidentally overwriting concurrent changes. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes.", + SerializedName = @"If-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Header)] + public string IfMatch { get => this._ifMatch; set => this._ifMatch = value; } + + /// Backing field for property. + private string _ifNoneMatch; + + /// + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result + /// in error from server as they are not supported. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result in error from server as they are not supported.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result in error from server as they are not supported.", + SerializedName = @"If-None-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Header)] + public string IfNoneMatch { get => this._ifNoneMatch; set => this._ifNoneMatch = 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 Create operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Json string supplied to the Create operation")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of the cloud services network. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the cloud services network.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the cloud services network.", + SerializedName = @"cloudServicesNetworkName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("CloudServicesNetworkName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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. The value must be an UUID. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription. The value must be an UUID.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription. The value must be an UUID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.ICloudServicesNetwork + /// 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.NetworkCloud.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of NewAzNetworkCloudServicesNetwork_CreateViaJsonString + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets.NewAzNetworkCloudServicesNetwork_CreateViaJsonString Clone() + { + var clone = new NewAzNetworkCloudServicesNetwork_CreateViaJsonString(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.Name = this.Name; + clone.IfMatch = this.IfMatch; + clone.IfNoneMatch = this.IfNoneMatch; + clone.JsonString = this.JsonString; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 NewAzNetworkCloudServicesNetwork_CreateViaJsonString() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'CloudServicesNetworksCreateOrUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.CloudServicesNetworksCreateOrUpdateViaJsonString(SubscriptionId, ResourceGroupName, Name, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _jsonString, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.ICloudServicesNetwork + /// 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.NetworkCloud.Models.ICloudServicesNetwork + var result = (await response); + WriteObject(result, false); + } + } + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/NewAzNetworkCloudTrunkedNetwork_CreateExpanded.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/NewAzNetworkCloudTrunkedNetwork_CreateExpanded.cs index fc527f127ef5..b5a4d0a6cde9 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/NewAzNetworkCloudTrunkedNetwork_CreateExpanded.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/NewAzNetworkCloudTrunkedNetwork_CreateExpanded.cs @@ -6,22 +6,24 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// - /// Create a new trunked network or update the properties of the existing trunked network. + /// create a new trunked network or create the properties of the existing trunked network. /// /// /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/trunkedNetworks/{trunkedNetworkName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzNetworkCloudTrunkedNetwork_CreateExpanded", SupportsShouldProcess = true)] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetwork", "15.0.0", "2.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"AssociatedResourceId","HybridAksClustersAssociatedId","IsolationDomainId","VirtualMachinesAssociatedId","Vlan"}, NewOutputProperties=new string[] {"AssociatedResourceId","HybridAksClustersAssociatedId","IsolationDomainId","VirtualMachinesAssociatedId","Vlan"}, ChangeDescription="The types of properties will be changed from fixed array to 'List'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetwork))] - [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Create a new trunked network or update the properties of the existing trunked network.")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetwork))] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"create a new trunked network or create the properties of the existing trunked network.")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/trunkedNetworks/{trunkedNetworkName}", ApiVersion = "2025-02-01")] public partial class NewAzNetworkCloudTrunkedNetwork_CreateExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -37,10 +39,13 @@ public partial class NewAzNetworkCloudTrunkedNetwork_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(); + /// /// TrunkedNetwork represents a network that utilizes multiple isolation domains and specified VLANs to create a trunked network. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetwork _trunkedNetworkParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.TrunkedNetwork(); + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetwork _trunkedNetworkParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.TrunkedNetwork(); /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] @@ -52,6 +57,9 @@ public partial class NewAzNetworkCloudTrunkedNetwork_CreateExpanded : global::Sy [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -87,6 +95,9 @@ public partial class NewAzNetworkCloudTrunkedNetwork_CreateExpanded : global::Sy PossibleTypes = new [] { typeof(string) })] public string ExtendedLocationType { get => _trunkedNetworkParametersBody.ExtendedLocationType ?? null; set => _trunkedNetworkParametersBody.ExtendedLocationType = 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] @@ -110,9 +121,9 @@ public partial class NewAzNetworkCloudTrunkedNetwork_CreateExpanded : global::Sy ReadOnly = false, Description = @"Field Deprecated. The field was previously optional, now it will have no defined behavior and will be ignored. The network plugin type for Hybrid AKS.", SerializedName = @"hybridAksPluginType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HybridAksPluginType) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HybridAksPluginType))] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HybridAksPluginType HybridAksPluginType { get => _trunkedNetworkParametersBody.HybridAksPluginType ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.HybridAksPluginType)""); set => _trunkedNetworkParametersBody.HybridAksPluginType = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("DPDK", "SRIOV", "OSDevice")] + public string HybridAksPluginType { get => _trunkedNetworkParametersBody.HybridAksPluginType ?? null; set => _trunkedNetworkParametersBody.HybridAksPluginType = value; } /// Backing field for property. private string _ifMatch; @@ -178,7 +189,7 @@ public partial class NewAzNetworkCloudTrunkedNetwork_CreateExpanded : global::Sy Description = @"The list of resource IDs representing the Network Fabric isolation domains. It can be any combination of l2IsolationDomain and l3IsolationDomain resources.", SerializedName = @"isolationDomainIds", PossibleTypes = new [] { typeof(string) })] - public string[] IsolationDomainId { get => _trunkedNetworkParametersBody.IsolationDomainId ?? null /* arrayOf */; set => _trunkedNetworkParametersBody.IsolationDomainId = value; } + public string[] IsolationDomainId { get => _trunkedNetworkParametersBody.IsolationDomainId?.ToArray() ?? null /* fixedArrayOf */; set => _trunkedNetworkParametersBody.IsolationDomainId = (value != null ? new System.Collections.Generic.List(value) : null); } /// The geo-location where the resource lives [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The geo-location where the resource lives")] @@ -225,7 +236,7 @@ public partial class NewAzNetworkCloudTrunkedNetwork_CreateExpanded : global::Sy /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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")] @@ -271,7 +282,8 @@ public partial class NewAzNetworkCloudTrunkedNetwork_CreateExpanded : global::Sy [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -284,8 +296,8 @@ public partial class NewAzNetworkCloudTrunkedNetwork_CreateExpanded : global::Sy ReadOnly = false, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceTags) })] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceTags Tag { get => _trunkedNetworkParametersBody.Tag ?? null /* object */; set => _trunkedNetworkParametersBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceTags Tag { get => _trunkedNetworkParametersBody.Tag ?? null /* object */; set => _trunkedNetworkParametersBody.Tag = value; } /// The list of vlans that are selected from the isolation domains for trunking. [global::System.Management.Automation.AllowEmptyCollection] @@ -297,31 +309,31 @@ public partial class NewAzNetworkCloudTrunkedNetwork_CreateExpanded : global::Sy Description = @"The list of vlans that are selected from the isolation domains for trunking.", SerializedName = @"vlans", PossibleTypes = new [] { typeof(long) })] - public long[] Vlan { get => _trunkedNetworkParametersBody.Vlan ?? null /* arrayOf */; set => _trunkedNetworkParametersBody.Vlan = value; } + public long[] Vlan { get => _trunkedNetworkParametersBody.Vlan?.ToArray() ?? null /* fixedArrayOf */; set => _trunkedNetworkParametersBody.Vlan = (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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.ITrunkedNetwork + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetwork /// 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) @@ -434,11 +446,36 @@ 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.NetworkCloud.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -450,10 +487,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -463,7 +516,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public NewAzNetworkCloudTrunkedNetwork_CreateExpanded() { @@ -529,7 +582,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -542,12 +595,12 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.TrunkedNetworksCreateOrUpdate(SubscriptionId, ResourceGroupName, Name, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _trunkedNetworkParametersBody, onOk, onDefault, this, Pipeline); + await this.Client.TrunkedNetworksCreateOrUpdate(SubscriptionId, ResourceGroupName, Name, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _trunkedNetworkParametersBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate); await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null,body=_trunkedNetworkParametersBody}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -585,12 +638,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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ) { @@ -607,15 +660,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.NetworkCloud.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, IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, body=_trunkedNetworkParametersBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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, IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, body=_trunkedNetworkParametersBody }) + 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 } }); @@ -625,12 +678,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.NetworkCloud.Models.Api20250201.ITrunkedNetwork + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetwork /// 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 ) { @@ -642,8 +695,9 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetwork - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetwork + var result = (await response); + WriteObject(result, false); } } } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/NewAzNetworkCloudTrunkedNetwork_CreateViaJsonFilePath.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/NewAzNetworkCloudTrunkedNetwork_CreateViaJsonFilePath.cs new file mode 100644 index 000000000000..65ea807e20c2 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/NewAzNetworkCloudTrunkedNetwork_CreateViaJsonFilePath.cs @@ -0,0 +1,614 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; + using System; + + /// + /// create a new trunked network or create the properties of the existing trunked network. + /// + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/trunkedNetworks/{trunkedNetworkName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzNetworkCloudTrunkedNetwork_CreateViaJsonFilePath", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetwork))] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"create a new trunked network or create the properties of the existing trunked network.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/trunkedNetworks/{trunkedNetworkName}", ApiVersion = "2025-02-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.NotSuggestDefaultParameterSet] + public partial class NewAzNetworkCloudTrunkedNetwork_CreateViaJsonFilePath : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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(); + + public global::System.String _jsonString; + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private string _ifMatch; + + /// + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value + /// to prevent accidentally overwriting concurrent changes. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes.", + SerializedName = @"If-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Header)] + public string IfMatch { get => this._ifMatch; set => this._ifMatch = value; } + + /// Backing field for property. + private string _ifNoneMatch; + + /// + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result + /// in error from server as they are not supported. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result in error from server as they are not supported.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result in error from server as they are not supported.", + SerializedName = @"If-None-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Header)] + public string IfNoneMatch { get => this._ifNoneMatch; set => this._ifNoneMatch = 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 _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.NetworkCloud.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.NetworkCloud.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of the trunked network. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the trunked network.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the trunked network.", + SerializedName = @"trunkedNetworkName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("TrunkedNetworkName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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. The value must be an UUID. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription. The value must be an UUID.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription. The value must be an UUID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.ITrunkedNetwork + /// 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.NetworkCloud.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of NewAzNetworkCloudTrunkedNetwork_CreateViaJsonFilePath + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets.NewAzNetworkCloudTrunkedNetwork_CreateViaJsonFilePath Clone() + { + var clone = new NewAzNetworkCloudTrunkedNetwork_CreateViaJsonFilePath(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.Name = this.Name; + clone.IfMatch = this.IfMatch; + clone.IfNoneMatch = this.IfNoneMatch; + clone.JsonFilePath = this.JsonFilePath; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 NewAzNetworkCloudTrunkedNetwork_CreateViaJsonFilePath() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'TrunkedNetworksCreateOrUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.TrunkedNetworksCreateOrUpdateViaJsonString(SubscriptionId, ResourceGroupName, Name, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _jsonString, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.ITrunkedNetwork + /// 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.NetworkCloud.Models.ITrunkedNetwork + var result = (await response); + WriteObject(result, false); + } + } + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/NewAzNetworkCloudTrunkedNetwork_CreateViaJsonString.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/NewAzNetworkCloudTrunkedNetwork_CreateViaJsonString.cs new file mode 100644 index 000000000000..7f46f454bbac --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/NewAzNetworkCloudTrunkedNetwork_CreateViaJsonString.cs @@ -0,0 +1,612 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; + using System; + + /// + /// create a new trunked network or create the properties of the existing trunked network. + /// + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/trunkedNetworks/{trunkedNetworkName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzNetworkCloudTrunkedNetwork_CreateViaJsonString", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetwork))] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"create a new trunked network or create the properties of the existing trunked network.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/trunkedNetworks/{trunkedNetworkName}", ApiVersion = "2025-02-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.NotSuggestDefaultParameterSet] + public partial class NewAzNetworkCloudTrunkedNetwork_CreateViaJsonString : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private string _ifMatch; + + /// + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value + /// to prevent accidentally overwriting concurrent changes. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes.", + SerializedName = @"If-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Header)] + public string IfMatch { get => this._ifMatch; set => this._ifMatch = value; } + + /// Backing field for property. + private string _ifNoneMatch; + + /// + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result + /// in error from server as they are not supported. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result in error from server as they are not supported.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result in error from server as they are not supported.", + SerializedName = @"If-None-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Header)] + public string IfNoneMatch { get => this._ifNoneMatch; set => this._ifNoneMatch = 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 Create operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Json string supplied to the Create operation")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of the trunked network. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the trunked network.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the trunked network.", + SerializedName = @"trunkedNetworkName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("TrunkedNetworkName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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. The value must be an UUID. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription. The value must be an UUID.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription. The value must be an UUID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.ITrunkedNetwork + /// 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.NetworkCloud.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of NewAzNetworkCloudTrunkedNetwork_CreateViaJsonString + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets.NewAzNetworkCloudTrunkedNetwork_CreateViaJsonString Clone() + { + var clone = new NewAzNetworkCloudTrunkedNetwork_CreateViaJsonString(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.Name = this.Name; + clone.IfMatch = this.IfMatch; + clone.IfNoneMatch = this.IfNoneMatch; + clone.JsonString = this.JsonString; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 NewAzNetworkCloudTrunkedNetwork_CreateViaJsonString() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'TrunkedNetworksCreateOrUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.TrunkedNetworksCreateOrUpdateViaJsonString(SubscriptionId, ResourceGroupName, Name, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _jsonString, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.ITrunkedNetwork + /// 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.NetworkCloud.Models.ITrunkedNetwork + var result = (await response); + WriteObject(result, false); + } + } + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/NewAzNetworkCloudVirtualMachine_CreateExpanded.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/NewAzNetworkCloudVirtualMachine_CreateExpanded.cs index c88d7c186bb3..563594bd51f7 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/NewAzNetworkCloudVirtualMachine_CreateExpanded.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/NewAzNetworkCloudVirtualMachine_CreateExpanded.cs @@ -6,22 +6,24 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// - /// Create a new virtual machine or update the properties of the existing virtual machine. + /// create a new virtual machine or create the properties of the existing virtual machine. /// /// /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/virtualMachines/{virtualMachineName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzNetworkCloudVirtualMachine_CreateExpanded", SupportsShouldProcess = true)] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachine", "15.0.0", "2.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"NetworkAttachment","PlacementHint","SshPublicKey","StorageProfileVolumeAttachment","Volume"}, NewOutputProperties=new string[] {"NetworkAttachment","PlacementHint","SshPublicKey","StorageProfileVolumeAttachment","Volume"}, ChangeDescription="The types of properties will be changed from fixed array to 'List'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachine))] - [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Create a new virtual machine or update the properties of the existing virtual machine.")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachine))] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"create a new virtual machine or create the properties of the existing virtual machine.")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/virtualMachines/{virtualMachineName}", ApiVersion = "2025-02-01")] public partial class NewAzNetworkCloudVirtualMachine_CreateExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -37,8 +39,11 @@ public partial class NewAzNetworkCloudVirtualMachine_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(); + /// VirtualMachine represents the on-premises Network Cloud virtual machine. - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachine _virtualMachineParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.VirtualMachine(); + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachine _virtualMachineParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.VirtualMachine(); /// /// The name of the administrator to which the ssh public keys will be added into the authorized keys. @@ -66,15 +71,18 @@ public partial class NewAzNetworkCloudVirtualMachine_CreateExpanded : global::Sy ReadOnly = false, Description = @"Selects the boot method for the virtual machine.", SerializedName = @"bootMethod", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineBootMethod) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineBootMethod))] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineBootMethod BootMethod { get => _virtualMachineParametersBody.BootMethod ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineBootMethod)""); set => _virtualMachineParametersBody.BootMethod = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("UEFI", "BIOS")] + public string BootMethod { get => _virtualMachineParametersBody.BootMethod ?? null; set => _virtualMachineParametersBody.BootMethod = 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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -103,9 +111,9 @@ public partial class NewAzNetworkCloudVirtualMachine_CreateExpanded : global::Sy ReadOnly = false, Description = @"The indicator of whether this is the default gateway.Only one of the attached networks (including the CloudServicesNetwork attachment) for a single machine may be specified as True.", SerializedName = @"defaultGateway", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.DefaultGateway) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.DefaultGateway))] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.DefaultGateway CloudServiceNetworkAttachmentDefaultGateway { get => _virtualMachineParametersBody.CloudServiceNetworkAttachmentDefaultGateway ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.DefaultGateway)""); set => _virtualMachineParametersBody.CloudServiceNetworkAttachmentDefaultGateway = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("True", "False")] + public string CloudServiceNetworkAttachmentDefaultGateway { get => _virtualMachineParametersBody.CloudServiceNetworkAttachmentDefaultGateway ?? null; set => _virtualMachineParametersBody.CloudServiceNetworkAttachmentDefaultGateway = value; } /// /// The IP allocation mechanism for the virtual machine.Dynamic and Static are only valid for l3Network which may also specify @@ -118,9 +126,9 @@ public partial class NewAzNetworkCloudVirtualMachine_CreateExpanded : global::Sy ReadOnly = false, Description = @"The IP allocation mechanism for the virtual machine.Dynamic and Static are only valid for l3Network which may also specify Disabled.Otherwise, Disabled is the only permitted value.", SerializedName = @"ipAllocationMethod", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineIPAllocationMethod) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineIPAllocationMethod))] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineIPAllocationMethod CloudServiceNetworkAttachmentIPAllocationMethod { get => _virtualMachineParametersBody.CloudServiceNetworkAttachmentIPAllocationMethod; set => _virtualMachineParametersBody.CloudServiceNetworkAttachmentIPAllocationMethod = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Dynamic", "Static", "Disabled")] + public string CloudServiceNetworkAttachmentIPAllocationMethod { get => _virtualMachineParametersBody.CloudServiceNetworkAttachmentIPAllocationMethod ?? null; set => _virtualMachineParametersBody.CloudServiceNetworkAttachmentIPAllocationMethod = value; } /// /// The IPv4 address of the virtual machine.This field is used only if the attached network has IPAllocationType of IPV4 or @@ -200,7 +208,7 @@ public partial class NewAzNetworkCloudVirtualMachine_CreateExpanded : global::Sy Description = @"The number of CPU cores in the virtual machine.", SerializedName = @"cpuCores", PossibleTypes = new [] { typeof(long) })] - public long CpuCore { get => _virtualMachineParametersBody.CpuCore; set => _virtualMachineParametersBody.CpuCore = value; } + public long CpuCore { get => _virtualMachineParametersBody.CpuCore ?? default(long); set => _virtualMachineParametersBody.CpuCore = value; } /// /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet @@ -234,6 +242,9 @@ public partial class NewAzNetworkCloudVirtualMachine_CreateExpanded : global::Sy PossibleTypes = new [] { typeof(string) })] public string ExtendedLocationType { get => _virtualMachineParametersBody.ExtendedLocationType ?? null; set => _virtualMachineParametersBody.ExtendedLocationType = 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] @@ -294,9 +305,9 @@ public partial class NewAzNetworkCloudVirtualMachine_CreateExpanded : global::Sy ReadOnly = false, Description = @"Field Deprecated, the value will be ignored if provided. The indicator of whether one of the specified CPU cores is isolated to run the emulator thread for this virtual machine.", SerializedName = @"isolateEmulatorThread", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineIsolateEmulatorThread) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineIsolateEmulatorThread))] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineIsolateEmulatorThread IsolateEmulatorThread { get => _virtualMachineParametersBody.IsolateEmulatorThread ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineIsolateEmulatorThread)""); set => _virtualMachineParametersBody.IsolateEmulatorThread = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("True", "False")] + public string IsolateEmulatorThread { get => _virtualMachineParametersBody.IsolateEmulatorThread ?? null; set => _virtualMachineParametersBody.IsolateEmulatorThread = value; } /// The geo-location where the resource lives [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The geo-location where the resource lives")] @@ -318,7 +329,7 @@ public partial class NewAzNetworkCloudVirtualMachine_CreateExpanded : global::Sy Description = @"The memory size of the virtual machine. Allocations are measured in gibibytes.", SerializedName = @"memorySizeGB", PossibleTypes = new [] { typeof(long) })] - public long MemorySizeGb { get => _virtualMachineParametersBody.MemorySizeGb; set => _virtualMachineParametersBody.MemorySizeGb = value; } + public long MemorySizeGb { get => _virtualMachineParametersBody.MemorySizeGb ?? default(long); set => _virtualMachineParametersBody.MemorySizeGb = value; } /// /// cancellation delegate. Stops the cmdlet when called. @@ -352,8 +363,8 @@ public partial class NewAzNetworkCloudVirtualMachine_CreateExpanded : global::Sy ReadOnly = false, Description = @"The list of network attachments to the virtual machine.", SerializedName = @"networkAttachments", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkAttachment) })] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.INetworkAttachment[] NetworkAttachment { get => _virtualMachineParametersBody.NetworkAttachment ?? null /* arrayOf */; set => _virtualMachineParametersBody.NetworkAttachment = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkAttachment) })] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkAttachment[] NetworkAttachment { get => _virtualMachineParametersBody.NetworkAttachment?.ToArray() ?? null /* fixedArrayOf */; set => _virtualMachineParametersBody.NetworkAttachment = (value != null ? new System.Collections.Generic.List(value) : null); } /// The Base64 encoded cloud-init network data. [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The Base64 encoded cloud-init network data.")] @@ -382,9 +393,9 @@ public partial class NewAzNetworkCloudVirtualMachine_CreateExpanded : global::Sy ReadOnly = false, Description = @"The strategy for creating the OS disk.", SerializedName = @"createOption", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.OSDiskCreateOption) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.OSDiskCreateOption))] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.OSDiskCreateOption OSDiskCreateOption { get => _virtualMachineParametersBody.OSDiskCreateOption ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.OSDiskCreateOption)""); set => _virtualMachineParametersBody.OSDiskCreateOption = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Ephemeral", "Persistent")] + public string OSDiskCreateOption { get => _virtualMachineParametersBody.OSDiskCreateOption ?? null; set => _virtualMachineParametersBody.OSDiskCreateOption = value; } /// The strategy for deleting the OS disk. [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The strategy for deleting the OS disk.")] @@ -394,9 +405,9 @@ public partial class NewAzNetworkCloudVirtualMachine_CreateExpanded : global::Sy ReadOnly = false, Description = @"The strategy for deleting the OS disk.", SerializedName = @"deleteOption", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.OSDiskDeleteOption) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.OSDiskDeleteOption))] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.OSDiskDeleteOption OSDiskDeleteOption { get => _virtualMachineParametersBody.OSDiskDeleteOption ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.OSDiskDeleteOption)""); set => _virtualMachineParametersBody.OSDiskDeleteOption = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Delete")] + public string OSDiskDeleteOption { get => _virtualMachineParametersBody.OSDiskDeleteOption ?? null; set => _virtualMachineParametersBody.OSDiskDeleteOption = value; } /// /// The size of the disk. Required if the createOption is Ephemeral. Allocations are measured in gibibytes. @@ -409,12 +420,12 @@ public partial class NewAzNetworkCloudVirtualMachine_CreateExpanded : global::Sy Description = @"The size of the disk. Required if the createOption is Ephemeral. Allocations are measured in gibibytes.", SerializedName = @"diskSizeGB", PossibleTypes = new [] { typeof(long) })] - public long OSDiskSizeGb { get => _virtualMachineParametersBody.OSDiskSizeGb; set => _virtualMachineParametersBody.OSDiskSizeGb = value; } + public long OSDiskSizeGb { get => _virtualMachineParametersBody.OSDiskSizeGb ?? default(long); set => _virtualMachineParametersBody.OSDiskSizeGb = value; } /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } /// The scheduling hints for the virtual machine. [global::System.Management.Automation.AllowEmptyCollection] @@ -425,8 +436,8 @@ public partial class NewAzNetworkCloudVirtualMachine_CreateExpanded : global::Sy ReadOnly = false, Description = @"The scheduling hints for the virtual machine.", SerializedName = @"placementHints", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePlacementHint) })] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePlacementHint[] PlacementHint { get => _virtualMachineParametersBody.PlacementHint ?? null /* arrayOf */; set => _virtualMachineParametersBody.PlacementHint = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePlacementHint) })] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePlacementHint[] PlacementHint { get => _virtualMachineParametersBody.PlacementHint?.ToArray() ?? null /* fixedArrayOf */; set => _virtualMachineParametersBody.PlacementHint = (value != null ? new System.Collections.Generic.List(value) : null); } /// The URI for the proxy server to use [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] @@ -470,8 +481,8 @@ public partial class NewAzNetworkCloudVirtualMachine_CreateExpanded : global::Sy ReadOnly = false, Description = @"The list of ssh public keys. Each key will be added to the virtual machine using the cloud-init ssh_authorized_keys mechanism for the adminUsername.", SerializedName = @"sshPublicKeys", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey) })] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey[] SshPublicKey { get => _virtualMachineParametersBody.SshPublicKey ?? null /* arrayOf */; set => _virtualMachineParametersBody.SshPublicKey = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISshPublicKey) })] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISshPublicKey[] SshPublicKey { get => _virtualMachineParametersBody.SshPublicKey?.ToArray() ?? null /* fixedArrayOf */; set => _virtualMachineParametersBody.SshPublicKey = (value != null ? new System.Collections.Generic.List(value) : null); } /// /// The resource IDs of volumes that are requested to be attached to the virtual machine. @@ -485,7 +496,7 @@ public partial class NewAzNetworkCloudVirtualMachine_CreateExpanded : global::Sy Description = @"The resource IDs of volumes that are requested to be attached to the virtual machine.", SerializedName = @"volumeAttachments", PossibleTypes = new [] { typeof(string) })] - public string[] StorageProfileVolumeAttachment { get => _virtualMachineParametersBody.StorageProfileVolumeAttachment ?? null /* arrayOf */; set => _virtualMachineParametersBody.StorageProfileVolumeAttachment = value; } + public string[] StorageProfileVolumeAttachment { get => _virtualMachineParametersBody.StorageProfileVolumeAttachment?.ToArray() ?? null /* fixedArrayOf */; set => _virtualMachineParametersBody.StorageProfileVolumeAttachment = (value != null ? new System.Collections.Generic.List(value) : null); } /// Backing field for property. private string _subscriptionId; @@ -501,7 +512,8 @@ public partial class NewAzNetworkCloudVirtualMachine_CreateExpanded : global::Sy [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -514,8 +526,8 @@ public partial class NewAzNetworkCloudVirtualMachine_CreateExpanded : global::Sy ReadOnly = false, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceTags) })] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceTags Tag { get => _virtualMachineParametersBody.Tag ?? null /* object */; set => _virtualMachineParametersBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceTags Tag { get => _virtualMachineParametersBody.Tag ?? null /* object */; set => _virtualMachineParametersBody.Tag = value; } /// The Base64 encoded cloud-init user data. [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The Base64 encoded cloud-init user data.")] @@ -536,9 +548,9 @@ public partial class NewAzNetworkCloudVirtualMachine_CreateExpanded : global::Sy ReadOnly = false, Description = @"The type of the device model to use.", SerializedName = @"vmDeviceModel", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineDeviceModelType) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineDeviceModelType))] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineDeviceModelType VMDeviceModel { get => _virtualMachineParametersBody.VMDeviceModel ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineDeviceModelType)""); set => _virtualMachineParametersBody.VMDeviceModel = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("T1", "T2", "T3")] + public string VMDeviceModel { get => _virtualMachineParametersBody.VMDeviceModel ?? null; set => _virtualMachineParametersBody.VMDeviceModel = value; } /// /// The virtual machine image that is currently provisioned to the OS disk, using the full url and tag notation used to pull @@ -599,33 +611,33 @@ public partial class NewAzNetworkCloudVirtualMachine_CreateExpanded : global::Sy ReadOnly = false, Description = @"Field Deprecated, use virtualizationModel instead. The type of the virtio interface.", SerializedName = @"virtioInterface", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineVirtioInterfaceType) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineVirtioInterfaceType))] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineVirtioInterfaceType VirtioInterface { get => _virtualMachineParametersBody.VirtioInterface ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VirtualMachineVirtioInterfaceType)""); set => _virtualMachineParametersBody.VirtioInterface = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Modern", "Transitional")] + public string VirtioInterface { get => _virtualMachineParametersBody.VirtioInterface ?? null; set => _virtualMachineParametersBody.VirtioInterface = 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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IVirtualMachine + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachine /// 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) @@ -738,11 +750,36 @@ 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.NetworkCloud.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -754,10 +791,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -767,7 +820,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public NewAzNetworkCloudVirtualMachine_CreateExpanded() { @@ -833,7 +886,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -846,12 +899,12 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.VirtualMachinesCreateOrUpdate(SubscriptionId, ResourceGroupName, Name, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _virtualMachineParametersBody, onOk, onDefault, this, Pipeline); + await this.Client.VirtualMachinesCreateOrUpdate(SubscriptionId, ResourceGroupName, Name, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _virtualMachineParametersBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate); await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null,body=_virtualMachineParametersBody}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -889,12 +942,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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ) { @@ -911,15 +964,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.NetworkCloud.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, IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, body=_virtualMachineParametersBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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, IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, body=_virtualMachineParametersBody }) + 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 } }); @@ -929,12 +982,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.NetworkCloud.Models.Api20250201.IVirtualMachine + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachine /// 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 ) { @@ -946,8 +999,9 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachine - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachine + var result = (await response); + WriteObject(result, false); } } } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/NewAzNetworkCloudVirtualMachine_CreateViaJsonFilePath.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/NewAzNetworkCloudVirtualMachine_CreateViaJsonFilePath.cs new file mode 100644 index 000000000000..afd199ac1d35 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/NewAzNetworkCloudVirtualMachine_CreateViaJsonFilePath.cs @@ -0,0 +1,614 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; + using System; + + /// + /// create a new virtual machine or create the properties of the existing virtual machine. + /// + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/virtualMachines/{virtualMachineName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzNetworkCloudVirtualMachine_CreateViaJsonFilePath", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachine))] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"create a new virtual machine or create the properties of the existing virtual machine.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/virtualMachines/{virtualMachineName}", ApiVersion = "2025-02-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.NotSuggestDefaultParameterSet] + public partial class NewAzNetworkCloudVirtualMachine_CreateViaJsonFilePath : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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(); + + public global::System.String _jsonString; + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private string _ifMatch; + + /// + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value + /// to prevent accidentally overwriting concurrent changes. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes.", + SerializedName = @"If-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Header)] + public string IfMatch { get => this._ifMatch; set => this._ifMatch = value; } + + /// Backing field for property. + private string _ifNoneMatch; + + /// + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result + /// in error from server as they are not supported. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result in error from server as they are not supported.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result in error from server as they are not supported.", + SerializedName = @"If-None-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Header)] + public string IfNoneMatch { get => this._ifNoneMatch; set => this._ifNoneMatch = 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 _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.NetworkCloud.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.NetworkCloud.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of the virtual machine. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the virtual machine.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the virtual machine.", + SerializedName = @"virtualMachineName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("VirtualMachineName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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. The value must be an UUID. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription. The value must be an UUID.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription. The value must be an UUID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.IVirtualMachine + /// 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.NetworkCloud.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of NewAzNetworkCloudVirtualMachine_CreateViaJsonFilePath + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets.NewAzNetworkCloudVirtualMachine_CreateViaJsonFilePath Clone() + { + var clone = new NewAzNetworkCloudVirtualMachine_CreateViaJsonFilePath(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.Name = this.Name; + clone.IfMatch = this.IfMatch; + clone.IfNoneMatch = this.IfNoneMatch; + clone.JsonFilePath = this.JsonFilePath; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 NewAzNetworkCloudVirtualMachine_CreateViaJsonFilePath() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'VirtualMachinesCreateOrUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.VirtualMachinesCreateOrUpdateViaJsonString(SubscriptionId, ResourceGroupName, Name, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _jsonString, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.IVirtualMachine + /// 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.NetworkCloud.Models.IVirtualMachine + var result = (await response); + WriteObject(result, false); + } + } + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/NewAzNetworkCloudVirtualMachine_CreateViaJsonString.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/NewAzNetworkCloudVirtualMachine_CreateViaJsonString.cs new file mode 100644 index 000000000000..8361131bd6b1 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/NewAzNetworkCloudVirtualMachine_CreateViaJsonString.cs @@ -0,0 +1,612 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; + using System; + + /// + /// create a new virtual machine or create the properties of the existing virtual machine. + /// + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/virtualMachines/{virtualMachineName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzNetworkCloudVirtualMachine_CreateViaJsonString", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachine))] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"create a new virtual machine or create the properties of the existing virtual machine.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/virtualMachines/{virtualMachineName}", ApiVersion = "2025-02-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.NotSuggestDefaultParameterSet] + public partial class NewAzNetworkCloudVirtualMachine_CreateViaJsonString : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private string _ifMatch; + + /// + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value + /// to prevent accidentally overwriting concurrent changes. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes.", + SerializedName = @"If-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Header)] + public string IfMatch { get => this._ifMatch; set => this._ifMatch = value; } + + /// Backing field for property. + private string _ifNoneMatch; + + /// + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result + /// in error from server as they are not supported. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result in error from server as they are not supported.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result in error from server as they are not supported.", + SerializedName = @"If-None-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Header)] + public string IfNoneMatch { get => this._ifNoneMatch; set => this._ifNoneMatch = 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 Create operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Json string supplied to the Create operation")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of the virtual machine. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the virtual machine.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the virtual machine.", + SerializedName = @"virtualMachineName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("VirtualMachineName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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. The value must be an UUID. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription. The value must be an UUID.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription. The value must be an UUID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.IVirtualMachine + /// 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.NetworkCloud.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of NewAzNetworkCloudVirtualMachine_CreateViaJsonString + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets.NewAzNetworkCloudVirtualMachine_CreateViaJsonString Clone() + { + var clone = new NewAzNetworkCloudVirtualMachine_CreateViaJsonString(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.Name = this.Name; + clone.IfMatch = this.IfMatch; + clone.IfNoneMatch = this.IfNoneMatch; + clone.JsonString = this.JsonString; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 NewAzNetworkCloudVirtualMachine_CreateViaJsonString() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'VirtualMachinesCreateOrUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.VirtualMachinesCreateOrUpdateViaJsonString(SubscriptionId, ResourceGroupName, Name, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _jsonString, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.IVirtualMachine + /// 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.NetworkCloud.Models.IVirtualMachine + var result = (await response); + WriteObject(result, false); + } + } + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/NewAzNetworkCloudVolume_CreateExpanded.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/NewAzNetworkCloudVolume_CreateExpanded.cs index 72acd73586b9..7bbcbd4c28f2 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/NewAzNetworkCloudVolume_CreateExpanded.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/NewAzNetworkCloudVolume_CreateExpanded.cs @@ -6,20 +6,22 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; - /// Create a new volume or update the properties of the existing one. + /// create a new volume or create the properties of the existing one. /// /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/volumes/{volumeName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzNetworkCloudVolume_CreateExpanded", SupportsShouldProcess = true)] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolume", "15.0.0", "2.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"AttachedTo"}, NewOutputProperties=new string[] {"AttachedTo"}, ChangeDescription="The type of property will be changed from fixed array to 'List'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolume))] - [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Create a new volume or update the properties of the existing one.")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolume))] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"create a new volume or create the properties of the existing one.")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/volumes/{volumeName}", ApiVersion = "2025-02-01")] public partial class NewAzNetworkCloudVolume_CreateExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,10 +37,13 @@ public partial class NewAzNetworkCloudVolume_CreateExpanded : 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(); + /// /// Volume represents storage made available for use by resources running on the cluster. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolume _volumeParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.Volume(); + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolume _volumeParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Volume(); /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] @@ -50,6 +55,9 @@ public partial class NewAzNetworkCloudVolume_CreateExpanded : global::System.Man [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -85,6 +93,9 @@ public partial class NewAzNetworkCloudVolume_CreateExpanded : global::System.Man PossibleTypes = new [] { typeof(string) })] public string ExtendedLocationType { get => _volumeParametersBody.ExtendedLocationType ?? null; set => _volumeParametersBody.ExtendedLocationType = 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] @@ -179,7 +190,7 @@ public partial class NewAzNetworkCloudVolume_CreateExpanded : global::System.Man /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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")] @@ -220,7 +231,7 @@ public partial class NewAzNetworkCloudVolume_CreateExpanded : global::System.Man Description = @"The size of the allocation for this volume in Mebibytes.", SerializedName = @"sizeMiB", PossibleTypes = new [] { typeof(long) })] - public long SizeMiB { get => _volumeParametersBody.SizeMiB; set => _volumeParametersBody.SizeMiB = value; } + public long SizeMiB { get => _volumeParametersBody.SizeMiB ?? default(long); set => _volumeParametersBody.SizeMiB = value; } /// Backing field for property. private string _subscriptionId; @@ -236,7 +247,8 @@ public partial class NewAzNetworkCloudVolume_CreateExpanded : global::System.Man [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -249,32 +261,32 @@ public partial class NewAzNetworkCloudVolume_CreateExpanded : global::System.Man ReadOnly = false, Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceTags) })] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.ITrackedResourceTags Tag { get => _volumeParametersBody.Tag ?? null /* object */; set => _volumeParametersBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceTags Tag { get => _volumeParametersBody.Tag ?? null /* object */; set => _volumeParametersBody.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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IVolume + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolume /// 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) @@ -387,11 +399,36 @@ 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.NetworkCloud.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -403,10 +440,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -416,7 +469,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public NewAzNetworkCloudVolume_CreateExpanded() { @@ -482,7 +535,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -495,12 +548,12 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.VolumesCreateOrUpdate(SubscriptionId, ResourceGroupName, Name, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _volumeParametersBody, onOk, onDefault, this, Pipeline); + await this.Client.VolumesCreateOrUpdate(SubscriptionId, ResourceGroupName, Name, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _volumeParametersBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate); await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null,body=_volumeParametersBody}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -538,12 +591,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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ) { @@ -560,15 +613,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.NetworkCloud.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, IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, body=_volumeParametersBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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, IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, body=_volumeParametersBody }) + 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 } }); @@ -578,12 +631,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.NetworkCloud.Models.Api20250201.IVolume + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolume /// 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 ) { @@ -595,8 +648,9 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolume - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolume + var result = (await response); + WriteObject(result, false); } } } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/NewAzNetworkCloudVolume_CreateViaJsonFilePath.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/NewAzNetworkCloudVolume_CreateViaJsonFilePath.cs new file mode 100644 index 000000000000..8d44697dac77 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/NewAzNetworkCloudVolume_CreateViaJsonFilePath.cs @@ -0,0 +1,612 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; + using System; + + /// create a new volume or create the properties of the existing one. + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/volumes/{volumeName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzNetworkCloudVolume_CreateViaJsonFilePath", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolume))] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"create a new volume or create the properties of the existing one.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/volumes/{volumeName}", ApiVersion = "2025-02-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.NotSuggestDefaultParameterSet] + public partial class NewAzNetworkCloudVolume_CreateViaJsonFilePath : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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(); + + public global::System.String _jsonString; + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private string _ifMatch; + + /// + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value + /// to prevent accidentally overwriting concurrent changes. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes.", + SerializedName = @"If-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Header)] + public string IfMatch { get => this._ifMatch; set => this._ifMatch = value; } + + /// Backing field for property. + private string _ifNoneMatch; + + /// + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result + /// in error from server as they are not supported. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result in error from server as they are not supported.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result in error from server as they are not supported.", + SerializedName = @"If-None-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Header)] + public string IfNoneMatch { get => this._ifNoneMatch; set => this._ifNoneMatch = 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 _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.NetworkCloud.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.NetworkCloud.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of the volume. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the volume.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the volume.", + SerializedName = @"volumeName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("VolumeName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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. The value must be an UUID. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription. The value must be an UUID.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription. The value must be an UUID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.IVolume + /// 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.NetworkCloud.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of NewAzNetworkCloudVolume_CreateViaJsonFilePath + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets.NewAzNetworkCloudVolume_CreateViaJsonFilePath Clone() + { + var clone = new NewAzNetworkCloudVolume_CreateViaJsonFilePath(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.Name = this.Name; + clone.IfMatch = this.IfMatch; + clone.IfNoneMatch = this.IfNoneMatch; + clone.JsonFilePath = this.JsonFilePath; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 NewAzNetworkCloudVolume_CreateViaJsonFilePath() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'VolumesCreateOrUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.VolumesCreateOrUpdateViaJsonString(SubscriptionId, ResourceGroupName, Name, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _jsonString, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.IVolume + /// 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.NetworkCloud.Models.IVolume + var result = (await response); + WriteObject(result, false); + } + } + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/NewAzNetworkCloudVolume_CreateViaJsonString.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/NewAzNetworkCloudVolume_CreateViaJsonString.cs new file mode 100644 index 000000000000..004a7b4b2215 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/NewAzNetworkCloudVolume_CreateViaJsonString.cs @@ -0,0 +1,610 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; + using System; + + /// create a new volume or create the properties of the existing one. + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/volumes/{volumeName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzNetworkCloudVolume_CreateViaJsonString", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolume))] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"create a new volume or create the properties of the existing one.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/volumes/{volumeName}", ApiVersion = "2025-02-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.NotSuggestDefaultParameterSet] + public partial class NewAzNetworkCloudVolume_CreateViaJsonString : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private string _ifMatch; + + /// + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value + /// to prevent accidentally overwriting concurrent changes. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes.", + SerializedName = @"If-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Header)] + public string IfMatch { get => this._ifMatch; set => this._ifMatch = value; } + + /// Backing field for property. + private string _ifNoneMatch; + + /// + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result + /// in error from server as they are not supported. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result in error from server as they are not supported.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result in error from server as they are not supported.", + SerializedName = @"If-None-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Header)] + public string IfNoneMatch { get => this._ifNoneMatch; set => this._ifNoneMatch = 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 Create operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Json string supplied to the Create operation")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of the volume. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the volume.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the volume.", + SerializedName = @"volumeName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("VolumeName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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. The value must be an UUID. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription. The value must be an UUID.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription. The value must be an UUID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.IVolume + /// 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.NetworkCloud.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of NewAzNetworkCloudVolume_CreateViaJsonString + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets.NewAzNetworkCloudVolume_CreateViaJsonString Clone() + { + var clone = new NewAzNetworkCloudVolume_CreateViaJsonString(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.Name = this.Name; + clone.IfMatch = this.IfMatch; + clone.IfNoneMatch = this.IfNoneMatch; + clone.JsonString = this.JsonString; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 NewAzNetworkCloudVolume_CreateViaJsonString() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'VolumesCreateOrUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.VolumesCreateOrUpdateViaJsonString(SubscriptionId, ResourceGroupName, Name, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _jsonString, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.IVolume + /// 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.NetworkCloud.Models.IVolume + var result = (await response); + WriteObject(result, false); + } + } + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RemoveAzNetworkCloudAgentPool_Delete.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RemoveAzNetworkCloudAgentPool_Delete.cs index 9e8ec10b4b82..b264305e3858 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RemoveAzNetworkCloudAgentPool_Delete.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RemoveAzNetworkCloudAgentPool_Delete.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// Delete the provided Kubernetes cluster agent pool. @@ -18,7 +20,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/kubernetesClusters/{kubernetesClusterName}/agentPools/{agentPoolName}", ApiVersion = "2025-02-01")] public partial class RemoveAzNetworkCloudAgentPool_Delete : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,6 +37,9 @@ public partial class RemoveAzNetworkCloudAgentPool_Delete : 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(); + /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] @@ -44,6 +50,9 @@ public partial class RemoveAzNetworkCloudAgentPool_Delete : global::System.Manag [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -57,6 +66,9 @@ public partial class RemoveAzNetworkCloudAgentPool_Delete : global::System.Manag [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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] @@ -161,7 +173,7 @@ public partial class RemoveAzNetworkCloudAgentPool_Delete : global::System.Manag /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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")] @@ -207,7 +219,8 @@ public partial class RemoveAzNetworkCloudAgentPool_Delete : global::System.Manag [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -216,12 +229,12 @@ public partial class RemoveAzNetworkCloudAgentPool_Delete : 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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 @@ -354,11 +367,36 @@ 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.NetworkCloud.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -370,10 +408,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -441,7 +495,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -459,7 +513,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,KubernetesClusterName=KubernetesClusterName,Name=Name,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,KubernetesClusterName=KubernetesClusterName,Name=Name,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -472,7 +526,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public RemoveAzNetworkCloudAgentPool_Delete() { @@ -505,12 +559,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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ) { @@ -527,15 +581,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.NetworkCloud.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, KubernetesClusterName=KubernetesClusterName, Name=Name, IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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, KubernetesClusterName=KubernetesClusterName, Name=Name, IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : 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 } }); @@ -560,7 +614,7 @@ protected override void StopProcessing() return ; } // onNoContent - response for 204 / - if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + if (true == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) { WriteObject(true); } @@ -584,7 +638,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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RemoveAzNetworkCloudAgentPool_DeleteViaIdentity.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RemoveAzNetworkCloudAgentPool_DeleteViaIdentity.cs index 3ad87cebd0df..b6ad4d64ddc6 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RemoveAzNetworkCloudAgentPool_DeleteViaIdentity.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RemoveAzNetworkCloudAgentPool_DeleteViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// Delete the provided Kubernetes cluster agent pool. @@ -18,7 +20,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/kubernetesClusters/{kubernetesClusterName}/agentPools/{agentPoolName}", ApiVersion = "2025-02-01")] public partial class RemoveAzNetworkCloudAgentPool_DeleteViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,6 +37,9 @@ public partial class RemoveAzNetworkCloudAgentPool_DeleteViaIdentity : 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(); + /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] @@ -44,6 +50,9 @@ public partial class RemoveAzNetworkCloudAgentPool_DeleteViaIdentity : global::S [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -57,6 +66,9 @@ public partial class RemoveAzNetworkCloudAgentPool_DeleteViaIdentity : global::S [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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] @@ -140,7 +152,7 @@ public partial class RemoveAzNetworkCloudAgentPool_DeleteViaIdentity : global::S /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,12 +175,12 @@ public partial class RemoveAzNetworkCloudAgentPool_DeleteViaIdentity : 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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 @@ -297,11 +309,36 @@ 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.NetworkCloud.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -313,10 +350,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -384,7 +437,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -426,7 +479,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -439,7 +492,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public RemoveAzNetworkCloudAgentPool_DeleteViaIdentity() { @@ -472,12 +525,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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ) { @@ -494,15 +547,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.NetworkCloud.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 { IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : 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 } }); @@ -527,7 +580,7 @@ protected override void StopProcessing() return ; } // onNoContent - response for 204 / - if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + if (true == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) { WriteObject(true); } @@ -551,7 +604,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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RemoveAzNetworkCloudAgentPool_DeleteViaIdentityKubernetesCluster.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RemoveAzNetworkCloudAgentPool_DeleteViaIdentityKubernetesCluster.cs new file mode 100644 index 000000000000..d1b8840931ed --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RemoveAzNetworkCloudAgentPool_DeleteViaIdentityKubernetesCluster.cs @@ -0,0 +1,630 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; + using System; + + /// Delete the provided Kubernetes cluster agent pool. + /// + /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/kubernetesClusters/{kubernetesClusterName}/agentPools/{agentPoolName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzNetworkCloudAgentPool_DeleteViaIdentityKubernetesCluster", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Delete the provided Kubernetes cluster agent pool.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/kubernetesClusters/{kubernetesClusterName}/agentPools/{agentPoolName}", ApiVersion = "2025-02-01")] + public partial class RemoveAzNetworkCloudAgentPool_DeleteViaIdentityKubernetesCluster : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private string _ifMatch; + + /// + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value + /// to prevent accidentally overwriting concurrent changes. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes.", + SerializedName = @"If-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Header)] + public string IfMatch { get => this._ifMatch; set => this._ifMatch = value; } + + /// Backing field for property. + private string _ifNoneMatch; + + /// + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result + /// in error from server as they are not supported. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result in error from server as they are not supported.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result in error from server as they are not supported.", + SerializedName = @"If-None-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Header)] + public string IfNoneMatch { get => this._ifNoneMatch; set => this._ifNoneMatch = 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 Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity _kubernetesClusterInputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity KubernetesClusterInputObject { get => this._kubernetesClusterInputObject; set => this._kubernetesClusterInputObject = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of the Kubernetes cluster agent pool. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the Kubernetes cluster agent pool.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the Kubernetes cluster agent pool.", + SerializedName = @"agentPoolName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("AgentPoolName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// 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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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); + + /// + /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of + /// what happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of RemoveAzNetworkCloudAgentPool_DeleteViaIdentityKubernetesCluster + /// + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets.RemoveAzNetworkCloudAgentPool_DeleteViaIdentityKubernetesCluster Clone() + { + var clone = new RemoveAzNetworkCloudAgentPool_DeleteViaIdentityKubernetesCluster(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.IfMatch = this.IfMatch; + clone.IfNoneMatch = this.IfNoneMatch; + clone.Name = this.Name; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'AgentPoolsDelete' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (KubernetesClusterInputObject?.Id != null) + { + this.KubernetesClusterInputObject.Id += $"/agentPools/{(global::System.Uri.EscapeDataString(this.Name.ToString()))}"; + await this.Client.AgentPoolsDeleteViaIdentity(KubernetesClusterInputObject.Id, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, onOk, onNoContent, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == KubernetesClusterInputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("KubernetesClusterInputObject has null value for KubernetesClusterInputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, KubernetesClusterInputObject) ); + } + if (null == KubernetesClusterInputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("KubernetesClusterInputObject has null value for KubernetesClusterInputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, KubernetesClusterInputObject) ); + } + if (null == KubernetesClusterInputObject.KubernetesClusterName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("KubernetesClusterInputObject has null value for KubernetesClusterInputObject.KubernetesClusterName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, KubernetesClusterInputObject) ); + } + await this.Client.AgentPoolsDelete(KubernetesClusterInputObject.SubscriptionId ?? null, KubernetesClusterInputObject.ResourceGroupName ?? null, KubernetesClusterInputObject.KubernetesClusterName ?? null, Name, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, onOk, onNoContent, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Name=Name,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Initializes a new instance of the cmdlet + /// class. + /// + public RemoveAzNetworkCloudAgentPool_DeleteViaIdentityKubernetesCluster() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / + if (true == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RemoveAzNetworkCloudBareMetalMachineKeySet_Delete.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RemoveAzNetworkCloudBareMetalMachineKeySet_Delete.cs index ef2e4af13700..5b95a4759245 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RemoveAzNetworkCloudBareMetalMachineKeySet_Delete.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RemoveAzNetworkCloudBareMetalMachineKeySet_Delete.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// Delete the bare metal machine key set of the provided cluster. @@ -18,7 +20,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/bareMetalMachineKeySets/{bareMetalMachineKeySetName}", ApiVersion = "2025-02-01")] public partial class RemoveAzNetworkCloudBareMetalMachineKeySet_Delete : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,6 +37,9 @@ public partial class RemoveAzNetworkCloudBareMetalMachineKeySet_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(); + /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] @@ -44,6 +50,9 @@ public partial class RemoveAzNetworkCloudBareMetalMachineKeySet_Delete : global: [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -71,6 +80,9 @@ public partial class RemoveAzNetworkCloudBareMetalMachineKeySet_Delete : global: [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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] @@ -161,7 +173,7 @@ public partial class RemoveAzNetworkCloudBareMetalMachineKeySet_Delete : global: /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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")] @@ -207,7 +219,8 @@ public partial class RemoveAzNetworkCloudBareMetalMachineKeySet_Delete : global: [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -216,12 +229,12 @@ public partial class RemoveAzNetworkCloudBareMetalMachineKeySet_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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 @@ -354,11 +367,36 @@ 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.NetworkCloud.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -370,10 +408,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -441,7 +495,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -459,7 +513,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,ClusterName=ClusterName,Name=Name,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,ClusterName=ClusterName,Name=Name,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -472,7 +526,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public RemoveAzNetworkCloudBareMetalMachineKeySet_Delete() { @@ -505,12 +559,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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ) { @@ -527,15 +581,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.NetworkCloud.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, ClusterName=ClusterName, Name=Name, IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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, ClusterName=ClusterName, Name=Name, IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : 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 } }); @@ -560,7 +614,7 @@ protected override void StopProcessing() return ; } // onNoContent - response for 204 / - if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + if (true == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) { WriteObject(true); } @@ -584,7 +638,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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RemoveAzNetworkCloudBareMetalMachineKeySet_DeleteViaIdentity.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RemoveAzNetworkCloudBareMetalMachineKeySet_DeleteViaIdentity.cs index 47e5e8ceb6fa..d5c3b79b6da7 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RemoveAzNetworkCloudBareMetalMachineKeySet_DeleteViaIdentity.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RemoveAzNetworkCloudBareMetalMachineKeySet_DeleteViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// Delete the bare metal machine key set of the provided cluster. @@ -18,7 +20,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/bareMetalMachineKeySets/{bareMetalMachineKeySetName}", ApiVersion = "2025-02-01")] public partial class RemoveAzNetworkCloudBareMetalMachineKeySet_DeleteViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,6 +37,9 @@ public partial class RemoveAzNetworkCloudBareMetalMachineKeySet_DeleteViaIdentit /// 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(); + /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] @@ -44,6 +50,9 @@ public partial class RemoveAzNetworkCloudBareMetalMachineKeySet_DeleteViaIdentit [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -57,6 +66,9 @@ public partial class RemoveAzNetworkCloudBareMetalMachineKeySet_DeleteViaIdentit [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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] @@ -140,7 +152,7 @@ public partial class RemoveAzNetworkCloudBareMetalMachineKeySet_DeleteViaIdentit /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,12 +175,12 @@ public partial class RemoveAzNetworkCloudBareMetalMachineKeySet_DeleteViaIdentit /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 @@ -299,11 +311,36 @@ 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.NetworkCloud.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -315,10 +352,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -386,7 +439,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -428,7 +481,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -441,7 +494,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public RemoveAzNetworkCloudBareMetalMachineKeySet_DeleteViaIdentity() { @@ -474,12 +527,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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ) { @@ -496,15 +549,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.NetworkCloud.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 { IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : 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 } }); @@ -529,7 +582,7 @@ protected override void StopProcessing() return ; } // onNoContent - response for 204 / - if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + if (true == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) { WriteObject(true); } @@ -553,7 +606,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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RemoveAzNetworkCloudBareMetalMachineKeySet_DeleteViaIdentityCluster.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RemoveAzNetworkCloudBareMetalMachineKeySet_DeleteViaIdentityCluster.cs new file mode 100644 index 000000000000..0f3fa2598979 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RemoveAzNetworkCloudBareMetalMachineKeySet_DeleteViaIdentityCluster.cs @@ -0,0 +1,630 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; + using System; + + /// Delete the bare metal machine key set of the provided cluster. + /// + /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/bareMetalMachineKeySets/{bareMetalMachineKeySetName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzNetworkCloudBareMetalMachineKeySet_DeleteViaIdentityCluster", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Delete the bare metal machine key set of the provided cluster.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/bareMetalMachineKeySets/{bareMetalMachineKeySetName}", ApiVersion = "2025-02-01")] + public partial class RemoveAzNetworkCloudBareMetalMachineKeySet_DeleteViaIdentityCluster : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity _clusterInputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity ClusterInputObject { get => this._clusterInputObject; set => this._clusterInputObject = 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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private string _ifMatch; + + /// + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value + /// to prevent accidentally overwriting concurrent changes. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes.", + SerializedName = @"If-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Header)] + public string IfMatch { get => this._ifMatch; set => this._ifMatch = value; } + + /// Backing field for property. + private string _ifNoneMatch; + + /// + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result + /// in error from server as they are not supported. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result in error from server as they are not supported.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result in error from server as they are not supported.", + SerializedName = @"If-None-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Header)] + public string IfNoneMatch { get => this._ifNoneMatch; set => this._ifNoneMatch = 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.NetworkCloud.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of the bare metal machine key set. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the bare metal machine key set.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the bare metal machine key set.", + SerializedName = @"bareMetalMachineKeySetName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("BareMetalMachineKeySetName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// 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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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); + + /// + /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of + /// what happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of RemoveAzNetworkCloudBareMetalMachineKeySet_DeleteViaIdentityCluster + /// + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets.RemoveAzNetworkCloudBareMetalMachineKeySet_DeleteViaIdentityCluster Clone() + { + var clone = new RemoveAzNetworkCloudBareMetalMachineKeySet_DeleteViaIdentityCluster(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.IfMatch = this.IfMatch; + clone.IfNoneMatch = this.IfNoneMatch; + clone.Name = this.Name; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'BareMetalMachineKeySetsDelete' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (ClusterInputObject?.Id != null) + { + this.ClusterInputObject.Id += $"/bareMetalMachineKeySets/{(global::System.Uri.EscapeDataString(this.Name.ToString()))}"; + await this.Client.BareMetalMachineKeySetsDeleteViaIdentity(ClusterInputObject.Id, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, onOk, onNoContent, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == ClusterInputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("ClusterInputObject has null value for ClusterInputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, ClusterInputObject) ); + } + if (null == ClusterInputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("ClusterInputObject has null value for ClusterInputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, ClusterInputObject) ); + } + if (null == ClusterInputObject.ClusterName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("ClusterInputObject has null value for ClusterInputObject.ClusterName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, ClusterInputObject) ); + } + await this.Client.BareMetalMachineKeySetsDelete(ClusterInputObject.SubscriptionId ?? null, ClusterInputObject.ResourceGroupName ?? null, ClusterInputObject.ClusterName ?? null, Name, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, onOk, onNoContent, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Name=Name,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Initializes a new instance of the cmdlet + /// class. + /// + public RemoveAzNetworkCloudBareMetalMachineKeySet_DeleteViaIdentityCluster() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / + if (true == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RemoveAzNetworkCloudBmcKeySet_Delete.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RemoveAzNetworkCloudBmcKeySet_Delete.cs index c5687491cff4..5be53b48a436 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RemoveAzNetworkCloudBmcKeySet_Delete.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RemoveAzNetworkCloudBmcKeySet_Delete.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// Delete the baseboard management controller key set of the provided cluster. @@ -18,7 +20,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/bmcKeySets/{bmcKeySetName}", ApiVersion = "2025-02-01")] public partial class RemoveAzNetworkCloudBmcKeySet_Delete : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,6 +37,9 @@ public partial class RemoveAzNetworkCloudBmcKeySet_Delete : 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(); + /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] @@ -44,6 +50,9 @@ public partial class RemoveAzNetworkCloudBmcKeySet_Delete : global::System.Manag [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -71,6 +80,9 @@ public partial class RemoveAzNetworkCloudBmcKeySet_Delete : global::System.Manag [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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] @@ -161,7 +173,7 @@ public partial class RemoveAzNetworkCloudBmcKeySet_Delete : global::System.Manag /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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")] @@ -207,7 +219,8 @@ public partial class RemoveAzNetworkCloudBmcKeySet_Delete : global::System.Manag [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -216,12 +229,12 @@ public partial class RemoveAzNetworkCloudBmcKeySet_Delete : 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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 @@ -354,11 +367,36 @@ 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.NetworkCloud.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -370,10 +408,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -441,7 +495,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -459,7 +513,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,ClusterName=ClusterName,Name=Name,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,ClusterName=ClusterName,Name=Name,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -472,7 +526,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public RemoveAzNetworkCloudBmcKeySet_Delete() { @@ -505,12 +559,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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ) { @@ -527,15 +581,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.NetworkCloud.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, ClusterName=ClusterName, Name=Name, IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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, ClusterName=ClusterName, Name=Name, IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : 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 } }); @@ -560,7 +614,7 @@ protected override void StopProcessing() return ; } // onNoContent - response for 204 / - if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + if (true == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) { WriteObject(true); } @@ -584,7 +638,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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RemoveAzNetworkCloudBmcKeySet_DeleteViaIdentity.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RemoveAzNetworkCloudBmcKeySet_DeleteViaIdentity.cs index 5a127d406086..45e70396e7ce 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RemoveAzNetworkCloudBmcKeySet_DeleteViaIdentity.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RemoveAzNetworkCloudBmcKeySet_DeleteViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// Delete the baseboard management controller key set of the provided cluster. @@ -18,7 +20,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/bmcKeySets/{bmcKeySetName}", ApiVersion = "2025-02-01")] public partial class RemoveAzNetworkCloudBmcKeySet_DeleteViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,6 +37,9 @@ public partial class RemoveAzNetworkCloudBmcKeySet_DeleteViaIdentity : 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(); + /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] @@ -44,6 +50,9 @@ public partial class RemoveAzNetworkCloudBmcKeySet_DeleteViaIdentity : global::S [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -57,6 +66,9 @@ public partial class RemoveAzNetworkCloudBmcKeySet_DeleteViaIdentity : global::S [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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] @@ -140,7 +152,7 @@ public partial class RemoveAzNetworkCloudBmcKeySet_DeleteViaIdentity : global::S /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,12 +175,12 @@ public partial class RemoveAzNetworkCloudBmcKeySet_DeleteViaIdentity : 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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 @@ -297,11 +309,36 @@ 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.NetworkCloud.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -313,10 +350,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -384,7 +437,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -426,7 +479,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -439,7 +492,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public RemoveAzNetworkCloudBmcKeySet_DeleteViaIdentity() { @@ -472,12 +525,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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ) { @@ -494,15 +547,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.NetworkCloud.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 { IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : 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 } }); @@ -527,7 +580,7 @@ protected override void StopProcessing() return ; } // onNoContent - response for 204 / - if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + if (true == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) { WriteObject(true); } @@ -551,7 +604,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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RemoveAzNetworkCloudBmcKeySet_DeleteViaIdentityCluster.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RemoveAzNetworkCloudBmcKeySet_DeleteViaIdentityCluster.cs new file mode 100644 index 000000000000..6b5d0c9b1d8b --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RemoveAzNetworkCloudBmcKeySet_DeleteViaIdentityCluster.cs @@ -0,0 +1,627 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; + using System; + + /// Delete the baseboard management controller key set of the provided cluster. + /// + /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/bmcKeySets/{bmcKeySetName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzNetworkCloudBmcKeySet_DeleteViaIdentityCluster", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Delete the baseboard management controller key set of the provided cluster.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/bmcKeySets/{bmcKeySetName}", ApiVersion = "2025-02-01")] + public partial class RemoveAzNetworkCloudBmcKeySet_DeleteViaIdentityCluster : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity _clusterInputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity ClusterInputObject { get => this._clusterInputObject; set => this._clusterInputObject = 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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private string _ifMatch; + + /// + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value + /// to prevent accidentally overwriting concurrent changes. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes.", + SerializedName = @"If-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Header)] + public string IfMatch { get => this._ifMatch; set => this._ifMatch = value; } + + /// Backing field for property. + private string _ifNoneMatch; + + /// + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result + /// in error from server as they are not supported. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result in error from server as they are not supported.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result in error from server as they are not supported.", + SerializedName = @"If-None-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Header)] + public string IfNoneMatch { get => this._ifNoneMatch; set => this._ifNoneMatch = 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.NetworkCloud.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of the baseboard management controller key set. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the baseboard management controller key set.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the baseboard management controller key set.", + SerializedName = @"bmcKeySetName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("BmcKeySetName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// 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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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); + + /// + /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of + /// what happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of RemoveAzNetworkCloudBmcKeySet_DeleteViaIdentityCluster + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets.RemoveAzNetworkCloudBmcKeySet_DeleteViaIdentityCluster Clone() + { + var clone = new RemoveAzNetworkCloudBmcKeySet_DeleteViaIdentityCluster(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.IfMatch = this.IfMatch; + clone.IfNoneMatch = this.IfNoneMatch; + clone.Name = this.Name; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'BmcKeySetsDelete' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (ClusterInputObject?.Id != null) + { + this.ClusterInputObject.Id += $"/bmcKeySets/{(global::System.Uri.EscapeDataString(this.Name.ToString()))}"; + await this.Client.BmcKeySetsDeleteViaIdentity(ClusterInputObject.Id, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, onOk, onNoContent, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == ClusterInputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("ClusterInputObject has null value for ClusterInputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, ClusterInputObject) ); + } + if (null == ClusterInputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("ClusterInputObject has null value for ClusterInputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, ClusterInputObject) ); + } + if (null == ClusterInputObject.ClusterName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("ClusterInputObject has null value for ClusterInputObject.ClusterName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, ClusterInputObject) ); + } + await this.Client.BmcKeySetsDelete(ClusterInputObject.SubscriptionId ?? null, ClusterInputObject.ResourceGroupName ?? null, ClusterInputObject.ClusterName ?? null, Name, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, onOk, onNoContent, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Name=Name,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public RemoveAzNetworkCloudBmcKeySet_DeleteViaIdentityCluster() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / + if (true == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RemoveAzNetworkCloudClusterManager_Delete.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RemoveAzNetworkCloudClusterManager_Delete.cs index ba4ff1aa33cc..e78b4b820f41 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RemoveAzNetworkCloudClusterManager_Delete.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RemoveAzNetworkCloudClusterManager_Delete.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// Delete the provided cluster manager. @@ -18,7 +20,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusterManagers/{clusterManagerName}", ApiVersion = "2025-02-01")] public partial class RemoveAzNetworkCloudClusterManager_Delete : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,6 +37,9 @@ public partial class RemoveAzNetworkCloudClusterManager_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(); + /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] @@ -44,6 +50,9 @@ public partial class RemoveAzNetworkCloudClusterManager_Delete : global::System. [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -57,6 +66,9 @@ public partial class RemoveAzNetworkCloudClusterManager_Delete : global::System. [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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] @@ -147,7 +159,7 @@ public partial class RemoveAzNetworkCloudClusterManager_Delete : global::System. /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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")] @@ -193,7 +205,8 @@ public partial class RemoveAzNetworkCloudClusterManager_Delete : global::System. [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -202,12 +215,12 @@ public partial class RemoveAzNetworkCloudClusterManager_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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 @@ -339,11 +352,36 @@ 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.NetworkCloud.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -355,10 +393,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -426,7 +480,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -444,7 +498,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -457,7 +511,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public RemoveAzNetworkCloudClusterManager_Delete() { @@ -490,12 +544,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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ) { @@ -512,15 +566,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.NetworkCloud.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, IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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, IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : 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 } }); @@ -545,7 +599,7 @@ protected override void StopProcessing() return ; } // onNoContent - response for 204 / - if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + if (true == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) { WriteObject(true); } @@ -569,7 +623,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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RemoveAzNetworkCloudClusterManager_DeleteViaIdentity.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RemoveAzNetworkCloudClusterManager_DeleteViaIdentity.cs index 1bff2d9f59e8..a299edd4def1 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RemoveAzNetworkCloudClusterManager_DeleteViaIdentity.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RemoveAzNetworkCloudClusterManager_DeleteViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// Delete the provided cluster manager. @@ -18,7 +20,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusterManagers/{clusterManagerName}", ApiVersion = "2025-02-01")] public partial class RemoveAzNetworkCloudClusterManager_DeleteViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,6 +37,9 @@ public partial class RemoveAzNetworkCloudClusterManager_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(); + /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] @@ -44,6 +50,9 @@ public partial class RemoveAzNetworkCloudClusterManager_DeleteViaIdentity : glob [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -57,6 +66,9 @@ public partial class RemoveAzNetworkCloudClusterManager_DeleteViaIdentity : glob [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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] @@ -140,7 +152,7 @@ public partial class RemoveAzNetworkCloudClusterManager_DeleteViaIdentity : glob /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,12 +175,12 @@ public partial class RemoveAzNetworkCloudClusterManager_DeleteViaIdentity : 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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 @@ -297,11 +309,36 @@ 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.NetworkCloud.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -313,10 +350,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -384,7 +437,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -422,7 +475,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -435,7 +488,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public RemoveAzNetworkCloudClusterManager_DeleteViaIdentity() { @@ -468,12 +521,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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ) { @@ -490,15 +543,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.NetworkCloud.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 { IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : 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 } }); @@ -523,7 +576,7 @@ protected override void StopProcessing() return ; } // onNoContent - response for 204 / - if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + if (true == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) { WriteObject(true); } @@ -547,7 +600,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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RemoveAzNetworkCloudCluster_Delete.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RemoveAzNetworkCloudCluster_Delete.cs index 0bfbced46a72..f5a0b24098d0 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RemoveAzNetworkCloudCluster_Delete.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RemoveAzNetworkCloudCluster_Delete.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// Delete the provided cluster. @@ -18,7 +20,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}", ApiVersion = "2025-02-01")] public partial class RemoveAzNetworkCloudCluster_Delete : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,6 +37,9 @@ public partial class RemoveAzNetworkCloudCluster_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(); + /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] @@ -44,6 +50,9 @@ public partial class RemoveAzNetworkCloudCluster_Delete : global::System.Managem [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -57,6 +66,9 @@ public partial class RemoveAzNetworkCloudCluster_Delete : global::System.Managem [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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] @@ -147,7 +159,7 @@ public partial class RemoveAzNetworkCloudCluster_Delete : global::System.Managem /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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")] @@ -193,7 +205,8 @@ public partial class RemoveAzNetworkCloudCluster_Delete : global::System.Managem [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -202,12 +215,12 @@ public partial class RemoveAzNetworkCloudCluster_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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 @@ -339,11 +352,36 @@ 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.NetworkCloud.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -355,10 +393,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -426,7 +480,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -444,7 +498,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -457,7 +511,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public RemoveAzNetworkCloudCluster_Delete() { @@ -490,12 +544,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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ) { @@ -512,15 +566,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.NetworkCloud.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, IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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, IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : 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 } }); @@ -545,7 +599,7 @@ protected override void StopProcessing() return ; } // onNoContent - response for 204 / - if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + if (true == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) { WriteObject(true); } @@ -569,7 +623,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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RemoveAzNetworkCloudCluster_DeleteViaIdentity.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RemoveAzNetworkCloudCluster_DeleteViaIdentity.cs index 93836da8e8d1..bf2bfdee03cb 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RemoveAzNetworkCloudCluster_DeleteViaIdentity.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RemoveAzNetworkCloudCluster_DeleteViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// Delete the provided cluster. @@ -18,7 +20,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}", ApiVersion = "2025-02-01")] public partial class RemoveAzNetworkCloudCluster_DeleteViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,6 +37,9 @@ public partial class RemoveAzNetworkCloudCluster_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(); + /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] @@ -44,6 +50,9 @@ public partial class RemoveAzNetworkCloudCluster_DeleteViaIdentity : global::Sys [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -57,6 +66,9 @@ public partial class RemoveAzNetworkCloudCluster_DeleteViaIdentity : global::Sys [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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] @@ -140,7 +152,7 @@ public partial class RemoveAzNetworkCloudCluster_DeleteViaIdentity : global::Sys /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,12 +175,12 @@ public partial class RemoveAzNetworkCloudCluster_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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 @@ -297,11 +309,36 @@ 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.NetworkCloud.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -313,10 +350,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -384,7 +437,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -422,7 +475,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -435,7 +488,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public RemoveAzNetworkCloudCluster_DeleteViaIdentity() { @@ -468,12 +521,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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ) { @@ -490,15 +543,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.NetworkCloud.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 { IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : 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 } }); @@ -523,7 +576,7 @@ protected override void StopProcessing() return ; } // onNoContent - response for 204 / - if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + if (true == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) { WriteObject(true); } @@ -547,7 +600,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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RemoveAzNetworkCloudConsole_Delete.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RemoveAzNetworkCloudConsole_Delete.cs index dfaf601286f0..6faa17ba5f60 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RemoveAzNetworkCloudConsole_Delete.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RemoveAzNetworkCloudConsole_Delete.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// Delete the provided virtual machine console. @@ -18,7 +20,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/virtualMachines/{virtualMachineName}/consoles/{consoleName}", ApiVersion = "2025-02-01")] public partial class RemoveAzNetworkCloudConsole_Delete : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,6 +37,9 @@ public partial class RemoveAzNetworkCloudConsole_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(); + /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] @@ -44,6 +50,9 @@ public partial class RemoveAzNetworkCloudConsole_Delete : global::System.Managem [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -57,6 +66,9 @@ public partial class RemoveAzNetworkCloudConsole_Delete : global::System.Managem [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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] @@ -147,7 +159,7 @@ public partial class RemoveAzNetworkCloudConsole_Delete : global::System.Managem /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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")] @@ -193,7 +205,8 @@ public partial class RemoveAzNetworkCloudConsole_Delete : global::System.Managem [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -216,12 +229,12 @@ public partial class RemoveAzNetworkCloudConsole_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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 @@ -354,11 +367,36 @@ 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.NetworkCloud.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -370,10 +408,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -441,7 +495,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -459,7 +513,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,VirtualMachineName=VirtualMachineName,Name=Name,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,VirtualMachineName=VirtualMachineName,Name=Name,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -472,7 +526,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public RemoveAzNetworkCloudConsole_Delete() { @@ -505,12 +559,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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ) { @@ -527,15 +581,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.NetworkCloud.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, VirtualMachineName=VirtualMachineName, Name=Name, IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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, VirtualMachineName=VirtualMachineName, Name=Name, IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : 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 } }); @@ -560,7 +614,7 @@ protected override void StopProcessing() return ; } // onNoContent - response for 204 / - if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + if (true == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) { WriteObject(true); } @@ -584,7 +638,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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RemoveAzNetworkCloudConsole_DeleteViaIdentity.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RemoveAzNetworkCloudConsole_DeleteViaIdentity.cs index 650950437414..9e2ab85c768c 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RemoveAzNetworkCloudConsole_DeleteViaIdentity.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RemoveAzNetworkCloudConsole_DeleteViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// Delete the provided virtual machine console. @@ -18,7 +20,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/virtualMachines/{virtualMachineName}/consoles/{consoleName}", ApiVersion = "2025-02-01")] public partial class RemoveAzNetworkCloudConsole_DeleteViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,6 +37,9 @@ public partial class RemoveAzNetworkCloudConsole_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(); + /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] @@ -44,6 +50,9 @@ public partial class RemoveAzNetworkCloudConsole_DeleteViaIdentity : global::Sys [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -57,6 +66,9 @@ public partial class RemoveAzNetworkCloudConsole_DeleteViaIdentity : global::Sys [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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] @@ -140,7 +152,7 @@ public partial class RemoveAzNetworkCloudConsole_DeleteViaIdentity : global::Sys /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,12 +175,12 @@ public partial class RemoveAzNetworkCloudConsole_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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 @@ -297,11 +309,36 @@ 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.NetworkCloud.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -313,10 +350,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -384,7 +437,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -426,7 +479,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -439,7 +492,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public RemoveAzNetworkCloudConsole_DeleteViaIdentity() { @@ -472,12 +525,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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ) { @@ -494,15 +547,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.NetworkCloud.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 { IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : 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 } }); @@ -527,7 +580,7 @@ protected override void StopProcessing() return ; } // onNoContent - response for 204 / - if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + if (true == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) { WriteObject(true); } @@ -551,7 +604,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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RemoveAzNetworkCloudConsole_DeleteViaIdentityVirtualMachine.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RemoveAzNetworkCloudConsole_DeleteViaIdentityVirtualMachine.cs new file mode 100644 index 000000000000..bb01fd0fb8c3 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RemoveAzNetworkCloudConsole_DeleteViaIdentityVirtualMachine.cs @@ -0,0 +1,629 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; + using System; + + /// Delete the provided virtual machine console. + /// + /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/virtualMachines/{virtualMachineName}/consoles/{consoleName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzNetworkCloudConsole_DeleteViaIdentityVirtualMachine", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Delete the provided virtual machine console.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/virtualMachines/{virtualMachineName}/consoles/{consoleName}", ApiVersion = "2025-02-01")] + public partial class RemoveAzNetworkCloudConsole_DeleteViaIdentityVirtualMachine : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private string _ifMatch; + + /// + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value + /// to prevent accidentally overwriting concurrent changes. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes.", + SerializedName = @"If-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Header)] + public string IfMatch { get => this._ifMatch; set => this._ifMatch = value; } + + /// Backing field for property. + private string _ifNoneMatch; + + /// + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result + /// in error from server as they are not supported. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result in error from server as they are not supported.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result in error from server as they are not supported.", + SerializedName = @"If-None-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Header)] + public string IfNoneMatch { get => this._ifNoneMatch; set => this._ifNoneMatch = 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.NetworkCloud.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of the virtual machine console. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the virtual machine console.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the virtual machine console.", + SerializedName = @"consoleName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("ConsoleName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// 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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity _virtualMachineInputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity VirtualMachineInputObject { get => this._virtualMachineInputObject; set => this._virtualMachineInputObject = 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.NetworkCloud.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); + + /// + /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of + /// what happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of RemoveAzNetworkCloudConsole_DeleteViaIdentityVirtualMachine + /// + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets.RemoveAzNetworkCloudConsole_DeleteViaIdentityVirtualMachine Clone() + { + var clone = new RemoveAzNetworkCloudConsole_DeleteViaIdentityVirtualMachine(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.IfMatch = this.IfMatch; + clone.IfNoneMatch = this.IfNoneMatch; + clone.Name = this.Name; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ConsolesDelete' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (VirtualMachineInputObject?.Id != null) + { + this.VirtualMachineInputObject.Id += $"/consoles/{(global::System.Uri.EscapeDataString(this.Name.ToString()))}"; + await this.Client.ConsolesDeleteViaIdentity(VirtualMachineInputObject.Id, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, onOk, onNoContent, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == VirtualMachineInputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("VirtualMachineInputObject has null value for VirtualMachineInputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, VirtualMachineInputObject) ); + } + if (null == VirtualMachineInputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("VirtualMachineInputObject has null value for VirtualMachineInputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, VirtualMachineInputObject) ); + } + if (null == VirtualMachineInputObject.VirtualMachineName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("VirtualMachineInputObject has null value for VirtualMachineInputObject.VirtualMachineName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, VirtualMachineInputObject) ); + } + await this.Client.ConsolesDelete(VirtualMachineInputObject.SubscriptionId ?? null, VirtualMachineInputObject.ResourceGroupName ?? null, VirtualMachineInputObject.VirtualMachineName ?? null, Name, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, onOk, onNoContent, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Name=Name,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public RemoveAzNetworkCloudConsole_DeleteViaIdentityVirtualMachine() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / + if (true == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RemoveAzNetworkCloudKubernetesClusterFeature_Delete.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RemoveAzNetworkCloudKubernetesClusterFeature_Delete.cs index d7a846d9db3e..0499c3a3de14 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RemoveAzNetworkCloudKubernetesClusterFeature_Delete.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RemoveAzNetworkCloudKubernetesClusterFeature_Delete.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// Delete the provided Kubernetes cluster feature. @@ -18,7 +20,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/kubernetesClusters/{kubernetesClusterName}/features/{featureName}", ApiVersion = "2025-02-01")] public partial class RemoveAzNetworkCloudKubernetesClusterFeature_Delete : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,6 +37,9 @@ public partial class RemoveAzNetworkCloudKubernetesClusterFeature_Delete : 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(); + /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] @@ -44,6 +50,9 @@ public partial class RemoveAzNetworkCloudKubernetesClusterFeature_Delete : globa [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -57,6 +66,9 @@ public partial class RemoveAzNetworkCloudKubernetesClusterFeature_Delete : globa [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 _featureName; @@ -160,7 +172,7 @@ public partial class RemoveAzNetworkCloudKubernetesClusterFeature_Delete : globa /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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")] @@ -206,7 +218,8 @@ public partial class RemoveAzNetworkCloudKubernetesClusterFeature_Delete : globa [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -215,12 +228,12 @@ public partial class RemoveAzNetworkCloudKubernetesClusterFeature_Delete : 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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 @@ -353,11 +366,36 @@ 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.NetworkCloud.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -369,10 +407,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -440,7 +494,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -458,7 +512,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,KubernetesClusterName=KubernetesClusterName,FeatureName=FeatureName,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,KubernetesClusterName=KubernetesClusterName,FeatureName=FeatureName,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -471,7 +525,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public RemoveAzNetworkCloudKubernetesClusterFeature_Delete() { @@ -504,12 +558,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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ) { @@ -526,15 +580,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.NetworkCloud.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, KubernetesClusterName=KubernetesClusterName, FeatureName=FeatureName, IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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, KubernetesClusterName=KubernetesClusterName, FeatureName=FeatureName, IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : 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 } }); @@ -559,7 +613,7 @@ protected override void StopProcessing() return ; } // onNoContent - response for 204 / - if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + if (true == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) { WriteObject(true); } @@ -583,7 +637,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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RemoveAzNetworkCloudKubernetesClusterFeature_DeleteViaIdentity.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RemoveAzNetworkCloudKubernetesClusterFeature_DeleteViaIdentity.cs index a4b658f67895..288ec2c495ec 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RemoveAzNetworkCloudKubernetesClusterFeature_DeleteViaIdentity.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RemoveAzNetworkCloudKubernetesClusterFeature_DeleteViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// Delete the provided Kubernetes cluster feature. @@ -18,7 +20,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/kubernetesClusters/{kubernetesClusterName}/features/{featureName}", ApiVersion = "2025-02-01")] public partial class RemoveAzNetworkCloudKubernetesClusterFeature_DeleteViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,6 +37,9 @@ public partial class RemoveAzNetworkCloudKubernetesClusterFeature_DeleteViaIdent /// 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(); + /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] @@ -44,6 +50,9 @@ public partial class RemoveAzNetworkCloudKubernetesClusterFeature_DeleteViaIdent [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -57,6 +66,9 @@ public partial class RemoveAzNetworkCloudKubernetesClusterFeature_DeleteViaIdent [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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] @@ -140,7 +152,7 @@ public partial class RemoveAzNetworkCloudKubernetesClusterFeature_DeleteViaIdent /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,12 +175,12 @@ public partial class RemoveAzNetworkCloudKubernetesClusterFeature_DeleteViaIdent /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 @@ -299,11 +311,36 @@ 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.NetworkCloud.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -315,10 +352,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -386,7 +439,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -428,7 +481,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -441,7 +494,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet + /// Initializes a new instance of the cmdlet /// class. /// public RemoveAzNetworkCloudKubernetesClusterFeature_DeleteViaIdentity() @@ -475,12 +528,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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ) { @@ -497,15 +550,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.NetworkCloud.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 { IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : 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 } }); @@ -530,7 +583,7 @@ protected override void StopProcessing() return ; } // onNoContent - response for 204 / - if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + if (true == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) { WriteObject(true); } @@ -554,7 +607,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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RemoveAzNetworkCloudKubernetesClusterFeature_DeleteViaIdentityKubernetesCluster.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RemoveAzNetworkCloudKubernetesClusterFeature_DeleteViaIdentityKubernetesCluster.cs new file mode 100644 index 000000000000..b51c50cf78b2 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RemoveAzNetworkCloudKubernetesClusterFeature_DeleteViaIdentityKubernetesCluster.cs @@ -0,0 +1,629 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; + using System; + + /// Delete the provided Kubernetes cluster feature. + /// + /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/kubernetesClusters/{kubernetesClusterName}/features/{featureName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzNetworkCloudKubernetesClusterFeature_DeleteViaIdentityKubernetesCluster", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Delete the provided Kubernetes cluster feature.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/kubernetesClusters/{kubernetesClusterName}/features/{featureName}", ApiVersion = "2025-02-01")] + public partial class RemoveAzNetworkCloudKubernetesClusterFeature_DeleteViaIdentityKubernetesCluster : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 _featureName; + + /// The name of the feature. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the feature.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the feature.", + SerializedName = @"featureName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] + public string FeatureName { get => this._featureName; set => this._featureName = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private string _ifMatch; + + /// + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value + /// to prevent accidentally overwriting concurrent changes. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes.", + SerializedName = @"If-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Header)] + public string IfMatch { get => this._ifMatch; set => this._ifMatch = value; } + + /// Backing field for property. + private string _ifNoneMatch; + + /// + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result + /// in error from server as they are not supported. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result in error from server as they are not supported.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result in error from server as they are not supported.", + SerializedName = @"If-None-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Header)] + public string IfNoneMatch { get => this._ifNoneMatch; set => this._ifNoneMatch = 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 Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity _kubernetesClusterInputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity KubernetesClusterInputObject { get => this._kubernetesClusterInputObject; set => this._kubernetesClusterInputObject = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// 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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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); + + /// + /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of + /// what happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of RemoveAzNetworkCloudKubernetesClusterFeature_DeleteViaIdentityKubernetesCluster + /// + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets.RemoveAzNetworkCloudKubernetesClusterFeature_DeleteViaIdentityKubernetesCluster Clone() + { + var clone = new RemoveAzNetworkCloudKubernetesClusterFeature_DeleteViaIdentityKubernetesCluster(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.IfMatch = this.IfMatch; + clone.IfNoneMatch = this.IfNoneMatch; + clone.FeatureName = this.FeatureName; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'KubernetesClusterFeaturesDelete' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (KubernetesClusterInputObject?.Id != null) + { + this.KubernetesClusterInputObject.Id += $"/features/{(global::System.Uri.EscapeDataString(this.FeatureName.ToString()))}"; + await this.Client.KubernetesClusterFeaturesDeleteViaIdentity(KubernetesClusterInputObject.Id, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, onOk, onNoContent, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == KubernetesClusterInputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("KubernetesClusterInputObject has null value for KubernetesClusterInputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, KubernetesClusterInputObject) ); + } + if (null == KubernetesClusterInputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("KubernetesClusterInputObject has null value for KubernetesClusterInputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, KubernetesClusterInputObject) ); + } + if (null == KubernetesClusterInputObject.KubernetesClusterName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("KubernetesClusterInputObject has null value for KubernetesClusterInputObject.KubernetesClusterName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, KubernetesClusterInputObject) ); + } + await this.Client.KubernetesClusterFeaturesDelete(KubernetesClusterInputObject.SubscriptionId ?? null, KubernetesClusterInputObject.ResourceGroupName ?? null, KubernetesClusterInputObject.KubernetesClusterName ?? null, FeatureName, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, onOk, onNoContent, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { FeatureName=FeatureName,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public RemoveAzNetworkCloudKubernetesClusterFeature_DeleteViaIdentityKubernetesCluster() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / + if (true == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RemoveAzNetworkCloudKubernetesCluster_Delete.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RemoveAzNetworkCloudKubernetesCluster_Delete.cs index 10796ffccadc..4d8ee89b0214 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RemoveAzNetworkCloudKubernetesCluster_Delete.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RemoveAzNetworkCloudKubernetesCluster_Delete.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// Delete the provided Kubernetes cluster. @@ -18,7 +20,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/kubernetesClusters/{kubernetesClusterName}", ApiVersion = "2025-02-01")] public partial class RemoveAzNetworkCloudKubernetesCluster_Delete : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,6 +37,9 @@ public partial class RemoveAzNetworkCloudKubernetesCluster_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(); + /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] @@ -44,6 +50,9 @@ public partial class RemoveAzNetworkCloudKubernetesCluster_Delete : global::Syst [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -57,6 +66,9 @@ public partial class RemoveAzNetworkCloudKubernetesCluster_Delete : global::Syst [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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] @@ -147,7 +159,7 @@ public partial class RemoveAzNetworkCloudKubernetesCluster_Delete : global::Syst /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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")] @@ -193,7 +205,8 @@ public partial class RemoveAzNetworkCloudKubernetesCluster_Delete : global::Syst [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -202,12 +215,12 @@ public partial class RemoveAzNetworkCloudKubernetesCluster_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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 @@ -339,11 +352,36 @@ 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.NetworkCloud.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -355,10 +393,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -426,7 +480,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -444,7 +498,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -457,7 +511,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public RemoveAzNetworkCloudKubernetesCluster_Delete() { @@ -490,12 +544,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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ) { @@ -512,15 +566,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.NetworkCloud.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, IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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, IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : 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 } }); @@ -545,7 +599,7 @@ protected override void StopProcessing() return ; } // onNoContent - response for 204 / - if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + if (true == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) { WriteObject(true); } @@ -569,7 +623,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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RemoveAzNetworkCloudKubernetesCluster_DeleteViaIdentity.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RemoveAzNetworkCloudKubernetesCluster_DeleteViaIdentity.cs index 93c611837851..db560dffbd79 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RemoveAzNetworkCloudKubernetesCluster_DeleteViaIdentity.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RemoveAzNetworkCloudKubernetesCluster_DeleteViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// Delete the provided Kubernetes cluster. @@ -18,7 +20,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/kubernetesClusters/{kubernetesClusterName}", ApiVersion = "2025-02-01")] public partial class RemoveAzNetworkCloudKubernetesCluster_DeleteViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,6 +37,9 @@ public partial class RemoveAzNetworkCloudKubernetesCluster_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(); + /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] @@ -44,6 +50,9 @@ public partial class RemoveAzNetworkCloudKubernetesCluster_DeleteViaIdentity : g [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -57,6 +66,9 @@ public partial class RemoveAzNetworkCloudKubernetesCluster_DeleteViaIdentity : g [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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] @@ -140,7 +152,7 @@ public partial class RemoveAzNetworkCloudKubernetesCluster_DeleteViaIdentity : g /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,12 +175,12 @@ public partial class RemoveAzNetworkCloudKubernetesCluster_DeleteViaIdentity : 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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 @@ -297,11 +309,36 @@ 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.NetworkCloud.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -313,10 +350,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -384,7 +437,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -422,7 +475,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -435,7 +488,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public RemoveAzNetworkCloudKubernetesCluster_DeleteViaIdentity() { @@ -468,12 +521,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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ) { @@ -490,15 +543,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.NetworkCloud.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 { IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : 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 } }); @@ -523,7 +576,7 @@ protected override void StopProcessing() return ; } // onNoContent - response for 204 / - if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + if (true == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) { WriteObject(true); } @@ -547,7 +600,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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RemoveAzNetworkCloudL2Network_Delete.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RemoveAzNetworkCloudL2Network_Delete.cs index 6250af3bb74e..27228ed31795 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RemoveAzNetworkCloudL2Network_Delete.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RemoveAzNetworkCloudL2Network_Delete.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// Delete the provided layer 2 (L2) network. @@ -18,7 +20,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/l2Networks/{l2NetworkName}", ApiVersion = "2025-02-01")] public partial class RemoveAzNetworkCloudL2Network_Delete : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,6 +37,9 @@ public partial class RemoveAzNetworkCloudL2Network_Delete : 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(); + /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] @@ -44,6 +50,9 @@ public partial class RemoveAzNetworkCloudL2Network_Delete : global::System.Manag [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -57,6 +66,9 @@ public partial class RemoveAzNetworkCloudL2Network_Delete : global::System.Manag [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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] @@ -147,7 +159,7 @@ public partial class RemoveAzNetworkCloudL2Network_Delete : global::System.Manag /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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")] @@ -193,7 +205,8 @@ public partial class RemoveAzNetworkCloudL2Network_Delete : global::System.Manag [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -202,12 +215,12 @@ public partial class RemoveAzNetworkCloudL2Network_Delete : 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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 @@ -339,11 +352,36 @@ 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.NetworkCloud.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -355,10 +393,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -426,7 +480,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -444,7 +498,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -457,7 +511,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public RemoveAzNetworkCloudL2Network_Delete() { @@ -490,12 +544,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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ) { @@ -512,15 +566,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.NetworkCloud.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, IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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, IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : 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 } }); @@ -545,7 +599,7 @@ protected override void StopProcessing() return ; } // onNoContent - response for 204 / - if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + if (true == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) { WriteObject(true); } @@ -569,7 +623,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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RemoveAzNetworkCloudL2Network_DeleteViaIdentity.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RemoveAzNetworkCloudL2Network_DeleteViaIdentity.cs index 392537b46e2b..2e84c99df1af 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RemoveAzNetworkCloudL2Network_DeleteViaIdentity.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RemoveAzNetworkCloudL2Network_DeleteViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// Delete the provided layer 2 (L2) network. @@ -18,7 +20,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/l2Networks/{l2NetworkName}", ApiVersion = "2025-02-01")] public partial class RemoveAzNetworkCloudL2Network_DeleteViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,6 +37,9 @@ public partial class RemoveAzNetworkCloudL2Network_DeleteViaIdentity : 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(); + /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] @@ -44,6 +50,9 @@ public partial class RemoveAzNetworkCloudL2Network_DeleteViaIdentity : global::S [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -57,6 +66,9 @@ public partial class RemoveAzNetworkCloudL2Network_DeleteViaIdentity : global::S [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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] @@ -140,7 +152,7 @@ public partial class RemoveAzNetworkCloudL2Network_DeleteViaIdentity : global::S /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,12 +175,12 @@ public partial class RemoveAzNetworkCloudL2Network_DeleteViaIdentity : 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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 @@ -297,11 +309,36 @@ 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.NetworkCloud.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -313,10 +350,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -384,7 +437,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -422,7 +475,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -435,7 +488,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public RemoveAzNetworkCloudL2Network_DeleteViaIdentity() { @@ -468,12 +521,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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ) { @@ -490,15 +543,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.NetworkCloud.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 { IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : 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 } }); @@ -523,7 +576,7 @@ protected override void StopProcessing() return ; } // onNoContent - response for 204 / - if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + if (true == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) { WriteObject(true); } @@ -547,7 +600,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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RemoveAzNetworkCloudL3Network_Delete.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RemoveAzNetworkCloudL3Network_Delete.cs index 449738e8c4fd..2b7c54ee8e72 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RemoveAzNetworkCloudL3Network_Delete.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RemoveAzNetworkCloudL3Network_Delete.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// Delete the provided layer 3 (L3) network. @@ -18,7 +20,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/l3Networks/{l3NetworkName}", ApiVersion = "2025-02-01")] public partial class RemoveAzNetworkCloudL3Network_Delete : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,6 +37,9 @@ public partial class RemoveAzNetworkCloudL3Network_Delete : 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(); + /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] @@ -44,6 +50,9 @@ public partial class RemoveAzNetworkCloudL3Network_Delete : global::System.Manag [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -57,6 +66,9 @@ public partial class RemoveAzNetworkCloudL3Network_Delete : global::System.Manag [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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] @@ -147,7 +159,7 @@ public partial class RemoveAzNetworkCloudL3Network_Delete : global::System.Manag /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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")] @@ -193,7 +205,8 @@ public partial class RemoveAzNetworkCloudL3Network_Delete : global::System.Manag [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -202,12 +215,12 @@ public partial class RemoveAzNetworkCloudL3Network_Delete : 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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 @@ -339,11 +352,36 @@ 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.NetworkCloud.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -355,10 +393,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -426,7 +480,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -444,7 +498,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -457,7 +511,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public RemoveAzNetworkCloudL3Network_Delete() { @@ -490,12 +544,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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ) { @@ -512,15 +566,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.NetworkCloud.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, IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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, IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : 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 } }); @@ -545,7 +599,7 @@ protected override void StopProcessing() return ; } // onNoContent - response for 204 / - if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + if (true == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) { WriteObject(true); } @@ -569,7 +623,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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RemoveAzNetworkCloudL3Network_DeleteViaIdentity.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RemoveAzNetworkCloudL3Network_DeleteViaIdentity.cs index d974c0ef6c24..c201f321a8e8 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RemoveAzNetworkCloudL3Network_DeleteViaIdentity.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RemoveAzNetworkCloudL3Network_DeleteViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// Delete the provided layer 3 (L3) network. @@ -18,7 +20,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/l3Networks/{l3NetworkName}", ApiVersion = "2025-02-01")] public partial class RemoveAzNetworkCloudL3Network_DeleteViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,6 +37,9 @@ public partial class RemoveAzNetworkCloudL3Network_DeleteViaIdentity : 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(); + /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] @@ -44,6 +50,9 @@ public partial class RemoveAzNetworkCloudL3Network_DeleteViaIdentity : global::S [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -57,6 +66,9 @@ public partial class RemoveAzNetworkCloudL3Network_DeleteViaIdentity : global::S [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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] @@ -140,7 +152,7 @@ public partial class RemoveAzNetworkCloudL3Network_DeleteViaIdentity : global::S /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,12 +175,12 @@ public partial class RemoveAzNetworkCloudL3Network_DeleteViaIdentity : 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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 @@ -297,11 +309,36 @@ 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.NetworkCloud.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -313,10 +350,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -384,7 +437,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -422,7 +475,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -435,7 +488,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public RemoveAzNetworkCloudL3Network_DeleteViaIdentity() { @@ -468,12 +521,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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ) { @@ -490,15 +543,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.NetworkCloud.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 { IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : 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 } }); @@ -523,7 +576,7 @@ protected override void StopProcessing() return ; } // onNoContent - response for 204 / - if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + if (true == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) { WriteObject(true); } @@ -547,7 +600,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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RemoveAzNetworkCloudMetricsConfiguration_Delete.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RemoveAzNetworkCloudMetricsConfiguration_Delete.cs index 5b4b0a000b4a..3ac7f4421672 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RemoveAzNetworkCloudMetricsConfiguration_Delete.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RemoveAzNetworkCloudMetricsConfiguration_Delete.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// Delete the metrics configuration of the provided cluster. @@ -18,7 +20,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/metricsConfigurations/{metricsConfigurationName}", ApiVersion = "2025-02-01")] public partial class RemoveAzNetworkCloudMetricsConfiguration_Delete : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,6 +37,9 @@ public partial class RemoveAzNetworkCloudMetricsConfiguration_Delete : 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(); + /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] @@ -44,6 +50,9 @@ public partial class RemoveAzNetworkCloudMetricsConfiguration_Delete : global::S [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -71,6 +80,9 @@ public partial class RemoveAzNetworkCloudMetricsConfiguration_Delete : global::S [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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] @@ -161,7 +173,7 @@ public partial class RemoveAzNetworkCloudMetricsConfiguration_Delete : global::S /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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")] @@ -207,7 +219,8 @@ public partial class RemoveAzNetworkCloudMetricsConfiguration_Delete : global::S [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -216,12 +229,12 @@ public partial class RemoveAzNetworkCloudMetricsConfiguration_Delete : 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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 @@ -354,11 +367,36 @@ 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.NetworkCloud.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -370,10 +408,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -441,7 +495,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -459,7 +513,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,ClusterName=ClusterName,Name=Name,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,ClusterName=ClusterName,Name=Name,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -472,7 +526,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public RemoveAzNetworkCloudMetricsConfiguration_Delete() { @@ -505,12 +559,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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ) { @@ -527,15 +581,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.NetworkCloud.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, ClusterName=ClusterName, Name=Name, IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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, ClusterName=ClusterName, Name=Name, IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : 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 } }); @@ -560,7 +614,7 @@ protected override void StopProcessing() return ; } // onNoContent - response for 204 / - if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + if (true == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) { WriteObject(true); } @@ -584,7 +638,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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RemoveAzNetworkCloudMetricsConfiguration_DeleteViaIdentity.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RemoveAzNetworkCloudMetricsConfiguration_DeleteViaIdentity.cs index 4873577da9fe..87a7dbb02b4b 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RemoveAzNetworkCloudMetricsConfiguration_DeleteViaIdentity.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RemoveAzNetworkCloudMetricsConfiguration_DeleteViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// Delete the metrics configuration of the provided cluster. @@ -18,7 +20,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/metricsConfigurations/{metricsConfigurationName}", ApiVersion = "2025-02-01")] public partial class RemoveAzNetworkCloudMetricsConfiguration_DeleteViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,6 +37,9 @@ public partial class RemoveAzNetworkCloudMetricsConfiguration_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(); + /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] @@ -44,6 +50,9 @@ public partial class RemoveAzNetworkCloudMetricsConfiguration_DeleteViaIdentity [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -57,6 +66,9 @@ public partial class RemoveAzNetworkCloudMetricsConfiguration_DeleteViaIdentity [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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] @@ -140,7 +152,7 @@ public partial class RemoveAzNetworkCloudMetricsConfiguration_DeleteViaIdentity /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,12 +175,12 @@ public partial class RemoveAzNetworkCloudMetricsConfiguration_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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 @@ -299,11 +311,36 @@ 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.NetworkCloud.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -315,10 +352,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -386,7 +439,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -428,7 +481,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -441,7 +494,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public RemoveAzNetworkCloudMetricsConfiguration_DeleteViaIdentity() { @@ -474,12 +527,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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ) { @@ -496,15 +549,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.NetworkCloud.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 { IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : 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 } }); @@ -529,7 +582,7 @@ protected override void StopProcessing() return ; } // onNoContent - response for 204 / - if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + if (true == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) { WriteObject(true); } @@ -553,7 +606,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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RemoveAzNetworkCloudMetricsConfiguration_DeleteViaIdentityCluster.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RemoveAzNetworkCloudMetricsConfiguration_DeleteViaIdentityCluster.cs new file mode 100644 index 000000000000..276a4e63cda2 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RemoveAzNetworkCloudMetricsConfiguration_DeleteViaIdentityCluster.cs @@ -0,0 +1,630 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; + using System; + + /// Delete the metrics configuration of the provided cluster. + /// + /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/metricsConfigurations/{metricsConfigurationName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzNetworkCloudMetricsConfiguration_DeleteViaIdentityCluster", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Delete the metrics configuration of the provided cluster.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/metricsConfigurations/{metricsConfigurationName}", ApiVersion = "2025-02-01")] + public partial class RemoveAzNetworkCloudMetricsConfiguration_DeleteViaIdentityCluster : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity _clusterInputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity ClusterInputObject { get => this._clusterInputObject; set => this._clusterInputObject = 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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private string _ifMatch; + + /// + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value + /// to prevent accidentally overwriting concurrent changes. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes.", + SerializedName = @"If-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Header)] + public string IfMatch { get => this._ifMatch; set => this._ifMatch = value; } + + /// Backing field for property. + private string _ifNoneMatch; + + /// + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result + /// in error from server as they are not supported. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result in error from server as they are not supported.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result in error from server as they are not supported.", + SerializedName = @"If-None-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Header)] + public string IfNoneMatch { get => this._ifNoneMatch; set => this._ifNoneMatch = 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.NetworkCloud.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of the metrics configuration for the cluster. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the metrics configuration for the cluster.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the metrics configuration for the cluster.", + SerializedName = @"metricsConfigurationName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("MetricsConfigurationName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// 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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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); + + /// + /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of + /// what happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of RemoveAzNetworkCloudMetricsConfiguration_DeleteViaIdentityCluster + /// + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets.RemoveAzNetworkCloudMetricsConfiguration_DeleteViaIdentityCluster Clone() + { + var clone = new RemoveAzNetworkCloudMetricsConfiguration_DeleteViaIdentityCluster(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.IfMatch = this.IfMatch; + clone.IfNoneMatch = this.IfNoneMatch; + clone.Name = this.Name; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'MetricsConfigurationsDelete' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (ClusterInputObject?.Id != null) + { + this.ClusterInputObject.Id += $"/metricsConfigurations/{(global::System.Uri.EscapeDataString(this.Name.ToString()))}"; + await this.Client.MetricsConfigurationsDeleteViaIdentity(ClusterInputObject.Id, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, onOk, onNoContent, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == ClusterInputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("ClusterInputObject has null value for ClusterInputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, ClusterInputObject) ); + } + if (null == ClusterInputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("ClusterInputObject has null value for ClusterInputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, ClusterInputObject) ); + } + if (null == ClusterInputObject.ClusterName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("ClusterInputObject has null value for ClusterInputObject.ClusterName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, ClusterInputObject) ); + } + await this.Client.MetricsConfigurationsDelete(ClusterInputObject.SubscriptionId ?? null, ClusterInputObject.ResourceGroupName ?? null, ClusterInputObject.ClusterName ?? null, Name, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, onOk, onNoContent, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Name=Name,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Initializes a new instance of the cmdlet + /// class. + /// + public RemoveAzNetworkCloudMetricsConfiguration_DeleteViaIdentityCluster() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / + if (true == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RemoveAzNetworkCloudServicesNetwork_Delete.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RemoveAzNetworkCloudServicesNetwork_Delete.cs index 0b0d5c9fe283..bc5c51c784af 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RemoveAzNetworkCloudServicesNetwork_Delete.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RemoveAzNetworkCloudServicesNetwork_Delete.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// Delete the provided cloud services network. @@ -18,7 +20,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/cloudServicesNetworks/{cloudServicesNetworkName}", ApiVersion = "2025-02-01")] public partial class RemoveAzNetworkCloudServicesNetwork_Delete : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,6 +37,9 @@ public partial class RemoveAzNetworkCloudServicesNetwork_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(); + /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] @@ -44,6 +50,9 @@ public partial class RemoveAzNetworkCloudServicesNetwork_Delete : global::System [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -57,6 +66,9 @@ public partial class RemoveAzNetworkCloudServicesNetwork_Delete : global::System [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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] @@ -147,7 +159,7 @@ public partial class RemoveAzNetworkCloudServicesNetwork_Delete : global::System /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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")] @@ -193,7 +205,8 @@ public partial class RemoveAzNetworkCloudServicesNetwork_Delete : global::System [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -202,12 +215,12 @@ public partial class RemoveAzNetworkCloudServicesNetwork_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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 @@ -339,11 +352,36 @@ 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.NetworkCloud.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -355,10 +393,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -426,7 +480,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -444,7 +498,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -457,7 +511,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public RemoveAzNetworkCloudServicesNetwork_Delete() { @@ -490,12 +544,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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ) { @@ -512,15 +566,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.NetworkCloud.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, IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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, IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : 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 } }); @@ -545,7 +599,7 @@ protected override void StopProcessing() return ; } // onNoContent - response for 204 / - if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + if (true == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) { WriteObject(true); } @@ -569,7 +623,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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RemoveAzNetworkCloudServicesNetwork_DeleteViaIdentity.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RemoveAzNetworkCloudServicesNetwork_DeleteViaIdentity.cs index bde020695fda..3e0c9c22557c 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RemoveAzNetworkCloudServicesNetwork_DeleteViaIdentity.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RemoveAzNetworkCloudServicesNetwork_DeleteViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// Delete the provided cloud services network. @@ -18,7 +20,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/cloudServicesNetworks/{cloudServicesNetworkName}", ApiVersion = "2025-02-01")] public partial class RemoveAzNetworkCloudServicesNetwork_DeleteViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,6 +37,9 @@ public partial class RemoveAzNetworkCloudServicesNetwork_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(); + /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] @@ -44,6 +50,9 @@ public partial class RemoveAzNetworkCloudServicesNetwork_DeleteViaIdentity : glo [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -57,6 +66,9 @@ public partial class RemoveAzNetworkCloudServicesNetwork_DeleteViaIdentity : glo [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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] @@ -140,7 +152,7 @@ public partial class RemoveAzNetworkCloudServicesNetwork_DeleteViaIdentity : glo /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,12 +175,12 @@ public partial class RemoveAzNetworkCloudServicesNetwork_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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 @@ -297,11 +309,36 @@ 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.NetworkCloud.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -313,10 +350,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -384,7 +437,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -422,7 +475,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -435,7 +488,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public RemoveAzNetworkCloudServicesNetwork_DeleteViaIdentity() { @@ -468,12 +521,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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ) { @@ -490,15 +543,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.NetworkCloud.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 { IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : 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 } }); @@ -523,7 +576,7 @@ protected override void StopProcessing() return ; } // onNoContent - response for 204 / - if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + if (true == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) { WriteObject(true); } @@ -547,7 +600,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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RemoveAzNetworkCloudTrunkedNetwork_Delete.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RemoveAzNetworkCloudTrunkedNetwork_Delete.cs index 70eb2ce39881..705bc5cde8ec 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RemoveAzNetworkCloudTrunkedNetwork_Delete.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RemoveAzNetworkCloudTrunkedNetwork_Delete.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// Delete the provided trunked network. @@ -18,7 +20,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/trunkedNetworks/{trunkedNetworkName}", ApiVersion = "2025-02-01")] public partial class RemoveAzNetworkCloudTrunkedNetwork_Delete : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,6 +37,9 @@ public partial class RemoveAzNetworkCloudTrunkedNetwork_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(); + /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] @@ -44,6 +50,9 @@ public partial class RemoveAzNetworkCloudTrunkedNetwork_Delete : global::System. [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -57,6 +66,9 @@ public partial class RemoveAzNetworkCloudTrunkedNetwork_Delete : global::System. [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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] @@ -147,7 +159,7 @@ public partial class RemoveAzNetworkCloudTrunkedNetwork_Delete : global::System. /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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")] @@ -193,7 +205,8 @@ public partial class RemoveAzNetworkCloudTrunkedNetwork_Delete : global::System. [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -202,12 +215,12 @@ public partial class RemoveAzNetworkCloudTrunkedNetwork_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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 @@ -339,11 +352,36 @@ 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.NetworkCloud.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -355,10 +393,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -426,7 +480,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -444,7 +498,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -457,7 +511,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public RemoveAzNetworkCloudTrunkedNetwork_Delete() { @@ -490,12 +544,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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ) { @@ -512,15 +566,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.NetworkCloud.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, IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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, IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : 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 } }); @@ -545,7 +599,7 @@ protected override void StopProcessing() return ; } // onNoContent - response for 204 / - if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + if (true == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) { WriteObject(true); } @@ -569,7 +623,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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RemoveAzNetworkCloudTrunkedNetwork_DeleteViaIdentity.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RemoveAzNetworkCloudTrunkedNetwork_DeleteViaIdentity.cs index a5571c746672..5f1ae15af268 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RemoveAzNetworkCloudTrunkedNetwork_DeleteViaIdentity.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RemoveAzNetworkCloudTrunkedNetwork_DeleteViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// Delete the provided trunked network. @@ -18,7 +20,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/trunkedNetworks/{trunkedNetworkName}", ApiVersion = "2025-02-01")] public partial class RemoveAzNetworkCloudTrunkedNetwork_DeleteViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,6 +37,9 @@ public partial class RemoveAzNetworkCloudTrunkedNetwork_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(); + /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] @@ -44,6 +50,9 @@ public partial class RemoveAzNetworkCloudTrunkedNetwork_DeleteViaIdentity : glob [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -57,6 +66,9 @@ public partial class RemoveAzNetworkCloudTrunkedNetwork_DeleteViaIdentity : glob [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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] @@ -140,7 +152,7 @@ public partial class RemoveAzNetworkCloudTrunkedNetwork_DeleteViaIdentity : glob /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,12 +175,12 @@ public partial class RemoveAzNetworkCloudTrunkedNetwork_DeleteViaIdentity : 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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 @@ -297,11 +309,36 @@ 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.NetworkCloud.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -313,10 +350,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -384,7 +437,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -422,7 +475,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -435,7 +488,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public RemoveAzNetworkCloudTrunkedNetwork_DeleteViaIdentity() { @@ -468,12 +521,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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ) { @@ -490,15 +543,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.NetworkCloud.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 { IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : 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 } }); @@ -523,7 +576,7 @@ protected override void StopProcessing() return ; } // onNoContent - response for 204 / - if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + if (true == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) { WriteObject(true); } @@ -547,7 +600,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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RemoveAzNetworkCloudVirtualMachine_Delete.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RemoveAzNetworkCloudVirtualMachine_Delete.cs index 2f2a4237c817..aaa23a6ec91b 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RemoveAzNetworkCloudVirtualMachine_Delete.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RemoveAzNetworkCloudVirtualMachine_Delete.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// Delete the provided virtual machine. @@ -18,7 +20,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/virtualMachines/{virtualMachineName}", ApiVersion = "2025-02-01")] public partial class RemoveAzNetworkCloudVirtualMachine_Delete : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,6 +37,9 @@ public partial class RemoveAzNetworkCloudVirtualMachine_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(); + /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] @@ -44,6 +50,9 @@ public partial class RemoveAzNetworkCloudVirtualMachine_Delete : global::System. [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -57,6 +66,9 @@ public partial class RemoveAzNetworkCloudVirtualMachine_Delete : global::System. [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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] @@ -147,7 +159,7 @@ public partial class RemoveAzNetworkCloudVirtualMachine_Delete : global::System. /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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")] @@ -193,7 +205,8 @@ public partial class RemoveAzNetworkCloudVirtualMachine_Delete : global::System. [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -202,12 +215,12 @@ public partial class RemoveAzNetworkCloudVirtualMachine_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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 @@ -339,11 +352,36 @@ 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.NetworkCloud.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -355,10 +393,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -426,7 +480,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -444,7 +498,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -457,7 +511,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public RemoveAzNetworkCloudVirtualMachine_Delete() { @@ -490,12 +544,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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ) { @@ -512,15 +566,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.NetworkCloud.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, IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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, IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : 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 } }); @@ -545,7 +599,7 @@ protected override void StopProcessing() return ; } // onNoContent - response for 204 / - if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + if (true == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) { WriteObject(true); } @@ -569,7 +623,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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RemoveAzNetworkCloudVirtualMachine_DeleteViaIdentity.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RemoveAzNetworkCloudVirtualMachine_DeleteViaIdentity.cs index 5ce985565437..97715acf49a1 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RemoveAzNetworkCloudVirtualMachine_DeleteViaIdentity.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RemoveAzNetworkCloudVirtualMachine_DeleteViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// Delete the provided virtual machine. @@ -18,7 +20,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/virtualMachines/{virtualMachineName}", ApiVersion = "2025-02-01")] public partial class RemoveAzNetworkCloudVirtualMachine_DeleteViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,6 +37,9 @@ public partial class RemoveAzNetworkCloudVirtualMachine_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(); + /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] @@ -44,6 +50,9 @@ public partial class RemoveAzNetworkCloudVirtualMachine_DeleteViaIdentity : glob [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -57,6 +66,9 @@ public partial class RemoveAzNetworkCloudVirtualMachine_DeleteViaIdentity : glob [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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] @@ -140,7 +152,7 @@ public partial class RemoveAzNetworkCloudVirtualMachine_DeleteViaIdentity : glob /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,12 +175,12 @@ public partial class RemoveAzNetworkCloudVirtualMachine_DeleteViaIdentity : 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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 @@ -297,11 +309,36 @@ 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.NetworkCloud.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -313,10 +350,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -384,7 +437,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -422,7 +475,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -435,7 +488,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public RemoveAzNetworkCloudVirtualMachine_DeleteViaIdentity() { @@ -468,12 +521,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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ) { @@ -490,15 +543,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.NetworkCloud.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 { IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : 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 } }); @@ -523,7 +576,7 @@ protected override void StopProcessing() return ; } // onNoContent - response for 204 / - if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + if (true == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) { WriteObject(true); } @@ -547,7 +600,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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RemoveAzNetworkCloudVolume_Delete.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RemoveAzNetworkCloudVolume_Delete.cs index 6b945ceecce8..af3ae546d0be 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RemoveAzNetworkCloudVolume_Delete.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RemoveAzNetworkCloudVolume_Delete.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// Delete the provided volume. @@ -18,7 +20,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/volumes/{volumeName}", ApiVersion = "2025-02-01")] public partial class RemoveAzNetworkCloudVolume_Delete : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,6 +37,9 @@ public partial class RemoveAzNetworkCloudVolume_Delete : 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(); + /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] @@ -44,6 +50,9 @@ public partial class RemoveAzNetworkCloudVolume_Delete : global::System.Manageme [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -57,6 +66,9 @@ public partial class RemoveAzNetworkCloudVolume_Delete : global::System.Manageme [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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] @@ -147,7 +159,7 @@ public partial class RemoveAzNetworkCloudVolume_Delete : global::System.Manageme /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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")] @@ -193,7 +205,8 @@ public partial class RemoveAzNetworkCloudVolume_Delete : global::System.Manageme [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -202,12 +215,12 @@ public partial class RemoveAzNetworkCloudVolume_Delete : 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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 @@ -339,11 +352,36 @@ 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.NetworkCloud.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -355,10 +393,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -426,7 +480,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -444,7 +498,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -457,7 +511,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public RemoveAzNetworkCloudVolume_Delete() { @@ -490,12 +544,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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ) { @@ -512,15 +566,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.NetworkCloud.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, IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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, IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : 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 } }); @@ -545,7 +599,7 @@ protected override void StopProcessing() return ; } // onNoContent - response for 204 / - if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + if (true == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) { WriteObject(true); } @@ -569,7 +623,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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RemoveAzNetworkCloudVolume_DeleteViaIdentity.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RemoveAzNetworkCloudVolume_DeleteViaIdentity.cs index 674b2d2dab68..a1c92ff19103 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RemoveAzNetworkCloudVolume_DeleteViaIdentity.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RemoveAzNetworkCloudVolume_DeleteViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// Delete the provided volume. @@ -18,7 +20,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/volumes/{volumeName}", ApiVersion = "2025-02-01")] public partial class RemoveAzNetworkCloudVolume_DeleteViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,6 +37,9 @@ public partial class RemoveAzNetworkCloudVolume_DeleteViaIdentity : 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(); + /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] @@ -44,6 +50,9 @@ public partial class RemoveAzNetworkCloudVolume_DeleteViaIdentity : global::Syst [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -57,6 +66,9 @@ public partial class RemoveAzNetworkCloudVolume_DeleteViaIdentity : global::Syst [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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] @@ -140,7 +152,7 @@ public partial class RemoveAzNetworkCloudVolume_DeleteViaIdentity : global::Syst /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,12 +175,12 @@ public partial class RemoveAzNetworkCloudVolume_DeleteViaIdentity : 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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 @@ -297,11 +309,36 @@ 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.NetworkCloud.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -313,10 +350,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -384,7 +437,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -422,7 +475,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -435,7 +488,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public RemoveAzNetworkCloudVolume_DeleteViaIdentity() { @@ -468,12 +521,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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ) { @@ -490,15 +543,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.NetworkCloud.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 { IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : 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 } }); @@ -523,7 +576,7 @@ protected override void StopProcessing() return ; } // onNoContent - response for 204 / - if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + if (true == InvocationInformation?.BoundParameters?.ContainsKey("PassThru")) { WriteObject(true); } @@ -547,7 +600,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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RestartAzNetworkCloudBareMetalMachine_Restart.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RestartAzNetworkCloudBareMetalMachine_Restart.cs index ae1b6e043231..ca624a014273 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RestartAzNetworkCloudBareMetalMachine_Restart.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RestartAzNetworkCloudBareMetalMachine_Restart.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// Restart the provided bare metal machine. @@ -18,7 +20,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/bareMetalMachines/{bareMetalMachineName}/restart", ApiVersion = "2025-02-01")] public partial class RestartAzNetworkCloudBareMetalMachine_Restart : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,6 +37,9 @@ public partial class RestartAzNetworkCloudBareMetalMachine_Restart : 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(); + /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] @@ -44,6 +50,9 @@ public partial class RestartAzNetworkCloudBareMetalMachine_Restart : global::Sys [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -57,6 +66,9 @@ public partial class RestartAzNetworkCloudBareMetalMachine_Restart : global::Sys [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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] @@ -113,7 +125,7 @@ public partial class RestartAzNetworkCloudBareMetalMachine_Restart : global::Sys /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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")] @@ -159,7 +171,8 @@ public partial class RestartAzNetworkCloudBareMetalMachine_Restart : global::Sys [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -168,12 +181,12 @@ public partial class RestartAzNetworkCloudBareMetalMachine_Restart : 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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 @@ -293,11 +306,36 @@ 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.NetworkCloud.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -309,10 +347,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -380,7 +434,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -398,7 +452,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 } }); @@ -411,7 +465,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public RestartAzNetworkCloudBareMetalMachine_Restart() { @@ -444,12 +498,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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ) { @@ -466,15 +520,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.NetworkCloud.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.NetworkCloud.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 } }); @@ -499,7 +553,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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RestartAzNetworkCloudBareMetalMachine_RestartViaIdentity.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RestartAzNetworkCloudBareMetalMachine_RestartViaIdentity.cs index ec1cdae57039..a4cd19c5f644 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RestartAzNetworkCloudBareMetalMachine_RestartViaIdentity.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RestartAzNetworkCloudBareMetalMachine_RestartViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// Restart the provided bare metal machine. @@ -18,7 +20,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/bareMetalMachines/{bareMetalMachineName}/restart", ApiVersion = "2025-02-01")] public partial class RestartAzNetworkCloudBareMetalMachine_RestartViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,6 +37,9 @@ public partial class RestartAzNetworkCloudBareMetalMachine_RestartViaIdentity : /// 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(); + /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] @@ -44,6 +50,9 @@ public partial class RestartAzNetworkCloudBareMetalMachine_RestartViaIdentity : [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -57,6 +66,9 @@ public partial class RestartAzNetworkCloudBareMetalMachine_RestartViaIdentity : [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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] @@ -106,7 +118,7 @@ public partial class RestartAzNetworkCloudBareMetalMachine_RestartViaIdentity : /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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")] @@ -129,12 +141,12 @@ public partial class RestartAzNetworkCloudBareMetalMachine_RestartViaIdentity : /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 @@ -253,11 +265,36 @@ 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.NetworkCloud.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -269,10 +306,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -340,7 +393,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -378,7 +431,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 } }); @@ -391,7 +444,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public RestartAzNetworkCloudBareMetalMachine_RestartViaIdentity() { @@ -424,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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ) { @@ -446,7 +499,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.NetworkCloud.Runtime.RestException(responseMessage, await response); + var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 } @@ -479,7 +532,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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RestartAzNetworkCloudKubernetesClusterNode_Restart.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RestartAzNetworkCloudKubernetesClusterNode_Restart.cs new file mode 100644 index 000000000000..52b2d28158d3 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RestartAzNetworkCloudKubernetesClusterNode_Restart.cs @@ -0,0 +1,581 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; + using System; + + /// Restart a targeted node of a Kubernetes cluster. + /// + /// [OpenAPI] RestartNode=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/kubernetesClusters/{kubernetesClusterName}/restartNode" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Restart, @"AzNetworkCloudKubernetesClusterNode_Restart", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Restart a targeted node of a Kubernetes cluster.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/kubernetesClusters/{kubernetesClusterName}/restartNode", ApiVersion = "2025-02-01")] + public partial class RestartAzNetworkCloudKubernetesClusterNode_Restart : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 _kubernetesClusterName; + + /// The name of the Kubernetes cluster. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the Kubernetes cluster.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the Kubernetes cluster.", + SerializedName = @"kubernetesClusterName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] + public string KubernetesClusterName { get => this._kubernetesClusterName; set => this._kubernetesClusterName = value; } + + /// + /// Backing field for property. + /// + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterRestartNodeParameters _kubernetesClusterRestartNodeParameter; + + /// + /// KubernetesClusterRestartNodeParameters represents the body of the request to restart the node of a Kubernetes cluster. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "KubernetesClusterRestartNodeParameters represents the body of the request to restart the node of a Kubernetes cluster.", ValueFromPipeline = true)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"KubernetesClusterRestartNodeParameters represents the body of the request to restart the node of a Kubernetes cluster.", + SerializedName = @"kubernetesClusterRestartNodeParameters", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterRestartNodeParameters) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Body)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterRestartNodeParameters KubernetesClusterRestartNodeParameter { get => this._kubernetesClusterRestartNodeParameter; set => this._kubernetesClusterRestartNodeParameter = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// 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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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. The value must be an UUID. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription. The value must be an UUID.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription. The value must be an UUID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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. + /// /// 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.NetworkCloud.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of RestartAzNetworkCloudKubernetesClusterNode_Restart + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets.RestartAzNetworkCloudKubernetesClusterNode_Restart Clone() + { + var clone = new RestartAzNetworkCloudKubernetesClusterNode_Restart(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.KubernetesClusterName = this.KubernetesClusterName; + clone.KubernetesClusterRestartNodeParameter = this.KubernetesClusterRestartNodeParameter; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'KubernetesClustersRestartNode' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.KubernetesClustersRestartNode(SubscriptionId, ResourceGroupName, KubernetesClusterName, KubernetesClusterRestartNodeParameter, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,KubernetesClusterName=KubernetesClusterName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public RestartAzNetworkCloudKubernetesClusterNode_Restart() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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. + /// + /// 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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RestartAzNetworkCloudKubernetesClusterNode_RestartExpanded.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RestartAzNetworkCloudKubernetesClusterNode_RestartExpanded.cs index 9e7c81feb90c..f20323676b2f 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RestartAzNetworkCloudKubernetesClusterNode_RestartExpanded.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RestartAzNetworkCloudKubernetesClusterNode_RestartExpanded.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// Restart a targeted node of a Kubernetes cluster. @@ -18,7 +20,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/kubernetesClusters/{kubernetesClusterName}/restartNode", ApiVersion = "2025-02-01")] public partial class RestartAzNetworkCloudKubernetesClusterNode_RestartExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,10 +37,13 @@ public partial class RestartAzNetworkCloudKubernetesClusterNode_RestartExpanded /// 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(); + /// /// KubernetesClusterRestartNodeParameters represents the body of the request to restart the node of a Kubernetes cluster. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterRestartNodeParameters _kubernetesClusterRestartNodeParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.KubernetesClusterRestartNodeParameters(); + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterRestartNodeParameters _kubernetesClusterRestartNodeParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.KubernetesClusterRestartNodeParameters(); /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] @@ -49,6 +55,9 @@ public partial class RestartAzNetworkCloudKubernetesClusterNode_RestartExpanded [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -62,6 +71,9 @@ public partial class RestartAzNetworkCloudKubernetesClusterNode_RestartExpanded [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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] @@ -128,7 +140,7 @@ public partial class RestartAzNetworkCloudKubernetesClusterNode_RestartExpanded /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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")] @@ -174,7 +186,8 @@ public partial class RestartAzNetworkCloudKubernetesClusterNode_RestartExpanded [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -183,12 +196,12 @@ public partial class RestartAzNetworkCloudKubernetesClusterNode_RestartExpanded /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 @@ -311,11 +324,36 @@ 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.NetworkCloud.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -327,10 +365,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -398,7 +452,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -416,7 +470,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,KubernetesClusterName=KubernetesClusterName,body=_kubernetesClusterRestartNodeParametersBody}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,KubernetesClusterName=KubernetesClusterName}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -429,7 +483,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public RestartAzNetworkCloudKubernetesClusterNode_RestartExpanded() { @@ -462,12 +516,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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ) { @@ -484,15 +538,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.NetworkCloud.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, KubernetesClusterName=KubernetesClusterName, body=_kubernetesClusterRestartNodeParametersBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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, KubernetesClusterName=KubernetesClusterName, body=_kubernetesClusterRestartNodeParametersBody }) + 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 } }); @@ -517,7 +571,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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RestartAzNetworkCloudKubernetesClusterNode_RestartViaIdentity.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RestartAzNetworkCloudKubernetesClusterNode_RestartViaIdentity.cs new file mode 100644 index 000000000000..c5ec30def33a --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RestartAzNetworkCloudKubernetesClusterNode_RestartViaIdentity.cs @@ -0,0 +1,562 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; + using System; + + /// Restart a targeted node of a Kubernetes cluster. + /// + /// [OpenAPI] RestartNode=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/kubernetesClusters/{kubernetesClusterName}/restartNode" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Restart, @"AzNetworkCloudKubernetesClusterNode_RestartViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Restart a targeted node of a Kubernetes cluster.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/kubernetesClusters/{kubernetesClusterName}/restartNode", ApiVersion = "2025-02-01")] + public partial class RestartAzNetworkCloudKubernetesClusterNode_RestartViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity 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 Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterRestartNodeParameters _kubernetesClusterRestartNodeParameter; + + /// + /// KubernetesClusterRestartNodeParameters represents the body of the request to restart the node of a Kubernetes cluster. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "KubernetesClusterRestartNodeParameters represents the body of the request to restart the node of a Kubernetes cluster.", ValueFromPipeline = true)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"KubernetesClusterRestartNodeParameters represents the body of the request to restart the node of a Kubernetes cluster.", + SerializedName = @"kubernetesClusterRestartNodeParameters", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterRestartNodeParameters) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Body)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterRestartNodeParameters KubernetesClusterRestartNodeParameter { get => this._kubernetesClusterRestartNodeParameter; set => this._kubernetesClusterRestartNodeParameter = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// 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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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. + /// /// 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.NetworkCloud.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of RestartAzNetworkCloudKubernetesClusterNode_RestartViaIdentity + /// + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets.RestartAzNetworkCloudKubernetesClusterNode_RestartViaIdentity Clone() + { + var clone = new RestartAzNetworkCloudKubernetesClusterNode_RestartViaIdentity(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.KubernetesClusterRestartNodeParameter = this.KubernetesClusterRestartNodeParameter; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'KubernetesClustersRestartNode' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.KubernetesClustersRestartNodeViaIdentity(InputObject.Id, KubernetesClusterRestartNodeParameter, onOk, onDefault, this, Pipeline); + } + 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.KubernetesClusterName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.KubernetesClusterName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.KubernetesClustersRestartNode(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.KubernetesClusterName ?? null, KubernetesClusterRestartNodeParameter, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Initializes a new instance of the cmdlet + /// class. + /// + public RestartAzNetworkCloudKubernetesClusterNode_RestartViaIdentity() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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. + /// + /// 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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RestartAzNetworkCloudKubernetesClusterNode_RestartViaIdentityExpanded.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RestartAzNetworkCloudKubernetesClusterNode_RestartViaIdentityExpanded.cs index bd59784bbe09..a9422cfe6d89 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RestartAzNetworkCloudKubernetesClusterNode_RestartViaIdentityExpanded.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RestartAzNetworkCloudKubernetesClusterNode_RestartViaIdentityExpanded.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// Restart a targeted node of a Kubernetes cluster. @@ -18,7 +20,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/kubernetesClusters/{kubernetesClusterName}/restartNode", ApiVersion = "2025-02-01")] public partial class RestartAzNetworkCloudKubernetesClusterNode_RestartViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,10 +37,13 @@ public partial class RestartAzNetworkCloudKubernetesClusterNode_RestartViaIdenti /// 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(); + /// /// KubernetesClusterRestartNodeParameters represents the body of the request to restart the node of a Kubernetes cluster. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterRestartNodeParameters _kubernetesClusterRestartNodeParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.KubernetesClusterRestartNodeParameters(); + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterRestartNodeParameters _kubernetesClusterRestartNodeParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.KubernetesClusterRestartNodeParameters(); /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] @@ -49,6 +55,9 @@ public partial class RestartAzNetworkCloudKubernetesClusterNode_RestartViaIdenti [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -62,6 +71,9 @@ public partial class RestartAzNetworkCloudKubernetesClusterNode_RestartViaIdenti [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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] @@ -122,7 +134,7 @@ public partial class RestartAzNetworkCloudKubernetesClusterNode_RestartViaIdenti /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,12 +157,12 @@ public partial class RestartAzNetworkCloudKubernetesClusterNode_RestartViaIdenti /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 @@ -270,11 +282,36 @@ 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.NetworkCloud.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -286,10 +323,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -357,7 +410,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -395,7 +448,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_kubernetesClusterRestartNodeParametersBody}) + 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 } }); @@ -408,7 +461,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the + /// Initializes a new instance of the /// cmdlet class. /// public RestartAzNetworkCloudKubernetesClusterNode_RestartViaIdentityExpanded() @@ -442,12 +495,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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ) { @@ -464,15 +517,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.NetworkCloud.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_kubernetesClusterRestartNodeParametersBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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=_kubernetesClusterRestartNodeParametersBody }) + 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 } }); @@ -497,7 +550,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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RestartAzNetworkCloudKubernetesClusterNode_RestartViaJsonFilePath.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RestartAzNetworkCloudKubernetesClusterNode_RestartViaJsonFilePath.cs new file mode 100644 index 000000000000..de15ad44bfbb --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RestartAzNetworkCloudKubernetesClusterNode_RestartViaJsonFilePath.cs @@ -0,0 +1,582 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; + using System; + + /// Restart a targeted node of a Kubernetes cluster. + /// + /// [OpenAPI] RestartNode=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/kubernetesClusters/{kubernetesClusterName}/restartNode" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Restart, @"AzNetworkCloudKubernetesClusterNode_RestartViaJsonFilePath", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Restart a targeted node of a Kubernetes cluster.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/kubernetesClusters/{kubernetesClusterName}/restartNode", ApiVersion = "2025-02-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.NotSuggestDefaultParameterSet] + public partial class RestartAzNetworkCloudKubernetesClusterNode_RestartViaJsonFilePath : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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(); + + public global::System.String _jsonString; + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 Restart operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Path of Json file supplied to the Restart operation")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Path of Json file supplied to the Restart 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 _kubernetesClusterName; + + /// The name of the Kubernetes cluster. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the Kubernetes cluster.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the Kubernetes cluster.", + SerializedName = @"kubernetesClusterName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] + public string KubernetesClusterName { get => this._kubernetesClusterName; set => this._kubernetesClusterName = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// 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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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. The value must be an UUID. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription. The value must be an UUID.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription. The value must be an UUID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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. + /// /// 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.NetworkCloud.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of RestartAzNetworkCloudKubernetesClusterNode_RestartViaJsonFilePath + /// + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets.RestartAzNetworkCloudKubernetesClusterNode_RestartViaJsonFilePath Clone() + { + var clone = new RestartAzNetworkCloudKubernetesClusterNode_RestartViaJsonFilePath(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.KubernetesClusterName = this.KubernetesClusterName; + clone.JsonFilePath = this.JsonFilePath; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'KubernetesClustersRestartNode' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.KubernetesClustersRestartNodeViaJsonString(SubscriptionId, ResourceGroupName, KubernetesClusterName, _jsonString, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,KubernetesClusterName=KubernetesClusterName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Initializes a new instance of the cmdlet + /// class. + /// + public RestartAzNetworkCloudKubernetesClusterNode_RestartViaJsonFilePath() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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. + /// + /// 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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RestartAzNetworkCloudKubernetesClusterNode_RestartViaJsonString.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RestartAzNetworkCloudKubernetesClusterNode_RestartViaJsonString.cs new file mode 100644 index 000000000000..d1f3236c0a67 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RestartAzNetworkCloudKubernetesClusterNode_RestartViaJsonString.cs @@ -0,0 +1,580 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; + using System; + + /// Restart a targeted node of a Kubernetes cluster. + /// + /// [OpenAPI] RestartNode=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/kubernetesClusters/{kubernetesClusterName}/restartNode" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Restart, @"AzNetworkCloudKubernetesClusterNode_RestartViaJsonString", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Restart a targeted node of a Kubernetes cluster.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/kubernetesClusters/{kubernetesClusterName}/restartNode", ApiVersion = "2025-02-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.NotSuggestDefaultParameterSet] + public partial class RestartAzNetworkCloudKubernetesClusterNode_RestartViaJsonString : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 Restart operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Json string supplied to the Restart operation")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Json string supplied to the Restart operation", + SerializedName = @"JsonString", + PossibleTypes = new [] { typeof(string) })] + public string JsonString { get => this._jsonString; set => this._jsonString = value; } + + /// Backing field for property. + private string _kubernetesClusterName; + + /// The name of the Kubernetes cluster. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the Kubernetes cluster.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the Kubernetes cluster.", + SerializedName = @"kubernetesClusterName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] + public string KubernetesClusterName { get => this._kubernetesClusterName; set => this._kubernetesClusterName = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// 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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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. The value must be an UUID. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription. The value must be an UUID.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription. The value must be an UUID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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. + /// /// 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.NetworkCloud.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of RestartAzNetworkCloudKubernetesClusterNode_RestartViaJsonString + /// + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets.RestartAzNetworkCloudKubernetesClusterNode_RestartViaJsonString Clone() + { + var clone = new RestartAzNetworkCloudKubernetesClusterNode_RestartViaJsonString(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.KubernetesClusterName = this.KubernetesClusterName; + clone.JsonString = this.JsonString; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'KubernetesClustersRestartNode' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.KubernetesClustersRestartNodeViaJsonString(SubscriptionId, ResourceGroupName, KubernetesClusterName, _jsonString, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,KubernetesClusterName=KubernetesClusterName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Initializes a new instance of the cmdlet + /// class. + /// + public RestartAzNetworkCloudKubernetesClusterNode_RestartViaJsonString() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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. + /// + /// 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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RestartAzNetworkCloudVirtualMachine_Restart.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RestartAzNetworkCloudVirtualMachine_Restart.cs index f5f170bcbd22..c55ba0a9f40f 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RestartAzNetworkCloudVirtualMachine_Restart.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RestartAzNetworkCloudVirtualMachine_Restart.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// Restart the provided virtual machine. @@ -18,7 +20,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/virtualMachines/{virtualMachineName}/restart", ApiVersion = "2025-02-01")] public partial class RestartAzNetworkCloudVirtualMachine_Restart : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,6 +37,9 @@ public partial class RestartAzNetworkCloudVirtualMachine_Restart : 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(); + /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] @@ -44,6 +50,9 @@ public partial class RestartAzNetworkCloudVirtualMachine_Restart : global::Syste [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -57,6 +66,9 @@ public partial class RestartAzNetworkCloudVirtualMachine_Restart : global::Syste [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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] @@ -113,7 +125,7 @@ public partial class RestartAzNetworkCloudVirtualMachine_Restart : global::Syste /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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")] @@ -159,7 +171,8 @@ public partial class RestartAzNetworkCloudVirtualMachine_Restart : global::Syste [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -168,12 +181,12 @@ public partial class RestartAzNetworkCloudVirtualMachine_Restart : 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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 @@ -293,11 +306,36 @@ 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.NetworkCloud.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -309,10 +347,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -380,7 +434,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -398,7 +452,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 } }); @@ -411,7 +465,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public RestartAzNetworkCloudVirtualMachine_Restart() { @@ -444,12 +498,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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ) { @@ -466,15 +520,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.NetworkCloud.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.NetworkCloud.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 } }); @@ -499,7 +553,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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RestartAzNetworkCloudVirtualMachine_RestartViaIdentity.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RestartAzNetworkCloudVirtualMachine_RestartViaIdentity.cs index aa36eaab5d7c..061ae0ae0ac1 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RestartAzNetworkCloudVirtualMachine_RestartViaIdentity.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/RestartAzNetworkCloudVirtualMachine_RestartViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// Restart the provided virtual machine. @@ -18,7 +20,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/virtualMachines/{virtualMachineName}/restart", ApiVersion = "2025-02-01")] public partial class RestartAzNetworkCloudVirtualMachine_RestartViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,6 +37,9 @@ public partial class RestartAzNetworkCloudVirtualMachine_RestartViaIdentity : 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(); + /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] @@ -44,6 +50,9 @@ public partial class RestartAzNetworkCloudVirtualMachine_RestartViaIdentity : gl [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -57,6 +66,9 @@ public partial class RestartAzNetworkCloudVirtualMachine_RestartViaIdentity : gl [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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] @@ -106,7 +118,7 @@ public partial class RestartAzNetworkCloudVirtualMachine_RestartViaIdentity : gl /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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")] @@ -129,12 +141,12 @@ public partial class RestartAzNetworkCloudVirtualMachine_RestartViaIdentity : 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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 @@ -251,11 +263,36 @@ 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.NetworkCloud.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -267,10 +304,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -338,7 +391,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -376,7 +429,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 } }); @@ -389,7 +442,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public RestartAzNetworkCloudVirtualMachine_RestartViaIdentity() { @@ -422,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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ) { @@ -444,7 +497,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.NetworkCloud.Runtime.RestException(responseMessage, await response); + var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 } @@ -477,7 +530,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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/StartAzNetworkCloudBareMetalMachine_Start.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/StartAzNetworkCloudBareMetalMachine_Start.cs index 04ccd9f2f168..22c606be15a1 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/StartAzNetworkCloudBareMetalMachine_Start.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/StartAzNetworkCloudBareMetalMachine_Start.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// Start the provided bare metal machine. @@ -18,7 +20,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/bareMetalMachines/{bareMetalMachineName}/start", ApiVersion = "2025-02-01")] public partial class StartAzNetworkCloudBareMetalMachine_Start : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,6 +37,9 @@ public partial class StartAzNetworkCloudBareMetalMachine_Start : 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(); + /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] @@ -44,6 +50,9 @@ public partial class StartAzNetworkCloudBareMetalMachine_Start : global::System. [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -57,6 +66,9 @@ public partial class StartAzNetworkCloudBareMetalMachine_Start : global::System. [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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] @@ -113,7 +125,7 @@ public partial class StartAzNetworkCloudBareMetalMachine_Start : global::System. /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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")] @@ -159,7 +171,8 @@ public partial class StartAzNetworkCloudBareMetalMachine_Start : global::System. [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -168,12 +181,12 @@ public partial class StartAzNetworkCloudBareMetalMachine_Start : 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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 @@ -293,11 +306,36 @@ 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.NetworkCloud.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -309,10 +347,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -380,7 +434,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -398,7 +452,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 } }); @@ -411,7 +465,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public StartAzNetworkCloudBareMetalMachine_Start() { @@ -444,12 +498,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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ) { @@ -466,15 +520,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.NetworkCloud.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.NetworkCloud.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 } }); @@ -499,7 +553,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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/StartAzNetworkCloudBareMetalMachine_StartViaIdentity.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/StartAzNetworkCloudBareMetalMachine_StartViaIdentity.cs index 50ebe2a3365b..bf9c9438cc15 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/StartAzNetworkCloudBareMetalMachine_StartViaIdentity.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/StartAzNetworkCloudBareMetalMachine_StartViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// Start the provided bare metal machine. @@ -18,7 +20,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/bareMetalMachines/{bareMetalMachineName}/start", ApiVersion = "2025-02-01")] public partial class StartAzNetworkCloudBareMetalMachine_StartViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,6 +37,9 @@ public partial class StartAzNetworkCloudBareMetalMachine_StartViaIdentity : 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(); + /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] @@ -44,6 +50,9 @@ public partial class StartAzNetworkCloudBareMetalMachine_StartViaIdentity : glob [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -57,6 +66,9 @@ public partial class StartAzNetworkCloudBareMetalMachine_StartViaIdentity : glob [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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] @@ -106,7 +118,7 @@ public partial class StartAzNetworkCloudBareMetalMachine_StartViaIdentity : glob /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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")] @@ -129,12 +141,12 @@ public partial class StartAzNetworkCloudBareMetalMachine_StartViaIdentity : 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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 @@ -251,11 +263,36 @@ 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.NetworkCloud.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -267,10 +304,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -338,7 +391,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -376,7 +429,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 } }); @@ -389,7 +442,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public StartAzNetworkCloudBareMetalMachine_StartViaIdentity() { @@ -422,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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ) { @@ -444,7 +497,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.NetworkCloud.Runtime.RestException(responseMessage, await response); + var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 } @@ -477,7 +530,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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/StartAzNetworkCloudVirtualMachine_Start.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/StartAzNetworkCloudVirtualMachine_Start.cs index 32cc50eb2175..607b8e4a494b 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/StartAzNetworkCloudVirtualMachine_Start.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/StartAzNetworkCloudVirtualMachine_Start.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// Start the provided virtual machine. @@ -18,7 +20,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/virtualMachines/{virtualMachineName}/start", ApiVersion = "2025-02-01")] public partial class StartAzNetworkCloudVirtualMachine_Start : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,6 +37,9 @@ public partial class StartAzNetworkCloudVirtualMachine_Start : 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(); + /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] @@ -44,6 +50,9 @@ public partial class StartAzNetworkCloudVirtualMachine_Start : global::System.Ma [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -57,6 +66,9 @@ public partial class StartAzNetworkCloudVirtualMachine_Start : global::System.Ma [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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] @@ -113,7 +125,7 @@ public partial class StartAzNetworkCloudVirtualMachine_Start : global::System.Ma /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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")] @@ -159,7 +171,8 @@ public partial class StartAzNetworkCloudVirtualMachine_Start : global::System.Ma [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -168,12 +181,12 @@ public partial class StartAzNetworkCloudVirtualMachine_Start : 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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 @@ -293,11 +306,36 @@ 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.NetworkCloud.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -309,10 +347,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -380,7 +434,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -398,7 +452,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 } }); @@ -411,7 +465,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public StartAzNetworkCloudVirtualMachine_Start() { @@ -444,12 +498,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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ) { @@ -466,15 +520,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.NetworkCloud.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.NetworkCloud.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 } }); @@ -499,7 +553,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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/StartAzNetworkCloudVirtualMachine_StartViaIdentity.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/StartAzNetworkCloudVirtualMachine_StartViaIdentity.cs index 50613853034f..8b3ffd211103 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/StartAzNetworkCloudVirtualMachine_StartViaIdentity.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/StartAzNetworkCloudVirtualMachine_StartViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// Start the provided virtual machine. @@ -18,7 +20,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/virtualMachines/{virtualMachineName}/start", ApiVersion = "2025-02-01")] public partial class StartAzNetworkCloudVirtualMachine_StartViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,6 +37,9 @@ public partial class StartAzNetworkCloudVirtualMachine_StartViaIdentity : 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(); + /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] @@ -44,6 +50,9 @@ public partial class StartAzNetworkCloudVirtualMachine_StartViaIdentity : global [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -57,6 +66,9 @@ public partial class StartAzNetworkCloudVirtualMachine_StartViaIdentity : global [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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] @@ -106,7 +118,7 @@ public partial class StartAzNetworkCloudVirtualMachine_StartViaIdentity : global /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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")] @@ -129,12 +141,12 @@ public partial class StartAzNetworkCloudVirtualMachine_StartViaIdentity : 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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 @@ -251,11 +263,36 @@ 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.NetworkCloud.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -267,10 +304,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -338,7 +391,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -376,7 +429,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 } }); @@ -389,7 +442,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public StartAzNetworkCloudVirtualMachine_StartViaIdentity() { @@ -422,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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ) { @@ -444,7 +497,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.NetworkCloud.Runtime.RestException(responseMessage, await response); + var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 } @@ -477,7 +530,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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/StopAzNetworkCloudBareMetalMachine_PowerOffExpanded.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/StopAzNetworkCloudBareMetalMachine_PowerOffExpanded.cs index c565067a7303..6e25a8b1dd01 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/StopAzNetworkCloudBareMetalMachine_PowerOffExpanded.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/StopAzNetworkCloudBareMetalMachine_PowerOffExpanded.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// Power off the provided bare metal machine. @@ -18,7 +20,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/bareMetalMachines/{bareMetalMachineName}/powerOff", ApiVersion = "2025-02-01")] public partial class StopAzNetworkCloudBareMetalMachine_PowerOffExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -32,13 +35,16 @@ public partial class StopAzNetworkCloudBareMetalMachine_PowerOffExpanded : globa /// /// BareMetalMachinePowerOffParameters represents the body of the request to power off bare metal machine. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePowerOffParameters _bareMetalMachinePowerOffParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BareMetalMachinePowerOffParameters(); + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePowerOffParameters _bareMetalMachinePowerOffParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BareMetalMachinePowerOffParameters(); /// /// 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(); + /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] @@ -49,6 +55,9 @@ public partial class StopAzNetworkCloudBareMetalMachine_PowerOffExpanded : globa [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -62,6 +71,9 @@ public partial class StopAzNetworkCloudBareMetalMachine_PowerOffExpanded : globa [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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] @@ -118,7 +130,7 @@ public partial class StopAzNetworkCloudBareMetalMachine_PowerOffExpanded : globa /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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")] @@ -160,9 +172,9 @@ public partial class StopAzNetworkCloudBareMetalMachine_PowerOffExpanded : globa ReadOnly = false, Description = @"The indicator of whether to skip the graceful OS shutdown and power off the bare metal machine immediately.", SerializedName = @"skipShutdown", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineSkipShutdown) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineSkipShutdown))] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineSkipShutdown SkipShutdown { get => _bareMetalMachinePowerOffParametersBody.SkipShutdown ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineSkipShutdown)""); set => _bareMetalMachinePowerOffParametersBody.SkipShutdown = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("True", "False")] + public string SkipShutdown { get => _bareMetalMachinePowerOffParametersBody.SkipShutdown ?? null; set => _bareMetalMachinePowerOffParametersBody.SkipShutdown = value; } /// Backing field for property. private string _subscriptionId; @@ -178,7 +190,8 @@ public partial class StopAzNetworkCloudBareMetalMachine_PowerOffExpanded : globa [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -187,12 +200,12 @@ public partial class StopAzNetworkCloudBareMetalMachine_PowerOffExpanded : 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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 @@ -313,11 +326,36 @@ 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.NetworkCloud.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -329,10 +367,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -400,7 +454,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -418,7 +472,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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=_bareMetalMachinePowerOffParametersBody}) + 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 } }); @@ -431,7 +485,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public StopAzNetworkCloudBareMetalMachine_PowerOffExpanded() { @@ -464,12 +518,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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ) { @@ -486,15 +540,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.NetworkCloud.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=_bareMetalMachinePowerOffParametersBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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=_bareMetalMachinePowerOffParametersBody }) + 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 } }); @@ -519,7 +573,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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/StopAzNetworkCloudBareMetalMachine_PowerOffViaIdentityExpanded.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/StopAzNetworkCloudBareMetalMachine_PowerOffViaIdentityExpanded.cs index d1c319209d4f..2e1ddc7d55a5 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/StopAzNetworkCloudBareMetalMachine_PowerOffViaIdentityExpanded.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/StopAzNetworkCloudBareMetalMachine_PowerOffViaIdentityExpanded.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// Power off the provided bare metal machine. @@ -18,7 +20,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/bareMetalMachines/{bareMetalMachineName}/powerOff", ApiVersion = "2025-02-01")] public partial class StopAzNetworkCloudBareMetalMachine_PowerOffViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -32,13 +35,16 @@ public partial class StopAzNetworkCloudBareMetalMachine_PowerOffViaIdentityExpan /// /// BareMetalMachinePowerOffParameters represents the body of the request to power off bare metal machine. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePowerOffParameters _bareMetalMachinePowerOffParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BareMetalMachinePowerOffParameters(); + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePowerOffParameters _bareMetalMachinePowerOffParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BareMetalMachinePowerOffParameters(); /// /// 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(); + /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] @@ -49,6 +55,9 @@ public partial class StopAzNetworkCloudBareMetalMachine_PowerOffViaIdentityExpan [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -62,6 +71,9 @@ public partial class StopAzNetworkCloudBareMetalMachine_PowerOffViaIdentityExpan [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 +123,7 @@ public partial class StopAzNetworkCloudBareMetalMachine_PowerOffViaIdentityExpan /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,21 +151,21 @@ public partial class StopAzNetworkCloudBareMetalMachine_PowerOffViaIdentityExpan ReadOnly = false, Description = @"The indicator of whether to skip the graceful OS shutdown and power off the bare metal machine immediately.", SerializedName = @"skipShutdown", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineSkipShutdown) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineSkipShutdown))] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineSkipShutdown SkipShutdown { get => _bareMetalMachinePowerOffParametersBody.SkipShutdown ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.BareMetalMachineSkipShutdown)""); set => _bareMetalMachinePowerOffParametersBody.SkipShutdown = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("True", "False")] + public string SkipShutdown { get => _bareMetalMachinePowerOffParametersBody.SkipShutdown ?? null; set => _bareMetalMachinePowerOffParametersBody.SkipShutdown = 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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 @@ -273,11 +285,36 @@ 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.NetworkCloud.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -289,10 +326,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -360,7 +413,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -398,7 +451,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_bareMetalMachinePowerOffParametersBody}) + 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 } }); @@ -411,7 +464,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet + /// Initializes a new instance of the cmdlet /// class. /// public StopAzNetworkCloudBareMetalMachine_PowerOffViaIdentityExpanded() @@ -445,12 +498,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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ) { @@ -467,15 +520,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.NetworkCloud.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_bareMetalMachinePowerOffParametersBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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=_bareMetalMachinePowerOffParametersBody }) + 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 } }); @@ -500,7 +553,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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/StopAzNetworkCloudBareMetalMachine_PowerOffViaJsonFilePath.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/StopAzNetworkCloudBareMetalMachine_PowerOffViaJsonFilePath.cs new file mode 100644 index 000000000000..a9b85c840766 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/StopAzNetworkCloudBareMetalMachine_PowerOffViaJsonFilePath.cs @@ -0,0 +1,582 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; + using System; + + /// Power off the provided bare metal machine. + /// + /// [OpenAPI] PowerOff=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/bareMetalMachines/{bareMetalMachineName}/powerOff" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Stop, @"AzNetworkCloudBareMetalMachine_PowerOffViaJsonFilePath", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Power off the provided bare metal machine.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/bareMetalMachines/{bareMetalMachineName}/powerOff", ApiVersion = "2025-02-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.NotSuggestDefaultParameterSet] + public partial class StopAzNetworkCloudBareMetalMachine_PowerOffViaJsonFilePath : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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(); + + public global::System.String _jsonString; + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 PowerOff operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Path of Json file supplied to the PowerOff operation")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Path of Json file supplied to the PowerOff 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.NetworkCloud.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of the bare metal machine. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the bare metal machine.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the bare metal machine.", + SerializedName = @"bareMetalMachineName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("BareMetalMachineName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// 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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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. The value must be an UUID. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription. The value must be an UUID.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription. The value must be an UUID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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. + /// /// 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.NetworkCloud.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of StopAzNetworkCloudBareMetalMachine_PowerOffViaJsonFilePath + /// + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets.StopAzNetworkCloudBareMetalMachine_PowerOffViaJsonFilePath Clone() + { + var clone = new StopAzNetworkCloudBareMetalMachine_PowerOffViaJsonFilePath(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.Name = this.Name; + clone.JsonFilePath = this.JsonFilePath; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'BareMetalMachinesPowerOff' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.BareMetalMachinesPowerOffViaJsonString(SubscriptionId, ResourceGroupName, Name, _jsonString, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public StopAzNetworkCloudBareMetalMachine_PowerOffViaJsonFilePath() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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. + /// + /// 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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/StopAzNetworkCloudBareMetalMachine_PowerOffViaJsonString.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/StopAzNetworkCloudBareMetalMachine_PowerOffViaJsonString.cs new file mode 100644 index 000000000000..976bbf8e9236 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/StopAzNetworkCloudBareMetalMachine_PowerOffViaJsonString.cs @@ -0,0 +1,580 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; + using System; + + /// Power off the provided bare metal machine. + /// + /// [OpenAPI] PowerOff=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/bareMetalMachines/{bareMetalMachineName}/powerOff" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Stop, @"AzNetworkCloudBareMetalMachine_PowerOffViaJsonString", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Power off the provided bare metal machine.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/bareMetalMachines/{bareMetalMachineName}/powerOff", ApiVersion = "2025-02-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.NotSuggestDefaultParameterSet] + public partial class StopAzNetworkCloudBareMetalMachine_PowerOffViaJsonString : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 PowerOff operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Json string supplied to the PowerOff operation")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Json string supplied to the PowerOff 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.NetworkCloud.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of the bare metal machine. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the bare metal machine.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the bare metal machine.", + SerializedName = @"bareMetalMachineName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("BareMetalMachineName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// 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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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. The value must be an UUID. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription. The value must be an UUID.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription. The value must be an UUID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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. + /// /// 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.NetworkCloud.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of StopAzNetworkCloudBareMetalMachine_PowerOffViaJsonString + /// + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets.StopAzNetworkCloudBareMetalMachine_PowerOffViaJsonString Clone() + { + var clone = new StopAzNetworkCloudBareMetalMachine_PowerOffViaJsonString(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.Name = this.Name; + clone.JsonString = this.JsonString; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'BareMetalMachinesPowerOff' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.BareMetalMachinesPowerOffViaJsonString(SubscriptionId, ResourceGroupName, Name, _jsonString, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public StopAzNetworkCloudBareMetalMachine_PowerOffViaJsonString() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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. + /// + /// 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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/StopAzNetworkCloudVirtualMachine_PowerOffExpanded.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/StopAzNetworkCloudVirtualMachine_PowerOffExpanded.cs index 7645efdaaf07..18a932fe76da 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/StopAzNetworkCloudVirtualMachine_PowerOffExpanded.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/StopAzNetworkCloudVirtualMachine_PowerOffExpanded.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// Power off the provided virtual machine. @@ -18,7 +20,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/virtualMachines/{virtualMachineName}/powerOff", ApiVersion = "2025-02-01")] public partial class StopAzNetworkCloudVirtualMachine_PowerOffExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,10 +37,13 @@ public partial class StopAzNetworkCloudVirtualMachine_PowerOffExpanded : 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(); + /// /// VirtualMachinePowerOffParameters represents the body of the request to power off virtual machine. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePowerOffParameters _virtualMachinePowerOffParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.VirtualMachinePowerOffParameters(); + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePowerOffParameters _virtualMachinePowerOffParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.VirtualMachinePowerOffParameters(); /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] @@ -49,6 +55,9 @@ public partial class StopAzNetworkCloudVirtualMachine_PowerOffExpanded : global: [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -62,6 +71,9 @@ public partial class StopAzNetworkCloudVirtualMachine_PowerOffExpanded : global: [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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] @@ -118,7 +130,7 @@ public partial class StopAzNetworkCloudVirtualMachine_PowerOffExpanded : global: /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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")] @@ -160,9 +172,9 @@ public partial class StopAzNetworkCloudVirtualMachine_PowerOffExpanded : global: ReadOnly = false, Description = @"The indicator of whether to skip the graceful OS shutdown and power off the virtual machine immediately.", SerializedName = @"skipShutdown", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.SkipShutdown) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.SkipShutdown))] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.SkipShutdown SkipShutdown { get => _virtualMachinePowerOffParametersBody.SkipShutdown ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.SkipShutdown)""); set => _virtualMachinePowerOffParametersBody.SkipShutdown = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("True", "False")] + public string SkipShutdown { get => _virtualMachinePowerOffParametersBody.SkipShutdown ?? null; set => _virtualMachinePowerOffParametersBody.SkipShutdown = value; } /// Backing field for property. private string _subscriptionId; @@ -178,7 +190,8 @@ public partial class StopAzNetworkCloudVirtualMachine_PowerOffExpanded : global: [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -187,12 +200,12 @@ public partial class StopAzNetworkCloudVirtualMachine_PowerOffExpanded : 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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 @@ -313,11 +326,36 @@ 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.NetworkCloud.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -329,10 +367,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -400,7 +454,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -418,7 +472,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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=_virtualMachinePowerOffParametersBody}) + 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 } }); @@ -431,7 +485,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public StopAzNetworkCloudVirtualMachine_PowerOffExpanded() { @@ -464,12 +518,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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ) { @@ -486,15 +540,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.NetworkCloud.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=_virtualMachinePowerOffParametersBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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=_virtualMachinePowerOffParametersBody }) + 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 } }); @@ -519,7 +573,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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/StopAzNetworkCloudVirtualMachine_PowerOffViaIdentityExpanded.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/StopAzNetworkCloudVirtualMachine_PowerOffViaIdentityExpanded.cs index 4b4e310e9367..ecf4abd1c258 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/StopAzNetworkCloudVirtualMachine_PowerOffViaIdentityExpanded.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/StopAzNetworkCloudVirtualMachine_PowerOffViaIdentityExpanded.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// Power off the provided virtual machine. @@ -18,7 +20,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/virtualMachines/{virtualMachineName}/powerOff", ApiVersion = "2025-02-01")] public partial class StopAzNetworkCloudVirtualMachine_PowerOffViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,10 +37,13 @@ public partial class StopAzNetworkCloudVirtualMachine_PowerOffViaIdentityExpande /// 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(); + /// /// VirtualMachinePowerOffParameters represents the body of the request to power off virtual machine. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePowerOffParameters _virtualMachinePowerOffParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.VirtualMachinePowerOffParameters(); + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePowerOffParameters _virtualMachinePowerOffParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.VirtualMachinePowerOffParameters(); /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] @@ -49,6 +55,9 @@ public partial class StopAzNetworkCloudVirtualMachine_PowerOffViaIdentityExpande [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -62,6 +71,9 @@ public partial class StopAzNetworkCloudVirtualMachine_PowerOffViaIdentityExpande [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 +123,7 @@ public partial class StopAzNetworkCloudVirtualMachine_PowerOffViaIdentityExpande /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,21 +151,21 @@ public partial class StopAzNetworkCloudVirtualMachine_PowerOffViaIdentityExpande ReadOnly = false, Description = @"The indicator of whether to skip the graceful OS shutdown and power off the virtual machine immediately.", SerializedName = @"skipShutdown", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.SkipShutdown) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.SkipShutdown))] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.SkipShutdown SkipShutdown { get => _virtualMachinePowerOffParametersBody.SkipShutdown ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.SkipShutdown)""); set => _virtualMachinePowerOffParametersBody.SkipShutdown = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("True", "False")] + public string SkipShutdown { get => _virtualMachinePowerOffParametersBody.SkipShutdown ?? null; set => _virtualMachinePowerOffParametersBody.SkipShutdown = 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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 @@ -273,11 +285,36 @@ 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.NetworkCloud.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -289,10 +326,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -360,7 +413,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -398,7 +451,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_virtualMachinePowerOffParametersBody}) + 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 } }); @@ -411,7 +464,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public StopAzNetworkCloudVirtualMachine_PowerOffViaIdentityExpanded() { @@ -444,12 +497,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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ) { @@ -466,15 +519,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.NetworkCloud.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_virtualMachinePowerOffParametersBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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=_virtualMachinePowerOffParametersBody }) + 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 } }); @@ -499,7 +552,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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/StopAzNetworkCloudVirtualMachine_PowerOffViaJsonFilePath.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/StopAzNetworkCloudVirtualMachine_PowerOffViaJsonFilePath.cs new file mode 100644 index 000000000000..36e1324afae9 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/StopAzNetworkCloudVirtualMachine_PowerOffViaJsonFilePath.cs @@ -0,0 +1,582 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; + using System; + + /// Power off the provided virtual machine. + /// + /// [OpenAPI] PowerOff=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/virtualMachines/{virtualMachineName}/powerOff" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Stop, @"AzNetworkCloudVirtualMachine_PowerOffViaJsonFilePath", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Power off the provided virtual machine.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/virtualMachines/{virtualMachineName}/powerOff", ApiVersion = "2025-02-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.NotSuggestDefaultParameterSet] + public partial class StopAzNetworkCloudVirtualMachine_PowerOffViaJsonFilePath : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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(); + + public global::System.String _jsonString; + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 PowerOff operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Path of Json file supplied to the PowerOff operation")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Path of Json file supplied to the PowerOff 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.NetworkCloud.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of the virtual machine. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the virtual machine.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the virtual machine.", + SerializedName = @"virtualMachineName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("VirtualMachineName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// 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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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. The value must be an UUID. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription. The value must be an UUID.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription. The value must be an UUID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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. + /// /// 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.NetworkCloud.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of StopAzNetworkCloudVirtualMachine_PowerOffViaJsonFilePath + /// + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets.StopAzNetworkCloudVirtualMachine_PowerOffViaJsonFilePath Clone() + { + var clone = new StopAzNetworkCloudVirtualMachine_PowerOffViaJsonFilePath(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.Name = this.Name; + clone.JsonFilePath = this.JsonFilePath; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'VirtualMachinesPowerOff' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.VirtualMachinesPowerOffViaJsonString(SubscriptionId, ResourceGroupName, Name, _jsonString, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public StopAzNetworkCloudVirtualMachine_PowerOffViaJsonFilePath() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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. + /// + /// 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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/StopAzNetworkCloudVirtualMachine_PowerOffViaJsonString.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/StopAzNetworkCloudVirtualMachine_PowerOffViaJsonString.cs new file mode 100644 index 000000000000..67333dad6617 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/StopAzNetworkCloudVirtualMachine_PowerOffViaJsonString.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.NetworkCloud.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; + using System; + + /// Power off the provided virtual machine. + /// + /// [OpenAPI] PowerOff=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/virtualMachines/{virtualMachineName}/powerOff" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Stop, @"AzNetworkCloudVirtualMachine_PowerOffViaJsonString", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Power off the provided virtual machine.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/virtualMachines/{virtualMachineName}/powerOff", ApiVersion = "2025-02-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.NotSuggestDefaultParameterSet] + public partial class StopAzNetworkCloudVirtualMachine_PowerOffViaJsonString : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 PowerOff operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Json string supplied to the PowerOff operation")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Json string supplied to the PowerOff 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.NetworkCloud.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of the virtual machine. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the virtual machine.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the virtual machine.", + SerializedName = @"virtualMachineName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("VirtualMachineName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// 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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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. The value must be an UUID. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription. The value must be an UUID.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription. The value must be an UUID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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. + /// /// 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.NetworkCloud.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of StopAzNetworkCloudVirtualMachine_PowerOffViaJsonString + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets.StopAzNetworkCloudVirtualMachine_PowerOffViaJsonString Clone() + { + var clone = new StopAzNetworkCloudVirtualMachine_PowerOffViaJsonString(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.Name = this.Name; + clone.JsonString = this.JsonString; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'VirtualMachinesPowerOff' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.VirtualMachinesPowerOffViaJsonString(SubscriptionId, ResourceGroupName, Name, _jsonString, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public StopAzNetworkCloudVirtualMachine_PowerOffViaJsonString() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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. + /// + /// 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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudAgentPool_UpdateExpanded.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudAgentPool_UpdateExpanded.cs index 17fe75656cd1..c421215dcf7c 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudAgentPool_UpdateExpanded.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudAgentPool_UpdateExpanded.cs @@ -6,23 +6,25 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// /// Patch the properties of the provided Kubernetes cluster agent pool, or update the tags associated with the Kubernetes - /// cluster agent pool. Properties and tag updates can be done independently. + /// cluster agent pool. Properties and tag update can be done independently. /// /// /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/kubernetesClusters/{kubernetesClusterName}/agentPools/{agentPoolName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzNetworkCloudAgentPool_UpdateExpanded", SupportsShouldProcess = true)] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPool", "15.0.0", "2.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"AdministratorConfigurationSshPublicKey","AttachedNetworkConfigurationL2Network","AttachedNetworkConfigurationL3Network","AttachedNetworkConfigurationTrunkedNetwork","AvailabilityZone","Label","Taint"}, NewOutputProperties=new string[] {"AdministratorConfigurationSshPublicKey","AttachedNetworkConfigurationL2Network","AttachedNetworkConfigurationL3Network","AttachedNetworkConfigurationTrunkedNetwork","AvailabilityZone","Label","Taint"}, ChangeDescription="The types of properties will be changed from fixed array to 'List'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPool))] - [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Patch the properties of the provided Kubernetes cluster agent pool, or update the tags associated with the Kubernetes cluster agent pool. Properties and tag updates can be done independently.")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Patch the properties of the provided Kubernetes cluster agent pool, or update the tags associated with the Kubernetes cluster agent pool. Properties and tag update can be done independently.")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/kubernetesClusters/{kubernetesClusterName}/agentPools/{agentPoolName}", ApiVersion = "2025-02-01")] public partial class UpdateAzNetworkCloudAgentPool_UpdateExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -36,13 +38,16 @@ public partial class UpdateAzNetworkCloudAgentPool_UpdateExpanded : global::Syst /// /// AgentPoolPatchParameters represents the body of the request to patch the Kubernetes cluster agent pool. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPatchParameters _agentPoolUpdateParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AgentPoolPatchParameters(); + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPatchParameters _agentPoolUpdateParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AgentPoolPatchParameters(); /// /// 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(); + /// /// SshPublicKey represents the public key used to authenticate with a resource through SSH. /// @@ -54,8 +59,8 @@ public partial class UpdateAzNetworkCloudAgentPool_UpdateExpanded : global::Syst ReadOnly = false, Description = @"SshPublicKey represents the public key used to authenticate with a resource through SSH.", SerializedName = @"sshPublicKeys", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey) })] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey[] AdministratorConfigurationSshPublicKey { get => _agentPoolUpdateParametersBody.AdministratorConfigurationSshPublicKey ?? null /* arrayOf */; set => _agentPoolUpdateParametersBody.AdministratorConfigurationSshPublicKey = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISshPublicKey) })] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISshPublicKey[] AdministratorConfigurationSshPublicKey { get => _agentPoolUpdateParametersBody.AdministratorConfigurationSshPublicKey?.ToArray() ?? null /* fixedArrayOf */; set => _agentPoolUpdateParametersBody.AdministratorConfigurationSshPublicKey = (value != null ? new System.Collections.Generic.List(value) : null); } /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] @@ -67,6 +72,9 @@ public partial class UpdateAzNetworkCloudAgentPool_UpdateExpanded : global::Syst [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -91,6 +99,9 @@ public partial class UpdateAzNetworkCloudAgentPool_UpdateExpanded : global::Syst [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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] @@ -188,7 +199,7 @@ public partial class UpdateAzNetworkCloudAgentPool_UpdateExpanded : global::Syst /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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")] @@ -234,7 +245,8 @@ public partial class UpdateAzNetworkCloudAgentPool_UpdateExpanded : global::Syst [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -247,8 +259,8 @@ public partial class UpdateAzNetworkCloudAgentPool_UpdateExpanded : global::Syst ReadOnly = false, Description = @"The Azure resource tags that will replace the existing ones.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPatchParametersTags) })] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPatchParametersTags Tag { get => _agentPoolUpdateParametersBody.Tag ?? null /* object */; set => _agentPoolUpdateParametersBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPatchParametersTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPatchParametersTags Tag { get => _agentPoolUpdateParametersBody.Tag ?? null /* object */; set => _agentPoolUpdateParametersBody.Tag = value; } /// /// The maximum time in seconds that is allowed for a node drain to complete before proceeding with the upgrade of the agent @@ -301,24 +313,24 @@ public partial class UpdateAzNetworkCloudAgentPool_UpdateExpanded : 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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IAgentPool + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPool /// 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) @@ -432,11 +444,36 @@ 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.NetworkCloud.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -448,10 +485,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -519,7 +572,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -532,12 +585,12 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.AgentPoolsUpdate(SubscriptionId, ResourceGroupName, KubernetesClusterName, Name, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _agentPoolUpdateParametersBody, onOk, onDefault, this, Pipeline); + await this.Client.AgentPoolsUpdate(SubscriptionId, ResourceGroupName, KubernetesClusterName, Name, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _agentPoolUpdateParametersBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate); await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,KubernetesClusterName=KubernetesClusterName,Name=Name,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null,body=_agentPoolUpdateParametersBody}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,KubernetesClusterName=KubernetesClusterName,Name=Name,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -557,7 +610,7 @@ protected override void StopProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public UpdateAzNetworkCloudAgentPool_UpdateExpanded() { @@ -583,12 +636,12 @@ public UpdateAzNetworkCloudAgentPool_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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ) { @@ -605,15 +658,15 @@ public UpdateAzNetworkCloudAgentPool_UpdateExpanded() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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, KubernetesClusterName=KubernetesClusterName, Name=Name, IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, body=_agentPoolUpdateParametersBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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, KubernetesClusterName=KubernetesClusterName, Name=Name, IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, body=_agentPoolUpdateParametersBody }) + 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 } }); @@ -623,12 +676,12 @@ public UpdateAzNetworkCloudAgentPool_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.NetworkCloud.Models.Api20250201.IAgentPool + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPool /// 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 ) { @@ -640,8 +693,9 @@ public UpdateAzNetworkCloudAgentPool_UpdateExpanded() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPool - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPool + var result = (await response); + WriteObject(result, false); } } } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudAgentPool_UpdateViaIdentityExpanded.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudAgentPool_UpdateViaIdentityExpanded.cs index 693329a83e85..14e231aa61c7 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudAgentPool_UpdateViaIdentityExpanded.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudAgentPool_UpdateViaIdentityExpanded.cs @@ -6,23 +6,25 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// /// Patch the properties of the provided Kubernetes cluster agent pool, or update the tags associated with the Kubernetes - /// cluster agent pool. Properties and tag updates can be done independently. + /// cluster agent pool. Properties and tag update can be done independently. /// /// /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/kubernetesClusters/{kubernetesClusterName}/agentPools/{agentPoolName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzNetworkCloudAgentPool_UpdateViaIdentityExpanded", SupportsShouldProcess = true)] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPool", "15.0.0", "2.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"AdministratorConfigurationSshPublicKey","AttachedNetworkConfigurationL2Network","AttachedNetworkConfigurationL3Network","AttachedNetworkConfigurationTrunkedNetwork","AvailabilityZone","Label","Taint"}, NewOutputProperties=new string[] {"AdministratorConfigurationSshPublicKey","AttachedNetworkConfigurationL2Network","AttachedNetworkConfigurationL3Network","AttachedNetworkConfigurationTrunkedNetwork","AvailabilityZone","Label","Taint"}, ChangeDescription="The types of properties will be changed from fixed array to 'List'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPool))] - [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Patch the properties of the provided Kubernetes cluster agent pool, or update the tags associated with the Kubernetes cluster agent pool. Properties and tag updates can be done independently.")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Patch the properties of the provided Kubernetes cluster agent pool, or update the tags associated with the Kubernetes cluster agent pool. Properties and tag update can be done independently.")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/kubernetesClusters/{kubernetesClusterName}/agentPools/{agentPoolName}", ApiVersion = "2025-02-01")] public partial class UpdateAzNetworkCloudAgentPool_UpdateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -36,13 +38,16 @@ public partial class UpdateAzNetworkCloudAgentPool_UpdateViaIdentityExpanded : g /// /// AgentPoolPatchParameters represents the body of the request to patch the Kubernetes cluster agent pool. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPatchParameters _agentPoolUpdateParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.AgentPoolPatchParameters(); + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPatchParameters _agentPoolUpdateParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AgentPoolPatchParameters(); /// /// 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(); + /// /// SshPublicKey represents the public key used to authenticate with a resource through SSH. /// @@ -54,8 +59,8 @@ public partial class UpdateAzNetworkCloudAgentPool_UpdateViaIdentityExpanded : g ReadOnly = false, Description = @"SshPublicKey represents the public key used to authenticate with a resource through SSH.", SerializedName = @"sshPublicKeys", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey) })] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey[] AdministratorConfigurationSshPublicKey { get => _agentPoolUpdateParametersBody.AdministratorConfigurationSshPublicKey ?? null /* arrayOf */; set => _agentPoolUpdateParametersBody.AdministratorConfigurationSshPublicKey = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISshPublicKey) })] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISshPublicKey[] AdministratorConfigurationSshPublicKey { get => _agentPoolUpdateParametersBody.AdministratorConfigurationSshPublicKey?.ToArray() ?? null /* fixedArrayOf */; set => _agentPoolUpdateParametersBody.AdministratorConfigurationSshPublicKey = (value != null ? new System.Collections.Generic.List(value) : null); } /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] @@ -67,6 +72,9 @@ public partial class UpdateAzNetworkCloudAgentPool_UpdateViaIdentityExpanded : g [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -91,6 +99,9 @@ public partial class UpdateAzNetworkCloudAgentPool_UpdateViaIdentityExpanded : g [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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] @@ -167,7 +178,7 @@ public partial class UpdateAzNetworkCloudAgentPool_UpdateViaIdentityExpanded : g /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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")] @@ -194,8 +205,8 @@ public partial class UpdateAzNetworkCloudAgentPool_UpdateViaIdentityExpanded : g ReadOnly = false, Description = @"The Azure resource tags that will replace the existing ones.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPatchParametersTags) })] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPoolPatchParametersTags Tag { get => _agentPoolUpdateParametersBody.Tag ?? null /* object */; set => _agentPoolUpdateParametersBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPatchParametersTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPatchParametersTags Tag { get => _agentPoolUpdateParametersBody.Tag ?? null /* object */; set => _agentPoolUpdateParametersBody.Tag = value; } /// /// The maximum time in seconds that is allowed for a node drain to complete before proceeding with the upgrade of the agent @@ -248,24 +259,24 @@ public partial class UpdateAzNetworkCloudAgentPool_UpdateViaIdentityExpanded : 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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IAgentPool + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPool /// 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) @@ -375,11 +386,36 @@ 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.NetworkCloud.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -391,10 +427,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -462,7 +514,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -477,7 +529,7 @@ protected override void ProcessRecord() await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } if (InputObject?.Id != null) { - await this.Client.AgentPoolsUpdateViaIdentity(InputObject.Id, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _agentPoolUpdateParametersBody, onOk, onDefault, this, Pipeline); + await this.Client.AgentPoolsUpdateViaIdentity(InputObject.Id, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _agentPoolUpdateParametersBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate); } else { @@ -498,13 +550,13 @@ protected override void ProcessRecord() { ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.AgentPoolName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); } - await this.Client.AgentPoolsUpdate(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.KubernetesClusterName ?? null, InputObject.AgentPoolName ?? null, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _agentPoolUpdateParametersBody, onOk, onDefault, this, Pipeline); + await this.Client.AgentPoolsUpdate(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.KubernetesClusterName ?? null, InputObject.AgentPoolName ?? null, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _agentPoolUpdateParametersBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate); } await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null,body=_agentPoolUpdateParametersBody}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -524,7 +576,7 @@ protected override void StopProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public UpdateAzNetworkCloudAgentPool_UpdateViaIdentityExpanded() { @@ -550,12 +602,12 @@ public UpdateAzNetworkCloudAgentPool_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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ) { @@ -572,15 +624,15 @@ public UpdateAzNetworkCloudAgentPool_UpdateViaIdentityExpanded() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, body=_agentPoolUpdateParametersBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 { IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, body=_agentPoolUpdateParametersBody }) + 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 } }); @@ -590,12 +642,12 @@ public UpdateAzNetworkCloudAgentPool_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.NetworkCloud.Models.Api20250201.IAgentPool + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPool /// 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 ) { @@ -607,8 +659,9 @@ public UpdateAzNetworkCloudAgentPool_UpdateViaIdentityExpanded() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IAgentPool - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPool + var result = (await response); + WriteObject(result, false); } } } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudAgentPool_UpdateViaIdentityKubernetesClusterExpanded.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudAgentPool_UpdateViaIdentityKubernetesClusterExpanded.cs new file mode 100644 index 000000000000..0ed7228155e7 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudAgentPool_UpdateViaIdentityKubernetesClusterExpanded.cs @@ -0,0 +1,684 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; + using System; + + /// + /// Patch the properties of the provided Kubernetes cluster agent pool, or update the tags associated with the Kubernetes + /// cluster agent pool. Properties and tag update can be done independently. + /// + /// + /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/kubernetesClusters/{kubernetesClusterName}/agentPools/{agentPoolName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzNetworkCloudAgentPool_UpdateViaIdentityKubernetesClusterExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Patch the properties of the provided Kubernetes cluster agent pool, or update the tags associated with the Kubernetes cluster agent pool. Properties and tag update can be done independently.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/kubernetesClusters/{kubernetesClusterName}/agentPools/{agentPoolName}", ApiVersion = "2025-02-01")] + public partial class UpdateAzNetworkCloudAgentPool_UpdateViaIdentityKubernetesClusterExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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; + + /// + /// AgentPoolPatchParameters represents the body of the request to patch the Kubernetes cluster agent pool. + /// + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPatchParameters _agentPoolUpdateParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.AgentPoolPatchParameters(); + + /// + /// 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(); + + /// + /// SshPublicKey represents the public key used to authenticate with a resource through SSH. + /// + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "SshPublicKey represents the public key used to authenticate with a resource through SSH.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"SshPublicKey represents the public key used to authenticate with a resource through SSH.", + SerializedName = @"sshPublicKeys", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISshPublicKey) })] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISshPublicKey[] AdministratorConfigurationSshPublicKey { get => _agentPoolUpdateParametersBody.AdministratorConfigurationSshPublicKey?.ToArray() ?? null /* fixedArrayOf */; set => _agentPoolUpdateParametersBody.AdministratorConfigurationSshPublicKey = (value != null ? new System.Collections.Generic.List(value) : null); } + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; + + /// The number of virtual machines that use this configuration. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The number of virtual machines that use this configuration.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The number of virtual machines that use this configuration.", + SerializedName = @"count", + PossibleTypes = new [] { typeof(long) })] + public long Count { get => _agentPoolUpdateParametersBody.Count ?? default(long); set => _agentPoolUpdateParametersBody.Count = 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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private string _ifMatch; + + /// + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value + /// to prevent accidentally overwriting concurrent changes. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes.", + SerializedName = @"If-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Header)] + public string IfMatch { get => this._ifMatch; set => this._ifMatch = value; } + + /// Backing field for property. + private string _ifNoneMatch; + + /// + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result + /// in error from server as they are not supported. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result in error from server as they are not supported.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result in error from server as they are not supported.", + SerializedName = @"If-None-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Header)] + public string IfNoneMatch { get => this._ifNoneMatch; set => this._ifNoneMatch = 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 Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity _kubernetesClusterInputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity KubernetesClusterInputObject { get => this._kubernetesClusterInputObject; set => this._kubernetesClusterInputObject = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of the Kubernetes cluster agent pool. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the Kubernetes cluster agent pool.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the Kubernetes cluster agent pool.", + SerializedName = @"agentPoolName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("AgentPoolName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// The Azure resource tags that will replace the existing ones. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ExportAs(typeof(global::System.Collections.Hashtable))] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The Azure resource tags that will replace the existing ones.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The Azure resource tags that will replace the existing ones.", + SerializedName = @"tags", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPatchParametersTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPoolPatchParametersTags Tag { get => _agentPoolUpdateParametersBody.Tag ?? null /* object */; set => _agentPoolUpdateParametersBody.Tag = value; } + + /// + /// The maximum time in seconds that is allowed for a node drain to complete before proceeding with the upgrade of the agent + /// pool. If not specified during creation, a value of 1800 seconds is used. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The maximum time in seconds that is allowed for a node drain to complete before proceeding with the upgrade of the agent pool. If not specified during creation, a value of 1800 seconds is used.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The maximum time in seconds that is allowed for a node drain to complete before proceeding with the upgrade of the agent pool. If not specified during creation, a value of 1800 seconds is used.", + SerializedName = @"drainTimeout", + PossibleTypes = new [] { typeof(long) })] + public long UpgradeSettingDrainTimeout { get => _agentPoolUpdateParametersBody.UpgradeSettingDrainTimeout ?? default(long); set => _agentPoolUpdateParametersBody.UpgradeSettingDrainTimeout = value; } + + /// + /// The maximum number or percentage of nodes that are surged during upgrade. This can either be set to an integer (e.g. '5') + /// or a percentage (e.g. '50%'). If a percentage is specified, it is the percentage of the total agent pool size at the time + /// of the upgrade. For percentages, fractional nodes are rounded up. If not specified during creation, a value of 1 is used. + /// One of MaxSurge and MaxUnavailable must be greater than 0. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The maximum number or percentage of nodes that are surged during upgrade. This can either be set to an integer (e.g. '5') or a percentage (e.g. '50%'). If a percentage is specified, it is the percentage of the total agent pool size at the time of the upgrade. For percentages, fractional nodes are rounded up. If not specified during creation, a value of 1 is used. One of MaxSurge and MaxUnavailable must be greater than 0.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The maximum number or percentage of nodes that are surged during upgrade. This can either be set to an integer (e.g. '5') or a percentage (e.g. '50%'). If a percentage is specified, it is the percentage of the total agent pool size at the time of the upgrade. For percentages, fractional nodes are rounded up. If not specified during creation, a value of 1 is used. One of MaxSurge and MaxUnavailable must be greater than 0.", + SerializedName = @"maxSurge", + PossibleTypes = new [] { typeof(string) })] + public string UpgradeSettingMaxSurge { get => _agentPoolUpdateParametersBody.UpgradeSettingMaxSurge ?? null; set => _agentPoolUpdateParametersBody.UpgradeSettingMaxSurge = value; } + + /// + /// The maximum number or percentage of nodes that can be unavailable during upgrade. This can either be set to an integer + /// (e.g. '5') or a percentage (e.g. '50%'). If a percentage is specified, it is the percentage of the total agent pool size + /// at the time of the upgrade. For percentages, fractional nodes are rounded up. If not specified during creation, a value + /// of 0 is used. One of MaxSurge and MaxUnavailable must be greater than 0. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The maximum number or percentage of nodes that can be unavailable during upgrade. This can either be set to an integer (e.g. '5') or a percentage (e.g. '50%'). If a percentage is specified, it is the percentage of the total agent pool size at the time of the upgrade. For percentages, fractional nodes are rounded up. If not specified during creation, a value of 0 is used. One of MaxSurge and MaxUnavailable must be greater than 0.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The maximum number or percentage of nodes that can be unavailable during upgrade. This can either be set to an integer (e.g. '5') or a percentage (e.g. '50%'). If a percentage is specified, it is the percentage of the total agent pool size at the time of the upgrade. For percentages, fractional nodes are rounded up. If not specified during creation, a value of 0 is used. One of MaxSurge and MaxUnavailable must be greater than 0.", + SerializedName = @"maxUnavailable", + PossibleTypes = new [] { typeof(string) })] + public string UpgradeSettingMaxUnavailable { get => _agentPoolUpdateParametersBody.UpgradeSettingMaxUnavailable ?? null; set => _agentPoolUpdateParametersBody.UpgradeSettingMaxUnavailable = 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.NetworkCloud.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.NetworkCloud.Models.IAgentPool + /// 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.NetworkCloud.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of UpdateAzNetworkCloudAgentPool_UpdateViaIdentityKubernetesClusterExpanded + /// + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets.UpdateAzNetworkCloudAgentPool_UpdateViaIdentityKubernetesClusterExpanded Clone() + { + var clone = new UpdateAzNetworkCloudAgentPool_UpdateViaIdentityKubernetesClusterExpanded(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone._agentPoolUpdateParametersBody = this._agentPoolUpdateParametersBody; + clone.IfMatch = this.IfMatch; + clone.IfNoneMatch = this.IfNoneMatch; + clone.Name = this.Name; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'AgentPoolsUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (KubernetesClusterInputObject?.Id != null) + { + this.KubernetesClusterInputObject.Id += $"/agentPools/{(global::System.Uri.EscapeDataString(this.Name.ToString()))}"; + await this.Client.AgentPoolsUpdateViaIdentity(KubernetesClusterInputObject.Id, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _agentPoolUpdateParametersBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate); + } + else + { + // try to call with PATH parameters from Input Object + if (null == KubernetesClusterInputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("KubernetesClusterInputObject has null value for KubernetesClusterInputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, KubernetesClusterInputObject) ); + } + if (null == KubernetesClusterInputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("KubernetesClusterInputObject has null value for KubernetesClusterInputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, KubernetesClusterInputObject) ); + } + if (null == KubernetesClusterInputObject.KubernetesClusterName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("KubernetesClusterInputObject has null value for KubernetesClusterInputObject.KubernetesClusterName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, KubernetesClusterInputObject) ); + } + await this.Client.AgentPoolsUpdate(KubernetesClusterInputObject.SubscriptionId ?? null, KubernetesClusterInputObject.ResourceGroupName ?? null, KubernetesClusterInputObject.KubernetesClusterName ?? null, Name, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _agentPoolUpdateParametersBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Name=Name,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public UpdateAzNetworkCloudAgentPool_UpdateViaIdentityKubernetesClusterExpanded() + { + + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.IAgentPool + /// 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.NetworkCloud.Models.IAgentPool + var result = (await response); + WriteObject(result, false); + } + } + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudAgentPool_UpdateViaJsonFilePath.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudAgentPool_UpdateViaJsonFilePath.cs new file mode 100644 index 000000000000..2b99f15a1aa5 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudAgentPool_UpdateViaJsonFilePath.cs @@ -0,0 +1,630 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; + using System; + + /// + /// Patch the properties of the provided Kubernetes cluster agent pool, or update the tags associated with the Kubernetes + /// cluster agent pool. Properties and tag update can be done independently. + /// + /// + /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/kubernetesClusters/{kubernetesClusterName}/agentPools/{agentPoolName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzNetworkCloudAgentPool_UpdateViaJsonFilePath", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Patch the properties of the provided Kubernetes cluster agent pool, or update the tags associated with the Kubernetes cluster agent pool. Properties and tag update can be done independently.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/kubernetesClusters/{kubernetesClusterName}/agentPools/{agentPoolName}", ApiVersion = "2025-02-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.NotSuggestDefaultParameterSet] + public partial class UpdateAzNetworkCloudAgentPool_UpdateViaJsonFilePath : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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(); + + public global::System.String _jsonString; + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private string _ifMatch; + + /// + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value + /// to prevent accidentally overwriting concurrent changes. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes.", + SerializedName = @"If-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Header)] + public string IfMatch { get => this._ifMatch; set => this._ifMatch = value; } + + /// Backing field for property. + private string _ifNoneMatch; + + /// + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result + /// in error from server as they are not supported. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result in error from server as they are not supported.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result in error from server as they are not supported.", + SerializedName = @"If-None-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Header)] + public string IfNoneMatch { get => this._ifNoneMatch; set => this._ifNoneMatch = 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 _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.NetworkCloud.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 _kubernetesClusterName; + + /// The name of the Kubernetes cluster. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the Kubernetes cluster.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the Kubernetes cluster.", + SerializedName = @"kubernetesClusterName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] + public string KubernetesClusterName { get => this._kubernetesClusterName; set => this._kubernetesClusterName = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of the Kubernetes cluster agent pool. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the Kubernetes cluster agent pool.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the Kubernetes cluster agent pool.", + SerializedName = @"agentPoolName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("AgentPoolName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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. The value must be an UUID. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription. The value must be an UUID.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription. The value must be an UUID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.IAgentPool + /// 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.NetworkCloud.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of UpdateAzNetworkCloudAgentPool_UpdateViaJsonFilePath + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets.UpdateAzNetworkCloudAgentPool_UpdateViaJsonFilePath Clone() + { + var clone = new UpdateAzNetworkCloudAgentPool_UpdateViaJsonFilePath(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.KubernetesClusterName = this.KubernetesClusterName; + clone.Name = this.Name; + clone.IfMatch = this.IfMatch; + clone.IfNoneMatch = this.IfNoneMatch; + clone.JsonFilePath = this.JsonFilePath; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'AgentPoolsUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.AgentPoolsUpdateViaJsonString(SubscriptionId, ResourceGroupName, KubernetesClusterName, Name, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _jsonString, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,KubernetesClusterName=KubernetesClusterName,Name=Name,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public UpdateAzNetworkCloudAgentPool_UpdateViaJsonFilePath() + { + + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.IAgentPool + /// 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.NetworkCloud.Models.IAgentPool + var result = (await response); + WriteObject(result, false); + } + } + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudAgentPool_UpdateViaJsonString.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudAgentPool_UpdateViaJsonString.cs new file mode 100644 index 000000000000..7bd929a8ba53 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudAgentPool_UpdateViaJsonString.cs @@ -0,0 +1,628 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; + using System; + + /// + /// Patch the properties of the provided Kubernetes cluster agent pool, or update the tags associated with the Kubernetes + /// cluster agent pool. Properties and tag update can be done independently. + /// + /// + /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/kubernetesClusters/{kubernetesClusterName}/agentPools/{agentPoolName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzNetworkCloudAgentPool_UpdateViaJsonString", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IAgentPool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Patch the properties of the provided Kubernetes cluster agent pool, or update the tags associated with the Kubernetes cluster agent pool. Properties and tag update can be done independently.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/kubernetesClusters/{kubernetesClusterName}/agentPools/{agentPoolName}", ApiVersion = "2025-02-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.NotSuggestDefaultParameterSet] + public partial class UpdateAzNetworkCloudAgentPool_UpdateViaJsonString : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private string _ifMatch; + + /// + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value + /// to prevent accidentally overwriting concurrent changes. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes.", + SerializedName = @"If-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Header)] + public string IfMatch { get => this._ifMatch; set => this._ifMatch = value; } + + /// Backing field for property. + private string _ifNoneMatch; + + /// + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result + /// in error from server as they are not supported. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result in error from server as they are not supported.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result in error from server as they are not supported.", + SerializedName = @"If-None-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Header)] + public string IfNoneMatch { get => this._ifNoneMatch; set => this._ifNoneMatch = 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.NetworkCloud.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 _kubernetesClusterName; + + /// The name of the Kubernetes cluster. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the Kubernetes cluster.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the Kubernetes cluster.", + SerializedName = @"kubernetesClusterName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] + public string KubernetesClusterName { get => this._kubernetesClusterName; set => this._kubernetesClusterName = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of the Kubernetes cluster agent pool. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the Kubernetes cluster agent pool.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the Kubernetes cluster agent pool.", + SerializedName = @"agentPoolName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("AgentPoolName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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. The value must be an UUID. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription. The value must be an UUID.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription. The value must be an UUID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.IAgentPool + /// 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.NetworkCloud.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of UpdateAzNetworkCloudAgentPool_UpdateViaJsonString + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets.UpdateAzNetworkCloudAgentPool_UpdateViaJsonString Clone() + { + var clone = new UpdateAzNetworkCloudAgentPool_UpdateViaJsonString(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.KubernetesClusterName = this.KubernetesClusterName; + clone.Name = this.Name; + clone.IfMatch = this.IfMatch; + clone.IfNoneMatch = this.IfNoneMatch; + clone.JsonString = this.JsonString; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'AgentPoolsUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.AgentPoolsUpdateViaJsonString(SubscriptionId, ResourceGroupName, KubernetesClusterName, Name, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _jsonString, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,KubernetesClusterName=KubernetesClusterName,Name=Name,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public UpdateAzNetworkCloudAgentPool_UpdateViaJsonString() + { + + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.IAgentPool + /// 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.NetworkCloud.Models.IAgentPool + var result = (await response); + WriteObject(result, false); + } + } + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudBareMetalMachineKeySet_UpdateExpanded.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudBareMetalMachineKeySet_UpdateExpanded.cs index 2d7707cf052d..1329af933195 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudBareMetalMachineKeySet_UpdateExpanded.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudBareMetalMachineKeySet_UpdateExpanded.cs @@ -6,23 +6,25 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// /// Patch properties of bare metal machine key set for the provided cluster, or update the tags associated with it. Properties - /// and tag updates can be done independently. + /// and tag update can be done independently. /// /// /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/bareMetalMachineKeySets/{bareMetalMachineKeySetName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzNetworkCloudBareMetalMachineKeySet_UpdateExpanded", SupportsShouldProcess = true)] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySet", "15.0.0", "2.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"JumpHostsAllowed","UserList","UserListStatus"}, NewOutputProperties=new string[] {"JumpHostsAllowed","UserList","UserListStatus"}, ChangeDescription="The types of properties will be changed from fixed array to 'List'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySet))] - [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Patch properties of bare metal machine key set for the provided cluster, or update the tags associated with it. Properties and tag updates can be done independently.")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySet))] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Patch properties of bare metal machine key set for the provided cluster, or update the tags associated with it. Properties and tag update can be done independently.")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/bareMetalMachineKeySets/{bareMetalMachineKeySetName}", ApiVersion = "2025-02-01")] public partial class UpdateAzNetworkCloudBareMetalMachineKeySet_UpdateExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -36,13 +38,16 @@ public partial class UpdateAzNetworkCloudBareMetalMachineKeySet_UpdateExpanded : /// /// BareMetalMachineKeySetPatchParameters represents the body of the request to patch the bare metal machine key set. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetPatchParameters _bareMetalMachineKeySetUpdateParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BareMetalMachineKeySetPatchParameters(); + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetPatchParameters _bareMetalMachineKeySetUpdateParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BareMetalMachineKeySetPatchParameters(); /// /// 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(); + /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] @@ -53,6 +58,9 @@ public partial class UpdateAzNetworkCloudBareMetalMachineKeySet_UpdateExpanded : [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -93,6 +101,9 @@ public partial class UpdateAzNetworkCloudBareMetalMachineKeySet_UpdateExpanded : PossibleTypes = new [] { typeof(global::System.DateTime) })] public global::System.DateTime Expiration { get => _bareMetalMachineKeySetUpdateParametersBody.Expiration ?? default(global::System.DateTime); set => _bareMetalMachineKeySetUpdateParametersBody.Expiration = 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] @@ -154,7 +165,7 @@ public partial class UpdateAzNetworkCloudBareMetalMachineKeySet_UpdateExpanded : Description = @"The list of IP addresses of jump hosts with management network access from which a login will be allowed for the users.", SerializedName = @"jumpHostsAllowed", PossibleTypes = new [] { typeof(string) })] - public string[] JumpHostsAllowed { get => _bareMetalMachineKeySetUpdateParametersBody.JumpHostsAllowed ?? null /* arrayOf */; set => _bareMetalMachineKeySetUpdateParametersBody.JumpHostsAllowed = value; } + public string[] JumpHostsAllowed { get => _bareMetalMachineKeySetUpdateParametersBody.JumpHostsAllowed?.ToArray() ?? null /* fixedArrayOf */; set => _bareMetalMachineKeySetUpdateParametersBody.JumpHostsAllowed = (value != null ? new System.Collections.Generic.List(value) : null); } /// /// cancellation delegate. Stops the cmdlet when called. @@ -190,7 +201,7 @@ public partial class UpdateAzNetworkCloudBareMetalMachineKeySet_UpdateExpanded : /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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")] @@ -236,7 +247,8 @@ public partial class UpdateAzNetworkCloudBareMetalMachineKeySet_UpdateExpanded : [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -249,8 +261,8 @@ public partial class UpdateAzNetworkCloudBareMetalMachineKeySet_UpdateExpanded : ReadOnly = false, Description = @"The Azure resource tags that will replace the existing ones.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetPatchParametersTags) })] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetPatchParametersTags Tag { get => _bareMetalMachineKeySetUpdateParametersBody.Tag ?? null /* object */; set => _bareMetalMachineKeySetUpdateParametersBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetPatchParametersTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetPatchParametersTags Tag { get => _bareMetalMachineKeySetUpdateParametersBody.Tag ?? null /* object */; set => _bareMetalMachineKeySetUpdateParametersBody.Tag = value; } /// The unique list of permitted users. [global::System.Management.Automation.AllowEmptyCollection] @@ -261,32 +273,32 @@ public partial class UpdateAzNetworkCloudBareMetalMachineKeySet_UpdateExpanded : ReadOnly = false, Description = @"The unique list of permitted users.", SerializedName = @"userList", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKeySetUser) })] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKeySetUser[] UserList { get => _bareMetalMachineKeySetUpdateParametersBody.UserList ?? null /* arrayOf */; set => _bareMetalMachineKeySetUpdateParametersBody.UserList = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKeySetUser) })] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKeySetUser[] UserList { get => _bareMetalMachineKeySetUpdateParametersBody.UserList?.ToArray() ?? null /* fixedArrayOf */; set => _bareMetalMachineKeySetUpdateParametersBody.UserList = (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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySet + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySet /// 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) @@ -402,11 +414,36 @@ 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.NetworkCloud.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -418,10 +455,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -489,7 +542,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -502,12 +555,12 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.BareMetalMachineKeySetsUpdate(SubscriptionId, ResourceGroupName, ClusterName, Name, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _bareMetalMachineKeySetUpdateParametersBody, onOk, onDefault, this, Pipeline); + await this.Client.BareMetalMachineKeySetsUpdate(SubscriptionId, ResourceGroupName, ClusterName, Name, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _bareMetalMachineKeySetUpdateParametersBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate); await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,ClusterName=ClusterName,Name=Name,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null,body=_bareMetalMachineKeySetUpdateParametersBody}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,ClusterName=ClusterName,Name=Name,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -527,7 +580,7 @@ protected override void StopProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public UpdateAzNetworkCloudBareMetalMachineKeySet_UpdateExpanded() { @@ -553,12 +606,12 @@ public UpdateAzNetworkCloudBareMetalMachineKeySet_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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ) { @@ -575,15 +628,15 @@ public UpdateAzNetworkCloudBareMetalMachineKeySet_UpdateExpanded() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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, ClusterName=ClusterName, Name=Name, IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, body=_bareMetalMachineKeySetUpdateParametersBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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, ClusterName=ClusterName, Name=Name, IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, body=_bareMetalMachineKeySetUpdateParametersBody }) + 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 } }); @@ -593,12 +646,12 @@ public UpdateAzNetworkCloudBareMetalMachineKeySet_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.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySet + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySet /// 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 ) { @@ -610,8 +663,9 @@ public UpdateAzNetworkCloudBareMetalMachineKeySet_UpdateExpanded() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySet - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySet + var result = (await response); + WriteObject(result, false); } } } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudBareMetalMachineKeySet_UpdateViaIdentityClusterExpanded.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudBareMetalMachineKeySet_UpdateViaIdentityClusterExpanded.cs new file mode 100644 index 000000000000..ad0c6ad4e5c2 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudBareMetalMachineKeySet_UpdateViaIdentityClusterExpanded.cs @@ -0,0 +1,652 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; + using System; + + /// + /// Patch properties of bare metal machine key set for the provided cluster, or update the tags associated with it. Properties + /// and tag update can be done independently. + /// + /// + /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/bareMetalMachineKeySets/{bareMetalMachineKeySetName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzNetworkCloudBareMetalMachineKeySet_UpdateViaIdentityClusterExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySet))] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Patch properties of bare metal machine key set for the provided cluster, or update the tags associated with it. Properties and tag update can be done independently.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/bareMetalMachineKeySets/{bareMetalMachineKeySetName}", ApiVersion = "2025-02-01")] + public partial class UpdateAzNetworkCloudBareMetalMachineKeySet_UpdateViaIdentityClusterExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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; + + /// + /// BareMetalMachineKeySetPatchParameters represents the body of the request to patch the bare metal machine key set. + /// + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetPatchParameters _bareMetalMachineKeySetUpdateParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BareMetalMachineKeySetPatchParameters(); + + /// + /// 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(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity _clusterInputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity ClusterInputObject { get => this._clusterInputObject; set => this._clusterInputObject = 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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// + /// The date and time after which the users in this key set will be removed from the bare metal machines. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The date and time after which the users in this key set will be removed from the bare metal machines.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The date and time after which the users in this key set will be removed from the bare metal machines.", + SerializedName = @"expiration", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + public global::System.DateTime Expiration { get => _bareMetalMachineKeySetUpdateParametersBody.Expiration ?? default(global::System.DateTime); set => _bareMetalMachineKeySetUpdateParametersBody.Expiration = 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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private string _ifMatch; + + /// + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value + /// to prevent accidentally overwriting concurrent changes. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes.", + SerializedName = @"If-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Header)] + public string IfMatch { get => this._ifMatch; set => this._ifMatch = value; } + + /// Backing field for property. + private string _ifNoneMatch; + + /// + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result + /// in error from server as they are not supported. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result in error from server as they are not supported.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result in error from server as they are not supported.", + SerializedName = @"If-None-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Header)] + public string IfNoneMatch { get => this._ifNoneMatch; set => this._ifNoneMatch = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// The list of IP addresses of jump hosts with management network access from which a login will be allowed for the users. + /// + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The list of IP addresses of jump hosts with management network access from which a login will be allowed for the users.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The list of IP addresses of jump hosts with management network access from which a login will be allowed for the users.", + SerializedName = @"jumpHostsAllowed", + PossibleTypes = new [] { typeof(string) })] + public string[] JumpHostsAllowed { get => _bareMetalMachineKeySetUpdateParametersBody.JumpHostsAllowed?.ToArray() ?? null /* fixedArrayOf */; set => _bareMetalMachineKeySetUpdateParametersBody.JumpHostsAllowed = (value != null ? new System.Collections.Generic.List(value) : null); } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of the bare metal machine key set. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the bare metal machine key set.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the bare metal machine key set.", + SerializedName = @"bareMetalMachineKeySetName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("BareMetalMachineKeySetName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// The Azure resource tags that will replace the existing ones. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ExportAs(typeof(global::System.Collections.Hashtable))] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The Azure resource tags that will replace the existing ones.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The Azure resource tags that will replace the existing ones.", + SerializedName = @"tags", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetPatchParametersTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetPatchParametersTags Tag { get => _bareMetalMachineKeySetUpdateParametersBody.Tag ?? null /* object */; set => _bareMetalMachineKeySetUpdateParametersBody.Tag = value; } + + /// The unique list of permitted users. + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The unique list of permitted users.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The unique list of permitted users.", + SerializedName = @"userList", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKeySetUser) })] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKeySetUser[] UserList { get => _bareMetalMachineKeySetUpdateParametersBody.UserList?.ToArray() ?? null /* fixedArrayOf */; set => _bareMetalMachineKeySetUpdateParametersBody.UserList = (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.NetworkCloud.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.NetworkCloud.Models.IBareMetalMachineKeySet + /// 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.NetworkCloud.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of UpdateAzNetworkCloudBareMetalMachineKeySet_UpdateViaIdentityClusterExpanded + /// + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets.UpdateAzNetworkCloudBareMetalMachineKeySet_UpdateViaIdentityClusterExpanded Clone() + { + var clone = new UpdateAzNetworkCloudBareMetalMachineKeySet_UpdateViaIdentityClusterExpanded(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone._bareMetalMachineKeySetUpdateParametersBody = this._bareMetalMachineKeySetUpdateParametersBody; + clone.IfMatch = this.IfMatch; + clone.IfNoneMatch = this.IfNoneMatch; + clone.Name = this.Name; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'BareMetalMachineKeySetsUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (ClusterInputObject?.Id != null) + { + this.ClusterInputObject.Id += $"/bareMetalMachineKeySets/{(global::System.Uri.EscapeDataString(this.Name.ToString()))}"; + await this.Client.BareMetalMachineKeySetsUpdateViaIdentity(ClusterInputObject.Id, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _bareMetalMachineKeySetUpdateParametersBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate); + } + else + { + // try to call with PATH parameters from Input Object + if (null == ClusterInputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("ClusterInputObject has null value for ClusterInputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, ClusterInputObject) ); + } + if (null == ClusterInputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("ClusterInputObject has null value for ClusterInputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, ClusterInputObject) ); + } + if (null == ClusterInputObject.ClusterName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("ClusterInputObject has null value for ClusterInputObject.ClusterName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, ClusterInputObject) ); + } + await this.Client.BareMetalMachineKeySetsUpdate(ClusterInputObject.SubscriptionId ?? null, ClusterInputObject.ResourceGroupName ?? null, ClusterInputObject.ClusterName ?? null, Name, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _bareMetalMachineKeySetUpdateParametersBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Name=Name,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public UpdateAzNetworkCloudBareMetalMachineKeySet_UpdateViaIdentityClusterExpanded() + { + + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.IBareMetalMachineKeySet + /// 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.NetworkCloud.Models.IBareMetalMachineKeySet + var result = (await response); + WriteObject(result, false); + } + } + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudBareMetalMachineKeySet_UpdateViaIdentityExpanded.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudBareMetalMachineKeySet_UpdateViaIdentityExpanded.cs index 07c179f6b191..3737b2033e6e 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudBareMetalMachineKeySet_UpdateViaIdentityExpanded.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudBareMetalMachineKeySet_UpdateViaIdentityExpanded.cs @@ -6,23 +6,25 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// /// Patch properties of bare metal machine key set for the provided cluster, or update the tags associated with it. Properties - /// and tag updates can be done independently. + /// and tag update can be done independently. /// /// /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/bareMetalMachineKeySets/{bareMetalMachineKeySetName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzNetworkCloudBareMetalMachineKeySet_UpdateViaIdentityExpanded", SupportsShouldProcess = true)] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySet", "15.0.0", "2.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"JumpHostsAllowed","UserList","UserListStatus"}, NewOutputProperties=new string[] {"JumpHostsAllowed","UserList","UserListStatus"}, ChangeDescription="The types of properties will be changed from fixed array to 'List'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySet))] - [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Patch properties of bare metal machine key set for the provided cluster, or update the tags associated with it. Properties and tag updates can be done independently.")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySet))] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Patch properties of bare metal machine key set for the provided cluster, or update the tags associated with it. Properties and tag update can be done independently.")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/bareMetalMachineKeySets/{bareMetalMachineKeySetName}", ApiVersion = "2025-02-01")] public partial class UpdateAzNetworkCloudBareMetalMachineKeySet_UpdateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -36,13 +38,16 @@ public partial class UpdateAzNetworkCloudBareMetalMachineKeySet_UpdateViaIdentit /// /// BareMetalMachineKeySetPatchParameters represents the body of the request to patch the bare metal machine key set. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetPatchParameters _bareMetalMachineKeySetUpdateParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BareMetalMachineKeySetPatchParameters(); + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetPatchParameters _bareMetalMachineKeySetUpdateParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BareMetalMachineKeySetPatchParameters(); /// /// 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(); + /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] @@ -53,6 +58,9 @@ public partial class UpdateAzNetworkCloudBareMetalMachineKeySet_UpdateViaIdentit [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -79,6 +87,9 @@ public partial class UpdateAzNetworkCloudBareMetalMachineKeySet_UpdateViaIdentit PossibleTypes = new [] { typeof(global::System.DateTime) })] public global::System.DateTime Expiration { get => _bareMetalMachineKeySetUpdateParametersBody.Expiration ?? default(global::System.DateTime); set => _bareMetalMachineKeySetUpdateParametersBody.Expiration = 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] @@ -148,7 +159,7 @@ public partial class UpdateAzNetworkCloudBareMetalMachineKeySet_UpdateViaIdentit Description = @"The list of IP addresses of jump hosts with management network access from which a login will be allowed for the users.", SerializedName = @"jumpHostsAllowed", PossibleTypes = new [] { typeof(string) })] - public string[] JumpHostsAllowed { get => _bareMetalMachineKeySetUpdateParametersBody.JumpHostsAllowed ?? null /* arrayOf */; set => _bareMetalMachineKeySetUpdateParametersBody.JumpHostsAllowed = value; } + public string[] JumpHostsAllowed { get => _bareMetalMachineKeySetUpdateParametersBody.JumpHostsAllowed?.ToArray() ?? null /* fixedArrayOf */; set => _bareMetalMachineKeySetUpdateParametersBody.JumpHostsAllowed = (value != null ? new System.Collections.Generic.List(value) : null); } /// /// cancellation delegate. Stops the cmdlet when called. @@ -169,7 +180,7 @@ public partial class UpdateAzNetworkCloudBareMetalMachineKeySet_UpdateViaIdentit /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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")] @@ -196,8 +207,8 @@ public partial class UpdateAzNetworkCloudBareMetalMachineKeySet_UpdateViaIdentit ReadOnly = false, Description = @"The Azure resource tags that will replace the existing ones.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetPatchParametersTags) })] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySetPatchParametersTags Tag { get => _bareMetalMachineKeySetUpdateParametersBody.Tag ?? null /* object */; set => _bareMetalMachineKeySetUpdateParametersBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetPatchParametersTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySetPatchParametersTags Tag { get => _bareMetalMachineKeySetUpdateParametersBody.Tag ?? null /* object */; set => _bareMetalMachineKeySetUpdateParametersBody.Tag = value; } /// The unique list of permitted users. [global::System.Management.Automation.AllowEmptyCollection] @@ -208,32 +219,32 @@ public partial class UpdateAzNetworkCloudBareMetalMachineKeySet_UpdateViaIdentit ReadOnly = false, Description = @"The unique list of permitted users.", SerializedName = @"userList", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKeySetUser) })] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKeySetUser[] UserList { get => _bareMetalMachineKeySetUpdateParametersBody.UserList ?? null /* arrayOf */; set => _bareMetalMachineKeySetUpdateParametersBody.UserList = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKeySetUser) })] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKeySetUser[] UserList { get => _bareMetalMachineKeySetUpdateParametersBody.UserList?.ToArray() ?? null /* fixedArrayOf */; set => _bareMetalMachineKeySetUpdateParametersBody.UserList = (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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySet + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySet /// 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) @@ -345,11 +356,36 @@ 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.NetworkCloud.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -361,10 +397,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -432,7 +484,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -447,7 +499,7 @@ protected override void ProcessRecord() await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } if (InputObject?.Id != null) { - await this.Client.BareMetalMachineKeySetsUpdateViaIdentity(InputObject.Id, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _bareMetalMachineKeySetUpdateParametersBody, onOk, onDefault, this, Pipeline); + await this.Client.BareMetalMachineKeySetsUpdateViaIdentity(InputObject.Id, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _bareMetalMachineKeySetUpdateParametersBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate); } else { @@ -468,13 +520,13 @@ protected override void ProcessRecord() { ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.BareMetalMachineKeySetName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); } - await this.Client.BareMetalMachineKeySetsUpdate(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.ClusterName ?? null, InputObject.BareMetalMachineKeySetName ?? null, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _bareMetalMachineKeySetUpdateParametersBody, onOk, onDefault, this, Pipeline); + await this.Client.BareMetalMachineKeySetsUpdate(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.ClusterName ?? null, InputObject.BareMetalMachineKeySetName ?? null, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _bareMetalMachineKeySetUpdateParametersBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate); } await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null,body=_bareMetalMachineKeySetUpdateParametersBody}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -494,8 +546,8 @@ protected override void StopProcessing() } /// - /// Intializes a new instance of the cmdlet - /// class. + /// Initializes a new instance of the + /// cmdlet class. /// public UpdateAzNetworkCloudBareMetalMachineKeySet_UpdateViaIdentityExpanded() { @@ -521,12 +573,12 @@ public UpdateAzNetworkCloudBareMetalMachineKeySet_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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ) { @@ -543,15 +595,15 @@ public UpdateAzNetworkCloudBareMetalMachineKeySet_UpdateViaIdentityExpanded() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, body=_bareMetalMachineKeySetUpdateParametersBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 { IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, body=_bareMetalMachineKeySetUpdateParametersBody }) + 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 } }); @@ -561,12 +613,12 @@ public UpdateAzNetworkCloudBareMetalMachineKeySet_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.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySet + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySet /// 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 ) { @@ -578,8 +630,9 @@ public UpdateAzNetworkCloudBareMetalMachineKeySet_UpdateViaIdentityExpanded() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineKeySet - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySet + var result = (await response); + WriteObject(result, false); } } } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudBareMetalMachineKeySet_UpdateViaJsonFilePath.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudBareMetalMachineKeySet_UpdateViaJsonFilePath.cs new file mode 100644 index 000000000000..b3ce92822451 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudBareMetalMachineKeySet_UpdateViaJsonFilePath.cs @@ -0,0 +1,633 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; + using System; + + /// + /// Patch properties of bare metal machine key set for the provided cluster, or update the tags associated with it. Properties + /// and tag update can be done independently. + /// + /// + /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/bareMetalMachineKeySets/{bareMetalMachineKeySetName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzNetworkCloudBareMetalMachineKeySet_UpdateViaJsonFilePath", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySet))] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Patch properties of bare metal machine key set for the provided cluster, or update the tags associated with it. Properties and tag update can be done independently.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/bareMetalMachineKeySets/{bareMetalMachineKeySetName}", ApiVersion = "2025-02-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.NotSuggestDefaultParameterSet] + public partial class UpdateAzNetworkCloudBareMetalMachineKeySet_UpdateViaJsonFilePath : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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(); + + public global::System.String _jsonString; + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; + + /// Backing field for property. + private string _clusterName; + + /// The name of the cluster. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the cluster.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the cluster.", + SerializedName = @"clusterName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] + public string ClusterName { get => this._clusterName; set => this._clusterName = 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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private string _ifMatch; + + /// + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value + /// to prevent accidentally overwriting concurrent changes. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes.", + SerializedName = @"If-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Header)] + public string IfMatch { get => this._ifMatch; set => this._ifMatch = value; } + + /// Backing field for property. + private string _ifNoneMatch; + + /// + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result + /// in error from server as they are not supported. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result in error from server as they are not supported.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result in error from server as they are not supported.", + SerializedName = @"If-None-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Header)] + public string IfNoneMatch { get => this._ifNoneMatch; set => this._ifNoneMatch = 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 _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.NetworkCloud.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.NetworkCloud.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of the bare metal machine key set. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the bare metal machine key set.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the bare metal machine key set.", + SerializedName = @"bareMetalMachineKeySetName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("BareMetalMachineKeySetName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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. The value must be an UUID. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription. The value must be an UUID.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription. The value must be an UUID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.IBareMetalMachineKeySet + /// 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.NetworkCloud.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of UpdateAzNetworkCloudBareMetalMachineKeySet_UpdateViaJsonFilePath + /// + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets.UpdateAzNetworkCloudBareMetalMachineKeySet_UpdateViaJsonFilePath Clone() + { + var clone = new UpdateAzNetworkCloudBareMetalMachineKeySet_UpdateViaJsonFilePath(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.ClusterName = this.ClusterName; + clone.Name = this.Name; + clone.IfMatch = this.IfMatch; + clone.IfNoneMatch = this.IfNoneMatch; + clone.JsonFilePath = this.JsonFilePath; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'BareMetalMachineKeySetsUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.BareMetalMachineKeySetsUpdateViaJsonString(SubscriptionId, ResourceGroupName, ClusterName, Name, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _jsonString, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,ClusterName=ClusterName,Name=Name,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Initializes a new instance of the cmdlet + /// class. + /// + public UpdateAzNetworkCloudBareMetalMachineKeySet_UpdateViaJsonFilePath() + { + + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.IBareMetalMachineKeySet + /// 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.NetworkCloud.Models.IBareMetalMachineKeySet + var result = (await response); + WriteObject(result, false); + } + } + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudBareMetalMachineKeySet_UpdateViaJsonString.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudBareMetalMachineKeySet_UpdateViaJsonString.cs new file mode 100644 index 000000000000..1426ca9162dc --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudBareMetalMachineKeySet_UpdateViaJsonString.cs @@ -0,0 +1,631 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; + using System; + + /// + /// Patch properties of bare metal machine key set for the provided cluster, or update the tags associated with it. Properties + /// and tag update can be done independently. + /// + /// + /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/bareMetalMachineKeySets/{bareMetalMachineKeySetName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzNetworkCloudBareMetalMachineKeySet_UpdateViaJsonString", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineKeySet))] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Patch properties of bare metal machine key set for the provided cluster, or update the tags associated with it. Properties and tag update can be done independently.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/bareMetalMachineKeySets/{bareMetalMachineKeySetName}", ApiVersion = "2025-02-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.NotSuggestDefaultParameterSet] + public partial class UpdateAzNetworkCloudBareMetalMachineKeySet_UpdateViaJsonString : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; + + /// Backing field for property. + private string _clusterName; + + /// The name of the cluster. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the cluster.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the cluster.", + SerializedName = @"clusterName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] + public string ClusterName { get => this._clusterName; set => this._clusterName = 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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private string _ifMatch; + + /// + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value + /// to prevent accidentally overwriting concurrent changes. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes.", + SerializedName = @"If-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Header)] + public string IfMatch { get => this._ifMatch; set => this._ifMatch = value; } + + /// Backing field for property. + private string _ifNoneMatch; + + /// + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result + /// in error from server as they are not supported. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result in error from server as they are not supported.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result in error from server as they are not supported.", + SerializedName = @"If-None-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Header)] + public string IfNoneMatch { get => this._ifNoneMatch; set => this._ifNoneMatch = 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.NetworkCloud.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.NetworkCloud.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of the bare metal machine key set. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the bare metal machine key set.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the bare metal machine key set.", + SerializedName = @"bareMetalMachineKeySetName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("BareMetalMachineKeySetName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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. The value must be an UUID. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription. The value must be an UUID.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription. The value must be an UUID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.IBareMetalMachineKeySet + /// 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.NetworkCloud.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of UpdateAzNetworkCloudBareMetalMachineKeySet_UpdateViaJsonString + /// + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets.UpdateAzNetworkCloudBareMetalMachineKeySet_UpdateViaJsonString Clone() + { + var clone = new UpdateAzNetworkCloudBareMetalMachineKeySet_UpdateViaJsonString(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.ClusterName = this.ClusterName; + clone.Name = this.Name; + clone.IfMatch = this.IfMatch; + clone.IfNoneMatch = this.IfNoneMatch; + clone.JsonString = this.JsonString; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'BareMetalMachineKeySetsUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.BareMetalMachineKeySetsUpdateViaJsonString(SubscriptionId, ResourceGroupName, ClusterName, Name, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _jsonString, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,ClusterName=ClusterName,Name=Name,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Initializes a new instance of the cmdlet + /// class. + /// + public UpdateAzNetworkCloudBareMetalMachineKeySet_UpdateViaJsonString() + { + + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.IBareMetalMachineKeySet + /// 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.NetworkCloud.Models.IBareMetalMachineKeySet + var result = (await response); + WriteObject(result, false); + } + } + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudBareMetalMachine_UpdateExpanded.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudBareMetalMachine_UpdateExpanded.cs index e6eeed5502b3..0d383cb0a9cb 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudBareMetalMachine_UpdateExpanded.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudBareMetalMachine_UpdateExpanded.cs @@ -6,23 +6,25 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// /// Patch properties of the provided bare metal machine, or update tags associated with the bare metal machine. Properties - /// and tag updates can be done independently. + /// and tag update can be done independently. /// /// /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/bareMetalMachines/{bareMetalMachineName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzNetworkCloudBareMetalMachine_UpdateExpanded", SupportsShouldProcess = true)] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachine", "15.0.0", "2.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"AssociatedResourceId","HardwareInventoryInterface","HardwareInventoryNic","HybridAksClustersAssociatedId","MachineRole","SecretRotationStatus","VirtualMachinesAssociatedId"}, NewOutputProperties=new string[] {"AssociatedResourceId","HardwareInventoryInterface","HardwareInventoryNic","HybridAksClustersAssociatedId","MachineRole","SecretRotationStatus","VirtualMachinesAssociatedId"}, ChangeDescription="The types of properties will be changed from fixed array to 'List'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachine))] - [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Patch properties of the provided bare metal machine, or update tags associated with the bare metal machine. Properties and tag updates can be done independently.")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachine))] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Patch properties of the provided bare metal machine, or update tags associated with the bare metal machine. Properties and tag update can be done independently.")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/bareMetalMachines/{bareMetalMachineName}", ApiVersion = "2025-02-01")] public partial class UpdateAzNetworkCloudBareMetalMachine_UpdateExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -36,13 +38,16 @@ public partial class UpdateAzNetworkCloudBareMetalMachine_UpdateExpanded : globa /// /// BareMetalMachinePatchParameters represents the body of the request to patch bare metal machine properties. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePatchParameters _bareMetalMachineUpdateParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BareMetalMachinePatchParameters(); + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePatchParameters _bareMetalMachineUpdateParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BareMetalMachinePatchParameters(); /// /// 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(); + /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] @@ -53,6 +58,9 @@ public partial class UpdateAzNetworkCloudBareMetalMachine_UpdateExpanded : globa [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -66,6 +74,9 @@ public partial class UpdateAzNetworkCloudBareMetalMachine_UpdateExpanded : globa [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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] @@ -163,7 +174,7 @@ public partial class UpdateAzNetworkCloudBareMetalMachine_UpdateExpanded : globa /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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")] @@ -209,7 +220,8 @@ public partial class UpdateAzNetworkCloudBareMetalMachine_UpdateExpanded : globa [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -222,32 +234,32 @@ public partial class UpdateAzNetworkCloudBareMetalMachine_UpdateExpanded : globa ReadOnly = false, Description = @"The Azure resource tags that will replace the existing ones.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePatchParametersTags) })] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePatchParametersTags Tag { get => _bareMetalMachineUpdateParametersBody.Tag ?? null /* object */; set => _bareMetalMachineUpdateParametersBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePatchParametersTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePatchParametersTags Tag { get => _bareMetalMachineUpdateParametersBody.Tag ?? null /* object */; set => _bareMetalMachineUpdateParametersBody.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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IBareMetalMachine + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachine /// 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) @@ -360,11 +372,36 @@ 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.NetworkCloud.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -376,10 +413,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -447,7 +500,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -460,12 +513,12 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.BareMetalMachinesUpdate(SubscriptionId, ResourceGroupName, Name, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _bareMetalMachineUpdateParametersBody, onOk, onDefault, this, Pipeline); + await this.Client.BareMetalMachinesUpdate(SubscriptionId, ResourceGroupName, Name, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _bareMetalMachineUpdateParametersBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate); await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null,body=_bareMetalMachineUpdateParametersBody}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -485,7 +538,7 @@ protected override void StopProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public UpdateAzNetworkCloudBareMetalMachine_UpdateExpanded() { @@ -511,12 +564,12 @@ public UpdateAzNetworkCloudBareMetalMachine_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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ) { @@ -533,15 +586,15 @@ public UpdateAzNetworkCloudBareMetalMachine_UpdateExpanded() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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, IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, body=_bareMetalMachineUpdateParametersBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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, IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, body=_bareMetalMachineUpdateParametersBody }) + 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 } }); @@ -551,12 +604,12 @@ public UpdateAzNetworkCloudBareMetalMachine_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.NetworkCloud.Models.Api20250201.IBareMetalMachine + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachine /// 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 ) { @@ -568,8 +621,9 @@ public UpdateAzNetworkCloudBareMetalMachine_UpdateExpanded() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachine - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachine + var result = (await response); + WriteObject(result, false); } } } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudBareMetalMachine_UpdateViaIdentityExpanded.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudBareMetalMachine_UpdateViaIdentityExpanded.cs index 607d84d13250..7de226d428dc 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudBareMetalMachine_UpdateViaIdentityExpanded.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudBareMetalMachine_UpdateViaIdentityExpanded.cs @@ -6,23 +6,25 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// /// Patch properties of the provided bare metal machine, or update tags associated with the bare metal machine. Properties - /// and tag updates can be done independently. + /// and tag update can be done independently. /// /// /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/bareMetalMachines/{bareMetalMachineName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzNetworkCloudBareMetalMachine_UpdateViaIdentityExpanded", SupportsShouldProcess = true)] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachine", "15.0.0", "2.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"AssociatedResourceId","HardwareInventoryInterface","HardwareInventoryNic","HybridAksClustersAssociatedId","MachineRole","SecretRotationStatus","VirtualMachinesAssociatedId"}, NewOutputProperties=new string[] {"AssociatedResourceId","HardwareInventoryInterface","HardwareInventoryNic","HybridAksClustersAssociatedId","MachineRole","SecretRotationStatus","VirtualMachinesAssociatedId"}, ChangeDescription="The types of properties will be changed from fixed array to 'List'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachine))] - [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Patch properties of the provided bare metal machine, or update tags associated with the bare metal machine. Properties and tag updates can be done independently.")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachine))] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Patch properties of the provided bare metal machine, or update tags associated with the bare metal machine. Properties and tag update can be done independently.")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/bareMetalMachines/{bareMetalMachineName}", ApiVersion = "2025-02-01")] public partial class UpdateAzNetworkCloudBareMetalMachine_UpdateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -36,13 +38,16 @@ public partial class UpdateAzNetworkCloudBareMetalMachine_UpdateViaIdentityExpan /// /// BareMetalMachinePatchParameters represents the body of the request to patch bare metal machine properties. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePatchParameters _bareMetalMachineUpdateParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BareMetalMachinePatchParameters(); + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePatchParameters _bareMetalMachineUpdateParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BareMetalMachinePatchParameters(); /// /// 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(); + /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] @@ -53,6 +58,9 @@ public partial class UpdateAzNetworkCloudBareMetalMachine_UpdateViaIdentityExpan [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -66,6 +74,9 @@ public partial class UpdateAzNetworkCloudBareMetalMachine_UpdateViaIdentityExpan [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 +167,7 @@ public partial class UpdateAzNetworkCloudBareMetalMachine_UpdateViaIdentityExpan /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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")] @@ -183,32 +194,32 @@ public partial class UpdateAzNetworkCloudBareMetalMachine_UpdateViaIdentityExpan ReadOnly = false, Description = @"The Azure resource tags that will replace the existing ones.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePatchParametersTags) })] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachinePatchParametersTags Tag { get => _bareMetalMachineUpdateParametersBody.Tag ?? null /* object */; set => _bareMetalMachineUpdateParametersBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePatchParametersTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachinePatchParametersTags Tag { get => _bareMetalMachineUpdateParametersBody.Tag ?? null /* object */; set => _bareMetalMachineUpdateParametersBody.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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IBareMetalMachine + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachine /// 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) @@ -320,11 +331,36 @@ 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.NetworkCloud.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -336,10 +372,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -407,7 +459,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -422,7 +474,7 @@ protected override void ProcessRecord() await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } if (InputObject?.Id != null) { - await this.Client.BareMetalMachinesUpdateViaIdentity(InputObject.Id, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _bareMetalMachineUpdateParametersBody, onOk, onDefault, this, Pipeline); + await this.Client.BareMetalMachinesUpdateViaIdentity(InputObject.Id, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _bareMetalMachineUpdateParametersBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate); } else { @@ -439,13 +491,13 @@ protected override void ProcessRecord() { ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.BareMetalMachineName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); } - await this.Client.BareMetalMachinesUpdate(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.BareMetalMachineName ?? null, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _bareMetalMachineUpdateParametersBody, onOk, onDefault, this, Pipeline); + await this.Client.BareMetalMachinesUpdate(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.BareMetalMachineName ?? null, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _bareMetalMachineUpdateParametersBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate); } await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null,body=_bareMetalMachineUpdateParametersBody}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -465,7 +517,7 @@ protected override void StopProcessing() } /// - /// Intializes a new instance of the cmdlet + /// Initializes a new instance of the cmdlet /// class. /// public UpdateAzNetworkCloudBareMetalMachine_UpdateViaIdentityExpanded() @@ -492,12 +544,12 @@ public UpdateAzNetworkCloudBareMetalMachine_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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ) { @@ -514,15 +566,15 @@ public UpdateAzNetworkCloudBareMetalMachine_UpdateViaIdentityExpanded() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, body=_bareMetalMachineUpdateParametersBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 { IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, body=_bareMetalMachineUpdateParametersBody }) + 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 } }); @@ -532,12 +584,12 @@ public UpdateAzNetworkCloudBareMetalMachine_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.NetworkCloud.Models.Api20250201.IBareMetalMachine + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachine /// 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 ) { @@ -549,8 +601,9 @@ public UpdateAzNetworkCloudBareMetalMachine_UpdateViaIdentityExpanded() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachine - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachine + var result = (await response); + WriteObject(result, false); } } } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudBareMetalMachine_UpdateViaJsonFilePath.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudBareMetalMachine_UpdateViaJsonFilePath.cs new file mode 100644 index 000000000000..65ced59a65c3 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudBareMetalMachine_UpdateViaJsonFilePath.cs @@ -0,0 +1,617 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; + using System; + + /// + /// Patch properties of the provided bare metal machine, or update tags associated with the bare metal machine. Properties + /// and tag update can be done independently. + /// + /// + /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/bareMetalMachines/{bareMetalMachineName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzNetworkCloudBareMetalMachine_UpdateViaJsonFilePath", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachine))] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Patch properties of the provided bare metal machine, or update tags associated with the bare metal machine. Properties and tag update can be done independently.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/bareMetalMachines/{bareMetalMachineName}", ApiVersion = "2025-02-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.NotSuggestDefaultParameterSet] + public partial class UpdateAzNetworkCloudBareMetalMachine_UpdateViaJsonFilePath : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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(); + + public global::System.String _jsonString; + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private string _ifMatch; + + /// + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value + /// to prevent accidentally overwriting concurrent changes. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes.", + SerializedName = @"If-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Header)] + public string IfMatch { get => this._ifMatch; set => this._ifMatch = value; } + + /// Backing field for property. + private string _ifNoneMatch; + + /// + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result + /// in error from server as they are not supported. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result in error from server as they are not supported.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result in error from server as they are not supported.", + SerializedName = @"If-None-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Header)] + public string IfNoneMatch { get => this._ifNoneMatch; set => this._ifNoneMatch = 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 _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.NetworkCloud.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.NetworkCloud.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of the bare metal machine. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the bare metal machine.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the bare metal machine.", + SerializedName = @"bareMetalMachineName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("BareMetalMachineName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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. The value must be an UUID. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription. The value must be an UUID.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription. The value must be an UUID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.IBareMetalMachine + /// 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.NetworkCloud.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of UpdateAzNetworkCloudBareMetalMachine_UpdateViaJsonFilePath + /// + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets.UpdateAzNetworkCloudBareMetalMachine_UpdateViaJsonFilePath Clone() + { + var clone = new UpdateAzNetworkCloudBareMetalMachine_UpdateViaJsonFilePath(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.Name = this.Name; + clone.IfMatch = this.IfMatch; + clone.IfNoneMatch = this.IfNoneMatch; + clone.JsonFilePath = this.JsonFilePath; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'BareMetalMachinesUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.BareMetalMachinesUpdateViaJsonString(SubscriptionId, ResourceGroupName, Name, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _jsonString, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public UpdateAzNetworkCloudBareMetalMachine_UpdateViaJsonFilePath() + { + + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.IBareMetalMachine + /// 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.NetworkCloud.Models.IBareMetalMachine + var result = (await response); + WriteObject(result, false); + } + } + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudBareMetalMachine_UpdateViaJsonString.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudBareMetalMachine_UpdateViaJsonString.cs new file mode 100644 index 000000000000..ed13c0b1f01a --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudBareMetalMachine_UpdateViaJsonString.cs @@ -0,0 +1,615 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; + using System; + + /// + /// Patch properties of the provided bare metal machine, or update tags associated with the bare metal machine. Properties + /// and tag update can be done independently. + /// + /// + /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/bareMetalMachines/{bareMetalMachineName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzNetworkCloudBareMetalMachine_UpdateViaJsonString", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachine))] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Patch properties of the provided bare metal machine, or update tags associated with the bare metal machine. Properties and tag update can be done independently.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/bareMetalMachines/{bareMetalMachineName}", ApiVersion = "2025-02-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.NotSuggestDefaultParameterSet] + public partial class UpdateAzNetworkCloudBareMetalMachine_UpdateViaJsonString : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private string _ifMatch; + + /// + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value + /// to prevent accidentally overwriting concurrent changes. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes.", + SerializedName = @"If-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Header)] + public string IfMatch { get => this._ifMatch; set => this._ifMatch = value; } + + /// Backing field for property. + private string _ifNoneMatch; + + /// + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result + /// in error from server as they are not supported. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result in error from server as they are not supported.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result in error from server as they are not supported.", + SerializedName = @"If-None-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Header)] + public string IfNoneMatch { get => this._ifNoneMatch; set => this._ifNoneMatch = 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.NetworkCloud.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.NetworkCloud.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of the bare metal machine. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the bare metal machine.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the bare metal machine.", + SerializedName = @"bareMetalMachineName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("BareMetalMachineName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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. The value must be an UUID. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription. The value must be an UUID.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription. The value must be an UUID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.IBareMetalMachine + /// 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.NetworkCloud.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of UpdateAzNetworkCloudBareMetalMachine_UpdateViaJsonString + /// + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets.UpdateAzNetworkCloudBareMetalMachine_UpdateViaJsonString Clone() + { + var clone = new UpdateAzNetworkCloudBareMetalMachine_UpdateViaJsonString(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.Name = this.Name; + clone.IfMatch = this.IfMatch; + clone.IfNoneMatch = this.IfNoneMatch; + clone.JsonString = this.JsonString; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'BareMetalMachinesUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.BareMetalMachinesUpdateViaJsonString(SubscriptionId, ResourceGroupName, Name, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _jsonString, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public UpdateAzNetworkCloudBareMetalMachine_UpdateViaJsonString() + { + + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.IBareMetalMachine + /// 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.NetworkCloud.Models.IBareMetalMachine + var result = (await response); + WriteObject(result, false); + } + } + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudBmcKeySet_UpdateExpanded.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudBmcKeySet_UpdateExpanded.cs index 6204b871d9b3..c4debfbdd697 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudBmcKeySet_UpdateExpanded.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudBmcKeySet_UpdateExpanded.cs @@ -6,23 +6,25 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// /// Patch properties of baseboard management controller key set for the provided cluster, or update the tags associated with - /// it. Properties and tag updates can be done independently. + /// it. Properties and tag update can be done independently. /// /// /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/bmcKeySets/{bmcKeySetName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzNetworkCloudBmcKeySet_UpdateExpanded", SupportsShouldProcess = true)] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySet", "15.0.0", "2.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"UserList","UserListStatus"}, NewOutputProperties=new string[] {"UserList","UserListStatus"}, ChangeDescription="The types of properties will be changed from fixed array to 'List'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySet))] - [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Patch properties of baseboard management controller key set for the provided cluster, or update the tags associated with it. Properties and tag updates can be done independently.")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySet))] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Patch properties of baseboard management controller key set for the provided cluster, or update the tags associated with it. Properties and tag update can be done independently.")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/bmcKeySets/{bmcKeySetName}", ApiVersion = "2025-02-01")] public partial class UpdateAzNetworkCloudBmcKeySet_UpdateExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -36,13 +38,16 @@ public partial class UpdateAzNetworkCloudBmcKeySet_UpdateExpanded : global::Syst /// /// BmcKeySetPatchParameters represents the body of the request to patch the baseboard management controller key set. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetPatchParameters _bmcKeySetUpdateParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BmcKeySetPatchParameters(); + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetPatchParameters _bmcKeySetUpdateParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BmcKeySetPatchParameters(); /// /// 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(); + /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] @@ -53,6 +58,9 @@ public partial class UpdateAzNetworkCloudBmcKeySet_UpdateExpanded : global::Syst [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -93,6 +101,9 @@ public partial class UpdateAzNetworkCloudBmcKeySet_UpdateExpanded : global::Syst PossibleTypes = new [] { typeof(global::System.DateTime) })] public global::System.DateTime Expiration { get => _bmcKeySetUpdateParametersBody.Expiration ?? default(global::System.DateTime); set => _bmcKeySetUpdateParametersBody.Expiration = 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] @@ -176,7 +187,7 @@ public partial class UpdateAzNetworkCloudBmcKeySet_UpdateExpanded : global::Syst /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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")] @@ -222,7 +233,8 @@ public partial class UpdateAzNetworkCloudBmcKeySet_UpdateExpanded : global::Syst [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -235,8 +247,8 @@ public partial class UpdateAzNetworkCloudBmcKeySet_UpdateExpanded : global::Syst ReadOnly = false, Description = @"The Azure resource tags that will replace the existing ones.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetPatchParametersTags) })] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetPatchParametersTags Tag { get => _bmcKeySetUpdateParametersBody.Tag ?? null /* object */; set => _bmcKeySetUpdateParametersBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetPatchParametersTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetPatchParametersTags Tag { get => _bmcKeySetUpdateParametersBody.Tag ?? null /* object */; set => _bmcKeySetUpdateParametersBody.Tag = value; } /// The unique list of permitted users. [global::System.Management.Automation.AllowEmptyCollection] @@ -247,32 +259,32 @@ public partial class UpdateAzNetworkCloudBmcKeySet_UpdateExpanded : global::Syst ReadOnly = false, Description = @"The unique list of permitted users.", SerializedName = @"userList", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKeySetUser) })] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKeySetUser[] UserList { get => _bmcKeySetUpdateParametersBody.UserList ?? null /* arrayOf */; set => _bmcKeySetUpdateParametersBody.UserList = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKeySetUser) })] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKeySetUser[] UserList { get => _bmcKeySetUpdateParametersBody.UserList?.ToArray() ?? null /* fixedArrayOf */; set => _bmcKeySetUpdateParametersBody.UserList = (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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IBmcKeySet + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySet /// 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) @@ -386,11 +398,36 @@ 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.NetworkCloud.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -402,10 +439,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -473,7 +526,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -486,12 +539,12 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.BmcKeySetsUpdate(SubscriptionId, ResourceGroupName, ClusterName, Name, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _bmcKeySetUpdateParametersBody, onOk, onDefault, this, Pipeline); + await this.Client.BmcKeySetsUpdate(SubscriptionId, ResourceGroupName, ClusterName, Name, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _bmcKeySetUpdateParametersBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate); await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,ClusterName=ClusterName,Name=Name,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null,body=_bmcKeySetUpdateParametersBody}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,ClusterName=ClusterName,Name=Name,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -511,7 +564,7 @@ protected override void StopProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public UpdateAzNetworkCloudBmcKeySet_UpdateExpanded() { @@ -537,12 +590,12 @@ public UpdateAzNetworkCloudBmcKeySet_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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ) { @@ -559,15 +612,15 @@ public UpdateAzNetworkCloudBmcKeySet_UpdateExpanded() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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, ClusterName=ClusterName, Name=Name, IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, body=_bmcKeySetUpdateParametersBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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, ClusterName=ClusterName, Name=Name, IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, body=_bmcKeySetUpdateParametersBody }) + 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 } }); @@ -577,12 +630,12 @@ public UpdateAzNetworkCloudBmcKeySet_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.NetworkCloud.Models.Api20250201.IBmcKeySet + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySet /// 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 ) { @@ -594,8 +647,9 @@ public UpdateAzNetworkCloudBmcKeySet_UpdateExpanded() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySet - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySet + var result = (await response); + WriteObject(result, false); } } } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudBmcKeySet_UpdateViaIdentityClusterExpanded.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudBmcKeySet_UpdateViaIdentityClusterExpanded.cs new file mode 100644 index 000000000000..a0a3996de8e7 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudBmcKeySet_UpdateViaIdentityClusterExpanded.cs @@ -0,0 +1,638 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; + using System; + + /// + /// Patch properties of baseboard management controller key set for the provided cluster, or update the tags associated with + /// it. Properties and tag update can be done independently. + /// + /// + /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/bmcKeySets/{bmcKeySetName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzNetworkCloudBmcKeySet_UpdateViaIdentityClusterExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySet))] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Patch properties of baseboard management controller key set for the provided cluster, or update the tags associated with it. Properties and tag update can be done independently.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/bmcKeySets/{bmcKeySetName}", ApiVersion = "2025-02-01")] + public partial class UpdateAzNetworkCloudBmcKeySet_UpdateViaIdentityClusterExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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; + + /// + /// BmcKeySetPatchParameters represents the body of the request to patch the baseboard management controller key set. + /// + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetPatchParameters _bmcKeySetUpdateParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BmcKeySetPatchParameters(); + + /// + /// 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(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity _clusterInputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity ClusterInputObject { get => this._clusterInputObject; set => this._clusterInputObject = 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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// + /// The date and time after which the users in this key set will be removed from the baseboard management controllers. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The date and time after which the users in this key set will be removed from the baseboard management controllers.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The date and time after which the users in this key set will be removed from the baseboard management controllers.", + SerializedName = @"expiration", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + public global::System.DateTime Expiration { get => _bmcKeySetUpdateParametersBody.Expiration ?? default(global::System.DateTime); set => _bmcKeySetUpdateParametersBody.Expiration = 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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private string _ifMatch; + + /// + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value + /// to prevent accidentally overwriting concurrent changes. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes.", + SerializedName = @"If-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Header)] + public string IfMatch { get => this._ifMatch; set => this._ifMatch = value; } + + /// Backing field for property. + private string _ifNoneMatch; + + /// + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result + /// in error from server as they are not supported. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result in error from server as they are not supported.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result in error from server as they are not supported.", + SerializedName = @"If-None-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Header)] + public string IfNoneMatch { get => this._ifNoneMatch; set => this._ifNoneMatch = 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.NetworkCloud.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of the baseboard management controller key set. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the baseboard management controller key set.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the baseboard management controller key set.", + SerializedName = @"bmcKeySetName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("BmcKeySetName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// The Azure resource tags that will replace the existing ones. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ExportAs(typeof(global::System.Collections.Hashtable))] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The Azure resource tags that will replace the existing ones.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The Azure resource tags that will replace the existing ones.", + SerializedName = @"tags", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetPatchParametersTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetPatchParametersTags Tag { get => _bmcKeySetUpdateParametersBody.Tag ?? null /* object */; set => _bmcKeySetUpdateParametersBody.Tag = value; } + + /// The unique list of permitted users. + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The unique list of permitted users.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The unique list of permitted users.", + SerializedName = @"userList", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKeySetUser) })] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKeySetUser[] UserList { get => _bmcKeySetUpdateParametersBody.UserList?.ToArray() ?? null /* fixedArrayOf */; set => _bmcKeySetUpdateParametersBody.UserList = (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.NetworkCloud.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.NetworkCloud.Models.IBmcKeySet + /// 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.NetworkCloud.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of UpdateAzNetworkCloudBmcKeySet_UpdateViaIdentityClusterExpanded + /// + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets.UpdateAzNetworkCloudBmcKeySet_UpdateViaIdentityClusterExpanded Clone() + { + var clone = new UpdateAzNetworkCloudBmcKeySet_UpdateViaIdentityClusterExpanded(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone._bmcKeySetUpdateParametersBody = this._bmcKeySetUpdateParametersBody; + clone.IfMatch = this.IfMatch; + clone.IfNoneMatch = this.IfNoneMatch; + clone.Name = this.Name; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'BmcKeySetsUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (ClusterInputObject?.Id != null) + { + this.ClusterInputObject.Id += $"/bmcKeySets/{(global::System.Uri.EscapeDataString(this.Name.ToString()))}"; + await this.Client.BmcKeySetsUpdateViaIdentity(ClusterInputObject.Id, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _bmcKeySetUpdateParametersBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate); + } + else + { + // try to call with PATH parameters from Input Object + if (null == ClusterInputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("ClusterInputObject has null value for ClusterInputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, ClusterInputObject) ); + } + if (null == ClusterInputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("ClusterInputObject has null value for ClusterInputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, ClusterInputObject) ); + } + if (null == ClusterInputObject.ClusterName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("ClusterInputObject has null value for ClusterInputObject.ClusterName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, ClusterInputObject) ); + } + await this.Client.BmcKeySetsUpdate(ClusterInputObject.SubscriptionId ?? null, ClusterInputObject.ResourceGroupName ?? null, ClusterInputObject.ClusterName ?? null, Name, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _bmcKeySetUpdateParametersBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Name=Name,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Initializes a new instance of the cmdlet + /// class. + /// + public UpdateAzNetworkCloudBmcKeySet_UpdateViaIdentityClusterExpanded() + { + + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.IBmcKeySet + /// 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.NetworkCloud.Models.IBmcKeySet + var result = (await response); + WriteObject(result, false); + } + } + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudBmcKeySet_UpdateViaIdentityExpanded.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudBmcKeySet_UpdateViaIdentityExpanded.cs index 1e2555b22b75..187435ec5e2d 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudBmcKeySet_UpdateViaIdentityExpanded.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudBmcKeySet_UpdateViaIdentityExpanded.cs @@ -6,23 +6,25 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// /// Patch properties of baseboard management controller key set for the provided cluster, or update the tags associated with - /// it. Properties and tag updates can be done independently. + /// it. Properties and tag update can be done independently. /// /// /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/bmcKeySets/{bmcKeySetName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzNetworkCloudBmcKeySet_UpdateViaIdentityExpanded", SupportsShouldProcess = true)] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySet", "15.0.0", "2.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"UserList","UserListStatus"}, NewOutputProperties=new string[] {"UserList","UserListStatus"}, ChangeDescription="The types of properties will be changed from fixed array to 'List'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySet))] - [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Patch properties of baseboard management controller key set for the provided cluster, or update the tags associated with it. Properties and tag updates can be done independently.")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySet))] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Patch properties of baseboard management controller key set for the provided cluster, or update the tags associated with it. Properties and tag update can be done independently.")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/bmcKeySets/{bmcKeySetName}", ApiVersion = "2025-02-01")] public partial class UpdateAzNetworkCloudBmcKeySet_UpdateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -36,13 +38,16 @@ public partial class UpdateAzNetworkCloudBmcKeySet_UpdateViaIdentityExpanded : g /// /// BmcKeySetPatchParameters represents the body of the request to patch the baseboard management controller key set. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetPatchParameters _bmcKeySetUpdateParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.BmcKeySetPatchParameters(); + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetPatchParameters _bmcKeySetUpdateParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.BmcKeySetPatchParameters(); /// /// 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(); + /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] @@ -53,6 +58,9 @@ public partial class UpdateAzNetworkCloudBmcKeySet_UpdateViaIdentityExpanded : g [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -79,6 +87,9 @@ public partial class UpdateAzNetworkCloudBmcKeySet_UpdateViaIdentityExpanded : g PossibleTypes = new [] { typeof(global::System.DateTime) })] public global::System.DateTime Expiration { get => _bmcKeySetUpdateParametersBody.Expiration ?? default(global::System.DateTime); set => _bmcKeySetUpdateParametersBody.Expiration = 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] @@ -155,7 +166,7 @@ public partial class UpdateAzNetworkCloudBmcKeySet_UpdateViaIdentityExpanded : g /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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")] @@ -182,8 +193,8 @@ public partial class UpdateAzNetworkCloudBmcKeySet_UpdateViaIdentityExpanded : g ReadOnly = false, Description = @"The Azure resource tags that will replace the existing ones.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetPatchParametersTags) })] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySetPatchParametersTags Tag { get => _bmcKeySetUpdateParametersBody.Tag ?? null /* object */; set => _bmcKeySetUpdateParametersBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetPatchParametersTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySetPatchParametersTags Tag { get => _bmcKeySetUpdateParametersBody.Tag ?? null /* object */; set => _bmcKeySetUpdateParametersBody.Tag = value; } /// The unique list of permitted users. [global::System.Management.Automation.AllowEmptyCollection] @@ -194,32 +205,32 @@ public partial class UpdateAzNetworkCloudBmcKeySet_UpdateViaIdentityExpanded : g ReadOnly = false, Description = @"The unique list of permitted users.", SerializedName = @"userList", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKeySetUser) })] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKeySetUser[] UserList { get => _bmcKeySetUpdateParametersBody.UserList ?? null /* arrayOf */; set => _bmcKeySetUpdateParametersBody.UserList = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKeySetUser) })] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKeySetUser[] UserList { get => _bmcKeySetUpdateParametersBody.UserList?.ToArray() ?? null /* fixedArrayOf */; set => _bmcKeySetUpdateParametersBody.UserList = (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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IBmcKeySet + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySet /// 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) @@ -329,11 +340,36 @@ 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.NetworkCloud.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -345,10 +381,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -416,7 +468,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -431,7 +483,7 @@ protected override void ProcessRecord() await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } if (InputObject?.Id != null) { - await this.Client.BmcKeySetsUpdateViaIdentity(InputObject.Id, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _bmcKeySetUpdateParametersBody, onOk, onDefault, this, Pipeline); + await this.Client.BmcKeySetsUpdateViaIdentity(InputObject.Id, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _bmcKeySetUpdateParametersBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate); } else { @@ -452,13 +504,13 @@ protected override void ProcessRecord() { ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.BmcKeySetName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); } - await this.Client.BmcKeySetsUpdate(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.ClusterName ?? null, InputObject.BmcKeySetName ?? null, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _bmcKeySetUpdateParametersBody, onOk, onDefault, this, Pipeline); + await this.Client.BmcKeySetsUpdate(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.ClusterName ?? null, InputObject.BmcKeySetName ?? null, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _bmcKeySetUpdateParametersBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate); } await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null,body=_bmcKeySetUpdateParametersBody}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -478,7 +530,7 @@ protected override void StopProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public UpdateAzNetworkCloudBmcKeySet_UpdateViaIdentityExpanded() { @@ -504,12 +556,12 @@ public UpdateAzNetworkCloudBmcKeySet_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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ) { @@ -526,15 +578,15 @@ public UpdateAzNetworkCloudBmcKeySet_UpdateViaIdentityExpanded() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, body=_bmcKeySetUpdateParametersBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 { IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, body=_bmcKeySetUpdateParametersBody }) + 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 } }); @@ -544,12 +596,12 @@ public UpdateAzNetworkCloudBmcKeySet_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.NetworkCloud.Models.Api20250201.IBmcKeySet + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySet /// 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 ) { @@ -561,8 +613,9 @@ public UpdateAzNetworkCloudBmcKeySet_UpdateViaIdentityExpanded() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBmcKeySet - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySet + var result = (await response); + WriteObject(result, false); } } } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudBmcKeySet_UpdateViaJsonFilePath.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudBmcKeySet_UpdateViaJsonFilePath.cs new file mode 100644 index 000000000000..0bf7c3818a33 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudBmcKeySet_UpdateViaJsonFilePath.cs @@ -0,0 +1,630 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; + using System; + + /// + /// Patch properties of baseboard management controller key set for the provided cluster, or update the tags associated with + /// it. Properties and tag update can be done independently. + /// + /// + /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/bmcKeySets/{bmcKeySetName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzNetworkCloudBmcKeySet_UpdateViaJsonFilePath", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySet))] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Patch properties of baseboard management controller key set for the provided cluster, or update the tags associated with it. Properties and tag update can be done independently.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/bmcKeySets/{bmcKeySetName}", ApiVersion = "2025-02-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.NotSuggestDefaultParameterSet] + public partial class UpdateAzNetworkCloudBmcKeySet_UpdateViaJsonFilePath : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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(); + + public global::System.String _jsonString; + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; + + /// Backing field for property. + private string _clusterName; + + /// The name of the cluster. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the cluster.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the cluster.", + SerializedName = @"clusterName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] + public string ClusterName { get => this._clusterName; set => this._clusterName = 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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private string _ifMatch; + + /// + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value + /// to prevent accidentally overwriting concurrent changes. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes.", + SerializedName = @"If-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Header)] + public string IfMatch { get => this._ifMatch; set => this._ifMatch = value; } + + /// Backing field for property. + private string _ifNoneMatch; + + /// + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result + /// in error from server as they are not supported. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result in error from server as they are not supported.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result in error from server as they are not supported.", + SerializedName = @"If-None-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Header)] + public string IfNoneMatch { get => this._ifNoneMatch; set => this._ifNoneMatch = 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 _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.NetworkCloud.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.NetworkCloud.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of the baseboard management controller key set. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the baseboard management controller key set.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the baseboard management controller key set.", + SerializedName = @"bmcKeySetName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("BmcKeySetName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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. The value must be an UUID. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription. The value must be an UUID.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription. The value must be an UUID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.IBmcKeySet + /// 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.NetworkCloud.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of UpdateAzNetworkCloudBmcKeySet_UpdateViaJsonFilePath + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets.UpdateAzNetworkCloudBmcKeySet_UpdateViaJsonFilePath Clone() + { + var clone = new UpdateAzNetworkCloudBmcKeySet_UpdateViaJsonFilePath(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.ClusterName = this.ClusterName; + clone.Name = this.Name; + clone.IfMatch = this.IfMatch; + clone.IfNoneMatch = this.IfNoneMatch; + clone.JsonFilePath = this.JsonFilePath; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'BmcKeySetsUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.BmcKeySetsUpdateViaJsonString(SubscriptionId, ResourceGroupName, ClusterName, Name, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _jsonString, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,ClusterName=ClusterName,Name=Name,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public UpdateAzNetworkCloudBmcKeySet_UpdateViaJsonFilePath() + { + + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.IBmcKeySet + /// 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.NetworkCloud.Models.IBmcKeySet + var result = (await response); + WriteObject(result, false); + } + } + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudBmcKeySet_UpdateViaJsonString.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudBmcKeySet_UpdateViaJsonString.cs new file mode 100644 index 000000000000..32c30c880cdb --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudBmcKeySet_UpdateViaJsonString.cs @@ -0,0 +1,628 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; + using System; + + /// + /// Patch properties of baseboard management controller key set for the provided cluster, or update the tags associated with + /// it. Properties and tag update can be done independently. + /// + /// + /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/bmcKeySets/{bmcKeySetName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzNetworkCloudBmcKeySet_UpdateViaJsonString", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBmcKeySet))] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Patch properties of baseboard management controller key set for the provided cluster, or update the tags associated with it. Properties and tag update can be done independently.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/bmcKeySets/{bmcKeySetName}", ApiVersion = "2025-02-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.NotSuggestDefaultParameterSet] + public partial class UpdateAzNetworkCloudBmcKeySet_UpdateViaJsonString : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; + + /// Backing field for property. + private string _clusterName; + + /// The name of the cluster. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the cluster.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the cluster.", + SerializedName = @"clusterName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] + public string ClusterName { get => this._clusterName; set => this._clusterName = 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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private string _ifMatch; + + /// + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value + /// to prevent accidentally overwriting concurrent changes. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes.", + SerializedName = @"If-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Header)] + public string IfMatch { get => this._ifMatch; set => this._ifMatch = value; } + + /// Backing field for property. + private string _ifNoneMatch; + + /// + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result + /// in error from server as they are not supported. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result in error from server as they are not supported.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result in error from server as they are not supported.", + SerializedName = @"If-None-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Header)] + public string IfNoneMatch { get => this._ifNoneMatch; set => this._ifNoneMatch = 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.NetworkCloud.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.NetworkCloud.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of the baseboard management controller key set. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the baseboard management controller key set.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the baseboard management controller key set.", + SerializedName = @"bmcKeySetName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("BmcKeySetName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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. The value must be an UUID. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription. The value must be an UUID.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription. The value must be an UUID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.IBmcKeySet + /// 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.NetworkCloud.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of UpdateAzNetworkCloudBmcKeySet_UpdateViaJsonString + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets.UpdateAzNetworkCloudBmcKeySet_UpdateViaJsonString Clone() + { + var clone = new UpdateAzNetworkCloudBmcKeySet_UpdateViaJsonString(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.ClusterName = this.ClusterName; + clone.Name = this.Name; + clone.IfMatch = this.IfMatch; + clone.IfNoneMatch = this.IfNoneMatch; + clone.JsonString = this.JsonString; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'BmcKeySetsUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.BmcKeySetsUpdateViaJsonString(SubscriptionId, ResourceGroupName, ClusterName, Name, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _jsonString, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,ClusterName=ClusterName,Name=Name,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public UpdateAzNetworkCloudBmcKeySet_UpdateViaJsonString() + { + + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.IBmcKeySet + /// 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.NetworkCloud.Models.IBmcKeySet + var result = (await response); + WriteObject(result, false); + } + } + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudClusterManager_UpdateExpanded.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudClusterManager_UpdateExpanded.cs index 94b42727061b..6006c95a3878 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudClusterManager_UpdateExpanded.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudClusterManager_UpdateExpanded.cs @@ -6,23 +6,24 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// - /// Patch properties of the provided cluster manager, or update the tags assigned to the cluster manager. Properties and tag - /// updates can be done independently. + /// update a new cluster manager or update properties of the cluster manager if it exists. /// /// - /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusterManagers/{clusterManagerName}" + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusterManagers/{clusterManagerName}" + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusterManagers/{clusterManagerName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzNetworkCloudClusterManager_UpdateExpanded", SupportsShouldProcess = true)] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManager", "15.0.0", "2.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"AvailabilityZone","ClusterVersion"}, NewOutputProperties=new string[] {"AvailabilityZone","ClusterVersion"}, ChangeDescription="The types of properties will be changed from fixed array to 'List'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManager))] - [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Patch properties of the provided cluster manager, or update the tags assigned to the cluster manager. Properties and tag updates can be done independently.")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManager))] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"update a new cluster manager or update properties of the cluster manager if it exists.")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusterManagers/{clusterManagerName}", ApiVersion = "2025-02-01")] public partial class UpdateAzNetworkCloudClusterManager_UpdateExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -39,15 +40,26 @@ public partial class UpdateAzNetworkCloudClusterManager_UpdateExpanded : global: private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); /// - /// ClusterManagerPatchParameters represents the body of the request to patch the cluster properties. + /// ClusterManager represents a control-plane to manage one or more on-premises clusters. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerPatchParameters _clusterManagerUpdateParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ClusterManagerPatchParameters(); + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManager _clusterManagerParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterManager(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } /// Wait for .NET debugger to attach [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -61,6 +73,13 @@ public partial class UpdateAzNetworkCloudClusterManager_UpdateExpanded : global: [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// 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 System.Boolean? EnableSystemAssignedIdentity { 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] @@ -73,36 +92,6 @@ public partial class UpdateAzNetworkCloudClusterManager_UpdateExpanded : global: [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Support.ManagedServiceIdentityType) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentityType))] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentityType IdentityType { get => _clusterManagerUpdateParametersBody.IdentityType ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentityType)""); set => _clusterManagerUpdateParametersBody.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.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api50.IUserAssignedIdentities) })] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IUserAssignedIdentities IdentityUserAssignedIdentity { get => _clusterManagerUpdateParametersBody.IdentityUserAssignedIdentity ?? null /* object */; set => _clusterManagerUpdateParametersBody.IdentityUserAssignedIdentity = value; } - /// Backing field for property. private string _ifMatch; @@ -163,10 +152,18 @@ public partial class UpdateAzNetworkCloudClusterManager_UpdateExpanded : global: [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] public string Name { get => this._name; set => this._name = value; } + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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")] @@ -212,45 +209,54 @@ public partial class UpdateAzNetworkCloudClusterManager_UpdateExpanded : global: [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } - /// The Azure resource tags that will replace the existing ones. + /// Resource tags. [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ExportAs(typeof(global::System.Collections.Hashtable))] - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The Azure resource tags that will replace the existing ones.")] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Resource tags.")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Body)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = false, ReadOnly = false, - Description = @"The Azure resource tags that will replace the existing ones.", + Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerPatchParametersTags) })] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerPatchParametersTags Tag { get => _clusterManagerUpdateParametersBody.Tag ?? null /* object */; set => _clusterManagerUpdateParametersBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceTags Tag { get => _clusterManagerParametersBody.Tag ?? null /* object */; set => _clusterManagerParametersBody.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; } /// /// 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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IClusterManager + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManager /// 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) @@ -270,6 +276,32 @@ protected override void BeginProcessing() ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of UpdateAzNetworkCloudClusterManager_UpdateExpanded + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets.UpdateAzNetworkCloudClusterManager_UpdateExpanded Clone() + { + var clone = new UpdateAzNetworkCloudClusterManager_UpdateExpanded(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone._clusterManagerParametersBody = this._clusterManagerParametersBody; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.Name = this.Name; + clone.IfMatch = this.IfMatch; + clone.IfNoneMatch = this.IfNoneMatch; + return clone; + } + /// Performs clean-up after the command execution protected override void EndProcessing() { @@ -323,8 +355,8 @@ protected override void EndProcessing() } case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Information: { - var data = messageData(); - WriteInformation(data.Message, new string[]{}); + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); return ; } case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Debug: @@ -337,8 +369,67 @@ 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.NetworkCloud.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } } - await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -347,6 +438,44 @@ protected override void EndProcessing() } } + private void PreProcessManagedIdentityParametersWithGetResult() + { + bool supportsSystemAssignedIdentity = (true == this.EnableSystemAssignedIdentity || null == this.EnableSystemAssignedIdentity && true == _clusterManagerParametersBody?.IdentityType?.Contains("SystemAssigned")); + bool supportsUserAssignedIdentity = false; + if (this.UserAssignedIdentity?.Length > 0) + { + // calculate UserAssignedIdentity + _clusterManagerParametersBody.IdentityUserAssignedIdentity.Clear(); + foreach( var id in this.UserAssignedIdentity ) + { + _clusterManagerParametersBody.IdentityUserAssignedIdentity.Add(id, new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.UserAssignedIdentity()); + } + } + supportsUserAssignedIdentity = true == this.MyInvocation?.BoundParameters?.ContainsKey("UserAssignedIdentity") && this.UserAssignedIdentity?.Length > 0 || + true != this.MyInvocation?.BoundParameters?.ContainsKey("UserAssignedIdentity") && true == _clusterManagerParametersBody.IdentityType?.Contains("UserAssigned"); + if (!supportsUserAssignedIdentity) + { + _clusterManagerParametersBody.IdentityUserAssignedIdentity = null; + } + // calculate IdentityType + if ((supportsUserAssignedIdentity && supportsSystemAssignedIdentity)) + { + _clusterManagerParametersBody.IdentityType = "SystemAssigned,UserAssigned"; + } + else if ((supportsUserAssignedIdentity && !supportsSystemAssignedIdentity)) + { + _clusterManagerParametersBody.IdentityType = "UserAssigned"; + } + else if ((!supportsUserAssignedIdentity && supportsSystemAssignedIdentity)) + { + _clusterManagerParametersBody.IdentityType = "SystemAssigned"; + } + else + { + _clusterManagerParametersBody.IdentityType = "None"; + } + } + /// Performs execution of the command. protected override void ProcessRecord() { @@ -355,11 +484,23 @@ protected override void ProcessRecord() try { // work - if (ShouldProcess($"Call remote 'ClusterManagersUpdate' operation")) + if (ShouldProcess($"Call remote 'ClusterManagersCreateOrUpdate' operation")) { - using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token) ) + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) { - asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token); + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token); + } } } } @@ -394,7 +535,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -407,12 +548,15 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.ClusterManagersUpdate(SubscriptionId, ResourceGroupName, Name, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _clusterManagerUpdateParametersBody, onOk, onDefault, this, Pipeline); + _clusterManagerParametersBody = await this.Client.ClusterManagersGetWithResult(SubscriptionId, ResourceGroupName, Name, this, Pipeline); + this.PreProcessManagedIdentityParametersWithGetResult(); + this.Update_clusterManagerParametersBody(); + await this.Client.ClusterManagersCreateOrUpdate(SubscriptionId, ResourceGroupName, Name, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _clusterManagerParametersBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate); await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null,body=_clusterManagerUpdateParametersBody}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -432,13 +576,21 @@ protected override void StopProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public UpdateAzNetworkCloudClusterManager_UpdateExpanded() { } + private void Update_clusterManagerParametersBody() + { + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("Tag"))) + { + this.Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceTags)(this.MyInvocation?.BoundParameters["Tag"]); + } + } + /// new protected void WriteObject(object sendToPipeline) { @@ -458,12 +610,12 @@ public UpdateAzNetworkCloudClusterManager_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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ) { @@ -480,15 +632,15 @@ public UpdateAzNetworkCloudClusterManager_UpdateExpanded() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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, IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, body=_clusterManagerUpdateParametersBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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, IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, body=_clusterManagerUpdateParametersBody }) + 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 } }); @@ -498,12 +650,12 @@ public UpdateAzNetworkCloudClusterManager_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.NetworkCloud.Models.Api20250201.IClusterManager + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManager /// 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 ) { @@ -515,8 +667,9 @@ public UpdateAzNetworkCloudClusterManager_UpdateExpanded() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManager - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManager + var result = (await response); + WriteObject(result, false); } } } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudClusterManager_UpdateViaIdentityExpanded.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudClusterManager_UpdateViaIdentityExpanded.cs index e2f51a77078f..677ef10f310b 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudClusterManager_UpdateViaIdentityExpanded.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudClusterManager_UpdateViaIdentityExpanded.cs @@ -6,23 +6,24 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// - /// Patch properties of the provided cluster manager, or update the tags assigned to the cluster manager. Properties and tag - /// updates can be done independently. + /// update a new cluster manager or update properties of the cluster manager if it exists. /// /// - /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusterManagers/{clusterManagerName}" + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusterManagers/{clusterManagerName}" + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusterManagers/{clusterManagerName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzNetworkCloudClusterManager_UpdateViaIdentityExpanded", SupportsShouldProcess = true)] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManager", "15.0.0", "2.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"AvailabilityZone","ClusterVersion"}, NewOutputProperties=new string[] {"AvailabilityZone","ClusterVersion"}, ChangeDescription="The types of properties will be changed from fixed array to 'List'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManager))] - [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Patch properties of the provided cluster manager, or update the tags assigned to the cluster manager. Properties and tag updates can be done independently.")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManager))] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"update a new cluster manager or update properties of the cluster manager if it exists.")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusterManagers/{clusterManagerName}", ApiVersion = "2025-02-01")] public partial class UpdateAzNetworkCloudClusterManager_UpdateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -39,15 +40,26 @@ public partial class UpdateAzNetworkCloudClusterManager_UpdateViaIdentityExpande private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); /// - /// ClusterManagerPatchParameters represents the body of the request to patch the cluster properties. + /// ClusterManager represents a control-plane to manage one or more on-premises clusters. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerPatchParameters _clusterManagerUpdateParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ClusterManagerPatchParameters(); + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManager _clusterManagerParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterManager(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } /// Wait for .NET debugger to attach [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -61,6 +73,13 @@ public partial class UpdateAzNetworkCloudClusterManager_UpdateViaIdentityExpande [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// 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 System.Boolean? EnableSystemAssignedIdentity { 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] @@ -73,36 +92,6 @@ public partial class UpdateAzNetworkCloudClusterManager_UpdateViaIdentityExpande [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Support.ManagedServiceIdentityType) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentityType))] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentityType IdentityType { get => _clusterManagerUpdateParametersBody.IdentityType ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentityType)""); set => _clusterManagerUpdateParametersBody.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.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api50.IUserAssignedIdentities) })] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IUserAssignedIdentities IdentityUserAssignedIdentity { get => _clusterManagerUpdateParametersBody.IdentityUserAssignedIdentity ?? null /* object */; set => _clusterManagerUpdateParametersBody.IdentityUserAssignedIdentity = value; } - /// Backing field for property. private string _ifMatch; @@ -156,10 +145,18 @@ public partial class UpdateAzNetworkCloudClusterManager_UpdateViaIdentityExpande /// cancellation token. global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,41 +174,49 @@ public partial class UpdateAzNetworkCloudClusterManager_UpdateViaIdentityExpande [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } - /// The Azure resource tags that will replace the existing ones. + /// Resource tags. [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ExportAs(typeof(global::System.Collections.Hashtable))] - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The Azure resource tags that will replace the existing ones.")] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Resource tags.")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Body)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = false, ReadOnly = false, - Description = @"The Azure resource tags that will replace the existing ones.", + Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerPatchParametersTags) })] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManagerPatchParametersTags Tag { get => _clusterManagerUpdateParametersBody.Tag ?? null /* object */; set => _clusterManagerUpdateParametersBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceTags Tag { get => _clusterManagerParametersBody.Tag ?? null /* object */; set => _clusterManagerParametersBody.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; } /// /// 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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IClusterManager + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManager /// 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) @@ -231,6 +236,31 @@ protected override void BeginProcessing() ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of UpdateAzNetworkCloudClusterManager_UpdateViaIdentityExpanded + /// + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets.UpdateAzNetworkCloudClusterManager_UpdateViaIdentityExpanded Clone() + { + var clone = new UpdateAzNetworkCloudClusterManager_UpdateViaIdentityExpanded(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone._clusterManagerParametersBody = this._clusterManagerParametersBody; + clone.IfMatch = this.IfMatch; + clone.IfNoneMatch = this.IfNoneMatch; + return clone; + } + /// Performs clean-up after the command execution protected override void EndProcessing() { @@ -284,8 +314,8 @@ protected override void EndProcessing() } case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Information: { - var data = messageData(); - WriteInformation(data.Message, new string[]{}); + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); return ; } case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Debug: @@ -298,8 +328,67 @@ 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.NetworkCloud.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } } - await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -308,6 +397,44 @@ protected override void EndProcessing() } } + private void PreProcessManagedIdentityParametersWithGetResult() + { + bool supportsSystemAssignedIdentity = (true == this.EnableSystemAssignedIdentity || null == this.EnableSystemAssignedIdentity && true == _clusterManagerParametersBody?.IdentityType?.Contains("SystemAssigned")); + bool supportsUserAssignedIdentity = false; + if (this.UserAssignedIdentity?.Length > 0) + { + // calculate UserAssignedIdentity + _clusterManagerParametersBody.IdentityUserAssignedIdentity.Clear(); + foreach( var id in this.UserAssignedIdentity ) + { + _clusterManagerParametersBody.IdentityUserAssignedIdentity.Add(id, new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.UserAssignedIdentity()); + } + } + supportsUserAssignedIdentity = true == this.MyInvocation?.BoundParameters?.ContainsKey("UserAssignedIdentity") && this.UserAssignedIdentity?.Length > 0 || + true != this.MyInvocation?.BoundParameters?.ContainsKey("UserAssignedIdentity") && true == _clusterManagerParametersBody.IdentityType?.Contains("UserAssigned"); + if (!supportsUserAssignedIdentity) + { + _clusterManagerParametersBody.IdentityUserAssignedIdentity = null; + } + // calculate IdentityType + if ((supportsUserAssignedIdentity && supportsSystemAssignedIdentity)) + { + _clusterManagerParametersBody.IdentityType = "SystemAssigned,UserAssigned"; + } + else if ((supportsUserAssignedIdentity && !supportsSystemAssignedIdentity)) + { + _clusterManagerParametersBody.IdentityType = "UserAssigned"; + } + else if ((!supportsUserAssignedIdentity && supportsSystemAssignedIdentity)) + { + _clusterManagerParametersBody.IdentityType = "SystemAssigned"; + } + else + { + _clusterManagerParametersBody.IdentityType = "None"; + } + } + /// Performs execution of the command. protected override void ProcessRecord() { @@ -316,11 +443,23 @@ protected override void ProcessRecord() try { // work - if (ShouldProcess($"Call remote 'ClusterManagersUpdate' operation")) + if (ShouldProcess($"Call remote 'ClusterManagersCreateOrUpdate' operation")) { - using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token) ) + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) { - asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token); + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token); + } } } } @@ -355,7 +494,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -370,7 +509,10 @@ protected override void ProcessRecord() await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } if (InputObject?.Id != null) { - await this.Client.ClusterManagersUpdateViaIdentity(InputObject.Id, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _clusterManagerUpdateParametersBody, onOk, onDefault, this, Pipeline); + _clusterManagerParametersBody = await this.Client.ClusterManagersGetViaIdentityWithResult(InputObject.Id, this, Pipeline); + this.PreProcessManagedIdentityParametersWithGetResult(); + this.Update_clusterManagerParametersBody(); + await this.Client.ClusterManagersCreateOrUpdateViaIdentity(InputObject.Id, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _clusterManagerParametersBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate); } else { @@ -387,13 +529,16 @@ protected override void ProcessRecord() { ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ClusterManagerName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); } - await this.Client.ClusterManagersUpdate(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.ClusterManagerName ?? null, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _clusterManagerUpdateParametersBody, onOk, onDefault, this, Pipeline); + _clusterManagerParametersBody = await this.Client.ClusterManagersGetWithResult(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.ClusterManagerName ?? null, this, Pipeline); + this.PreProcessManagedIdentityParametersWithGetResult(); + this.Update_clusterManagerParametersBody(); + await this.Client.ClusterManagersCreateOrUpdate(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.ClusterManagerName ?? null, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _clusterManagerParametersBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate); } await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null,body=_clusterManagerUpdateParametersBody}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -413,13 +558,21 @@ protected override void StopProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public UpdateAzNetworkCloudClusterManager_UpdateViaIdentityExpanded() { } + private void Update_clusterManagerParametersBody() + { + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("Tag"))) + { + this.Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceTags)(this.MyInvocation?.BoundParameters["Tag"]); + } + } + /// new protected void WriteObject(object sendToPipeline) { @@ -439,12 +592,12 @@ public UpdateAzNetworkCloudClusterManager_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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ) { @@ -461,15 +614,15 @@ public UpdateAzNetworkCloudClusterManager_UpdateViaIdentityExpanded() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, body=_clusterManagerUpdateParametersBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 { IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, body=_clusterManagerUpdateParametersBody }) + 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 } }); @@ -479,12 +632,12 @@ public UpdateAzNetworkCloudClusterManager_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.NetworkCloud.Models.Api20250201.IClusterManager + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManager /// 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 ) { @@ -496,8 +649,9 @@ public UpdateAzNetworkCloudClusterManager_UpdateViaIdentityExpanded() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterManager - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterManager + var result = (await response); + WriteObject(result, false); } } } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudCluster_UpdateExpanded.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudCluster_UpdateExpanded.cs index 2c651cb4dbe3..4fae5608136b 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudCluster_UpdateExpanded.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudCluster_UpdateExpanded.cs @@ -6,23 +6,22 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; - /// - /// Patch the properties of the provided cluster, or update the tags associated with the cluster. Properties and tag updates - /// can be done independently. - /// + /// update a new cluster or update the properties of the cluster if it exists. /// - /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}" + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}" + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzNetworkCloudCluster_UpdateExpanded", SupportsShouldProcess = true)] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICluster", "15.0.0", "2.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"AggregatorOrSingleRackDefinitionBareMetalMachineConfigurationData","AggregatorOrSingleRackDefinitionStorageApplianceConfigurationData","AvailableUpgradeVersion","ComputeRackDefinition","WorkloadResourceId"}, NewOutputProperties=new string[] {"AggregatorOrSingleRackDefinitionBareMetalMachineConfigurationData","AggregatorOrSingleRackDefinitionStorageApplianceConfigurationData","AvailableUpgradeVersion","ComputeRackDefinition","WorkloadResourceId"}, ChangeDescription="The types of properties will be changed from fixed array to 'List'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICluster))] - [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Patch the properties of the provided cluster, or update the tags associated with the cluster. Properties and tag updates can be done independently.")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICluster))] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"update a new cluster or update the properties of the cluster if it exists.")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}", ApiVersion = "2025-02-01")] public partial class UpdateAzNetworkCloudCluster_UpdateExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -38,10 +37,11 @@ public partial class UpdateAzNetworkCloudCluster_UpdateExpanded : global::System /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); - /// - /// ClusterPatchParameters represents the body of the request to patch the cluster properties. - /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParameters _clusterUpdateParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ClusterPatchParameters(); + /// Cluster represents the on-premises Network Cloud cluster. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICluster _clusterParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Cluster(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); /// /// The zone name used for this rack when created. Availability zones are used for workload placement. @@ -54,7 +54,7 @@ public partial class UpdateAzNetworkCloudCluster_UpdateExpanded : global::System Description = @"The zone name used for this rack when created. Availability zones are used for workload placement.", SerializedName = @"availabilityZone", PossibleTypes = new [] { typeof(string) })] - public string AggregatorOrSingleRackDefinitionAvailabilityZone { get => _clusterUpdateParametersBody.AggregatorOrSingleRackDefinitionAvailabilityZone ?? null; set => _clusterUpdateParametersBody.AggregatorOrSingleRackDefinitionAvailabilityZone = value; } + public string AggregatorOrSingleRackDefinitionAvailabilityZone { get => _clusterParametersBody.AggregatorOrSingleRackDefinitionAvailabilityZone ?? null; set => _clusterParametersBody.AggregatorOrSingleRackDefinitionAvailabilityZone = value; } /// The unordered list of bare metal machine configuration. [global::System.Management.Automation.AllowEmptyCollection] @@ -65,8 +65,8 @@ public partial class UpdateAzNetworkCloudCluster_UpdateExpanded : global::System ReadOnly = false, Description = @"The unordered list of bare metal machine configuration.", SerializedName = @"bareMetalMachineConfigurationData", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineConfigurationData) })] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineConfigurationData[] AggregatorOrSingleRackDefinitionBareMetalMachineConfiguration { get => _clusterUpdateParametersBody.AggregatorOrSingleRackDefinitionBareMetalMachineConfigurationData ?? null /* arrayOf */; set => _clusterUpdateParametersBody.AggregatorOrSingleRackDefinitionBareMetalMachineConfigurationData = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineConfigurationData) })] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineConfigurationData[] AggregatorOrSingleRackDefinitionBareMetalMachineConfiguration { get => _clusterParametersBody.AggregatorOrSingleRackDefinitionBareMetalMachineConfigurationData?.ToArray() ?? null /* fixedArrayOf */; set => _clusterParametersBody.AggregatorOrSingleRackDefinitionBareMetalMachineConfigurationData = (value != null ? new System.Collections.Generic.List(value) : null); } /// The resource ID of the network rack that matches this rack definition. [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The resource ID of the network rack that matches this rack definition.")] @@ -77,7 +77,7 @@ public partial class UpdateAzNetworkCloudCluster_UpdateExpanded : global::System Description = @"The resource ID of the network rack that matches this rack definition.", SerializedName = @"networkRackId", PossibleTypes = new [] { typeof(string) })] - public string AggregatorOrSingleRackDefinitionNetworkRackId { get => _clusterUpdateParametersBody.AggregatorOrSingleRackDefinitionNetworkRackId ?? null; set => _clusterUpdateParametersBody.AggregatorOrSingleRackDefinitionNetworkRackId = value; } + public string AggregatorOrSingleRackDefinitionNetworkRackId { get => _clusterParametersBody.AggregatorOrSingleRackDefinitionNetworkRackId ?? null; set => _clusterParametersBody.AggregatorOrSingleRackDefinitionNetworkRackId = value; } /// The free-form description of the rack's location. [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The free-form description of the rack's location.")] @@ -88,7 +88,7 @@ public partial class UpdateAzNetworkCloudCluster_UpdateExpanded : global::System Description = @"The free-form description of the rack's location.", SerializedName = @"rackLocation", PossibleTypes = new [] { typeof(string) })] - public string AggregatorOrSingleRackDefinitionRackLocation { get => _clusterUpdateParametersBody.AggregatorOrSingleRackDefinitionRackLocation ?? null; set => _clusterUpdateParametersBody.AggregatorOrSingleRackDefinitionRackLocation = value; } + public string AggregatorOrSingleRackDefinitionRackLocation { get => _clusterParametersBody.AggregatorOrSingleRackDefinitionRackLocation ?? null; set => _clusterParametersBody.AggregatorOrSingleRackDefinitionRackLocation = value; } /// /// The unique identifier for the rack within Network Cloud cluster. An alternate unique alphanumeric value other than a serial @@ -102,7 +102,7 @@ public partial class UpdateAzNetworkCloudCluster_UpdateExpanded : global::System Description = @"The unique identifier for the rack within Network Cloud cluster. An alternate unique alphanumeric value other than a serial number may be provided if desired.", SerializedName = @"rackSerialNumber", PossibleTypes = new [] { typeof(string) })] - public string AggregatorOrSingleRackDefinitionRackSerialNumber { get => _clusterUpdateParametersBody.AggregatorOrSingleRackDefinitionRackSerialNumber ?? null; set => _clusterUpdateParametersBody.AggregatorOrSingleRackDefinitionRackSerialNumber = value; } + public string AggregatorOrSingleRackDefinitionRackSerialNumber { get => _clusterParametersBody.AggregatorOrSingleRackDefinitionRackSerialNumber ?? null; set => _clusterParametersBody.AggregatorOrSingleRackDefinitionRackSerialNumber = value; } /// The resource ID of the sku for the rack being added. [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The resource ID of the sku for the rack being added.")] @@ -113,7 +113,7 @@ public partial class UpdateAzNetworkCloudCluster_UpdateExpanded : global::System Description = @"The resource ID of the sku for the rack being added.", SerializedName = @"rackSkuId", PossibleTypes = new [] { typeof(string) })] - public string AggregatorOrSingleRackDefinitionRackSkuId { get => _clusterUpdateParametersBody.AggregatorOrSingleRackDefinitionRackSkuId ?? null; set => _clusterUpdateParametersBody.AggregatorOrSingleRackDefinitionRackSkuId = value; } + public string AggregatorOrSingleRackDefinitionRackSkuId { get => _clusterParametersBody.AggregatorOrSingleRackDefinitionRackSkuId ?? null; set => _clusterParametersBody.AggregatorOrSingleRackDefinitionRackSkuId = value; } /// The list of storage appliance configuration data for this rack. [global::System.Management.Automation.AllowEmptyCollection] @@ -124,8 +124,8 @@ public partial class UpdateAzNetworkCloudCluster_UpdateExpanded : global::System ReadOnly = false, Description = @"The list of storage appliance configuration data for this rack.", SerializedName = @"storageApplianceConfigurationData", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceConfigurationData) })] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceConfigurationData[] AggregatorOrSingleRackDefinitionStorageApplianceConfiguration { get => _clusterUpdateParametersBody.AggregatorOrSingleRackDefinitionStorageApplianceConfigurationData ?? null /* arrayOf */; set => _clusterUpdateParametersBody.AggregatorOrSingleRackDefinitionStorageApplianceConfigurationData = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceConfigurationData) })] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceConfigurationData[] AggregatorOrSingleRackDefinitionStorageApplianceConfiguration { get => _clusterParametersBody.AggregatorOrSingleRackDefinitionStorageApplianceConfigurationData?.ToArray() ?? null /* fixedArrayOf */; set => _clusterParametersBody.AggregatorOrSingleRackDefinitionStorageApplianceConfigurationData = (value != null ? new System.Collections.Generic.List(value) : null); } /// /// The resource ID of the analytics workspace that is to be used by the specified identity. @@ -138,7 +138,7 @@ public partial class UpdateAzNetworkCloudCluster_UpdateExpanded : global::System Description = @"The resource ID of the analytics workspace that is to be used by the specified identity.", SerializedName = @"analyticsWorkspaceId", PossibleTypes = new [] { typeof(string) })] - public string AnalyticOutputSettingAnalyticsWorkspaceId { get => _clusterUpdateParametersBody.AnalyticOutputSettingAnalyticsWorkspaceId ?? null; set => _clusterUpdateParametersBody.AnalyticOutputSettingAnalyticsWorkspaceId = value; } + public string AnalyticOutputSettingAnalyticsWorkspaceId { get => _clusterParametersBody.AnalyticOutputSettingAnalyticsWorkspaceId ?? null; set => _clusterParametersBody.AnalyticOutputSettingAnalyticsWorkspaceId = value; } /// The type of managed identity that is being selected. [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The type of managed identity that is being selected.")] @@ -148,9 +148,9 @@ public partial class UpdateAzNetworkCloudCluster_UpdateExpanded : global::System ReadOnly = false, Description = @"The type of managed identity that is being selected.", SerializedName = @"identityType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType))] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType AnalyticsOutputSettingsAssociatedIdentityType { get => _clusterUpdateParametersBody.AnalyticsOutputSettingsAssociatedIdentityType ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType)""); set => _clusterUpdateParametersBody.AnalyticsOutputSettingsAssociatedIdentityType = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("SystemAssignedIdentity", "UserAssignedIdentity")] + public string AnalyticsOutputSettingsAssociatedIdentityType { get => _clusterParametersBody.AnalyticsOutputSettingsAssociatedIdentityType ?? null; set => _clusterParametersBody.AnalyticsOutputSettingsAssociatedIdentityType = value; } /// /// The user assigned managed identity resource ID to use. Mutually exclusive with a system assigned identity type. @@ -163,7 +163,7 @@ public partial class UpdateAzNetworkCloudCluster_UpdateExpanded : global::System Description = @"The user assigned managed identity resource ID to use. Mutually exclusive with a system assigned identity type.", SerializedName = @"userAssignedIdentityResourceId", PossibleTypes = new [] { typeof(string) })] - public string AnalyticsOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId { get => _clusterUpdateParametersBody.AnalyticsOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId ?? null; set => _clusterUpdateParametersBody.AnalyticsOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId = value; } + public string AnalyticsOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId { get => _clusterParametersBody.AnalyticsOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId ?? null; set => _clusterParametersBody.AnalyticsOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId = value; } /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] @@ -178,9 +178,9 @@ public partial class UpdateAzNetworkCloudCluster_UpdateExpanded : global::System ReadOnly = false, Description = @"The type of associated identity for CommandOutputSettings.", SerializedName = @"identityType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType))] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType AssociatedIdentityType { get => _clusterUpdateParametersBody.CommandOutputSettingsAssociatedIdentityType ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType)""); set => _clusterUpdateParametersBody.CommandOutputSettingsAssociatedIdentityType = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("SystemAssignedIdentity", "UserAssignedIdentity")] + public string AssociatedIdentityType { get => _clusterParametersBody.AssociatedIdentityType ?? null; set => _clusterParametersBody.AssociatedIdentityType = value; } /// The resource ID of the user assigned identity for CommandOutputSettings. [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The resource ID of the user assigned identity for CommandOutputSettings.")] @@ -191,13 +191,16 @@ public partial class UpdateAzNetworkCloudCluster_UpdateExpanded : global::System Description = @"The resource ID of the user assigned identity for CommandOutputSettings.", SerializedName = @"userAssignedIdentityResourceId", PossibleTypes = new [] { typeof(string) })] - public string AssociatedIdentityUserAssignedIdentityResourceId { get => _clusterUpdateParametersBody.CommandOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId ?? null; set => _clusterUpdateParametersBody.CommandOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId = value; } + public string AssociatedIdentityUserAssignedIdentityResourceId { get => _clusterParametersBody.AssociatedIdentityUserAssignedIdentityResourceId ?? null; set => _clusterParametersBody.AssociatedIdentityUserAssignedIdentityResourceId = 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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -212,7 +215,7 @@ public partial class UpdateAzNetworkCloudCluster_UpdateExpanded : global::System Description = @"The customer-provided location information to identify where the cluster resides.", SerializedName = @"clusterLocation", PossibleTypes = new [] { typeof(string) })] - public string ClusterLocation { get => _clusterUpdateParametersBody.ClusterLocation ?? null; set => _clusterUpdateParametersBody.ClusterLocation = value; } + public string ClusterLocation { get => _clusterParametersBody.ClusterLocation ?? null; set => _clusterParametersBody.ClusterLocation = value; } /// The application ID, also known as client ID, of the service principal. [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The application ID, also known as client ID, of the service principal.")] @@ -223,7 +226,7 @@ public partial class UpdateAzNetworkCloudCluster_UpdateExpanded : global::System Description = @"The application ID, also known as client ID, of the service principal.", SerializedName = @"applicationId", PossibleTypes = new [] { typeof(string) })] - public string ClusterServicePrincipalApplicationId { get => _clusterUpdateParametersBody.ClusterServicePrincipalApplicationId ?? null; set => _clusterUpdateParametersBody.ClusterServicePrincipalApplicationId = value; } + public string ClusterServicePrincipalApplicationId { get => _clusterParametersBody.ServicePrincipalApplicationId ?? null; set => _clusterParametersBody.ServicePrincipalApplicationId = value; } /// The principal ID, also known as the object ID, of the service principal. [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The principal ID, also known as the object ID, of the service principal.")] @@ -234,7 +237,7 @@ public partial class UpdateAzNetworkCloudCluster_UpdateExpanded : global::System Description = @"The principal ID, also known as the object ID, of the service principal.", SerializedName = @"principalId", PossibleTypes = new [] { typeof(string) })] - public string ClusterServicePrincipalId { get => _clusterUpdateParametersBody.ClusterServicePrincipalId ?? null; set => _clusterUpdateParametersBody.ClusterServicePrincipalId = value; } + public string ClusterServicePrincipalId { get => _clusterParametersBody.ServicePrincipalId ?? null; set => _clusterParametersBody.ServicePrincipalId = value; } /// The password of the service principal. [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The password of the service principal.")] @@ -245,7 +248,7 @@ public partial class UpdateAzNetworkCloudCluster_UpdateExpanded : global::System Description = @"The password of the service principal.", SerializedName = @"password", PossibleTypes = new [] { typeof(System.Security.SecureString) })] - public System.Security.SecureString ClusterServicePrincipalPassword { get => _clusterUpdateParametersBody.ClusterServicePrincipalPassword ?? null; set => _clusterUpdateParametersBody.ClusterServicePrincipalPassword = value; } + public System.Security.SecureString ClusterServicePrincipalPassword { get => _clusterParametersBody.ServicePrincipalPassword ?? null; set => _clusterParametersBody.ServicePrincipalPassword = value; } /// /// The tenant ID, also known as the directory ID, of the tenant in which the service principal is created. @@ -258,7 +261,7 @@ public partial class UpdateAzNetworkCloudCluster_UpdateExpanded : global::System Description = @"The tenant ID, also known as the directory ID, of the tenant in which the service principal is created.", SerializedName = @"tenantId", PossibleTypes = new [] { typeof(string) })] - public string ClusterServicePrincipalTenantId { get => _clusterUpdateParametersBody.ClusterServicePrincipalTenantId ?? null; set => _clusterUpdateParametersBody.ClusterServicePrincipalTenantId = value; } + public string ClusterServicePrincipalTenantId { get => _clusterParametersBody.ServicePrincipalTenantId ?? null; set => _clusterParametersBody.ServicePrincipalTenantId = value; } /// /// The URL of the storage account container that is to be used by the specified identities. @@ -271,7 +274,7 @@ public partial class UpdateAzNetworkCloudCluster_UpdateExpanded : global::System Description = @"The URL of the storage account container that is to be used by the specified identities.", SerializedName = @"containerUrl", PossibleTypes = new [] { typeof(string) })] - public string CommandOutputSettingContainerUrl { get => _clusterUpdateParametersBody.CommandOutputSettingContainerUrl ?? null; set => _clusterUpdateParametersBody.CommandOutputSettingContainerUrl = value; } + public string CommandOutputSettingContainerUrl { get => _clusterParametersBody.CommandOutputSettingContainerUrl ?? null; set => _clusterParametersBody.CommandOutputSettingContainerUrl = value; } /// Selection of how the type evaluation is applied to the cluster calculation. [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Selection of how the type evaluation is applied to the cluster calculation.")] @@ -281,9 +284,9 @@ public partial class UpdateAzNetworkCloudCluster_UpdateExpanded : global::System ReadOnly = false, Description = @"Selection of how the type evaluation is applied to the cluster calculation.", SerializedName = @"grouping", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdGrouping) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdGrouping))] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdGrouping ComputeDeploymentThresholdGrouping { get => _clusterUpdateParametersBody.ComputeDeploymentThresholdGrouping ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdGrouping)""); set => _clusterUpdateParametersBody.ComputeDeploymentThresholdGrouping = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("PerCluster", "PerRack")] + public string ComputeDeploymentThresholdGrouping { get => _clusterParametersBody.ComputeDeploymentThresholdGrouping ?? null; set => _clusterParametersBody.ComputeDeploymentThresholdGrouping = value; } /// Selection of how the threshold should be evaluated. [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Selection of how the threshold should be evaluated.")] @@ -293,9 +296,9 @@ public partial class UpdateAzNetworkCloudCluster_UpdateExpanded : global::System ReadOnly = false, Description = @"Selection of how the threshold should be evaluated.", SerializedName = @"type", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdType) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdType))] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdType ComputeDeploymentThresholdType { get => _clusterUpdateParametersBody.ComputeDeploymentThresholdType ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdType)""); set => _clusterUpdateParametersBody.ComputeDeploymentThresholdType = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("CountSuccess", "PercentSuccess")] + public string ComputeDeploymentThresholdType { get => _clusterParametersBody.ComputeDeploymentThresholdType ?? null; set => _clusterParametersBody.ComputeDeploymentThresholdType = value; } /// The numeric threshold value. [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The numeric threshold value.")] @@ -306,7 +309,7 @@ public partial class UpdateAzNetworkCloudCluster_UpdateExpanded : global::System Description = @"The numeric threshold value.", SerializedName = @"value", PossibleTypes = new [] { typeof(long) })] - public long ComputeDeploymentThresholdValue { get => _clusterUpdateParametersBody.ComputeDeploymentThresholdValue ?? default(long); set => _clusterUpdateParametersBody.ComputeDeploymentThresholdValue = value; } + public long ComputeDeploymentThresholdValue { get => _clusterParametersBody.ComputeDeploymentThresholdValue ?? default(long); set => _clusterParametersBody.ComputeDeploymentThresholdValue = value; } /// /// The list of rack definitions for the compute racks in a multi-rack cluster, or an empty list in a single-rack cluster. @@ -319,8 +322,8 @@ public partial class UpdateAzNetworkCloudCluster_UpdateExpanded : global::System ReadOnly = false, Description = @"The list of rack definitions for the compute racks in a multi-rack cluster, or an empty list in a single-rack cluster.", SerializedName = @"computeRackDefinitions", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackDefinition) })] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackDefinition[] ComputeRackDefinition { get => _clusterUpdateParametersBody.ComputeRackDefinition ?? null /* arrayOf */; set => _clusterUpdateParametersBody.ComputeRackDefinition = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackDefinition) })] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackDefinition[] ComputeRackDefinition { get => _clusterParametersBody.ComputeRackDefinition?.ToArray() ?? null /* fixedArrayOf */; set => _clusterParametersBody.ComputeRackDefinition = (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 @@ -332,6 +335,13 @@ public partial class UpdateAzNetworkCloudCluster_UpdateExpanded : global::System [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// 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 System.Boolean? EnableSystemAssignedIdentity { 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] @@ -344,36 +354,6 @@ public partial class UpdateAzNetworkCloudCluster_UpdateExpanded : global::System [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Support.ManagedServiceIdentityType) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentityType))] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentityType IdentityType { get => _clusterUpdateParametersBody.IdentityType ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentityType)""); set => _clusterUpdateParametersBody.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.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api50.IUserAssignedIdentities) })] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IUserAssignedIdentities IdentityUserAssignedIdentity { get => _clusterUpdateParametersBody.IdentityUserAssignedIdentity ?? null /* object */; set => _clusterUpdateParametersBody.IdentityUserAssignedIdentity = value; } - /// Backing field for property. private string _ifMatch; @@ -445,7 +425,7 @@ public partial class UpdateAzNetworkCloudCluster_UpdateExpanded : global::System /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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")] @@ -485,9 +465,9 @@ public partial class UpdateAzNetworkCloudCluster_UpdateExpanded : global::System ReadOnly = false, Description = @"The mode of operation for runtime protection.", SerializedName = @"enforcementLevel", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RuntimeProtectionEnforcementLevel) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RuntimeProtectionEnforcementLevel))] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RuntimeProtectionEnforcementLevel RuntimeProtectionConfigurationEnforcementLevel { get => _clusterUpdateParametersBody.RuntimeProtectionConfigurationEnforcementLevel ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RuntimeProtectionEnforcementLevel)""); set => _clusterUpdateParametersBody.RuntimeProtectionConfigurationEnforcementLevel = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Audit", "Disabled", "OnDemand", "Passive", "RealTime")] + public string RuntimeProtectionConfigurationEnforcementLevel { get => _clusterParametersBody.RuntimeProtectionConfigurationEnforcementLevel ?? null; set => _clusterParametersBody.RuntimeProtectionConfigurationEnforcementLevel = value; } /// The resource ID of the key vault to archive the secrets of the cluster. [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The resource ID of the key vault to archive the secrets of the cluster.")] @@ -498,7 +478,7 @@ public partial class UpdateAzNetworkCloudCluster_UpdateExpanded : global::System Description = @"The resource ID of the key vault to archive the secrets of the cluster.", SerializedName = @"keyVaultId", PossibleTypes = new [] { typeof(string) })] - public string SecretArchiveKeyVaultId { get => _clusterUpdateParametersBody.SecretArchiveKeyVaultId ?? null; set => _clusterUpdateParametersBody.SecretArchiveKeyVaultId = value; } + public string SecretArchiveKeyVaultId { get => _clusterParametersBody.SecretArchiveKeyVaultId ?? null; set => _clusterParametersBody.SecretArchiveKeyVaultId = value; } /// The URI for the key vault used as the secret archive. [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The URI for the key vault used as the secret archive.")] @@ -509,7 +489,7 @@ public partial class UpdateAzNetworkCloudCluster_UpdateExpanded : global::System Description = @"The URI for the key vault used as the secret archive.", SerializedName = @"vaultUri", PossibleTypes = new [] { typeof(string) })] - public string SecretArchiveSettingVaultUri { get => _clusterUpdateParametersBody.SecretArchiveSettingVaultUri ?? null; set => _clusterUpdateParametersBody.SecretArchiveSettingVaultUri = value; } + public string SecretArchiveSettingVaultUri { get => _clusterParametersBody.SecretArchiveSettingVaultUri ?? null; set => _clusterParametersBody.SecretArchiveSettingVaultUri = value; } /// The type of managed identity that is being selected. [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The type of managed identity that is being selected.")] @@ -519,9 +499,9 @@ public partial class UpdateAzNetworkCloudCluster_UpdateExpanded : global::System ReadOnly = false, Description = @"The type of managed identity that is being selected.", SerializedName = @"identityType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType))] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType SecretArchiveSettingsAssociatedIdentityType { get => _clusterUpdateParametersBody.SecretArchiveSettingsAssociatedIdentityType ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType)""); set => _clusterUpdateParametersBody.SecretArchiveSettingsAssociatedIdentityType = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("SystemAssignedIdentity", "UserAssignedIdentity")] + public string SecretArchiveSettingsAssociatedIdentityType { get => _clusterParametersBody.SecretArchiveSettingsAssociatedIdentityType ?? null; set => _clusterParametersBody.SecretArchiveSettingsAssociatedIdentityType = value; } /// /// The user assigned managed identity resource ID to use. Mutually exclusive with a system assigned identity type. @@ -534,7 +514,7 @@ public partial class UpdateAzNetworkCloudCluster_UpdateExpanded : global::System Description = @"The user assigned managed identity resource ID to use. Mutually exclusive with a system assigned identity type.", SerializedName = @"userAssignedIdentityResourceId", PossibleTypes = new [] { typeof(string) })] - public string SecretArchiveSettingsAssociatedIdentityUserAssignedIdentityResourceId { get => _clusterUpdateParametersBody.SecretArchiveSettingsAssociatedIdentityUserAssignedIdentityResourceId ?? null; set => _clusterUpdateParametersBody.SecretArchiveSettingsAssociatedIdentityUserAssignedIdentityResourceId = value; } + public string SecretArchiveSettingsAssociatedIdentityUserAssignedIdentityResourceId { get => _clusterParametersBody.SecretArchiveSettingsAssociatedIdentityUserAssignedIdentityResourceId ?? null; set => _clusterParametersBody.SecretArchiveSettingsAssociatedIdentityUserAssignedIdentityResourceId = value; } /// /// The indicator if the specified key vault should be used to archive the secrets of the cluster. @@ -546,9 +526,9 @@ public partial class UpdateAzNetworkCloudCluster_UpdateExpanded : global::System ReadOnly = false, Description = @"The indicator if the specified key vault should be used to archive the secrets of the cluster.", SerializedName = @"useKeyVault", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterSecretArchiveEnabled) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterSecretArchiveEnabled))] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterSecretArchiveEnabled SecretArchiveUseKeyVault { get => _clusterUpdateParametersBody.SecretArchiveUseKeyVault ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterSecretArchiveEnabled)""); set => _clusterUpdateParametersBody.SecretArchiveUseKeyVault = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("True", "False")] + public string SecretArchiveUseKeyVault { get => _clusterParametersBody.SecretArchiveUseKeyVault ?? null; set => _clusterParametersBody.SecretArchiveUseKeyVault = value; } /// Backing field for property. private string _subscriptionId; @@ -564,21 +544,22 @@ public partial class UpdateAzNetworkCloudCluster_UpdateExpanded : global::System [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } - /// The Azure resource tags that will replace the existing ones. + /// Resource tags. [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ExportAs(typeof(global::System.Collections.Hashtable))] - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The Azure resource tags that will replace the existing ones.")] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Resource tags.")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Body)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = false, ReadOnly = false, - Description = @"The Azure resource tags that will replace the existing ones.", + Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersTags) })] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersTags Tag { get => _clusterUpdateParametersBody.Tag ?? null /* object */; set => _clusterUpdateParametersBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceTags Tag { get => _clusterParametersBody.Tag ?? null /* object */; set => _clusterParametersBody.Tag = value; } /// /// The maximum number of worker nodes that can be offline within the increment of update, e.g., rack-by-rack.Limited by the @@ -592,7 +573,7 @@ public partial class UpdateAzNetworkCloudCluster_UpdateExpanded : global::System Description = @"The maximum number of worker nodes that can be offline within the increment of update, e.g., rack-by-rack.Limited by the maximum number of machines in the increment. Defaults to the whole increment size.", SerializedName = @"maxUnavailable", PossibleTypes = new [] { typeof(long) })] - public long UpdateStrategyMaxUnavailable { get => _clusterUpdateParametersBody.UpdateStrategyMaxUnavailable ?? default(long); set => _clusterUpdateParametersBody.UpdateStrategyMaxUnavailable = value; } + public long UpdateStrategyMaxUnavailable { get => _clusterParametersBody.UpdateStrategyMaxUnavailable ?? default(long); set => _clusterParametersBody.UpdateStrategyMaxUnavailable = value; } /// Selection of how the threshold should be evaluated. [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Selection of how the threshold should be evaluated.")] @@ -602,9 +583,9 @@ public partial class UpdateAzNetworkCloudCluster_UpdateExpanded : global::System ReadOnly = false, Description = @"Selection of how the threshold should be evaluated.", SerializedName = @"thresholdType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdType) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdType))] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdType UpdateStrategyThresholdType { get => _clusterUpdateParametersBody.UpdateStrategyThresholdType ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdType)""); set => _clusterUpdateParametersBody.UpdateStrategyThresholdType = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("CountSuccess", "PercentSuccess")] + public string UpdateStrategyThresholdType { get => _clusterParametersBody.UpdateStrategyThresholdType ?? null; set => _clusterParametersBody.UpdateStrategyThresholdType = value; } /// The numeric threshold value. [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The numeric threshold value.")] @@ -615,7 +596,7 @@ public partial class UpdateAzNetworkCloudCluster_UpdateExpanded : global::System Description = @"The numeric threshold value.", SerializedName = @"thresholdValue", PossibleTypes = new [] { typeof(long) })] - public long UpdateStrategyThresholdValue { get => _clusterUpdateParametersBody.UpdateStrategyThresholdValue ?? default(long); set => _clusterUpdateParametersBody.UpdateStrategyThresholdValue = value; } + public long UpdateStrategyThresholdValue { get => _clusterParametersBody.UpdateStrategyThresholdValue ?? default(long); set => _clusterParametersBody.UpdateStrategyThresholdValue = value; } /// The mode of operation for runtime protection. [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The mode of operation for runtime protection.")] @@ -625,9 +606,9 @@ public partial class UpdateAzNetworkCloudCluster_UpdateExpanded : global::System ReadOnly = false, Description = @"The mode of operation for runtime protection.", SerializedName = @"strategyType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterUpdateStrategyType) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterUpdateStrategyType))] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterUpdateStrategyType UpdateStrategyType { get => _clusterUpdateParametersBody.UpdateStrategyType ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterUpdateStrategyType)""); set => _clusterUpdateParametersBody.UpdateStrategyType = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Rack", "PauseAfterRack")] + public string UpdateStrategyType { get => _clusterParametersBody.UpdateStrategyType ?? null; set => _clusterParametersBody.UpdateStrategyType = value; } /// The time to wait between the increments of update defined by the strategy. [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The time to wait between the increments of update defined by the strategy.")] @@ -638,7 +619,15 @@ public partial class UpdateAzNetworkCloudCluster_UpdateExpanded : global::System Description = @"The time to wait between the increments of update defined by the strategy.", SerializedName = @"waitTimeMinutes", PossibleTypes = new [] { typeof(long) })] - public long UpdateStrategyWaitTimeMinute { get => _clusterUpdateParametersBody.UpdateStrategyWaitTimeMinute ?? default(long); set => _clusterUpdateParametersBody.UpdateStrategyWaitTimeMinute = value; } + public long UpdateStrategyWaitTimeMinute { get => _clusterParametersBody.UpdateStrategyWaitTimeMinute ?? default(long); set => _clusterParametersBody.UpdateStrategyWaitTimeMinute = 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; } /// The mode selection for container vulnerability scanning. [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The mode selection for container vulnerability scanning.")] @@ -648,33 +637,33 @@ public partial class UpdateAzNetworkCloudCluster_UpdateExpanded : global::System ReadOnly = false, Description = @"The mode selection for container vulnerability scanning.", SerializedName = @"containerScan", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VulnerabilityScanningSettingsContainerScan) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VulnerabilityScanningSettingsContainerScan))] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VulnerabilityScanningSettingsContainerScan VulnerabilityScanningSettingContainerScan { get => _clusterUpdateParametersBody.VulnerabilityScanningSettingContainerScan ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VulnerabilityScanningSettingsContainerScan)""); set => _clusterUpdateParametersBody.VulnerabilityScanningSettingContainerScan = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Disabled", "Enabled")] + public string VulnerabilityScanningSettingContainerScan { get => _clusterParametersBody.VulnerabilityScanningSettingContainerScan ?? null; set => _clusterParametersBody.VulnerabilityScanningSettingContainerScan = 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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.ICluster + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICluster /// 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) @@ -711,7 +700,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets.UpdateAzNetworkCl clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; clone.HttpPipelinePrepend = this.HttpPipelinePrepend; clone.HttpPipelineAppend = this.HttpPipelineAppend; - clone._clusterUpdateParametersBody = this._clusterUpdateParametersBody; + clone._clusterParametersBody = this._clusterParametersBody; clone.SubscriptionId = this.SubscriptionId; clone.ResourceGroupName = this.ResourceGroupName; clone.Name = this.Name; @@ -787,11 +776,36 @@ 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.NetworkCloud.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -803,10 +817,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -815,6 +845,44 @@ protected override void EndProcessing() } } + private void PreProcessManagedIdentityParametersWithGetResult() + { + bool supportsSystemAssignedIdentity = (true == this.EnableSystemAssignedIdentity || null == this.EnableSystemAssignedIdentity && true == _clusterParametersBody?.IdentityType?.Contains("SystemAssigned")); + bool supportsUserAssignedIdentity = false; + if (this.UserAssignedIdentity?.Length > 0) + { + // calculate UserAssignedIdentity + _clusterParametersBody.IdentityUserAssignedIdentity.Clear(); + foreach( var id in this.UserAssignedIdentity ) + { + _clusterParametersBody.IdentityUserAssignedIdentity.Add(id, new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.UserAssignedIdentity()); + } + } + supportsUserAssignedIdentity = true == this.MyInvocation?.BoundParameters?.ContainsKey("UserAssignedIdentity") && this.UserAssignedIdentity?.Length > 0 || + true != this.MyInvocation?.BoundParameters?.ContainsKey("UserAssignedIdentity") && true == _clusterParametersBody.IdentityType?.Contains("UserAssigned"); + if (!supportsUserAssignedIdentity) + { + _clusterParametersBody.IdentityUserAssignedIdentity = null; + } + // calculate IdentityType + if ((supportsUserAssignedIdentity && supportsSystemAssignedIdentity)) + { + _clusterParametersBody.IdentityType = "SystemAssigned,UserAssigned"; + } + else if ((supportsUserAssignedIdentity && !supportsSystemAssignedIdentity)) + { + _clusterParametersBody.IdentityType = "UserAssigned"; + } + else if ((!supportsUserAssignedIdentity && supportsSystemAssignedIdentity)) + { + _clusterParametersBody.IdentityType = "SystemAssigned"; + } + else + { + _clusterParametersBody.IdentityType = "None"; + } + } + /// Performs execution of the command. protected override void ProcessRecord() { @@ -823,7 +891,7 @@ protected override void ProcessRecord() try { // work - if (ShouldProcess($"Call remote 'ClustersUpdate' operation")) + if (ShouldProcess($"Call remote 'ClustersCreateOrUpdate' operation")) { if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) { @@ -874,7 +942,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -887,12 +955,15 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.ClustersUpdate(SubscriptionId, ResourceGroupName, Name, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _clusterUpdateParametersBody, onOk, onDefault, this, Pipeline); + _clusterParametersBody = await this.Client.ClustersGetWithResult(SubscriptionId, ResourceGroupName, Name, this, Pipeline); + this.PreProcessManagedIdentityParametersWithGetResult(); + this.Update_clusterParametersBody(); + await this.Client.ClustersCreateOrUpdate(SubscriptionId, ResourceGroupName, Name, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _clusterParametersBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate); await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null,body=_clusterUpdateParametersBody}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -912,13 +983,157 @@ protected override void StopProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public UpdateAzNetworkCloudCluster_UpdateExpanded() { } + private void Update_clusterParametersBody() + { + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("Tag"))) + { + this.Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceTags)(this.MyInvocation?.BoundParameters["Tag"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("ClusterLocation"))) + { + this.ClusterLocation = (string)(this.MyInvocation?.BoundParameters["ClusterLocation"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("ComputeRackDefinition"))) + { + this.ComputeRackDefinition = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackDefinition[])(this.MyInvocation?.BoundParameters["ComputeRackDefinition"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("CommandOutputSettingContainerUrl"))) + { + this.CommandOutputSettingContainerUrl = (string)(this.MyInvocation?.BoundParameters["CommandOutputSettingContainerUrl"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("SecretArchiveSettingVaultUri"))) + { + this.SecretArchiveSettingVaultUri = (string)(this.MyInvocation?.BoundParameters["SecretArchiveSettingVaultUri"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("VulnerabilityScanningSettingContainerScan"))) + { + this.VulnerabilityScanningSettingContainerScan = (string)(this.MyInvocation?.BoundParameters["VulnerabilityScanningSettingContainerScan"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("AggregatorOrSingleRackDefinitionAvailabilityZone"))) + { + this.AggregatorOrSingleRackDefinitionAvailabilityZone = (string)(this.MyInvocation?.BoundParameters["AggregatorOrSingleRackDefinitionAvailabilityZone"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("AggregatorOrSingleRackDefinitionBareMetalMachineConfiguration"))) + { + this.AggregatorOrSingleRackDefinitionBareMetalMachineConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineConfigurationData[])(this.MyInvocation?.BoundParameters["AggregatorOrSingleRackDefinitionBareMetalMachineConfiguration"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("AggregatorOrSingleRackDefinitionNetworkRackId"))) + { + this.AggregatorOrSingleRackDefinitionNetworkRackId = (string)(this.MyInvocation?.BoundParameters["AggregatorOrSingleRackDefinitionNetworkRackId"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("AggregatorOrSingleRackDefinitionRackLocation"))) + { + this.AggregatorOrSingleRackDefinitionRackLocation = (string)(this.MyInvocation?.BoundParameters["AggregatorOrSingleRackDefinitionRackLocation"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("AggregatorOrSingleRackDefinitionRackSerialNumber"))) + { + this.AggregatorOrSingleRackDefinitionRackSerialNumber = (string)(this.MyInvocation?.BoundParameters["AggregatorOrSingleRackDefinitionRackSerialNumber"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("AggregatorOrSingleRackDefinitionRackSkuId"))) + { + this.AggregatorOrSingleRackDefinitionRackSkuId = (string)(this.MyInvocation?.BoundParameters["AggregatorOrSingleRackDefinitionRackSkuId"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("AggregatorOrSingleRackDefinitionStorageApplianceConfiguration"))) + { + this.AggregatorOrSingleRackDefinitionStorageApplianceConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceConfigurationData[])(this.MyInvocation?.BoundParameters["AggregatorOrSingleRackDefinitionStorageApplianceConfiguration"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("AnalyticOutputSettingAnalyticsWorkspaceId"))) + { + this.AnalyticOutputSettingAnalyticsWorkspaceId = (string)(this.MyInvocation?.BoundParameters["AnalyticOutputSettingAnalyticsWorkspaceId"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("ClusterServicePrincipalApplicationId"))) + { + this.ClusterServicePrincipalApplicationId = (string)(this.MyInvocation?.BoundParameters["ClusterServicePrincipalApplicationId"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("ClusterServicePrincipalPassword"))) + { + this.ClusterServicePrincipalPassword = (System.Security.SecureString)(this.MyInvocation?.BoundParameters["ClusterServicePrincipalPassword"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("ClusterServicePrincipalId"))) + { + this.ClusterServicePrincipalId = (string)(this.MyInvocation?.BoundParameters["ClusterServicePrincipalId"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("ClusterServicePrincipalTenantId"))) + { + this.ClusterServicePrincipalTenantId = (string)(this.MyInvocation?.BoundParameters["ClusterServicePrincipalTenantId"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("ComputeDeploymentThresholdGrouping"))) + { + this.ComputeDeploymentThresholdGrouping = (string)(this.MyInvocation?.BoundParameters["ComputeDeploymentThresholdGrouping"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("ComputeDeploymentThresholdType"))) + { + this.ComputeDeploymentThresholdType = (string)(this.MyInvocation?.BoundParameters["ComputeDeploymentThresholdType"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("ComputeDeploymentThresholdValue"))) + { + this.ComputeDeploymentThresholdValue = (long)(this.MyInvocation?.BoundParameters["ComputeDeploymentThresholdValue"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("RuntimeProtectionConfigurationEnforcementLevel"))) + { + this.RuntimeProtectionConfigurationEnforcementLevel = (string)(this.MyInvocation?.BoundParameters["RuntimeProtectionConfigurationEnforcementLevel"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("SecretArchiveKeyVaultId"))) + { + this.SecretArchiveKeyVaultId = (string)(this.MyInvocation?.BoundParameters["SecretArchiveKeyVaultId"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("SecretArchiveUseKeyVault"))) + { + this.SecretArchiveUseKeyVault = (string)(this.MyInvocation?.BoundParameters["SecretArchiveUseKeyVault"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("UpdateStrategyMaxUnavailable"))) + { + this.UpdateStrategyMaxUnavailable = (long)(this.MyInvocation?.BoundParameters["UpdateStrategyMaxUnavailable"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("UpdateStrategyType"))) + { + this.UpdateStrategyType = (string)(this.MyInvocation?.BoundParameters["UpdateStrategyType"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("UpdateStrategyThresholdType"))) + { + this.UpdateStrategyThresholdType = (string)(this.MyInvocation?.BoundParameters["UpdateStrategyThresholdType"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("UpdateStrategyThresholdValue"))) + { + this.UpdateStrategyThresholdValue = (long)(this.MyInvocation?.BoundParameters["UpdateStrategyThresholdValue"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("UpdateStrategyWaitTimeMinute"))) + { + this.UpdateStrategyWaitTimeMinute = (long)(this.MyInvocation?.BoundParameters["UpdateStrategyWaitTimeMinute"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("AnalyticsOutputSettingsAssociatedIdentityType"))) + { + this.AnalyticsOutputSettingsAssociatedIdentityType = (string)(this.MyInvocation?.BoundParameters["AnalyticsOutputSettingsAssociatedIdentityType"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("AnalyticsOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId"))) + { + this.AnalyticsOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId = (string)(this.MyInvocation?.BoundParameters["AnalyticsOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("AssociatedIdentityType"))) + { + this.AssociatedIdentityType = (string)(this.MyInvocation?.BoundParameters["AssociatedIdentityType"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("AssociatedIdentityUserAssignedIdentityResourceId"))) + { + this.AssociatedIdentityUserAssignedIdentityResourceId = (string)(this.MyInvocation?.BoundParameters["AssociatedIdentityUserAssignedIdentityResourceId"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("SecretArchiveSettingsAssociatedIdentityType"))) + { + this.SecretArchiveSettingsAssociatedIdentityType = (string)(this.MyInvocation?.BoundParameters["SecretArchiveSettingsAssociatedIdentityType"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("SecretArchiveSettingsAssociatedIdentityUserAssignedIdentityResourceId"))) + { + this.SecretArchiveSettingsAssociatedIdentityUserAssignedIdentityResourceId = (string)(this.MyInvocation?.BoundParameters["SecretArchiveSettingsAssociatedIdentityUserAssignedIdentityResourceId"]); + } + } + /// new protected void WriteObject(object sendToPipeline) { @@ -938,12 +1153,12 @@ public UpdateAzNetworkCloudCluster_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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ) { @@ -960,15 +1175,15 @@ public UpdateAzNetworkCloudCluster_UpdateExpanded() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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, IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, body=_clusterUpdateParametersBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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, IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, body=_clusterUpdateParametersBody }) + 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 } }); @@ -978,12 +1193,12 @@ public UpdateAzNetworkCloudCluster_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.NetworkCloud.Models.Api20250201.ICluster + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICluster /// 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 ) { @@ -995,8 +1210,9 @@ public UpdateAzNetworkCloudCluster_UpdateExpanded() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICluster - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICluster + var result = (await response); + WriteObject(result, false); } } } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudCluster_UpdateViaIdentityExpanded.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudCluster_UpdateViaIdentityExpanded.cs index c603a40a4ac0..565d83f5f89e 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudCluster_UpdateViaIdentityExpanded.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudCluster_UpdateViaIdentityExpanded.cs @@ -6,23 +6,22 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; - /// - /// Patch the properties of the provided cluster, or update the tags associated with the cluster. Properties and tag updates - /// can be done independently. - /// + /// update a new cluster or update the properties of the cluster if it exists. /// - /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}" + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}" + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzNetworkCloudCluster_UpdateViaIdentityExpanded", SupportsShouldProcess = true)] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICluster", "15.0.0", "2.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"AggregatorOrSingleRackDefinitionBareMetalMachineConfigurationData","AggregatorOrSingleRackDefinitionStorageApplianceConfigurationData","AvailableUpgradeVersion","ComputeRackDefinition","WorkloadResourceId"}, NewOutputProperties=new string[] {"AggregatorOrSingleRackDefinitionBareMetalMachineConfigurationData","AggregatorOrSingleRackDefinitionStorageApplianceConfigurationData","AvailableUpgradeVersion","ComputeRackDefinition","WorkloadResourceId"}, ChangeDescription="The types of properties will be changed from fixed array to 'List'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICluster))] - [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Patch the properties of the provided cluster, or update the tags associated with the cluster. Properties and tag updates can be done independently.")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICluster))] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"update a new cluster or update the properties of the cluster if it exists.")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] - [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}", ApiVersion = "2025-02-01")] public partial class UpdateAzNetworkCloudCluster_UpdateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -38,10 +37,11 @@ public partial class UpdateAzNetworkCloudCluster_UpdateViaIdentityExpanded : glo /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); - /// - /// ClusterPatchParameters represents the body of the request to patch the cluster properties. - /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParameters _clusterUpdateParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ClusterPatchParameters(); + /// Cluster represents the on-premises Network Cloud cluster. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICluster _clusterParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Cluster(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); /// /// The zone name used for this rack when created. Availability zones are used for workload placement. @@ -54,7 +54,7 @@ public partial class UpdateAzNetworkCloudCluster_UpdateViaIdentityExpanded : glo Description = @"The zone name used for this rack when created. Availability zones are used for workload placement.", SerializedName = @"availabilityZone", PossibleTypes = new [] { typeof(string) })] - public string AggregatorOrSingleRackDefinitionAvailabilityZone { get => _clusterUpdateParametersBody.AggregatorOrSingleRackDefinitionAvailabilityZone ?? null; set => _clusterUpdateParametersBody.AggregatorOrSingleRackDefinitionAvailabilityZone = value; } + public string AggregatorOrSingleRackDefinitionAvailabilityZone { get => _clusterParametersBody.AggregatorOrSingleRackDefinitionAvailabilityZone ?? null; set => _clusterParametersBody.AggregatorOrSingleRackDefinitionAvailabilityZone = value; } /// The unordered list of bare metal machine configuration. [global::System.Management.Automation.AllowEmptyCollection] @@ -65,8 +65,8 @@ public partial class UpdateAzNetworkCloudCluster_UpdateViaIdentityExpanded : glo ReadOnly = false, Description = @"The unordered list of bare metal machine configuration.", SerializedName = @"bareMetalMachineConfigurationData", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineConfigurationData) })] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IBareMetalMachineConfigurationData[] AggregatorOrSingleRackDefinitionBareMetalMachineConfiguration { get => _clusterUpdateParametersBody.AggregatorOrSingleRackDefinitionBareMetalMachineConfigurationData ?? null /* arrayOf */; set => _clusterUpdateParametersBody.AggregatorOrSingleRackDefinitionBareMetalMachineConfigurationData = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineConfigurationData) })] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineConfigurationData[] AggregatorOrSingleRackDefinitionBareMetalMachineConfiguration { get => _clusterParametersBody.AggregatorOrSingleRackDefinitionBareMetalMachineConfigurationData?.ToArray() ?? null /* fixedArrayOf */; set => _clusterParametersBody.AggregatorOrSingleRackDefinitionBareMetalMachineConfigurationData = (value != null ? new System.Collections.Generic.List(value) : null); } /// The resource ID of the network rack that matches this rack definition. [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The resource ID of the network rack that matches this rack definition.")] @@ -77,7 +77,7 @@ public partial class UpdateAzNetworkCloudCluster_UpdateViaIdentityExpanded : glo Description = @"The resource ID of the network rack that matches this rack definition.", SerializedName = @"networkRackId", PossibleTypes = new [] { typeof(string) })] - public string AggregatorOrSingleRackDefinitionNetworkRackId { get => _clusterUpdateParametersBody.AggregatorOrSingleRackDefinitionNetworkRackId ?? null; set => _clusterUpdateParametersBody.AggregatorOrSingleRackDefinitionNetworkRackId = value; } + public string AggregatorOrSingleRackDefinitionNetworkRackId { get => _clusterParametersBody.AggregatorOrSingleRackDefinitionNetworkRackId ?? null; set => _clusterParametersBody.AggregatorOrSingleRackDefinitionNetworkRackId = value; } /// The free-form description of the rack's location. [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The free-form description of the rack's location.")] @@ -88,7 +88,7 @@ public partial class UpdateAzNetworkCloudCluster_UpdateViaIdentityExpanded : glo Description = @"The free-form description of the rack's location.", SerializedName = @"rackLocation", PossibleTypes = new [] { typeof(string) })] - public string AggregatorOrSingleRackDefinitionRackLocation { get => _clusterUpdateParametersBody.AggregatorOrSingleRackDefinitionRackLocation ?? null; set => _clusterUpdateParametersBody.AggregatorOrSingleRackDefinitionRackLocation = value; } + public string AggregatorOrSingleRackDefinitionRackLocation { get => _clusterParametersBody.AggregatorOrSingleRackDefinitionRackLocation ?? null; set => _clusterParametersBody.AggregatorOrSingleRackDefinitionRackLocation = value; } /// /// The unique identifier for the rack within Network Cloud cluster. An alternate unique alphanumeric value other than a serial @@ -102,7 +102,7 @@ public partial class UpdateAzNetworkCloudCluster_UpdateViaIdentityExpanded : glo Description = @"The unique identifier for the rack within Network Cloud cluster. An alternate unique alphanumeric value other than a serial number may be provided if desired.", SerializedName = @"rackSerialNumber", PossibleTypes = new [] { typeof(string) })] - public string AggregatorOrSingleRackDefinitionRackSerialNumber { get => _clusterUpdateParametersBody.AggregatorOrSingleRackDefinitionRackSerialNumber ?? null; set => _clusterUpdateParametersBody.AggregatorOrSingleRackDefinitionRackSerialNumber = value; } + public string AggregatorOrSingleRackDefinitionRackSerialNumber { get => _clusterParametersBody.AggregatorOrSingleRackDefinitionRackSerialNumber ?? null; set => _clusterParametersBody.AggregatorOrSingleRackDefinitionRackSerialNumber = value; } /// The resource ID of the sku for the rack being added. [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The resource ID of the sku for the rack being added.")] @@ -113,7 +113,7 @@ public partial class UpdateAzNetworkCloudCluster_UpdateViaIdentityExpanded : glo Description = @"The resource ID of the sku for the rack being added.", SerializedName = @"rackSkuId", PossibleTypes = new [] { typeof(string) })] - public string AggregatorOrSingleRackDefinitionRackSkuId { get => _clusterUpdateParametersBody.AggregatorOrSingleRackDefinitionRackSkuId ?? null; set => _clusterUpdateParametersBody.AggregatorOrSingleRackDefinitionRackSkuId = value; } + public string AggregatorOrSingleRackDefinitionRackSkuId { get => _clusterParametersBody.AggregatorOrSingleRackDefinitionRackSkuId ?? null; set => _clusterParametersBody.AggregatorOrSingleRackDefinitionRackSkuId = value; } /// The list of storage appliance configuration data for this rack. [global::System.Management.Automation.AllowEmptyCollection] @@ -124,8 +124,8 @@ public partial class UpdateAzNetworkCloudCluster_UpdateViaIdentityExpanded : glo ReadOnly = false, Description = @"The list of storage appliance configuration data for this rack.", SerializedName = @"storageApplianceConfigurationData", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceConfigurationData) })] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageApplianceConfigurationData[] AggregatorOrSingleRackDefinitionStorageApplianceConfiguration { get => _clusterUpdateParametersBody.AggregatorOrSingleRackDefinitionStorageApplianceConfigurationData ?? null /* arrayOf */; set => _clusterUpdateParametersBody.AggregatorOrSingleRackDefinitionStorageApplianceConfigurationData = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceConfigurationData) })] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceConfigurationData[] AggregatorOrSingleRackDefinitionStorageApplianceConfiguration { get => _clusterParametersBody.AggregatorOrSingleRackDefinitionStorageApplianceConfigurationData?.ToArray() ?? null /* fixedArrayOf */; set => _clusterParametersBody.AggregatorOrSingleRackDefinitionStorageApplianceConfigurationData = (value != null ? new System.Collections.Generic.List(value) : null); } /// /// The resource ID of the analytics workspace that is to be used by the specified identity. @@ -138,7 +138,7 @@ public partial class UpdateAzNetworkCloudCluster_UpdateViaIdentityExpanded : glo Description = @"The resource ID of the analytics workspace that is to be used by the specified identity.", SerializedName = @"analyticsWorkspaceId", PossibleTypes = new [] { typeof(string) })] - public string AnalyticOutputSettingAnalyticsWorkspaceId { get => _clusterUpdateParametersBody.AnalyticOutputSettingAnalyticsWorkspaceId ?? null; set => _clusterUpdateParametersBody.AnalyticOutputSettingAnalyticsWorkspaceId = value; } + public string AnalyticOutputSettingAnalyticsWorkspaceId { get => _clusterParametersBody.AnalyticOutputSettingAnalyticsWorkspaceId ?? null; set => _clusterParametersBody.AnalyticOutputSettingAnalyticsWorkspaceId = value; } /// The type of managed identity that is being selected. [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The type of managed identity that is being selected.")] @@ -148,9 +148,9 @@ public partial class UpdateAzNetworkCloudCluster_UpdateViaIdentityExpanded : glo ReadOnly = false, Description = @"The type of managed identity that is being selected.", SerializedName = @"identityType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType))] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType AnalyticsOutputSettingsAssociatedIdentityType { get => _clusterUpdateParametersBody.AnalyticsOutputSettingsAssociatedIdentityType ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType)""); set => _clusterUpdateParametersBody.AnalyticsOutputSettingsAssociatedIdentityType = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("SystemAssignedIdentity", "UserAssignedIdentity")] + public string AnalyticsOutputSettingsAssociatedIdentityType { get => _clusterParametersBody.AnalyticsOutputSettingsAssociatedIdentityType ?? null; set => _clusterParametersBody.AnalyticsOutputSettingsAssociatedIdentityType = value; } /// /// The user assigned managed identity resource ID to use. Mutually exclusive with a system assigned identity type. @@ -163,7 +163,7 @@ public partial class UpdateAzNetworkCloudCluster_UpdateViaIdentityExpanded : glo Description = @"The user assigned managed identity resource ID to use. Mutually exclusive with a system assigned identity type.", SerializedName = @"userAssignedIdentityResourceId", PossibleTypes = new [] { typeof(string) })] - public string AnalyticsOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId { get => _clusterUpdateParametersBody.AnalyticsOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId ?? null; set => _clusterUpdateParametersBody.AnalyticsOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId = value; } + public string AnalyticsOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId { get => _clusterParametersBody.AnalyticsOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId ?? null; set => _clusterParametersBody.AnalyticsOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId = value; } /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] @@ -178,9 +178,9 @@ public partial class UpdateAzNetworkCloudCluster_UpdateViaIdentityExpanded : glo ReadOnly = false, Description = @"The type of associated identity for CommandOutputSettings.", SerializedName = @"identityType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType))] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType AssociatedIdentityType { get => _clusterUpdateParametersBody.CommandOutputSettingsAssociatedIdentityType ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType)""); set => _clusterUpdateParametersBody.CommandOutputSettingsAssociatedIdentityType = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("SystemAssignedIdentity", "UserAssignedIdentity")] + public string AssociatedIdentityType { get => _clusterParametersBody.AssociatedIdentityType ?? null; set => _clusterParametersBody.AssociatedIdentityType = value; } /// The resource ID of the user assigned identity for CommandOutputSettings. [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The resource ID of the user assigned identity for CommandOutputSettings.")] @@ -191,13 +191,16 @@ public partial class UpdateAzNetworkCloudCluster_UpdateViaIdentityExpanded : glo Description = @"The resource ID of the user assigned identity for CommandOutputSettings.", SerializedName = @"userAssignedIdentityResourceId", PossibleTypes = new [] { typeof(string) })] - public string AssociatedIdentityUserAssignedIdentityResourceId { get => _clusterUpdateParametersBody.CommandOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId ?? null; set => _clusterUpdateParametersBody.CommandOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId = value; } + public string AssociatedIdentityUserAssignedIdentityResourceId { get => _clusterParametersBody.AssociatedIdentityUserAssignedIdentityResourceId ?? null; set => _clusterParametersBody.AssociatedIdentityUserAssignedIdentityResourceId = 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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -212,7 +215,7 @@ public partial class UpdateAzNetworkCloudCluster_UpdateViaIdentityExpanded : glo Description = @"The customer-provided location information to identify where the cluster resides.", SerializedName = @"clusterLocation", PossibleTypes = new [] { typeof(string) })] - public string ClusterLocation { get => _clusterUpdateParametersBody.ClusterLocation ?? null; set => _clusterUpdateParametersBody.ClusterLocation = value; } + public string ClusterLocation { get => _clusterParametersBody.ClusterLocation ?? null; set => _clusterParametersBody.ClusterLocation = value; } /// The application ID, also known as client ID, of the service principal. [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The application ID, also known as client ID, of the service principal.")] @@ -223,7 +226,7 @@ public partial class UpdateAzNetworkCloudCluster_UpdateViaIdentityExpanded : glo Description = @"The application ID, also known as client ID, of the service principal.", SerializedName = @"applicationId", PossibleTypes = new [] { typeof(string) })] - public string ClusterServicePrincipalApplicationId { get => _clusterUpdateParametersBody.ClusterServicePrincipalApplicationId ?? null; set => _clusterUpdateParametersBody.ClusterServicePrincipalApplicationId = value; } + public string ClusterServicePrincipalApplicationId { get => _clusterParametersBody.ServicePrincipalApplicationId ?? null; set => _clusterParametersBody.ServicePrincipalApplicationId = value; } /// The principal ID, also known as the object ID, of the service principal. [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The principal ID, also known as the object ID, of the service principal.")] @@ -234,7 +237,7 @@ public partial class UpdateAzNetworkCloudCluster_UpdateViaIdentityExpanded : glo Description = @"The principal ID, also known as the object ID, of the service principal.", SerializedName = @"principalId", PossibleTypes = new [] { typeof(string) })] - public string ClusterServicePrincipalId { get => _clusterUpdateParametersBody.ClusterServicePrincipalId ?? null; set => _clusterUpdateParametersBody.ClusterServicePrincipalId = value; } + public string ClusterServicePrincipalId { get => _clusterParametersBody.ServicePrincipalId ?? null; set => _clusterParametersBody.ServicePrincipalId = value; } /// The password of the service principal. [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The password of the service principal.")] @@ -245,7 +248,7 @@ public partial class UpdateAzNetworkCloudCluster_UpdateViaIdentityExpanded : glo Description = @"The password of the service principal.", SerializedName = @"password", PossibleTypes = new [] { typeof(System.Security.SecureString) })] - public System.Security.SecureString ClusterServicePrincipalPassword { get => _clusterUpdateParametersBody.ClusterServicePrincipalPassword ?? null; set => _clusterUpdateParametersBody.ClusterServicePrincipalPassword = value; } + public System.Security.SecureString ClusterServicePrincipalPassword { get => _clusterParametersBody.ServicePrincipalPassword ?? null; set => _clusterParametersBody.ServicePrincipalPassword = value; } /// /// The tenant ID, also known as the directory ID, of the tenant in which the service principal is created. @@ -258,7 +261,7 @@ public partial class UpdateAzNetworkCloudCluster_UpdateViaIdentityExpanded : glo Description = @"The tenant ID, also known as the directory ID, of the tenant in which the service principal is created.", SerializedName = @"tenantId", PossibleTypes = new [] { typeof(string) })] - public string ClusterServicePrincipalTenantId { get => _clusterUpdateParametersBody.ClusterServicePrincipalTenantId ?? null; set => _clusterUpdateParametersBody.ClusterServicePrincipalTenantId = value; } + public string ClusterServicePrincipalTenantId { get => _clusterParametersBody.ServicePrincipalTenantId ?? null; set => _clusterParametersBody.ServicePrincipalTenantId = value; } /// /// The URL of the storage account container that is to be used by the specified identities. @@ -271,7 +274,7 @@ public partial class UpdateAzNetworkCloudCluster_UpdateViaIdentityExpanded : glo Description = @"The URL of the storage account container that is to be used by the specified identities.", SerializedName = @"containerUrl", PossibleTypes = new [] { typeof(string) })] - public string CommandOutputSettingContainerUrl { get => _clusterUpdateParametersBody.CommandOutputSettingContainerUrl ?? null; set => _clusterUpdateParametersBody.CommandOutputSettingContainerUrl = value; } + public string CommandOutputSettingContainerUrl { get => _clusterParametersBody.CommandOutputSettingContainerUrl ?? null; set => _clusterParametersBody.CommandOutputSettingContainerUrl = value; } /// Selection of how the type evaluation is applied to the cluster calculation. [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Selection of how the type evaluation is applied to the cluster calculation.")] @@ -281,9 +284,9 @@ public partial class UpdateAzNetworkCloudCluster_UpdateViaIdentityExpanded : glo ReadOnly = false, Description = @"Selection of how the type evaluation is applied to the cluster calculation.", SerializedName = @"grouping", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdGrouping) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdGrouping))] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdGrouping ComputeDeploymentThresholdGrouping { get => _clusterUpdateParametersBody.ComputeDeploymentThresholdGrouping ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdGrouping)""); set => _clusterUpdateParametersBody.ComputeDeploymentThresholdGrouping = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("PerCluster", "PerRack")] + public string ComputeDeploymentThresholdGrouping { get => _clusterParametersBody.ComputeDeploymentThresholdGrouping ?? null; set => _clusterParametersBody.ComputeDeploymentThresholdGrouping = value; } /// Selection of how the threshold should be evaluated. [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Selection of how the threshold should be evaluated.")] @@ -293,9 +296,9 @@ public partial class UpdateAzNetworkCloudCluster_UpdateViaIdentityExpanded : glo ReadOnly = false, Description = @"Selection of how the threshold should be evaluated.", SerializedName = @"type", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdType) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdType))] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdType ComputeDeploymentThresholdType { get => _clusterUpdateParametersBody.ComputeDeploymentThresholdType ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdType)""); set => _clusterUpdateParametersBody.ComputeDeploymentThresholdType = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("CountSuccess", "PercentSuccess")] + public string ComputeDeploymentThresholdType { get => _clusterParametersBody.ComputeDeploymentThresholdType ?? null; set => _clusterParametersBody.ComputeDeploymentThresholdType = value; } /// The numeric threshold value. [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The numeric threshold value.")] @@ -306,7 +309,7 @@ public partial class UpdateAzNetworkCloudCluster_UpdateViaIdentityExpanded : glo Description = @"The numeric threshold value.", SerializedName = @"value", PossibleTypes = new [] { typeof(long) })] - public long ComputeDeploymentThresholdValue { get => _clusterUpdateParametersBody.ComputeDeploymentThresholdValue ?? default(long); set => _clusterUpdateParametersBody.ComputeDeploymentThresholdValue = value; } + public long ComputeDeploymentThresholdValue { get => _clusterParametersBody.ComputeDeploymentThresholdValue ?? default(long); set => _clusterParametersBody.ComputeDeploymentThresholdValue = value; } /// /// The list of rack definitions for the compute racks in a multi-rack cluster, or an empty list in a single-rack cluster. @@ -319,8 +322,8 @@ public partial class UpdateAzNetworkCloudCluster_UpdateViaIdentityExpanded : glo ReadOnly = false, Description = @"The list of rack definitions for the compute racks in a multi-rack cluster, or an empty list in a single-rack cluster.", SerializedName = @"computeRackDefinitions", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackDefinition) })] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackDefinition[] ComputeRackDefinition { get => _clusterUpdateParametersBody.ComputeRackDefinition ?? null /* arrayOf */; set => _clusterUpdateParametersBody.ComputeRackDefinition = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackDefinition) })] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackDefinition[] ComputeRackDefinition { get => _clusterParametersBody.ComputeRackDefinition?.ToArray() ?? null /* fixedArrayOf */; set => _clusterParametersBody.ComputeRackDefinition = (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 @@ -332,6 +335,13 @@ public partial class UpdateAzNetworkCloudCluster_UpdateViaIdentityExpanded : glo [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// 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 System.Boolean? EnableSystemAssignedIdentity { 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] @@ -344,36 +354,6 @@ public partial class UpdateAzNetworkCloudCluster_UpdateViaIdentityExpanded : glo [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Support.ManagedServiceIdentityType) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentityType))] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentityType IdentityType { get => _clusterUpdateParametersBody.IdentityType ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentityType)""); set => _clusterUpdateParametersBody.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.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Body)] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api50.IUserAssignedIdentities) })] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IUserAssignedIdentities IdentityUserAssignedIdentity { get => _clusterUpdateParametersBody.IdentityUserAssignedIdentity ?? null /* object */; set => _clusterUpdateParametersBody.IdentityUserAssignedIdentity = value; } - /// Backing field for property. private string _ifMatch; @@ -438,7 +418,7 @@ public partial class UpdateAzNetworkCloudCluster_UpdateViaIdentityExpanded : glo /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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")] @@ -464,9 +444,9 @@ public partial class UpdateAzNetworkCloudCluster_UpdateViaIdentityExpanded : glo ReadOnly = false, Description = @"The mode of operation for runtime protection.", SerializedName = @"enforcementLevel", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RuntimeProtectionEnforcementLevel) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RuntimeProtectionEnforcementLevel))] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RuntimeProtectionEnforcementLevel RuntimeProtectionConfigurationEnforcementLevel { get => _clusterUpdateParametersBody.RuntimeProtectionConfigurationEnforcementLevel ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.RuntimeProtectionEnforcementLevel)""); set => _clusterUpdateParametersBody.RuntimeProtectionConfigurationEnforcementLevel = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Audit", "Disabled", "OnDemand", "Passive", "RealTime")] + public string RuntimeProtectionConfigurationEnforcementLevel { get => _clusterParametersBody.RuntimeProtectionConfigurationEnforcementLevel ?? null; set => _clusterParametersBody.RuntimeProtectionConfigurationEnforcementLevel = value; } /// The resource ID of the key vault to archive the secrets of the cluster. [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The resource ID of the key vault to archive the secrets of the cluster.")] @@ -477,7 +457,7 @@ public partial class UpdateAzNetworkCloudCluster_UpdateViaIdentityExpanded : glo Description = @"The resource ID of the key vault to archive the secrets of the cluster.", SerializedName = @"keyVaultId", PossibleTypes = new [] { typeof(string) })] - public string SecretArchiveKeyVaultId { get => _clusterUpdateParametersBody.SecretArchiveKeyVaultId ?? null; set => _clusterUpdateParametersBody.SecretArchiveKeyVaultId = value; } + public string SecretArchiveKeyVaultId { get => _clusterParametersBody.SecretArchiveKeyVaultId ?? null; set => _clusterParametersBody.SecretArchiveKeyVaultId = value; } /// The URI for the key vault used as the secret archive. [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The URI for the key vault used as the secret archive.")] @@ -488,7 +468,7 @@ public partial class UpdateAzNetworkCloudCluster_UpdateViaIdentityExpanded : glo Description = @"The URI for the key vault used as the secret archive.", SerializedName = @"vaultUri", PossibleTypes = new [] { typeof(string) })] - public string SecretArchiveSettingVaultUri { get => _clusterUpdateParametersBody.SecretArchiveSettingVaultUri ?? null; set => _clusterUpdateParametersBody.SecretArchiveSettingVaultUri = value; } + public string SecretArchiveSettingVaultUri { get => _clusterParametersBody.SecretArchiveSettingVaultUri ?? null; set => _clusterParametersBody.SecretArchiveSettingVaultUri = value; } /// The type of managed identity that is being selected. [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The type of managed identity that is being selected.")] @@ -498,9 +478,9 @@ public partial class UpdateAzNetworkCloudCluster_UpdateViaIdentityExpanded : glo ReadOnly = false, Description = @"The type of managed identity that is being selected.", SerializedName = @"identityType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType))] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType SecretArchiveSettingsAssociatedIdentityType { get => _clusterUpdateParametersBody.SecretArchiveSettingsAssociatedIdentityType ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ManagedServiceIdentitySelectorType)""); set => _clusterUpdateParametersBody.SecretArchiveSettingsAssociatedIdentityType = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("SystemAssignedIdentity", "UserAssignedIdentity")] + public string SecretArchiveSettingsAssociatedIdentityType { get => _clusterParametersBody.SecretArchiveSettingsAssociatedIdentityType ?? null; set => _clusterParametersBody.SecretArchiveSettingsAssociatedIdentityType = value; } /// /// The user assigned managed identity resource ID to use. Mutually exclusive with a system assigned identity type. @@ -513,7 +493,7 @@ public partial class UpdateAzNetworkCloudCluster_UpdateViaIdentityExpanded : glo Description = @"The user assigned managed identity resource ID to use. Mutually exclusive with a system assigned identity type.", SerializedName = @"userAssignedIdentityResourceId", PossibleTypes = new [] { typeof(string) })] - public string SecretArchiveSettingsAssociatedIdentityUserAssignedIdentityResourceId { get => _clusterUpdateParametersBody.SecretArchiveSettingsAssociatedIdentityUserAssignedIdentityResourceId ?? null; set => _clusterUpdateParametersBody.SecretArchiveSettingsAssociatedIdentityUserAssignedIdentityResourceId = value; } + public string SecretArchiveSettingsAssociatedIdentityUserAssignedIdentityResourceId { get => _clusterParametersBody.SecretArchiveSettingsAssociatedIdentityUserAssignedIdentityResourceId ?? null; set => _clusterParametersBody.SecretArchiveSettingsAssociatedIdentityUserAssignedIdentityResourceId = value; } /// /// The indicator if the specified key vault should be used to archive the secrets of the cluster. @@ -525,21 +505,21 @@ public partial class UpdateAzNetworkCloudCluster_UpdateViaIdentityExpanded : glo ReadOnly = false, Description = @"The indicator if the specified key vault should be used to archive the secrets of the cluster.", SerializedName = @"useKeyVault", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterSecretArchiveEnabled) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterSecretArchiveEnabled))] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterSecretArchiveEnabled SecretArchiveUseKeyVault { get => _clusterUpdateParametersBody.SecretArchiveUseKeyVault ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterSecretArchiveEnabled)""); set => _clusterUpdateParametersBody.SecretArchiveUseKeyVault = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("True", "False")] + public string SecretArchiveUseKeyVault { get => _clusterParametersBody.SecretArchiveUseKeyVault ?? null; set => _clusterParametersBody.SecretArchiveUseKeyVault = value; } - /// The Azure resource tags that will replace the existing ones. + /// Resource tags. [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ExportAs(typeof(global::System.Collections.Hashtable))] - [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The Azure resource tags that will replace the existing ones.")] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Resource tags.")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Body)] [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( Required = false, ReadOnly = false, - Description = @"The Azure resource tags that will replace the existing ones.", + Description = @"Resource tags.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersTags) })] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterPatchParametersTags Tag { get => _clusterUpdateParametersBody.Tag ?? null /* object */; set => _clusterUpdateParametersBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceTags Tag { get => _clusterParametersBody.Tag ?? null /* object */; set => _clusterParametersBody.Tag = value; } /// /// The maximum number of worker nodes that can be offline within the increment of update, e.g., rack-by-rack.Limited by the @@ -553,7 +533,7 @@ public partial class UpdateAzNetworkCloudCluster_UpdateViaIdentityExpanded : glo Description = @"The maximum number of worker nodes that can be offline within the increment of update, e.g., rack-by-rack.Limited by the maximum number of machines in the increment. Defaults to the whole increment size.", SerializedName = @"maxUnavailable", PossibleTypes = new [] { typeof(long) })] - public long UpdateStrategyMaxUnavailable { get => _clusterUpdateParametersBody.UpdateStrategyMaxUnavailable ?? default(long); set => _clusterUpdateParametersBody.UpdateStrategyMaxUnavailable = value; } + public long UpdateStrategyMaxUnavailable { get => _clusterParametersBody.UpdateStrategyMaxUnavailable ?? default(long); set => _clusterParametersBody.UpdateStrategyMaxUnavailable = value; } /// Selection of how the threshold should be evaluated. [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Selection of how the threshold should be evaluated.")] @@ -563,9 +543,9 @@ public partial class UpdateAzNetworkCloudCluster_UpdateViaIdentityExpanded : glo ReadOnly = false, Description = @"Selection of how the threshold should be evaluated.", SerializedName = @"thresholdType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdType) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdType))] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdType UpdateStrategyThresholdType { get => _clusterUpdateParametersBody.UpdateStrategyThresholdType ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ValidationThresholdType)""); set => _clusterUpdateParametersBody.UpdateStrategyThresholdType = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("CountSuccess", "PercentSuccess")] + public string UpdateStrategyThresholdType { get => _clusterParametersBody.UpdateStrategyThresholdType ?? null; set => _clusterParametersBody.UpdateStrategyThresholdType = value; } /// The numeric threshold value. [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The numeric threshold value.")] @@ -576,7 +556,7 @@ public partial class UpdateAzNetworkCloudCluster_UpdateViaIdentityExpanded : glo Description = @"The numeric threshold value.", SerializedName = @"thresholdValue", PossibleTypes = new [] { typeof(long) })] - public long UpdateStrategyThresholdValue { get => _clusterUpdateParametersBody.UpdateStrategyThresholdValue ?? default(long); set => _clusterUpdateParametersBody.UpdateStrategyThresholdValue = value; } + public long UpdateStrategyThresholdValue { get => _clusterParametersBody.UpdateStrategyThresholdValue ?? default(long); set => _clusterParametersBody.UpdateStrategyThresholdValue = value; } /// The mode of operation for runtime protection. [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The mode of operation for runtime protection.")] @@ -586,9 +566,9 @@ public partial class UpdateAzNetworkCloudCluster_UpdateViaIdentityExpanded : glo ReadOnly = false, Description = @"The mode of operation for runtime protection.", SerializedName = @"strategyType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterUpdateStrategyType) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterUpdateStrategyType))] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterUpdateStrategyType UpdateStrategyType { get => _clusterUpdateParametersBody.UpdateStrategyType ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ClusterUpdateStrategyType)""); set => _clusterUpdateParametersBody.UpdateStrategyType = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Rack", "PauseAfterRack")] + public string UpdateStrategyType { get => _clusterParametersBody.UpdateStrategyType ?? null; set => _clusterParametersBody.UpdateStrategyType = value; } /// The time to wait between the increments of update defined by the strategy. [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The time to wait between the increments of update defined by the strategy.")] @@ -599,7 +579,15 @@ public partial class UpdateAzNetworkCloudCluster_UpdateViaIdentityExpanded : glo Description = @"The time to wait between the increments of update defined by the strategy.", SerializedName = @"waitTimeMinutes", PossibleTypes = new [] { typeof(long) })] - public long UpdateStrategyWaitTimeMinute { get => _clusterUpdateParametersBody.UpdateStrategyWaitTimeMinute ?? default(long); set => _clusterUpdateParametersBody.UpdateStrategyWaitTimeMinute = value; } + public long UpdateStrategyWaitTimeMinute { get => _clusterParametersBody.UpdateStrategyWaitTimeMinute ?? default(long); set => _clusterParametersBody.UpdateStrategyWaitTimeMinute = 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; } /// The mode selection for container vulnerability scanning. [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The mode selection for container vulnerability scanning.")] @@ -609,33 +597,33 @@ public partial class UpdateAzNetworkCloudCluster_UpdateViaIdentityExpanded : glo ReadOnly = false, Description = @"The mode selection for container vulnerability scanning.", SerializedName = @"containerScan", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VulnerabilityScanningSettingsContainerScan) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VulnerabilityScanningSettingsContainerScan))] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VulnerabilityScanningSettingsContainerScan VulnerabilityScanningSettingContainerScan { get => _clusterUpdateParametersBody.VulnerabilityScanningSettingContainerScan ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.VulnerabilityScanningSettingsContainerScan)""); set => _clusterUpdateParametersBody.VulnerabilityScanningSettingContainerScan = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("Disabled", "Enabled")] + public string VulnerabilityScanningSettingContainerScan { get => _clusterParametersBody.VulnerabilityScanningSettingContainerScan ?? null; set => _clusterParametersBody.VulnerabilityScanningSettingContainerScan = 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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.ICluster + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICluster /// 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) @@ -672,7 +660,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets.UpdateAzNetworkCl clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; clone.HttpPipelinePrepend = this.HttpPipelinePrepend; clone.HttpPipelineAppend = this.HttpPipelineAppend; - clone._clusterUpdateParametersBody = this._clusterUpdateParametersBody; + clone._clusterParametersBody = this._clusterParametersBody; clone.IfMatch = this.IfMatch; clone.IfNoneMatch = this.IfNoneMatch; return clone; @@ -745,11 +733,36 @@ 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.NetworkCloud.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -761,10 +774,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -773,6 +802,44 @@ protected override void EndProcessing() } } + private void PreProcessManagedIdentityParametersWithGetResult() + { + bool supportsSystemAssignedIdentity = (true == this.EnableSystemAssignedIdentity || null == this.EnableSystemAssignedIdentity && true == _clusterParametersBody?.IdentityType?.Contains("SystemAssigned")); + bool supportsUserAssignedIdentity = false; + if (this.UserAssignedIdentity?.Length > 0) + { + // calculate UserAssignedIdentity + _clusterParametersBody.IdentityUserAssignedIdentity.Clear(); + foreach( var id in this.UserAssignedIdentity ) + { + _clusterParametersBody.IdentityUserAssignedIdentity.Add(id, new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.UserAssignedIdentity()); + } + } + supportsUserAssignedIdentity = true == this.MyInvocation?.BoundParameters?.ContainsKey("UserAssignedIdentity") && this.UserAssignedIdentity?.Length > 0 || + true != this.MyInvocation?.BoundParameters?.ContainsKey("UserAssignedIdentity") && true == _clusterParametersBody.IdentityType?.Contains("UserAssigned"); + if (!supportsUserAssignedIdentity) + { + _clusterParametersBody.IdentityUserAssignedIdentity = null; + } + // calculate IdentityType + if ((supportsUserAssignedIdentity && supportsSystemAssignedIdentity)) + { + _clusterParametersBody.IdentityType = "SystemAssigned,UserAssigned"; + } + else if ((supportsUserAssignedIdentity && !supportsSystemAssignedIdentity)) + { + _clusterParametersBody.IdentityType = "UserAssigned"; + } + else if ((!supportsUserAssignedIdentity && supportsSystemAssignedIdentity)) + { + _clusterParametersBody.IdentityType = "SystemAssigned"; + } + else + { + _clusterParametersBody.IdentityType = "None"; + } + } + /// Performs execution of the command. protected override void ProcessRecord() { @@ -781,7 +848,7 @@ protected override void ProcessRecord() try { // work - if (ShouldProcess($"Call remote 'ClustersUpdate' operation")) + if (ShouldProcess($"Call remote 'ClustersCreateOrUpdate' operation")) { if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) { @@ -832,7 +899,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -847,7 +914,10 @@ protected override void ProcessRecord() await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } if (InputObject?.Id != null) { - await this.Client.ClustersUpdateViaIdentity(InputObject.Id, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _clusterUpdateParametersBody, onOk, onDefault, this, Pipeline); + _clusterParametersBody = await this.Client.ClustersGetViaIdentityWithResult(InputObject.Id, this, Pipeline); + this.PreProcessManagedIdentityParametersWithGetResult(); + this.Update_clusterParametersBody(); + await this.Client.ClustersCreateOrUpdateViaIdentity(InputObject.Id, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _clusterParametersBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate); } else { @@ -864,13 +934,16 @@ protected override void ProcessRecord() { ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ClusterName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); } - await this.Client.ClustersUpdate(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.ClusterName ?? null, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _clusterUpdateParametersBody, onOk, onDefault, this, Pipeline); + _clusterParametersBody = await this.Client.ClustersGetWithResult(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.ClusterName ?? null, this, Pipeline); + this.PreProcessManagedIdentityParametersWithGetResult(); + this.Update_clusterParametersBody(); + await this.Client.ClustersCreateOrUpdate(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.ClusterName ?? null, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _clusterParametersBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate); } await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null,body=_clusterUpdateParametersBody}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -890,13 +963,157 @@ protected override void StopProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public UpdateAzNetworkCloudCluster_UpdateViaIdentityExpanded() { } + private void Update_clusterParametersBody() + { + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("Tag"))) + { + this.Tag = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrackedResourceTags)(this.MyInvocation?.BoundParameters["Tag"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("ClusterLocation"))) + { + this.ClusterLocation = (string)(this.MyInvocation?.BoundParameters["ClusterLocation"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("ComputeRackDefinition"))) + { + this.ComputeRackDefinition = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackDefinition[])(this.MyInvocation?.BoundParameters["ComputeRackDefinition"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("CommandOutputSettingContainerUrl"))) + { + this.CommandOutputSettingContainerUrl = (string)(this.MyInvocation?.BoundParameters["CommandOutputSettingContainerUrl"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("SecretArchiveSettingVaultUri"))) + { + this.SecretArchiveSettingVaultUri = (string)(this.MyInvocation?.BoundParameters["SecretArchiveSettingVaultUri"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("VulnerabilityScanningSettingContainerScan"))) + { + this.VulnerabilityScanningSettingContainerScan = (string)(this.MyInvocation?.BoundParameters["VulnerabilityScanningSettingContainerScan"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("AggregatorOrSingleRackDefinitionAvailabilityZone"))) + { + this.AggregatorOrSingleRackDefinitionAvailabilityZone = (string)(this.MyInvocation?.BoundParameters["AggregatorOrSingleRackDefinitionAvailabilityZone"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("AggregatorOrSingleRackDefinitionBareMetalMachineConfiguration"))) + { + this.AggregatorOrSingleRackDefinitionBareMetalMachineConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IBareMetalMachineConfigurationData[])(this.MyInvocation?.BoundParameters["AggregatorOrSingleRackDefinitionBareMetalMachineConfiguration"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("AggregatorOrSingleRackDefinitionNetworkRackId"))) + { + this.AggregatorOrSingleRackDefinitionNetworkRackId = (string)(this.MyInvocation?.BoundParameters["AggregatorOrSingleRackDefinitionNetworkRackId"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("AggregatorOrSingleRackDefinitionRackLocation"))) + { + this.AggregatorOrSingleRackDefinitionRackLocation = (string)(this.MyInvocation?.BoundParameters["AggregatorOrSingleRackDefinitionRackLocation"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("AggregatorOrSingleRackDefinitionRackSerialNumber"))) + { + this.AggregatorOrSingleRackDefinitionRackSerialNumber = (string)(this.MyInvocation?.BoundParameters["AggregatorOrSingleRackDefinitionRackSerialNumber"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("AggregatorOrSingleRackDefinitionRackSkuId"))) + { + this.AggregatorOrSingleRackDefinitionRackSkuId = (string)(this.MyInvocation?.BoundParameters["AggregatorOrSingleRackDefinitionRackSkuId"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("AggregatorOrSingleRackDefinitionStorageApplianceConfiguration"))) + { + this.AggregatorOrSingleRackDefinitionStorageApplianceConfiguration = (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageApplianceConfigurationData[])(this.MyInvocation?.BoundParameters["AggregatorOrSingleRackDefinitionStorageApplianceConfiguration"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("AnalyticOutputSettingAnalyticsWorkspaceId"))) + { + this.AnalyticOutputSettingAnalyticsWorkspaceId = (string)(this.MyInvocation?.BoundParameters["AnalyticOutputSettingAnalyticsWorkspaceId"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("ClusterServicePrincipalApplicationId"))) + { + this.ClusterServicePrincipalApplicationId = (string)(this.MyInvocation?.BoundParameters["ClusterServicePrincipalApplicationId"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("ClusterServicePrincipalPassword"))) + { + this.ClusterServicePrincipalPassword = (System.Security.SecureString)(this.MyInvocation?.BoundParameters["ClusterServicePrincipalPassword"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("ClusterServicePrincipalId"))) + { + this.ClusterServicePrincipalId = (string)(this.MyInvocation?.BoundParameters["ClusterServicePrincipalId"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("ClusterServicePrincipalTenantId"))) + { + this.ClusterServicePrincipalTenantId = (string)(this.MyInvocation?.BoundParameters["ClusterServicePrincipalTenantId"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("ComputeDeploymentThresholdGrouping"))) + { + this.ComputeDeploymentThresholdGrouping = (string)(this.MyInvocation?.BoundParameters["ComputeDeploymentThresholdGrouping"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("ComputeDeploymentThresholdType"))) + { + this.ComputeDeploymentThresholdType = (string)(this.MyInvocation?.BoundParameters["ComputeDeploymentThresholdType"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("ComputeDeploymentThresholdValue"))) + { + this.ComputeDeploymentThresholdValue = (long)(this.MyInvocation?.BoundParameters["ComputeDeploymentThresholdValue"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("RuntimeProtectionConfigurationEnforcementLevel"))) + { + this.RuntimeProtectionConfigurationEnforcementLevel = (string)(this.MyInvocation?.BoundParameters["RuntimeProtectionConfigurationEnforcementLevel"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("SecretArchiveKeyVaultId"))) + { + this.SecretArchiveKeyVaultId = (string)(this.MyInvocation?.BoundParameters["SecretArchiveKeyVaultId"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("SecretArchiveUseKeyVault"))) + { + this.SecretArchiveUseKeyVault = (string)(this.MyInvocation?.BoundParameters["SecretArchiveUseKeyVault"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("UpdateStrategyMaxUnavailable"))) + { + this.UpdateStrategyMaxUnavailable = (long)(this.MyInvocation?.BoundParameters["UpdateStrategyMaxUnavailable"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("UpdateStrategyType"))) + { + this.UpdateStrategyType = (string)(this.MyInvocation?.BoundParameters["UpdateStrategyType"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("UpdateStrategyThresholdType"))) + { + this.UpdateStrategyThresholdType = (string)(this.MyInvocation?.BoundParameters["UpdateStrategyThresholdType"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("UpdateStrategyThresholdValue"))) + { + this.UpdateStrategyThresholdValue = (long)(this.MyInvocation?.BoundParameters["UpdateStrategyThresholdValue"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("UpdateStrategyWaitTimeMinute"))) + { + this.UpdateStrategyWaitTimeMinute = (long)(this.MyInvocation?.BoundParameters["UpdateStrategyWaitTimeMinute"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("AnalyticsOutputSettingsAssociatedIdentityType"))) + { + this.AnalyticsOutputSettingsAssociatedIdentityType = (string)(this.MyInvocation?.BoundParameters["AnalyticsOutputSettingsAssociatedIdentityType"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("AnalyticsOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId"))) + { + this.AnalyticsOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId = (string)(this.MyInvocation?.BoundParameters["AnalyticsOutputSettingsAssociatedIdentityUserAssignedIdentityResourceId"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("AssociatedIdentityType"))) + { + this.AssociatedIdentityType = (string)(this.MyInvocation?.BoundParameters["AssociatedIdentityType"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("AssociatedIdentityUserAssignedIdentityResourceId"))) + { + this.AssociatedIdentityUserAssignedIdentityResourceId = (string)(this.MyInvocation?.BoundParameters["AssociatedIdentityUserAssignedIdentityResourceId"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("SecretArchiveSettingsAssociatedIdentityType"))) + { + this.SecretArchiveSettingsAssociatedIdentityType = (string)(this.MyInvocation?.BoundParameters["SecretArchiveSettingsAssociatedIdentityType"]); + } + if ((bool)(true == this.MyInvocation?.BoundParameters.ContainsKey("SecretArchiveSettingsAssociatedIdentityUserAssignedIdentityResourceId"))) + { + this.SecretArchiveSettingsAssociatedIdentityUserAssignedIdentityResourceId = (string)(this.MyInvocation?.BoundParameters["SecretArchiveSettingsAssociatedIdentityUserAssignedIdentityResourceId"]); + } + } + /// new protected void WriteObject(object sendToPipeline) { @@ -916,12 +1133,12 @@ public UpdateAzNetworkCloudCluster_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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ) { @@ -938,15 +1155,15 @@ public UpdateAzNetworkCloudCluster_UpdateViaIdentityExpanded() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, body=_clusterUpdateParametersBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 { IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, body=_clusterUpdateParametersBody }) + 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 } }); @@ -956,12 +1173,12 @@ public UpdateAzNetworkCloudCluster_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.NetworkCloud.Models.Api20250201.ICluster + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICluster /// 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 ) { @@ -973,8 +1190,9 @@ public UpdateAzNetworkCloudCluster_UpdateViaIdentityExpanded() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICluster - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICluster + var result = (await response); + WriteObject(result, false); } } } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudConsole_UpdateExpanded.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudConsole_UpdateExpanded.cs index 32f2ef7ecf1c..b7c5b3b6584b 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudConsole_UpdateExpanded.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudConsole_UpdateExpanded.cs @@ -6,22 +6,25 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// /// Patch the properties of the provided virtual machine console, or update the tags associated with the virtual machine console. - /// Properties and tag updates can be done independently. + /// Properties and tag update can be done independently. /// /// /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/virtualMachines/{virtualMachineName}/consoles/{consoleName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzNetworkCloudConsole_UpdateExpanded", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsole))] - [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Patch the properties of the provided virtual machine console, or update the tags associated with the virtual machine console. Properties and tag updates can be done independently.")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsole))] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Patch the properties of the provided virtual machine console, or update the tags associated with the virtual machine console. Properties and tag update can be done independently.")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/virtualMachines/{virtualMachineName}/consoles/{consoleName}", ApiVersion = "2025-02-01")] public partial class UpdateAzNetworkCloudConsole_UpdateExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -40,7 +43,10 @@ public partial class UpdateAzNetworkCloudConsole_UpdateExpanded : global::System /// /// ConsolePatchParameters represents the body of the request to patch the virtual machine console. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsolePatchParameters _consoleUpdateParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ConsolePatchParameters(); + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsolePatchParameters _consoleUpdateParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ConsolePatchParameters(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] @@ -52,6 +58,9 @@ public partial class UpdateAzNetworkCloudConsole_UpdateExpanded : global::System [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -73,9 +82,9 @@ public partial class UpdateAzNetworkCloudConsole_UpdateExpanded : global::System ReadOnly = false, Description = @"The indicator of whether the console access is enabled.", SerializedName = @"enabled", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ConsoleEnabled) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ConsoleEnabled))] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ConsoleEnabled Enabled { get => _consoleUpdateParametersBody.Enabled ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ConsoleEnabled)""); set => _consoleUpdateParametersBody.Enabled = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("True", "False")] + public string Enabled { get => _consoleUpdateParametersBody.Enabled ?? null; set => _consoleUpdateParametersBody.Enabled = value; } /// The date and time after which the key will be disallowed access. [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The date and time after which the key will be disallowed access.")] @@ -88,6 +97,9 @@ public partial class UpdateAzNetworkCloudConsole_UpdateExpanded : global::System PossibleTypes = new [] { typeof(global::System.DateTime) })] public global::System.DateTime Expiration { get => _consoleUpdateParametersBody.Expiration ?? default(global::System.DateTime); set => _consoleUpdateParametersBody.Expiration = 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] @@ -171,7 +183,7 @@ public partial class UpdateAzNetworkCloudConsole_UpdateExpanded : global::System /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 +240,8 @@ public partial class UpdateAzNetworkCloudConsole_UpdateExpanded : global::System [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -241,8 +254,8 @@ public partial class UpdateAzNetworkCloudConsole_UpdateExpanded : global::System ReadOnly = false, Description = @"The Azure resource tags that will replace the existing ones.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsolePatchParametersTags) })] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsolePatchParametersTags Tag { get => _consoleUpdateParametersBody.Tag ?? null /* object */; set => _consoleUpdateParametersBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsolePatchParametersTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsolePatchParametersTags Tag { get => _consoleUpdateParametersBody.Tag ?? null /* object */; set => _consoleUpdateParametersBody.Tag = value; } /// Backing field for property. private string _virtualMachineName; @@ -263,24 +276,24 @@ public partial class UpdateAzNetworkCloudConsole_UpdateExpanded : 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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IConsole + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsole /// 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) @@ -394,11 +407,36 @@ 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.NetworkCloud.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -410,10 +448,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -481,7 +535,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -494,12 +548,12 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.ConsolesUpdate(SubscriptionId, ResourceGroupName, VirtualMachineName, Name, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _consoleUpdateParametersBody, onOk, onDefault, this, Pipeline); + await this.Client.ConsolesUpdate(SubscriptionId, ResourceGroupName, VirtualMachineName, Name, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _consoleUpdateParametersBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate); await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,VirtualMachineName=VirtualMachineName,Name=Name,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null,body=_consoleUpdateParametersBody}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,VirtualMachineName=VirtualMachineName,Name=Name,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -519,7 +573,7 @@ protected override void StopProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public UpdateAzNetworkCloudConsole_UpdateExpanded() { @@ -545,12 +599,12 @@ public UpdateAzNetworkCloudConsole_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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ) { @@ -567,15 +621,15 @@ public UpdateAzNetworkCloudConsole_UpdateExpanded() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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, VirtualMachineName=VirtualMachineName, Name=Name, IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, body=_consoleUpdateParametersBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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, VirtualMachineName=VirtualMachineName, Name=Name, IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, body=_consoleUpdateParametersBody }) + 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 } }); @@ -585,12 +639,12 @@ public UpdateAzNetworkCloudConsole_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.NetworkCloud.Models.Api20250201.IConsole + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsole /// 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 ) { @@ -602,8 +656,9 @@ public UpdateAzNetworkCloudConsole_UpdateExpanded() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsole - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsole + var result = (await response); + WriteObject(result, false); } } } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudConsole_UpdateViaIdentityExpanded.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudConsole_UpdateViaIdentityExpanded.cs index 8e32ee0819e2..64e55b963dc5 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudConsole_UpdateViaIdentityExpanded.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudConsole_UpdateViaIdentityExpanded.cs @@ -6,22 +6,25 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// /// Patch the properties of the provided virtual machine console, or update the tags associated with the virtual machine console. - /// Properties and tag updates can be done independently. + /// Properties and tag update can be done independently. /// /// /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/virtualMachines/{virtualMachineName}/consoles/{consoleName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzNetworkCloudConsole_UpdateViaIdentityExpanded", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsole))] - [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Patch the properties of the provided virtual machine console, or update the tags associated with the virtual machine console. Properties and tag updates can be done independently.")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsole))] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Patch the properties of the provided virtual machine console, or update the tags associated with the virtual machine console. Properties and tag update can be done independently.")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/virtualMachines/{virtualMachineName}/consoles/{consoleName}", ApiVersion = "2025-02-01")] public partial class UpdateAzNetworkCloudConsole_UpdateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -40,7 +43,10 @@ public partial class UpdateAzNetworkCloudConsole_UpdateViaIdentityExpanded : glo /// /// ConsolePatchParameters represents the body of the request to patch the virtual machine console. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsolePatchParameters _consoleUpdateParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ConsolePatchParameters(); + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsolePatchParameters _consoleUpdateParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ConsolePatchParameters(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] @@ -52,6 +58,9 @@ public partial class UpdateAzNetworkCloudConsole_UpdateViaIdentityExpanded : glo [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -73,9 +82,9 @@ public partial class UpdateAzNetworkCloudConsole_UpdateViaIdentityExpanded : glo ReadOnly = false, Description = @"The indicator of whether the console access is enabled.", SerializedName = @"enabled", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ConsoleEnabled) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ConsoleEnabled))] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ConsoleEnabled Enabled { get => _consoleUpdateParametersBody.Enabled ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.ConsoleEnabled)""); set => _consoleUpdateParametersBody.Enabled = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("True", "False")] + public string Enabled { get => _consoleUpdateParametersBody.Enabled ?? null; set => _consoleUpdateParametersBody.Enabled = value; } /// The date and time after which the key will be disallowed access. [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The date and time after which the key will be disallowed access.")] @@ -88,6 +97,9 @@ public partial class UpdateAzNetworkCloudConsole_UpdateViaIdentityExpanded : glo PossibleTypes = new [] { typeof(global::System.DateTime) })] public global::System.DateTime Expiration { get => _consoleUpdateParametersBody.Expiration ?? default(global::System.DateTime); set => _consoleUpdateParametersBody.Expiration = 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] @@ -164,7 +176,7 @@ public partial class UpdateAzNetworkCloudConsole_UpdateViaIdentityExpanded : glo /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,32 +214,32 @@ public partial class UpdateAzNetworkCloudConsole_UpdateViaIdentityExpanded : glo ReadOnly = false, Description = @"The Azure resource tags that will replace the existing ones.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsolePatchParametersTags) })] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsolePatchParametersTags Tag { get => _consoleUpdateParametersBody.Tag ?? null /* object */; set => _consoleUpdateParametersBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsolePatchParametersTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsolePatchParametersTags Tag { get => _consoleUpdateParametersBody.Tag ?? null /* object */; set => _consoleUpdateParametersBody.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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IConsole + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsole /// 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) @@ -337,11 +349,36 @@ 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.NetworkCloud.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -353,10 +390,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -424,7 +477,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -439,7 +492,7 @@ protected override void ProcessRecord() await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } if (InputObject?.Id != null) { - await this.Client.ConsolesUpdateViaIdentity(InputObject.Id, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _consoleUpdateParametersBody, onOk, onDefault, this, Pipeline); + await this.Client.ConsolesUpdateViaIdentity(InputObject.Id, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _consoleUpdateParametersBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate); } else { @@ -460,13 +513,13 @@ protected override void ProcessRecord() { ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ConsoleName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); } - await this.Client.ConsolesUpdate(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.VirtualMachineName ?? null, InputObject.ConsoleName ?? null, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _consoleUpdateParametersBody, onOk, onDefault, this, Pipeline); + await this.Client.ConsolesUpdate(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.VirtualMachineName ?? null, InputObject.ConsoleName ?? null, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _consoleUpdateParametersBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate); } await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null,body=_consoleUpdateParametersBody}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -486,7 +539,7 @@ protected override void StopProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public UpdateAzNetworkCloudConsole_UpdateViaIdentityExpanded() { @@ -512,12 +565,12 @@ public UpdateAzNetworkCloudConsole_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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ) { @@ -534,15 +587,15 @@ public UpdateAzNetworkCloudConsole_UpdateViaIdentityExpanded() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, body=_consoleUpdateParametersBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 { IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, body=_consoleUpdateParametersBody }) + 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 } }); @@ -552,12 +605,12 @@ public UpdateAzNetworkCloudConsole_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.NetworkCloud.Models.Api20250201.IConsole + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsole /// 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 ) { @@ -569,8 +622,9 @@ public UpdateAzNetworkCloudConsole_UpdateViaIdentityExpanded() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IConsole - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsole + var result = (await response); + WriteObject(result, false); } } } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudConsole_UpdateViaIdentityVirtualMachineExpanded.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudConsole_UpdateViaIdentityVirtualMachineExpanded.cs new file mode 100644 index 000000000000..d5b9f61b2d7d --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudConsole_UpdateViaIdentityVirtualMachineExpanded.cs @@ -0,0 +1,647 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; + using System; + + /// + /// Patch the properties of the provided virtual machine console, or update the tags associated with the virtual machine console. + /// Properties and tag update can be done independently. + /// + /// + /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/virtualMachines/{virtualMachineName}/consoles/{consoleName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzNetworkCloudConsole_UpdateViaIdentityVirtualMachineExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsole))] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Patch the properties of the provided virtual machine console, or update the tags associated with the virtual machine console. Properties and tag update can be done independently.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/virtualMachines/{virtualMachineName}/consoles/{consoleName}", ApiVersion = "2025-02-01")] + public partial class UpdateAzNetworkCloudConsole_UpdateViaIdentityVirtualMachineExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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(); + + /// + /// ConsolePatchParameters represents the body of the request to patch the virtual machine console. + /// + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsolePatchParameters _consoleUpdateParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ConsolePatchParameters(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// The indicator of whether the console access is enabled. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The indicator of whether the console access is enabled.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The indicator of whether the console access is enabled.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("True", "False")] + public string Enabled { get => _consoleUpdateParametersBody.Enabled ?? null; set => _consoleUpdateParametersBody.Enabled = value; } + + /// The date and time after which the key will be disallowed access. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The date and time after which the key will be disallowed access.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The date and time after which the key will be disallowed access.", + SerializedName = @"expiration", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + public global::System.DateTime Expiration { get => _consoleUpdateParametersBody.Expiration ?? default(global::System.DateTime); set => _consoleUpdateParametersBody.Expiration = 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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private string _ifMatch; + + /// + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value + /// to prevent accidentally overwriting concurrent changes. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes.", + SerializedName = @"If-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Header)] + public string IfMatch { get => this._ifMatch; set => this._ifMatch = value; } + + /// Backing field for property. + private string _ifNoneMatch; + + /// + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result + /// in error from server as they are not supported. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result in error from server as they are not supported.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result in error from server as they are not supported.", + SerializedName = @"If-None-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Header)] + public string IfNoneMatch { get => this._ifNoneMatch; set => this._ifNoneMatch = 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.NetworkCloud.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of the virtual machine console. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the virtual machine console.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the virtual machine console.", + SerializedName = @"consoleName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("ConsoleName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// The SSH public key data. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The SSH public key data.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The SSH public key data.", + SerializedName = @"keyData", + PossibleTypes = new [] { typeof(string) })] + public string SshPublicKeyData { get => _consoleUpdateParametersBody.SshPublicKeyData ?? null; set => _consoleUpdateParametersBody.SshPublicKeyData = value; } + + /// The Azure resource tags that will replace the existing ones. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ExportAs(typeof(global::System.Collections.Hashtable))] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The Azure resource tags that will replace the existing ones.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The Azure resource tags that will replace the existing ones.", + SerializedName = @"tags", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsolePatchParametersTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsolePatchParametersTags Tag { get => _consoleUpdateParametersBody.Tag ?? null /* object */; set => _consoleUpdateParametersBody.Tag = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity _virtualMachineInputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity VirtualMachineInputObject { get => this._virtualMachineInputObject; set => this._virtualMachineInputObject = 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.NetworkCloud.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.NetworkCloud.Models.IConsole + /// 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.NetworkCloud.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of UpdateAzNetworkCloudConsole_UpdateViaIdentityVirtualMachineExpanded + /// + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets.UpdateAzNetworkCloudConsole_UpdateViaIdentityVirtualMachineExpanded Clone() + { + var clone = new UpdateAzNetworkCloudConsole_UpdateViaIdentityVirtualMachineExpanded(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone._consoleUpdateParametersBody = this._consoleUpdateParametersBody; + clone.IfMatch = this.IfMatch; + clone.IfNoneMatch = this.IfNoneMatch; + clone.Name = this.Name; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ConsolesUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (VirtualMachineInputObject?.Id != null) + { + this.VirtualMachineInputObject.Id += $"/consoles/{(global::System.Uri.EscapeDataString(this.Name.ToString()))}"; + await this.Client.ConsolesUpdateViaIdentity(VirtualMachineInputObject.Id, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _consoleUpdateParametersBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate); + } + else + { + // try to call with PATH parameters from Input Object + if (null == VirtualMachineInputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("VirtualMachineInputObject has null value for VirtualMachineInputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, VirtualMachineInputObject) ); + } + if (null == VirtualMachineInputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("VirtualMachineInputObject has null value for VirtualMachineInputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, VirtualMachineInputObject) ); + } + if (null == VirtualMachineInputObject.VirtualMachineName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("VirtualMachineInputObject has null value for VirtualMachineInputObject.VirtualMachineName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, VirtualMachineInputObject) ); + } + await this.Client.ConsolesUpdate(VirtualMachineInputObject.SubscriptionId ?? null, VirtualMachineInputObject.ResourceGroupName ?? null, VirtualMachineInputObject.VirtualMachineName ?? null, Name, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _consoleUpdateParametersBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Name=Name,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Initializes a new instance of the cmdlet + /// class. + /// + public UpdateAzNetworkCloudConsole_UpdateViaIdentityVirtualMachineExpanded() + { + + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.IConsole + /// 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.NetworkCloud.Models.IConsole + var result = (await response); + WriteObject(result, false); + } + } + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudConsole_UpdateViaJsonFilePath.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudConsole_UpdateViaJsonFilePath.cs new file mode 100644 index 000000000000..ccc04f02d511 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudConsole_UpdateViaJsonFilePath.cs @@ -0,0 +1,630 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; + using System; + + /// + /// Patch the properties of the provided virtual machine console, or update the tags associated with the virtual machine console. + /// Properties and tag update can be done independently. + /// + /// + /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/virtualMachines/{virtualMachineName}/consoles/{consoleName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzNetworkCloudConsole_UpdateViaJsonFilePath", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsole))] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Patch the properties of the provided virtual machine console, or update the tags associated with the virtual machine console. Properties and tag update can be done independently.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/virtualMachines/{virtualMachineName}/consoles/{consoleName}", ApiVersion = "2025-02-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.NotSuggestDefaultParameterSet] + public partial class UpdateAzNetworkCloudConsole_UpdateViaJsonFilePath : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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(); + + public global::System.String _jsonString; + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private string _ifMatch; + + /// + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value + /// to prevent accidentally overwriting concurrent changes. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes.", + SerializedName = @"If-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Header)] + public string IfMatch { get => this._ifMatch; set => this._ifMatch = value; } + + /// Backing field for property. + private string _ifNoneMatch; + + /// + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result + /// in error from server as they are not supported. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result in error from server as they are not supported.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result in error from server as they are not supported.", + SerializedName = @"If-None-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Header)] + public string IfNoneMatch { get => this._ifNoneMatch; set => this._ifNoneMatch = 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 _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.NetworkCloud.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.NetworkCloud.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of the virtual machine console. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the virtual machine console.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the virtual machine console.", + SerializedName = @"consoleName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("ConsoleName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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. The value must be an UUID. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription. The value must be an UUID.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription. The value must be an UUID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Backing field for property. + private string _virtualMachineName; + + /// The name of the virtual machine. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the virtual machine.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the virtual machine.", + SerializedName = @"virtualMachineName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] + public string VirtualMachineName { get => this._virtualMachineName; set => this._virtualMachineName = 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.NetworkCloud.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.NetworkCloud.Models.IConsole + /// 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.NetworkCloud.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of UpdateAzNetworkCloudConsole_UpdateViaJsonFilePath + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets.UpdateAzNetworkCloudConsole_UpdateViaJsonFilePath Clone() + { + var clone = new UpdateAzNetworkCloudConsole_UpdateViaJsonFilePath(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.VirtualMachineName = this.VirtualMachineName; + clone.Name = this.Name; + clone.IfMatch = this.IfMatch; + clone.IfNoneMatch = this.IfNoneMatch; + clone.JsonFilePath = this.JsonFilePath; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ConsolesUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ConsolesUpdateViaJsonString(SubscriptionId, ResourceGroupName, VirtualMachineName, Name, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _jsonString, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,VirtualMachineName=VirtualMachineName,Name=Name,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public UpdateAzNetworkCloudConsole_UpdateViaJsonFilePath() + { + + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.IConsole + /// 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.NetworkCloud.Models.IConsole + var result = (await response); + WriteObject(result, false); + } + } + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudConsole_UpdateViaJsonString.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudConsole_UpdateViaJsonString.cs new file mode 100644 index 000000000000..ee4426cb7935 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudConsole_UpdateViaJsonString.cs @@ -0,0 +1,628 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; + using System; + + /// + /// Patch the properties of the provided virtual machine console, or update the tags associated with the virtual machine console. + /// Properties and tag update can be done independently. + /// + /// + /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/virtualMachines/{virtualMachineName}/consoles/{consoleName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzNetworkCloudConsole_UpdateViaJsonString", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IConsole))] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Patch the properties of the provided virtual machine console, or update the tags associated with the virtual machine console. Properties and tag update can be done independently.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/virtualMachines/{virtualMachineName}/consoles/{consoleName}", ApiVersion = "2025-02-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.NotSuggestDefaultParameterSet] + public partial class UpdateAzNetworkCloudConsole_UpdateViaJsonString : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private string _ifMatch; + + /// + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value + /// to prevent accidentally overwriting concurrent changes. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes.", + SerializedName = @"If-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Header)] + public string IfMatch { get => this._ifMatch; set => this._ifMatch = value; } + + /// Backing field for property. + private string _ifNoneMatch; + + /// + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result + /// in error from server as they are not supported. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result in error from server as they are not supported.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result in error from server as they are not supported.", + SerializedName = @"If-None-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Header)] + public string IfNoneMatch { get => this._ifNoneMatch; set => this._ifNoneMatch = 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.NetworkCloud.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.NetworkCloud.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of the virtual machine console. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the virtual machine console.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the virtual machine console.", + SerializedName = @"consoleName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("ConsoleName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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. The value must be an UUID. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription. The value must be an UUID.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription. The value must be an UUID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Backing field for property. + private string _virtualMachineName; + + /// The name of the virtual machine. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the virtual machine.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the virtual machine.", + SerializedName = @"virtualMachineName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] + public string VirtualMachineName { get => this._virtualMachineName; set => this._virtualMachineName = 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.NetworkCloud.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.NetworkCloud.Models.IConsole + /// 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.NetworkCloud.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of UpdateAzNetworkCloudConsole_UpdateViaJsonString + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets.UpdateAzNetworkCloudConsole_UpdateViaJsonString Clone() + { + var clone = new UpdateAzNetworkCloudConsole_UpdateViaJsonString(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.VirtualMachineName = this.VirtualMachineName; + clone.Name = this.Name; + clone.IfMatch = this.IfMatch; + clone.IfNoneMatch = this.IfNoneMatch; + clone.JsonString = this.JsonString; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ConsolesUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ConsolesUpdateViaJsonString(SubscriptionId, ResourceGroupName, VirtualMachineName, Name, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _jsonString, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,VirtualMachineName=VirtualMachineName,Name=Name,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public UpdateAzNetworkCloudConsole_UpdateViaJsonString() + { + + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.IConsole + /// 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.NetworkCloud.Models.IConsole + var result = (await response); + WriteObject(result, false); + } + } + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudKubernetesClusterFeature_UpdateExpanded.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudKubernetesClusterFeature_UpdateExpanded.cs index b4a122b1582e..df907a5b43a1 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudKubernetesClusterFeature_UpdateExpanded.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudKubernetesClusterFeature_UpdateExpanded.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// Patch properties of the provided Kubernetes cluster feature. @@ -13,13 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/kubernetesClusters/{kubernetesClusterName}/features/{featureName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzNetworkCloudKubernetesClusterFeature_UpdateExpanded", SupportsShouldProcess = true)] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeature", "15.0.0", "2.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"Option"}, NewOutputProperties=new string[] {"Option"}, ChangeDescription="The type of property will be changed from fixed array to 'List'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeature))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeature))] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Patch properties of the provided Kubernetes cluster feature.")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/kubernetesClusters/{kubernetesClusterName}/features/{featureName}", ApiVersion = "2025-02-01")] public partial class UpdateAzNetworkCloudKubernetesClusterFeature_UpdateExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,10 +37,13 @@ public partial class UpdateAzNetworkCloudKubernetesClusterFeature_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(); + /// /// KubernetesClusterFeaturePatchParameters represents the body of the request to patch the Kubernetes cluster feature. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeaturePatchParameters _kubernetesClusterFeatureUpdateParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.KubernetesClusterFeaturePatchParameters(); + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeaturePatchParameters _kubernetesClusterFeatureUpdateParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.KubernetesClusterFeaturePatchParameters(); /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] @@ -50,6 +55,9 @@ public partial class UpdateAzNetworkCloudKubernetesClusterFeature_UpdateExpanded [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -63,6 +71,9 @@ public partial class UpdateAzNetworkCloudKubernetesClusterFeature_UpdateExpanded [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 _featureName; @@ -165,13 +176,13 @@ public partial class UpdateAzNetworkCloudKubernetesClusterFeature_UpdateExpanded ReadOnly = false, Description = @"The configured options for the feature.", SerializedName = @"options", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStringKeyValuePair) })] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStringKeyValuePair[] Option { get => _kubernetesClusterFeatureUpdateParametersBody.Option ?? null /* arrayOf */; set => _kubernetesClusterFeatureUpdateParametersBody.Option = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStringKeyValuePair) })] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStringKeyValuePair[] Option { get => _kubernetesClusterFeatureUpdateParametersBody.Option?.ToArray() ?? null /* fixedArrayOf */; set => _kubernetesClusterFeatureUpdateParametersBody.Option = (value != null ? new System.Collections.Generic.List(value) : null); } /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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")] @@ -217,7 +228,8 @@ public partial class UpdateAzNetworkCloudKubernetesClusterFeature_UpdateExpanded [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -230,32 +242,32 @@ public partial class UpdateAzNetworkCloudKubernetesClusterFeature_UpdateExpanded ReadOnly = false, Description = @"The Azure resource tags that will replace the existing ones.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeaturePatchParametersTags) })] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeaturePatchParametersTags Tag { get => _kubernetesClusterFeatureUpdateParametersBody.Tag ?? null /* object */; set => _kubernetesClusterFeatureUpdateParametersBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeaturePatchParametersTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeaturePatchParametersTags Tag { get => _kubernetesClusterFeatureUpdateParametersBody.Tag ?? null /* object */; set => _kubernetesClusterFeatureUpdateParametersBody.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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IKubernetesClusterFeature + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeature /// 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) @@ -371,11 +383,36 @@ 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.NetworkCloud.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -387,10 +424,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -458,7 +511,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -471,12 +524,12 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.KubernetesClusterFeaturesUpdate(SubscriptionId, ResourceGroupName, KubernetesClusterName, FeatureName, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _kubernetesClusterFeatureUpdateParametersBody, onOk, onDefault, this, Pipeline); + await this.Client.KubernetesClusterFeaturesUpdate(SubscriptionId, ResourceGroupName, KubernetesClusterName, FeatureName, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _kubernetesClusterFeatureUpdateParametersBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate); await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,KubernetesClusterName=KubernetesClusterName,FeatureName=FeatureName,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null,body=_kubernetesClusterFeatureUpdateParametersBody}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,KubernetesClusterName=KubernetesClusterName,FeatureName=FeatureName,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -496,7 +549,7 @@ protected override void StopProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public UpdateAzNetworkCloudKubernetesClusterFeature_UpdateExpanded() { @@ -522,12 +575,12 @@ public UpdateAzNetworkCloudKubernetesClusterFeature_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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ) { @@ -544,15 +597,15 @@ public UpdateAzNetworkCloudKubernetesClusterFeature_UpdateExpanded() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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, KubernetesClusterName=KubernetesClusterName, FeatureName=FeatureName, IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, body=_kubernetesClusterFeatureUpdateParametersBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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, KubernetesClusterName=KubernetesClusterName, FeatureName=FeatureName, IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, body=_kubernetesClusterFeatureUpdateParametersBody }) + 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 } }); @@ -562,12 +615,12 @@ public UpdateAzNetworkCloudKubernetesClusterFeature_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.NetworkCloud.Models.Api20250201.IKubernetesClusterFeature + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeature /// 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 ) { @@ -579,8 +632,9 @@ public UpdateAzNetworkCloudKubernetesClusterFeature_UpdateExpanded() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeature - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeature + var result = (await response); + WriteObject(result, false); } } } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudKubernetesClusterFeature_UpdateViaIdentityExpanded.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudKubernetesClusterFeature_UpdateViaIdentityExpanded.cs index 26d71f52595c..8c74e3ffaa84 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudKubernetesClusterFeature_UpdateViaIdentityExpanded.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudKubernetesClusterFeature_UpdateViaIdentityExpanded.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// Patch properties of the provided Kubernetes cluster feature. @@ -13,13 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/kubernetesClusters/{kubernetesClusterName}/features/{featureName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzNetworkCloudKubernetesClusterFeature_UpdateViaIdentityExpanded", SupportsShouldProcess = true)] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeature", "15.0.0", "2.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"Option"}, NewOutputProperties=new string[] {"Option"}, ChangeDescription="The type of property will be changed from fixed array to 'List'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeature))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeature))] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Patch properties of the provided Kubernetes cluster feature.")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/kubernetesClusters/{kubernetesClusterName}/features/{featureName}", ApiVersion = "2025-02-01")] public partial class UpdateAzNetworkCloudKubernetesClusterFeature_UpdateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,10 +37,13 @@ public partial class UpdateAzNetworkCloudKubernetesClusterFeature_UpdateViaIdent /// 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(); + /// /// KubernetesClusterFeaturePatchParameters represents the body of the request to patch the Kubernetes cluster feature. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeaturePatchParameters _kubernetesClusterFeatureUpdateParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.KubernetesClusterFeaturePatchParameters(); + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeaturePatchParameters _kubernetesClusterFeatureUpdateParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.KubernetesClusterFeaturePatchParameters(); /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] @@ -50,6 +55,9 @@ public partial class UpdateAzNetworkCloudKubernetesClusterFeature_UpdateViaIdent [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -63,6 +71,9 @@ public partial class UpdateAzNetworkCloudKubernetesClusterFeature_UpdateViaIdent [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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] @@ -145,13 +156,13 @@ public partial class UpdateAzNetworkCloudKubernetesClusterFeature_UpdateViaIdent ReadOnly = false, Description = @"The configured options for the feature.", SerializedName = @"options", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStringKeyValuePair) })] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStringKeyValuePair[] Option { get => _kubernetesClusterFeatureUpdateParametersBody.Option ?? null /* arrayOf */; set => _kubernetesClusterFeatureUpdateParametersBody.Option = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStringKeyValuePair) })] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStringKeyValuePair[] Option { get => _kubernetesClusterFeatureUpdateParametersBody.Option?.ToArray() ?? null /* fixedArrayOf */; set => _kubernetesClusterFeatureUpdateParametersBody.Option = (value != null ? new System.Collections.Generic.List(value) : null); } /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,32 +189,32 @@ public partial class UpdateAzNetworkCloudKubernetesClusterFeature_UpdateViaIdent ReadOnly = false, Description = @"The Azure resource tags that will replace the existing ones.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeaturePatchParametersTags) })] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeaturePatchParametersTags Tag { get => _kubernetesClusterFeatureUpdateParametersBody.Tag ?? null /* object */; set => _kubernetesClusterFeatureUpdateParametersBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeaturePatchParametersTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeaturePatchParametersTags Tag { get => _kubernetesClusterFeatureUpdateParametersBody.Tag ?? null /* object */; set => _kubernetesClusterFeatureUpdateParametersBody.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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IKubernetesClusterFeature + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeature /// 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) @@ -315,11 +326,36 @@ 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.NetworkCloud.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -331,10 +367,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -402,7 +454,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -417,7 +469,7 @@ protected override void ProcessRecord() await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } if (InputObject?.Id != null) { - await this.Client.KubernetesClusterFeaturesUpdateViaIdentity(InputObject.Id, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _kubernetesClusterFeatureUpdateParametersBody, onOk, onDefault, this, Pipeline); + await this.Client.KubernetesClusterFeaturesUpdateViaIdentity(InputObject.Id, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _kubernetesClusterFeatureUpdateParametersBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate); } else { @@ -438,13 +490,13 @@ protected override void ProcessRecord() { ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.FeatureName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); } - await this.Client.KubernetesClusterFeaturesUpdate(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.KubernetesClusterName ?? null, InputObject.FeatureName ?? null, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _kubernetesClusterFeatureUpdateParametersBody, onOk, onDefault, this, Pipeline); + await this.Client.KubernetesClusterFeaturesUpdate(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.KubernetesClusterName ?? null, InputObject.FeatureName ?? null, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _kubernetesClusterFeatureUpdateParametersBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate); } await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null,body=_kubernetesClusterFeatureUpdateParametersBody}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -464,7 +516,7 @@ protected override void StopProcessing() } /// - /// Intializes a new instance of the + /// Initializes a new instance of the /// cmdlet class. /// public UpdateAzNetworkCloudKubernetesClusterFeature_UpdateViaIdentityExpanded() @@ -491,12 +543,12 @@ public UpdateAzNetworkCloudKubernetesClusterFeature_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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ) { @@ -513,15 +565,15 @@ public UpdateAzNetworkCloudKubernetesClusterFeature_UpdateViaIdentityExpanded() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, body=_kubernetesClusterFeatureUpdateParametersBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 { IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, body=_kubernetesClusterFeatureUpdateParametersBody }) + 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 } }); @@ -531,12 +583,12 @@ public UpdateAzNetworkCloudKubernetesClusterFeature_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.NetworkCloud.Models.Api20250201.IKubernetesClusterFeature + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeature /// 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 ) { @@ -548,8 +600,9 @@ public UpdateAzNetworkCloudKubernetesClusterFeature_UpdateViaIdentityExpanded() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterFeature - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeature + var result = (await response); + WriteObject(result, false); } } } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudKubernetesClusterFeature_UpdateViaIdentityKubernetesClusterExpanded.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudKubernetesClusterFeature_UpdateViaIdentityKubernetesClusterExpanded.cs new file mode 100644 index 000000000000..937209042aee --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudKubernetesClusterFeature_UpdateViaIdentityKubernetesClusterExpanded.cs @@ -0,0 +1,621 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; + using System; + + /// Patch properties of the provided Kubernetes cluster feature. + /// + /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/kubernetesClusters/{kubernetesClusterName}/features/{featureName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzNetworkCloudKubernetesClusterFeature_UpdateViaIdentityKubernetesClusterExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeature))] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Patch properties of the provided Kubernetes cluster feature.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/kubernetesClusters/{kubernetesClusterName}/features/{featureName}", ApiVersion = "2025-02-01")] + public partial class UpdateAzNetworkCloudKubernetesClusterFeature_UpdateViaIdentityKubernetesClusterExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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(); + + /// + /// KubernetesClusterFeaturePatchParameters represents the body of the request to patch the Kubernetes cluster feature. + /// + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeaturePatchParameters _kubernetesClusterFeatureUpdateParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.KubernetesClusterFeaturePatchParameters(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 _featureName; + + /// The name of the feature. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the feature.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the feature.", + SerializedName = @"featureName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] + public string FeatureName { get => this._featureName; set => this._featureName = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private string _ifMatch; + + /// + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value + /// to prevent accidentally overwriting concurrent changes. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes.", + SerializedName = @"If-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Header)] + public string IfMatch { get => this._ifMatch; set => this._ifMatch = value; } + + /// Backing field for property. + private string _ifNoneMatch; + + /// + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result + /// in error from server as they are not supported. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result in error from server as they are not supported.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result in error from server as they are not supported.", + SerializedName = @"If-None-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Header)] + public string IfNoneMatch { get => this._ifNoneMatch; set => this._ifNoneMatch = 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 Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity _kubernetesClusterInputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity KubernetesClusterInputObject { get => this._kubernetesClusterInputObject; set => this._kubernetesClusterInputObject = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// The configured options for the feature. + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The configured options for the feature.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The configured options for the feature.", + SerializedName = @"options", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStringKeyValuePair) })] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStringKeyValuePair[] Option { get => _kubernetesClusterFeatureUpdateParametersBody.Option?.ToArray() ?? null /* fixedArrayOf */; set => _kubernetesClusterFeatureUpdateParametersBody.Option = (value != null ? new System.Collections.Generic.List(value) : null); } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// The Azure resource tags that will replace the existing ones. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ExportAs(typeof(global::System.Collections.Hashtable))] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The Azure resource tags that will replace the existing ones.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The Azure resource tags that will replace the existing ones.", + SerializedName = @"tags", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeaturePatchParametersTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeaturePatchParametersTags Tag { get => _kubernetesClusterFeatureUpdateParametersBody.Tag ?? null /* object */; set => _kubernetesClusterFeatureUpdateParametersBody.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.NetworkCloud.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.NetworkCloud.Models.IKubernetesClusterFeature + /// 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.NetworkCloud.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of UpdateAzNetworkCloudKubernetesClusterFeature_UpdateViaIdentityKubernetesClusterExpanded + /// + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets.UpdateAzNetworkCloudKubernetesClusterFeature_UpdateViaIdentityKubernetesClusterExpanded Clone() + { + var clone = new UpdateAzNetworkCloudKubernetesClusterFeature_UpdateViaIdentityKubernetesClusterExpanded(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone._kubernetesClusterFeatureUpdateParametersBody = this._kubernetesClusterFeatureUpdateParametersBody; + clone.IfMatch = this.IfMatch; + clone.IfNoneMatch = this.IfNoneMatch; + clone.FeatureName = this.FeatureName; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'KubernetesClusterFeaturesUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (KubernetesClusterInputObject?.Id != null) + { + this.KubernetesClusterInputObject.Id += $"/features/{(global::System.Uri.EscapeDataString(this.FeatureName.ToString()))}"; + await this.Client.KubernetesClusterFeaturesUpdateViaIdentity(KubernetesClusterInputObject.Id, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _kubernetesClusterFeatureUpdateParametersBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate); + } + else + { + // try to call with PATH parameters from Input Object + if (null == KubernetesClusterInputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("KubernetesClusterInputObject has null value for KubernetesClusterInputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, KubernetesClusterInputObject) ); + } + if (null == KubernetesClusterInputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("KubernetesClusterInputObject has null value for KubernetesClusterInputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, KubernetesClusterInputObject) ); + } + if (null == KubernetesClusterInputObject.KubernetesClusterName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("KubernetesClusterInputObject has null value for KubernetesClusterInputObject.KubernetesClusterName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, KubernetesClusterInputObject) ); + } + await this.Client.KubernetesClusterFeaturesUpdate(KubernetesClusterInputObject.SubscriptionId ?? null, KubernetesClusterInputObject.ResourceGroupName ?? null, KubernetesClusterInputObject.KubernetesClusterName ?? null, FeatureName, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _kubernetesClusterFeatureUpdateParametersBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { FeatureName=FeatureName,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public UpdateAzNetworkCloudKubernetesClusterFeature_UpdateViaIdentityKubernetesClusterExpanded() + { + + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.IKubernetesClusterFeature + /// 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.NetworkCloud.Models.IKubernetesClusterFeature + var result = (await response); + WriteObject(result, false); + } + } + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudKubernetesClusterFeature_UpdateViaJsonFilePath.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudKubernetesClusterFeature_UpdateViaJsonFilePath.cs new file mode 100644 index 000000000000..8dce8233a09c --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudKubernetesClusterFeature_UpdateViaJsonFilePath.cs @@ -0,0 +1,629 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; + using System; + + /// Patch properties of the provided Kubernetes cluster feature. + /// + /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/kubernetesClusters/{kubernetesClusterName}/features/{featureName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzNetworkCloudKubernetesClusterFeature_UpdateViaJsonFilePath", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeature))] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Patch properties of the provided Kubernetes cluster feature.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/kubernetesClusters/{kubernetesClusterName}/features/{featureName}", ApiVersion = "2025-02-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.NotSuggestDefaultParameterSet] + public partial class UpdateAzNetworkCloudKubernetesClusterFeature_UpdateViaJsonFilePath : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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(); + + public global::System.String _jsonString; + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 _featureName; + + /// The name of the feature. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the feature.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the feature.", + SerializedName = @"featureName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] + public string FeatureName { get => this._featureName; set => this._featureName = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private string _ifMatch; + + /// + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value + /// to prevent accidentally overwriting concurrent changes. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes.", + SerializedName = @"If-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Header)] + public string IfMatch { get => this._ifMatch; set => this._ifMatch = value; } + + /// Backing field for property. + private string _ifNoneMatch; + + /// + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result + /// in error from server as they are not supported. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result in error from server as they are not supported.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result in error from server as they are not supported.", + SerializedName = @"If-None-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Header)] + public string IfNoneMatch { get => this._ifNoneMatch; set => this._ifNoneMatch = 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 _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.NetworkCloud.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 _kubernetesClusterName; + + /// The name of the Kubernetes cluster. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the Kubernetes cluster.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the Kubernetes cluster.", + SerializedName = @"kubernetesClusterName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] + public string KubernetesClusterName { get => this._kubernetesClusterName; set => this._kubernetesClusterName = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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. The value must be an UUID. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription. The value must be an UUID.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription. The value must be an UUID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.IKubernetesClusterFeature + /// 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.NetworkCloud.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of UpdateAzNetworkCloudKubernetesClusterFeature_UpdateViaJsonFilePath + /// + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets.UpdateAzNetworkCloudKubernetesClusterFeature_UpdateViaJsonFilePath Clone() + { + var clone = new UpdateAzNetworkCloudKubernetesClusterFeature_UpdateViaJsonFilePath(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.KubernetesClusterName = this.KubernetesClusterName; + clone.FeatureName = this.FeatureName; + clone.IfMatch = this.IfMatch; + clone.IfNoneMatch = this.IfNoneMatch; + clone.JsonFilePath = this.JsonFilePath; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'KubernetesClusterFeaturesUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.KubernetesClusterFeaturesUpdateViaJsonString(SubscriptionId, ResourceGroupName, KubernetesClusterName, FeatureName, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _jsonString, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,KubernetesClusterName=KubernetesClusterName,FeatureName=FeatureName,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Initializes a new instance of the cmdlet + /// class. + /// + public UpdateAzNetworkCloudKubernetesClusterFeature_UpdateViaJsonFilePath() + { + + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.IKubernetesClusterFeature + /// 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.NetworkCloud.Models.IKubernetesClusterFeature + var result = (await response); + WriteObject(result, false); + } + } + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudKubernetesClusterFeature_UpdateViaJsonString.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudKubernetesClusterFeature_UpdateViaJsonString.cs new file mode 100644 index 000000000000..6d4aba4df73e --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudKubernetesClusterFeature_UpdateViaJsonString.cs @@ -0,0 +1,627 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; + using System; + + /// Patch properties of the provided Kubernetes cluster feature. + /// + /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/kubernetesClusters/{kubernetesClusterName}/features/{featureName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzNetworkCloudKubernetesClusterFeature_UpdateViaJsonString", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterFeature))] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Patch properties of the provided Kubernetes cluster feature.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/kubernetesClusters/{kubernetesClusterName}/features/{featureName}", ApiVersion = "2025-02-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.NotSuggestDefaultParameterSet] + public partial class UpdateAzNetworkCloudKubernetesClusterFeature_UpdateViaJsonString : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 _featureName; + + /// The name of the feature. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the feature.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the feature.", + SerializedName = @"featureName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] + public string FeatureName { get => this._featureName; set => this._featureName = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private string _ifMatch; + + /// + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value + /// to prevent accidentally overwriting concurrent changes. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes.", + SerializedName = @"If-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Header)] + public string IfMatch { get => this._ifMatch; set => this._ifMatch = value; } + + /// Backing field for property. + private string _ifNoneMatch; + + /// + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result + /// in error from server as they are not supported. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result in error from server as they are not supported.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result in error from server as they are not supported.", + SerializedName = @"If-None-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Header)] + public string IfNoneMatch { get => this._ifNoneMatch; set => this._ifNoneMatch = 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.NetworkCloud.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 _kubernetesClusterName; + + /// The name of the Kubernetes cluster. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the Kubernetes cluster.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the Kubernetes cluster.", + SerializedName = @"kubernetesClusterName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] + public string KubernetesClusterName { get => this._kubernetesClusterName; set => this._kubernetesClusterName = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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. The value must be an UUID. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription. The value must be an UUID.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription. The value must be an UUID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.IKubernetesClusterFeature + /// 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.NetworkCloud.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of UpdateAzNetworkCloudKubernetesClusterFeature_UpdateViaJsonString + /// + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets.UpdateAzNetworkCloudKubernetesClusterFeature_UpdateViaJsonString Clone() + { + var clone = new UpdateAzNetworkCloudKubernetesClusterFeature_UpdateViaJsonString(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.KubernetesClusterName = this.KubernetesClusterName; + clone.FeatureName = this.FeatureName; + clone.IfMatch = this.IfMatch; + clone.IfNoneMatch = this.IfNoneMatch; + clone.JsonString = this.JsonString; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'KubernetesClusterFeaturesUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.KubernetesClusterFeaturesUpdateViaJsonString(SubscriptionId, ResourceGroupName, KubernetesClusterName, FeatureName, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _jsonString, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,KubernetesClusterName=KubernetesClusterName,FeatureName=FeatureName,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Initializes a new instance of the cmdlet + /// class. + /// + public UpdateAzNetworkCloudKubernetesClusterFeature_UpdateViaJsonString() + { + + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.IKubernetesClusterFeature + /// 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.NetworkCloud.Models.IKubernetesClusterFeature + var result = (await response); + WriteObject(result, false); + } + } + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudKubernetesCluster_UpdateExpanded.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudKubernetesCluster_UpdateExpanded.cs index 9e7916580ea3..73a33dc94d1e 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudKubernetesCluster_UpdateExpanded.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudKubernetesCluster_UpdateExpanded.cs @@ -6,23 +6,25 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// /// Patch the properties of the provided Kubernetes cluster, or update the tags associated with the Kubernetes cluster. Properties - /// and tag updates can be done independently. + /// and tag update can be done independently. /// /// /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/kubernetesClusters/{kubernetesClusterName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzNetworkCloudKubernetesCluster_UpdateExpanded", SupportsShouldProcess = true)] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesCluster", "15.0.0", "2.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"AadConfigurationAdminGroupObjectId","AttachedNetworkConfigurationL2Network","AttachedNetworkConfigurationL3Network","AttachedNetworkConfigurationTrunkedNetwork","AttachedNetworkId","AvailableUpgrade","BgpServiceLoadBalancerConfigurationBgpAdvertisement","BgpServiceLoadBalancerConfigurationBgpPeer","BgpServiceLoadBalancerConfigurationIPAddressPool","ControlPlaneNodeConfigurationAdministratorConfigurationSshPublicKey","ControlPlaneNodeConfigurationAvailabilityZone","FeatureStatuses","InitialAgentPoolConfiguration","L2ServiceLoadBalancerConfigurationIPAddressPool","NetworkConfigurationPodCidr","NetworkConfigurationServiceCidr","Node","SshPublicKey"}, NewOutputProperties=new string[] {"AadConfigurationAdminGroupObjectId","AttachedNetworkConfigurationL2Network","AttachedNetworkConfigurationL3Network","AttachedNetworkConfigurationTrunkedNetwork","AttachedNetworkId","AvailableUpgrade","BgpServiceLoadBalancerConfigurationBgpAdvertisement","BgpServiceLoadBalancerConfigurationBgpPeer","BgpServiceLoadBalancerConfigurationIPAddressPool","ControlPlaneNodeConfigurationAdministratorConfigurationSshPublicKey","ControlPlaneNodeConfigurationAvailabilityZone","FeatureStatuses","InitialAgentPoolConfiguration","L2ServiceLoadBalancerConfigurationIPAddressPool","NetworkConfigurationPodCidr","NetworkConfigurationServiceCidr","Node","SshPublicKey"}, ChangeDescription="The types of properties will be changed from fixed array to 'List'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesCluster))] - [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Patch the properties of the provided Kubernetes cluster, or update the tags associated with the Kubernetes cluster. Properties and tag updates can be done independently.")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesCluster))] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Patch the properties of the provided Kubernetes cluster, or update the tags associated with the Kubernetes cluster. Properties and tag update can be done independently.")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/kubernetesClusters/{kubernetesClusterName}", ApiVersion = "2025-02-01")] public partial class UpdateAzNetworkCloudKubernetesCluster_UpdateExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -38,10 +40,13 @@ public partial class UpdateAzNetworkCloudKubernetesCluster_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(); + /// /// KubernetesClusterPatchParameters represents the body of the request to patch the Hybrid AKS cluster. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPatchParameters _kubernetesClusterUpdateParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.KubernetesClusterPatchParameters(); + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPatchParameters _kubernetesClusterUpdateParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.KubernetesClusterPatchParameters(); /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] @@ -53,6 +58,9 @@ public partial class UpdateAzNetworkCloudKubernetesCluster_UpdateExpanded : glob [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -67,8 +75,8 @@ public partial class UpdateAzNetworkCloudKubernetesCluster_UpdateExpanded : glob ReadOnly = false, Description = @"SshPublicKey represents the public key used to authenticate with a resource through SSH.", SerializedName = @"sshPublicKeys", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey) })] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey[] ControlPlaneNodeConfigurationAdminPublicKey { get => _kubernetesClusterUpdateParametersBody.ControlPlaneNodeConfigurationAdministratorConfigurationSshPublicKey ?? null /* arrayOf */; set => _kubernetesClusterUpdateParametersBody.ControlPlaneNodeConfigurationAdministratorConfigurationSshPublicKey = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISshPublicKey) })] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISshPublicKey[] ControlPlaneNodeConfigurationAdminPublicKey { get => _kubernetesClusterUpdateParametersBody.ControlPlaneNodeConfigurationAdministratorConfigurationSshPublicKey?.ToArray() ?? null /* fixedArrayOf */; set => _kubernetesClusterUpdateParametersBody.ControlPlaneNodeConfigurationAdministratorConfigurationSshPublicKey = (value != null ? new System.Collections.Generic.List(value) : null); } /// The number of virtual machines that use this configuration. [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The number of virtual machines that use this configuration.")] @@ -91,6 +99,9 @@ public partial class UpdateAzNetworkCloudKubernetesCluster_UpdateExpanded : glob [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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] @@ -185,7 +196,7 @@ public partial class UpdateAzNetworkCloudKubernetesCluster_UpdateExpanded : glob /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,8 +239,8 @@ public partial class UpdateAzNetworkCloudKubernetesCluster_UpdateExpanded : glob ReadOnly = false, Description = @"SshPublicKey represents the public key used to authenticate with a resource through SSH.", SerializedName = @"sshPublicKeys", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey) })] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey[] SshPublicKey { get => _kubernetesClusterUpdateParametersBody.SshPublicKey ?? null /* arrayOf */; set => _kubernetesClusterUpdateParametersBody.SshPublicKey = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISshPublicKey) })] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISshPublicKey[] SshPublicKey { get => _kubernetesClusterUpdateParametersBody.SshPublicKey?.ToArray() ?? null /* fixedArrayOf */; set => _kubernetesClusterUpdateParametersBody.SshPublicKey = (value != null ? new System.Collections.Generic.List(value) : null); } /// Backing field for property. private string _subscriptionId; @@ -245,7 +256,8 @@ public partial class UpdateAzNetworkCloudKubernetesCluster_UpdateExpanded : glob [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -258,32 +270,32 @@ public partial class UpdateAzNetworkCloudKubernetesCluster_UpdateExpanded : glob ReadOnly = false, Description = @"The Azure resource tags that will replace the existing ones.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPatchParametersTags) })] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPatchParametersTags Tag { get => _kubernetesClusterUpdateParametersBody.Tag ?? null /* object */; set => _kubernetesClusterUpdateParametersBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPatchParametersTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPatchParametersTags Tag { get => _kubernetesClusterUpdateParametersBody.Tag ?? null /* object */; set => _kubernetesClusterUpdateParametersBody.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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IKubernetesCluster + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesCluster /// 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) @@ -396,11 +408,36 @@ 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.NetworkCloud.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -412,10 +449,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -483,7 +536,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -496,12 +549,12 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.KubernetesClustersUpdate(SubscriptionId, ResourceGroupName, Name, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _kubernetesClusterUpdateParametersBody, onOk, onDefault, this, Pipeline); + await this.Client.KubernetesClustersUpdate(SubscriptionId, ResourceGroupName, Name, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _kubernetesClusterUpdateParametersBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate); await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null,body=_kubernetesClusterUpdateParametersBody}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -521,7 +574,7 @@ protected override void StopProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public UpdateAzNetworkCloudKubernetesCluster_UpdateExpanded() { @@ -547,12 +600,12 @@ public UpdateAzNetworkCloudKubernetesCluster_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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ) { @@ -569,15 +622,15 @@ public UpdateAzNetworkCloudKubernetesCluster_UpdateExpanded() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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, IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, body=_kubernetesClusterUpdateParametersBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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, IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, body=_kubernetesClusterUpdateParametersBody }) + 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 } }); @@ -587,12 +640,12 @@ public UpdateAzNetworkCloudKubernetesCluster_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.NetworkCloud.Models.Api20250201.IKubernetesCluster + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesCluster /// 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 ) { @@ -604,8 +657,9 @@ public UpdateAzNetworkCloudKubernetesCluster_UpdateExpanded() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesCluster - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesCluster + var result = (await response); + WriteObject(result, false); } } } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudKubernetesCluster_UpdateViaIdentityExpanded.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudKubernetesCluster_UpdateViaIdentityExpanded.cs index 6f52364365b0..2b897a207987 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudKubernetesCluster_UpdateViaIdentityExpanded.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudKubernetesCluster_UpdateViaIdentityExpanded.cs @@ -6,23 +6,25 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// /// Patch the properties of the provided Kubernetes cluster, or update the tags associated with the Kubernetes cluster. Properties - /// and tag updates can be done independently. + /// and tag update can be done independently. /// /// /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/kubernetesClusters/{kubernetesClusterName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzNetworkCloudKubernetesCluster_UpdateViaIdentityExpanded", SupportsShouldProcess = true)] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesCluster", "15.0.0", "2.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"AadConfigurationAdminGroupObjectId","AttachedNetworkConfigurationL2Network","AttachedNetworkConfigurationL3Network","AttachedNetworkConfigurationTrunkedNetwork","AttachedNetworkId","AvailableUpgrade","BgpServiceLoadBalancerConfigurationBgpAdvertisement","BgpServiceLoadBalancerConfigurationBgpPeer","BgpServiceLoadBalancerConfigurationIPAddressPool","ControlPlaneNodeConfigurationAdministratorConfigurationSshPublicKey","ControlPlaneNodeConfigurationAvailabilityZone","FeatureStatuses","InitialAgentPoolConfiguration","L2ServiceLoadBalancerConfigurationIPAddressPool","NetworkConfigurationPodCidr","NetworkConfigurationServiceCidr","Node","SshPublicKey"}, NewOutputProperties=new string[] {"AadConfigurationAdminGroupObjectId","AttachedNetworkConfigurationL2Network","AttachedNetworkConfigurationL3Network","AttachedNetworkConfigurationTrunkedNetwork","AttachedNetworkId","AvailableUpgrade","BgpServiceLoadBalancerConfigurationBgpAdvertisement","BgpServiceLoadBalancerConfigurationBgpPeer","BgpServiceLoadBalancerConfigurationIPAddressPool","ControlPlaneNodeConfigurationAdministratorConfigurationSshPublicKey","ControlPlaneNodeConfigurationAvailabilityZone","FeatureStatuses","InitialAgentPoolConfiguration","L2ServiceLoadBalancerConfigurationIPAddressPool","NetworkConfigurationPodCidr","NetworkConfigurationServiceCidr","Node","SshPublicKey"}, ChangeDescription="The types of properties will be changed from fixed array to 'List'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesCluster))] - [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Patch the properties of the provided Kubernetes cluster, or update the tags associated with the Kubernetes cluster. Properties and tag updates can be done independently.")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesCluster))] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Patch the properties of the provided Kubernetes cluster, or update the tags associated with the Kubernetes cluster. Properties and tag update can be done independently.")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/kubernetesClusters/{kubernetesClusterName}", ApiVersion = "2025-02-01")] public partial class UpdateAzNetworkCloudKubernetesCluster_UpdateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -38,10 +40,13 @@ public partial class UpdateAzNetworkCloudKubernetesCluster_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(); + /// /// KubernetesClusterPatchParameters represents the body of the request to patch the Hybrid AKS cluster. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPatchParameters _kubernetesClusterUpdateParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.KubernetesClusterPatchParameters(); + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPatchParameters _kubernetesClusterUpdateParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.KubernetesClusterPatchParameters(); /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] @@ -53,6 +58,9 @@ public partial class UpdateAzNetworkCloudKubernetesCluster_UpdateViaIdentityExpa [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -67,8 +75,8 @@ public partial class UpdateAzNetworkCloudKubernetesCluster_UpdateViaIdentityExpa ReadOnly = false, Description = @"SshPublicKey represents the public key used to authenticate with a resource through SSH.", SerializedName = @"sshPublicKeys", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey) })] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey[] ControlPlaneNodeConfigurationAdminPublicKey { get => _kubernetesClusterUpdateParametersBody.ControlPlaneNodeConfigurationAdministratorConfigurationSshPublicKey ?? null /* arrayOf */; set => _kubernetesClusterUpdateParametersBody.ControlPlaneNodeConfigurationAdministratorConfigurationSshPublicKey = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISshPublicKey) })] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISshPublicKey[] ControlPlaneNodeConfigurationAdminPublicKey { get => _kubernetesClusterUpdateParametersBody.ControlPlaneNodeConfigurationAdministratorConfigurationSshPublicKey?.ToArray() ?? null /* fixedArrayOf */; set => _kubernetesClusterUpdateParametersBody.ControlPlaneNodeConfigurationAdministratorConfigurationSshPublicKey = (value != null ? new System.Collections.Generic.List(value) : null); } /// The number of virtual machines that use this configuration. [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The number of virtual machines that use this configuration.")] @@ -91,6 +99,9 @@ public partial class UpdateAzNetworkCloudKubernetesCluster_UpdateViaIdentityExpa [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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] @@ -178,7 +189,7 @@ public partial class UpdateAzNetworkCloudKubernetesCluster_UpdateViaIdentityExpa /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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")] @@ -207,8 +218,8 @@ public partial class UpdateAzNetworkCloudKubernetesCluster_UpdateViaIdentityExpa ReadOnly = false, Description = @"SshPublicKey represents the public key used to authenticate with a resource through SSH.", SerializedName = @"sshPublicKeys", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey) })] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ISshPublicKey[] SshPublicKey { get => _kubernetesClusterUpdateParametersBody.SshPublicKey ?? null /* arrayOf */; set => _kubernetesClusterUpdateParametersBody.SshPublicKey = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISshPublicKey) })] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ISshPublicKey[] SshPublicKey { get => _kubernetesClusterUpdateParametersBody.SshPublicKey?.ToArray() ?? null /* fixedArrayOf */; set => _kubernetesClusterUpdateParametersBody.SshPublicKey = (value != null ? new System.Collections.Generic.List(value) : null); } /// The Azure resource tags that will replace the existing ones. [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ExportAs(typeof(global::System.Collections.Hashtable))] @@ -219,32 +230,32 @@ public partial class UpdateAzNetworkCloudKubernetesCluster_UpdateViaIdentityExpa ReadOnly = false, Description = @"The Azure resource tags that will replace the existing ones.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPatchParametersTags) })] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesClusterPatchParametersTags Tag { get => _kubernetesClusterUpdateParametersBody.Tag ?? null /* object */; set => _kubernetesClusterUpdateParametersBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPatchParametersTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesClusterPatchParametersTags Tag { get => _kubernetesClusterUpdateParametersBody.Tag ?? null /* object */; set => _kubernetesClusterUpdateParametersBody.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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IKubernetesCluster + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesCluster /// 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) @@ -356,11 +367,36 @@ 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.NetworkCloud.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -372,10 +408,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -443,7 +495,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -458,7 +510,7 @@ protected override void ProcessRecord() await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } if (InputObject?.Id != null) { - await this.Client.KubernetesClustersUpdateViaIdentity(InputObject.Id, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _kubernetesClusterUpdateParametersBody, onOk, onDefault, this, Pipeline); + await this.Client.KubernetesClustersUpdateViaIdentity(InputObject.Id, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _kubernetesClusterUpdateParametersBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate); } else { @@ -475,13 +527,13 @@ protected override void ProcessRecord() { ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.KubernetesClusterName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); } - await this.Client.KubernetesClustersUpdate(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.KubernetesClusterName ?? null, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _kubernetesClusterUpdateParametersBody, onOk, onDefault, this, Pipeline); + await this.Client.KubernetesClustersUpdate(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.KubernetesClusterName ?? null, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _kubernetesClusterUpdateParametersBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate); } await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null,body=_kubernetesClusterUpdateParametersBody}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -501,7 +553,7 @@ protected override void StopProcessing() } /// - /// Intializes a new instance of the cmdlet + /// Initializes a new instance of the cmdlet /// class. /// public UpdateAzNetworkCloudKubernetesCluster_UpdateViaIdentityExpanded() @@ -528,12 +580,12 @@ public UpdateAzNetworkCloudKubernetesCluster_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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ) { @@ -550,15 +602,15 @@ public UpdateAzNetworkCloudKubernetesCluster_UpdateViaIdentityExpanded() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, body=_kubernetesClusterUpdateParametersBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 { IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, body=_kubernetesClusterUpdateParametersBody }) + 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 } }); @@ -568,12 +620,12 @@ public UpdateAzNetworkCloudKubernetesCluster_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.NetworkCloud.Models.Api20250201.IKubernetesCluster + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesCluster /// 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 ) { @@ -585,8 +637,9 @@ public UpdateAzNetworkCloudKubernetesCluster_UpdateViaIdentityExpanded() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IKubernetesCluster - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesCluster + var result = (await response); + WriteObject(result, false); } } } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudKubernetesCluster_UpdateViaJsonFilePath.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudKubernetesCluster_UpdateViaJsonFilePath.cs new file mode 100644 index 000000000000..3614f1adbaa4 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudKubernetesCluster_UpdateViaJsonFilePath.cs @@ -0,0 +1,617 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; + using System; + + /// + /// Patch the properties of the provided Kubernetes cluster, or update the tags associated with the Kubernetes cluster. Properties + /// and tag update can be done independently. + /// + /// + /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/kubernetesClusters/{kubernetesClusterName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzNetworkCloudKubernetesCluster_UpdateViaJsonFilePath", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesCluster))] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Patch the properties of the provided Kubernetes cluster, or update the tags associated with the Kubernetes cluster. Properties and tag update can be done independently.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/kubernetesClusters/{kubernetesClusterName}", ApiVersion = "2025-02-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.NotSuggestDefaultParameterSet] + public partial class UpdateAzNetworkCloudKubernetesCluster_UpdateViaJsonFilePath : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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(); + + public global::System.String _jsonString; + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private string _ifMatch; + + /// + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value + /// to prevent accidentally overwriting concurrent changes. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes.", + SerializedName = @"If-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Header)] + public string IfMatch { get => this._ifMatch; set => this._ifMatch = value; } + + /// Backing field for property. + private string _ifNoneMatch; + + /// + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result + /// in error from server as they are not supported. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result in error from server as they are not supported.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result in error from server as they are not supported.", + SerializedName = @"If-None-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Header)] + public string IfNoneMatch { get => this._ifNoneMatch; set => this._ifNoneMatch = 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 _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.NetworkCloud.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.NetworkCloud.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of the Kubernetes cluster. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the Kubernetes cluster.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the Kubernetes cluster.", + SerializedName = @"kubernetesClusterName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("KubernetesClusterName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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. The value must be an UUID. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription. The value must be an UUID.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription. The value must be an UUID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.IKubernetesCluster + /// 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.NetworkCloud.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of UpdateAzNetworkCloudKubernetesCluster_UpdateViaJsonFilePath + /// + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets.UpdateAzNetworkCloudKubernetesCluster_UpdateViaJsonFilePath Clone() + { + var clone = new UpdateAzNetworkCloudKubernetesCluster_UpdateViaJsonFilePath(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.Name = this.Name; + clone.IfMatch = this.IfMatch; + clone.IfNoneMatch = this.IfNoneMatch; + clone.JsonFilePath = this.JsonFilePath; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'KubernetesClustersUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.KubernetesClustersUpdateViaJsonString(SubscriptionId, ResourceGroupName, Name, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _jsonString, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public UpdateAzNetworkCloudKubernetesCluster_UpdateViaJsonFilePath() + { + + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.IKubernetesCluster + /// 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.NetworkCloud.Models.IKubernetesCluster + var result = (await response); + WriteObject(result, false); + } + } + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudKubernetesCluster_UpdateViaJsonString.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudKubernetesCluster_UpdateViaJsonString.cs new file mode 100644 index 000000000000..63c12bec8fcc --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudKubernetesCluster_UpdateViaJsonString.cs @@ -0,0 +1,615 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; + using System; + + /// + /// Patch the properties of the provided Kubernetes cluster, or update the tags associated with the Kubernetes cluster. Properties + /// and tag update can be done independently. + /// + /// + /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/kubernetesClusters/{kubernetesClusterName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzNetworkCloudKubernetesCluster_UpdateViaJsonString", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IKubernetesCluster))] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Patch the properties of the provided Kubernetes cluster, or update the tags associated with the Kubernetes cluster. Properties and tag update can be done independently.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/kubernetesClusters/{kubernetesClusterName}", ApiVersion = "2025-02-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.NotSuggestDefaultParameterSet] + public partial class UpdateAzNetworkCloudKubernetesCluster_UpdateViaJsonString : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private string _ifMatch; + + /// + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value + /// to prevent accidentally overwriting concurrent changes. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes.", + SerializedName = @"If-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Header)] + public string IfMatch { get => this._ifMatch; set => this._ifMatch = value; } + + /// Backing field for property. + private string _ifNoneMatch; + + /// + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result + /// in error from server as they are not supported. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result in error from server as they are not supported.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result in error from server as they are not supported.", + SerializedName = @"If-None-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Header)] + public string IfNoneMatch { get => this._ifNoneMatch; set => this._ifNoneMatch = 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.NetworkCloud.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.NetworkCloud.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of the Kubernetes cluster. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the Kubernetes cluster.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the Kubernetes cluster.", + SerializedName = @"kubernetesClusterName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("KubernetesClusterName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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. The value must be an UUID. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription. The value must be an UUID.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription. The value must be an UUID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.IKubernetesCluster + /// 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.NetworkCloud.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of UpdateAzNetworkCloudKubernetesCluster_UpdateViaJsonString + /// + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets.UpdateAzNetworkCloudKubernetesCluster_UpdateViaJsonString Clone() + { + var clone = new UpdateAzNetworkCloudKubernetesCluster_UpdateViaJsonString(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.Name = this.Name; + clone.IfMatch = this.IfMatch; + clone.IfNoneMatch = this.IfNoneMatch; + clone.JsonString = this.JsonString; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'KubernetesClustersUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.KubernetesClustersUpdateViaJsonString(SubscriptionId, ResourceGroupName, Name, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _jsonString, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public UpdateAzNetworkCloudKubernetesCluster_UpdateViaJsonString() + { + + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.IKubernetesCluster + /// 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.NetworkCloud.Models.IKubernetesCluster + var result = (await response); + WriteObject(result, false); + } + } + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudL2Network_UpdateExpanded.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudL2Network_UpdateExpanded.cs index 5004ed575567..c1500a2c4bc7 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudL2Network_UpdateExpanded.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudL2Network_UpdateExpanded.cs @@ -6,20 +6,22 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; - /// Update tags associated with the provided layer 2 (L2) network. + /// update tags associated with the provided layer 2 (L2) network. /// /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/l2Networks/{l2NetworkName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzNetworkCloudL2Network_UpdateExpanded", SupportsShouldProcess = true)] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2Network", "15.0.0", "2.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"AssociatedResourceId","HybridAksClustersAssociatedId","VirtualMachinesAssociatedId"}, NewOutputProperties=new string[] {"AssociatedResourceId","HybridAksClustersAssociatedId","VirtualMachinesAssociatedId"}, ChangeDescription="The types of properties will be changed from fixed array to 'List'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2Network))] - [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Update tags associated with the provided layer 2 (L2) network.")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2Network))] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"update tags associated with the provided layer 2 (L2) network.")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/l2Networks/{l2NetworkName}", ApiVersion = "2025-02-01")] public partial class UpdateAzNetworkCloudL2Network_UpdateExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 UpdateAzNetworkCloudL2Network_UpdateExpanded : 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; + /// /// L2NetworkPatchParameters represents the body of the request to patch the L2 network. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkPatchParameters _l2NetworkUpdateParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.L2NetworkPatchParameters(); + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkPatchParameters _l2NetworkUpdateParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.L2NetworkPatchParameters(); + + /// + /// 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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -58,6 +75,9 @@ public partial class UpdateAzNetworkCloudL2Network_UpdateExpanded : global::Syst [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 UpdateAzNetworkCloudL2Network_UpdateExpanded : global::Syst /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,7 +199,8 @@ public partial class UpdateAzNetworkCloudL2Network_UpdateExpanded : global::Syst [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -192,32 +213,32 @@ public partial class UpdateAzNetworkCloudL2Network_UpdateExpanded : global::Syst ReadOnly = false, Description = @"The Azure resource tags that will replace the existing ones.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkPatchParametersTags) })] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkPatchParametersTags Tag { get => _l2NetworkUpdateParametersBody.Tag ?? null /* object */; set => _l2NetworkUpdateParametersBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkPatchParametersTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkPatchParametersTags Tag { get => _l2NetworkUpdateParametersBody.Tag ?? null /* object */; set => _l2NetworkUpdateParametersBody.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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IL2Network + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2Network /// 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) @@ -240,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.NetworkCloud.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -304,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.NetworkCloud.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.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -361,7 +412,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -374,12 +425,12 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.L2NetworksUpdate(SubscriptionId, ResourceGroupName, Name, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _l2NetworkUpdateParametersBody, onOk, onDefault, this, Pipeline); + await this.Client.L2NetworksUpdate(SubscriptionId, ResourceGroupName, Name, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _l2NetworkUpdateParametersBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate); await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null,body=_l2NetworkUpdateParametersBody}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -399,7 +450,7 @@ protected override void StopProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public UpdateAzNetworkCloudL2Network_UpdateExpanded() { @@ -425,12 +476,12 @@ public UpdateAzNetworkCloudL2Network_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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ) { @@ -447,15 +498,15 @@ public UpdateAzNetworkCloudL2Network_UpdateExpanded() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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, IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, body=_l2NetworkUpdateParametersBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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, IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, body=_l2NetworkUpdateParametersBody }) + 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 } }); @@ -465,12 +516,12 @@ public UpdateAzNetworkCloudL2Network_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.NetworkCloud.Models.Api20250201.IL2Network + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2Network /// 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 ) { @@ -482,8 +533,26 @@ public UpdateAzNetworkCloudL2Network_UpdateExpanded() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2Network - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2Network + 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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudL2Network_UpdateViaIdentityExpanded.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudL2Network_UpdateViaIdentityExpanded.cs index 8999e048149d..32c135060fbc 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudL2Network_UpdateViaIdentityExpanded.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudL2Network_UpdateViaIdentityExpanded.cs @@ -6,20 +6,22 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; - /// Update tags associated with the provided layer 2 (L2) network. + /// update tags associated with the provided layer 2 (L2) network. /// /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/l2Networks/{l2NetworkName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzNetworkCloudL2Network_UpdateViaIdentityExpanded", SupportsShouldProcess = true)] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2Network", "15.0.0", "2.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"AssociatedResourceId","HybridAksClustersAssociatedId","VirtualMachinesAssociatedId"}, NewOutputProperties=new string[] {"AssociatedResourceId","HybridAksClustersAssociatedId","VirtualMachinesAssociatedId"}, ChangeDescription="The types of properties will be changed from fixed array to 'List'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2Network))] - [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Update tags associated with the provided layer 2 (L2) network.")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2Network))] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"update tags associated with the provided layer 2 (L2) network.")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/l2Networks/{l2NetworkName}", ApiVersion = "2025-02-01")] public partial class UpdateAzNetworkCloudL2Network_UpdateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 UpdateAzNetworkCloudL2Network_UpdateViaIdentityExpanded : 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; + /// /// L2NetworkPatchParameters represents the body of the request to patch the L2 network. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkPatchParameters _l2NetworkUpdateParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.L2NetworkPatchParameters(); + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkPatchParameters _l2NetworkUpdateParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.L2NetworkPatchParameters(); + + /// + /// 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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -58,6 +75,9 @@ public partial class UpdateAzNetworkCloudL2Network_UpdateViaIdentityExpanded : g [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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] @@ -126,7 +146,7 @@ public partial class UpdateAzNetworkCloudL2Network_UpdateViaIdentityExpanded : g /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,32 +173,32 @@ public partial class UpdateAzNetworkCloudL2Network_UpdateViaIdentityExpanded : g ReadOnly = false, Description = @"The Azure resource tags that will replace the existing ones.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkPatchParametersTags) })] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2NetworkPatchParametersTags Tag { get => _l2NetworkUpdateParametersBody.Tag ?? null /* object */; set => _l2NetworkUpdateParametersBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkPatchParametersTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2NetworkPatchParametersTags Tag { get => _l2NetworkUpdateParametersBody.Tag ?? null /* object */; set => _l2NetworkUpdateParametersBody.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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IL2Network + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2Network /// 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 +221,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.NetworkCloud.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -265,8 +290,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.NetworkCloud.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.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -322,7 +372,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -337,7 +387,7 @@ protected override void ProcessRecord() await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } if (InputObject?.Id != null) { - await this.Client.L2NetworksUpdateViaIdentity(InputObject.Id, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _l2NetworkUpdateParametersBody, onOk, onDefault, this, Pipeline); + await this.Client.L2NetworksUpdateViaIdentity(InputObject.Id, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _l2NetworkUpdateParametersBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate); } else { @@ -354,13 +404,13 @@ protected override void ProcessRecord() { ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.L2NetworkName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); } - await this.Client.L2NetworksUpdate(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.L2NetworkName ?? null, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _l2NetworkUpdateParametersBody, onOk, onDefault, this, Pipeline); + await this.Client.L2NetworksUpdate(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.L2NetworkName ?? null, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _l2NetworkUpdateParametersBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate); } await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null,body=_l2NetworkUpdateParametersBody}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -380,7 +430,7 @@ protected override void StopProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public UpdateAzNetworkCloudL2Network_UpdateViaIdentityExpanded() { @@ -406,12 +456,12 @@ public UpdateAzNetworkCloudL2Network_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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ) { @@ -428,15 +478,15 @@ public UpdateAzNetworkCloudL2Network_UpdateViaIdentityExpanded() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, body=_l2NetworkUpdateParametersBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 { IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, body=_l2NetworkUpdateParametersBody }) + 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 } }); @@ -446,12 +496,12 @@ public UpdateAzNetworkCloudL2Network_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.NetworkCloud.Models.Api20250201.IL2Network + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2Network /// 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 ) { @@ -463,8 +513,26 @@ public UpdateAzNetworkCloudL2Network_UpdateViaIdentityExpanded() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL2Network - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2Network + 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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudL2Network_UpdateViaJsonFilePath.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudL2Network_UpdateViaJsonFilePath.cs new file mode 100644 index 000000000000..b9c59bbd9e54 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudL2Network_UpdateViaJsonFilePath.cs @@ -0,0 +1,558 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; + using System; + + /// update tags associated with the provided layer 2 (L2) network. + /// + /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/l2Networks/{l2NetworkName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzNetworkCloudL2Network_UpdateViaJsonFilePath", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2Network))] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"update tags associated with the provided layer 2 (L2) network.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/l2Networks/{l2NetworkName}", ApiVersion = "2025-02-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.NotSuggestDefaultParameterSet] + public partial class UpdateAzNetworkCloudL2Network_UpdateViaJsonFilePath : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private string _ifMatch; + + /// + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value + /// to prevent accidentally overwriting concurrent changes. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes.", + SerializedName = @"If-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Header)] + public string IfMatch { get => this._ifMatch; set => this._ifMatch = value; } + + /// Backing field for property. + private string _ifNoneMatch; + + /// + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result + /// in error from server as they are not supported. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result in error from server as they are not supported.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result in error from server as they are not supported.", + SerializedName = @"If-None-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Header)] + public string IfNoneMatch { get => this._ifNoneMatch; set => this._ifNoneMatch = 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 _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.NetworkCloud.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.NetworkCloud.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of the L2 network. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the L2 network.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the L2 network.", + SerializedName = @"l2NetworkName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("L2NetworkName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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. The value must be an UUID. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription. The value must be an UUID.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription. The value must be an UUID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.IL2Network + /// 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.NetworkCloud.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'L2NetworksUpdate' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.L2NetworksUpdateViaJsonString(SubscriptionId, ResourceGroupName, Name, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _jsonString, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public UpdateAzNetworkCloudL2Network_UpdateViaJsonFilePath() + { + + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.IL2Network + /// 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.NetworkCloud.Models.IL2Network + 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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudL2Network_UpdateViaJsonString.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudL2Network_UpdateViaJsonString.cs new file mode 100644 index 000000000000..18a3bfd3dfed --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudL2Network_UpdateViaJsonString.cs @@ -0,0 +1,556 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; + using System; + + /// update tags associated with the provided layer 2 (L2) network. + /// + /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/l2Networks/{l2NetworkName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzNetworkCloudL2Network_UpdateViaJsonString", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL2Network))] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"update tags associated with the provided layer 2 (L2) network.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/l2Networks/{l2NetworkName}", ApiVersion = "2025-02-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.NotSuggestDefaultParameterSet] + public partial class UpdateAzNetworkCloudL2Network_UpdateViaJsonString : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private string _ifMatch; + + /// + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value + /// to prevent accidentally overwriting concurrent changes. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes.", + SerializedName = @"If-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Header)] + public string IfMatch { get => this._ifMatch; set => this._ifMatch = value; } + + /// Backing field for property. + private string _ifNoneMatch; + + /// + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result + /// in error from server as they are not supported. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result in error from server as they are not supported.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result in error from server as they are not supported.", + SerializedName = @"If-None-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Header)] + public string IfNoneMatch { get => this._ifNoneMatch; set => this._ifNoneMatch = 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.NetworkCloud.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.NetworkCloud.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of the L2 network. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the L2 network.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the L2 network.", + SerializedName = @"l2NetworkName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("L2NetworkName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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. The value must be an UUID. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription. The value must be an UUID.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription. The value must be an UUID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.IL2Network + /// 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.NetworkCloud.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'L2NetworksUpdate' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.L2NetworksUpdateViaJsonString(SubscriptionId, ResourceGroupName, Name, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _jsonString, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public UpdateAzNetworkCloudL2Network_UpdateViaJsonString() + { + + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.IL2Network + /// 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.NetworkCloud.Models.IL2Network + 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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudL3Network_UpdateExpanded.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudL3Network_UpdateExpanded.cs index 06a221b60914..085a1fa98287 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudL3Network_UpdateExpanded.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudL3Network_UpdateExpanded.cs @@ -6,20 +6,22 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; - /// Update tags associated with the provided layer 3 (L3) network. + /// update tags associated with the provided layer 3 (L3) network. /// /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/l3Networks/{l3NetworkName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzNetworkCloudL3Network_UpdateExpanded", SupportsShouldProcess = true)] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3Network", "15.0.0", "2.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"AssociatedResourceId","HybridAksClustersAssociatedId","VirtualMachinesAssociatedId"}, NewOutputProperties=new string[] {"AssociatedResourceId","HybridAksClustersAssociatedId","VirtualMachinesAssociatedId"}, ChangeDescription="The types of properties will be changed from fixed array to 'List'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3Network))] - [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Update tags associated with the provided layer 3 (L3) network.")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3Network))] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"update tags associated with the provided layer 3 (L3) network.")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/l3Networks/{l3NetworkName}", ApiVersion = "2025-02-01")] public partial class UpdateAzNetworkCloudL3Network_UpdateExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 UpdateAzNetworkCloudL3Network_UpdateExpanded : 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; + /// /// L3NetworkPatchParameters represents the body of the request to patch the cloud services network. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkPatchParameters _l3NetworkUpdateParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.L3NetworkPatchParameters(); + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkPatchParameters _l3NetworkUpdateParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.L3NetworkPatchParameters(); + + /// + /// 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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -58,6 +75,9 @@ public partial class UpdateAzNetworkCloudL3Network_UpdateExpanded : global::Syst [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 UpdateAzNetworkCloudL3Network_UpdateExpanded : global::Syst /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,7 +199,8 @@ public partial class UpdateAzNetworkCloudL3Network_UpdateExpanded : global::Syst [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -192,32 +213,32 @@ public partial class UpdateAzNetworkCloudL3Network_UpdateExpanded : global::Syst ReadOnly = false, Description = @"The Azure resource tags that will replace the existing ones.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkPatchParametersTags) })] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkPatchParametersTags Tag { get => _l3NetworkUpdateParametersBody.Tag ?? null /* object */; set => _l3NetworkUpdateParametersBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkPatchParametersTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkPatchParametersTags Tag { get => _l3NetworkUpdateParametersBody.Tag ?? null /* object */; set => _l3NetworkUpdateParametersBody.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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IL3Network + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3Network /// 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) @@ -240,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.NetworkCloud.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -304,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.NetworkCloud.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.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -361,7 +412,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -374,12 +425,12 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.L3NetworksUpdate(SubscriptionId, ResourceGroupName, Name, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _l3NetworkUpdateParametersBody, onOk, onDefault, this, Pipeline); + await this.Client.L3NetworksUpdate(SubscriptionId, ResourceGroupName, Name, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _l3NetworkUpdateParametersBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate); await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null,body=_l3NetworkUpdateParametersBody}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -399,7 +450,7 @@ protected override void StopProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public UpdateAzNetworkCloudL3Network_UpdateExpanded() { @@ -425,12 +476,12 @@ public UpdateAzNetworkCloudL3Network_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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ) { @@ -447,15 +498,15 @@ public UpdateAzNetworkCloudL3Network_UpdateExpanded() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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, IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, body=_l3NetworkUpdateParametersBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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, IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, body=_l3NetworkUpdateParametersBody }) + 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 } }); @@ -465,12 +516,12 @@ public UpdateAzNetworkCloudL3Network_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.NetworkCloud.Models.Api20250201.IL3Network + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3Network /// 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 ) { @@ -482,8 +533,26 @@ public UpdateAzNetworkCloudL3Network_UpdateExpanded() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3Network - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3Network + 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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudL3Network_UpdateViaIdentityExpanded.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudL3Network_UpdateViaIdentityExpanded.cs index 0932e48b17e9..219be10eced4 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudL3Network_UpdateViaIdentityExpanded.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudL3Network_UpdateViaIdentityExpanded.cs @@ -6,20 +6,22 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; - /// Update tags associated with the provided layer 3 (L3) network. + /// update tags associated with the provided layer 3 (L3) network. /// /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/l3Networks/{l3NetworkName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzNetworkCloudL3Network_UpdateViaIdentityExpanded", SupportsShouldProcess = true)] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3Network", "15.0.0", "2.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"AssociatedResourceId","HybridAksClustersAssociatedId","VirtualMachinesAssociatedId"}, NewOutputProperties=new string[] {"AssociatedResourceId","HybridAksClustersAssociatedId","VirtualMachinesAssociatedId"}, ChangeDescription="The types of properties will be changed from fixed array to 'List'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3Network))] - [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Update tags associated with the provided layer 3 (L3) network.")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3Network))] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"update tags associated with the provided layer 3 (L3) network.")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/l3Networks/{l3NetworkName}", ApiVersion = "2025-02-01")] public partial class UpdateAzNetworkCloudL3Network_UpdateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 UpdateAzNetworkCloudL3Network_UpdateViaIdentityExpanded : 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; + /// /// L3NetworkPatchParameters represents the body of the request to patch the cloud services network. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkPatchParameters _l3NetworkUpdateParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.L3NetworkPatchParameters(); + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkPatchParameters _l3NetworkUpdateParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.L3NetworkPatchParameters(); + + /// + /// 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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -58,6 +75,9 @@ public partial class UpdateAzNetworkCloudL3Network_UpdateViaIdentityExpanded : g [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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] @@ -126,7 +146,7 @@ public partial class UpdateAzNetworkCloudL3Network_UpdateViaIdentityExpanded : g /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,32 +173,32 @@ public partial class UpdateAzNetworkCloudL3Network_UpdateViaIdentityExpanded : g ReadOnly = false, Description = @"The Azure resource tags that will replace the existing ones.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkPatchParametersTags) })] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3NetworkPatchParametersTags Tag { get => _l3NetworkUpdateParametersBody.Tag ?? null /* object */; set => _l3NetworkUpdateParametersBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkPatchParametersTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3NetworkPatchParametersTags Tag { get => _l3NetworkUpdateParametersBody.Tag ?? null /* object */; set => _l3NetworkUpdateParametersBody.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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IL3Network + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3Network /// 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 +221,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.NetworkCloud.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -265,8 +290,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.NetworkCloud.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.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -322,7 +372,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -337,7 +387,7 @@ protected override void ProcessRecord() await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } if (InputObject?.Id != null) { - await this.Client.L3NetworksUpdateViaIdentity(InputObject.Id, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _l3NetworkUpdateParametersBody, onOk, onDefault, this, Pipeline); + await this.Client.L3NetworksUpdateViaIdentity(InputObject.Id, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _l3NetworkUpdateParametersBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate); } else { @@ -354,13 +404,13 @@ protected override void ProcessRecord() { ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.L3NetworkName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); } - await this.Client.L3NetworksUpdate(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.L3NetworkName ?? null, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _l3NetworkUpdateParametersBody, onOk, onDefault, this, Pipeline); + await this.Client.L3NetworksUpdate(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.L3NetworkName ?? null, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _l3NetworkUpdateParametersBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate); } await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null,body=_l3NetworkUpdateParametersBody}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -380,7 +430,7 @@ protected override void StopProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public UpdateAzNetworkCloudL3Network_UpdateViaIdentityExpanded() { @@ -406,12 +456,12 @@ public UpdateAzNetworkCloudL3Network_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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ) { @@ -428,15 +478,15 @@ public UpdateAzNetworkCloudL3Network_UpdateViaIdentityExpanded() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, body=_l3NetworkUpdateParametersBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 { IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, body=_l3NetworkUpdateParametersBody }) + 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 } }); @@ -446,12 +496,12 @@ public UpdateAzNetworkCloudL3Network_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.NetworkCloud.Models.Api20250201.IL3Network + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3Network /// 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 ) { @@ -463,8 +513,26 @@ public UpdateAzNetworkCloudL3Network_UpdateViaIdentityExpanded() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IL3Network - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3Network + 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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudL3Network_UpdateViaJsonFilePath.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudL3Network_UpdateViaJsonFilePath.cs new file mode 100644 index 000000000000..914b054ac67e --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudL3Network_UpdateViaJsonFilePath.cs @@ -0,0 +1,558 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; + using System; + + /// update tags associated with the provided layer 3 (L3) network. + /// + /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/l3Networks/{l3NetworkName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzNetworkCloudL3Network_UpdateViaJsonFilePath", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3Network))] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"update tags associated with the provided layer 3 (L3) network.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/l3Networks/{l3NetworkName}", ApiVersion = "2025-02-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.NotSuggestDefaultParameterSet] + public partial class UpdateAzNetworkCloudL3Network_UpdateViaJsonFilePath : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private string _ifMatch; + + /// + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value + /// to prevent accidentally overwriting concurrent changes. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes.", + SerializedName = @"If-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Header)] + public string IfMatch { get => this._ifMatch; set => this._ifMatch = value; } + + /// Backing field for property. + private string _ifNoneMatch; + + /// + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result + /// in error from server as they are not supported. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result in error from server as they are not supported.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result in error from server as they are not supported.", + SerializedName = @"If-None-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Header)] + public string IfNoneMatch { get => this._ifNoneMatch; set => this._ifNoneMatch = 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 _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.NetworkCloud.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.NetworkCloud.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of the L3 network. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the L3 network.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the L3 network.", + SerializedName = @"l3NetworkName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("L3NetworkName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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. The value must be an UUID. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription. The value must be an UUID.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription. The value must be an UUID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.IL3Network + /// 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.NetworkCloud.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'L3NetworksUpdate' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.L3NetworksUpdateViaJsonString(SubscriptionId, ResourceGroupName, Name, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _jsonString, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public UpdateAzNetworkCloudL3Network_UpdateViaJsonFilePath() + { + + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.IL3Network + /// 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.NetworkCloud.Models.IL3Network + 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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudL3Network_UpdateViaJsonString.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudL3Network_UpdateViaJsonString.cs new file mode 100644 index 000000000000..08d332301af9 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudL3Network_UpdateViaJsonString.cs @@ -0,0 +1,556 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; + using System; + + /// update tags associated with the provided layer 3 (L3) network. + /// + /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/l3Networks/{l3NetworkName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzNetworkCloudL3Network_UpdateViaJsonString", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IL3Network))] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"update tags associated with the provided layer 3 (L3) network.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/l3Networks/{l3NetworkName}", ApiVersion = "2025-02-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.NotSuggestDefaultParameterSet] + public partial class UpdateAzNetworkCloudL3Network_UpdateViaJsonString : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private string _ifMatch; + + /// + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value + /// to prevent accidentally overwriting concurrent changes. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes.", + SerializedName = @"If-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Header)] + public string IfMatch { get => this._ifMatch; set => this._ifMatch = value; } + + /// Backing field for property. + private string _ifNoneMatch; + + /// + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result + /// in error from server as they are not supported. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result in error from server as they are not supported.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result in error from server as they are not supported.", + SerializedName = @"If-None-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Header)] + public string IfNoneMatch { get => this._ifNoneMatch; set => this._ifNoneMatch = 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.NetworkCloud.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.NetworkCloud.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of the L3 network. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the L3 network.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the L3 network.", + SerializedName = @"l3NetworkName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("L3NetworkName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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. The value must be an UUID. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription. The value must be an UUID.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription. The value must be an UUID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.IL3Network + /// 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.NetworkCloud.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'L3NetworksUpdate' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.L3NetworksUpdateViaJsonString(SubscriptionId, ResourceGroupName, Name, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _jsonString, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public UpdateAzNetworkCloudL3Network_UpdateViaJsonString() + { + + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.IL3Network + /// 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.NetworkCloud.Models.IL3Network + 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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudMetricsConfiguration_UpdateExpanded.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudMetricsConfiguration_UpdateExpanded.cs index e9c387d74077..61bab4964866 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudMetricsConfiguration_UpdateExpanded.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudMetricsConfiguration_UpdateExpanded.cs @@ -6,23 +6,25 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// /// Patch properties of metrics configuration for the provided cluster, or update the tags associated with it. Properties - /// and tag updates can be done independently. + /// and tag update can be done independently. /// /// /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/metricsConfigurations/{metricsConfigurationName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzNetworkCloudMetricsConfiguration_UpdateExpanded", SupportsShouldProcess = true)] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfiguration", "15.0.0", "2.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"DisabledMetric","EnabledMetric"}, NewOutputProperties=new string[] {"DisabledMetric","EnabledMetric"}, ChangeDescription="The types of properties will be changed from fixed array to 'List'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfiguration))] - [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Patch properties of metrics configuration for the provided cluster, or update the tags associated with it. Properties and tag updates can be done independently.")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfiguration))] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Patch properties of metrics configuration for the provided cluster, or update the tags associated with it. Properties and tag update can be done independently.")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/metricsConfigurations/{metricsConfigurationName}", ApiVersion = "2025-02-01")] public partial class UpdateAzNetworkCloudMetricsConfiguration_UpdateExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -38,10 +40,13 @@ public partial class UpdateAzNetworkCloudMetricsConfiguration_UpdateExpanded : 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(); + /// /// ClusterMetricsConfigurationPatchParameters represents the body of the request to patch the metrics configuration of cluster. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationPatchParameters _metricsConfigurationUpdateParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ClusterMetricsConfigurationPatchParameters(); + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationPatchParameters _metricsConfigurationUpdateParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterMetricsConfigurationPatchParameters(); /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] @@ -53,6 +58,9 @@ public partial class UpdateAzNetworkCloudMetricsConfiguration_UpdateExpanded : g [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -103,7 +111,10 @@ public partial class UpdateAzNetworkCloudMetricsConfiguration_UpdateExpanded : g Description = @"The list of metric names that have been chosen to be enabled in addition to the core set of enabled metrics.", SerializedName = @"enabledMetrics", PossibleTypes = new [] { typeof(string) })] - public string[] EnabledMetric { get => _metricsConfigurationUpdateParametersBody.EnabledMetric ?? null /* arrayOf */; set => _metricsConfigurationUpdateParametersBody.EnabledMetric = value; } + public string[] EnabledMetric { get => _metricsConfigurationUpdateParametersBody.EnabledMetric?.ToArray() ?? null /* fixedArrayOf */; set => _metricsConfigurationUpdateParametersBody.EnabledMetric = (value != null ? new System.Collections.Generic.List(value) : null); } + + /// 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")] @@ -188,7 +199,7 @@ public partial class UpdateAzNetworkCloudMetricsConfiguration_UpdateExpanded : g /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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")] @@ -234,7 +245,8 @@ public partial class UpdateAzNetworkCloudMetricsConfiguration_UpdateExpanded : g [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -247,32 +259,32 @@ public partial class UpdateAzNetworkCloudMetricsConfiguration_UpdateExpanded : g ReadOnly = false, Description = @"The Azure resource tags that will replace the existing ones.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationPatchParametersTags) })] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationPatchParametersTags Tag { get => _metricsConfigurationUpdateParametersBody.Tag ?? null /* object */; set => _metricsConfigurationUpdateParametersBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationPatchParametersTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationPatchParametersTags Tag { get => _metricsConfigurationUpdateParametersBody.Tag ?? null /* object */; set => _metricsConfigurationUpdateParametersBody.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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IClusterMetricsConfiguration + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfiguration /// 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) @@ -386,11 +398,36 @@ 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.NetworkCloud.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -402,10 +439,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -473,7 +526,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -486,12 +539,12 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.MetricsConfigurationsUpdate(SubscriptionId, ResourceGroupName, ClusterName, Name, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _metricsConfigurationUpdateParametersBody, onOk, onDefault, this, Pipeline); + await this.Client.MetricsConfigurationsUpdate(SubscriptionId, ResourceGroupName, ClusterName, Name, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _metricsConfigurationUpdateParametersBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate); await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,ClusterName=ClusterName,Name=Name,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null,body=_metricsConfigurationUpdateParametersBody}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,ClusterName=ClusterName,Name=Name,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -511,7 +564,7 @@ protected override void StopProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public UpdateAzNetworkCloudMetricsConfiguration_UpdateExpanded() { @@ -537,12 +590,12 @@ public UpdateAzNetworkCloudMetricsConfiguration_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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ) { @@ -559,15 +612,15 @@ public UpdateAzNetworkCloudMetricsConfiguration_UpdateExpanded() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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, ClusterName=ClusterName, Name=Name, IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, body=_metricsConfigurationUpdateParametersBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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, ClusterName=ClusterName, Name=Name, IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, body=_metricsConfigurationUpdateParametersBody }) + 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 } }); @@ -577,12 +630,12 @@ public UpdateAzNetworkCloudMetricsConfiguration_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.NetworkCloud.Models.Api20250201.IClusterMetricsConfiguration + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfiguration /// 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 ) { @@ -594,8 +647,9 @@ public UpdateAzNetworkCloudMetricsConfiguration_UpdateExpanded() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfiguration - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfiguration + var result = (await response); + WriteObject(result, false); } } } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudMetricsConfiguration_UpdateViaIdentityClusterExpanded.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudMetricsConfiguration_UpdateViaIdentityClusterExpanded.cs new file mode 100644 index 000000000000..4bc581dd4346 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudMetricsConfiguration_UpdateViaIdentityClusterExpanded.cs @@ -0,0 +1,638 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; + using System; + + /// + /// Patch properties of metrics configuration for the provided cluster, or update the tags associated with it. Properties + /// and tag update can be done independently. + /// + /// + /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/metricsConfigurations/{metricsConfigurationName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzNetworkCloudMetricsConfiguration_UpdateViaIdentityClusterExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfiguration))] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Patch properties of metrics configuration for the provided cluster, or update the tags associated with it. Properties and tag update can be done independently.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/metricsConfigurations/{metricsConfigurationName}", ApiVersion = "2025-02-01")] + public partial class UpdateAzNetworkCloudMetricsConfiguration_UpdateViaIdentityClusterExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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(); + + /// + /// ClusterMetricsConfigurationPatchParameters represents the body of the request to patch the metrics configuration of cluster. + /// + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationPatchParameters _metricsConfigurationUpdateParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterMetricsConfigurationPatchParameters(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity _clusterInputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.INetworkCloudIdentity ClusterInputObject { get => this._clusterInputObject; set => this._clusterInputObject = value; } + + /// The interval in minutes by which metrics will be collected. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The interval in minutes by which metrics will be collected.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The interval in minutes by which metrics will be collected.", + SerializedName = @"collectionInterval", + PossibleTypes = new [] { typeof(long) })] + public long CollectionInterval { get => _metricsConfigurationUpdateParametersBody.CollectionInterval ?? default(long); set => _metricsConfigurationUpdateParametersBody.CollectionInterval = 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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// + /// The list of metric names that have been chosen to be enabled in addition to the core set of enabled metrics. + /// + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The list of metric names that have been chosen to be enabled in addition to the core set of enabled metrics.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The list of metric names that have been chosen to be enabled in addition to the core set of enabled metrics.", + SerializedName = @"enabledMetrics", + PossibleTypes = new [] { typeof(string) })] + public string[] EnabledMetric { get => _metricsConfigurationUpdateParametersBody.EnabledMetric?.ToArray() ?? null /* fixedArrayOf */; set => _metricsConfigurationUpdateParametersBody.EnabledMetric = (value != null ? new System.Collections.Generic.List(value) : null); } + + /// 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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private string _ifMatch; + + /// + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value + /// to prevent accidentally overwriting concurrent changes. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes.", + SerializedName = @"If-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Header)] + public string IfMatch { get => this._ifMatch; set => this._ifMatch = value; } + + /// Backing field for property. + private string _ifNoneMatch; + + /// + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result + /// in error from server as they are not supported. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result in error from server as they are not supported.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result in error from server as they are not supported.", + SerializedName = @"If-None-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Header)] + public string IfNoneMatch { get => this._ifNoneMatch; set => this._ifNoneMatch = 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.NetworkCloud.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of the metrics configuration for the cluster. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the metrics configuration for the cluster.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the metrics configuration for the cluster.", + SerializedName = @"metricsConfigurationName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("MetricsConfigurationName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// The Azure resource tags that will replace the existing ones. + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ExportAs(typeof(global::System.Collections.Hashtable))] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The Azure resource tags that will replace the existing ones.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The Azure resource tags that will replace the existing ones.", + SerializedName = @"tags", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationPatchParametersTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationPatchParametersTags Tag { get => _metricsConfigurationUpdateParametersBody.Tag ?? null /* object */; set => _metricsConfigurationUpdateParametersBody.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.NetworkCloud.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.NetworkCloud.Models.IClusterMetricsConfiguration + /// 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.NetworkCloud.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of UpdateAzNetworkCloudMetricsConfiguration_UpdateViaIdentityClusterExpanded + /// + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets.UpdateAzNetworkCloudMetricsConfiguration_UpdateViaIdentityClusterExpanded Clone() + { + var clone = new UpdateAzNetworkCloudMetricsConfiguration_UpdateViaIdentityClusterExpanded(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone._metricsConfigurationUpdateParametersBody = this._metricsConfigurationUpdateParametersBody; + clone.IfMatch = this.IfMatch; + clone.IfNoneMatch = this.IfNoneMatch; + clone.Name = this.Name; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'MetricsConfigurationsUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (ClusterInputObject?.Id != null) + { + this.ClusterInputObject.Id += $"/metricsConfigurations/{(global::System.Uri.EscapeDataString(this.Name.ToString()))}"; + await this.Client.MetricsConfigurationsUpdateViaIdentity(ClusterInputObject.Id, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _metricsConfigurationUpdateParametersBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate); + } + else + { + // try to call with PATH parameters from Input Object + if (null == ClusterInputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("ClusterInputObject has null value for ClusterInputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, ClusterInputObject) ); + } + if (null == ClusterInputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("ClusterInputObject has null value for ClusterInputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, ClusterInputObject) ); + } + if (null == ClusterInputObject.ClusterName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("ClusterInputObject has null value for ClusterInputObject.ClusterName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, ClusterInputObject) ); + } + await this.Client.MetricsConfigurationsUpdate(ClusterInputObject.SubscriptionId ?? null, ClusterInputObject.ResourceGroupName ?? null, ClusterInputObject.ClusterName ?? null, Name, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _metricsConfigurationUpdateParametersBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Name=Name,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public UpdateAzNetworkCloudMetricsConfiguration_UpdateViaIdentityClusterExpanded() + { + + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.IClusterMetricsConfiguration + /// 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.NetworkCloud.Models.IClusterMetricsConfiguration + var result = (await response); + WriteObject(result, false); + } + } + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudMetricsConfiguration_UpdateViaIdentityExpanded.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudMetricsConfiguration_UpdateViaIdentityExpanded.cs index 4f1bc27c904c..a9d6b2f96c5f 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudMetricsConfiguration_UpdateViaIdentityExpanded.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudMetricsConfiguration_UpdateViaIdentityExpanded.cs @@ -6,23 +6,25 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// /// Patch properties of metrics configuration for the provided cluster, or update the tags associated with it. Properties - /// and tag updates can be done independently. + /// and tag update can be done independently. /// /// /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/metricsConfigurations/{metricsConfigurationName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzNetworkCloudMetricsConfiguration_UpdateViaIdentityExpanded", SupportsShouldProcess = true)] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfiguration", "15.0.0", "2.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"DisabledMetric","EnabledMetric"}, NewOutputProperties=new string[] {"DisabledMetric","EnabledMetric"}, ChangeDescription="The types of properties will be changed from fixed array to 'List'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfiguration))] - [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Patch properties of metrics configuration for the provided cluster, or update the tags associated with it. Properties and tag updates can be done independently.")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfiguration))] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Patch properties of metrics configuration for the provided cluster, or update the tags associated with it. Properties and tag update can be done independently.")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/metricsConfigurations/{metricsConfigurationName}", ApiVersion = "2025-02-01")] public partial class UpdateAzNetworkCloudMetricsConfiguration_UpdateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -38,10 +40,13 @@ public partial class UpdateAzNetworkCloudMetricsConfiguration_UpdateViaIdentityE /// 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(); + /// /// ClusterMetricsConfigurationPatchParameters represents the body of the request to patch the metrics configuration of cluster. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationPatchParameters _metricsConfigurationUpdateParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ClusterMetricsConfigurationPatchParameters(); + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationPatchParameters _metricsConfigurationUpdateParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ClusterMetricsConfigurationPatchParameters(); /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] @@ -53,6 +58,9 @@ public partial class UpdateAzNetworkCloudMetricsConfiguration_UpdateViaIdentityE [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -89,7 +97,10 @@ public partial class UpdateAzNetworkCloudMetricsConfiguration_UpdateViaIdentityE Description = @"The list of metric names that have been chosen to be enabled in addition to the core set of enabled metrics.", SerializedName = @"enabledMetrics", PossibleTypes = new [] { typeof(string) })] - public string[] EnabledMetric { get => _metricsConfigurationUpdateParametersBody.EnabledMetric ?? null /* arrayOf */; set => _metricsConfigurationUpdateParametersBody.EnabledMetric = value; } + public string[] EnabledMetric { get => _metricsConfigurationUpdateParametersBody.EnabledMetric?.ToArray() ?? null /* fixedArrayOf */; set => _metricsConfigurationUpdateParametersBody.EnabledMetric = (value != null ? new System.Collections.Generic.List(value) : null); } + + /// 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")] @@ -167,7 +178,7 @@ public partial class UpdateAzNetworkCloudMetricsConfiguration_UpdateViaIdentityE /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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")] @@ -194,32 +205,32 @@ public partial class UpdateAzNetworkCloudMetricsConfiguration_UpdateViaIdentityE ReadOnly = false, Description = @"The Azure resource tags that will replace the existing ones.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationPatchParametersTags) })] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfigurationPatchParametersTags Tag { get => _metricsConfigurationUpdateParametersBody.Tag ?? null /* object */; set => _metricsConfigurationUpdateParametersBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationPatchParametersTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfigurationPatchParametersTags Tag { get => _metricsConfigurationUpdateParametersBody.Tag ?? null /* object */; set => _metricsConfigurationUpdateParametersBody.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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IClusterMetricsConfiguration + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfiguration /// 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) @@ -331,11 +342,36 @@ 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.NetworkCloud.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -347,10 +383,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -418,7 +470,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -433,7 +485,7 @@ protected override void ProcessRecord() await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } if (InputObject?.Id != null) { - await this.Client.MetricsConfigurationsUpdateViaIdentity(InputObject.Id, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _metricsConfigurationUpdateParametersBody, onOk, onDefault, this, Pipeline); + await this.Client.MetricsConfigurationsUpdateViaIdentity(InputObject.Id, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _metricsConfigurationUpdateParametersBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate); } else { @@ -454,13 +506,13 @@ protected override void ProcessRecord() { ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.MetricsConfigurationName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); } - await this.Client.MetricsConfigurationsUpdate(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.ClusterName ?? null, InputObject.MetricsConfigurationName ?? null, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _metricsConfigurationUpdateParametersBody, onOk, onDefault, this, Pipeline); + await this.Client.MetricsConfigurationsUpdate(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.ClusterName ?? null, InputObject.MetricsConfigurationName ?? null, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _metricsConfigurationUpdateParametersBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate); } await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null,body=_metricsConfigurationUpdateParametersBody}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -480,7 +532,7 @@ protected override void StopProcessing() } /// - /// Intializes a new instance of the cmdlet + /// Initializes a new instance of the cmdlet /// class. /// public UpdateAzNetworkCloudMetricsConfiguration_UpdateViaIdentityExpanded() @@ -507,12 +559,12 @@ public UpdateAzNetworkCloudMetricsConfiguration_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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 +581,15 @@ public UpdateAzNetworkCloudMetricsConfiguration_UpdateViaIdentityExpanded() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, body=_metricsConfigurationUpdateParametersBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 { IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, body=_metricsConfigurationUpdateParametersBody }) + 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 +599,12 @@ public UpdateAzNetworkCloudMetricsConfiguration_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.NetworkCloud.Models.Api20250201.IClusterMetricsConfiguration + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfiguration /// 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 +616,9 @@ public UpdateAzNetworkCloudMetricsConfiguration_UpdateViaIdentityExpanded() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IClusterMetricsConfiguration - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfiguration + var result = (await response); + WriteObject(result, false); } } } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudMetricsConfiguration_UpdateViaJsonFilePath.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudMetricsConfiguration_UpdateViaJsonFilePath.cs new file mode 100644 index 000000000000..ebb5d00b9f46 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudMetricsConfiguration_UpdateViaJsonFilePath.cs @@ -0,0 +1,633 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; + using System; + + /// + /// Patch properties of metrics configuration for the provided cluster, or update the tags associated with it. Properties + /// and tag update can be done independently. + /// + /// + /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/metricsConfigurations/{metricsConfigurationName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzNetworkCloudMetricsConfiguration_UpdateViaJsonFilePath", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfiguration))] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Patch properties of metrics configuration for the provided cluster, or update the tags associated with it. Properties and tag update can be done independently.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/metricsConfigurations/{metricsConfigurationName}", ApiVersion = "2025-02-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.NotSuggestDefaultParameterSet] + public partial class UpdateAzNetworkCloudMetricsConfiguration_UpdateViaJsonFilePath : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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(); + + public global::System.String _jsonString; + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; + + /// Backing field for property. + private string _clusterName; + + /// The name of the cluster. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the cluster.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the cluster.", + SerializedName = @"clusterName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] + public string ClusterName { get => this._clusterName; set => this._clusterName = 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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private string _ifMatch; + + /// + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value + /// to prevent accidentally overwriting concurrent changes. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes.", + SerializedName = @"If-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Header)] + public string IfMatch { get => this._ifMatch; set => this._ifMatch = value; } + + /// Backing field for property. + private string _ifNoneMatch; + + /// + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result + /// in error from server as they are not supported. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result in error from server as they are not supported.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result in error from server as they are not supported.", + SerializedName = @"If-None-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Header)] + public string IfNoneMatch { get => this._ifNoneMatch; set => this._ifNoneMatch = 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 _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.NetworkCloud.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.NetworkCloud.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of the metrics configuration for the cluster. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the metrics configuration for the cluster.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the metrics configuration for the cluster.", + SerializedName = @"metricsConfigurationName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("MetricsConfigurationName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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. The value must be an UUID. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription. The value must be an UUID.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription. The value must be an UUID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.IClusterMetricsConfiguration + /// 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.NetworkCloud.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of UpdateAzNetworkCloudMetricsConfiguration_UpdateViaJsonFilePath + /// + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets.UpdateAzNetworkCloudMetricsConfiguration_UpdateViaJsonFilePath Clone() + { + var clone = new UpdateAzNetworkCloudMetricsConfiguration_UpdateViaJsonFilePath(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.ClusterName = this.ClusterName; + clone.Name = this.Name; + clone.IfMatch = this.IfMatch; + clone.IfNoneMatch = this.IfNoneMatch; + clone.JsonFilePath = this.JsonFilePath; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'MetricsConfigurationsUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.MetricsConfigurationsUpdateViaJsonString(SubscriptionId, ResourceGroupName, ClusterName, Name, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _jsonString, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,ClusterName=ClusterName,Name=Name,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Initializes a new instance of the cmdlet + /// class. + /// + public UpdateAzNetworkCloudMetricsConfiguration_UpdateViaJsonFilePath() + { + + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.IClusterMetricsConfiguration + /// 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.NetworkCloud.Models.IClusterMetricsConfiguration + var result = (await response); + WriteObject(result, false); + } + } + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudMetricsConfiguration_UpdateViaJsonString.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudMetricsConfiguration_UpdateViaJsonString.cs new file mode 100644 index 000000000000..9f038cc6d9cc --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudMetricsConfiguration_UpdateViaJsonString.cs @@ -0,0 +1,630 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; + using System; + + /// + /// Patch properties of metrics configuration for the provided cluster, or update the tags associated with it. Properties + /// and tag update can be done independently. + /// + /// + /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/metricsConfigurations/{metricsConfigurationName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzNetworkCloudMetricsConfiguration_UpdateViaJsonString", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IClusterMetricsConfiguration))] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Patch properties of metrics configuration for the provided cluster, or update the tags associated with it. Properties and tag update can be done independently.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/clusters/{clusterName}/metricsConfigurations/{metricsConfigurationName}", ApiVersion = "2025-02-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.NotSuggestDefaultParameterSet] + public partial class UpdateAzNetworkCloudMetricsConfiguration_UpdateViaJsonString : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; + + /// Backing field for property. + private string _clusterName; + + /// The name of the cluster. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the cluster.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the cluster.", + SerializedName = @"clusterName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] + public string ClusterName { get => this._clusterName; set => this._clusterName = 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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private string _ifMatch; + + /// + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value + /// to prevent accidentally overwriting concurrent changes. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes.", + SerializedName = @"If-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Header)] + public string IfMatch { get => this._ifMatch; set => this._ifMatch = value; } + + /// Backing field for property. + private string _ifNoneMatch; + + /// + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result + /// in error from server as they are not supported. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result in error from server as they are not supported.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result in error from server as they are not supported.", + SerializedName = @"If-None-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Header)] + public string IfNoneMatch { get => this._ifNoneMatch; set => this._ifNoneMatch = 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.NetworkCloud.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.NetworkCloud.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of the metrics configuration for the cluster. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the metrics configuration for the cluster.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the metrics configuration for the cluster.", + SerializedName = @"metricsConfigurationName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("MetricsConfigurationName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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. The value must be an UUID. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription. The value must be an UUID.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription. The value must be an UUID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.IClusterMetricsConfiguration + /// 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.NetworkCloud.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of UpdateAzNetworkCloudMetricsConfiguration_UpdateViaJsonString + /// + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets.UpdateAzNetworkCloudMetricsConfiguration_UpdateViaJsonString Clone() + { + var clone = new UpdateAzNetworkCloudMetricsConfiguration_UpdateViaJsonString(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.ClusterName = this.ClusterName; + clone.Name = this.Name; + clone.IfMatch = this.IfMatch; + clone.IfNoneMatch = this.IfNoneMatch; + clone.JsonString = this.JsonString; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'MetricsConfigurationsUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.MetricsConfigurationsUpdateViaJsonString(SubscriptionId, ResourceGroupName, ClusterName, Name, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _jsonString, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,ClusterName=ClusterName,Name=Name,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public UpdateAzNetworkCloudMetricsConfiguration_UpdateViaJsonString() + { + + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.IClusterMetricsConfiguration + /// 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.NetworkCloud.Models.IClusterMetricsConfiguration + var result = (await response); + WriteObject(result, false); + } + } + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudRack_UpdateExpanded.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudRack_UpdateExpanded.cs index 0ecb281aa2ee..fb46e74044a0 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudRack_UpdateExpanded.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudRack_UpdateExpanded.cs @@ -6,22 +6,25 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// - /// Patch properties of the provided rack, or update the tags associated with the rack. Properties and tag updates can be - /// done independently. + /// Patch properties of the provided rack, or update the tags associated with the rack. Properties and tag update can be done + /// independently. /// /// /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/racks/{rackName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzNetworkCloudRack_UpdateExpanded", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRack))] - [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Patch properties of the provided rack, or update the tags associated with the rack. Properties and tag updates can be done independently.")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRack))] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Patch properties of the provided rack, or update the tags associated with the rack. Properties and tag update can be done independently.")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/racks/{rackName}", ApiVersion = "2025-02-01")] public partial class UpdateAzNetworkCloudRack_UpdateExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -37,10 +40,13 @@ public partial class UpdateAzNetworkCloudRack_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(); + /// /// RackPatchParameters represents the body of the request to patch the rack properties. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackPatchParameters _rackUpdateParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.RackPatchParameters(); + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackPatchParameters _rackUpdateParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.RackPatchParameters(); /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] @@ -52,6 +58,9 @@ public partial class UpdateAzNetworkCloudRack_UpdateExpanded : global::System.Ma [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -65,6 +74,9 @@ public partial class UpdateAzNetworkCloudRack_UpdateExpanded : global::System.Ma [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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] @@ -148,7 +160,7 @@ public partial class UpdateAzNetworkCloudRack_UpdateExpanded : global::System.Ma /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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")] @@ -218,7 +230,8 @@ public partial class UpdateAzNetworkCloudRack_UpdateExpanded : global::System.Ma [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -231,32 +244,32 @@ public partial class UpdateAzNetworkCloudRack_UpdateExpanded : global::System.Ma ReadOnly = false, Description = @"The Azure resource tags that will replace the existing ones.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackPatchParametersTags) })] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackPatchParametersTags Tag { get => _rackUpdateParametersBody.Tag ?? null /* object */; set => _rackUpdateParametersBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackPatchParametersTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackPatchParametersTags Tag { get => _rackUpdateParametersBody.Tag ?? null /* object */; set => _rackUpdateParametersBody.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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IRack + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRack /// 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) @@ -369,11 +382,36 @@ 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.NetworkCloud.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -385,10 +423,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -456,7 +510,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -469,12 +523,12 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.RacksUpdate(SubscriptionId, ResourceGroupName, Name, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _rackUpdateParametersBody, onOk, onDefault, this, Pipeline); + await this.Client.RacksUpdate(SubscriptionId, ResourceGroupName, Name, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _rackUpdateParametersBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate); await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null,body=_rackUpdateParametersBody}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -494,7 +548,7 @@ protected override void StopProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public UpdateAzNetworkCloudRack_UpdateExpanded() { @@ -520,12 +574,12 @@ public UpdateAzNetworkCloudRack_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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ) { @@ -542,15 +596,15 @@ public UpdateAzNetworkCloudRack_UpdateExpanded() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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, IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, body=_rackUpdateParametersBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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, IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, body=_rackUpdateParametersBody }) + 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 } }); @@ -560,12 +614,12 @@ public UpdateAzNetworkCloudRack_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.NetworkCloud.Models.Api20250201.IRack + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRack /// 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 ) { @@ -577,8 +631,9 @@ public UpdateAzNetworkCloudRack_UpdateExpanded() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRack - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRack + var result = (await response); + WriteObject(result, false); } } } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudRack_UpdateViaIdentityExpanded.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudRack_UpdateViaIdentityExpanded.cs index d9e5ccaef297..edd33685bb35 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudRack_UpdateViaIdentityExpanded.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudRack_UpdateViaIdentityExpanded.cs @@ -6,22 +6,25 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// - /// Patch properties of the provided rack, or update the tags associated with the rack. Properties and tag updates can be - /// done independently. + /// Patch properties of the provided rack, or update the tags associated with the rack. Properties and tag update can be done + /// independently. /// /// /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/racks/{rackName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzNetworkCloudRack_UpdateViaIdentityExpanded", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRack))] - [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Patch properties of the provided rack, or update the tags associated with the rack. Properties and tag updates can be done independently.")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRack))] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Patch properties of the provided rack, or update the tags associated with the rack. Properties and tag update can be done independently.")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/racks/{rackName}", ApiVersion = "2025-02-01")] public partial class UpdateAzNetworkCloudRack_UpdateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -37,10 +40,13 @@ public partial class UpdateAzNetworkCloudRack_UpdateViaIdentityExpanded : 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(); + /// /// RackPatchParameters represents the body of the request to patch the rack properties. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackPatchParameters _rackUpdateParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.RackPatchParameters(); + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackPatchParameters _rackUpdateParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.RackPatchParameters(); /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] @@ -52,6 +58,9 @@ public partial class UpdateAzNetworkCloudRack_UpdateViaIdentityExpanded : global [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -65,6 +74,9 @@ public partial class UpdateAzNetworkCloudRack_UpdateViaIdentityExpanded : global [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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] @@ -141,7 +153,7 @@ public partial class UpdateAzNetworkCloudRack_UpdateViaIdentityExpanded : global /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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")] @@ -192,32 +204,32 @@ public partial class UpdateAzNetworkCloudRack_UpdateViaIdentityExpanded : global ReadOnly = false, Description = @"The Azure resource tags that will replace the existing ones.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackPatchParametersTags) })] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRackPatchParametersTags Tag { get => _rackUpdateParametersBody.Tag ?? null /* object */; set => _rackUpdateParametersBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackPatchParametersTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRackPatchParametersTags Tag { get => _rackUpdateParametersBody.Tag ?? null /* object */; set => _rackUpdateParametersBody.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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IRack + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRack /// 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) @@ -327,11 +339,36 @@ 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.NetworkCloud.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -343,10 +380,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -414,7 +467,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -429,7 +482,7 @@ protected override void ProcessRecord() await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } if (InputObject?.Id != null) { - await this.Client.RacksUpdateViaIdentity(InputObject.Id, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _rackUpdateParametersBody, onOk, onDefault, this, Pipeline); + await this.Client.RacksUpdateViaIdentity(InputObject.Id, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _rackUpdateParametersBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate); } else { @@ -446,13 +499,13 @@ protected override void ProcessRecord() { ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.RackName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); } - await this.Client.RacksUpdate(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.RackName ?? null, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _rackUpdateParametersBody, onOk, onDefault, this, Pipeline); + await this.Client.RacksUpdate(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.RackName ?? null, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _rackUpdateParametersBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate); } await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null,body=_rackUpdateParametersBody}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -472,7 +525,7 @@ protected override void StopProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public UpdateAzNetworkCloudRack_UpdateViaIdentityExpanded() { @@ -498,12 +551,12 @@ public UpdateAzNetworkCloudRack_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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ) { @@ -520,15 +573,15 @@ public UpdateAzNetworkCloudRack_UpdateViaIdentityExpanded() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, body=_rackUpdateParametersBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 { IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, body=_rackUpdateParametersBody }) + 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 } }); @@ -538,12 +591,12 @@ public UpdateAzNetworkCloudRack_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.NetworkCloud.Models.Api20250201.IRack + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRack /// 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 ) { @@ -555,8 +608,9 @@ public UpdateAzNetworkCloudRack_UpdateViaIdentityExpanded() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IRack - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRack + var result = (await response); + WriteObject(result, false); } } } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudRack_UpdateViaJsonFilePath.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudRack_UpdateViaJsonFilePath.cs new file mode 100644 index 000000000000..3bfbf61cbe66 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudRack_UpdateViaJsonFilePath.cs @@ -0,0 +1,615 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; + using System; + + /// + /// Patch properties of the provided rack, or update the tags associated with the rack. Properties and tag update can be done + /// independently. + /// + /// + /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/racks/{rackName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzNetworkCloudRack_UpdateViaJsonFilePath", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRack))] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Patch properties of the provided rack, or update the tags associated with the rack. Properties and tag update can be done independently.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/racks/{rackName}", ApiVersion = "2025-02-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.NotSuggestDefaultParameterSet] + public partial class UpdateAzNetworkCloudRack_UpdateViaJsonFilePath : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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(); + + public global::System.String _jsonString; + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private string _ifMatch; + + /// + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value + /// to prevent accidentally overwriting concurrent changes. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes.", + SerializedName = @"If-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Header)] + public string IfMatch { get => this._ifMatch; set => this._ifMatch = value; } + + /// Backing field for property. + private string _ifNoneMatch; + + /// + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result + /// in error from server as they are not supported. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result in error from server as they are not supported.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result in error from server as they are not supported.", + SerializedName = @"If-None-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Header)] + public string IfNoneMatch { get => this._ifNoneMatch; set => this._ifNoneMatch = 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 _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.NetworkCloud.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.NetworkCloud.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of the rack. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the rack.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the rack.", + SerializedName = @"rackName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("RackName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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. The value must be an UUID. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription. The value must be an UUID.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription. The value must be an UUID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.IRack + /// 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.NetworkCloud.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of UpdateAzNetworkCloudRack_UpdateViaJsonFilePath + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets.UpdateAzNetworkCloudRack_UpdateViaJsonFilePath Clone() + { + var clone = new UpdateAzNetworkCloudRack_UpdateViaJsonFilePath(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.Name = this.Name; + clone.IfMatch = this.IfMatch; + clone.IfNoneMatch = this.IfNoneMatch; + clone.JsonFilePath = this.JsonFilePath; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'RacksUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.RacksUpdateViaJsonString(SubscriptionId, ResourceGroupName, Name, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _jsonString, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public UpdateAzNetworkCloudRack_UpdateViaJsonFilePath() + { + + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.IRack + /// 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.NetworkCloud.Models.IRack + var result = (await response); + WriteObject(result, false); + } + } + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudRack_UpdateViaJsonString.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudRack_UpdateViaJsonString.cs new file mode 100644 index 000000000000..d8b88419592b --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudRack_UpdateViaJsonString.cs @@ -0,0 +1,613 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; + using System; + + /// + /// Patch properties of the provided rack, or update the tags associated with the rack. Properties and tag update can be done + /// independently. + /// + /// + /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/racks/{rackName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzNetworkCloudRack_UpdateViaJsonString", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IRack))] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Patch properties of the provided rack, or update the tags associated with the rack. Properties and tag update can be done independently.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/racks/{rackName}", ApiVersion = "2025-02-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.NotSuggestDefaultParameterSet] + public partial class UpdateAzNetworkCloudRack_UpdateViaJsonString : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private string _ifMatch; + + /// + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value + /// to prevent accidentally overwriting concurrent changes. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes.", + SerializedName = @"If-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Header)] + public string IfMatch { get => this._ifMatch; set => this._ifMatch = value; } + + /// Backing field for property. + private string _ifNoneMatch; + + /// + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result + /// in error from server as they are not supported. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result in error from server as they are not supported.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result in error from server as they are not supported.", + SerializedName = @"If-None-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Header)] + public string IfNoneMatch { get => this._ifNoneMatch; set => this._ifNoneMatch = 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.NetworkCloud.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.NetworkCloud.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of the rack. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the rack.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the rack.", + SerializedName = @"rackName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("RackName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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. The value must be an UUID. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription. The value must be an UUID.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription. The value must be an UUID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.IRack + /// 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.NetworkCloud.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of UpdateAzNetworkCloudRack_UpdateViaJsonString + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets.UpdateAzNetworkCloudRack_UpdateViaJsonString Clone() + { + var clone = new UpdateAzNetworkCloudRack_UpdateViaJsonString(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.Name = this.Name; + clone.IfMatch = this.IfMatch; + clone.IfNoneMatch = this.IfNoneMatch; + clone.JsonString = this.JsonString; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'RacksUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.RacksUpdateViaJsonString(SubscriptionId, ResourceGroupName, Name, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _jsonString, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public UpdateAzNetworkCloudRack_UpdateViaJsonString() + { + + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.IRack + /// 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.NetworkCloud.Models.IRack + var result = (await response); + WriteObject(result, false); + } + } + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudServicesNetwork_UpdateExpanded.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudServicesNetwork_UpdateExpanded.cs index f48dda9a5ce9..c00156e10c34 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudServicesNetwork_UpdateExpanded.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudServicesNetwork_UpdateExpanded.cs @@ -6,22 +6,25 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// - /// Update properties of the provided cloud services network, or update the tags associated with it. Properties and tag updates + /// update properties of the provided cloud services network, or update the tags associated with it. Properties and tag update /// can be done independently. /// /// /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/cloudServicesNetworks/{cloudServicesNetworkName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzNetworkCloudServicesNetwork_UpdateExpanded", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetwork))] - [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Update properties of the provided cloud services network, or update the tags associated with it. Properties and tag updates can be done independently.")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetwork))] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"update properties of the provided cloud services network, or update the tags associated with it. Properties and tag update can be done independently.")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/cloudServicesNetworks/{cloudServicesNetworkName}", ApiVersion = "2025-02-01")] public partial class UpdateAzNetworkCloudServicesNetwork_UpdateExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -40,7 +43,10 @@ public partial class UpdateAzNetworkCloudServicesNetwork_UpdateExpanded : global /// /// CloudServicesNetworkPatchParameters represents the body of the request to patch the cloud services network. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkPatchParameters _cloudServicesNetworkUpdateParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.CloudServicesNetworkPatchParameters(); + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkPatchParameters _cloudServicesNetworkUpdateParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.CloudServicesNetworkPatchParameters(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); /// /// The list of egress endpoints. This allows for connection from a Hybrid AKS cluster to the specified endpoint. @@ -53,8 +59,8 @@ public partial class UpdateAzNetworkCloudServicesNetwork_UpdateExpanded : global ReadOnly = false, Description = @"The list of egress endpoints. This allows for connection from a Hybrid AKS cluster to the specified endpoint.", SerializedName = @"additionalEgressEndpoints", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IEgressEndpoint) })] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IEgressEndpoint[] AdditionalEgressEndpoint { get => _cloudServicesNetworkUpdateParametersBody.AdditionalEgressEndpoint ?? null /* arrayOf */; set => _cloudServicesNetworkUpdateParametersBody.AdditionalEgressEndpoint = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IEgressEndpoint) })] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IEgressEndpoint[] AdditionalEgressEndpoint { get => _cloudServicesNetworkUpdateParametersBody.AdditionalEgressEndpoint?.ToArray() ?? null /* fixedArrayOf */; set => _cloudServicesNetworkUpdateParametersBody.AdditionalEgressEndpoint = (value != null ? new System.Collections.Generic.List(value) : null); } /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] @@ -66,6 +72,9 @@ public partial class UpdateAzNetworkCloudServicesNetwork_UpdateExpanded : global [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -89,9 +98,12 @@ public partial class UpdateAzNetworkCloudServicesNetwork_UpdateExpanded : global ReadOnly = false, Description = @"The indicator of whether the platform default endpoints are allowed for the egress traffic.", SerializedName = @"enableDefaultEgressEndpoints", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CloudServicesNetworkEnableDefaultEgressEndpoints) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CloudServicesNetworkEnableDefaultEgressEndpoints))] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CloudServicesNetworkEnableDefaultEgressEndpoints EnableDefaultEgressEndpoint { get => _cloudServicesNetworkUpdateParametersBody.EnableDefaultEgressEndpoint ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CloudServicesNetworkEnableDefaultEgressEndpoints)""); set => _cloudServicesNetworkUpdateParametersBody.EnableDefaultEgressEndpoint = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("True", "False")] + public string EnableDefaultEgressEndpoint { get => _cloudServicesNetworkUpdateParametersBody.EnableDefaultEgressEndpoint ?? null; set => _cloudServicesNetworkUpdateParametersBody.EnableDefaultEgressEndpoint = 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")] @@ -176,7 +188,7 @@ public partial class UpdateAzNetworkCloudServicesNetwork_UpdateExpanded : global /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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")] @@ -222,7 +234,8 @@ public partial class UpdateAzNetworkCloudServicesNetwork_UpdateExpanded : global [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -235,32 +248,32 @@ public partial class UpdateAzNetworkCloudServicesNetwork_UpdateExpanded : global ReadOnly = false, Description = @"The Azure resource tags that will replace the existing ones.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkPatchParametersTags) })] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkPatchParametersTags Tag { get => _cloudServicesNetworkUpdateParametersBody.Tag ?? null /* object */; set => _cloudServicesNetworkUpdateParametersBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkPatchParametersTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkPatchParametersTags Tag { get => _cloudServicesNetworkUpdateParametersBody.Tag ?? null /* object */; set => _cloudServicesNetworkUpdateParametersBody.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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.ICloudServicesNetwork + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetwork /// 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) @@ -373,11 +386,36 @@ 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.NetworkCloud.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -389,10 +427,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -460,7 +514,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -473,12 +527,12 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.CloudServicesNetworksUpdate(SubscriptionId, ResourceGroupName, Name, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _cloudServicesNetworkUpdateParametersBody, onOk, onDefault, this, Pipeline); + await this.Client.CloudServicesNetworksUpdate(SubscriptionId, ResourceGroupName, Name, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _cloudServicesNetworkUpdateParametersBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate); await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null,body=_cloudServicesNetworkUpdateParametersBody}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -498,7 +552,7 @@ protected override void StopProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public UpdateAzNetworkCloudServicesNetwork_UpdateExpanded() { @@ -524,12 +578,12 @@ public UpdateAzNetworkCloudServicesNetwork_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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ) { @@ -546,15 +600,15 @@ public UpdateAzNetworkCloudServicesNetwork_UpdateExpanded() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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, IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, body=_cloudServicesNetworkUpdateParametersBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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, IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, body=_cloudServicesNetworkUpdateParametersBody }) + 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 } }); @@ -564,12 +618,12 @@ public UpdateAzNetworkCloudServicesNetwork_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.NetworkCloud.Models.Api20250201.ICloudServicesNetwork + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetwork /// 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 ) { @@ -581,8 +635,9 @@ public UpdateAzNetworkCloudServicesNetwork_UpdateExpanded() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetwork - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetwork + var result = (await response); + WriteObject(result, false); } } } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudServicesNetwork_UpdateViaIdentityExpanded.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudServicesNetwork_UpdateViaIdentityExpanded.cs index 99791bdc60d0..66c8a7b8531a 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudServicesNetwork_UpdateViaIdentityExpanded.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudServicesNetwork_UpdateViaIdentityExpanded.cs @@ -6,22 +6,25 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// - /// Update properties of the provided cloud services network, or update the tags associated with it. Properties and tag updates + /// update properties of the provided cloud services network, or update the tags associated with it. Properties and tag update /// can be done independently. /// /// /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/cloudServicesNetworks/{cloudServicesNetworkName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzNetworkCloudServicesNetwork_UpdateViaIdentityExpanded", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetwork))] - [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Update properties of the provided cloud services network, or update the tags associated with it. Properties and tag updates can be done independently.")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetwork))] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"update properties of the provided cloud services network, or update the tags associated with it. Properties and tag update can be done independently.")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/cloudServicesNetworks/{cloudServicesNetworkName}", ApiVersion = "2025-02-01")] public partial class UpdateAzNetworkCloudServicesNetwork_UpdateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -40,7 +43,10 @@ public partial class UpdateAzNetworkCloudServicesNetwork_UpdateViaIdentityExpand /// /// CloudServicesNetworkPatchParameters represents the body of the request to patch the cloud services network. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkPatchParameters _cloudServicesNetworkUpdateParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.CloudServicesNetworkPatchParameters(); + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkPatchParameters _cloudServicesNetworkUpdateParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.CloudServicesNetworkPatchParameters(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); /// /// The list of egress endpoints. This allows for connection from a Hybrid AKS cluster to the specified endpoint. @@ -53,8 +59,8 @@ public partial class UpdateAzNetworkCloudServicesNetwork_UpdateViaIdentityExpand ReadOnly = false, Description = @"The list of egress endpoints. This allows for connection from a Hybrid AKS cluster to the specified endpoint.", SerializedName = @"additionalEgressEndpoints", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IEgressEndpoint) })] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IEgressEndpoint[] AdditionalEgressEndpoint { get => _cloudServicesNetworkUpdateParametersBody.AdditionalEgressEndpoint ?? null /* arrayOf */; set => _cloudServicesNetworkUpdateParametersBody.AdditionalEgressEndpoint = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IEgressEndpoint) })] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IEgressEndpoint[] AdditionalEgressEndpoint { get => _cloudServicesNetworkUpdateParametersBody.AdditionalEgressEndpoint?.ToArray() ?? null /* fixedArrayOf */; set => _cloudServicesNetworkUpdateParametersBody.AdditionalEgressEndpoint = (value != null ? new System.Collections.Generic.List(value) : null); } /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] @@ -66,6 +72,9 @@ public partial class UpdateAzNetworkCloudServicesNetwork_UpdateViaIdentityExpand [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -89,9 +98,12 @@ public partial class UpdateAzNetworkCloudServicesNetwork_UpdateViaIdentityExpand ReadOnly = false, Description = @"The indicator of whether the platform default endpoints are allowed for the egress traffic.", SerializedName = @"enableDefaultEgressEndpoints", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CloudServicesNetworkEnableDefaultEgressEndpoints) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CloudServicesNetworkEnableDefaultEgressEndpoints))] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CloudServicesNetworkEnableDefaultEgressEndpoints EnableDefaultEgressEndpoint { get => _cloudServicesNetworkUpdateParametersBody.EnableDefaultEgressEndpoint ?? ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support.CloudServicesNetworkEnableDefaultEgressEndpoints)""); set => _cloudServicesNetworkUpdateParametersBody.EnableDefaultEgressEndpoint = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.PSArgumentCompleterAttribute("True", "False")] + public string EnableDefaultEgressEndpoint { get => _cloudServicesNetworkUpdateParametersBody.EnableDefaultEgressEndpoint ?? null; set => _cloudServicesNetworkUpdateParametersBody.EnableDefaultEgressEndpoint = 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")] @@ -169,7 +181,7 @@ public partial class UpdateAzNetworkCloudServicesNetwork_UpdateViaIdentityExpand /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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")] @@ -196,32 +208,32 @@ public partial class UpdateAzNetworkCloudServicesNetwork_UpdateViaIdentityExpand ReadOnly = false, Description = @"The Azure resource tags that will replace the existing ones.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkPatchParametersTags) })] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetworkPatchParametersTags Tag { get => _cloudServicesNetworkUpdateParametersBody.Tag ?? null /* object */; set => _cloudServicesNetworkUpdateParametersBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkPatchParametersTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetworkPatchParametersTags Tag { get => _cloudServicesNetworkUpdateParametersBody.Tag ?? null /* object */; set => _cloudServicesNetworkUpdateParametersBody.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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.ICloudServicesNetwork + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetwork /// 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) @@ -333,11 +345,36 @@ 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.NetworkCloud.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -349,10 +386,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -420,7 +473,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -435,7 +488,7 @@ protected override void ProcessRecord() await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } if (InputObject?.Id != null) { - await this.Client.CloudServicesNetworksUpdateViaIdentity(InputObject.Id, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _cloudServicesNetworkUpdateParametersBody, onOk, onDefault, this, Pipeline); + await this.Client.CloudServicesNetworksUpdateViaIdentity(InputObject.Id, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _cloudServicesNetworkUpdateParametersBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate); } else { @@ -452,13 +505,13 @@ protected override void ProcessRecord() { ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.CloudServicesNetworkName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); } - await this.Client.CloudServicesNetworksUpdate(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.CloudServicesNetworkName ?? null, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _cloudServicesNetworkUpdateParametersBody, onOk, onDefault, this, Pipeline); + await this.Client.CloudServicesNetworksUpdate(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.CloudServicesNetworkName ?? null, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _cloudServicesNetworkUpdateParametersBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate); } await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null,body=_cloudServicesNetworkUpdateParametersBody}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -478,7 +531,8 @@ protected override void StopProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet + /// class. /// public UpdateAzNetworkCloudServicesNetwork_UpdateViaIdentityExpanded() { @@ -504,12 +558,12 @@ public UpdateAzNetworkCloudServicesNetwork_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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ) { @@ -526,15 +580,15 @@ public UpdateAzNetworkCloudServicesNetwork_UpdateViaIdentityExpanded() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, body=_cloudServicesNetworkUpdateParametersBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 { IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, body=_cloudServicesNetworkUpdateParametersBody }) + 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 } }); @@ -544,12 +598,12 @@ public UpdateAzNetworkCloudServicesNetwork_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.NetworkCloud.Models.Api20250201.ICloudServicesNetwork + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetwork /// 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 ) { @@ -561,8 +615,9 @@ public UpdateAzNetworkCloudServicesNetwork_UpdateViaIdentityExpanded() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ICloudServicesNetwork - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetwork + var result = (await response); + WriteObject(result, false); } } } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudServicesNetwork_UpdateViaJsonFilePath.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudServicesNetwork_UpdateViaJsonFilePath.cs new file mode 100644 index 000000000000..a7e5eab9ad42 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudServicesNetwork_UpdateViaJsonFilePath.cs @@ -0,0 +1,617 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; + using System; + + /// + /// update properties of the provided cloud services network, or update the tags associated with it. Properties and tag update + /// can be done independently. + /// + /// + /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/cloudServicesNetworks/{cloudServicesNetworkName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzNetworkCloudServicesNetwork_UpdateViaJsonFilePath", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetwork))] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"update properties of the provided cloud services network, or update the tags associated with it. Properties and tag update can be done independently.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/cloudServicesNetworks/{cloudServicesNetworkName}", ApiVersion = "2025-02-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.NotSuggestDefaultParameterSet] + public partial class UpdateAzNetworkCloudServicesNetwork_UpdateViaJsonFilePath : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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(); + + public global::System.String _jsonString; + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private string _ifMatch; + + /// + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value + /// to prevent accidentally overwriting concurrent changes. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes.", + SerializedName = @"If-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Header)] + public string IfMatch { get => this._ifMatch; set => this._ifMatch = value; } + + /// Backing field for property. + private string _ifNoneMatch; + + /// + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result + /// in error from server as they are not supported. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result in error from server as they are not supported.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result in error from server as they are not supported.", + SerializedName = @"If-None-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Header)] + public string IfNoneMatch { get => this._ifNoneMatch; set => this._ifNoneMatch = 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 _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.NetworkCloud.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.NetworkCloud.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of the cloud services network. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the cloud services network.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the cloud services network.", + SerializedName = @"cloudServicesNetworkName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("CloudServicesNetworkName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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. The value must be an UUID. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription. The value must be an UUID.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription. The value must be an UUID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.ICloudServicesNetwork + /// 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.NetworkCloud.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of UpdateAzNetworkCloudServicesNetwork_UpdateViaJsonFilePath + /// + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets.UpdateAzNetworkCloudServicesNetwork_UpdateViaJsonFilePath Clone() + { + var clone = new UpdateAzNetworkCloudServicesNetwork_UpdateViaJsonFilePath(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.Name = this.Name; + clone.IfMatch = this.IfMatch; + clone.IfNoneMatch = this.IfNoneMatch; + clone.JsonFilePath = this.JsonFilePath; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'CloudServicesNetworksUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.CloudServicesNetworksUpdateViaJsonString(SubscriptionId, ResourceGroupName, Name, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _jsonString, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public UpdateAzNetworkCloudServicesNetwork_UpdateViaJsonFilePath() + { + + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.ICloudServicesNetwork + /// 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.NetworkCloud.Models.ICloudServicesNetwork + var result = (await response); + WriteObject(result, false); + } + } + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudServicesNetwork_UpdateViaJsonString.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudServicesNetwork_UpdateViaJsonString.cs new file mode 100644 index 000000000000..243539c73a34 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudServicesNetwork_UpdateViaJsonString.cs @@ -0,0 +1,613 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; + using System; + + /// + /// update properties of the provided cloud services network, or update the tags associated with it. Properties and tag update + /// can be done independently. + /// + /// + /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/cloudServicesNetworks/{cloudServicesNetworkName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzNetworkCloudServicesNetwork_UpdateViaJsonString", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ICloudServicesNetwork))] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"update properties of the provided cloud services network, or update the tags associated with it. Properties and tag update can be done independently.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/cloudServicesNetworks/{cloudServicesNetworkName}", ApiVersion = "2025-02-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.NotSuggestDefaultParameterSet] + public partial class UpdateAzNetworkCloudServicesNetwork_UpdateViaJsonString : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private string _ifMatch; + + /// + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value + /// to prevent accidentally overwriting concurrent changes. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes.", + SerializedName = @"If-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Header)] + public string IfMatch { get => this._ifMatch; set => this._ifMatch = value; } + + /// Backing field for property. + private string _ifNoneMatch; + + /// + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result + /// in error from server as they are not supported. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result in error from server as they are not supported.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result in error from server as they are not supported.", + SerializedName = @"If-None-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Header)] + public string IfNoneMatch { get => this._ifNoneMatch; set => this._ifNoneMatch = 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.NetworkCloud.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.NetworkCloud.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of the cloud services network. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the cloud services network.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the cloud services network.", + SerializedName = @"cloudServicesNetworkName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("CloudServicesNetworkName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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. The value must be an UUID. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription. The value must be an UUID.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription. The value must be an UUID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.ICloudServicesNetwork + /// 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.NetworkCloud.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of UpdateAzNetworkCloudServicesNetwork_UpdateViaJsonString + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets.UpdateAzNetworkCloudServicesNetwork_UpdateViaJsonString Clone() + { + var clone = new UpdateAzNetworkCloudServicesNetwork_UpdateViaJsonString(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.Name = this.Name; + clone.IfMatch = this.IfMatch; + clone.IfNoneMatch = this.IfNoneMatch; + clone.JsonString = this.JsonString; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'CloudServicesNetworksUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.CloudServicesNetworksUpdateViaJsonString(SubscriptionId, ResourceGroupName, Name, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _jsonString, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public UpdateAzNetworkCloudServicesNetwork_UpdateViaJsonString() + { + + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.ICloudServicesNetwork + /// 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.NetworkCloud.Models.ICloudServicesNetwork + var result = (await response); + WriteObject(result, false); + } + } + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudStorageAppliance_UpdateExpanded.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudStorageAppliance_UpdateExpanded.cs index b5867079a842..6a100a527088 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudStorageAppliance_UpdateExpanded.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudStorageAppliance_UpdateExpanded.cs @@ -6,23 +6,25 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// - /// Update properties of the provided storage appliance, or update tags associated with the storage appliance Properties and - /// tag updates can be done independently. + /// update properties of the provided storage appliance, or update tags associated with the storage appliance Properties and + /// tag update can be done independently. /// /// /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/storageAppliances/{storageApplianceName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzNetworkCloudStorageAppliance_UpdateExpanded", SupportsShouldProcess = true)] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliance", "15.0.0", "2.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"SecretRotationStatus"}, NewOutputProperties=new string[] {"SecretRotationStatus"}, ChangeDescription="The type of property will be changed from fixed array to 'List'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliance))] - [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Update properties of the provided storage appliance, or update tags associated with the storage appliance Properties and tag updates can be done independently.")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliance))] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"update properties of the provided storage appliance, or update tags associated with the storage appliance Properties and tag update can be done independently.")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/storageAppliances/{storageApplianceName}", ApiVersion = "2025-02-01")] public partial class UpdateAzNetworkCloudStorageAppliance_UpdateExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -38,10 +40,13 @@ public partial class UpdateAzNetworkCloudStorageAppliance_UpdateExpanded : 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(); + /// /// StorageAppliancePatchParameters represents the body of the request to patch storage appliance properties. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePatchParameters _storageApplianceUpdateParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.StorageAppliancePatchParameters(); + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePatchParameters _storageApplianceUpdateParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.StorageAppliancePatchParameters(); /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] @@ -53,6 +58,9 @@ public partial class UpdateAzNetworkCloudStorageAppliance_UpdateExpanded : globa [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -66,6 +74,9 @@ public partial class UpdateAzNetworkCloudStorageAppliance_UpdateExpanded : globa [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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] @@ -149,7 +160,7 @@ public partial class UpdateAzNetworkCloudStorageAppliance_UpdateExpanded : globa /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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")] @@ -206,7 +217,8 @@ public partial class UpdateAzNetworkCloudStorageAppliance_UpdateExpanded : globa [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -219,32 +231,32 @@ public partial class UpdateAzNetworkCloudStorageAppliance_UpdateExpanded : globa ReadOnly = false, Description = @"The Azure resource tags that will replace the existing ones.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePatchParametersTags) })] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePatchParametersTags Tag { get => _storageApplianceUpdateParametersBody.Tag ?? null /* object */; set => _storageApplianceUpdateParametersBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePatchParametersTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePatchParametersTags Tag { get => _storageApplianceUpdateParametersBody.Tag ?? null /* object */; set => _storageApplianceUpdateParametersBody.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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IStorageAppliance + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliance /// 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) @@ -357,11 +369,36 @@ 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.NetworkCloud.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -373,10 +410,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -444,7 +497,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -457,12 +510,12 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.StorageAppliancesUpdate(SubscriptionId, ResourceGroupName, Name, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _storageApplianceUpdateParametersBody, onOk, onDefault, this, Pipeline); + await this.Client.StorageAppliancesUpdate(SubscriptionId, ResourceGroupName, Name, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _storageApplianceUpdateParametersBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate); await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null,body=_storageApplianceUpdateParametersBody}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -482,7 +535,7 @@ protected override void StopProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public UpdateAzNetworkCloudStorageAppliance_UpdateExpanded() { @@ -508,12 +561,12 @@ public UpdateAzNetworkCloudStorageAppliance_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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ) { @@ -530,15 +583,15 @@ public UpdateAzNetworkCloudStorageAppliance_UpdateExpanded() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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, IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, body=_storageApplianceUpdateParametersBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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, IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, body=_storageApplianceUpdateParametersBody }) + 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 +601,12 @@ public UpdateAzNetworkCloudStorageAppliance_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.NetworkCloud.Models.Api20250201.IStorageAppliance + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliance /// 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 +618,9 @@ public UpdateAzNetworkCloudStorageAppliance_UpdateExpanded() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliance - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliance + var result = (await response); + WriteObject(result, false); } } } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudStorageAppliance_UpdateViaIdentityExpanded.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudStorageAppliance_UpdateViaIdentityExpanded.cs index 13152de855db..725013c38731 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudStorageAppliance_UpdateViaIdentityExpanded.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudStorageAppliance_UpdateViaIdentityExpanded.cs @@ -6,23 +6,25 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// - /// Update properties of the provided storage appliance, or update tags associated with the storage appliance Properties and - /// tag updates can be done independently. + /// update properties of the provided storage appliance, or update tags associated with the storage appliance Properties and + /// tag update can be done independently. /// /// /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/storageAppliances/{storageApplianceName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzNetworkCloudStorageAppliance_UpdateViaIdentityExpanded", SupportsShouldProcess = true)] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliance", "15.0.0", "2.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"SecretRotationStatus"}, NewOutputProperties=new string[] {"SecretRotationStatus"}, ChangeDescription="The type of property will be changed from fixed array to 'List'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliance))] - [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Update properties of the provided storage appliance, or update tags associated with the storage appliance Properties and tag updates can be done independently.")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliance))] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"update properties of the provided storage appliance, or update tags associated with the storage appliance Properties and tag update can be done independently.")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/storageAppliances/{storageApplianceName}", ApiVersion = "2025-02-01")] public partial class UpdateAzNetworkCloudStorageAppliance_UpdateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -38,10 +40,13 @@ public partial class UpdateAzNetworkCloudStorageAppliance_UpdateViaIdentityExpan /// 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(); + /// /// StorageAppliancePatchParameters represents the body of the request to patch storage appliance properties. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePatchParameters _storageApplianceUpdateParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.StorageAppliancePatchParameters(); + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePatchParameters _storageApplianceUpdateParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.StorageAppliancePatchParameters(); /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] @@ -53,6 +58,9 @@ public partial class UpdateAzNetworkCloudStorageAppliance_UpdateViaIdentityExpan [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -66,6 +74,9 @@ public partial class UpdateAzNetworkCloudStorageAppliance_UpdateViaIdentityExpan [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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] @@ -142,7 +153,7 @@ public partial class UpdateAzNetworkCloudStorageAppliance_UpdateViaIdentityExpan /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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")] @@ -180,32 +191,32 @@ public partial class UpdateAzNetworkCloudStorageAppliance_UpdateViaIdentityExpan ReadOnly = false, Description = @"The Azure resource tags that will replace the existing ones.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePatchParametersTags) })] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliancePatchParametersTags Tag { get => _storageApplianceUpdateParametersBody.Tag ?? null /* object */; set => _storageApplianceUpdateParametersBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePatchParametersTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliancePatchParametersTags Tag { get => _storageApplianceUpdateParametersBody.Tag ?? null /* object */; set => _storageApplianceUpdateParametersBody.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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IStorageAppliance + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliance /// 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,11 +328,36 @@ 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.NetworkCloud.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -333,10 +369,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -404,7 +456,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -419,7 +471,7 @@ protected override void ProcessRecord() await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } if (InputObject?.Id != null) { - await this.Client.StorageAppliancesUpdateViaIdentity(InputObject.Id, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _storageApplianceUpdateParametersBody, onOk, onDefault, this, Pipeline); + await this.Client.StorageAppliancesUpdateViaIdentity(InputObject.Id, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _storageApplianceUpdateParametersBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate); } else { @@ -436,13 +488,13 @@ protected override void ProcessRecord() { ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.StorageApplianceName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); } - await this.Client.StorageAppliancesUpdate(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.StorageApplianceName ?? null, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _storageApplianceUpdateParametersBody, onOk, onDefault, this, Pipeline); + await this.Client.StorageAppliancesUpdate(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.StorageApplianceName ?? null, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _storageApplianceUpdateParametersBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate); } await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null,body=_storageApplianceUpdateParametersBody}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -462,7 +514,7 @@ protected override void StopProcessing() } /// - /// Intializes a new instance of the cmdlet + /// Initializes a new instance of the cmdlet /// class. /// public UpdateAzNetworkCloudStorageAppliance_UpdateViaIdentityExpanded() @@ -489,12 +541,12 @@ public UpdateAzNetworkCloudStorageAppliance_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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ) { @@ -511,15 +563,15 @@ public UpdateAzNetworkCloudStorageAppliance_UpdateViaIdentityExpanded() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, body=_storageApplianceUpdateParametersBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 { IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, body=_storageApplianceUpdateParametersBody }) + 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 } }); @@ -529,12 +581,12 @@ public UpdateAzNetworkCloudStorageAppliance_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.NetworkCloud.Models.Api20250201.IStorageAppliance + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliance /// 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 ) { @@ -546,8 +598,9 @@ public UpdateAzNetworkCloudStorageAppliance_UpdateViaIdentityExpanded() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IStorageAppliance - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliance + var result = (await response); + WriteObject(result, false); } } } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudStorageAppliance_UpdateViaJsonFilePath.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudStorageAppliance_UpdateViaJsonFilePath.cs new file mode 100644 index 000000000000..92d3091c15c5 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudStorageAppliance_UpdateViaJsonFilePath.cs @@ -0,0 +1,617 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; + using System; + + /// + /// update properties of the provided storage appliance, or update tags associated with the storage appliance Properties and + /// tag update can be done independently. + /// + /// + /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/storageAppliances/{storageApplianceName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzNetworkCloudStorageAppliance_UpdateViaJsonFilePath", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliance))] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"update properties of the provided storage appliance, or update tags associated with the storage appliance Properties and tag update can be done independently.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/storageAppliances/{storageApplianceName}", ApiVersion = "2025-02-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.NotSuggestDefaultParameterSet] + public partial class UpdateAzNetworkCloudStorageAppliance_UpdateViaJsonFilePath : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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(); + + public global::System.String _jsonString; + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private string _ifMatch; + + /// + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value + /// to prevent accidentally overwriting concurrent changes. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes.", + SerializedName = @"If-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Header)] + public string IfMatch { get => this._ifMatch; set => this._ifMatch = value; } + + /// Backing field for property. + private string _ifNoneMatch; + + /// + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result + /// in error from server as they are not supported. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result in error from server as they are not supported.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result in error from server as they are not supported.", + SerializedName = @"If-None-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Header)] + public string IfNoneMatch { get => this._ifNoneMatch; set => this._ifNoneMatch = 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 _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.NetworkCloud.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.NetworkCloud.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of the storage appliance. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the storage appliance.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the storage appliance.", + SerializedName = @"storageApplianceName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("StorageApplianceName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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. The value must be an UUID. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription. The value must be an UUID.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription. The value must be an UUID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.IStorageAppliance + /// 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.NetworkCloud.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of UpdateAzNetworkCloudStorageAppliance_UpdateViaJsonFilePath + /// + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets.UpdateAzNetworkCloudStorageAppliance_UpdateViaJsonFilePath Clone() + { + var clone = new UpdateAzNetworkCloudStorageAppliance_UpdateViaJsonFilePath(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.Name = this.Name; + clone.IfMatch = this.IfMatch; + clone.IfNoneMatch = this.IfNoneMatch; + clone.JsonFilePath = this.JsonFilePath; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'StorageAppliancesUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.StorageAppliancesUpdateViaJsonString(SubscriptionId, ResourceGroupName, Name, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _jsonString, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public UpdateAzNetworkCloudStorageAppliance_UpdateViaJsonFilePath() + { + + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.IStorageAppliance + /// 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.NetworkCloud.Models.IStorageAppliance + var result = (await response); + WriteObject(result, false); + } + } + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudStorageAppliance_UpdateViaJsonString.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudStorageAppliance_UpdateViaJsonString.cs new file mode 100644 index 000000000000..e23ab7026321 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudStorageAppliance_UpdateViaJsonString.cs @@ -0,0 +1,615 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; + using System; + + /// + /// update properties of the provided storage appliance, or update tags associated with the storage appliance Properties and + /// tag update can be done independently. + /// + /// + /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/storageAppliances/{storageApplianceName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzNetworkCloudStorageAppliance_UpdateViaJsonString", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IStorageAppliance))] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"update properties of the provided storage appliance, or update tags associated with the storage appliance Properties and tag update can be done independently.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/storageAppliances/{storageApplianceName}", ApiVersion = "2025-02-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.NotSuggestDefaultParameterSet] + public partial class UpdateAzNetworkCloudStorageAppliance_UpdateViaJsonString : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private string _ifMatch; + + /// + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value + /// to prevent accidentally overwriting concurrent changes. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes.", + SerializedName = @"If-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Header)] + public string IfMatch { get => this._ifMatch; set => this._ifMatch = value; } + + /// Backing field for property. + private string _ifNoneMatch; + + /// + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result + /// in error from server as they are not supported. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result in error from server as they are not supported.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result in error from server as they are not supported.", + SerializedName = @"If-None-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Header)] + public string IfNoneMatch { get => this._ifNoneMatch; set => this._ifNoneMatch = 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.NetworkCloud.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.NetworkCloud.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of the storage appliance. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the storage appliance.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the storage appliance.", + SerializedName = @"storageApplianceName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("StorageApplianceName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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. The value must be an UUID. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription. The value must be an UUID.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription. The value must be an UUID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.IStorageAppliance + /// 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.NetworkCloud.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of UpdateAzNetworkCloudStorageAppliance_UpdateViaJsonString + /// + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets.UpdateAzNetworkCloudStorageAppliance_UpdateViaJsonString Clone() + { + var clone = new UpdateAzNetworkCloudStorageAppliance_UpdateViaJsonString(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.Name = this.Name; + clone.IfMatch = this.IfMatch; + clone.IfNoneMatch = this.IfNoneMatch; + clone.JsonString = this.JsonString; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'StorageAppliancesUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.StorageAppliancesUpdateViaJsonString(SubscriptionId, ResourceGroupName, Name, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _jsonString, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public UpdateAzNetworkCloudStorageAppliance_UpdateViaJsonString() + { + + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.IStorageAppliance + /// 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.NetworkCloud.Models.IStorageAppliance + var result = (await response); + WriteObject(result, false); + } + } + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudTrunkedNetwork_UpdateExpanded.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudTrunkedNetwork_UpdateExpanded.cs index 934549a515b2..7b70f05b7d60 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudTrunkedNetwork_UpdateExpanded.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudTrunkedNetwork_UpdateExpanded.cs @@ -6,20 +6,22 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; - /// Update tags associated with the provided trunked network. + /// update tags associated with the provided trunked network. /// /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/trunkedNetworks/{trunkedNetworkName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzNetworkCloudTrunkedNetwork_UpdateExpanded", SupportsShouldProcess = true)] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetwork", "15.0.0", "2.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"AssociatedResourceId","HybridAksClustersAssociatedId","IsolationDomainId","VirtualMachinesAssociatedId","Vlan"}, NewOutputProperties=new string[] {"AssociatedResourceId","HybridAksClustersAssociatedId","IsolationDomainId","VirtualMachinesAssociatedId","Vlan"}, ChangeDescription="The types of properties will be changed from fixed array to 'List'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetwork))] - [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Update tags associated with the provided trunked network.")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetwork))] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"update tags associated with the provided trunked network.")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/trunkedNetworks/{trunkedNetworkName}", ApiVersion = "2025-02-01")] public partial class UpdateAzNetworkCloudTrunkedNetwork_UpdateExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 UpdateAzNetworkCloudTrunkedNetwork_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; + /// /// TrunkedNetworkPatchParameters represents the body of the request to patch the Trunked network. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkPatchParameters _trunkedNetworkUpdateParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.TrunkedNetworkPatchParameters(); + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkPatchParameters _trunkedNetworkUpdateParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.TrunkedNetworkPatchParameters(); /// Wait for .NET debugger to attach [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -58,6 +75,9 @@ public partial class UpdateAzNetworkCloudTrunkedNetwork_UpdateExpanded : global: [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 UpdateAzNetworkCloudTrunkedNetwork_UpdateExpanded : global: /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,7 +199,8 @@ public partial class UpdateAzNetworkCloudTrunkedNetwork_UpdateExpanded : global: [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -192,32 +213,32 @@ public partial class UpdateAzNetworkCloudTrunkedNetwork_UpdateExpanded : global: ReadOnly = false, Description = @"The Azure resource tags that will replace the existing ones.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkPatchParametersTags) })] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkPatchParametersTags Tag { get => _trunkedNetworkUpdateParametersBody.Tag ?? null /* object */; set => _trunkedNetworkUpdateParametersBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkPatchParametersTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkPatchParametersTags Tag { get => _trunkedNetworkUpdateParametersBody.Tag ?? null /* object */; set => _trunkedNetworkUpdateParametersBody.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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.ITrunkedNetwork + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetwork /// 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) @@ -240,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.NetworkCloud.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -304,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.NetworkCloud.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.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -361,7 +412,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -374,12 +425,12 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.TrunkedNetworksUpdate(SubscriptionId, ResourceGroupName, Name, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _trunkedNetworkUpdateParametersBody, onOk, onDefault, this, Pipeline); + await this.Client.TrunkedNetworksUpdate(SubscriptionId, ResourceGroupName, Name, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _trunkedNetworkUpdateParametersBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate); await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null,body=_trunkedNetworkUpdateParametersBody}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -399,7 +450,7 @@ protected override void StopProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public UpdateAzNetworkCloudTrunkedNetwork_UpdateExpanded() { @@ -425,12 +476,12 @@ public UpdateAzNetworkCloudTrunkedNetwork_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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ) { @@ -447,15 +498,15 @@ public UpdateAzNetworkCloudTrunkedNetwork_UpdateExpanded() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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, IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, body=_trunkedNetworkUpdateParametersBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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, IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, body=_trunkedNetworkUpdateParametersBody }) + 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 } }); @@ -465,12 +516,12 @@ public UpdateAzNetworkCloudTrunkedNetwork_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.NetworkCloud.Models.Api20250201.ITrunkedNetwork + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetwork /// 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 ) { @@ -482,8 +533,26 @@ public UpdateAzNetworkCloudTrunkedNetwork_UpdateExpanded() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetwork - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetwork + 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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudTrunkedNetwork_UpdateViaIdentityExpanded.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudTrunkedNetwork_UpdateViaIdentityExpanded.cs index 6e555534d747..c59e12a1ded1 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudTrunkedNetwork_UpdateViaIdentityExpanded.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudTrunkedNetwork_UpdateViaIdentityExpanded.cs @@ -6,20 +6,22 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; - /// Update tags associated with the provided trunked network. + /// update tags associated with the provided trunked network. /// /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/trunkedNetworks/{trunkedNetworkName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzNetworkCloudTrunkedNetwork_UpdateViaIdentityExpanded", SupportsShouldProcess = true)] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetwork", "15.0.0", "2.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"AssociatedResourceId","HybridAksClustersAssociatedId","IsolationDomainId","VirtualMachinesAssociatedId","Vlan"}, NewOutputProperties=new string[] {"AssociatedResourceId","HybridAksClustersAssociatedId","IsolationDomainId","VirtualMachinesAssociatedId","Vlan"}, ChangeDescription="The types of properties will be changed from fixed array to 'List'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetwork))] - [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Update tags associated with the provided trunked network.")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetwork))] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"update tags associated with the provided trunked network.")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/trunkedNetworks/{trunkedNetworkName}", ApiVersion = "2025-02-01")] public partial class UpdateAzNetworkCloudTrunkedNetwork_UpdateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 UpdateAzNetworkCloudTrunkedNetwork_UpdateViaIdentityExpande /// 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; + /// /// TrunkedNetworkPatchParameters represents the body of the request to patch the Trunked network. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkPatchParameters _trunkedNetworkUpdateParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.TrunkedNetworkPatchParameters(); + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkPatchParameters _trunkedNetworkUpdateParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.TrunkedNetworkPatchParameters(); /// Wait for .NET debugger to attach [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -58,6 +75,9 @@ public partial class UpdateAzNetworkCloudTrunkedNetwork_UpdateViaIdentityExpande [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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] @@ -126,7 +146,7 @@ public partial class UpdateAzNetworkCloudTrunkedNetwork_UpdateViaIdentityExpande /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,32 +173,32 @@ public partial class UpdateAzNetworkCloudTrunkedNetwork_UpdateViaIdentityExpande ReadOnly = false, Description = @"The Azure resource tags that will replace the existing ones.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkPatchParametersTags) })] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetworkPatchParametersTags Tag { get => _trunkedNetworkUpdateParametersBody.Tag ?? null /* object */; set => _trunkedNetworkUpdateParametersBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkPatchParametersTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetworkPatchParametersTags Tag { get => _trunkedNetworkUpdateParametersBody.Tag ?? null /* object */; set => _trunkedNetworkUpdateParametersBody.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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.ITrunkedNetwork + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetwork /// 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 +221,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.NetworkCloud.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -265,8 +290,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.NetworkCloud.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.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -322,7 +372,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -337,7 +387,7 @@ protected override void ProcessRecord() await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } if (InputObject?.Id != null) { - await this.Client.TrunkedNetworksUpdateViaIdentity(InputObject.Id, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _trunkedNetworkUpdateParametersBody, onOk, onDefault, this, Pipeline); + await this.Client.TrunkedNetworksUpdateViaIdentity(InputObject.Id, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _trunkedNetworkUpdateParametersBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate); } else { @@ -354,13 +404,13 @@ protected override void ProcessRecord() { ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.TrunkedNetworkName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); } - await this.Client.TrunkedNetworksUpdate(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.TrunkedNetworkName ?? null, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _trunkedNetworkUpdateParametersBody, onOk, onDefault, this, Pipeline); + await this.Client.TrunkedNetworksUpdate(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.TrunkedNetworkName ?? null, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _trunkedNetworkUpdateParametersBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate); } await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null,body=_trunkedNetworkUpdateParametersBody}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -380,7 +430,7 @@ protected override void StopProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public UpdateAzNetworkCloudTrunkedNetwork_UpdateViaIdentityExpanded() { @@ -406,12 +456,12 @@ public UpdateAzNetworkCloudTrunkedNetwork_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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ) { @@ -428,15 +478,15 @@ public UpdateAzNetworkCloudTrunkedNetwork_UpdateViaIdentityExpanded() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, body=_trunkedNetworkUpdateParametersBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 { IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, body=_trunkedNetworkUpdateParametersBody }) + 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 } }); @@ -446,12 +496,12 @@ public UpdateAzNetworkCloudTrunkedNetwork_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.NetworkCloud.Models.Api20250201.ITrunkedNetwork + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetwork /// 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 ) { @@ -463,8 +513,26 @@ public UpdateAzNetworkCloudTrunkedNetwork_UpdateViaIdentityExpanded() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.ITrunkedNetwork - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetwork + 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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudTrunkedNetwork_UpdateViaJsonFilePath.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudTrunkedNetwork_UpdateViaJsonFilePath.cs new file mode 100644 index 000000000000..fd6bd401ea19 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudTrunkedNetwork_UpdateViaJsonFilePath.cs @@ -0,0 +1,558 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; + using System; + + /// update tags associated with the provided trunked network. + /// + /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/trunkedNetworks/{trunkedNetworkName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzNetworkCloudTrunkedNetwork_UpdateViaJsonFilePath", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetwork))] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"update tags associated with the provided trunked network.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/trunkedNetworks/{trunkedNetworkName}", ApiVersion = "2025-02-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.NotSuggestDefaultParameterSet] + public partial class UpdateAzNetworkCloudTrunkedNetwork_UpdateViaJsonFilePath : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private string _ifMatch; + + /// + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value + /// to prevent accidentally overwriting concurrent changes. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes.", + SerializedName = @"If-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Header)] + public string IfMatch { get => this._ifMatch; set => this._ifMatch = value; } + + /// Backing field for property. + private string _ifNoneMatch; + + /// + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result + /// in error from server as they are not supported. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result in error from server as they are not supported.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result in error from server as they are not supported.", + SerializedName = @"If-None-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Header)] + public string IfNoneMatch { get => this._ifNoneMatch; set => this._ifNoneMatch = 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 _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.NetworkCloud.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.NetworkCloud.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of the trunked network. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the trunked network.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the trunked network.", + SerializedName = @"trunkedNetworkName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("TrunkedNetworkName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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. The value must be an UUID. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription. The value must be an UUID.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription. The value must be an UUID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.ITrunkedNetwork + /// 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.NetworkCloud.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'TrunkedNetworksUpdate' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.TrunkedNetworksUpdateViaJsonString(SubscriptionId, ResourceGroupName, Name, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _jsonString, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public UpdateAzNetworkCloudTrunkedNetwork_UpdateViaJsonFilePath() + { + + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.ITrunkedNetwork + /// 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.NetworkCloud.Models.ITrunkedNetwork + 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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudTrunkedNetwork_UpdateViaJsonString.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudTrunkedNetwork_UpdateViaJsonString.cs new file mode 100644 index 000000000000..57c94791113b --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudTrunkedNetwork_UpdateViaJsonString.cs @@ -0,0 +1,556 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; + using System; + + /// update tags associated with the provided trunked network. + /// + /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/trunkedNetworks/{trunkedNetworkName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzNetworkCloudTrunkedNetwork_UpdateViaJsonString", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.ITrunkedNetwork))] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"update tags associated with the provided trunked network.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/trunkedNetworks/{trunkedNetworkName}", ApiVersion = "2025-02-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.NotSuggestDefaultParameterSet] + public partial class UpdateAzNetworkCloudTrunkedNetwork_UpdateViaJsonString : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private string _ifMatch; + + /// + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value + /// to prevent accidentally overwriting concurrent changes. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes.", + SerializedName = @"If-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Header)] + public string IfMatch { get => this._ifMatch; set => this._ifMatch = value; } + + /// Backing field for property. + private string _ifNoneMatch; + + /// + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result + /// in error from server as they are not supported. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result in error from server as they are not supported.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result in error from server as they are not supported.", + SerializedName = @"If-None-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Header)] + public string IfNoneMatch { get => this._ifNoneMatch; set => this._ifNoneMatch = 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.NetworkCloud.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.NetworkCloud.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of the trunked network. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the trunked network.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the trunked network.", + SerializedName = @"trunkedNetworkName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("TrunkedNetworkName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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. The value must be an UUID. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription. The value must be an UUID.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription. The value must be an UUID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.ITrunkedNetwork + /// 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.NetworkCloud.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'TrunkedNetworksUpdate' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.TrunkedNetworksUpdateViaJsonString(SubscriptionId, ResourceGroupName, Name, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _jsonString, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public UpdateAzNetworkCloudTrunkedNetwork_UpdateViaJsonString() + { + + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.ITrunkedNetwork + /// 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.NetworkCloud.Models.ITrunkedNetwork + 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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudVirtualMachine_UpdateExpanded.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudVirtualMachine_UpdateExpanded.cs index 0cd5906d2f04..e45a826d1c33 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudVirtualMachine_UpdateExpanded.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudVirtualMachine_UpdateExpanded.cs @@ -6,23 +6,25 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// /// Patch the properties of the provided virtual machine, or update the tags associated with the virtual machine. Properties - /// and tag updates can be done independently. + /// and tag update can be done independently. /// /// /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/virtualMachines/{virtualMachineName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzNetworkCloudVirtualMachine_UpdateExpanded", SupportsShouldProcess = true)] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachine", "15.0.0", "2.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"NetworkAttachment","PlacementHint","SshPublicKey","StorageProfileVolumeAttachment","Volume"}, NewOutputProperties=new string[] {"NetworkAttachment","PlacementHint","SshPublicKey","StorageProfileVolumeAttachment","Volume"}, ChangeDescription="The types of properties will be changed from fixed array to 'List'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachine))] - [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Patch the properties of the provided virtual machine, or update the tags associated with the virtual machine. Properties and tag updates can be done independently.")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachine))] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Patch the properties of the provided virtual machine, or update the tags associated with the virtual machine. Properties and tag update can be done independently.")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/virtualMachines/{virtualMachineName}", ApiVersion = "2025-02-01")] public partial class UpdateAzNetworkCloudVirtualMachine_UpdateExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -38,10 +40,13 @@ public partial class UpdateAzNetworkCloudVirtualMachine_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(); + /// /// VirtualMachinePatchParameters represents the body of the request to patch the virtual machine. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePatchParameters _virtualMachineUpdateParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.VirtualMachinePatchParameters(); + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePatchParameters _virtualMachineUpdateParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.VirtualMachinePatchParameters(); /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] @@ -53,6 +58,9 @@ public partial class UpdateAzNetworkCloudVirtualMachine_UpdateExpanded : global: [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -66,6 +74,9 @@ public partial class UpdateAzNetworkCloudVirtualMachine_UpdateExpanded : global: [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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] @@ -149,7 +160,7 @@ public partial class UpdateAzNetworkCloudVirtualMachine_UpdateExpanded : global: /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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")] @@ -195,7 +206,8 @@ public partial class UpdateAzNetworkCloudVirtualMachine_UpdateExpanded : global: [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -208,8 +220,8 @@ public partial class UpdateAzNetworkCloudVirtualMachine_UpdateExpanded : global: ReadOnly = false, Description = @"The Azure resource tags that will replace the existing ones.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePatchParametersTags) })] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePatchParametersTags Tag { get => _virtualMachineUpdateParametersBody.Tag ?? null /* object */; set => _virtualMachineUpdateParametersBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePatchParametersTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePatchParametersTags Tag { get => _virtualMachineUpdateParametersBody.Tag ?? null /* object */; set => _virtualMachineUpdateParametersBody.Tag = value; } /// The password or token used to access an image in the target repository. [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The password or token used to access an image in the target repository.")] @@ -251,24 +263,24 @@ public partial class UpdateAzNetworkCloudVirtualMachine_UpdateExpanded : 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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IVirtualMachine + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachine /// 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) @@ -381,11 +393,36 @@ 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.NetworkCloud.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -397,10 +434,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -468,7 +521,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -481,12 +534,12 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.VirtualMachinesUpdate(SubscriptionId, ResourceGroupName, Name, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _virtualMachineUpdateParametersBody, onOk, onDefault, this, Pipeline); + await this.Client.VirtualMachinesUpdate(SubscriptionId, ResourceGroupName, Name, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _virtualMachineUpdateParametersBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate); await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null,body=_virtualMachineUpdateParametersBody}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -506,7 +559,7 @@ protected override void StopProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public UpdateAzNetworkCloudVirtualMachine_UpdateExpanded() { @@ -532,12 +585,12 @@ public UpdateAzNetworkCloudVirtualMachine_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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ) { @@ -554,15 +607,15 @@ public UpdateAzNetworkCloudVirtualMachine_UpdateExpanded() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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, IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, body=_virtualMachineUpdateParametersBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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, IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, body=_virtualMachineUpdateParametersBody }) + 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 } }); @@ -572,12 +625,12 @@ public UpdateAzNetworkCloudVirtualMachine_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.NetworkCloud.Models.Api20250201.IVirtualMachine + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachine /// 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 ) { @@ -589,8 +642,9 @@ public UpdateAzNetworkCloudVirtualMachine_UpdateExpanded() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachine - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachine + var result = (await response); + WriteObject(result, false); } } } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudVirtualMachine_UpdateViaIdentityExpanded.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudVirtualMachine_UpdateViaIdentityExpanded.cs index d7202572b065..0f0300a83578 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudVirtualMachine_UpdateViaIdentityExpanded.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudVirtualMachine_UpdateViaIdentityExpanded.cs @@ -6,23 +6,25 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; /// /// Patch the properties of the provided virtual machine, or update the tags associated with the virtual machine. Properties - /// and tag updates can be done independently. + /// and tag update can be done independently. /// /// /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/virtualMachines/{virtualMachineName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzNetworkCloudVirtualMachine_UpdateViaIdentityExpanded", SupportsShouldProcess = true)] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachine", "15.0.0", "2.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"NetworkAttachment","PlacementHint","SshPublicKey","StorageProfileVolumeAttachment","Volume"}, NewOutputProperties=new string[] {"NetworkAttachment","PlacementHint","SshPublicKey","StorageProfileVolumeAttachment","Volume"}, ChangeDescription="The types of properties will be changed from fixed array to 'List'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachine))] - [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Patch the properties of the provided virtual machine, or update the tags associated with the virtual machine. Properties and tag updates can be done independently.")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachine))] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Patch the properties of the provided virtual machine, or update the tags associated with the virtual machine. Properties and tag update can be done independently.")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/virtualMachines/{virtualMachineName}", ApiVersion = "2025-02-01")] public partial class UpdateAzNetworkCloudVirtualMachine_UpdateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -38,10 +40,13 @@ public partial class UpdateAzNetworkCloudVirtualMachine_UpdateViaIdentityExpande /// 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(); + /// /// VirtualMachinePatchParameters represents the body of the request to patch the virtual machine. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePatchParameters _virtualMachineUpdateParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.VirtualMachinePatchParameters(); + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePatchParameters _virtualMachineUpdateParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.VirtualMachinePatchParameters(); /// when specified, runs this cmdlet as a PowerShell job [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] @@ -53,6 +58,9 @@ public partial class UpdateAzNetworkCloudVirtualMachine_UpdateViaIdentityExpande [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -66,6 +74,9 @@ public partial class UpdateAzNetworkCloudVirtualMachine_UpdateViaIdentityExpande [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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] @@ -142,7 +153,7 @@ public partial class UpdateAzNetworkCloudVirtualMachine_UpdateViaIdentityExpande /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,8 +180,8 @@ public partial class UpdateAzNetworkCloudVirtualMachine_UpdateViaIdentityExpande ReadOnly = false, Description = @"The Azure resource tags that will replace the existing ones.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePatchParametersTags) })] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachinePatchParametersTags Tag { get => _virtualMachineUpdateParametersBody.Tag ?? null /* object */; set => _virtualMachineUpdateParametersBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePatchParametersTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachinePatchParametersTags Tag { get => _virtualMachineUpdateParametersBody.Tag ?? null /* object */; set => _virtualMachineUpdateParametersBody.Tag = value; } /// The password or token used to access an image in the target repository. [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The password or token used to access an image in the target repository.")] @@ -212,24 +223,24 @@ public partial class UpdateAzNetworkCloudVirtualMachine_UpdateViaIdentityExpande /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IVirtualMachine + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachine /// 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) @@ -341,11 +352,36 @@ 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.NetworkCloud.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 ; + } case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: { + var data = messageData(); if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) { - var data = messageData(); if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) { var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); @@ -357,10 +393,26 @@ protected override void EndProcessing() return; } } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } break; } } - await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -428,7 +480,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -443,7 +495,7 @@ protected override void ProcessRecord() await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } if (InputObject?.Id != null) { - await this.Client.VirtualMachinesUpdateViaIdentity(InputObject.Id, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _virtualMachineUpdateParametersBody, onOk, onDefault, this, Pipeline); + await this.Client.VirtualMachinesUpdateViaIdentity(InputObject.Id, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _virtualMachineUpdateParametersBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate); } else { @@ -460,13 +512,13 @@ protected override void ProcessRecord() { ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.VirtualMachineName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); } - await this.Client.VirtualMachinesUpdate(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.VirtualMachineName ?? null, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _virtualMachineUpdateParametersBody, onOk, onDefault, this, Pipeline); + await this.Client.VirtualMachinesUpdate(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.VirtualMachineName ?? null, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _virtualMachineUpdateParametersBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate); } await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null,body=_virtualMachineUpdateParametersBody}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -486,7 +538,7 @@ protected override void StopProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public UpdateAzNetworkCloudVirtualMachine_UpdateViaIdentityExpanded() { @@ -512,12 +564,12 @@ public UpdateAzNetworkCloudVirtualMachine_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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ) { @@ -534,15 +586,15 @@ public UpdateAzNetworkCloudVirtualMachine_UpdateViaIdentityExpanded() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, body=_virtualMachineUpdateParametersBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 { IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, body=_virtualMachineUpdateParametersBody }) + 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 } }); @@ -552,12 +604,12 @@ public UpdateAzNetworkCloudVirtualMachine_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.NetworkCloud.Models.Api20250201.IVirtualMachine + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachine /// 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 ) { @@ -569,8 +621,9 @@ public UpdateAzNetworkCloudVirtualMachine_UpdateViaIdentityExpanded() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVirtualMachine - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachine + var result = (await response); + WriteObject(result, false); } } } diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudVirtualMachine_UpdateViaJsonFilePath.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudVirtualMachine_UpdateViaJsonFilePath.cs new file mode 100644 index 000000000000..5398ead81a41 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudVirtualMachine_UpdateViaJsonFilePath.cs @@ -0,0 +1,617 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; + using System; + + /// + /// Patch the properties of the provided virtual machine, or update the tags associated with the virtual machine. Properties + /// and tag update can be done independently. + /// + /// + /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/virtualMachines/{virtualMachineName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzNetworkCloudVirtualMachine_UpdateViaJsonFilePath", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachine))] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Patch the properties of the provided virtual machine, or update the tags associated with the virtual machine. Properties and tag update can be done independently.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/virtualMachines/{virtualMachineName}", ApiVersion = "2025-02-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.NotSuggestDefaultParameterSet] + public partial class UpdateAzNetworkCloudVirtualMachine_UpdateViaJsonFilePath : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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(); + + public global::System.String _jsonString; + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private string _ifMatch; + + /// + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value + /// to prevent accidentally overwriting concurrent changes. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes.", + SerializedName = @"If-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Header)] + public string IfMatch { get => this._ifMatch; set => this._ifMatch = value; } + + /// Backing field for property. + private string _ifNoneMatch; + + /// + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result + /// in error from server as they are not supported. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result in error from server as they are not supported.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result in error from server as they are not supported.", + SerializedName = @"If-None-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Header)] + public string IfNoneMatch { get => this._ifNoneMatch; set => this._ifNoneMatch = 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 _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.NetworkCloud.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.NetworkCloud.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of the virtual machine. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the virtual machine.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the virtual machine.", + SerializedName = @"virtualMachineName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("VirtualMachineName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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. The value must be an UUID. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription. The value must be an UUID.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription. The value must be an UUID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.IVirtualMachine + /// 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.NetworkCloud.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of UpdateAzNetworkCloudVirtualMachine_UpdateViaJsonFilePath + /// + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets.UpdateAzNetworkCloudVirtualMachine_UpdateViaJsonFilePath Clone() + { + var clone = new UpdateAzNetworkCloudVirtualMachine_UpdateViaJsonFilePath(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.Name = this.Name; + clone.IfMatch = this.IfMatch; + clone.IfNoneMatch = this.IfNoneMatch; + clone.JsonFilePath = this.JsonFilePath; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'VirtualMachinesUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.VirtualMachinesUpdateViaJsonString(SubscriptionId, ResourceGroupName, Name, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _jsonString, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public UpdateAzNetworkCloudVirtualMachine_UpdateViaJsonFilePath() + { + + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.IVirtualMachine + /// 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.NetworkCloud.Models.IVirtualMachine + var result = (await response); + WriteObject(result, false); + } + } + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudVirtualMachine_UpdateViaJsonString.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudVirtualMachine_UpdateViaJsonString.cs new file mode 100644 index 000000000000..609ea3d85e34 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudVirtualMachine_UpdateViaJsonString.cs @@ -0,0 +1,613 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; + using System; + + /// + /// Patch the properties of the provided virtual machine, or update the tags associated with the virtual machine. Properties + /// and tag update can be done independently. + /// + /// + /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/virtualMachines/{virtualMachineName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzNetworkCloudVirtualMachine_UpdateViaJsonString", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVirtualMachine))] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Patch the properties of the provided virtual machine, or update the tags associated with the virtual machine. Properties and tag update can be done independently.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/virtualMachines/{virtualMachineName}", ApiVersion = "2025-02-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.NotSuggestDefaultParameterSet] + public partial class UpdateAzNetworkCloudVirtualMachine_UpdateViaJsonString : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private string _ifMatch; + + /// + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value + /// to prevent accidentally overwriting concurrent changes. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes.", + SerializedName = @"If-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Header)] + public string IfMatch { get => this._ifMatch; set => this._ifMatch = value; } + + /// Backing field for property. + private string _ifNoneMatch; + + /// + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result + /// in error from server as they are not supported. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result in error from server as they are not supported.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result in error from server as they are not supported.", + SerializedName = @"If-None-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Header)] + public string IfNoneMatch { get => this._ifNoneMatch; set => this._ifNoneMatch = 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.NetworkCloud.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.NetworkCloud.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of the virtual machine. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the virtual machine.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the virtual machine.", + SerializedName = @"virtualMachineName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("VirtualMachineName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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. The value must be an UUID. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription. The value must be an UUID.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription. The value must be an UUID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.IVirtualMachine + /// 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.NetworkCloud.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of UpdateAzNetworkCloudVirtualMachine_UpdateViaJsonString + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets.UpdateAzNetworkCloudVirtualMachine_UpdateViaJsonString Clone() + { + var clone = new UpdateAzNetworkCloudVirtualMachine_UpdateViaJsonString(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.SubscriptionId = this.SubscriptionId; + clone.ResourceGroupName = this.ResourceGroupName; + clone.Name = this.Name; + clone.IfMatch = this.IfMatch; + clone.IfNoneMatch = this.IfNoneMatch; + clone.JsonString = this.JsonString; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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 ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.DelayBeforePolling: + { + var data = messageData(); + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + else + { + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + int delay = (int)(response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + WriteDebug($"Delaying {delay} seconds before polling."); + for (var now = 0; now < delay; ++now) + { + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, "In progress", "Checking operation status") + { + PercentComplete = now * 100 / delay + }); + await global::System.Threading.Tasks.Task.Delay(1000, token); + } + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'VirtualMachinesUpdate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.VirtualMachinesUpdateViaJsonString(SubscriptionId, ResourceGroupName, Name, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _jsonString, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public UpdateAzNetworkCloudVirtualMachine_UpdateViaJsonString() + { + + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.IVirtualMachine + /// 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.NetworkCloud.Models.IVirtualMachine + var result = (await response); + WriteObject(result, false); + } + } + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudVolume_UpdateExpanded.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudVolume_UpdateExpanded.cs index 73118c284d0e..61bced23751f 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudVolume_UpdateExpanded.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudVolume_UpdateExpanded.cs @@ -6,20 +6,22 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; - /// Update tags associated with the provided volume. + /// update tags associated with the provided volume. /// /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/volumes/{volumeName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzNetworkCloudVolume_UpdateExpanded", SupportsShouldProcess = true)] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolume", "15.0.0", "2.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"AttachedTo"}, NewOutputProperties=new string[] {"AttachedTo"}, ChangeDescription="The type of property will be changed from fixed array to 'List'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolume))] - [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Update tags associated with the provided volume.")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolume))] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"update tags associated with the provided volume.")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/volumes/{volumeName}", ApiVersion = "2025-02-01")] public partial class UpdateAzNetworkCloudVolume_UpdateExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 UpdateAzNetworkCloudVolume_UpdateExpanded : 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; + /// /// VolumePatchParameters represents the body of the request to patch the volume resource. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolumePatchParameters _volumeUpdateParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.VolumePatchParameters(); + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumePatchParameters _volumeUpdateParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.VolumePatchParameters(); /// Wait for .NET debugger to attach [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -58,6 +75,9 @@ public partial class UpdateAzNetworkCloudVolume_UpdateExpanded : global::System. [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 UpdateAzNetworkCloudVolume_UpdateExpanded : global::System. /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,7 +199,8 @@ public partial class UpdateAzNetworkCloudVolume_UpdateExpanded : global::System. [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -192,32 +213,32 @@ public partial class UpdateAzNetworkCloudVolume_UpdateExpanded : global::System. ReadOnly = false, Description = @"The Azure resource tags that will replace the existing ones.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolumePatchParametersTags) })] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolumePatchParametersTags Tag { get => _volumeUpdateParametersBody.Tag ?? null /* object */; set => _volumeUpdateParametersBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumePatchParametersTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumePatchParametersTags Tag { get => _volumeUpdateParametersBody.Tag ?? null /* object */; set => _volumeUpdateParametersBody.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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IVolume + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolume /// 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) @@ -240,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.NetworkCloud.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -304,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.NetworkCloud.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.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -361,7 +412,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -374,12 +425,12 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.VolumesUpdate(SubscriptionId, ResourceGroupName, Name, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _volumeUpdateParametersBody, onOk, onDefault, this, Pipeline); + await this.Client.VolumesUpdate(SubscriptionId, ResourceGroupName, Name, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _volumeUpdateParametersBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate); await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null,body=_volumeUpdateParametersBody}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -399,7 +450,7 @@ protected override void StopProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public UpdateAzNetworkCloudVolume_UpdateExpanded() { @@ -425,12 +476,12 @@ public UpdateAzNetworkCloudVolume_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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ) { @@ -447,15 +498,15 @@ public UpdateAzNetworkCloudVolume_UpdateExpanded() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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, IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, body=_volumeUpdateParametersBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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, IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, body=_volumeUpdateParametersBody }) + 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 } }); @@ -465,12 +516,12 @@ public UpdateAzNetworkCloudVolume_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.NetworkCloud.Models.Api20250201.IVolume + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolume /// 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 ) { @@ -482,8 +533,26 @@ public UpdateAzNetworkCloudVolume_UpdateExpanded() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolume - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolume + 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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudVolume_UpdateViaIdentityExpanded.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudVolume_UpdateViaIdentityExpanded.cs index 35d4506688c0..6116f83c54fc 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudVolume_UpdateViaIdentityExpanded.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudVolume_UpdateViaIdentityExpanded.cs @@ -6,20 +6,22 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; using System; - /// Update tags associated with the provided volume. + /// update tags associated with the provided volume. /// /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/volumes/{volumeName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzNetworkCloudVolume_UpdateViaIdentityExpanded", SupportsShouldProcess = true)] - [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.OutputBreakingChange("Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolume", "15.0.0", "2.0.0", "2025/11/03", DeprecatedOutputProperties=new string[] {"AttachedTo"}, NewOutputProperties=new string[] {"AttachedTo"}, ChangeDescription="The type of property will be changed from fixed array to 'List'.")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolume))] - [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"Update tags associated with the provided volume.")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolume))] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"update tags associated with the provided volume.")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/volumes/{volumeName}", ApiVersion = "2025-02-01")] public partial class UpdateAzNetworkCloudVolume_UpdateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 UpdateAzNetworkCloudVolume_UpdateViaIdentityExpanded : 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; + /// /// VolumePatchParameters represents the body of the request to patch the volume resource. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolumePatchParameters _volumeUpdateParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.VolumePatchParameters(); + private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumePatchParameters _volumeUpdateParametersBody = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.VolumePatchParameters(); /// Wait for .NET debugger to attach [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.ClientAPI; @@ -58,6 +75,9 @@ public partial class UpdateAzNetworkCloudVolume_UpdateViaIdentityExpanded : glob [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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] @@ -126,7 +146,7 @@ public partial class UpdateAzNetworkCloudVolume_UpdateViaIdentityExpanded : glob /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,32 +173,32 @@ public partial class UpdateAzNetworkCloudVolume_UpdateViaIdentityExpanded : glob ReadOnly = false, Description = @"The Azure resource tags that will replace the existing ones.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolumePatchParametersTags) })] - public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolumePatchParametersTags Tag { get => _volumeUpdateParametersBody.Tag ?? null /* object */; set => _volumeUpdateParametersBody.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumePatchParametersTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolumePatchParametersTags Tag { get => _volumeUpdateParametersBody.Tag ?? null /* object */; set => _volumeUpdateParametersBody.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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Models.Api20250201.IVolume + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolume /// 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 +221,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.NetworkCloud.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -265,8 +290,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.NetworkCloud.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.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -322,7 +372,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -337,7 +387,7 @@ protected override void ProcessRecord() await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } if (InputObject?.Id != null) { - await this.Client.VolumesUpdateViaIdentity(InputObject.Id, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _volumeUpdateParametersBody, onOk, onDefault, this, Pipeline); + await this.Client.VolumesUpdateViaIdentity(InputObject.Id, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _volumeUpdateParametersBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate); } else { @@ -354,13 +404,13 @@ protected override void ProcessRecord() { ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.VolumeName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); } - await this.Client.VolumesUpdate(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.VolumeName ?? null, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _volumeUpdateParametersBody, onOk, onDefault, this, Pipeline); + await this.Client.VolumesUpdate(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.VolumeName ?? null, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _volumeUpdateParametersBody, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SerializationMode.IncludeUpdate); } await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null,body=_volumeUpdateParametersBody}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -380,7 +430,7 @@ protected override void StopProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public UpdateAzNetworkCloudVolume_UpdateViaIdentityExpanded() { @@ -406,12 +456,12 @@ public UpdateAzNetworkCloudVolume_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.NetworkCloud.Models.Api50.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 ) { @@ -428,15 +478,15 @@ public UpdateAzNetworkCloudVolume_UpdateViaIdentityExpanded() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, body=_volumeUpdateParametersBody }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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 { IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, body=_volumeUpdateParametersBody }) + 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 } }); @@ -446,12 +496,12 @@ public UpdateAzNetworkCloudVolume_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.NetworkCloud.Models.Api20250201.IVolume + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolume /// 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 ) { @@ -463,8 +513,26 @@ public UpdateAzNetworkCloudVolume_UpdateViaIdentityExpanded() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api20250201.IVolume - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolume + 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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudVolume_UpdateViaJsonFilePath.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudVolume_UpdateViaJsonFilePath.cs new file mode 100644 index 000000000000..026c9d57098d --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudVolume_UpdateViaJsonFilePath.cs @@ -0,0 +1,558 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; + using System; + + /// update tags associated with the provided volume. + /// + /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/volumes/{volumeName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzNetworkCloudVolume_UpdateViaJsonFilePath", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolume))] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"update tags associated with the provided volume.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/volumes/{volumeName}", ApiVersion = "2025-02-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.NotSuggestDefaultParameterSet] + public partial class UpdateAzNetworkCloudVolume_UpdateViaJsonFilePath : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private string _ifMatch; + + /// + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value + /// to prevent accidentally overwriting concurrent changes. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes.", + SerializedName = @"If-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Header)] + public string IfMatch { get => this._ifMatch; set => this._ifMatch = value; } + + /// Backing field for property. + private string _ifNoneMatch; + + /// + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result + /// in error from server as they are not supported. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result in error from server as they are not supported.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result in error from server as they are not supported.", + SerializedName = @"If-None-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Header)] + public string IfNoneMatch { get => this._ifNoneMatch; set => this._ifNoneMatch = 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 _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.NetworkCloud.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.NetworkCloud.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of the volume. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the volume.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the volume.", + SerializedName = @"volumeName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("VolumeName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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. The value must be an UUID. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription. The value must be an UUID.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription. The value must be an UUID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.IVolume + /// 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.NetworkCloud.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'VolumesUpdate' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.VolumesUpdateViaJsonString(SubscriptionId, ResourceGroupName, Name, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _jsonString, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public UpdateAzNetworkCloudVolume_UpdateViaJsonFilePath() + { + + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.IVolume + /// 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.NetworkCloud.Models.IVolume + 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/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudVolume_UpdateViaJsonString.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudVolume_UpdateViaJsonString.cs new file mode 100644 index 000000000000..79038b799a59 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/cmdlets/UpdateAzNetworkCloudVolume_UpdateViaJsonString.cs @@ -0,0 +1,556 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Cmdlets; + using System; + + /// update tags associated with the provided volume. + /// + /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/volumes/{volumeName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzNetworkCloudVolume_UpdateViaJsonString", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IVolume))] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Description(@"update tags associated with the provided volume.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetworkCloud/volumes/{volumeName}", ApiVersion = "2025-02-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.NotSuggestDefaultParameterSet] + public partial class UpdateAzNetworkCloudVolume_UpdateViaJsonString : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.NetworkCloud Client => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private string _ifMatch; + + /// + /// The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value + /// to prevent accidentally overwriting concurrent changes. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The ETag of the transformation. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting concurrent changes.", + SerializedName = @"If-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Header)] + public string IfMatch { get => this._ifMatch; set => this._ifMatch = value; } + + /// Backing field for property. + private string _ifNoneMatch; + + /// + /// Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result + /// in error from server as they are not supported. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result in error from server as they are not supported.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Set to '*' to allow a new record set to be created, but to prevent updating an existing resource. Other values will result in error from server as they are not supported.", + SerializedName = @"If-None-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.ParameterCategory.Header)] + public string IfNoneMatch { get => this._ifNoneMatch; set => this._ifNoneMatch = 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.NetworkCloud.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.NetworkCloud.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of the volume. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the volume.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the volume.", + SerializedName = @"volumeName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("VolumeName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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. The value must be an UUID. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription. The value must be an UUID.")] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription. The value must be an UUID.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Category(global::Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.IVolume + /// 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.NetworkCloud.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'VolumesUpdate' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.VolumesUpdateViaJsonString(SubscriptionId, ResourceGroupName, Name, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null, _jsonString, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,IfNoneMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfNoneMatch") ? IfNoneMatch : null}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public UpdateAzNetworkCloudVolume_UpdateViaJsonString() + { + + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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.NetworkCloud.Models.IVolume + /// 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.NetworkCloud.Models.IVolume + 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/NetworkCloud/NetworkCloud.Autorest/generated/runtime/Attributes/ExternalDocsAttribute.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/runtime/Attributes/ExternalDocsAttribute.cs new file mode 100644 index 000000000000..89038ef4c450 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.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.NetworkCloud +{ + 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/NetworkCloud/NetworkCloud.Autorest/generated/runtime/Attributes/PSArgumentCompleterAttribute.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/runtime/Attributes/PSArgumentCompleterAttribute.cs new file mode 100644 index 000000000000..182a6ea1c48d --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.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.NetworkCloud +{ + 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/NetworkCloud/NetworkCloud.Autorest/generated/runtime/BuildTime/Cmdlets/ExportFormatPs1xml.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/runtime/BuildTime/Cmdlets/ExportFormatPs1xml.cs index ca80a2b7dcc8..f139edef1e88 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/runtime/BuildTime/Cmdlets/ExportFormatPs1xml.cs +++ b/generated/NetworkCloud/NetworkCloud.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.NetworkCloud.Models"; - private const string SupportNamespace = @"Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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/NetworkCloud/NetworkCloud.Autorest/generated/runtime/BuildTime/Cmdlets/ExportModelSurface.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/runtime/BuildTime/Cmdlets/ExportModelSurface.cs index e8ae9ceda78f..f899ca6b4d1c 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/runtime/BuildTime/Cmdlets/ExportModelSurface.cs +++ b/generated/NetworkCloud/NetworkCloud.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.NetworkCloud.Models"; - private const string SupportNamespace = @"Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Support"; + private const string SupportNamespace = @"${$project.supportNamespace.fullName}"; protected override void ProcessRecord() { diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/runtime/BuildTime/Cmdlets/ExportProxyCmdlet.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/runtime/BuildTime/Cmdlets/ExportProxyCmdlet.cs index bc7c2af6315e..ea8da0168d73 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/runtime/BuildTime/Cmdlets/ExportProxyCmdlet.cs +++ b/generated/NetworkCloud/NetworkCloud.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/NetworkCloud/NetworkCloud.Autorest/generated/runtime/BuildTime/Cmdlets/ExportPsd1.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/runtime/BuildTime/Cmdlets/ExportPsd1.cs index 8a394ce677db..dde605e3e860 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/runtime/BuildTime/Cmdlets/ExportPsd1.cs +++ b/generated/NetworkCloud/NetworkCloud.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/NetworkCloud/NetworkCloud.Autorest/generated/runtime/BuildTime/Cmdlets/ExportTestStub.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/runtime/BuildTime/Cmdlets/ExportTestStub.cs index 058b27e4bfb4..53651e49aaee 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/runtime/BuildTime/Cmdlets/ExportTestStub.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/runtime/BuildTime/Cmdlets/ExportTestStub.cs @@ -12,50 +12,96 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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/NetworkCloud/NetworkCloud.Autorest/generated/runtime/BuildTime/MarkdownRenderer.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/runtime/BuildTime/MarkdownRenderer.cs index 9307a558bf80..766a761f7685 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/runtime/BuildTime/MarkdownRenderer.cs +++ b/generated/NetworkCloud/NetworkCloud.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/NetworkCloud/NetworkCloud.Autorest/generated/runtime/BuildTime/Models/PsHelpTypes.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/runtime/BuildTime/Models/PsHelpTypes.cs index ffb6530b7652..6074831c3356 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/runtime/BuildTime/Models/PsHelpTypes.cs +++ b/generated/NetworkCloud/NetworkCloud.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/NetworkCloud/NetworkCloud.Autorest/generated/runtime/BuildTime/Models/PsMarkdownTypes.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/runtime/BuildTime/Models/PsMarkdownTypes.cs index 8349ccf8eb33..a992b8fc91e6 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/runtime/BuildTime/Models/PsMarkdownTypes.cs +++ b/generated/NetworkCloud/NetworkCloud.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/NetworkCloud/NetworkCloud.Autorest/generated/runtime/BuildTime/Models/PsProxyOutputs.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/runtime/BuildTime/Models/PsProxyOutputs.cs index 4f6e8f31846e..587c84b5ea47 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/runtime/BuildTime/Models/PsProxyOutputs.cs +++ b/generated/NetworkCloud/NetworkCloud.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.NetworkCloud.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.NetworkCloud.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.NetworkCloud.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/NetworkCloud/NetworkCloud.Autorest/generated/runtime/BuildTime/Models/PsProxyTypes.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/runtime/BuildTime/Models/PsProxyTypes.cs index 92924d96b660..a871cf4214ba 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/runtime/BuildTime/Models/PsProxyTypes.cs +++ b/generated/NetworkCloud/NetworkCloud.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/NetworkCloud/NetworkCloud.Autorest/generated/runtime/BuildTime/PsAttributes.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/runtime/BuildTime/PsAttributes.cs index d5d755ec2a8c..61ce9cbe0b40 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/runtime/BuildTime/PsAttributes.cs +++ b/generated/NetworkCloud/NetworkCloud.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/NetworkCloud/NetworkCloud.Autorest/generated/runtime/BuildTime/PsExtensions.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/runtime/BuildTime/PsExtensions.cs index 37793c3b1b2b..671edb008a67 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/runtime/BuildTime/PsExtensions.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/runtime/BuildTime/PsExtensions.cs @@ -13,6 +13,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PowerShell { 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/NetworkCloud/NetworkCloud.Autorest/generated/runtime/BuildTime/PsHelpers.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/runtime/BuildTime/PsHelpers.cs index f6046fd27178..882a6fccb331 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/runtime/BuildTime/PsHelpers.cs +++ b/generated/NetworkCloud/NetworkCloud.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/NetworkCloud/NetworkCloud.Autorest/generated/runtime/Context.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/runtime/Context.cs new file mode 100644 index 000000000000..91de35710c1b --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.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.NetworkCloud.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.NetworkCloud.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.NetworkCloud.NetworkCloud Client { get; } + } +} diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/runtime/Events.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/runtime/Events.cs index dbb19831886c..c3ecd88a2424 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/runtime/Events.cs +++ b/generated/NetworkCloud/NetworkCloud.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/NetworkCloud/NetworkCloud.Autorest/generated/runtime/ISendAsync.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/runtime/ISendAsync.cs index 15bbaf211941..2d8f2301bd4a 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/runtime/ISendAsync.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/runtime/ISendAsync.cs @@ -11,6 +11,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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/NetworkCloud/NetworkCloud.Autorest/generated/runtime/InfoAttribute.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/runtime/InfoAttribute.cs index c4cf1acbbe13..a041ec3cddf8 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/runtime/InfoAttribute.cs +++ b/generated/NetworkCloud/NetworkCloud.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/NetworkCloud/NetworkCloud.Autorest/generated/runtime/InputHandler.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/runtime/InputHandler.cs new file mode 100644 index 000000000000..55e8ba68c774 --- /dev/null +++ b/generated/NetworkCloud/NetworkCloud.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.NetworkCloud.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.NetworkCloud.Runtime.IContext context); + } +} \ No newline at end of file diff --git a/generated/NetworkCloud/NetworkCloud.Autorest/generated/runtime/MessageAttribute.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/runtime/MessageAttribute.cs index 9185fc4a352b..5e06ea99463b 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/runtime/MessageAttribute.cs +++ b/generated/NetworkCloud/NetworkCloud.Autorest/generated/runtime/MessageAttribute.cs @@ -16,9 +16,12 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.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.NetworkCloud" : @""; + //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/NetworkCloud/NetworkCloud.Autorest/generated/runtime/Nodes/Collections/XNodeArray.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/runtime/Nodes/Collections/XNodeArray.cs index 8ca1c7707b4d..18e83274e215 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/runtime/Nodes/Collections/XNodeArray.cs +++ b/generated/NetworkCloud/NetworkCloud.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/NetworkCloud/NetworkCloud.Autorest/generated/runtime/Properties/Resources.resx b/generated/NetworkCloud/NetworkCloud.Autorest/generated/runtime/Properties/Resources.resx index a08a2e50172b..4ef90b70573d 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/runtime/Properties/Resources.resx +++ b/generated/NetworkCloud/NetworkCloud.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/NetworkCloud/NetworkCloud.Autorest/generated/runtime/SerializationMode.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/runtime/SerializationMode.cs index 643e2dc5560c..c6b946b88e3e 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/runtime/SerializationMode.cs +++ b/generated/NetworkCloud/NetworkCloud.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/NetworkCloud/NetworkCloud.Autorest/generated/runtime/TypeConverterExtensions.cs b/generated/NetworkCloud/NetworkCloud.Autorest/generated/runtime/TypeConverterExtensions.cs index 71532097812b..625eb78975c8 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/generated/runtime/TypeConverterExtensions.cs +++ b/generated/NetworkCloud/NetworkCloud.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/NetworkCloud/NetworkCloud.Autorest/internal/Get-AzNetworkCloudOperation.ps1 b/generated/NetworkCloud/NetworkCloud.Autorest/internal/Get-AzNetworkCloudOperation.ps1 index 89f6bdddc905..8821879f7b2a 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/internal/Get-AzNetworkCloudOperation.ps1 +++ b/generated/NetworkCloud/NetworkCloud.Autorest/internal/Get-AzNetworkCloudOperation.ps1 @@ -27,12 +27,12 @@ It contains a URL link to get the next set of results. {{ Add code here }} .Outputs -Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IOperation +Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperation .Link https://learn.microsoft.com/powershell/module/az.networkcloud/get-aznetworkcloudoperation #> function Get-AzNetworkCloudOperation { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IOperation])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperation])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter()] @@ -91,12 +91,18 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } $mapping = @{ List = 'Az.NetworkCloud.private\Get-AzNetworkCloudOperation_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/NetworkCloud/NetworkCloud.Autorest/internal/ProxyCmdletDefinitions.ps1 b/generated/NetworkCloud/NetworkCloud.Autorest/internal/ProxyCmdletDefinitions.ps1 index 89f6bdddc905..8821879f7b2a 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/internal/ProxyCmdletDefinitions.ps1 +++ b/generated/NetworkCloud/NetworkCloud.Autorest/internal/ProxyCmdletDefinitions.ps1 @@ -27,12 +27,12 @@ It contains a URL link to get the next set of results. {{ Add code here }} .Outputs -Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IOperation +Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperation .Link https://learn.microsoft.com/powershell/module/az.networkcloud/get-aznetworkcloudoperation #> function Get-AzNetworkCloudOperation { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.Api50.IOperation])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Models.IOperation])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter()] @@ -91,12 +91,18 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.NetworkCloud.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } $mapping = @{ List = 'Az.NetworkCloud.private\Get-AzNetworkCloudOperation_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/NetworkCloud/NetworkCloud.Autorest/test-module.ps1 b/generated/NetworkCloud/NetworkCloud.Autorest/test-module.ps1 index 7da340d13331..1a3370899fa9 100644 --- a/generated/NetworkCloud/NetworkCloud.Autorest/test-module.ps1 +++ b/generated/NetworkCloud/NetworkCloud.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-------------'